- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to add the startup script in hp-unix
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
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
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
01-23-2019 08:35 PM
01-23-2019 08:35 PM
how to add the startup script in hp-unix
how to add the startup script in hp-unix 11.31
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2019 12:13 AM
01-24-2019 12:13 AM
Re: how to add the startup script in hp-unix
A quick explanation.
- Startup and stop scripts in 11.31 are located in "/sbin/initd.d/"
- Configuration files/items, like variables should be placed in /etc/rc.config.d/
There is a "template" file in /sbin/init.d that you should copy, rename and use. It also has some general descriptions.
Modify/add the 4 possible options in the "case $1" statement.
Test start and stop:
To start run:
"/sbin/init.d/<your_script> start "
To stop run:
"/sbin/init.d/<your_script> stop"
To let HPUX run the script during startup and stop, you need to add symbolic links.
First you need to decide in which run-level the script should be started. E.g. 2
Under /sbin you will find directories named "rc1.d, rc2.d, rc3.d" etc....
The number is the run-level.
If you want your script to be run when entering run-level2, then you will need to create a symbolic link to your script in "rc.2.d".
The symbolic link-name need to begin with a "S" and a number and point to your created startup-script. (check the files/links in the directory and you will understand. E.g. "S432my_new_startup -> /sbin/init.d/<your_script>"
Note that your script will now be called twice when entering run-level 2.
First time with option "start_msg", second time with option "start". (Its all scripted, check "/sbin/rc" ).
The number that you put into your symbolic link defines the order of the startup. lower numbers are called first.
The same method needs to be applied when doing the stop.
In the example, you would want your script to be run with the "stop" option when moving from run-level 2 to run-level 1.
Thus, you need to add a link in "/sbin/rc1.d/". This link need to start with "K" followed by a number.....
Run "ll /sbin/*/*audit", and you will understand how that should look like. (i picked up the audit-script as an example)
Hope that helps.
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
