Project

General

Profile

Bug #4099

SMF methods without absolute paths no longer work

Added by Rich Lowe about 6 years ago. Updated about 6 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:

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.

History

#1

Updated by Robert Mustacchi about 6 years ago

  • Category set to cmd - userland programs
  • Status changed from New to Pending RTI
  • % Done changed from 0 to 100
  • Tags deleted (needs-triage)

Jerry's current approach is to currently restrict the additional check here to fully qualified paths.

#2

Updated by Robert Mustacchi about 6 years ago

  • Status changed from Pending RTI to Resolved

Resolved in 52e13e00baadc11c135170cd60a8b3c4f253a694.

Also available in: Atom PDF