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


Groups > linux.debian.user > #198527 > unrolled thread

/etc/alternatives feedback for presentation

Started by"der.hans" <deb-user@LuftHans.com>
First post2018-08-09 22:10 +0200
Last post2018-08-17 04:40 +0200
Articles 8 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  /etc/alternatives feedback for presentation "der.hans" <deb-user@LuftHans.com> - 2018-08-09 22:10 +0200
    Re: /etc/alternatives feedback for presentation Ryan Nowakowski <tubaman@fattuba.com> - 2018-08-12 00:30 +0200
      Re: /etc/alternatives feedback for presentation Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-13 15:10 +0200
        Re: /etc/alternatives feedback for presentation David Wright <deblis@lionunicorn.co.uk> - 2018-08-14 17:40 +0200
          Re: /etc/alternatives feedback for presentation Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-14 17:50 +0200
        Re: /etc/alternatives feedback for presentation "der.hans" <deb-user@LuftHans.com> - 2018-08-24 04:30 +0200
          Re: /etc/alternatives feedback for presentation Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-24 14:20 +0200
      Re: /etc/alternatives feedback for presentation "der.hans" <deb-user@LuftHans.com> - 2018-08-17 04:40 +0200

#198527 — /etc/alternatives feedback for presentation

From"der.hans" <deb-user@LuftHans.com>
Date2018-08-09 22:10 +0200
Subject/etc/alternatives feedback for presentation
Message-ID<wkZpU-7Yo-13@gated-at.bofh.it>
moin moin,

I'm giving a presentation on /etc/alternatives in a few hours.

If you use the alternatives system a lot and would like to spend a few
minutes reviewing my talk for me, please see the links below.

Any use cases or cool functionality that I've missed?

Anything I've gotten completely wrong?

Any suggestions for good examples?

AsciiDoc source file:

https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.adoc

Slidy HTML ( one-page format without JavaScript, slides with JavaScript ):

https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.html

ciao,

der.hans
-- 
#  https://www.LuftHans.com   https://www.PhxLinux.org
#  "The purpose of IT is to seamlessly and transparently provide the other
#  9/10's of the iceberg for people who need to work with chunks
#  of floating ice." -- Strata Rose Chalup

[toc] | [next] | [standalone]


#198647

FromRyan Nowakowski <tubaman@fattuba.com>
Date2018-08-12 00:30 +0200
Message-ID<wlKyt-22b-1@gated-at.bofh.it>
In reply to#198527
On Thu, Aug 09, 2018 at 08:08:00PM +0000, der.hans wrote:
> moin moin,
> 
> I'm giving a presentation on /etc/alternatives in a few hours.
> 
> If you use the alternatives system a lot and would like to spend a few
> minutes reviewing my talk for me, please see the links below.
> 
> Any use cases or cool functionality that I've missed?
> 
> Anything I've gotten completely wrong?
> 
> Any suggestions for good examples?
> 
> AsciiDoc source file:
> 
> https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.adoc
> 
> Slidy HTML ( one-page format without JavaScript, slides with JavaScript ):
> 
> https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.html
> 

You might add more info on how the other methods interact with
update-alternatives.  For example if I set the EDITOR env var how does
that interact with update-alternatives when I run visudo?  In fact I
think something like a "best practices" is needed for setting default
programs and then overriding them on a per user basis.  I'm not sure
this presentation is the right place for that but perhaps it could be
a wiki page in the future.

[toc] | [prev] | [next] | [standalone]


#198702

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-08-13 15:10 +0200
Message-ID<wmkLE-6Ct-11@gated-at.bofh.it>
In reply to#198647
On Sat, Aug 11, 2018 at 05:28:37PM -0500, Ryan Nowakowski wrote:
> For example if I set the EDITOR env var how does
> that interact with update-alternatives when I run visudo?

The VISUAL or EDITOR variable takes precedence, if one of them is set.
If neither one is set, then visudo uses its compiled-in default, which
on Debian happens to be '/usr/bin/editor'.

The problem is that sometimes, sudo will strip environment variables,
and sometimes, it will not.  So, on any given computer with any given
sudoers configuration, you can't actually know in advance whether
"sudo visudo" will use VISUAL/EDITOR or not.

Isn't Unix *fun*?

Of course, if you simply use "su", then VISUAL/EDITOR will be preserved
in the environment (because "su" does not strip environment variables),
so "su" followed by "visudo" should work fine.

But, wait!  Debian has decided to CHANGE HOW SU WORKS in testing, so
after stretch, who knows how things will work?!

Some people claim you should muscle-memorize "su -" which strips the
environment in order to give you a usable PATH variable.  If you follow
THIS advice, then "su -" will strip VISUAL/EDITOR from the environment,
and then your VISUAL/EDITOR variables won't work when you type visudo.
So, I can't imagine why you would want to do that.  Losing all your
qualify-of-life environment variables is far too high a price to pay to
get a working PATH variable after su.

The other alternatives are:

1) Stay on stretch.
2) Edit /etc/login.defs to restore a functional su command (without needing
   to use "su -").
3) Put /usr/sbin and /sbin in your ordinary account's PATH.

*Fun*!

[toc] | [prev] | [next] | [standalone]


#198783

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2018-08-14 17:40 +0200
Message-ID<wmJAm-4mp-9@gated-at.bofh.it>
In reply to#198702
On Mon 13 Aug 2018 at 09:08:28 (-0400), Greg Wooledge wrote:
> On Sat, Aug 11, 2018 at 05:28:37PM -0500, Ryan Nowakowski wrote:
> > For example if I set the EDITOR env var how does
> > that interact with update-alternatives when I run visudo?
> 
> The VISUAL or EDITOR variable takes precedence, if one of them is set.
> If neither one is set, then visudo uses its compiled-in default, which
> on Debian happens to be '/usr/bin/editor'.
> 
> The problem is that sometimes, sudo will strip environment variables,
> and sometimes, it will not.  So, on any given computer with any given
> sudoers configuration, you can't actually know in advance whether
> "sudo visudo" will use VISUAL/EDITOR or not.
> 
> Isn't Unix *fun*?
> 
> Of course, if you simply use "su", then VISUAL/EDITOR will be preserved
> in the environment (because "su" does not strip environment variables),
> so "su" followed by "visudo" should work fine.
> 
> But, wait!  Debian has decided to CHANGE HOW SU WORKS in testing, so
> after stretch, who knows how things will work?!
> 
> Some people claim you should muscle-memorize "su -" which strips the
> environment in order to give you a usable PATH variable.  If you follow
> THIS advice, then "su -" will strip VISUAL/EDITOR from the environment,
> and then your VISUAL/EDITOR variables won't work when you type visudo.
> So, I can't imagine why you would want to do that.  Losing all your
> qualify-of-life environment variables is far too high a price to pay to
> get a working PATH variable after su.
> 
> The other alternatives are:
> 
> 1) Stay on stretch.
> 2) Edit /etc/login.defs to restore a functional su command (without needing
>    to use "su -").
> 3) Put /usr/sbin and /sbin in your ordinary account's PATH.
> 
> *Fun*!

Why is

 Put some "qualify-of-life environment variables" into /root/.bashrc

not in your list?

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#198784

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-08-14 17:50 +0200
Message-ID<wmJK1-4py-1@gated-at.bofh.it>
In reply to#198783
On Tue, Aug 14, 2018 at 10:31:02AM -0500, David Wright wrote:
> On Mon 13 Aug 2018 at 09:08:28 (-0400), Greg Wooledge wrote:
> > The other alternatives are:
> > 
> > 1) Stay on stretch.
> > 2) Edit /etc/login.defs to restore a functional su command (without needing
> >    to use "su -").
> > 3) Put /usr/sbin and /sbin in your ordinary account's PATH.

> Why is
> 
>  Put some "qualify-of-life environment variables" into /root/.bashrc
> 
> not in your list?

I guess that would work, but I see some flaws:

 a) Every time you change an environment variable in your personal
    account, you'll need to remember to make the same change in root's
    account.

 b) What if other people also have root access to this system and don't
    want your personal variables?

 c) If you need to make a change on every machine as root to fix the
    behavior, why not just change /etc/login.defs instead?

 d) Especially if your home directory is shared across many systems.
    Changing it just once in your home directory is better than having
    to change every single system you log into.

Still, feel free to come up with your own alternatives to make things
work.  You might find some more ideas that I overlooked.

[toc] | [prev] | [next] | [standalone]


#199304

From"der.hans" <deb-user@LuftHans.com>
Date2018-08-24 04:30 +0200
Message-ID<wqa1j-3oS-1@gated-at.bofh.it>
In reply to#198702

[Multipart message — attachments visible in raw view] — view raw

Am 13. Aug, 2018 schwätzte Greg Wooledge so:

moin moin,

> On Sat, Aug 11, 2018 at 05:28:37PM -0500, Ryan Nowakowski wrote:
>> For example if I set the EDITOR env var how does
>> that interact with update-alternatives when I run visudo?
>
> The VISUAL or EDITOR variable takes precedence, if one of them is set.
> If neither one is set, then visudo uses its compiled-in default, which
> on Debian happens to be '/usr/bin/editor'.

More than one way...

> The problem is that sometimes, sudo will strip environment variables,
> and sometimes, it will not.  So, on any given computer with any given
> sudoers configuration, you can't actually know in advance whether
> "sudo visudo" will use VISUAL/EDITOR or not.

Will this preserve the variables you want?

      --preserve-env=list
                  Indicates to the security policy that the user wishes to
add
                  the comma-separated list of environment variables to
those
                  preserved from the user's environment.  The security
policy
                  may return an error if the user does not have permission
to
                  preserve the environment.

> Isn't Unix *fun*?

Yup :)

> Of course, if you simply use "su", then VISUAL/EDITOR will be preserved
> in the environment (because "su" does not strip environment variables),
> so "su" followed by "visudo" should work fine.
>
> But, wait!  Debian has decided to CHANGE HOW SU WORKS in testing, so
> after stretch, who knows how things will work?!

I didn't realize su is changing. What's the change?

> Some people claim you should muscle-memorize "su -" which strips the
> environment in order to give you a usable PATH variable.  If you follow
> THIS advice, then "su -" will strip VISUAL/EDITOR from the environment,
> and then your VISUAL/EDITOR variables won't work when you type visudo.
> So, I can't imagine why you would want to do that.  Losing all your
> qualify-of-life environment variables is far too high a price to pay to
> get a working PATH variable after su.
>
> The other alternatives are:
>
> 1) Stay on stretch.
> 2) Edit /etc/login.defs to restore a functional su command (without needing
>   to use "su -").
> 3) Put /usr/sbin and /sbin in your ordinary account's PATH.

That's what I do. At this point anyone who has the knowledge and desire to
use the shell also knows how to update PATH, no need to give them a
half-baked environment.

> *Fun*!

*WHEEEEEEEE* :)

ciao,

der.hans
-- 
#  https://www.LuftHans.com   https://www.PhxLinux.org
#  "I guess I should've agreed with my boss more often. Today I was replaced
#  by a bobblehead doll!" -- Randy Glasbergen, 13Mar2006

[toc] | [prev] | [next] | [standalone]


#199315

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-08-24 14:20 +0200
Message-ID<wqjei-pM-1@gated-at.bofh.it>
In reply to#199304
On Fri, Aug 24, 2018 at 02:26:19AM +0000, der.hans wrote:
> Am 13. Aug, 2018 schwätzte Greg Wooledge so:
> > But, wait!  Debian has decided to CHANGE HOW SU WORKS in testing, so
> > after stretch, who knows how things will work?!
> 
> I didn't realize su is changing. What's the change?

<https://lists.debian.org/debian-user/2018/08/msg00487.html> is just
one of several threads that discussed it recently.

[toc] | [prev] | [next] | [standalone]


#198902

From"der.hans" <deb-user@LuftHans.com>
Date2018-08-17 04:40 +0200
Message-ID<wnCQ9-2ZS-1@gated-at.bofh.it>
In reply to#198647

[Multipart message — attachments visible in raw view] — view raw

Am 11. Aug, 2018 schwätzte Ryan Nowakowski so:

moin moin Ryan,

> On Thu, Aug 09, 2018 at 08:08:00PM +0000, der.hans wrote:
>> moin moin,
>>
>> I'm giving a presentation on /etc/alternatives in a few hours.
>>
>> If you use the alternatives system a lot and would like to spend a few
>> minutes reviewing my talk for me, please see the links below.
>>
>> Any use cases or cool functionality that I've missed?
>>
>> Anything I've gotten completely wrong?
>>
>> Any suggestions for good examples?
>>
>> AsciiDoc source file:
>>
>> https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.adoc
>>
>> Slidy HTML ( one-page format without JavaScript, slides with JavaScript ):
>>
>> https://www.LuftHans.com/Akten/Presentations/2018/PLUG/PLUG.intro_to_etc_alternatives.2018Aug09.html
>>
>
> You might add more info on how the other methods interact with
> update-alternatives.  For example if I set the EDITOR env var how does
> that interact with update-alternatives when I run visudo?  In fact I
> think something like a "best practices" is needed for setting default
> programs and then overriding them on a per user basis.  I'm not sure
> this presentation is the right place for that but perhaps it could be
> a wiki page in the future.

Yeah, I think I need to write/update an article on how they are used and
in what order they're evaluated. That would actually be a good resource
for my anatomy of the command line presentation as well.

I also need more examples.

ciao,

der.hans
-- 
#  https://www.LuftHans.com   https://www.PhxLinux.org
#  "Rock 'n' roll might not solve your problems, but it does let you dance
#  all over them." -- Pete Townsend
fred

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web