hi all, i am new to linux , my question is that i want to start a program when the linux boots , where do i issue the command to run this program , does it goes in one of the boot scripts in linux .
thanks in advance.
yahya
hi all, i am new to linux , my question is that i want to start a program when the linux boots , where do i issue the command to run this program , does it goes in one of the boot scripts in linux .
thanks in advance.
yahya
There's no need to post the same question to multiple forums - people will see your post.
What distro are you running?
Are you trying to run something as the machine actually boots, or rather when you log in?
running embedded linux,
need to start the program at boot , ( no need for any one to login)
I know know Embedded Linux myself, but most distros have should have a simliar setup. Look for the file rc.local, somehere under /etc most likely. Add the full path to what you're trying to run to the end of rc.local (make sure there's a blank line at the end of the file). If Embedded doesn't have an rc.local file, perhaps someone that knows that system better would be able to tell you the equivalent file.
example tail rc.local:
[spot@halb spot]$ tail /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/bin/time
/usr/bin/time above is a script I wrote to connect to a remote NTP server and sync my machine's clock, it runs every time the machine is booted via being added to the rc.local file.
You won't see all the fancy schmancy deals like the true init script, with the [OK] or [FAIL], but it will run. If you'd prefer to see it like other services, you're going to need to do some pretty deep reading and learn how to set it up via the init scripts.
Bookmarks