Consider the following test-echo.service
:
[Unit]
Description=Testing journalling of stdout
[Service]
ExecStart=/bin/echo hello world
[Install]
WantedBy=multi-user.target
Its stdout ends up in the journal as expected:
$ sudo systemctl enable test-echo
$ sudo systemctl start test-echo
$ sudo journalctl -e -u test-echo
> ... systemd[1]: Started Testing journalling of stdout.
> ... echo[20178]: hello world
$ sudo systemctl stop test-echo
Now I add User=ubuntu
under the [Service]
section. ubuntu
is an existing regular user.
$ sudo systemctl daemon-reload
$ sudo systemctl start test-echo
$ sudo journalctl -e -u test-echo
> ... systemd[1]: Started Testing journalling of stdout.
Note that the echo message is now missing from the journal. Why is this, and how can I get it to show up?
I am using systemd 229 on Ubuntu 16.04.