Spot the difference
by jcf. Average Reading Time: less than a minute.
Version 1:
su bea -c "cd /opt/local/somewhere && ./runSomeShellScript.sh"
Version 2:
su - bea -c "cd /opt/local/somewhere && ./runSomeShellScript.sh"
It took me about an hour to figure out why my installation package (which used version 1) didn’t work. Stranger because it worked flawlessly from the commandline. All *nix geeks will already have spotted the difference and LTAO my mistake.
For all others: the “-” parameter to su specifies that the user should get his own correct environemnt. Without the “-”, the new shell process will inherit the environment from the calling process (which — as it was in my case — lacked some ENVIRONMENT variables that the script excpected)
I’m one step further in my “unix-do”

Try setuidgid from DJB’s daemontools package.
http://cr.yp.to/daemontools.html
Regards,
/k
Unfortunately, I’m working on Sun Solaris servers – and while I have root rights on this particular machine – installing software on it is not something that the operations people like.
And in addition, this machine is only an integration machine. Deploying software on the production boxes is a total no-no.