1837048 Members
3244 Online
110111 Solutions
New Discussion

startup scripts

 
SOLVED
Go to solution
navin
Super Advisor

startup scripts

Hi,
i have posted a message regarding application startup scripts couple of weeks ago and got very good useful responses . With that ..i would like to discuss more on that.Actually i do have application start up script located at /sbin/init.d and appropriate link at /sbin/rc3.d in order to start up a application while system boots up.For some reason the app is not starting up while system boots up.I had to manually start up the application by running the script located at /sbin/init.d after system booted.Any idea wether it is an app problem or system related problem.I checked with permissions and ownerships ..of the script ,it looks everything is set up as it should be.Please advice.Thanks in advance.
Learning ...
9 REPLIES 9
Ralph Grothe
Honored Contributor
Solution

Re: startup scripts

First try to start and stop the application by invoking your script with the argument start and stop respectively from a root shell.
If that works recheck your symlink.
The name it should point to in the runlevel subdir must begin with an S for the startup, and a K for the shutdown.
Also check if your script is setting some control variables like START_MY_APP=1 which are usually placed in /etc/rc.config.d/myscriptconf
Then you should check /etc/rc.log after a runlevel change to see what output and return code your script has produced.
You could temporarily set -x in your script to enhance debugging.
Your script must comply with the return code recommendations as commented in the /etc/init.d/template file.
Madness, thy name is system administration
Artyom Voronchihin
Respected Contributor

Re: startup scripts

Hello.
Where is difference of running script at startup and in root shell. Unlike root shell, where are no difined environment variables during startup. So full paths and all necessary variables shold be used in the script's body. May be that's the reason.
"Intel inside" is not a label, it's a warning.
Peter Godron
Honored Contributor

Re: startup scripts

Hi,
I would also advise to check the /etc/rc.log file, which may give you a clue on why your script is not being executed/fails.

James R. Ferguson
Acclaimed Contributor

Re: startup scripts

Hi Navin:

I'd begin by examining the PATH variable in your startup script and particularly any environmental variables that you "normally" export to your login environment when your login profile runs. None of your '.profile' environmental variable will be present unless you have made provisions for them.

Regards!

...JRF...
Mancboy
Valued Contributor

Re: startup scripts

If you can run it from the command line but not from a system startup, then I suspect that your script is expecting variables to be sourced before it is run (just as your .profile is sourced when you log on)

1) see what variables it (and the scripts it calls) is using.
2) type env and see what your shell is using
3) set these values into your script

or

ensure that all paths are fully qualified in your script - and the scripts it calls.
navin
Super Advisor

Re: startup scripts

hello,
thanks for the responses. when i checked on rc.log file..i have not seen any error messgae or startup message for the particular script. it looks like system has igored the script.and also the higher numbered system startup scripts like dtlogin , etc starting from S901.I'm sure it is not the limitation.
thanks
Learning ...
Mancboy
Valued Contributor

Re: startup scripts

just a quickie,
1) running the script from the link works fine? ie /sbin/rc3.d/scriptlink

2) you're at the correct run level for the script? who -r will tell you
navin
Super Advisor

Re: startup scripts

Hello,
i'm able to see the logs. the rc.log.old files has the old+current reboot messages.Is that true.
thanks
Learning ...
James R. Ferguson
Acclaimed Contributor

Re: startup scripts

Hi (again) Navin:

Yes, 'etc/rc.log' has the startup messages from the last boot, while '/etc/rc.log.old' has the shutdown messages from the last reboot *plus* the previous boot's startup.

As noted, make sure that you transitted the runlevel you expected. That is, if your link is in '/sbin/rc3.d' then you must be at runlevel three (3) or greater to have started your script.

# who -r

...will tell you your current run-level.

Regards!

...JRF...