bootup script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users bootup script
# 1  
Old 01-09-2004
bootup script

Hello there
I need to run a script whenever i reboot or startup my HP-UX server. This script adds some routes to the route table, and it start third party aplications like "Star Manager".
I thought i could do this simply putting the script in "/sbin/init.d,
and a link to the script in "/sbin/rc2.d" using this command:

ls -s /sbin/init.d/myscript S999myscript

Then i have created a reference to "/etc/rc.config.d/myscript"
using in the file , "MYSCRIPT=1", wich means it's to run.

But, simply just doesn't work.
What am i doing rong?
Thanks for any help
# 2  
Old 01-09-2004
Re: bootup script

Code:
ls -s /sbin/init.d/myscript  S999myscript

The correct command is ln -s, not ls -s.

Also, you should link the script as S99myscript, i.e. only TWO digits. Apart from that, I'm a Linux admin so I don't know the specifics of HP-UX, but under Linux:

place original file in /etc/rc.d, then create the link thusly

Code:
ln -s /etc/rc.d/myscript /etc/rc.d/rc3.d/S99myscript

(or rcn.d where n is the runlevel)

Don't know if this helps

Cheers
ZB
# 3  
Old 01-09-2004
> Also, you should link the script as S99myscript, i.e. only TWO > > digits.

HP-UX uses mostly 3 digits after the S or K. Thus S999 would
be the last thing started.

Note - good practice says you should also create an equivalant stop script i.e. K999myscript or similar.

- Finnbarr
# 4  
Old 01-09-2004
Sorry , i have used "ln -s" not "ls -s", i just wrote it wrong.
Like you said fpmurphy, HP-UX uses 3 digits to set the starting order, so i have used S999 to star in last.
I will create the other link with K100 to kill the process, thats a very good tip. But first of all, i want to get it started.
many thanks to you both.
# 5  
Old 01-09-2004
It sounds like you're doing things more or less right. Look in /etc/rc.log to see if there are any clues there.
# 6  
Old 01-09-2004
I love this forum
Thanks Perderabo, you were right.
I looked into rc.log , and found a "/sbin/rc2.d/S999myscript: execute permission denied
start FAILED

I dont know why it doesn't start but this is a point to go from.
By the way, could this have something to do with the run level?
or could be about permissions, wich would be strange since the script was created by "root"?
# 7  
Old 01-09-2004
You'll need to make sure that the original file, /sbin/init.d/myscript, has execute permission.

Code:
chmod 755 /sbin/init.d/myscript

would make it executable for the scripts owner, and everyone else

the check that the permissions exist for the link with
Code:
ls -l /sbin/rc2.d/S999myscript

and it should be something like lrwxr-xr-x Use the other scripts for a guide as to what the permissions should be.

Last edited by zazzybob; 01-09-2004 at 12:30 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

Error F painit on bootup

I have a known good external SCSI HD running SCO UNIX OpenServer 5.0.7. I decided that I wanted to be able to run this drive on another computer, so I bought the same SCSI card as before (LSI) and then attempted to boot on the other system. The bootup process hung with the error F painit. I've... (13 Replies)
Discussion started by: Transpower
13 Replies

2. Linux

Script under rc3.d not being executed on server bootup

Hello all, I have a script callled 'ABCstartup' setup under /etc/rc.d/init.d Softlink 'S91ABCstartup' pointing to above script has been created under /etc/rc.d/rc3.d The script is not being executed when the server restarts. The script runs successfully via manual execution:... (5 Replies)
Discussion started by: hemangjani
5 Replies

3. UNIX for Dummies Questions & Answers

bootup sequence

What is the boot up sequence in UNIX? (2 Replies)
Discussion started by: karthi_g
2 Replies

4. AIX

File system not mounting at bootup

Hi, I've got a recent problem with 2 file systems on an AIX 5.3 server. The fs's are marked to auto mount at startup and do show as being mounted after a a restart however if you cd to the mount point and 'df -g .' it shows the fs hasn't actually mounted. $ mount |grep SQLT0001.0 ... (2 Replies)
Discussion started by: m223464
2 Replies

5. UNIX for Advanced & Expert Users

Multiple runlevel options at Bootup

Is it possible to give multiple runlevel options during boot up.. When the Welcome screen appears, i want to give multiple runlevel options.. So the user can boot into any desired runlevel he wants.. Found this kinda interesting.. Any hints and solutions please? (2 Replies)
Discussion started by: srikumar_cs
2 Replies

6. AIX

AIX server freezes on bootup

Issue: AIX server freezes on bootup. Server AIX ver 4.3.3.0 When the AIX server reboots it negotiates NIS. During startup of NFS, customer gets one or more of the following error messages: 0513-056 Timeout waiting for command response. If you specified a foreign host, see the /etc/inittab file... (1 Reply)
Discussion started by: srzaman1
1 Replies

7. AIX

How to start ssh at bootup

Hi i installed ssh of version v 1.21 and my AIX is of 5.3. I want to start my ssh deamon at the startup can any one please help me out reg.. Thanks in advance.. (1 Reply)
Discussion started by: kmalla
1 Replies

8. UNIX for Dummies Questions & Answers

Why not automatic bootup

Evry time I start up my mavhine ,have to type in unix at Boot : Is there a way unix should bootup automatically? Asif (2 Replies)
Discussion started by: asif iqbal
2 Replies

9. UNIX for Dummies Questions & Answers

Bootup Error

Hi all The following error was displayed when a sco server (5.0.5) was booted. What should be done to overcome the problem. Replies appreciated. Bios 03.0 0130688 KB memory good 01 processor(s) in system remote console dialing on, please wait connect fail : modem off cpu clock... (6 Replies)
Discussion started by: raguramtgr
6 Replies

10. UNIX for Dummies Questions & Answers

Triple bootup

Hi guys, May I know how to install Solaris 8 in the way that I can triple boot it with my the other two OS: WIndows ME and Windows 2000 Pro. Can you all please kindly advise me on how to setup the triple boot process inorder to allow Windows ME to be the default OS when being ask to choose... (1 Reply)
Discussion started by: cia
1 Replies
Login or Register to Ask a Question