-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from freedomofpress/poweroff-on-lid-close
Fully power off workstation after lid close
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
## | ||
# Updates to systemd configuration in dom0 | ||
## | ||
|
||
{% import_json "sd/config.json" as d %} | ||
{% if d.environment == "prod" or d.environment == "staging" %} | ||
# Power off instead of suspend on lid close, for security reasons, but only in | ||
# prod and staging, to avoid interfering with developer workflows | ||
dom0-poweroff: | ||
file.blockreplace: | ||
- name: /etc/systemd/logind.conf | ||
- append_if_not_found: True | ||
- marker_start: "### BEGIN securedrop-workstation ###" | ||
- marker_end: "### END securedrop-workstation ###" | ||
- content: | | ||
HandleLidSwitch=poweroff | ||
apply-systemd-changes: | ||
cmd.run: | ||
- name: sudo systemctl restart systemd-logind | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters