systemctl force order with before

Я хочу создать службу systemctl, которая монтирует разделы, необходимые lighttpd. В файле my-service.service я написал следующее:

[Unit]
Before=lighttpd

[Service]
ExecStart=/home/user/mount_script
Type=notify
User=user
Group=user

[Install]
WantedBy=multi-user.target

Но когда я хочу включить его, у меня появляется следующая ошибка, выводимая в syslog:

systemd[1]: Reloading.
systemd[1]: /etc/systemd/system/my-service.service:2: Failed to add dependency on lighttpd, ignoring: Invalid argument

Я не понимаю, как я могу заставить lighttpd запускаться после my-service...

Из руководства:

Before=: The units listed in this directive will not be started
         until the current unit is marked as started if they are
         activated at the same time. This does not imply a dependency
         relationship and must be used in conjunction with one of the
         above directives if this is desired.
0
задан 28 May 2019 в 18:16
1 ответ

Имя подразделения - lighttpd.service , а не просто lighttpd , так что это то, что вам нужно указать.

1
ответ дан 4 December 2019 в 15:42

Теги

Похожие вопросы