2014年8月11日月曜日

yumでpostfix削除したらcronが動かなくなってはまった件

postfix入れなくていいサーバーだったので、
yumでpostfixを削除したらcronが動かなくなりはまってしまいました。

yum removeで削除したところ。
何も確認しないで削除してたら、依存してるものもいくつか消していました。
その中にcrontabsもいました。
# yum remove postfix
Loaded plugins: fastestmirror, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be erased
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-12.el6 will be erased
--> Processing Dependency: cronie = 1.4.4-12.el6 for package: cronie-anacron-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be erased
--> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-22.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be erased
---> Package sysstat.x86_64 0:9.0.4-22.el6 will be erased
--> Finished Dependency Resolution
base                                                                                                                                  | 3.7 kB     00:00     
epel/metalink                                                                                                                         | 4.2 kB     00:00     
epel                                                                                                                                  | 4.4 kB     00:00     
epel/primary_db                                                                                                                       | 6.3 MB     00:00     
extras                                                                                                                                | 3.4 kB     00:00     
updates                                                                                                                               | 3.4 kB     00:00     
 
Dependencies Resolved
 
=============================================================================================================================================================
 Package                         Arch                    Version                             Repository                                                 Size
=============================================================================================================================================================
Removing:
 postfix                         x86_64                  2:2.6.6-2.2.el6_1                   @anaconda-CentOS-201311291202.x86_64/6.5                  9.7 M
Removing for dependencies:
 cronie                          x86_64                  1.4.4-12.el6                        @anaconda-CentOS-201311291202.x86_64/6.5                  174 k
 cronie-anacron                  x86_64                  1.4.4-12.el6                        @anaconda-CentOS-201311291202.x86_64/6.5                   43 k
 crontabs                        noarch                  1.10-33.el6                         @anaconda-CentOS-201311291202.x86_64/6.5                  2.4 k
 sysstat                         x86_64                  9.0.4-22.el6                        @anaconda-CentOS-201311291202.x86_64/6.5                  824 k
 
Transaction Summary
=============================================================================================================================================================
Remove        5 Package(s)
 
Installed size: 11 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : sysstat-9.0.4-22.el6.x86_64                                                                                                               1/5 
  Erasing    : cronie-anacron-1.4.4-12.el6.x86_64                                                                                                        2/5 
  Erasing    : crontabs-1.10-33.el6.noarch                                                                                                               3/5 
  Erasing    : cronie-1.4.4-12.el6.x86_64                                                                                                                4/5 
  Erasing    : 2:postfix-2.6.6-2.2.el6_1.x86_64                                                                                                          5/5 
警告: /etc/postfix/main.cf は /etc/postfix/main.cf.rpmsave として保存されました。
  Verifying  : crontabs-1.10-33.el6.noarch                                                                                                               1/5 
  Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                                                                                                        2/5 
  Verifying  : sysstat-9.0.4-22.el6.x86_64                                                                                                               3/5 
  Verifying  : 2:postfix-2.6.6-2.2.el6_1.x86_64                                                                                                          4/5 
  Verifying  : cronie-1.4.4-12.el6.x86_64                                                                                                                5/5 
 
Removed:
  postfix.x86_64 2:2.6.6-2.2.el6_1                                                                                                                           
 
Dependency Removed:
  cronie.x86_64 0:1.4.4-12.el6        cronie-anacron.x86_64 0:1.4.4-12.el6        crontabs.noarch 0:1.10-33.el6        sysstat.x86_64 0:9.0.4-22.el6       
 
Complete!

cronがいるはずのディレクトリを探してもいません。。。
# ls /etc/init.d/c*
/etc/init.d/certmonger  /etc/init.d/cpuspeed
 
# ls /usr/bin/cr*
/usr/bin/crash  /usr/bin/crlutil


yumでcrontabを入れます。
# yum install crontabs
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * epel: ftp.kddilabs.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be installed
--> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-12.el6 will be installed
--> Processing Dependency: dailyjobs for package: cronie-1.4.4-12.el6.x86_64
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be installed
---> Package exim.x86_64 0:4.72-5.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=============================================================================================================================================================
 Package                                   Arch                              Version                                   Repository                       Size
=============================================================================================================================================================
Installing:
 crontabs                                  noarch                            1.10-33.el6                               base                             10 k
Installing for dependencies:
 cronie                                    x86_64                            1.4.4-12.el6                              base                             73 k
 cronie-anacron                            x86_64                            1.4.4-12.el6                              base                             30 k
 exim                                      x86_64                            4.72-5.el6                                epel                            1.2 M
 
Transaction Summary
=============================================================================================================================================================
Install       4 Package(s)
 
Total download size: 1.3 M
Installed size: 4.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): cronie-1.4.4-12.el6.x86_64.rpm                                                                                                 |  73 kB     00:00     
(2/4): cronie-anacron-1.4.4-12.el6.x86_64.rpm                                                                                         |  30 kB     00:00     
(3/4): crontabs-1.10-33.el6.noarch.rpm                                                                                                |  10 kB     00:00     
(4/4): exim-4.72-5.el6.x86_64.rpm                                                                                                     | 1.2 MB     00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        4.1 MB/s | 1.3 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : exim-4.72-5.el6.x86_64                                                                                                                    1/4 
  Installing : cronie-1.4.4-12.el6.x86_64                                                                                                                2/4 
  Installing : crontabs-1.10-33.el6.noarch                                                                                                               3/4 
  Installing : cronie-anacron-1.4.4-12.el6.x86_64                                                                                                        4/4 
  Verifying  : crontabs-1.10-33.el6.noarch                                                                                                               1/4 
  Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                                                                                                        2/4 
  Verifying  : exim-4.72-5.el6.x86_64                                                                                                                    3/4 
  Verifying  : cronie-1.4.4-12.el6.x86_64                                                                                                                4/4 
 
Installed:
  crontabs.noarch 0:1.10-33.el6                                                                                                                              
 
Dependency Installed:
  cronie.x86_64 0:1.4.4-12.el6                      cronie-anacron.x86_64 0:1.4.4-12.el6                      exim.x86_64 0:4.72-5.el6                     
 
Complete!

無事に入りました。
cronがいるべきディレクトリを見てみると、
ちゃんとcrondとcrontabが存在してました。
よかった。
# ls /etc/init.d/c*
/etc/init.d/certmonger  /etc/init.d/cpuspeed  /etc/init.d/crond
 
# ls /usr/bin/cr*
/usr/bin/crash  /usr/bin/crlutil  /usr/bin/crontab

yumで削除する時は一緒に消されるものもちゃんと確認しようと心に誓いました。

0 件のコメント:

コメントを投稿