Re: [PATCH] daemon: Fix LIBVIRT_DEBUG=1 default output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/2012 03:01 PM, Cole Robinson wrote:
> This commit changes the behavior of LIBVIRT_DEBUG=1 libvirtd:
> 
> $ git show 7022b09111d4322d21396a70d58320a9ad773962
> commit 7022b09111d4322d21396a70d58320a9ad773962
> Author: Daniel P. Berrange <berrange@xxxxxxxxxx>
> Date:   Thu Sep 27 13:13:09 2012 +0100
> 
>     Automatically enable systemd journal logging
> 
>     Probe to see if the systemd journal is accessible, and if
>     so enable logging to the journal by default, rather than
>     stderr (current default under systemd).
> 
> Previously  'LIBVIRT_DEBUG=1 /usr/sbin/libvirtd' would show all debug
> output to stderr, now it send debug output to the journal.
> 
> Only use the journal by default if running in daemon mode, or
> if stdin is _not_ a tty. This should make libvirtd launched from
> systemd use the journal, but preserve the old behavior in most
> situations.

Makes sense.

> -    if (virLogGetNbOutputs() == 0) {
> +    if (virLogGetNbOutputs() == 0 &&
> +        (godaemon || isatty(STDIN_FILENO) != 1)) {

isatty() is only required to return non-zero for ttys; there is no
guarantee that it will return 1.  You need to write this as:

(godaemon || !isatty(STDIN_FILENO))

ACK with that change.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]