Skip to content

Commit

Permalink
[config reload] Removed job-mode for sonic.target restart (#1820)
Browse files Browse the repository at this point in the history
#### What I did

As discussed in this PR sonic-net/sonic-utilities#1814 (comment), only the stop.job should have job-mode set to replace irreversibly.

Otherwise,  simultaneous config reloads in the quick succession, can lead to the behavior.

Although ,when the restart job (and all the other dependent jobs) are finished and is taken out of systemd's job queue, the next stop job will not be cancelled.
  • Loading branch information
vivekrnv authored Sep 15, 2021
1 parent f76f672 commit ce11545
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def _reset_failed_services():

def _restart_services():
click.echo("Restarting SONiC target ...")
clicommon.run_command("sudo systemctl restart sonic.target --job-mode replace-irreversibly")
clicommon.run_command("sudo systemctl restart sonic.target")

try:
subprocess.check_call("sudo monit status", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Expand Down

0 comments on commit ce11545

Please sign in to comment.