aboutsummaryrefslogtreecommitdiffstats
path: root/devel/distcc/files/distccd.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'devel/distcc/files/distccd.sh.in')
-rw-r--r--devel/distcc/files/distccd.sh.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/devel/distcc/files/distccd.sh.in b/devel/distcc/files/distccd.sh.in
new file mode 100644
index 00000000000..7fb081cbb30
--- /dev/null
+++ b/devel/distcc/files/distccd.sh.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: distccd
+# REQUIRE: NETWORKING
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable distccd:
+#
+# distccd_enable="YES"
+#
+
+distccd_enable=${distccd_enable-"NO"}
+distccd_flags=${distccd_flags-"-a 127.0.0.0/8 --user distcc --daemon -P %%DISTCCD_PIDFILE%%"}
+
+. %%RC_SUBR%%
+
+name=distccd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+# extract pid file from distccd_flags (if any)
+pidfile="`echo ${distccd_flags} |sed -nE -e 's/^.*-P ([^ ]+).*$/\1/p'`"
+# set default value
+pidfile=${pidfile:-%%DISTCCD_PIDFILE%%}
+
+distccd_precmd()
+{
+ # distccd drops root privileges and then attempts to create the pid file
+ touch ${pidfile}
+ chown distcc:distcc ${pidfile}
+}
+
+start_precmd="distccd_precmd"
+
+load_rc_config ${name}
+run_rc_command "$1"