I want to create a
systemctl service that mounts partitions required by
lighttpd. In the
my-service.service file, I wrote the following:
[Unit] Before=lighttpd [Service] ExecStart=/home/user/mount_script Type=notify User=user Group=user [Install] WantedBy=multi-user.target
But when I want to enable it, I have the following error printed in
systemd: Reloading. systemd: /etc/systemd/system/my-service.service:2: Failed to add dependency on lighttpd, ignoring: Invalid argument
I don’t understand how I can force
lighttpd to be launched after
From the manual:
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.
The name of the unit is
lighttpd.service, not just
lighttpd, so that is what you need to specify.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.