[OpenIndiana-discuss] shell script mutex locking or process signaling

Edward Ned Harvey (openindiana) openindiana at nedharvey.com
Thu May 30 16:51:57 UTC 2013


> From: Gary Mills [mailto:gary_mills at fastmail.fm]
> 
> On Thu, May 30, 2013 at 02:15:12PM +0000, Edward Ned Harvey
> (openindiana) wrote:
> >
> > Here's the problem I'm trying to solve: SMF service is configured
> > to launch things like VirtualBox during startup / shutdown.  This
> > startup process can take a long time (10, 20 minutes) so if there's
> > a problem of any kind for any reason, you might do things like
> > enable and disable or refresh the service ... but each time the
> > script gets launched, it's not aware of the previous one.
> 
> Are you saying that the method script itself might manipulate the
> service, or that the system admin might do it?  SMF has ways to
> prevent multiple instances of the method from running and to make
> enable and disable requests synchronous.  Can you do what you want
> within SMF, or does the method script had to do all the process
> manipulation?

Not familiar with that, but, if you can name some XML tags, or things to search for, I'd be willing to take a look.  I can say this: I'm biased to believe SMF is complex and confusing, mostly due to lack of understandable documentation surrounding the XML, and lack of any good XML tools to edit, validate, or otherwise produce good XML.   So I'm biased to expect it's probably better to use locking within the script.

Also, the desired behavior is NOT to prevent multiple scripts from running.  The desired behavior is to let the later instances supersede the previous instances, letting the previous instances die gracefully (without putting SMF into mainetnance or anything like that.)  So a certain amount of shell script hackery is required, no matter what.



More information about the OpenIndiana-discuss mailing list