Always

This is a very small program i wrote some time ago when a deamon running in a linux box was ending from time to time (once or twice a day) and i couldn't find the reason.

The solution was to write this small program and let it launch the deamon. This program creates a child process, the child then runs the deamon program. The parent simply waits (no CPU used) for the child to die, when that happens another child will be launched to run the deamon again.

This program is not supposed to be used in normal server operation, it only provides a way for administrators to implement an emergency solution in the scenario above. "Always" sends information to syslog, so you may check it to know at what time did the server failed and the exit code.

Before use/install (requirements):

  • This program is for standalone servers only. Not for services provided by inetd/xinetd.
  • You can't use this with servers that go to background on their own, the server must be started in such a way it runs in foreground.

Install:

  1. get the tarball always.tgz
  2. extract (tar xzf always.tgz). The directory always will be created on the current working directory
  3. enter the directory (cd always)
  4. run "make" to create the executable file "always"
  5. run "make install" to copy the file "always" to /usr/local/sbin/ or copy it to a suitable place.

Usage:

andre@dei.isep.ipp.pt