Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Aug 2008 20:45:36 -0500
From:      Jeffrey Goldberg <jeffrey@goldmark.org>
To:        Michael Grant <mgrant@grant.org>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: shutdown/reboot suggestion
Message-ID:  <34556D79-74F5-4222-A945-DC22628CB17D@goldmark.org>
In-Reply-To: <62b856460808091322m38558ec2o1359fff91ae68a79@mail.gmail.com>
References:  <62b856460808091322m38558ec2o1359fff91ae68a79@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 9, 2008, at 3:22 PM, Michael Grant wrote:

> More than once, through carelessness, and I'm sure I'm not alone, I
> have inadvertently shutdown or rebooted the wrong machine.  I'm sure
> some of you know that all too familiar feeling when you see
> "Connection closed" instead of your desktop being rebooted.

I use a combination of tricks.

1. I have the hostname in my prompt.
2. I have a separate color scheme for ssh sessions for each host I  
commonly connect to, and a generic color scheme for ssh sessions for  
other hosts.  These are all distinct from my term window color scheme  
for my local host.
3. I rarely run as root, so all of my shutdown's use sudo.  My  
password isn't the same on all hosts.

This doesn't work perfectly, but it does help avoid this kind of  
problem.


> I have a suggestion with respect to these commands.  What if they
> could be modified to require the hostname of the machine as their
> first argument, otherwise, they refuse to bring the machine down?
>
>  shutdown -h now
>
> becomes:
>
>  shutdown example.com -h now

As others have pointed out, you can easily make scripts to do that.

-j



-- 
Jeffrey Goldberg                        http://www.goldmark.org/jeff/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34556D79-74F5-4222-A945-DC22628CB17D>