[systemd-devel] Log unit's name instead of unit's description?

Lennart Poettering lennart at poettering.net
Wed Oct 22 09:51:38 PDT 2014


On Mon, 08.09.14 11:56, Simon McVittie (simon.mcvittie at collabora.co.uk) wrote:

> On 05/09/14 18:22, Jakub Klinkovský wrote:
> > What is the reason behind logging unit's description? Consider the
> > following journal message (from `journalctl -b`):
> > 
> > systemd[1]: Starting A secure, fast, compliant and very flexible
> > web-server...
> 
> As a data point, Debian's init scripts have traditionally combined the
> description and name like this:
> 
>     Starting miscellaneous widget daemon: miscd.
>     Starting Apache web server: apache2.
> 
> Perhaps something like this would make more (grammatical and UI) sense
> for a systemd unit named miscd.service with Description="Miscellaneous
> widget daemon", in a way that degrades gracefully if the maintainer
> has (IMO incorrectly) used a Description like the one quoted above?
> 
>     systemd[1]: Starting miscd.service (Miscellaneous widget daemon)...
>     systemd[1]: Started miscd.service (Miscellaneous widget daemon).
>     systemd[1]: Starting apache2.service (Apache web server)...
>     systemd[1]: Started apache2.service (Apache web server).
> 
> or
> 
>     systemd[1]: Starting miscd.service: Miscellaneous widget daemon...
>     systemd[1]: Started miscd.service: Miscellaneous widget daemon.
>     systemd[1]: Starting apache2.service: Apache web server...
>     systemd[1]: Started apache2.service: Apache web server.
> 
> As a native Speaker of a Language that does not capitalize Nouns :-)
> I've always found "Starting Miscellaneous widget daemon" a bit
> jarring. Or is the intention that that unit should have had
> "miscellaneous widget daemon", without the initial capital, as its
> Description?

Hmm, this is something to think about. I have for now added this to
the TODO list. That said, the boot output is supposed to be "pretty"
stuff, hence at least should contain the pretty description. We can
also add the non-pretty one, but that would certainly make the strings
even longer...

So far, our idea was to enable unit file authors to control what is
shown. The burden is currently on them to set the description to
something really useful. However, I do agree with the sentiment that
including the unit name might be useful too, since it would make the
log output "more actionable", if you follow what I mean.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list