免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 889 | 回复: 0
打印 上一主题 下一主题

qq2440 linux初始化过程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-09 09:49 |只看该作者 |倒序浏览
qq2440 linux初始化过程
/etc/inittab_ ==>> /etc/init.d/rcS ==>> 用户登录界面
            ||调用此文件夹下的批处理文件
            ||
            /etc/rc.d/init.d
[root@FriendlyARM /etc]# cat inittab_                                          
#                                                                              
# inittab       This file describes how the INIT process should set up         
#               the system in a certain run-level.                              
#                                                                              
# Author:       Miquel van Smoorenburg,         
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes         
#                                                                              
                                                                                
# Default runlevel. The runlevels used by RHS are:                              
#   0 - halt (Do NOT set initdefault to this)                                   
#   1 - Single user mode                                                        
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)   
#   3 - Full multiuser mode                                                     
#   4 - unused                                                                  
#   5 - X11                                                                     
#   6 - reboot (Do NOT set initdefault to this)                                 
#                                                                              
                                                                                
# System initialization.                                                        
::sysinit:/etc/init.d/rcS                                                      
::askfirst:/sbin/getty 115200 console
///////////////////////////////////////////////////////////////
[root@FriendlyARM /etc]# cat init.d/rcS                                         
#! /bin/sh                                                                     
                                                                                
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:                              
runlevel=S                                                                     
prevlevel=N                                                                     
umask 022                                                                       
export PATH runlevel prevlevel                                                  
                                                                                
#                                                                              
#       Trap CTRL-C &c only in this shell so we can interrupt subprocesses.     
#                                                                              
trap ":" INT QUIT TSTP                                                         
/sbin/hwclock -s                                                               
                                                                                
#SCSI modules                                                                  
                                                                                
#Input modules                                                                  
#/sbin/insmod /lib/input.o                                                      
#/sbin/insmod /lib/keybdev.o                                                   
#/sbin/insmod /lib/mousedev.o                                                   
#/sbin/insmod /lib/evdev.o                                                      
                                                                                
#Charactor modules                                                              
                                                                                
/bin/mknod /dev/pts/0 c 136 0                                                   
/bin/ln -s /dev/v4l/video0 /dev/video0                                          
/bin/ln -s /dev/fb/0 /dev/fb0                                                   
/bin/ln -s /dev/vc/0 /dev/tty1                                                  
/bin/ln -s /dev/sound/dsp /dev/dsp                                             
/bin/ln -s /dev/sound/mixer /dev/mixer                                          
/bin/ln -s /dev/scsi/host0/bus0/target0/lun0/part1 /dev/sda1                    
                                                                                
                                                                                
/bin/mount -t proc none /proc                                                   
/bin/mount -t tmpfs none /tmp                                                   
/bin/mount -t tmpfs none /var                                                   
                                                                                
/bin/mkdir -p /var/lib                                                         
/bin/mkdir -p /var/run                                                         
/bin/mkdir -p /var/log                                                         
                                                                                
                                                                                
/etc/rc.d/init.d/netd start                                                     
echo "                        " > /dev/vc/0                                    
echo "Starting networking..." > /dev/vc/0                                       
usleep 300000                                                                  
/etc/rc.d/init.d/httpd start                                                   
echo "                        " > /dev/vc/0                                    
echo "Starting web server..." > /dev/vc/0                                       
usleep 300000                                                                  
/etc/rc.d/init.d/leds start                                                     
echo "                        " > /dev/vc/0                                    
echo "Starting leds service..." > /dev/vc/0                                    
echo "                        "                                                
usleep 300000                                                                  
/sbin/ifconfig lo 127.0.0.1                                                     
/sbin/ifconfig eth0 192.168.1.230 up                                            
                                                                                
/sbin/madplay /shanghaitan.mp3 &                                                
                                                                                
/bin/hostname -F /etc/sysconfig/HOSTNAME   
///////////////////////////////////////////////////////////////
[root@FriendlyARM init.d]# pwd                                                  
/etc/rc.d/init.d                                                               
[root@FriendlyARM init.d]# ls                                                   
httpd  leds   netd                                                              
[root@FriendlyARM init.d]#
///////////////////////////////////////////////////////////////
[root@FriendlyARM /etc]# cat rc.d/init.d/netd                                   
#!/bin/sh                                                                       
                                                                                
base=inetd                                                                     
                                                                                
# See how we were called.                                                      
case "$1" in                                                                    
  start)                                                                        
                /usr/sbin/$base                                                
        ;;                                                                     
  stop)                                                                        
        pid=`/bin/pidof $base`                                                  
        if [ -n "$pid" ]; then                                                  
                kill -9 $pid                                                   
        fi                                                                     
        ;;                                                                     
esac                                                                           
                                                                                
exit 0  
///////////////////////////////////////////////////////////////
#!/bin/sh                                                                       
                                                                                
base=boa                                                                        
                                                                                
# See how we were called.                                                      
case "$1" in                                                                    
  start)                                                                        
                /sbin/$base                                                     
        ;;                                                                     
  stop)                                                                        
        pid=`/bin/pidof $base`                                                  
        if [ -n "$pid" ]; then                                                  
                kill -9 $pid                                                   
        fi                                                                     
        ;;                                                                     
esac                                                                           
                                                                                
exit 0                                    
///////////////////////////////////////////////////////////////
[root@FriendlyARM init.d]# cat leds                                             
#!/bin/sh                                                                       
                                                                                
base=led-player                                                                 
                                                                                
# See how we were called.                                                      
case "$1" in                                                                    
  start)                                                                        
                /sbin/$base &                                                   
        ;;                                                                     
  stop)                                                                        
        pid=`/bin/pidof $base`                                                  
        if [ -n "$pid" ]; then                                                  
                kill -9 $pid                                                   
        fi                                                                     
        ;;                                                                     
esac                                                                           
                                                                                
exit 0                 


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/66022/showart_681709.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP