1 |
#!/bin/sh |
2 |
# |
3 |
# $FreeBSD: ports/devel/distcc/files/distccd.sh.in,v 1.5 2010/08/09 13:57:26 skreuzer Exp $ |
4 |
# $MCom: ports/devel/distcc/files/distccd.sh.in,v 1.1 2007/05/19 17:43:14 ahze Exp $ |
5 |
|
6 |
# PROVIDE: distccd |
7 |
# REQUIRE: NETWORKING ldconfig |
8 |
# KEYWORD: shutdown |
9 |
|
10 |
# |
11 |
# Add the following lines to /etc/rc.conf to enable distccd: |
12 |
# |
13 |
# distccd_enable="YES" |
14 |
# |
15 |
|
16 |
distccd_enable=${distccd_enable-"NO"} |
17 |
distccd_flags=${distccd_flags-"-a 127.0.0.0/8 --user distcc --daemon -P %%DISTCCD_PIDFILE%%"} |
18 |
|
19 |
. /etc/rc.subr |
20 |
|
21 |
name=distccd |
22 |
rcvar=`set_rcvar` |
23 |
|
24 |
command=%%PREFIX%%/sbin/${name} |
25 |
# extract pid file from distccd_flags (if any) |
26 |
pidfile="`echo ${distccd_flags} |sed -nE -e 's/^.*-P ([^ ]+).*$/\1/p'`" |
27 |
# set default value |
28 |
pidfile=${pidfile:-%%DISTCCD_PIDFILE%%} |
29 |
|
30 |
distccd_precmd() |
31 |
{ |
32 |
# distccd drops root privileges and then attempts to create the pid file |
33 |
touch ${pidfile} |
34 |
chown distcc:distcc ${pidfile} |
35 |
} |
36 |
|
37 |
start_precmd="distccd_precmd" |
38 |
|
39 |
load_rc_config ${name} |
40 |
run_rc_command "$1" |