systemd computes units to start on boot once when it [systemd] is started (or after switch to the real root from initrd). If unit definition is not available at this point, it is not included in boot transaction.
OK, understood. Instead of a symlink, I will copy the service definition itself to /etc/systemd/system/multi-user.target.wants and see if it works then. Give me a minute.
If you scroll down that man page until section titled Unit File Load Path, there’s a table which contains this row:
/usr/local/lib/systemd/system System units installed by the administrator
And if you think about it, the command sudo systemctl enable journal-split from the first post wouldn’t have worked if it was like you said. It would have thrown an error message that it can’t find journal-split.service.
I’d consider this a bug: If this path is explicitly foreseen to hold system units installed by the administrator, then it must be available at the time when systemd looks for unit definitions.
$ systemd-analyze verify journal-split.service
multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/journal-split.service is not a symlink, ignoring.
Will try to copy the service definition to /etc/systemd/system/ and create symlinks from there.
This is what I take as the lessons learned from this, at least for system stuff. For userland stuff (except services and other systemd stuff), I think that /usr/local is the right place.
This is only needed for services running under the current user, i.e. when you use the --user option with systemd.
Good for you This is because you never tried putting your service definition in /usr/local/lib/systemd/system instead of /etc/systemd/system.
On the one hand, the File Hierarchy Standard (also man file-hierarchy) specifies that /etc is for local configurations that do not execute binaries. On the other hand it specifies that /usr/local/ “is for use by the system administrator when installing software locally”. You could also argue (if not just for the purpose of organization) that all system unit files should go under /usr/local/lib/systemd/system, but this is intended for unit files that are part of “software” not from a package manager. The corresponding systemd user units that are system-wide could go under /usr/local/lib/systemd/user.
If one does follow this logic, she will end up in the same mess as I did.
When I started working with the HP 1000 - 21-MX E-Series in 1977 I needed to produce results and thus I learned at an early stage to avoid less common options. The same strategy works in 2023. I need no longer produce results. However I don’t want to waste my time either.