Systemd - defined form of symbolic links

I’ve recently installed the UM 26.04 LTS Resolute Racoon Daily Build from Nov 19 2025.

lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=26.04
DISTRIB_CODENAME=resolute
DISTRIB_DESCRIPTION="Ubuntu Resolute Raccoon (development branch)"


Related to the following file:

/etc/systemd/system/hybrid-sleep.target.wants/grub2-common.service

Is it possible that the file’s name should be

/etc/systemd/system/hybrid-sleep.target.wants/grub-common.service


Would it be a better form to have that symlink defined as:

cd /etc/systemd/system/hybrid-sleep.target.wants/

ln -s ../grub2-common.service grub2-common.service

instead of

cd /etc/systemd/system/hybrid-sleep.target.wants/

ln -s /etc/systemd/system/grub2-common.service grub2-common.service

or, in line with my first question:

ln -s ../grub-common.service grub-common.service

It is not clear to me what you are asking here.

Are you reporting a bug or requesting a change?

Thank you, @rubi1200, for responding.

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 :slight_smile: )?

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 …

1 Like

To be fair, in Debian packaging, absolute symlinks should not be used.

-HOWEVER-

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.

1 Like

Well, if you actually ship symlinks, yes :slight_smile: but here debhelper handles it at install time as you described …

Exactly. We’re agreeing here. I just wanted to show both sides of the coin.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.