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

Igor Bukanov igor at mir2.org
Sun Jan 4 12:06:52 PST 2015


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
ExecStart=/usr/bin/rsync -vv /etc/hostname /tmp

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
ExecStart=/usr/bin/bash -c 'a=$(/usr/bin/rsync -vv /etc/hostname
/tmp); echo "$a"'

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