Operating System - HP-UX
1753329 Members
4906 Online
108792 Solutions
New Discussion юеВ

Problem with a startup script

 
Chuck Dennis_2
New Member

Problem with a startup script

I am have a problem with a startup script that I have created to start in run
level 3. The script works fine when I transition from run level 2 to run level
3, but when I re-boot the system the script runs and then ends. In the startup
script I a starting another script in background (that I want to stay active).
See that attached code example.

Thanks for any help you can offer.
5 REPLIES 5
Chris Anoruo_1
Frequent Advisor

Re: Problem with a startup script

Hi chuck,

Place the startup link file in /sbin/rc3.d directory and ame it appropriately.
It will enable the file to start in run level 3.
I hope this will help.

Cheers!
Fernando Santana
Frequent Advisor

Re: Problem with a startup script

Hi, just put "nohup" for no hangup before the program
you want to stay up running. The process will be adopted by init and your start
script would exit and
leave it running.

nohup /opt/rnic/bin/rnicd 1>/opt/rnic/log/rnic.log 2>&1 &
Chuck Dennis_2
New Member

Re: Problem with a startup script

I have tried putting nuhup in and got the same results. The script died when rc
finished. Also the startup file is the last script run in rc3.d .

Thanks
Fernando Santana
Frequent Advisor

Re: Problem with a startup script

When you manually go from run level 2 to 3 as
the root user, your environment is set differently. There might be env.
variables that need to be set in order to run that aplication. Try to find out
what they are, set and export them before running your nohup line. If you
can't point them out, run the entire roots .profile before the nohup line.

ex: ". /.profile" #run on current shell.

Good Luck!!!
Sachin Patel_2
Advisor

Re: Problem with a startup script

If it is script then how about if you run this under cron
* * * * /opt/rnic/bin/rnicd 1>/opt/rnic/log/rnic.log 2>&1

Sachin