LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-06-2010, 09:28 AM   #1
richman1234
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora12 & Angstrom
Posts: 22

Rep: Reputation: 0
Xwindow's program will not run when executed on boot or when executed remotely


I have written and tested an SDL graphics program. It is a very basic program that just displays a bitmap over the whole screen (not in a window). It works very well on my FC12 machine when I type ./screen_test in the shell. It also works well on my embedded computer (with it's own monitor) when I type ./screen_test in its shell.

Here is the problem:
When I ssh into the embedded computer and type ./screen_test I get an error when executing the part of the code that draws to the screen. (This confusions some so let me explain. I want the program to run on and display on the embedded computer, I am just launching it from my laptop by sshing into it.)

I have the same problem when I set up a shell script to run the program automatically on boot. After X11 is launched on my embedded computer, "screen_test" is run automatically by a shell script, but I get the same error.

Cause:
I believe the cause is that the <user???> running the program doesn't have the ability to control the frame buffer.

Can some one help shed some light on this problem? Being verbose on my comments would be helpful, I am kinda new to linux.

thanks,
Rich
 
Old 10-07-2010, 03:05 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
When running from a boot script, does setting the display help?
eg
Code:
DISPLAY=:0.0 ./screen_test
You can do the same from a remote login, but this assumes an X session is already open for that user.
 
1 members found this post helpful.
Old 10-08-2010, 01:32 PM   #3
richman1234
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora12 & Angstrom
Posts: 22

Original Poster
Rep: Reputation: 0
Holy stink'n cow! THAT'S IT! I have looked all week for a fix to this problem. I have even tried:
# DISPLAY=:0.0
#./test_prog

but it didn't work. However, trying your sugestion:
$ DISPLAY=:0.0 ./test_prog
IT WORKS!

Thank you for your help.
 
  


Reply



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
python, tkinter, command is executed when program is run not when button clicked deathalele Programming 5 06-15-2009 03:13 PM
How can I get a binary to run at a certain priority when executed by a user? abefroman Linux - Server 2 05-30-2008 09:03 AM
is there a way to find out who executed a program? vannguyen0 Linux - Software 1 07-03-2007 01:44 PM
how is my program executed by bash and the kernel aheak123 Programming 2 08-20-2006 05:41 PM
getting output from a program executed from c++ dfuse Programming 6 08-22-2003 02:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration