SMF is fast and loose with require_any/service dependencies
Service instances are started by graph_start_if_satisfied() in startd/graph.c. This function calls instance_satisfied with 'satbility' set to B_FALSE (the 'satbility' flag is used to enable/disable checking for unsatisfiable dependencies) which in turn is passed to the dependency functions.
Unfortunately due to a bug in require_any_satisfied it always returns '1' when 'satbility' is set to B_FALSE. Even more unfortunate is that dependencies on services are mapped internally to a require_any dependency group containing all instances of said service. In short, you cannot rely on require_any or service dependencies to be satisfied before your service starts.
Updated by Rich Lowe over 3 years ago
This makes sense, but I'm not sure which piece of what you describe is the wrong one.
The behaviour of the 'satbility' flag seems like it may make sense, from a certain point of view. But if it does, the mapping to a require_any with it passed B_FALSE does not.
Also, allow me to state for the record just how upset I am that the flag is really called "satbility" and is not a typo.
Updated by Andrew Stormont over 3 years ago
Let me clarify what the 'satbility' flag is supposed to do. The dependency functions return 1 (satisfied), 0 (unsatisfied) or -1 (unsatisfiable). Because it takes a bit more work to determine if a dependency is unsatisfiable and that information is not always needed, the satbilility flag can be used to turn it off. In that case functions should only return 1 or 0.