runlevelとsystemd targetの切替、停止と再起動3 / 3

終了と通知

wall 'Maintenance starts at 18:00'
shutdown -r +10 'Maintenance reboot'
shutdown -c
systemctl poweroff
systemctl reboot
指定 動作
wall 利用者の端末へmessageを送る
shutdown -r +10 10分後の再起動を予約し通知する
shutdown -c 予約を取り消す
poweroff 電源停止を要求する
reboot 再起動を要求する

通常のservice終了ではSIGTERMなどで終了を依頼し、処理や保存の猶予を持たせる。応答しない場合のSIGKILLは捕捉できず、後片付けを実行できない場合がある。

acpidは電源ボタンなどのACPI eventを受けて処理するdaemonである。Upstartはevent駆動のinit方式であり、systemdのtargetやSysVのrunlevelの設定と構文を混ぜない。

学習パスへ
参考資料