Skip to content

Commit c6d8b10

Browse files
authored
systemd and more about systemctl
1 parent e366643 commit c6d8b10

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,29 @@ Regular expressions.
583583

584584

585585
## Managing systemd units
586+
- `systemd` is the process process started by the kernel linux, systemd is responsible for rrunning the other processes, `pstree` to show the processes in a tree structure.
587+
- `ps -ax` to show the processes, the id of `systemd` is 1.
588+
- `systemd` is a system and service manager, it introduces a concept of system units.
589+
- system units are represented by unit configuration files:
590+
- `/etc/systemd/system/` --> managed by admin
591+
- `/run/systemd/system` --> created at runtime.
592+
- `usr/lib/systemd/system/` --> distributed with package installation.
593+
- Types of system units:
594+
- `service units`
595+
- `socket units`
596+
- `path units`
586597
- `systemctl status jenkins`: systemctl is included in systemd, the preceding command check the status of the jenkins service.
587598
- `systemctl disable jenkins`: do not start jenkins automatically after the boot.
588599
- `systemctl enable jenkins`: start jenkins automatically after the boot.
589600
- `systemctl stop jenkins`: stop the service jenkins.
590601
- `systemctl start jenkins`: start jenkins.
591602
- `systemctl restart jenkins`: restart jenkins.
603+
- `systemctl is-active jenkins`: is the service jenkis active?.
604+
- `systemctl --type=service`: show only service units.
605+
- `systemctl list-dependencies ssh`: show the dependencies of a given service, in other word, what are the other units that will start when starting the given service.
606+
- `systemctl edit --full sshd.service`: to edit the config unit file of the ssh service without the need to know the location of that file in the system.
607+
- `systemctl cat sshd.service`: to print the config unit file.
608+
- `system show ssh.service`: to print more details about the unit configiguration of that service.
592609

593610
## Viewing Logs
594611
- `cat var/log/syslog`: print the content of the syslog file. The `var/log` directory contains logs of different services.

0 commit comments

Comments
 (0)