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.
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
$ cp /tmp/rmtmpfiles.xml /etc/svc/profile/site/rmtmpfiles.xml
$ svcadm restart manifest-import
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