Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#65942 - [coturn] "Cannot open log file for writing"

Attached to Project: Community Packages
Opened by Randy Heydon (Tempel) - Monday, 23 March 2020, 00:36 GMT
Last edited by freswa (frederik) - Monday, 30 March 2020, 13:58 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Using coturn On starting turnserver.service, an error is reported in the status output and no log files are created. I expect this is because turnserver.service runs as user turnserver, but /var/log/turnserver is owned by root with permissions as 755.

# systemctl enable turnserver
# systemctl status turnserver
● turnserver.service - STUN and TURN relay server for VoIP and WebRTC
Loaded: loaded (/usr/lib/systemd/system/turnserver.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-03-19 19:35:37 EDT; 2 days ago
Main PID: 39554 (turnserver)
Tasks: 9 (limit: 19109)
Memory: 9.5M
CGroup: /system.slice/turnserver.service
└─39554 /usr/bin/turnserver -c /etc/turnserver/turnserver.conf -o -v

... systemd[1]: Starting STUN and TURN relay server for VoIP and WebRTC...
... turnserver[39552]: ERROR: Cannot open log file for writing: /var/log/turnserver/turn_2020-03-19.log
... systemd[1]: Started STUN and TURN relay server for VoIP and WebRTC.
# ls -a /var/log/turnserver/
. ..
This task depends upon

Closed by  freswa (frederik)
Monday, 30 March 2020, 13:58 GMT
Reason for closing:  Fixed
Additional comments about closing:
Comment by loqs (loqs) - Monday, 23 March 2020, 21:29 GMT
@Tempel please try building the package with the changes from the attached diff
The changes have systemd create /var/log/turnserver when the service starts with permissions 0700.
Likewise /run/turnserver. (with default permissions 0755)
Change the pidfile to use /run/turnserver/ without needing the symlink from /var/run to /run.
Applies the fix from  FS#65646 
Comment by Randy Heydon (Tempel) - Monday, 23 March 2020, 23:23 GMT
That patch fixes this issue, but I'll note it causes a minor annoyance: on re-installing the package, this warning appears:

warning: directory permissions differ on /etc/turnserver/
filesystem: 700 package: 755

It looks like /etc/turnserver is stored as 755 in the package, but changed to 700 at the end of installation by turnserver.tmpfiles.d, so pacman gives a warning when the install is repeated.
Comment by loqs (loqs) - Tuesday, 24 March 2020, 00:11 GMT
Now the directory should be packaged with 700 permissions.
Comment by Sergej Pupykin (sergej) - Sunday, 29 March 2020, 20:54 GMT
please try coturn-
Comment by Randy Heydon (Tempel) - Monday, 30 March 2020, 11:12 GMT looks to be fixed. Thanks!