====== サービス関連 ====== ===== サービス起動 ===== Fedora
$ sudo systemctl start httpd.service
$ sudo systemctl start {httpd,php-fpm}
CentOS 6
$ sudo service httpd start
===== サービス停止 ===== Fedora
$ sudo systemctl stop httpd.service
$ sudo systemctl stop {httpd,php-fpm}
CentOS 6
$ sudo service httpd stop
===== サービス再起動 ===== Fedora
$ sudo systemctl restart httpd.service
$ sudo systemctl restart {httpd,php-fpm}
CentOS 6
$ sudo service httpd restart
===== サービス設定反映 ===== Fedora
$ sudo systemctl reload httpd.service
サービスにHUPシグナルを送って設定を反映させる。\\ \\ CentOS 6
$ sudo service httpd reload
===== サービス自動起動設定 ===== Fedora
$ sudo systemctl enable httpd.service
$ sudo systemctl enable --now httpd
CentOS 6
$ sudo chkconfig httpd on
===== サービス自動起動無効設定 ===== Fedora
$ sudo systemctl disable httpd.service
CentOS 6
$ sudo chkconfig httpd off
===== サービス状態表示 ===== Fedora
$ systemctl status acpid
$ systemctl status {httpd,php-fpm}
===== サービス一覧表示 ===== Fedora
$ systemctl -t service --all
CentOS 6
$ chkconfig --list
===== systemd のランレベル設定方法 ===== [[linux:change_systemd_runlevel|systemd のランレベル設定方法]]\\ ===== systemd のサービス定義ファイルの内容表示 =====
$ cat /usr/lib/systemd/system/named-chroot.service
===== シャットダウン、サスペンド、休止状態 ===== Fedora ^ コマンド ^ 説明 ^ |
$ sudo systemctl --no-wall reboot
| システムを再起動する | |
$ sudo systemctl poweroff
| システムの電源を切る | |
$ sudo systemctl --no-wall poweroff
| システムの電源を切る (ログインユーザーに通知しない) | |
$ sudo shutdown --poweroff 07:21
| システムの電源を切る (指定時間に) | |
$ sudo systemctl suspend
| システムをサスペンド(システム状態は RAM に保存)する | |
$ sudo systemctl hibernate
| システムをハイバネート(システム状態はディスクに保存)する | |
$ sudo systemctl hybrid-sleep
| システムをハイブリッドスリープ(システム状態は RAM とディスクに保存、一定期間でサスペンドからハイバネートへ移行)する | |
$ sudo systemctl suspend-then-hibernate
| | |
$ sudo systemctl soft-reboot
| | |
$ sudo shutdown --halt +3
|
$ sudo shutdown -c
| | |
$ sudo systemctl halt
| | |
$ sudo systemctl reboot
| |
===== 参考文献 ===== [[https://community.nethserver.org/t/systemctl-and-vendor-preset-disabled/18355|Systemctl and "vendor preset: disabled" - Support - NethServer Community]]\\ [[https://www.freedesktop.org/software/systemd/man/systemd.preset.html|systemd.preset]]\\ [[rhdoc>ja/documentation/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-power#sect-Managing_Services_with_systemd-Power|10.4. システムのシャットダウン、サスペンド、および休止状態 | Red Hat Product Documentation]]\\ [[rhdoc>ja/documentation/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/shutting-down-suspending-and-hibernating-the-system_managing-systemd#changing-the-power-button-behavior-in-gnome_changing-the-power-button-behavior|12.4. システムのシャットダウン、サスペンド、およびハイバネート | Red Hat Product Documentation]]\\ [[arc>Systemd#.E9.9B.BB.E6.BA.90.E7.AE.A1.E7.90.86|systemd - ArchWiki - systemd - ArchWiki]]\\ [[arc>%E9%9B%BB%E6%BA%90%E7%AE%A1%E7%90%86/%E3%82%B5%E3%82%B9%E3%83%9A%E3%83%B3%E3%83%89%E3%81%A8%E3%83%8F%E3%82%A4%E3%83%90%E3%83%8D%E3%83%BC%E3%83%88#.E9.AB.98.E3.83.AC.E3.83.99.E3.83.AB.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.BC.E3.83.95.E3.82.A7.E3.82.A4.E3.82.B9_.28systemd.29|電源管理/サスペンドとハイバネート - ArchWiki]]\\