Add init.d script for the job queue

master
Vitaliy Filippov 2014-05-19 16:53:41 +04:00
parent e91f12c4d1
commit 50716398b4
2 changed files with 47 additions and 3 deletions

View File

@ -9,10 +9,10 @@
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PIDFILE=/var/run/bugzilla.pid
DIR=/home/www/localhost/bugs3
CONFIG=$DIR/HTTP_Prefork.conf
NAME=bugzilla
PIDFILE=/var/run/bugzilla.pid
DIR=/home/www/bugzilla3
CONFIG=$DIR/HTTP_Prefork.conf
. /lib/lsb/init-functions

44
contrib/init.d/bugzilla-jobs Executable file
View File

@ -0,0 +1,44 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: bugzilla-jobs
# 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
# Short-Description: Start/stop Bugzilla job queue.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=bugzilla-jobs
DIR=/home/www/bugzilla3
CONFIG=$DIR/HTTP_Prefork.conf
USER=`grep ^user $CONFIG | awk '{print $2}'`
. /lib/lsb/init-functions
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
case "$1" in
start)
log_daemon_msg "Starting Bugzilla job queue" $NAME
su $USER -s /bin/sh -c "$DIR/jobqueue.pl start"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping Bugzilla job queue" $NAME
su $USER -s /bin/sh -c "$DIR/jobqueue.pl stop"
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting Bugzilla job queue" $NAME
su $USER -s /bin/sh -c "$DIR/jobqueue.pl restart"
log_end_msg $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0