Am 23.05.2016 um 10:50 schrieb Lennart Poettering:
On Mon, 23.05.16 10:32, Reindl Harald (h.rei...@thelounge.net) wrote:even something like "systemd-run -t --service-type=oneshot --quiet" behaves differently and don't work if you call it via crond to get the typical behavior of cronjobs sending mails when some output appears (imho a major bug by design or accident)This is completely unrelated to Ashish' case. Note that what you do above should actually work fine on current systemd. With v230 I get: <snip> $ systemd-run -t --service-type=oneshot --quiet /bin/echo hallo | cat hallo </snip> Which suggests this works fine.
in a shell it works finebut i talk about cronjobs like "8,38 * * * * root /usr/local/bin/spamfilter-fetch-samples" where the shell-script invokes systemd-run which finally calls a php-script producing output if there where sammples on the imap-folders not already classified with BAYES_99
the intention is to use systemd-capabilities like "-p ProtectSystem=full,ProtectHome=yes" starting with F24 and behave like a classical cronjob -> producing emails to all administrators
This didn't always works though, and it was pretty nasty to get right actually. The core of the problem is really that "-t" actually allocates a tty, and ttys know no clean concept of single-direction EOF, but only bi-directional hangups. Thus, using ttys as the backend for inner components of shell pipeliness, without losing trailing data is really hard to get right. But anyway, this should work now
at least not on current Fedora releases, maybe it works now
signature.asc
Description: OpenPGP digital signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel