zabbix / zabbix-docker

Official Zabbix Dockerfiles
https://www.zabbix.com
GNU Affero General Public License v3.0
2.39k stars 1.38k forks source link

zabbix-web-nginx-mysql:ubuntu images: session_start() permission denied #42

Closed Shawyeok closed 8 years ago

Shawyeok commented 8 years ago

Intermittent error message appear in web interface: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->__construct() → CSession::start() → session_start() in include/classes/core/CSession.php:49]

root@dc3bb0cd8f42:/usr/share/zabbix# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Oct08 ?        00:00:00 /bin/bash /data/run_zabbix_component.sh frontend mysql nginx
root        28     1  0 Oct08 ?        00:00:50 /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
root        31    28  0 Oct08 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon off; -c /etc/nginx/nginx.conf
root        32    28  0 Oct08 ?        00:00:06 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-data    33    31  0 Oct08 ?        00:00:15 nginx: worker process
www-data    34    31  0 Oct08 ?        00:00:15 nginx: worker process
www-data    35    31  0 Oct08 ?        00:00:15 nginx: worker process
www-data    36    31  0 Oct08 ?        00:00:15 nginx: worker process
www-data    37    31  0 Oct08 ?        00:00:17 nginx: worker process
www-data   641    32  0 16:54 ?        00:00:00 php-fpm: pool www
www-data   642    32  0 16:54 ?        00:00:00 php-fpm: pool www
www-data   643    32  0 16:56 ?        00:00:00 php-fpm: pool www
root       644     0  0 16:57 ?        00:00:00 bash
root       659   644  0 16:57 ?        00:00:00 ps -ef
root@dc3bb0cd8f42:/var/lib/php5# sudo -u www-data ls /var/lib/php5
ls: cannot open directory /var/lib/php5: Permission denied
root@dc3bb0cd8f42:/var/lib/php5# ll /var/lib/php5/
total 12
drwx-wx-wt  3 root     root      102 Oct  9 10:44 ./
drwxr-xr-x 25 root     root     4096 Aug  4 06:54 ../
drwxr-xr-x  4 root     root       31 Aug  4 06:54 modules/
-rw-------  1 www-data www-data   51 Oct  9 15:44 sess_xxxxxxxxxxxxxxxxxxxxxxx

So, we should grant read permission to user www-data in Dockerfile.

dotneft commented 8 years ago

fixed