Systemctl силы порядка с до
Я хочу создать 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.
1 ответ
Решение
Наименование подразделения lighttpd.service, не просто lighttpdтак что это то, что вам нужно указать.