[systemd-devel] "StandardOutput=console" don't work as expected

Reindl Harald h.reindl at thelounge.net
Wed Dec 30 02:35:41 PST 2015



Am 30.12.2015 um 11:24 schrieb Martin Pitt:
> Reindl Harald [2015-12-30 11:10 +0100]:
>> i just want systemd *not to touch* the stdout behavior when asked to do so -
>> it don't need to know anything about ssh ptys, just don't touch stdout
>>
>> i am asking for StandardOutput=console get piped to the terminal systemctl
>> was called - the rest is done by crond as all the years before
>
> This isn't how systemd works -- systemctl does *not* run any jobs by
> itself, it just asks pid 1 [1] to run a job. Thus the stdout/err of
> systemctl are completely irrelevant here.

since "systemctl start" on the shell waits until the "oneshot" service 
is finished it can't be impossible that pid 1 geives back the tasks output

> To do what you want to do, don't put the code that you want to run
> into a systemd unit, just run it straight away. Then you don't have
> the indirection, and whatever you run will just output straight to
> stdout/err

in the first mail i wrote: "migrate cronjobs to systemd-units for using 
ReadOnlyDirectory and other security otpions"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151230/26c3fac9/attachment.sig>


More information about the systemd-devel mailing list