5

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/

  • To me it makes more sense the way Ubuntu does it. But you would have to ask the developers to get the correct answer. – WinEunuuchs2Unix Aug 7 '19 at 11:24
  • 2
    Since Ubuntu is Debian-based, see the Debian page on the topic. The answer to "why" seems simple: Limited Debian Developer interest in the proposal. – user535733 Aug 7 '19 at 11:29
  • it should be /sbin/systemctl or /usr/sbin/systemctl :=) – Rinzwind Aug 7 '19 at 11:50
  • 2
    @Rinzwind systemctl status foo-service should be available to all users. This means sbin is the wrong place. – guettli Aug 7 '19 at 11:58
  • 2
    @Rinzwind I want systemctl status foo-service to work as non-root user. This makes check-scripts easier. At least in my environment most checking gets done as non-root user. – guettli Aug 7 '19 at 12:11
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.