Permission denied when writing logs

apvargas

New Member
Oct 24, 2019
15
3
3
53
Hello, I currently have the PMG v 6.1 in production environment, I am throwing the following error when starting the services with the following command:

#systemctl restart pmgproxy

The error is as follows:

# unable to open log file '/var/log/pmgproxy/pmgproxy.log' - Permission denied

The current permissions of the file are:

-rw-r ----- 1 www-data www-data 157M Feb 28 13:17 pmgproxy.log

Grateful for the support
 
What's the permissions of:
/var
/var/log
/var/log/pmgproxy
?
 
Hi, the permissions of the directories are as follows:

drwxr-xr-x 11 root root 4.0K Feb 19 2019 var

drwxr-xr-x 13 root root 4.0K Mar 2 00:00 log

-rw-r--r-- 1 www-data www-data 157M Feb 28 13:17 pmgproxy.log


Best Regards
Ángel
 
and the permission of the directory /var/log/pmgproxy?
(`ls -la /var/log/pmgproxy` - the complete output)
 
Hi, Hi, the result of the command:
root@mail-gateway:/var/log# ls -la /var/log/pmgproxy
total 160180
drw-r----- 2 root adm 4096 Nov 8 13:27 .
drwxr-xr-x 13 root root 4096 Mar 2 00:00 ..
-rw-r--r-- 1 www-data www-data 164011405 Feb 28 13:17 pmgproxy.log


Best regards
 
drw-r----- 2 root adm 4096 Nov 8 13:27 .
That is the issue - the directory should belong to 'www-data:www-data' and have permission of 755:
run:
Code:
chown www-data:www-data /var/log/pmgproxy
chmod 755 /var/log/pmgproxy

and try starting pmgproxy again
 
  • Like
Reactions: PeteMox
Glad that solved it - please mark the thread as 'SOLVED' - this helps others in a similar situation
 
That is the issue - the directory should belong to 'www-data:www-data' and have permission of 755:
run:
Code:
chown www-data:www-data /var/log/pmgproxy
chmod 755 /var/log/pmgproxy

and try starting pmgproxy again
Thank you! I did have to set ownership and 755 to /var/log/pveproxy/access.log specifically before the proxy service status would stop throwing access denied errors.

Have a great day :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!