Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
title fix
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 263

systemd "wants" directory for a custom target,target; does not seem to work as expecteexpected

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.

systemd "wants" directory for a custom target, does not seem to work as expecte

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.

systemd "wants" directory for a custom target; does not seem to work as expected

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.

Source Link

systemd "wants" directory for a custom target, does not seem to work as expecte

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.