четверг, 21 января 2016 г.

Sun StorEdge A3510FC: SMF для Sun StorEdge(tm) Configuration Service Agent и Sun StorEdge(tm) Diagnostic Reporter daemon

Точно по той же самой причине, что и в случае SMF для SMagent в массивах 2540-M2, напишем SMF для ssagent и ssdgrptd.

 <?xml version="1.0"?>  
 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">  
 <!--  Manifest-file for Sun StorEdge(tm) Configuration Service Agent, put this file in  
     /var/svc/manifest/system/ssagent.xml  
     and run #svccfg import /var/svc/manifest/system/ssagent.xml  
     Yuri Voinov (C) 2016  
 -->  
 <service_bundle type='manifest' name='SSagent'>  
   
 <service  
     name='system/ssagent'  
     type='service'  
     version='1'>  
   
     <create_default_instance enabled='false' />  
   
     <single_instance />  
   
     <dependency name='fs-local'  
         grouping='require_all'  
         restart_on='none'  
         type='service'>  
         <service_fmri  
             value='svc:/system/filesystem/local' />  
     </dependency>  
   
     <dependency name="multi-user"  
         grouping="require_all"  
        restart_on="error"  
           type="service">  
       <service_fmri value="svc:/milestone/multi-user-server:default"/>  
     </dependency>  
   
     <exec_method  
         type='method'                                                     
         name='start'  
         exec='/etc/init.d/ssagent %m'  
         timeout_seconds='60' />  
   
     <exec_method  
         type='method'  
         name='stop'  
           exec='/etc/init.d/ssagent %m'  
         timeout_seconds='60' />  
   
     <property_group name='general' type='framework'>  
         <!-- to start stop SSagent -->  
         <propval name='action_authorization' type='astring'  
             value='solaris.smf.manage' />  
     </property_group>  
   
     <stability value='Unstable' />  
   
     <template>  
         <common_name>  
             <loctext xml:lang='C'>  
              Sun StorEdge(tm) Configuration Service Agent  
             </loctext>  
         </common_name>  
     </template>  
   
 </service>  
 </service_bundle>  

 <?xml version="1.0"?>  
 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">  
 <!--  Manifest-file for Sun StorEdge(tm) Diagnostic Reporter daemon, put this file in  
     /var/svc/manifest/system/ssdgrptd.xml  
     and run #svccfg import /var/svc/manifest/system/ssdgrptd.xml  
     Yuri Voinov (C) 2016  
 -->  
 <service_bundle type='manifest' name='ssdgrptd'>  
   
 <service  
     name='system/ssdgrptd'  
     type='service'  
     version='1'>  
   
     <create_default_instance enabled='false' />  
   
     <single_instance />  
   
     <dependency name='fs-local'  
         grouping='require_all'  
         restart_on='none'  
         type='service'>  
         <service_fmri  
             value='svc:/system/filesystem/local' />  
     </dependency>  
   
     <dependency name="multi-user"  
         grouping="require_all"  
        restart_on="error"  
           type="service">  
       <service_fmri value="svc:/milestone/multi-user-server:default"/>  
     </dependency>  
   
      <dependency name='SSagent'  
           grouping='optional_all'  
           restart_on='refresh'  
           type='service'>  
       <service_fmri value="svc:/system/ssagent:default"/>  
      </dependency>  
   
     <exec_method  
         type='method'  
         name='start'  
         exec='/etc/init.d/ssdgrptd %m'  
         timeout_seconds='60' />  
   
     <exec_method  
         type='method'  
         name='stop'  
           exec='/etc/init.d/ssdgrptd %m'  
         timeout_seconds='60' />  
   
     <property_group name='general' type='framework'>  
         <!-- to start stop ssdgrptd -->  
         <propval name='action_authorization' type='astring'  
             value='solaris.smf.manage' />  
     </property_group>  
   
     <stability value='Unstable' />  
   
     <template>  
         <common_name>  
             <loctext xml:lang='C'>  
              Sun StorEdge(tm) Diagnostic Reporter daemon  
             </loctext>  
         </common_name>  
     </template>  
   
 </service>  
 </service_bundle>  

И сходным образом отключим lrc сервисы для последующего использования SMF:

 # To disable StorEdge lrc services:  
 mv /etc/rc2.d/S81ssagent /etc/rc2.d/.S81ssagent  
 mv /etc/rc2.d/S82ssdgrptd /etc/rc2.d/.S82ssdgrptd  
   
 or   
   
 /etc/init.d/ssdgrptd disable stop  
 /etc/init.d/ssagent disable stop  
   
 svcadm enable ssagent  
 svcadm enable ssdgrptd  

Вот и все, ребята! ;)

PS. Импортировать сервисные манифесты не забудьте ;).