MT#16387 Report pending requested reboots

There are some times when a configuration, service or system upgrade
requires a reboot to take effect. When a component requires a reboot,
it will record this fact in the file system through the file
«/var/run/reboot-required», and «ngcpcfg status» will notify the user
that a reboot has been requested.

We use the «/var/run/reboot-required» because it is already being used
in the unattended-upgrades package on Debian/Ubuntu which does something
similar.

Change-Id: I43997bfb83892f67bd57bb55ad3ec0a41a5e088d
changes/62/3362/1
Guillem Jover 11 years ago
parent 50b08a355a
commit 301cb7cd3c

@ -32,6 +32,9 @@ TIME_FORMAT="+%F %T"
# directory holding files for internal state of ngcpcfg
TIMESTAMP_DIR='/var/lib/ngcpcfg/timestamps/'
# Run-time state directory
RUN_DIR='/var/run'
# validate configs using kwalify schema
VALIDATE_SCHEMA="false"
## END OF FILE #################################################################

@ -147,12 +147,26 @@ check_pending_actions() {
fi
}
check_reboot_requests() {
log_debug "check_requested_reboot"
log_info "Checking for pending reboot requests:"
if [ -f "${RUN_DIR}/reboot-required" ]; then
log_info "ACTION_NEEDED: configuration, service or system changes requested a reboot"
log_info "-> reboot the system at your earliest convenience"
else
log_info "OK: no reboot requested"
fi
}
if [ -z "${1:-}" ] ; then
check_local_state
check_push
check_etc_state
check_pending_actions
check_shared_storage "$@"
check_reboot_requests
fi
check_remote "$@"

Loading…
Cancel
Save