summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/gnump3d/files/gnump3d.init.d-r1')
-rw-r--r--media-sound/gnump3d/files/gnump3d.init.d-r140
1 files changed, 40 insertions, 0 deletions
diff --git a/media-sound/gnump3d/files/gnump3d.init.d-r1 b/media-sound/gnump3d/files/gnump3d.init.d-r1
new file mode 100644
index 00000000000..2ead467d788
--- /dev/null
+++ b/media-sound/gnump3d/files/gnump3d.init.d-r1
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="index"
+
+depend() {
+ need net
+ after netmount nfsmount
+}
+
+start() {
+ ebegin "Starting gnump3d"
+
+ if [ ${DO_INDEX} -eq 1 ]; then
+ ebegin "Updating index of music files (may take a while for the first time)"
+ /usr/bin/gnump3d-index
+ eend $?
+ fi
+
+ start-stop-daemon --start --quiet --exec /usr/bin/gnump3d2 --make-pidfile \
+ --pidfile /var/run/gnump3d.pid --background -- --quiet
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gnump3d"
+ start-stop-daemon --stop --quiet --pidfile /var/run/gnump3d.pid
+ eend $?
+}
+
+index() {
+ ebegin "Indexing music files"
+ /usr/bin/gnump3d-index
+ eend $?
+}
+
+start_pre() {
+ checkpath -d -o "gnump3d:gnump3d" -q "/var/cache/gnump3d" "/var/cache/gnump3d/serving"
+}