I have a question on the method_context of an SMF profile that was discussed below. I'm currently implementing the SMF service and all works fine with the exception of
the method_profile.  This is  what the start method looks like:
 <exec_method
             type='method'
             name='start'
             exec='/lib/svc/method/svc-usb-interconnect start'
             timeout_seconds='60'>
             <method_context>
                     <method_profile name='Maintenance and Repair' />
             </method_context>
 </exec_method>

When I execute the start I get:
[ Mar 23 10:05:42 Could not find the execution profile "Maintenance and Repair", command /lib/svc/method/svc-usb-interconnect. ]

I know that 'Maintenance and Repair' is a valid execution profile in /etc/security/prof_attr:
root@bur419-75:/etc/security# grep Maintenance /etc/security/prof_attr
Maintenance and Repair:::Maintain and repair a system:auths=solaris.smf.manage.system-log,solaris.label.range,solaris.smf.manage.coreadm,solaris.smf.value.coreadm;profiles=Hotplug Management;help=RtMaintAndRepair.html


Is there a reason why this method_profile can't be found at execution? Perhaps the syntax is incorrect?

Thanks a lot for your help.

Bob Fournier


Thomas Whitten wrote:
On Wed, Jan 05, 2011 at 01:59:47PM -0500, robert fournier - Oracle Corporation 
- Burlington wrote:
Hello,

I would like some advice on SMF changes for a new command line
utility that is being
added via PSARC/2010/427 - x86 ILOM Configuration Utility.  The new
utility - ilomconfig -
is used to configure ILOM on the Service Processor using IPMI over
KCS (/dev/bmc).
One of commands ("ilomconfig enable interconnect") can be used to
set up the USB
interface (usbemc0) between the host and ILOM so that this interface
can be used
by applications to transfer data to/from ILOM.  As part of startup,
we need to run this
command ("ilomconfig enable interconnect") to set up the interface
so applications can
use it.  The command runs to entirety and sets up the host and ILOM
side of the
interface.  No other ilomconfig commands need to be added to SMF.

The questions I have, along with my proposal, are as follows:
- Is it appropriate to use SMF to run this command at startup (I
believe it is)?

From your description I would say yes.

- Since this command is related to network configuration, I believe
that the manifest should
be placed under /lib/svc/manifest/network. Is that acceptable?

Yes.

- I would like the default to be that the command will run to enable
the interconnect. I'm not
exactly sure how this relates to the issue of services being
disabled by default.

We have in the past recommended that service manifests be written with
instances declared as disabled, and then use the
/etc/svc/profile/generic.xml profile to enable the service where
appropriate.

There is a problem with this, however.  This profile is only applied once
on the first boot of the system.  If your service is a new service that is
delivered as part of an upgrade, then it won't get enabled.  We are working
on a project to fix this problem.  Until this project is delivered, you
should probably declare the service to be enabled in your manifest.  See
the create_default_instance entry that I've added to your manifest below.

- I am using the "Maintenance and Repair" Rights Profile and I have
an entry for ilomconfig.
in exec_attr that defines the privilege levels according to the
principle of least privilege.
I'm not exactly sure how how to specify the Rights Profile in the
method context, but there is
a stab at it below.

Your stab looks correct.

- My rough draft of a manifest file is as follows.  The naming is
preliminary.

<service_bundle type='manifest' name='SUNWilomconfig:usb-interconnect'>
<service
       name='network/usb-interconnect'
       type='service'
       version='1'>

Add the following line to create your instance and enable it as I discussed
above.  The instance's name will be default.

        <create_default_instance enabled='true' />

       <single_instance />

   <exec_method
               type='method'
               name='start'
               exec='/usr/sbin/ilomconfig enable interconnect'
               timeout_seconds='60'>
               <method_context>
                       <method_profile name='Maintenance and Repair' />
               </method_context>
       </exec_method>
   <exec_method
               type='method'
               name='disable'

The name should be 'stop'.

               exec='/usr/sbin/ilomconfig disable interconnect'
               timeout_seconds='60'>
               <method_context>
                       <method_profile name='Maintenance and Repair' />
               </method_context>
       </exec_method>

From your description, it sounds as if you want ilomconfig to run once at
startup.  You don't want SMF to restart it after it exits.  This is called
a transient service (look for duration in the svc.startd man page).  To
make the service be transient, add something like the following at this
point in your manifest.

        <property_group name='startd' type='framework'>
                <propval name='duration' type='astring'
                        value='transient' />
        </property_group>

       <template>
               <common_name>
                       <loctext xml:lang='C'>usb-interconnect</loctext>
               </common_name>
               <description>
                       <loctext xml:lang='C'>
                        usb-interconnect uses ilomconfig to set up
the USB interface to ILOM on the Service Processor
                       </loctext>
               </description>
               <documentation>
                       <manpage title='ilomconfig' section='1M'
                               manpath='/usr/share/man' />
               </documentation>
       </template>
</service>
</service_bundle>


Thank you for your help in defining this SMF service.

Regards,
Bob Fournier

_______________________________________________
smf-discuss mailing list
[email protected]

_______________________________________________
smf-discuss mailing list
[email protected]

Reply via email to