I am raising a point of discussion, because I don’t know whether this is a bug or not.
If someone confirms that it is a bug, for each of
form of symlink, and/or
the name of the file,
I will happily take that and submit a bug report.
I wanted to get feedback/confirmation regarding what my instincts tell me may be “malformed”.
But not being an Ubuntu OS developer, I didn’t want to make any claims until I was “enlightened” by those having the necessary wisdom or awareness of intent.
The filename for the service is the name of the deb package that shipped it, so grub2-common is correct here …
Why do you think relative symlinks would be better (I personally doubt it is safer, without having done any research or having any evidence though, just a gut feeling )?
The handling of links comes from systemd, it creates the symlinks when you enable a service, so there is not a lot Ubuntu could do here, you should ask upstream …
The systemd spec, when it comes to symbolic links for the purposes of an “enabled” service (a service that starts at boot time), those should be absolute links as systemctl enable would create.
So, how does a Debian package deal with this?
If there’s a systemd service named <<packagename>>.service in the debian directory of a particular package, then debhelper, the application that does a majority of the automated package handling, handles it and, by default, enables it, creating the absolute symlinks as @ericmarceau showed us above.
As you’ll see above, these are not only created by the package, but the systemctl enable command, per the spec by systemd, wants these to be absolute (full path) links. When the package is unpacked and configured, debhelper takes care of this automatically.
Before anybody says that Ubuntu should not do this, you must realize that systemd is a component of a much larger Ubuntu operating system (as is the Linux kernel!) in which most things are developed upstream, including systemd. This is something outside the scope of Ubuntu, but part of systemd which is developed upstream. I’m sure the systemd developers have thought of reasons why things are done this way, and considering it’s the first thing run after the Linux kernel is loaded into memory, I’d say the rationalle has already been thought through tremendously and thoroughly.