by Harry Coin: remove deprecated -t option from the debian init script.
[citadel.git] / webcit / debian / webcit.init
index e237ac867bd3097569637405443b50800686751f..2375ac7122df840b38b05b16a5a085a39c3f49e7 100644 (file)
 #                    placed in /etc/init.d.
 ### END INIT INFO
 
+# uncomment this to create coredumps as described in
+# http://www.citadel.org/doku.php/faq:mastering_your_os:gdb#how.do.i.make.my.system.produce.core-files
+# ulimit -c unlimited
+
 # Author: Wilfried Goesgens <citadel@outgesourced.org>
 RUNDIR=/var/run/webcit
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
@@ -21,8 +25,7 @@ PIDFILE=$RUNDIR/$NAME.pid
 SCRIPTNAME=/etc/init.d/webcit
 SENDCOMMAND=/usr/sbin/sendcommand
 DEFAULT=/etc/default/webcit
-LOGDIR=/var/log/webcit/
-
+DROP_TO_UID=`id -u nobody`
 
 # Exit if the package is not installed
 [ -x "$DAEMON" ] || exit 0
@@ -53,9 +56,6 @@ unset LANG
 unset LANGUAGE
 unset LC_ALL
 unset LOCALE
-if test -n "$WEBCIT_LANG" -a "$WEBCIT_LANG" != "UNLIMITED"; then
-    export LANG=$WEBCIT_LANG
-fi 
 
 if test -z "$TZ"; then
        if test -e /etc/timezone; then
@@ -78,10 +78,6 @@ do_start()
            mkdir -p $RUNDIR
        fi
 
-        if test ! -d $LOGDIR; then
-           mkdir -p $LOGDIR
-       fi
-
        # are we disabled?
        if test "$1" -lt "0"; then
            return 0
@@ -91,8 +87,8 @@ do_start()
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
-       if $DAEMON -D$PIDFILE.$1 \
-           -p$@ -t$LOGDIR/access.${1}.log $4; then
+       if $DAEMON -u $DROP_TO_UID -D$PIDFILE.$1 \
+           -p$@ $4; then
            return 0
        else
            return 2
@@ -112,7 +108,8 @@ do_stop()
 
 do_reload() {
         do_stop
-        do_start
+       do_start $WEBCIT_HTTP_PORT $WEBCIT_CITADEL_IP $WEBCIT_CITADEL_PORT "" "$LISTEN"  "$WEBCIT_APACHEFLAG"
+       do_start $WEBCIT_HTTPS_PORT $WEBCIT_CITADEL_IP $WEBCIT_CITADEL_PORT -s "$LISTEN"  "$WEBCIT_APACHEFLAG"
        return 0
 }