LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-22-2008, 01:13 AM   #1
thesk8ingtoad
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
How to reconnect to wifi on resume from hibernate/suspend? Slackware 12.1, madwifi


Okay, so I've upgraded to Slack 12.1 (actually it's slamd64 12.1, but from my experience, what works on one works on the other.) and after a few hours of set up everything is working great- even hibernate/suspend, which I had given up on with 12.0. The only thing is that when I resume, my wifi does not reconnect. I can reconnect manually by running '/etc/rc.d/rc.inet1 ath0_start' but it's kind of a pain. I'd like to be able to have this run right after resume, but can't figure out what config file to put it in. /etc/acpi/acpi_handler.sh or /etc/acpi/events/default ? Normally I'd just play around with the thing until it worked, but with everything else working so well I've been afraid to muck about with the acpi config. any ideas? btw, if there's a better way to do this that would certainly work as well
 
Old 08-22-2008, 07:15 AM   #2
harryhaller
Member
 
Registered: Sep 2004
Posts: 429

Rep: Reputation: Disabled
You should have acpi_handler.sh call a script located in the same directory.

You can then run '/etc/rc.d/rc.inet1 ath0_start' from there.

I start hibernate by pressing the power button. Here's what I have on my machine:

acpi_handler.sh:
Code:
 #!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
  button)
    case "$2" in
#      power) /sbin/init 0
      power) /etc/acpi/hibernate.sh
         ;;
      *) logger "ACPI action $2 is not defined
         ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac
hibernate.sh:
Code:
 #!/bin/sh


# Switch to console terminal to avoid graphics corruption in X:
chvt 1

# Flush all data to disk (just in case...):
sync

# turn off dhcpcd
/sbin/dhcpcd -k

# Save the system time
hwclock --systohc --localtime

# Suspend:
echo -n "mem" > /sys/power/state

# Now we are sleeping.

# Restore the system time:
hwclock --hctosys --localtime

# restart dhcpcd
/sbin/dhcpcd -d -t 30 -R eth0

# get time
/usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org

# Switch back to X:
chvt 7
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HP Laptop hibernate/suspend/resume question Jongi Debian 4 05-20-2008 08:08 PM
Wifi card LED comes on after suspend/resume but not at boot? hollywoodb Linux - Hardware 3 04-18-2007 01:10 PM
mandriva 2007: suspend, resume, wifi won't work thevanillaspy Mandriva 1 01-23-2007 06:05 AM
Mini HOW-TO: Hibernate and resume cwwilson721 Slackware 12 03-13-2006 03:54 PM
Suspend / Resume scripts on slackware 9 boney Slackware 0 06-19-2003 02:09 AM


All times are GMT -5. The time now is 03:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration