Trond Norbye's Weblog

« Memcached in Solaris | Main | Memcached source... »
Thursday Jan 24, 2008

OpenGrok and SMF

I have had SMF controlling my OpenGrok server for a long time, but up until today I have always performed the SMF management as root.

When I upgraded my server today I decided to try to figure out what I needed to do in order to create a new profile that I could use to start and stop OpenGrok, and it turned out to be quite easy.

The first thing you need to do is to create the authorizations and the profile by adding them to /etc/security/auth_attr and /etc/security/prof_attr:

/etc/security/auth_attr:
solaris.smf.value.opengrok:::Change OpenGrok value properties::
solaris.smf.manage.opengrok:::Manage OpenGrok service states::

/etc/security/prof_attr:
OpenGrok Administration::::auths=solaris.smf.manage.opengrok,solaris.smf.value.opengrok

The next thing you should do is to add this profile to the users you trust by updating /etc/user_attr

username::::profiles=OpenGrok Administration

(If you don't trust them that much you could give them just one of the authorizations)

You should now be ready to import the OpenGrok SMF description file (tools/smf/opengrok.xml in the OpenGrok source repository) and modify the environment-section to match your local configuration. (Note: you need the one I committed in changeset 228:175ea847bf89)

Import the service by executing the following command:

# svccfg import /path/to/opengrok.xml

Users should now be able to start and stop the service as long as they have the appropriate authorizations.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed