Bug 17105 - slaves interfaces cannot be managed by ifplugd
Summary: slaves interfaces cannot be managed by ifplugd
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: x86_64 Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Base system maintainers
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-11-07 11:49 CET by Yves DEMUR
Modified: 2020-08-02 22:44 CEST (History)
4 users (show)

See Also:
Source RPM: initscripts-9.55-13.mga5.src.rpm
CVE:
Status comment:


Attachments
Modified files (7.59 KB, application/gzip)
2015-11-08 11:58 CET, Yves DEMUR
Details
New version of modified files (7.58 KB, application/gzip)
2015-11-09 04:08 CET, Yves DEMUR
Details
ifplugd on slaves (9.70 KB, patch)
2015-12-02 21:00 CET, Yves DEMUR
Details | Diff

Description Yves DEMUR 2015-11-07 11:49:05 CET
Description of problem:

When mii of bonding cannot support an interface while ifplugd does (by using its wireless extension for ex.), it is possible to workaround the always up status of the interface in bonding. The solution is to use ifplugd to stop the interface when its link is down. Stopping makes the interface being unslaved from the bond, so it is removed from the list of slaves for activation, and bonding don't use it. When ifplugd detects up, the interface is re-enslaved by the run of ifup launched by ifplugd.


This workaround needs lights improvements to the ifup-eth ant ifdown-eth scripts :

In /etc/sysconfig/network-scripts/ifup-eth, change line 201
            /sbin/ifup ${device##*/}
to
            /sbin/ifup ${device##*/} $2
So the "boot" argument will be transmitted to the slave starting script at boot.


In /etc/sysconfig/network-scripts/ifdown-eth, change line 65
        /sbin/ifdown ${device##*/}
to
        /sbin/ifdown ${device##*/} $2
So the "boot" argument will be transmitted to the slave stopping script at boot.

In /etc/sysconfig/network-scripts/ifup-eth, add this block before line 191
    # exec ifplugd daemon at boot if supported
    if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ]; then
        IFPLUGD_ARGS="${IFPLUGD_ARGS=-I -b}"
        exec /sbin/ifplugd $IFPLUGD_ARGS -i $DEVICE
    fi

So the ifplugd daemon wil be started for the slave (the block is copied from a block further in the file). Stopping ifplugd daemon will be done by ifdown-eth without modifying the script.


Now, if ra0 is a slave wireless interface, not supported by mii of bonding but supported by mii of ifplugd, with MII_NOT_SUPPORTED=no in its cfg file, and if bond0 has the option primary=ra0, the loss of wireless signal makes bonding use another interface.

I propose the insertion of these 3 modifications to the package.


Reproducible: 

Steps to Reproduce:
Comment 1 Yves DEMUR 2015-11-08 05:54:30 CET
EDITS ON THE DESCRIPTION :


CHANGE :
In /etc/sysconfig/network-scripts/ifup-eth, change line 201
            /sbin/ifup ${device##*/}
to
            /sbin/ifup ${device##*/} ${2:+daemon}
So the possible "boot" 2nd argument will be transmitted as "daemon" to the slave starting script at boot. This enables daemons starting for the slave and prevents effect of a possible ONBOOT=no in slave ifcfg-* file.


CHANGE :
In /etc/sysconfig/network-scripts/ifdown-eth, change line 65
        /sbin/ifdown ${device##*/}
to
        /sbin/ifdown ${device##*/} ${2:+daemon}
So the possible "boot" 2nd argument will be transmitted as "daemon" to the slave stopping script at boot. This is for homogeneity with the previous change of line 201 of ifup-eth.


ADD :
In /etc/sysconfig/network-scripts/ifup-eth : change line 239
if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ]; then
to
if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ] && ! is_bonding_device ${DEVICE} ; then
So ifplugd will never be used on master bonding devices, despite the value of MII_NOT_SUPPORTED.


ADD :
In /etc/sysconfig/network-scripts/ifdown-eth : change line 124
if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ]; then
to
if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ] && ! is_bonding_device ${DEVICE} ; then
Because, according to previous modification in ifup-eth, ifplugd is never used on master bonding devices.


CHANGE :
I propose the insertion of these 5 modifications to the package.
Comment 2 Yves DEMUR 2015-11-08 11:58:42 CET
Created attachment 7188 [details]
Modified files
Comment 3 Yves DEMUR 2015-11-09 04:08:08 CET
Created attachment 7190 [details]
New version of modified files

Humm, on reflection, I think that the automatic inhibition of the role of "ONBOOT=no" by the use of "daemon" argument in place of "boot" is a wrong good idea : it is possible to want that an interface will not be launched automatically at boot, but optionally manually launched by "# ifup interface daemon". The role of "ONBOOT=no" is important, so I undo the automatic change of "boot" to "daemon" by the argument "${2:+daemon}".

I join the new version of files.
Comment 4 Yves DEMUR 2015-11-10 19:15:42 CET
Every day I think my modifications are the last, but next day I find new ideas, bugs and enhancements.

I propose to delete this report. When my work is mature I will open a new report.

Sorry for the noise.
Back in a few weeks.

Yves
Comment 5 Samuel Verschelde 2015-11-16 11:35:37 CET
Assigning to maintainer. You can still close it yourself if you think your bug report is not relevant anymore, but I'll not decide that myself.

Assignee: bugsquad => mageia

Comment 6 Colin Guthrie 2015-11-16 12:02:20 CET
FYI, these scripts generally come from Fedora, but over the years there have been many "improvements" made (mainly in Mandriva days - I've been gradually trying to reduce our delta to the upstream Fedora scripts).

We keep our initscripts here:

http://gitweb.mageia.org/software/forks/initscripts/

The "master" branch is the upstream fedora one (likely a bit behind at present - not synced for ages!), and our changes are in the "mga" branch.

If you do make changes, a git formatted patch would be the preferred way to go :)
Comment 7 Yves DEMUR 2015-12-02 21:00:55 CET
Created attachment 7259 [details]
ifplugd on slaves

BUG
ifdown-eth:
in function dhcp_client_pids(), filters are too permissive and awk always return 0
A /bin/bash job in background with args "Zenp1s0Z" "ZdhclientZ" will be killed.
in function dhcp_client_pids(), wpa_supplicant process launched by the wpa_supplicant.service may be killed

BUG
ifdown-eth:
line: while ! dhcp_client_pids > /dev/null && [ "$waited" -lt 50 ] ; do
waiting occurs if dhcp_client_pids() finds no pid, test must be reversed.

BUG?
ifup-eth:
ifplugd is allowed on bonding devices ; it should not

Other changes are enhancements or allow the use of ifplugd on slaves.
Comment 8 Marja Van Waes 2018-04-18 09:07:25 CEST
Hi Yves,

Thank you for having taken the needed time to report this issue, too.

Did this bug get fixed? If so, please change its status to RESOLVED - FIXED

If it didn't, then we regret that we weren't able to fix it in Mageia 5. Mageia 5 has officially reached its End of Life on December 31st, 2017 https://blog.mageia.org/en/2017/11/07/mageia-5-eol-postponed/
It only continued to get important security updates since then, because we are waiting for a big Plasma5 update in Mageia 6, that'll fix many of the Mageia 5 => 6 upgrade issues.

If you haven't seen that this bug got fixed, then please check whether this bug still exists in Mageia 6. If it does, then please change the Version (near the top, at the left) to "6". If you know it exists in Cauldron, then change Version to Cauldron. If you see it in both Cauldron and Mageia 6, then please set Version to Cauldron and add MGA6TOO on the Whiteboard.

Thanks,
Marja

(In case this report needs to stay open for a supported release: Reassigning to the Base System maintainers, because Colin, the registered maintainer, is mostly unavailable)

Keywords: (none) => PATCH
CC: (none) => mageia, marja11, ngompa13
Assignee: mageia => basesystem

Yves DEMUR 2018-04-18 19:39:38 CEST

Version: 5 => 6

Comment 9 Aurelien Oudelet 2020-08-02 22:44:44 CEST
This message is a reminder that Mageia 6 is end of life.

Mageia stopped maintaining and issuing updates for Mageia 6. At that time this bug will be closed as OLD (EOL).

Package Maintainer: If you wish for this bug to remain open because you plan to 
fix it in a currently maintained version, simply change the 'version' to a later 
Mageia version prior to Mageia 6's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we cannot 
be able to fix it before Mageia 6 was end of life.
If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, 
sometimes those efforts are overtaken by events. Often a more recent Mageia 
release includes newer upstream software that fixes bugs or makes them obsolete.

--
Mageia Bugsquad

Status: NEW => RESOLVED
CC: (none) => ouaurelien
Resolution: (none) => OLD


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