LoginSignup
119
122

More than 5 years have passed since last update.

CentOSの要らないサービスを無効にするレシピ

Last updated at Posted at 2013-05-28

CentOSでインストールされるサービスの中で、頻繁に不要とされるサービスをまとめて無効にするレシピです。よく使うレシピに忍ばせておけば便利ですよ。

パッケージは適宜カスタマイズしてください。

default.rb
%w[acpid auditd autofs avahi-daemon avahi-dnsconfd bluetooth conman cpuspeed cups dnsmasq dund gpm hidd ip6tables irda lvm2-monitor mcstrans mdmonitor multipathd pand pcscd psacct rawdevices readahead_early readahead_later restorecond saslauthd smartd wpa_supplicant ypbind yum-updatesd].each { |name|
  service name do
    ignore_failure true
    action [:disable, :stop]
  end
}

ignore_failureをつけないと、パッケージが見つからない時点でエラーで止まってしまいます。と言っても見栄えが悪いのでいい方法あったら教えてください。


(2013-6-17 追記)
上記のレシピをCookbookcentos5::stop-servicesにまとめました

https://github.com/tumf/centos5-cookbook

Berkshellf使っている方はいかのようにすることで簡単に利用できます。

echo "cookbook 'centos5', github: 'tumf/centos5-cookbook'" >> Berksfile
berks berks install --path cookbooks
119
122
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
119
122