Advertisement

Linux startup configuration files for newbie

Started by February 24, 2002 07:31 AM
5 comments, last by Abominus 22 years, 6 months ago
what are the configuration files that are accessed when linux boots right up till the user is logged in? is there an equivalent of an "autoexec.bat" script of file that is automatically run when the system boots/user logs in? Im running redhat 7.1 btw. Thanks. Edited by - Abominus on February 24, 2002 8:32:59 AM
Depending on what runlevel it is, different files are run. You should have a directory of symbolic links. read man init.

If you want to run a file just for when your user starts up, I think redhat has .bashrc in your home directory. At the end of it just put the full path to your program.
Advertisement
.profile in a home directory can also be edited to allow echo''ing on login and execution of scripts.
I am using slackware (which isn''t SYS V) but i use this file /etc/rc.d/rc.local. You may or may not have that file.
quote: Original post by Ravuya
.profile in a home directory can also be edited to allow echo''ing on login and execution of scripts.


Thanks. But where if the .profile for root kept? And .profile is user specific. Is there another file which is global to the entire machine. What I mean is a startup file which is run regardless of which user logs in.
/etc/profile
/etc/rc.local

You probably don''t want to touch the latter, and messing with the former can lead to a nice mess too, so be careful with what you''re trying to do.
Advertisement
Ok, a couple of clarifications seem in order.

/etc/profile: run right after the user enters their username and password. Can be overrided by a (homedir)/.profile depending on system configuration.

/root/.profile: the location of the .profile file for root.

(note that you have to use an "ls -a" command to see files that begin with a ".".

/etc/rc.d/rc.local: run when the system boots up. Not that scary.

/etc/rc.d/rc#.d: (replace # with run-level number). Run on system boot into appropriate run level. Kind of messy.

Each have different uses.

They''re coming for you!

This topic is closed to new replies.

Advertisement