439aa6e4f5
Move openrc files to contrib/ in conjunction with systemd service. Update gemspec to bundle contrib/ into the gem.
37 lines
674 B
Plaintext
37 lines
674 B
Plaintext
#!/sbin/runscript
|
|
# Distributed under the terms of the MIT License
|
|
|
|
NAME=gollum
|
|
PID=/var/run/${NAME}.pid
|
|
EXEC=/usr/local/bin/gollum
|
|
LOG=/var/log/gollum.log
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start() {
|
|
# Change log file to be owned by GOLLUM_USER
|
|
touch "${LOG}"
|
|
chown "${GOLLUM_USER}" "${LOG}"
|
|
|
|
ebegin "Starting Gollum"
|
|
start-stop-daemon --start \
|
|
--name "${NAME}" \
|
|
--user "${GOLLUM_USER}" \
|
|
--pidfile "${PID}" \
|
|
--make-pidfile --background \
|
|
--stderr "${LOG}" \
|
|
--exec "${EXEC}" -- $GOLLUM_OPTS "$GOLLUM_BASE"
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping Gollum"
|
|
start-stop-daemon --stop \
|
|
--name "${NAME}" \
|
|
--user "${GOLLUM_USER}" \
|
|
--pidfile "${PID}"
|
|
eend $?
|
|
}
|