Re: regression in logger output to syslog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 12, Karel Zak wrote:

> 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?

I'm sure the PPID variable itself is correct. But its value does not
appear anymore in journalctl -f.

>  $ 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.

While having a 'journalctl -f &' running:

root@probook:~ # echo $PPID
2824
root@probook:~ # logger -t "me"  --id=$PPID "foo: blah"
root@probook:~ # Oct 12 15:29:55 probook.fritz.box me[6911]: foo: blah

root@probook:~ # logger -t "me"  --id=$PPID "foo: blah"
root@probook:~ # Oct 12 15:30:01 probook.fritz.box me[6912]: foo: blah
logger -t "me"  --id=$PPID "foo: blah"
root@probook:~ # Oct 12 15:30:05 probook.fritz.box me[6939]: foo: blah
root@probook:~ # logger -t "me" --no-act --stderr  --id=$PPID "foo: blah"
<13>Oct 12 15:32:26 me[2824]: foo: blah
root@probook:~ # logger -t "me" --no-act --stderr  --id=$PPID "foo: blah"
<13>Oct 12 15:32:28 me[2824]: foo: blah


So, its "systemd" who eats the required info.


Olaf
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux