- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shutdown, init, and SAM
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
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
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
тАО12-08-2009 02:02 PM
тАО12-08-2009 02:02 PM
http://docs.hp.com/en/B3921-600631/shutdown.1M.html
http://docs.hp.com/en/B3921-60631/init.1M.html
The man page for shutdown states that with no options it will take you to "single-user mode". When describing the shutdown process it says that, for a "stand alone system" it will be brought down to run level 0. Then "If the system was not a cluster client and the system was being brought down to single-user state, a signal is sent to the init process to change states (see init(1M))."
Question 1: Am I to interpret that to mean that an "init -s" (or whatever the actual signal is) will be executed from run level 0?
Question 2: Assuming the answer to question one is yes, I thought that the only way to truly get into single user mode was to interrupt the boot process (what I've always done). Yes/No? Is it really possibly, for example, get to single user mode from SAM via the "shutdown to single user state" option?
Finally, my Asghar Ghori HP admin book states that "The shutdown command calls the init command behind the scenes.... You may use the init command instead. The only two features not available with init... [is] it will not broadcast a message or wait a specified period of time." Is this actually true or an oversimplification? The man pages seem to describe them quite differently.
I'm on 11iv2 and a PA-RISC based system (rp5450) if it matters given the general nature of my questions.
I'd appreciate any insight some of you more experienced admins could throw my way, including suggestions for further reading on these topics.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2009 02:38 PM
тАО12-08-2009 02:38 PM
Re: shutdown, init, and SAM
Single user mode is a start up command.
Start the system, get on console
Interupt on the 10 second prompt.
bo
Y to the interact question
hpux -is
At a boot prompt.
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
тАО12-08-2009 02:49 PM
тАО12-08-2009 02:49 PM
Re: shutdown, init, and SAM
If single user mode is a "start up" command as you say, then what does /usr/sbin/shutdown executed from say, run level 4, actually do? If I do a who -r afterwards, it tells me I'm in run level s....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2009 02:57 PM
тАО12-08-2009 02:57 PM
Re: shutdown, init, and SAM
With shutdown command you can't take your system into single user or any specific run label.
but through init command you can do the same
means from any runlabel you can switch to any.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2009 03:21 PM
тАО12-08-2009 03:21 PM
Re: shutdown, init, and SAM
"The shutdown command is part of the HP-UX system operation procedures. Its primary function is to terminate all currently running processes in an orderly and cautious manner. shutdown can be used to put the system in SINGLE-USER MODE for administrative purposes such as backup or file system consistency checks (see fsck(1M)), to halt or reboot the system, or to make the partition ready for reconfiguration. "
If you do a "/sbin/shutdown" and then do a "who -r" after, what run level do you get reported?
Thanks for the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2009 04:13 PM
тАО12-08-2009 04:13 PM
Re: shutdown, init, and SAM
However, it may not necessarily unmount all of the file systems or stop all services. So if you need to do something that require /var, /tmp or one of the OS related file systems to be unmounted, just doing a shutdown is not the best solution.
If you read the init man page for the 's|S' options you will see the following warning: "Transitioning into run level S from a higher run level does not terminate other system activity and does not result in a "single-user state"; this operation should not be done."
So while you "could" theoretically do an 'init s' or 'init S' you should not.
I suppose you could use SAM to shut down to single-user mode, but I think you will run into the same issues as above since it will probably just do a 'shutdown' or 'init S'.
Rebooting the server and coming UP into single-user mode is the SAFEST way to get there. Coming up into single-user mode absolutely ensures that NO extraneous processes are running and NO file systems are mounted.
I don't think I've every just done a 'shutdown' or 'init S' to go to single-user mode. It's not worth the potential pain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2009 06:33 PM
тАО12-08-2009 06:33 PM
Re: shutdown, init, and SAM
Going back to a few of my original questions, would you interpret the "Shutdown Procedure" section of shutdown's man to mean that when run with no params it will take the system down to 0, and from there, init to s|S?
Would there be any difference in running:
#shutdown
as opposed to
#init 0
#init s
Good response above. Want to try and get this nailed down since this will effect how some admin processes are done in production.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2009 06:56 AM
тАО12-09-2009 06:56 AM
Re: shutdown, init, and SAM
>>questions, would you interpret the
>>"Shutdown Procedure" section of shutdown's
>>man to mean that when run with no params
>>it will take the system down to 0, and
>>from there, init to s|S
I see the area of the man page you are looking at. However, doing a 'shutdown' with no arguments will NOT take the system down to run-level 0 and then back up to 's|S'. Run-level 0 shut's down HP-UX. If you were to run 'init 0' from the command prompt, HP-UX would shut down. Doing an 'init 0' is the equivalent of doing a 'shutdown -h'.
>>Would there be any difference in running:
>>#shutdown
>>as opposed to
>>#init 0
>>#init s
ABSOLUTELY. Once an 'init 0' is done, you would have to restart the system as it would be down. There would be no way to do an 'init s' after doing 'init 0'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2009 07:15 AM
тАО12-09-2009 07:15 AM
SolutionI don't normally do a 'shutdown' on systems, so I tried it. According to the messages displayed it appears that the /sbin/rc?.d/K* scripts were executed, and the system taken to a some semblance of run-level 0, and then brought to run-level 's'. When it go to 'single-user' mode via this method ALL of my VG00 file systems (/, /stand, /opt, /tmp, /usr and /home) were still mounted and there were 36 processes running.
I have just rebooted the system, interacted with the IPL, and brought it into single-user mode via 'hpux is'. At this point I have /stand mounted and cannot tell how many processes are running because the 'ps' command isn't available.
After mounting all filesystems, I have 34 processes running.
If you want to go to a true single-user mode I would reboot the system and come up into single-user mode via 'hpux -is'.
I would not use 'shutdown' to get to single-user mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2009 07:29 AM
тАО12-09-2009 07:29 AM
Re: shutdown, init, and SAM
The file systems above showed to have processes running against them when 'fuser -cu' was run against each one. One of the running processes was my shell process.
If something needed to be done against one of those file systems, it would probably be difficult because killing the running processes would shut the system down.
Killing your shell process wouldn't be much of an option.
When I did an 'exit' from this mode, I was asked what run level I wanted the system to go to. So, no shell means no system access.
If you have doubts, and a test system you can easily reboot, do some experiments of your own to see exactly what I'm talking about.