Index: GIDs =================================================================== --- GIDs +++ GIDs @@ -219,7 +219,7 @@ haclient:*:275: frontbase:*:276: # free: 277 -# free: 278 +rtg:*:278: mrtg:*:279: xymon:*:280: prelude:*:281: Index: UIDs =================================================================== --- UIDs +++ UIDs @@ -224,7 +224,7 @@ hacluster:*:275:275::0:0:Heartbeat cluster user:/nonexistent:/usr/sbin/nologin frontbase:*:276:276::0:0:FrontBase Daemon:/usr/local/FrontBase/Databases:/bin/sh # free: 277 -# free: 278 +rtg:*:278:278::0:0:RTG daemon:/nonexistent:/usr/sbin/nologin mrtg:*:279:279::0:0:MRTG daemon:/nonexistent:/usr/sbin/nologin xymon:*:280:280::0:0:Xymon Monitor:/nonexistent:/usr/sbin/nologin prelude:*:281:281::0:0:Prelude user:/nonexistent:/usr/sbin/nologin Index: net/rtg/Makefile =================================================================== --- net/rtg/Makefile +++ net/rtg/Makefile @@ -3,7 +3,7 @@ PORTNAME= rtg PORTVERSION= 0.7.4 -PORTREVISION= 12 +PORTREVISION= 13 CATEGORIES= net MASTER_SITES= SF \ ftp://ftpmirror.uk/freebsd-ports/rtg/ @@ -29,6 +29,10 @@ CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc/${PORTNAME} \ --with-mysql=${LOCALBASE} \ --with-snmp=${LOCALBASE} + +USERS= rtg +GROUPS= rtg + OPTIONS_DEFINE= WEB MYSQL OPTIONS_DEFAULT=WEB MYSQL_DESC= Pull MySQL server in as a dependancy for local setups Index: net/rtg/files/rtgpoll.in =================================================================== --- net/rtg/files/rtgpoll.in +++ net/rtg/files/rtgpoll.in @@ -21,7 +21,8 @@ name="rtgpoll" rcvar=rtgpoll_enable -command=%%PREFIX%%/bin/${name} +cmd=%%PREFIX%%/bin/${name} +command="/usr/sbin/daemon" load_rc_config $name @@ -29,10 +30,25 @@ : ${rtgpoll_config="%%PREFIX%%/etc/rtg/rtg.conf"} : ${rtgpoll_targets="%%PREFIX%%/etc/rtg/targets.cfg"} : ${rtgpoll_pidfile="/var/run/${name}.pid"} +: ${rtgpoll_user="rtg"} +: ${rtgpoll_group="rtg"} required_files="$rtgpoll_targets" -command_args="-p $rtgpoll_pidfile -c $rtgpoll_config -t $rtgpoll_targets &" +command_args="-f -p $rtgpoll_pidfile $cmd -c $rtgpoll_config -t $rtgpoll_targets" + +start_precmd="rtgpoll_prestart" + +rtgpoll_prestart() { + if [ ! -e "${rtgpoll_pidfile}" ]; then + touch $rtgpoll_pidfile + fi + + chown "${rtgpoll_user}:${rtgpoll_group}" "$rtgpoll_pidfile" + chmod 640 "$rtgpoll_pidfile" + chown -R "${rtgpoll_user}:${rtgpoll_group}" "%%PREFIX%%/etc/rtg" + chmod -R u+rwX,g+rX "%%PREFIX%%/etc/rtg" +} run_rc_command "$1"