Re: [libvirt] [PATCH] Change logrotate to be per-hypervisor logs

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

 



According to Daniel Veillard on 3/4/2010 7:36 AM:
> Original bug is:
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=547514
> 
> maybe this could be done in slightly different way, possibly more
> generic, but I think doing a simple split is good enough for now.

Seems easy enough.

> +++ b/daemon/Makefile.am
> @@ -25,7 +25,9 @@ EXTRA_DIST =						\
>  	libvirtd.sasl					\
>  	libvirtd.sysconf				\
>  	libvirtd.aug                                    \
> -	libvirtd.logrotate.in                           \
> +	libvirtd.qemu.logrotate.in                      \
> +	libvirtd.lxc.logrotate.in                       \
> +	libvirtd.uml.logrotate.in                       \
>  	test_libvirtd.aug                               \
>  	$(AVAHI_SOURCES)				\
>  	$(DAEMON_SOURCES)
> @@ -177,20 +179,37 @@ remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
>  remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
>  	perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
>  
> -BUILT_SOURCES += libvirtd.logrotate
> +LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
> +                  libvirtd.uml.logrotate
>  
> -libvirtd.logrotate: libvirtd.logrotate.in
> +BUILT_SOURCES += $(LOGROTATE_CONFS)
> +
> +libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
> +libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
>  	sed						\
>  	    -e s!\@localstatedir\@!@localstatedir@!g	\
>  	    < $< > $@-t
>  	mv $@-t $@

Not introduced by your patch, but copied and pasted two more times.
Unfortunately, POSIX does not define \@ in sed (GNU sed treats it like @,
but some others treat it like \\@).  Can you guarantee that
@localstatedir@ will not expand to any shell metacharacters?  Also,
automake guarantees that $(localstatedir) will have the same value as
@localstatedir@, but without triggering a 'make syntax-check' warning
(although we must already be ignoring that particular check).  It would
probably be better to write:

	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\

as the substitution.

Other than that, you have my ACK

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