TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource

auto-running a script as daemon

Linux & Opensource

 
 
Thread Tools Display Modes
Unread 08-12-2007, 03:17 AM   #21
Will Kemp
Guest
 
Posts: n/a
Re: auto-running a script as daemon

On Wed, 05 Dec 2007 15:55:13 +0000, Tony van der Hoff wrote:

> I have a perl script to monitor various bits of my server, which I run
> as root: /usr/local/sbin/monitor.pl &
>
> That works fine, but I'd really like to start it automatically on
> reboot. How would I organise that?


What other people have suggested is good, but personally i'd do it more
simply. For simple custom stuff like this, i can't be bothered with all
that runlevel / rcx.d stuff - there's no need.

I'd just add a line at the bottom of /etc/rc.d/rc.local to start it on
boot. (rc.local is run after the system startup scripts at boot time.) If
you're not concerned about it stopping tidily - i.e., you don't mind it
just being killed unceremoniously on shutdown - this is usually the
simplest way.

If you want it to do anything special on shutdown, then you'll probably
be better off doing as others have suggested.

Will

Sponsored Links
 
Unread 08-12-2007, 03:21 AM   #22
Will Kemp
Guest
 
Posts: n/a
Re: auto-running a script as daemon

On Wed, 05 Dec 2007 15:55:13 +0000, Tony van der Hoff wrote:

> I have a perl script to monitor various bits of my server, which I run
> as root: /usr/local/sbin/monitor.pl &
>
> That works fine, but I'd really like to start it automatically on
> reboot. How would I organise that?


What other people have suggested is good, but personally i'd do it more
simply. For simple custom stuff like this, i can't be bothered with all
that runlevel / rcx.d stuff - there's no need.

I'd just add a line at the bottom of /etc/rc.d/rc.local to start it on
boot. (rc.local is run after the system startup scripts at boot time.) If
you're not concerned about it stopping tidily - i.e., you don't mind it
just being killed unceremoniously on shutdown - this is usually the
simplest way.

If you want it to do anything special on shutdown, then you'll probably
be better off doing as others have suggested.

Will
 
Unread 08-12-2007, 03:49 AM   #23
Will Kemp
Guest
 
Posts: n/a
Re: auto-running a script as daemon

Sponsored Links
On Wed, 05 Dec 2007 15:55:13 +0000, Tony van der Hoff wrote:

> I have a perl script to monitor various bits of my server, which I run
> as root: /usr/local/sbin/monitor.pl &
>
> That works fine, but I'd really like to start it automatically on
> reboot. How would I organise that?


What other people have suggested is good, but personally i'd do it more
simply. For simple custom stuff like this, i can't be bothered with all
that runlevel / rcx.d stuff - there's no need.

I'd just add a line at the bottom of /etc/rc.d/rc.local to start it on
boot. (rc.local is run after the system startup scripts at boot time.) If
you're not concerned about it stopping tidily - i.e., you don't mind it
just being killed unceremoniously on shutdown - this is usually the
simplest way.

If you want it to do anything special on shutdown, then you'll probably
be better off doing as others have suggested.

Will

Sponsored Links
 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 09:48 PM.


vBulletin, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2005-2016, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional