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.

 >>   svc-dlmgmtd:
 >>
 >>     If you want to guard against another running copy of dlmgmtd, I'd
 >>     first:
 >>
 >>       Try to find some way to test other than grepping for a process
 >>       that happens to have the same name.  I think fattach will fail if
 >>       another daemon has set up shop;
 >
 > Okay. I will add a check to see whether fattach() to the door file can
 > succeed before the dlmgmt_daemonize() call.

   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).

   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.

 >>     Why are you redirecting output to /dev/msglog?
 >>
 > 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.

 >>   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.

   Dave


Reply via email to