[PLUG] Restart a 'hung'(?) process
Russell Senior
seniorr at aracnet.com
Wed Mar 2 00:56:52 UTC 2005
>>>>> "Roderick" == Roderick A Anderson <raanders at acm.org> writes:
Roderick> We monitor several mail spool systems using a ssh connection
Roderick> (from a Windows box that runs What's up Gold using PuTTY )
Roderick> and some simple shell and perl scripts. One thing I
Roderick> watching is the maillog with colorize ( perl script ).
Roderick> Where this goes bad is when logrotate moves the file out
Roderick> from under colorize , ie. closes the file then opens a new
Roderick> one with the same name. I thought there was a signal that
Roderick> could be sent ( via. kill/killall ) that caused a process to
Roderick> restart. But when I tried HUP/SIGHUP it killed the whole
Roderick> process. Something in the back brain said HUP ( hangup )
Roderick> was the ticket. Looking in the man pages ( man 7 signal ) I
Roderick> find nothing I recognize as the proper signal. So is there
Roderick> a method that will cause a process to restart?
Signals need the appropriate signal handler in the application
receiving them. In your case, you want the application to close and
reopen a particular filename. If the application doesn't provide this
signal handling, you might need to resort to the start/stop init
scripts (in Debian, they are found in /etc/init.d/). The usual
interface with those is:
# /etc/init.d/foo restart
where "foo" is the name of the service-start/stopping script.
Maybe that'll work for you.
--
Russell Senior ``I have nine fingers; you have ten.''
seniorr at aracnet.com
More information about the PLUG
mailing list