Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #261878

Re: apt-get aborts in subshell with redirections on Debian 12

From John Crawley <john@bunsenlabs.org>
Newsgroups linux.debian.user
Subject Re: apt-get aborts in subshell with redirections on Debian 12
Date 2023-09-25 05:00 +0200
Message-ID <HhJZf-blOm-3@gated-at.bofh.it> (permalink)
References <HhrSF-baRk-1@gated-at.bofh.it> <HhudP-bcpK-9@gated-at.bofh.it> <HhwyZ-bdIW-5@gated-at.bofh.it> <HhHup-bkoN-1@gated-at.bofh.it> <HhHNM-bkuD-3@gated-at.bofh.it>
Organization BunsenLabs

Show all headers | View raw


Thanks for the ideas!

On 25/09/2023 09:36, Greg Wooledge wrote:
> On Mon, Sep 25, 2023 at 09:10:28AM +0900, John Crawley wrote:
>> I just tried, and yes it runs OK when the commands are in a script.
>> But type directly into the terminal:
>>
>> errors=$(sudo apt-get install mirage 2>&1 1>/dev/tty)
>>
>> To see the immediate abort.
>> (But not on Debian 11, or after invoking 'sh'.)
> 
> I actually tested in a terminal, not with a script.  But the fact that
> *you* are getting different results with a script vs. a terminal is a
> clue.  It doesn't give us a complete answer, but it's definitely a
> significant observation.
> 
> The first thing you'll want to check is "type sudo", in your shell.
> 
> unicorn:~$ type sudo
> sudo is hashed (/usr/bin/sudo)

sudo is hashed (/usr/bin/sudo)

> If that doesn't give any further clues, you might look for unusual
> configuration in your interactive shell.  Things like a DEBUG trap,
> or the PROMPT_COMMAND or PS0 variables, which might trigger surprises
> when running commands, would be good to know about.

I don't think I've added anything like that - this is a fairly new test install.
I tried logging into a Ctrl+Alt+F2 tty and got the same results.
For a moment I thought it might be because it's a Qemu VM, so dragged out my old test laptop and the results are the same.

The only thing I can think of right now is that this (VM and laptop both) is an i386 system. Could it be bash is missing some 32 bit update?

Anyway, I tried these:

> 1) Run "bash --noprofile --norc" to get a vanilla shell, without any
>     aliases, functions, weird shopts, etc.  See if you still get the
>     undesired results.

Same undesired result.

> 2) Try in dash, ksh, zsh or whatever other shells you have.  See if you
>     get the undesired results in any shell other than bash.  (It looks
>     like you already tried in dash, assuming sh -> dash.)

Dash is OK. I installed and tried ksh and zsh and there was no problem there either.

> 3) Create a new user account with only the default dotfiles, and see
>     if you get the undesired results there.  (You may have to add it to
>     the sudo group.)

adduser tmp
adduser tmp sudo

Log in to tmp (no graphical session set up), and the results are the same: behaviour in a bash shell is wrong, everything else works.

So the 32bit system is different??

-- 
John

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-24 09:40 +0200
  Re: apt-get aborts in subshell with redirections on Debian 12 Michel Verdier <mv524@free.fr> - 2023-09-24 12:10 +0200
    Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-24 14:40 +0200
      Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-25 02:20 +0200
        Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-25 02:40 +0200
          Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-25 05:00 +0200
            Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-25 05:20 +0200
            Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-25 05:50 +0200
              Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-25 06:40 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-25 13:30 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-26 04:40 +0200
              Re: apt-get aborts in subshell with redirections on Debian 12 Michael <ml@hemathor.de> - 2023-09-25 11:20 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-25 13:30 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-26 05:00 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 Greg Wooledge <greg@wooledge.org> - 2023-09-26 05:10 +0200
                Re: apt-get aborts in subshell with redirections on Debian 12 John Crawley <john@bunsenlabs.org> - 2023-09-26 05:20 +0200
                sudo+use_pty+urxvt+pipe [WAS: apt-get aborts in subshell with  redirections on Debian 12] John Crawley <john@bunsenlabs.org> - 2023-12-24 09:50 +0100

csiph-web