[Bug 25586] New: Something wrong with KOHA_HOME
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Bug ID: 25586 Summary: Something wrong with KOHA_HOME Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: mirko@abunchofthings.net -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com Summary|Something wrong with |Something wrong with |KOHA_HOME |KOHA_HOME (?) --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- debian/templates/koha-conf-site.xml.in: <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir> debian/koha-common.default:KOHA_HOME="/usr/share/koha" debian/scripts/koha-functions.sh: KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- KOHA_HOME can be: * /usr/share/koha # pkg install * /kohadevbox/koha # dev install (or another path ofc, the one in the intranetdir config) Weird thing: * debian/scripts/koha-plack 392 adjust_paths_dev_install $name 393 export DEV_INSTALL 394 export KOHA_HOME 395 PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer On a pkg install we don't have /usr/share/koha/installer or /usr/share/koha/lib/installer On a dev instal we don't have /kohadevbox/koha/lib -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105552&action=edit Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I was wondering what KOHA_HOME was about yesterday... Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset. Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@helsinki.fi Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105552|0 |1 is obsolete| | --- Comment #5 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 105573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105573&action=edit Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Cook from comment #4)
I was wondering what KOHA_HOME was about yesterday...
Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset.
Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location?
We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think adding more variables will help. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #7 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- KOHA_HOME is the place where intranetdir code is placed, I got this with grep:
koha-functions.sh: KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir)
So using KOHA_HOME is favourable in my opinion to be able to support installations with different installation paths. The user should be able to change only the paths in koha-conf.xml and stuff should work, now without this variable things don't work so the original patch should be extended to include also koha-plack and maybe other scripts. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #6)
(In reply to David Cook from comment #4)
I was wondering what KOHA_HOME was about yesterday...
Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset.
Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location?
We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think adding more variables will help.
This is not a new variable. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #8)
(In reply to Jonathan Druart from comment #6)
(In reply to David Cook from comment #4)
I was wondering what KOHA_HOME was about yesterday...
Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset.
Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location?
We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think adding more variables will help.
This is not a new variable.
KOHA_HOME is not (hence this bug report). David's suggestion was to add a new one. At least it's what I understood. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #9)
(In reply to Marcel de Rooy from comment #8)
(In reply to Jonathan Druart from comment #6)
(In reply to David Cook from comment #4)
I was wondering what KOHA_HOME was about yesterday...
Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset.
Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location?
We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think adding more variables will help.
This is not a new variable.
KOHA_HOME is not (hence this bug report). David's suggestion was to add a new one. At least it's what I understood.
I think you misunderstood me, Jonathan. I meant keeping the existing KOHA_HOME variable, but setting it differently (to make it easier to re-configure for dev environments and when using systemd services). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #11 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Please revisit this. It might not be relevant with the latest rewrites. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |RESOLVED Resolution|--- |WONTFIX -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #12 from David Cook <dcook@prosentient.com.au> --- If we look through the Koha codebase for KOHA_HOME, we can see that it's only used in the "debian/" files, and it gets set in 3-4 places: debian/koha-common.default:KOHA_HOME="/usr/share/koha" debian/koha-core.default:KOHA_HOME="/usr/share/koha" debian/scripts/koha-functions.sh: KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir) debian/scripts/koha-plack: local KOHA_HOME=$KOHA_HOME What I was saying before was that we could look to see if KOHA_HOME is set by an environmental variable before setting it, but... that could be error prone if you have different instances with different KOHA_HOME values. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #13 from David Cook <dcook@prosentient.com.au> --- Locally, I've created a Koha::Prosentient::Setup::Home module which dynamically finds the "Koha Home": #NOTE: See Catalyst->setup_home() #NOTE: See Mojo::Home->detect() sub detect { my ( $class, $home ) = @_; my $env_var = $ENV{KOHA_HOME}; if ($env_var) { $home = $env_var; } if ( !$home ) { my $koha_logical_root = File::Spec->catdir( File::Basename::dirname(__FILE__), File::Spec->updir, File::Spec->updir, File::Spec->updir, File::Spec->updir ); my $koha_real_root = Cwd::realpath($koha_logical_root); if ( -d $koha_real_root ) { $home = $koha_real_root; } } return $home; } Using Koha::Prosentient::Setup::Home->detect(), I find the application root/home, and then I can manipulate the @INC using "use lib @local_libs" to do things like add a directory for Koha modules at a system level (modules provided by Debian packages) and a directory for instance level Koha modules. I use Koha::Prosentient::Setup early in plack.psgi before any Koha-specific module is called, so that I can manipulate the @INC early and thus have my local modules loaded first, which allows me to override Koha modules or add extra Koha modules - which is especially useful when using things like Module::Pluggable. In the longer term, I think these would be wise additions to upstream Koha, as they'll make it easier to do local customisations/extensions while preserving core Koha. And it all comes back to a concept of "home" or "application root". -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- With the instance level modules, I use koha-conf.xml for a configurable per-instance directory, so it's really an opt-in experience. It would also be useful for "Bug 42870 - Make email transports pluggable" @Marcel: It's also what I'm thinking for "Bug 41932 - Allow optional zero-padding in items.cn_sort" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25586 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #13)
In the longer term, I think these would be wise additions to upstream Koha, as they'll make it easier to do local customisations/extensions while preserving core Koha.
I mean even if the Koha community doesn't go that route, I think that I'm going to start leaning more heavily in this direction for managing local customisations/extensions, and designing a mind to modularity, extensibility, etc. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org