aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2007-10-30 18:49:16 +0800
committerroam <roam@FreeBSD.org>2007-10-30 18:49:16 +0800
commit2e819b9fe5e779a6b33a91fea237517dd6b92571 (patch)
treed3d3f9c6efc6d03fe0c99b94680aa9f7561f7a6b /sysutils
parent8fa5ba4a5253bf74b5ed4ac97e37cc533f566286 (diff)
downloadfreebsd-ports-gnome-2e819b9fe5e779a6b33a91fea237517dd6b92571.tar.gz
freebsd-ports-gnome-2e819b9fe5e779a6b33a91fea237517dd6b92571.tar.zst
freebsd-ports-gnome-2e819b9fe5e779a6b33a91fea237517dd6b92571.zip
Add a knob to disable the run-time testsuite, e.g. when building with
a NFS-mounted work directory (prompted by PR 115100). Add support for logging through multilog instead of readproctitle for the main svscan process and document the startup script variables (loosely based on PR 111749). PR: 111749, 115100 Submitted by: Andrew Hammond<andrew.george.hammond@gmail.com>, Charles Sprickman <spork@bway.net>
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/daemontools/Makefile7
-rw-r--r--sysutils/daemontools/files/rts-skip.patch11
-rw-r--r--sysutils/daemontools/files/svscan.sh.sample38
3 files changed, 50 insertions, 6 deletions
diff --git a/sysutils/daemontools/Makefile b/sysutils/daemontools/Makefile
index cdedc2ee4214..b7c037affb9b 100644
--- a/sysutils/daemontools/Makefile
+++ b/sysutils/daemontools/Makefile
@@ -17,7 +17,8 @@ MAINTAINER= roam@FreeBSD.org
COMMENT= Service monitoring and logging utilities by djb
OPTIONS= MAN "Install Gerrit Pape's manual pages" on \
- SIGQ12 "Add svc support for QUIT, USR1, and USR2 signals" off
+ SIGQ12 "Add svc support for QUIT, USR1, and USR2 signals" off \
+ TESTS "Run the test suite, fails on NFS-mounted workdir" on
.include <bsd.port.pre.mk>
@@ -59,6 +60,10 @@ RC_SCRIPTS_SUB+= DAEMON="/usr/sbin/daemon -f"
RC_SCRIPTS_SUB+= DAEMON=""
.endif
+.if defined(WITHOUT_TESTS)
+EXTRA_PATCHES+= ${FILESDIR}/rts-skip.patch
+.endif
+
post-patch:
@${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc
@${ECHO_CMD} "${CC} ${STRIP}" > ${WRKSRC}/conf-ld
diff --git a/sysutils/daemontools/files/rts-skip.patch b/sysutils/daemontools/files/rts-skip.patch
new file mode 100644
index 000000000000..3dfd0efc6d01
--- /dev/null
+++ b/sysutils/daemontools/files/rts-skip.patch
@@ -0,0 +1,11 @@
+--- Makefile.old 2007-10-30 12:18:08.000000000 +0200
++++ Makefile 2007-10-30 12:18:16.000000000 +0200
+@@ -264,7 +264,7 @@
+ rts: envdir envuidgid fghack matchtest multilog pgrphack \
+ readproctitle rts.tests setlock setuidgid softlimit supervise svc \
+ svok svscan svscanboot svstat tai64n tai64nlocal
+- env - /bin/sh rts.tests 2>&1 | cat -v > rts
++ echo env - /bin/sh rts.tests 2>&1 | cat -v > rts
+
+ scan_ulong.o: compile scan.h scan_ulong.c
+ ./compile scan_ulong.c
diff --git a/sysutils/daemontools/files/svscan.sh.sample b/sysutils/daemontools/files/svscan.sh.sample
index 87ca26a5e9e3..2aa1b2432fb0 100644
--- a/sysutils/daemontools/files/svscan.sh.sample
+++ b/sysutils/daemontools/files/svscan.sh.sample
@@ -11,8 +11,22 @@
# /etc/rc.conf.local
# /etc/rc.conf.d/svscan
#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-#
+# svscan_enable Set to "YES" to run svscan.
+# svscan_servicedir The directory containing the various service.
+# directories to be monitored. Professor Daniel J.
+# Bernstein recomments "/service", but the FreeBSD
+# port has a default of "/var/service" instead, which
+# is consistent with the FreeBSD filesystem hierarchy
+# guidelines as described in the hier(7) manual page.
+# svscan_logdir If set, then svscan will not log its output through
+# readproctitle, but through multilog instead, and
+# the logs will be placed in the specified directory.
+# The FreeBSD port default is to run svscan through
+# readproctitle.
+# svscan_lognum The number of logfiles that multilog will keep if
+# svscan_logdir is set; the multilog default is 10.
+# svscan_logmax The maximum logfile size for multilog if svscan_logdir
+# is set; the multilog default is 99999.
# It would really, really be a Good Thing(tm) for you to enable some
# of the below control variables and the apropriate ulimit.
@@ -48,6 +62,10 @@
name="svscan"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/svscan"
+
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
svscan_enable=${svscan_enable-"NO"}
svscan_servicedir=${svscan_servicedir-"/var/service"}
@@ -57,12 +75,22 @@ stop_postcmd="svscan_stop_post"
load_rc_config $name
required_dirs="${svscan_servicedir}"
+if [ -n "${svscan_logdir}" ]; then
+ required_dirs="${required_dirs} ${svscan_logdir}"
+fi
svscan_start () {
echo "Starting svscan."
- /usr/bin/env \
- PATH=%%PREFIX%%/sbin:%%PREFIX%%/bin:/usr/sbin:/usr/bin:/sbin:/bin \
- %%DAEMON%% /bin/sh -c "$command $svscan_servicedir 2>&1 | %%PREFIX%%/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null
+ EP="/usr/bin/env \
+ PATH=%%PREFIX%%/sbin:%%PREFIX%%/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ if [ -z "${svscan_logdir}" ]; then
+ ${EP} %%DAEMON%% /bin/sh -c "$command $svscan_servicedir 2>&1 | %%PREFIX%%/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null
+ else
+ logmax=${svscan_logmax+s$svscan_logmax}
+ lognum=${svscan_lognum+n$svscan_lognum}
+ ${EP} %%DAEMON%% /bin/sh -c "$command $svscan_servicedir 2>&1 \
+ | %%PREFIX%%/bin/multilog t $logmax $lognum '${svscan_logdir}' &" > /dev/null
+ fi
}
svscan_stop_post () {