Subject: Re: Macintosh/Linux UPS question
From: Ryan McBeth (ryan@mobiusnm.com)
Date: Fri May 18 2001 - 08:16:27 EDT
        Heath,
        Heck, I don't mind cross-posting as long as there's an 
interesting problem to solve.
        What I might do is have the linux box run a cron job every 
minute (or every 5, whatever).  This cron job doesn't check for a 
file.  It pings for the Macintosh.  If the Macintosh isn't there, 
record that fact.  Then ping again in another 5 minutes.  If it still 
isn't there, then shut everything down.
        Conversely, can you have the Macintosh send a signal to the 
Linux box?  What if the Macintosh sent a "death notice" to the linux 
box via e-mail when it was instructed to shut down?
        Alias the e-mail to a shell script on your Linux machine. 
Here's the problem though:  With a little tweaking, someone could 
shut down your Linux system if they sent mail to that specific 
shutdown address.   So you might want the script to check for a code 
that is sent in the death e-mail.
        I actually wrote something like this once back when one of 
our NT machines had a UPS that did automatic shutdown, and one of our 
Linux machines had a "My First UPS" that probably came from Fisher 
Price.  Since we couldn't do automatic shutdown on the Linux machine, 
we would periodically check to see if the NT machine had fallen off 
the network.  If it did, the Linux machine sent a a page to me, and 
shut itself down.
        However, one day I shut the NT machine down for periodic 
maintenance and forgot to disable the Linux server's checking. 
Needless to say the Linux machine obediently shut itself down in the 
middle of the workday.  Sometimes, when I close my eyes, I still hear 
the screams... :-)
        So in a nutshell, build in a safety - even if it's just a 
note on the server - that if you shut the machine down for 
maintenance, be sure to disable the checking script on the Linux 
machine.
        Let me know how it turns out, or if you need help developing 
the script.
        Ryan
>Hello everyone,
>
>Sorry for the cross-post, but I have an intriguing question.
>
>Is there a way to have a Macintosh (6100 hooked to an APC-UPS and when
>shutdown is initiated it will close filemaker with no arguments, as well as
>run a shutdown script that will also power-down a linux box on the same
>machine.  I wasn't sure if I could have it write a text file to Halt the
>computer and upon UPS powerdown copy it to a Linux Netatalk mounted drive
>and have the Linux box run a cron job every one minute that will cause it to
>look for a particular file.  If present it will run a script, if not it will
>not run that script.  I need to be able to power down both Macintosh and
>Linux box from one or the other machines?
>
>
>Thanks for any help.
>
>Heath Henderson
__________________________________
Ryan McBeth
Systems Administrator, Mobius New Media
Voice: (302) 475-9880 x11
FAX: (302) 475-9894
www.mobiusnm.com
__________________________________
If all you have is a hammer, everything looks like a nail.
This archive was generated by hypermail 2b28 : Sun Oct 14 2001 - 03:04:40 EDT