- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Init Run Levels
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
06-24-2008 12:00 AM
06-24-2008 12:00 AM
Re: Init Run Levels
That's not what it says:
If a transition from a higher to a lower run level occurs, the kill scripts for the new run level and all intermediate levels between the old and new level are executed.
So from 3 to 2, only 2 gets executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:08 AM
06-24-2008 12:08 AM
Re: Init Run Levels
so, the K script on level 2 should be executed, when I moved from 3 to 2.
what can cause it not to be executed?!
tx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:12 AM
06-24-2008 12:12 AM
Re: Init Run Levels
You need to trust in the rc(1m). :-)
Take a look at /etc/rc.log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:21 AM
06-24-2008 12:21 AM
Re: Init Run Levels
To execute a Kill init script run level 2.
init 2
or reboot
To execute a Start script run level 3
reboot
or
init 3
Note a softlink in /sbin/rc3.d/s180oracle will not execute
/sbin/rc3.d/S180oracle
will execute.
There is no chkconfig command in HP-UX.
lets say S180oracle softlinks to /sbin/init.d/oracle
For diagnostics , throw some echo statements in that script to try and narrow down the problem.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:31 AM
06-24-2008 12:31 AM
Re: Init Run Levels
I found the problem, now I need the way to solve it.
Since my service is a networking server, before I start it or stop it I check its status, by the command "ps -ef | grep -i $BIN_FILE_PATH | grep -v grep | awk '{print $2}'"
this is working for all the Unix platforms and also here when running from the command line.
BUT, after reading the rc log, I saw the following error:
Output from "/sbin/rc2.d/K009aim stop":
----------------------------
/sbin/rc2.d/K009aim[2]: ps: not found.
/sbin/rc2.d/K009aim[2]: grep: not found.
/sbin/rc2.d/K009aim[2]: grep: not found.
/sbin/rc2.d/K009aim[5]: printf: not found.
why those commands are not recognized?!
I'm sure there is something I miss here.
tx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:45 AM
06-24-2008 12:45 AM
Re: Init Run Levels
/sbin/rc2.d/K009aim[2]: ps: not found.
/sbin/rc2.d/K009aim[2]: grep: not found.
/sbin/rc2.d/K009aim[5]: printf: not found.
This is why I mentioned using "env -i".
>why those commands are not recognized?
Either your PATH isn't set up. Or /usr/bin is no longer mounted so you can't use those commands. Only the ones in /sbin/.
None of these commands are in /sbin/. So if your sequence number is before /usr is mounted, you'll fail.
Your K009aim seems to indicate you would be near the first for "K".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 12:58 AM
06-24-2008 12:58 AM
Re: Init Run Levels
I've already figured it out.
In my aim script I shoulf set the PATH variable and that fixed all the problem....
now...
after everything work, I want to get back to standards.
Is it ok to put K script only on rc2.d and S script on rc3.d
The reason that I'm asking is since on the other platforms, for each level that the server should be up/down we put the relevant script.
but here - I wonder.... what do you say?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 01:16 AM
06-24-2008 01:16 AM
Re: Init Run Levels
This is not "ok" but this is required that you have it S for 3 and K for 2.
>for each level that the server should be up/down we put the relevant script.
rc(1m) says that all levels between are executed. This basically means if you only have it in one place, you only do it on S transitions to 3 or higher. Or on K transitions to 2 or lower. You don't need it at every level, unless you want to do different things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 03:54 AM
06-24-2008 03:54 AM
Re: Init Run Levels
> In my aim script I shoulf set the PATH variable and that fixed all the problem....
If you had started with the '/sbin/init.d/template', or looked at it more closely, you might have seen :-) that it declares a minimal PATH:
PATH=/usr/sbin:/usr/bin:/sbin
Too, when you test startup and shutdown (kill) scripts at a commandline, and they work, but then fail when executed in the '/sbin/rc?.d' sequence during changes in 'init' level, you can immediately begin to suspect deficiencies in your running environment. Aside from the PATH, you must include any environmental variable that you need. This is the reason I suggested that you test first at the command line in your normal shell environment.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2008 05:06 AM
06-24-2008 05:06 AM
Re: Init Run Levels
- « Previous
-
- 1
- 2
- Next »