I'm trying to dump the env from a systemd service unit and systemctl show-environment doesn't do what I want. Is there any way to systemctl to show me what the environment looks like inside my service?


If your service is running, you can use systemctl status <name>.service to identify the PID(s) of the service process(es), and then use sudo strings /proc/<PID>/environ to look at the actual environment of the process.


run a script which executes 'set' within and write the output to a file.


set >> /tmp/set-results.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.