Re: regression in logger output to syslog

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

 



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@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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