RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 617300 - libvirt-guests initscript Fedora compliance.
Summary: libvirt-guests initscript Fedora compliance.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: 6.0
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 630621 633349
TreeView+ depends on / blocked
 
Reported: 2010-07-22 18:15 UTC by Gurhan Ozen
Modified: 2013-11-04 02:00 UTC (History)
11 users (show)

Fixed In Version: libvirt-0_8_1-19_el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 630621 (view as bug list)
Environment:
Last Closed: 2010-11-11 14:47:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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