Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: util-linux@vger.kernel.org
Subject: Re: regression in logger output to syslog
Date: Mon, 12 Oct 2015 12:44:14 +0200	[thread overview]
Message-ID: <20151012104414.GF2356@ws.net.home> (raw)
In-Reply-To: <20151009082541.GA9068@aepfle.de>

On Fri, Oct 09, 2015 at 10:25:41AM +0200, Olaf Hering wrote:
> I used a script with openSUSE 11.4 which called logger like this:
> # logger -t "$l[$PPID] $i" "`sed -n ${c}p < $t`"
> 
> The tag was something like "me[123] foo: blah", and the number remained
> stable for a single run.
> 
> Now with systemd and util-linux-2.26.2 the number does always change. 

Not sure if I understand the problem. How can logger update have any
impact to the $PPID if this variable is generated by shell?
 
> IfI understand the man page correctly this is supposed to achieve the
> same, but the $PPID never made it into journalctl -f outout:
> 
> logger -t "me"  --id=$PPID "foo: blah"

 $ logger --no-act --stderr --id=$PPID "this is message"
 <13>Oct 12 12:40:07 kzak[1562]: this is message
 $ logger --no-act --stderr --id=$PPID "this is message"
 <13>Oct 12 12:40:07 kzak[1562]: this is message

.. still the same number. It seems that the problem is your script
where is probably any fork/exec before logger call.

Maybe you need to save the PID at the begin of the script:

#!/bin/bash

REPORTED_PID=$$

... your script ...

logger --id=$REPORTED_PID "foo: blah"

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-10-12 10:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  8:25 regression in logger output to syslog Olaf Hering
2015-10-12 10:44 ` Karel Zak [this message]
2015-10-12 13:34   ` Olaf Hering
2015-10-21  9:37     ` Olaf Hering
2015-10-29 10:35       ` Karel Zak
2015-10-29 14:20         ` Olaf Hering
2015-10-29 14:36           ` Lennart Poettering
2015-10-29 15:32             ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151012104414.GF2356@ws.net.home \
    --to=kzak@redhat.com \
    --cc=olaf@aepfle.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox