5

When I run the service manually, it logs something when it starts.

But I cannot find this log anywhere when it starts as systemd process.

journalctl -u <service> only shows the records about the service starting and stopping, not the actual service output.

I tried adding config to /etc/systemd/system/<service>.service file:

StandardOutput=append:/var/opt/<service>/stdout.log
StandardError=append:/var/opt/<service>/stderr.log

but it also didn't help - the files are created after daemon and service restart, but they are empty.

What am I missing?

Thank you for any suggestions, I am out of ideas.

esp
  • 151
  • 1
  • 5

1 Answers1

3

Use the following in the unit file

[Service]
StandardError=journal
StandardOutput=journal
StandardInput=null

See here for more: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=