PDA

View Full Version : Auto run of programs.



Mycroft1855
02-15-2003, 02:25 AM
Is it possible to setup Knoppix so that it will auto run a console based program as soon as the machine boots? Please use details on any methods described. Thanks.

mmaki
02-15-2003, 07:11 AM
I'm sure there are better and more efficient ways of doing this but this should work. And I assume this is after a HD install.
Creat a text file that begins with #! /bin/sh and follow with the commands you want executed.
Save your file in the /etc/rc5.d directory.
Make sure your file name starts with S99
Make sure it is executable by root (I believe).
It will now be one of the last scripts to be executed when your computer to boots (at least to the KNOPPIX default run level 5).

Good Luck,

Mike

Mycroft1855
02-25-2003, 03:16 AM
I gave your suggestion a shot and it gives me a permission error. I have made sure that it and the file to executed by the script are executable by all users.

Is there anything else that I need to place in the script file? I placed the text you gave mean and the following command:

"/cdrom/program/program"

Thanks again for the help.

mmaki
02-25-2003, 06:19 AM
What are you trying to do? More specifics might help.

David Douthitt
02-25-2003, 04:45 PM
I'm sure there are better and more efficient ways of doing this but this should work. And I assume this is after a HD install.
Creat a text file that begins with #! /bin/sh and follow with the commands you want executed.
Save your file in the /etc/rc5.d directory.
Make sure your file name starts with S99
Make sure it is executable by root (I believe).
It will now be one of the last scripts to be executed when your computer to boots (at least to the KNOPPIX default run level 5).

This assumes that one is using the Knoppix off of the hard drive, and that the user is entering run level 5.

If you are using a console-based program, you might be entering run level 2, in which case the program should be put into /etc/rc2.d. Make sure the program has permissions of 755 (rwxr-xr-x).

Better yet is to put the program into /etc/init.d and put a link in /etc/rc2.d:

cd /etc/rc2.d
ln -s ../init.d/myprog S99myprog

Notice that the link starts with S99 but the standard program does not.

Another way which works with the Knoppix CD is to put a shell script on a floppy and enter "floppyconfig" at the command line. With a console-based program, you probably want to use the "2" option also.

archtron
02-25-2003, 08:22 PM
And persistent-home, what level run ??
1,2, 5???
/home/knoppix in /ramdisk is mounted in that level??

Mycroft1855
02-26-2003, 12:24 AM
Thanks for everyones help. I had the permissions wrong before I compressed the Knoppix file but when I looked at them on the cd they appeared differently. Stupid mistake #542.