Re: [PATCH] Fix libvirt-guests init script

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

 



On 05/28/2010 09:16 AM, Jiri Denemark wrote:
> Firstly, the init script has to touch its file under /var/lock/subsys
> when started, otherwise system would think it's not running and won't
> stop it during shutdown.
> 
> Secondly, for some reason there is a policy to automatically enable
> init scripts when they are installed, so let the specfile do this. We
> also need to start the init script to ensure it will be stopped during
> the first shutdown after installing the package.

Makes sense.

>  LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
> +VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
>  
>  RETVAL=0
>  
> @@ -117,12 +118,17 @@ guest_is_on() {
>      return 0
>  }
>  
> +started() {
> +    touch $VAR_SUBSYS_LIBVIRT_GUESTS

touch "$VAR_SUBSYS_LIBVIRT_GUESTS"

> +}
> +
>  start() {
> -    [ -f $LISTFILE ] || return 0
> +    [ -f $LISTFILE ] || { started; return 0; }

Do we want to detect failures in started (that is, failure to touch the
lock file)?  Then again, failure to touch the lock file merely means
that stop won't be called automatically, but doesn't affect whether we
actually started and can call stop manually, so blindly succeeding seems
okay to me.

> +
> +    rm -f $VAR_SUBSYS_LIBVIRT_GUESTS

rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"

ACK with those tweaks.

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