summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2019-04-23 19:09:10 +0300
committerAlexey Shvetsov <alexxy@gentoo.org>2019-04-23 19:16:58 +0300
commitbd165bbcc492952508f3cbe7bc78014e6b48f52c (patch)
tree4db047a6afe77fc8a5549fa3fee293a69a42f27f /www-apps/octoprint/files/octoprint.initd
parentdev-python: add ~arm keywords (diff)
downloadalexxy-master.tar.gz
alexxy-master.tar.bz2
alexxy-master.zip
www-apps/octoprint: Initial importHEADmaster
Package-Manager: Portage-2.3.64, Repoman-2.3.12 Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'www-apps/octoprint/files/octoprint.initd')
-rw-r--r--www-apps/octoprint/files/octoprint.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/www-apps/octoprint/files/octoprint.initd b/www-apps/octoprint/files/octoprint.initd
new file mode 100644
index 0000000..69256c1
--- /dev/null
+++ b/www-apps/octoprint/files/octoprint.initd
@@ -0,0 +1,39 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE="/run/octoprint/octoprint.pid"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting OctoPrint"
+
+ checkpath -q -d -o ${OCTOPRINT_USER}:${OCTOPRINT_GROUP} -m 0770 "$(dirname "${PIDFILE}")"
+
+ start-stop-daemon \
+ --quiet \
+ --start \
+ --user ${OCTOPRINT_USER} \
+ --group ${OCTOPRINT_GROUP} \
+ --background --make-pidfile \
+ --pidfile "${PIDFILE}" \
+ --wait 1000 \
+ --nicelevel -2 \
+ --ionice 1 \
+ --exec /usr/bin/octoprint serve
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping OctoPrint"
+
+ start-stop-daemon \
+ --stop \
+ --pidfile "${PIDFILE}"
+
+ eend $?
+}