Soaking collectd restart with pmond out of the picture.
#!/bin/bash
LOOPS=1000
old_pid=`cat /var/run/collectd.pid`
for ((loop=0;loop<${LOOPS};loop++))
do
date
systemctl restart collectd
sleep 5
if [ ! -e /var/run/collectd.pid ] ; then
echo "No PIDFILE";
exit 1
fi
new_pid=`cat /var/run/collectd.pid`
if [ "$old_pid" == "$new_pid" ] ; then
echo "Error: same PID"
exit 2
fi
echo "New Pid $loop: $new_pid"
old_pid=$new_pid
done
Soaking collectd restart with pmond out of the picture.
#!/bin/bash collectd. pid` 0;loop< ${LOOPS} ;loop++ )) collectd. pid ] ; then collectd. pid` pid=$new_ pid
LOOPS=1000
old_pid=`cat /var/run/
for ((loop=
do
date
systemctl restart collectd
sleep 5
if [ ! -e /var/run/
echo "No PIDFILE";
exit 1
fi
new_pid=`cat /var/run/
if [ "$old_pid" == "$new_pid" ] ; then
echo "Error: same PID"
exit 2
fi
echo "New Pid $loop: $new_pid"
old_
done