sonic-buildimage/src
Stepan Blyshchak 9ce7c6d9fe
[hostcfgd] Configure service auto-restart in hostcfgd. (#5744)
Before this change, a process running inside every SONiC container dealt with FEATURE table 'auto_restart' field and depending on the value decided whether a container has to be killed or not.
If killed service auto restart mechanism restarts the container.
This change moves the logic from container to the host daemon - hostcfgd.
The 'auto_restart' handling is kept in supervisor-proc-exit-listener but now it is not required for container that wants to support auto restart feature.

hostcfgd refactoring - move feature handling in another class.
override systemd service Restart= setting from hostcfgd.
remove default systemd Restart=always.
Signed-off-by: Stepan Blyshchak stepanb@nvidia.com

- Why I did it

Remove the need to deal with container orchestration logic from the container itself. Leave this logic to the orchestrator - host OS.

- How I did it

hostcfgd configures 'Restart=' value for systemd service.

- How to verify it

root@r-tigon-11:/home/admin# sudo config feature autorestart lldp enabled
root@r-tigon-11:/home/admin# show feature status | grep lldp
lldp            enabled   enabled
root@r-tigon-11:/home/admin# docker exec -it lldp pkill -9 lldpd
root@r-tigon-11:/home/admin# docker ps -a | grep lldp
65058396277c        docker-lldp:latest                   "/usr/bin/docker-lld…"   2 days ago          Exited (0) 20 seconds ago                       lldp
root@r-tigon-11:/home/admin# docker ps -a | grep lldp
65058396277c        docker-lldp:latest                   "/usr/bin/docker-lld…"   2 days ago          Up 5 seconds                            lldp
root@r-tigon-11:/home/admin# sudo config feature autorestart lldp disabled
root@r-tigon-11:/home/admin# docker exec -it lldp pkill -9 lldpd
root@r-tigon-11:/home/admin# docker ps -a | grep lldp
65058396277c        docker-lldp:latest                   "/usr/bin/docker-lld…"   2 days ago          Up 35 seconds                           lldp
root@r-tigon-11:/home/admin# docker ps -a | grep lldp
65058396277c        docker-lldp:latest                   "/usr/bin/docker-lld…"   2 days ago          Exited (0) 3 seconds ago                       lldp
root@r-tigon-11:/home/admin# docker ps -a | grep lldp
65058396277c        docker-lldp:latest                   "/usr/bin/docker-lld…"   2 days ago          Exited (0) 39 seconds ago                       lldp
root@r-tigon-11:/home/admin#
2021-06-29 09:06:21 -07:00
..
bash [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
dhcpmon dhcpmon: support dual tor scenario (#7471) 2021-05-03 10:51:26 -07:00
ethtool [arm] support compile sonic arm image on arm server (#7285) 2021-04-18 08:17:57 -07:00
flashrom Flashrom refactoring for broadcom platforms (#7693) 2021-06-22 15:29:21 -07:00
gobgp Update go version to 1.11.2 for gobgp and telemetry (#2230) 2018-11-09 21:56:39 -08:00
hiredis [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
iccpd [iccpd] Fix the bug of iccp cmd show. (#5214) 2020-09-01 13:07:13 -07:00
ifupdown2 [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
initramfs-tools [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
iproute2 [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
iptables [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
isc-dhcp DHCP Relay: add option -si to support using src intf ip in relay (#7052) 2021-03-19 13:27:14 -07:00
ixgbe Reorganize .gitignore files (#4707) 2020-06-09 21:04:55 -07:00
kdump-tools [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
libnl3 [MPLS][libnl3] libnl patches for supporting MPLS 2021-06-16 15:08:23 -07:00
libteam [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
libyang Export libyang API "lyd_check_mandatory_tree" for Management framework (CVL) (#5714) 2021-01-14 16:47:57 -08:00
libyang1 [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
lldpd [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
lm-sensors [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
monit [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
mpdecimal [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
ntp [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
openssh [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
ptf@36a3e3d9ac [docker-sonic-mgmt] install ptf framework in mgmt container and upgrade ptf (#3239) 2019-07-30 10:19:48 -07:00
radius [radius]: RADIUS Management User Authentication (#7551) 2021-06-14 07:57:01 -07:00
redis [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
redis-dump-load@7585497951 [redis-dump-load] Update submodule (#5215) 2020-08-19 11:23:42 -07:00
redis-dump-load.patch [baseimage]: Build and install redis-dump-load Python 3 package in host image (#4661) 2020-05-30 05:52:27 -07:00
sflow [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
smartmontools [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
snmpd [arm] support compile sonic arm image on arm server (#7285) 2021-04-18 08:17:57 -07:00
socat [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
sonic-bgpcfgd [multi-asic] fix network command for internal loopback (#7878) 2021-06-24 12:02:01 -07:00
sonic-build-hooks Skip the web proxy when downloading from proxy endpoint (#7592) 2021-05-18 14:28:32 +08:00
sonic-config-engine [build]: Fix sonic-cfggen contextlib err (#7996) 2021-06-28 17:15:03 -07:00
sonic-ctrmgrd [Kubernetes]: The kube server could be used as http-proxy for docker (#7469) 2021-06-16 07:46:01 -07:00
sonic-dbsyncd@df46ed418e [submodule update] sonic-db-syncd (#7225) 2021-04-03 07:36:11 -07:00
sonic-device-data Add BRCM SOC Property to not count ACL drops towards interface RX_DRP… (#7945) 2021-06-23 18:09:47 -07:00
sonic-frr Add "bgp bestpath peer-type multipath-relax" to FRR (#5629) 2021-04-16 11:20:15 -07:00
sonic-frr-mgmt-framework Bump pyyaml from 5.3.1 to 5.4.1 (#6511) 2021-01-28 10:46:56 -08:00
sonic-host-services [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
sonic-host-services-data [radius] Management User Authentication Feature Issue (#7420) (#7503) 2021-05-01 10:25:20 -07:00
sonic-linux-kernel@fcf7cdcc4c [sonic-linux-kernel] submodule update (#7761) 2021-05-31 17:41:30 +03:00
sonic-mgmt-common@86c1108125 [sonic-mgmt-common] Update submodule (#6129) 2020-12-08 04:31:16 -08:00
sonic-mgmt-framework@3c3384cec8 Mgmt reorg -- submodule and build rules for sonic-mgmt-common (#4765) 2020-06-22 16:01:55 -07:00
sonic-platform-common@7670b49927 [sonic-platform-common] Update submodule (#7868) 2021-06-18 11:33:35 -07:00
sonic-platform-daemons@53639ded1e [sonic-platform-daemons] Advance submodule head (#7961) 2021-06-25 10:54:19 -07:00
sonic-py-common [sonic-py-common] Clear environment variables before running device_info tests (#7273) 2021-06-28 09:30:53 -07:00
sonic-py-swsssdk@6be76f4570 Update sonic-py-swsssdk. (#7889) 2021-06-24 08:05:58 -07:00
sonic-restapi@8d09602a9e [submodule]: Update restapi (#7213) 2021-04-01 22:40:55 -07:00
sonic-sairedis@0e2105a8e5 [sonic-saidredis]: Advance submodule (#7774) 2021-06-02 19:02:51 -07:00
sonic-snmpagent@28b9dfd3a2 [Submodule update] sonic-snmpagent (#7638) 2021-05-24 16:22:04 -07:00
sonic-swss@3226163654 [sonic-swss] submodule update (#8010) 2021-06-29 17:30:29 +03:00
sonic-swss-common@11db9ba640 [Submodule update] sonic-swss-common (#7812) 2021-06-08 08:28:21 -07:00
sonic-telemetry@6df988cce7 Telemetry submodule update (#7864) 2021-06-14 18:22:49 -07:00
sonic-utilities@5708497358 [sonic-utilities] submodule update (#7937) 2021-06-25 11:04:38 -07:00
sonic-yang-mgmt Add SONiC YANGs for Management Port, Management Interface, Management VRF and NTP. (#7252) 2021-06-18 11:47:45 -07:00
sonic-yang-models SONiC yang models for AAA and TACACS features (#7671) 2021-06-21 13:55:43 -07:00
sonic-ztp@4475750df0 [sonic-ztp] submodule update (#7984) 2021-06-27 09:56:27 +03:00
swig [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
system-health [dell]: System Health: Fix ASIC key issue in Dell platform (#6556) 2021-04-05 18:00:38 -07:00
systemd-sonic-generator Revert "[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7633)" 2021-06-09 08:20:23 -07:00
tacacs [tacacs]: do not modify local user if there is no priviledge 2021-02-06 12:28:52 -08:00
thrift Fix CVE-2017-1000487 security alert (#7173) 2021-03-31 22:45:06 -07:00
wpasupplicant [MACsec]: Set MACsec feature to be auto-start (#6678) 2021-02-23 13:22:45 -08:00