diff --git a/devstack/lib/update b/devstack/lib/update index f9dbc8ae..c3648fdb 100644 --- a/devstack/lib/update +++ b/devstack/lib/update @@ -48,7 +48,6 @@ function install_sw_patch { $STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/patching $STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/patching/patch-scripts $STX_SUDO install -m 755 -d ${stx_patch_sysconfdir}/pmon.d - $STX_SUDO install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent } function install_update { diff --git a/patch-scripts/EXAMPLE_0002/scripts/example-cgcs-patch-restart b/patch-scripts/EXAMPLE_0002/scripts/example-cgcs-patch-restart index f128a3ba..c437cff7 100644 --- a/patch-scripts/EXAMPLE_0002/scripts/example-cgcs-patch-restart +++ b/patch-scripts/EXAMPLE_0002/scripts/example-cgcs-patch-restart @@ -26,12 +26,6 @@ # declare -i GLOBAL_RC=$PATCH_STATUS_OK -# -# First up, we'll handle restarting the patch-agent, which runs on all nodes -# Since the patch-agent is a delayed restart, there's no error to return -# -/usr/sbin/sw-patch-agent-restart - # # Next, handle restarting the patch-controller. # diff --git a/software/service-files/usm-initialize-init.sh b/software/service-files/usm-initialize-init.sh index 8118849c..7372b5b8 100755 --- a/software/service-files/usm-initialize-init.sh +++ b/software/service-files/usm-initialize-init.sh @@ -118,7 +118,6 @@ refresh_init_links() { ln -s /usr/share/starlingx/pmon.d/sm.conf /etc/pmon.d/sm.conf ln -s /usr/share/starlingx/pmon.d/sshd.conf /etc/pmon.d/sshd.conf ln -s /usr/share/starlingx/pmon.d/sssd.conf /etc/pmon.d/sssd.conf - ln -s /usr/share/starlingx/pmon.d/sw-patch-agent.conf /etc/pmon.d/sw-patch-agent.conf ln -s /usr/share/starlingx/pmon.d/sw-patch-controller-daemon.conf /etc/pmon.d/sw-patch-controller-daemon.conf ln -s /usr/share/starlingx/pmon.d/sysinv-agent.conf /etc/pmon.d/sysinv-agent.conf ln -s /usr/share/starlingx/pmon.d/syslog-ng.conf /etc/pmon.d/syslog-ng.conf @@ -142,7 +141,6 @@ refresh_init_links() { ln -s /usr/share/starlingx/pmon.d/sm-eru.conf /etc/pmon.d/sm-eru.conf ln -s /usr/share/starlingx/pmon.d/sshd.conf /etc/pmon.d/sshd.conf ln -s /usr/share/starlingx/pmon.d/sssd.conf /etc/pmon.d/sssd.conf - ln -s /usr/share/starlingx/pmon.d/sw-patch-agent.conf /etc/pmon.d/sw-patch-agent.conf ln -s /usr/share/starlingx/pmon.d/sysinv-agent.conf /etc/pmon.d/sysinv-agent.conf ln -s /usr/share/starlingx/pmon.d/syslog-ng.conf /etc/pmon.d/syslog-ng.conf fi @@ -160,7 +158,6 @@ refresh_init_links() { ln -s /usr/share/starlingx/pmon.d/sm-eru.conf /etc/pmon.d/sm-eru.conf ln -s /usr/share/starlingx/pmon.d/sshd.conf /etc/pmon.d/sshd.conf ln -s /usr/share/starlingx/pmon.d/sssd.conf /etc/pmon.d/sssd.conf - ln -s /usr/share/starlingx/pmon.d/sw-patch-agent.conf /etc/pmon.d/sw-patch-agent.conf ln -s /usr/share/starlingx/pmon.d/sysinv-agent.conf /etc/pmon.d/sysinv-agent.conf ln -s /usr/share/starlingx/pmon.d/syslog-ng.conf /etc/pmon.d/syslog-ng.conf fi diff --git a/sw-patch/bin/pmon-sw-patch-agent.conf b/sw-patch/bin/pmon-sw-patch-agent.conf deleted file mode 100644 index 09872dab..00000000 --- a/sw-patch/bin/pmon-sw-patch-agent.conf +++ /dev/null @@ -1,19 +0,0 @@ -[process] -process = sw-patch-agent -pidfile = /var/run/sw-patch-agent.pid -script = /etc/init.d/sw-patch-agent -style = lsb ; ocf or lsb -severity = major ; Process failure severity - ; critical : host is failed - ; major : host is degraded - ; minor : log is generated -restarts = 3 ; Number of back to back unsuccessful restarts before severity assertion -interval = 5 ; Number of seconds to wait between back-to-back unsuccessful restarts -debounce = 20 ; Number of seconds the process needs to run before declaring - ; it as running O.K. after a restart. - ; Time after which back-to-back restart count is cleared. -startuptime = 10 ; Seconds to wait after process start before starting the debounce monitor -mode = passive ; Monitoring mode: passive (default) or active - ; passive: process death monitoring (default: always) - ; active: heartbeat monitoring, i.e. request / response messaging - diff --git a/sw-patch/bin/sw-patch-agent b/sw-patch/bin/sw-patch-agent deleted file mode 100755 index 427ed176..00000000 --- a/sw-patch/bin/sw-patch-agent +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python - -""" -Copyright (c) 2014 Wind River Systems, Inc. - -SPDX-License-Identifier: Apache-2.0 - -""" - -import sys - -from cgcs_patch.patch_agent import main - -if __name__ == "__main__": - main() - diff --git a/sw-patch/bin/sw-patch-agent-init.sh b/sw-patch/bin/sw-patch-agent-init.sh deleted file mode 100755 index d17ae901..00000000 --- a/sw-patch/bin/sw-patch-agent-init.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2014-2015 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -# chkconfig: 345 26 30 - -### BEGIN INIT INFO -# Provides: sw-patch-agent -# Required-Start: $syslog -# Required-Stop: $syslog -# Default-Start: 2 3 5 -# Default-Stop: 0 1 6 -# Short-Description: sw-patch-agent -# Description: Provides the CGCS Patch Agent Daemon -### END INIT INFO - -DESC="sw-patch-agent" -DAEMON="/usr/sbin/sw-patch-agent" -PIDFILE="/var/run/sw-patch-agent.pid" -PATCH_INSTALLING_FILE="/var/run/patch_installing" - -start() -{ - if [ -e $PIDFILE ]; then - PIDDIR=/proc/$(cat $PIDFILE) - if [ -d ${PIDDIR} ]; then - echo "$DESC already running." - exit 1 - else - echo "Removing stale PID file $PIDFILE" - rm -f $PIDFILE - fi - fi - - echo -n "Starting $DESC..." - - start-stop-daemon --start --quiet --background \ - --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} - - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed." - fi -} - -stop() -{ - if [ -f $PATCH_INSTALLING_FILE ]; then - echo "Patches are installing. Waiting for install to complete." - while [ -f $PATCH_INSTALLING_FILE ]; do - # Verify the agent is still running - pid=$(cat $PATCH_INSTALLING_FILE) - cat /proc/$pid/cmdline 2>/dev/null | grep -q $DAEMON - if [ $? -ne 0 ]; then - echo "Patch agent not running." - break - fi - sleep 1 - done - echo "Continuing with shutdown." - fi - - echo -n "Stopping $DESC..." - start-stop-daemon --stop --quiet --pidfile $PIDFILE - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed." - fi - rm -f $PIDFILE -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|force-reload) - stop - start - ;; - *) - echo "Usage: $0 {start|stop|force-reload|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/sw-patch/bin/sw-patch-agent-restart b/sw-patch/bin/sw-patch-agent-restart deleted file mode 100644 index 45e86798..00000000 --- a/sw-patch/bin/sw-patch-agent-restart +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -. /etc/patching/patch-functions - -# -# Triggering a restart of the patching daemons is done by -# creating a flag file and letting the daemon handle the restart. -# -loginfo "Requesting restart of patch-agent" - -restart_patch_agent_flag="/run/patching/.restart.patch-agent" -touch $restart_patch_agent_flag - -exit 0 - diff --git a/sw-patch/bin/sw-patch-agent.service b/sw-patch/bin/sw-patch-agent.service deleted file mode 100644 index de96e493..00000000 --- a/sw-patch/bin/sw-patch-agent.service +++ /dev/null @@ -1,27 +0,0 @@ -[Unit] -Description=StarlingX Patching Agent -After=syslog.target network-online.target sw-patch.service -Before=pmon.service - -[Service] -Type=forking -User=root -ExecStart=/etc/init.d/sw-patch-agent start -ExecStop=/etc/init.d/sw-patch-agent stop -ExecReload=/etc/init.d/sw-patch-agent restart -PIDFile=/var/run/sw-patch-agent.pid - -# cgroup performance engineering -# - sw-patch-agent.service does not provide latency critical service -# - ostree pull, ostree admin processes are 100% cpu hog; -# these do significant disk read and write IO -# - set 1/8th default share -# - set lower IO priority (effective only with 'bfq' scheduler) -CPUShares=128 -Nice=19 -IOSchedulingClass=best-effort -IOSchedulingPriority=7 - -[Install] -WantedBy=multi-user.target - diff --git a/sw-patch/bin/sw-patch-controller.service b/sw-patch/bin/sw-patch-controller.service index d40535a7..9651013d 100644 --- a/sw-patch/bin/sw-patch-controller.service +++ b/sw-patch/bin/sw-patch-controller.service @@ -1,7 +1,7 @@ [Unit] Description=StarlingX Patching Controller After=syslog.service network-online.target sw-patch.service -Before=sw-patch-agent.service sw-patch-controller-daemon.service +Before=sw-patch-controller-daemon.service [Service] Type=oneshot diff --git a/sw-patch/bin/sw-patch-init.sh b/sw-patch/bin/sw-patch-init.sh index 5c2d79bf..2201ab57 100644 --- a/sw-patch/bin/sw-patch-init.sh +++ b/sw-patch/bin/sw-patch-init.sh @@ -123,58 +123,6 @@ if [ ${FOUND} -eq 0 ]; then fi RC=0 -case "$1" in - start) - if [ "${system_mode}" = "simplex" ]; then - # On a simplex CPE, we need to launch the http server first, - # before we can do the patch installation - LOG_TO_FILE "***** Launching lighttpd *****" - /etc/init.d/lighttpd start - - LOG_TO_FILE "***** Starting patch operation *****" - /usr/sbin/sw-patch-agent --install 2>>$logfile - if [ -f ${patch_failed_file} ]; then - RC=1 - LOG_TO_FILE "***** Patch operation failed *****" - fi - LOG_TO_FILE "***** Finished patch operation *****" - - LOG_TO_FILE "***** Shutting down lighttpd *****" - /etc/init.d/lighttpd stop - else - check_install_uuid - if [ $? -ne 0 ]; then - # The INSTALL_UUID doesn't match the active controller, so exit - exit 1 - fi - - LOG_TO_FILE "***** Starting patch operation *****" - /usr/sbin/sw-patch-agent --install 2>>$logfile - if [ -f ${patch_failed_file} ]; then - RC=1 - LOG_TO_FILE "***** Patch operation failed *****" - fi - LOG_TO_FILE "***** Finished patch operation *****" - fi - - check_for_rr_patch - ;; - stop) - # Nothing to do here - ;; - restart) - LOG_TO_FILE "***** Starting patch operation *****" - /usr/sbin/sw-patch-agent --install 2>>$logfile - if [ -f ${patch_failed_file} ]; then - RC=1 - LOG_TO_FILE "***** Patch operation failed *****" - fi - LOG_TO_FILE "***** Finished patch operation *****" - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 -esac exit $RC diff --git a/sw-patch/bin/sw-patch.service b/sw-patch/bin/sw-patch.service index 6c7a80fa..f8ac3b56 100644 --- a/sw-patch/bin/sw-patch.service +++ b/sw-patch/bin/sw-patch.service @@ -1,7 +1,6 @@ [Unit] Description=StarlingX Patching After=syslog.target network-online.target -Before=sw-patch-agent.service [Service] Type=oneshot diff --git a/sw-patch/debian/deb_folder/cgcs-patch-agent.dirs b/sw-patch/debian/deb_folder/cgcs-patch-agent.dirs deleted file mode 100644 index ba89452f..00000000 --- a/sw-patch/debian/deb_folder/cgcs-patch-agent.dirs +++ /dev/null @@ -1,3 +0,0 @@ -etc/init.d -lib/systemd/system -usr/sbin diff --git a/sw-patch/debian/deb_folder/cgcs-patch-agent.install b/sw-patch/debian/deb_folder/cgcs-patch-agent.install deleted file mode 100644 index 237a8d26..00000000 --- a/sw-patch/debian/deb_folder/cgcs-patch-agent.install +++ /dev/null @@ -1,5 +0,0 @@ -etc/init.d/sw-patch-agent -lib/systemd/system/sw-patch-agent.service -usr/sbin/sw-patch-agent -usr/sbin/sw-patch-agent-restart -usr/share/starlingx/pmon.d/sw-patch-agent.conf diff --git a/sw-patch/debian/deb_folder/cgcs-patch-agent.lintian-overrides b/sw-patch/debian/deb_folder/cgcs-patch-agent.lintian-overrides deleted file mode 100644 index a6221dfc..00000000 --- a/sw-patch/debian/deb_folder/cgcs-patch-agent.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -init.d-script-missing-dependency-on-local_fs -non-standard-file-permissions-for-etc-init.d-script diff --git a/sw-patch/debian/deb_folder/rules b/sw-patch/debian/deb_folder/rules index a6f04981..64a1d552 100755 --- a/sw-patch/debian/deb_folder/rules +++ b/sw-patch/debian/deb_folder/rules @@ -33,24 +33,18 @@ override_dh_install: install -m 755 -d ${DEBIAN_DESTDIR}/lib/systemd/system install -m 755 -d ${PMONDIR} - install -m 500 bin/sw-patch-agent \ - ${DEBIAN_DESTDIR}/usr/sbin/sw-patch-agent install -m 500 bin/sw-patch-controller-daemon \ ${DEBIAN_DESTDIR}/usr/sbin/sw-patch-controller-daemon install -m 555 bin/sw-patch \ ${DEBIAN_DESTDIR}/usr/sbin/sw-patch install -m 500 bin/sw-patch-controller-daemon-init.sh \ ${DEBIAN_DESTDIR}/etc/init.d/sw-patch-controller-daemon - install -m 500 bin/sw-patch-agent-init.sh \ - ${DEBIAN_DESTDIR}/etc/init.d/sw-patch-agent install -m 600 bin/patching.conf \ ${DEBIAN_DESTDIR}/etc/patching/patching.conf install -m 644 bin/policy.json \ ${DEBIAN_DESTDIR}/etc/patching/policy.json install -m 444 bin/pmon-sw-patch-controller-daemon.conf \ ${PMONDIR}/sw-patch-controller-daemon.conf - install -m 444 bin/pmon-sw-patch-agent.conf \ - ${PMONDIR}/sw-patch-agent.conf install -m 444 bin/*.service \ ${DEBIAN_DESTDIR}/lib/systemd/system install -m 444 bin/sw-patch.completion \ @@ -63,8 +57,6 @@ override_dh_install: ${DEBIAN_DESTDIR}/usr/sbin/run-patch-scripts install -m 500 bin/sw-patch-controller-daemon-restart \ ${DEBIAN_DESTDIR}/usr/sbin/sw-patch-controller-daemon-restart - install -m 500 bin/sw-patch-agent-restart \ - ${DEBIAN_DESTDIR}/usr/sbin/sw-patch-agent-restart install -m 500 bin/sw-patch-init.sh \ ${DEBIAN_DESTDIR}/etc/init.d/sw-patch install -m 500 bin/sw-patch-controller-init.sh \