Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How di I reinitialize eth0 on resume from suspend?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
insomniac
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jul 2002
Posts: 132
Location: Lund, Sweden

PostPosted: Sun Oct 20, 2002 1:45 pm    Post subject: How di I reinitialize eth0 on resume from suspend? Reply with quote

I have a laptop connected to a LAN (dhcp) and every time i resume from suspend, I have to wait about 15 minutes before dhcpcd rediscovers the dhcp address. I'd like to have a script which automatically shuts down eth0 on suspend, and restarts it at resume.
eth0 is started and stopped via /etc/init.d/net.eth0 but where do I put the script to have it shut down on suspend (/etc/init.d/net.eth0 stop) and start on resume???
_________________
My next computer is also a Gentoo computer
Back to top
View user's profile Send private message
clacour
n00b
n00b


Joined: 19 Apr 2002
Posts: 59
Location: Dallas, Tx USA

PostPosted: Wed Oct 23, 2002 9:09 pm    Post subject: Reply with quote

This applies to apmd -- I can't speak on the subject of acpi.

Do a "ps -ef | grep apm". If all you see is "kapmd", then you're not running the apmd program, which you have to have to make this fly.

Use "/etc/init.d/apmd start" to start it.
Say "rc-update add apmd default" to turn it on permanently.

All the stuff that controls what apmd does is in /etc/apm. Rather than cover all the various ways it can be done, I'll just describe how I did it:

Create a script in "/etc/apm/event.d". (I called mine "events", but any script(s) in that directory will be executed).

The script will be passed two parameters. See /etc/apm/apmd_proxy for the list of possible values.

I only cared about two: "suspend" and "resume", and I didn't really care why it suspended or resumed, just that it did.

In pseudocode, here's what mine does:

if "suspend"
/etc/init.d/net.eth0 stop
cardctl eject 0
fi

if "resume"
cardctl insert 0
/etc/init.d/net.eth0 start
fi

I need the cardctl stuff because there's something squirrelly with either my card or the driver. I used to have a 10mbit-only card that came up with no grief at all. I wouldn't put in the "cardctl" stuff unless you find you need it.

Hope this helps,

CHL
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum