为什么ubuntu中没有inittab文件

来源:互联网 发布:淘宝睡衣退款率 编辑:程序博客网 时间:2024/05/22 02:26
linux 启动时第一个进程是/sbin/init,其主要功能就是软件执行环境,包括系统的主机名、网络设置、语系处理、文件系统格式及其他服务的启动等。其配置文件就是/etc/inittab,但在我的ubuntu10.10却没有找到此文件。
原来ubuntu中使用/etc/event.d这个目录,完成相似的功能。ubuntu9.10版本的upstart不再用/etc/event.d这个目录了。而是改用/etc/init目录。在/etc/init/下发现一个文件rc-sysinit.conf,与rc.sysinit文件名相似,于是打开发现其中有如下内容:
[html] view plaincopyprint?
  1. # rc-sysinit - System V initialisation compatibility 
  2. #    
  3. # This task runs the old System V-style system initialisation scripts, 
  4.  
  5. # and enters the default runlevel when finished. 
  6. # Check for default runlevel in /etc/inittab 
  7.     
  8. if [ -r /etc/inittab ]         
  9.      then                
  10.     eval "$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL="\1";/p' /etc/inittab || true)" 
  11. fi 
  12. ......   
  13.  
  14. # Run the system initialisation scripts        
  15. [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/rcS 
很明显,在ubuntu还是支持/etc/initab文件的。脚本的最后会执行/etc/init.d/rcS, rcS的内容为::
[html] view plaincopyprint?
  1. #! /bin/sh   
  2. #    
  3. # rcS    
  4. #    
  5. # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order   

文件中所有的语句竟然都被注释掉了,看来此文件的存在只是为了兼容而已,没有实现用处。不过还是看一看srS.d目录:

[html] view plaincopyprint?
  1. gavin@ubuntu:/etc/rcS.d$ ll  
  2. 总计 20 
  3. -rw-r--r--   1 root root   447 2009-09-07 11:58 README 
  4. lrwxrwxrwx   1 root root    18 2010-12-07 05:27 S01apparmor -> ../init.d/apparmor* 
  5. lrwxrwxrwx   1 root root    16 2010-12-07 05:27 S01brltty -> ../init.d/brltty* 
  6. lrwxrwxrwx   1 root root    20 2010-12-07 05:27 S01lm-sensors -> ../init.d/lm-sensors* 
  7. lrwxrwxrwx   1 root root    20 2010-12-07 05:27 S01x11-common -> ../init.d/x11-common* 
  8. lrwxrwxrwx   1 root root    21 2010-12-07 05:27 S02pcmciautils -> ../init.d/pcmciautils* 
  9. lrwxrwxrwx   1 root root    17 2010-12-07 05:27 S02urandom -> ../init.d/urandom* 

所有文件都是符号链接,都指向../init.d目录中的文件
0 0
原创粉丝点击