|
Description
|
[dep, 15Jan2008]
We recently discovered that on some systems adding a share using
sharemgr took 15 seconds. This delay was tracked down to
smb_enable_service(), which includes the following code:
/* Wait for service to come online */
for (i = 0; i < WAIT_FOR_SERVICE; i++) {
if (smb_isonline()) {
ret = SA_OK;
break;
} else {
ret = SA_BUSY;
(void) sleep(1);
}
}
Diagnosing the problem further showed that smb/server wasn't
available. In particular, it was in the maintenance state, which
means that until an administrator does something, it will *never* be
available. smb_isonline (which is already checking the state of the
service) should test for that so we can fail quickly.
This problem is exacerbated by the fact that no error is returned to
the user. I don't know if that is correct or not (I'd guess no), but
one outcome is that it takes considerable effort to determine why
sharemgr is behaving erratically.
|