ports/107818: [maintainer update] net-mgmt/netmond
Viktor Fomichev
vfom at narod.ru
Thu Jan 11 11:50:13 UTC 2007
>Number: 107818
>Category: ports
>Synopsis: [maintainer update] net-mgmt/netmond
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 11 11:50:12 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Viktor Fomichev
>Release: FreeBSD 5.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD ipsec.sicex.ru 5.5-STABLE FreeBSD 5.5-STABLE #0: Mon Aug 28 16:29:27 NOVST 2006 vfom at ipsec.sicex.ru:/usr/src/sys/i386/compile/LORD i386
>Description:
This is update for net-mgmt/netmond port.
Please, replace current port.
>How-To-Repeat:
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# netmond
# netmond/files
# netmond/files/netmond.sh.in
# netmond/files/netmond_watchdog.in
# netmond/files/netmondctl.in
# netmond/files/pkg-message.in
# netmond/Makefile
# netmond/pkg-descr
# netmond/pkg-install
# netmond/pkg-deinstall
# netmond/distinfo
#
echo c - netmond
mkdir -p netmond > /dev/null 2>&1
echo c - netmond/files
mkdir -p netmond/files > /dev/null 2>&1
echo x - netmond/files/netmond.sh.in
sed 's/^X//' >netmond/files/netmond.sh.in << 'END-of-netmond/files/netmond.sh.in'
X#!/bin/sh
X
X# $FreeBSD: ports/net-mgmt/netmond/files/netmond.sh.in,v 1.1 2006/11/29 13:29:09 rafan Exp $
X
X# PROVIDE: netmond
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: FreeBSD shutdown
X#
X# Define these netmond_* variables in one of these files:
X# /etc/rc.conf
X# /etc/rc.conf.local
X# /etc/rc.conf.d/netmond
X#
X
X. %%RC_SUBR%%
X
Xname="netmond"
Xrcvar=`set_rcvar`
X
Xcommand="%%PREFIX%%/sbin/${name}"
Xpidfile="/var/run/${name}.pid"
Xrequired_files="%%PREFIX%%/etc/${name}.conf"
X
Xstop_postcmd="netmond_poststop"
X
Xnetmond_poststop() {
X /bin/rm -f ${pidfile}
X}
X
Xload_rc_config $name
X
X: ${netmond_enable="NO"}
X
Xrun_rc_command "$1"
END-of-netmond/files/netmond.sh.in
echo x - netmond/files/netmond_watchdog.in
sed 's/^X//' >netmond/files/netmond_watchdog.in << 'END-of-netmond/files/netmond_watchdog.in'
X#!/bin/sh
X
XPATH=/bin:/usr/bin
Xexport PATH
Xpidfile=/var/run/netmond.pid
Xconfig=%%PREFIX%%/etc/netmond.conf
X
Xwhile : ; do
X if [ -r $pidfile ] && kill -0 `cat $pidfile` >/dev/null 2>&1 ; then
X # echo "Netmond Running"
X else
X # echo "Netmond failed"
X logger -p daemon.err -t netmond_watchdog "Netmond failed. Restarting..."
X rm -f ${pidfile}
X %%PREFIX%%/sbin/netmond -c ${config}
X fi
X sleep 10
Xdone
END-of-netmond/files/netmond_watchdog.in
echo x - netmond/files/netmondctl.in
sed 's/^X//' >netmond/files/netmondctl.in << 'END-of-netmond/files/netmondctl.in'
X#!/bin/sh
X#
X# The exit codes returned are:
X# 0 - operation completed successfully
X# 1 - some error
X# 2 - usage error
X#
X#
X# the path to your NETMOND binary, including options if necessary
XNETMOND=%%PREFIX%%/sbin/netmond
XPIDFILE=/var/run/netmond.pid
X#
X# config file (default is "/usr/local/etc/netmond.conf")
X#
XTTT=X$2
Xif [ $TTT = "X" ]
Xthen
X CONFIG=""
Xelse
X CONFIG="-c $2"
X CFILE=$2
Xfi
X
X
XERROR=0
X
Xcase $1 in
Xstart)
X if [ -r $PIDFILE ] ; then
X PID=`cat $PIDFILE`
X if kill -0 $PID ;then
X echo "$0 $1: netmond (pid $PID) already running."
X exit 0;
X fi
X fi
X if $NETMOND -C $CONFIG >/dev/null 2>&1 ; then
X if $NETMOND $CONFIG ; then
X echo "$0 $1: netmond started"
X else
X echo "$0 $1: netmond could not be started"
X ERROR=1
X fi
X else
X echo "$0 $1: configuration broken, ignoring start"
X echo "$0 $1: (run 'netmond -C' for details)"
X ERROR=1
X fi
X ;;
Xstop)
X if [ ! -r $PIDFILE ] ; then
X exit 0
X fi
X PID=`cat $PIDFILE`
X if kill $PID ; then
X echo "$0 $1: netmond stopped"
X else
X echo "$0 $1: netmond could not be stopped"
X ERROR=1
X fi
X ;;
Xrestart)
X if [ ! -r $PIDFILE ] ; then
X echo "$0 $1: netmond not running, trying to start"
X if $NETMOND $CONFIG ; then
X echo "$0 $ARG: netmond started"
X else
X echo "$0 $ARG: netmond could not be started"
X ERROR=1
X fi
X else
X PID=`cat $PIDFILE`
X if $NETMOND -C $CONFIG >/dev/null 2>&1 ; then
X if kill -HUP $PID ; then
X echo "$0 $1: netmond restarted"
X else
X echo "$0 $1: netmond could not be restarted"
X ERROR=1
X fi
X else
X echo "$0 $1: configuration broken, ignoring restart"
X echo "$0 $1: (run 'netmond -C' for details)"
X ERROR=1
X fi
X fi
X ;;
X *)
X echo "usage: $0 start|stop|restart"
X cat <<EOF
X
Xstart - start netmond (or do nothing if running)
Xstop - stop netmond
Xrestart - restart netmond if running by sending a SIGHUP or start if
X not running
X
X
XEOF
X ERROR=
X ;;
Xesac
X
Xexit $ERROR
X
END-of-netmond/files/netmondctl.in
echo x - netmond/files/pkg-message.in
sed 's/^X//' >netmond/files/pkg-message.in << 'END-of-netmond/files/pkg-message.in'
X######################################################################
X
X Attention!
X
X You need to create a configuration file netmond.conf
X in directory %%PREFIX%%/etc prior to launch netmond.
X
X Look at %%PREFIX%%/share/doc/netmond/ for the configuration guide
X or try to use net-mgmt/tknetmon to create configuration semiautomatically.
X
X######################################################################
END-of-netmond/files/pkg-message.in
echo x - netmond/Makefile
sed 's/^X//' >netmond/Makefile << 'END-of-netmond/Makefile'
X# New ports collection makefile for: netmond
X# Date created: 2004 Mar 30
X# Whom: vfom at narod.ru
X#
X# $FreeBSD: ports/net-mgmt/netmond/Makefile,v 1.6 2006/11/29 13:29:09 rafan Exp $
X#
X
XPORTNAME= netmond
XPORTVERSION= 2.2b6
XPORTREVISION= 4
XCATEGORIES= net-mgmt
XMASTER_SITES= ftp://ftp.risp.ru/pub/RinetSoftware/
XDISTNAME= netmond-2.2-b6
XEXTRACT_SUFX= .tgz
X
XPATCH_SITES= http://vfom.narod.ru/download/
XPATCH_VERSION= 1
XPATCHFILES= ${DISTNAME}.patch${PATCH_VERSION}${EXTRACT_SUFX} ${DISTNAME}.docs${EXTRACT_SUFX}
X
XMAINTAINER= vfom at narod.ru
XCOMMENT= Netmond - IP network monitoring daemon
X
X#MK_IFGRAPH= yes
X
X.if defined(MK_IFGRAPH)
XLIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd
X.else
XCONFIGURE_ARGS= --without-ifgraph
X.endif
X
XGNU_CONFIGURE= yes
XUSE_BISON= yes
X
XBINOWN= root
XBINGRP= netmon
XBINMODE= 0550
X
XPLIST_FILES= sbin/netmond sbin/netmond_watchdog sbin/netmondctl \
X etc/netmond.conf.sample
X.if defined(MK_IFGRAPH)
XPLIST_FILES+= sbin/ifgraph
X.endif
X
XUSE_RC_SUBR= netmond.sh
X
XSUB_FILES+= pkg-message netmond_watchdog netmondctl
X
XPORTDOCS= README README.ru CHANGES README.port.eng README.port.ru index.html netmond.css en/ ru/
X
Xpost-extract:
X ${TAR} -zxf ${DISTDIR}/${DISTNAME}.patch${PATCH_VERSION}${EXTRACT_SUFX} -C ${PATCHDIR}
X ${CP} ${FILESDIR}/pipe.c ${WRKSRC}
X
Xdo-install:
X @if pw user show netmon 2>/dev/null ; then \
X ${ECHO} "User 'netmon' exists." ; \
X else \
X pw useradd -n netmon -g wheel -c 'Network monitor account' -s /usr/sbin/nologin ; \
X fi
X @if pw group show ${BINGRP} 2>/dev/null ; then \
X ${ECHO} "Group '${BINGRP}' exists." ; \
X else \
X pw groupadd ${BINGRP} -M root,netmon ; \
X fi
X ${INSTALL_PROGRAM} ${WRKSRC}/netmond ${PREFIX}/sbin/netmond
X.if defined(MK_IFGRAPH)
X ${INSTALL_PROGRAM} ${WRKSRC}/ifgraph ${PREFIX}/sbin/ifgraph
X.endif
X ${INSTALL_SCRIPT} ${WRKDIR}/netmond_watchdog ${PREFIX}/sbin/netmond_watchdog
X ${INSTALL_SCRIPT} ${WRKDIR}/netmondctl ${PREFIX}/sbin/netmondctl
X ${INSTALL_DATA} ${WRKSRC}/netmon.conf.sample ${PREFIX}/etc/netmond.conf.sample
X ${CHMOD} u+s ${PREFIX}/sbin/netmond
X.if !defined(NOPORTDOCS)
X ${MKDIR} ${DOCSDIR}
X ${CHMOD} 755 ${DOCSDIR}
X ${TAR} -zxf ${DISTDIR}/${DISTNAME}.docs${EXTRACT_SUFX} -C ${DOCSDIR}
X.endif
X
Xpost-install:
X ${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-netmond/Makefile
echo x - netmond/pkg-descr
sed 's/^X//' >netmond/pkg-descr << 'END-of-netmond/pkg-descr'
XNETwork MONitoring Dealer - IP network monitoring daemon.
XCan check hosts availability (via ICMP ping), collect SNMP counters,
Xcheck simple TCP/UDP services (with internal chat), handle SNMP traps.
X
XGUI frontends exist for netmond:
X - net-mgmt/tknetmon ( tcl/tk )
X - ftp://ftp.risp.ru/RinetSoft/netmond-spyboat-0.5.tgz ( with QT )
X
XWWW: http://soft.risp.ru/netmond/
END-of-netmond/pkg-descr
echo x - netmond/pkg-install
sed 's/^X//' >netmond/pkg-install << 'END-of-netmond/pkg-install'
X#!/bin/sh
X#
XPKGNAME=$1
XDATADIR=/var/netmon
X#
Xcase $2 in
X PRE-INSTALL)
X if pw user show netmon 2>/dev/null ; then
X echo "User 'netmon' exists." ;
X else
X pw useradd -n netmon -g wheel -c 'Network monitor account' -s /usr/sbin/nologin ;
X fi
X if pw group show netmon 2>/dev/null ; then
X echo "Group 'netmon' exists." ;
X else
X pw groupadd netmon -M root,netmon ;
X fi
X if [ ! -d ${DATADIR} ] ; then
X mkdir ${DATADIR}
X chown root:netmon ${DATADIR}
X chmod 750 ${DATADIR}
X fi
X ;;
X POST-INSTALL)
X ;;
X *)
X echo "Unexpected Argument $2!!!"
X exit 1
X ;;
Xesac
Xexit 0
END-of-netmond/pkg-install
echo x - netmond/pkg-deinstall
sed 's/^X//' >netmond/pkg-deinstall << 'END-of-netmond/pkg-deinstall'
X#!/bin/sh
X#
XPKGNAME=$1
X#
Xcase $2 in
X DEINSTALL)
X ;;
X POST-DEINSTALL)
X echo ""
X echo "If you wish to remove this port from your computer complete,"
X echo "remove user 'netmon' and group 'netmon' manually."
X echo ""
X ;;
X *)
X echo "Unexpected Argument $2!!!"
X exit 1
X ;;
Xesac
Xexit 0
END-of-netmond/pkg-deinstall
echo x - netmond/distinfo
sed 's/^X//' >netmond/distinfo << 'END-of-netmond/distinfo'
XMD5 (netmond-2.2-b6.tgz) = 87e324702e60d1c4e1a83ae3649c1488
XSHA256 (netmond-2.2-b6.tgz) = 2b31096f731e347b65ce2c2a11f1ce70af0d8d7a9ff0c49edf4b3c3b65d0befd
XSIZE (netmond-2.2-b6.tgz) = 264500
XMD5 (netmond-2.2-b6.patch1.tgz) = c19002459fe22c64684e922c9829f24b
XSHA256 (netmond-2.2-b6.patch1.tgz) = 0fa7aae8dcfce5ba735af2ec0dfd3fc7a7d4e991cf2dc331ed6714e3ad9d08e5
XSIZE (netmond-2.2-b6.patch1.tgz) = 18574
XMD5 (netmond-2.2-b6.docs.tgz) = a92919c3ae22b75aa081fe5cc10fc72b
XSHA256 (netmond-2.2-b6.docs.tgz) = 4cdad1003455c99ee1d3067a4db7a01f1db11247d2d5fe683c384f6d05ed79e8
XSIZE (netmond-2.2-b6.docs.tgz) = 110692
END-of-netmond/distinfo
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list