aboutsummaryrefslogtreecommitdiff
path: root/sysutils/daemontools
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2002-01-28 19:37:14 +0000
committerPeter Pentchev <roam@FreeBSD.org>2002-01-28 19:37:14 +0000
commit51aa7990519ecf792be47c8af164f60da0554330 (patch)
tree5084b71221358b7a62dd015a39e27109450c41a1 /sysutils/daemontools
parentcc5ab47cf6cfc745fd33c428794464433c3c2f0e (diff)
downloadports-51aa7990519ecf792be47c8af164f60da0554330.tar.gz
ports-51aa7990519ecf792be47c8af164f60da0554330.zip
Tweak the startup script so that it is *really* a FreeBSD startup
script; that is, add 'start|stop' argument processing and the ability to actually stop the script. Bump PORTREVISION to indicate a functionality change - or rather, to indicate a change that actually makes this a FreeBSD port.. Final push by: Dan Langille <dan@langille.org> in a somewhat unrelated e-mail exchange Obtained from: a svscan SysV init script that I somehow managed to lose the source and URL for :(
Notes
Notes: svn path=/head/; revision=53924
Diffstat (limited to 'sysutils/daemontools')
-rw-r--r--sysutils/daemontools/Makefile1
-rw-r--r--sysutils/daemontools/files/svscan.sh.sample33
2 files changed, 31 insertions, 3 deletions
diff --git a/sysutils/daemontools/Makefile b/sysutils/daemontools/Makefile
index 7bc4107b6f5b..72d73f35d95c 100644
--- a/sysutils/daemontools/Makefile
+++ b/sysutils/daemontools/Makefile
@@ -7,6 +7,7 @@
PORTNAME= daemontools
PORTVERSION= 0.76
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://cr.yp.to/daemontools/ \
ftp://cr.yp.to/daemontools/
diff --git a/sysutils/daemontools/files/svscan.sh.sample b/sysutils/daemontools/files/svscan.sh.sample
index 8f2311317402..71fad0fed167 100644
--- a/sysutils/daemontools/files/svscan.sh.sample
+++ b/sysutils/daemontools/files/svscan.sh.sample
@@ -1,6 +1,12 @@
#!/bin/sh
-# Surely advice you to enable some of the below
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+# It would really, really be a Good Thing(tm)
+# for you to enable some of the below
# control variables and the apropriate ulimit.
# These are only examples.
# Furthermore, you should think about additional
@@ -31,5 +37,26 @@
#ulimit -s ${MINSEGMENT}
#ulimit -u ${MAXCHILD}
-exec /bin/csh -cf '/usr/local/bin/svscan /var/service |& '\
-'/usr/local/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &'
+KILLALL=/usr/bin/killall
+SVC=${PREFIX}/bin/svc
+SVPROC=svscan
+SVSCAN=$PREFIX/bin/svscan
+READPROCTITLE=$PREFIX/bin/readproctitle
+SVDIR=/var/service
+
+case "$1" in
+ start)
+ echo -n " svscan"
+ exec env PATH=$PREFIX/sbin:$PREFIX/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH /bin/csh -cf "$SVSCAN $SVDIR |& $READPROCTITLE service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null
+ ;;
+
+ stop)
+ echo -n " svscan: "
+ $KILLALL $SVPROC
+ $SVC -dx $SVDIR/* $SVDIR/*/log
+ ;;
+
+ *)
+ echo "Usage: $0 start | stop"
+ ;;
+esac