systemctlコマンド

Debian でも システム管理に systemd を採用しているが、systemd を制御するコマンドが systemctl になる。
shutdown コマンドが利用できないと慌てると、シンボリックリンクが張られていなかったりする。

コマンド対応表

従来systemctl機能
haltsystemctl haltシステムの停止
poweroffsystemctl poweroff電源を切る
rebootsystemctl reboot再起動
suhtdownsystemctl poweroff電源を切る

ちなみに

コマンドの所在

# which halt poweroff reboot shutdown
/sbin/halt
/sbin/poweroff
/sbin/reboot
/sbin/shutdown

リンクの確認

# ls -l /sbin/halt /sbin/poweroff /sbin/reboot /sbin/shutdown
lrwxrwxrwx 1 root root 14  7月 22 03:43 /sbin/halt -> /bin/systemctl
lrwxrwxrwx 1 root root 14  7月 22 03:43 /sbin/poweroff -> /bin/systemctl
lrwxrwxrwx 1 root root 14  7月 22 03:43 /sbin/reboot -> /bin/systemctl
lrwxrwxrwx 1 root root 14  7月 22 03:43 /sbin/shutdown -> /bin/systemctl

ヘルプ

systemctl はいろいろな機能があるが、システムコマンドのみを抜粋

# systemctl --help
:
System Commands:
  is-system-running               Check whether system is fully running
  default                         Enter system default mode
  rescue                          Enter system rescue mode
  emergency                       Enter system emergency mode
  halt                            Shut down and halt the system
  poweroff                        Shut down and power-off the system
  reboot [ARG]                    Shut down and reboot the system
  kexec                           Shut down and reboot the system with kexec
  exit [EXIT_CODE]                Request user instance or container exit
  switch-root ROOT [INIT]         Change to a different root file system
  suspend                         Suspend the system
  hibernate                       Hibernate the system
  hybrid-sleep                    Hibernate and suspend the system

なぜか suhtdown の表記がない?


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2020-02-14 (金) 10:09:21