v188 added the ability to enable a unit with an instance name. However, if the unit has an Alias, it is not possible to enable this unit by any other template name than the name defined by the Alias. --> Example unit: [Unit] Description=dhcpcd on %I Wants=network.target Before=network.target [Service] Type=forking PIDFile=/run/dhcpcd-%I.pid ExecStart=/sbin/dhcpcd -A -q -w %I ExecStop=/sbin/dhcpcd -k %I [Install] Alias=multi-user.target.wants/dhcpcd@eth0.service --> Expected behavior: # systemctl enable dhcpcd@eth1.service ln -s '/usr/lib/systemd/system/dhcpcd@.service' '/etc/systemd/system/multi-user.target.wants/dhcpcd@eth1.service' --> Actual behavior: # systemctl enable dhcpcd@eth1.service ln -s '/usr/lib/systemd/system/dhcpcd@.service' '/etc/systemd/system/multi-user.target.wants/dhcpcd@eth0.service'
The Install section wants teh Alias removing and using WantedBy instead eg: [Unit] Description=dhcpcd on %I Wants=network.target Before=network.target BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=forking PIDFile=/run/dhcpcd-%I.pid ExecStart=/usr/sbin/dhcpcd -q -w %I ExecStop=/usr/sbin/dhcpcd -x %I [Install] WantedBy=multi-user.target
Created attachment 71508 [details] [review] Remove alias, add WantedBy Proposed patch.
http://lists.freedesktop.org/archives/systemd-devel/2013-January/008189.html Patch #2
Should be fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=7584d23.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.