[Bug 25752] New: Current directory not kept when using koha-create
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Bug ID: 25752 Summary: Current directory not kept when using koha-create Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz After bug 25538, after a koha-shell we are not longer in the current directory: root@cec7bffd8100:koha(master)$ pwd /kohadevbox/koha root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev kohadev-koha@cec7bffd8100:~$ pwd /var/lib/koha/kohadev -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |25538 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25538 [Bug 25538] koha-shell should pass --login to sudo if no command -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105884 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105884&action=edit Bug 25752: Stay in cwd after koha-shell After bug 25538, after a koha-shell we are not longer in the current directory: root@cec7bffd8100:koha(master)$ pwd /kohadevbox/koha root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev kohadev-koha@cec7bffd8100:~$ pwd /var/lib/koha/kohadev Test plan: Repeat the commands above and confirm that with this version of the script you get /kohadevbox/koha inside the koha-shell Search for possible regressions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105884|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106386&action=edit Bug 25752: Stay in cwd after koha-shell After bug 25538, after a koha-shell we are not longer in the current directory: root@cec7bffd8100:koha(master)$ pwd /kohadevbox/koha root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev kohadev-koha@cec7bffd8100:~$ pwd /var/lib/koha/kohadev Test plan: Repeat the commands above and confirm that with this version of the script you get /kohadevbox/koha inside the koha-shell Search for possible regressions Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, no obvious regressions. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Current directory not kept |Current directory not kept |when using koha-create |when using koha-shell -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I need it ASAP, maybe it will fix 00-testcritic (?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #4)
I need it ASAP, maybe it will fix 00-testcritic (?)
Not related, forget that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- With this patch, $ koha-shell $ pwd and $ koha-shell -c 'pwd' will return different results. Is that expected ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Looks ok for me With sudo: root@f62733f90b41:koha(BZ25752)$ sudo koha-shell kohadev kohadev-koha@f62733f90b41:/kohadevbox/koha$ pwd /kohadevbox/koha kohadev-koha@f62733f90b41:/kohadevbox/koha$ exit root@f62733f90b41:koha(BZ25752)$ sudo koha-shell kohadev -c pwd /kohadevbox/koha Without sudo: root@f62733f90b41:koha(BZ25752)$ koha-shell kohadev kohadev-koha@f62733f90b41:/kohadevbox/koha$ pwd /kohadevbox/koha root@f62733f90b41:koha(BZ25752)$ koha-shell kohadev -c pwd /kohadevbox/koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106386|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 106515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106515&action=edit Bug 25752: Stay in cwd after koha-shell After bug 25538, after a koha-shell we are not longer in the current directory: root@cec7bffd8100:koha(master)$ pwd /kohadevbox/koha root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev kohadev-koha@cec7bffd8100:~$ pwd /var/lib/koha/kohadev Test plan: Repeat the commands above and confirm that with this version of the script you get /kohadevbox/koha inside the koha-shell Search for possible regressions Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #7)
Looks ok for me
With sudo: root@f62733f90b41:koha(BZ25752)$ sudo koha-shell kohadev kohadev-koha@f62733f90b41:/kohadevbox/koha$ pwd /kohadevbox/koha kohadev-koha@f62733f90b41:/kohadevbox/koha$ exit root@f62733f90b41:koha(BZ25752)$ sudo koha-shell kohadev -c pwd /kohadevbox/koha
Without sudo: root@f62733f90b41:koha(BZ25752)$ koha-shell kohadev kohadev-koha@f62733f90b41:/kohadevbox/koha$ pwd /kohadevbox/koha root@f62733f90b41:koha(BZ25752)$ koha-shell kohadev -c pwd /kohadevbox/koha
Well, of course if you are running koha-shell from the home directory of kohadev-koha, the result will be the same. Try: # cd /tmp # koha-shell -c pwd # koha-shell # pwd -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Also, why are you using sudo when you are already root ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #9)
Try: # cd /tmp # koha-shell -c pwd # koha-shell # pwd
Forgot the instance name. I meant: root@localhost# cd /tmp root@localhost# koha-shell -c pwd kohadev root@localhost# koha-shell kohadev koahdev-koha@localhost$ pwd -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Sorry Julian I cannot retest right now. $HOME for kohadev-koha is /var/lib/koha/kohadev, that's why we are landing there without this patch. I tried with sudo to test the behaviour of the 'kshell' alias. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- root@615331e1369d:koha(master)$ cd /tmp root@615331e1369d:tmp$ koha-shell -c pwd kohadev /tmp root@615331e1369d:tmp$ koha-shell kohadev kohadev-koha@615331e1369d:/tmp$ pwd /tmp -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #13)
root@615331e1369d:koha(master)$ cd /tmp root@615331e1369d:tmp$ koha-shell -c pwd kohadev /tmp root@615331e1369d:tmp$ koha-shell kohadev kohadev-koha@615331e1369d:/tmp$ pwd /tmp
Sorry, I misread the patch. The problem is with the --login option: # cwd is /home/koha/env/master/src # user test-koha created by hand so $HOME is different than with package install % debian/scripts/koha-shell --login -c pwd test /home/test-koha % debian/scripts/koha-shell --login test % pwd /home/koha/env/master/src Compare with sudo: # cwd is /home/koha/env/master/src % sudo --login -u test-koha pwd /home/test-koha % sudo --login -u test-koha % pwd /home/test-koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|20.11.00 |20.11.00, 20.05.02 released in| | Status|Pushed to master |Pushed to stable --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- I can't seem to reproduce the bug in 19.11.x so I won't backport. Let me know if it does need to be backported. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #18 from Victor Grousset/tuxayo <victor@tuxayo.net> --- I think I remember not having this bug in 19.11.x when I tried it once. But anyone now it's affected. Backported to 19.11.x branch for 19.11.13 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25752 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00, 20.05.02 |20.11.00, 20.05.02, released in| |19.11.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org