We are doing some testing and need to run a java program as a user other than root. This is on a CentOS 6.5 box. with java 8. The script calls and executes the java program. I did the following on that script without any luck.
chown user:user script
chmod 06755 script
This still runs the process as root. The following is the part of the script that calls the java program and generate the process. What would be the best way to get this to run as the user instead of root.
#SHOWCLASSES="-verbose:class"
SHOWCLASSES=
exec /opt/jdk32/bin/java $SHOWCLASSES -Xms80M -Xmx120M com.integra.linkage.ProgramDirector "$@"
When I try and run the script with this modification i get this following error
su -c "exec /opt/jdk32/bin/java $SHOWCLASSES -Xms80M -Xmx120M com.integra.linkage.ProgramDirector "$@"" -s /bin/sh esadmin
ProgramDirector: No operational mode chosen.
Usage: ProgramDirector [-wsdl programname ...]
-wsdl - Generate a WSDL file
programname - The name of one or more program classes
-mcs - Connect to MCS and wait for messages.