天天看點

centos 7的/etc/rc.local無法啟動問題分析

centos7釋出到現在有4年多了,公司項目也被迫需要全部更新到centos7,畢竟網際網路項目就是不斷的在更新再更新,升到不能升為止!哈哈~~

看看下面的centos釋出時間,是不是感覺跟你孩子的年齡一樣,對了,忘了還有單身的朋友!

版本 平台 RHEL 版本 釋出日期 RHEL 釋出日期
2 i386 2.1 2004.05.14 2002.05.17
3.1 i386,x86_64,ia64,s390,s390x 3 2004.03.19 2003.10.23
3.4 - Server CD i386,x86_64,ia64,s390,s390x 3.4 2005.01.23 -
3.7 i386,x86_64,ia64,s390,s390x 3.7 2006.04.11 -
3.8 i386,x86_64 3.8 2006.08.25 2006.07.20
3.9 i386,x86_64,ia64,s390,s390x 3.9 2007.07.26 2007.06.15
4.0 i386,x86_64,various 4 2005.03.09 2005.02.14
4.6 i386,x86_64,ia64,alpha,s390,s390x,ppc (beta),sparc (beta) 4.6 2007.12.16 2007.11.16
4.7 i386,x86_64,ia64,alpha,s390,s390x 4.7 2008.09.13 2008.07.24
4.7 - Server CD i386,x86_64,ia64,alpha,s390,s390x 4.7 2008.10.17 -
4.8 i386,x86-64,ia64,alpha,s390,s390x 4.8 2009.08.21 2009.05.18
4.9 i386,x86-64,ia64,alpha,s390,s390x 4.9 2011.03.02 2011.02.16
5.0 i386,x86_64 5 2007.04.12 2007.03.14
5.1 i386,x86_64 5.1 2007.12.02 2007.11.07
5.1 - LiveCD i386 5.1 2008.02.18 -
5.2 i386,x86_64 5.2 2008.06.24 2008.05.21
5.2 - LiveCD i386 5.2 2008.07.17 -
5.3 i386,x86_64 5.3 2009.03.31 2009.01.20
5.3 - Live CD i386 5.3 2009.05.27 -
5.4 i386,x86_64 5.4 2009.10.21 2009.09.02
5.5 i386,x86_64 5.5 2010.05.14 2010.03.31
5.5 - LiveCD i386,x86-64 5.5 2010.05.14 -
5.6 i386,x86-64 5.6 2011.04.07 2011.01.13
5.7 i386,x86-64 5.7 2011.09.14 -
5.8 i386,x86-64 5.8 2012.03.07
5.9 i386,x86-64 5.9 2013.01.17 2013.01.07
5.10 [3]  i386,x86-64 5.10 2013.10.19 2013.10.01
5.11 i386,x86-64 5.11 2014.09.30 2014.09.16
6.0 i386,x86-64 6 2011.07.04 2010-11-10
6.1 i386,x86-64 6.1 2011.12.10 2011-05-19
6.2 i386,x86-64 6.2 2011.12.20 2011-12-06
6.3 i386,x86-64 6.3 2012.07.10 2012.06.21
6.4 i386,x86-64 6.4 2013.03.08 2013.02.21
6.5 [4]  i386,x86_64 6.5 2013.12.01 2013.11.21
6.6 i386,x86_64 6.6 2014.10.27 2014.10.28
7.0 [2]  x86_64,armv7hl 7.0 2014.07.07 2014.06.11
7.1 x86_64 7.1 2015.03.31 2015.03.05
7.2 x86_64 7.2 2015.12.15 2015.12.15
7.3 x86_64 7.3 2016.12.12 2016.11.03
7.4 x86_64 7.4 2017.09.13 2017.08.01

    [[email protected] ~]# uname -a

    Linux mcuhome.us-west-1.compute.internal 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    首先看一下/etc/rc.local檔案内容

    [[email protected] logs]# more /etc/rc.local 

    #!/bin/bash

    # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES

    #

    # It is highly advisable to create own systemd services or udev rules

    # to run scripts during boot instead of using this file.

    #

    # In contrast to previous versions due to parallel execution during boot

    # this script will NOT be run after all other services.

    #

    # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure

    # that this script will be executed during boot.

    touch /var/lock/subsys/local

    /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

    注意“Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure”

    [[email protected] ~]# ll /etc/rc.local 

    lrwxrwxrwx. 1 root root 13 5月   2 2017 /etc/rc.local -> rc.d/rc.local

    您在 /var/spool/mail/root 中有新郵件

    [[email protected] ~]# ll /etc/rc.d/rc.local 

    -rw-r--r--. 1 root root 811 3月   7 10:37 /etc/rc.d/rc.local

    [[email protected] logs]# chmod +x /etc/rc.d/rc.local

    [[email protected] logs]# ll /etc/rc.d/rc.local 

    -r-xr-xr-x 1 root root 531 5月  28 14:47 /etc/rc.d/rc.local

    看樣子是版本的變遷,/etc/rc.local /etc/rc.d/rc.local正在棄用的路上。

    看了readme才是最好的document啊!

繼續閱讀