Running named from SMF

From: Crist Clark (Crist.Clark@globalstar.com)
Date: Tue Mar 18 2008 - 17:05:03 EST


I want to run BIND, named, on a system. This is of course
in the Solaris 10 base system and as such, has all of the
SMF magic already installed. But I am having trouble
figuring out how to customize the start up. All I want to
do is have named drop privileges and run as a non-root user
after it gets going, i.e. I want to run it with the "-u"
option.

I'm having two problems with this. The first is a fundamental
question I have about the whole SMF thing. The named manpage
mentions,

     start/user

         Specifies the identity of the user that is invoking
         named. See smf_method(5) and chroot(2).

Now whether this is actually what I want, I will get into
later, but first, I'm having trouble making this change.
Here is a pretty clear way to show the disconnect,

        # svcprop -p start/user dns/server
        root
        # svccfg -s dns/server setprop start/user = astring: bind
             
        svccfg: No such property group "start".
        # svccfg -s dns/server listprop | grep start
        filesystem_minimal/restart_on astring none
        loopback/restart_on astring error
        network/restart_on astring error

If I look at the manifest file,
/var/svc/manifest/network/dns/server.xml,
I can kind of see what's going on. The "start" and some other
stuff that svcprop(1) sees is actually in the "exec_method" tags,
not a "property_group" which is what svccfg(1M) seems to only
see. I could just go in and change the manifest files, but while
researching this and in past looks at SMF documentation, I always
see lots of dire warnings about manual edits to manifest files.
What is the right way to modify the "start/user?" If I were to
create a "start" property group, does this magically override the
settings inside of the "exec_method" somehow?

My second problem is that "start/user" is probably not what I
want. I believe that the "start/user" is roughly equivalent
to doing,

        su - <user> -c <smf_method>

That is, it would execute named as the non-root user I specify.
That's not what I want. I want the "-u" option of named. However,
no such option is provided in the Sun execution method for the
dns/server service. It looks straight forward enough for me to edit
/lib/svc/method/dns-server to add the feature I want, but what
is the "right way," the vendor-supported way, to do this? Do
I change the existing /lib/svc/method/dns-server, or do I risk
getting that clobbered by a future patch? Is there a standard
place to put a administrator-modified method script?

(Oh, and if there are any Sun people out there, could you add
the "-u" option to the Sun distribution? I don't know why
99% of the BIND installations shouldn't be running with reduced
privileges. The "-u" option is something to be encouraged.)

BB<information contained in this e-mail message is confidential, intended
only for the use of the individual or entity named above. If the reader
of this e-mail is not the intended recipient, or the employee or agent
responsible to deliver it to the intended recipient, you are hereby
notified that any review, dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this e-mail
in error, please contact postmaster@globalstar.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:42:52 EDT