欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

​Linux下chkconfig命令详解 有大用 有大大用 有大大大用

Linux下chkconfig命令详解

chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息。谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接。

使用语法:
chkconfig [--add][--del][--list][系统服务] 或 chkconfig [--level <等级代号>][系统服务][on/off/reset]

chkconfig 在没有参数运行时,显示用法。如果加上服务名,那么就检查这个服务是否在当前运行级启动。如果是,返回true,否则返回false。如果在服务名后面指 定了on,off或者reset,那么chkconfi 会改变指定服务的启动信息。on和off分别指服务被启动和停止,reset指重置服务的启动信息,无论有问题的初始化脚本指定了什么。on和off开 关,系统默认只对运行级3,4,5有效,但是reset可以对所有运行级有效。

参数用法:
   --add  增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据。
   --del  删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的叙述文件内删除相关数据。
   --level<等级代号>  指定读系统服务要在哪一个执行等级中开启或关毕。
      等级0表示:表示关机
      等级1表示:单用户模式
      等级2表示:无网络连接的多用户命令行模式
      等级3表示:有网络连接的多用户命令行模式
      等级4表示:不可用
      等级5表示:带图形界面的多用户模式
      等级6表示:重新启动
      需要说明的是,level选项可以指定要查看的运行级而不一定是当前运行级。对于每个运行级,只能有一个启动脚本或者停止脚本。当切换运行级时,init不会重新启动已经启动的服务,也不会再次去停止已经停止的服务。

    chkconfig --list [name]:显示所有运行级系统服务的运行状态信息(on或off)。如果指定了name,那么只显示指定的服务在不同运行级的状态。
    chkconfig --add name:增加一项新的服务。chkconfig确保每个运行级有一项启动(S)或者杀死(K)入口。如有缺少,则会从缺省的init脚本自动建立。
    chkconfig --del name:删除服务,并把相关符号连接从/etc/rc[0-6].d删除。
    chkconfig [--level levels] name:设置某一服务在指定的运行级是被启动,停止还是重置。

运行级文件:
每 个被chkconfig管理的服务需要在对应的init.d下的脚本加上两行或者更多行的注释。第一行告诉chkconfig缺省启动的运行级以及启动和 停止的优先级。如果某服务缺省不在任何运行级启动,那么使用 - 代替运行级。第二行对服务进行描述,可以用\ 跨行注释。
例如,random.init包含三行:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.

使用范例:
chkconfig --list        #列出所有的系统服务
chkconfig --add httpd        #增加httpd服务
chkconfig --del httpd        #删除httpd服务
chkconfig --level httpd 2345 on        #设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态
chkconfig --list        #列出系统所有的服务启动情况
chkconfig --list mysqld        #列出mysqld服务设置情况
chkconfig --level 35 mysqld on        #设定mysqld在等级3和5为开机运行服务,--level 35表示操作只在等级3和5执行,on表示启动,off表示关闭
chkconfig mysqld on        #设定mysqld在各等级为on,“各等级”包括2、3、4、5等级

如何增加一个服务:
1.服务脚本必须存放在/etc/ini.d/目录下;
2.chkconfig --add servicename
    在chkconfig工具服务列表中增加此服务,此时服务会被在/etc/rc.d/rcN.d中赋予K/S入口了;
3.chkconfig --level 35 mysqld on
    修改服务的默认启动等级。

原文地址:http://www.cnblogs.com/lcword/p/5917405.html

标签: Linux


来自 https://www.cnblogs.com/gotodsp/p/6405106.html


linux启动脚本和service、chkconfig

2014年12月03日 17:02:05 乌托邦2号 阅读数 34560

(1)启动脚本的写法


  1. case "$1" in

  2. start)

  3. do start-thing;

  4. ;;

  5. stop)

  6. do stop-thing;

  7. ;;

  8. restart)

  9. do restart-thing;

  10. ;;

  11. ...

  12. esac


       你如果按这种结构写个启动脚本测试一下就会发现,若该脚本的软连接以S开头,则系统启动的时候执行start-thing代码段,若该脚本的软连接以K开头的话,则系统启动时执行stop-thing代码段(有一点儿例外的是运行级别0,因为0级别是关闭系统,所以/etc/rc0.d/下的以S开头的软连接也执行stop-thing段)。是不是很智能化,所以如果可以的话启动脚本最好写标准一些。如果你非写成普通的脚本,就几个命令,没有上面那个结构,建立以K或S开头的软连接会怎么执行呢?答案是全部执行。

chkconfig --add script
chkconfig --levels 2345 script on或chkconfig --levels 2345 script off

(2)启动脚本


  1. #!/bin/sh -e

  2. PATH=/bin

  3. case "$1" in

  4. start)

  5. echo "starting"

  6. cd /usr/bin

  7. ls

  8. ;;

  9. stop)

  10. echo "Stopping"

  11. kill -9

  12. ;;

  13. restart)

  14. $0 stop || true

  15. $0 start

  16. ;;

  17. *)

  18. echo "Usage: ls {start|stop|restart}"

  19. exit 1

  20. ;;

  21. esac


(3)自己动手开发apache启动脚本


  1. #!/bin/bash -e


  2. [ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions

  3. RETVAL=0

  4. httpd="/application/apache/bin/httpd"

  5. start() {

  6. $httpd -k start >/dev/null 2>&1

  7. # daemon httpd >/dev/null 2>&1

  8. RETVAL=$?

  9. [ $RETVAL -eq 0 ] && action "启动 httpd:" /bin/true ||\

  10. action "启动 httpd:" /bin/false

  11. return $RETVAL

  12. }


  13. stop() {

  14. $httpd -k stop >/dev/null 2>&1

  15. # killproc httpd >/dev/null 2>&1

  16. [ $? -eq 0 ] && action "停止 httpd:" /bin/true ||\

  17. action "停止 httpd:" /bin/false

  18. return $RETVAL

  19. }

  20. case "$1" in

  21. start)

  22. start

  23. ;;

  24. stop)

  25. stop

  26. ;;

  27. restart)


  28. sh $0 stop

  29. sh $0 start

  30. ;;

  31. *)

  32. echo "Format error!"

  33. echo $"Usage: $0 {start|stop|restart}"

  34. exit 1

  35. ;;

  36. esac

  37. exit $RETVAL

有时使用#!/bin/bash -e表示脚本发生第一个错误时就中止脚本运行,对于那些不想终止的命令使用$0 stop || true


(4)系统脚本httpd

还可查看分析其他的系统脚本mysqld rc.sysinit crond portmap nfs等。

  1. #!/bin/bash

  2. #

  3. # httpd        Startup script for the Apache HTTP Server

  4. #

  5. # chkconfig: - 85 15

  6. # description: The Apache HTTP Server is an efficient and extensible  \

  7. #        server implementing the current HTTP standards.

  8. # processname: httpd

  9. # config: /etc/httpd/conf/httpd.conf

  10. # config: /etc/sysconfig/httpd

  11. # pidfile: /var/run/httpd/httpd.pid

  12. #

  13. ### BEGIN INIT INFO

  14. # Provides: httpd

  15. # Required-Start: $local_fs $remote_fs $network $named

  16. # Required-Stop: $local_fs $remote_fs $network

  17. # Should-Start: distcache

  18. # Short-Description: start and stop Apache HTTP Server

  19. # Description: The Apache HTTP Server is an extensible server

  20. #  implementing the current HTTP standards.

  21. ### END INIT INFO


  22. # Source function library.

  23. . /etc/rc.d/init.d/functions


  24. if [ -f /etc/sysconfig/httpd ]; then

  25. . /etc/sysconfig/httpd

  26. fi


  27. # Start httpd in the C locale by default.

  28. HTTPD_LANG=${HTTPD_LANG-"C"}


  29. # This will prevent initlog from swallowing up a pass-phrase prompt if

  30. # mod_ssl needs a pass-phrase from the user.

  31. INITLOG_ARGS=""


  32. # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server

  33. # with the thread-based "worker" MPM; BE WARNED that some modules may not

  34. # work correctly with a thread-based MPM; notably PHP will refuse to start.


  35. # Path to the apachectl script, server binary, and short-form for messages.

  36. apachectl=/usr/sbin/apachectl

  37. httpd=${HTTPD-/usr/sbin/httpd}

  38. prog=httpd

  39. pidfile=${PIDFILE-/var/run/httpd/httpd.pid}

  40. lockfile=${LOCKFILE-/var/lock/subsys/httpd}

  41. RETVAL=0

  42. STOP_TIMEOUT=${STOP_TIMEOUT-10}


  43. # The semantics of these two functions differ from the way apachectl does

  44. # things -- attempting to start while running is a failure, and shutdown

  45. # when not running is also a failure.  So we just do it the way init scripts

  46. # are expected to behave here.

  47. start() {

  48. echo -n $"Starting $prog: "

  49. LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS

  50. RETVAL=$?

  51. echo

  52. [ $RETVAL = 0 ] && touch ${lockfile}

  53. return $RETVAL

  54. }


  55. # When stopping httpd, a delay (of default 10 second) is required

  56. # before SIGKILLing the httpd parent; this gives enough time for the

  57. # httpd parent to SIGKILL any errant children.

  58. stop() {

  59. echo -n $"Stopping $prog: "

  60. killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd

  61. RETVAL=$?

  62. echo

  63. [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}

  64. }

  65. reload() {

  66. echo -n $"Reloading $prog: "

  67. if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then

  68. RETVAL=6

  69. echo $"not reloading due to configuration syntax error"

  70. failure $"not reloading $httpd due to configuration syntax error"

  71. else

  72. # Force LSB behaviour from killproc

  73. LSB=1 killproc -p ${pidfile} $httpd -HUP

  74. RETVAL=$?

  75. if [ $RETVAL -eq 7 ]; then

  76. failure $"httpd shutdown"

  77. fi

  78. fi

  79. echo

  80. }


  81. # See how we were called.

  82. case "$1" in

  83. start)

  84. start

  85. ;;

  86. stop)

  87. stop

  88. ;;

  89. status)

  90. status -p ${pidfile} $httpd

  91. RETVAL=$?

  92. ;;

  93. restart)

  94. stop

  95. start

  96. ;;

  97. condrestart|try-restart)

  98. if status -p ${pidfile} $httpd >&/dev/null; then

  99. stop

  100. start

  101. fi

  102. ;;

  103. force-reload|reload)

  104. reload

  105. ;;

  106. graceful|help|configtest|fullstatus)

  107. $apachectl $@

  108. RETVAL=$?

  109. ;;

  110. *)

  111. echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"

  112. RETVAL=2

  113. esac


  114. exit $RETVAL

(5)service和chkconfig命令


service命令可以快速地开启和停止linux中的服务程序,这在调试过程中非常有用.chkconfig命令可以快速地设置开机时需要自动启动的服务程序.
  这两个命令的功能都可以通过其他方法实现,只不过有了它们之后更加方便,维护工作可以更加轻松.

service命令和进程管理脚本


  在debian linux中如果用apt-get命令安装mysql,nginx等服务程序,安装程序都会自动在/etc/init.d/目录中创建一个管理此服务进程用的shell脚本,如:


123/etc/init.d/mysql/etc/init.d/nginx/etc/init.d/keepalived

  这样就用可以用/etc/init.d/{脚本文件名} start  service {脚本文件名} start 来启动一个服务,如:

123#启动mysql服务/etc/init.d/mysqlstartservice mysql start
  如果进程管理脚本支持restart命令参数,还可以用 /etc/init.d/{脚本文件名} restart 或 service{脚本文件名} restart来重新启动 一个服务,如:
123#重新启动mysql服务/etc/init.d/mysqlrestartservice mysql restart

  上面两个命令的效果是一样的,这样重启mysql或php-fpm的时候就不用每次都先把进程kill掉,然后写一大段路径和参数来启动服务了.只不过用service命令的话只要记住脚本文件名,不用写绝对地址,这样比较方便,默认的脚本文件名都是和服务程序的名字一样的.

  如果自己编译安装php-fpm等服务程序,/etc/init.d目录中的这个脚本是需要自己加的.幸运的是很多服务程序的源码包中都附带了这个脚本如:

123mysql5.6源码中的 support-files/mysql.serverphp5.4源码中的 sapi/fpm/init.d.php-fpmredis2.6源码中的 utils/redis_init_script
这些就是应用程序官方提供的进程管理脚本,把它们复制到/etc/init.d目录中,顺便改一个简短点儿的名字,就可以用service 命令管理服务进程了.别忘了给复制到/etc/init.d中的脚本加可执行权限.
1chmod +x /etc/init.d/mysql/etc/init.d/nginx/etc/init.d/redis

  有的时候需要修改脚本中的参数如路径名等才能顺利执行,需要简单调试一下.

  这里需要注意一下service命令后面的参数
  service命令后面的第一个参数,一定要和/etc/init.d中的脚本名字一样,要不然系统会报错,为了简单,可以直接命名成服务程序名字.
  service命令的第二个参数,如start,stop,restart,它是传给进程管理脚本的.所以是否支持这个参数不是service命令决定的,是进程管理脚本决定的,使用不同的进程管理脚本,可以选择的命令参数和功能也是不同的.
  进程管理脚本都会支持start和stop两个命令参数,还有可能支持其他的命令参数.一般可以用service {脚本名} 查看脚本的帮助信息,里面有支持的命令参数如:

123456root@lvmingming:/etc/init.d# service mysqlUsage: /etc/init.d/mysqlstart|stop|restart|reload|force-reload|statusroot@lvmingming:/etc/init.d# service redisPlease use start or stop as first argumentroot@lvmingming:/etc/init.d# service memcachedUsage: /etc/init.d/memcached{start|stop|restart|force-reload|status}
  也有些服务,如用apt-get安装的keepalived的管理脚本,用这个方法查看不到帮助信息.想知道这个脚本里支持哪些命令参数,只能自己读一下脚本了,shell脚本的语法比较简单,还是挺容易看懂的.

  如果需要编译安装服务程序,并且源码里没有进程管理脚本,如memcached.那只能上网查别人写好的脚本了.要不然自己写个进程管理脚本也不错~


chkconfig命令和/etc/rc.local脚本

  chkconfig命令可以用来配置某一项服务是否开机自动启动,有些版本的linux需要自己手动安装这个命令,如debian linux中安装chkconfig命令: 

1apt-get installchkconfig
  如果没有chkconfig命令,想添加一项开机自动启动的服务,可以把开启服务的命令放进/etc/rc.local中,只不过用chconfig命令更加方便 
  chkconfig命令同样要依赖放在/etc/init.d目录中的进程管理脚本. 
  chkconfig命令示例: 
1234567#以下脚本在debian linux中测试通过chkconfig --help #查看chkconfig命令语法chkconfig -l #查看所有服务程序在所有运行级别下的是否开机自动启动chkconfig -l mysql#查mysql服务在所有运行级别下的是否开机自动启动chkconfig -a mysql#在服务列表中添加新的服务mysql并设置成开机自动启动chkconfig -d mysql#取消mysql服务的开机自动启动设置chkconfig -s mysql 2345#让mysql在2345这几个运行级别下开机自动启动,如果某一运行级别下的链接没有正确添加,可以使用这个命令添加一下.

chkconfig的原理


       chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息。谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接。

使用语法:
chkconfig [--add][--del][--list][系统服务] 或 chkconfig [--level <等级代号>][系统服务][on/off/reset]

chkconfig在没有参数运行时,显示用法。如果加上服务名,那么就检查这个服务是否在当前运行级启动。如果是,返回true,否则返回false。如果在服务名后面指定了on,off或者reset,那么chkconfi 会改变指定服务的启动信息。on和off分别指服务被启动和停止,reset指重置服务的启动信息,无论有问题的初始化脚本指定了什么。on和off开关,系统默认只对运行级3,4,5有效,但是reset可以对所有运行级有效。

参数用法:
   --add  增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据。
   --del  删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的叙述文件内删除相关数据。
   --level<等级代号>  指定读系统服务要在哪一个执行等级中开启或关毕。
      等级0表示:表示关机
      等级1表示:单用户模式
      等级2表示:无网络连接的多用户命令行模式
      等级3表示:有网络连接的多用户命令行模式
      等级4表示:不可用
      等级5表示:带图形界面的多用户模式
      等级6表示:重新启动
      需要说明的是,level选项可以指定要查看的运行级而不一定是当前运行级。对于每个运行级,只能有一个启动脚本或者停止脚本。当切换运行级时,init不会重新启动已经启动的服务,也不会再次去停止已经停止的服务。

    chkconfig --list [name]:显示所有运行级系统服务的运行状态信息(on或off)。如果指定了name,那么只显示指定的服务在不同运行级的状态。
    chkconfig --add name:增加一项新的服务。chkconfig确保每个运行级有一项启动(S)或者杀死(K)入口。如有缺少,则会从缺省的init脚本自动建立。
    chkconfig --del name:删除服务,并把相关符号连接从/etc/rc[0-6].d删除。
    chkconfig [--level levels] name:设置某一服务在指定的运行级是被启动,停止还是重置。

运行级文件:
每个被chkconfig管理的服务需要在对应的init.d下的脚本加上两行或者更多行的注释。第一行告诉chkconfig缺省启动的运行级以及启动和停止的优先级。如果某服务缺省不在任何运行级启动,那么使用 - 代替运行级。第二行对服务进行描述,可以用\ 跨行注释。
例如,random.init包含三行:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.

使用范例:
chkconfig --list        #列出所有的系统服务
chkconfig --add httpd        #增加httpd服务
chkconfig --del httpd        #删除httpd服务
chkconfig --level httpd 2345 on        #设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态
chkconfig --list        #列出系统所有的服务启动情况
chkconfig --list mysqld        #列出mysqld服务设置情况
chkconfig --level 35 mysqld on        #设定mysqld在等级3和5为开机运行服务,--level 35表示操作只在等级3和5执行,on表示启动,off表示关闭
chkconfig mysqld on        #设定mysqld在各等级为on,“各等级”包括2、3、4、5等级

如何增加一个服务:
1.服务脚本必须存放在/etc/ini.d/目录下;
2.chkconfig --add servicename
    在chkconfig工具服务列表中增加此服务,此时服务会被在/etc/rc.d/rcN.d中赋予K/S入口了;
3.chkconfig --level 35 mysqld on
    修改服务的默认启动等级。

/etc目录下有一组rc开头目录,它们用来存放在各个运行级别下linux自动启动的服务:

12345678/etc/rcS.d/ #开机后需要自动启动的一些基本服务/etc/rc0.d/ #运行模式0下需要启动的服务/etc/rc1.d/ #运行模式1下需要启动的服务/etc/rc2.d/ #运行模式2下需要启动的服务/etc/rc3.d/ #运行模式3下需要启动的服务/etc/rc4.d/ #运行模式4下需要启动的服务/etc/rc5.d/ #运行模式5下需要启动的服务/etc/rc6.d/ #运行模式6下需要启动的服务
  这些目录中除README说明文档之外放的都是些软链接(符号链接),这些链接指向各服务的进程管理脚本,而这些进程管理脚本都放在/etc/init.d目录中. 
  debian linux的默认运行级别是2,看一下/etc/rc2.d/中的内容 
123456789101112131415root@lvmingming:~# ls -l /etc/rc2.d/total 4-rw-r--r-- 1 root     root     677 Nov 17  2012 READMElrwxrwxrwx 1 root     root      17 May 30  2011 S01ipvsadm -> ../init.d/ipvsadmlrwxrwxrwx 1 root     root      17 Feb  6 13:45 S16apache2 -> ../init.d/apache2lrwxrwxrwx 1 root     root      20 Jun 10 16:31 S17keepalived -> ../init.d/keepalivedlrwxrwxrwx 1 root     root      19 Jun 13 13:54 S17memcached -> ../init.d/memcachedlrwxrwxrwx 1 root     root      15 Feb  6 13:45 S17mysql -> ../init.d/mysqllrwxrwxrwx 1 root     root      28 Feb 16 13:14 S17nagios-nrpe-server -> ../init.d/nagios-nrpe-serverlrwxrwxrwx 1 root     root      15 Feb  6 13:45 S17nginx -> ../init.d/nginxlrwxrwxrwx 1 root     root      15 Feb  6 13:45 S17rsync -> ../init.d/rsynclrwxrwxrwx 1 root     root      16 Feb  6 13:45 S17vsftpd -> ../init.d/vsftpdlrwxrwxrwx 1 root     root      22 Apr  3 14:06 S18avahi-daemon -> ../init.d/avahi-daemonlrwxrwxrwx 1 root     root      15 Feb  6 13:45 S18exim4 -> ../init.d/exim4lrwxrwxrwx 1 root     root      18 Feb  6 13:45 S20rc.local-> ../init.d/rc.local
  用chkconfig命令操作的添加或者删除开机自动启动服务程序,其实就是创建或删除这些目录中的软链接. 
  每个软链接的命名都是"大写S+运行顺序+脚本名称",里面有一个链接是"S20rc.local -> ../init.d/rc.local".打开它指向的脚本/etc/init.d/rc.local看一下,发现它里面调用了/etc/rc.local这个脚本.原来/etc/rc.local中的命令是在这儿执行的.
  如果把mysql服务的启动命令放进/etc/rc.local中,操作系统也会在执行这个列表的时候执行它,不过它的执行顺序是20,比排在前面的S17mysql还要晚一些~



chconfig --level 2345 puppet off 等价于 chkconfig puppet off (不用--level 指定级别时,默认是2345)

这条命令是设置 puppet 服务在 2345 级别 不自动启动,当执行这条命令时,会在

rc2.d rc3.d rc4.d rc5.d 这几个目录新建软连接 K02puppet 从 /etc/rc.d/init/puppet 脚本

chkconfig puppet on 这个就是在2345级别时,开机自动启动

当执行这条命令时,会在

rc2.d rc3.d rc4.d rc5.d 这几个目录新建软连接 S98puppet 从 /etc/rc.d/init/puppet 脚本

那这个 K02puppet S98puppet 中的 02 和 98 是怎么来的?

打开/etc/rc.d/init.d/puppet这个脚本文件,看前几行 如下:


  1. #!/bin/bash

  2. # puppet        Init script for running the puppet client daemon

  3. #

  4. # Author:       Duane Griffin

  5. #               David Lutterkort

  6. #

  7. # chkconfig: - 98 02

  8. #

  9. # description: Enables periodic system configuration checks through puppet.

  10. # processname: puppet

  11. # config: /etc/sysconfig/puppet

特别是这行

# chkconfig: - 98 02

chkconfig 命令会读取这一行,来获取运行级别和那2个数字的,在这个脚本里面

  1. - 是代表默认的级别(2345),也可以把想要启动的级别写到这里

  2. 98    代表的是在开机启动脚本中的启动顺序(第98个启动)

  3. 02    代表是 第二个停止的

98和02 都是代表的顺序,所以在编写服务启动脚本时这行是必不可少的,当然# description: 和 # processname:也是不能少的

在/etc/inittab 文件中 这一行

l3:3:wait:/etc/rc.d/rc 3

其中 /etc/rc.d/rc 这个脚本就是用来在 开机和关机时 管理服务的启动和停止的,当我们运行在3级别时,这个脚本会执行/etc/rc.d/rc3.d/下面所有脚本先执行K字头开头的脚本,然后执行S开头的脚本,这些脚本都是有执行顺序的,是按照数字的顺序来执行的。

来自   https://www.cnblogs.com/gotodsp/p/6405106.html


普通分类: