#!/bin/sh # # Legacy action script for "service angie upgrade" prog=angie angie=/usr/sbin/angie conffile=/etc/angie/angie.conf pidfile=/run/angie.pid oldbinpidfile=${pidfile}.oldbin ${angie} -t -c ${conffile} -q || exit 6 echo -n $"Starting new master $prog: " pkill -F ${pidfile} ${prog} --signal USR2 echo for i in `/usr/bin/seq 5`; do /bin/sleep 1 if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then echo -n $"Graceful shutdown of old $prog: " pkill -F ${oldbinpidfile} ${prog} --signal QUIT echo exit 0 fi done echo "Upgrade failed!" exit 1