MT#6561 Make sure daemon executable is available before executing any actions

Otherwise we might run into situations like that:

| Removing ngcp-schema ...
| Force-reloading ngcp-panel to handle schema changes
| Force-reloading ngcp-www-csc to handle schema changes
| [....] Restarting web application: ngcp-www-csc  not runningstart-stop-daemon: unable to stat /usr/share/ngcp-www-csc/script/csc_fastcgi.pl (No such file or directory)
| [FAIL] error ... failed!
|  failed!
| invoke-rc.d: initscript ngcp-www-csc, action "force-reload" failed.
| dpkg: error processing ngcp-schema (--remove):
|  subprocess installed post-removal script returned error exit status 1
mr3.3.1
Michael Prokop 11 years ago
parent 74cce847d2
commit caeef94641

@ -26,6 +26,11 @@ NPROC=5
OPTIONS="--listen $USOCKET --daemon --pidfile $PIDFILE --nproc $NPROC"
if ! [ -x "$DAEMON" ] ; then
log_warning_msg "File $DAEMON not available/executable."
exit 0
fi
check_running() {
if [ -s $PIDFILE ]; then
kill -0 $(cat $PIDFILE) >/dev/null 2>&1

Loading…
Cancel
Save