summaryrefslogtreecommitdiff
path: root/sysutils/cbsd/files/cbsdd.in
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2014-02-04 00:52:58 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2014-02-04 00:52:58 +0000
commit3dffd6c4add3fc4c1984fe14fe6056fed9212552 (patch)
tree3a97cad62b4453a7ab308c1107eee0337aba63f2 /sysutils/cbsd/files/cbsdd.in
parentFix a stage symlink. (diff)
- update to 10.0.2
- use ports framework to create cbsd user/group - add rc.d scripts - add pkg-deinstall instructions for complete uninstall PR: 186344 Submitted by: Oleg Ginzburg <olevole@olevole.ru> (maintainer)
Notes
Notes: svn path=/head/; revision=342481
Diffstat (limited to 'sysutils/cbsd/files/cbsdd.in')
-rw-r--r--sysutils/cbsd/files/cbsdd.in60
1 files changed, 60 insertions, 0 deletions
diff --git a/sysutils/cbsd/files/cbsdd.in b/sysutils/cbsd/files/cbsdd.in
new file mode 100644
index 000000000000..9127d7df9ea1
--- /dev/null
+++ b/sysutils/cbsd/files/cbsdd.in
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# PROVIDE: cbsdd
+# REQUIRE: LOGIN FILESYSTEMS sshd
+# KEYWORD: shutdown
+#
+# cbsdd_enable="YES"
+#
+
+. /etc/rc.subr
+
+name=cbsdd
+rcvar=cbsdd_enable
+load_rc_config $name
+
+: ${cbsdd_enable="NO"}
+
+export workdir="${cbsd_workdir}"
+globalconf=${cbsd_globalconf:-"${workdir}/cbsd.conf"}
+
+if [ ! -f ${globalconf} ]; then
+ echo "cbsd: no such ${globalconf}";
+ exit 1
+fi
+
+. ${globalconf}
+. ${inventory}
+. ${mdtools}
+. ${subr}
+
+if [ ! -f ${localcbsdconf} ]; then
+ echo "cbsd: no such ${localcbsdconf}";
+ exit 1
+fi
+
+. ${localcbsdconf}
+
+start_precmd=${name}_prestart
+stop_precmd=${name}_prestop
+
+command="${sbindir}/cbsdd"
+pidfile="/var/run/$name.pid"
+
+cbsdd_prestart() {
+ find ${ftmpdir} -depth 1 -maxdepth 1 -type f -exec rm -f {} \;
+ %%PREFIX%%/bin/cbsd sysinv mode=update
+
+ . ${inventory}
+
+ [ -n "$nat_enable" ] && %%PREFIX%%/bin/cbsd naton
+ /usr/sbin/daemon ${rcddir}/jails-astart start
+}
+
+cbsdd_prestop()
+{
+ ${rcddir}/jails-astart stop
+ [ -n "${nat_enable}" ] && %%PREFIX%%/bin/cbsd natoff
+}
+
+run_rc_command "$1"