Skip site navigation (1)Skip section navigation (2)
Date:      11 Jun 2000 04:16:37 -0000
From:      lioux@uol.com.br
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/19191: Update port sysutils/daemontools to include sample rc file
Message-ID:  <20000611041637.27083.qmail@Fedaykin.here>

next in thread | raw e-mail | index | archive | help

>Number:         19191
>Category:       ports
>Synopsis:       Update port sysutils/daemontools to include sample rc file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 10 21:20:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mario Sergio Fujikawa Ferreira
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

FreeBSD Here.here 4.0-STABLE FreeBSD 4.0-STABLE #2: Fri Jun  9 13:22:10 EST 2000     lioux@Here.here:/usr/src/sys/compile/LIOUX  i386

>Description:

Updated sysutils/daemontools to include a sample svscan startup
script.

Besides, I created the standard service directory under /var
(/var/service).

I wrote warning messages allowing the user to change the directory.

Both the sample startup script and the warning messages are prefix safe.
Make package works correctly.

2 final considerations though:
	1) I am pretty sure @(cd ${.CURDIR} ; ${MAKE} www-site)
	can be done more stylish/clean. Someone please do;
	2) We should have a INSTALL_DIR var and a @dirmd PLIST token.

New files:
	files/svscan.sh.sample

>How-To-Repeat:

n/a

>Fix:

diff -ruN /usr/ports/sysutils/daemontools/Makefile daemontools/Makefile
--- /usr/ports/sysutils/daemontools/Makefile	Thu Apr 27 18:43:32 2000
+++ daemontools/Makefile	Sun Jun 11 00:31:30 2000
@@ -16,10 +16,40 @@
 
 ALL_TARGET=	it
 INSTALL_TARGET=	setup check
+PLIST_SUB=	SERVICEDIR="${SERVICEDIR}"
+
+# Supplied by Mario Ferreira <lioux@linf.unb.br>
+# Directory where the service control directory will be placed.
+# Check hier(7) if you do not agree.
+SERVICEDIR=	/var/service
+SAMPLERC=	svscan.sh.sample
+
+pre-fetch:
+	@${ECHO_MSG} 
+	@${ECHO_MSG} "===> This port will automatically create"
+	@${ECHO_MSG} "===> ${SERVICEDIR} as your ${PORTNAME}"
+	@${ECHO_MSG} "===> service directory."
+	@${ECHO_MSG} "===> Add \"SERVICEDIR=whatever you like\""
+	@${ECHO_MSG} "===> to argument of make if you want to change it"
+	@${ECHO_MSG} 
+	@/bin/sleep 2
 
 post-patch:
-	@echo "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc
-	@echo "${CC} -s" > ${WRKSRC}/conf-ld
-	@echo "${PREFIX}" > ${WRKSRC}/conf-home
+	@${ECHO} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc
+	@${ECHO} "${CC} -s" > ${WRKSRC}/conf-ld
+	@${ECHO} "${PREFIX}" > ${WRKSRC}/conf-home
+
+post-build:
+	@${SED} "s!/usr/local/!${PREFIX}/!;s!/var/service!${SERVICEDIR}!g" \
+		${FILESDIR}/${SAMPLERC} > ${WRKDIR}/${SAMPLERC}
+
+post-install:
+	@${SED} "s!/usr/local/!${PREFIX}/!;s!/var/service!${SERVICEDIR}!" ${PKGDIR}/MESSAGE | /usr/bin/fmt
+	@(cd ${.CURDIR} ; ${MAKE} www-site)
+	@${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755 \
+		${PREFIX}/share/examples/${PORTNAME}
+	@${INSTALL_DATA} ${WRKDIR}/${SAMPLERC} \
+		${PREFIX}/share/examples/${PORTNAME}
+	@${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755 "${SERVICEDIR}"
 
 .include <bsd.port.mk>
diff -ruN /usr/ports/sysutils/daemontools/files/svscan.sh.sample daemontools/files/svscan.sh.sample
--- /usr/ports/sysutils/daemontools/files/svscan.sh.sample	Wed Dec 31 21:00:00 1969
+++ daemontools/files/svscan.sh.sample	Sat Jun 10 23:44:20 2000
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Surely advice 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
+#
+# 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}
+
+exec /bin/csh -cf '/usr/local/bin/svscan /var/service &'
diff -ruN /usr/ports/sysutils/daemontools/pkg/MESSAGE daemontools/pkg/MESSAGE
--- /usr/ports/sysutils/daemontools/pkg/MESSAGE	Wed Dec 31 21:00:00 1969
+++ daemontools/pkg/MESSAGE	Sun Jun 11 01:06:21 2000
@@ -0,0 +1,11 @@
+	ATTENTIONATTENTION:
+
+Check /usr/local/share/examples/daemontools for startup script
+samples.
+
+The port just created /var/service. Use this as your service
+directory when using daemontools.
+
+In case you don't know what this mean, check the daemontools
+URL just below.
+
diff -ruN /usr/ports/sysutils/daemontools/pkg/PLIST daemontools/pkg/PLIST
--- /usr/ports/sysutils/daemontools/pkg/PLIST	Fri Apr 28 08:24:34 2000
+++ daemontools/pkg/PLIST	Sun Jun 11 01:04:24 2000
@@ -1,14 +1,19 @@
-bin/svscan
+bin/envdir
+bin/envuidgid
+bin/fghack
+bin/multilog
+bin/setlock
+bin/setuidgid
+bin/softlimit
 bin/supervise
 bin/svc
 bin/svok
+bin/svscan
 bin/svstat
-bin/fghack
-bin/multilog
 bin/tai64n
 bin/tai64nlocal
-bin/softlimit
-bin/setuidgid
-bin/envuidgid
-bin/envdir
-bin/setlock
+share/examples/daemontools/svscan.sh.sample
+@comment Why is the cwd necessary? Because dirrm is relative to cwd
+@cwd /
+@dirrm %%SERVICEDIR%%
+@exec /usr/bin/install -d -o root -g wheel -m 755 %%SERVICEDIR%%

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000611041637.27083.qmail>