0

I create a "target" in /etc/systemd/system that is very simple

sp-example.target

[Unit]
Description=SP Example Target

[Install]
WantedBy=multi-user.target

I then create a directory called /etc/systemd/system/sp-example.target.wants. In this directory, I put a link to my service and restart the system. It doesn't start the service, but it does start the target. I move the link from this sp-example.target.wants directory into multi-user.target.wants and reboot and the service starts.

  • This folder /etc/systemd/system/sp-example.target.wants is actually a link to another disk. It seems that systemd mounts the disks later and may already be determining this folder is empty (bad link). Maybe I need a way to trigger systemd to rescan for the wants folder. – Steven P Sep 27 '17 at 7:57
0

It appears that "wants" directories cannot be on another disk that is not yet mounted unless systemd is reloaded as follows after the disk is mounted.

systemctl daemon-reload
systemctl restart <service>

Putting this in a later rc5.d script causes the problem to be solved.

Reference: https://serverfault.com/questions/700862/do-systemd-unit-files-have-to-be-reloaded-when-modified

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.