Nokia N900 - Meego Linux - xterminal - shell script - keep working

I need a program in Nokia N900 - Meego Linux - so that it is always on, if it dies, it must restart by itself, how can I do it?

I would like to use it on 'x11vnc'

can also start the process again if it was killed by any other process by restarting again

+4
source share
3 answers

Add your process to / etc / inittab and let init restart your process when it exits.

those.

mp:2345:respawn:/usr/app/bin/my_process 

See inittab (5) for more details.

(Credit is sent to Lew Pitcher, http://forum.soft32.com/linux2/process-alive-ftopict10675.html )

+9
source

Using inittab, suggested by blinry, is good when you have root access.

If you do not have root access, you can run the shell on the screen and do this:

 $ while true; do run_program; done 

It is assumed that your "run_program" script does not fall into the background, otherwise the loop will contain non-resident instances of "run_program" for an indefinite period.

+3
source

I ended up using daemon , which I installed from apt-get. It has the -r argument, which should restart my command if it dies. So my last command turned out to be:

 daemon -u www-data -n arbitrary_name -r -X "ffmpeg blah blah blah" 
+2
source

All Articles