You are not logged in.
When a SystemD service fails I can use the commands
# systemctl status <service-name>
Assuming I have given service:
[Unit]
Description=Load encryption keys
DefaultDependencies=no
After=zfs-import.target
Before=zfs-mount.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/zfs load-key -a
StandardInput=tty-force
[Install]
WantedBy=zfs-mount.service
And I get somethin like:
systemctl status zfs-load-key.service ~
× zfs-load-key.service - Load encryption keys
Loaded: loaded (/etc/systemd/system/zfs-load-key.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Fri 2024-03-08 16:51:30 CET; 26min ago
Process: 1974 ExecStart=/usr/bin/zfs load-key -a (code=exited, status=255/EXCEPTION)
Main PID: 1974 (code=exited, status=255/EXCEPTION)
CPU: 110ms
Mär 08 16:51:29 vbm systemd[1]: Starting Load encryption keys...
Mär 08 16:51:30 vbm systemd[1]: zfs-load-key.service: Main process exited, code=exited, status=255/>
Mär 08 16:51:30 vbm systemd[1]: zfs-load-key.service: Failed with result 'exit-code'.
Mär 08 16:51:30 vbm systemd[1]: Failed to start Load encryption keys.
All I get is "zfs-load-key.service: Failed with result 'exit-code'."
However it does not print me the error output of the internal command
of 'ExecStart' which here is the command
#/usr/bin/zfs load-key -a
How can I make the error output of the internal command (here zfs load-key -a) visible?
Offline
Offline
I agree with Seth.
What I did was to create a function that did both. If a unit fails, but retries and you need to know its' entire startup to address the situation, you won't know from just the systemctl command.
systemctl status "${1:-lightdm}" --no-pager --full ; echo '--' ; journalctl -b -u "${1:-lightdm}" --no-pager
Offline