diff options
author | roam <roam@FreeBSD.org> | 2004-07-26 20:48:44 +0800 |
---|---|---|
committer | roam <roam@FreeBSD.org> | 2004-07-26 20:48:44 +0800 |
commit | 874147a67222dbf5a06894a3f33d2d75a9fb86b8 (patch) | |
tree | 8c5991a428d78ce3d0c13fc7f7d998ed3d9d7b62 /sysutils | |
parent | 194a38fb53b2ca254d2e1b9b8d41c0caca7216e7 (diff) | |
download | freebsd-ports-gnome-874147a67222dbf5a06894a3f33d2d75a9fb86b8.tar.gz freebsd-ports-gnome-874147a67222dbf5a06894a3f33d2d75a9fb86b8.tar.zst freebsd-ports-gnome-874147a67222dbf5a06894a3f33d2d75a9fb86b8.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 :)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/daemontools/Makefile | 4 | ||||
-rw-r--r-- | sysutils/daemontools/files/svscan.sh.sample | 10 |
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" |