Proper sequence to boot from run level 3 to single user mode.

Posted on 2010-11-17
Last Modified: 2013-12-27
Hi, I was told by my tech lead that if you boot into single user mode  from run level 3 usnig init -s
that once you reach single user mode you are not truely in single user mode because there is a bug in the OS..  He said that the only way it should be done is to init 0 and then boot too single user mode from the boot prompt.  Has anyone heard of such a bug in the OS or know anything about the bug ? The reason for my concern is that we are trying to automate the patching where once booted into single user mode it will attempt to install the monthly patch cluster and would prefer to boot into single user mode to stream line the automation
Question by:FranHill
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 34157411
Never heard of it, additionnaly official sun documents recommends using init S from run level 3 as you mentioned to switch in single user mode for patch installations.


 Using appropriate run level for patching

Some patches such as the kernel updates need to be installed in single user mode.

This document describes the steps to use the appropriate run level during the patching operations.

Available Documentations:

The Manage Solaris Patches by Using the patchadd Command chapter in the Solaris System Administration Guide: Basic Administration manual provides further detail on patch installation on a Solaris system.

Steps to Follow
Please validate that each troubleshooting step below is true for your environment. Each step will provide instructions via a link to the document, for validating the step and taking corrective action as necessary. The steps are ordered in the most appropriate sequence to isolate the issue and identify the proper resolution. Please do not skip a step
1. Refer to the README file for the requirement of appropriate installation mode.
In general, kernel patches and patch clusters require installation in single user mode (or run level S).   Most other patches can be safely installed in multi user mode.  However, it is always necessary to check the installation requirement for every patch.  Such requirement is stated in the 'Installation Requirements' and 'Special Installation Instructions' section of the patch's associated README file.

For example, the README file for 120011-14 shows that this patch needs to be installed in single user mode.

(host1) /share/patches/120011/120011-14 $ ls README*

Install Requirements: See Special Install Instructions
                      Reconfigure immediately after patch is installed, an alternative may be in Special Install Instructions
                      Install in Single User Mode, an alternative may be in Special Install Instructions
Special Install Instructions:

NOTE 1:  Perform patch installation in single user mode.

NOTE 2:  Reconfigure the system (boot -r) immediately after patch installation.
2. Verify system's current run level with the command line utility 'who'.  For details of the utility, please refer to the manpage.
The following example shows that the system is at run level 3.
# who -r
   .       run-level 3  Apr  2 14:19     3      0  S
The following example shows that the system is at run level S.

# who -r
   .       run-level S  Apr  2 14:32     S      1  3
3. Bring the system to the single user mode if needed.
To switch the system to single user mode from multi user mode, you can use 'init S'.  Refer to the manpage for details.

The following example shows the process of bringing down to single user mode.

# init S
# svc.startd: The system is coming down for administration.  Please wait.
Apr  2 14:32:14 v4v-t1000c-sin06 syslogd: going down on signal 15
svc.startd: Killing user processes: done.
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)

Root password for system maintenance (control-d to bypass):
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode

Apr  2 14:32:34 su: 'su root' succeeded for root on /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.
4. If a patch needs to be installed in single user mode, it also needs to be removed in the same mode.

At this point, if you have validated that each troubleshooting step above is true for your environment, and the issue still exists, further troubleshooting is required.

Solaris 10 Operating System
Solaris 9 Operating System
Solaris 8 Operating System
LVL 22

Expert Comment

ID: 34157806
Define "single user mode".  I don't know of a difference off hand, but I suppose it is possible
that coming down to single user mode might leave you in a different state than coming up
to single user mode. Might also depend on your OS rev. There are a number of system services that do not have stop methods as I recall in Solaris 9 and before.

In any case, you should be in single user mode as far as installing patches is concerned. The
reason to go into single user mode is that while patches are being installed, the system can
be in an inconsistent state, where the libraries and on-disk kernel do not match the in memory kernel. The effect of this on arbitrary user processes is unknown, and could lead to
data corruption. We therefore limit the exposure by preventing any user processes from
running during the patching process.

What OS rev are you using? If it is an option, you should really consider using live upgrade
to install you patches. This eliminates the need to go to single user mode at all and gives
you the previous un-patched system image as a backup in case something goes wrong.
LVL 16

Accepted Solution

Joseph Gan earned 500 total points
ID: 34158344
The difference of "init S" from multi-user mode and "init 0" then "boot -s" is, "init S" will have all filesystems mounted. But "init 0" and "boot -s" will only have OS of root, /usr and /var etc mounted. That is recommanded status for patching. If you use "init S" follow by "umountall" then will be the same. You can try "init S" to see.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question