純粋なシステムデバイスのK99停止コマンド

純粋なシステムデバイスのK99停止コマンド

systemctl isolate rescue.target終了、再開、またはinit 1sysv私のOS用の初期化スクリプトがありますCentos7。私のスクリプトは、これらのスクリプトがすべて停止した後に実行する必要があります。名前が生成されたため、WantedByオプションでは使用できません。

可能なすべての終了バリアントをリストしたくなかったので、WantedByスクリプトを実行する代わりに使用する方が簡単だと思いました。ExecStopExecStart

WantedBy=basic.target希望の単位より遅く停止すると仮定し、これを試しましたが、うまくmulti-user.targetいきません。

# my unit stopped:
Apr 08 16:58:00 wc8rh7 systemd[1]: Stopped Stop all db2 processes except fault monitor.
# the generated sysv script stopped:
Apr 08 16:58:12 wc8rh7 systemd[1]: Stopped LSB: Starts and stops Application Server instances.

_

[Unit]
Description=Stop all db2 processes except fault monitor
#DefaultDependencies=no
#Before=multi-user.target

[Service]
IgnoreSIGPIPE=false
ExecStart=/bin/true
ExecStop=/usr/local/bin/db2stopall
RemainAfterExit=yes

[Install]
WantedBy=basic.target

ベストアンサー1

おすすめ記事