not syncing: Attempted to kill init

NeilZhang
NeilZhang
管理员
140
文章
106.8千
浏览
Linux评论262字数 2368阅读7分53秒阅读模式

Several days ago, I run 'yum update' while failed:

  1. error: Couldn't fork %pre(php71u-fpm-7.1.14-1.ius.centos6.x86_64): Cannot allocate memory
  2. Error in PREIN scriptlet in rpm package php71u-fpm-7.1.14-1.ius.centos6.x86_64
  3. error: install: %pre scriptlet failed (2), skipping php71u-fpm-7.1.14-1.ius.centos6
  4.  
  5. Updating : php71u-pecl-apcu-5.1.10-1.ius.centos6.x86_64

Just now when I checked the log, I found similar errors happened many times while unfortunately at that time I just thought maybe one package failed.

I did not know why I got this error as there should be enough memory:

  1. [root@www ~]# free
  2. total used free shared buffers cached
  3. Mem: 1019932 778860 241072 56920 14732 182964
  4. -/+ buffers/cache: 581164 438768
  5. Swap: 0 0 0

Anyway, I stopped mysql and nginx and tried to run 'yum update' again, and got this:

  1. Resolving Dependencies
  2. There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
  3. --> Running transaction check
  4. ---> Package kernel-headers.x86_64 0:2.6.32-696.16.1.el6 will be updated
  5. ---> Package kernel-headers.x86_64 0:2.6.32-696.20.1.el6 will be an update
  6. ---> Package mysql-community-server.x86_64 0:5.7.20-1.el6 will be updated
  7. ---> Package mysql-community-server.x86_64 0:5.7.21-1.el6 will be an update
  8. ---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.1 will be updated
  9. --> Processing Dependency: ntpdate = 4.2.6p5-12.el6.centos.1 for package: ntp-4.2.6p5-12.el6.centos.1.x86_64
  10. ---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.2 will be an update
  11. ---> Package php71u-cli.x86_64 0:7.1.11-1.ius.centos6 will be updated
  12. ---> Package php71u-cli.x86_64 0:7.1.14-1.ius.centos6 will be an update
  13. ---> Package php71u-fpm.x86_64 0:7.1.11-1.ius.centos6 will be updated
  14. ---> Package php71u-fpm.x86_64 0:7.1.14-1.ius.centos6 will be an update
  15. ---> Package php71u-intl.x86_64 0:7.1.11-1.ius.centos6 will be updated
  16. ---> Package php71u-intl.x86_64 0:7.1.14-1.ius.centos6 will be an update
  17. ---> Package php71u-json.x86_64 0:7.1.11-1.ius.centos6 will be updated
  18. ---> Package php71u-json.x86_64 0:7.1.14-1.ius.centos6 will be an update
  19. ---> Package php71u-mbstring.x86_64 0:7.1.11-1.ius.centos6 will be updated
  20. ---> Package php71u-mbstring.x86_64 0:7.1.14-1.ius.centos6 will be an update
  21. ---> Package php71u-tidy.x86_64 0:7.1.11-1.ius.centos6 will be updated
  22. ---> Package php71u-tidy.x86_64 0:7.1.14-1.ius.centos6 will be an update
  23. ---> Package selinux-policy-targeted.noarch 0:3.7.19-307.el6_9.2 will be updated
  24. ---> Package selinux-policy-targeted.noarch 0:3.7.19-307el6_9.3 will be an update
  25. ---> Package tzdata.noarch 0:2017c-1.el6 will be updated
  26. ---> Package tzdata.noarch 0:2018c-1.el6 will be an update
  27. --> Finished Dependency Resolution
  28. Error: Package: ntp-4.2.6p5-12.el6.centos.1.x86_64 (@updates)
  29. Requires: ntpdate = 4.2.6p5-12.el6.centos.1
  30. Removing: ntpdate-4.2.6p5-12.el6.centos.1.x86_64 (@updates)
  31. ntpdate = 4.2.6p5-12.el6.centos.1
  32. Updated By: ntpdate-4.2.6p5-12.el6.centos.2.x86_64 (updates)
  33. ntpdate = 4.2.6p5-12.el6.centos.2
  34. Available: ntpdate-4.2.6p5-10.el6.centos.2.x86_64 (base)
  35. ntpdate = 4.2.6p5-10.el6.centos.2
  36. You could try using --skip-broken to work around the problem
  37. ** Found 31 pre-existing rpmdb problem(s), 'yum check' output follows:
  38. GeoIP-GeoLite-data-2018.01-1.el6.noarch is a duplicate with GeoIP-GeoLite-data-2017.07-1.el6.noarch
  39. GeoIP-GeoLite-data-extra-2018.01-1.el6.noarch is a duplicate with GeoIP-GeoLite-data-extra-2017.07-1.el6.noarch
  40. kernel-firmware-2.6.32-696.20.1.el6.noarch is a duplicate with kernel-firmware-2.6.32-696.16.1.el6.noarch
  41. libblkid-2.17.2-12.28.el6_9.2.x86_64 is a duplicate with libblkid-2.17.2-12.28.el6_9.1.x86_64
  42. libuuid-2.17.2-12.28.el6_9.2.x86_64 is a duplicate with libuuid-2.17.2-12.28.el6_9.1.x86_64
  43. mysql-community-client-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-client-5.7.20-1.el6.x86_64
  44. mysql-community-common-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-common-5.7.20-1.el6.x86_64
  45. mysql-community-libs-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-libs-5.7.20-1.el6.x86_64
  46. ntp-4.2.6p5-12.el6.centos.2.x86_64 is a duplicate with ntp-4.2.6p5-12.el6.centos.1.x86_64
  47. ntp-4.2.6p5-12.el6.centos.2.x86_64 has missing requires of ntpdate = ('0', '4.2.6p5', '12.el6.centos.2')
  48. php71u-common-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-common < ('0', '7.1.14', '1.ius.centos6'): php71u-common-7.1.11-1.ius.centos6.x86_64
  49. php71u-common-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-common-7.1.11-1.ius.centos6.x86_64
  50. php71u-gd-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-gd < ('0', '7.1.14', '1.ius.centos6'): php71u-gd-7.1.11-1.ius.centos6.x86_64
  51. php71u-gd-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-gd-7.1.11-1.ius.centos6.x86_64
  52. php71u-mysqlnd-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-mysqlnd < ('0', '7.1.14', '1.ius.centos6'): php71u-mysqlnd-7.1.11-1.ius.centos6.x86_64
  53. php71u-mysqlnd-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-mysqlnd-7.1.11-1.ius.centos6.x86_64
  54. php71u-opcache-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-opcache < ('0', '7.1.14', '1.ius.centos6'): php71u-opcache-7.1.11-1.ius.centos6.x86_64
  55. php71u-opcache-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-opcache-7.1.11-1.ius.centos6.x86_64
  56. php71u-pdo-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-pdo < ('0', '7.1.14', '1.ius.centos6'): php71u-pdo-7.1.11-1.ius.centos6.x86_64
  57. php71u-pdo-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-pdo-7.1.11-1.ius.centos6.x86_64
  58. php71u-pecl-apcu-5.1.10-1.ius.centos6.x86_64 has installed conflicts php-pecl-apcu < ('0', '5.1.10', None): php71u-pecl-apcu-5.1.8-1.ius.centos6.x86_64
  59. php71u-pecl-apcu-5.1.10-1.ius.centos6.x86_64 is a duplicate with php71u-pecl-apcu-5.1.8-1.ius.centos6.x86_64
  60. php71u-pecl-igbinary-2.0.5-2.ius.centos6.x86_64 is a duplicate with php71u-pecl-igbinary-2.0.5-1.ius.centos6.x86_64
  61. php71u-pecl-redis-3.1.6-2.ius.centos6.x86_64 has installed conflicts php-pecl-redis < ('0', '3.1.6', None): php71u-pecl-redis-3.1.4-2.ius.centos6.x86_64
  62. php71u-pecl-redis-3.1.6-2.ius.centos6.x86_64 is a duplicate with php71u-pecl-redis-3.1.4-2.ius.centos6.x86_64
  63. php71u-process-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-process < ('0', '7.1.14', '1.ius.centos6'): php71u-process-7.1.11-1.ius.centos6.x86_64
  64. php71u-process-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-process-7.1.11-1.ius.centos6.x86_64
  65. php71u-xml-7.1.14-1.ius.centos6.x86_64 has installed conflicts php-xml < ('0', '7.1.14', '1.ius.centos6'): php71u-xml-7.1.11-1.ius.centos6.x86_64
  66. php71u-xml-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-xml-7.1.11-1.ius.centos6.x86_64
  67. selinux-policy-3.7.19-307el6_9.3.noarch is a duplicate with selinux-policy-3.7.19-307.el6_9.2.noarch
  68. util-linux-ng-2.17.2-12.28.el6_9.2.x86_64 is a duplicate with util-linux-ng-2.17.2-12.28.el6_9.1.x86_64

OK, run 'yum-complete-transaction':

  1. [root@www ~]# yum-complete-transactionn
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.zju.edu.cn
  5. * epel: ftp.cuhk.edu.hk
  6. * extras: ftp.sjtu.edu.cn
  7. * ius: hkg.mirror.rackspace.com
  8. * updates: ftp.sjtu.edu.cn
  9. There are 1 outstanding transactions to complete. Finishing the most recent one
  10. The remaining transaction had 40 elements left to run
  11. --> Running transaction check
  12. ---> Package GeoIP-GeoLite-data.noarch 0:2017.07-1.el6 will be erased
  13. ---> Package GeoIP-GeoLite-data-extra.noarch 0:2017.07-1.el6 will be erased
  14. ---> Package kernel.x86_64 0:2.6.32-642.13.1.el6 will be erased
  15. ---> Package kernel-firmware.noarch 0:2.6.32-696.16.1.el6 will be erased
  16. ---> Package kernel-headers.x86_64 0:2.6.32-696.16.1.el6 will be updated
  17. ---> Package kernel-headers.x86_64 0:2.6.32-696.20.1.el6 will be an update
  18. ---> Package libblkid.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
  19. ---> Package libuuid.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
  20. ---> Package mysql-community-client.x86_64 0:5.7.20-1.el6 will be erased
  21. ---> Package mysql-community-common.x86_64 0:5.7.20-1.el6 will be erased
  22. ---> Package mysql-community-libs.x86_64 0:5.7.20-1.el6 will be erased
  23. ---> Package mysql-community-server.x86_64 0:5.7.20-1.el6 will be erased
  24. ---> Package ntp.x86_64 0:4.2.6p5-12.el6.centos.1 will be erased
  25. ---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.1 will be erased
  26. ---> Package php71u-cli.x86_64 0:7.1.11-1.ius.centos6 will be updated
  27. ---> Package php71u-cli.x86_64 0:7.1.14-1.ius.centos6 will be an update
  28. ---> Package php71u-common.x86_64 0:7.1.11-1.ius.centos6 will be erased
  29. ---> Package php71u-fpm.x86_64 0:7.1.11-1.ius.centos6 will be erased
  30. ---> Package php71u-gd.x86_64 0:7.1.11-1.ius.centos6 will be erased
  31. ---> Package php71u-intl.x86_64 0:7.1.11-1.ius.centos6 will be updated
  32. ---> Package php71u-intl.x86_64 0:7.1.14-1.ius.centos6 will be an update
  33. ---> Package php71u-json.x86_64 0:7.1.11-1.ius.centos6 will be updated
  34. ---> Package php71u-json.x86_64 0:7.1.14-1.ius.centos6 will be an update
  35. ---> Package php71u-mbstring.x86_64 0:7.1.11-1.ius.centos6 will be updated
  36. ---> Package php71u-mbstring.x86_64 0:7.1.14-1.ius.centos6 will be an update
  37. ---> Package php71u-mysqlnd.x86_64 0:7.1.11-1.ius.centos6 will be erased
  38. ---> Package php71u-opcache.x86_64 0:7.1.11-1.ius.centos6 will be erased
  39. ---> Package php71u-pdo.x86_64 0:7.1.11-1.ius.centos6 will be erased
  40. ---> Package php71u-pecl-apcu.x86_64 0:5.1.8-1.ius.centos6 will be erased
  41. ---> Package php71u-pecl-igbinary.x86_64 0:2.0.5-1.ius.centos6 will be erased
  42. ---> Package php71u-pecl-redis.x86_64 0:3.1.4-2.ius.centos6 will be erased
  43. ---> Package php71u-process.x86_64 0:7.1.11-1.ius.centos6 will be erased
  44. ---> Package php71u-tidy.x86_64 0:7.1.11-1.ius.centos6 will be updated
  45. ---> Package php71u-tidy.x86_64 0:7.1.14-1.ius.centos6 will be an update
  46. ---> Package php71u-xml.x86_64 0:7.1.11-1.ius.centos6 will be erased
  47. ---> Package selinux-policy.noarch 0:3.7.19-307.el6_9.2 will be erased
  48. ---> Package selinux-policy-targeted.noarch 0:3.7.19-307.el6_9.2 will be erased
  49. ---> Package tzdata.noarch 0:2017c-1.el6 will be updated
  50. ---> Package tzdata.noarch 0:2018c-1.el6 will be an update
  51. ---> Package util-linux-ng.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
  52. --> Finished Dependency Resolution
  53.  
  54. Dependencies Resolved
  55.  
  56. ======================================================================================================================================================================================================
  57. Package Arch Version Repository Size
  58. ======================================================================================================================================================================================================
  59. Updating:
  60. kernel-headers x86_64 2.6.32-696.20.1.el6 updates 4.5 M
  61. php71u-cli x86_64 7.1.14-1.ius.centos6 ius 4.1 M
  62. php71u-intl x86_64 7.1.14-1.ius.centos6 ius 200 k
  63. php71u-json x86_64 7.1.14-1.ius.centos6 ius 64 k
  64. php71u-mbstring x86_64 7.1.14-1.ius.centos6 ius 988 k
  65. php71u-tidy x86_64 7.1.14-1.ius.centos6 ius 65 k
  66. tzdata noarch 2018c-1.el6 updates 492 k
  67. Removing:
  68. GeoIP-GeoLite-data noarch 2017.07-1.el6 @epel 1.1 M
  69. GeoIP-GeoLite-data-extra noarch 2017.07-1.el6 @epel 49 M
  70. kernel x86_64 2.6.32-642.13.1.el6 @updates 131 M
  71. kernel-firmware noarch 2.6.32-696.16.1.el6 @updates 58 M
  72. libblkid x86_64 2.17.2-12.28.el6_9.1 @updates 133 k
  73. libuuid x86_64 2.17.2-12.28.el6_9.1 @updates 16 k
  74. mysql-community-client x86_64 5.7.20-1.el6 @mysql57-community 100 M
  75. mysql-community-common x86_64 5.7.20-1.el6 @mysql57-community 2.5 M
  76. mysql-community-libs x86_64 5.7.20-1.el6 @mysql57-community 8.9 M
  77. mysql-community-server x86_64 5.7.20-1.el6 @mysql57-community 771 M
  78. ntp x86_64 4.2.6p5-12.el6.centos.1 @updates 1.6 M
  79. ntpdate x86_64 4.2.6p5-12.el6.centos.1 @updates 123 k
  80. php71u-common x86_64 7.1.11-1.ius.centos6 @ius 8.1 M
  81. php71u-fpm x86_64 7.1.11-1.ius.centos6 @ius 4.0 M
  82. php71u-gd x86_64 7.1.11-1.ius.centos6 @ius 731 k
  83. php71u-mysqlnd x86_64 7.1.11-1.ius.centos6 @ius 814 k
  84. php71u-opcache x86_64 7.1.11-1.ius.centos6 @ius 791 k
  85. php71u-pdo x86_64 7.1.11-1.ius.centos6 @ius 345 k
  86. php71u-pecl-apcu x86_64 5.1.8-1.ius.centos6 @ius 263 k
  87. php71u-pecl-igbinary x86_64 2.0.5-1.ius.centos6 @ius 134 k
  88. php71u-pecl-redis x86_64 3.1.4-2.ius.centos6 @ius 964 k
  89. php71u-process x86_64 7.1.11-1.ius.centos6 @ius 148 k
  90. php71u-xml x86_64 7.1.11-1.ius.centos6 @ius 788 k
  91. selinux-policy noarch 3.7.19-307.el6_9.2 @updates 9.0 M
  92. selinux-policy-targeted noarch 3.7.19-307.el6_9.2 @updates 3.5 M
  93. util-linux-ng x86_64 2.17.2-12.28.el6_9.1 @updates 5.9 M
  94.  
  95. Transaction Summary
  96. ======================================================================================================================================================================================================
  97. Upgrade 7 Package(s)
  98. Remove 26 Package(s)
  99.  
  100. Total size: 10 M
  101. Is this ok [y/N]: y
  102. Downloading Packages:
  103. Running rpm_check_debug
  104. ERROR with rpm_check_debug vs depsolve:
  105. ntpdate = 4.2.6p5-12.el6.centos.2 is needed by (installed) ntp-4.2.6p5-12.el6.centos.2.x86_64
  106. Complete!
  107. Not removing old transaction files

Do you find something wrong? I should read the output more carefully but I did not.

I wanted to finish the update in a short time so I did some attempts and had to remove the ntp package and finally run the 'yum update' successfully.

  1. ............
  2. Removed:
  3. GeoIP-GeoLite-data.noarch 0:2017.07-1.el6 GeoIP-GeoLite-data-extra.noarch 0:2017.07-1.el6 kernel.x86_64 0:2.6.32-642.13.1.el6 kernel-firmware.noarch 0:2.6.32-696.16.1.el6
  4. libblkid.x86_64 0:2.17.2-12.28.el6_9.1 libuuid.x86_64 0:2.17.2-12.28.el6_9.1 mysql-community-client.x86_64 0:5.7.20-1.el6 mysql-community-common.x86_64 0:5.7.20-1.el6
  5. mysql-community-libs.x86_64 0:5.7.20-1.el6 mysql-community-server.x86_64 0:5.7.20-1.el6 ntpdate.x86_64 0:4.2.6p5-12.el6.centos.1 php71u-common.x86_64 0:7.1.11-1.ius.centos6
  6. php71u-fpm.x86_64 0:7.1.11-1.ius.centos6 php71u-gd.x86_64 0:7.1.11-1.ius.centos6 php71u-mysqlnd.x86_64 0:7.1.11-1.ius.centos6 php71u-opcache.x86_64 0:7.1.11-1.ius.centos6
  7. php71u-pdo.x86_64 0:7.1.11-1.ius.centos6 php71u-pecl-apcu.x86_64 0:5.1.8-1.ius.centos6 php71u-pecl-igbinary.x86_64 0:2.0.5-1.ius.centos6 php71u-pecl-redis.x86_64 0:3.1.4-2.ius.centos6
  8. php71u-process.x86_64 0:7.1.11-1.ius.centos6 php71u-xml.x86_64 0:7.1.11-1.ius.centos6 selinux-policy.noarch 0:3.7.19-307.el6_9.2 selinux-policy-targeted.noarch 0:3.7.19-307.el6_9.2
  9. util-linux-ng.x86_64 0:2.17.2-12.28.el6_9.1
  10.  
  11. Updated:
  12. kernel-headers.x86_64 0:2.6.32-696.20.1.el6 php71u-cli.x86_64 0:7.1.14-1.ius.centos6 php71u-intl.x86_64 0:7.1.14-1.ius.centos6 php71u-json.x86_64 0:7.1.14-1.ius.centos6
  13. php71u-mbstring.x86_64 0:7.1.14-1.ius.centos6 php71u-tidy.x86_64 0:7.1.14-1.ius.centos6 tzdata.noarch 0:2018c-1.el6
  14.  
  15. Complete!
  16. Cleaning up completed transaction file

I did not find lots of packages were removed wrongly. not syncing: Attempted to kill init

Then I installed the ntp again and run the 'yum update' to confirm all the packages were the latest ones:

  1. [root@www ~]# yum update
  2. Loaded plugins: fastestmirror
  3. Setting up Update Process
  4. Loading mirror speeds from cached hostfile
  5. * base: mirrors.zju.edu.cn
  6. * epel: ftp.cuhk.edu.hk
  7. * extras: ftp.sjtu.edu.cn
  8. * ius: hkg.mirror.rackspace.com
  9. * updates: ftp.sjtu.edu.cn
  10. No Packages marked for Update

Then I rebooted the server and lost access to it.

From the console, I got the error messages similar with below:

  1. Kernel Panic - not syncing: Attempted to kill init!
  2. Pid: 1 comm: init Not tainted 2.6.32-358.6.2.e16.x86_64 #1
  3. Call Trace:
  4. [] ? panic+0xs7/0x16f
  5. [] ? do_exit+0x862/0x870
  6. [] ? fput+0x25/0x30
  7. [] ? do_group_exit+0x58/0xd0
  8. [] ? sys_exit_group+0x17/0x20
  9. [] ? system_call_fastpath+0x16/0x1b

I could not boot an Linux image to the rescue mode and at last I found one way to boot the system by adding kernel parameter selinux=0.

And removed the rhgb and quiet boot options, I found the root cause was the system could not load selinux policy, so I tried to regenerate the selinux policy by 'semodule -B'. I got some errors as some folders did not exist, so created them and run it finally.

While if I enabled the selinux, I would fail to boot the system again so temporarily I had to disable it.

Then I found mysql and php-fpm were not installed so had to reinstalled them to make my website work and had to restore some configuration files.

I was so tried these days that I wrote this note late, but currently I still do not know why 'yum update' did not upgrade those packages but removed them? Bug?

 
  • 本文由 NeilZhang 发表于16/03/2018 02:24:51
  • Repost please keep this link: https://www.dbcloudsvc.com/blogs/linux/not-syncing-attempted-to-kill-init/
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定