You are not logged in.

#1 2012-02-03 14:59:26

btby
Member
From: United States
Registered: 2011-12-23
Posts: 11

[SOLVED] Run script on suspend/lid closed before network disconnect

I'm trying to get a laptop running Gnome 3.2 to run a script on laptop suspend, but before network manager disconnects from the wireless network (I'm using networkmanager to manage networks). Tried /etc/pm/sleep.d/00script, but by the time it is run, the connections are down already. What exactly handles the network manager disconnect on suspend in my configuration and how can I run something before that happens?

(Not sure if this is a laptop questiont, Gnome question or network manager question, so please move as appropriate.)

Edit: Looks like NetworkManager gets a clue to disconnect the networks from upower even before pm-utils scripts are run and there is no way to help that as of yet.

Last edited by btby (2012-02-04 08:13:32)

Offline

#2 2012-02-03 22:27:31

vwyodajl
Member
Registered: 2012-01-21
Posts: 183

Re: [SOLVED] Run script on suspend/lid closed before network disconnect

not sure if this would work/help but maybe try running what you need from handler.sh. That is how I start/stop all the scripts and power related things based on power plug on AC or battery and so on.

HTH

Offline

#3 2012-02-04 08:13:16

btby
Member
From: United States
Registered: 2011-12-23
Posts: 11

Re: [SOLVED] Run script on suspend/lid closed before network disconnect

vwyodajl wrote:

not sure if this would work/help but maybe try running what you need from handler.sh. That is how I start/stop all the scripts and power related things based on power plug on AC or battery and so on.

HTH

Thanks, tried calling the script from /etc/acpi/handler.sh, but the `ip addr` values echo'ed to the file show that the connection is broken / suspended by the time the script gets called.

Switched to netcfg and wicd-gtk for this system where suspend is handled by 11netcfg in sleep.d, which allows me to run my script earlier by prefixing it with a lower number. I guess this solves it.

Edit: Gnome 3 users can get indicator placement similar to that of network-manager-applet by installing gnome-shell-extension-wicd-status from AUR.

Last edited by btby (2012-02-04 08:16:59)

Offline

Board footer

Powered by FluxBB