Linux 在 CentOS 上安装 glassfish 的 /tmp 文件夹的权限被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9155762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 04:24:30  来源:igfitidea点击:

permission denied on /tmp folder installing glassfish on CentOS

linuxglassfish

提问by ggkmath

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 glassfishusing:

我正在尝试使用 Apache HTTP 前端在 Centos 6.2 Linux 服务器上安装 Glassfish 3.1.1。我创建了一个名为glassfish使用的新组:

# groupadd glassfish

and added a new user glassfishusing:

glassfish使用以下方法添加了一个新用户:

# 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 安装说明,我在启动自解压文件时遇到以下错误:

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:

tmp/ 目录有:

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

Anyone know how to resolve this error?

有谁知道如何解决这个错误?

UPDATE 1

更新 1

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

我以 root 用户身份输入了以下命令,但在以 glassfish 用户身份安装时没有任何变化:

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

UPDATE 2

更新 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:

我在 glassfish-3.1.1-unix.sh 文件中输入了一些 set -x 和 set +x 命令用于调试,执行该文件时看到的第一个问题如下:

+ 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.

但是,如果我使用相同的 glassfish-3.1.1-unix.sh 文件并将其解压缩到一个虚拟目录中,我确实会看到 /Product/Packages/Engine.zip 在那里。所以文件没有损坏。

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

此外,我再次尝试了整个安装过程,但使用 root 用户而不是 glassfish 用户,并且发生了完全相同的错误。

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

还有什么可能导致此错误?我正在使用 CentOS 6.2。

回答by Ignacio Vazquez-Abrams

/tmpis mounted noexec. Remount it exec.

/tmp已安装noexec。重新安装它exec

回答by Tineo

Well, maybe you need enough privileges...

好吧,也许您需要足够的权限...

Execute with "root's privileges"

以“root 权限”执行

$ su -

or

或者

Add "glassfish" user like a sudoer

像sudoer一样添加“glassfish”用户

How add a sudoer

如何添加sudoer