Feature Request - Run a script after suspend/resume

Bug #390140 reported by Alan Hicks on 2009-06-21
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wicd
Wishlist
Adam Blackburn

Bug Description

When suspending and resuming, wicd doesn't allow the user to set a script to be run after resume or before suspend. This would be particularly useful for users running network daemons in their postconnect scripts, particularly VPN connections which don't always resume the connection after resume.

Adam Blackburn (adamblackburn) wrote :

Targeting to 1.6.3 release.

Changed in wicd:
importance: Undecided → Wishlist
milestone: none → 1.6.3
status: New → Triaged
Changed in wicd:
status: Triaged → In Progress
assignee: nobody → Adam Blackburn (adamblackburn)
Adam Blackburn (adamblackburn) wrote :

When Wicd suspends, it should run the postdisconnect script. On resume, it will run the preconnect script. Doesn't this do what you want, or am I missing something?

On Wed, 12 Aug 2009 21:36:28 -0000
Adam Blackburn <email address hidden> wrote:

> When Wicd suspends, it should run the postdisconnect script. On
> resume, it will run the preconnect script. Doesn't this do what you
> want, or am I missing something?

No; it doesn't do this, at least not for me. I'm running
Slackware-current, x86_64. Perhaps wicd relies on something that
Slackware doesn't do in order to determine if the machine has slept or
not. I've included my configuration file along with my postconnect and
disconnect scripts. My system sleeps simply by echoing "mem"
into /sys/power/state. Does wicd rely on something more complicated
than this?

/etc/wicd/wireless-settings.conf
================================
[00:13:10:EA:4E:BD]
afterscript = /usr/local/bin/nest.sh
bssid = 00:13:10:EA:4E:BD
ip = None
dns_domain = None
quality = 75
gateway = None
use_global_dns = 0
strength = -59
encryption = False
bitrates = 1 Mb/s
beforescript = None
hidden = False
channel = 5
essid = nest
has_profile = True
netmask = None
enctype = None
dns3 = None
dns2 = None
dns1 = None
use_settings_globally = 0
use_static_dns = 0
mode = Master
disconnectscript = /usr/local/bin/nest_disconnect.sh
automatic = False
search_domain = None

/usr/local/bin/nest.sh
======================
#!/bin/bash
# Connect to nest wifi

# Check to see if this is run
echo "nest.sh" >> /tmp/nesting

# Make sure the socket is open
killall openvpn

openvpn --config /etc/openvpn/nest.conf &

sleep 5 # give it a moment to get the interfaces up

cat << EOF > /etc/resolv.conf
search lizella.net
nameserver 192.168.1.254
EOF

route add default gw 172.16.1.17

/usr/local/bin/nest_disconnect.sh
=================================
#!/bin/bash

echo "nest_disconnect.sh" >> /tmp/nesting

killall openvpn

--
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5

Adam Blackburn (adamblackburn) wrote :

Ah. Wicd's suspend/resume scripts use pm-utils, so that would explain why they don't run. What/how would we hook into to grab suspend events from echoing "mem" into /sys/power/state?

Robby Workman (rworkman) wrote :

We wouldn't. Alan needs to RTFM and use "pm-suspend" instead ;-)

Adam Blackburn (adamblackburn) wrote :

I'm going to go ahead and mark this as won't fix, as I believe using pm-utils should solve what was needed by this feature. If I'm wrong, feel free to reopen.

Changed in wicd:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers