I have a script that I need to run. It is kicking off a java program. When I run it as me, it seems to work fine. If I type "
sudo myscript.sh" it does not run fine. In reality, I need to run it as "
sudo -su otherguy myscript.sh"
So neither of the sudo versions work. I get errors from the java program that make me think there are permission problems - file not found, could not write, etc etc. So what can I do to figure out why it is losing permissions? The funny thing is, I made the entire directory structure wide open with
chmod -fR 777 * to try to figure out if it would run at those otehr users, and I still get the same error.