Bug 991473
| Summary: | 'service dnsmasq status' incorrectly identifies the libvirt dnsmasq process. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Robert McSwain <rmcswain> | ||||
| Component: | dnsmasq | Assignee: | Tomáš Hozza <thozza> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Jan Ščotka <jscotka> | ||||
| Severity: | urgent | Docs Contact: | |||||
| Priority: | urgent | ||||||
| Version: | 6.4 | CC: | cww, jduncan, jscotka, ovasik, psklenar, thozza | ||||
| Target Milestone: | rc | Keywords: | Patch | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | dnsmasq-2.48-14.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: |
Previously, the Dnsmasq service status verification in the init script was not sufficiently robust and only determined the presence of all the instances of Dnsmasq running on the system. As a consequence, the init script identified Dnsmasq as running even when no Dnsmasq system instance had been initiated. The init script has been fixed to explicitly verify the process with the process ID written in the PID file of the system instance. As a result, the status of the Dnsmasq system instance is now identified correctly even if there are running instances not started by the init script.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-06-16 14:35:39 UTC | Type: | Bug | ||||
| 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: | 947782, 994246 | ||||||
| Attachments: |
|
||||||
|
Description
Robert McSwain
2013-08-02 13:37:24 UTC
Created attachment 785691 [details]
Proposed fix
Fix dnsmasq initscript to correctly identify the system dnsmasq instance.
In testing this from our end we cannot seem to reproduce this: [root@testsystem-63vm ~]# uname -a Linux testsystem-63vm 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed May 15 10:48:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux [root@testsystem-63vm ~]# service libvirtd status libvirtd is stopped [root@testsystem-63vm ~]# service dnsmasq status dnsmasq is stopped [root@testsystem-63vm ~]# service dnsmasq start Starting dnsmasq: [ OK ] [root@testsystem-63vm ~]# service dnsmasq status dnsmasq (pid 3134) is running... [root@testsystem-63vm ~]# service dnsmasq stop Shutting down dnsmasq: [ OK ] [root@testsystem-63vm ~]# service libvirtd restart Stopping libvirtd daemon: [FAILED] Starting libvirtd daemon: [ OK ] [root@testsystem-63vm ~]# service dnsmasq status dnsmasq is stopped [root@testsystem-63vm ~]# The user has seen that the 'pidof' code in /etc/init.d/functions appears to grab the pid of the process from the process table if it can't find a file in /var/run. There is no file in /var/run so it's (correctly) using the pid from the libvirt instance and from what the user has investigated in the code, it seems to back up what he's seeing. I feel that this could be a holdover from the following bug as they seem to be fairly closely related. https://bugzilla.redhat.com/show_bug.cgi?id=850944 The user's version of the package matches the errata that was released for this bug shown here however: http://rhn.redhat.com/errata/RHSA-2013-0277.html Output from the user's system: [root@test ~]# rpm --verify dnsmasq .......T. c /etc/dnsmasq.conf [root@test ~]# rpm -q dnsmasq dnsmasq-2.48-13.el6.x86_64 [root@test ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) Finally, the customer's /var/lib/libvirt/dnsmasq has three files: default.addnhosts default.hostsfile default.leases All of these are empty. Otherwise, user is not using dnsmasq and all files from the package verify cleanly (no changes). (In reply to Robert McSwain from comment #2) > In testing this from our end we cannot seem to reproduce this: You can reproduce this as follows: [root@localhost ~]# uname -a Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux [root@localhost ~]# ps -C dnsmasq PID TTY TIME CMD [root@localhost ~]# service dnsmasq status dnsmasq is stopped [root@localhost ~]# service libvirtd status libvirtd (pid 2450) is running... [root@localhost ~]# virsh net-list Name State Autostart Persistent -------------------------------------------------- [root@localhost ~]# virsh net-start default Network default started [root@localhost ~]# virsh net-list Name State Autostart Persistent -------------------------------------------------- default active yes yes [root@localhost ~]# ps -C dnsmasq PID TTY TIME CMD 2785 ? 00:00:00 dnsmasq -> *** started by libvirt *** [root@localhost ~]# service dnsmasq status dnsmasq (pid 2785) is running... -> *** should be "dnsmasq is stopped" *** [root@localhost ~]# service dnsmasq start Starting dnsmasq: [ OK ] [root@localhost ~]# service dnsmasq status dnsmasq (pid 2826) is running... [root@localhost ~]# service dnsmasq stop Shutting down dnsmasq: [ OK ] [root@localhost ~]# service dnsmasq status dnsmasq (pid 2785) is running... -> *** should be "dnsmasq is stopped" *** > The user has seen that the 'pidof' code in /etc/init.d/functions appears to > grab the pid of the process from the process table if it can't find a file > in /var/run. > > There is no file in /var/run so it's (correctly) using the pid from the > libvirt instance and from what the user has investigated in the code, it > seems to back up what he's seeing. initscript uses function "status" from /etc/init.d/functions if 'service dnsmasq status' is called. > I feel that this could be a holdover from the following bug as they seem to > be fairly closely related. > > https://bugzilla.redhat.com/show_bug.cgi?id=850944 This issue is different from what I've fixed in Bug #850944. It was unidentified at that time. But it is related to process pids, pidfiles in that the initscript is incorrectly identifying a process that was not started using it. Hope this and the reproducer helps you. Anyway if you have a customer ticket for this issue I'm recommending adding it to this Bug so there is a higher chance of getting it fixed in the future RHEL-6 releases. I've added the customer ticket to this issue. Thank you! This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. 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/RHBA-2014-0757.html |