Changeset View
Changeset View
Standalone View
Standalone View
devel/cvsd/files/cvsd.in
Show All 13 Lines | |||||
required_files=$cvsd_config | required_files=$cvsd_config | ||||
start_precmd=${name}_prestart | start_precmd=${name}_prestart | ||||
stop_precmd=cvsd_config | stop_precmd=cvsd_config | ||||
stop_postcmd=${name}_poststop | stop_postcmd=${name}_poststop | ||||
cvsd_config() | cvsd_config() | ||||
{ | { | ||||
osreldate=`sysctl -n kern.osreldate` | |||||
chrootjail=`sed -n 's/^ *RootJail *\([^ ]*\) *$/\1/p' < $cvsd_config` | chrootjail=`sed -n 's/^ *RootJail *\([^ ]*\) *$/\1/p' < $cvsd_config` | ||||
if [ -z "$chrootjail" ]; then | if [ -z "$chrootjail" ]; then | ||||
err 1 "RootJail is not specified in $cvsd_config" | err 1 "RootJail is not specified in $cvsd_config" | ||||
fi | fi | ||||
pidfile=`sed -n 's/^ *PidFile *\([^ ]*\) *$/\1/p' < $cvsd_config` | pidfile=`sed -n 's/^ *PidFile *\([^ ]*\) *$/\1/p' < $cvsd_config` | ||||
if [ -z "$pidfile" ]; then | if [ -z "$pidfile" ]; then | ||||
err 1 "PidFile is not specified in $cvsd_config" | err 1 "PidFile is not specified in $cvsd_config" | ||||
fi | fi | ||||
} | } | ||||
cvsd_prestart() | cvsd_prestart() | ||||
{ | { | ||||
cvsd_config | cvsd_config | ||||
if [ $osreldate -gt 500000 ] && [ "$chrootjail" != "none" ]; then | if [ "$chrootjail" != "none" ]; then | ||||
mount -t devfs devfs $chrootjail/dev | mount -t devfs devfs $chrootjail/dev | ||||
devfs -m $chrootjail/dev rule apply hide | devfs -m $chrootjail/dev rule apply hide | ||||
devfs -m $chrootjail/dev rule apply path null unhide | devfs -m $chrootjail/dev rule apply path null unhide | ||||
devfs -m $chrootjail/dev rule apply path zero unhide | devfs -m $chrootjail/dev rule apply path zero unhide | ||||
fi | fi | ||||
} | } | ||||
cvsd_poststop() | cvsd_poststop() | ||||
{ | { | ||||
if [ $osreldate -gt 500000 ] && [ "$chrootjail" != "none" ]; then | if [ "$chrootjail" != "none" ]; then | ||||
umount -t devfs $chrootjail/dev | umount -t devfs $chrootjail/dev | ||||
fi | fi | ||||
} | } | ||||
load_rc_config $name | load_rc_config $name | ||||
: ${cvsd_enable="NO"} | : ${cvsd_enable="NO"} | ||||
: ${cvsd_config="%%PREFIX%%/etc/$name/$name.conf"} | : ${cvsd_config="%%PREFIX%%/etc/$name/$name.conf"} | ||||
run_rc_command "$1" | run_rc_command "$1" |