Grant Walton tapped away at the keyboard with:
On our small network is a file/print server and a mail server, both running 6.3. The file server is connected to a UPS via a serial cable and monitoring software initiates the shutdown process in event of a power failure. The mail server is connected to a simple UPS without any monitoring capabilities, in another part of the building. Is is possible to write a script (or something!) that will be triggered on the file server in event of a power failure and that can telnet into the mail server across the network and initiate the shutdown sequence before the file server shuts itself down? What would such a script look like? I am trying to avoid purchasing another smart UPS just for the mail server.
If you have a spare serial port on the file server, then hook that up to the mail server for a "secure" connection to trigger a shutdown. If you _trust_ and I mean really trust everybody on the network, then you can do it by use of inetd to launch a shutdown script when a connection is established to the corresponding TCP/IP port. Some protection is available by limiting hosts allowed to connect to the file server. A similar possibility is to use ssh to trigger the shutdown. It's not as secure as one could hope because a password will have to be provided and "stored" in the UPS monitoring system. In brief. Yes; it's possible. What it would look like depends on the sophistication involved. A "one-liner" is sufficient to initiate a shutdown. e.g. $ ssh root@mailserver "shutdown -h now" -- /"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia \ / ASCII ribbon campaign | I'm a .signature virus! | X against HTML mail | Copy me into your ~/.signature| / \ and postings | to help me spread! |