- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /sbin/init.d script problem
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
03-02-2005 03:00 PM
03-02-2005 03:00 PM
The startup script is in /sbin/rc3.d, and the shutdown script is in /sbin/rc2.d. Perhaps I'll attach the scripts and someone in the know can comment on it (this is all new to me).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 04:15 PM
03-02-2005 04:15 PM
Re: /sbin/init.d script problem
scripts placed under /sbin/init.d and softlink to /sbin/rc2.d and rc3.d. and it works well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 06:56 PM
03-02-2005 06:56 PM
Re: /sbin/init.d script problem
Make sure that you ONLY have 2 links created as follows (substitue myscriptname for your script name!!):
ln -s /sbin/init.d/myscriptname /sbin/rc2.d/K001myscriptname
ln -s /sbin/init.d/myscriptname /sbin/rc3.d/S999myscriptname
When you do 'll -R /sbin | grep myscriptname' you should only have 3 entries.
To prevent the 'junk' in the rc.log, you should remember to re-direct your output from each xxx_start_db line that you have in your script - for example:
/u05/rpsb_admin/tiger_start_db >/tmp/logfile
or
/u05/rpsb_admin/tiger_start_db >/dev/null
The latter is not preferable as you won't see any errors!!
Hope that helps - Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 07:01 PM
03-02-2005 07:01 PM
Re: /sbin/init.d script problem
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 07:04 PM
03-02-2005 07:04 PM
Re: /sbin/init.d script problem
ln -s /sbin/init.d/mystopscript /sbin/rc2.d/K001myscriptname
ln -s /sbin/init.d/mystartscript /sbin/rc3.d/S999myscriptname
When you do 'll -R /sbin | egrep "mystopscript|mystartscript"' you should only have 4 entries.
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 07:59 PM
03-02-2005 07:59 PM
Re: /sbin/init.d script problem
also have a look at the attached document which discusses about HP-UX system startup and configuration models.
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 08:03 PM
03-02-2005 08:03 PM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:09 AM
03-03-2005 03:09 AM
Re: /sbin/init.d script problem
2) I don't place anything under /etc/rc.config.c. Granted, I am using two separate scripts - so I take it this is a non-issue?
3) I do not have any arguments to pass to the scripts, (hence no start_msg, start, stop_msg, or stop commands) - will this be an issue?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:27 AM
03-03-2005 03:27 AM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:31 AM
03-03-2005 03:31 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:36 AM
03-03-2005 03:36 AM
Re: /sbin/init.d script problem
The operating system will call the script twice on startup, once passing it the argument 'start_msg', the second time passing the argument 'start'. The first call is to allow the script to output a short line that will be displayed on the console (usually between [ ]'s), the second call is to actual start whatever the script is going to start.
The operating system will call the script twice on system shutdown, once passing it the argument 'stop_msg', the second time passing it the argument 'stop', for similar reasons.
Thus you should have a control script in /sbin/init.d which does something like ...
#!/sbin/sh
# comments
#
PATH=... whatever ...
export PATH
case "$1" in
"start_msg") echo "Starting XYZ" ;;
"start") start_script ;;
"stop_msg") echo "Stopping XYZ" ;;
"stop") stop_script ;;
esac
exit 0;
############
You start_script/stop_scripts can be wherever you like, provided you set the path correctly in the control script. You need to create a Kxxxx link in /sbin/rc2.d and a Sxxx link in /sbin/rc3.d to the control file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:42 AM
03-03-2005 03:42 AM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 03:47 AM
03-03-2005 03:47 AM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 04:07 AM
03-03-2005 04:07 AM
Re: /sbin/init.d script problem
I'm using this file to re-build my scripts. Since my script only starts and stops Oracle services - the section in that template file that is "Kill the named Process(es), $1=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 04:14 AM
03-03-2005 04:14 AM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 01:49 AM
03-04-2005 01:49 AM
Re: /sbin/init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2005 06:54 AM
03-07-2005 06:54 AM