Skip to content

Commit

Permalink
Add possibility to restart single slave
Browse files Browse the repository at this point in the history
  • Loading branch information
jollyroger committed Oct 19, 2014
1 parent 6d327e4 commit e79649a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions master/contrib/init-scripts/buildmaster.init.sh
Expand Up @@ -125,7 +125,9 @@ function master_op () {
function do_op () {
errors=0
for i in $( seq ${#MASTER_ENABLED[@]} ); do
if is_disabled "${MASTER_ENABLED[$i]}" ; then
if [ -n "$4" ] && [ "$4" != "${MASTER_NAME[$i]}" ] ; then
continue
elif is_disabled "${MASTER_ENABLED[$i]}" && [ -z "$4" ] ; then
continue
fi

Expand All @@ -152,19 +154,19 @@ function do_op () {

case "$1" in
start)
do_op "master_op" "start" "Starting buildmaster"
do_op "master_op" "start" "Starting buildmaster" "$2"
exit $?
;;
stop)
do_op "master_op" "stop" "Stopping buildmaster"
do_op "master_op" "stop" "Stopping buildmaster" "$2"
exit $?
;;
reload)
do_op "master_op" "reconfig" "Reloading buildmaster"
do_op "master_op" "reconfig" "Reloading buildmaster" "$2"
exit $?
;;
restart|force-reload)
do_op "master_op" "restart" "Restarting buildmaster"
do_op "master_op" "restart" "Restarting buildmaster" "$2"
exit $?
;;
*)
Expand Down
12 changes: 7 additions & 5 deletions slave/contrib/init-scripts/buildslave.init.sh
Expand Up @@ -157,7 +157,9 @@ function slave_op () {
function do_op () {
errors=0
for i in $( seq ${#SLAVE_ENABLED[@]} ); do
if is_disabled "${SLAVE_ENABLED[$i]}" ; then
if [ -n "$4" ] && [ "$4" != "${SLAVE_NAME[$i]}" ] ; then
continue
elif is_disabled "${SLAVE_ENABLED[$i]}" && [ -z "$4" ] ; then
continue
fi

Expand All @@ -184,19 +186,19 @@ function do_op () {

case "$1" in
start)
do_op "slave_op" "start" "Starting buildslave"
do_op "slave_op" "start" "Starting buildslave" "$2"
exit $?
;;
stop)
do_op "slave_op" "stop" "Stopping buildslave"
do_op "slave_op" "stop" "Stopping buildslave" "$2"
exit $?
;;
reload)
do_op "slave_op" "reload" "Reloading buildslave"
do_op "slave_op" "reload" "Reloading buildslave" "$2"
exit $?
;;
restart|force-reload)
do_op "slave_op" "restart" "Restarting buildslave"
do_op "slave_op" "restart" "Restarting buildslave" "$2"
exit $?
;;
*)
Expand Down

0 comments on commit e79649a

Please sign in to comment.