Linux - rc.d

来源:互联网 发布:arduino图形化编程软件 编辑:程序博客网 时间:2024/06/05 01:12
All Linux distros use rc.d to handle initialization jobs. You can see files rc.0, rc.1, rc.2, rc.3, rc.4, rc.5, rc.6 in /etc, or directories rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d, rc6.d, which according to different distribution . Script files inside these sub-folders are the stuff Linux will do during logon. Number 0~6 correspond runlevel 0~6. The default runlevel your PC will take is specified in file /etc/inittab as the line below:

                id:4:initdefault:

You can specify jobs the specified runlevel will do respectively in the corresponding files(or directories). Note that for directories, actually files inside it usually are all symbolic links to /etc/init.d

There is a simple way to add your customized jobs: add them into file /etc/rc.local, which will be executed after all the other initialized works and before logon prompt.

Run Level

Generic

Fedora Core

Slackware

Debian

0 Halt Halt Halt Halt 1 Single-user mode Single-user mode Single-user mode Single-user mode 2 Basic multi-user mode (without networking) User definable (Unused) User definable - configured the same as runlevel 3 Multi-user mode 3 Full (text based) multi-user mode Multi-user mode Multi-user mode - default Slackware runlevel 4 Not used Not used X11 with KDM/GDM/XDM (session managers) Multi-user mode 5 Full (GUI based) multi-user mode Full multi-user mode (with an X-based login screen) - default runlevel User definable - configured the same as runlevel 3 Multi-user mode 6 Reboot Reboot Reboot Reboot
原创粉丝点击