aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2004-07-26 12:48:44 +0000
committerPeter Pentchev <roam@FreeBSD.org>2004-07-26 12:48:44 +0000
commit648cd0ea137558490459322896a2c378fc7347d2 (patch)
treed781f92e70cf6fcd8b63996455ae064ab41135c2 /sysutils
parentc42f1611e87324a02918e4238258b9b90f2fa544 (diff)
downloadports-648cd0ea137558490459322896a2c378fc7347d2.tar.gz
ports-648cd0ea137558490459322896a2c378fc7347d2.zip
- make this script work with the New World Order in /etc/rc.d/localpkg,
where the config files may have been loaded already and our load_rc_config invocation may do nothing: thus, we need to honor any previously set value of svscan_enable; - for some reason svscan_stop_post() does not like the IFS-like vars set by rc.subr and localpkg; use find/xargs instead of having the shell parse its own output; - dequote COMMENT; - fix the daemon(8)-ization by moving 2>&1 to its proper place, so that the errors from svscan are actually picked up by readproctitle, as explained in <20040630175050.GD979@straylight.m.ringlet.net>; - move the 'Starting svscan' message to its proper place, so that the PATH set by env(1) affects svscan, not the echo command :)
Notes
Notes: svn path=/head/; revision=114770
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/daemontools/Makefile4
-rw-r--r--sysutils/daemontools/files/svscan.sh.sample10
2 files changed, 7 insertions, 7 deletions
diff --git a/sysutils/daemontools/Makefile b/sysutils/daemontools/Makefile
index 9d4b248e4622..72f54a289704 100644
--- a/sysutils/daemontools/Makefile
+++ b/sysutils/daemontools/Makefile
@@ -7,14 +7,14 @@
PORTNAME= daemontools
PORTVERSION= 0.76
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= sysutils
MASTER_SITES= http://cr.yp.to/daemontools/ \
ftp://cr.yp.to/daemontools/
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= roam@FreeBSD.org
-COMMENT= "Service monitoring and logging utilities by djb"
+COMMENT= Service monitoring and logging utilities by djb
.if !defined(WITHOUT_MAN)
MANDATE= -20010714
diff --git a/sysutils/daemontools/files/svscan.sh.sample b/sysutils/daemontools/files/svscan.sh.sample
index f321d1dff8cc..7516fe93c851 100644
--- a/sysutils/daemontools/files/svscan.sh.sample
+++ b/sysutils/daemontools/files/svscan.sh.sample
@@ -49,8 +49,8 @@
name="svscan"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/svscan"
-svscan_enable="NO"
-svscan_servicedir="%%SERVICEDIR%%"
+svscan_enable=${svscan_enable-"NO"}
+svscan_servicedir=${svscan_servicedir-"/var/service"}
start_cmd="svscan_start"
stop_postcmd="svscan_stop_post"
@@ -60,15 +60,15 @@ load_rc_config $name
required_dirs="${svscan_servicedir}"
svscan_start () {
+ echo "Starting svscan."
/usr/bin/env \
PATH=%%PREFIX%%/sbin:%%PREFIX%%/bin:/usr/sbin:/usr/bin:/sbin:/bin \
- /usr/sbin/daemon -f /bin/sh -c "$command $svscan_servicedir | %%PREFIX%%/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ 2>&1 &"
- echo "Starting svscan."
+ /usr/sbin/daemon -f /bin/sh -c "$command $svscan_servicedir 2>&1 | %%PREFIX%%/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &"
}
svscan_stop_post () {
echo "Stopping svscan."
- %%PREFIX%%/bin/svc -dx `/bin/ls -d $svscan_servicedir/* $svscan_servicedir/*/log 2>/dev/null`
+ find -L "$svscan_servicedir" -maxdepth 2 -type d \( -depth 1 -or \( -depth 2 -name 'log' \) \) -print0 | xargs -0 %%PREFIX%%/bin/svc -dx
}
run_rc_command "$1"