Siewert308SW wrote: Saturday 27 January 2018 13:57
First of all a reboot like you do/want aint good.
"sudo reboot" doesn't take care of Domoticz which needs a proper shutdown.
Meaning, you will hit a time that your database gets corrupt.
It will happen for sure that a read/write to the database is interrupted.
There are many ways like for example a simple bash called from cron.
And then stop domoticz service and afterwards then conduct a reboot.
should do it as that is the url that the www gui calls.
So, what's the difference between a sudo reboot (or shutdown) or by example a reboot with an ssh session (or reboot in the GUI of the Raspberry) for Domotics?
Is it always so that a reboot or shutdown into the Raspberry not safely closes the Domotics database?
Thanks in advance for the explanation.
Last edited by McJohn on Sunday 16 June 2019 11:57, edited 1 time in total.
Normally Domoticz is started as a service under control of systemd.
When you issue a command like "sudo reboot" then system will close all open files and reboot.
It does a kind of "sudo systemctl stop <service>" for all services, which issues a TERM signal to the running services.
So no harm will be done, I did it thousands of times.
Thank you very much for the quick response and the tranquillized words!
Then this post don't give the right information:
Siewert308SW wrote: ↑Saturday 27 January 2018 14:57
First of all a reboot like you do/want aint good.
"sudo reboot" doesn't take care of Domoticz which needs a proper shutdown.
OK, what I understood is that systemd "kills" all the running services at a reboot or shutdown?
Isn't it be a nicer way to place a file into the directory /lib/systemd/system-shutdown with a script with the command:
'sudo service domoticz.sh stop" ?
No, you cannot just put a script in /lib/systemd/system-shutdown.
Systemd is the proper way to control boot, reboot and shutdown if it is installed.
Services are getting a proper SIGTERM signal instead of the SIGKILL signal and are allowed to close files in the right way.
It's close to what the old "sudo service domoticz.sh stop" would do.
B.t.w. the old "sudo service" is transfered to "sudo systemctl", which is used to control systemd services.
Thanks for the clear explanation. Case closed and everything is working well.
(For a Raspberry without a screen, we put a bash script with espeak command, into the /lib/systemd/system-shutdown directory
it says "Shutdown the system" trough the speaker, so, we know the Raspberry is on halt )