From 20ec59e5e3d8e532bf22cfa7d696a6ceef9ecc42 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 9 Oct 2003 19:32:55 +0000 Subject: first try with /bin/bash which is available in move. specify --rcfile or else it'll try /.bashrc which doesn't exist, and miss good definitions from /etc/bashrc (aliases, home/end keys, etc) --- perl-install/install_any.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index dc2122c08..2d6a6f482 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -201,8 +201,6 @@ sub getNextStep() { sub spawnShell() { return if $::o->{localInstall} || $::testing; - -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; - fork() and return; $ENV{DISPLAY} ||= ":0"; #- why not :pp @@ -221,8 +219,12 @@ sub spawnShell() { ioctl(STDIN, c::TIOCSCTTY(), 0) or warn "could not set new controlling tty: $!"; - my $busybox = "/usr/bin/busybox"; - exec { -e $busybox ? $busybox : "/bin/sh" } "/bin/sh" or log::l("exec of /bin/sh failed: $!"); + my @args; -e '/etc/bashrc' and @args = qw(--rcfile /etc/bashrc); + foreach (qw(/bin/bash /usr/bin/busybox /bin/sh)) { + -x $_ or next; + exec { $_ } $_ =~ /busybox/ ? "/bin/sh" : $_, @args or log::l("exec of $_ failed: $!"); + } + die "cannot open shell"; } sub getAvailableSpace { -- cgit v1.2.1