is there an easy way to find any units not in their default (vendor) state?

Christoph Anton Mitterer calestyo at scientia.net
Fri Jul 2 18:55:57 BST 2021


Hey.

On Fri, 2021-07-02 at 10:50 -0400, Felipe Sateler wrote:
> systemctl show -p Id,UnitFileState,UnitFilePreset '*.service'

That seems promising... thx.


When I do something like:

systemctl show -p Id,UnitFileState,UnitFilePreset '*' | paste - - - -  | grep -E -v $'^[^\t]+\tUnitFileState=([^\t]*)\tUnitFilePreset=\\1\t$'  | sed 's/^Id=//' | column -t -s $'\t'


I still get these combinations:
UnitFileState=alias            UnitFilePreset=enabled   
UnitFileState=disabled         UnitFilePreset=enabled   
UnitFileState=enabled-runtime  UnitFilePreset=enabled   
UnitFileState=generated        UnitFilePreset=enabled   
UnitFileState=indirect         UnitFilePreset=enabled   
UnitFileState=static           UnitFilePreset=disabled  
UnitFileState=static           UnitFilePreset=enabled   
UnitFileState=transient        UnitFilePreset=enabled   


of which I'd suspect these can be ignored:
- static / *

and probably also these which are however not documented in
(org.freedesktop.systemd1(5)):
- alias / *       (seems to be just aliases and not what really enables/disables a unit?)
- generated / *   (not sure about that)


while these are actually the ones where the system's local state
somehow differs from what it should be:
- disabled / enabled
- enabled / disabled

not sure about these, but they also sound like cases where the current
state differs from the "default":
- enabled-runtime / *
- linked / *
- linked-runtime / *
- masked / *
- masked-runtime / *


not sure about these (don't seem to be documented):
- indirect
- transient



Would there be any way to reset everything?
Probably not, because maintainer scripts might also
enable/disable/mask/etc. stuff?


Thanks,
Chris.




More information about the Pkg-systemd-maintainers mailing list