Operating System - HP-UX
1830657 Members
28096 Online
110015 Solutions
New Discussion

Re: messages to syslog.log

 
Lukas Grijander
Advisor

messages to syslog.log

Hello.

I??ve a program who send msg??s to /dev/syscon (I don??t know how and I can??t rewrite the program), and I want to catch this msg??s to syslog.log.

Thanks in advance
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: messages to syslog.log

Do a man on syslogd, and modify /etc/syslog.conf file.


live free or die
harry
Live Free or Die
Bernie Vande Griend
Respected Contributor

Re: messages to syslog.log

Harry's right in that syslog.conf is the first place to look. It is possible though that the program is not using syslogd for routing its messages to /dev/syscon. The best option would be to find the programmer and make sure they are using syslog utilies for messages. If that is not possible, you will have to look for an alternative such as putting a wrapper around the program to ensure messages are routed somewhere else.
Ye who thinks he has a lot to say, probably shouldn't.
James Beamish-White
Trusted Contributor

Re: messages to syslog.log

Does it do an append? why not link it to the syslog.log?
ln -s /var/adm/syslog.log whateverlog

James
GARDENOFEDEN> create light
Lukas Grijander
Advisor

Re: messages to syslog.log

my /etc/syslog.conf has this line :

*.debug /var/adm/syslog/syslog.log

so, I understand all msg??s go to syslog.log, but must these msg??s be sent through syslog routines?

echo "HELLO" > /dev/syscon

don??t send the msg to syslog.log

but

logger "HELLO"

send twice the same msg to syslog.log

Thanks.
Frank Slootweg
Honored Contributor

Re: messages to syslog.log

Are you sure it logs to /dev/syscon, not /dev/console?

If it logs to /dev/console or syscon is linked to console, and you have a (CDE/VUE) GUI, you can use a hpterm(1) window with the "-C" option to catch (/dev/console) console messages.

Alternatively you can try to use a binary editor on the executable file to change /dev/syscon to some other, equally 'long' name. A simple binary editor is "vis -n", your favorite *text* editor (vi(1)) and "inv -n".
Roger Baptiste
Honored Contributor

Re: messages to syslog.log

hi,

/dev/syscon is console,
as the list on it shows below.
****************
crw--w--w- 1 root sys 0 0x000000 Nov 5 11:07 /dev/console
crw--w--w- 2 bin bin 0 0x000000 Jul 31 14:57 /dev/syscon
*****************

So the messages are going
to console. If you want
them to go to syslog.log file,
then the change has to be
made in application to
redirect the messages to
syslog file (append) .

Is this a uSer application
or a system-related application?

-raj
Take it easy.
Carlos Fernandez Riera
Honored Contributor

Re: messages to syslog.log

First thing i were do is
strings your_program | grep /dev. See man strings for options.

If you find /dev/syscon or /dev/console use adb to change it to /dev/null or a pipe file you can manage.

JRF seems to be the master of adb, he can help you.
unsupported
Frank Slootweg
Honored Contributor

Re: messages to syslog.log

RajMan, /dev/syscon is not exactly the same as [/dev/]console, that is why I wrote "If ... syscon is linked to console".

See your own ll(1) output. The link count for /dev/syscon is 2, while the link count for /dev/console is 1. This means that they are *not* (hard) linked. You can see this by doing a "ll -i" which shows that the inode numbers are different. (Also the different UID/GID/timestamp show that they are not (hard) linked.)

However that they are not (hard) *linked* does not neccessarily mean that they are not *pointing* to the same physical device.

See the init(1M) manual page on how /dev/syscon (the *logical* system console) and /dev/systty (the *physical* system console) interact.

The bottom line in that in *most* cases /dev/console, /dev/syscon and /dev/systty point to the same physical device, but not in *all* cases.