Managing System Services in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Create a Profile by Using svcbundle

The svc:/system/rmtmpfiles service is responsible for cleaning up the /tmp directory on boot. By default, the rmtmpfiles service does not clean up /var/tmp. To clean up /var/tmp during the boot process, change the behavior of the svc:/system/rmtmpfiles service by setting the options/clean_vartmp property to true. The easiest way to achieve this behavior on multiple systems is to create a profile and place it in /etc/svc/profile/site on each system.

  1. Create the profile.

    The following command creates a new profile in /tmp/rmtmpfiles.xml.

    $ svcbundle -o /tmp/rmtmpfiles.xml -s service-name=system/rmtmpfiles \
    	    -s bundle-type=profile -s service-property=options:clean_vartmp:boolean:true
  2. Make any necessary changes to the profile.
  3. Copy the profile to the correct directory.
    $ cp /tmp/rmtmpfiles.xml /etc/svc/profile/site/rmtmpfiles.xml
  4. Restart the manifest import service to apply the profile to the system.
    $ svcadm restart manifest-import
Example 4-16  Automatically Installing a Profile by Using svcbundle

If you do not need to make any changes to the new profile, you can use the -i option to install the profile as soon as it is created. The svcbundle command will write the profile to /etc/svc/profile/site/rmtmpfiles.xml and restart the manifest-import service. Any existing file with the same name in the /etc/svc/profile/site directory will be overwritten.

# svcbundle -i -s service-name=system/rmtmpfiles \
	    -s bundle-type=profile -s service-property=options:clean_vartmp:boolean:true