TT#43700 Create a running file to denote that services is being executed

Although the NGCPCFG_RUNNING environment variable might be useful for
some of the subprocesses, it is definitely not useful for anything
that gets started via systemd. In that case we have to transmit this
information via the filesystem.

In the future we should probably extend this with some proper locking,
but for our current problem with ngcp-eaddres we'll still want to
completely avoid running if such file exists, not just prevent
multiple concurrent executions.

Change-Id: I0546620d8ef4263177c5d04f7d2546345c42fbb6
changes/08/24708/3
Guillem Jover 8 years ago
parent 106373c444
commit 3f0dee4844

@ -171,6 +171,7 @@ find_all_changed_services() {
# main script
RUNNING_FILE="${RUN_DIR}/ngcpcfg-services.running"
DRYRUN='false'
FORCE_ALL_SERVICES='false'
@ -182,6 +183,12 @@ fi
log_debug "DRYRUN = ${DRYRUN}"
log_debug "FORCE_ALL_SERVICES = ${FORCE_ALL_SERVICES}"
if ! ${DRYRUN}; then
log_debug "creating current execution filesystem trail"
trap 'rm -f "${RUNNING_FILE}"' EXIT ERR
echo $$ >"${RUNNING_FILE}"
fi
log_debug "systed_daemon_reload_preset function"
systed_daemon_reload_preset

Loading…
Cancel
Save