Skip to content

Commit

Permalink
systemd/system/sshkeys: Make execution more robust
Browse files Browse the repository at this point in the history
The service failed when the unit to start was masked. Since it involves
networking, the service can fail and if it does we should restart.
Prevent execution when it has no chance to succeed because the unit to
start is masked but in all other cases try to restart on failure.
  • Loading branch information
pothos committed Nov 17, 2023
1 parent 591e7a6 commit 81ea594
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions systemd/system/sshkeys.service
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ConditionKernelCommandLine=|coreos.oem.id=openstack
[Service]
Type=oneshot
RemainAfterExit=yes
Restart=on-failure
ExecCondition=/usr/bin/bash -c 'if [ $("readlink -f /etc/systemd/system/[email protected]") = "/dev/null" ]; then exit 1; fi'
ExecStart=/usr/bin/systemctl start [email protected]

[Install]
Expand Down

0 comments on commit 81ea594

Please sign in to comment.