I just tried out sshfs and it works great.
yum install fuse-sshfs
is all that is required to get it going on FC5.
Thanks Scott for an excellent presentation and making me aware of Fuse and sshfs.
-- Bill
According to Montana Quiring:
> Good information. Thanks.
>
> If I put this line in /etc/inittab:
> x:2:respawn:/usr/X11R6/bin/startx > tty1
> or
> x:2:respawn:/usr/X11R6/bin/startx
>
> I get this error after it boots up:
> /usr/X11R6/bin/startx: line xxx: xinit: command not found
> /usr/X11R6/bin/startx: line xxx: xauth: command not found
> (xxx being a number in the 100's)
>
> This led me to look at the startx script and I figured out that xauth …
[View More]and
> xinit were scripts in /usr/X11R6/bin/ that were not in the path when
> inittab was being run.
>
> So I edited startx and made the first line:
> export PATH=$PATH:/usr/X11R6/bin/
>
> Now X starts but it starts as root. *Insert frown here*
> I guess this makes sense because inittab is run as root, right?
That's correct. But wasn't that the case all along? I.e. when you ran
"/bin/bash -login" from inittab, and it called startx from .bash_profile,
that was all running as root as well?
But, I can see why you'd want to change that...
> So I edited the /etc/inittab again and changed the line to:
> x:2:respawn:/usr/bin/sudo -H -u me /usr/X11R6/bin/startx
>
> and I added this to sudoers:
> me ALL=NOPASSWD: /usr/X11R6/bin/startx
>
> but I get this error on bootup:
> X: user not authorized to run the X server, aborting.
> xinit: Server error.
>
> Gee wizz this has been a pain.
That's strange. I wonder what would happen on this machine if a non-root
user logged in (on a virtual console tty) and ran startx from a shell prompt?
I'm not sure why that would work if the above sudo command doesn't...
I wonder if console (or some other device) ownership is the issue? You may
need to set up a wrapper script which first sets device ownership correctly,
using pam_console_apply (if it's there) or a bunch of chown commands, then
does the sudo command, then finally (maybe) resets device ownerships after
the startx is finished.
--
Gilbert E. Detillieux E-mail: <gedetil(a)cs.umanitoba.ca>
Dept. of Computer Science Web: http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba Phone: (204)474-8161
Winnipeg, MB, CANADA R3T 2N2 Fax: (204)474-7609
[View Less]
According to Montana Quiring:
> Thanks for all the info Gilbert. You put me on the right path.
> I found that if I put:
> startx; kill -9 $$
> in the ~/.bash_profile
> It goes to a login prompt instead of a BASH prompt after the user presses
> Control+C, so that's a temp workaround.
There's a possible race condition there, I think, so it's perhaps not the
safest way to do it. Using "exec startx" might be better, since startx
would then replace the login shell, so there's no …
[View More]bash prompt (since there's
no more login shell) to return to.
> I would like to get your suggestion working in /etc/inittab
> I put the line:
> x:5:respawn:/usr/X11R6/bin/startx
> in my /etc/inittab after the other getty TTY's
> ...but like you said it looks like I need to redirect it to a tty, as X
> does not start up.
> I've been googling trying to figure out how to do that, but no dice yet.
> If you can give me a hint I'd appreciate it.
I don't think the tty is strictly needed here. See below...
> This is what is in my /etc/inttab:
> id:2:initdefault
This says the default run level is 2, so only inittab entries with a 2 in
their run level list will be considered...
> ....the rc scripts setup and stuff...
> 1:2345:respawn:/sbin/getty 38400 tty1
> 2:23:respawn:/sbin/getty 38400 tty2
These will work, since 2 is among their list of run levels.
> x:5:respawn:/usr/X11R6/bin/startx > tty1
This line will only work at run level 5, so you can either...
- change that to a 2, so it runs at the default run level,
- change the initdefault line to use run level 5, but that might break other
things...
- have a command run somewhere at the end of all the run level 2 stuff,
which says "/sbin/init 5" to change the run level. That's rather
convoluted, though. (But it's similar to what Solaris's init scripts do.)
> Thanks for your patience. I haven't worked with inittab much in the past,
> so this has been a real learning experience for me.
It's worth a careful read of the init(8) and inittab(5) man pages, to better
understand the concepts behind it. After than, the setup makes more sense.
--
Gilbert E. Detillieux E-mail: <gedetil(a)cs.umanitoba.ca>
Dept. of Computer Science Web: http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba Phone: (204)474-8161
Winnipeg, MB, CANADA R3T 2N2 Fax: (204)474-7609
[View Less]
According to Sean Cody:
> First of all this is under OpenBSD 3.9 but that should be immaterial
> to the issue.
>
> Basically if I run startx from a shell X starts and my .xinitrc is
> parsed/executed and all is well.
> Since I'm using X more I decided to enable xdm (via echo
> "xdm_flags="" > /etc/rc.conf.local; reboot; ) instead of launching
> manually from a shell.
> Now when I log in through XDM my .xinitrc isn't parsed/executed and I
> have to run …
[View More]it manually (fvwm notices my .fvwmrc so that part is
> working as expected).
>
> I'm not doing anything too complex and everything is rather 'stock'
> with changes to the default install are overridden in my home
> directory such as .Xdefaults and .fvwmrc . I'm using .xinitrc to set
> a pretty background (via xv(l) and to start an ssh-agent)
>
> Any ideas on how I can figure this out?
> I should probably investigate how XDM is launched and actually read
> the startx script, but I'm going to gamble on someone else already
> knowing why this happens.
Essentially, .xinitrc is only used by the startx script, which invokes
xinit. It's not used by any of the typical X display managers (xdm, kdm,
gdm, etc.). They typically have a different set of startup scripts they
use. In the case of xdm, there are system-wide startup, session and reset
scripts, which are specified in a resource file (typically, these are called
Xstartup, Xsession, and Xreset, and the resource file is xdm-config, all
located in the same system-wide directory). The startup and reset scripts
are always run as root, and are used (as their names suggest) to do special
tasks before and after the session is run. Furthermore, the Xsession file
(which is run as the logged-in user) will typically look for and exec a
user-specific ~/.xsession file.
If what you're doing in your .xinitrc file is fairly generic, you can
probably link it to .xsession as well, to use the one script for both
environments (startx/xinit and xdm/kdm/whatever). Of course, you'll want to
look at the system-wide session script for your display manager, to make
sure it does look for a user-specific script, and if so, which one.
--
Gilbert E. Detillieux E-mail: <gedetil(a)cs.umanitoba.ca>
Dept. of Computer Science Web: http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba Phone: (204)474-8161
Winnipeg, MB, CANADA R3T 2N2 Fax: (204)474-7609
[View Less]
According to Montana Quiring:
> Hello,
>
> Thanks for your feedback at the last MUUG meeting about the problem I had
> with Control+C droping someone to a shell prompt in the forst TTY.
>
> I had a google group thread here if you want to read/respond there:
> http://groups.google.ca/group/ubuntu_lite/browse_thread/thread/11b044eeebe0…
If you read this thread to the end, you'll see that the X server is launched
from within root's ~/.bash_profile, which would explain why …
[View More]you see this
problem...
> I changed the line in /etc/inittab from:
> 1:2345:respawn:/bin/bash -login > /dev/tty1 2>&1 < /dev/tty1
> to:
> 1:2345:respawn:/sbin/getty 38400 tty1
>
> and that solves to problem of getting to a shell but now X Windows doesn't
> start.
>
> I don't fully understand what the orig line is doing and I think that's my
> problem.
As Bill mentioned, the redirect stuff is what you see at the end of the
line. however, the /bin/bash -login is the key part here. The -login
option forces bash to treat this as a login shell, and read the
.bash_profile for the logged-in user (root in this case, since init runs
as root, and nothing has been done to change to a different userid).
This strikes me as a roundabout way of doing things, and also (as you've
discovered) not very bullet-proof. I'd recommend you change the
.bash_profile to not start the X server from there, but rather start it
in its own line in /etc/inittab, such as this...
x:5:respawn:/usr/X11R6/bin/startx
Decide which runlevel(s) is/are appropriate for this system, of course.
Also, you may want to just use the command line you've commented out of
the .bash_profile, if it's different than the startx above, but you will
need to specify the full path name of the command explicitly, I believe.
Also note that commands started in inittab aren't automatically bound to a
tty (such as a virtual console), so you might need to explicitly do so using
redirects (as they did for the bash -login). That's not necessary when you
invoke getty, since you specify a tty as a command line argument to it, and
it's job is to set up a process group bound to the tty. This likely won't
matter in the case of X, but if you want to debug or check output from the
X server or clients, then you should redirect it somewhere (a log file if
not a virtual console).
--
Gilbert E. Detillieux E-mail: <gedetil(a)cs.umanitoba.ca>
Dept. of Computer Science Web: http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba Phone: (204)474-8161
Winnipeg, MB, CANADA R3T 2N2 Fax: (204)474-7609
[View Less]
Sorry, I forgot to CC MUUG.
-Montana
---------------------------- Original Message ----------------------------
Subject: Re: [RndTbl] TTY1 and Starting X Windows
From: "Montana Quiring" <montanaq(a)gmail.com>
Date: Tue, April 18, 2006 3:05 pm
To: "Bill Reid" <billreid(a)shaw.ca>
--------------------------------------------------------------------------
Thanks for The reply Bill.
I tried changing inittab again and this time around it lets me start X
after I log in. I …
[View More]miht have goofed something last time.
Because these machines are in a lab I want them to log into X
automatically like they were doing, and I don't want the students to have
access to the command line.
Do I need to install a login-manager?
-Montana
"When I give, I give myself.
-Walt Whitman
On Tue, April 18, 2006 12:08 pm, Bill Reid said:
> Montana Quiring wrote:
>
>>
>> and that solves to problem of getting to a shell but now X Windows doesn't
>> start.
>>
>
> Do you mean that issuing the startx does not work?
>
>> I don't fully understand what the orig line is doing and I think that's my
>> problem.
>>
>
> It is setting stdout and stdout to tty1 and redirecting stderr to stdout.
>
> -- Bill
>
[View Less]
Hello,
Thanks for your feedback at the last MUUG meeting about the problem I had
with Control+C droping someone to a shell prompt in the forst TTY.
I had a google group thread here if you want to read/respond there:
http://groups.google.ca/group/ubuntu_lite/browse_thread/thread/11b044eeebe0…
I changed the line in /etc/inittab from:
1:2345:respawn:/bin/bash -login > /dev/tty1 2>&1 < /dev/tty1
to:
1:2345:respawn:/sbin/getty 38400 tty1
and that solves to problem of getting to a …
[View More]shell but now X Windows doesn't
start.
I don't fully understand what the orig line is doing and I think that's my
problem.
I tried to put a Control C trap in ~.bash_profile, ~.bashrc,
/etc/profile /etc/bash.bashrc by putting this line it:
trap "" 2
It works after the X server has been killed but doesn't seem to stop my
from pressing Control C to kill it.
Maybe I'm going about this all wrong.
If I run /sbin/getty in the inittab how do I get it to start X?
Any help would be appreciated.
-Montana
"When I give, I give myself.
-Walt Whitman
[View Less]
Hello,
Thanks for your feedback at the last MUUG meeting about the problem I had
with Control+C droping someone to a shell prompt in the forst TTY.
I had a google group thread here if you want to read/respond there:
http://groups.google.ca/group/ubuntu_lite/browse_thread/thread/11b044eeebe0…
I changed the line in /etc/inittab from:
1:2345:respawn:/bin/bash -login > /dev/tty1 2>&1 < /dev/tty1
to:
1:2345:respawn:/sbin/getty 38400 tty1
and that solves to problem of getting to a …
[View More]shell but now X Windows doesn't
start.
I don't fully understand what the orig line is doing and I think that's my
problem.
Any help would be appreciated.
-Montana
"When I give, I give myself.
-Walt Whitman
*** If your email looks like it's a forward and not a personally composed
email, I may not get time to read it. If you're email is more than 1 Meg
in size I probably won't open it. ***
[View Less]
At last night's MUUG meeting someone asked me why the Winnipeg Python
Users Group meets in the middle of the afternoon.
We don't (anymore).
Our next meeting is April 26th at 7:30 p.m., usually done by 9:00 or
9:30 p.m. We'll be looking at some novice code, so while not an
explicit introduction to Python, it should be approachable to all.
For more information see our web site at http://WinniPUG.ca
Stuart Williams.
OK, have a RedHat 7 system with a dying HD. So I ran Norton Ghost and
copied everything over to a newer drive (same size, just newer). I've been
hours on the 'Net and tried a number of different instructions on
installign Lilo to the new HD so that it boots when moved from hdb to hda.
Nothing seems to work.
Sorry, I haven't logged everything I've done, as I (silly me) kept hoping
that *this time* something *would* work. But this shutting down every
night to re-Ghost the drive to keep it …
[View More]current when I try something new is
just silly. It seems to me that there has to be a pretty straight forward
way of installing Lilo that I'm just not finding.
This is my last shot at doing it this way, I'm hoping someone has an
idea.... My next move is to just build another server, and set everything
up on that one...
[View Less]