starting a programme from boot script in Etch
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 |
Yes, you'll need a number in the sym-link, otherwise the kernel doesn't know when to execute the script in the boot-sequence.
|
Thanks but no luck. I really don't now why it won't start the game :(
|
You still didn't post the script, so I can't tell if that's OK....
|
Sorry my script says
echo "script running" startx ./../../root/gamedirs/game 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 |
Your script isn't a script yet:
Code:
#! /bin/bash |
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. Learn about scripting here: http://tldp.org/LDP/abs/html/ |
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. |
All times are GMT -5. The time now is 12:00 AM. |