diff options
| author | Hengqing Hu <hudayou@hotmail.com> | 2012-08-30 13:37:54 +0000 |
|---|---|---|
| committer | Hengqing Hu <hudayou@hotmail.com> | 2012-08-30 13:37:54 +0000 |
| commit | 338752012b4b5c79726c72fe94e26eb4f0a78cf1 (patch) | |
| tree | 2909d54783c56b657b37f21572531b076176e591 /usr/src/cmd/svc | |
| parent | cd1c8b85eb30b568e9816221430c479ace7a559d (diff) | |
| download | illumos-joyent-338752012b4b5c79726c72fe94e26eb4f0a78cf1.tar.gz | |
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>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd/svc')
| -rw-r--r-- | usr/src/cmd/svc/startd/method.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/usr/src/cmd/svc/startd/method.c b/usr/src/cmd/svc/startd/method.c index 7c4e389845..6fc05ed49a 100644 --- a/usr/src/cmd/svc/startd/method.c +++ b/usr/src/cmd/svc/startd/method.c @@ -516,6 +516,33 @@ exec_method(const restarter_inst_t *inst, int type, const char *method, exit(SMF_EXIT_ERR_CONFIG); } + if (errf != NULL && strcmp(errf, "chdir") == 0) { + switch (rsmc_errno) { + case EACCES: + case EFAULT: + case EIO: + case ELOOP: + case ENAMETOOLONG: + case ENOENT: + case ENOLINK: + case ENOTDIR: + log_instance(inst, B_FALSE, "%s: %s (\"%s\")", + errf, + strerror(rsmc_errno), mcp->working_dir); + break; + + default: +#ifndef NDEBUG + uu_warn("%s:%d: Bad error %d for function %s " + "in restarter_set_method_context().\n", + __FILE__, __LINE__, rsmc_errno, errf); +#endif + abort(); + } + + exit(SMF_EXIT_ERR_CONFIG); + } + if (errf != NULL) { errno = rsmc_errno; perror(errf); |
