Re: Proper suspend mode (no more on/off switching)
Pending further investigation, we now allege that Hanno Mueller wrote:
> probably a stupid question: How can I automate the re-assignment of my
> laptop's IP address?
> Linux runs just perfectly on my laptop, APM is fully supported, suspend to
> disk works as expected, as does my PCMCIA network card. Thanks everyone.
> However, it's quite slow and and I move a lot between different networks
> (home, university, office, places where I don't need the network card at
> Using DHCP, at my new location I often do telinit 1 and back just to make
> sure that all my applications know that the local ip address has changed.
> Is there any way to automate this, without telinit 1 ? (Maybe I just don't
> quite get this.)
> My ideal scenario would be waking up the laptop from suspend, inserting
> the network card and somehow making sure that all applications running on
> my laptop (e.g. apache, X, exim) get informed about the new network
> adapter and / or the new IP address, while they continue to run. Similar
> to this, I would want to remove the PCMCIA card just as easy.
> Basically, I don't want to do a real shutdown of my laptop at all, I just
> want to use suspend to disk / wakeup; going from one office to another;
> without leaving or restarting X to do so.
> Links for further reading are appreciated.
You edit the network.opts under /etc/pcmcia to run arbitrary
commands when the network card starts up by entering those commands
under the start_fn() function. Use this to run a shell
script or perl script to do whatever you need. In fact, I use it on
my laptop to run a shell script that sets up appropriate ipchains
rules, update my hosts file with my IP address and restart bind.
You can do something similar for removing a card with stop_fn().