[Gllug] Fully automating server shutdown and reboot
Dylan
dylan at dylan.me.uk
Wed Mar 12 13:43:39 UTC 2008
Hi again,
This is by way of a followup to my previous post (UPS Battery life.)
I'm in the process of moving and so have the opportunity to introduce more
automation into the shutdown and reboot of my network. The setup is as
follows:
A gateway providing DNS and DHCP internally, and ssh internally and
externally.
The WAN side is connected to an ADSL router which passes the public IP to the
gateway as a Zero-IP Bridge.
The LAN side is connected to a wi-fi switch.
A second box acts as a backup server. (I do the backups manually.)
The third box is a media server. It provides various nfs exports, and is
connected to the house stereo, but doesn't do media streaming (yet?)
And then there's the laptop I use day-to-day. It automounts the nfs exports
from the media server and is often running Amarok on the media server via
ssh.
My ideal scenario would be as follows:
Soon (say 30 mins) after my laptop 'leaves the network', the media server and
backup server should shut down. The gateway should also shut down, unless it
is in the process of a download, in which case it should shut down when that
download finishes.
When the laptop returns, the gateway should power up as quckly as possible.
Preferably triggered by the laptop's network presence. The backup and media
servers should also boot, but there would be no particular time constraint on
that.
It would be absolutely ideal if I could trigger the gateway to boot from the
WAN as well, but I'm not sure of the security implications of that.
Presumably, it is relatively easy to set a cron job on the gateway to check if
the laptop is present and if not then it can instruct the the other two boxes
to shut down - in much the way the UPS system works, or simply by issuing a
halt by ssh. Can I get dhcp to tell me which machines are present?
So far so good, but how would I go about getting the machines to boot in
response to the laptop attempting to connect?
There is a final complication - the backup and media machines have their data
partitions encrypted. Since I currently boot the machines manually, this is
no problem. Is there a way for the servers to retrieve the keys from the
laptop (which itself has an encrypted home partition)?
I know that's a lot, and may well not make entire sense, but any suggestions
and discussions are welcome.
Dylan
--
“ ‘... but there is so much else behind what I say. It makes itself known to
me so slowly, so incompletely! ...’ ”
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list