aboutsummaryrefslogtreecommitdiff
path: root/sysutils/daemontools
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/daemontools')
-rw-r--r--sysutils/daemontools/Makefile13
-rw-r--r--sysutils/daemontools/files/svscan.sh.sample34
2 files changed, 47 insertions, 0 deletions
diff --git a/sysutils/daemontools/Makefile b/sysutils/daemontools/Makefile
index 5904f65e3b30..f78311cb94df 100644
--- a/sysutils/daemontools/Makefile
+++ b/sysutils/daemontools/Makefile
@@ -17,9 +17,22 @@ NO_PACKAGE= Unsure of djb\'s license
ALL_TARGET= it
INSTALL_TARGET= setup check
+SAMPLERC= svscan.sh.sample
+SERVICEDIR?= /var/service/
+
post-patch:
@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:
+ @${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755 \
+ ${PREFIX}/share/examples/${PORTNAME}
+ @${INSTALL_DATA} ${WRKDIR}/${SAMPLERC} \
+ ${PREFIX}/share/examples/${PORTNAME}
+
.include <bsd.port.mk>
diff --git a/sysutils/daemontools/files/svscan.sh.sample b/sysutils/daemontools/files/svscan.sh.sample
new file mode 100644
index 000000000000..ab67f451307c
--- /dev/null
+++ b/sysutils/daemontools/files/svscan.sh.sample
@@ -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 &'