DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all I'm trying to get a programme to run from startup script, my script runs fine ie will say hello world, but won't start the programme. To run the programme from my start up I type
cd /root/software
./game
However this won't work, can anyone advise me how to I can tell my startup to go to a directory and start a game? Thanks
Your script needs to be executable, but also properly set up. Store it in your home-dir, that's fine. Then, once the script works, you'd have to make a sym-link from the /etc/rc2.d dir to the script. Post your script to see if it's ok.
Thanks Dutch Master but I'm unsure about some of your points, I'm using Etch and running the script (start up) from etc/init.d, I've made it executable by the
chmod -x startup
and made it run from
update-rc.d startup defaults.
my script runs as it will do things like print hello world.
Do I need to make it run from a hight number eg s99? To stop any conflicts?
If so I'm not sure how to allocate it's number base? thanks
I think it's something to do with my code running using x? So it's trying to start before x has initialized?
I tried starting x from inside the code rather than from a startup script, eg system("startx") but this just does the same start x windows but no game running
#! /bin/bash
# startup script
startx
sh /root/gamedirs/game
exit 0
This is However, X should start automatically if you've installed a window manager like xdm/kdm/gdm so you could ommit that part. I have a feeling you're trying to solve part of a larger problem, but if you tell us the exact problem in full (e.i. what you want to achieve) we can help you better.
Hi I'm using a min install of Etch with xorg core. I'm running it in an old arcade cabinet for arcade emulators. If you just install xorg on etch you need to manually start X. It's running great except I need to do a startx and ./game to run. I want to get rid of this step and the use of a keyboard .
I run min Etch as it boots very fast.
However my game/frontend uses GLX so x need to be running.
I'm sure it's because my frontend tries to run before x has started fully, and my tests seem to confirm this but I'm ussure how to solve this?
Thanks
OK, I understand. Your next step is one of 2 options:
a) tell the script to wait a certain time before executing the next command. You'll need to specify the waiting time long enough to be sure that X has started properly. This is the easiest option, but requires an absolute 100% guarantee that the X server will start within that time. (hint: you'll need the sleep command)
b) tell the script to test a specific X-related file to exist and it's contents before starting the next command. For this you'll need a loop and determine the outcome of all possibilities that the loop can give you. This is the most difficult but safest way.
Thanks dutch master tried the sleep but it doesn't work. I know the problem now, as far as I can tell whenever you start up X it produces the display as the very last thing. When you use GLX you call a display pointer, pointing to the screen, however as the very last thing in the boot sequence is to produce the screen it gives a null pointer, so no gui stuff can ever be produced before the actually system has booted up. The only way to start it is to use gnome or kde startup stuff.
So looks like I'll have to install gnome-core.
Hope tha makes sense basically x produces the screen pointer last thing, so whereever you call your code your variable to the screens returns null and segmentation faults.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.