Bug 617300

Summary: libvirt-guests initscript Fedora compliance.
Product: Red Hat Enterprise Linux 6 Reporter: Gurhan Ozen <gozen>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: dallan, ddumas, eblake, jburke, jdenemar, notting, nzhang, snagar, veillard, weizhan, xen-maint
Target Milestone: rcKeywords: RHELNAK
Target Release: 6.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0_8_1-19_el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 630621 (view as bug list) Environment:
Last Closed: 2010-11-11 14:47:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 630621, 633349    

Description Gurhan Ozen 2010-07-22 18:15:37 UTC
Description of problem:

QE is making an effort to make all initscripts comforming to consistency. More
information about it can be seen at 

https://wiki.test.redhat.com/BaseOs/Projects/InitScripts

and the guidelines can be seen at:

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

libvirt-guests init script has the following issues:
-- status is a valid action but is not listed in the usage script.
# service libvirt-guests usage
Usage: /etc/init.d/libvirt-guests {start|stop|restart|force-reload|gueststatus|shutdown}

-- status should print out the status but it doesn't print anything.
# service libvirt-guests status
# 

-- condrestart and try-restart should exist as an action but it doesn't.
# egrep "condrestart|try-restart" /etc/init.d/libvirt-guests 
#
-- reload should exist as an action, but it doesn't.
# grep "load" /etc/init.d/libvirt-guests | grep -v reload
#

-- When no or wrong argument is given the script should return 2 but it's
returning 3 instead.

-- # service libvirt-guests skdskjd; echo $?
Usage: /etc/init.d/libvirt-guests {start|stop|restart|force-reload|gueststatus|shutdown}
3




Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 RHEL Program Management 2010-07-22 18:17:53 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 2 Jiri Denemark 2010-07-23 08:20:34 UTC
According to http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html only start, stop, restart, force-reload, and status are required to be implemented by all init scripts. The other actions you mention are optional. And since they doesn't make any sense for this particular script, they are not implemented.

Looking at the link you posted, I see that those actions are, however, required by Fedora packaging guidelines so the summary is quite misleading...

Comment 3 Gurhan Ozen 2010-07-23 14:27:18 UTC
(In reply to comment #2)
> According to
> http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
> only start, stop, restart, force-reload, and status are required to be
> implemented by all init scripts. The other actions you mention are optional.
> And since they doesn't make any sense for this particular script, they are not
> implemented.
> 
> Looking at the link you posted, I see that those actions are, however, required
> by Fedora packaging guidelines so the summary is quite misleading...    

Yes indeed. I was thinking maybe do nothing and return 0? I don't know what to make of this, libvirt-guests is not a deamon running, it's just a service to handle guests during bootup/shutdown.

Comment 4 Eric Blake 2010-07-27 20:03:15 UTC
Even though there is no daemon process (and thus no daemon pid to track), we do
handle two pieces of state - whether guests have been saved (if so, we are
necessarily stopped), and whether the lock file exists (so that the system
knows whether it is essential to call 'libvirt-guests stop' at shutdown time). 
I think both pieces of information are useful in 'libvirt-guests status'
output; at which point, condrestart makes sense: save and restore guests if we
are already started, but don't start if there are already saved guests.  I'm
working on the appropriate patches...

Comment 5 Bill Nottingham 2010-07-27 20:06:58 UTC
I'm not sure condrestart makes sense... do you really want to bounce all guests on libvirtd upgrades?

Comment 6 Bill Nottingham 2010-07-27 20:11:25 UTC
To be more clear: if condrestart isn't a useful operation, just stub it out and return 0.

Comment 7 Eric Blake 2010-07-27 20:22:53 UTC
Patch series awaiting ACK at
http://post-office.corp.redhat.com/archives/rhvirt-patches/2010-July/msg00930.html

'restart' already bounces all guests, and 'condrestart' is documented as requiring the same behavior as 'restart' if the daemon is already started, but doing nothing if the daemon is stopped (that is, the difference between 'restart' and 'condrestart' is that 'restart' is guaranteed to restore guests and put us in a started state, while 'condrestart' must not restore guests if the user has not yet run 'start' or 'restart').

Comment 8 Bill Nottingham 2010-07-27 20:31:37 UTC
Looks reasonable to me.

Comment 9 Dave Allan 2010-07-27 23:20:16 UTC
libvirt-0_8_1-19_el6 has been built in RHEL-6-candidate with the fix.

Dave

Comment 11 weizhang 2010-08-02 08:41:19 UTC
I test it with the following result:

#service libvirt-guests usage
Usage: /etc/init.d/libvirt-guests {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}

# service libvirt-guests status
started

# egrep "condrestart|try-restart" /etc/init.d/libvirt-guests
    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
    condrestart|try-restart)

# grep "load" /etc/init.d/libvirt-guests |grep reload
    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
    reload|force-reload)

# service libvirt-guests sdkjflsj;echo $?
Usage: /etc/init.d/libvirt-guests {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}
2

so the bug is verified

[root@redhat ~]# rpm -qa libvirt
libvirt-0.8.1-20.el6.x86_64
[root@redhat ~]# uname -r
2.6.32-54.el6.x86_64

Comment 12 Nan Zhang 2010-09-09 11:35:36 UTC
Verified with libvirt-0.8.1-27.el6.x86_64 & qemu-kvm-0.12.1.2-2.113.el6.x86_64.

# service libvirt-guests usage
Usage: /etc/init.d/libvirt-guests {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}

# service libvirt-guests status
started

# egrep "condrestart|try-restart" /etc/init.d/libvirt-guests
    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
    condrestart|try-restart)

# grep "load" /etc/init.d/libvirt-guests |grep reload
    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
    reload|force-reload)

# service libvirt-guests sdkjflsj;echo $?
Usage: /etc/init.d/libvirt-guests {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}
2

Comment 13 releng-rhel@redhat.com 2010-11-11 14:47:57 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.