Links

   Quran Explorer - Interactive Audio Recitations & Translations

Wednesday, September 1, 2010

Solaris - svc command options

Table 2—Useful options for svcs(1)

Note that a lowercase -d option and the uppercase -D option actually mean different things. The -d option results in a list of services on which the named service depends, while the -D option results in a list of services which depend upon the named service. Think of them as above and below the service on a dependency tree.
In Step 1, you used the -a option to list all services on the system. Now take a look at the list of services on which inetd depends.
To list the dependencies of the inetd service, use the svcs command, specifying the -d option:
my-system# svcs -d inetd
STATE STIME FMRI
disabled Apr_18 svc:/network/inetd-upgrade:default
online Apr_18 svc:/milestone/name-services:default
online Apr_18 svc:/network/loopback:default
online Apr_18 svc:/milestone/network:default
online Apr_18 svc:/system/filesystem/local:default
online Apr_18 svc:/network/rpc/bind:default
online Apr_18 svc:/milestone/sysconfig:default
As you can see, inetd depends upon a number of different services including inetd-upgrade and name-services. The same command can be used to find out if any one of these services depends upon other services. With the information gathered you can sketch out the dependency tree for inetd. Figure 1 shows a partial graph of the dependency tree for inetd.

Figure 1—Partial dependency tree for inetd (enlarge image)
To generate a similar list for Apache2, use the svcs command and the -d option, specifying Apache2 by name:
my-system# svcs -d apache2
STATE STIME FMRI
online Apr_18 svc:/network/loopback:default
online Apr_18 svc:/network/physical:default
Next, use the -D option to identify services which depend upon inetd and Apache.
To discover the services which depend upon inetd, use the svcs command with the -D option, specifying inetd by name:
my-system# svcs -D inetd
STATE STIME FMRI
online Apr_18 svc:/milestone/multi-user:default
In this example you can see that multi-user depends upon inetd.
Next, find the services which, in turn, depend upon multi-user.
To discover the services which depend upon multi-user, use the svcs command with the -D option, specifying multiuser by name:
my-system# svcs -D multi-user
STATE STIME FMRI
disabled Apr_18 svc:/network/dhcp-server:default
online Apr_18 svc:/milestone/multi-user-server:default
Notice that there are two services which depend upon multi-user, dhcp-server and multi-user-server.
Next, examine the dhcp-server.
To discover the services which depend upon dhcp-server, use the svcs command with the -D option, specifying dhcp-server by name. Follow through the whole dependency tree in the same way:


my-system# svcs -D dhcp-server
STATE STIME FMRI
online Apr_18 svc:/milestone/multi-user-server:default
Find the services which depend upon multi-user-server:
my-system# svcs -D multi-user-server
STATE STIME FMRI
online Apr_18 svc:/system/zones:default
Find services which depend upon zones:
my-system# svcs -D zones
STATE STIME FMRI
In this case, there are no services which depend on zones, so this is the end of the dependency tree. See the dependency tree below.
 Listing Service Processes

No comments:

Post a Comment

Feel free to leave a comment