diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-04-14 19:05:03 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-04-14 19:10:20 +0200 |
commit | 4a130afba58836ebb2f70a31c88588ea46017009 (patch) | |
tree | 200816c2c7525e76228559e6b0ee81dc46980c14 /vagrant_support/bugzilla-push | |
parent | 480bbf368b485a6a0317b9356ce90b75201b3efa (diff) | |
download | bugzilla-4a130afba58836ebb2f70a31c88588ea46017009.tar.gz bugzilla-4a130afba58836ebb2f70a31c88588ea46017009.tar.xz |
Bug 1328874 - Add Vagrantfile for production-like development VMs
Diffstat (limited to 'vagrant_support/bugzilla-push')
-rwxr-xr-x | vagrant_support/bugzilla-push | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/vagrant_support/bugzilla-push b/vagrant_support/bugzilla-push new file mode 100755 index 000000000..995b0d44c --- /dev/null +++ b/vagrant_support/bugzilla-push @@ -0,0 +1,112 @@ +#!/bin/bash +# +# bugzilla-push This starts, stops, and restarts the Bugzilla push +# daemon, which manages syncronising bugzilla.mozilla.org and +# third party bugzilla installs. +# +# chkconfig: 345 85 15 +# description: Bugzilla push daemon +# +### BEGIN INIT INFO +# Provides: bugzilla-push +# Required-Start: $local_fs $syslog MTA mysqld +# Required-Stop: $local_fs $syslog MTA mysqld +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Start and stop the Bugzilla push daemon. +# Description: The Bugzilla push daemon (bugzilla-pushd.pl) +# +# +# +### END INIT INFO + +NAME=`basename $0` + +################# +# Configuration # +################# + +# This should be the path to your Bugzilla +BUGZILLA=/data/www/bugzilla.mozilla.org +# Who owns the Bugzilla directory and files? +USER=root + +# If you want to pass any options to the daemon (like -d for debugging) +# specify it here. +OPTIONS="" + +# You can also override the configuration by creating a +# /etc/sysconfig/bugzilla-queue file so that you don't +# have to edit this script. +if [ -r /etc/sysconfig/$NAME ]; then + . /etc/sysconfig/$NAME +fi + +########## +# Script # +########## + +RETVAL=0 +BIN=$BUGZILLA/extensions/Push/bin/bugzilla-pushd.pl +PIDFILE=/var/run/$NAME.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +usage () +{ + echo "Usage: service $NAME {start|stop|status|restart|condrestart}" + RETVAL=1 +} + + +start () +{ + if [ -f "$PIDFILE" ]; then + checkpid `cat $PIDFILE` && return 0 + fi + echo -n "Starting $NAME: " + touch $PIDFILE + chown $USER $PIDFILE + daemon --user=$USER "cd $BUGZILLA && $BIN ${OPTIONS} -p '$PIDFILE' -n $NAME start > /dev/null" + ret=$? + [ $ret -eq "0" ] && touch /var/lock/subsys/$NAME + echo + return $ret +} + +stop () +{ + [ -f /var/lock/subsys/$NAME ] || return 0 + echo -n "Killing $NAME: " + killproc $NAME + echo + rm -f /var/lock/subsys/$NAME +} + +restart () +{ + stop + start +} + +condrestart () +{ + [ -e /var/lock/subsys/$NAME ] && restart || return 0 +} + +status () +{ + cd $BUGZILLA && $BIN -p $PIDFILE -n $NAME check +} + +case "$1" in + start) start; RETVAL=$? ;; + stop) stop; RETVAL=$? ;; + status) status; RETVAL=$?;; + restart) restart; RETVAL=$? ;; + condrestart) condrestart; RETVAL=$? ;; + *) usage ; RETVAL=2 ;; +esac + +exit $RETVAL |