Ubuntu – Why /bin/systemctl

fhssystemd

According to the system experts, the correct location of systemctl is /usr/bin/systemctl:

https://lists.freedesktop.org/archives/systemd-devel/2019-August/043224.html

Why does Ubuntu use /bin/systemctl?

Related: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/

Best Answer

So booting into a system with a separate /usr partition is not supported by systemd. More specifically, switching root to a system where /usr is not yet mounted is not supported, in such systems, the initramfs should mount both / and /usr before switching root.

Having said that, the configuration with a separate /usr mostly worked in systemd systems, and it used to work almost well in older versions of systemd, before they officially declared it unsupported and started rejecting fixes for those setups.

(You've already referred to The Case for the /usr Merge, so you can read more there on the inherent problems with those setups and motivations for the merge as a fix.)

Since historically supporting systems with separate /usr was necessary to some extent, a decision had to be made of whether to put systemctl under /usr or outside it. The main question to answer in this context is: what happens if /usr fails to mount and you need to fix your system into booting again? If systemctl was under /usr, it wouldn't be available, while if it's in /bin, you'll have it around. Given you're likely to be starting, stopping and checking status of services while trying to fix your system, shipping it in the root partition makes sense.

But, again, merging /usr is the real solution for this, since then these points are all moot. If /usr fails to mount you're still on an initramfs and can use the tools inside there for fixing it. All modern distributions are switching to a merged /usr, so this solution should be around most Linux setups real soon now.

Related Question