You are not logged in.

#1 2011-08-26 06:44:22

krax
Member
From: Tory;Mi
Registered: 2010-06-26
Posts: 62
Website

screwed up $PATH

while ago, all of a sudden my $PATH was totally hammered and I didn't know why? but the signs were ifconfig reboot halt and common command in terminal returned the same error "command not found". I was without clue as what effect the $PATH. while all of the common places which PATH could be defined were normal and nothing to dictate the new $PATH.My consult in IRC led nowhere and everybody ignored me there.
at the end i re-install the arch again but now I have the same problem all over again. now I checked and recheck but all the same. but while I checked deeper i found that in TTY all thing are normal for example the reboot will restart and Ifconfig will report back.
and the problem was I installed LightDM in both cases
and after that my $PATH was gone.
HOW could I fix the $PATH???

Offline

#2 2011-08-26 06:59:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,740

Re: screwed up $PATH

I know nothing about lightDM, but your PATH is set by various login scipts --
It starts with /etc/profile,
then,
It runs all the scrips in /etc/profile.d.  Check that none of them are mucking with the path
then,
depending on what you are doing, other startup and login scrips can change it.  This can occur in .bashrc, .zshrc, .xinitrc, etc...

Find out what lightdm is running at login and check those scripts.  Also, check that /etc/profile is what you expect.  If it is,  rerun that script and see if things improve.  If they do, it happens in one of the later scripts


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Online

#3 2011-08-26 07:06:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,740

Re: screwed up $PATH

One last thought as I head off to bed (00:05 here):  Use the -Ql option with pacman to find out what files it has installed.  Look for the ones that mess with PATH.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Online

#4 2011-08-26 07:21:44

krax
Member
From: Tory;Mi
Registered: 2010-06-26
Posts: 62
Website

Re: screwed up $PATH

After the fresh install of arch linux what should the $PATH in /etc/profile be ?

Offline

#5 2011-08-26 07:48:59

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,019

Re: screwed up $PATH

krax wrote:

After the fresh install of arch linux what should the $PATH in /etc/profile be ?

Here's the default /etc/profile file ( i've never touched it...)

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

Cheers


You're just jealous because the voices only talk to me.

Offline

#6 2011-08-26 07:57:50

krax
Member
From: Tory;Mi
Registered: 2010-06-26
Posts: 62
Website

Re: screwed up $PATH

mines the same and I didn't set $PATH anywhere else
so how lightdm mess with it. it chouldn't change it in /etc/profile so where does it change $PATH?

Last edited by krax (2011-08-26 07:59:49)

Offline

#7 2011-08-26 08:05:25

krax
Member
From: Tory;Mi
Registered: 2010-06-26
Posts: 62
Website

Re: screwed up $PATH

guys i emailed Robert Ancell and he says "LightDM uses a default PATH /usr/local/bin:/usr/bin:/bin which is
overridden by PAM if it is configured that way (it is in Ubuntu)." does it help in $PATH issue?

Offline

#8 2011-08-26 08:17:28

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,019

Re: screwed up $PATH

I have no idea if pam does anything with PATH ...
If you use bash as your shell and have a ~/.bash_profile or even a ~/.profile you can add a line in it to set your PATH after login something like :

PATH=/usr/local/sbin:/usr/sbin:/sbin:"${PATH}"

which with what you said lightdm sets it to should get it back to the defaults.
Cheers


You're just jealous because the voices only talk to me.

Offline

#9 2011-08-26 15:08:11

krax
Member
From: Tory;Mi
Registered: 2010-06-26
Posts: 62
Website

Re: screwed up $PATH

refer to this https://bbs.archlinux.org/viewtopic.php?id=125327
we need the wrapper!!!!!!!

Hence the $PATH problem, I wrote back and force with the Robert Ancell the developer of the LightDM project bout the cause of the problem and how to solve it.
Robert replied; "LightDM uses a default PATH /usr/local/bin:/usr/bin:/bin which is overridden by PAM if it is configured that way (it is in Ubuntu). " so the investigation of the case leed us to this.
"but LightDM simply sets a default PATH like every other display manager (gdm/kdm/xdm etc.) for the session. You still haven't told us what distribution/OS you're actually using
but if you want a different PATH for the session you are free to override it in the session wrapper script or via PAM as with any other display manager."
and
"change PATH in the session wrapper script, i.e. the script that's referenced by the session-wrapper option in lightdm.conf."
[BOLD]the problem is that what is session wrapper for arch and where is it?[/BOLD]
as the project manager pointed it out
change PATH in the session wrapper script, i.e. the script that's referenced by the session-wrapper option in lightdm.conf.
but there is non to my knowledge present.
what lightdm project manager suggested was " it is usually a shell script which sets up your session and
starts the windowmanager or desktop environment, so you could add
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
in an appropriate place."
Note that this script is not part of LightDM, it is your distributions responsibility to provide such a wrapper script and to configure LightDM to use it. If that's not the case I would
file a bug against your distros LightDM package
So How should we proceed?

Last edited by krax (2011-08-26 15:18:57)

Offline

#10 2011-08-26 15:36:29

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: screwed up $PATH

Talk to maintainer of AUR package, LightDM isn't an official package.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#11 2011-08-26 16:00:50

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: screwed up $PATH

Also, why don't you just write your own "session wrapper".

-Set up a global xinitrc in /etc/X11/xinit/ and make sure its executable.
-Make it functionally equivalent to this:

#!/bin/sh

[[ -f /etc/profile ]] && . /etc/profile

exec ck-launch-session $1

-Open /etc/lightdm/lightdm.conf and set

session-wrapper=/etc/X11/xinit/xinitrc

-Start lightdm normally and login. It should pick up the right environment variable. I haven't tested it to a great extend though, and maybe it works without ck-launch-session.

Last edited by Wey (2011-08-26 16:08:30)

Offline

#12 2011-10-21 01:51:55

hooluupog
Member
Registered: 2011-10-16
Posts: 28

Re: screwed up $PATH

Wey wrote:

Also, why don't you just write your own "session wrapper".

-Set up a global xinitrc in /etc/X11/xinit/ and make sure its executable.
-Make it functionally equivalent to this:

#!/bin/sh

[[ -f /etc/profile ]] && . /etc/profile

exec ck-launch-session $1

-Open /etc/lightdm/lightdm.conf and set

session-wrapper=/etc/X11/xinit/xinitrc

-Start lightdm normally and login. It should pick up the right environment variable. I haven't tested it to a great extend though, and maybe it works without ck-launch-session.

Hi, everyone,I need your help. smile
I tried the session wrapper and it works. However, it block the regular user(no root) to shutdown/reboot/suspend/hibernate  from the logout panel in xfce4.The panel just show log out button , the shutdown/reboot/suspend/hibernate buttons became gray and unable to  click. After I commented the session wrapper line in lightdm.conf, the log out panel return to normal. Is there any better methods  to source /etc/profile? THANKS!

Offline

#13 2011-10-21 07:33:39

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: screwed up $PATH

My local solution (I use Xfce so modify according to your desktop of choice)

# cp /usr/share/xsessions/xfce.desktop /usr/share/xsessions/<<WHATEVER>>.desktop

#nano /usr/share/xsessions/<<WHATEVER>>.desktop

Change the Name= field to something other than Xfce Session ( i just set it as my username)
Change the Exec= field to /home/<<USERNAME>>/.xinitrc
(Of course you could do as Wey has suggested and create a global xinitrc)
Save the file.

Now just export PATH in your ~/.xinitrc and launch your desktop session (no need to ck-launch-session as lightdm handles this). eg:

#! /bin/bash

export PATH=/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/local/bin/:/usr/bin/:/bin/

exec startxfce4

and make ~/.xinirtc executable

$ chmod +x ~/.xinitrc

Now when you login, in lightdm select the session name you created in /use/share/xsessions.

Cheers.

Last edited by Padfoot (2011-10-21 07:36:18)

Offline

#14 2011-10-21 08:15:29

hooluupog
Member
Registered: 2011-10-16
Posts: 28

Re: screwed up $PATH

Padfoot wrote:

My local solution (I use Xfce so modify according to your desktop of choice)

# cp /usr/share/xsessions/xfce.desktop /usr/share/xsessions/<<WHATEVER>>.desktop

#nano /usr/share/xsessions/<<WHATEVER>>.desktop

Change the Name= field to something other than Xfce Session ( i just set it as my username)
Change the Exec= field to /home/<<USERNAME>>/.xinitrc
(Of course you could do as Wey has suggested and create a global xinitrc)
Save the file.

Now just export PATH in your ~/.xinitrc and launch your desktop session (no need to ck-launch-session as lightdm handles this). eg:

#! /bin/bash

export PATH=/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/local/bin/:/usr/bin/:/bin/

exec startxfce4

and make ~/.xinirtc executable

$ chmod +x ~/.xinitrc

Now when you login, in lightdm select the session name you created in /use/share/xsessions.

Cheers.

Excellent!! It works fine to me smile 
By the way, how to autologin in lightDM+xfce4?

Offline

#15 2011-10-21 08:23:26

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: screwed up $PATH

hooluupog wrote:

Excellent!! It works fine to me smile 
By the way, how to autologin in lightDM+xfce4?

# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..............
autologin-user=<<USERNAME>>
autologin-user-timeout=<<TIME IN SECONDS>>
..............

Cheers.

Offline

#16 2011-10-21 08:45:44

hooluupog
Member
Registered: 2011-10-16
Posts: 28

Re: screwed up $PATH

Yep, my config file is :

[SeatDefaults]
..............
autologin-user=tom
autologin-user-timeout=3

It still let me input password. I found this line in lightdm.conf

#autologin-session=UNIMPLEMENTED

Thank you any way,The primal problem(posted on #12) was solved.

Last edited by hooluupog (2011-10-21 08:54:18)

Offline

#17 2011-10-21 09:05:31

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: screwed up $PATH

Ok, my ~/.xinitrc is my local solution as I customise my $XDG_DATA_DIRS environment variable to cater for my heavily customised Xfce menu system.

For a standard Xfce session with lightdm you need to do as Wey suggested - as follows:

# nano /etc/X11/xinit/xinitrc
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then

    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then

    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs


if [ -d /etc/X11/xinit/xinitrc.d ] ; then
	for f in /etc/X11/xinit/xinitrc.d/* ; do
		[ -x "$f" ] && . "$f"
	done
	unset f
fi

#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login

[[ -f /etc/profile ]] && . /etc/profile

exec $1
# chmod +x /etc/X11/xinit/xinitrc
# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..........
session-wrapper=/etc/X11/xinit/xinitrc
..........

Now just login to the normal Xfce Session from lightdm.

As for auto-login maybe try the following:

# nano /etc/lightdm/lightdm.conf
[SeatDefaults]
..........
autologin-user=<<USERNAME>>
autologin-user-timeout=<<SECONDS>>
autologin-session=/etc/X11/xinit/xinitrc
.........

Cheers.

Last edited by Padfoot (2011-10-21 09:06:47)

Offline

#18 2011-10-21 10:08:46

hooluupog
Member
Registered: 2011-10-16
Posts: 28

Re: screwed up $PATH

What a pity,it doesn't work. Thank you all the same for your patience and great help . Let's call it a day.

Last edited by hooluupog (2011-10-21 10:09:56)

Offline

Board footer

Powered by FluxBB