1

I'm trying to install Glassfish 3.1.1 on Centos 6.2 Linux server with Apache HTTP front end. I created a new group called glassfish using:

# groupadd glassfish

and added a new user glassfish using:

# useradd -s /bin/bash -g glassfish glassfish
# passwd glassfish 

Following the Glassfish install instructions, I'm getting the following error launching the self-extraction file:

glassfish@host3 [~/software]# sh ./glassfish-3.1.1-unix.sh 
Extracting the installer archive...
Extracting the installer runtime...
Extracting the installer resources...
Extracting the installer metadata...

Welcome to GlassFish V3 installer

Using the user defined JAVA_HOME : /usr/java/jdk1.6.0_30
Entering setup...
product-installer.sh: line 178: /tmp/install.020512204334/install/bin/engine-wrapper: Permission denied

The tmp/ directory has:

4 drwxrwxrwx  12 root root  4096 Feb  5 20:39 tmp/

Anyone know how to resolve this error?

UPDATE 1

I entered the following command as root user, but nothing changed when installing as glassfish user:

 # mount -o remount,exec /tmp /var/tmp

UPDATE 2

I entered some set -x and set +x commands into the glassfish-3.1.1-unix.sh file for debugging purposes, and the first problem seen executing this file is as follows:

+ echo 'Extracting the installer runtime...'
Extracting the installer runtime...
+ /home/glassfish/java/jdk1.6.0_30/bin/jar xf ./Product/Packages/Engine.zip
java.io.FileNotFoundException: ./Product/Packages/Engine.zip (No such file or directory)

However, if I take the same glassfish-3.1.1-unix.sh file and unzip it in a dummy directory, I DO see that /Product/Packages/Engine.zip is there. So the file is not corrupted.

Also, I tried the entire install process over again but using root user instead of glassfish user, and the same exact error occurs.

What else could cause this error? I'm using CentOS 6.2.

ggkmath
  • 4,188
  • 23
  • 72
  • 129

3 Answers3

4

/tmp is mounted noexec. Remount it exec.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • [First Google hit for "remount noexec"](http://wiki.mediatemple.net/w/%28dv%29:Noexec_and_/tmp_troubleshooting) – Ignacio Vazquez-Abrams Feb 06 '12 at 05:12
  • Here's what I found: # mount -o remount,exec /tmp (Will give it a try) – ggkmath Feb 06 '12 at 05:14
  • OK, I executed the about mount command as root (it seemed to execute fine, meaning it didn't return any errors), then tried to install as user glassfish, and no change (same error reported). – ggkmath Feb 06 '12 at 05:21
  • The user glassfish seems to have no problem creating directories on the /tmp drive. Could it be related to the engine-wrapper (perhaps being in some other directory outside /tmp)? I have no idea what it's trying to do here. Regarding `/tmp/install.020512204334/install/bin/engine-wrapper`, the `/tmp/install.020512204334` directory exists, but the `install` directory doesn't. – ggkmath Feb 06 '12 at 06:03
0

Well, maybe you need enough privileges...

Execute with "root's privileges"

$ su -

or

Add "glassfish" user like a sudoer

How add a sudoer

Community
  • 1
  • 1
Tineo
  • 519
  • 1
  • 4
  • 19
  • It's an installer extracting files to `/tmp`, presumably as the current user. It should have plenty of permissions, unless the VFS/kernel gets in the way. – Ignacio Vazquez-Abrams Feb 06 '12 at 05:19
  • I'm reluctant to increase glassfish user's permissions to root level because I worry if the software installs with such permissions then I restore the proper (non-root) glassfish user permissions after the install completes, then the glassfish user will have problems using the installation (since it was setup with higher permissions). And, I don't want to always have glassfish user operate with root permissions forever after just to be able to use it. – ggkmath Feb 06 '12 at 06:00
  • GlassFish Server does not require root privileges to run unless you want to listen on a privileged port, so there must be some other security configuration blocking the install. – John Clingan Feb 06 '12 at 19:10
0

I eventually solved this with the help of GlassFish support forum. See here:

http://www.java.net/forum/topic/glassfish/glassfish/what-directories-does-glassfish-311-self-extracting-installer-touch-outside-directory-it-runs#comment-821920

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
ggkmath
  • 4,188
  • 23
  • 72
  • 129