You are not logged in.

#1 2013-07-01 20:23:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 10,010

/etc/profile $PATH not being used in by Display Manager

Does anyone know why $PATH is not being set correctly at login by /etc/profile for zsh?

dnewgard@Scimmia ~ % echo $PATH
/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/core_perl
dnewgard@Scimmia ~ % source /etc/profile
dnewgard@Scimmia ~ % echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl

As you can see, it's correct after sourcing /etc/profile. Do I need to do this manually in zprofile? I thought shells sourced /etc/profile automatically?

Edit: OK, so zsh doesn't use it automatically, but it is already being sourced in /etc/zsh/zprofile, so why isn't it being applied correctly? It does seem to work in bash.

Last edited by Scimmia (2013-07-01 22:17:20)

Online

#2 2013-07-01 20:29:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: /etc/profile $PATH not being used in by Display Manager

The wiki says "/etc/profile - This file is sourced by all Bourne-compatible shells upon login:" https://wiki.archlinux.org/index.php/Zs … tion_files
Maybe something else sets the wrong PATH - /etc/profile.d/*.sh?


Edit: https://wiki.archlinux.org/index.php/Zs … ng_.24PATH ?

Last edited by karol (2013-07-01 20:30:45)

Offline

#3 2013-07-01 20:34:50

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: /etc/profile $PATH not being used in by Display Manager

Two things to try...

1) Is your local file over writing the PATH variable? Try grepping for PATH in your Bash configs.

2) How is it being invoked, this is from the manual:

A  login  shell  is  one  whose  first character of argument zero is a -, or one started with the
       --login option.

       An interactive shell is one started without non-option arguments and without the -c option  whose
       standard  input  and  error  are both connected to terminals (as determined by isatty(3)), or one
       started with the -i option.  PS1 is set and $- includes i if  bash  is  interactive,  allowing  a
       shell script or a startup file to test this state.
...

When  bash  is  invoked  as  an  interactive  login shell, or as a non-interactive shell with the
       --login option, it first reads and executes commands from the file  /etc/profile,  if  that  file
       exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in
       that order, and reads and executes commands from the first one that exists and is readable.   The
       --noprofile option may be used when the shell is started to inhibit this behavior.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#4 2013-07-01 20:35:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 10,010

Re: /etc/profile $PATH not being used in by Display Manager

Alright, never mind, this seems to have something to do with my Display Manager. Logging in at the TTY correctly sources /etc/profile.

Online

#5 2013-07-01 22:20:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 10,010

Re: /etc/profile $PATH not being used in by Display Manager

Curiouser and curiouser. The DM in question is SDDM, and it's Xsession script does call /etc/zsh/zprofile. Not only that, I know for sure that /etc/profile is being sourced because "/usr/bin/core_perl" is added to the path by /etc/profile.d/perbin.sh. If I comment out the line in Xsession that calls zprofile, /usr/bin/core_perl is not added to the path, so everything SEEMS to be being called correctly, only PATH isn't getting overridden by /etc/profile.

Online

Board footer

Powered by FluxBB