diff options
author | dougb <dougb@FreeBSD.org> | 2006-06-09 00:59:41 +0800 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2006-06-09 00:59:41 +0800 |
commit | d8fedf5ea3566de070b464a68f807879b9647765 (patch) | |
tree | b9e5e3a63225df9e7efd7587f348efa42f986eab /devel | |
parent | 42a70aa12ba9c3d634f7807b618a14ebf85f22c5 (diff) | |
download | freebsd-ports-gnome-d8fedf5ea3566de070b464a68f807879b9647765.tar.gz freebsd-ports-gnome-d8fedf5ea3566de070b464a68f807879b9647765.tar.zst freebsd-ports-gnome-d8fedf5ea3566de070b464a68f807879b9647765.zip |
Update rc.d script to better fit current practice.
PR: ports/98692
Submitted by: Andrey V. Elsukov <bu7cher@yandex.ru> [maintainer]
Diffstat (limited to 'devel')
-rw-r--r-- | devel/cvsd/Makefile | 4 | ||||
-rw-r--r-- | devel/cvsd/files/cvsd.in | 59 | ||||
-rw-r--r-- | devel/cvsd/files/cvsd.sh.in | 52 |
3 files changed, 61 insertions, 54 deletions
diff --git a/devel/cvsd/Makefile b/devel/cvsd/Makefile index 045710059b64..dce03616c564 100644 --- a/devel/cvsd/Makefile +++ b/devel/cvsd/Makefile @@ -8,7 +8,7 @@ PORTNAME= cvsd PORTVERSION= 1.0.12 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://ch.tudelft.nl/~arthur/cvsd/ @@ -31,7 +31,7 @@ PORTDOCS= README PLIST_FILES= etc/cvsd/cvsd.conf.sample sbin/cvsd sbin/cvsd-buginfo \ sbin/cvsd-buildroot sbin/cvsd-passwd PLIST_DIRS= etc/cvsd -USE_RC_SUBR= cvsd.sh +USE_RC_SUBR= cvsd .include <bsd.port.pre.mk> diff --git a/devel/cvsd/files/cvsd.in b/devel/cvsd/files/cvsd.in new file mode 100644 index 000000000000..d2823dd70ae3 --- /dev/null +++ b/devel/cvsd/files/cvsd.in @@ -0,0 +1,59 @@ +#!/bin/sh +# $FreeBSD$ +# +# PROVIDE: cvsd +# REQUIRE: LOGIN syslogd +# KEYWORD: nojail shutdown + +. %%RC_SUBR%% + +name="cvsd" +rcvar=${name}_enable + +command="%%PREFIX%%/sbin/$name" +command_args='-f $cvsd_config' +required_files=$cvsd_config + +start_precmd=${name}_prestart +stop_precmd=cvsd_config +stop_postcmd=${name}_poststop + +cvsd_config() +{ + osreldate=`sysctl -n kern.osreldate` + chrootjail=`sed -n 's/^ *RootJail *\([^ ]*\) *$/\1/p' < $cvsd_config` + if [ -z "$chrootjail" ]; then + err 1 "RootJail is not specified in $cvsd_config" + fi + + pidfile=`sed -n 's/^ *PidFile *\([^ ]*\) *$/\1/p' < $cvsd_config` + if [ -z "$pidfile" ]; then + err 1 "PidFile is not specified in $cvsd_config" + fi +} + +cvsd_prestart() +{ + cvsd_config + if [ $osreldate -gt 500000 ]; then + mount -t devfs devfs $chrootjail/dev + devfs -m $chrootjail/dev rule apply hide + devfs -m $chrootjail/dev rule apply path null unhide + devfs -m $chrootjail/dev rule apply path zero unhide + fi + +} + +cvsd_poststop() +{ + if [ $osreldate -gt 500000 ]; then + umount -t devfs $chrootjail/dev + fi +} + +load_rc_config $name + +: ${cvsd_enable="NO"} +: ${cvsd_config="%%PREFIX%%/etc/$name/$name.conf"} + +run_rc_command "$1" diff --git a/devel/cvsd/files/cvsd.sh.in b/devel/cvsd/files/cvsd.sh.in deleted file mode 100644 index dac4508f67cb..000000000000 --- a/devel/cvsd/files/cvsd.sh.in +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# $FreeBSD: -# -# PROVIDE: cvsd -# REQUIRE: NETWORKING -# KEYWORD: nojail - -. %%RC_SUBR%% - -name="cvsd" -rcvar=`set_rcvar` -command="%%PREFIX%%/sbin/$name" - -load_rc_config $name - -: ${cvsd_enable="NO"} -: ${cvsd_config="%%PREFIX%%/etc/$name/$name.conf"} - -command_args="-f $cvsd_config" - -start_precmd="cvsd_prestart" -stop_postcmd="cvsd_poststop" - -cvsd_prestart() -{ - if [ $osreldate -gt 500000 ]; then - mount -t devfs devfs $jail/dev - devfs -m $jail/dev rule apply hide - devfs -m $jail/dev rule apply path null unhide - devfs -m $jail/dev rule apply path zero unhide - fi -} - -cvsd_poststop() -{ - if [ $osreldate -gt 500000 ]; then - umount -t devfs $jail/dev - fi -} - -jail=`sed -n 's/^ *RootJail *\([^ ]*\) *$/\1/p' < $cvsd_config` -pidfile=`sed -n 's/^ *PidFile *\([^ ]*\) *$/\1/p' < $cvsd_config` -osreldate=`sysctl -n kern.osreldate` -if [ "$jail" = "X$jail" ]; then - err 1 "RootJail is not specified in $cvsd_config" -fi -if [ "$pidfile" = "X$pidfile" ]; then - err 1 "PidFile is not specified in $cvsd_config" -fi - -run_rc_command "$1" - |