- Reference 29.1<br>System Initialization
- Reference 29.2<br>User Session
- Reference 29.3<br>Sleep Modes, Logout, and Shutdown
- Reference 29.4<br>Startup Shortcuts
- Reference 29.5<br>System Initialization Troubleshooting
- Reference 29.6<br>User Session Troubleshooting
- Exercise 29.1<br>Examine System Startup
- Exercise 29.2<br>Use Single-User Mod
Exercise 29.1
Examine System Startup
Prerequisite
You must have created the Chris Johnson account (Exercise 6.1).
As OS X starts up, it gives auditory or visual cues as to which step of the startup process is currently being performed. If the startup process fails to complete, identifying the step where it halted can help illuminate the cause of the issue. In this exercise, you will identify steps in the startup sequence using audible and visible cues. You will then examine the processes that activate automatically when you start up your computer. After completing this exercise, you will be able to identify the sequence of startup events that occur during OS X startup.
Identify Steps in the Startup Process
In this exercise, you will watch the startup process in a standard startup. You will find that the startup process moves through some steps very rapidly, while other steps only flash on the screen, such as an icon that blinks to indicate a component loading. Some steps display onscreen for a significant amount of time only if the underlying process does not start properly.
- If your computer is on, shut it down. You can use the Apple menu or (if you are not logged in) the buttons on the login screen to shut it down.
- Start up your computer.
- As the computer is starting up, use the table below to note the major steps occurring during the startup process (from turning the computer on through the user environment appearing). Keep in mind that certain steps may not apply, since you are not testing hardware issues or situations in which the startup device cannot be found.
Record the startup process associated with each visible or audible stage of the startup process. Refer to the reference section of this lesson. When you reach the login window, log in as Chris Johnson.
Visual or auditory cue |
Startup step, or process executing at startup step |
Startup chime |
|
Gray screen with Apple logo |
|
Gray screen with Apple logo and spinning gear |
|
Arrow pointer appears |
|
Login screen |
|
Desktop and Dock appear |
|
Examine the Process Hierarchy
The launchd process is an essential part of OS X. It is responsible for starting and managing much of what goes on in the background of OS X. It’s important to understand that there is a hierarchy of tasks in the core operating system. The kernel starts launchd, launchd starts a number of other processes, those processes start other processes, and so on. It can be useful, in the event of an issue, to understand this parent-child relationship or hierarchy to identify parent tasks, like launchd, that spawn multiple children to do their work.
- Ensure you are logged in as Chris Johnson.
- Open Activity Monitor from the Utilities folder.
- Choose View > “All Processes, Hierarchically”.
- If necessary, click the CPU tab.
- Click in the PID (Process ID) column header to display the processes in the order they launched (ascending order by process ID). You want the triangle, indicating the sort order, to be pointing up. If it is not, click the column header again.
- Click the disclosure triangle next to the launchd process with a process ID of 1 to reduce the view to just kernel_task and launchd.
- Select launchd and choose View > Inspect Process (Command-I, or click the i button in the toolbar).
- Close the Inspect window.
- Click the disclosure triangle next to launchd.
- Look for an instance of launchd owned by you (“chris” in the User column) and if necessary click its disclosure triangle to show its child processes.
- Quit Activity Monitor.
You can see that in the Process ID column, kernel_task is listed as a process. This represents the activity taking place inside the kernel. You can also see that launchd is process 1, meaning that it is the first task that is started by the kernel. This launchd process does not terminate until the system shuts down. All other processes are numbered sequentially after these core tasks. The process ID (PID) is an unsigned 32-bit number with a maximum value somewhere in the neighborhood of 2,147,483,647. Rest assured, however, that should you ever run two billion processes without restarting, the system would not crash when it reaches the maximum PID. It simply starts over again, using currently unused PIDs.
To understand the task hierarchy, you need more information than the task name and ID.
When inspecting a process, the name of the window is the name of the process followed by the process ID in parentheses. You can also see various process statistics relating to memory usage, performance, resource allocation, and (for processes you own) open files. You may also quit a process or sample a process. Sampling involves observing what is happening within the process and can be useful to developers if their application or other process is not responding.
Note that you can click the parent process and open an Inspect window for that task as well. This is very useful when you are working with higher-numbered tasks and tracing the process hierarchy backward.
The statistical values in your window will differ from what is shown here.
The list of processes running on the computer appears. The low-numbered processes are generally daemons that started before you logged in. Daemon is a term for a background process that acts on behalf of the system. Agents are background processes that act on behalf of a user. Daemons generally run as root (the System Administrator account) or another system user. Agents run as the users they are acting on behalf of.
A parent-child relationship is indicated by an indent and a disclosure triangle.
Most of the processes that make up your login session are subprocesses started by this launchd process. This includes applications you started yourself (for example, Activity Monitor), visible agents that were started automatically (for example, Finder and Dock), and also background agents that maintain part of the user environment without any visible indications (for example, fontd, which collects fonts and makes them available to your applications).
Check your launchd process for unexpected subprocesses that might affect the user environment. For example, this list would contain applications that were opened as login items for the current user, but hidden at startup. It also shows a disclosure triangle for processes that have subprocesses.