Leverage systemd conditionals for logging services #396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal of this change is to make it possible to just enable all the services we need on all VMs, but have them start exclusively in the VMs they're meant for.
Since we have predictable hostnames, we can ask systemd to only start services for specific hostnames.
Relies on 2 PRs in other repos:
Testing
securedrop-log
andsecuredrop-workstation-config
sd-small-bullseye-template
and install themsd-small-bullseye-template
, runsystemctl is-enabled securedrop-log
andsystemctl is-enabled securedrop-disable-remote-logging
, both returnenabled
sd-small-bullseye-template
mv /rw/config/rc.local.bak /rw/config/rc.local
insd-gpg
andsd-log
sd-gpg
,sd-log
, andsd-proxy
systemctl is-active securedrop-log
in …sd-gpg
it returnsinactive
sd-proxy
it returnsinactive
sd-log
it returnsactive
systemctl is-active securedrop-disable-remote-logging
in …sd-log
it returnsactive
sd-gpg
it returnsactive
sd-proxy
it returnsinactive
sd-log
still receives log output fromsd-app
,sd-proxy
etc.Order of operation for merging
To not waste CI time, I'd recommend merging in the following order: