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?

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
  • 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 7 '17 at 14:48
  • list-unit-files takes a pattern. There is no need for grep. – JdeBP Feb 9 '17 at 15:55

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.