Re: auto-running a script as daemon
- From: Martin Gregorie <martin@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 05 Dec 2007 22:14:24 +0000
Tony van der Hoff wrote:
On 5 Dec at 16:25 Gordon Henderson <gordon+usenet@xxxxxxxxxx> wrote inIf your distro is RedHat-like, there is a bit of help:
In article <gemini.jsl2w1005t6v4052s.news@xxxxxxxxxxxxxxxxxxxxx>, Tony van
der Hoff <news_0711@xxxxxxxxxxxxxx> wrote:
I have a perl script to monitor various bits of my server, which I runIt varies from distro to distro... Eg. Debian look in /etc/init.d for a
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?
file called skeleton - this is a bash script, so copy this to eg
/etc/init.d/monitorMyStuff and edit to start your own thing, then run
Thanks, Gordon; my distro doesn't have that; I can only see things like
"Program Files", and "My Documents and Settings".
Um, not really :), but I'm running Mandriva, which has its roots in red hat,
and what Geoff described was ideal.
- there's no example script, but its easy enough to find something
suitable in /etc/rc.d/init.d, copy it and edit it. At a minimum
it should have sections that implement start, stop, status and restart
requests. The vs-ftp or sshd scripts are reasonable starting points.
- use the "chkconfig" command to set up the symlinks in /etc/rc.d/rc.n
(where 'n' is the run level) that are used to start or stop the
service whenever the runlevel is changed
- use the "service" command to start, stop and restart the service or
query its status.
chkconfig and service can only be run as root.
martin@ | Martin Gregorie
gregorie. | Essex, UK
- Prev by Date: Re: DVD burner with verify option?
- Next by Date: Re: Archiving mail passing through
- Previous by thread: Re: auto-running a script as daemon
- Next by thread: Re: auto-running a script as daemon