Cheap pro­cess mon­it­or­ing (no ad­di­tion­al soft­ware re­quired)

I have an old sys­tem (only the hard­ware, it runs -cur­rent) which re­boots it­self from time to time (mostly dur­ing the daily periodic(8) run, but also dur­ing a lot of com­pil­ing (por­tup­grade)). There is no ob­vi­ous reas­on (no pan­ic) why it is do­ing this. It could be that there is some hard­ware de­fect, or some­thing else. It is not im­port­ant enough to get a high enough pri­or­ity that I try hard to ana­lyze the prob­lem with this ma­chine. The an­noy­ing part is, that some­times after a re­start apache does not start. So if this hap­pens, the solu­tion is to lo­gin and start the web­serv­er. If the web­serv­er would start each time, nearly nobody would de­tect the re­boot (root gets an EMail on each re­boot via an @reboot crontab entry).

My prag­mat­ic solu­tion (for ser­vices star­ted via a good rc.d script which has a work­ing status com­mand) is a crontab entry which checks peri­od­ic­ally if it is run­ning and which re­starts the ser­vice if not. As an ex­ample for apache and an in­ter­val of 10 minutes:

*/​10 * * * *    /usr/local/etc/rc.d/apache22 status >/​dev/​null 2>&1 || /usr/local/etc/rc.d/apache22 re­start

For the use case of this service/​machine, this is enough. In case of a prob­lem with the ser­vice, a mail with the re­start out­put would ar­rive each time it runs, else only after a re­boot for which the ser­vice did not re­start.

I got some­thing done in the last days

Wow, some of the TODO items in the last post are done:

  • emu10k1 lower pri­or­ity on at­tach (al­lows emu10kx to at­tach when loaded too)
  • sade com­mit­ted (and code im­proved)

And I did some more things:

  • emu10kx fixes (sub­mit­ted by Yur­iy)
  • en­hance­ment of the bsd to linux er­rno map­ping (sub­mit­ted by “In­tron”)
  • ad­ded some more files to (sub­mit­ted by kris@)
  • had a look at linux_​kdump and de­term­ined that we should up­date it with what we have in -cur­rent

There’s also a sub­mis­sion of sup­port for Envy24HT chips from Kon­stantin (he also has a page with a lot of docs for envy* chips).