Table of Contents
Identify Automatically Started System Processes
Systemd
Replaces the older and clunkier init. Default as of RH7. Manages various things
Services | Daemons |
---|---|
Path | watches files |
Mount | controls mounts |
Timer | scheduling |
Slice | resource management |
socket | listens to ports |
target | groups units |
YOu can see the processes using pstree -p
Systemd divives your system into manageable chunks to see them
systemcctl list-units
You can specify to just list a particular type
systemctl list-units -t services -a
the -a will showe all se3rvices including those not active or installed that systemd knows about
You can also check if a service is enabled and or activbe with
systemctl is-active service name
If a service is not enabled you can enable it and start it with one command
systemctl enable --now service-name
List the enabled or disabled states of all service units.
systemctl list-unit-files --type=service
working with services
Every service has a process ID you can see it using systemctl or you can try using
pidof service
this will show you all the process ids associated with that service. Ussually the lowest one is the main one and others are branches.
reload
you can reload a service to cause it to reread the configuration file. This does not affect the PID ofr aq service those stay the same
restart
this restarts the service and it gets a new PID
if you are unsure if you can reload a service you can try the
systemctl reload-or-restarrt service
first tries a reload if tht does not work it will relstart it
ypu can also list the dependencies of a service
systemctl list-dependencies service
you can also see what calls the service with the
--reverse
option
The system can also mask a service so it will not run even to satisfy a dependency
systemctl mask service