Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

[emerg] open() "/var/run/nginx.pid" failed (13: Permission denied) #40

Closed
hardware opened this issue Sep 24, 2016 · 2 comments
Closed

Comments

@hardware
Copy link
Collaborator

hardware commented Sep 24, 2016

I got this error with the last build from dockerhub https://hub.docker.com/r/wonderfall/nginx/ :

docker logs -f nginx

chown: /var/run/nginx.pid: No such file or directory
nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)

Any idea ? Maybe related to this issue : #37

docker version

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:02:53 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:02:53 2016
 OS/Arch:      linux/amd64
docker info

Containers: 10
 Running: 10
 Paused: 0
 Stopped: 0
Images: 47
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 120
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host overlay bridge
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options:
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 983.1 MiB
ID: BGXB:SLYS:W24R:XGXO:H4G6:RBTN:LRDL:YDRF:PWLM:R3FA:T7JY:O7EG
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No kernel memory limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
Insecure Registries:
 127.0.0.0/8

EDIT:

I added touch /var/run/nginx.pid before chown command in run.sh and then rebuild image, now it works.

@iRave
Copy link

iRave commented Sep 25, 2016

I'm still getting the following alert in '/log/error.log':
[alert] 8#8: unlink() "/var/run/nginx.pid" failed (13: Permission denied)

Based on: http://serverfault.com/questions/487415/nginx-permission-denied-upstream-error-even-after-777, I changed '/var/run/nginx.pid' to '/var/run' in run.sh which seems to fix it for now.

@Wonderfall
Copy link
Owner

Someone reported me that even after changing '/var/run/nginx.pid' to '/var/run' like you did, the problem persisted. So we just moved the pid file to /tmp, it seems to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants