SUMMARY: Solaris 10 services .xml howto

From: Christopher L. Barnard <cbar44_at_tsg.cbot.com>
Date: Fri Oct 13 2006 - 10:31:31 EDT
I asked:

> I am in need of an .xml / solaris 10 svc file tutorial.  I am trying to
> port a working Named configuration from a solaris 9 server to a solaris 10
> server.  I copied the named.xml file from another, working, .xml file.  The
> /lib/svc/method/site/named file is basically my /etc/init.d/named file from
> solaris 9.  If I execute "/lib/svc/method/site/named start" manually,
> everything starts up as I want.  However, if I try to start it with svcadm,
> the named service immediately drops into mainenance mode:
>
> !/var/svc/log ] >> svcs site/named
> STATE          STIME    FMRI
> maintenance    15:07:06 svc:/site/named:default
>
> From the log file, it looks like there is a conflict with "initgroups".
> Unfortunately I have no idea what this is.  So I think I need a tutorial on
> building the site/named.xml file.  I am doing something wrong and I have
> no idea what...
>
> [ root!/var/svc/log ] >> more site-named\:default.log
> [ Oct 12 15:06:30 Leaving maintenance because disable requested. ]
> [ Oct 12 15:06:30 Disabled. ]
> [ Oct 12 15:07:06 Enabled. ]
> [ Oct 12 15:07:06 Executing start method ("/lib/svc/method/site/named start") ]
> starting domain name server with a nonroot user in a chrooted environment.
> named: initgroups(): Not owner
> [ Oct 12 15:07:06 Method "start" exited with status 0 ]
> [ Oct 12 15:07:06 Stopping because all processes in service exited. ]
> [ Oct 12 15:07:06 Executing stop method ("/lib/svc/method/site/named stop") ]
> rndc: connection to remote host closed

The answer:

Well, I had built the .xml file from the server.xml file which sets the user
and group for the named process.  It was pointed out to me that initgroups()
is a Sun Solaris call, and has a man page.  I further found out that the error
was not coming from the manifest -- it was coming from the named binary.

I stripped out the user & group settings in the .xml file and went with
the -u and -t flags for named, and all is well.  I also got rid of my
legacy startup script and put all of the code in the .xml file itself.  But
the biggest thing to remember is that mods to the .xml file are not read into
the manifest until after you delete and then re-add the manifest with svccfg.
Just saving the file is not sufficient.  Once I figured that out my changes
were suddenly taking effect.;^)

Thanks to Darren Durham from taos.com and Luc Suryo of suryo.com.

+-----------------------------------------------------------------------+
| Christopher L. Barnard         O     When I was a boy I was told that |
| cbarnard@tsg.cbot.com         / \    anybody could become president.  |
| (312) 347-4901               O---O   Now I'm beginning to believe it. |
| http://www.cs.uchicago.edu/~cbarnard                --Clarence Darrow |
+----------PGP public key available via finger or PGP keyserver---------+
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Oct 13 10:32:37 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:02 EST