zoukankan      html  css  js  c++  java
  • 【转】ubuntu中没有/etc/inittab文件探究

    原文网址:http://blog.csdn.net/gavinr/article/details/6584582

    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文件名相似,于是打开发现其中有如下内容:
    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的内容为::
    1. #! /bin/sh    
    2. #     
    3. # rcS     
    4. #     
    5. # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order    
    6. #  

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

    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目录中的文件 
  • 相关阅读:
    系统综合实践第三次实践
    系统综合实践第二次实践作业
    第1次实践作业
    软工总结
    团队Beta演示
    团队Beta5
    软工实践个人总结
    第09组 Beta版本演示
    第09组 Beta冲刺(5/5)
    第09组 Beta冲刺(4/5)
  • 原文地址:https://www.cnblogs.com/wi100sh/p/4206149.html
Copyright © 2011-2022 走看看