Re: [PATCH 4/4] libvirt-guest.init: Use lsb-init functions

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

 



On 03/10/2011 10:27 PM, Philipp Hahn wrote:
> The current libvirt-guest init script only prints to stdout, which isn't
> shown when using a graphical splash screen: During a reboot the shutdown
> screen might not show any progress while the domains are suspended.
> 
> This patch mostly drops the use of gettext and gettext_eval and used the
> appropriate lsb_*-functions. Splash screens integrate with LSB compatibe
> init scripts by overwriting the lsb_*-functions defined in
> /lib/lsb/init-functions.

NACK because you dropped the gettext portions.  But I completely agree
that the standards for init scripts recommend using standard log_*
functions rather than direct output to stdout.

http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html

Furthermore, that states that logged messages should be complete lines,
no more than 60 characters; I don't know that we can fully comply with
that (a uuid takes up a lot of real estate, and we (ab)use \r for
progress messages).

A proper patch would combine the two approaches - use gettext to perform
the translation, then use log_* to output the translated strings.

Would you care to rework this patch?

> +++ b/tools/libvirt-guests.init.sh
> @@ -36,6 +36,8 @@ test ! -r "$sysconfdir"/rc.d/init.d/functions ||
>  # Make sure this file is recognized as having translations: _("dummy")
>  . "@bindir@"/gettext.sh
>  
> +. /lib/lsb/init-functions

Hmm, the Fedora init script standards:

http://fedoraproject.org/wiki/Packaging/SysVInitScript

which don't mention this file.  So we probably ought to make its
inclusion conditional, and provide fallback definitions for the log_*
functions if it is not present.

>      if [ "x$ON_BOOT" != xstart ]; then
> -        gettext "libvirt-guests is configured not to start any guests on boot"
> -        echo
> +        log_action_msg "libvirt-guests is configured not to start any guests on boot"

log_action_msg "$(gettext "libvirt-guests is configured not to start any
guests on boot")"

merges both translation and proper logging.

-- 
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]