From owner-freebsd-questions@FreeBSD.ORG Sun Aug 10 01:45:38 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7651065688 for ; Sun, 10 Aug 2008 01:45:38 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8F78FC19 for ; Sun, 10 Aug 2008 01:45:38 +0000 (UTC) (envelope-from jeffrey@goldmark.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 2299113A65A; Sat, 9 Aug 2008 21:45:38 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 09 Aug 2008 21:45:38 -0400 X-Sasl-enc: h92kl/8aFD06P8imaCh4SyOVkfMD50q5OLgmoum7ZYCk 1218332737 Received: from hagrid.ewd.goldmark.org (n114.ewd.goldmark.org [72.64.118.114]) by mail.messagingengine.com (Postfix) with ESMTPSA id AED8DE8F3; Sat, 9 Aug 2008 21:45:37 -0400 (EDT) Message-Id: <34556D79-74F5-4222-A945-DC22628CB17D@goldmark.org> From: Jeffrey Goldberg To: Michael Grant In-Reply-To: <62b856460808091322m38558ec2o1359fff91ae68a79@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Date: Sat, 9 Aug 2008 20:45:36 -0500 References: <62b856460808091322m38558ec2o1359fff91ae68a79@mail.gmail.com> X-Mailer: Apple Mail (2.928.1) Cc: FreeBSD Questions Subject: Re: shutdown/reboot suggestion X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Aug 2008 01:45:38 -0000 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/