From 033d6489f856b599f2630b5eacdb0b9a6208e81a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 26 Sep 2013 15:58:04 +0000 Subject: [PATCH] Created OpenRC init script. --- openrc/conf.d/gollum | 3 +++ openrc/init.d/gollum | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 openrc/conf.d/gollum create mode 100644 openrc/init.d/gollum diff --git a/openrc/conf.d/gollum b/openrc/conf.d/gollum new file mode 100644 index 00000000..e5ef8213 --- /dev/null +++ b/openrc/conf.d/gollum @@ -0,0 +1,3 @@ +GOLLUM_USER=gollum +GOLLUM_BASE=/home/gollum/wiki +GOLLUM_OPTS="--config /home/gollum/config.rb" diff --git a/openrc/init.d/gollum b/openrc/init.d/gollum new file mode 100644 index 00000000..235e888c --- /dev/null +++ b/openrc/init.d/gollum @@ -0,0 +1,31 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +NAME=gollum +PID=/var/run/${NAME}.pid + +depend() { + need net +} + +start() { + ebegin "Starting Gollum" + start-stop-daemon --start \ + --name "${NAME}" \ + --user "${GOLLUM_USER}" \ + --pidfile "${PID}" \ + --make-pidfile --background \ + --exec gollum -- $GOLLUM_OPTS "$GOLLUM_BASE" + eend $? +} + +stop() { + ebegin "Stopping Gollum" + start-stop-daemon --stop \ + --name "${NAME}" \ + --user "${GOLLUM_USER}" \ + --pidfile "${PID}" + eend $? +}