Package: systemd
Version: 232-25+deb9u1

Imagine I have this template unit file 
/lib/systemd/system/foo@.service<mailto:/lib/systemd/system/foo@.service>
[Unit]
Description=hello service (%i)

[Service]
TimeoutStartSec=0
Type=oneshot
ExecStart=/bin/echo "hello world %i"

[Install]
WantedBy=multi-user.target
Alias=%p@%i.service<mailto:Alias=%25p@%25i.service>

Now, if I enabled two service instances from this template unit file, and I try 
to disable them just after then there is an error of type “Failed to disable 
unit: Too many levels of symbolic links”, and the only way to disable them 
properly is to disable the service template, look at the below example for a 
better understanding:

root@debian:/lib/systemd/system# systemctl enable 
hello@1.service<mailto:hello@1.service>
Created symlink 
/etc/systemd/system/hello@1.service<mailto:/etc/systemd/system/hello@1.service> 
→ /lib/systemd/system/hello@.service<mailto:/lib/systemd/system/hello@.service>.
Created symlink 
/etc/systemd/system/multi-user.target.wants/hello@1.service<mailto:/etc/systemd/system/multi-user.target.wants/hello@1.service>
 → 
/lib/systemd/system/hello@.service<mailto:/lib/systemd/system/hello@.service>.

root@debian:/lib/systemd/system# systemctl enable 
hello@2.service<mailto:hello@2.service>
Created symlink 
/etc/systemd/system/hello@2.service<mailto:/etc/systemd/system/hello@2.service> 
→ /lib/systemd/system/hello@.service<mailto:/lib/systemd/system/hello@.service>.
Created symlink 
/etc/systemd/system/multi-user.target.wants/hello@2.service<mailto:/etc/systemd/system/multi-user.target.wants/hello@2.service>
 → 
/lib/systemd/system/hello@.service<mailto:/lib/systemd/system/hello@.service>.

root@debian:/lib/systemd/system# systemctl disable 
hello@1.service<mailto:hello@1.service>
Failed to disable unit: Too many levels of symbolic links

root@debian:/lib/systemd/system# systemctl disable 
hello@2.service<mailto:hello@2.service>
Failed to disable unit: Too many levels of symbolic links

root@debian:/lib/systemd/system# systemctl disable 
hello@.service<mailto:hello@.service>
Removed 
/etc/systemd/system/hello@1.service<mailto:/etc/systemd/system/hello@1.service>.
Removed 
/etc/systemd/system/hello@2.service<mailto:/etc/systemd/system/hello@2.service>.
Removed 
/etc/systemd/system/multi-user.target.wants/hello@1.service<mailto:/etc/systemd/system/multi-user.target.wants/hello@1.service>.
Removed 
/etc/systemd/system/multi-user.target.wants/hello@2.service<mailto:/etc/systemd/system/multi-user.target.wants/hello@2.service>.

This is a big regression because on Jessie it works well, and as all my 
applications are based on systemd template unit files, I am not able actually 
to upgrade to Stretch…
I meet the same issue on x86_64 or ARM architecture.
The only work around I found is to manually remove symlink files but I don’t 
know if it is enough to properly disable a systemd service ?

Other technical informations:

-          dpkg -s libc6 | grep ^Version : Version: 2.24-11+deb9u1

-          uname -a : Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 
(2017-09-19) x86_64 GNU/Linux








_________________________________________________________________________________________________________________________



Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc

pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler

a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,

Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.



This message and its attachments may contain confidential or privileged 
information that may be protected by law;

they should not be distributed, used or copied without authorisation.

If you have received this email in error, please notify the sender and delete 
this message and its attachments.

As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.

Thank you.

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.
Thank you.

Reply via email to