Re: [libvirt] [PATCH] libvirtd: Better initscript error reporting

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

 



According to Cole Robinson on 2/24/2010 10:55 AM:
>>From time to time I bork my install, and hate it when the initscript
> returns no info. This patch makes things a bit more clear.
> 
> +LIBVIRTD_BIN="@sbindir@/libvirtd"
> +
>  # Sanity checks.
> -[ -x @sbindir@/libvirtd ] || exit 0
> +[ ! -e $LIBVIRTD_BIN ] && echo "$LIBVIRTD_BIN not found." && exit 1

Why the switch from -x to -e?  If libvirtd is missing executable
permissions, it can now get through this check whereas before it exited early.

Group the failure, in case echo also fails (such as for a full disk);
also, I'm used to not seeing trailing . on error messages, but it is
polite to attribute who's printing the failure.  Printing to stderr is
also nice.  Something like:

[...] && { echo "$0: $LIBVIRTD_BIN not found" 2>&1; exit 1; }

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]