If you have a non-standard Koha apache configuration, for example you have virtualhosts in separate files instead of all in one file (you might do this if you were using Let's Encrypt, among other reasons) koha-list --plack --enabled can fail because it is looking for apache configurations in only one file (/etc/apache2/sites-available/instance.conf). I propose to make the check for plack enabled work more like the email enabled, where we touch a file in /var/lib/koha/instance when the service is enabled, and remove it when it is disabled. I'm happy to leave the current checking alone and include this as a bracer to the existing belt. To do: edit koha-plack to make enable and disable put a file in /var/lib/koha/instance called plack.enable edit koha-functions.sh to include checking for the file as part of is_plack_enabled There are probably other things to do as well.
Created attachment 63493 [details] [review] Bug 18617 - starting plack on reboot can fail on non-standard apache configs To test: apply this patch copy debian/scripts/koha-functions.sh to /usr/share/koha/bin copy debian/scripts/koha-plack to /usr/sbin create a dummy instance if you need to (koha-create --create-db whatever) enable plack - koha-plack --enable whatever check for existence of /var/lib/koha/whatever/plack.enabled do a koha-list --enabled --plack and your instance should be listed as enabled. rename your /etc/apache2/sites-available/whatever.conf to something else do a koha-list --enabled --plack - it should still be enabled do a koha-plack --disable whatever - it should remove /var/lib/koha/whatever/plack.enabled do a koha-list --enabled --plack - it should not be listed. Note: This does not deal with the issue of disabling plack not doing the right thing for config files that are not "/etc/apache2/sites-available/whatever.conf" - this only ensures that koha-list --enabled and --disabled reports correctly in that circumstance.
Bump, we'll need this if we want to ever split up the apache configuration files as we should.
(In reply to Liz Rea from comment #2) > Bump, we'll need this if we want to ever split up the apache configuration > files as we should. I vaguely recall that LetsEncrypt does not like split config files.
Do you have objections that are further to the actual function here, because I don't really want to look up and document every bit of certbot to defend that. I have directly experienced the plack problem with vhosts in separate files, it ought to be enough to justify the change. Cheers, Liz
I like the idea of not having to grep the apache configuration files. I was testing this, and discovered that this doesn't fully work. I'm going to attach a follow up which should. If that makes you happy, Liz, then sign off, and I'll sign off, and we can set this to signed off.
Created attachment 70971 [details] [review] Bug 18617: Follow up - correctly check plack.enabled file first This patch was required, because without it, the apache2 config grepping logic was preventing the elif from checking the existence of the enabled file.