ZM 1.34 on Buster Two Installs Same Problem

Forum for questions and support relating to the 1.34.x releases only.
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

Hello All,
So I am quite new to all of this, but I feel I've done pretty well getting two installations complete and running. However, after just a day each has crashed. The first was basically totally frozen. I noticed the screen in firefox which should have been the montage just said ZM db connection refused. I couldn't get anything in Debian to respond to a click. After pulling the power cord and rebooting I notice a ton of I/O errors during post. It never started back up. So a new fresh install on another brand new hard drive ran for less than 24 hours before giving me the same connection refused message. This install did allow me to reboot and there were no errors during post. The system is incredibly slow and I have a ZM DB Connection refused message again.

I have all cameras and the deb zm machine connected to a belkin router with no connection to the internet.

The computer is a Dell. It's about 5 years old, but is totally brand new. Wondering if this is a debian issue, a zoneminder issue... or what's going on.

I started out a few years back writing a system with I guess similar to zm functionality. Took a long long time and never finished. I have found ZM and absolutely love everything about it.

I have one more computer to try and am out of new hard drives. Any help is greatly appreciated.

Thank You,
John
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by snake »

DB connection refused usually means Mysql is not running (or bad password).

Code: Select all

service mysql start
Please post some logs.
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

Ok. So. My user is no longer a sudoer and I can not log in as root. I try running service mysql start without sudo and I get command not found. Not sure why I'm not in the sudoer list as I was before which is how I did the install. Also not sure if it makes any difference, but the tutorial I followed here on zm and on digital ocean had me install mariadb.

The password is super hard to mess up so I am 100% confident that's not the issue.

I don't know where the logs are or which logs you might need.

Thank You,
John
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by snake »

Start with syslog and dmesg. Please post logs in code tags.
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

So I was able to get the system to boot but was running very slow and not incredibly responsive. I found logs in var, couldn't copy them because not a super user. So I created a new admin user which is able to copy log files. Insert jump drive and copy a couple files. Looking for other logs to copy over and all windows closed on their own. I'm installing ubuntu on another hdd and then zm. gonna give that a shot.

John
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

Got ubuntu installed. Got lamp and zm installed ... mostly. gave a program error detected message at the end. i clicked send report and it said it couldn't send a report. I visited ip/zm and get connection error. going to bed now.

Best,
John
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

Ok. Quick recap and update. So lastnight I followed install instructions from these sources
https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.34.x
https://computingforgeeks.com/how-to-in ... on-ubuntu/
https://computingforgeeks.com/install-m ... cal-fossa/

Nowhere in this did we create a database named zm, no user zmuser and no privileges. So I have done all of this now and zm is up and running.

Can someone please provide I'll just call it a cheat sheet..? What all do I really need to know here? How do I know that each component/service is running and healthy? How do I stop/start/restart all parts?? Zoneminder, Apache, Mysql etc... to keep this working.

Thank You,
John
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

So far so good. One small issue. When i install something like nmap for example at the end i get "Errors were encountered while processing: zoneminder". Of course zm isn't showing any camera feed. So i sudo service zoneminder start. And it's working again. Why is installing nmap bothering with zoneminder? How can i make that not happen?

Thank You,
John
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by bbunge »

SammyD23 wrote: Thu Apr 30, 2020 3:59 pm Ok. Quick recap and update. So lastnight I followed install instructions from these sources
https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.34.x
https://computingforgeeks.com/how-to-in ... on-ubuntu/
https://computingforgeeks.com/install-m ... cal-fossa/

Nowhere in this did we create a database named zm, no user zmuser and no privileges. So I have done all of this now and zm is up and running.

Can someone please provide I'll just call it a cheat sheet..? What all do I really need to know here? How do I know that each component/service is running and healthy? How do I stop/start/restart all parts?? Zoneminder, Apache, Mysql etc... to keep this working.

Thank You,
John
May I recommend you start afresh with a new Ubuntu install. Use the Ubuntu Minimal install .iso.
See: https://help.ubuntu.com/community/Insta ... /MinimalCD
You may as well use Ubuntu 20.04. You can get the download link here: http://cdimages.ubuntu.com/netboot/
Burn the .iso to a CD or thumb drive.
I would recommend you set your computer bios to use a legacy boot. While UEFI is more secure, get some practice installing and running Linux before moving on to more complicated things.
Boot into the CD or thumb drive. You will be asked to input a username and password, chose the entire disk to be formatted, do not take automatic updates. When you get to Tasksel install only the OpenSSH server (near the bottom of the list).
When you boot into Ubuntu, log in then do
sudo su
enter your password and you are now logged in as a super user.
Install net-tools
apt install net-tools
When that is installed find your IP address
ifconfig
Now, from another PC (I use Windows) log into the Ubuntu box. I use Putty but there are other ways.
Become root again with sudo su
See the instructions at: https://wiki.zoneminder.com/Ubuntu_Serv ... ell_script
Install the LAMP components
apt install apache2 php mariadb-server php-mysql libapache2-mod-php
Secure Mariadb
mysql_secure_installation
Then follow the instructions for the install script for Zoneminder. You can copy the script from the WIKI web page and paste it into Nano via Putty. Set the file permissions and run the script.
As an alternate you can enter the individual commands one at a time and run them.
This is what you have to enter to get Zoneminder working at a minimum:

apt install apache2 php mariadb-server php-mysql libapache2-mod-php
mysql_secure_installation
apt install software-properties-common
add-apt-repository ppa:iconnor/zoneminder-1.34
apt install zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

So over the past about two weeks I have found zoneminder not running for one reason or another about three different times. I've been able to resolve the issue with a quick google search. This last time though... not so much. Landed on a hardware issue, but i don't think that's really what it was. Anyways, today I followed exactly bbunge's instructions above on a brand new hard drive. So far so good.

So I am running ZM 1.34 on Ubuntu 20.04. This is on a never used Dell inspiron 620 with A00 bios, i5-2310 CPU 2.9GHz x 4, 4TB HDD, 64-bit.

System is 100% offline with dedicated Asus AC1200 router. All cameras are wireless and computer is wired to router.

I have 4 Uniden IP cams, 2 SriCam (older black models) and 4 SriHome SH024. I will likely add a few more SH024 soon.

If you can please point me to a concise list of instructions for proper maintenance of zoneminder and apache. I realize this request may seem ridiculous but i'm not a skilled linux user so i don't know how to do these things. I absolutely love the smoothness of ubuntu and just can't say enough about zoneminder. I really want to keep it running well. I do have clonezilla on jump drive and i'll be grabbing another new hdd soon so I can back this thing up.

Your advice is greatly appreciated. Thanks for reading...

Best,
John
kevins
Posts: 7
Joined: Sun Aug 06, 2017 8:24 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by kevins »

Can you tell what the system load average is and how many cores you have?

What setting have you got in the camera settings in the storage tab for video writer?

may be worth installing glances and post a screenshot of that and may give an idea as what issues you are facing.

I usually use mysqltuner and see what recommendations it makes, but usually this is more important as time goes on and the database starts to grow, I wouldnt think you could see issues with a system only running for a day or two.

May be worth looking up zoneminder swappiness
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

I believe it's a 4 core processor. I'm not sure about the load average just yet. Since the rebuild I have only one camera set to capture. The rest are just monitors at this time. I wanted to see if I could go a week without a crash before enabling capture on all channels. The Storage setting are totally default right now as it was before the crash. So i'll be looking into the best settings for my system.
kevins
Posts: 7
Joined: Sun Aug 06, 2017 8:24 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by kevins »

monitor the system load with glances or top. top comes with ubuntu, glances you would need to install. With a 4 core a load of 4.0 means 100%. If it is contantly above 4.0 then the system is overloaded. If it is low then that is a good sign.

Check your settings for the video writer in the settings for the camera in zoneminder. If is set to disabled, you are decoding the stream to jpegs and storing them. Try h264 passthrough. If you camera is putting out a h264 stream it is much more efficient to store directly as a mp4 video.

Are you using a usb hard drive or interal hard drive for zoneminder storage?

This is what you will see with glances. See if anything stands out as being high such as iowait
glances.png
glances.png (140.22 KiB) Viewed 3076 times
Last edited by kevins on Mon May 18, 2020 7:45 pm, edited 1 time in total.
kevins
Posts: 7
Joined: Sun Aug 06, 2017 8:24 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by kevins »

Also how much ram is in the system? maybe worth changing the swappiness viewtopic.php?t=24909
SammyD23
Posts: 9
Joined: Wed Apr 29, 2020 6:22 pm

Re: ZM 1.34 on Buster Two Installs Same Problem

Post by SammyD23 »

Hey Thanks for that! My HDD is internal. Picked up a 4TB 5900RPM SATA Surveillance Hard Drive for $65. Definitely not fast and makes a bunch of noise, but so far no issues. My RAM is 8G. The load shown in zoneminder is 1.6. I don't see a load using 'top', but the cpu is mostly around 8% with spikes of 16 to 20%. I realize those are different processes running. The memory is around 2.5%. I just made the temporary change to swappiness. We'll see how it goes before making it permanent. Also, I found this (https://zoneminder.blogspot.com/p/blog-page_19.html). Should I do these things? Sounds like I should.

Thanks again,
John
Post Reply