Weird set -u error

2022-08-26 Thread Tim Woodall

$ cat Makefile.test
SHELL := /bin/bash -u
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:

all:
echo done
$ make -f Makefile.test
echo done
done
$ make -f Makefile.test | cat
echo done
/etc/bash.bashrc: line 7: PS1: unbound variable
done
$ cat <(make -f Makefile.test)
echo done
done
$


Why do I get that unbound variable error? (I know how to fix it, I just
don't understand why it only happens when I pipe the output)

And is this a bug? In make?

The only way I've managed to reproduce this other than as above is by
explictly sourcing /etc/bash.bashrc where there are a few places where
set -u can report unbound variables.

Tim



Re: Weird set -u error

2022-08-26 Thread Thomas Schmitt
Hi,

> $ cat Makefile.test
> SHELL := /bin/bash -u
> [...]
> /etc/bash.bashrc: line 7: PS1: unbound variable
> [...]
> Why do I get that unbound variable error?

According to a comment in /etc/bash.bashrc it tests for emptiness of PS1
in order to detect non-interactive shell sessions:

  # If not running interactively, don't do anything
  [ -z "$PS1" ] && return

See
  https://sources.debian.org/src/bash/5.2~rc2-2/debian/etc.bash.bashrc/#L6


It should rather test for the variable being set, rather than being empty.

Jumping ahead of more skilled experts i found in the web
  
https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
which brings me to a proposal for /etc/bash.bashrc

  [ -z "${PS1:+x}" ] && return

Testing it:

  $ bash -u

reports various "unbound variable".
Now test whether a non-empty PS1 is properly recognized

  $ [ -z "${PS1:+x}" ] && echo "empty"
  $

Now with undefined PS1:

  $ unset PS1

makes the prompt invisible, but

  [ -z "${PS1:+x}" ] && echo "empty"
  empty

and

  set PS1=
  [ -z "${PS1:+x}" ] && echo "empty"
  empty

Back to a visible prompt:

  PS1='$ '
  $ [ -z "${PS1:+x}" ] && echo "empty"
  $


Have a nice day :)

Thomas



Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> $ cat Makefile.test
> SHELL := /bin/bash -u
> MAKEFLAGS += --no-builtin-rules
> .SUFFIXES:
> 
> all:
> echo done
> $ make -f Makefile.test
> echo done
> done
> $ make -f Makefile.test | cat
> echo done
> /etc/bash.bashrc: line 7: PS1: unbound variable
^^^

[...]

> Why do I get that unbound variable error? (I know how to fix it, I just
> don't understand why it only happens when I pipe the output)

If I were you, I'd  go looking at your /etc/bashrc and see what's around
line 7. Mine says (line numbers added by me):

 6 # If not running interactively, don't do anything
 7 [ -z "$PS1" ] && return

...and indeed, bash -u complains there, because it tries to expand an
(unset) PS1 before checking it for emptyness.

> And is this a bug? In make?

Arguably it's a bug(let) in /etc/bash.bashrc. This would work better:

  [ -z "${PS1:-}" ] && return

But I'll defer to more shell-savvy people for a proper fix.

> The only way I've managed to reproduce this other than as above is by
> explictly sourcing /etc/bash.bashrc where there are a few places where
> set -u can report unbound variables.

I think this /is/ what you are seeing.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 10:01:06AM +0200, Thomas Schmitt wrote:
> Hi,
> 
> > $ cat Makefile.test
> > SHELL := /bin/bash -u
> > [...]
> > /etc/bash.bashrc: line 7: PS1: unbound variable
> > [...]
> > Why do I get that unbound variable error?
> 
> According to a comment in /etc/bash.bashrc it tests for emptiness of PS1
> in order to detect non-interactive shell sessions:
> 
>   # If not running interactively, don't do anything
>   [ -z "$PS1" ] && return
> 
> See
>   https://sources.debian.org/src/bash/5.2~rc2-2/debian/etc.bash.bashrc/#L6
> 
> 
> It should rather test for the variable being set, rather than being empty.
> 
> Jumping ahead of more skilled experts i found in the web
>   
> https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
> which brings me to a proposal for /etc/bash.bashrc
> 
>   [ -z "${PS1:+x}" ] && return

[...]

Ah, great minds think alike :)

Why {PS1:+x} rather than {PS1:-}?

(Not a rethorical question: I think I can learn more shell programming
from you than the other way around)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread Tim Woodall

On Fri, 26 Aug 2022, to...@tuxteam.de wrote:


On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:

$ cat Makefile.test
SHELL := /bin/bash -u
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:

all:
echo done
$ make -f Makefile.test
echo done
done
$ make -f Makefile.test | cat
echo done
/etc/bash.bashrc: line 7: PS1: unbound variable

   ^^^

[...]


Why do I get that unbound variable error? (I know how to fix it, I just
don't understand why it only happens when I pipe the output)


If I were you, I'd  go looking at your /etc/bashrc and see what's around
line 7. Mine says (line numbers added by me):


Yes, I know how to fix it. That is straight forward. SUDO_USER and
SUDO_PS1 have similar issues, debian_chroot works in the presence of set
-u

But I don't understand why /etc/bash.bashrc is being sourced by make
when piping make through cat. Make is doing something like:

source /etc/bash.bashrc; bash -c 'echo done' - but only when the output
is to a pipe.

bash -uc 'echo done'
doesn't have the problem whether or not it is outputting to a pipe.

Tim



Re: Bookworm: Firefox v102 seems to be hanging quite often

2022-08-26 Thread Dekks Herton
local10  writes:

> Aug 25, 2022, 09:07 by dekkz...@gmail.com
>
>> Yes all fine here
>>
>> Version: 102.1.0esr-2
>>
>
>
> Are you using NoScript or uBlock Origin plugins? Both? Thanks

Yes to both as i replied.

Regards...



Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 09:19:03AM +0100, Tim Woodall wrote:

[...]

> Yes, I know how to fix it. That is straight forward. SUDO_USER and
> SUDO_PS1 have similar issues, debian_chroot works in the presence of set
> -u

I see.

> But I don't understand why /etc/bash.bashrc is being sourced by make
> when piping make through cat. Make is doing something like:

The shell must be thinking that it is interactive. I'm a bit pressed at
the moment, so I'll have to leave the "why" as an exercise...  you know
:)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread Thomas Schmitt
Hi,

to...@tuxteam.de wrote:
> Why {PS1:+x} rather than {PS1:-}?

It seemed to be the nearest suitable variation which was similar to the
proposal
  [ ${var+x} ]
in
  
https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
where one can see a nice table of ${VARIABLE...} tricks:
  parameter expansion   VARIABLE setVARIABLE empty  VARIABLE unset
  ...
>From the hint that it is defined by POSIX i got to the table at
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
under "2.6.2 Parameter Expansion".


As stated at other occasions, my shell mindset is still from the late 1980s
when the choice was Bourne shell or C shell. When newer skills are needed,
i search the web or look into my own existing scripts.


Have a nice day :)

Thomas



Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> Hi,
> 
> to...@tuxteam.de wrote:
> > Why {PS1:+x} rather than {PS1:-}?
> 
> It seemed to be the nearest suitable variation which was similar to the
> proposal
>   [ ${var+x} ]

[...]

Thanks :)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Hibernation issue [was: Bookworm : graphic glitches all over my screen after upgrade]

2022-08-26 Thread rudu

  bthLe 25/08/2022 à 23:51, piorunz a écrit :

On 25/08/2022 09:13, rudu wrote:

Le 24/08/2022 à 22:32, piorunz a écrit :

Looking at your kernel version, why you are running two years old
kernel? Support for this kernel has ended upstream, your system is
vulnerable to security issues.



That's because I experienced hibernation issues from this kernel up.
The screen shuts down ok, but the power never goes off, I have to use
the button.
And next boot is a standard one.
Don't know where to look for a clue here.

Regards
Rudu



That's very sad to hear.
Have you tried to report this to Debian BTS?
How about LTS kernel 5.10? That didn't worked either?

You are on Debian Testing and using older kernel than Debian Stable,
that's very uncommon.


You should be right, but after booting on both 5.10 kernels I found in 
my repositories :
ii  linux-image-5.10.0-13-amd64  5.10.106-1   amd64 Linux 5.10 
for 64-bit PCs (signed)
ii  linux-image-5.10.0-16-amd64  5.10.127-1   amd64 Linux 5.10 
for 64-bit PCs (signed)


... the hibernation process fails as described above ...

With Linux birdynam 5.7.0-3-amd64 #1 SMP Debian 5.7.17-1 (2020-08-23) 
x86_64 GNU/Linux hibernation works as expected.


Rudu



Re: Weird set -u error

2022-08-26 Thread David
On Fri, 26 Aug 2022 at 18:02,  wrote:
> On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:

> > $ cat Makefile.test
> > SHELL := /bin/bash -u
> > MAKEFLAGS += --no-builtin-rules
> > .SUFFIXES:
> >
> > all:
> > echo done
> > $ make -f Makefile.test
> > echo done
> > done
> > $ make -f Makefile.test | cat
> > echo done
> > /etc/bash.bashrc: line 7: PS1: unbound variable
> ^^^
> > Why do I get that unbound variable error? (I know how to fix it, I just
> > don't understand why it only happens when I pipe the output)

Hi, I'm no expert, but I would explain this as follows.

> > $ make -f Makefile.test

In the above command, make runs an interactive shell, because its standard
output is connected to a terminal.

> > $ make -f Makefile.test | cat

Whereas in the above command, make runs a non-interactive shell, because
it is in a pipeline so its standard output is not connected to a terminal,
but rather to the standard input of the 'cat' command.

PS1 is unbound in the second case because when the shell starts in
non-interactive mode, it does not set PS1.

The behaviour of interactive shells is explained in the three pages
linked here:
  https://www.gnu.org/software/bash/manual/html_node/Interactive-Shells.html

You can find expert responses on this topic by asking the mailing list:
  https://lists.gnu.org/mailman/listinfo/help-bash

>   [ -z "${PS1:-}" ] && return
>
> But I'll defer to more shell-savvy people for a proper fix.

Regarding the side discussion of how to test whether a bash shell is
interactive, both bash and dash shells provide the 'i' flag inside the
special variable $- (hyphen) for precisely this purpose.

So I would be inclinded to use that, rather than the old way of examining
$PS1. Unlikely, but possible, that some bizarre user has unset their $PS1
variable.

Some bash project documentation on this topic is here:
  
https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html



Debian 11 - KDE and NumLock

2022-08-26 Thread Amn

Hi there!!
Every time I restart my Acer Aspire E5-771G running Debian 11 I find 
that NumLock is off, is there a way to set up Deb11 to automatically 
turn on the NumLock?

Thanks.



Re: Weird set -u error

2022-08-26 Thread Tim Woodall





On Fri, Aug 26, 2022 at 09:19:03AM +0100, Tim Woodall wrote:

[...]


Yes, I know how to fix it. That is straight forward. SUDO_USER and
SUDO_PS1 have similar issues, debian_chroot works in the presence of set
-u


I see.


But I don't understand why /etc/bash.bashrc is being sourced by make
when piping make through cat. Make is doing something like:


The shell must be thinking that it is interactive. I'm a bit pressed at
the moment, so I'll have to leave the "why" as an exercise...  you know
:)


Thanks! I'd been trying -l but

$ bash -uic 'echo done'
bash: SUDO_USER: unbound variable
bash: color_prompt: unbound variable
done
$

Interesting that make is creating an interactive shell when its output
is redirected!

Tim.



Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> $ cat Makefile.test
> SHELL := /bin/bash -u

WHY?!

> Why do I get that unbound variable error?

Because you turned on set -u in a place where the code had not been
adjusted to account for set -u's foibles.

set -u breaks scripts.  It's not as bad as set -e (nothing is that bad),
but it's still a dramatic change to the shell's behavior, and some
perfectly legitimate code *will* break.


On Fri, Aug 26, 2022 at 10:01:06AM +0200, Thomas Schmitt wrote:
> According to a comment in /etc/bash.bashrc it tests for emptiness of PS1
> in order to detect non-interactive shell sessions:
> 
>   # If not running interactively, don't do anything
>   [ -z "$PS1" ] && return
> 
> It should rather test for the variable being set, rather than being empty.

If you're testing whether a shell is interactive, the *proper* way is
to check for the presence of "i" in the "$-" special parameter:

case $- in *i*) :;; *) return;; esac

Or, bash only:

[[ $- = *i* ]] || return

Testing whether PS1 is set is a *hack* and it will fail (giving false
positives) if the user has exported the PS1 variable.  Which some people
do.

>   $ [ -z "${PS1:+x}" ] && echo "empty"

The ":" gives a positive result if the variable is defined but empty,
which may not be what you want.  Dunno, hard to guess why anyone would
want an empty PS1 variable, but I suppose it's possible.  People do weird
stuff all the time.


On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> to...@tuxteam.de wrote:
> > Why {PS1:+x} rather than {PS1:-}?
> 
> It seemed to be the nearest suitable variation which was similar to the
> proposal
>   [ ${var+x} ]

You *should* still use quotes here.  Yeah, you might be thinking, the
only possible expansions are the empty string or "x", and it handles
both of those correctly, but it's still a matter of principle and good
habits.  By omitting the quotes, you're forcing the shell to perform
word splitting and globbing steps on the result, which actually makes
it run more slowly, even when those steps don't change the result.



Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Fri, Aug 26, 2022 at 11:14:37AM +0100, Tim Woodall wrote:
> $ bash -uic 'echo done'
> bash: SUDO_USER: unbound variable
> bash: color_prompt: unbound variable
> done
> $

Cute.  Mine's even weirder:

unicorn:~$ bash -uic 'echo done'
bash: SUDO_USER: unbound variable
bash: no: unbound variable
done

It turns out, this is due to the following line in my .bashrc:

MAILCHECK=no

I can't even remember putting that in there.  Here's what the man page
says:

   MAILCHECK
  Specifies  how often (in seconds) bash checks for mail.  The de‐
  fault is 60 seconds.  When it is time to  check  for  mail,  the
  shell  does  so  before  displaying the primary prompt.  If this
  variable is unset, or set to  a  value  that  is  not  a  number
  greater than or equal to zero, the shell disables mail checking.

Apparently "not a number greater than or equal to zero" must not mean
what I thought it meant, at the time I wrote that line.

At some point, bash must have given MAILCHECK the "integer attribute",
which means that MAILCHECK=no is attempting assignment to an *arithmetic*
variable, which means it performs a recursive expansion on the word "no"
in an arithmetic context -- which makes it treat "no" as a shell variable
to be expanded.  Hence the complaint from -u.

Without -u, and without a "no" variable, the effect is basically
MAILCHECK=0 which is clearly not what I wanted.

Fortunately, it's entirely moot, because in context, I have this:

MAILCHECK=no
unset MAILCHECK # Takes too damned long.

I guess I should just comment out the first line, then.  There's no point
keeping it there.

So, today I guess I learned that MAILCHECK gained the integer attribute
at some point.  I wonder when... well, let's find out.

...
unicorn:~$ bash-3.1 -uic :
bash-3.1: no: unbound variable
unicorn:~$ bash-3.0 -uic :
unicorn:~$ 

Looks like it happened in bash 3.1.

*Now* I'll comment out that line in my .bashrc.



Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
> On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> > $ cat Makefile.test
> > SHELL := /bin/bash -u
> 
> WHY?!
> 
> > Why do I get that unbound variable error?
> 
> Because you turned on set -u in a place where the code had not been
> adjusted to account for set -u's foibles.
> 
> set -u breaks scripts.  It's not as bad as set -e (nothing is that bad),
> but it's still a dramatic change to the shell's behavior, and some
> perfectly legitimate code *will* break.

Yeah, but the interesting question still remaining is why a
call to a shell from a makefile is interactive in the first
place (otherwise it wouldn't be sourcing /etc/bash.bashrc,
which is what's triggering the error).

Perhaps an academic exercise, I don't know.

[...]

> >   [ -z "$PS1" ] && return
> > 
> > It should rather test for the variable being set, rather than being empty.
> 
> If you're testing whether a shell is interactive, the *proper* way is
> to check for the presence of "i" in the "$-" special parameter:
> 
> case $- in *i*) :;; *) return;; esac
> 
> Or, bash only:
> 
> [[ $- = *i* ]] || return

Note that this "you" doesn't include the OP: the problematic test is
in /etc/bash.bashrc, which is Debian-provided code.

> Testing whether PS1 is set is a *hack* and it will fail (giving false
> positives) if the user has exported the PS1 variable.  Which some people
> do.
> 
> >   $ [ -z "${PS1:+x}" ] && echo "empty"
> 
> The ":" gives a positive result if the variable is defined but empty,
> which may not be what you want.  Dunno, hard to guess why anyone would
> want an empty PS1 variable, but I suppose it's possible.  People do weird
> stuff all the time.

---
> On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> > to...@tuxteam.de wrote:
> > > Why {PS1:+x} rather than {PS1:-}?
> > 
> > It seemed to be the nearest suitable variation which was similar to the
> > proposal
> >   [ ${var+x} ]
> 
> You *should* still use quotes here.  Yeah, you might be thinking, the
> only possible expansions are the empty string or "x", and it handles
> both of those correctly, but it's still a matter of principle and good
> habits.  By omitting the quotes, you're forcing the shell to perform
> word splitting and globbing steps on the result, which actually makes
> it run more slowly, even when those steps don't change the result.

To be fair, Thomas's recommendation, as well as mine both had the
quotes. Thomas was just quoting (heh) where he got his version from.

But all in all we're still "fixing" a package-provided script. Should
we file a bug against it? WDYT?

And then, there's that other riddle: why is a shell invoked from a
Makefile sourcing /etc/bash.bashrc in the first place?

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread David
On Fri, 26 Aug 2022 at 22:14,  wrote:

> And then, there's that other riddle: why is a shell invoked from a
> Makefile sourcing /etc/bash.bashrc in the first place?

Hi, my understanding is that the rule commands in the Makefile are run by
a shell, one for each line. The output stream of those commands is usually
stdout (unless redirected), to allow the user to see the output. The shell
detects that the command output is not redirected away from stdout, and so
it starts itself in interactive mode.

'man bash' says:

  When an interactive shell that is not a login shell is started, bash
  reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
  these files exist. This may be inhibited by using the --norc option.



Re: Weird set -u error

2022-08-26 Thread David
On Fri, 26 Aug 2022 at 22:14,  wrote:
> On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
> > On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:

[...]

> > On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> > > to...@tuxteam.de wrote:

> But all in all we're still "fixing" a package-provided script. Should
> we file a bug against it? WDYT?

In my opinion, the only "bug" is the user putting -u in the SHELL
definition contained in the Makefile. I haven't yet seen them
answer Greg's enquiry=WHY?!



Re: Weird set -u error

2022-08-26 Thread Tim Woodall

On Fri, 26 Aug 2022, David wrote:


On Fri, 26 Aug 2022 at 22:14,  wrote:


And then, there's that other riddle: why is a shell invoked from a
Makefile sourcing /etc/bash.bashrc in the first place?


Hi, my understanding is that the rule commands in the Makefile are run by
a shell, one for each line. The output stream of those commands is usually
stdout (unless redirected), to allow the user to see the output. The shell
detects that the command output is not redirected away from stdout, and so
it starts itself in interactive mode.

'man bash' says:

 When an interactive shell that is not a login shell is started, bash
 reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
 these files exist. This may be inhibited by using the --norc option.


But that's backwards, make is starting an interactive shell when its
output is redirected. When I don't redirect make's output it works.








Re: Weird set -u error

2022-08-26 Thread Tim Woodall

On Fri, 26 Aug 2022, David wrote:


On Fri, 26 Aug 2022 at 22:14,  wrote:

On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:

On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:


[...]


On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:

to...@tuxteam.de wrote:



But all in all we're still "fixing" a package-provided script. Should
we file a bug against it? WDYT?


In my opinion, the only "bug" is the user putting -u in the SHELL
definition contained in the Makefile. I haven't yet seen them
answer Greg's enquiry=WHY?!



I disagree with Greg.

The real Makefile has -euo pipefail - and works perfectly, even from
cron. I tend to use this in all scripts. -u in particular is useful for
picking up typos and -e makes it fail fast and early.

It's only when I attempted to redirect output that I spotted this.

The failure doesn't even break anything, it just creates noise on
stderr.

I might log a bug to fix /etc/bash.bashrc but I'm suspecting there's a
bug in make - and changing .bashrc will just hide the symptoms.

Tim.




Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Cindy Sue Causey
On 8/26/22, Amn  wrote:
> Hi there!!
> Every time I restart my Acer Aspire E5-771G running Debian 11 I find
> that NumLock is off, is there a way to set up Deb11 to automatically
> turn on the NumLock?


Hi.. You didn't name which desktop environment you're using so I'm
sharing what I found in LXQt. For this one, I can go to:

* Applications dropdown menu
* Preferences
* LXQt Settings
* Keyboard and Mouse
* Keyboard (lefthand column in window that pops up)
* Checkbox that says "Turn on NumLock after login

The main desktop environments *try* to follow a similar pattern for
very basic User features like that. Hopefully you'll be able to find a
similar path to success in whatever setup you're using.

As an aside that I've only recently tripped over myself: Searching the
Internet for tips like this sometimes leads to a way to add a line to
"dot" rc files that reside in our User /home directories. When we do
that, that's a handy feature that would carry across if we bind that
same home directory to different versions of Linux. As an example, I
once added terminal color tweaks that carry across.

The downside would go back to that same thing. Maybe we don't want to
carry that tweak across the various Linux flavors we use. Sometimes
doing so causes irritating glitches. I've experienced it with favorite
background images being blocked, just as a very simple example.

Glitches happen to me solely within Debian if my home directory is
used across e.g. both Bullseye and Bookworm. It's no big thing. It's
just about them being ever progressively different, period. Yay,
Developers!

Cindy :)
-- 
Talking Rock, Pickens County, Georgia, USA
* runs with birdseed *



Re: Weird set -u error

2022-08-26 Thread David
On Fri, 26 Aug 2022 at 23:41, Tim Woodall  wrote:
> On Fri, 26 Aug 2022, David wrote:
> > On Fri, 26 Aug 2022 at 22:14,  wrote:

> >> And then, there's that other riddle: why is a shell invoked from a
> >> Makefile sourcing /etc/bash.bashrc in the first place?
> >
> > Hi, my understanding is that the rule commands in the Makefile are run by
> > a shell, one for each line. The output stream of those commands is usually
> > stdout (unless redirected), to allow the user to see the output. The shell
> > detects that the command output is not redirected away from stdout, and so
> > it starts itself in interactive mode.
> >
> > 'man bash' says:
> >
> >  When an interactive shell that is not a login shell is started, bash
> >  reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
> >  these files exist. This may be inhibited by using the --norc option.
> >
> But that's backwards, make is starting an interactive shell when its
> output is redirected. When I don't redirect make's output it works.

As already stated, my guess is that while you might be redirecting the
make command line, there are no redirection operations in the commands
in the Makefile rules, so the the shells started by make are interactive.

Anyway, as I already suggested, if you ask your original question to
a mailing list of either the 'make' project [1] or the 'bash' project [2], then
the developers of these projects can give you a more authoritative answer
than the speculations of random Debian users such as myself.

[1] https://savannah.gnu.org/mail/?group=make
[2] https://savannah.gnu.org/mail/?group=bash



Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Fri, Aug 26, 2022 at 02:40:55PM +0100, Tim Woodall wrote:
> But that's backwards, make is starting an interactive shell when its
> output is redirected. When I don't redirect make's output it works.

I thought you were piping in the original message.  There is a difference
between a pipe, and a redirection.

You might want to test both, and see exactly which one(s) trigger this
behavior.  It's still not clear to me whether it's make(1) passing the
-i option for some reason, or bash incorrectly deciding that it should
read these startup files, based on whatever criteria it uses to sense
whether it's being run as an interactive shell.

There are also various hacks that are compiled into Debian's version
of bash, for example the one that reads the interactive startup files
if bash believes it's the child of an sshd daemon.  This is not the
default behavior of upstream bash, but most Linux distributions enable
this behavior because they believe, rightly or wrongly, that their users
bases expect it.

At this moment, I'm kind of leaning toward one of those hacks being
triggered by your specific combination of factors.



Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Fri, Aug 26, 2022 at 02:51:47PM +0100, Tim Woodall wrote:
> The real Makefile has -euo pipefail

I have stopped reading and caring now.  Good luck.



Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Andrew M.A. Cater
On Fri, Aug 26, 2022 at 06:14:36AM -0400, Amn wrote:

> Hi there!!
> Every time I restart my Acer Aspire E5-771G running Debian 11 I find that
> NumLock is off, is there a way to set up Deb11 to automatically turn on the
> NumLock?
> Thanks.
>

You may find that there's a setting in the firmware/BIOS. You may also find
that KDE has the equivalent of a Settings program.

You may find it easier to ask questions on the debian-user mailing list.

With every good wish, as ever,

Andy Cater
 



Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Cindy Sue Causey
On 8/26/22, Cindy Sue Causey  wrote:
> On 8/26/22, Amn  wrote:
>> Hi there!!
>> Every time I restart my Acer Aspire E5-771G running Debian 11 I find
>> that NumLock is off, is there a way to set up Deb11 to automatically
>> turn on the NumLock?
>
>
> Hi.. You didn't name which desktop environment you're using so I'm
> sharing what I found in LXQt. For this one, I can go to:
>
> * Applications dropdown menu
> * Preferences
> * LXQt Settings
> * Keyboard and Mouse
> * Keyboard (lefthand column in window that pops up)
> * Checkbox that says "Turn on NumLock after login
>
> The main desktop environments *try* to follow a similar pattern for
> very basic User features like that. Hopefully you'll be able to find a
> similar path to success in whatever setup you're using.


Ha, just saw that this did say which desktop environment. It was only
stated in the subject line, LOL. You could always search the Internet
for KDE specifically to see what pops, too.

Happy hacking!

Cindy :)
-- 
Talking Rock, Pickens County, Georgia, USA
* runs with birdseed *



Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Brad Rogers
On Fri, 26 Aug 2022 06:14:36 -0400
Amn  wrote:

Hello Amn,

In KDE's System Settings;

Hardware Section, Input Devices->Keyboard

You can Set On, Off or Leave Unchanged.  Also set keyboard model there,
too - Acer Laptop being one of the options.

-- 
 Regards  _
 / )  "The blindingly obvious is never immediately apparent"
/ _)rad   "Is it only me that has a working delete key?"
Cocaine, heroin, I never use speed, I never put the needle in
Keep it Clean - The Vibrators


pgpDi5LXJD3GU.pgp
Description: OpenPGP digital signature


Re: Weird set -u error

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:

[...]

> There are also various hacks that are compiled into Debian's version
> of bash [...]

> At this moment, I'm kind of leaning toward one of those hacks being
> triggered by your specific combination of factors.

That's the most convincing conjecture so far, I'd say :)

Cheers
-- 
t


signature.asc
Description: PGP signature


BlueTooth - Acer - Qualcomm Atheros

2022-08-26 Thread Amn

Hey there!!

As the subject suggests, this combo [BlueTooth - Acer - Qualcomm 
Atheros] is my problem.
But before going any further I'd like to leave clear that I am not, by 
any means, a Linux Power User [LPU], I just installed Debian 11 in my 
laptop and are now discovering the pros and cons of this OS, that's it!


After installing Debian 11 from an USB, I found out that the blue-tooth 
wasn't working, so searching the net I found this web pages that attempt 
to fix the issue, among them are :

/https://wiki.debian.org/BluetoothUser/a2dp//
//https://wiki.debian.org/SourcesList//
//https://www.reddit.com/r/linuxquestions/comments/meaxi5/bluetooth_not_working_in_debian_11///
//https://wiki.debian.org/BluetoothUser/a2dp#Pre-configuration//
//https://wiki.debian.org/PipeWire#Installation//
//https://unix.stackexchange.com/questions/559134/bluetooth-adapter-not-found-in-debian-buster/559147#559147/

and many more that are not worth mentioning.

I've learned that PulseAdio was not doing the trick in my laptop, so I 
tried PipeWire, but to no avail. Later I went deeper and installed the 
Qualcomm driver, since my Acer Aspire E5-771G has a 'Qualcomm Atheros 
AR956x Wireless Network Adapter' as suggested by - 
https://www.systranbox.com/how-to-install-atheros-wireless-driver-linux/ 
-. The result was catastrophic! Not only the blue-tooth did not work, 
but the WiFi was extremely slow.


Now I am open to anyone's suggestions to get the blue-tooth to work, it 
worked under MS, therefore, I know the hardware if functional


I have tried :

sudo iwconfig
lo    no wireless extensions.

enp4s0    no wireless extensions.

wlp5s0    IEEE 802.11  ESSID:"BELL419"
Mode:Managed Frequency:2.462 GHz  Access Point: 54:64:D9:39:D2
:4F
 Bit Rate=150 Mb/s   Tx-Power=18 dBm
 Retry short limit:7   RTS thr:off   Fragment thr:off
 Encryption key:off
 Power Management:off
 Link Quality=56/70  Signal level=-54 dBm
 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
 Tx excessive retries:2  Invalid misc:474   Missed beacon:0

/

sudo lshw -C network
sudo: lshw: command not found

//

rfkill list all
0: phy0: Wireless LAN
   Soft blocked: no
   Hard blocked: no
1: acer-wireless: Wireless LAN
   Soft blocked: no
   Hard blocked: no
2: acer-bluetooth: Bluetooth
   Soft blocked: no
   Hard blocked: no

/Thanks for any help you could provide me with./


Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Porter Smith
Could you please provide us with more  information.Such as  excerpts of log 
files and dmsg.
Thanks,
Chip

On August 26, 2022 3:14:36 AM PDT, Amn  wrote:
>Hi there!!
>Every time I restart my Acer Aspire E5-771G running Debian 11 I find that 
>NumLock is off, is there a way to set up Deb11 to automatically turn on the 
>NumLock?
>Thanks.
>


Re: BlueTooth - Acer - Qualcomm Atheros

2022-08-26 Thread Alexander V. Makartsev

On 26.08.2022 21:24, Amn wrote:


Hey there!!

As the subject suggests, this combo [BlueTooth - Acer - Qualcomm 
Atheros] is my problem.
But before going any further I'd like to leave clear that I am not, by 
any means, a Linux Power User [LPU], I just installed Debian 11 in my 
laptop and are now discovering the pros and cons of this OS, that's it!


After installing Debian 11 from an USB, I found out that the 
blue-tooth wasn't working, so searching the net I found this web pages 
that attempt to fix the issue, among them are



There is pretty good ArchWiki page about Bluetooth setup. [1]
Basically, first you need to install bluetooth stack provided by BlueZ 
and install firmware for your hardware, before you will proceed to the 
other things, like changing PulseAudio config.

To install bluetooth stack:
$ sudo apt install bluetooth bluez bluez-tools bluez-firmware blueman
And to install firmware (from non-free section [2] ):
  $ sudo apt install firmware-atheros

To check if there is a Bluetooth adapter:
    $ hciconfig -a

If there is an adapter, you can use GUI application "Bluetooth Manager" 
for an additional setup and BT device pairing.



You can also install additional packages that will help to gather 
information about your hardware:

  $ sudo apt install lshw pciutils usbutils inxi

They will provide "lshw", "lspci", "lsusb", "inxi" console utilities.


[1] https://wiki.archlinux.org/title/bluetooth
[2] https://wiki.debian.org/SourcesList

--
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄



Re: Hibernation issue [was: Bookworm : graphic glitches all over my screen after upgrade]

2022-08-26 Thread piorunz

On 26/08/2022 10:18, rudu wrote:


You should be right, but after booting on both 5.10 kernels I found in
my repositories :
ii  linux-image-5.10.0-13-amd64  5.10.106-1   amd64 Linux 5.10
for 64-bit PCs (signed)
ii  linux-image-5.10.0-16-amd64  5.10.127-1   amd64 Linux 5.10
for 64-bit PCs (signed)

... the hibernation process fails as described above ...

With Linux birdynam 5.7.0-3-amd64 #1 SMP Debian 5.7.17-1 (2020-08-23)
x86_64 GNU/Linux hibernation works as expected.


I suggest you should report this error as soon as possible.

--
With kindest regards, Piotr.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄



Debian 11, Chrome and .asp pages

2022-08-26 Thread tony mollica

Good morning (Mountain time).

Here's the problem I'm having.  Debian is so stable that issues I've resolved 
years ago took place so far back and with no issues that I forget how I did it. 
So it is with this latest issue.  The problem is I need to log into a router and 
make some changes, preferably using my Linux laptop.  I can log in but several 
of the configuration pages are in the .asp format and my Chrome or Firefox 
browsers running on a fresh Debian 11 install won't display the pages and gives 
me a 404 error.  What is my Debian install missing to allow my to access these 
pages.  There's no problem using Debian10, only 11 and also no issues using the 
'other' OS.


Guidance please.

Thanks,
Tony



Re: Debian 11, Chrome and .asp pages

2022-08-26 Thread tomas
On Fri, Aug 26, 2022 at 11:37:41AM -0600, tony mollica wrote:
> Good morning (Mountain time).
> 
> Here's the problem I'm having.  Debian is so stable that issues I've
> resolved years ago took place so far back and with no issues that I forget
> how I did it. So it is with this latest issue.  The problem is I need to log
> into a router and make some changes, preferably using my Linux laptop.  I
> can log in but several of the configuration pages are in the .asp format and
> my Chrome or Firefox browsers running on a fresh Debian 11 install won't
> display the pages and gives me a 404 error.  What is my Debian install
> missing to allow my to access these pages.  There's no problem using
> Debian10, only 11 and also no issues using the 'other' OS.

Hm. .asp is a server-side thing (i.e. the server transforms whatever into
html and serves it). It's Microsoft's version of CGI, back from last century.

The 404 is also a server-side thing (i.e. at the router side). Your Linux
laptop isn't involved in that, it's just reporting what it "sees".

Thus, can't be at the root of the 404. You'll have to describe in more detail
what is going on.

That might take some back-and-forth.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Felix Miata
Amn composed on 2022-08-26 06:14 (UTC-0400):

> Every time I restart my Acer Aspire E5-771G running Debian 11 I find 
> that NumLock is off, is there a way to set up Deb11 to automatically 
> turn on the NumLock?

There are many opportunities for NUM to be toggled. For those this frustrates:

1-Ensure BIOS is set for numlock ON

2-The kernel ruthlessly turns off NUM. This can be countered by enabling

numlock.service

# systemctl cat numlock.service
# /etc/systemd/system/numlock.service
[Unit]
Description=numlock

[Service]
ExecStart=/usr/local/bin/numlock
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

3-Alone 1 & 2 may not be sufficient. If using LightDM as login greeter, you may
need to install numlockx package and add to its config file:

greeter-setup-script=/usr/bin/numlockx on

If using SDDM as greeter, /etc/sddm.conf needs added:

Numlock=on

4-Regardless of 1-3, NUM can be turned on for Plasma sessions via systemsettings
as described by Brad's response re Plasma keyboard settings in hardware section.
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata



networking.service: start operation timed out

2022-08-26 Thread Ross Boylan
In Debian 11/bullseye my system keeps reporting timeouts while trying
to bring up the first non-loopback interface.  According to ip, the
interface actually is up, but ifup/down do not know that.  My 2nd
interface is down, and there is no mention of attempting to bring it
up in the logs.  I can bring up both interfaces after startup,
suggesting there may be something special about the initial
environment that is causing trouble, but I don't know what.

I'd appreciate any suggestions about how to diagnose or cure the
problem.  I have set VERBOSE=yes in /etc/default/networking

When I started the errors were coming on a bridge interface;
suspecting a bridge-specific problem I disabled the bridge (comment
out the auto br0 in /etc/network/interface).  Now I have the exact
same problem with a vanilla declaration for a lan.

My machine has 2 physical ethernet ports, resolvconf, KDE,
network-manager, bridge-utils, tor, and nftables.  I have systemctl
disable'd NetworkManager and tor, though with no visible effect.
NetworkManager was mentioning the interfaces controlled by
/etc/network/interfaces, but it wasn't clearly doing anything to them,
and the default options do say to leave them alone.  I have customized
scripts for networking and resolvconf.

- /etc/network/interfaces

# The next directory is empty
# many posts about similar problems had an interfaces.d/setup file
causing trouble
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

rename enp5s0=ethlan
rename eno2=ethworld

auto ethlan
iface ethlan inet static
   address 192.168.1.10/24
   # not sure if it makes sense to be my own gateway
   # gateway 192.168.1.10
   broadcast 192.168.1.255
   dns-domain betterworld.us
   dns-search betterworld.us

#auto br0
iface br0 inet static
# details omitted, presumed irrelevant

auto ethworld
iface ethworld inet static
  address 66.181.128.36/24  # IP obscured
  gateway 66.181.128.1
  # I am my own nameserver, but next is a fallback
  dns-nameservers N.N.N.N
  pre-up /etc/network/rb-iface-manage up  # brings up firewall.
takes a few seconds.

  post-down /etc/network/rb-iface-manage down
  post-down ip route add default dev ethlan

---  journalctl -b -u networking

-- Journal begins at Thu 2022-05-19 12:21:39 PDT, ends at Fri
2022-08-26 11:58:07 PDT. --
Aug 26 11:55:19 barley ifup[1563]: /sbin/ip link set enp5s0 name ethlan
Aug 26 11:55:19 barley ifup[1563]: /sbin/ip link set eno2 name ethworld
Aug 26 11:55:19 barley ifup[1563]: /bin/run-parts --exit-on-error
--verbose /etc/network/if-pre-up.d
Aug 26 11:55:19 barley ifup[1573]: run-parts: executing
/etc/network/if-pre-up.d/bridge
Aug 26 11:55:19 barley ifup[1573]: run-parts: executing
/etc/network/if-pre-up.d/vde2
Aug 26 11:55:19 barley ifup[1573]: run-parts: executing
/etc/network/if-pre-up.d/wpasupplicant
Aug 26 11:55:18 barley systemd[1]: Starting Raise network interfaces...
Aug 26 11:55:19 barley ifup[1563]: ifup: configuring interface lo=lo (inet)
Aug 26 11:55:19 barley ifup[1563]: /bin/run-parts --exit-on-error
--verbose /etc/network/if-pre-up.d
Aug 26 11:55:19 barley ifup[1583]: run-parts: executing
/etc/network/if-pre-up.d/bridge
Aug 26 11:55:19 barley ifup[1583]: run-parts: executing
/etc/network/if-pre-up.d/vde2
Aug 26 11:55:19 barley ifup[1583]: run-parts: executing
/etc/network/if-pre-up.d/wpasupplicant
Aug 26 11:55:19 barley ifup[1563]: /sbin/ip link set dev lo up
Aug 26 11:55:19 barley ifup[1563]: /bin/run-parts --exit-on-error
--verbose /etc/network/if-up.d
Aug 26 11:55:19 barley ifup[1590]: run-parts: executing
/etc/network/if-up.d/000resolvconf
Aug 26 11:55:19 barley ifup[1590]: run-parts: executing
/etc/network/if-up.d/bind9
Aug 26 11:55:20 barley ifup[1590]: run-parts: executing
/etc/network/if-up.d/chrony
Aug 26 11:55:20 barley ifup[1590]: run-parts: executing
/etc/network/if-up.d/wpasupplicant
Aug 26 11:55:20 barley ifup[1563]: ifup: configuring interface
ethlan=ethlan (inet)
Aug 26 11:55:20 barley ifup[1563]: /bin/run-parts --exit-on-error
--verbose /etc/network/if-pre-up.d
Aug 26 11:55:20 barley ifup[1658]: run-parts: executing
/etc/network/if-pre-up.d/bridge
Aug 26 11:55:20 barley ifup[1658]: run-parts: executing
/etc/network/if-pre-up.d/vde2
Aug 26 11:55:20 barley ifup[1658]: run-parts: executing
/etc/network/if-pre-up.d/wpasupplicant
Aug 26 11:55:20 barley ifup[1563]: /sbin/ip addr add
192.168.1.10/255.255.255.0 broadcast 192.168.1.255   dev
ethlan label ethlan
Aug 26 11:55:20 barley ifup[1563]: /sbin/ip link set dev ethlan   up
Aug 26 11:55:20 barley ifup[1563]: /bin/run-parts --exit-on-error
--verbose /etc/network/if-up.d
Aug 26 11:55:20 barley ifup[1680]: run-parts: executing
/etc/network/if-up.d/000resolvconf
Aug 26 11:56:18 barley systemd[1]: networking.service: start operation
timed out. Terminating.
Aug 26 11:56:18 barley ifup[1

Re: networking.service: start operation timed out

2022-08-26 Thread Andrew M.A. Cater
On Fri, Aug 26, 2022 at 03:06:24PM -0700, Ross Boylan wrote:
> In Debian 11/bullseye my system keeps reporting timeouts while trying
> to bring up the first non-loopback interface.  According to ip, the
> interface actually is up, but ifup/down do not know that.  My 2nd
> interface is down, and there is no mention of attempting to bring it
> up in the logs.  I can bring up both interfaces after startup,
> suggesting there may be something special about the initial
> environment that is causing trouble, but I don't know what.
> 
> I'd appreciate any suggestions about how to diagnose or cure the
> problem.  I have set VERBOSE=yes in /etc/default/networking
> 

Cut /etc/network/interfaces down to the lo stanza

# The loopback network interface
auto lo
iface lo inet loopback

Remove EVERYTHING else.

Use Network Manager / nmtui / nmcli to build back what you need slowly

If you have interfaces mentioned in /etc/network/interfaces - the old way -
you will face problems.

Hand editing the files is probably not the way to do this any more.

>

Hope this helps,

With every good wish, as ever,

Andy Cater 



Re: Weird set -u error

2022-08-26 Thread Tim Woodall

On Fri, 26 Aug 2022, to...@tuxteam.de wrote:


On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:

[...]


There are also various hacks that are compiled into Debian's version
of bash [...]



At this moment, I'm kind of leaning toward one of those hacks being
triggered by your specific combination of factors.


That's the most convincing conjecture so far, I'd say :)



It's bash:

$ bash -uc :
$ ( bash -uc : )
'PS1='
/etc/bash.bashrc: line 8: PS1: unbound variable
$ ( bash -uc : ; : )
$

I modified /etc/bash.bashrc to prove it was only being sourced in the
second case above (it prints the value of PS1)

And now I can reproduce without -u
$ bash -c :
$ ( bash -c : )
'PS1='
$ ( bash -c : ; : )
$



Re: networking.service: start operation timed out

2022-08-26 Thread Felix Miata
Ross Boylan composed on 2022-08-26 15:06 (UTC-0700):

> I'd appreciate any suggestions about how to diagnose or cure the problem.

I switched most of my static installations to systemd-networkd.service last 
year:
# inxi -Snz
System:
  Kernel: 5.10.0-17-amd64 arch: x86_64 bits: 64 Console: pty pts/0
Distro: Debian GNU/Linux 11 (bullseye)
Network:
  Device-1: Intel Ethernet I219-V driver: e1000e
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 
# systemctl list-unit-files | egrep 'netw|solv'
dbus-org.freedesktop.network1.service  alias   -
networking.service disabledenabled
systemd-network-generator.service  disableddisabled
systemd-networkd-wait-online.service   disableddisabled
systemd-networkd.service   enabled enabled
systemd-resolved.service   disabledenabled
systemd-networkd.socketenabled enabled
network-online.target  static  -
network-pre.target static  -
network.target static  -
# ls -gG /etc/systemd/network
total 4
-rw-r--r-- 1 147 Jun 13  2021 eth0.network
# ls -gG /etc/resolv.conf
-rw-r--r-- 1 233 Nov 30  2020 /etc/resolv.conf
#
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata



Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Fri, Aug 26, 2022 at 11:54:06PM +0100, Tim Woodall wrote:
> I modified /etc/bash.bashrc to prove it was only being sourced in the
> second case above (it prints the value of PS1)
> 
> And now I can reproduce without -u
> $ bash -c :
> $ ( bash -c : )
> 'PS1='
> $ ( bash -c : ; : )
> $

I can't reproduce this on Debian 11, with bash 5.1-2+deb11u1.
What version of bash is this?



Re: networking.service: start operation timed out

2022-08-26 Thread Jeremy Ardley


On 27/8/22 6:06 am, Ross Boylan wrote:

In Debian 11/bullseye my system keeps reporting timeouts while trying
to bring up the first non-loopback interface.  According to ip, the
interface actually is up, but ifup/down do not know that.  My 2nd
interface is down, and there is no mention of attempting to bring it
up in the logs.  I can bring up both interfaces after startup,
suggesting there may be something special about the initial
environment that is causing trouble, but I don't know what.

I'd appreciate any suggestions about how to diagnose or cure the
problem.  I have set VERBOSE=yes in /etc/default/networking


First of all ensure NetworkManager is really dead.

You should see

systemctl status NetworkManager
● NetworkManager.service
   Loaded: masked (Reason: Unit NetworkManager.service is masked.)
   Active: inactive (dead)

if not, use

systemctl disable NetworkManager

systemctl mask NetworkManager

Then ensure that only the really basics of networking are enabled

cat /etc/networki/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# note subdirectory source statement is commented out

# source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

At his stage the only thing you need to attend to is 
/etc/systemd/network files


In my case I have a single file

/etc/systemd/network/20-wired.network

Getting network changes to fully take may require a reboot after 
initially disabling NetworkManager and restricting /etc/network/interfaces


Then it is just a matter of configuring your network by editing your 
/etc/systemd/network/


systemd-networkd does work reasonably well. It just requires a bit of study

--

Jeremy



OpenPGP_signature
Description: OpenPGP digital signature


Re: Weird set -u error

2022-08-26 Thread David
On Sat, 27 Aug 2022 at 08:54, Tim Woodall  wrote:
> On Fri, 26 Aug 2022, to...@tuxteam.de wrote:
> > On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:

> I modified /etc/bash.bashrc to prove it was only being sourced in the
> second case above (it prints the value of PS1)
>
> And now I can reproduce without -u
> $ bash -c :
> $ ( bash -c : )
> 'PS1='
> $ ( bash -c : ; : )
> $

Just sharing something that I tried, to shed some more light
on this, in case that's useful ...

$ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
esac ; echo $BASHPID $i ; }
$ declare -fx foo
$ foo
2415 interactive
$ foo ; ( foo ) ; foo
2415 interactive
2512 interactive
2415 interactive
$ bash -c foo
2515 not-interactive
$ foo ; ( bash -c foo ) ; foo
2415 interactive
2516 not-interactive
2415 interactive
$ foo ; ( foo ; bash -c foo ; foo ) ; foo
2415 interactive
2517 interactive
2518 not-interactive
2517 interactive
2415 interactive
$



Re: Debian 11 - KDE and NumLock

2022-08-26 Thread Amn

Yes, thank you! That worked.

On 2022-08-26 11:52 a.m., Brad Rogers wrote:

On Fri, 26 Aug 2022 06:14:36 -0400
Amn  wrote:

Hello Amn,

In KDE's System Settings;

Hardware Section, Input Devices->Keyboard

You can Set On, Off or Leave Unchanged.  Also set keyboard model there,
too - Acer Laptop being one of the options.





Re: Weird set -u error

2022-08-26 Thread Greg Wooledge
On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
> Just sharing something that I tried, to shed some more light
> on this, in case that's useful ...
> 
> $ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
> esac ; echo $BASHPID $i ; }
> $ declare -fx foo
> $ foo
> 2415 interactive
> $ foo ; ( foo ) ; foo
> 2415 interactive
> 2512 interactive
> 2415 interactive
> $ bash -c foo
> 2515 not-interactive
> $ foo ; ( bash -c foo ) ; foo
> 2415 interactive
> 2516 not-interactive
> 2415 interactive
> $ foo ; ( foo ; bash -c foo ; foo ) ; foo
> 2415 interactive
> 2517 interactive
> 2518 not-interactive
> 2517 interactive
> 2415 interactive

I get these results as well, with Debian 11's packaged bash.

Has anyone managed to reproduce the OP's results, either getting
"interactive" from a bash -c call, or seeing *any* evidence that
/etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?



Re: Weird set -u error

2022-08-26 Thread David
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:
> On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:

> > Just sharing something that I tried, to shed some more light
> > on this, in case that's useful ...
> >
> > $ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
> > esac ; echo $BASHPID $i ; }
> > $ declare -fx foo
> > $ foo
> > 2415 interactive
> > $ foo ; ( foo ) ; foo
> > 2415 interactive
> > 2512 interactive
> > 2415 interactive
> > $ bash -c foo
> > 2515 not-interactive
> > $ foo ; ( bash -c foo ) ; foo
> > 2415 interactive
> > 2516 not-interactive
> > 2415 interactive
> > $ foo ; ( foo ; bash -c foo ; foo ) ; foo
> > 2415 interactive
> > 2517 interactive
> > 2518 not-interactive
> > 2517 interactive
> > 2415 interactive
>
> I get these results as well, with Debian 11's packaged bash.

Yeah, sorry, I forgot to include, for the record:

$ echo $BASH_VERSION
5.1.4(1)-release
$ apt list --installed bash
Listing... Done
bash/stable,now 5.1-2+deb11u1 amd64 [installed]



Re: Weird set -u error

2022-08-26 Thread David
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:

> Has anyone managed to reproduce the OP's results, either getting
> "interactive" from a bash -c call, or seeing *any* evidence that
> /etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?

On Debian 11, when I create a test user, login on a console as that
user, and duplicate the recipe provided in the original message[1],
the reported problem does NOT occur:

t220827a@kablamm:~$ cat Makefile.test
SHELL := /bin/bash -u
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:

all:
echo done
t220827a@kablamm:~$ make -f Makefile.test
echo done
done
t220827a@kablamm:~$ make -f Makefile.test | cat
echo done
done
t220827a@kablamm:~$ cat <(make -f Makefile.test)
echo done
done
t220827a@kablamm:~$

[1] https://lists.debian.org/debian-user/2022/08/msg00578.html



Re: no JAVA_HOME in the path

2022-08-26 Thread Amn

Thanks!
The problem is solved.

On 2022-08-23 9:40 a.m., Roberto C. Sánchez wrote:

On Tue, Aug 23, 2022 at 09:21:38AM -0400, Amn wrote:

When I type echo $JAVA_HOME, Debian 11's Konsole displays ... nothing,
'echo $PATH' reports -

/usr/local/[1]bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:libtool:
/usr/bin/libtool /usr/share/libtool /usr/share/man/man1/libtool.1.gz -
However if I type, 'java --version' I get -

/usr/local/[2]bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:libtool:
/usr/bin/libtool /usr/share/libtool /usr/share/man/man1/libtool.1.gz -,
which is correct.
Where is $JAVA_HOME set or how do I add it to the path permanently?


You have to set it yourself.

Options include /etc/bashrc, /etc/profile, /etc/profile.d,
/etc/environment, /etc/environment.d, and possibly others, for setting
it system-wide, and their per-user counterparts in $HOME for setting it
on a per-user basis.

Regards,

-Roberto





Re: Weird set -u error

2022-08-26 Thread gene heskett

On 8/26/22 20:35, David wrote:

On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:

On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:

Just sharing something that I tried, to shed some more light
on this, in case that's useful ...

$ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
esac ; echo $BASHPID $i ; }
$ declare -fx foo
$ foo
2415 interactive
$ foo ; ( foo ) ; foo
2415 interactive
2512 interactive
2415 interactive
$ bash -c foo
2515 not-interactive
$ foo ; ( bash -c foo ) ; foo
2415 interactive
2516 not-interactive
2415 interactive
$ foo ; ( foo ; bash -c foo ; foo ) ; foo
2415 interactive
2517 interactive
2518 not-interactive
2517 interactive
2415 interactive

I get these results as well, with Debian 11's packaged bash.

Yeah, sorry, I forgot to include, for the record:

$ echo $BASH_VERSION
5.1.4(1)-release
$ apt list --installed bash
Listing... Done
bash/stable,now 5.1-2+deb11u1 amd64 [installed]

.

Why the miss-match, I get the same results as this myself.

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



Re: Weird set -u error

2022-08-26 Thread tomas
On Sat, Aug 27, 2022 at 10:32:06AM +1000, David wrote:
> On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:
> > On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
> 
> > > Just sharing something that I tried, to shed some more light
> > > on this, in case that's useful ...
> > >
> > > $ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
> > > esac ; echo $BASHPID $i ; }
> > > $ declare -fx foo
> > > $ foo
> > > 2415 interactive
> > > $ foo ; ( foo ) ; foo
> > > 2415 interactive
> > > 2512 interactive
> > > 2415 interactive
> > > $ bash -c foo
> > > 2515 not-interactive
> > > $ foo ; ( bash -c foo ) ; foo
> > > 2415 interactive
> > > 2516 not-interactive
> > > 2415 interactive
> > > $ foo ; ( foo ; bash -c foo ; foo ) ; foo
> > > 2415 interactive
> > > 2517 interactive
> > > 2518 not-interactive
> > > 2517 interactive
> > > 2415 interactive
> >
> > I get these results as well, with Debian 11's packaged bash.

Same results here...

> Yeah, sorry, I forgot to include, for the record:
> 
> $ echo $BASH_VERSION
> 5.1.4(1)-release
> $ apt list --installed bash
> Listing... Done
> bash/stable,now 5.1-2+deb11u1 amd64 [installed]

... and same bas version. Hmmm.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread tomas
On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
> On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:
> 
> > Has anyone managed to reproduce the OP's results, either getting
> > "interactive" from a bash -c call, or seeing *any* evidence that
> > /etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?
> 
> On Debian 11, when I create a test user, login on a console as that
> user, and duplicate the recipe provided in the original message[1],
> the reported problem does NOT occur:

Aha...

so main suspects are now ~/.bash_profile ~/.inputrc or some exported
environment lying around...

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Weird set -u error

2022-08-26 Thread David Wright
On Sat 27 Aug 2022 at 00:23:10 (-0400), gene heskett wrote:
> On 8/26/22 20:35, David wrote:
> > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:
> > > I get these results as well, with Debian 11's packaged bash.
> > Yeah, sorry, I forgot to include, for the record:
> > 
> > $ echo $BASH_VERSION
> > 5.1.4(1)-release
> > $ apt list --installed bash
> > Listing... Done
> > bash/stable,now 5.1-2+deb11u1 amd64 [installed]
> > 
> > .
> Why the miss-match, I get the same results as this myself.

bash_5.1-2+deb11u1_amd64.deb

bash is package name

 5.1 is upstream version

 2+deb11u1 is /Debian/ version

   amd64 is architecture.

Cheers,
David.



Re: Weird set -u error

2022-08-26 Thread David
On Sat, 27 Aug 2022 at 15:07,  wrote:
> On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
> > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:

> > > Has anyone managed to reproduce the OP's results, either getting
> > > "interactive" from a bash -c call, or seeing *any* evidence that
> > > /etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?

> > On Debian 11, when I create a test user, login on a console as that
> > user, and duplicate the recipe provided in the original message[1],
> > the reported problem does NOT occur:

> Aha...

> so main suspects are now ~/.bash_profile ~/.inputrc or some exported
> environment lying around...

On Sat, 27 Aug 2022 at 08:54, Tim Woodall  wrote:
> On Fri, 26 Aug 2022, to...@tuxteam.de wrote:
> > On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:

> >> There are also various hacks that are compiled into Debian's version
> >> of bash [...]

> >> At this moment, I'm kind of leaning toward one of those hacks being
> >> triggered by your specific combination of factors.

> > That's the most convincing conjecture so far, I'd say :)

> It's bash:

> $ bash -uc :
> $ ( bash -uc : )
> 'PS1='
> /etc/bash.bashrc: line 8: PS1: unbound variable
> $ ( bash -uc : ; : )

I am still thinking about this weirdness, as a learning exercise :)

Some observations and conjecture:

1. No-one except Tim is yet able to reproduce the above. Tim has not given
   us enough information to do so.

2. We dont know what shell and version is initially running *before* any of
   the above occurs. That information is essential. It could be 'bash' or
   'dash' or anything else with different behaviour we have not yet
   considered.

3. It looks like the initial shell is being used interactively, and has
   PS1='$ ' which suggests that is not 'bash', possibly 'dash'.

4. The ':' command is a shell builtin, not an external command.  That could
   be a relevant fact in the above example.

5. My 'foo' examples in a previous message demonstrate that bash -c ...  is
   always non-interactive.

6. 'man bash' tells us that bash when started interactively includes the
   steps of: (a) set PS1 (b) source /etc/bash.bashrc

7. But the Makefile example originally given by Tim requires that (b)
   occurs as if (a) never happened.

8. Similarly the above error message requires that (b) occurs as if (a)
   never happened.

9. How is this error possible then, if an interactive shell does both (a)
   and (b) when it starts? What could possibly be unsetting PS1 before
   step (b) occurs. Something that could occur between (a) and (b) could
   be any commands inside a file named in either an ENV or BASH_ENV
   environment variable. We need to know if either of these exist.

10. On the other hand, a non-interactive shell could do (b) without (a) if
BASH_ENV=/etc/bash.bashrc was set in the environment that it inherits.

11. Regarding this line from above:
$ ( bash -uc : )

I could attempt to explain what happens as: the initial shell forks
a subshell clone of itself because of the parentheses. That subshell
clone is interactve. It somehow has PS1 unset, and stupidly sources
/etc/bash.bashrc which gives the error. The subshell then runs
'bash -uc :' as a non-interactive shell.

That might make sense, except for the fact that when I run
that example here, I do not see any errors!

Of course I don't want to see errors, but the lack of them indicates
that my shell and everyone elses shell don't work in the way that my
explanation says they do.

Perhaps, whatever strange shell Tim has does source /etc/bash.bashrc
when it forks a subshell environment, but my shell does not. I don't
see a good reason why any subshell would source that file again,
because its environment is supposed to be a clone of its parent.

12. And regarding this line from above:
$ ( bash -uc : ; : )

Maybe Tim's strange shell does not error on this line, because
the command is not a simple builtin. I have no clue.

Finally, to take this any further, I think we need to know:

What the initial shell is.
The output of 'env' in the initial shell.
(particularly any ENV or BASH_ENV values)
The output of 'cat ~/.bashrc'



Re: Weird set -u error

2022-08-26 Thread Tim Woodall

On Sat, 27 Aug 2022, to...@tuxteam.de wrote:


On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:

On Sat, 27 Aug 2022 at 10:27, Greg Wooledge  wrote:


Has anyone managed to reproduce the OP's results, either getting
"interactive" from a bash -c call, or seeing *any* evidence that
/etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?


On Debian 11, when I create a test user, login on a console as that
user, and duplicate the recipe provided in the original message[1],
the reported problem does NOT occur:


Aha...

so main suspects are now ~/.bash_profile ~/.inputrc or some exported
environment lying around...

Cheers



This just gets weirder and weirder.

It looks like it's related to logging in with ssh:

I am running a modified ssh. It's been patched to allow cipher None and
I've backported from sid

I had to jump through some hoops to login at the console but now:

aptmirror17 login: apt-mirror
Password: 
Linux aptmirror17.home.woodall.me.uk 5.10.0-16-amd64 #1 SMP Debian

5.10.127-2 (2022-07-23) x86_64

The programs included with the Debian GNU/Linux system are free
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 06:22:26 UTC 2022 on hvc0
sourcing /etc/bash.bashrc
apt-mirror@aptmirror17:~$ ( bash -cu : )
apt-mirror@aptmirror17:~$


apt-mirror@aptmirror17:~$ ssh aptmirror17
Enter passphrase for key '/var/spool/apt-mirror/.ssh/id_rsa': 
Linux aptmirror17.home.woodall.me.uk 5.10.0-16-amd64 #1 SMP Debian

5.10.127-2 (2022-07-23) x86_64

The programs included with the Debian GNU/Linux system are free
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 06:23:12 2022
apt-mirror@aptmirror17:~$ ( bash -cu : )
/etc/bash.bashrc: line 7: PS1: unbound variable

apt-mirror@aptmirror17:/mnt/mirror/local-debs$ ssh -V
OpenSSH_9.0p1 Debian-1+~tjw11r1, OpenSSL 1.1.1n  15 Mar 2022



Downgrading ssh back to the version from bullseye shows it's not my
local changes:

apt-mirror@aptmirror17:~$ ssh aptmirror17
Enter passphrase for key '/var/spool/apt-mirror/.ssh/id_rsa': 
Linux aptmirror17.home.woodall.me.uk 5.10.0-16-amd64 #1 SMP Debian

5.10.127-2 (2022-07-23) x86_64

The programs included with the Debian GNU/Linux system are free
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 06:36:10 2022 from
2001:8b0:bfcd:100:216:3eff:fee0:7107
apt-mirror@aptmirror17:~$ ( bash -cu : )
/etc/bash.bashrc: line 7: PS1: unbound variable
apt-mirror@aptmirror17:~$

apt-mirror@aptmirror17:~$ ssh -V
OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n  15 Mar 2022
apt-mirror@aptmirror17:~$