diff options
Diffstat (limited to 'community/atheme-iris/atheme-iris.initd')
-rwxr-xr-x | community/atheme-iris/atheme-iris.initd | 39 |
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 $? +} |