What could be the reason for the following erorrs. I ran the script as a root user. I believe the root user must be having super user permissions. It was failing with the following error
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
(base) [root#localhost ~]# cat /tmp/hadoop-service-startup.log
STARTING NAMENODE
WARNING: HADOOP_NAMENODE_OPTS has been replaced by HDFS_NAMENODE_OPTS. Using value of HADOOP_NAMENODE_OPTS.
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTING SECONDARY NAMENODE
WARNING: HADOOP_SECONDARYNAMENODE_OPTS has been replaced by HDFS_SECONDARYNAMENODE_OPTS. Using value of HADOOP_SECONDARYNAMENODE_OPTS.
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTING DATANODE
WARNING: HADOOP_DATANODE_OPTS has been replaced by HDFS_DATANODE_OPTS. Using value of HADOOP_DATANODE_OPTS.
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTED DAEMONS
4884 Jps
STARTING RESOURCEMANGER
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTING NODEMANGER
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTING HISTORYSERVER
WARNING: /var/log/hadoop does not exist. Creating.
mkdir: cannot create directory ‘/var/log/hadoop’: Permission denied
ERROR: Unable to create /var/log/hadoop. Aborting.
COMPLETE
STARTED DAEMONS
5012 Jps
You may be having a permissions issue. Try changing the permissions doing the following
sudo chown -R hadoop /var/log/hadoop/
If thy doesn’t work, you could try to work around it by changing the location of the Hadoop logs to a different location
Related
I wonder how one investigates the cause of denied access in a case like that:
uid=0(root) gid=0(root) groups=0(root)
root#host:/tmp# chown root .mount_app
chown: cannot access '.mount_app': Permission denied
root#host:/tmp# ls -la .mount_flameshot
ls: cannot access '.mount_app': Permission denied
root#host:/tmp# stat -c "%U" .mount_app
stat: cannot stat '.mount_app': Permission denied
Addiotional Info:
In this specific case the file is somehow related to snap.
Calling a scp-command in symfony ($process->run()), will end up in a errormessage.
The command "scp -r /var/www/html//media/* user#server:/var/www/tmp/" failed.
Exit Code: 1(General error) Working directory: /root
Output: ================ Error
Output: ================ Permission denied, please try again. Permission denied, please try again.
user#server: Permission denied (publickey,password)
as the www-data user is a nologin user without own keys, how can this get be done?
Trying to install JFrog Xray on a CentOS machine, using the Docker installer.
I've created a /opt/xray directory, where I've downloaded the install file into.
Then ran chmod +x xray on this file.
When I try to install using sudo "./xray install", I get the following output:
[root#xray xray]# sudo ./xray install
INFO: Using XRAY_MOUNT_ROOT=/root/.jfrog/xray
Verifying Xray prerequisites ...
WARNING: Running with 3GB Total RAM
WARNING: Running with 1 CPU Cores
The System resources are not aligned with Xray minimal prerequisites, Do you want to proceed with the process? [Y
touch: cannot touch '/data/installer.info': Permission denied
Are you adding this node to an existing cluster? (not relevant for the first cluster node) [Y/n]: n
mkdir: cannot create directory '/xray_global_mount_root/xray': Permission denied
./wrapper.sh: line 583: /xray_global_mount_root/xray/ha/ha-node.properties: No such file or directory
./wrapper.sh: line 586: /data/installer.info: Permission denied
./wrapper.sh: line 589: /data/installer.info: Permission denied
./wrapper.sh: line 592: /data/installer.info: Permission denied
ERROR: Installation failed
Any ideas what may be causing this?
I had a similar issue on RHEL and it was selinux getting in the way. To fix it, change the following line in the xray script: -
XRAY_VOLUMES="-v ${XRAY_MOUNT_ROOT}/xray-installer:/data -v ${XRAY_MOUNT_ROOT}:/xray_global_mount_root"
To this: -
XRAY_VOLUMES="-v ${XRAY_MOUNT_ROOT}/xray-installer:/data:z -v ${XRAY_MOUNT_ROOT}:/xray_global_mount_root:z"
(basically adding :z to each volume).
This makes sure the folder is labelled to be used by multiple containers in selinux.
If I run fuser -n tcp 80 on ubuntu 14.0.4 which is running in a docker image, I get:
Cannot stat file /proc/25/fd/0: Permission denied
Cannot stat file /proc/25/fd/1: Permission denied
Cannot stat file /proc/25/fd/2: Permission denied
Cannot stat file /proc/25/fd/3: Permission denied
Cannot stat file /proc/25/fd/4: Permission denied
Cannot stat file /proc/25/fd/5: Permission denied
etc.
80/tcp: 24
If I run whoami it returns root.
Why can I not run this command?
That should be because of AppArmor.
It is a Linux Security Module implementation of name-based access controls. AppArmor confines individual programs to a set of listed files and posix 1003.1e draft capabilities.
You can see various workarounds in issue 7276 or issue 6800.
docker run -itd --cap-add=SYS_PTRACE --security-opt=apparmor:unconfined mytomcat7image
I get the following error everytime I try to execute
Error:-
/usr/bin/python: can't open file '/local/mnt/workspace/scrit1.py': [Errno 13] Permission denied
Permissions shown below:-
username3#buildserver:/local/mnt/workspace$ getfacl script1.py
getfacl: Removing leading '/' from absolute path names
# file: local/mnt/workspace/script1.py
# owner: username1
# group: users
user::rwx
user:username2:rwx #effective:r--
group::---
mask::r--
other::---
username3#qca-cdit-03:/local/mnt/workspace$ getfacl script2.py
getfacl: Removing leading '/' from absolute path names
# file: local/mnt/workspace/script2.py
# owner: username1
# group: users
user::rwx
group::r--
other::r--
This is pretty trivial case---as the permissions show you don't have the permission to execute that file.
But,there is a workaround to execute that file! You anyhow need to have root/admin privileges to be able to execute that file. You can use sudo command to execute that file with root privilege.
NOTE :- But,to have this command working you must be a sudoer and your username must be present in /etc/sudoer list! If not then you can consult admin to include you in sudoers list.
So,if you are a sudoer,then try doing this :-
$ sudo ./script1.py
It'll ask for your password! Please enter the same.
Enter password :
And,lastly that script will run for sure!