2

In the good old days you would use chkconfig to see if a service was enabled for a run level. E.g.

chkconfig --list tgtd

However, now you're supposed to use systemctl. But I can't get systemctl to give a similarly succinct output as chkconfig.

Any suggestions on how you do so?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Snowcrash
  • 679
  • Not the exactly answer. I use insserv -s | grep whatever –  Feb 07 '17 at 12:47
  • check here for a bit more details about Systemd : http://unix.stackexchange.com/questions/158872/does-systemd-still-know-about-runlevels – magor Feb 07 '17 at 13:27

1 Answers1

2

You can check if it is enabled or disables by using this command:

systemctl list-unit-files --type=service

Where "--type=service" helps you narrow it down to services only.

And you can enable/disable services with commands:

systemctl enable httpd
systemctl disable httpd
Iggy B
  • 144
  • Yes. So systemctl list-unit-files --type=service | grep tgtd which gives tgtd.service enabled. Not quite as succinct but does the job. – Snowcrash Feb 07 '17 at 14:48
  • list-unit-files takes a pattern. There is no need for grep. – JdeBP Feb 09 '17 at 15:55