Re: [CentOS] Assistance with startup script

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



Will McDonald wrote:

On 01/06/06, Sam Drinkard <sam@xxxxxxxxxx> wrote:

Could someone give me some assistance in getting this startup script to
conform to chkconfig and such where the service will start up after
networking comes up, and then shut down when networking goes away?
Where all do entries need to be made, and what would they consist of?


On a simplistic level, just adding the chkconfig line somewhere near
the top should do the job.

[wmcdonald@willspc ~]$ /sbin/chkconfig --list network
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[wmcdonald@willspc ~]$ grep chkconfig /etc/rc.d/init.d/network
# chkconfig: 2345 10 90

So, network's starting in runlevels 2, 3, 4 & 5. It's starting with a
weighting, or priority, of 10 and stopping with one of 90.

If you added something like...

# chkconfig: 345 20 80
# description: Does LDM stuff

... after your shabang #!/bin/sh line that should suffice. That would
start your LDM script after networking in runlevels 345 and stop it
before networking's stopped when hopping back down through the
runleves.

I can't recall if you need a "chkconfig --add ldm" but if your
script's not visible in "chkconfig --list" then try it. The chkconfig
man page's RUNLEVEL FILES section should have all the info you need.

If you wanted to go the whole hog you could also look at integrating
your startup stuff into /var/lock/subsys etc. Just have a look through
an existing init script.

Will.
_______________________________________________

Thanks Will, and others. Now if I can just get the script to be recognized! Really weird. If I do a ./ldm start, *from* that directory, it says "no such file" Not sure I quite understand why, but it's physically there.

Sam


--
Sam W.Drinkard -- sam@xxxxxxxxxx
WEB http://wa4phy.net
Augusta Mesonet
cell 706.825.8513 Home 706.868.7253
MAIL 4438 Branchwood Drive,
Martinez Georgia, 30907-1304

begin:vcard
fn:Sam W Drinkard
n:Drinkard;Sam W
org:National Weather Service;Augusta Area Mesonet
adr:;;4428 Branchwood Drive;Martinez;GA;30907-1304;USA
email;internet:sam@xxxxxxxxxx
title:Cooperative Weather Observer
tel;home:706-868-7253
tel;cell:706-825-8513
x-mozilla-html:TRUE
url:http://wa4phy.net
version:2.1
end:vcard

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux