Poor Man's Service

From Nottinghack Wiki
Revision as of 22:09, 19 June 2011 by Msemtd (talk | contribs) (Created page with "Ever want to run a permanent restarting service on a Unix machine as a non-root user? I often use a screen + cron recipe to run long-lived processes where cron checks to see if ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ever want to run a permanent restarting service on a Unix machine as a non-root user?

I often use a screen + cron recipe to run long-lived processes where cron checks to see if it's running, restarting it if it isn't, and screen provides a handy detached interface to stdin/stdout etc.

So, let's call this service "service1" and make cron run a script every five minutes to check that it's OK...

 0,5,10,15,20,25,30,35,40,45,50,55 * * * *       /home/michael/service1/check