https://archlinuxjp.kusakata.com/wiki/Systemd#.E9.9B.BB.E6.BA.90.E7.AE.A1.E7.90.86
Linuxでシャットダウンや再起動をするときは以下の様なコマンドを使用すると思いますが、systemdになってからsystemctlでも行えるようになっているのを知りました。
従来だと、
再起動:
shutdown -r now
reboot
シャットダウン:
shutdown -h now
halt
が、
systemctlだと
(再起動)systemctl reboot
(シャットダウン&パワーオフ)systemctl poweroff
(サスペンド)systemctl suspend
(ハイバネーション)systemctl hibernate
(ハイブリッドスリープ)systemctl hybrid-sleep
と別の形のものが用意されるようになりました。
他にもrescueやemergencyモードへの切り替えも行えるようになってもいるみたいです。
Systemdの採用が増えてきている以上は、こういうのも覚えておく必要がありそうです。
default
Enter default mode. This is mostly equivalent to isolate default.target.
rescue
Enter rescue mode. This is mostly equivalent to isolate rescue.target, but also prints a wall
message to all users.
emergency
Enter emergency mode. This is mostly equivalent to isolate emergency.target, but also prints a
wall message to all users.
halt
Shut down and halt the system. This is mostly equivalent to start halt.target --irreversible,
but also prints a wall message to all users. If combined with --force, shutdown of all running
services is skipped, however all processes are killed and all file systems are unmounted or
mounted read-only, immediately followed by the system halt. If --force is specified twice, the
operation is immediately executed without terminating any processes or unmounting any file
systems. This may result in data loss.
poweroff
Shut down and power-off the system. This is mostly equivalent to start poweroff.target
--irreversible, but also prints a wall message to all users. If combined with --force, shutdown
of all running services is skipped, however all processes are killed and all file systems are
unmounted or mounted read-only, immediately followed by the powering off. If --force is
specified twice, the operation is immediately executed without terminating any processes or
unmounting any file systems. This may result in data loss.
reboot [arg]
Shut down and reboot the system. This is mostly equivalent to start reboot.target
--irreversible, but also prints a wall message to all users. If combined with --force, shutdown
of all running services is skipped, however all processes are killed and all file systems are
unmounted or mounted read-only, immediately followed by the reboot. If --force is specified
twice, the operation is immediately executed without terminating any processes or unmounting
any file systems. This may result in data loss.
If the optional argument arg is given, it will be passed as the optional argument to the
reboot(2) system call. The value is architecture and firmware specific. As an example,
"recovery" might be used to trigger system recovery, and "fota" might be used to trigger a
“firmware over the air” update.
suspend
Suspend the system. This will trigger activation of the special suspend.target target.
hibernate
Hibernate the system. This will trigger activation of the special hibernate.target target.
hybrid-sleep
Hibernate and suspend the system. This will trigger activation of the special
hybrid-sleep.target target.
沓名 亮典
技術評論社
売り上げランキング: 202541
技術評論社
売り上げランキング: 202541