Sha256: 1e2b82c2a5c9651fd9fb1057b7d171b79dedcccd5be467fa893a69e9437028b8

Contents?: true

Size: 1.57 KB

Versions: 25

Compression:

Stored size: 1.57 KB

Contents

#!/bin/sh
### BEGIN INIT INFO
# Provides:          gollum
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop gollum wiki
### END INIT INFO

# Distributed under the terms of the MIT License

set -e

# Edit these settings to your liking:
GOLLUM_USER=gollum
GOLLUM_BASE=/var/lib/gollum/.git
GOLLUM_OPTS="--bare"

NAME=gollum
PID=/var/run/${NAME}.pid
EXEC=/usr/local/bin/gollum
LOG=/var/log/gollum.log

. /lib/lsb/init-functions

start ()
{
    # Change log file to be owned by GOLLUM_USER
    touch "${LOG}"
    chown "${GOLLUM_USER}" "${LOG}"

    log_daemon_msg "Starting Gollum"
    start-stop-daemon --start \
        --name "${NAME}" \
        --user "${GOLLUM_USER}" \
        --chuid "${GOLLUM_USER}" \
        --pidfile "${PID}" \
        --make-pidfile --background \
        --startas /bin/sh -- -c "exec ${EXEC} $GOLLUM_OPTS \"$GOLLUM_BASE\" > \"${LOG}\" 2>&1"
    log_end_msg $?
}

stop ()
{
    log_daemon_msg "Stopping Gollum"
    start-stop-daemon --stop \
        --user "${GOLLUM_USER}" \
        --signal INT \
        --pidfile "${PID}" \
        --retry 10
    log_end_msg $?
}

status ()
{
    status_of_proc -p $PID $EXEC $NAME
}

case $1 in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    status)
        status
        ;;
    *)
        log_success_msg "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
gollum-6.0.1 contrib/sysv-debian/init.d/gollum
gollum-6.0.0 contrib/sysv-debian/init.d/gollum
gollum-5.3.3 contrib/sysv-debian/init.d/gollum
gollum-5.3.2 contrib/sysv-debian/init.d/gollum
gollum-5.3.1 contrib/sysv-debian/init.d/gollum
gollum-5.3.0 contrib/sysv-debian/init.d/gollum
gollum-5.2.3 contrib/sysv-debian/init.d/gollum
gollum-5.2.2 contrib/sysv-debian/init.d/gollum
gollum-5.2.1 contrib/sysv-debian/init.d/gollum
gollum-5.2 contrib/sysv-debian/init.d/gollum
gollum-5.1.2 contrib/sysv-debian/init.d/gollum
gollum-5.1.1 contrib/sysv-debian/init.d/gollum
gollum-5.1 contrib/sysv-debian/init.d/gollum
gollum-5.0.1 contrib/sysv-debian/init.d/gollum
gollum-5.0.0 contrib/sysv-debian/init.d/gollum
gollum-4.1.4 contrib/sysv-debian/init.d/gollum
gollum-4.1.3 contrib/sysv-debian/init.d/gollum
inc_gollum-5.0.1b.pre.rc2 contrib/sysv-debian/init.d/gollum
inc_gollum-5.0.1b.pre.rc1 contrib/sysv-debian/init.d/gollum
inc_gollum-4.1.2d contrib/sysv-debian/init.d/gollum