David Powell wrote: > Roland Mainz wrote: > > - "usr/src/cmd/dlmgmtd/svc-dlmgmtd" contains something weired: > > -- snip -- > > +# The real daemon is not started in a non-global zone. But we need to > > +# create a dummy background process to preserve contract lifetime. > > + > > +if smf_is_nonglobalzone; then > > + (while true ; do sleep 3600 ; done) & > > + exit $SMF_EXIT_OK > > +fi > > -- snip -- > > Erm... questions: > > 1. why is this done.. > > 2. ... and how should this work ? I assume the shell child process will > > "meet the truck" at the first SIGHUP... or am I wrong in this case ? > > 3. At which runlevel is this script used, before or after /usr has been > > mounted ? > > A contract-duration service's start method is expected to exit having > started some long-running daemon or set of daemons. If those > processes ever die out, startd notices and restarts them. > > If a contract-duration service sometimes doesn't need to start long- > running daemons, simply returning isn't an option. startd will think > some calamity immediately befell the service and will immediately > restart it. Eventually it will think something is seriously wrong > and put the service in the maintenance state. > > This code is faking out SMF, making it think that the service is > healthy (which it truly is) and running (which it really isn't). > I notice svc-nscd plays a similar trick.
Well, there is a quick&&easy solution using the "disown" command (e.g. $ xclock & disown $! #) ... however it depend on whether /usr is available or not... > I just filed RFE 6611755 to find a better way of doing this. Thanks! :-) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)
