Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge branch 'fixup-preprod'
Browse files Browse the repository at this point in the history
  • Loading branch information
aegiap committed Apr 29, 2016
2 parents 28595ad + 6fbe7fd commit a3bb0c1
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions debian/python-baobab.baobab-ircd.init
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
NAME=baobab-ircd
PATH=/sbin:/bin:/usr/sbin:/usr/bin
CMD=/usr/bin/baobab
PIDFILE=/var/run/$NAME/$NAME.pid
RUNDIR=/run/$NAME
PIDFILE="${RUNDIR}/${NAME}.pid"
CONFFILE="/etc/gandi/baobab.py"
OPTIONS="ircd"
USER='root'
USER='www-data'
GROUP='www-data'
SOCKET=`grep '^IRC_SOCKET_PATH' /etc/gandi/baobab.py | sed -e "s,^IRC_SOCKET_PATH\s*=\s*,,g" -e "s,[\'\"],,g"`

Expand All @@ -33,28 +34,24 @@ fi

case "$1" in
start)
PID_DIR=`dirname $PIDFILE`
[ ! -d "$PID_DIR" ] && mkdir -p $PID_DIR
if [ ! -d "/run/baobab" ]; then
mkdir -p "/run/baobab"
chown $USER:$USER "/run/baobab"
if [ ! -d "$RUNDIR" ]; then
install -d -m 0750 -o "$USER" -g "$GROUP" "$RUNDIR"
else
chown $USER:$GROUP "$RUNDIR"
fi
log_begin_msg "Starting $NAME"
export PYTHONPATH="/etc" DJANGO_SETTINGS_MODULE="gandi.baobab"
start-stop-daemon --start --quiet \
--chuid $USER:nogroup \
--chuid $USER:$GROUP \
--make-pidfile --pidfile $PIDFILE \
--background \
--exec $CMD -- $OPTIONS
if [ -n "${SOCKET}" ] && [ -e "${SOCKET}" ]; then
chmod g+w "${SOCKET}"
chgrp "${GROUP}" "${SOCKET}"
fi
;;
stop)
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE \
--user $USER
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE \
--user $USER
rm -rf "$RUNDIR"
;;
status|force-reload|restart|try-restart)
# nothing
Expand Down

0 comments on commit a3bb0c1

Please sign in to comment.