Mailinglist Archive: opensuse (794 mails)

< Previous Next >
[opensuse] systemd - zgrep -m1 gives me "gzip: stdout: Broken pipe" ?
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Wed, 29 Nov 2017 10:51:19 +0100
  • Message-id: <ovlvun$ku$>
Okay, I need another pair of eyes -

in a bash script, I have "zgrep -m1 SOA file.gz". The script is being
run under systemd. The line with SOA is found, but I always get "gzip:
stdout: Broken pipe".

zgrep is obviously "gzip -dc | grep".

I guess grep closes early when the first line is found, but why does
this produce the error when running under systemd? If I remove
the '-m1', no problem, no message.

In the console, if I run the "zgrep -m1" manually or from within a
script, no problem, no message.

The script itself (suitably redacted) is nothing much:

echo "$name started, version $version, cwd=$PWD"
trap "echo \"$name terminated\"" exit

while true
a=$(date +%S)
sleep $w
echo "running rsync ..."
rsync -rvt -q -4 --address=$addr etc etc
zgrep -m1 SOA newfile.gz
make -r -C /srv/rbldnsd 2>&1 >>updatelog
sleep 1

Per Jessen, Zürich (3.9°C) - virtual servers, made in Switzerland.

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >