to test..
1/ install koha-common
$ sudo apt install koha-common
2/ start memcached, check PID
$ sudo service memcached start
$ sudo systemctl status memcached | grep PID
Main PID: 52851 (memcached)
3/ build and install new koha-common package (will trigger a restart)
$ sudo apt install ./koha-common-git+deadbeef.deb
5/ check that memcache is started, and has new PID (52900)
$ sudo systemctl status memcached | grep PID
Main PID: 52900 (memcached)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa096e7a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
To test:
1 - Apply patch
2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below:
log4perl.logger.worker = WARN, WORKER
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen
log4perl.appender.WORKER.stderr=1
log4perl.appender.WORKER.mode=append
log4perl.appender.WORKER.layout=PatternLayout
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n
log4perl.appender.WORKER.utf8=1
3 - Restart all
4 - Edit misc/background_jobs_worker.pl
- my $job = Koha::BackgroundJobs->find($args->{job_id});
+ my $job;# = Koha::BackgroundJobs->find($args->{job_id});
5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log
6 - Force enqueue a job (that won't be found because of #4
perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});'
7 - Note error in log like:
[2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The PLACKOPAC, PLACKAPI and PLACKINTRANET appenders still need %n
(i.e. a newline). Note that this patch does not add %l since it
is a bit confusing because it adds a lot of Plack internal noise like:
[2022/09/29 08:51:34] [WARN] Test mainpage CGI::Compile::ROOT::usr_share_koha_mainpage_2epl::__ANON__ /usr/share/koha/mainpage.pl (49)
The patch is a result of:
git grep -l "log4perl.appender.PLACK" | xargs sed -i -e"/ConversionPattern/ s/%m$/%m%n/"
Test plan:
First run: sed -i -e"/ConversionPattern/ s/%m$/%m%n/" /etc/koha/sites/[YOUR_CLONE]/log4perl.conf
Edit that file, change PLACKOPAC to debug level like:
log4perl.logger.plack-opac = DEBUG, PLACKOPAC
Restart.
Hit an OPAC page twice.
Check plack-opac logfile and verify that it contains a newline between last two messages like:
[2022/09/29 08:04:30] [DEBUG] kohaversion : 22.0600054
[2022/09/29 08:04:42] [DEBUG] kohaversion : 22.0600054
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 15253 originally had the ability to specify the incoming IP address used for
a given log statement via SIP, as well as the SIP2 account that was in use at the time.
This data is very helpful for debugging purposes, and should be brought back.
Test Plan:
1) Apply this patch
2) Update you SIP ConversionPattern to "[%d] [%p] %X{accountid}@%X{peeraddr}: %m %l %n"
3) Restart SIP
4) Use the SIP cli tester to make some SIP requests
5) View the SIP2 log, note the account id and client ip address show in the log!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Trivial change.
Do sed -i -r -e'/log4perl/ s/\s%n$/%n/' on the log4perl configs.
Test plan:
Update your own config.
Trigger some logging and check that logfile.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds `%P` to the SIP log4perl configuration so that PID is
recorded against log lines.
This allows transactions to be more easily tied together under one
SIPServer, thus making it easier to pick out a whole transaction from
start to finish.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
If plack.psgi is updated to the newer version and the log4perl.conf file
is not then the warnings will not be logged anywhere. This adds the
log4perl configurations that are needed for logging for pre-existing Koha
installation which are upgraded.
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Since bug 25172 we are failing loudly if the permissions are not correct
and that the logger cannot init successfully.
We must set the correct permission on upgrading.
koha-create deals with new installs
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The current grep expression uses -x|--line-regexp, but that causes
the regexp to fail to match since we're not specifying a regexp
that can match a whole line. We can either provide a better regexp,
or remove that --line-regexp option.
This patch removes the --line-regexp (ie -x) option from the grep
in log4perl_component, so that it detects logger components correctly.
To Test:
0) Apply patch
1) Build Koha package
2) Look at /etc/koha/sites/kohadev/log4perl.conf in an existing
Koha instance (e.g. on koha-testing-docker), and note it has
components for z3950, api, and sip
3) Install package
4) Note that /etc/koha/sites/kohadev/log4perl.conf is the same as before
5) Remove the "log4perl.logger.sip and log4perl.appender.SIP lines from
/etc/koha/sites/kohadev/log4perl.conf
6) Reinstall package
7) Note that the missing lines have been appended to the file at
/etc/koha/sites/kohadev/log4perl.conf
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch puts a space between the negation operator ! and
the function name (ie log4perl_component).
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
* We should not call Log::Log4perl directly
* Not sure it is correct as I get from (comment 77):
% koha-sip --restart
[2020/04/23 11:23:27] [ERROR] [undef]@[undef]: Argument "0.33_01" isn't
numeric in numeric lt (<) at /usr/share/perl5/Net/Server/Log/Sys/Syslog.pm
line 42.
C4::SIP::Trapper::PRINT /kohadevbox/koha/C4/SIP/Trapper.pm (24)
Why "ERROR" when it's a warning?
The [undef]@[undef] seems wrong here.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Now koha-common.postinst has a way to patch log4perl configs on
instances, we should patch the Z3950 responder config accordingly,
before it is backported to 19.11 or the 20.05 release :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes koha-common.postinst check if the log4perl.conf files
on the instances need tweaking. If they do, it appends the relevant
configuration text.
To test:
1. Install Koha 19.11 or earlier using the packages
2. Create an instance:
$ koha-create --create-db test1
$ koha-create --create-db test2
=> FAIL: /etc/koha/sites/test1/log4perl.conf doesn't include an entry for
z39.50
3. Apply this patch and run:
$ docker run \
--volume=/path/to/your/clone:/koha \
--volume=/dest/path/for/debs:/debs \
--privileged
--env VERSION=19.12.00.047 \
koha/koha-dpkg:master
Note: Paths need to be adjusted
4. Grab the .deb files and put them on the machine you're testing this
5. Edit /etc/koha/sites/test2/log4perl.conf and add the following text
at the bottom: log4perl.logger.z3950
6. Install the debs:
$ sudo dpkg -i koha-perldeps koha-deps koha-common
=> SUCCESS: Install process doesn't explode due to the addition
=> SUCCESS: /etc/koha/sites/test1/log4perl.conf has a new entry for log4perl.logger.z3950
=> SUCCESS: /etc/koha/sites/test2/log4perl.conf doesn't have a new entry for log4perl.logger.z3950
7. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Remove:
- BIB_INDEX_MODE and AUTH_INDEX_MODE env var
- bib_index_mode and auth_index_mode options from scripts
- Warnings from about page, just kept one if zebra_bib_index_mode or
zebra_auth_index_mode still exist in config and are set to grs1
Test plan:
- Install Koha from src
- Install Koha from pkg
- Read the code, carefully!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Rebased
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This is a workaround meant to correct upgrading installs.
We force the order by disable/enable.
Test plan:
[1] When upgrading an existing install, check that the startup order
after the upgrade has been corrected in /etc/rcX.d (say X=5).
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
If there are no instances already created on install/upgrade, the
koha-common.postinst script hungs in the absence of files to fix
and keeps waiting for user input.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patches the zebra configuration of existing Koha installations so
that their modulePath will work on newer Debian (and presumably Ubuntu)
releases.
Testing:
* Install a package built with this patch onto a system with instances
created by an older Koha version.
* Check that the files in /etc/koha/sites/*/zebra-*.cfg have the new
modulePath: directive rather than the old one.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
As the way we need to reference Apache instance names has now changed
between 2.2 and 2.4, we need to try it out both ways to make sure we get
it right.
This also allows koha-create/koha-disable to try the .conf version of
the name if the first one doesn't work.
To test:
* Create an instance on an Apache 2.2 system with koha < 3.16
* Upgrade to 3.16 with this patch, saying 'yes' to the renaming question
** Make sure you don't see the warning: Warning: problem enabling $site
in Apache
* Do a 'service apache2 restart'
* Make sure you can still access the instance
* Make sure that /etc/apache2/sites-enabled/instance.conf exists as a link
to /etc/apache2/sites-available/instance.conf
* Check that koha-create and koha-remove behave like you'd expect.
Note:
* If you need to make debconf forget that it asked you the question
about renaming so that it'll do it again, then run:
echo "unregister koha-common/rename-apache-vhost-files" | sudo debconf-communicate koha-common
* 'debconf-show koha-common' will show you the current debconf
configuration.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
There's no point asking the user if they want their Apache Koha
configuration updated if there's no configuration needing updated.
This also fixes a case where the updating would have failed when running
on Apache 2.4.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
I agree with adding that checks, and the conditions rewrite seems cleaner
than my first approach. So, I sign it.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch makes the install scripts take care of the new file
and prompt for user confirmation on the apache file renaming step.
Both prompt and the renaming actions depend on the fact that there
are instances with their files missing the .conf appendix.
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
As noted by Robin, STDOUT is used by the script to communicate with
debconf and, hence, the warning messages should be directed to STDERR.
This patch does that. To test:
- Set AUTOMATIC_TRANSLATIONS_UPDATE="no" so the warning normally shows
- Redirect STDOUT to /dev/null:
dpkg -i koha-common...deb > /dev/null
=> Warning message doesn't show (i.e. it is sent to STDOUT)
- Apply the patch, rebuild package
- Redirect STDOUT to /dev/null:
dpkg -i koha-common...deb > /dev/null
=> Warning message shows (i.e. is correctly sent to STDERR)
- Redirect STDERR to /dev/null:
dpkg -i koha-common...deb 2> /dev/null
=> Warning message doesn't show
- Verify that previous tests pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This causes a question to be asked at installation time as to whether
translations should be updated or not. The answer is written to the
config file, and stored in debconf. Effort is taken to ensure that if
the admin changes the config file, the update will be picked up and
reflected in debconf (i.e. that the admin's decision is always the
correct one.)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fixed two typos that made it fail and it worked like a charm.
Tested like this:
- Install the package
=> no errors, the file is created, defaults to 'yes'
- Install a language (koha-translate --install es-ES)
- Re-install the package (simulating an upgrade)
=> es-ES gets updated
- Set preference to 'no'
- Re-install
=> es-ES doesn't get updated, the warning is printed correctly
- Installed a second language (koha-translate --install pt-BR)
- did all the tests again
=> Success
Note: on master there are obvious template translation warnings.
A copy of the generated package can be grabbed from:
http://es.koha-community.org/koha-common_3.15+20140312172225.af7c0a23_all.deb
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch makes AUTOMATIC_TRANSLATIONS_UPDATE default to yes,
meaning that package upgrades will update the translations by
default. This seems definitely sensible for new installations,
but as there are some older installations that may be in the
habit directly editing generated translated templates, it's
less clear whether this is a good idea for upgrades.
This patch is intentionally separate, and can be ignored if
the consensus swings towards having AUTOMATIC_TRANSLATIONS_UPDATE
be off even for new installations or if somebody counter-patches
with adding debconf support.
To test:
- As with the previous patches in the series, except that the
translations would be automatically updated upon installing
the new package.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch creates a new master configuration file for the
koha-common package, and moves the AUTOMATIC_TRANSLATIONS_UPDATE
variable rather than leaving in in /etc/default/koha, which is meant
to be used for init script settings.
The configuration format is simple - a shell script that
sets variables and which can sourced by another script or
trivially parsed.
To test:
- Apply the patch series for bug 10942 and build a package.
- Install the package.
- Verify that a new config file, /etc/koha/koha-common.conf.
- Follow the rest of the test plan for the main page (e.g.,
set AUTOMATIC_TRANSLATIONS_UPDATE and force a package upgrade).
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds a new config variable AUTOMATIC_TRANSLATIONS_UPDATE at
/etc/default/koha-common that is used to control whether the upgrade
process should trigger a
$ koha-translate --update <lang_code>
command for each installed template translation language.
To test:
- Have a koha-common setup with some languages installed
(e.g. koha-translate --install es-ES)
- Apply the patch and build a package for it.
- Install it.
- A new AUTOMATIC_TRANSLATIONS_UPDATE config variable should be in place
at /etc/default/koha-common
- Set AUTOMATIC_TRANSLATIONS_UPDATE to 'yes'
- Re-install the package to trigger the post-install script
- Verify that translations get updated.
Edit: added a warning message for the case AUTOMATIC_TRANSLATIONS_UPDATE=no
and there are translations installed (so they need to get updated).
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Works as advertised, default behaviour doesn't change.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit does the following:
* Merge the changelog from the releases of 3.2
* Adds a command 'koha-upgrade-to-3.4' that does the MARC item splitting
stuff.
* Adds a debconf note to make sure people know that they need to run
the above command.
* Fixes the inclusion of jQuery in the packages.
* Makes build-git-snapshot build packages with a 3.5 version.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
If the new version of Koha requires a newer version of the database
schema, the Koha instances will work immediately after the package
is upgraded, rather than after the sysadmin has run koha-upgrade-schema
manually.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-common.postinst now creates a symlink to the Debian one.
The sysadmin may replace that manually with something that allows
Koha to access a remote mysql server.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>