Jim Gauld 443681e209 Support dockerd in-service patching with EXAMPLE_DOCKER script
This adds the EXAMPLE_DOCKER in-service patching script.
Packaging currently for CentOS, but script itself is generic.

The docker.service has required patching, so this supports future
patching.

Closes-Bug: 1996916
Depends-On: https://review.opendev.org/c/starlingx/utilities/+/865731

Test Plan:
PASS: CentOS: Apply/remove designer in-service patch including
      EXAMPLE_DOCKER and verify docker.service restarts.

Signed-off-by: Jim Gauld <james.gauld@windriver.com>
Change-Id: I2c630eac88da030af69240a2badd11f06cbd5475
2022-11-27 18:51:12 +00:00

43 lines
1.0 KiB
Bash

#!/bin/bash
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
#
# This script provides an in-service patching restart script for
# docker.service. This supports service and Drop-In file changes by
# issuing a systemctl daemon reload after the patch is applied.
#
#
# The patching subsystem provides a patch-functions bash source file
# with useful function and variable definitions.
#
. /etc/patching/patch-functions
#
# Declare an overall script return code
#
declare -i GLOBAL_RC=$PATCH_STATUS_OK
# Issue a systemd daemon-reload once the rpms have been installed and
# before the processes have been restarted.
systemctl daemon-reload
# processes that run on all nodes
processes_to_restart="dockerd"
/usr/local/sbin/patch-restart-processes ${processes_to_restart}
if [ $? != 0 ] ; then
loginfo "patching restart failed"
loginfo "... process-restart ${processes_to_restart}"
exit ${PATCH_STATUS_FAILED}
fi
#
# Exit the script with the overall return code
#
exit $GLOBAL_RC