(imported topic written by gearoid)
It’s useful to know how the environment is set up when you’re using fixlets and tasks that execute shell scripts or shell commands.
In particular, the environment is probably not going to be the same as when you log in as a user, such as root.
The BESClient process envrionment is inherited by the process that’s running your shell command/script. This is a pretty small set of environment variables.
I use the following action script in a task to get the environment and compare it with the environment of the root. They are quite different and may explain why a script that runs perfectly when you’re logged in as root doesn’t when you run it from a task.
// get the BESClient’s env
wait bash -c “env > /tmp/besenv”