roguehunter - identify and terminate rogue processes
roguehunter [ -c <config_file> ] [ -d ] [ -m # ] [ -v ]
roguehunter is a Bourne shell script which should work equally well on all versions of UNIX, Linux and even bloody UnixWare.
The roguehunter is at present server specific. Tests to identify rogue processes are hard coded into the script.
The script attempts to kill processes with SIGHUP in order allow a clean termination. No attempt is made to use SIGKILL if termination fails.
A terse record of the attempted kills are maintained in the log file. /var/log/roguehunter<#>.
-c <configuration_file>
The configuration file is at present unused.
-d The debug mode echos all actions to standard error.
-m # Set the maximum time in minutes that a process may occupy the CPU before it catches the attention of roguehunter. In the abscence of a -m option the default maximum time is 50.
-v Verbose mode, the script will run with the -x option set.
roguehunter
Identify rogue processes (cpu hogs) on the current host using the criteria hard coded in the script and terminate them.
roguehunter -d
As above but echo each line to standard error.
The script has very little input error checking. .SH HISTORY The script was created to deal with extreme process hogs created by Mega on a Caldera Open Unix host. Access to the system is achieved through terminal emulation from PCs. I suspect that the PCs are shutdown without ending the telnet/ssh session and that as a consequence, SIGHUP is never sent to the host. When the telnet session is broken the login process is attached to init and the application process smn12 becomes a process hog. The script therefore is essentially concerned with processor hogs identified as smn12 and the associated ksh login although it could be easily modified to use a config script which identified other target names. Other processes that are identified as a potential problem are added to the log files for further consideration.
Clifford W Fulford, City Linux. Contact fulford@fulford.net or +44 (0)793 572 8612
Copyright
© 2003-2017
Clifford W Fulford.
Fulford Consulting Ltd.
Regd. Co. 4250037 in England & Wales.
Regd. office 162, Edward Rd. Nottingham NG2 5GF, England, UK.
Related web sites: City Linux | Flare Support | West Bridgford | Fulford Portal | Joan Mary Fulford (Nottingham Writer) | Fulford Gallery | Amharic Interpreter | Arabic Interpreter | Tigrinya Interpreter
The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.