Bug 617300 - libvirt-guests initscript Fedora compliance.
libvirt-guests initscript Fedora compliance.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
high Severity medium
: rc
: 6.0
Assigned To: Eric Blake
Virtualization Bugs
: RHELNAK
Depends On:
Blocks: 633349 630621
  Show dependency treegraph
 
Reported: 2010-07-22 14:15 EDT by Gurhan Ozen
Modified: 2013-11-03 21:00 EST (History)
11 users (show)

See Also:
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 09:47:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Gurhan Ozen 2010-07-22 14:15:37 EDT
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 Product and Program Management 2010-07-22 14:17:53 EDT
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 04:20:34 EDT
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 10:27:18 EDT
(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 16:03:15 EDT
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 16:06:58 EDT
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 16:11:25 EDT
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 16:22:53 EDT
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 16:31:37 EDT
Looks reasonable to me.
Comment 9 Dave Allan 2010-07-27 19:20:16 EDT
libvirt-0_8_1-19_el6 has been built in RHEL-6-candidate with the fix.

Dave
Comment 11 weizhang 2010-08-02 04:41:19 EDT
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 07:35:36 EDT
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 09:47:57 EST
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.

Note You need to log in before you can comment on or make changes to this bug.