1847710 Members
5968 Online
110265 Solutions
New Discussion

Re: Boot Script problem

 
Rusty Sapper
Frequent Advisor

Boot Script problem

I have a boot script that needs to run after everything else has run. I have the link set up as S999myscript in the /sbin/rc3.d dir.

However, It seems to be running before anything else, even before rc1 and rc2.

TIA

Rusty
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: Boot Script problem

Hi Rusty:

What is it that leads you to this impression? Make sure that your script (as pointed to by the link) has a valid environment. In particular, make sure that your PATH variable includes what you need.

Regards!

...JRF...
Rusty Sapper
Frequent Advisor

Re: Boot Script problem

Watching the console, I see errors from the script even before the system runs through the rest of the rc scripts.
James R. Ferguson
Acclaimed Contributor

Re: Boot Script problem

Hi (again) Rusty:

Are you sure that what you are seeing isn't the processing of /etc/rc.config.d/* files as /etc/rc.config sources the files in this directory?

...JRF...
Mladen Despic
Honored Contributor

Re: Boot Script problem

Rusty,

If you do:

ll /sbin/rc*/*myscript

does it reveal more than one link to your script?

Is any output from your script saved in /etc/rc.log or /etc/rc.log.old ? If so, is it at the beginning or at the end of the log file? Does it show the correct link name:
S999myscript ?
Sachin Patel
Honored Contributor

Re: Boot Script problem

Hi Rusty,
Try S900 rather then S999.

Three thing to make sure
-link S900scirpt -> /sbin/init.d/script
-script itself /sbin/init.d/script and
-text file in /etc/rc.config.d/ for variable if any.

Check your /etc/rc.log file which is log for all daemon that are started at boot time.

Sachin

Is photography a hobby or another way to spend $
Sanjay_6
Honored Contributor

Re: Boot Script problem

Hi Rusty,

Have a look at your /etc/rc.log file. It will list the order in which the startup script was run and the error associated with it, if any. Most of the times the errors are self explanatory, so you should be able to know what you are missing.

You can try the solution sachin is advising of changing the S???script. However don't think that should be the reason. Could be ?.

Hope this helps

Thanks
Wodisch
Honored Contributor

Re: Boot Script problem

Hello Rusty,

seems pretty simple to me: your script does not react
properly when called with the parameter "start_msg"
(and perhaps "stop_msg", too).
But it should, as ALL scripts are called with that
parameter BEFORE even the first is executed with the
parameter "start" (or "stop", of course) to built the
list that you see on the console during that startup
process.
Have a look into the example in "/sbin/init.d/template"
and modify your script accordingly...

HTH,
Wodisch
Sahul  Hameed
New Member

Re: Boot Script problem

Ensure the script or a link to it is not proesent in /etc/rc.config.d directory. I once had a problem where by mistake I had a crontab file copy under /etc/rc.config.d.

Good luck.