Print this page
3121 missing SMF method directories should say something useful
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: T Nguyen <truongqnguien@gmail.com>
Reviewed by: Richard Elling <richard.elling@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/method.c
          +++ new/usr/src/cmd/svc/startd/method.c
↓ open down ↓ 508 lines elided ↑ open up ↑
 509  509                                  uu_warn("%s:%d: Bad error %d for function %s "
 510  510                                      "in restarter_set_method_context().\n",
 511  511                                      __FILE__, __LINE__, rsmc_errno, errf);
 512  512  #endif
 513  513                                  abort();
 514  514                          }
 515  515  
 516  516                          exit(SMF_EXIT_ERR_CONFIG);
 517  517                  }
 518  518  
      519 +                if (errf != NULL && strcmp(errf, "chdir") == 0) {
      520 +                        switch (rsmc_errno) {
      521 +                        case EACCES:
      522 +                        case EFAULT:
      523 +                        case EIO:
      524 +                        case ELOOP:
      525 +                        case ENAMETOOLONG:
      526 +                        case ENOENT:
      527 +                        case ENOLINK:
      528 +                        case ENOTDIR:
      529 +                                log_instance(inst, B_FALSE, "%s: %s (\"%s\")",
      530 +                                    errf,
      531 +                                    strerror(rsmc_errno), mcp->working_dir);
      532 +                                break;
      533 +
      534 +                        default:
      535 +#ifndef NDEBUG
      536 +                                uu_warn("%s:%d: Bad error %d for function %s "
      537 +                                    "in restarter_set_method_context().\n",
      538 +                                    __FILE__, __LINE__, rsmc_errno, errf);
      539 +#endif
      540 +                                abort();
      541 +                        }
      542 +
      543 +                        exit(SMF_EXIT_ERR_CONFIG);
      544 +                }
      545 +
 519  546                  if (errf != NULL) {
 520  547                          errno = rsmc_errno;
 521  548                          perror(errf);
 522  549  
 523  550                          switch (rsmc_errno) {
 524  551                          case EINVAL:
 525  552                          case EPERM:
 526  553                          case ENOENT:
 527  554                          case ENAMETOOLONG:
 528  555                          case ERANGE:
↓ open down ↓ 678 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX