- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to execute a script at startup
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:19 AM
02-24-2003 07:19 AM
I've also a sun server and I put the scripts I want to run automatically at startup in /etc/init.d but I don't know how to do it in hp-ux.
Thanx for the help I hope to receive,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:24 AM
02-24-2003 07:24 AM
Re: How to execute a script at startup
This related link should cover all the steps involved.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0fdefef4d250d611abdb0090277a778c,00.html
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:24 AM
02-24-2003 07:24 AM
Re: How to execute a script at startup
The config file for your script in /etc/rc.config.d/filename.
In filename you set variable to 0 or 1.
with 1 set it will start at boottime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:26 AM
02-24-2003 07:26 AM
SolutionIn HP-UX you use /sbin/init.d.
Place your script there & then link it to the dir for the necessary run level /sbin/rc2.d, /sbin/rc3.d, etc.
Call the file whatever you want in /sbin/init.d, but the links should be of the following format
Start script => SXXXname
Stop scipt => KXXXname
where XXX=three digits like S725name. The digits control the order or execution. Take a look at any of the scripts already there for proper file syntax. You normally need at least 4 sections, stop, start, stop_message & start_message. These scripts should require NO input nor terminal to run.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:27 AM
02-24-2003 07:27 AM
Re: How to execute a script at startup
put the startup script in /sbin/init.d
lets call this script sc01
Then create a symbolic link
/sbin/rc2.d/Sxxxsc01
to
/sbin/init.d/sc01
where
xxx is a number you can choose.
When the system boots up and enters run-level 2 all scripts in /sbin/rc2.d will be executed, so will be your Sxxxsc01
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:27 AM
02-24-2003 07:27 AM
Re: How to execute a script at startup
Look at the scripts in /sbin/init.d directory for examples. When the system comes up, it will start the scripts under /sbin/rc*.d that start with S* depending on the run level. Also during the shutdown, it brings down the processes using the scripts K* under the /sbin/rc*.d again. These are nothing but links to /sbin/init.d scripts.
So, keep your script in /sbin/init.d. Create links from /sbin/rc?.d for both K* and S* ? being the run level that you wish to run this script at.
You can also keep a switch file in /etc/rc.config.d. Define a variable in the script that gets set with /etc/rc.config.d. Again, you can look at the files under this directory and see how they control the behaviour of the scripts /sbin/init.d directory.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:31 AM
02-24-2003 07:31 AM
Re: How to execute a script at startup
Then create the appropriate symbolic link in /sbin/rc2.d (assuming you want to start this script up at run level 2). Use the last startup sequence number. For instance if say S900ems is the existing last startup script then use S901
# /sbin/init.d/myprogram start
to start it up .. and ..
# /sbin/init.d/myprogram stop
to stop it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 07:46 AM
02-24-2003 07:46 AM
Re: How to execute a script at startup
Hope it helps