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>


 499                                 break;
 500 
 501                         case EINVAL:
 502                                 log_instance(inst, B_FALSE, "%s: pool name "
 503                                     "\"%s\" is invalid", errf,
 504                                     mcp->resource_pool);
 505                                 break;
 506 
 507                         default:
 508 #ifndef NDEBUG
 509                                 uu_warn("%s:%d: Bad error %d for function %s "
 510                                     "in restarter_set_method_context().\n",
 511                                     __FILE__, __LINE__, rsmc_errno, errf);
 512 #endif
 513                                 abort();
 514                         }
 515 
 516                         exit(SMF_EXIT_ERR_CONFIG);
 517                 }
 518 



























 519                 if (errf != NULL) {
 520                         errno = rsmc_errno;
 521                         perror(errf);
 522 
 523                         switch (rsmc_errno) {
 524                         case EINVAL:
 525                         case EPERM:
 526                         case ENOENT:
 527                         case ENAMETOOLONG:
 528                         case ERANGE:
 529                         case ESRCH:
 530                                 exit(SMF_EXIT_ERR_CONFIG);
 531                                 /* NOTREACHED */
 532 
 533                         default:
 534                                 exit(1);
 535                         }
 536                 }
 537 
 538                 switch (rsmc_errno) {




 499                                 break;
 500 
 501                         case EINVAL:
 502                                 log_instance(inst, B_FALSE, "%s: pool name "
 503                                     "\"%s\" is invalid", errf,
 504                                     mcp->resource_pool);
 505                                 break;
 506 
 507                         default:
 508 #ifndef NDEBUG
 509                                 uu_warn("%s:%d: Bad error %d for function %s "
 510                                     "in restarter_set_method_context().\n",
 511                                     __FILE__, __LINE__, rsmc_errno, errf);
 512 #endif
 513                                 abort();
 514                         }
 515 
 516                         exit(SMF_EXIT_ERR_CONFIG);
 517                 }
 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 
 546                 if (errf != NULL) {
 547                         errno = rsmc_errno;
 548                         perror(errf);
 549 
 550                         switch (rsmc_errno) {
 551                         case EINVAL:
 552                         case EPERM:
 553                         case ENOENT:
 554                         case ENAMETOOLONG:
 555                         case ERANGE:
 556                         case ESRCH:
 557                                 exit(SMF_EXIT_ERR_CONFIG);
 558                                 /* NOTREACHED */
 559 
 560                         default:
 561                                 exit(1);
 562                         }
 563                 }
 564 
 565                 switch (rsmc_errno) {