Bug 9477 - zoneminder package should pull database engine
Summary: zoneminder package should pull database engine
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard: OK
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-22 01:09 CET by Morgan Leijström
Modified: 2013-03-25 13:37 CET (History)
1 user (show)

See Also:
Source RPM: zoneminder-1.25.0-22.mga3.tainted.src.rpm
CVE:
Status comment:


Attachments

Description Morgan Leijström 2013-03-22 01:09:26 CET
This is a fresh install mga3b2 KDE 32-bit that rested a while, then today full update, reboot, selected zoneminder in MCC->Install/Remove_Programs, and accepted the first of choices of additional packages.
When I run # zmsetup  i get:

*** Welcome to ZoneMinder Setup ***
Please wait a moment...
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory. See system logs and 'systemctl status mysqld.service' for details.
Please enter your mysql root password:

(I have no mysql pw - that and other things is what zmsetup is supposed to help with...)

Reboot did not help.

# systemctl status mysqld.service
mysqld.service
          Loaded: error (Reason: No such file or directory)
          Active: inactive (dead)

I do not know how to  watch which log, in this new system, but when running
$ journalctl -f
in a separate terminal, while issuing # zmsetup, nothing happens.

Reproducible: 

Steps to Reproduce:
Comment 1 Morgan Leijström 2013-03-22 01:30:00 CET
Doh... After I installed the database engine it works perfectly :)

I think the zoneminder rpm should pull mysql-MariaDB ?

OR, if it is possible for zoneminder to use a database on another system, then zmsetup should ask which database to connect to, and if answer is local, then suggest to install it then rerun zmsetup.
Comment 2 Morgan Leijström 2013-03-22 01:35:04 CET
Barry, i saw you in another thread working on zoneminder.

CC: (none) => zen25000
Summary: zoneminder zmsetup fail loading mysqld.service => zoneminder package should pull database engine

Comment 3 Barry Jackson 2013-03-22 01:43:21 CET
We had a mid air collision I was just about to say:-

Hmm - I knew this would happen.
The Require on mysql was removed from the zoneminder spec.

http://svnweb.mageia.org/packages/cauldron/zoneminder/current/SPECS/zoneminder.spec?r1=291100&r2=291101

Do:

su
urpmi mariadb
zmsetup 

I have no idea if zoneminder could use a remote database, however I suppose someone may want to try. I will look at changing the zmsetup script (in fact I did start to do it but must have got sidetracked) so that it at least checks that a database is available.

Glad it's working now for you.

Leave this bug open until I resolve it one way or the other.
Thanks for reporting this.
Barry Jackson 2013-03-22 01:45:53 CET

Assignee: bugsquad => zen25000
Whiteboard: (none) => OK

Comment 4 Morgan Leijström 2013-03-22 02:41:47 CET
Thank you for the quick reply and your work on this.

Yes I think that regardless if the require is there or not, zmsetup should check mariadb is installed and suggest user to install it if it is not.

Maybe the script should begin with saying it will configure ZM for using local database.  If user wants to use remote database it is 1) very unusual 2) he is probaly experienced enough to read up on how.
Comment 5 Morgan Leijström 2013-03-22 14:07:00 CET
While I have you "on the line" and you probably test it on cauldron;
i have problem getting it to see my USB camera.

kamoso, cheese, wxcam, xawtv all see it OK at /dev/video0

zoneminder New Monitor > Probe finds nothing

Following http://www.zoneminder.com/wiki/index.php/Troubleshooting :

# zmc --device /dev/video0
(returns immediately without feedback)

# zmu -d 0 -q -v
Error, failed to open video device 0: Success

Why did it fail?

Neither generate output in another terminal running journalctl

Do USB video "webcam" work for you?

Maybe you have a quick tip?  Should we dig in cauldron problem or turn to zoneminder forum?  (i found nothing there now in a quick browsing)
Comment 6 Barry Jackson 2013-03-22 15:30:48 CET
Yes, although I think zoneminder should suggest mysql, to avoid these sort of issues in 99% of 'normal' use cases.
Comment 7 Barry Jackson 2013-03-22 15:44:54 CET
(In reply to Morgan Leijström from comment #5)
> While I have you "on the line" and you probably test it on cauldron;
> i have problem getting it to see my USB camera.
> 
> kamoso, cheese, wxcam, xawtv all see it OK at /dev/video0
> 
> zoneminder New Monitor > Probe finds nothing
> 
> Following http://www.zoneminder.com/wiki/index.php/Troubleshooting :
> 
> # zmc --device /dev/video0
> (returns immediately without feedback)
> 
> # zmu -d 0 -q -v
> Error, failed to open video device 0: Success
> 
> Why did it fail?

Not sure but see below

> 
> Neither generate output in another terminal running journalctl
> 
> Do USB video "webcam" work for you?

Yes but only in Cauldron (uvc mjpeg is not supported in Mageia 2 version)

> 
> Maybe you have a quick tip?  Should we dig in cauldron problem or turn to
> zoneminder forum?  (i found nothing there now in a quick browsing)

Try opening /dev/video0 in VLC and then have a dig around the tools it has to find the full details of the camera. VLC gives great detail.

Also try updating to the version of zoneminder in tainted, as it's built against tainted ffmpeg with more codecs available.
Comment 8 Barry Jackson 2013-03-22 17:00:55 CET
Morgan,
Fixed in svn - please test zoneminder-1.25.0-23.mga3
It now suggests mysql but if you install with urpmi --no-suggests with mariadb uninstalled you can test the updated zmsetup, which should offer to install mysql for you if you accept, or tell you to go away and figure it out yourself if you decline ;)
Barry
Comment 9 Morgan Leijström 2013-03-22 23:22:15 CET
Great, Barry :)
I uninstalled zm and mariadb, installed zm with --no-suggests  (-23 tainted cauldron i586).  I ran zmsetup and it asked if i wanted to install mariadb.

When i answered no, it said i need to provide database myself, and exited.

Run it again, answered yes, it installed maria, then after a few seconds asked for database root pwd, i gave it, it asked if i wanted to reuse zm database, i said yes, ... done.

And if i uninstall zm and maria, then install zm without --no-suggests, maria gets installed.

I consider this bug to be solved perfectly, good job  :)
Comment 10 Morgan Leijström 2013-03-22 23:37:54 CET
About ZM not seeing a camera: 
I *am* using the cauldron tainted version.
I have four USB cameras of different brand age 1 to 4 years, and they work with vlc, kamoso, cheese, wxcam, xawtv. They are on same external USBhub (this lappy only have one free USB) I can have two cams showing video simultaneously in two separate programs.  They see them using v4l2 on /dev/video{0..4}

I thought zoneminder Probe function should find them.
Or at least zmu and zmc should get something.
The respond the same regardless of i point them to any of the cameras, or to nonexisting /dev/video5
Could it be I am missing some library or setting up?
ownership/rights of zm use them?

If you have time;
If you plug in a USB camera, do Probe function, or zmc, zmu work for you?
(how, see my comment 5)
Morgan Leijström 2013-03-22 23:39:08 CET

Status: NEW => REOPENED

Comment 11 Barry Jackson 2013-03-22 23:39:39 CET
Thanks Morgan :)

Closing then.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 12 Morgan Leijström 2013-03-22 23:42:30 CET
whoops slippy mouse mat... i meant to set it resolved fixed, but set it reopened, which you did too in a mid air collision to my correction :)
Comment 13 Barry Jackson 2013-03-23 00:14:54 CET
Re Camera
I just re-installed zoneminder (tainted) on my desktop, plugged in my usb webcam, clicked on "Add new monitor", left all settings at default and clicked "Save" and it just works.

I then uninstalled zm and re-installed the non-tainted version. That also works out of the box, as above.

My camera is:
Bus 003 Device 003: ID 041e:4088 Creative Technology, Ltd Live! Cam Chat HD [VF0700]

Morgan are you on IRC - if so #zoneminder ?
Comment 14 Morgan Leijström 2013-03-23 00:37:39 CET
I plugged in one cam: Trust, "15704 webcam" using module uvcvideo. Used default settings in zm, just entering /dev/video0. Did not work.  Rebooted the system, hang, had to pull power.
When it got up it works!  :)

I have als experienced that if zm have tried to use a camera, wxcam or cheese hang when they try to use it, until i reboot, which hangs just before shutting down.
If i just reboot without messing with video cam it reboots OK.
I guess something is not quite perfect in the system regarding v4l...

Have not used IRC since fifteen years or so...
I think i should try zoneminder forum... or IRC... now bedtime.

Thank you for your time, Barry!
Comment 15 Morgan Leijström 2013-03-23 17:04:06 CET
I now moved to a more powerful laptop and mga2, and it works much better.

One thing i noted is that zmsetup finishes saying i can browse to http://mymachinename/zm.  For some reason it do not work (firewall?) on this machine, but 127.0.0.1 works perfectly.

So maybe we to that last word sentence ought to add
" or 127.0.0.1 here on the machine where zoneminder runs."
Comment 16 Barry Jackson 2013-03-24 11:07:32 CET
Strange - I have installed zm on lots of different machines VMs etc and that has always worked without problem. Also that feature has been unchanged for a long time now without a single bug report or forum post mentioning it.

In a clean install it normally defaults to localhost, however if a hostname has been configured it is used.

Did you have apache installed prior to installing zoneminder with your own custom configuration?

I'm certainly no apache expert, so maybe you can shed some light on just why it failed in this case.
Comment 17 Morgan Leijström 2013-03-25 10:57:07 CET
Hmm, another detail:
I am thinking that the way mageia finds updates is not optimal:
Now the mga2-64 system said there are upgrade to zoneminder:  1.25.0-10.1.mga2
But the installed version is  1.25.0-10.mga2.tainted
I installed it because when learning to get it going i want all compatibility possible.

I do not think it is a good idea to replace tainted with a version that do not have htat "extra".   Maybe it can be avoided depending on package naming?
Comment 18 Morgan Leijström 2013-03-25 11:12:29 CET
About hostname everything works as it should.
I just found out that i had earlier set up that browser on this system to use a proxy server for non local adresses, so http://t61m.tribun/zm/ did not work, but http://t61m/zm/ localhost and 127.0.0.1 did.

It shows that it is most reliable to use the simplest method on local system, for the case the sysadmin have had too little coffee ;)
Comment 19 Barry Jackson 2013-03-25 13:37:37 CET
(In reply to Morgan Leijström from comment #17)
> Hmm, another detail:
> I am thinking that the way mageia finds updates is not optimal:
> Now the mga2-64 system said there are upgrade to zoneminder: 
> 1.25.0-10.1.mga2
> But the installed version is  1.25.0-10.mga2.tainted
> I installed it because when learning to get it going i want all
> compatibility possible.
> 
> I do not think it is a good idea to replace tainted with a version that do
> not have htat "extra".   Maybe it can be avoided depending on package naming?

That was my fault, sorry - 1.25.0-10.1.mga2.tainted never got pushed because I forgot to send it to updates/testing.

Tainted IS always preferred over core.
rpmdev-vercmp 1.25.0-10.1.mga2.tainted 1.25.0-10.1.mga2
1.25.0-10.1.mga2.tainted > 1.25.0-10.1.mga2

There will soon be 1.25.0-10.2.mga2.tainted which has recently passed qa in updates/testing and this WILL replace your current version if you have tainted enabled. :)

Note You need to log in before you can comment on or make changes to this bug.