fresh install on ubuntu 18.04 fails during dpkg configure & other places

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
wmarler
Posts: 1
Joined: Wed Oct 24, 2018 5:17 am

fresh install on ubuntu 18.04 fails during dpkg configure & other places

Post by wmarler » Wed Oct 24, 2018 6:32 am

TL;DR -- there are a number of issues with the Ubuntu 18.04 package; it does not succeed in installing a working ZoneMinder on a fresh install. (There really isn't a TL;DR version, sorry, I tried to be thorough with what didn't work though!).

This is reliably reproducible for me. First, the package seems to expect that /etc/zm and /etc/zm/zm.conf should exist:

Code: Select all

% sudo add-apt-repository ppa:iconnor/zoneminder-1.32
 Stable releases of ZoneMinder 1.32

This is to provide newer official packages for older ubuntu dists.                [i]<---- side note: what? 18.04 is older already?[/i]

If you would like to make a donation to directly support this ppa, you may do so by sending paypal to <email address hidden> or send digital coins to the following addresses:
BTC: 143XJVxDQ1c1HF4vixuCZAqG6LDhSBQFwU
BCH: qpk8a4938am7ex37k2yfykyglkxg6v46v5jy8qw05c
ETH: 0xA23b82d94A3589A866529DE9db05E3ba8a37fed8
ECH: 0x93FC917d1B9d3EA6c83fC5E2b48C7314B00D9407
LTC: M9QT3SUywaEcPwMwvu9rFLVmMuugQzdPWK
 More info: https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-1.32
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                  
Get:3 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic InRelease [20.7 kB]                 
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]                                           
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                   
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [369 kB]            
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [412 kB]                                      
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [153 kB]                                               
Get:9 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic/main amd64 Packages [1,612 B]         
Get:10 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [185 kB]                         
Get:11 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [147 kB]                                                     
Get:12 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [562 kB]                                                       
Get:13 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [567 kB]                                                      
Get:14 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic/main i386 Packages [1,612 B]     
Get:15 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [186 kB]                              
Get:16 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [149 kB]                                                   
Get:17 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]                            
Get:18 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [89.1 kB]                     
Get:19 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [191 kB]                        
Get:20 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [89.2 kB]                                 
Get:21 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic/main Translation-en [700 B]                        
Get:22 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [9,380 B]                                     
Get:23 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]         
Get:24 http://us.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,104 B]           
Fetched 3,387 kB in 2s (1,957 kB/s)                                                                         
Reading package lists... Done

% sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease               
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                  
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                
Hit:5 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic InRelease
Reading package lists... Done                      
Building dependency tree       
Reading state information... Done
0 packages can be upgraded.

% sudo apt install zoneminder
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  docutils-common docutils-doc fonts-lato libappconfig-perl libb-hooks-op-check-perl libclass-inspector-perl libclass-load-perl
  libclass-std-fast-perl libclass-std-perl libconvert-binhex-perl libdata-optlist-perl libdate-manip-perl libdevel-callchecker-perl
  libdevice-serialport-perl libdynaloader-functions-perl libemail-date-format-perl libfile-slurp-perl libimage-base-bundle-perl
  libimage-info-perl libio-sessiondata-perl libio-socket-multicast-perl libio-stringy-perl libjs-modernizr libjs-mootools libjson-any-perl
  libjson-maybexs-perl libmime-lite-perl libmime-tools-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmp4v2-2
  libnet-sftp-foreign-perl libnumber-bytes-human-perl libossp-uuid-perl libossp-uuid16 libpackage-stash-perl libpackage-stash-xs-perl
  libparams-classify-perl libparams-util-perl libphp-serialization-perl libproxy-tools libsoap-lite-perl libsoap-wsdl-perl libsub-install-perl
  libsys-cpu-perl libsys-meminfo-perl libsys-mmap-perl libtask-weaken-perl libtemplate-perl libterm-readkey-perl liburi-encode-perl libvlc-bin
  libvlc5 libvlccore9 libxmlrpc-lite-perl php-apcu php-apcu-bc python-alabaster python-babel python-babel-localedata python-docutils
  python-imagesize python-jinja2 python-markupsafe python-olefile python-pil python-pygments python-roman python-sphinx python-sphinx-rtd-theme
  python-typing python-tz sphinx-common sphinx-rtd-theme-common zoneminder-doc
Suggested packages:
  libmojolicious-perl uuid libscalar-number-perl libapache2-mod-perl2 libnet-jabber-perl libtemplate-plugin-gd-perl libtemplate-plugin-xml-perl
  fonts-linuxlibertine | ttf-linux-libertine texlive-lang-french texlive-latex-base texlive-latex-recommended python-jinja2-doc python-pil-doc
  python-pil-dbg ttf-bitstream-vera dvipng texlive-latex-extra texlive-fonts-recommended texlive-generic-extra latexmk imagemagick-6.q16
  sphinx-doc fcgiwrap
The following NEW packages will be installed:
  docutils-common docutils-doc fonts-lato libappconfig-perl libb-hooks-op-check-perl libclass-inspector-perl libclass-load-perl
  libclass-std-fast-perl libclass-std-perl libconvert-binhex-perl libdata-optlist-perl libdate-manip-perl libdevel-callchecker-perl
  libdevice-serialport-perl libdynaloader-functions-perl libemail-date-format-perl libfile-slurp-perl libimage-base-bundle-perl
  libimage-info-perl libio-sessiondata-perl libio-socket-multicast-perl libio-stringy-perl libjs-modernizr libjs-mootools libjson-any-perl
  libjson-maybexs-perl libmime-lite-perl libmime-tools-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmp4v2-2
  libnet-sftp-foreign-perl libnumber-bytes-human-perl libossp-uuid-perl libossp-uuid16 libpackage-stash-perl libpackage-stash-xs-perl
  libparams-classify-perl libparams-util-perl libphp-serialization-perl libproxy-tools libsoap-lite-perl libsoap-wsdl-perl libsub-install-perl
  libsys-cpu-perl libsys-meminfo-perl libsys-mmap-perl libtask-weaken-perl libtemplate-perl libterm-readkey-perl liburi-encode-perl libvlc-bin
  libvlc5 libvlccore9 libxmlrpc-lite-perl php-apcu php-apcu-bc python-alabaster python-babel python-babel-localedata python-docutils
  python-imagesize python-jinja2 python-markupsafe python-olefile python-pil python-pygments python-roman python-sphinx python-sphinx-rtd-theme
  python-typing python-tz sphinx-common sphinx-rtd-theme-common zoneminder zoneminder-doc
0 upgraded, 77 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.4 MB/26.1 MB of archives.
After this operation, 119 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 fonts-lato all 2.0-2 [2,698 kB]
Get:2 http://ppa.launchpad.net/iconnor/zoneminder-1.32/ubuntu bionic/main amd64 zoneminder amd64 1.32.2-bionic1 [6,464 kB]
...
<snip>
...

Setting up libclass-load-perl (0.24-1) ...
Setting up libsoap-wsdl-perl (3.003-2) ...
Setting up zoneminder (1.32.2-bionic1) ...
/var/lib/dpkg/info/zoneminder.postinst: 7: .: Can't open /etc/zm/zm.conf
dpkg: error processing package zoneminder (--configure):
 installed zoneminder package post-installation script subprocess returned error exit status 2
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for libvlc-bin:amd64 (3.0.3-1-1ubuntu1) ...
Errors were encountered while processing:
 zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)

% ls /etc/zm/zm.conf
ls: cannot access '/etc/zm/zm.conf': No such file or directory
% ls /etc/zm/       
conf.d
% ls /etc/zm/conf.d
I cloned the git repo and ran the "do_debian_package.sh" script and found that it created a set of defaults for /etc/zm under ./zoneminder_release/debian/zoneminder/etc/zm . I went ahead and copied that etc/zm to /etc/zm recursively and re-tried the install, and got a warning:

Code: Select all

% sudo apt install zoneminder                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
zoneminder is already the newest version (1.32.2-bionic1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up zoneminder (1.32.2-bionic1) ...
Detected db service is mysql.service
Creating zm db

Database already at version 1.32.2, update aborted.


Freshening configuration in database
Loading config from DB 223 entries
Saving config to DB 223 entries
Done Updating; starting ZoneMinder.
zoneminder.service is a disabled or a static unit not running, not starting it.
W: APT had planned for dpkg to do more than it reported back (0 vs 4).
   Affected packages: zoneminder:amd64
Not sure what else apt had planned ... so I went and uninstalled zoneminder, wiped out the zm database & zmuser@localhost db user, and other traces of zoneminder (except for /etc/zm -- I kept that!) and re-installed the package. This time installation completed with no warnings or errors:

Code: Select all

% sudo apt install zoneminder              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  fcgiwrap
The following NEW packages will be installed:
  zoneminder
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6,464 kB of archives.
After this operation, 40.4 MB of additional disk space will be used.
Selecting previously unselected package zoneminder.
(Reading database ... 321840 files and directories currently installed.)
Preparing to unpack .../zoneminder_1.32.2-bionic1_amd64.deb ...
Unpacking zoneminder (1.32.2-bionic1) ...
Setting up zoneminder (1.32.2-bionic1) ...
Detected db service is mysql.service
Creating zm db

Database already at version 1.32.2, update aborted.


Freshening configuration in database
Loading config from DB 223 entries
Saving config to DB 223 entries
Done Updating; starting ZoneMinder.
zoneminder.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...


Unfortunately, the script in the wiki then
says to "a2enconf zoneminder", but the package does not put a "zoneminder" into /etc/apache2/sites-available, so this fails:

Code: Select all

% sudo a2enconf zoneminder
ERROR: Conf zoneminder does not exist!
... fortunately I had a VirtualHost config available:

Code: Select all

% cat /etc/apache2/sites-available/zm.<mydomain>.com.conf
<VirtualHost *:80>
  ServerName zm.<mydomain>.com
  Redirect permanent / https://zm.<mydomain>.com
</VirtualHost>

<VirtualHost *:443>
  ServerName zm.<mydomain>.com
  DocumentRoot /usr/share/zoneminder/www
  
  SSLEngine on
  SSLCertificateFile     /etc/letsencrypt/live/zm.<mydomain>.com/cert.pem 
  SSLCertificateKeyFile  /etc/letsencrypt/live/zm.<mydomain>.com/privkey.pem

  # HSTS (mod_headers is required) (15768000 seconds = 6 months)
  Header always set Strict-Transport-Security "max-age=15768000"

  ErrorLog /var/log/apache2/zoneminder-error.log
  CustomLog /var/log/apache2/zoneminder-access.log combined
  LogLevel info

  ScriptAlias /cgi-bin "/usr/lib/zoneminder/cgi-bin"
  <Directory "/usr/lib/zoneminder/cgi-bin">
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      AllowOverride All
      Require all granted
  </Directory>

  <Directory /usr/share/zoneminder/www>
    Options -Indexes +FollowSymLinks
    <IfModule mod_dir.c>
      DirectoryIndex index.php
    </IfModule>
  </Directory>

  <Directory /usr/share/zoneminder/www/api>
      AllowOverride All
  </Directory>
</VirtualHost>
This succeeds in getting me an interface, but it looks wrongly formatted. When I look at the Apache logs, Apache is complaining that some CSS files aren't present:

Code: Select all

% tail -f /var/log/apache2/zoneminder-error.log
[Tue Oct 23 23:31:30.929947 2018] [core:info] [pid 20229] [client 108.162.221.10:61074] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_css_base_skin-base-1539481441.css, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.937487 2018] [core:info] [pid 15041] [client 108.162.221.136:60648] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_css_base_views_privacy-base-1539481441.css, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.942839 2018] [core:info] [pid 26742] [client 172.69.69.33:32226] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic__js_dateTimePicker_jquery-ui-timepicker-addon-base-1539481441.css, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.942868 2018] [core:info] [pid 15034] [client 172.69.71.11:29916] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic__css_base_jquery-ui-theme-base-1539481441.css, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.942934 2018] [core:info] [pid 20230] [client 108.162.221.82:35208] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic__js_jquery-ui-1.12.1_jquery-ui.structure.min-base-1539481441.css, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.944259 2018] [core:info] [pid 1659] [client 172.69.70.184:12952] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_js_base-base-1539481441.js, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.947810 2018] [core:info] [pid 12792] [client 172.69.69.111:24590] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_views_js_privacy-base-1539481441.js, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:30.950446 2018] [core:info] [pid 14088] [client 172.69.70.106:13228] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_js_skin-base-1539481441.js, referer: https://zm.<mydomain>.com/
[Tue Oct 23 23:31:37.937290 2018] [core:info] [pid 12789] [client 172.69.69.57:45544] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_views_js_console-base-1539481441.js, referer: https://zm.<mydomain>.com/index.php?view=console
[Tue Oct 23 23:31:37.937339 2018] [core:info] [pid 22126] [client 172.69.70.112:58954] AH00128: File does not exist: /usr/share/zoneminder/www/cache/skins_classic_css_base_views_console-base-1539481441.css, referer: https://zm.<mydomain>.com/index.php?view=console
And they're not present ... indeed, there's no /usr/share/zoneminder/www/cache dir at all:

Code: Select all

% ll /usr/share/zoneminder/www
total 68K
drwxr-xr-x 13 www-data www-data 4.0K Oct 24 00:04 .
drwxr-xr-x  4 www-data www-data 4.0K Oct 24 00:04 ..
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 ajax
drwxr-xr-x  4 www-data www-data 4.0K Oct 24 00:04 api
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 css
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 fonts
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 graphics
drwxr-xr-x  3 www-data www-data 4.0K Oct 24 00:04 includes
-rw-r--r--  1 www-data www-data 8.6K Oct 13 19:44 index.php
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 js
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 lang
-rw-r--r--  1 www-data www-data   29 Oct 13 19:44 robots.txt
drwxr-xr-x  3 www-data www-data 4.0K Oct 24 00:04 skins
drwxr-xr-x  3 www-data www-data 4.0K Oct 24 00:04 tools
drwxr-xr-x  2 www-data www-data 4.0K Oct 24 00:04 views
I'm not sure where the cache dir is supposed to come from, but it wasn't created when I gave the www-data group write permissions to /usr/share/zoneminder/www/cache, restarted apache, reloaded the zm web page, etc.

Thanks in advance

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests