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