diff --git a/etc/init.d/bugzilla-jobs b/etc/init.d/bugzilla-jobs new file mode 100755 index 0000000..5460191 --- /dev/null +++ b/etc/init.d/bugzilla-jobs @@ -0,0 +1,45 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: bugzilla-jobs +# Required-Start: $local_fs $remote_fs $network $syslog +# Required-Stop: $local_fs $remote_fs $network $syslog +# Should-Start: bugzilla +# 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/bugzilla +CONFIG=/etc/bugzilla-http.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 diff --git a/home/start.sh b/home/start.sh index 903f546..dc3f6cb 100755 --- a/home/start.sh +++ b/home/start.sh @@ -5,6 +5,7 @@ export LC_ALL=ru_RU.UTF-8 LANG=ru_RU.UTF-8 service sphinxsearch start service mysql start service bugzilla start +service bugzilla-jobs start # Keep container running tail -fn0 /dev/null