[libvirt] [PATCH] Fix libvirt-guests init script

Eric Blake eblake at redhat.com
Fri May 28 15:37:42 UTC 2010


On 05/28/2010 09:29 AM, Eric Blake wrote:
> 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; }

On rereading this email, we should also s/\$LISTFILE/"\1"/g throughout
the script.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100528/d84fcb50/attachment-0001.sig>


More information about the libvir-list mailing list