hi, ZM stops about once a day (tipically at night) and I'm not able to understand why.
How can I get autorestart?
thanks
autorestart
- knight-of-ni
- Posts: 2404
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: autorestart
You didn't tell us what distro you are running, but it's probably safe to assume your distro is using systemd.
1) Make a copy of your zoneminder.service file and place it into /etc/systemd/system.
This file is typically under /lib/systemd/system for debian & ubuntu and /usr/lib/systemd/system for redhat.
It is important you don't modify the original service file as that will get overwritten during an upgrade.
2) Add the line "restart=always" under the [service] block.
3) Issue a "sudo systemctl daemon-reload && sudo systemctl restart zoneminder" and you are done.
1) Make a copy of your zoneminder.service file and place it into /etc/systemd/system.
This file is typically under /lib/systemd/system for debian & ubuntu and /usr/lib/systemd/system for redhat.
It is important you don't modify the original service file as that will get overwritten during an upgrade.
2) Add the line "restart=always" under the [service] block.
3) Issue a "sudo systemctl daemon-reload && sudo systemctl restart zoneminder" and you are done.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: autorestart
thanks very much.
My distro is ubuntu 16.04 server.
I suggest to insert this in the wiki.
thanks again
My distro is ubuntu 16.04 server.
I suggest to insert this in the wiki.
thanks again
- knight-of-ni
- Posts: 2404
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: autorestart
I personally wouldn't add it to the wiki because it doesn't address the real problem of why the service is stopped in the first place.
However, our wiki is community based. Anyone can add content to it, and you are welcome to add this yourself. I certainly won't object.
However, our wiki is community based. Anyone can add content to it, and you are welcome to add this yourself. I certainly won't object.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: autorestart
mysql gets restarted for log rotation. This kills zoneminder.
edit
/etc/systemd/system/multi-user.target.wants/zoneminder.service
And change the line with Restart=something
to Restart=always
edit
/etc/systemd/system/multi-user.target.wants/zoneminder.service
And change the line with Restart=something
to Restart=always
- knight-of-ni
- Posts: 2404
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: autorestart
Mysql doesn't restart on logrotate on any of the machines I'm running. Just to be sure, I did just check three of them. In addition, If I manually restart mysql, systemd automatically restarts zoneminder as well. ZoneMinder is not left in a stopped state, and I don't have restart=always in my zoneminder service file. It would be interesting to know exactly what cases you've seen this occurring so we can narrow it down to a specific set of conditions that might cause this problem.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: autorestart
Zoneminder stopping without obvious reason happens here too, and has been happening since I started using Zoneminder (1.28 then 1.30 now) I used to make a cronjob that checked if the ZM was runninng and restarting it if not. Happens once per day, time of day isn't same. I'm using Ubuntu Server 16.04.4 LTS 4.4.0-116.
Thank you knnnigget for the systemd guide.
Thank you knnnigget for the systemd guide.
Last edited by Viher on Thu Mar 15, 2018 9:02 am, edited 1 time in total.
- knight-of-ni
- Posts: 2404
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: autorestart
The next time it happens, check your mysql/mariadb logs during the same timeframe to see if your database restarted.
I don't doubt iconnor has seen this happen, but I'm not able to duplicate it. It would be extremely helpful if we could narrow down under what conditions this occurs.
I don't doubt iconnor has seen this happen, but I'm not able to duplicate it. It would be extremely helpful if we could narrow down under what conditions this occurs.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: autorestart
I think something went wrong with log. Zoneminder never stopped but today mysql and ubuntu was not able to work because no space on HD. I found 99% of used space. After analysing all big files I found in /var/log/zm a lot of "zm_debug_log.****" file for about 220 GB.