CentOS7になってから、否が応でもsystemdを使わなければならなくなりました…。
ので、特に使いそうなコマンドをメモっておきます。
【一覧】
操作内容 | SysVinit | Systemd |
起動 | /etc/init.d/sshd start | systemctl start sshd |
終了 | /etc/init.d/sshd stop | systemctl stop sshd |
強制終了 | PID探してkill -9 | systemctl kill -s 9 sshd |
再起動 | /etc/init.d/sshd restart | systemctl restart sshd |
設定反映 | /etc/init.d/sshd reload | systemctl reload sshd |
状態取得 | /etc/init.d/sshd status | systemctl status sshd |
自動起動を有効 | chkconfig sshd on | systemctl enable sshd |
自動起動を無効 | chkconfig sshd off | systemctl disable sshd |
自動起動の状態確認 | chkconfig --list | systemctl list-unit-files |
自動起動の状態確認 | chkconfig --list sshd | systemctl is-enabled sshd |
サービス一覧の表示 | ls /etc/init.d | systemctl --type service |