The officially official Devuan Forum!

You are not logged in.

#1 2023-10-14 13:40:34

tf
Member
Registered: 2023-05-04
Posts: 8  

[SOLVED] allow-hotplug not working properly on ifupdown

Hello everyone,

Last week, I upgraded my laptop from Devuan 4 to Devuan 5. However, next boot, I can see it starting DHCP and I have to wait for it. However, since it doesn't let other services run, this broke my whole wifi setup. (I use IWD with ifupdown, it runs ifupdown first and then iwd).

Is there a way to fix this?

Here is my /etc/network/interfaces file:

source /etc/network/interfaces.d/*

allow-hotplug wlan0
iface wlan0 inet dhcp

Best regards,
tf

Last edited by tf (2023-10-14 13:40:59)

Offline

#2 2023-10-15 18:36:06

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

You should also add as first line auto wlan0

Offline

#3 2023-10-16 13:48:28

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Danielsan wrote:

You should also add as first line auto wlan0

That would make it wait till DHCP has finished which breaks my networking setup. allow-hotplug used to make sure it didn't wait for DHCP but that seems to no longer be the case.

Offline

#4 2023-10-21 11:46:08

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

I fixed this by using ifplugd and not using ifupdown's built-in allow-hotplug.

Offline

#5 2023-10-21 14:58:29

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

tf wrote:

I fixed this by using ifplugd and not using ifupdown's built-in allow-hotplug.

Did you read where ifplugd come from?

apt show ifplugd
Package: ifplugd
Version: 0.28-19.5
Priority: optional
Section: net
Maintainer: Walter Franzini <walter.franzini@gmail.com>
Installed-Size: 222 kB
Depends: libc6 (>= 2.15), libdaemon0 (>= 0.10), debconf (>= 0.5) | debconf-2.0, lsb-base (>= 3.0-6)
Recommends: ifupdown (>= 0.6.4-4.2)
Suggests: wpasupplicant
Homepage: http://0pointer.de/lennart/projects/ifplugd/
Tag: hardware::laptop, implemented-in::c, interface::daemon,
 network::configuration, protocol::ethernet, role::program,
 scope::application, use::configuring, use::monitor
Download-Size: 65.5 kB
APT-Sources: http://deb.devuan.org/merged daedalus/main amd64 Packages
Description: configuration daemon for ethernet devices

😱

Offline

#6 2023-10-21 15:18:43

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Danielsan wrote:
tf wrote:

I fixed this by using ifplugd and not using ifupdown's built-in allow-hotplug.

Did you read where ifplugd come from?

apt show ifplugd
Package: ifplugd
Version: 0.28-19.5
Priority: optional
Section: net
Maintainer: Walter Franzini <walter.franzini@gmail.com>
Installed-Size: 222 kB
Depends: libc6 (>= 2.15), libdaemon0 (>= 0.10), debconf (>= 0.5) | debconf-2.0, lsb-base (>= 3.0-6)
Recommends: ifupdown (>= 0.6.4-4.2)
Suggests: wpasupplicant
Homepage: http://0pointer.de/lennart/projects/ifplugd/
Tag: hardware::laptop, implemented-in::c, interface::daemon,
 network::configuration, protocol::ethernet, role::program,
 scope::application, use::configuring, use::monitor
Download-Size: 65.5 kB
APT-Sources: http://deb.devuan.org/merged daedalus/main amd64 Packages
Description: configuration daemon for ethernet devices

😱

Ifplugd was the only workaround to my problem that I found that didn't involve using NetworkManager.

Last edited by tf (2023-10-21 15:24:30)

Offline

#7 2023-10-22 13:56:00

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Replaced ifplugd with netplugd, also works.

Offline

#8 2023-10-23 05:09:55

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Thank you!

Offline

#9 2023-10-23 05:22:16

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

tf wrote:

I fixed this by using ifplugd and not using ifupdown's built-in allow-hotplug.

Can you explain a little bit better what you did?

Thanks!

Offline

#10 2023-10-23 14:05:59

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Danielsan wrote:
tf wrote:

I fixed this by using ifplugd and not using ifupdown's built-in allow-hotplug.

Can you explain a little bit better what you did?

Thanks!

Remove all allow-hotplug and auto lines (except for lo) from /etc/network/interfaces, like this:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet dhcp

iface usb0 inet dhcp

iface wlan0 inet dhcp

Replace /etc/netplug/netplug with all of this:

#!/bin/sh
#
# netplug - policy agent for netplugd
#
# Copyright 2003 Key Research, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.  You are forbidden from
# redistributing or modifying it under the terms of any other license,
# including other versions of the GNU General Public License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH

dev="$1"
action="$2"

case "$action" in
in)
    if [ -x /sbin/ifup ]; then
        exec /sbin/ifup "$dev"
    else
        echo "Please teach me how to plug in an interface!" 1>&2
        exit 1
    fi
    ;;
out)
    if [ -x /sbin/ifdown ]; then
        # At least on Fedora Core 1, the call to ip addr flush infloops
        # /sbin/ifdown $dev && exec /sbin/ip addr flush $dev
        if ! [ -d "/sys/class/net/$dev/wireless" ]; then
                exec /sbin/ifdown "$dev"
        else
                # Do the same thing as ifdown (kill dhcp process, etc.) without putting the interface down
                # Putting the interface fully down will break IWD.
                eval "$(ifdown -n -f "$dev" 2>&1 | tail -n +2 | tac | tail -n +4 | tac | tr '\n' ';' | head -c -1)" && \
                echo > "/var/run/network/ifstate.$dev"
        fi
    else
        echo "Please teach me how to unplug an interface!" 1>&2
        exit 1
    fi
    ;;
probe)
    exec test -d "/sys/class/net/$dev" >/dev/null 2>&1
    ;;
*)
    echo "I have been called with a funny action of '$action'!" 1>&2
    exit 1
    ;;
esac

And replace /etc/netplug/netplugd.conf with this:

eth*
wlan*
usb*

Offline

#11 2023-10-23 16:06:20

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Thank you!

Offline

#12 2023-10-25 03:44:07

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Did you customize the default script?

My WiFi dongle is stuck in a endless loop with your script...

Last edited by Danielsan (2023-10-25 03:55:24)

Offline

#13 2023-10-31 19:51:23

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Danielsan wrote:

Did you customize the default script?

My WiFi dongle is stuck in a endless loop with your script...

Are you using IWD?
Did you remove allow-hotplug?
Did you make sure not to use IWD's built-in DHCP client?

Did you modify /etc/netplug/netplug?

Offline

#14 2023-11-22 03:30:23

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

tf wrote:

Are you using IWD?

Hi,
I don't use IWD only interfaces config file.

Did you remove allow-hotplug?

Both auto and allow-hotplug, should I restore auto instead?

Did you make sure not to use IWD's built-in DHCP client?

IWD is not installed!

Did you modify /etc/netplug/netplug?

Yes I did, using the configuration you shared!

I don't actually need the wifi I need it for the eth0, but I guess that if doesn't work is the same for the others, isn't it?

Thanks!

Offline

#15 2023-11-22 11:13:20

tf
Member
Registered: 2023-05-04
Posts: 8  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Danielsan wrote:
tf wrote:

Are you using IWD?

Hi,
I don't use IWD only interfaces config file.

Did you remove allow-hotplug?

Both auto and allow-hotplug, should I restore auto instead?

Did you make sure not to use IWD's built-in DHCP client?

IWD is not installed!

Did you modify /etc/netplug/netplug?

Yes I did, using the configuration you shared!

I don't actually need the wifi I need it for the eth0, but I guess that if doesn't work is the same for the others, isn't it?

Thanks!

This config is designed to specifically work with IWD. It should work like the original script if you are using ethernet (I made it detect if the interface is wireless or not.)

Offline

#16 2023-11-22 16:12:31

alexkemp
Member
Registered: 2018-05-14
Posts: 292  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Please, please STOP FULL-POST QUOTING. Thank you.

Offline

#17 2023-11-22 17:47:13

The-Amnesiac-Philosopher
Member
Registered: 2023-08-24
Posts: 250  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

alexkemp wrote:

Please, please STOP FULL-POST QUOTING. Thank you.

The Kempster,

It would probably help if you pointed to THIS POST so that you don't come off as so offensive when (cough-cough) requesting for people to please STOP FULL POST QUOTING...by explaining that an administrator has requested the same...instead of coming across as an angry man with an agenda of his own.

Offline

#18 2023-11-22 18:39:06

alexkemp
Member
Registered: 2018-05-14
Posts: 292  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

Thanks Amnesiac. Damn good point. I was attempting to find some humour in my post & failed completely.

Offline

#19 2023-11-22 23:05:04

Danielsan
Member
Registered: 2020-07-14
Posts: 172  

Re: [SOLVED] allow-hotplug not working properly on ifupdown

tf wrote:

This config is designed to specifically work with IWD. It should work like the original script if you are using ethernet (I made it detect if the interface is wireless or not.)

Needless to say that with the default script it doesn't work either.

Offline

Board footer