Click to See Complete Forum and Search --> : Running program on startup


tecknophreak
12-07-2001, 02:55 PM
I need to run a *.pl and a c++ on bootup automatically. how do i go about this? i'm in single user mode, if that has anything to do with it.

vee-eye
12-07-2001, 04:33 PM
I think that any commands in this file will run on startup:

/etc/rc.d/rc.local

Put the commands that execute the programs at the end of the file. I could be wrong, though.

bwkaz
12-07-2001, 05:39 PM
Check /etc/inittab. The first large set of lines are what get run at each runlevel. Single-user is typically runlevel 1, so find what gets run at runlevel 1, and edit that file. At the end of it, add commands to execute your perl script and your C++ program. If you can't tell what gets run at startup, post your inittab here and I'll see what I can find.

TheLinuxDuck
12-07-2001, 06:10 PM
tecknophreak:

What distro? Do the files need to be run when the system boots, when any user logs in, or just when a specific user logs in?

tecknophreak
12-07-2001, 06:11 PM
bwkaz, does /etc/rc.1/S00single sound like the correct file?

TheLinuxDuck
12-07-2001, 06:16 PM
tp:

Just edit /etc/rc.d/rc.local, and put your stuff on the end. That's one of the easiest ways.

tecknophreak
12-07-2001, 06:42 PM
/etc/rc.d/rc.local?

well i'm not sure how to run a program from in there. any special line? the perl script does an insmod.

bwkaz
12-07-2001, 07:04 PM
I'm fairly sure rc.local gets executed at every runlevel, so sure, go for it.

No special commands or anything. Whatever you would type in at a command prompt to run your programs, you can put as a line in the shell script and it'll be executed. But if all you're doing is an insmod, you may just want to put the insmod in the script, because if you do that, you won't have to load a Perl interpreter. Dunno if that's important, but if it takes a while it might be bad.