David Powell wrote: > Cathy Zhou wrote: > >> > SMF: Seb, David Powell > >> > > >> > External webrev: > >> > > >> > http://cr.grommit.com/~yun/webrev_uv_09_28 > > > > I thought about another problem in dlmgmt.xml the other day: > > > > Today, the 'stop' method is ':true', we choose that because trying to > > disable datalink-management service is usually not a right decision and > > would only cause problems. But that leaves a dlmgmtd deamon running, and > > reenabling the services will bring the service to the maintenance mode. > > > > Do you have good suggestion on this? > > I hadn't noticed that. You need to provide a functioning stop > method. If for nothing else, it is used by SMF to implement restart > (which is stop + start). > > There isn't a way to prevent someone from turning off a service, > other than to ensure they don't have the privilege doing so > requires. > Okay. I will change it to ':kill' then. Once the service is restarted, the daemon will recover the states. But things might go wrong between the "stop" and the next "start".
> What you have should work, but is doing unnecessary work and also > creates a point in time where someone could mistakenly attach to your > test door assuming dlmgmtd is on the other end. I was thinking you > would do so in the child and pass the result of the test back to the > parent, or (much simpler) take advantage of the existing test in > dlmgmt_wait_for_child() that compares di_target to your child pid. > > As it stands, the fact that dlmgmt_wait_for_child() will delay 5 > seconds and unconditionally return success is also a bug. It should > be waiting indefinitely, only returning success when the child > answers the door, and returning failure when someone else answers the > door or the child disappears (indicating it failed and exited). > Okay. I am not satisfied with the current dlmgmt_wait_for_child() code anyway. I will think about it. > Another thing I missed before is that the exit status of dlmgmtd is > returned as the exit status of the start method; you need to either > return the appropriate SMF_EXIT_* code from dlmgmtd or map its exit > status to the appropriate SMF_EXIT_* value in your method script. > Will do. Thank you! > > I'll remove that. The output should be able to be caught in the > > service's svc log file. > > Correct. There also isn't a need to redirect stderr to stdout; both > are captured by SMF. > Okay. > >> bfu.sh: > > > > I've considered all of your above comments and put the code into a > > common function that everyone can call. > > Yay! Looks great. > > BTW, if you instead do > > SVCCFG_REPOSITORY=... \ > /usr/sbin/svccfg ... > > you can avoid the export/unset. > Will change this too. Thank you again for your comments. - Cathy
