From 3f0dee484405ab41bbb3d4a44548aaeb9fd12a3a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 13 Nov 2018 01:12:53 +0100 Subject: [PATCH] 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 --- scripts/services | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/services b/scripts/services index c8dbb5bb..4125459e 100755 --- a/scripts/services +++ b/scripts/services @@ -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