Quoth christopher dodd on Thu, Aug 14, 2008 at 10:46:39AM -0700:
> I'd like to import a svc that starts out disabled that will be run
> upon next boot.

That is not built into SMF.  You must manipulate the SCF repository
after the service is imported.  This is usually done in the postinstall
script of the package which delivers the service.

Though if it's not a requirement that the service starts disabled, but
only that it doesn't do anything, then it might be possible to bake this
into the service implementation.  That is, the manifest prescribes that
the service is enabled, then svc.startd starts it, but then the
implementation realizes that it shouldn't do anything, and either idles
or temporarily disables itself.  This requires, I suppose, that the
implementation be capable of differentiating between initial import and
next boot.

> Would I execute those lines from the workaround right after my import?
> From within my service? 
> 
> What does that "# or true" line mean? When would that be needed?

It means that if you want the service to be enabled on next boot, you
would use

        svccfg -s instance_fmri setprop general/enabled = true

instead.


David

Reply via email to