Is there a better way to override all instances of a templated systemd unit?

in flag

I ran into an issue with vncserver needing to wait for my autofs-managed home directory. I have multiple users that will need VNC access. The vnc server is started by systemd.

I'm aware that I could do:

systemd edit vncserver@:1.service
systemd edit vncserver@:2.service
systemd edit vncserver@:3.service

etc and add:


to each, but I'd rather not be repeating myself when they all need the same edit.

I'm also aware that I could copy the unit file to /etc/systemd/system and just add my line there and then enable instances of that template.

My question is, does systemd have an in-built way to edit all instances of a templated unit at once, or do I need to go with one of the solutions above, or is there some other way to do this I haven't thought of?

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.