Tme520 Systemd
Tme520 Systemd
System state
Services management
service httpd start systemctl start httpd.service Start a service (not reboot persistent).
service httpd stop systemctl stop httpd.service Stop a service (not reboot persistent).
service httpd restart systemctl restart httpd.service Restart a service.
service httpd reload systemctl reload httpd.service Reloads the configuration files without interrupting pending
operations.
service httpd systemctl condrestart httpd.service Restarts if the service is already running.
condrestart
service httpd status systemctl status httpd.service Shows the status of a service.
service --status-all systemctl list-units --type=service Displays the status of all services.
ls /etc/rc.d/init.d/ systemctl list-unit-files --type=service List the services that can be started or stopped.
chkconfig httpd on systemctl enable httpd.service Start service at next boot.
chkconfig httpd off systemctl disable httpd.service Service won't be started on next boot.
chkconfig httpd systemctl is-enabled httpd.service Check if a service is configured to start in the current
environment.
chkconfig --list systemctl list-unit-files --type=service or ls /etc/systemd/sy‐ Print a list of services showing which runlevels they are
stem/*.wants/ configured for.
chkconfig httpd --list ls /etc/systemd/system/*.wants/httpd.service Show which runlevels a service is configured for.
chkconfig httpd -- systemctl daemon-reload Run this command after a change in any configuration file
add (old or new).
Investigate
Command Notes
systemctl get-default Determine which target unit is used by default.
systemctl set-default multi-user.target Change default boot target to multi-user.target.
journalctl -b Show all messages from last boot.
journalctl -b -p err Show all messages of priority level ERROR and more from last boot.
journalctl -p warning --since="2015-07-31 12:34:56" --until="2015-09- View the messages of priority level WARNING or more from a certain
19 23:59:59" date and time.
journalctl -f Follow new messages a la tail -f.
journalctl -u SERVICE Show logs for SERVICE.
journalctl /usr/sbin/httpd Show all messages related to a specific executable.
Runlevels