ifplugd does stop on suspend, but does not start again with resume

Bug #237118 reported by Petr Menšík
8
Affects Status Importance Assigned to Milestone
ifplugd (Debian)
Fix Released
Unknown
ifplugd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hello.
I am using ifplugd daemon for controling my ethernet card on my laptop (Sony Vaio VGN-FZ210C, but i believe that does not matter). It worked very well in gutsy. But it stopped working in hardy somehow and i cannot find what is a problem.

I have in /etc/network/interfaces:

iface eth0 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.wired.conf
        wpa-driver wired

#auto eth0

I am attaching part of log file, made by grep ifplug /var/log/daemon.log > /tmp/ifplug-daemon.log
 command. I havent found anything interesting in /var/log/daemon.log or else, but i can offer you any log if needed.

Problem is, after suspend to ram it does end. It is stopped, but dont know what does it. I found /etc/apm/other.d/50ifplugd, but it i dont know if that is called or when.

In /etc/default/ifplugd, i have

INTERFACES="eth0"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="none"

It was SUSPEND_ACTION="stop", but i replaced it in hope it will not finish always. It didnt work, it still does terminate on suspend, but does not start on resume. I have to do sudo /etc/init.d/ifplugd start after every suspend, and i am not happy with that.

I can always make some script in /etc/acpi/resume.d/something and get it started. But i believe better way would be not to terminate the daemon. But i dont know where is that done, grep haven't not found for me.

Oh, and i recall that used to work pretty well in gutsy. That is regression, it does not work in hardy as expected. I need wpa supplicant in university and i dont know better way for laptop. This way it does remove network connection if i unplug the cable, and i want that. Network manager is fine for wireless, but it does not allow wired supplicant. So i cannot use network manager now for ethernet.

Revision history for this message
Petr Menšík (pihhan) wrote :
Revision history for this message
Christoph (christoph-ka) wrote :

Try adding your interface to HOTPLUG_INTERFACES in /etc/default/ifplugd.

Upon suspend /lib/udev/ifplugd.agent is called and stops ifplugd for all interfaces. On resume, it only starts ifplugd for interfaces listed in HOTPLUG_INTERFACES.

While looking for a solution to my problem, I found an (unrelated) error in /etc/apm/scripts.d/ifplugd. The script ignores SUSPEND_ACTION=none because of small programming error. The attached patch is for this error, but does not help when using ACPI.

Revision history for this message
Christoph (christoph-ka) wrote :

Sorry I didn't test this well enough. Just adding interfaces to hotplug_interfaces works for resume, but doesn't work on system startup. Even though ifplugd gets started by udev and ifplugd.agent, this is too early in the boot process (file systems still mounted readonly or something like this) and doesn't bring up my eth0 interface.

This solution seems to work:

1.) Put the device in INTERFACES, not HOTPLUG_INTERFACES.
2.) Copy the attached script (derived from /etc/apm/scripts.d/ifplugd) to /usr/lib/pm-utils/sleep.d. This will respect the SUSPEND_ACTION in /etc/default/ifplugd and restart ifplugd if necassary.

I'm not sure when the scripts in /etc/acpi/resume.d and when /usr/lib/pm-utils/sleep.d gets called, but here (8.04 on a thinkpad t61) only the latter gets called.

Revision history for this message
Petr Menšík (pihhan) wrote :

Okay, thank you. With SUSPEND_ACTION=stop it does work like expected. It does not resume with suspend and none values, but with default stop it does work.

Changed in ifplugd:
status: Unknown → New
Revision history for this message
Mario Manno (manno) wrote :

The patch from #325614 should propably applied to ifplugd in intrepid.

But, actually this does not relate to this bug, can someone delete this 'also affects distribution' entry?

Revision history for this message
Mario Manno (manno) wrote :

I think hardys scripts work if you put the interface in INTERFACES and HOTPLUG_INTERFACES, and set SUSPEND_ACTION="suspend".

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

This bug is fixed in Debian and landed in Ubuntu, so marking this bug as fixed. Thank you for reporting bugs to Ubuntu!

Changed in ifplugd (Ubuntu):
status: New → Fix Released
affects: debian → ifplugd (Debian)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.