Bugzilla – Attachment 43402 Details for
Bug 15012
koha-shell raises " no job control in shell" error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15012: use sudo instead of su in koha-shell
Bug-15012-use-sudo-instead-of-su-in-koha-shell.patch (text/plain), 1.88 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-10-14 13:54:19 UTC
(
hide
)
Description:
Bug 15012: use sudo instead of su in koha-shell
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-10-14 13:54:19 UTC
Size:
1.88 KB
patch
obsolete
>From c58768334a1f490dd0bca4a6730e542349e883de Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Oct 2015 13:45:24 +0000 >Subject: [PATCH] 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. >--- > debian/scripts/koha-shell | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/debian/scripts/koha-shell b/debian/scripts/koha-shell >index 8d05b51..b8d92f5 100755 >--- a/debian/scripts/koha-shell >+++ b/debian/scripts/koha-shell >@@ -42,18 +42,18 @@ my $shell = $opts{shell} || $ENV{SHELL} || '/bin/sh'; > > # Now we're set up, build the 'su' command > my @su_args; >-push @su_args, '/bin/su'; >-push @su_args, '--preserve-environment' if $opts{'preserve-environment'}; >+push @su_args, '/usr/bin/sudo'; >+push @su_args, '--preserve-env' if $opts{'preserve-environment'}; > push @su_args, '--login' if $opts{login}; >-push @su_args, '--command', >+push @su_args, "-u", "$instance-koha"; >+push @su_args, > "env " > . "KOHA_CONF=/etc/koha/sites/$instance/koha-conf.xml " > . "PERL5LIB=/usr/share/koha/lib $shell" > . ( $opts{command} ? " -c '$opts{command}'" : '' ); >-push @su_args, "$instance-koha"; > > print "Command: '".join("' '",@su_args)."'\n" if $opts{verbose}; >-system(@su_args); >+system("@su_args"); > if ( $? == -1 ) { > print STDERR "failed to execute: $!\n"; > } >-- >2.6.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15012
:
43400
|
43402
|
43727