-
Notifications
You must be signed in to change notification settings - Fork 137
Systemd
Endi S. Dewata edited this page Sep 14, 2023
·
1 revision
To list services:
$ systemctl list-units --type=service
To start a service:
$ systemctl start <name>.service
To stop a service:
$ systemctl stop <name>.service
To check service status:
$ systemctl status <name>.service
To reload systemd configuration:
$ systemctl daemon-reload
The global systemd journal configuration is located at /etc/systemd/journald.conf.
To restrict the journal size to 100 MB:
[Journal] SystemMaxUse=100M
Then restart the systemd journal service:
$ systemctl restart systemd-journald
To view systemd journal for a PKI instance:
$ journalctl -u pki-tomcatd@<instance>.service
To clear systemd journals except for the last 2 days:
$ journalctl --vacuum-time=2d
To clear systemd journals except for the last 100 MB:
$ journalctl --vacuum-size=100M
$ systemd-ask-password --keyname=nssdb --accept-cached "NSS database password:" NSS database password: ********** Secret.123
$ keyctl search @u user nssdb @s 576612158
$ keyctl print %user:nssdb Secret.123
To notify that the service is ready:
$ systemd-notify --pid=<PID> --ready
If PKI service fails to start with the following error:
Starting PKI Tomcat Server pki-tomcat... pki-tomcatd@pki-tomcat.service: Failed to determine user credentials: No such process pki-tomcatd@pki-tomcat.service: Failed at step USER spawning /usr/sbin/pki-server: No such process pki-tomcatd@pki-tomcat.service: Control process exited, code=exited, status=217/USER pki-tomcatd@pki-tomcat.service: Failed with result 'exit-code'. Failed to start PKI Tomcat Server pki-tomcat.
execute the following command:
$ systemctl daemon-reexec
- systemd.service
- Understanding Systemd Units and Unit Files
- How To Use Systemctl to Manage Systemd Services and Units
- Packaging:Systemd
- RHEL 7 - System Administrator's Guide - Working with systemd Targets
- Using environment variables in systemd units
- DS Systemd
- Tomcat Systemd
- PKI Systemd Service
- Nuxwdog
- Keyring
- Understanding Systemd Units and Unit Files
- systemd-notify
- sd_notify
Tip
|
To find a page in the Wiki, enter the keywords in search field, press Enter, then click Wikis. |