]> code.citadel.org Git - citadel.git/blobdiff - webcit/debian/webcit.init
* drop down to nobody when up and running.
[citadel.git] / webcit / debian / webcit.init
index f867e8ad71828111782c19ddbc6d5ec31aada485..575c3dac20d1fd7a2cfd81badbe5dec375997f9e 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
@@ -22,7 +26,7 @@ SCRIPTNAME=/etc/init.d/webcit
 SENDCOMMAND=/usr/sbin/sendcommand
 DEFAULT=/etc/default/webcit
 LOGDIR=/var/log/webcit/
-
+UID=`id -u nobody`
 
 # Exit if the package is not installed
 [ -x "$DAEMON" ] || exit 0
@@ -54,7 +58,6 @@ unset LANGUAGE
 unset LC_ALL
 unset LOCALE
 
-
 if test -z "$TZ"; then
        if test -e /etc/timezone; then
                TZ=`cat /etc/timezone`
@@ -89,7 +92,7 @@ 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 \
+       if $DAEMON -u $UID -D$PIDFILE.$1 \
            -p$@ -t$LOGDIR/access.${1}.log $4; then
            return 0
        else
@@ -110,7 +113,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
 }