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

Details

Using coturn 4.5.1.1-7. 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:  4.5.1.1-8
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/turnserver.pid 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-4.5.1.1-8
Comment by Randy Heydon (Tempel) - Monday, 30 March 2020, 11:12 GMT
4.5.1.1-8 looks to be fixed. Thanks!

Loading...