Installing and Administering Solaris Container Manager 3.6

ProcedureTo Determine the Match Expression for an Application

Use this procedure to determine the correct match expression to identify the processes corresponding to the application you want to manage. This expression is required in the New Container wizard to move processes automatically into a container.

Steps
  1. From a terminal window, start the application that the application-based container will manage.

  2. To see a list of all processes that are running, in a terminal window type:


    % ps -cafe
    
  3. In the CMD column, locate the corresponding executable name.

    Choose the expression that will uniquely identify the application's processes.


Example 4–1 Determining a Match Expression For Mozilla

The following is an example of output from the ps - cafe command in a search for Mozilla:


% ps -cafe
     UID   PID  PPID  CLS PRI    STIME TTY      TIME CMD
    ...
username  8044  7435   IA  50 19:47:09 pts/11   0:00 /bin/ksh -p /usr/sfw/lib/mozilla/mozilla

In this example, the unique executable name is mozilla. Likewise, a correct match expression is mozilla.



Example 4–2 Determining a Match Expression for Tomcat Server

When you know the name of the application, you can use the grep command in conjunction with ps -cafe to locate the correct match expression. The following is an example of output from the ps - cafe | grep tomcat command in a search for Tomcat server. This example has been condensed for space, leaving the irrelevant information.


% ps -cafe | grep tomcat
  nobody 27307  /usr/j2se/bin/java -classpath //usr/apache/tomcat/bin/bootstrap.jar:/usr/j2se/l
 

In this example, the executable name is java. However, the correct match expression is tomcat. In this case, the match expression is the argument instead of the executable name, as java does not uniquely identify the Tomcat processes.



Example 4–3 Verifying a Match Expression for Tomcat Server

The following example shows how to use the pgrep command to find the PID. The PID verifies that you have identified the unique match expression for finding the desired process:


% pgrep -f tomcat
27307

The PID for Tomcat server is 27307. This number matches the PID from Example 4–2. This match confirms that the match expression tomcat corresponds to the Tomcat server process.