[[systemctl]]

*サービスの自動起動 [#v7e47dfd]
***一覧の確認 [#gc416a64]
 # systemctl list-unit-files

***サービスの自動起動の設定を確認する [#gb9b3a98]
 # systemctl list-unit-files postfix.service
 UNIT FILE       STATE
 postfix.service enabled
 
 1 unit files listed.

  # systemctl list-unit-files amavisd.service
 UNIT FILE       STATE
 amavisd.service disabled
 
 1 unit files listed.


*** serviceのみ確認する [#ld606bbc]
 # systemctl -t service 

***サービスの自動起動オン [#zf9246bf]
 # systemctl enable ntpd
 ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
 ※リンク先のショートカットを削除すると、systemctl list-unit-filesではdisabledとなる。
 ※また、/etc/systemd/system/multi-user.target.wants/ からもシンボリックリンクが消えるので確認可能。
 

***サービスの自動起動オフ [#refa9961]
 # systemctl disable ntpd
 rm '/etc/systemd/system/multi-user.target.wants/ntpd.service'
 # systemctl list-unit-files | grep ntp
 ntpd.service                                disabled

*サービスの起動と停止 [#wdd58cf8]
***起動 [#r51dfb0e]
 # systemctl start サービス名
***停止 [#z26c7845]
 # systemctl stop サービス名

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS