Suppose a package provides whatever.service file so certain events (including whatever.socket) cause a daemon to start with a certain configuration.
I want to disable this completely. In particular, I want the old socket and any other unit files that might refer to this service by name to be unable to start the daemon.
Instead, I want to create my own unit files for this daemon with a different .socket unit and different environment variables. I also want my override to automatically take account of possible upstream updates to the original unit file (which my current solution of copying whatever.service as whatever-modified.service and editing it unfortunately does not provide).
If I create the following symlinks and files:
/etc/systemd/system/whatever.service → /dev/null
/etc/systemd/system/whatever-modified.service → /usr/lib/systemd/system/whatever.service
systemd considers the new service to be masked as well and refuses to start it. How to avoid this?