Closed martinhpedersen closed 3 years ago
After resolving this issue by manually installing apache2 prior to apt-get install polaric-webapp2, I get the following new error from preinst:
a2ensite aprs.conf
ERROR: Site aprs does not exist!
I am unable to locate the source of preinst in this repo, but here is the copy I extracted from polaric-webapp2_1.6.2_all.deb:
#!/bin/bash
set -e
case "$1" in
install|upgrade)
a2enmod expires > /dev/null 2>&1
a2enmod deflate > /dev/null 2>&1
if [[ ! -f "/etc/apache2/sites-enabled/aprs.conf" ]]; then
a2ensite aprs.conf > /dev/null 2>&1
fi
if [[ ! -d "/var/lib/polaric/mapcache" ]]; then
mkdir /var/lib/polaric/mapcache
fi
chown www-data:polaric /var/lib/polaric/mapcache
chmod 775 /var/lib/polaric/mapcache
if ls /var/lib/polaric/mapcache/*.db > /dev/null 2>%1; then
chown www-data:polaric /var/lib/polaric/mapcache/*.db
chmod 664 /var/lib/polaric/mapcache/*.db
fi
;;
*)
echo "$0 called with unknown argument \`$1'" >&2
exit 1
;;
esac
Thanks for the top. I guess the a2enmod and a2ensite in preinst script could just be moved to the postinst script. Before the apache2ctl restart. I checked in the change..
Sounds good too me 👍 🙂 Thanks!
I'll update this issue once it has been released to verify the fix on my end.
Quick update: The pre-installation script is still failing in v1.7.
I will need to do some more digging in order to provide you with log output. I'll get back to you as soon as possible 🙂
That was easier than I thought.
#11 22.48 Selecting previously unselected package polaric-webapp2.
#11 22.48 Preparing to unpack .../113-polaric-webapp2_1.7_all.deb ...
#11 22.49 chown: invalid group: 'www-data:polaric'
#11 22.49 dpkg: error processing archive /tmp/apt-dpkg-install-7iWBtT/113-polaric-webapp2_1.7_all.deb (--unpack):
#11 22.49 new polaric-webapp2 package pre-installation script subprocess returned error exit status 1
So the issue is with the chown this time. Possibly that the group polaric
has not yet been created(?).
If this is installed for the first time, obviously the group should be created. I'll fix it.
This is probably only an issue if you don't install polaric-aprsd first, for example if creating a docker container with only the client.
Fixed in 1.7.3
The preinst script in polaric-webapp2_1.6.2 depends on
a2enmod
(from the apache2 package) and some apache2 modules being available on the system. However since debian/control lists apache2 asDepends:
(notPre-Depends
), the a2enmod fails on systems where apache2 is not pre-installed.I believe an easy fix would be to define apache2 as a
Pre-Depends
in debian/control, but the debian documentation recommends to avoid the situation if possible: