[systemd-devel] Q: Reducing the output of systemctl status
Ulrich Windl
Ulrich.Windl at rz.uni-regensburg.de
Wed May 15 06:49:02 UTC 2019
Hi!
First, is it a well-known bug that "--quitet" seems to be ignored for
"systemctl status"? It's the only command where --quiet makes sense IMHO, but
it seems to have no effect in v228.
Also, considering this example output:
---
● iotwatch at LOC1.service - iotwatch I/O performance monitor instance "LOC1"
Loaded: loaded (/run/systemd/generator.late/iotwatch at LOC1.service; bad;
vendor preset: disabled)
Active: active (running) since Wed 2019-05-15 08:33:14 CEST; 2min 17s ago
Docs: man:iotwatch(1)
man:iotwatch at .service(8)
Process: 13962 ExecStartPost=/usr/bin/sleep 0.2 (code=exited,
status=0/SUCCESS)
Process: 13950 ExecStart=iotwatch-LOC1 -l
/var/log/iotwatch/LOC1/iotwatch-LOC1.log -m N
-p/var/run/iotwatch-LOC1/iotwatch-LOC1.pid -d1 -a0.02 -b512 -i4 -sE -t2.0
-TA=0.025:0.035,X=0.25:0.75 -OR
-OS:T=F75,S:M=O52,N:3.29/40,Q:C=100,P:nagios.nagios=0664 /etc/passwd
(code=exited, status=0/SUCCESS)
Process: 13929 ExecStartPre=/bin/sh -c [ -d "/var/log/iotwatch/LOC1" -o 1
-eq 0 ] || mkdir "/var/log/iotwatch/LOC1" || exit 3 (code=exited,
status=0/SUCCESS)
Process: 13913 ExecStartPre=/bin/sh -c [ -h
"/var/run/iotwatch-LOC1/iotwatch-LOC1" ] || ln -s "/usr/bin/iotwatch"
"/var/run/iotwatch-LOC1/iotwatch-LOC1" || exit 3 (code=exited,
status=0/SUCCESS)
Process: 13903 ExecStartPre=/bin/sh -c [ -d "/var/run/iotwatch-LOC1" ] ||
mkdir "/var/run/iotwatch-LOC1" || exit 3 (code=exited, status=0/SUCCESS)
Main PID: 13960 (iotwatch-LOC1)
Tasks: 4 (limit: 512)
CGroup: /system.slice/system-iotwatch.slice/iotwatch at LOC1.service
└─13960 iotwatch-LOC1 -l /var/log/iotwatch/LOC1/iotwatch-LOC1.log
...
May 15 08:33:14 rksapv04 systemd[1]: Starting iotwatch I/O performance
moni.....
May 15 08:33:14 rksapv04 systemd[1]: Started iotwatch I/O performance
monit...".
---
I wonder if I could suppress the "lesser-important" output, like pre- and post
start commands.
(Actually I had to add a manual sleep as the PID file is created by the child
process after the parent exited, and systemd complained the PIDFile is not
present yet.)
I just noticed: If you use a "argv[0] override" for your command, it's not
just that the command is started with that name, it's also displayed as
ExecStart here (not path shown). I used it to shorten error messages using
argv[0].
So I'd like a status output that simply displays:
Active: active (running) since Wed 2019-05-15 08:33:14 CEST; 2min 17s ago
Regards,
Ulrich
More information about the systemd-devel
mailing list