Bug 15012

Summary: koha-shell raises " no job control in shell" error
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Command-line UtilitiesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, gmcharlt, kyle.m.hall, liz, mtj, robin, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15012: use sudo instead of su in koha-shell
Bug 15012: use sudo instead of su in koha-shell
Bug 15012: use sudo instead of su in koha-shell

Description Jonathan Druart 2015-10-14 13:44:46 UTC
vagrant@kohadevbox:kohaclone(master)$ sudo koha-shell kohadev
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
kohadev-koha@kohadevbox:/home/vagrant/kohaclone
Comment 1 Jonathan Druart 2015-10-14 13:48:17 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2015-10-14 13:54:19 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2015-10-14 13:55:31 UTC
*** Bug 14901 has been marked as a duplicate of this bug. ***
Comment 4 Tomás Cohen Arazi 2015-10-14 13:56:03 UTC
*** Bug 11775 has been marked as a duplicate of this bug. ***
Comment 5 Robin Sheat 2015-10-15 03:46:19 UTC
This looks like it could be good. Seems faster than waiting on whoever to fix su, anyway.
Comment 6 Robin Sheat 2015-10-22 02:54:13 UTC
Created attachment 43727 [details] [review]
Bug 15012: use sudo instead of su in koha-shell

Not sure this is the best way to fix it but it looks to work.

Test plan:
  sudo koha-shell kohadev
should not return any error
Without this patch, you should get
  bash: cannot set terminal process group (-1): Inappropriate ioctl for device
  bash: no job control in this shell

Confirm that other options work as before

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Works as expected. Tested on kohadevbox:ansible.
KOHA_CONF and PERL5LIB are correctly set on the child shell.
Bonus point: koha-shell doesn't die if the user issues Ctrl+C to abort an execution.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Comment 7 Tomás Cohen Arazi 2015-10-22 03:05:06 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 8 Chris Cormack 2015-10-24 08:35:11 UTC
Pushed to 3.20.x will be in 3.20.5
Comment 9 Liz Rea 2015-11-02 21:14:39 UTC
Pushed to 3.18.x, is in 3.18.12.