aboutsummaryrefslogtreecommitdiffstats
path: root/main/gross/grossd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/gross/grossd.initd')
-rw-r--r--main/gross/grossd.initd36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/gross/grossd.initd b/main/gross/grossd.initd
new file mode 100644
index 0000000000..c300ac4982
--- /dev/null
+++ b/main/gross/grossd.initd
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+
+NAME="grossd"
+DAEMON="/usr/sbin/$NAME"
+DAEMON_USER="gross"
+DAEMON_GROUP="gross"
+pidfile=/var/run/gross/$NAME.pid
+
+depend() {
+ need net
+ after firewall
+}
+
+check_config() {
+ if [ ! -f /var/db/gross/state ] ; then
+ einfo "Generating Gross database..."
+ install -dD -o${DAEMON_USER} -g${DAEMON_GROUP} /var/db/gross
+ ${DAEMON} -Cu ${DAEMON_USER} > /dev/null
+ fi
+}
+
+start() {
+ check_config || return 1
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet --pidfile ${pidfile} \
+ --exec ${DAEMON} -- \
+ -p ${pidfile} -u ${DAEMON_USER} ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --exec ${DAEMON}
+ eend $?
+}
+