SLES 12
Sponsored Link

サービスの設定2015/11/21

[1] サービスの状態は以下のようにして確認できます。
# 稼働中のサービスの一覧

dlp:~ #
systemctl -t service

UNIT                         LOAD   ACTIVE SUB     DESCRIPTION
after-local.service          loaded active exited  /etc/init.d/after.local Compa
apparmor.service             loaded active exited  LSB: AppArmor initialization
cron.service                 loaded active running Command Scheduler
dbus.service                 loaded active running D-Bus System Message Bus
dm-event.service             loaded active running Device-mapper event daemon
getty@tty1.service           loaded active running Getty on tty1
haveged.service              loaded active running Entropy Daemon based on the H
irqbalance.service           loaded active running irqbalance daemon
iscsi.service                loaded active exited  Login and scanning of iSCSI d
kdump.service                loaded active exited  Load kdump kernel on startup
kmod-static-nodes.service    loaded active exited  Create list of required stati
nscd.service                 loaded active running Name Service Cache Daemon
postfix.service              loaded active running Postfix Mail Transport Agent
rc-local.service             loaded active exited  /etc/init.d/boot.local Compat
rsyslog.service              loaded active running System Logging Service
serial-getty@ttyS0.service   loaded active running Serial Getty on ttyS0
sshd.service                 loaded active running OpenSSH Daemon
.....
.....

# 全サービスの一覧

dlp:~ #
systemctl list-unit-files -t service

UNIT FILE                               STATE
accounts-daemon.service                 disabled
after-local.service                     static
alsa-restore.service                    static
alsa-state.service                      static
alsa-store.service                      static
alsasound.service                       static
atd.service                             disabled
auditd.service                          disabled
autofs.service                          disabled
autovt@.service                         disabled
autoyast-initscripts.service            disabled
blk-availability.service                disabled
.....
.....
[2] 不要なサービスを止めるには以下のようにします。例として、iscsi を停止し、システムの起動時に自動的に立ち上がらないようにしています。
dlp:~ #
systemctl stop iscsi

dlp:~ #
systemctl disable iscsi

[3] 上記サービス(Systemdサービス)以外に旧式のSysVサービスが残っており、こちらの自動起動設定は旧式の chkconfig で制御することになります。
dlp:~ #
chkconfig --list


Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.

after.local               0:off  1:off  2:off  3:off  4:off  5:off  6:off
cifs                      0:off  1:off  2:off  3:off  4:off  5:off  6:off
dbus                      0:off  1:off  2:on   3:on   4:off  5:on   6:off
inputattach               0:off  1:off  2:off  3:off  4:off  5:off  6:off
ipmi                      0:off  1:off  2:off  3:off  4:off  5:off  6:off
nfs                       0:off  1:off  2:off  3:off  4:off  5:off  6:off
.....
.....

# snmpdの自動起動をオフにする

dlp:~ #
chkconfig snmpd off

関連コンテンツ