Re: Linux Startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 3, 2007 5:37 AM,  <tony.chamberlain@xxxxxxxxx> wrote:
>
>  I have a program I want started at system startup time, and also monitored
> so if it dies it will be restarted.
> I see two options but problems with both:
>
>
> 1) Put it into /etc/inittab
>
>      This would work, EXCEPT I need to do some stuff first.  I need to do a
> cd, and add some stuff to the
>       PATH and LD_LIBRARY_PATH.  And I can't do (as far as I can tell, as I
> tried):
>
>         x:respawn:cd /root/inittab;
> LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD";./Vms
>
>       I think you have to run from root
>
>
>
> 2) Put into /etc/rc*.d
>
>      Then I could do all the path setup, etc, but how do I get it to respawn
> if it somehow dies?
>
>
>
> --
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Hi Tony Chamberlain,

I think I would make a script for /etc/rc.d/init.d/ and launch (link
from) /etc/rc.d/rcN.d/ (one call to kill - one call to start as per
the rules for all files in /etc/rc.d/init.d/).

To watch, how about a script launched by crond (or whatever is
appropriate for your check timing) using the value of a system
variable talked to by your new script launched from /etc/rc.d/init.d/.
 The protocol might be something like - program sets it to 1 - watcher
notes one and sets to 2 - watcher notes 2 as OK and sets to 3 .. 99 .
0..99 - if the watcher notes the variable not changed as it expects it
can then check with ps aux | grep program and determine the status of
the program and kill and relaunch as necessary logging it's action and
reason.

Have fun!

Tod


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux