1753519 Members
4964 Online
108795 Solutions
New Discussion юеВ

Re: kill -1

 
SOLVED
Go to solution
cfeitosa
Frequent Advisor

kill -1

Hello guys1

I'm using B.11.11 U 9000/800.

Please, how can explain what the effect to the command below: I read the man of the kill but I didn't understand.

kill -1 `cat /var/run/syslog.pid`

What's happens with the syslog process?
Please could someone give me a help?

Thanks!
5 REPLIES 5
Ivan Krastev
Honored Contributor
Solution

Re: kill -1

This cause syslogd to reread configuration:

"To make syslogd, re-read its configuration file, send it a HANGUP signal:

kill -HUP `cat /var/run/syslog.pid` "

See man page for more.

regards,
ivan
Pete Randall
Outstanding Contributor

Re: kill -1

You need to check the man page for syslogd. There it tells you that you can make syslogd re-read it's configuration file by sending it a hangup signal, which is exactly what "kill -1 `cat /var/run/syslog.pid`" does.


Pete

Pete
cfeitosa
Frequent Advisor

Re: kill -1

Thanks!

I undestood!
Oviwan
Honored Contributor

Re: kill -1

Hey

you can use it for the trap command. how syslogd it handles you see in the previous posts.

here a silly example:
$ cat trapexp.sh
#!/usr/bin/ksh

trap "echo 'killed'" 1

while true ; do
echo blah
sleep 5
done

$ ./trapexp.sh
blah
blah
blah
killed #here i do a "kill -1 pid_of_trapexp.sh from an other session
blah

hope this helps

Regards
Dennis Handly
Acclaimed Contributor

Re: kill -1

You can convert bogus kill numbers to intelligible names by listing all signals using "kill -l".

So the proper command would be:
# kill -HUP $(< /var/run/syslog.pid)

(Oops lost the slash)