Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[temp resolved] terminal window drops me to root dir
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Fri Oct 05, 2012 11:34 am    Post subject: [temp resolved] terminal window drops me to root dir Reply with quote

Hi, everytime I open a terminal window as a normal user, I find myself in the root directory rather than my home directory. Both my HOME variable and my /etc/passwd entry home directory are set correctly. How do I fix this?

Btw, I'm using awesome wm, no login manager. Systemd autologs me and launches my wm, though.

Thanks.


Last edited by logical_guy on Thu Oct 11, 2012 9:25 am; edited 1 time in total
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Fri Oct 05, 2012 12:06 pm    Post subject: Re: terminal window drops me to root dir Reply with quote

logical_guy wrote:
Hi, everytime I open a terminal window as a normal user, I find myself in the root directory rather than my home directory.
Systemd autologs me and launches my wm, though.

I'm guessing that you have

User=<user>
ExecStart=startx (or startxfce or xinit)

in your service file.

I tried that with the same result as you.
To fix it I use su, rather than User=

ExecStart=/bin/su <user> -l -c "/bin/bash --login -c startx"

I would love to know if there is a better solution.

Edit:
Getting rid of the superfluous invocation of bash
ExecStart=/bin/su <user> -l -c startx


Last edited by Leo Laursen on Fri Oct 05, 2012 6:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Oct 05, 2012 2:00 pm    Post subject: Re: terminal window drops me to root dir Reply with quote

logical_guy wrote:
How do I fix this?

logical_guy ... seriously, is that a trick question? Surely, on any unix system something that doesn't aquire $HOME on login is broken?

Leo Laursen wrote:
Code:
ExecStart=/bin/su <user> -l -c "/bin/bash --login -c startx"

I'm simply lost for words.

best ... khay
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Fri Oct 05, 2012 3:12 pm    Post subject: Netiquette Reply with quote

khayyam wrote:
Leo Laursen wrote:
Code:
ExecStart=/bin/su <user> -l -c "/bin/bash --login -c startx"

I'm simply lost for words.

That is obviously inherently untrue, but apart from being belligerent, I'm at a loss as to why you write it.
In order of likelyhood, I'm guessing

1. my solution sucks
2. systemd sucks
3. the fact, that anybody might want to use a tool in a way it wasn't designed for, sucks

neither of which really justifies the comment.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Oct 05, 2012 4:42 pm    Post subject: Reply with quote

systemd is so awesome
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Oct 05, 2012 7:54 pm    Post subject: Re: Netiquette Reply with quote

Leo Laursen wrote:
khayyam wrote:
I'm simply lost for words.

That is obviously inherently untrue, but apart from being belligerent, I'm at a loss as to why you write it.

Leo ... I'm at a loss becuase I simply don't know how to express my suprise at such an ExecStart, or why it would be necessary when session management via simple mechanisms is already in place. If these mechanisms are bypassed, then you can expect that the features that they provide (ie, environment variables, etc) are absent, and this need to get out from the inconvieniences of such things (ie, login from sys-apps/shadow) has to resort to calling them (ie, /bin/su from sys-apps/shadow) in order that "<user>" (hardcoded) rules. But thats just the tip of the iceberg.

Leo Laursen wrote:
In order of likelyhood, I'm guessing
1. my solution sucks
2. systemd sucks
3. the fact, that anybody might want to use a tool in a way it wasn't designed for, sucks
neither of which really justifies the comment.

Its best not to put words in my mouth ... and so given the choice I'd select option 4.

best ... khay
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Fri Oct 05, 2012 9:16 pm    Post subject: Re: Netiquette Reply with quote

khayyam wrote:
Leo ... I'm at a loss becuase I simply don't know how to express my suprise at such an ExecStart, or why it would be necessary when session management via simple mechanisms is already in place. If these mechanisms are bypassed, then you can expect that the features that they provide (ie, environment variables, etc) are absent, and this need to get out from the inconvieniences of such things (ie, login from sys-apps/shadow) has to resort to calling them (ie, /bin/su from sys-apps/shadow) in order that "<user>" (hardcoded) rules. But thats just the tip of the iceberg.

Well, thank you; this is a much better response. Unfortunately I don't really know what you mean by e.g. "session management via simple mechanisms", but that is just me being dense, and not your problem.
My solution works as I expect it to, i.e. exactly as when using startx from the command line.

The reason for posting it, as I wrote, was to find a better solution, preferably not including gdm or xdm.
Back to top
View user's profile Send private message
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Mon Oct 08, 2012 11:05 am    Post subject: Re: terminal window drops me to root dir Reply with quote

khayyam wrote:
logical_guy wrote:
How do I fix this?

logical_guy ... seriously, is that a trick question? Surely, on any unix system something that doesn't aquire $HOME on login is broken?


best ... khay


Okay, point noted. Now, back to my question - how do I fix this??
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Mon Oct 08, 2012 1:17 pm    Post subject: Reply with quote

Quote:
Okay, point noted. Now, back to my question - how do I fix this??

I'd suggest get rid of systemd and use openrc.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Oct 08, 2012 1:40 pm    Post subject: Reply with quote

The program you're using to open the terminal window has a $CWD of /, fix it there.
Back to top
View user's profile Send private message
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Tue Oct 09, 2012 1:16 pm    Post subject: Reply with quote

Yeah, went back to openRC. Missing the speed of systemd, though. Maybe next year...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum