Subject: Re: logger issue
To: Martin Weber <Ephaeton@gmx.net>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-help
Date: 07/26/2001 20:54:28
>> >Is there a way to have logger put the pid of it's parent process into its
>> > tag ? As far as I can see if you use no tag, it prints its own pid. If
>> > you use a tag, you get no pid at all. But if I want to log from a say,
>> > script, I'd like to have the scripts pid, not that of logger itself, as
>> > it's long way dead when I read the entry in syslog.
>>
>> ppid=`ps -oppid -p$$ | tail -1`
>> tag="mytag[$ppid]"
>> logger -t "$tag" -p what.ever ta-da!
>
>Mmmmmm
>
>For a shell running under an xterm that reports the pid of the xterm, not
>that of the shell.. but tomorrow, after a good amount of sleep, I'll look
>onto ps some more, thanx for the directions
oh, yes, of course. in that case, you will want to do:
tag="mytag[$$]"
logger -t "$tag" -p what.ever ta-da!
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."