diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /www-servers/ocsigenserver/files/ocsigenserver.initd |
reinit the tree, so we can have metadata
Diffstat (limited to 'www-servers/ocsigenserver/files/ocsigenserver.initd')
-rw-r--r-- | www-servers/ocsigenserver/files/ocsigenserver.initd | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/www-servers/ocsigenserver/files/ocsigenserver.initd b/www-servers/ocsigenserver/files/ocsigenserver.initd new file mode 100644 index 000000000000..57d3343159f5 --- /dev/null +++ b/www-servers/ocsigenserver/files/ocsigenserver.initd @@ -0,0 +1,59 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="depend checkconfig reload" + +depend() { + need net + use logger + after bootmist +} + + +checkconfig() { + if [ ! -f "$DAEMON" ] ; then + ewarn "Unable to find $DAEMON" + return 1 + fi + if [ ! -f "$CONF" ] ; then + ewarn $CONF " does not exist." + return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Creating command pipe (${COMMANDPIPE})" + mkfifo -m 660 "${COMMANDPIPE}" + chown ocsigenserver:ocsigenserver "${COMMANDPIPE}" + eend $? + + ebegin "Starting ocsigen" + start-stop-daemon --start --exec $DAEMON -- \ + --pidfile $PIDFILE \ + --daemon \ + $OCSIGEN_OPTS + eend $? +} + +stop() { + ebegin "Stopping ocsigen" + start-stop-daemon --stop --pidfile $PIDFILE + eend $? + ebegin "Removing command pipe (${COMMANDPIPE})" + rm -f "${COMMANDPIPE}" + eend $? +} + +reload() { + if [ ! -f "$PIDFILE" ] ; then + ewarn "$PIDFILE not found!!" + ewarn "Ocsigen is not running. Not reloading." + return 1 + fi + ebegin "Reloading ocsigen" + echo reload > /var/run/ocsigen_command + eend $? +} |