Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I'm not positive on this, but I think what happens is that the login command essentially ends the rc.local's execution. Are you booting into the command line or the gui? If you're loading into the gui, there are better ways to run commands, using a user's .xinitrc file.
Do you want the script to run regardless of who is logging in, or do you want different (or no) scripts for different users?
If you want to have a general startup script for all users, you can insert the script into /etc/init.d, and then use chkconfig to enable it for the run levels you want it to run at.
i.e.
make /etc/init.d/boot.script
then type
chkconfig 3 boot.script on
this will enable the boot.script file in runlevel 3. It will create a symbolic link to the script in /etc/rc.d/rc3.d/ That way, whenever the computer enters runlevel 3, it should run. If you want user level scripting... it's definitely doable, but I'm not positive on how to do it for the command line.
Oh, and the chkconfig tool is redhat specific, so if you're using a different distro, you might have to do it manually, download chkconfig, or use a similar tool. I know gentoo, debian, and suse have similar functions, but with different names. Something like rc-update I think.
This post had something similar, it might be of interest.
OK... just talked to a friend fo mine about it, and there is an easier way for post login stuff to run in command line. In each user's home directory, there is a file called .bashrc or .cshrc depending on which shell you use. anything in that file will be run after that user logs in. That's probably your best bet....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.