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

Package acpid to handle shutdown signals #437

Merged
merged 1 commit into from
Oct 21, 2019
Merged

Package acpid to handle shutdown signals #437

merged 1 commit into from
Oct 21, 2019

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Oct 18, 2019

Issue #, if available: fixes #345

Description of changes:
This adds acpid. The hack to make it not depend on /bin/sh is not something I'm proud of, but it works for what we need it for right now. Because button/power is the only event we have listed in a config we should only shutdown on that event.

Instance responds to stop/terminate events as well as reboot events correctly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@iliana iliana requested a review from bcressey October 18, 2019 23:29
}
umask(0077);
- execl("/bin/sh", "/bin/sh", "-c", action, NULL);
+ execl("/sbin/shutdown", "/sbin/shutdown", "-h", "now", "Power button pressed", NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we run systemctl poweroff instead, so that the action here matches the configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, brain split. Going to change these both to shutdown -h now.

Signed-off-by: iliana destroyer of worlds <[email protected]>
@iliana iliana merged commit 04cf58b into develop Oct 21, 2019
@tjkirch tjkirch deleted the acpid branch October 21, 2019 16:29
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

Successfully merging this pull request may close these issues.

instances do not respond to terminate events
3 participants