Project

General

Profile

Actions

Bug #4099

closed

SMF methods without absolute paths no longer work

Added by Rich Lowe about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2013-09-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

2a17138d7a5102bc6e0bf0444224cd0c416d98f0 introduced changes from Jerry to fix "3991 startd, configd spinning due to bad sac start method"

This included code which does this

+        if (stat64(method, &sbuf) == -1 && errno == ENOENT) {
+            log_instance(inst, B_TRUE, "Missing start method (%s), " 
+                "changing state to maintenance.", method);
+            restarter_free_method_context(mcp);
+            result = ENOENT;
+            goto out;
+        }

SMF had, previously, been willing to search $PATH for methods. Obviously you can't stat() such a method though, and this will fail, preventing any SMF service that used to rely on a $PATH search to find its start method to drop into maintenance on upgrade.

Presumably, we should be mimicing the path search here, and then calling stat on the result, or otherwise doing something smarter.

smf_method(5) is a bit wishy-washy, but certainly suggests that us actually running '/bin/sh -c <value of exec>' is something that can be relied upon.

Actions

Also available in: Atom PDF