Date: Fri, 17 Jul 2009 07:14:43 GMT From: "Philip M. Gollucci" <pgollucci@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: roam@FreeBSD.org Subject: ports/136851: [PATCH] sysutils/daemontools: USE_RC_SUBR != yes Message-ID: <200907170714.n6H7EhJb043873@freefall.freebsd.org> Resent-Message-ID: <200907170720.n6H7K5T4045976@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 136851 >Category: ports >Synopsis: [PATCH] sysutils/daemontools: USE_RC_SUBR != yes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jul 17 07:20:04 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Philip M. Gollucci >Release: FreeBSD 7.2-STABLE i386 >Organization: RideCharge Inc. >Environment: System: FreeBSD freefall.freebsd.org 7.2-STABLE FreeBSD 7.2-STABLE #38 r194101: Sat Jun 13 11:12:24 UTC >Description: Added file(s): - files/svscan.in Removed file(s): - files/svscan.sh.sample Port maintainer (roam@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.77 >How-To-Repeat: >Fix: --- daemontools-0.76_13.patch begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/sysutils/daemontools/Makefile,v retrieving revision 1.28 diff -u -u -r1.28 Makefile --- Makefile 6 Jan 2009 17:59:24 -0000 1.28 +++ Makefile 17 Jul 2009 07:14:32 -0000 @@ -7,7 +7,7 @@ PORTNAME= daemontools PORTVERSION= 0.76 -PORTREVISION= 12 +PORTREVISION= 13 CATEGORIES= sysutils MASTER_SITES= http://cr.yp.to/daemontools/ \ ftp://cr.yp.to/daemontools/ @@ -40,20 +40,13 @@ PATCH_DIST_STRIP= -p2 .endif -USE_RC_SUBR= yes -RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} SERVICEDIR=${SERVICEDIR} \ - DAEMON="/usr/sbin/daemon -f" +USE_RC_SUBR= svscan WRKSRC= ${WRKDIR}/admin/${DISTNAME}/src ALL_TARGET= it INSTALL_TARGET= setup check -SAMPLERC= svscan.sh.sample -SERVICEDIR?= /var/service -STARTUP_SCRIPT?= ${SAMPLERC:S/.sample//} -PLIST_SUB+= STARTUP_SCRIPT="${STARTUP_SCRIPT}" - .if defined(WITHOUT_TESTS) EXTRA_PATCHES+= ${FILESDIR}/rts-skip.patch .endif @@ -62,10 +55,6 @@ @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc @${ECHO_CMD} "${CC} ${STRIP}" > ${WRKSRC}/conf-ld -post-build: - @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ - ${FILESDIR}/${SAMPLERC} > ${WRKDIR}/${SAMPLERC} - do-install: (while read cmd; do \ if ${FILE} ${WRKSRC}/$$cmd | ${GREP} -q "shell script"; then \ @@ -76,7 +65,6 @@ done) < ${WRKSRC}/../package/commands post-install: - @${INSTALL_SCRIPT} ${WRKDIR}/${SAMPLERC} ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT} .if !defined(WITHOUT_MAN) @${INSTALL_MAN} ${WRKDIR}/daemontools-man/*.8 ${PREFIX}/man/man8/ .endif Index: distinfo =================================================================== RCS file: /home/pcvs/ports/sysutils/daemontools/distinfo,v retrieving revision 1.6 diff -u -u -r1.6 distinfo --- distinfo 25 Sep 2006 11:44:38 -0000 1.6 +++ distinfo 17 Jul 2009 07:14:32 -0000 @@ -4,6 +4,3 @@ MD5 (daemontools-0.76-man-20010714.tar.gz) = 7f8105a2d6f3f7f9482dbdb6f4c78d1f SHA256 (daemontools-0.76-man-20010714.tar.gz) = d99a12be71a7bff2fc46546dce02bf102eba401dbadddc29f0fe4bb6d8826c1b SIZE (daemontools-0.76-man-20010714.tar.gz) = 7992 -MD5 (daemontools-0.76.sigq12.patch) = fe2b0ddbd1ea2e72b29c7d78d5e9b0f3 -SHA256 (daemontools-0.76.sigq12.patch) = 149569b2c1a81435d4b9be5905564b2743cdcb8e5ebd1c626d5cb401761e06ae -SIZE (daemontools-0.76.sigq12.patch) = 1975 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/sysutils/daemontools/pkg-plist,v retrieving revision 1.8 diff -u -u -r1.8 pkg-plist --- pkg-plist 7 Jun 2005 11:05:09 -0000 1.8 +++ pkg-plist 17 Jul 2009 07:14:32 -0000 @@ -15,4 +15,3 @@ bin/envdir bin/setlock bin/readproctitle -etc/rc.d/%%STARTUP_SCRIPT%% Index: files/svscan.in =================================================================== RCS file: files/svscan.in diff -N files/svscan.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/svscan.in 17 Jul 2009 07:14:32 -0000 @@ -0,0 +1,100 @@ +#!/bin/sh +# +# $FreeBSD: ports/sysutils/daemontools/files/svscan.sh.sample,v 1.14 2007/10/30 10:49:16 roam Exp $ +# + +# PROVIDE: svscan +# REQUIRE: LOGIN + +# Define these svscan_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/svscan +# +# 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. +# These are only examples. +# Furthermore, you should think about additional limits you might need. +# Or, check login.conf(5) for a suitable alternative. +# If you want to use these examples, please place into /etc/rc.conf.d/svscan. +# +# I really do suggest you use /var/service as your service spool directory. +# Check hier(7) for reasons. + +# 10 Mb +#MINSEGMENT=10240 +# 20 Mb +#MAXSEGMENT=20480 +# 10 Mb +#MAXFILESIZE=10240 +# 100 +#MAXFD=100 +# 40 +#MAXCHILD=40 + +# ulimits +#ulimit -d ${MINSEGMENT} +#ulimit -f ${MAXFILESIZE} +#ulimit -m ${MAXSEGMENT} +#ulimit -n ${MAXFD} +#ulimit -s ${MINSEGMENT} +#ulimit -u ${MAXCHILD} + +. %%RC_SUBR%% + +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"} + +start_cmd="svscan_start" +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." + 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 () { + find -L "$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d -name '[^.]*' \( \! -path "$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 %%PREFIX%%/bin/svc -dx +} + +run_rc_command "$1" Index: files/svscan.sh.sample =================================================================== RCS file: files/svscan.sh.sample diff -N files/svscan.sh.sample --- files/svscan.sh.sample 30 Oct 2007 10:49:16 -0000 1.14 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,100 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/sysutils/daemontools/files/svscan.sh.sample,v 1.14 2007/10/30 10:49:16 roam Exp $ -# - -# PROVIDE: svscan -# REQUIRE: LOGIN - -# Define these svscan_* variables in one of these files: -# /etc/rc.conf -# /etc/rc.conf.local -# /etc/rc.conf.d/svscan -# -# 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. -# These are only examples. -# Furthermore, you should think about additional limits you might need. -# Or, check login.conf(5) for a suitable alternative. -# If you want to use these examples, please place into /etc/rc.conf.d/svscan. -# -# I really do suggest you use /var/service as your service spool directory. -# Check hier(7) for reasons. - -# 10 Mb -#MINSEGMENT=10240 -# 20 Mb -#MAXSEGMENT=20480 -# 10 Mb -#MAXFILESIZE=10240 -# 100 -#MAXFD=100 -# 40 -#MAXCHILD=40 - -# ulimits -#ulimit -d ${MINSEGMENT} -#ulimit -f ${MAXFILESIZE} -#ulimit -m ${MAXSEGMENT} -#ulimit -n ${MAXFD} -#ulimit -s ${MINSEGMENT} -#ulimit -u ${MAXCHILD} - -. %%RC_SUBR%% - -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"} - -start_cmd="svscan_start" -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." - 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 () { - find -L "$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d -name '[^.]*' \( \! -path "$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 %%PREFIX%%/bin/svc -dx -} - -run_rc_command "$1" --- daemontools-0.76_13.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907170714.n6H7EhJb043873>