-
1. Re: java.io.IOException: Cannot run program error=13
sfcoy Sep 12, 2012 10:02 PM (in response to rangaraju)Where did you find your jboss-as-domain.sh script and what does it contain?
It looks like the issue is that the jboss user is attempting to access the user's home directory...
-
2. Re: java.io.IOException: Cannot run program error=13
neoyang Sep 13, 2012 2:44 AM (in response to sfcoy)hi Stephen, the jboss-as-domain.sh is modified base on jboss-as-standalone.sh for domain. Below is the cmd in the script.
JBOSS_CONFIG=domain.xml
JBOSS_SCRIPT=$JBOSS_HOME/bin/domain.sh
LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE $JBOSS_SCRIPT -c $JBOSS_CONFIG 2>&1 > $JBOSS_CONSOLE_LOG &
-
3. Re: java.io.IOException: Cannot run program error=13
sfcoy Sep 13, 2012 3:14 AM (in response to neoyang)You might try:
{code}sudo -H -u jboss ...{code}
If your sudoers file is set up correctly this will change the HOME environment variable to that of the jboss user.
-
4. Re: java.io.IOException: Cannot run program error=13
rangaraju Sep 13, 2012 1:17 PM (in response to sfcoy)Still getting the same error even with sudo -H -u jboss .
-
5. Re: java.io.IOException: Cannot run program error=13
wdfink Sep 13, 2012 3:48 PM (in response to rangaraju)I'm a bit confused about
the jboss-as-domain.sh is modified base on jboss-as-standalone.sh for domain. Below is the cmd in the script.
In the script there is a handling for JBOSS_USER, what if you set this variable and start the script as root?
-
6. Re: java.io.IOException: Cannot run program error=13
rangaraju Sep 13, 2012 4:33 PM (in response to wdfink)That setting is already there.
The probelm happened because of the below :
-------------------------
When a user performs a command with sudo, certain information is entered in to the “run as” user’s environment as environment variables. The variables are SUDO_USER, SUDO_UID, SUDO_GID, and SUDO_COMMAND. This does not happen when you take the extra step of sudo su - <user>, and then issue the same commands from within that shell that would otherwise be run directly through sudo.
What it looks like might be happening is that the SUDO_USER environment variable is being referenced to determine who is originating the command, and the java process tries to set its working directory to the originating user’s home directory. I really don’t see any other way for that information to be getting through to the java process when it is started directly from the user via sudo vs. not when using sudo su – jboss and then launching the command.
-------------------------
So to address the above issue, what I had to do was, I created a wrapper shell script that would be invoked as follows:
sudo –u jboss /app_mgmt/redhat/buildScripts/scripts/recycle-jboss-as-7-domain.ksh stop
sudo –u jboss /app_mgmt/redhat/buildScripts/scripts/recycle-jboss-as-7-domain.ksh start
Inside the script I am performing the two steps:
cd /opt/jboss/jboss-as-7.1.1.Final/bin/init.d
./jboss-as-domain.sh ${ARG_PASSED}
Now the user is able to start and stop the jboss process without having full sudo to jboss userid but with access to the above commands as himself.
Thank you all for your help. the issue is now resolved.