Bug 69209

Summary: RFE: All unit condition pre-requisites mismatch must be logged
Product: systemd Reporter: Alex Crazy <koloboid>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: systemd
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Alex Crazy 2013-09-11 08:07:48 UTC
Simple action:
I have an Archlinux, which up to date with latest packages on my laptop.
There are i8k package, which provides a kernel module and monitoring service. Unit of this service is quite simple:

[Unit]
Description=Dell laptop thermal monitoring
ConditionPathExists=/proc/i8k

[Service]
ExecStart=/usr/bin/i8kmon -d

[Install]
WantedBy=multi-user.targe

If I run this unit as systemctl i8k start, the only change I have is line

systemd[1]: Started Dell laptop thermal monitoring.

in journal (journalctl -b), where an nothing was started (pgrep confirms it), because /proc/i8k does not exists (kernel module is not loaded).

So, it would be awesome to report about any condition, which does not met in journal, like:

systemd[1]: Unable to start Dell laptop thermal monitoring, coz ConditionPathExists=/proc/i8k does not met

and this will really simplify our life's :)

Sorry for your time if it's dup.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-09-11 11:57:14 UTC
They are logged at the debug level, and are also accessible over dbus, and shown in systemctl. I committed that code, and I remember that there was some rationale, why we shouldn't log conditions by default, but now I'm not so sure it's a good idea. Maybe we should revisit this decision.
Comment 2 Pacho Ramos 2014-04-05 08:21:07 UTC
I have just hit this, I was getting this:
# systemctl start pdnsd
#

But it wasn't running, looking to journalctl output I saw:
abr 05 10:19:04 belkin5 systemd[1]: Started pdnsd private name-server cache daemon.


And running:
# systemctl status pdnsd
pdnsd.service - pdnsd private name-server cache daemon
   Loaded: loaded (/usr/lib64/systemd/system/pdnsd.service; disabled)
   Active: inactive (dead)

abr 05 10:17:11 belkin5 systemd[1]: Started pdnsd private name-server cache daemon.
abr 05 10:17:25 belkin5 systemd[1]: Stopped pdnsd private name-server cache daemon.
abr 05 10:17:34 belkin5 systemd[1]: Started pdnsd private name-server cache daemon.

I needed to manually read the unit file and guess it was due missing ConditionPath requirement:
ConditionPathExists=/etc/pdnsd/pdnsd.conf


But that is clearly not intuitive to me and I guess a lot of people won't guess that
Comment 3 Lennart Poettering 2017-09-14 11:02:48 UTC
"systemctl status" shows this data since a while now. Closing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.