-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[services] introduce sonic.target #5705
Conversation
admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 45cb06505f6a docker-sonic-telemetry:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes telemetry afb299c49d4c docker-snmp:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes snmp 5c75d20d71cf docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes mgmt-framework 3e0563cd556f docker-router-advertiser:latest "/usr/bin/docker-ini…" About an hour ago Up 12 minutes radv 65f94b300db1 docker-platform-monitor:latest "/usr/bin/docker_ini…" About an hour ago Up About a minute pmon 4ffadb5817aa docker-dhcp-relay:latest "/usr/bin/docker_ini…" About an hour ago Up 12 minutes dhcp_relay 65058396277c docker-lldp:latest "/usr/bin/docker-lld…" About an hour ago Up 12 minutes lldp f922b7a26b06 docker-syncd-mlnx:latest "/usr/bin/supervisord" About an hour ago Up 12 minutes syncd 4f3aaddcacf9 docker-teamd:latest "/usr/bin/supervisord" About an hour ago Up 13 minutes teamd c3622c5322b2 docker-orchagent:latest "/usr/bin/docker-ini…" About an hour ago Up 13 minutes swss 370acc8b2289 docker-fpm-frr:latest "/usr/bin/docker_ini…" About an hour ago Up 13 minutes bgp 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 13 minutes database admin@r-tigon-11:~$ sudo systemctl stop sonic.target admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 14 minutes database admin@r-tigon-11:~$ sudo systemctl restart sonic.target admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 45cb06505f6a docker-sonic-telemetry:latest "/usr/bin/supervisord" About an hour ago Up 11 seconds telemetry afb299c49d4c docker-snmp:latest "/usr/bin/supervisord" About an hour ago Up 6 seconds snmp 5c75d20d71cf docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" About an hour ago Up 8 seconds mgmt-framework 3e0563cd556f docker-router-advertiser:latest "/usr/bin/docker-ini…" About an hour ago Up 16 seconds radv 65f94b300db1 docker-platform-monitor:latest "/usr/bin/docker_ini…" About an hour ago Up 17 seconds pmon 4ffadb5817aa docker-dhcp-relay:latest "/usr/bin/docker_ini…" About an hour ago Up 17 seconds dhcp_relay 65058396277c docker-lldp:latest "/usr/bin/docker-lld…" About an hour ago Up 17 seconds lldp f922b7a26b06 docker-syncd-mlnx:latest "/usr/bin/supervisord" About an hour ago Up 18 seconds syncd 4f3aaddcacf9 docker-teamd:latest "/usr/bin/supervisord" About an hour ago Up About a minute teamd c3622c5322b2 docker-orchagent:latest "/usr/bin/docker-ini…" About an hour ago Up About a minute swss 370acc8b2289 docker-fpm-frr:latest "/usr/bin/docker_ini…" About an hour ago Up About a minute bgp 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 17 minutes database Signed-off-by: Stepan Blyschak <[email protected]>
What is the behavior if we issue systemctl start sonic.target when it is already started? Particularly, will it restart all 'wanted' services? What if the downstream service is started? What if downstream service is a oneshot timer which will start another service? |
@yxieca normal services are not touched, one-shot and timers get started, so delayed services restart as well as one-shot services. |
You may also want to apply these changes to this service file: https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-host-services-data/debian/sonic-host-services-data.procdockerstatsd.service |
'Conficts=' in timer units caused a problem when starting a timer causes restart of a service. Instead, 'PartOf=' is a better choice. 'PartOf=' will make the timer stop and restart togather with the service the timer is bound to, otherwise the timer OnUnitActiveSec expires imidiatelly when the service stops and starts it. Signed-off-by: Stepan Blyshchak <[email protected]>
To prevent restarts on 'systemctl start <service>'. Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 45cb06505f6a docker-sonic-telemetry:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes telemetry afb299c49d4c docker-snmp:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes snmp 5c75d20d71cf docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" About an hour ago Up 9 minutes mgmt-framework 3e0563cd556f docker-router-advertiser:latest "/usr/bin/docker-ini…" About an hour ago Up 12 minutes radv 65f94b300db1 docker-platform-monitor:latest "/usr/bin/docker_ini…" About an hour ago Up About a minute pmon 4ffadb5817aa docker-dhcp-relay:latest "/usr/bin/docker_ini…" About an hour ago Up 12 minutes dhcp_relay 65058396277c docker-lldp:latest "/usr/bin/docker-lld…" About an hour ago Up 12 minutes lldp f922b7a26b06 docker-syncd-mlnx:latest "/usr/bin/supervisord" About an hour ago Up 12 minutes syncd 4f3aaddcacf9 docker-teamd:latest "/usr/bin/supervisord" About an hour ago Up 13 minutes teamd c3622c5322b2 docker-orchagent:latest "/usr/bin/docker-ini…" About an hour ago Up 13 minutes swss 370acc8b2289 docker-fpm-frr:latest "/usr/bin/docker_ini…" About an hour ago Up 13 minutes bgp 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 13 minutes database admin@r-tigon-11:~$ sudo systemctl stop sonic.target admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 14 minutes database admin@r-tigon-11:~$ sudo systemctl restart sonic.target admin@r-tigon-11:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 45cb06505f6a docker-sonic-telemetry:latest "/usr/bin/supervisord" About an hour ago Up 11 seconds telemetry afb299c49d4c docker-snmp:latest "/usr/bin/supervisord" About an hour ago Up 6 seconds snmp 5c75d20d71cf docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" About an hour ago Up 8 seconds mgmt-framework 3e0563cd556f docker-router-advertiser:latest "/usr/bin/docker-ini…" About an hour ago Up 16 seconds radv 65f94b300db1 docker-platform-monitor:latest "/usr/bin/docker_ini…" About an hour ago Up 17 seconds pmon 4ffadb5817aa docker-dhcp-relay:latest "/usr/bin/docker_ini…" About an hour ago Up 17 seconds dhcp_relay 65058396277c docker-lldp:latest "/usr/bin/docker-lld…" About an hour ago Up 17 seconds lldp f922b7a26b06 docker-syncd-mlnx:latest "/usr/bin/supervisord" About an hour ago Up 18 seconds syncd 4f3aaddcacf9 docker-teamd:latest "/usr/bin/supervisord" About an hour ago Up About a minute teamd c3622c5322b2 docker-orchagent:latest "/usr/bin/docker-ini…" About an hour ago Up About a minute swss 370acc8b2289 docker-fpm-frr:latest "/usr/bin/docker_ini…" About an hour ago Up About a minute bgp 16f359ad4057 docker-database:latest "/usr/local/bin/dock…" About an hour ago Up 17 minutes database Signed-off-by: Stepan Blyschak <[email protected]>
'Conficts=' in timer units caused a problem when starting a timer causes restart of a service. Instead, 'PartOf=' is a better choice. 'PartOf=' will make the timer stop and restart togather with the service the timer is bound to, otherwise the timer OnUnitActiveSec expires imidiatelly when the service stops and starts it. Signed-off-by: Stepan Blyshchak <[email protected]>
To prevent restarts on 'systemctl start <service>'. Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
Please fix new conflicts, as hostcfgd has moved. Also please apply necessary changes to the other services in the new sonic-host-services package. |
Signed-off-by: Stepan Blyshchak <[email protected]>
@stepanblyschak: Has this been tested thoroughly? |
Signed-off-by: Stepan Blyshchak <[email protected]>
This was tested in different scenarios:
However, on recent master this change became broken because of #6115 wich introduced a cycle between ntp-config and ntp service. As a result config reload hangs forever. I am investigating further for a fix. |
Retest vsimage please |
Retest vsimage please |
Retest this please |
/AzurePipelines run |
Commenter does not have sufficient privileges for PR 5705 in repo Azure/sonic-buildimage |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@stepanblyschak can you resolve conflicts so we can have clean build and move forward with mergint it? this is an enhancement we would like to have in 202012 as well |
…_target Signed-off-by: Stepan Blyshchak <[email protected]>
d0efdf0
@rajendra-dendukuri and @yxieca i am sure i saw the approval before but for some reason it is deleted. Can you please add it again? |
@liat-grozovik: Repo settings have changed such that when new commits are pushed to the repo any existing approvals are reset. This prevents unreviewed commits from sneaking in after an approval. |
I also noticed this. Seems that when new change is pushed in. github dismisses old approvals. But this doesn't happen consistently. I also see new changes added and approval sticks. I didn't figure out what was the difference. |
- Why I did it Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services. - How I did it Add services to sonic.target - How to verify it Together with sonic-net/sonic-utilities#1199 config reload -y Signed-off-by: Stepan Blyshchak <[email protected]>
- Why I did it Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services. - How I did it Add services to sonic.target - How to verify it Together with sonic-net/sonic-utilities#1199 config reload -y Signed-off-by: Stepan Blyshchak <[email protected]>
- Why I did it Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services. - How I did it Add services to sonic.target - How to verify it Together with sonic-net/sonic-utilities#1199 config reload -y Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyschak [email protected]
- Why I did it
Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services.
- How I did it
Add services to sonic.target
- How to verify it
Together with sonic-net/sonic-utilities#1199
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)