-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
2.4.7
sleeping 10 seconds at restart is too slow (I think)
I propose, at least for moderns distributions (there where pgrep is present):
# diff -u misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd --- misc/init.d/fedora/core/zabbix_agentd 2015-11-29 23:00:31.000000000 +0100 +++ /etc/init.d/zabbix_agentd 2015-11-30 10:43:29.215831368 +0100 # Binary File BINARY_NAME=zabbix_agentd @@ -96,7 +96,17 @@ ;; restart) stop - sleep 10 + ((i=0)) + while pgrep -f $BASEDIR/sbin/$BINARY_NAME &> /dev/null; + do + echo -n "." + if [ $i -gt 20 ] + then + break; + fi + sleep 0.5 + ((i++)) + done
Additiionally, I would substitute ps | grep xxx | awk code with pgrep / pkill calls
Regards,