google-guest-agent.service reports the following error on Ubuntu 24.04 (noble)
ERROR oslogin.go:163 Error reloading service: Failed to reload-or-restart sshd.service: Unit sshd.service not found..
This error can be slightly misleading, as google-guest-agent.service still restarts ssh.service successfully before attempting to restart sshd.service. See code.
sshd.service is not loaded on Ubuntu 24.04 due to bug LP #2087949. sshd.service is just an alias to ssh.service. So technically, sshd.service exists but is not loaded.
$ systemctl list-units --all sshd.service
UNIT LOAD ACTIVE SUB DESCRIPTION
● sshd.service not-found inactive dead sshd.service
Legend: LOAD → Reflects whether the unit definition was properly loaded.
ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
SUB → The low-level unit activation state, values depend on unit type.
1 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
Given google-guest-agent.service tries to skip restarting services that do not exist, perhaps it should also skip restarting services that failed to load as a way to avoid logging the error mentioned above. Or maybe log an error only if it fails to restart both ssh.service and sshd.service in this case.
google-guest-agent.servicereports the following error on Ubuntu 24.04 (noble)This error can be slightly misleading, as
google-guest-agent.servicestill restartsssh.servicesuccessfully before attempting to restartsshd.service. See code.sshd.serviceis not loaded on Ubuntu 24.04 due to bug LP #2087949.sshd.serviceis just an alias tossh.service. So technically,sshd.serviceexists but is not loaded.Given
google-guest-agent.servicetries to skip restarting services that do not exist, perhaps it should also skip restarting services that failed to load as a way to avoid logging the error mentioned above. Or maybe log an error only if it fails to restart bothssh.serviceandsshd.servicein this case.