1

I try to port a full stack of services to centos8 and there to systemd start system.

I wrote a 'truc.service' like :

[Unit]
After=network.target network-online.target syslog.target
PartOf=machin.target
[Service]
Type=forking
ExecStart=/my/binary/stuff.bin run %i
[Install]
WantedBy=machin.target

so I describe a "machin.target" like :

[Unit]
Wants=bidule.service
Wants=truc@001.service truc@002.service
[Install]
WantedBy=chose.service

once enabled, and daemon-reloaded by systemctl, if I do

systemctl list-dependencies machin.target

I get

machin.target
--bidule.service
--truc@001.service
--truc@002.service
--truc@machin.service

It looks it tries to start one more instance of 'truc' using its own name, and I don't want it ! Where am I wrong ?

[my english skill might not be good enough and since this is a compagny work, I need to anonymize things. Hope you will understand my problem]

Overnuts
  • 121
  • 6

1 Answers1

1

I found !

When installing services I did :

 systemctl enable /my/path/truc@.service

This leads to a symbolic link into:

/etc/systemd/system/machin.target.wants/truc@.service

This seems to be the mistake. If I remove that symlink, after doing a 'daemon-reload', the list-dependencies tells:

machin.target
--bidule.service
--truc@001.service
--truc@002.service
Overnuts
  • 121
  • 6