Bug 1187967 - Can't run dhcrelay and dhcrelay6 simultaneously
Summary: Can't run dhcrelay and dhcrelay6 simultaneously
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dhcp
Version: 6.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jiri Popelka
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-31 23:39 UTC by Michal Bruncko
Modified: 2015-07-22 05:39 UTC (History)
4 users (show)

Fixed In Version: dhcp-4.1.1-49.P1.el6
Doc Type: Bug Fix
Doc Text:
Cause Trying to run dhcrelay and dhcrelay6 services simultaneously. Consequence The later service does not start. Fix dhcrelay6 init script was fixed. Result It's possible to run both dhcrelay and dhcrelay6 services at the same time.
Clone Of:
Environment:
Last Closed: 2015-07-22 05:39:59 UTC


Attachments (Terms of Use)
fixed dhcrelay6 init script (2.61 KB, text/plain)
2015-02-20 14:26 UTC, Jiri Popelka
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1258 normal SHIPPED_LIVE dhcp bug fix and enhancement update 2015-07-20 17:49:55 UTC

Description Michal Bruncko 2015-01-31 23:39:06 UTC
Description of problem:
Can't run dhcrelay and dhcrelay6 simultaneously. I.e once one dhcrelay daemon (either IPv4 or IPv6 version) is running, I can't run the next one (for other IP protocol).


Version-Release number of selected component (if applicable):
dhcp-4.1.1-43.P1.el6

How reproducible:
always

Steps to Reproduce:
1. run for example IPv4 version of dhcrelay (/etc/init.d/dhcrelay start)
2. confirm that it is running
3. now start IPv6 dhcrelay as well (/etc/init.d/dhcrelay6 start)

Actual results:
nothing happen - i.e. dhcrelay for IPv6 will not start.
same happen when I start with IPv6 dhcrelay firstly and followed with IPv4 dhcrelay

Expected results:
I can run both IPv4 and IPv6 relays on same host

Additional info:
the problem is in rh_status_q() fucntion:

rh_status() {
    status $exec
}

as because both IPv4 and IPv6 dhcrelays have same binary, "status $exec" will match already running dhcrelay. 

per my understanding this could be fixed with using status check with PID file:

rh_status() {
    status -p $pidfile
}

both init files (/etc/init.d/dhcrelay and /etc/init.d/dhcrelay6) contains same rh_status_q() function body.

ps: this is follow up of BZ1053155

Comment 2 Michal Bruncko 2015-02-02 09:53:15 UTC
Changing rh_status() function to use pidfile is not enough. I have do it following as well:

ln -s /usr/sbin/dhcrelay /usr/sbin/dhcrelay6

and update dhcrelay6 init script:

prog=dhcrelay6
exec=/usr/sbin/dhcrelay6

but this is by mi opinion dirty workaround :) not sure how to make this more clear :)

Comment 3 Jiri Popelka 2015-02-20 14:26:28 UTC
Created attachment 993922 [details]
fixed dhcrelay6 init script

(In reply to Michal Bruncko from comment #0)
> Can't run dhcrelay and dhcrelay6 simultaneously.

Oh, that's a fail. I'm sorry. Looks like neither commiter (bug #1053155, commit#5) nor QA (bug #1053155, commit#7) actually tested that.

(In reply to Michal Bruncko from comment #2)
> Changing rh_status() function to use pidfile is not enough.

Yes, it also needs to know a lockfile and the pidfile needs to be added also to daemon & killproc calls.

Comment 7 Peter Kotvan 2015-05-04 12:16:55 UTC
I tried to verify this on RHEL-6.7-20150429.0 with RHEL-6.7-20150429.0. If dhcrelay6 is started first, then dhcrelay does not report anything. If dhcrelay is stopped, dhcrelay6 ends up dead with pidfile still existing.

[root@localhost ~]# ps aux | grep dhcrelay
root      3249  0.0  0.0 103304   884 pts/0    S+   06:07   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
ls: cannot access /var/run/dhcre*: No such file or directory
[root@localhost ~]# service dhcrelay6 start
Starting dhcrelay (DHCPv6):                                [  OK  ]
[root@localhost ~]# ps aux | grep dhcrelay
root      3273  0.0  0.0   6944   612 ?        Ss   06:07   0:00 /usr/sbin/dhcrelay -6 -l eth0 -u eth1
root      3276  0.0  0.0 103304   884 pts/0    S+   06:07   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
/var/run/dhcrelay6.pid
[root@localhost ~]# service dhcrelay start
[root@localhost ~]# ps aux | grep dhcrelay
root      3273  0.0  0.0   6944   612 ?        Ss   06:07   0:00 /usr/sbin/dhcrelay -6 -l eth0 -u eth1
root      3295  0.0  0.0 103304   884 pts/0    S+   06:07   0:00 grep dhcrelay
[root@localhost ~]# service dhcrelay stop
Shutting down dhcrelay:                                    [  OK  ]
[root@localhost ~]# service dhcrelay6 status
dhcrelay dead but pid file exists
[root@localhost ~]# ps aux | grep dhcrelay
root     25662  0.0  0.0 103308   840 pts/0    S+   06:14   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
/var/run/dhcrelay6.pid
[root@localhost ~]#

In case dhcrelay was started first observe:

[root@localhost ~]# ps aux | grep dhcrelay
root      3318  0.0  0.0 103304   884 pts/0    S+   06:08   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
ls: cannot access /var/run/dhcre*: No such file or directory
[root@localhost ~]# service dhcrelay start
Starting dhcrelay:                                         [  OK  ]
[root@localhost ~]# ps aux | grep dhcrelay
root      3343  0.0  0.0   6648   292 ?        Ss   06:08   0:00 /usr/sbin/dhcrelay -i eth1 192.168.122.1
root      3346  0.0  0.0 103304   884 pts/0    S+   06:08   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
/var/run/dhcrelay.pid
[root@localhost ~]# service dhcrelay6 start
Starting dhcrelay (DHCPv6):                                [  OK  ]
[root@localhost ~]# ps aux | grep dhcrelay
root      3343  0.0  0.0   6648   292 ?        Ss   06:08   0:00 /usr/sbin/dhcrelay -i eth1 192.168.122.1
root      3368  0.0  0.0   6944   612 ?        Ss   06:08   0:00 /usr/sbin/dhcrelay -6 -l eth0 -u eth1
root      3371  0.0  0.0 103304   884 pts/0    S+   06:09   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
/var/run/dhcrelay6.pid  /var/run/dhcrelay.pid
[root@localhost ~]# service dhcrelay stop
Shutting down dhcrelay:                                    [  OK  ]
[root@localhost ~]# ps aux | grep dhcrelay
root      3368  0.0  0.0   6944   612 ?        Ss   06:08   0:00 /usr/sbin/dhcrelay -6 -l eth0 -u eth1
root      3392  0.0  0.0 103304   880 pts/0    S+   06:09   0:00 grep dhcrelay
[root@localhost ~]# ls /var/run/dhcre*
/var/run/dhcrelay6.pid
[root@localhost ~]# service dhcrelay status
dhcrelay (pid 3368) is running...
[root@localhost ~]#

Moving back to assigned.

Comment 10 Pavel Holica 2015-05-12 12:39:19 UTC
Reproduced on RHEL-6.6 x86_64 Server and verified on RHEL-6.7-20150506.0 x86_64 Server with dhcp-4.1.1-49.P1.el6.x86_64 (including issue in comment 7 ). Moving to VERIFIED.

Comment 12 errata-xmlrpc 2015-07-22 05:39:59 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-1258.html


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