You are not logged in.
Pages: 1
Topic closed
So, I booted into systemd for the first time today and have been poking around a bit trying to learn. I ran systemctl list-unit-files and noticed that a significant amount of them had a state of "static", rather than "enabled" or "disabled". I looked in the manpages for systemd and systemctl, as well as doing several different web searches, but haven't found an explanation of what "static" means in this context. Can anyone help shed some light on this.
Offline
Basically it means, that you can't disable those services. You can either manually remove relevant symlinks from /usr/lib/systemd/system/, or you can mask those services - systemd will ignore them even though they are statically enabled.
Offline
In particular, "static" means "enabled because something else wants it". Think by analogy to pacman's package install reasons:
enabled :: explicitly installed
static :: installed as dependency
disabled :: not installed
Offline
Fantastic, thanks. I had already guessed this was the case (unable to disable, pulled in as dependency) but couldn't find any confirming/dis-confirming information online.
Offline
Just in case someone falls here (as me) and gets confused about this post...
Static units are those which cannot be enabled/disabled, but it doesn't mean they are always executed. They will only if another unit depends on them, or if they are manually started.
Actually, static units are simply those without an [Install] section. As enabling units means just creating a symlink to wherever [Install] mandates, those units without [Install] section cannot be enabled, as systemctl doesn't know where to place the symlink.
Of course, you can still manually create a symlink from a static unit to (for instance) /etc/systemd/system/multi-user.target.wants/, and it will be executed as any other enabled unit. But I suppose static units are not intended to be enabled in that way, and most probably you shouldn't need to do it
Offline
I did not know that distinction, thanks!
Offline
good posts!
Offline
you can list them all by:
systemctl list-unit-files --state=static
Offline
Using this opportunity to close this very old thread.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed