0% found this document useful (0 votes)
563 views

CentOS 7 and RHEL 7 - Systemd Commands

This document provides an overview of using systemd commands like systemctl to manage services in CentOS 7 and RHEL 7, as the traditional service command is being deprecated. It outlines equivalents for common tasks like starting, stopping, restarting, reloading services. For example, to restart sshd you would now use "systemctl restart sshd" instead of the older "service sshd restart". Chkconfig commands are also replaced by systemctl, such as using "systemctl enable httpd" instead of "chkconfig httpd on".

Uploaded by

glaubercms
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
563 views

CentOS 7 and RHEL 7 - Systemd Commands

This document provides an overview of using systemd commands like systemctl to manage services in CentOS 7 and RHEL 7, as the traditional service command is being deprecated. It outlines equivalents for common tasks like starting, stopping, restarting, reloading services. For example, to restart sshd you would now use "systemctl restart sshd" instead of the older "service sshd restart". Chkconfig commands are also replaced by systemctl, such as using "systemctl enable httpd" instead of "chkconfig httpd on".

Uploaded by

glaubercms
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CentOS 7 / RHEL 7 systemd commands

July 29, 2014

By now, if youve played around with CentOS 7 (or RHEL 7), youve heard that there are now
systemd commands you can start using to start, restart and stop various services. They still have the service
command included for backwards compatibility, but that may go away in future releases. Heres a little tutorial to
help you learn the systemd commands!
Ok, so youre on your new CentOS 7 (or RHEL 7) system (well just call it CentOS 7 for now to make it easier) and
you restarted sshd with the old/familiar service sshd restart command and youre met with this: Redirecting to
/bin/systemctl restart sshd.service
[root@centos7 ~]# service sshd restart
Redirecting to /bin/systemctl restart sshd.service
Now, it still restarted it, but that little note is annoying. Its basically telling you hey things have changed use
systemctl now!
You could now type systemctl restart sshd for a shorter version.. here are some examples:
Stop service:
systemctl stop httpd
Start service:
systemctl start httpd
Restart service (stops/starts):
systemctl restart httpd
Reload service (reloads config file):
systemctl reload httpd
List status of service:
systemctl status httpd
What about chkconfig? That changed too? Yes, now you want to use systemctl for the chkconfig commands also..
chkconfig service on:
systemctl enable httpd
chkconfig service off:
systemctl disable httpd
chkconfig service (is it set up to start?)
systemctl is-enabled httpd
chkconfig list (shows what is and isnt enabled)
systemctl list-unit-files --type=service

You might also like