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
can't run an ssh command on power events from a unit file #21953
Comments
Maybe a workaround is to find SSH_AUTH_SOCK in /tmp |
EDIT: it worked suspend-system.service: [Service] [Install] why systemd blocks SSH_AUTH_SOCK? Is this solution insecure? |
EDIT2 without EnvironmentFile: [Service] [Install] |
I am not sure I follow, but you want to use a running user SSH agent from a system service that also runs something udner that UID? You probably want to use PAMName, so that your code actually runs under the user's session instead of a real system service... But this isn't really a feature request or bug report, but a support question. Those do not belong here. Please use the mailing list or so instead. The submission form should have made that clear to keep frustration at a minimum. |
You can't use a user's ssh-agent from a system unit file.
You can't use sleep.target from a user unit file.
systemd ignores /etc/pm/sleep.d scripts.
This means that if you want to run a command remotely via ssh on a power event
you just can't.
https://unix.stackexchange.com/questions/149959/how-to-run-systemd-user-service-to-trigger-on-sleep-aka-suspend-hibernate
The text was updated successfully, but these errors were encountered: