sonic-buildimage/files/image_config
yozhao101 af97e23686
[hostcfgd] Enable/disable the container service only when the feature state was changed. (#5689)
**- Why I did it**
If we ran the CLI commands `sudo config feature autorestart snmp disabled/enabled` or `sudo config feature autorestart swss disabled/enabled`, then SNMP container will be stopped and started. This behavior was not expected since we updated the `auto_restart` field not update `state` field in `FEATURE` table. The reason behind this issue is that either `state` field or `auto_restart` field was updated, the function `update_feature_state(...)` will be invoked which then starts snmp.timer service.
The snmp.timer service will first stop snmp.service and later start snmp.service. 

In order to solve this issue, the function `update_feature_state(...)` will be only invoked if `state` field in `FEATURE` table was
updated.

**- How I did it**
When the demon `hostcfgd` was activated, all the values of `state` field in `FEATURE` table of each container will be
cached. Each time the function `feature_state_handler(...)` is invoked, it will determine whether the `state` field of a
container was changed or not. If it was changed, function `update_feature_state(...)` will be invoked and the cached
value will also be updated. Otherwise, nothing will be done.

**- How to verify it**
We can run the CLI commands `sudo config feature autorestart snmp disabled/enabled` or `sudo config feature autorestart swss disabled/enabled` to check whether SNMP container is stopped and started. We also can run the CLI commands  `sudo config feature state snmp disabled/enabled` or `sudo config feature state swss disabled/enabled` to check whether the container is stopped and restarted.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
2020-10-22 20:01:07 -07:00
..
apt change image apt source list from stretch to buster for arm 2020-05-25 13:15:19 +00:00
bash [baseimage]: Increase TMOUT for serial port connections to 15 minutes (#3032) 2019-06-19 00:16:01 -07:00
caclmgrd [caclmgrd] Prevent unnecessary iptables updates (#5312) 2020-10-19 11:11:30 -07:00
config-chassisdb [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
config-setup [sonic-utilities] Build and install as a Python wheel package (#5409) 2020-09-20 20:16:42 -07:00
constants [bgpcfgd]: Dynamic BBR support (#5626) 2020-10-22 11:04:21 -07:00
corefile_uploader corefile uploader: Updates per review comments offline (#3915) 2019-12-30 13:01:03 -08:00
cron.d [core_cleanup] Fix issue where core_cleanup job runs too frequently (#3659) 2019-10-23 15:55:47 -07:00
ebtables [ebtbles] Replace binary config file to text config file for ebtables (#5252) 2020-09-03 17:27:07 -07:00
environment [image]: Update login message (#706) 2017-06-14 15:18:02 -07:00
fstrim [sonic-utilities] Build and install as a Python wheel package (#5409) 2020-09-20 20:16:42 -07:00
hostcfgd [hostcfgd] Enable/disable the container service only when the feature state was changed. (#5689) 2020-10-22 20:01:07 -07:00
hostname [hostname-config] improve hostname-config process (#3676) 2019-10-29 08:30:27 -07:00
interfaces [baseimage]: Change the loopback mask from /8 to /16 (#5353) 2020-09-15 15:29:48 -07:00
kubernetes [baseimage]: Install Kubernetes packages if enabled in image (#4374) 2020-04-13 08:41:18 -07:00
logrotate [logrotate] create separate logrotate.d config for update-alternatives (#5382) 2020-09-22 01:23:42 -07:00
misc [docker-wait-any] Use APIClient instead of Client according to API update 2020-04-17 04:51:51 +00:00
monit [Monit] Unmonitor the processes in containers which are disabled. (#5153) 2020-09-25 00:28:28 -07:00
ntp [ntp] disable ntp long jump (#4748) 2020-06-11 13:01:21 -07:00
pcie-check Fix bug with pcie-check.service (#5368) 2020-09-15 15:21:31 -07:00
platform [rc.local] separate configuration migration and grub installation logic (#5528) 2020-10-03 23:00:39 -07:00
procdockerstatsd [procdockerstatsd] Convert to Python 3 (#5657) 2020-10-19 09:46:02 -07:00
process-reboot-cause [process-reboot-cause] Use Logger class from sonic-py-common package (#5384) 2020-09-16 10:35:19 -07:00
rsyslog [docker-base]: Rate limit priority INFO and lower in syslog (#5666) 2020-10-20 11:52:46 -07:00
secureboot [platform] Add Support For Environment Variable File (#5010) 2020-07-31 17:59:09 -07:00
snmp mvrf_avoid_snmp_yml_config: made changes to pass SNMP config from con… (#4057) 2020-01-28 17:41:21 -08:00
sudoers [sonic-utilities] Build and install as a Python wheel package (#5409) 2020-09-20 20:16:42 -07:00
sysctl Set sock rx Buf size to 3MB. (#5566) 2020-10-15 14:40:59 -07:00
syslog [baseimage]: /host unmount timeout issue during reboot. (#5032) 2020-07-25 01:27:58 -07:00
system-health [system-health] Add support for monitoring system health (#4835) 2020-10-12 11:12:49 +03:00
systemd [services] Restart SwSS service upon unexpected critical process exit (#2845) 2019-05-01 08:02:38 -07:00
topology [platform] Add Support For Environment Variable File (#5010) 2020-07-31 17:59:09 -07:00
updategraph [platform] Add Support For Environment Variable File (#5010) 2020-07-31 17:59:09 -07:00
warmboot-finalizer [sonic-utilities] Build and install as a Python wheel package (#5409) 2020-09-20 20:16:42 -07:00
watchdog-control [sonic-utilities] Build and install as a Python wheel package (#5409) 2020-09-20 20:16:42 -07:00