- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Adding script in 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
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
09-05-2011 10:48 PM
09-05-2011 10:48 PM
Adding script in startup
Dear friends,
I am very new in hpux.
how to add my own script in startup. What are the steps. Kindly explain the any one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2011 10:52 PM
09-05-2011 10:52 PM
Re: Adding script in startup
Take a look at rc(1m). There is a template you can use.
- Tags:
- rc(1M)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2011 11:02 PM
09-05-2011 11:02 PM
Re: Adding script in startup
Steps :-
1. deciced which run-level you want your script to be called (e.g) /sbin/rc1.d or rc2.d or rc3.d
2. create file name for your script & create (soft-link) (e.g) /sbin/init.d/nfs.server
lrwxr-xr-x 1 root root 23 May 9 2009 S100nfs.server -> /sbin/init.d/nfs.server
S100nfs.server -> softlink file name
/sbin/init.d/nfs.server -> actual location of the file
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2011 12:25 AM
09-18-2011 12:25 AM
Re: Adding script in startup
Hello,
Here is the simple recipe for a new service, say, called myservice:
1. cp /sbin/init.d/template /sbin/init.d/myservice
2. vi /sbin/init.d/myservice
a. Edit start_msg statement
b. Edit stop_msg statement
c. Edit start statement
i. Change CONTROL_VARIABLE to MYSERVICE
ii. Add command to start your service
iii. Add command set_return
d. Edit stop statement
i. Change CONTROL_VARIABLE to MYSERVICE
ii. Add command to stop your service
iii. Add command set_return
3. vi /etc/rc.config.d/myservice
a. Add single line, MYSERVICE=1
4. ln -s /sbin/init.d/myservice /sbin/rc3.d/S900myservice
ln -s /sbin/init.d/myservice /sbin/rc2.d/K100myservice
This is well described in HP-UX SNA II course.
Regards,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2016 03:36 PM
05-09-2016 03:36 PM
Re: Adding script in startup
Don't forget to add the corresponding:
/etc/rc.config.d/myservice_CONTROL_FILE, to control startup (or no startup) during boot.