タイマー付きsystemdデバイス "Before ="

タイマー付きsystemdデバイス

私のシステムには、b.timerによって有効になっているb.serviceがあります。 b.serviceの前に他のサービス(a.service)を起動したいと思います。 b.serviceやb.timerは私のものではないので変更できません。 a.serviceを入れましたが、タイマーはBefore=b.serviceb.serviceを起動しますが、a.serviceは起動しません。

ベストアンサー1

a.serviceで表示できますRequiredBy b.service

a.service次のようにしてください:

[Unit]
Before=b.service

[Service]
Type=exec
ExecStart=...

[Install]
RequiredBy=b.service

それから:

systemctl enable a.service

b.service開始するたびに(タイマーであってもパスであっても)systemctl start、新しいものがa.service最初に始まります。

おすすめ記事