Bug 1018335

Summary: various timing parameters have an incorrect USec suffix in systemctl show output, such as RestartUSec, TimeoutUSec, etc.
Product: [Fedora] Fedora Reporter: Andrew J. Schorr <aschorr>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: johannbg, lnykryn, msekleta, plautrba, swadeley, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-13 18:11:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew J. Schorr 2013-10-11 17:38:45 UTC
Description of problem: When you run "systemctl show", various timing parameters have the wrong name.  For example:

bash-4.2$ systemctl show unbound | grep USec
JobTimeoutUSec=0
RestartUSec=100ms
TimeoutUSec=1min 30s
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0

The suffix in all cases should be "Sec", not "Usec".  Please refer to
the man page.  Compare this to what's in the service files:

bash-4.2$ awk -F= '$1 ~ /Sec$/ {print $1}' /usr/lib/systemd/system/*.service | sort -u
#RestartSec
RestartSec
TimeoutSec
TimeoutStopSec






Version-Release number of selected component (if applicable):
systemd-204-16.fc19.x86_64



How reproducible: Just look at the output from "systemctl show"


Steps to Reproduce:
1. systemctl show unbound | grep USec
2.
3.

Actual results:
JobTimeoutUSec=0
RestartUSec=100ms
TimeoutUSec=1min 30s
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0



Expected results:
JobTimeoutSec=0
RestartSec=100ms
TimeoutSec=1min 30s
TimeoutStartSec=1min 30s
TimeoutStopSec=1min 30s
WatchdogSec=0



Additional info:

Comment 1 Lennart Poettering 2013-10-13 18:11:52 UTC
Well, "systemctl show" shows low-level properties, as exposed on the bus. They use usec as base unit. The user friendly versions you can specify on unit files however use seconds as base unit. This assymetry is simply because one is a low-level interface, primarily intended for usage in tools, the other being a user-friendly interface for humans.

Comment 2 Andrew J. Schorr 2013-10-13 18:19:19 UTC
That would make sense if the actual values reported were in microsecond units.
But how does it make sense to say:

TimeoutStartUSec=1min 30s

??

I think either of these makes sense:

TimeoutStartUSec=90000000

or

TimeoutStartSec=1min 30s

But the choice you have made seems very strange to me.  I obviously have zero votes in this matter, but the current behavior is very counterintuitive.

Regards,
Andy

Comment 3 Andrew J. Schorr 2013-10-13 18:20:39 UTC
Actually, on 2nd thought, what would make more sense is to avoid having a unit of time in the parameter's name.  Shouldn't it simply be:

TimeoutStartTime=1min 30s

?

That makes infinitely more sense to me.

Regards,
Andy

Comment 4 Lennart Poettering 2013-10-13 18:23:33 UTC
Well, we really shouldn't rename the bus properties in systemctl show. If you want the rawest values possible you can use "gdbus introspect" on the units, which will show you the usec values actually as integers.