0

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.

2
  • 2
    Post the specific errors. Jan 25, 2012 at 22:35
  • Any chance NFS is involved in this? root usually has no permissions on NFS filesystems. Jan 25, 2012 at 22:41

1 Answer 1

0

It is difficult to be sure without seeing the specific errors or the source of the script involved, but especially with the "file not found" issue, it sounds like an environment issue to me.

Have you tried running the script as another user without using sudo? You may have something extra in your $PATH, etc. that is necessary, but that isn't currently set for other users.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .