Skip to main content

systemd Shell Execution

To start a shell with the same environment as a particular systemd service

sudo systemd-run --property=EnvironmentFile=<path/to/env/file> --uid=<service user> --pty bash

Be sure to use ^] instead of exiting the shell directly - this command spawns a service that will fail if exited improperly