aboutsummaryrefslogtreecommitdiff
path: root/devel/cvsd/files
diff options
context:
space:
mode:
authorYing-Chieh Liao <ijliao@FreeBSD.org>2006-06-06 09:33:07 +0000
committerYing-Chieh Liao <ijliao@FreeBSD.org>2006-06-06 09:33:07 +0000
commitc47590bf087f05a56b78f89b3f5b2e100a2c14f4 (patch)
tree1633aff78c2e1d844478a486f89a215d5831d9b5 /devel/cvsd/files
parent54c631b2bb33d54b13ee944a38b3eaef1133e819 (diff)
Notes
Diffstat (limited to 'devel/cvsd/files')
-rw-r--r--devel/cvsd/files/cvsd.sh.in52
-rw-r--r--devel/cvsd/files/extra-cvsd-buildroot.in42
2 files changed, 94 insertions, 0 deletions
diff --git a/devel/cvsd/files/cvsd.sh.in b/devel/cvsd/files/cvsd.sh.in
new file mode 100644
index 000000000000..dac4508f67cb
--- /dev/null
+++ b/devel/cvsd/files/cvsd.sh.in
@@ -0,0 +1,52 @@
+#!/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"
+
diff --git a/devel/cvsd/files/extra-cvsd-buildroot.in b/devel/cvsd/files/extra-cvsd-buildroot.in
new file mode 100644
index 000000000000..6e7ed4b33e1b
--- /dev/null
+++ b/devel/cvsd/files/extra-cvsd-buildroot.in
@@ -0,0 +1,42 @@
+--- cvsd-buildroot.in.orig Thu Jun 1 23:57:20 2006
++++ cvsd-buildroot.in Tue Jun 6 11:38:57 2006
+@@ -212,39 +212,6 @@
+ fi
+ done
+
+-# populate /dev (need root privileges for this)
+-echo $ECHO_N "creating $ROOT/dev devices... $ECHO_C"
+-DEVICES="null zero"
+-MISSINGDEVS=""
+-for d in $DEVICES
+-do
+- if [ -r "$ROOT/dev/$d" ]
+- then
+- :
+- else
+- MISSINGDEVS="$MISSINGDEVS $d"
+- fi
+-done
+-if [ -n "`echo $MISSINGDEVS`" ]
+-then
+- if (cd /dev ; tar chpf - $MISSINGDEVS) | \
+- ( cd "$ROOT/dev" ; tar xpf - > /dev/null 2>&1 )
+- then
+- # check if we can use the devices
+- if ( echo TEST > "$ROOT/dev/null" && \
+- echo TEST > "$ROOT/dev/zero" ) 2> /dev/null
+- then
+- echo "done."
+- else
+- echo "FAILED (unable to use devices)"
+- fi
+- else
+- echo "FAILED."
+- fi
+-else
+- echo "already there."
+-fi
+-
+ # update /etc/passwd
+ echo $ECHO_N "adding users to $ROOT/etc/passwd...$ECHO_C"
+ for i in $USERS