[OpenIndiana-discuss] shell script mutex locking or process signaling
Edward Ned Harvey (openindiana)
openindiana at nedharvey.com
Sat Jun 1 00:05:45 UTC 2013
> From: James Carlson [mailto:carlsonj at workingcode.com]
>
> At least for me, when an SMF method takes time, I end up with that "*"
> marker in the svcs output, and it doesn't let me to do overlapping changes.
Huh. Now I go explicitly check, and I see the same thing. As long as the service is in transition state (with *) any subsequent calls to enable/disable/refresh the service seem to be completely ignored. (I wonder what happens if you disable a service while it's in transition starting? Does it queue the commands and immediately call the "stop" after the "start" finished? Does it ignore your command and stay enabled? Does it become disabled, even though it's started?)
Now I wonder how I ever saw multiple concurrent instances of the start method running. Did I really do it manually, by running "/lib/svc/... start" and not remember that particular detail afterward? Was it a behavior that changed from 151a5 to 151a7? (Why do I remember seeing the behavior?) It seems unlikely that I would do that, and not remember it. But I've been known to be a doofus from time to time. So maybe. Uggh, I hope not.
I swear, I saw multiple concurrent start methods running, frequently enough, that I kept making the mental note to implement locking. Now I finally did it, and can't reproduce the problem. How annoying.
For what it's worth, I just tested refreshing 50 times in rapid succession. SMF queues the requests and processes them serially.
So I have a new question (probably warrants a new thread).
Suppose you have a SMF service that could take a while to start, and suppose in the meantime, an admin is noticing it's going poorly. And would like to disable the service. (While it's in transition starting.) Is there a simple SMF toggle property that will *allow* the service to be disabled (and call the stop method) while the start method is still running?
I've gone to the effort of writing all the locking BS now. Only to discover I can't use it. Pfffft.
At present, if there's a problem bringing up some machines, and I want to terminate the virtualbox guest startup process, I guess I can call "/lib/svc/method/... stop" But sometimes that's hard to remember under pressure.
More information about the OpenIndiana-discuss
mailing list