Tuesday, January 20, 2009

Strange SMF "Bug?"

Yesterday I've installed apache 2 on Solaris 10 x86 (on two machines) from the Solaris CD:
pkgadd -d . SUNWapch2r
pkgadd -d . SUNWapch2u
pkgadd -d . SUNWapch2d
After the successful install I've tried to enable the service, but the service was not there :), The next step was to reimport the service to the SMF repository:
bash-3.00# svccfg -v import /var/svc/manifest/network/http-apache2.xml
svccfg: Scope "localhost" changed unexpectedly (service "network/http" added).
svccfg: Could not refresh svc:/network/http:apache2 (deleted).
svccfg: Successful import.
and again, the service was not there, searching the net for it, and I've found this: http://mail.opensolaris.org/pipermail/smf-discuss/2006-October/005565.html
"This happens when a buggy i.manifest is used. If your package has an
i.manifest file which uses SVCCFG_REPOSITORY, then that is your problem.
You can fix it by restarting svc.configd ("pkill configd" as root).
Then you should fix your package, or file a bug."
By reading it I've thought that it is a long shot, but it worked! "killing" configd and reimporting the service worked:
bash-3.00# svccfg -v import /var/svc/manifest/network/http-apache2.xml
svccfg: Taking "previous" snapshot for svc:/network/http:apache2.
svccfg: Upgrading properties of svc:/network/http according to instance "apache2".
svccfg: Taking "last-import" snapshot for svc:/network/http:apache2.
svccfg: Refreshed svc:/network/http:apache2.
svccfg: Successful import.
Regards

3 comments:

Terence said...

Thank you very much! I also have this problem, and it helps.

Unknown said...

Yup, I did a minimal install, and this fix worked for me too.

Unknown said...

Champion!