My client's environment mandates strict umask settings:
- 027 for init scripts
- 077 for normal users
This causes problems when using exec resources or any add-on functions
that exec external scripts/programs.
The fix is relatively simple - run umask in /etc/sysconfig/puppet
and set a more lenient umask for puppet.
However, the /etc/sysconfig/puppet is sourced before the init
function library so any umask changes made in the former are
overridden by any in the latter.
Looking in other init scripts (including the puppetmaster init
script), it is usual for the function library to be sourced at the
start of the init script, ie. before the sysconfig override.
This change simply moves the lines that source the init function
library to the start of the init script.
My client is using PE 3.0.1 but the same problem also exists in the OS product.