Operating System - HP-UX
1847479 Members
2971 Online
110265 Solutions
New Discussion

Re: UNIX Auto Start Script

 
SOLVED
Go to solution
KY.Chuang
Advisor

UNIX Auto Start Script

Hi,
I want to edit a script ,it will be executed automatically when UNIX start , But Just once.
(1) Which directory or system file I should put this script into that let it executed when UNIX start ?
And if it have any error or log when executing, where system will be save it?
(2) If I edit a sciprt to start Oracle Service(svrmgrl and lsnrctl)when UNIX start, Can I use "su" -command to change cureent user form "root" to "oracle" and change it back in my script.

Regards.
K.Y

Service is King
3 REPLIES 3
ramkumar
Valued Contributor

Re: UNIX Auto Start Script

Hi k.y

you can do very easily . by adding your script in /sbin/rc /S##<script name> where ## is appropriate number which should not conflict with others . if you want to start the process
with only from oracle user while system boots that also possbile .

2) you can start this with inetd daemon . there is a file /etc/inetd.conf in this you can mention the desired user name also . to make it working you have to mention the proper listener
service name which should present in the /etc/services also.

Thanks and regards
Ramkumar
KCS_1
Respected Contributor
Solution

Re: UNIX Auto Start Script

Hi,KY,Chuang

Have a look at the following(recovery hand book)

This link gives you what you want to do

http://www2.itrc.hp.com/service/iv/docDisplay.do?docId=prodITRC/DE_SW_UX_swrec_EN_01_E/Startup.pdf



regards
Easy going at all.
Muthukumar_5
Honored Contributor

Re: UNIX Auto Start Script

1> Put the script on corrresponding startup level as /sbin/rc#.d/ directory there. And give the execution permission to that file, else it will not be executed. See some other files located at /sbin/rc#.d/ directoy. It is having standard format there. IF you want to try before startup try it on shell command there right now. If u have problem, that will be good to avoid during startup.

To check the script problem try to run with debugging mode as set -x on shell first.

Error log / startup information's will be in /etc/rc.log file there.

2> Yes. You can do it as su - -c to be executed there.

If you are running su from root then no passwd needed there. After execution of su with command it will return to root there.

See man rc, su
Easy to suggest when don't know about the problem!