Project

General

Profile

Bug #1357

ZoneMinder Path Issues on Amahi 7

Added by laddhouse over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Apps
Target version:
Start date:
04/30/2014
Due date:
% Done:

0%


Description

I've just installed ZoneMinder and it appears to working after a few tweaks. It was mostly a matter of correcting some paths.

In /etc/httpd/conf.d I had to change this line:

ScriptAlias /cgi-bin/zm "/var/hda/web-apps/zoneminder/html/cgi-bin"

To:

ScriptAlias /cgi-bin/zm "/var/hda/web-apps/zm/html/cgi-bin"

The symbolic links were also wrong. I changed them as follows:

cambozola.jar -> ../java/cambozola.jar
events -> ../../../../lib/zoneminder/events
images -> ../../../../lib/zoneminder/images
temp -> ../../../../lib/zoneminder/temp

I guess the links could point to the absolute paths but I just followed the format used by the original package in case there was a reason for it.

Finally, the Amahi package did not include cambozola.jar. I found that I could only view recorded events once I placed cambozola.jar in /var/hda/web-apps/zm/java/ and gave it the correct permissions. I first tried the version provided on the ZoneMinder website but it didn't work for me. I downloaded the latest version from the author's site and it now seems to be working.

Hope that helps!

cambozola.jar (61.5 KB) laddhouse, 04/30/2014 02:00 PM

History

#1 Updated by laddhouse over 5 years ago

EDIT: /etc/httpd/conf.d should be /etc/httpd/conf.d/1002-zm.conf

#2 Updated by bigfoot65 over 5 years ago

  • Status changed from New to Feedback
  • Assignee set to laddhouse

Thanks for the feedback. I have updated the ScriptAlias path that was overlooked.

Not sure what you mean by the symbolic links were wrong. The app does not create any symbolic links, only copies files to /var/hda/web-apps/zm/html. Can you please clarify what the full paths are that you referred to above?

I will see if I can find cambozola.jar and add it to the app. Once I make the changes, I would like you to uninstall and reinstall. We need to test to ensure it works correctly.

#3 Updated by bigfoot65 over 5 years ago

  • Target version set to amahi-7-3

Can you provide the compiled cambozola.jar file? That would save some time in updating the app.

#4 Updated by laddhouse over 5 years ago

After installation, the sym links in my /var/hda/web-apps/zm/html/ directory looked like this:

cambozola.jar -> ../../java/cambozola.jar
events -> ../../../../var/lib/zoneminder/events
images -> ../../../../var/lib/zoneminder/images
temp -> ../../../../var/lib/zoneminder/temp

They didn't work because ../../../../ from /var/hda/web-apps/zm/html/ takes you to /var/

The full paths would be:

cambozola.jar -> /var/hda/web-apps/zm/java/cambozola.jar
events -> /var/lib/zoneminder/events
images -> /var/lib/zoneminder/images
temp -> /var/lib/zoneminder/temp

I've attached the cambozola.jar file.

#5 Updated by bigfoot65 over 5 years ago

Great and thanks for the update. I will work on updating the app. I will post back here tonight to let you know it's ready for testing.

#6 Updated by laddhouse over 5 years ago

Great, thanks! Would it be a lot of trouble to update to the latest version? It's 1.26.5 now.

#7 Updated by bigfoot65 over 5 years ago

Ok, got it fixed.

Please uninstall and reinstall now. We cannot update it to the latest until Fedora has it in the repo. We are using the native Fedora 19 package.

I will see if there is a source version that we can use vs the Fedora version, but not expecting it to be simple.

#8 Updated by laddhouse over 5 years ago

This is probably a dumb question but how do I uninstall? It's no longer showing in my list of apps.

#9 Updated by bigfoot65 over 5 years ago

In the apps tab, select the Installed section. It should appear there.

#10 Updated by laddhouse over 5 years ago

See, I knew it was a dumb question! ;-)

Anyway, the reinstall seems to have failed. Here's the dump:

======= app uninstall begin 2014-05-02 12:31:49 -0400 ==========
Uninstalling app id yi7uxa8mlb under /var/hda/platform/html/script/.. ENV=production
Stopping zoneminder service
Disabling zoneminder service
rm '/etc/systemd/system/multi-user.target.wants/zoneminder.service'
Reloading systemctl daemon
Your HDA services have been restarted.
App: Zoneminder uninstalled ======= app uninstall end @ 2014-05-02 12:32:01 -0400 ========== ======= app install begin 2014-05-02 12:32:31 -0400 ==========
Installing app id yi7uxa8mlb under /var/hda/platform/html/script/.. ENV=production
Your HDA services have been restarted.
Your HDA services have been restarted.
NOTE: file /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320 written in cache
/var/hda/platform/html/lib/system_utils.rb:66:in `run_script': run_script had to KILL this script. it was taking too long. sorry. (RuntimeError)
from /var/hda/platform/html/app/models/app.rb:241:in `block in install_bg'
from /var/hda/platform/html/app/models/app.rb:240:in `chdir'
from /var/hda/platform/html/app/models/app.rb:240:in `install_bg'
from /var/hda/platform/html/script/install-app:86:in `install_or_uninstall'
from /var/hda/platform/html/script/install-app:107:in `main'
from /var/hda/platform/html/script/install-app:119:in `<main>'

#11 Updated by bigfoot65 over 5 years ago

Not a problem.

The install failure is due to a time out issue. Do you have a slow internet connection?

Please try again.

#12 Updated by laddhouse over 5 years ago

No, should be plenty fast. 15Mbps down, 1Mbps up. I tried to install again but got the same error right away. I think it was reading the cached installer. I removed /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320 and tried to install again but got the same error:

=======  app install begin      @  2014-05-03 14:33:00 -0400 ==========
Installing   app id yi7uxa8mlb under /var/hda/platform/html/script/.. ENV=production
Your HDA services have been restarted.
Your HDA services have been restarted.
NOTE: file /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320 written in cache
/var/hda/platform/html/lib/system_utils.rb:66:in `run_script': run_script had to KILL this script. it was taking too long. sorry. (RuntimeError)
        from /var/hda/platform/html/app/models/app.rb:241:in `block in install_bg'
        from /var/hda/platform/html/app/models/app.rb:240:in `chdir'
        from /var/hda/platform/html/app/models/app.rb:240:in `install_bg'
        from /var/hda/platform/html/script/install-app:86:in `install_or_uninstall'
        from /var/hda/platform/html/script/install-app:107:in `main'
        from /var/hda/platform/html/script/install-app:119:in `<main>'
/var/hda/platform/html/lib/system_utils.rb:66:in `run_script': run_script had to KILL this script. it was taking too long. sorry. (RuntimeError)
        from /var/hda/platform/html/app/models/app.rb:241:in `block in install_bg'
        from /var/hda/platform/html/app/models/app.rb:240:in `chdir'
        from /var/hda/platform/html/app/models/app.rb:240:in `install_bg'
        from /var/hda/platform/html/script/install-app:86:in `install_or_uninstall'
        from /var/hda/platform/html/script/install-app:107:in `main'
        from /var/hda/platform/html/script/install-app:119:in `<main>'

#13 Updated by bigfoot65 over 5 years ago

Did you clear the browser cache? Works fine for me. Maybe reboot the HDA before reinstall.

#14 Updated by laddhouse over 5 years ago

Yes, I've tried rebooting the HDA and clearing my browser cache. Is it possible that remnants of the prior install are causing issues?

#15 Updated by bigfoot65 over 5 years ago

That is possible. Do yum erase zoneminder. Then check for .rpmsave files and remove them.

#16 Updated by laddhouse over 5 years ago

I ran yum erase and then checked my /var/hda/web-apps/ directory. I found that it had created directories for each zm install attempt (zm, zm1, zm2, ect...). I used rm -rf /var/hda/web-apps/zm* to remove them.

I'm not sure where to look for the rpmsave files.

I ran the installation again and it created /var/hda/web-apps/zm7 then failed with the same error.

#17 Updated by laddhouse over 5 years ago

Okay, this time I removed every single thing I could find related to ZoneMinder (including the SQL database and user). I started the install again and it failed but I got a different error this time:

=======  app install begin      @  2014-05-06 09:26:44 -0400 ==========
Installing   app id yi7uxa8mlb under /var/hda/platform/html/script/.. ENV=production
Your HDA services have been restarted.
Your HDA services have been restarted.
NOTE: file /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320 written in cache
Reloading systemctl daemon
Enabling zoneminder service
ln -s '/usr/lib/systemd/system/zoneminder.service' '/etc/systemd/system/multi-user.target.wants/zoneminder.service'
Starting zoneminder service
Job for zoneminder.service failed. See 'systemctl status zoneminder.service' and 'journalctl -xn' for details.
App: Zoneminder installed
=======  app install end        @  2014-05-06 09:26:57 -0400 ==========

Here's the result from systemctl status zoneminder.service:

   Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled)
   Active: failed (Result: exit-code) since Tue 2014-05-06 09:26:58 EDT; 6min ago
  Process: 6015 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)

May 06 09:26:57 localhost.localdomain zmpkg[6015]: INF [Command: start]
May 06 09:26:57 localhost.localdomain systemd[1]: Failed to read PID from fil...
May 06 09:26:57 localhost.localdomain systemd[1]: Failed to start Video secur...
May 06 09:26:57 localhost.localdomain systemd[1]: Unit zoneminder.service ent...
May 06 09:26:57 localhost.localdomain systemd[1]: Starting Video security and...
May 06 09:26:58 localhost.localdomain systemd[1]: zoneminder.service: control...
May 06 09:26:58 localhost.localdomain systemd[1]: Failed to start Video secur...
May 06 09:26:58 localhost.localdomain systemd[1]: Unit zoneminder.service ent...

#18 Updated by bigfoot65 over 5 years ago

Have you been uninstalling the app via the Dashboard, Apps tab, Installed? If not, then you have quite a mess. There should only be one directory (/var/hda/web-apps/zm ) for the app. Seeing zm1, zm7, etc indicates it was not uninstalled correctly.

That would explain all the issues you are having with this app. As for the latest install, please post the result of the following command as root user:
systemctl status zoneminder.service

Also it's important to clear your browser cache occasionally as well.

#19 Updated by laddhouse over 5 years ago

I couldn't uninstall from the dashboard because Amahi never thought the app was installed. systemctl status zoneminder.service result posted above.

#20 Updated by bigfoot65 over 5 years ago

Well if you installed them via the applications tab, then Amahi knew they were installed. If they did not show up in the Installed tab, then might need to do some manual cleanup in the database.

Please post the results without the lines cut off. Need to see it all.

#21 Updated by laddhouse over 5 years ago

Sorry, here you are:

zoneminder.service - Video security and surveillance system
   Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled)
   Active: failed (Result: exit-code) since Tue 2014-05-06 09:26:58 EDT; 3h 36min ago
  Process: 6015 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)

May 06 09:26:57 localhost.localdomain zmpkg[6015]: INF [Command: start]
May 06 09:26:57 localhost.localdomain systemd[1]: Failed to read PID from file /run/zoneminder/zm.pid: Invalid argument
May 06 09:26:57 localhost.localdomain systemd[1]: Failed to start Video security and surveillance system.
May 06 09:26:57 localhost.localdomain systemd[1]: Unit zoneminder.service entered failed state.
May 06 09:26:57 localhost.localdomain systemd[1]: Starting Video security and surveillance system...
May 06 09:26:58 localhost.localdomain systemd[1]: zoneminder.service: control process exited, code=exited status=1
May 06 09:26:58 localhost.localdomain systemd[1]: Failed to start Video security and surveillance system.
May 06 09:26:58 localhost.localdomain systemd[1]: Unit zoneminder.service entered failed state.

#22 Updated by laddhouse over 5 years ago

Not sure if it helps but here's the contents of /run/zoneminder/zm.pid:

5900Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 789.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.
Can't exec "killall": No such file or directory at /usr/bin/zmdc.pl line 796.

#23 Updated by bigfoot65 over 5 years ago

Not much help unfortunately. I would recommend you completely uninstall the app. Do clean up and check the database to ensure there are no copies listed as installed. In the database, hda_production apps that are installed as listed. Ensure there are no rows for zoneminder.

You can also check the installed section in Apps to see if there is anything there. As I mentioned, browsers cache sometimes that causes problems. I have seen an app installed twice that way.

Probably a good idea to reboot the machine too before trying to install again.

BTW, What browser are you using? Things seem to be a mess here. Not sure why as I installed and uninstalled without any problems.

#24 Updated by laddhouse over 5 years ago

You know more about the Amahi install process than I do but I had assumed it wasn't showing up as installed because it wouldn't complete the install process. Without it showing as installed, I couldn't uninstall it (catch 22). I did try clearing my cache between install attempts. I'm using the latest version of Chrome.

The good news is, it let me uninstall the last install attempt. I checked the database after the uninstall and it was not shown in the apps table. I ran the installation again and it appears to have completed successfully this time. It did install as zm8 instead of zm but I'm not worried about that as long as everything works properly. I'll report back after I've had a chance to set up Zoneminder again. The only strange thing I've noticed thus far is that the installer placed the following symbolic link in /var/hda/web-apps/zm8/:

cambozola.zip -> /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320

It put the actual cambozola.jar in /var/hda/web-apps/zm8/html/ so I think it'll still work. Again, haven't tested yet.

#25 Updated by bigfoot65 over 5 years ago

Ok, that is good. Not sure why it's incrementing the web app directory. I presume you cleaned up /var/hda/web-apps. As for the file with symlink, that was the cached download file. It can be removed. I may add that to the app later.

#26 Updated by laddhouse over 5 years ago

The only issue I've had so far was caused by Zoneminder being installed in zm8 instead of zm. I had change /etc/httpd/conf.d/1010-zm8.conf to match:

ScriptAlias /cgi-bin/zm "/var/hda/web-apps/zm8/html/cgi-bin" 

#27 Updated by bigfoot65 over 5 years ago

Sounds good. We need to figure out why it's installed in zm8. Maybe an uninstall will correct it.

Did you check /var/hda/web-apps to ensure there were no other zm directories?

#28 Updated by laddhouse over 5 years ago

Yup, there were no zm directories before I started the last install.

#29 Updated by bigfoot65 over 5 years ago

Ok. Did you reboot before reinstalling? Just trying to figure out how to get it to install in zm and not zm8.

Something must still be stuck in the database or somewhere else.

#30 Updated by laddhouse over 5 years ago

I hadn't rebooted before reinstalling last time. However, I believe I've spotted the cause of the issue. Last time I checked the database, I looked in the apps table, not the webapps table. Looking in webapps, I see the following:

MariaDB [hda_production]> select id,name from webapps;
+----+------------+
| id | name       |
+----+------------+
|  1 | phpsysinfo |
|  2 | cups       |
|  4 | zm         |
|  5 | zm1        |
|  6 | zm2        |
|  7 | zm3        |
|  8 | zm4        |
|  9 | zm5        |
| 10 | zm6        |
| 12 | zm7        |
| 14 | zm8        |
+----+------------+
11 rows in set (0.00 sec)

Should I uninstall again, delete any remaining zm rows, and reinstall?

#31 Updated by bigfoot65 over 5 years ago

Yes I recommend you install, remove the remaining zm# rows, and reboot. Then verify before you install again that clean up is done.

#32 Updated by laddhouse over 5 years ago

I followed those steps and it seems to be working just fine. It also installed as zm with no number behind it. Thanks!

#33 Updated by bigfoot65 over 5 years ago

  • Status changed from Feedback to Closed

Sounds great. I will close the bug now. If you have any further issues, please reopen it and add details of the issue.

#34 Updated by laddhouse over 5 years ago

  • Status changed from Closed to Assigned
  • Assignee changed from laddhouse to bigfoot65

I did actually notice one more issue: zm is showing up as "Stopped" under Settings - Server in my Amahi control panel even though it's running.

#35 Updated by bigfoot65 over 5 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from bigfoot65 to laddhouse

I will take a look tonight. Will let you know when it's fixed.

#36 Updated by bigfoot65 over 5 years ago

Found the problem and corrected it. Please uninstall and reinstall the application. Check the server's section and it should show GREEN.

#37 Updated by laddhouse over 5 years ago

Yup, looks good now. Thanks!

#38 Updated by bigfoot65 over 5 years ago

  • Status changed from Feedback to Closed

Awesome. Promoted the app to BETA, so hope to get more testing done. If you find any other issues, please sbmit a new bug report.

Also available in: Atom