Search code examples
linuxrhel

How to determine a package service name for systemctl enable on RHEL 7


How can I check for a package service name so that I could use it for 'systemctl enable' on RHEL7.


Solution

  • The easiest way is to simply look at the list of unit files installed by the package, e.g.:

    $ rpm -ql openssh-server | grep '\.service'
    /usr/lib/systemd/system/sshd-keygen.service
    /usr/lib/systemd/system/sshd.service
    /usr/lib/systemd/system/sshd@.service