[SOLVED] Fresh install / ZoneMinder won't start

Forum for questions and support relating to the 1.28.x releases only.
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

[SOLVED] Fresh install / ZoneMinder won't start

Post by bmather9 »

I followed the installation directions here: http://www.zoneminder.com/wiki/index.ph ... e_easy_way

Everything seemed to work just fine and I am able to see the zoneminder web interface where I have been attempting to add my Samsung Smartcam with no luck. I can stream from this camera's RTSP stream in VLC media player without problems, but have yet to see an image or video in zoneminder.

I recently noticed at the top of the zoneminder web interface it says 'ZoneMinder Console - Stopped v1.28.1'

I tried to start zoneminder through the web interface and it doesn't work. On the command line, I get 'Starting ZoneMinder: failure'

So how is the web interface working, but zoneminder is not working? What can I do to fix it?
Last edited by bmather9 on Tue Jul 28, 2015 12:11 pm, edited 1 time in total.
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

I'm running Ubuntu 14.04.2 LTS GNU/Linux 3.13.0-57-generic x86_64 if that helps.

It appears my problem is similar to this thread, http://www.zoneminder.com/forums/viewto ... 32&t=23264, but my sleep 15 command is properly placed.

The strange things I've discovered is that when I run:

Code: Select all

sudo service zoneminder start
I get:

Code: Select all

Starting ZoneMinder: failure
But when I run:

Code: Select all

sudo service zoneminder status
I get:

Code: Select all

ZoneMinder is running
At the same time, the status at the top of the web interface says Zoneminder is stopped. So which is correct? Is it failed or is it running or is it stopped?
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

I tried to look for a log file in /var/log/zm but didn't see anything. Is there any other way I can troubleshoot this short of a fresh install of Ubuntu? I really not interested in trying that as it would be a big effort to set everything back up.
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

So using the restart command, it appears ZoneMinder works properly...it stops and then starts via CLI. So although it's status reports 'running', the web interface still shows 'Stopped'. Any ideas?

I tried adding a monitor with the following:

Function>Ffmpeg
Source Path>rtsp://admin:password@192.168.1.105/profile4/media.smp
Remote Method>RTP/RTSP

I'm in medium bandwidth mode and the monitor appears in the list but I don't see how I can view the stream? I can't click on the monitor name 'Monitor-1' as there is no link. The function 'Monitor' is orange and the Source 'media.smp' is red.

Anyone have any inkling of an idea out there, please help!
Southcross
Posts: 43
Joined: Tue Feb 10, 2015 9:17 pm

Re: Fresh install / ZoneMinder won't start

Post by Southcross »

did you install FFMPEG? it doesn't get automagically installed... no idea if that is the problem

edit... also check that MySQL is running

Code: Select all

sudo service mysql status
edit2... oh and the web interface is Apache, that will/should run regardless of the MySQL/Zoneminder statuses
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

I read somewhere ffmpeg has been replaced with avconv? It doesn't seem to be available to install:

Code: Select all

bmather9@bmather9:~$ sudo apt-get install ffmpeg
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ffmpeg is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ffmpeg' has no installation candidate

Code: Select all

bmather9@bmather9:~$ avconv
avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Hyper fast Audio and Video encoder
usage: avconv [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man avconv'
mysql appears to be running

Code: Select all

bmather9@bmather9:~$ sudo service mysql status
mysql start/running, process 20910
as well as apache2

Code: Select all

bmather9@bmather9:~$ sudo service apache2 status
 * apache2 is running
The bottom line that I can't understand, is how the zoneminder web interface works, and the service is running, but the web interface still says 'Stopped'?
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Fresh install / ZoneMinder won't start

Post by SteveGilvarry »

Web interface is just PHP pages in apache so they will work when backend is not running. I would focus on why it won't start, I will have to go back a re-read to see if anything sticks out to me.

Edit: sorry I see it starts but web reports not running so then your links don't work. Let me check what console is looking for. But you should have something in log if it is running.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Fresh install / ZoneMinder won't start

Post by SteveGilvarry »

Do you have any zm, zmc, ma, etc daemons running? I sometimes had more luck running zmc -m1 from cmd line to work out issues on first camera. But you really should get something in logs if it is failing to start.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

SteveGilvarry wrote:Do you have any zm, zmc, ma, etc daemons running? I sometimes had more luck running zmc -m1 from cmd line to work out issues on first camera. But you really should get something in logs if it is failing to start.
No logs exist in the /var/log/zm folder

So I don't really know what I'm doing here, but below are the things I've tried. It appears some of those daemons are not running that should be, but I'm not sure why? Let me know what command to run if the don't tell you what you need to know.

Code: Select all

bmather9@bmather9:/var/log/zm$ sudo service zmc status
zmc: unrecognized service
bmather9@bmather9:/var/log/zm$ sudo service zma status
zma: unrecognized service
bmather9@bmather9:/var/log/zm$ sudo service ma status
ma: unrecognized service
bmather9@bmather9:/var/log/zm$ sudo service zm status
zm: unrecognized service

bmather9@bmather9:/var/log/zm$ ps -A | grep zm
  403 ?        00:01:01 zmdc.pl
  428 ?        00:00:04 zmfilter.pl
  435 ?        00:00:00 zmaudit.pl
  442 ?        00:00:14 zmwatch.pl
31906 ?        00:00:00 zmupdate.pl
However, zmc seems to be there, although I don't think I can test it with my camera this way since it requires me to use ffmpeg

Code: Select all

bmather9@bmather9:/var/log/zm$ zmc
One of device, host/port/path, file or monitor id must be specified
zmc -d <device_path> or -r <proto> -H <host> -P <port> -p <path> or -f <file_path> or -m <monitor_id>
Options:
  -d, --device <device_path>               : For local cameras, device to access. E.g /dev/video0 etc
  -r <proto> -H <host> -P <port> -p <path> : For remote cameras
  -f, --file <file_path>                   : For local images, jpg file to access.
  -m, --monitor <monitor_id>               : For sources associated with a single monitor
  -h, --help                               : This screen
I'll try to play around tomorrow, so any help or direction would be much appreciated. Thanks!
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

Maybe this will provide some insight...it appears that 'zms' is not found? It seems like this needs to run to view a stream. Maybe that's my problem? But how would I fix it? I've already tried unistalling zoneminder and re-installing.

Code: Select all

bmather9@bmather9:~$ zms
No command 'zms' found, did you mean:
 Command 'zmf' from package 'zoneminder' (universe)
 Command 'zfs' from package 'zfs-fuse' (universe)
 Command 'zmc' from package 'zoneminder' (universe)
 Command 'fms' from package 'openafs-client' (universe)
 Command 'zma' from package 'zoneminder' (universe)
 Command 'zmu' from package 'zoneminder' (universe)
 Command 'ams' from package 'ams' (universe)
 Command 'pms' from package 'pms' (universe)
zms: command not found


bmather9@bmather9:~$ nph-zms
nph-zms: command not found
Also 'zmu' give no output when I run it, but this may be correct?

Code: Select all

bmather9@bmather9:~$ zmu
bmather9@bmather9:~$
Lastly 'zm' returns command not found:

Code: Select all

bmather9@bmather9:~$ zm
zm: command not found
It seems like missing zms and zm could be the problem? Any ideas?
mikb
Posts: 604
Joined: Mon Mar 25, 2013 12:34 pm

Re: Fresh install / ZoneMinder won't start

Post by mikb »

"zms" is not in your $PATH, it's not in the path on my system either. Try looking in /var/www/cgi-bin/zms

Code: Select all

root@perkin:~# which zms
which: no zms in (/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin)

root@perkin:~# locate zms 
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zms.cpp
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zmstreamer.o
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zmstreamer
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/.deps/zmstreamer.Po
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/.deps/zms.Po
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zms
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zms.o
/usr/local/src/zoneminder/ZoneMinder-1.25.0/src/zmstreamer.cpp
/usr/local/bin/zmstreamer
/var/www/cgi-bin/zms  <----- *****
/var/www/cgi-bin/nph-zms
Red herring: There is no "zm" , so you won't find one.
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

mikb wrote:"zms" is not in your $PATH, it's not in the path on my system either. Try looking in /var/www/cgi-bin/zms

Red herring: There is no "zm" , so you won't find one.
Found my zms! Mines at /usr/lib/cgi-bin/

Code: Select all

bmather9@bmather9:~$ locate zms
/usr/bin/zmstreamer
/usr/bin/zmsystemctl.pl
/usr/lib/cgi-bin/nph-zms
/usr/lib/cgi-bin/zms

bmather9@bmather9:~$ /usr/lib/cgi-bin/zms
Server: ZoneMinder Video Server/1.28.1
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Fri, 24 Jul 2015 21:55:44 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache
So now what should I do? How can I tell if it's running properly?

I tried to attach a screenshot of my zoneminder web interface, but it says the board attachment quota has been reached? Other than still saying 'stopped' (even after I try to start it) I noticed it also says 'Load: / Disk: -1%'. Any problem there? I believe there is still plenty of space on all drives in my system.

Code: Select all

bmather9@bmather9:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        66G   11G   52G  17% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            3.9G  4.0K  3.9G   1% /dev
tmpfs           787M  3.9M  783M   1% /run
none            5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G   33M  3.9G   1% /run/shm
none            100M     0  100M   0% /run/user
/rpool/files    5.3T  1.7T  3.7T  32% /rpool/home/jlmather/sharedfiles
/dev/sda1        95M  120K   95M   1% /boot/efi
/dev/sde1       459G  133G  303G  31% /mnt/externalbackup
I also noticed that the zms output says it is past the expiration date from 1997 (whatever that means):

Code: Select all

Expires: Mon, 26 Jul 1997 05:00:00 GMT
Thanks for the help so far, anything further is greatly appreciated.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Fresh install / ZoneMinder won't start

Post by SteveGilvarry »

14.04 Mmmm try this, I think I have it correct has been a while since I played with something not running at all.

Code: Select all

sudo zmpkg.pl start
What about the in ZM GUI there is a Logs link anything in there?

zmc -m1 if you have a camera called 1 should bring it up, or swap to your ID, or tell you what errors you are getting at camera daemon level. ZM should find alternate avconv libraries instead of ffmpeg OK, so don't worry about that they are the same mostly and we know ZM runs under them.

So a working system will have zmc (C=Camera) and zma (A=Analysis) running for each camera, you don't have any so then zms (S=Stream) has nothing to stream.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
bmather9
Posts: 23
Joined: Sun Jul 19, 2015 10:44 pm

Re: Fresh install / ZoneMinder won't start

Post by bmather9 »

SteveGilvarry wrote:14.04 Mmmm try this, I think I have it correct has been a while since I played with something not running at all.

Code: Select all

sudo zmpkg.pl start
What about the in ZM GUI there is a Logs link anything in there?

zmc -m1 if you have a camera called 1 should bring it up, or swap to your ID, or tell you what errors you are getting at camera daemon level. ZM should find alternate avconv libraries instead of ffmpeg OK, so don't worry about that they are the same mostly and we know ZM runs under them.

So a working system will have zmc (C=Camera) and zma (A=Analysis) running for each camera, you don't have any so then zms (S=Stream) has nothing to stream.
Good news and bad news; the logs link works! And it appears like my camera is working according to the logs! Although I still have no way to see the video through zoneminder.

I tried running zmpkg.pl and it showed up in the logs, but unfortunately the web interface remains 'Stopped'. Is there anything special I need to do when starting it? Do I need to define a 'New State' when starting?

Just to be sure, if ZoneMinder were running, I would be able to view video by clicking on Monitor-1 in the 'Name' column?

Here's some of the log output:

Code: Select all

Date/Time
Component	PID	Level	Message	File	Line
2015-07-25 10:17:14.650317	zmc_m1	4895	INF	Monitor-1: 540000 - Capturing at 10.00 fps	zm_monitor.cpp	2907
2015-07-25 10:16:30.433720	zmpkg	14931	INF	Command: start	zmpkg.pl	
2015-07-25 10:15:34.582725	zmc_m1	4895	INF	Monitor-1: 539000 - Capturing at 10.00 fps	zm_monitor.cpp	2907
2015-07-25 10:13:54.447380	zmc_m1	4895	INF	Monitor-1: 538000 - Capturing at 10.00 fps	zm_monitor.cpp	2907
2015-07-25 10:12:14.391167	zmc_m1	4895	INF	Monitor-1: 537000 - Capturing at 10.00 fps	zm_monitor.cpp	2907
2015-07-25 10:10:34.262566	zmc_m1	4895	INF	Monitor-1: 536000 - Capturing at 10.00 fps	zm_monitor.cpp	2907
I also found this page 'ZoneMinder Console - Stopped despite zmdc.pl startup running' of people having a similar issue but have struggled to follow what they do; my Linux skills aren't that great. Unfortunately this forum won't allow me to post the link so you'll have to google search for that page title in single quotes. The forum tells me:
Your post looks too spamy for a new user, please remove off-site URLs.
Lastly, I was thinking of things that could be causing this and I did follow much of this 'How to secure an Ubuntu 12.04 LTS server - Part 1 The Basics' a few years ago...maybe one of these things is causing zoneminder not to be able to run properly? You'll have to google it, since I'm evidently not allowed to post URLs
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Fresh install / ZoneMinder won't start

Post by SteveGilvarry »

Possibly caused by this
9. Harden PHP for security.

Edit the php.ini file :
sudo vi /etc/php5/apache2/php.ini
Add or edit the following lines an save :
disable_functions = exec,system,shell_exec,passthru
register_globals = Off
expose_php = Off
display_errors = Off
track_errors = Off
html_errors = Off
magic_quotes_gpc = Off
And ZM needs exec at least to run console status.
https://github.com/ZoneMinder/ZoneMinde ... er.php#L16
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Locked