I have a question. In the man page for smf_maintain_instance, it says that it can take two flags, SMF_TEMPORARY and SMF_IMMEDIATE. It says that SMF_TEMPORARY means that the state lasts only for the lifetime of the current system instance (SMF-speak for until reboot?) and that SMF_IMMEDIATE takes place immediately killing any running methods. By "running method", does that include the actual daemon process? Or do I need to do the smf_disable_instance as well? What if I want the smf_maintain_instance to be temporary and immediate, can I combine the flags? The man page also says that effect of these calls is asynchronous; if I do the smf_maintain_instance and then exit, will the restarter start it up again if smf_maintain_instance hasn't taken effect yet? If so, how do I prevent that?
Sorry if these are basic questions. I looked in the man pages, but couldn't find the answers. Renaud Manus wrote: > -------- Original Message -------- > Subject: Re:[smf-discuss] How to make a service go into maintenance. > From: Brian Utterback <Brian.Utterback at Sun.COM> > To: Renaud.Manus at Sun.COM > Cc: smf-discuss at opensolaris.org > Date: Wed Apr 04 2007 15:14:55 GMT+0200 (CEST) > >> Okay, at least it is doable. Now, can it be done programatically >> from within the daemon? > > Yes, by using the libscf API and smf_maintain_instance() / > smf_disable_instance() > > -- Renaud > >> >> Renaud Manus wrote: >>> -------- Original Message -------- >>> Subject: [smf-discuss] How to make a service go into maintenance. >>> From: Brian Utterback <Brian.Utterback at Sun.COM> >>> To: smf-discuss at opensolaris.org >>> Date: Wed Apr 04 2007 14:57:16 GMT+0200 (CEST) >>> >>>> I have two related questions. The first is how can a daemon supplying >>>> a service indicate that there is a problem and that the service should >>>> go into maintenance rather than having the restarter restart it? >>> >>> svcadm mark maintenance FMRI >>> >>>> >>>> Secondly, on a related note, is there anyway to mark a service as >>>> "not applicable"? If, for instance a service that was designed >>>> specifically for a particular configuration found itself started >>>> on a system without that configuration, is there a way for the >>>> daemon to exit and not get restarted and not appear in maintenance >>>> but still get started on the next reboot? >>> >>> Your daemon could just disable it until the next reboot: >>> >>> svcadm disable -t FMRI >>> >>> Does that help? >>> >>> -- Renaud >>> >> > -- blu "When Congress started Daylight Savings Time earlier, did they even consider what affect an extra hour of daylight would have on global warming? Well, did they?" ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom