(M)  s i s t e m a   o p e r a c i o n a l   m a g n u x   l i n u x ~/ · documentação · suporte · sobre

  Next Previous Contents

2. Unix/Linux command - procautostart

Use the program procautostart (say "Prok-Auto-Start" or Process AutoStart) to monitor and automatically re-start any Unix/Linux process if they die. This tiny program is very powerful and is comparable to big commercial products which costs about $80,000US. Procautostart can be used for controlling following applications:

  • For real-time control of process industries like chemical, manufacturing, power generation and others. Use nano-seconds in program to get fine control.
  • For controlling processes of software applications like Web servers, database servers, mission critical unix processes, etc..
  • As an alarm system for any general monitoring software system. The program can fire a pager or call cell phone or flash red lights on the computer screen. For calling a phone line you may need to use a Telephone card on PCI slot of the computer.

The program listing is given in following sections in this document.

procautostart -n < delay_seconds > -c "< command_line >" nohup &

This starts the unix process procautostart and also command_line process. The procautostart process will re-start command_line process if it dies. The -n option is the time delay in seconds before procautostart checks the running process started by command_line. It is advisable to start the procautostart as background process with no-hangup using "nohup &". See 'man nohup'.

The procautostart is written in "C" so that it is very fast and efficient, since the program is called every n seconds. Amount of resources consumed by procautostart is very minute and is negligible since the program size is small and is highly optimized with -o3 compiler option.

For example -


        procautostart -n 12 -c "monitor_test -d $HOME  -a dummy_arg " nohup &

Here procautostart will be checking the process monitor_test every 12 seconds.

The program will output log files in 'mon' sub-directory which has datetime stamp of when the processes died and re-started. These files gives info on how often the processes are dying.

You can also use micro-seconds option '-m' or nano-seconds option '-o', edit the source code file procautostart.cpp and uncomment appropriate lines.


Next Previous Contents