Sangeeta Misra wrote: > On 05/28/09 08:21, Alan Maguire wrote: >> Sangeeta Misra wrote: >>> On 05/28/09 05:29, Alan Maguire wrote: >>>> Sangeeta Misra wrote: >>>>> >>>>> >>>>> In ILB project, the persistent configuration is kept in the SCF >>>>> framework and a user would use svcadm to enable/disable the ILB >>>>> service. My question is, in the event that the ILB service, >>>>> experiences a fatal error, is there a programmatic way to put ILB >>>>> service in maintainance mode ( to prevent the service from going >>>>> into a cycle or restart followed by fatal error)? >>>> If the ILB service daemon can detect such fatal errors >>>> once it has daemonized, you can use the libscf function >>>> >>>> smf_maintain_instance(ILB_FMRI, SMF_IMMEDIATE) >>>> >>>> (where ILB_FMRI points at the ILB service instance) >>>> >>>> ...to kill the associated running processes and put the >>>> instance into maintenance. If there are fatal conditions >>>> detectable before daemonizing, simply exit with >>>> errorcode 95 (SMF_EXIT_ERR_FATAL). >>>> >>>> Hope this helps, >>>> >>>> Alan >>> Thanks. Also after the service automatically goes into maintainance >>> mode, we would like to have the user save the ILB config ( and >>> provide that to us, so we can recreate the problem) and then wipe >>> out the ILB service configuration in scf to start fresh. >>> Assuming this is possible with SCF, how can the user do this ? Do >>> they need to save a image of a shipped ILB config ( which is really >>> enpty config) before they configure ILB , so at a later time they >>> can revert back to that config? >>> >> hmm, one approach that might be worth investigating >> - assuming all the config is in properties contained >> in the ILB service instance - would be the use of SMF >> snapshots (read-only views of the properties >> associated with an instance). > > The ILB SMF manifest does not contain the config properties. Is there > a way of simply wiping out the ILB service configuration using SCF > commnand? Since the shipped ILB config is an empty config, I would > think wiping the config out via SCF ( note by this I mean the the > config of the ILB service) and restarting the service via svcadm > should do the trick (??) > That would do the trick, with the proviso that you'd need to refresh the ILB service instance so the property deletion makes it into the running snapshot (from which the ILB daemon will read its config).
Auto-restarting I'm not sure about - the more common SMF approach would be to reserve maintenance state for cases that required human intervention. Under that model, an explicit "ilbadm revert-config" command or similar could clear out the properties, refresh the instance and clear the maintenance state allowing the service to rerun (I'm assuming here that this clearing out of config would be reserved for scenarios where the configuration is not usable). Alan