linux service daemon

linux service daemon

Biran, Yahav (Yahav) yahav.biran at gmail.com
Wed Feb 18 06:53:35 IST 2009


2009/2/18 BIRAN, Yahav (Yahav) <biran at alcatel-lucent.com>:
> [Yahav Biran] the application is running on RH AS 5. its is a java process
(activemq 5.2.0).
> Im trying to have a running daemon that is starting and stopping
automatically (this is already achieved) the problem is when the process is
aborted in unlikely event. In that case I would expect the daemon will be
started automatically.

(please try to clip your lines to ~75 chars).

So you manage to start the daemon but you want some watch-dog to
restart it when it fails?

That's not something you usually put in the init startup script itself.

I'd suggest that you either use monit (http://mmonit.com/monit/,
available as a package from RPMForge) or have a wrapper parent process
inside bin/amq which would be a simple shell or perl script to re-run
the java process in a loop whenever it exits with a signal. You'll
have to kill that wrapper process before the child it watches when you
actually take things down to avoid it from restart the child.

I'm not sure how to get the details of a child exit signal from the
shell so I'd consider using perl (perl's $? is much more comprehansive
that the shell's $?).

Also consider redirecting standard input from /dev/null (</dev/null)
to completely detach your process from any controlling terminals.

--Amos

[Yahav Biran] thanks Amos, I already wrote a wrapper that set to run in
crontab and monitor the amq MBean but I thought RH have a build in
solution for that. Actually the documentation says it does with
 "probe: true" any way thanks for the help.
Yahav
_______________________________________________
Linux-il mailing list
Linux-il at cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il




More information about the Linux-il mailing list