The equivalent of autoexec.bat in Linux. _I guess that is a good description of the entire rc.d and init mechanism, it just needs to be more complicated because Linux has multiple runlevels (single user, multiuser GUI, network, network and GUI) and (usually) runs multiple services by default. All the seeming complication of the init mechanism and the rc.d directories is to make it fairly simple to administer (in the typical Linux idiom).
I could start a
#Draft_Story
See:
Contents
Aside: Booting My System5
For the commands I need to issue after booting my
System5 to get access to the network / Internet, see
EthernetChecklist#System_5.
Of course, what I should do is incorporate those commands in an appropriate "local" file. — oh, well, maybe next week.
Notes
To a certain extent, it depends on the distribution (and the runlevel you are booting to).
I may provide an explanation of runlevel and so forth later, but for now, I just want to talk about starting some additional things manually, regardless of run level.
The way to do that is via an executable script file named local. Depending on distribution it may need to be named:
- /etc/rc.d/rc.local
- /etc/rc.local
- /etc/init.d/local
- /etc/rc.<n>/S99local # (where n=0, 1, ..., or 6) — some distributions (was it Mandrake (9.1) set up something like this so you can have specific local scripts run for different run levels (and, even if they don't, youi could do this)
Debian doesn't have the file installed by default, so here are a set of instructions to create it (empty) —
I assume it needs an appropriate shebang line depending on what it is written in:
cd /etc/init.d
vi local
chmod +x local
update-rc.d local defaults
update-rc.d is apparently a command (a Perl script in /usr/sbin) to update the rc.d directories so they run (rc2.d through rc5.d) or don't run (rc[0,1,6].d) the local file just created.
See:
Draft Story
partial, and very preliminary, just to give the idea:
If you are coming from dos or Windows, you are probably familiar with autoexec.bat and config.sys, the two files that "control" the startup of a dos system. In Windows, those two files can still be used, but there are also the files like windows.ini, win.ini, etc., that help configure Windows (in addition to the mechanisms like the registry and the ability to start programs by putting them in a startup directory).
Dos and Windows started from the simple, a single user and only one "program" (command.com) started automatically at startup. I don't know the full story of *nix — it may have started from similar humble roots, but it has been way beyond that for years.
By default, a Linux starts up multiple services (things like networking, ..., ) and is ready to serve multiple users. (You can, when appropriate, force Linux to work in a single user mode (usually for maintenance purposes), and start no services.
A program called init is the program that starts up a (most? — difference between BSD and Sys V??) Linux system. It has what appears to be at first a rather complex set of directories, files, and other programs that (can) participate in this process.
A directory named rc.d (?) contains files named with a special 3 character prefix ... and refers to (script) files in ... ... ... ... .
Contributors
- () RandyKramer - 13 Oct 2003
- If you edit this page: add your name here; move this to the next line; and if you've used a comment marker (your initials in parenthesis), include it before your WikiName.
Revision Comment
Page Ratings