Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
You have 6 levels of boot time.
startup scripts are located in /etc/rc.d/rc%.d (where % is the run level).
/etc/rc.d/rc0.d/ Shutdown
/etc/rc.d/rc1.d/ Single user
/etc/rc.d/rc2.d/ Multiuser (no network)
/etc/rc.d/rc3.d/ Full multiuser - text console
/etc/rc.d/rc4.d/ Reserved
/etc/rc.d/rc5.d/ X fully functional
/etc/rc.d/rc6.d/ Reboot
Create your script in /etc/rc.d/init.d or in /etc/init.d (depending on your distro)
Then add a soft link in each run level to this script. the soft link name must begin with a 'K' or a 'S'. It is starts with a 'K', it means that the service must be stopped in this run level. With a 'S', it must run.
Practically, the init process will run all the scripts localted in the run level directory at each run level with 1 argument. This argument is 'start' or 'stop', depending if the script's first letter is 'K' or 'S'.
If you want something simpler :
Try to find a script in /etc/init.d or /etc/rc.d/init.d where you can add your script at the end.
For instance, if your script is about the network, you probably want it to run in levels 3, 4 and 5. There is probably a network starting script in /etc/init.d probably called network which is probably already soft linked in the right run level directories. Just add a call to your script at the end.
If you want something simpler :
Try to find a script in /etc/init.d or /etc/rc.d/init.d where you can add your script at the end.
For instance, if your script is about the network, you probably want it to run in levels 3, 4 and 5. There is probably a network starting script in /etc/init.d probably called network which is probably already soft linked in the right run level directories. Just add a call to your script at the end.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.