Enabling and disabling services

I thought I would show a different example of smf(5) today. Here's the state of the network/telnet service on my desktop:

# svcs -p network/telnet:default
STATE          STIME    FMRI
online         Jul_23   svc:/network/telnet:default

It's easy to enable and disable service instances using svcadm(1M):

# svcadm disable network/telnet
# svcs -p network/telnet:default
STATE          STIME    FMRI
disabled       13:08:15 svc:/network/telnet:default
# telnet localhost
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

And we can enable it just as easily, too:

# svcadm enable network/telnet
# svcs -p network/telnet:default
STATE          STIME    FMRI
online         13:08:29 svc:/network/telnet:default

Note that while something is declaring telnet service is available, no processes are associated with the service instance. If we "telnet localhost" from another window, we can then see the telnet daemon and the login session:

# svcs -p network/telnet:default
STATE          STIME    FMRI
online         13:08:52 svc:/network/telnet:default
               13:08:52   116400 in.telnetd
               13:08:52   116403 login

Support for enabling and disabling services can be done by calling smf_enable_instance(3SCF) and smf_disable_instance(3SCF), in addition to the command line interface of svcadm(1M). Since the framework relays the enable or disable request, we don't need privileges to signal any process (or even know which process we might have to signal to make the update...).

Comments:

Wow! This is pretty cool. I've been part of the external customer beta program for S10 and have been looking forward to seeing the SMF stuff. Are the changes persistent across reboots, or is there a seperate way to make changes persistent? Being able to see what's running and disable/enable things like this is a huge improvement for UNIX in general. Octave

Posted by Octave Orgeron on July 27, 2004 at 02:30 AM PDT #

@Octave: by default, enable and disable operations are persistent. You can specifically request temporary enabling or disabling�these will last only for the duration of the OS instance, and will reset on the next reboot. For example, <code>svcadm enable -t network/smtp:sendmail</code> would turn on Sendmail for the current boot of the OS, if it was previously disabled.

Posted by Stephen on July 27, 2004 at 02:39 AM PDT #

That's very handy. Do you see this replacing the inetd.conf type stuff? I'm all for replacing such things for something intelligent like SMF. I'll keep my eye out for testing this feature when it's available:)

Posted by Octave Orgeron on July 27, 2004 at 06:32 AM PDT #

@Octave: <code>inetd.conf</code>(4)'s contents have indeed been absorbed. We're very glad to hear you're willing to take it out for a test drive.

Posted by Stephen Hahn on July 27, 2004 at 08:50 AM PDT #

Stephen, Great news! I'm glad to see inetd.conf retired. I think it's really exciting to see soo many new features in S10 and improvements that other Unices don't have at all:)

Posted by Octave Orgeron on July 28, 2004 at 12:31 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

sch

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
External blogs