LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 11-18-2010, 12:30 PM   #1
gw1500se
Member
 
Registered: Mar 2004
Distribution: Mandriva 2010.0
Posts: 250

Rep: Reputation: 31
init.d script not executing and missing from chkconfig


I have a startup script in init.d that does not get executed on either startup or shutdown. It works fine from command line (/etc/rc.d/init.d/xxxxxxxx start|stop) The proper links exist in rc?.d. Specifically the link exists as S96xxxxxx in rc5.d and K00xxxxxx everywhere else. When I run 'chkconfig' it does not show up in the list. I assume that is also the reason it does not work on startup or shutdown. Ownership and permissions on the script and links match all the other scripts and links. Can someone point me in the right direction on this? TIA.
 
Old 11-18-2010, 02:23 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,667

Rep: Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711
chkconfig and init.d script

Well, first examine the man page for chkconfig. There is detail there you seem to have missed that should set some light on the subject. In particular attend the --add option.

Before you experiment: examine one of the other scripts in init.d that DOES appear in the chkconfig list. See those comments in the first 24 lines? The ones that refer to chkconfig are critical. They determine how and where chkconfig -add will install the automation lines for starting and stopping the script at different runlevels.

Make sure that your script conforms and contains the comments that will result in the desired behavior. Then try adding it. If it looks wrong, you can always --delete it, modify the comments, and --add it again later.

Finally: once the script is installed properly, the "service <script name> start" and service stop commands should work. You should never need to run it directly again.

Last edited by wpeckham; 11-18-2010 at 02:24 PM.
 
Old 11-18-2010, 06:08 PM   #3
gw1500se
Member
 
Registered: Mar 2004
Distribution: Mandriva 2010.0
Posts: 250

Original Poster
Rep: Reputation: 31
Thanks for the info which was a surprise. I'm from the old school where all that was done manually and seems easy. For me this chkconfig seems unnecessarily complicated. Anyway, I have it set up the way I think it should be and it now shows up in the chkconfig list correctly. However, it still is not working and examining the log files there is still something wrong. I can see a usage error for the script complaining a supplied parameter is not 'start' or 'stop'. Perhaps it does a 'status' or something first which I don't handle but then the documentation on this is very sketchy. Anyway, later in the log it appears that it does get executed with a proper parameter. However, for a shutdown I have the parameter 'Required-Stop: $network'. I am guessing (I can't find any documentation on these parameters) that means the network is required for stopping this service. However, looking at the alphabetical list in rc0.d, it is executed after the network shutdown script, not before, so the graceful shutdown fails. In rc5.d, it does appear to be executing after the network start script which is correct but without a graceful shutdown, I can't tell if the service is really starting properly.
 
Old 11-19-2010, 11:27 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,667

Rep: Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711Reputation: 2711
1. Yeah, but imagine how simple it make the install/update scripts! The maintainers must LOVE it!

2. If it is not working, perhaps there is a reason why that can be discovered. Can you provide a copy of the script? How about a description of what you expect it to do?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Init.d script not executing at shutdown and reboot roberbizimhatemo Linux - General 19 07-02-2019 04:35 AM
chkconfig runs script with different PATH values dchester11 Linux - Server 3 10-07-2010 09:36 PM
how to register auto start/stop service script with chkconfig travellers Linux - Software 8 06-15-2009 11:02 AM
Can't print: links in /etc/init.d/rc5.d to ../cups gone. Yast & chkconfig: no JZL240I-U SUSE / openSUSE 2 12-03-2008 02:45 AM
init.d and chkconfig? lt_wentoncha Mandriva 3 06-26-2006 05:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration