[systemd-devel] rsync output is not captured in the journal

Igor Bukanov igor at mir2.org
Mon Jan 5 02:58:30 PST 2015


It could be that this is SELinux-related. If I copy the rsync binary
to a new location and change the test service unit to use it, then the
log appeared as it should. However, I have no indications of any
rsync-related issues in any SELinux logs. Another thing is that if I
run under strace the original /usr/bin/rsync binary, the problem also
disappeares.

Any clues?

On 4 January 2015 at 21:06, Igor Bukanov <igor at mir2.org> wrote:
> Hello,
>
> I have a strange case when there is no output in the journal from
> rsync when the command is run from a service. This is on Fedora 21
> with systemd 217.
>
> Consider the following trivial test unit:
>
> # cat /etc/systemd/system/test.service
> [Service]
> ExecStart=/usr/bin/rsync -vv /etc/hostname /tmp
> StandardError=journal
> StandardOutput=journal
> Type=oneshot
>
> When I run it via
>
> systemctl start test
>
> I have no messages in the journal. journalctl -au test gives an empty output.
>
> Now, if I capture the rsync ouput into a shell variable like in:
> # cat /etc/systemd/system/test.service
> [Service]
> ExecStart=/usr/bin/bash -c 'a=$(/usr/bin/rsync -vv /etc/hostname
> /tmp); echo "$a"'
> StandardError=journal
> StandardOutput=journal
> Type=oneshot
>
> Then rsync stdout is captured and I have after systemctl start test:
>
> # journalctl -au test
> -- Logs begin at Thu 2015-01-01 20:02:12 CET, end at Sun 2015-01-04
> 20:54:54 CET. --
> Jan 04 20:54:02 dserver bash[6284]: delta-transmission disabled for
> local transfer or --whole-file
> Jan 04 20:54:02 dserver bash[6284]: hostname
> Jan 04 20:54:02 dserver bash[6284]: total: matches=0  hash_hits=0
> false_alarms=0 data=8
> Jan 04 20:54:02 dserver bash[6284]: sent 98 bytes  received 102 bytes
> 400.00 bytes/sec
> Jan 04 20:54:02 dserver bash[6284]: total size is 8  speedup is 0.04
>
>
> What could prevent stdout capturing with rsync?


More information about the systemd-devel mailing list