- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Startup scripts
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
07-29-2004 09:24 AM
07-29-2004 09:24 AM
ln -s /path/to/script /sbin/rc3.d/S999script.name
This is a script that starts and runs fine from the command line, but addinig to startup will be very useful. Is this correct or am I way off and risk hanging the boot like this? As you can see I want it to be the last thing that starts at boot time.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 09:31 AM
07-29-2004 09:31 AM
Re: Startup scripts
Did you use the template startup script as a guide in /sbin/init.d ? If not there could be something wrong. You may wish to post a copy here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 09:46 AM
07-29-2004 09:46 AM
Re: Startup scripts
As suggested, copy /sbin/init.d/template and include the script commands in the "start" section of the template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 09:51 AM
07-29-2004 09:51 AM
SolutionBy convention, the startup and kill values should add to 1000. This tends to order the startup/shutdown sequences nicely. For example if you link:
ln -s /sbin/init.d/myscript /sbin/rc3.d/S999myscript
You should link a kill script in run-level -1
ln -s /sbin/init.d/myscript /sbin/rc2.d/K001myscript
Make sure that you set and export and needed environment variables including PATH or you may find that the command will work perfectly when executed manually (when you have a nice PATH, etc.) but fail when rc'ed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 09:51 AM
07-29-2004 09:51 AM
Re: Startup scripts
By convention, the startup and kill values should add to 1000. This tends to order the startup/shutdown sequences nicely. For example if you link:
ln -s /sbin/init.d/myscript /sbin/rc3.d/S999myscript
You should link a kill script in run-level -1
ln -s /sbin/init.d/myscript /sbin/rc2.d/K001myscript
Make sure that you set and export any needed environment variables including PATH or you may find that the command will work perfectly when executed manually (when you have a nice PATH, etc.) but fail when rc'ed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 10:09 AM
07-29-2004 10:09 AM
Re: Startup scripts
an exit value of 3 from your script would mean the system will keep rebooting :-).
an exit value of 1 means failure, 2 means the script execution is skipped based on setting in some configuration file the script uses. (the startup scripts source /etc/rc.config.d/* files).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 12:47 PM
07-29-2004 12:47 PM
Re: Startup scripts
I've attached a document on startup that provides excellent info on how startup/shutdown scripts work under HP-UX.
Cheers
Con
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:13 AM
07-30-2004 01:13 AM
Re: Startup scripts
Thanks,
Rt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:18 AM
07-30-2004 01:18 AM
Re: Startup scripts
You've given me more then enough to get in the right direction on this, thanks so much!
If I have any other questions I'll post them here
(and Clay, no points for double posting! =)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 05:47 AM
07-30-2004 05:47 AM
Re: Startup scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 06:07 AM
07-30-2004 06:07 AM
Re: Startup scripts
So say I make a new script from the template and call it "start_script" and I use RUN_IT for the control variable, I need another file in /etc/rc.config.d called "start_script" and in there is a line that says RUN_IT=1 which say to run the script, if the 1 was a 0 it would skip running the script.
Is that run-on sentence the correct pattern (other then the obvious grammar errors)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 06:41 AM
07-30-2004 06:41 AM
Re: Startup scripts
# vi /etc/rc.config.d/myapp
RUN_IT=1
#
# vi /sbin/init.d/myapp
- Replace CONTROL_VARIABLE with RUN_IT
create sym links in /sbin/rc3.d to start and in /sbin/rc2.d (or below) to shutdown the application.