Running SMF Services as non-root user
non-root SMF service
Many services doesn't require to run as root. Traditionally most services do start as root and just drop their privileges. With Solaris (>=10) you don't need that anymore, you can start services directly as user from the SMF.
Some Services like Webserver need "root privileges" at start to bind port 80 for example. However, in Solaris there are no "root privileges". There are many privileges now, one privilege called "net_privaddr" is excactly the privilege a Webserver will need to bind port 80, so there is no need to give all privileges a root user normaly have to the webserver.
<exec_method type='method' name='start' exec='/usr/local/bin/tntnet -c /var/tntnet/tntnet.conf' timeout_seconds='60'> <method_context> <method_credential user='tntnet' group='tntnet' privileges='basic,net_privaddr'/> </method_context> </exec_method>
This is an example from my tntnet SMF manifest, you can download the full manifest here.