Skip to content
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

google-guest-agent logs error on Ubuntu 24.04 saying it failed to restart sshd.service after successfully restarting ssh.service #467

Open
Ankush-Pathak opened this issue Nov 14, 2024 · 0 comments

Comments

@Ankush-Pathak
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant