LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-27-2013, 01:07 PM   #1
rtmistler
Senior Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 1,119
Blog Entries: 7

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Having trouble configuring to autostart app in xserver with no display manager


Running on a BeagleBone Black, using their provided distribution, 3.8.13. Using the CircuitCo 3.5" TFT LCD display. My intentions were to autostart a GUI application at power on, not presently caring whether or not it's under the root user.

I've managed to get the X server running with no display manager. Have a UI based application which runs fine, full screen and all. The X server also will start automatically at boot.

What I'm having difficulty doing is getting the app to be automatically run just after the X server is running.

Here's what I have that accomplishes this.

- Had to install xf86-video-fbdev to get the X server so that it would allow me to rotate the screen.
- Went into /etc/rc#.d and removed the gdm scripts to stop gnome
- xorg.conf looks like this:
Code:
Section "Device"                                  
        Identifier      "Frame Buffer"
        Driver  "fbdev"
	Option	"Rotate"	"CCW"
EndSection
That's the whole file, no additional stuff.
- In order to run the X server after boot, I added this script to /etc/init.d:
Code:
#!/bin/sh

/usr/bin/setterm -blank 0
/usr/bin/setterm -powersave off
/usr/bin/startx -- -nocursor
And run that from levels 2345, after any other scripts were run.

Thus far this gets my display manager run and gets me to a prompt.

Interestingly, if I don't auto-run the x server, and run the startx command from the command prompt; the path available at the prompt once in the server matches root's home directory, and all of root's environment are there.

Auto-running the x server, the directory is "/", and root's environment information is not there, however the user is root.

Therefore trying to create a .xinitrc in root's home does not appear to work. I've placed an echo line to place info into a file to see if the script gets run and the UI happened to fail for some reason. It seems pretty clear that the .xinitrc script is not being run. So I looked into playing with the default xinitrc, no dice there; it ran the script but did not load the server. I'm not sure if that's all backwards either, for instance if the xinitrc runs before the server or any window manager runs. But I'm not running any window manager, just the server.

The reason I need the server is that Qt was near impossible to build for this, and FLTK worked extremely well. However FLTK does not yet work directly out of the frame buffer, hence it requires the X server.

Any suggestions on this? Should I try to figure a way to auto-login as root and from within there have a script which runs startx and then next get my UI running?

My Solution
In the end I had to edit the /usb/lib/X11/xinit/xinitrc file to place the starting of my application at the end of that file. I knew of that file, however this particular copy had xterms as well as xclock being run out of it and also knew that no xterms were running on my screen. In looking at the total processes running I did see that the xterm sessions were running; therefore this xinitrc was being used. So I removed all of the file and now it loads automatically to my custom GUI.

Here's the xinitrc:
Code:
#!/bin/sh
exec /home/root/myui

Last edited by rtmistler; 12-03-2013 at 08:07 AM.
 
Old 12-03-2013, 08:06 AM   #2
elucches
Member
 
Registered: Jan 2011
Posts: 91

Rep: Reputation: 8
Hello, I just want to say this blog post -which I didn't try and uses blackbox- might give you some hint. Some time ago I intended to do somethig similar to what you're trying to achieve and saved that link (for now I can use Qt embedded server without X).
Good luck,
Esteban
 
1 members found this post helpful.
Old 12-03-2013, 08:16 AM   #3
rtmistler
Senior Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 1,119
Blog Entries: 7

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Quote:
Originally Posted by elucches View Post
Hello, I just want to say this blog post -which I didn't try and uses blackbox- might give you some hint. Some time ago I intended to do somethig similar to what you're trying to achieve and saved that link (for now I can use Qt embedded server without X).
Good luck,
Esteban
Thanks. You caught me just updating the thread and marking it as solved because I self-resolved it. Yes, I've seen a few blogs like that one which refer to the /etc/inittab. Beagleboard's Angstrom doesn't have any inittab, but I gave that a try and tried to just use only the getty line in an inittab or grabbed an inittab from another distribution, but neither seemed to get me there. In parallel I was able to modify the xinitrc in the default location.

I have to say that I've not always been a real good X server person. It took me quite a bit to get the screen to rotate, and then to do this part. There are several ways to skin the cat here. If nothing, I'd be happier if it was possible to explain better to everyone, how the Xserver loads, exactly where it looks, what key words it accepts. But I do realize that it's a complex topic. And further, truthfully I had tried that xinitrc long ago, but instead of putting in exec I had put in ./home/root/mygui. The problem was, in having made that change, the whole Xserver then did not load and I went "whoa-oh!" and gave that effort up quickly. Not understanding any of all the environmental stuff in there. In the end, I checked it section by section and found that a 2-line xinitrc works perfectly fine; I just had to hit the exactly precise variations. I shouldn't complain, this is just my frustration with the mysteries of Xserver showing.
 
Old 12-04-2013, 02:17 PM   #4
elucches
Member
 
Registered: Jan 2011
Posts: 91

Rep: Reputation: 8
Yes, X is too complex. Good to hear you've solved it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE-core & K Display Manager or LXDE with Okular (KDE app)! Advice Pro Linux - Newbie 1 12-30-2011 09:43 PM
KDE WiFi manager won't autostart anibis Linux - Wireless Networking 2 08-06-2006 06:11 PM
howto autostart an app when it crashs or killed houssamfarag Mandriva 3 12-27-2005 04:22 PM
configuring Xserver niteshg Linux - Software 1 09-04-2005 02:05 AM
Trouble with autostart in kde... Toker Linux - Newbie 6 10-10-2003 02:49 PM


All times are GMT -5. The time now is 07:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration