Whenever I enable a certain instanced systemd service, I want two timers with the same instance specifier to be enabled as well. This is what my unit file foo@.service looks like:
[Unit] Description=Does something cool Documentation=man:foo(1) [Service] Type=forking ExecStart=/usr/bin/foo %i PIDFile=%t/foo/foo.pid StandardOutput=journal [Install] WantedBy=network-online.target Also=bar1@%i.timer Also=bar2@%i.timer
systemctl enable firstname.lastname@example.org returns:
Failed to enable unit: Invalid argument
If I remove the instance specifiers from the [Install] section and replace them with specific instance names (so it looks like the following), then it works just fine.
... Alsoemail@example.com Alsofirstname.lastname@example.org
The man page systemd.unit(5) says that the %i specifier is interpreted in the install section, so what gives?
The following specifiers are interpreted in the Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v.