simple upstart example

Karl Auer kauer at biplane.com.au
Sun Dec 22 07:35:47 UTC 2013


On Sun, 2013-12-22 at 05:31 +0000, thufir wrote:
> To have minerd, cpu mining, always running, but no more than one or two 
> miners.  Left alone, one instance of minerd will peg the cpu.

Upstart is ideal. Let it respawn.

Alternatively, a bit primitive but it works, write a script that calls
itself in the last line:

   #!/bin/sh
   /path/to/myprogram -with -args -as -needed
   exec $0 $*

This will make sure that myprogram is always running - and if it stops,
it will be restarted immediately. There will only ever be one copy
running though. Unless you run more than one copy of the script, of
course.

Note: Untested - just showing the idea...

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: B862 FB15 FE96 4961 BC62 1A40 6239 1208 9865 5F9A
Old fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017





More information about the ubuntu-users mailing list