Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 03-03-2009, 12:33 AM   #1
LQ Newbie
Registered: Mar 2009
Posts: 2

Rep: Reputation: 1
Automatically start graphical (SDL) program as root on non-graphical Debian

I'm not a Linux noob, but I am far from guru. I'm running a single board computer with a slightly customized Debian Etch (customized by the SBC vendor). No Gnome/KDE/X installed.

My application is a control application which uses SDL (Simple DirectMedia Layer) to paint some basic graphics on the VGA. I need to run it as root because the application calls iopl() to access an IO port.

If I run my application manually from the command line, life is sweet. From Googling around, I found, and hence I:

1) Created a script in /etc/init.d
2) Executed "update-rc.d scriptName defaults" to link the script into the boot sequence

All very straightforward. My application starts at boot. But when I try to SSH/SFTP into the SBC, I get "Connection refused". So I can't manage the SBC anymore, and this is a big problem. I am not sure if it's relevant, but my application starts before the SSH daemon.

My script looked like:

case "$1" in
echo "Starting my application"
cd /home/user

It occured to me that the problem might be that my application is starting in the foreground. So I added an "$" to that line. Now I can SSH/SFTP into the SBC again, but I have a blank screen instead of my SDL graphics. This is possibly not surpising now that my application is running in the background.

How do I get the best of both worlds?
Old 03-03-2009, 03:20 PM   #2
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Make it start after ssh looks like the easiest way.
If your default runlevel is 2 (check with "grep default /etc/inittab"), do a "ls -l /etc/rc2.d|grep ssh" to see which startup number it has.
Say it had 20, do "update-rc.d scriptName start 25 2 . stop 25 0 1 6 ."
Or you can use sysv-rc-conf to do it.


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
Enable to start graphical root-tools xpucto Linux - Software 1 09-19-2005 12:39 PM
Enable to start graphical root-tools xpucto Fedora 0 09-19-2005 07:51 AM
graphical lilo....doensn't go graphical -0- Slackware 3 02-01-2005 08:47 PM
How do I get Bash to automatically bg graphical programs without the &? kindredstar Linux - Software 5 10-07-2004 11:05 AM
Sorry dumb question - how to start graphical root session in KDE OrganicOrange84 Linux - Newbie 4 08-16-2004 06:29 AM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:05 PM.

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