Solaris OS Processes

Every program you run in the Solaris OS creates a process. When you log in and start the shell, you start a process. When you perform a command or when you open an application, you start a process.

The system starts processes called daemons. Daemons are processes that run in the background and provide services. For instance, the desktop login daemon (dtlogin) provides a graphical prompt that you use to log in.

Using a PID

Every process has a unique process identification number (PID), which the kernel uses to track, control, and manage the process.

Using Process UID and GID Numbers

Each process is associated with a UID and a GID. These numbers indicate who owns a process and determine the functions of a process. Generally the UID and GID associated with a process are the same as the UID and GID of the user who started the process.

Understanding the Parent Process

When one process creates another, the first process is considered to be the parent of the new process. The new process is called the child process.

While the child process runs, the parent process waits. When the child finishes its task, it informs the parent process. The parent process then terminates the child process. If the parent process is an interactive shell, a prompt appears, indicating that it is ready for a new command.

Viewing a Process

You can use the process status (ps) command to list the processes that are scheduled to run in that shell. The ps command has several options you can use to determine which processes to display and how to format the output.


Using the ps Command

The syntax for the ps command is as follows:

ps options

For each process, the ps command displays the PID, the terminal identifier (TTY), the cumulative execution time (TIME), and the command name (CMD).

Identifying the ps Options

The table describes some of the options you can use with the ps command.

Options for the ps Command
Option Description
Prints information about every process on the system, including the PID, TTY, TIME, and CMD
Generates a full (verbose) listing, which adds fields including the UID, parent process identification number (PPID), and process start time (STIME)
Note: Refer to the online man pages for a complete list of options for the ps command.

Displaying a Listing of All Processes

You can use the ps -ef command to view a listing of all the processes currently scheduled to run on the system. The following example shows how you can use the ps -ef command to display a listing of all processes.

$ ps -ef | more
root	  0	   0	0	Oct 23	 ?		0:18	sched
root	  1	   0	0	Oct 23	 ?		0:01	/etc/init -
root	  2	   0	0	Oct 23	 ?		0:00	pageout
root	  3	   0	0	Oct 23	 ?		17:47	fsflush
root	  7	   1	0	Oct 23	 ?		0:00	/lib/svc/bin/svc.startd
root	  9	   1	0	Oct 23	 ?pse		0:00	svc.configd
... (output truncated)

Leave a Reply

Your email address will not be published. Required fields are marked *