- start-stop-daemon -S -b -p ${pidfile} --oknodo -q -a ${mcollectived} -- ${daemonopts}
- [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
+ if [ -f $pidfile ]; then
+ if [ -f "$(cat /proc/$(cat $pidfile)/exe > /dev/null)" ] ; then
+ echo MCollective appears to be running
+ exit 1
+ else
+ /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
+ [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
+ fi
+ else
+ /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
+ fi