0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux][command] システム再起動_reboot, shutdown, systemctl, init, telinit

Last updated at Posted at 2025-02-24

システム再起動一覧

コマンド 説明
reboot 即座に再起動
使用例:
- reboot:即座に再起動
shutdown 再起動のスケジュール・ユーザーへの警告メッセージの送信
使用例:
- shutdown -r now:即座に再起動
- shutdown -r +5 "システムは5分後に再起動します":5分後に再起動し、メッセージを表示
- shutdown -r 22:00:当日の22:00に再起動をスケジュール
systemctl systemd システムでのサービスやシステムを管理
使用例:
- systemctl restart:即座に再起動
- systemctl reboot:即座に再起動
- systemctl start reboot.target:即座に再起動
init ランレベルを変更することでシステムの状態を変更
使用例:
- init 6:再起動
telinit ランレベルを変更することでシステムの状態を変更
使用例:
- telinit 6:再起動

強制的な再起動コマンド

reboot -f

-f オプションを付けることで、システムを即座に強制再起動します。通常のシャットダウン処理をバイパスするため、データ損失のリスクがあります。

# reboot -f

systemctl reboot --force

systemd を使用して、強制的に再起動を実行します。

# systemctl reboot --force

systemctl reboot --force --force

さらに --force を2回指定することで、systemd を完全にバイパスし、カーネルから直接再起動を実行します。システムが応答しなくなった場合の最終手段です。

# systemctl reboot --force --force

echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger

SysRq 機能を使用して、カーネルレベルで即座に再起動を実行します。プロセスの終了処理を行わず、強制的に再起動するため、ファイルシステムの破損リスクがあります。

# echo 1 > /proc/sys/kernel/sysrq
# echo b > /proc/sysrq-trigger

Ping-t

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?