1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

- 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 :)
This commit is contained in:
Peter Pentchev 2004-07-26 12:48:44 +00:00
parent c42f1611e8
commit 648cd0ea13
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=114770
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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"