smf(5) profiles: a preamble

I'll talk more about the details of smf(5) profiles later, but I've been motivated by an email question to post a profile use-case before I get around to the entire description. You can read about profiles in smf(5) and the somewhat inscrutable smf_bootstrap(5).

Profiles are really just a way to configure a bunch of services as enabled or disabled. They're generally located in /var/svc/profile (but that's not a requirement). You can use svccfg apply to apply a profile to a running system. See Stephen's post for a specific example.

Profiles are particularly useful if you want to enable or disable a bunch of services during jumpstart. All you need to do is create a site.xml file that reflects the services you want enabled and disabled, and drop it into /a/var/svc/profile/site.xml during your finish script. It will be imported automatically on the first reboot. For example, if I wanted to disable sendmail, I'd create a site.xml that looks like this:

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='profile' name='default'>
     <service name='network/smtp' version='1' type='service'>
          <instance name='sendmail' enabled='false'/>
     </service>
</service_bundle>

You can easily add more services to this example by just replicating the three "service" lines, and changing them to reflect the specific service name and instance name you want to enable/disable.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Liane Praza

Search

Categories
Archives
« July 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
31
  
       
Today