View previous topic :: View next topic |
Author |
Message |
logical_guy Apprentice
Joined: 18 Sep 2007 Posts: 268
|
Posted: Fri Oct 05, 2012 11:34 am Post subject: [temp resolved] terminal window drops me to root dir |
|
|
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 |
|
|
Leo Laursen n00b
Joined: 29 Mar 2012 Posts: 38
|
Posted: Fri Oct 05, 2012 12:06 pm Post subject: Re: terminal window drops me to root dir |
|
|
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 |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Oct 05, 2012 2:00 pm Post subject: Re: terminal window drops me to root dir |
|
|
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 |
|
|
Leo Laursen n00b
Joined: 29 Mar 2012 Posts: 38
|
Posted: Fri Oct 05, 2012 3:12 pm Post subject: Netiquette |
|
|
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 |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Oct 05, 2012 4:42 pm Post subject: |
|
|
systemd is so awesome |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Oct 05, 2012 7:54 pm Post subject: Re: Netiquette |
|
|
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 |
|
|
Leo Laursen n00b
Joined: 29 Mar 2012 Posts: 38
|
Posted: Fri Oct 05, 2012 9:16 pm Post subject: Re: Netiquette |
|
|
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 |
|
|
logical_guy Apprentice
Joined: 18 Sep 2007 Posts: 268
|
Posted: Mon Oct 08, 2012 11:05 am Post subject: Re: terminal window drops me to root dir |
|
|
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 |
|
|
gerard27 Advocate
Joined: 04 Jan 2004 Posts: 2377 Location: Netherlands
|
Posted: Mon Oct 08, 2012 1:17 pm Post subject: |
|
|
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 |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Mon Oct 08, 2012 1:40 pm Post subject: |
|
|
The program you're using to open the terminal window has a $CWD of /, fix it there. |
|
Back to top |
|
|
logical_guy Apprentice
Joined: 18 Sep 2007 Posts: 268
|
Posted: Tue Oct 09, 2012 1:16 pm Post subject: |
|
|
Yeah, went back to openRC. Missing the speed of systemd, though. Maybe next year... |
|
Back to top |
|
|
|