log file and pid file cannot be written to

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
Doler
Posts: 195
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

log file and pid file cannot be written to

Post 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.
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Trixie - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

Re: log file and pid file cannot be written to

Post 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
meal
Doler
Posts: 195
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: log file and pid file cannot be written to

Post by Doler »

I know the 'trick' with changing rights but using logrotate the rights will be reset to root after a rotate.
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Trixie - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
Doler
Posts: 195
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: log file and pid file cannot be written to

Post 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.
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Trixie - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
Doler
Posts: 195
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: log file and pid file cannot be written to

Post 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.
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Trixie - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
Post Reply