Managing the services in Solaris.

The svcs command will report the status of servics in Solaris.
The svcadm command is used for service management such as starting, stopping and restoring services.

To display all services with their state information, use the svcs command with the -a option.
root@server1 # svcs -a
STATE STIME FMRI
legacy_run 14:33:14 lrc:/etc/rcS_d/S29wrsmcfg
legacy_run 14:33:21 lrc:/etc/rc2_d/S10lu
legacy_run 14:33:23 lrc:/etc/rc3_d/S99EIS-DVDtag
disabled 14:33:02 svc:/network/iscsi_initiator:default
disabled 14:33:02 svc:/system/metainit:default
online 14:33:23 svc:/application/cde-printinfo:default
online 14:33:23 svc:/application/graphical-login/cde-login:default
online 14:33:31 svc:/system/webconsole:console
offline 14:33:03 svc:/application/print/ipp-listener:default
(Note: This list has been truncated)

To display information about the dns service specify the service name.
# svcs -a | grep dns
disabled 12:40:54 svc:/network/dns/client:default
disabled 12:40:55 svc:/network/dns/server:default

or

# svcs dns/client
STATE STIME FMRI
online 14:33:13 svc:/network/dns/client:default

To list the dependencies of the inetd service, use the svcs command, specifying the -d option:
# 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

To discover the services which depend upon inetd, use the svcs command with the -D option, specifying inetd by name:
# 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.

To discover the services which depend upon multi-user, use the svcs command with the -D option, specifying multiuser by

name:
# 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.

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:
# 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:
# svcs -D multi-user-server
STATE STIME FMRI
online Apr_18 svc:/system/zones:default
Find services which depend upon zones:

# 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.

To enable the dns client service.
# svcadm enable /network/dns/client

For more information about the service management here is a link to Sun,

http://www.sun.com/software/solaris/howtoguides/servicemgmthowto.jsp#1.

About Andrew Lin

Hi, I have always wanted to creat a blog site but never had the time. I have been working in Information Technology for over 15 years. I specialize mainly in networks and server technologies and dabble a little with the programming aspects. Andrew Lin

View all posts by Andrew Lin →