Systemd

From Dogtag
Jump to: navigation, search

Service

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

Journal

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

Password

$ 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

Troubleshooting

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

References