ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hello! I'm trying to get a script to run after reboot, and I have previously gotten advice to place it in the /etc/profile.d/, which turned out to be a horrid idea (almost broke my system). All I'm trying to do with my script is use "apt-get remove" on a bunch of patches. I also heard soemthing about putting it into /etc/rc3.d/, but nothing ever happens when I throw it in there.
You can try running the script from /etc/rc.d/rc.local. That's the last init script to run. Is this something you want to run every time you reboot or just a one shot deal? It's not clear why you would want to remove patches on every reboot. There may be simpler solutions to your problem.
Oh, and what is meant by "running it from /etc/rc.d/rc.local"? Can I just throw it in there and it'll startup after reboot? I'm trying to automate this process in a script, so the "simpler" the task, the better.
rc.local isn't really for that kind of task; it's meant for recurring commands that you want run every time you boot up. Why don't you just boot up, login and run whatever commands you want? If you have a script that you want run, put it in your home directory, boot up, login and run:
The chmod command makes the script executable if it's not already. The "./<script_name>" is the syntax for running the a script in your current working directory which should be your home directory after you boot up, i.e. where I told you to put the script.
Because a script (literally run on thousands of computers) is going to generate THAT script, will need it to run once after reboot and then remove itself. I'm not down for running it manually that many times...
On reboot, you will get a text file in your home directory named "hi.txt" with the words "Hi!" in it.
If you have to admin literally thousands of machines, I'd suggest that you obtain the services of a competent linux sysadmin. No offense, but this is not the kind of task that should be undertaken by someone that doesn't understand what rc.local is all about. A rollout of that size by someone inexperienced is a blueprint for disaster IMHO.