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

Michael Chapman mike at very.puzzling.org
Wed Dec 30 03:23:14 PST 2015


On Wed, 30 Dec 2015, Martin Pitt wrote:
> Reindl Harald [2015-12-30 11:35 +0100]:
>> in the first mail i wrote: "migrate cronjobs to systemd-units for using
>> ReadOnlyDirectory and other security otpions"
>
> OK, I suggest to use systemd-run -t then, like Michael Chapman already
> suggested. This should give you both, direct stdout/err and the
> possibility of additional security restrictions.

Ah, neat. I was unaware of the -t (aka --pty) option. I had suggested 
--scope.

I think --scope could be slightly more appropriate for use in a cron job 
since it will pass environment variables from the cron job configuration 
down to the command as normal. With a transient service unit you'd need to 
use --setenv to supply extra environment variables explicitly.

- Michael


More information about the systemd-devel mailing list