このブログを検索

2018年3月20日火曜日

サービス自動起動リスト確認→サービス停止→サービス開始

OS:CentOS7

[root@cent02 ~]# systemctl list-unit-files -t service  ←サービス毎の起動時設定を確認
UNIT FILE                                     STATE
arp-ethers.service                            disabled ←自動起動しない
auditd.service                                enabled ←自動起動する
auth-rpcgss-module.service                    static ←自動起動しない
autovt@.service                               enabled
blk-availability.service                      disabled
brandbot.service                              static
chrony-dnssrv@.service                        static
chrony-wait.service                           disabled
chronyd.service                               enabled
console-getty.service                         disabled
console-shell.service                         disabled
container-getty@.service                      static
corosync-notifyd.service                      disabled
corosync.service                              disabled
cpupower.service                              disabled
crm_mon.service                               disabled
crond.service                                 enabled
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl stop crond.service  ←サービス停止
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl is-active crond.service  ←状態確認
inactive
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl start crond.service  ←サービス開始
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl is-active crond.service  ←状態確認
active
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl restart crond.service  ←サービス再起動
[root@cent02 ~]#
[root@cent02 ~]#
[root@cent02 ~]#
systemctl is-active crond.service  ←状態確認
active
[root@cent02 ~]#