]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/stopdaemons.sh
CSRF Protection for login and new notice. Ticket #503
[quix0rs-gnu-social.git] / scripts / stopdaemons.sh
index d620472f05d2b4cde3dcbc83747c26e43ad11838..08e1d4714ff8643549864575fe5cbc333f0c4d5f 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # Laconica - a distributed open-source microblogging tool
+
 # Copyright (C) 2008, Controlez-Vous, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# This program tries to start the daemons for Laconica. Note that the 'maildaemon' needs to run as a mail filter.
+# This program tries to stop the daemons for Laconica that were
+# previously started by startdaemons.sh
+
+SDIR=`dirname $0`
+DIR=`php $SDIR/getpiddir.php`
+
+for f in jabberhandler ombhandler publichandler smshandler \
+        xmppconfirmhandler xmppdaemon; do
+
+       FILES="$DIR/$f.*.pid"
+       for ff in "$FILES" ; do
 
-export INSTALLDIR=$1
+               echo -n "Stopping $f..."
+               PID=`cat $ff`
+               kill -3 $PID
+               if kill -9 $PID ; then
+                       echo "DONE."
+               else
+                       echo "FAILED."
+               fi
+               rm -f $ff
+       done
+done
 
-/sbin/start-stop-daemon -K -m --pidfile=/var/run/xmppdaemon.pid
-/sbin/start-stop-daemon -K -m --pidfile=/var/run/xmppqueuehandler.pid
-/sbin/start-stop-daemon -K -m --pidfile=/var/run/xmppconfirmhandler.pid
-/sbin/start-stop-daemon -K -m --pidfile=/var/run/smsqueuehandler.pid
-/sbin/start-stop-daemon -K -m --pidfile=/var/run/ombqueuehandler.pid