comparison usr/src/cmd/svc/startd/method.c @ 14183:68927c785889 default tip

4099 SMF methods without absolute paths no longer work Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@nexenta.com>
author Jerry Jelinek <jerry.jelinek@joyent.com>
date Fri, 06 Sep 2013 09:20:56 -0700
parents 3159d5f5b16a
children
comparison
equal deleted inserted replaced
14182:863932c97ce8 14183:68927c785889
849 * such as '/lib/svc/method/console-login %i'. 849 * such as '/lib/svc/method/console-login %i'.
850 */ 850 */
851 if ((pend = strchr(method, ' ')) != NULL) 851 if ((pend = strchr(method, ' ')) != NULL)
852 *pend = '\0'; 852 *pend = '\0';
853 853
854 if (stat64(method, &sbuf) == -1 && errno == ENOENT) { 854 if (*method == '/' && stat64(method, &sbuf) == -1 &&
855 errno == ENOENT) {
855 log_instance(inst, B_TRUE, "Missing start method (%s), " 856 log_instance(inst, B_TRUE, "Missing start method (%s), "
856 "changing state to maintenance.", method); 857 "changing state to maintenance.", method);
857 restarter_free_method_context(mcp); 858 restarter_free_method_context(mcp);
858 result = ENOENT; 859 result = ENOENT;
859 goto out; 860 goto out;