July 10, 2022

RHEL 9.0 Manage Systemd Units

$ sudo systemctl list-units --type service --all

Systemd units can be of three kinds:

  • Service units have a .service extension and represent system services.
  • Socket units have a .socket extension and represent inter-process communication (IPC) sockets that systemd should monitor.
  • Path units have a .path extension and delay the activation of a service until a specific file-system change occurs.

Custom or override systemd units are stored:

/etc/systemd/system/

System defaults or rpm installed systemd units goes into are stored:

/usr/lib/systemd/system/

$ sudo systemctl cat sshd.service
$ sudo systemctl edit sshd.service
$ sudo systemctl daemon-reload
$ sudo systemctl status sshd.service 
$ sudo systemctl restart sshd.service 

Completely disabled, so that any start operation on it fails.

$ sudo systemctl mask sendmail.service
$ sudo  systemctl unmask sendmail.service
$ sudo systemctl enable httpd.service
$ sudo systemctl disable httpd.service 
$ sudo systemctl status httpd.service 
$ sudo systemctl is-enabled httpd.service 

No comments: