Page 1 of 1

log file and pid file cannot be written to

Posted: Saturday 28 February 2026 20:57
by Doler
Using beta 17290 nor a pid file nor a log file can be written to in 'default' locations. With 'default' I mean /var/run for the pid file and /var/log for the logfile. Defining those paths in ExecStart like:

Code: Select all

ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 443 -pidfile /var/run/domoticz.pid -log /var/log/domoticz.log -loglevel normal,status,error
doesn't work due to insufficient rights. Changing the paths to /home/pi/.. make things work.
Please advice.

Re: log file and pid file cannot be written to

Posted: Tuesday 03 March 2026 6:32
by meal
Hello
in a linux session launch the following command:

sudo chown pi:pi /var/log/domoticz.log

You will be able to record the log in /var/lo/domoticz.log.

Regarding the pid file I had the same issue as you and store the pid file in /home/pi too.

BR

Re: log file and pid file cannot be written to

Posted: Tuesday 03 March 2026 8:33
by Doler
I know the 'trick' with changing rights but using logrotate the rights will be reset to root after a rotate.

Re: log file and pid file cannot be written to

Posted: Tuesday 03 March 2026 15:58
by Doler
A solution could be to run Domoticz as root (comment out User=pi and Group=pi in the domoticz.service file). I don't know if this is a safe solution, please advice.

Re: log file and pid file cannot be written to

Posted: Tuesday 10 March 2026 8:25
by Doler
With beta 17342 Domoticz switched back to SysV init (init.d). So everything is 'normal' again. Run install program after beta update to make the change back from systemd. The domoticz.sh file in /etc/init.d may need some adaptations since it's written back as the default.