Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
[root@bintak qemu]# /etc/init.d/ksm stop
Stopping ksm: [ OK ]
[root@bintak qemu]# /etc/init.d/ksm condrestart
Stopping ksm: [ OK ]
Starting ksm: [ OK ]
--> 'service ksm condrestart' (which is executed by %post script) starts always ksm.
This happens due do broken status() function:
----
status() {
...
RETVAL=0
fi; fi
}
...
condrestart|try-restart)
status >/dev/null 2>&1 || exit 0
restart
----
E.g. 'RETVAL' is computed but never returned so that 'status' always succeeds and the 'restart' is executed unconditionally.
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.355.el6_4.5.x86_64
Reproduce this issue on qemu-kvm-0.12.1.2-2.375.el6.x86_64.
1. Stop ksm service
[root@localhost home]# service ksm stop
Stopping ksm: [ OK ]
2. [root@localhost home]# service ksm condrestart
Stopping ksm: [ OK ]
Starting ksm: [ OK ]
[root@localhost home]#
Expected result:
After step 2, ksm should not be restarted if it's stopped previously.
Enrico, thanks for taking the time to enter a bug report with us. We appreciate
the feedback and look to use reports such as this to guide our efforts at
improving our products. That being said, we're not able to guarantee the
timeliness or suitability of a resolution for issues entered here because this
is not a mechanism for requesting support.
If this issue is critical or in any way time sensitive, please raise a ticket
through your regular Red Hat support channels to make certain it receives the
proper attention and prioritization to assure a timely resolution.
For information on how to contact the Red Hat production support team, please
visit: https://www.redhat.com/support/process/production/#howto
(In reply to Enrico Scholz from comment #0)
> Description of problem:
>
> [root@bintak qemu]# /etc/init.d/ksm stop
> Stopping ksm: [ OK ]
> [root@bintak qemu]# /etc/init.d/ksm condrestart
> Stopping ksm: [ OK ]
> Starting ksm: [ OK ]
>
> --> 'service ksm condrestart' (which is executed by %post script) starts
> always ksm.
>
> This happens due do broken status() function:
>
> ----
> status() {
> ...
> RETVAL=0
> fi; fi
> }
> ...
>
> condrestart|try-restart)
> status >/dev/null 2>&1 || exit 0
> restart
> ----
>
> E.g. 'RETVAL' is computed but never returned so that 'status' always
> succeeds and the 'restart' is executed unconditionally.
>
>
> Version-Release number of selected component (if applicable):
>
> qemu-kvm-0.12.1.2-2.355.el6_4.5.x86_64
Thanks for your analysis Enrico. You are correct, it's been caused by return value not used. See comment #7 for fix :-)
Thanks,
Michal
Verified pass on qemu-kvm-0.12.1.2-2.377.el6.
[root@t2 home]# service ksm stop
Stopping ksm: [ OK ]
[root@t2 home]# service ksm status
ksm is not running
[root@t2 home]# service ksm condrestart
[root@t2 home]#
[root@t2 home]# service ksm status
ksm is not running
[root@t2 home]#
[root@t2 home]# service ksm start
Starting ksm: [ OK ]
[root@t2 home]# service ksm status
ksm is running
[root@t2 home]# service ksm condrestart
Stopping ksm: [ OK ]
Starting ksm: [ OK ]
[root@t2 home]# service ksm status
ksm is running
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHSA-2013-1553.html
Description of problem: [root@bintak qemu]# /etc/init.d/ksm stop Stopping ksm: [ OK ] [root@bintak qemu]# /etc/init.d/ksm condrestart Stopping ksm: [ OK ] Starting ksm: [ OK ] --> 'service ksm condrestart' (which is executed by %post script) starts always ksm. This happens due do broken status() function: ---- status() { ... RETVAL=0 fi; fi } ... condrestart|try-restart) status >/dev/null 2>&1 || exit 0 restart ---- E.g. 'RETVAL' is computed but never returned so that 'status' always succeeds and the 'restart' is executed unconditionally. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.355.el6_4.5.x86_64