Jon Krueger wrote: >> Unless if you declare your service as 'transient', >> svc.startd expects a process to still be running when the start method >> exits.) > > That seems related: > > [ Jun 3 00:47:18 Executing start method ("/lib/svc/method/svc-labeld > start") ] > /lib/svc/method/svc-labeld: already enabled. Exiting. > [ Jun 3 00:47:19 Method "start" exited with status 0 ] > [ Jun 3 00:47:19 Stopping because all processes in service exited. ] > > The second line comes from my start method here: > > echo "$0: already enabled. Exiting." > exit $SMF_EXIT_OK > > Our process isn't transient. Should be present. > > How about I instrument a little checking: > > echo "$0: already enabled. Exiting." > ps -aef | grep -labeld > exit $SMF_EXIT_OK > > If the start method is spinning, would I expect to see > no matching process at that point?
SMF doesn't work through pgreps. It works through contracts. It tracks 'children' precisely through a kernel mechanism that is resilient to reparenting to init and all the other tricks that daemons have to do. SMF can't track failure of your service if it didn't start it. Thus, as far as SMF is concerned, if the start method didn't start the process, the service isn't started. That's what the error message is telling you. You can't have it both ways: you can't have SMF track failures of your service and sometimes have your service not started by SMF. If you don't want SMF tracking your processes, make the service transient. If you leave it as a contract service, no $SMF_EXIT_OK is going to make SMF think that it started the service correctly, because it didn't start the service. liane