opscode-cookbooks/chef-client — pull request #170 by bixu (2014-07-02 15:29:30+00:00)
Title: use paths cookbook to set bin path for SMF-managed chef-client

The SMF service-management facility is shared by both Solaris and Illumos-based OS distributions. This causes issues with PATHing when the SMF template bundled with this cookbook is used on SmartOS systems, as an example:

```
[2014-07-02T13:18:44+00:00] ERROR: execute[install NPM package manta] (/var/chef/cache/cookbooks/npm/providers/package.rb line 6) had an error: Errno::ENOENT: No such file or directory - npm
```

This is because the bundled SMF method script has a hard-coded PATH env var, one that assumes Solaris-like patching for binaries (Solaris uses a /usr/local prefix while SmartOS uses a /opt/local prefix).

Rather than simply patching each cookbook affected by pathing issues such as this one, I think it's better to take a completely attribute-driven approach, and populate this attributes with a dedicated cookbook...which I happen to have created at http://github.com/bixu/paths

For now, I've only made changes to the PATH declaration in the SMF manifest for the chef-client cookbook, but this approach could easily be extended so that all pathing in this and other cookbooks is handled in an attribute-driven way.