I am automating regression testing using Perl sudo with the -H option to go from one account in one group to another account in another group.
The problem is that the .profile is not being executed in the account being sudo'ed to and so the CLASSPATH is not defined. So, when I try to execute a java main class it fails with CLASSNOTFOUND exception because the CLASSPATH is undefined.
A work around is to include SETENV in the sudoers and -E as a sudo option but this solution I do not like because now I have to maintain this really long classpath in both accounts.
Why is the .profile login script not being executed? Is there any way to force execution?
Thanks Perl Monks!