not syncing: Attempted to kill init

  • 262 views
  • Read

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

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

  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:

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

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

Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package kernel-headers.x86_64 0:2.6.32-696.16.1.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-696.20.1.el6 will be an update
---> Package mysql-community-server.x86_64 0:5.7.20-1.el6 will be updated
---> Package mysql-community-server.x86_64 0:5.7.21-1.el6 will be an update
---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.1 will be updated
--> Processing Dependency: ntpdate = 4.2.6p5-12.el6.centos.1 for package: ntp-4.2.6p5-12.el6.centos.1.x86_64
---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.2 will be an update
---> Package php71u-cli.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-cli.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-fpm.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-fpm.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-intl.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-intl.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-json.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-json.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-mbstring.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-mbstring.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-tidy.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-tidy.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package selinux-policy-targeted.noarch 0:3.7.19-307.el6_9.2 will be updated
---> Package selinux-policy-targeted.noarch 0:3.7.19-307el6_9.3 will be an update
---> Package tzdata.noarch 0:2017c-1.el6 will be updated
---> Package tzdata.noarch 0:2018c-1.el6 will be an update
--> Finished Dependency Resolution
Error: Package: ntp-4.2.6p5-12.el6.centos.1.x86_64 (@updates)
           Requires: ntpdate = 4.2.6p5-12.el6.centos.1
           Removing: ntpdate-4.2.6p5-12.el6.centos.1.x86_64 (@updates)
               ntpdate = 4.2.6p5-12.el6.centos.1
           Updated By: ntpdate-4.2.6p5-12.el6.centos.2.x86_64 (updates)
               ntpdate = 4.2.6p5-12.el6.centos.2
           Available: ntpdate-4.2.6p5-10.el6.centos.2.x86_64 (base)
               ntpdate = 4.2.6p5-10.el6.centos.2
 You could try using --skip-broken to work around the problem
** Found 31 pre-existing rpmdb problem(s), 'yum check' output follows:
GeoIP-GeoLite-data-2018.01-1.el6.noarch is a duplicate with GeoIP-GeoLite-data-2017.07-1.el6.noarch
GeoIP-GeoLite-data-extra-2018.01-1.el6.noarch is a duplicate with GeoIP-GeoLite-data-extra-2017.07-1.el6.noarch
kernel-firmware-2.6.32-696.20.1.el6.noarch is a duplicate with kernel-firmware-2.6.32-696.16.1.el6.noarch
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
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
mysql-community-client-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-client-5.7.20-1.el6.x86_64
mysql-community-common-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-common-5.7.20-1.el6.x86_64
mysql-community-libs-5.7.21-1.el6.x86_64 is a duplicate with mysql-community-libs-5.7.20-1.el6.x86_64
ntp-4.2.6p5-12.el6.centos.2.x86_64 is a duplicate with ntp-4.2.6p5-12.el6.centos.1.x86_64
ntp-4.2.6p5-12.el6.centos.2.x86_64 has missing requires of ntpdate = ('0', '4.2.6p5', '12.el6.centos.2')
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
php71u-common-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-common-7.1.11-1.ius.centos6.x86_64
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
php71u-gd-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-gd-7.1.11-1.ius.centos6.x86_64
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
php71u-mysqlnd-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-mysqlnd-7.1.11-1.ius.centos6.x86_64
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
php71u-opcache-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-opcache-7.1.11-1.ius.centos6.x86_64
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
php71u-pdo-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-pdo-7.1.11-1.ius.centos6.x86_64
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
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
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
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
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
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
php71u-process-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-process-7.1.11-1.ius.centos6.x86_64
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
php71u-xml-7.1.14-1.ius.centos6.x86_64 is a duplicate with php71u-xml-7.1.11-1.ius.centos6.x86_64
selinux-policy-3.7.19-307el6_9.3.noarch is a duplicate with selinux-policy-3.7.19-307.el6_9.2.noarch
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':

[root@www ~]# yum-complete-transactionn 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * epel: ftp.cuhk.edu.hk
 * extras: ftp.sjtu.edu.cn
 * ius: hkg.mirror.rackspace.com
 * updates: ftp.sjtu.edu.cn
There are 1 outstanding transactions to complete. Finishing the most recent one
The remaining transaction had 40 elements left to run
--> Running transaction check
---> Package GeoIP-GeoLite-data.noarch 0:2017.07-1.el6 will be erased
---> Package GeoIP-GeoLite-data-extra.noarch 0:2017.07-1.el6 will be erased
---> Package kernel.x86_64 0:2.6.32-642.13.1.el6 will be erased
---> Package kernel-firmware.noarch 0:2.6.32-696.16.1.el6 will be erased
---> Package kernel-headers.x86_64 0:2.6.32-696.16.1.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-696.20.1.el6 will be an update
---> Package libblkid.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
---> Package libuuid.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
---> Package mysql-community-client.x86_64 0:5.7.20-1.el6 will be erased
---> Package mysql-community-common.x86_64 0:5.7.20-1.el6 will be erased
---> Package mysql-community-libs.x86_64 0:5.7.20-1.el6 will be erased
---> Package mysql-community-server.x86_64 0:5.7.20-1.el6 will be erased
---> Package ntp.x86_64 0:4.2.6p5-12.el6.centos.1 will be erased
---> Package ntpdate.x86_64 0:4.2.6p5-12.el6.centos.1 will be erased
---> Package php71u-cli.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-cli.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-common.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-fpm.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-gd.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-intl.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-intl.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-json.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-json.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-mbstring.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-mbstring.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-mysqlnd.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-opcache.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-pdo.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-pecl-apcu.x86_64 0:5.1.8-1.ius.centos6 will be erased
---> Package php71u-pecl-igbinary.x86_64 0:2.0.5-1.ius.centos6 will be erased
---> Package php71u-pecl-redis.x86_64 0:3.1.4-2.ius.centos6 will be erased
---> Package php71u-process.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package php71u-tidy.x86_64 0:7.1.11-1.ius.centos6 will be updated
---> Package php71u-tidy.x86_64 0:7.1.14-1.ius.centos6 will be an update
---> Package php71u-xml.x86_64 0:7.1.11-1.ius.centos6 will be erased
---> Package selinux-policy.noarch 0:3.7.19-307.el6_9.2 will be erased
---> Package selinux-policy-targeted.noarch 0:3.7.19-307.el6_9.2 will be erased
---> Package tzdata.noarch 0:2017c-1.el6 will be updated
---> Package tzdata.noarch 0:2018c-1.el6 will be an update
---> Package util-linux-ng.x86_64 0:2.17.2-12.28.el6_9.1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================================
 Package                                               Arch                                Version                                              Repository                                       Size
======================================================================================================================================================================================================
Updating:
 kernel-headers                                        x86_64                              2.6.32-696.20.1.el6                                  updates                                         4.5 M
 php71u-cli                                            x86_64                              7.1.14-1.ius.centos6                                 ius                                             4.1 M
 php71u-intl                                           x86_64                              7.1.14-1.ius.centos6                                 ius                                             200 k
 php71u-json                                           x86_64                              7.1.14-1.ius.centos6                                 ius                                              64 k
 php71u-mbstring                                       x86_64                              7.1.14-1.ius.centos6                                 ius                                             988 k
 php71u-tidy                                           x86_64                              7.1.14-1.ius.centos6                                 ius                                              65 k
 tzdata                                                noarch                              2018c-1.el6                                          updates                                         492 k
Removing:
 GeoIP-GeoLite-data                                    noarch                              2017.07-1.el6                                        @epel                                           1.1 M
 GeoIP-GeoLite-data-extra                              noarch                              2017.07-1.el6                                        @epel                                            49 M
 kernel                                                x86_64                              2.6.32-642.13.1.el6                                  @updates                                        131 M
 kernel-firmware                                       noarch                              2.6.32-696.16.1.el6                                  @updates                                         58 M
 libblkid                                              x86_64                              2.17.2-12.28.el6_9.1                                 @updates                                        133 k
 libuuid                                               x86_64                              2.17.2-12.28.el6_9.1                                 @updates                                         16 k
 mysql-community-client                                x86_64                              5.7.20-1.el6                                         @mysql57-community                              100 M
 mysql-community-common                                x86_64                              5.7.20-1.el6                                         @mysql57-community                              2.5 M
 mysql-community-libs                                  x86_64                              5.7.20-1.el6                                         @mysql57-community                              8.9 M
 mysql-community-server                                x86_64                              5.7.20-1.el6                                         @mysql57-community                              771 M
 ntp                                                   x86_64                              4.2.6p5-12.el6.centos.1                              @updates                                        1.6 M
 ntpdate                                               x86_64                              4.2.6p5-12.el6.centos.1                              @updates                                        123 k
 php71u-common                                         x86_64                              7.1.11-1.ius.centos6                                 @ius                                            8.1 M
 php71u-fpm                                            x86_64                              7.1.11-1.ius.centos6                                 @ius                                            4.0 M
 php71u-gd                                             x86_64                              7.1.11-1.ius.centos6                                 @ius                                            731 k
 php71u-mysqlnd                                        x86_64                              7.1.11-1.ius.centos6                                 @ius                                            814 k
 php71u-opcache                                        x86_64                              7.1.11-1.ius.centos6                                 @ius                                            791 k
 php71u-pdo                                            x86_64                              7.1.11-1.ius.centos6                                 @ius                                            345 k
 php71u-pecl-apcu                                      x86_64                              5.1.8-1.ius.centos6                                  @ius                                            263 k
 php71u-pecl-igbinary                                  x86_64                              2.0.5-1.ius.centos6                                  @ius                                            134 k
 php71u-pecl-redis                                     x86_64                              3.1.4-2.ius.centos6                                  @ius                                            964 k
 php71u-process                                        x86_64                              7.1.11-1.ius.centos6                                 @ius                                            148 k
 php71u-xml                                            x86_64                              7.1.11-1.ius.centos6                                 @ius                                            788 k
 selinux-policy                                        noarch                              3.7.19-307.el6_9.2                                   @updates                                        9.0 M
 selinux-policy-targeted                               noarch                              3.7.19-307.el6_9.2                                   @updates                                        3.5 M
 util-linux-ng                                         x86_64                              2.17.2-12.28.el6_9.1                                 @updates                                        5.9 M

Transaction Summary
======================================================================================================================================================================================================
Upgrade       7 Package(s)
Remove       26 Package(s)

Total size: 10 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
ERROR with rpm_check_debug vs depsolve:
ntpdate = 4.2.6p5-12.el6.centos.2 is needed by (installed) ntp-4.2.6p5-12.el6.centos.2.x86_64
Complete!
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.

............
Removed:
  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       
  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       
  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        
  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       
  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     
  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
  util-linux-ng.x86_64 0:2.17.2-12.28.el6_9.1 

Updated:
  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      
  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                    

Complete!
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:

[root@www ~]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * epel: ftp.cuhk.edu.hk
 * extras: ftp.sjtu.edu.cn
 * ius: hkg.mirror.rackspace.com
 * updates: ftp.sjtu.edu.cn
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:

Kernel Panic - not syncing: Attempted to kill init!
Pid: 1 comm: init Not tainted 2.6.32-358.6.2.e16.x86_64 #1
Call Trace:
[] ? panic+0xs7/0x16f
[] ? do_exit+0x862/0x870
[] ? fput+0x25/0x30
[] ? do_group_exit+0x58/0xd0
[] ? sys_exit_group+0x17/0x20
[] ? 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?

  • by Published on 16/03/2018 02:24:51
  • Repost please keep this link: https://www.dbcloudsvc.com/blogs/linux/not-syncing-attempted-to-kill-init/
匿名

Comment

Anonymous Write

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

Decide