aboutsummaryrefslogtreecommitdiffstats
path: root/community/atheme-iris/atheme-iris.initd
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-05-27 20:44:56 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-05-27 20:44:56 +0000
commit0869f63689d9d7fb8ac57e8deeec48756e9b24cf (patch)
tree224d43573ba6f28fd5c7a0520060ffbdebf8c24b /community/atheme-iris/atheme-iris.initd
parent0df46e9eb6980d595517948ffe94b6fde2089d79 (diff)
downloadaports-0869f63689d9d7fb8ac57e8deeec48756e9b24cf.tar.bz2
aports-0869f63689d9d7fb8ac57e8deeec48756e9b24cf.tar.xz
community/atheme-iris: move from main
Diffstat (limited to 'community/atheme-iris/atheme-iris.initd')
-rwxr-xr-xcommunity/atheme-iris/atheme-iris.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/community/atheme-iris/atheme-iris.initd b/community/atheme-iris/atheme-iris.initd
new file mode 100755
index 0000000000..dd8a24dbe3
--- /dev/null
+++ b/community/atheme-iris/atheme-iris.initd
@@ -0,0 +1,39 @@
+#!/sbin/openrc-run
+# Copyright 2013 Alpine Linux
+# Distributed under the terms of the GNU General Public License v2
+
+extra_stopped_commands="compile"
+
+: ${SVCHOME:=/var/lib/$SVCNAME}
+: ${pidfile:=/var/run/${SVCNAME%%.*}/${SVCNAME#*.}.pid}
+
+depend() {
+ use net
+ need localmount
+}
+compile() {
+ ebegin "Compiling configuration for ${SVCNAME}"
+ cd ${SVCHOME}
+ ./clean.py
+ ./compile.py
+ eend $?
+}
+
+start() {
+ compile || return 1
+ checkpath --directory --owner iris ${pidfile%/*}
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --exec ${SVCHOME}/run.py \
+ --pidfile $pidfile \
+ --chdir $SVCHOME \
+ --user iris:iris \
+ --background \
+ --stdout /dev/null \
+ --stderr /dev/null \
+ --wait 500 \
+ -- \
+ -P $pidfile \
+ $ARGS
+
+ eend $?
+}