MiniDLNA log file permission problem
Hi,
I'm debugging a permission problem with the log files created by minidlna in /var/log/minidlna. I'm trying to use a different username to run minidlna and do not use the default user account minidlna. The problem is that log file /var/log/minidlna/minidlna.log is created with the owner "minidlna" and does not belong to the user that runs minidlna.
I use the following configuration options:
/etc/minidlna.conf
...
user = myuser
...
log_dir=/var/log/minidlna/ # This directory belongs to the user myuser
...
/etc/default/minidlna:
...
USER="myuser"
GROUP="myuser"
...
/usr/lib/systemd/system/minidlna.service
...
[Service]
User=myuser
Group=myuser
....
ExecStart=/usr/sbin/minidlnad -f $CONFIGFILE -P /run/minidlna/minidlna.pid -S $DAEMON_OPTS -u myuser
The systemd module was loaded with systemctl daemon-reload.
When I reboot the system, then the loading of minidlna fails because someone (presumably minidlna) creates the file /var/log/minidlna/minidlna.log with owner "minidlna" and not to the user "myuser". Minidlna therefore fails to load and therefore quits (lsof shows no process using /var/log/minidlna.conf).
When I manually remove this logfile and run "systemctl restart minidlna" a new file /var/log/minidlna.log is created with the owner "myuser" and minidlna is working properly.
So the problem only occurs when the system is rebooted. As systemd seems to work properly when I manually run systemctl start minidlna.service, I'm not sure if minidlna really creates the log file with the wrong username
My questions:
- Is there a way to determine who creates the log file that belongs to the wrong user at boot? (I have no way to trigger this problem other than on boot)
- Is there any configuration option in minidlna that I did not see that I have to change to successfully run minidlna as myuser?
Lothar
Reply to: