0

We have a custom service we start via systemd. File is stored at /etc/systemd/system/custom.service.

That's all great but we just had a situation where the disk ran full. I guess systemd catches all of the process' stdout and writes it into /var/log/syslog.

Our custom service writes all of STDOUT into actual log files. So we could ignore syslog.

How can I suppress everything from stdout being written to syslog?

transient_loop
  • 499
  • 1
  • 4
  • 15

1 Answers1

1

As shown in the documentation, you can redirect StandardOutput= to wherever you wish. By default this is journal. You can change it to null instead, to cause standard output to be discarded.

[Service]
StandardOutput=null
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Awesome. Why was I not able to find it here: https://www.freedesktop.org/software/systemd/man/systemd.service.html? I searched for "Standard" and no results – transient_loop Aug 23 '20 at 16:35
  • 1
    @transient_loop Because, as it says, only options unique to service units are documented there, and the common options are in other doc pages. "Service files must include a [Service] section, which carries information about the service and the process it supervises. A number of options that may be used in this section are shared with other unit types. These options are documented in systemd.exec(5), systemd.kill(5) and systemd.resource-control(5)." – Michael Hampton Aug 23 '20 at 16:39
  • Thanks. In the hurry to get our system back up I did not read everything well. – transient_loop Aug 23 '20 at 16:41