DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th March 2011
kpedersen kpedersen is offline
Port Guard
 
Join Date: Nov 2009
Posts: 20
Thanked 0 Times in 0 Posts
Default Xorg run from rc.local no keyboard response

Hello,

Currently for one of my machines, I have it automatically starting X using rc.local. E.g by putting in the following line.

Code:
su -l myusername -c "xinit twm &"
Whilst this works pretty well, I seem to not be able to type anything on the keyboard (keypresses go to the ttyC0 console underneath instead). To hack around this I have to write a script that waits 10 seconds and then runs 'xinit twm'. With this then it seems to have expected behavior.

Can anyone suggest a reason for this?

Best Regards,
Reply With Quote
  #2   (View Single Post)  
Old 16th March 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

If you want X to start during boot, it makes more sense to use a display manager.. xdm(1) is in base and can be started by adding a single line to /etc/rc.conf.local.

You could also start it by adding something to your shell initialization script, see your home directory.
Reply With Quote
  #3   (View Single Post)  
Old 16th March 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,668
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by kpedersen View Post
Can anyone suggest a reason for this?
Yep, but it only a suggestion. The xinit application was designed to be run by a logged in end user, with both an attached tty/pty and a $HOME environment variable. It was not intented to be run by an rc(8) script at initialization time.

Like BSDfan666, I would recommend xdm. It is highly configurable, and designed for this purpose.
Reply With Quote
  #4   (View Single Post)  
Old 16th March 2011
kpedersen kpedersen is offline
Port Guard
 
Join Date: Nov 2009
Posts: 20
Thanked 0 Times in 0 Posts
Default

The issue with XDM is that the user would need to log in.
Ideally this machine is to be used as a permanently logged in terminal with a GUI and interactive application running. (twm was just a simple example)

I used to use FreeBSD for this (put a similar script in '/etc/rc.d' and it worked well), unfortunately OpenBSD better supports the hardware than FreeBSD, thus the change.

Is there a way to forcefully attach a tty/pty before I call xinit (or startx)?

On another note I am also concerned that my clone of CDE's dtlogin is going to have problems with OpenBSD because it uses a similar method of starting up.
Reply With Quote
  #5   (View Single Post)  
Old 17th March 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

There are other display managers in the ports tree, gdm/kdm/slim, the idea of logging in automatically seems very inadvisable though.. but probably supported by one of them.

http://en.wikipedia.org/wiki/X_displ...mplementations

You may be able to workaround your problem and start X in the way you wish, but isn't a traditional way of doing things.

Note that using your method X will not recover if it crashes or is terminated by the user.. so you may wish to make your rc.local a bit more intelligent.

Indeed the keyboard input will probably be intercepted by the other wscons terminal, the following before or after executing xinit might help.. or even better try turning off ttyC0 in /etc/ttys.

wsconsctl display.focus=4

Good luck.
Reply With Quote
  #6   (View Single Post)  
Old 18th March 2011
kpedersen kpedersen is offline
Port Guard
 
Join Date: Nov 2009
Posts: 20
Thanked 0 Times in 0 Posts
Default

Hello,

I tried the wsconsctl trick you suggested but unfortunately it seems to just flick back to ttyC0 and when I try to go to x11 (ctrl-alt-F5) it doesn't seem to exist.

Oh well, I will probably just make do with my 10 seconds wait since I don't really want to disable ttyC0 in /etc/ttys.

Thanks for the suggestion and If I come up with a great workaround, I will update this post.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AMD Fusion APU benchmarks, the AMD's 'Response to Atom CPU' vermaden News 1 6th January 2011 12:56 AM
Can't Response Ping Request widhi OpenBSD General 5 24th March 2010 10:40 PM
Tor Project infrastructure updates in response to security breach J65nko News 1 22nd January 2010 06:57 PM
log from rc.conf.local and rc.local sdesilet OpenBSD General 1 21st January 2010 02:37 AM


All times are GMT. The time now is 03:10 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick