2

CentOS / RHEL 7

I'd like to see a list of services present on my system and which systemd target they'll automatically start for. Is that possible? I know I can run systemctl cat foo and check the WantedBy field value for an individual service but I was hoping to see a full list of everything.

Basically I'm looking for the systemd equivalent of chkconfig --list

Mike B
  • 8,769
  • 24
  • 70
  • 96

1 Answers1

3

Ah, nevermind. It looks like chkconfig still exists in a limited capacity on RHEL/CentOS 7 and has anticipated my question:

[foo@foobox ~] chkconfig

Note: This output shows SysV services only and does not include native
    systemd services.  SysV configuration data might be overridden by native
    systemd configuration. 

    If you want to list systemd services use `systemctl list-unit-files'.
    To see services enabled on particular target use
    `systemctl list-dependencies [target]'.

Sorry - I should have checked first. I just figured legacy stuff like chkconfig wouldn't exist in the newer OS's.

So while I can run a command using a specified individual target, I can't see a grand summary of launch status across all targets.

Mike B
  • 8,769
  • 24
  • 70
  • 96
  • 1
    In part that's because the list of targets is arbitrary. System administrators can add targets of their own, can make anything the default, and can make any target a goal. – JdeBP Jan 11 '18 at 21:55