Hardware Reference
In-Depth Information
All shutdown commands must be carried out by that machine's root user, and because root is disallowed from
connecting to a machine through ssh by default, it is not always obvious how to shut down a remote machine.
The standard method is to use sudo , letting a nonprivileged user connect to the machine and then upgrading
themselves to root temporarily to shut down the machine with the following:
sudo shutdown -h now
Although a password is generally required for sudo , this can be waived by amending the /etc/sudoers file with a
line such as this:
steev localhost=NOPASSWD: /sbin/shutdown
This can be automated further by issuing the command from a script that relies on a little-used feature of ssh ,
namely, the ability to log in, execute a command, and then quit:
ssh steev@myhomemachine.homelinux.net 'sudo shutdown -h now'
Because the shutdown command was created at a time when all users worked on the console, the alert message
is generally invisible to most house users, so you might like to create a shutdown script that uses speech synthesis
or music to indicate that the server is being switched off. However, as reboots and shutdowns in Linux are rare and
you're probably in the next room to your “users,” this is less important.
Shutting down any Windows machines on your network may be more difficult, since the method for doing so is
less well defined. A command such as the following:
net rpc shutdown -I 192.168.1.100 -U windows_username%their_password
can work in many instances but is dependent on firewalls, file-sharing options, and even the version of Windows.
Given these commands to start up and shut down most machines in your home, you can effectively coordinate
them to ensure the best power usage scenarios for your needs using a simple crontab on your primary server.
UPS
An uninterruptable power supply (UPS) is an essential piece of kit for anyone relying on moderate- to high-cost
technology. And because your house is now a high-cost peripheral to that high-cost technology, it becomes important
part in your HA setup—not just to eliminate the effects of short-term power dropouts and blackouts but also to
prevent the damage caused by surges.
Most UPS units work on the same principle; that is, a device looking like an oversize multigang power strip
connects the mains and a battery together to provide consistent power to four or more sockets. In the cheaper
and most commonly seen devices, the device monitors the mains supply and, if it fails or drops below a specified
threshold, switches to the battery. The second type of UPS supplies the output from the battery at all times and uses
the mains power to keep the battery charged. The shape of the output waveform varies too and is usually governed
by the cost of the device. The output of the cheaper devices is usually a square wave, while more expensive ones
have a sinusoidal wave form. This doesn't matter much for computers but can provide a difference when powering
an audiophile record player, as mentioned in Chapter 3. Whenever a power drop is noticed, an alarm will sound and
repeat the audible warning periodically. When the battery reaches a critically low level, the shutdown procedure will
be initiated via the USB (or serial) cable so that the machine(s) connected to the UPS can close down safely. Each unit
comes rated for a different VAs, indicating how much you can draw from it when it is disconnected from the mains.
You will usually need a higher VA than the wattage. The required VA is the watts divided by the power factor of the
connected device(s). The temporal duration of protection ranges from a few minutes to quarter of an hour, depending
on what machines are connected to it and the tasks running on those machines. You can refer to Table 4-1 for a rough
guide. For a buying, always get as high a power rating as possible.
Search WWH ::




Custom Search