public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Setting default user environments in /etc/profile.d/
@ 2012-05-01 18:11 Stroller
  2012-05-01 18:20 ` [gentoo-user] " Remy Blank
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Stroller @ 2012-05-01 18:11 UTC (permalink / raw
  To: gentoo-user

So /etc/profile contains the following message:

# You should override these in your ~/.bashrc (or equivalent) for per-user
# settings.  For system defaults, you can add a new file in /etc/profile.d/.
export EDITOR=${EDITOR:-/bin/nano}
export PAGER=${PAGER:-/usr/bin/less}

Therefore I have created a plain text file /etc/profile.d/essential_defaults

$ cat 

export HISTSIZE=900
export HISTFILESIZE=900
export HISTCONTROL=erasedups

# vi-style Bash history editing
set -o vi

export MANPAGER="/usr/bin/most"
$

Yet when I log in, these environment variables are not set. 

The file is world-readable (mode 644), and I even tried setting the execute bit (`chmod +xxx`).

If I source the file using `. /etc/profile.d/essential_defaults` then suddenly I get the right pager, but it does not seem to be sourced at login, as I believe is promised. What am I doing wrong or misunderstanding, please?

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user] Re: Setting default user environments in /etc/profile.d/
  2012-05-01 18:11 [gentoo-user] Setting default user environments in /etc/profile.d/ Stroller
@ 2012-05-01 18:20 ` Remy Blank
  2012-05-01 19:41   ` [gentoo-user] " Stroller
  2012-05-01 18:27 ` Michael Orlitzky
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Remy Blank @ 2012-05-01 18:20 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

Stroller wrote:
> What am I doing wrong or misunderstanding, please?

Rename your file to "essential_defaults.sh". Only files with a ".sh"
extension are sourced (assuming you are using bash).

-- Remy


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:11 [gentoo-user] Setting default user environments in /etc/profile.d/ Stroller
  2012-05-01 18:20 ` [gentoo-user] " Remy Blank
@ 2012-05-01 18:27 ` Michael Orlitzky
  2012-05-01 19:40   ` Stroller
  2012-05-01 18:38 ` Alex Schuster
  2012-05-01 22:52 ` Walter Dnes
  3 siblings, 1 reply; 11+ messages in thread
From: Michael Orlitzky @ 2012-05-01 18:27 UTC (permalink / raw
  To: gentoo-user

On 05/01/2012 02:11 PM, Stroller wrote:
> So /etc/profile contains the following message:
> 
> # You should override these in your ~/.bashrc (or equivalent) for per-user
> # settings.  For system defaults, you can add a new file in /etc/profile.d/.
> export EDITOR=${EDITOR:-/bin/nano}
> export PAGER=${PAGER:-/usr/bin/less}
> 
> Therefore I have created a plain text file /etc/profile.d/essential_defaults
> 

First of all, use `eselect pager` =)

The reason this isn't working is that the comment at the top of
/etc/profile fails to mention this:

  for sh in /etc/profile.d/*.sh ; do
  	[ -r "$sh" ] && . "$sh"
  done
  unset sh

So it looks like you need to add a ".sh" extension.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:11 [gentoo-user] Setting default user environments in /etc/profile.d/ Stroller
  2012-05-01 18:20 ` [gentoo-user] " Remy Blank
  2012-05-01 18:27 ` Michael Orlitzky
@ 2012-05-01 18:38 ` Alex Schuster
  2012-05-01 19:42   ` Stroller
  2012-05-01 22:52 ` Walter Dnes
  3 siblings, 1 reply; 11+ messages in thread
From: Alex Schuster @ 2012-05-01 18:38 UTC (permalink / raw
  To: gentoo-user

Stroller writes:

> Therefore I have created a plain text
> file /etc/profile.d/essential_defaults
[...]
> Yet when I log in, these environment variables are not set. 
> 
> The file is world-readable (mode 644), and I even tried setting the
> execute bit (`chmod +xxx`).

It needs to be readable by your user, more is not needed.

> If I source the file using `. /etc/profile.d/essential_defaults` then
> suddenly I get the right pager, but it does not seem to be sourced at
> login, as I believe is promised. What am I doing wrong or
> misunderstanding, please?

/etc/profile is sourced for login shells only. That happens when you log
in a text console, but usually not for a graphical terminal. As a KDE
user, I have set my Konsole's profiles to run '/bin/bash -l', this gives
me login shells. For xterm or aterm, you would use the '-ls' option.

	Wonko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:27 ` Michael Orlitzky
@ 2012-05-01 19:40   ` Stroller
  2012-05-02  2:26     ` Pandu Poluan
  0 siblings, 1 reply; 11+ messages in thread
From: Stroller @ 2012-05-01 19:40 UTC (permalink / raw
  To: gentoo-user


On 1 May 2012, at 19:27, Michael Orlitzky wrote:

> On 05/01/2012 02:11 PM, Stroller wrote:
>> So /etc/profile contains the following message:
>> 
>> # You should override these in your ~/.bashrc (or equivalent) for per-user
>> # settings.  For system defaults, you can add a new file in /etc/profile.d/.
>> export EDITOR=${EDITOR:-/bin/nano}
>> export PAGER=${PAGER:-/usr/bin/less}
>> 
>> Therefore I have created a plain text file /etc/profile.d/essential_defaults
>> 
> 
> First of all, use `eselect pager` =)

Actually, if you look at the contents of my essential_defaults file, I'm not so interested in the pager as the MANPAGER setting. I find that after using `most` as my man-pager, it's quite horrible using `less` on a new system. For anything else, `less` is fine.

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:20 ` [gentoo-user] " Remy Blank
@ 2012-05-01 19:41   ` Stroller
  0 siblings, 0 replies; 11+ messages in thread
From: Stroller @ 2012-05-01 19:41 UTC (permalink / raw
  To: gentoo-user


On 1 May 2012, at 19:20, Remy Blank wrote:

> Stroller wrote:
>> What am I doing wrong or misunderstanding, please?
> 
> Rename your file to "essential_defaults.sh". Only files with a ".sh"
> extension are sourced (assuming you are using bash).

Many thanks!

That's it.

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:38 ` Alex Schuster
@ 2012-05-01 19:42   ` Stroller
  0 siblings, 0 replies; 11+ messages in thread
From: Stroller @ 2012-05-01 19:42 UTC (permalink / raw
  To: gentoo-user


On 1 May 2012, at 19:38, Alex Schuster wrote:
>> … 
>> The file is world-readable (mode 644), and I even tried setting the
>> execute bit (`chmod +xxx`).
> 
> It needs to be readable by your user, more is not needed.

Yeah, I thought not, but I thought I'd mention trying it.

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 18:11 [gentoo-user] Setting default user environments in /etc/profile.d/ Stroller
                   ` (2 preceding siblings ...)
  2012-05-01 18:38 ` Alex Schuster
@ 2012-05-01 22:52 ` Walter Dnes
  2012-05-02  3:58   ` Stroller
  3 siblings, 1 reply; 11+ messages in thread
From: Walter Dnes @ 2012-05-01 22:52 UTC (permalink / raw
  To: gentoo-user

On Tue, May 01, 2012 at 07:11:37PM +0100, Stroller wrote
> So /etc/profile contains the following message:
> 
> # You should override these in your ~/.bashrc (or equivalent) for per-user
> # settings.  For system defaults, you can add a new file in /etc/profile.d/.
> export EDITOR=${EDITOR:-/bin/nano}
> export PAGER=${PAGER:-/usr/bin/less}
> 
> Therefore I have created a plain text file /etc/profile.d/essential_defaults

  I don't know if it gets executed in the right order.  Are you using
baselayout 2?  The items you mentioned are EDITOR and PAGER.  For the
official way of changing global settings, see...
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5&style=printable
for examples.  In my case...

waltdnes@d531 ~ $ cat /etc/env.d/99editor
EDITOR="/usr/bin/vim"

  In your case, I would suggest creating a file called /etc/env.d/99pager
containing the line...
PAGER="/usr/bin/most"

  Note that the files are sourced by name in your current locale sort
order.  In just about every locale numbers should sort properly, which
would start at 00blahblahblah and go through 99blahblahblah.

-- 
Walter Dnes <waltdnes@waltdnes.org>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 19:40   ` Stroller
@ 2012-05-02  2:26     ` Pandu Poluan
  2012-05-02  4:01       ` Stroller
  0 siblings, 1 reply; 11+ messages in thread
From: Pandu Poluan @ 2012-05-02  2:26 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On May 2, 2012 2:48 AM, "Stroller" <stroller@stellar.eclipse.co.uk> wrote:
>
>
> On 1 May 2012, at 19:27, Michael Orlitzky wrote:
>
> > On 05/01/2012 02:11 PM, Stroller wrote:
> >> So /etc/profile contains the following message:
> >>
> >> # You should override these in your ~/.bashrc (or equivalent) for
per-user
> >> # settings.  For system defaults, you can add a new file in
/etc/profile.d/.
> >> export EDITOR=${EDITOR:-/bin/nano}
> >> export PAGER=${PAGER:-/usr/bin/less}
> >>
> >> Therefore I have created a plain text file
/etc/profile.d/essential_defaults
> >>
> >
> > First of all, use `eselect pager` =)
>
> Actually, if you look at the contents of my essential_defaults file, I'm
not so interested in the pager as the MANPAGER setting. I find that after
using `most` as my man-pager, it's quite horrible using `less` on a new
system. For anything else, `less` is fine.
>
> Stroller.
>
>

'most' is for sissies ; I use vimmanpager for MANPAGER, and vimpager for
PAGER.  ;-)

Rgds,

[-- Attachment #2: Type: text/html, Size: 1355 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-01 22:52 ` Walter Dnes
@ 2012-05-02  3:58   ` Stroller
  0 siblings, 0 replies; 11+ messages in thread
From: Stroller @ 2012-05-02  3:58 UTC (permalink / raw
  To: gentoo-user


On 1 May 2012, at 23:52, Walter Dnes wrote:

> On Tue, May 01, 2012 at 07:11:37PM +0100, Stroller wrote
>> So /etc/profile contains the following message:
>> 
>> # You should override these in your ~/.bashrc (or equivalent) for per-user
>> # settings.  For system defaults, you can add a new file in /etc/profile.d/.
>> export EDITOR=${EDITOR:-/bin/nano}
>> export PAGER=${PAGER:-/usr/bin/less}
>> 
>> Therefore I have created a plain text file /etc/profile.d/essential_defaults
> 
> … The items you mentioned are EDITOR and PAGER.  For the
> official way of changing global settings, see...
> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5&style=printable
> for examples.  In my case…

Nope, those are merely the next two lines from the file when I ran `grep -C X` to find where I'd read about putting files in /etc/profile.d/.

If you read my original post (solved) now, you'll see that in my actual my_defaults.sh file I only concern myself with the MANPAGER, the history file and vi-style line editing (for Bash). 

Sorry if this was unclear,

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] Setting default user environments in /etc/profile.d/
  2012-05-02  2:26     ` Pandu Poluan
@ 2012-05-02  4:01       ` Stroller
  0 siblings, 0 replies; 11+ messages in thread
From: Stroller @ 2012-05-02  4:01 UTC (permalink / raw
  To: gentoo-user


On 2 May 2012, at 03:26, Pandu Poluan wrote:

>> Actually, if you look at the contents of my essential_defaults file, I'm not so interested in the pager as the MANPAGER setting. I find that after using `most` as my man-pager, it's quite horrible using `less` on a new system. For anything else, `less` is fine.
> 
> 'most' is for sissies ; I use vimmanpager for MANPAGER, and vimpager for PAGER.  ;-)

Hmmmn… I use vim as my editor, but most is much better for manpages. Perhaps it is simply the default syntax colouring that is so much better. I have tried your suggestion, and couldn't get along with it.

Stroller.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-05-02  4:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 18:11 [gentoo-user] Setting default user environments in /etc/profile.d/ Stroller
2012-05-01 18:20 ` [gentoo-user] " Remy Blank
2012-05-01 19:41   ` [gentoo-user] " Stroller
2012-05-01 18:27 ` Michael Orlitzky
2012-05-01 19:40   ` Stroller
2012-05-02  2:26     ` Pandu Poluan
2012-05-02  4:01       ` Stroller
2012-05-01 18:38 ` Alex Schuster
2012-05-01 19:42   ` Stroller
2012-05-01 22:52 ` Walter Dnes
2012-05-02  3:58   ` Stroller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox