Skip to content

Commit f1a4fbb

Browse files
authored
[FeatureD] Add featured systemd files in host-services and update submodule (#15815)
### Why I did it - Hostcfgd is handling a lot of tasks and Feature table is by itself an important and big task which can benefit from separation into a new daemon - Currently, Hostcfgd handles feature table first before other tables an thus other taska such as Aaa, Ntp are delayed. With the split, they can run in paralell - After the recent config-reload enhancements, Hostcfgd uses a multi-threading approach to listen to PortInitDone. BY splitting the daemon into two, we can avoid having a separate thread by using SubscriberStateTable and Select,. #### Note: Depends on host-services PR : sonic-net/sonic-host-services#71 Once the host-services is merged, updating the submodule along with this PR should fix the CI problem #### How I did it Refactor the feature related tasks from hostcfgd into a seperate daemon. #### How to verify it UT's and Tested on DUT ``` admin@r-tigris-22:~$ show logging -f | grep featured Jun 28 22:13:33.870021 r-tigris-22 INFO featured: ConfigDB connect success Jun 28 22:14:05.638063 r-tigris-22 INFO featured: Updating feature 'radv' systemd config file related to auto-restart ... Jun 28 22:14:06.169184 r-tigris-22 INFO featured: Feature radv is enabled and started Jun 28 22:14:06.172343 r-tigris-22 INFO featured: Updating feature 'sflow' systemd config file related to auto-restart ... Jun 28 22:14:06.844322 r-tigris-22 INFO featured: Feature sflow is stopped and disabled Jun 28 22:14:06.846761 r-tigris-22 INFO featured: Updating feature 'snmp' systemd config file related to auto-restart ... Jun 28 22:14:07.129090 r-tigris-22 INFO featured: Feature is snmp delayed for port init Jun 28 22:14:07.132052 r-tigris-22 INFO featured: Updating feature 'swss' systemd config file related to auto-restart ... Jun 28 22:14:08.368948 r-tigris-22 INFO featured: Feature swss is enabled and started Jun 28 22:14:08.369240 r-tigris-22 INFO featured: Updating feature 'syncd' systemd config file related to auto-restart ... Jun 28 22:14:08.718357 r-tigris-22 INFO featured: Feature syncd is enabled and started Jun 28 22:14:08.721496 r-tigris-22 INFO featured: Updating feature 'teamd' systemd config file related to auto-restart ... Jun 28 22:14:09.042495 r-tigris-22 INFO featured: Feature teamd is enabled and started Jun 28 22:14:09.045441 r-tigris-22 INFO featured: Updating feature 'telemetry' systemd config file related to auto-restart ... Jun 28 22:14:09.359831 r-tigris-22 INFO featured: Feature is telemetry delayed for port init Jun 28 22:14:30.740499 r-tigris-22 INFO featured: Updating delayed features after port initialization Jun 28 22:14:33.914178 r-tigris-22 INFO featured: Feature lldp is enabled and started Jun 28 22:14:35.536264 r-tigris-22 INFO featured: Feature mgmt-framework is enabled and started Jun 28 22:14:38.098571 r-tigris-22 INFO featured: Feature snmp is enabled and started Jun 28 22:14:39.555727 r-tigris-22 INFO featured: Feature telemetry is enabled and started Jun 28 22:13:33.977011 r-tigris-22 INFO hostcfgd: ConfigDB connect success Jun 28 22:13:33.993878 r-tigris-22 INFO hostcfgd: Waiting for systemctl to finish initialization Jun 28 22:13:34.274818 r-tigris-22 INFO hostcfgd: systemctl has finished initialization -- proceeding ... Jun 28 22:13:34.391623 r-tigris-22 INFO hostcfgd: file size check pass: /etc/pam.d/sshd size is (2139) bytes Jun 28 22:13:34.427273 r-tigris-22 INFO hostcfgd: file size check pass: /etc/pam.d/login size is (4132) bytes Jun 28 22:13:34.433390 r-tigris-22 INFO hostcfgd: file size check pass: /etc/nsswitch.conf size is (494) bytes Jun 28 22:13:34.455110 r-tigris-22 INFO hostcfgd: file size check pass: /etc/nsswitch.conf size is (494) bytes Jun 28 22:13:34.478882 r-tigris-22 INFO hostcfgd: Found audisp-tacplus PID: 442 Jun 28 22:13:34.482365 r-tigris-22 INFO hostcfgd: cmd - ['service', 'aaastatsd', 'stop'] Jun 28 22:13:36.108569 r-tigris-22 INFO hostcfgd: NtpCfg load ... Jun 28 22:13:36.108699 r-tigris-22 INFO hostcfgd: ntp server update key 0 Jun 28 22:13:36.108763 r-tigris-22 INFO hostcfgd: ntp server update, restarting ntp-config, ntp servers configured set() Jun 28 22:14:06.691693 r-tigris-22 INFO hostcfgd: KdumpCfg init ... Jun 28 22:14:06.691771 r-tigris-22 DEBUG hostcfgd: passw_policies_update - key: POLICIES Jun 28 22:14:06.691832 r-tigris-22 DEBUG hostcfgd: passw_policies_update - data: {'digits_class': 'true', 'expiration': '180', 'expiration_warning': '15', 'history_cnt': '10', 'len_min': '8', 'lower_class': 'true', 'reject_user_passw_match': 'true', 'special_class': 'true', 'state': 'disabled', 'upper_class': 'true'} Jun 28 22:14:06.691891 r-tigris-22 DEBUG hostcfgd: modify_conf_file: passw_policies - {'digits_class': True, 'expiration': '180', 'expiration_warning': '15', 'history_cnt': '10', 'len_min': '8', 'lower_class': True, 'reject_user_passw_match': True, 'special_class': True, 'state': 'disabled', 'upper_class': True} Jun 28 22:14:06.701982 r-tigris-22 DEBUG hostcfgd: Initial hostname: r-tigris-22 Jun 28 22:14:06.702075 r-tigris-22 DEBUG hostcfgd: Initial mgmt interface conf: {('eth0', '10.210.24.108/22'): {'gwaddr': '10.210.24.1'}} Jun 28 22:14:06.702115 r-tigris-22 DEBUG hostcfgd: Initial mgmt VRF state: Jun 28 22:14:06.702177 r-tigris-22 INFO hostcfgd: RSyslogCfg: Initial config: {'config': {'GLOBAL': {'rate_limit_burst': '0', 'rate_limit_interval': '0'}}, 'servers': {}} Jun 28 22:14:06.709455 r-tigris-22 INFO hostcfgd[39326]: Failed to restart resolv-config.service: Unit resolv-config.service not found. Jun 28 22:14:06.709560 r-tigris-22 ERR hostcfgd: ['systemctl', 'restart', 'resolv-config'] - failed: return code - 5, output:#012None admin@r-tigris-22:~$ Connection to r-tigris-22 closed by remote host. ```
1 parent abccdae commit f1a4fbb

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

src/sonic-host-services-data/debian/rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ build:
1515
override_dh_installsystemd:
1616
dh_installsystemd --no-start --name=caclmgrd
1717
dh_installsystemd --no-start --name=hostcfgd
18+
dh_installsystemd --no-start --name=featured
1819
dh_installsystemd --no-start --name=aaastatsd
1920
dh_installsystemd --no-start --name=procdockerstatsd
2021
dh_installsystemd --no-start --name=determine-reboot-cause
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Feature configuration daemon
3+
Requires=updategraph.service
4+
After=updategraph.service
5+
BindsTo=sonic.target
6+
After=sonic.target
7+
8+
[Service]
9+
Type=simple
10+
ExecStart=/usr/local/bin/featured
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Delays feature daemon until SONiC has started
3+
PartOf=featured.service
4+
5+
[Timer]
6+
OnUnitActiveSec=0 sec
7+
OnBootSec=1min 30 sec
8+
Unit=featured.service
9+
10+
[Install]
11+
WantedBy=timers.target sonic.target
12+

0 commit comments

Comments
 (0)