From owner-freebsd-questions@FreeBSD.ORG Mon Aug 11 12:25:33 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 337B71065689 for ; Mon, 11 Aug 2008 12:25:33 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id E4EEA8FC24 for ; Mon, 11 Aug 2008 12:25:32 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from working (198-144-37-131.static.vdsl.nidhog.net [198.144.37.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id A5961EBC09; Mon, 11 Aug 2008 08:25:31 -0400 (EDT) Date: Mon, 11 Aug 2008 08:25:30 -0400 From: Bill Moran To: "Michael Grant" Message-Id: <20080811082530.e4c51dae.wmoran@potentialtech.com> In-Reply-To: <62b856460808092211r50111d3fnd70feeb46f819a43@mail.gmail.com> References: <62b856460808091322m38558ec2o1359fff91ae68a79@mail.gmail.com> <34556D79-74F5-4222-A945-DC22628CB17D@goldmark.org> <62b856460808092211r50111d3fnd70feeb46f819a43@mail.gmail.com> X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Mon, 11 Aug 2008 12:25:33 -0000 "Michael Grant" wrote: > > I have such a script, I put it in /bin/require_hostname and symlinked > shutdown, halt, reboot, fastboot, and fasthalt to this script: > > #!/bin/sh > > if [ "$1" = `hostname` ]; then > shift > exec /sbin/`basename $0` $@ > else > echo "For your protection, use: $0 hostname ..." > fi > > I realize a lot of people have their own tricks and habits for > avoiding such stupidity, but what is the problem of fixing the problem > globally by getting these commands to take a hostname argument? > > This could certainly be the basis for another thread (and this is > perhaps not the correct list), but is there some way to request a > modification across all the unix/linux distributions out there to > maintain some level of consistency across them? Except for Posix, is > there some overall list which deals with this conformity of all these > sibling platforms? Changing that command globally is a huge undertaking. First off, it will break every single script out there that uses those commands, thus causing a worldwide riot. Second, it's not compliant with POSIX, thus we reopen the wound of The Unix Wars. Third, it's not a very good solution. Off the top of my head: 1) What happens to machines that don't have a hostname yet? (during install for example) you can't shut them down? 2) Which hostname? The FQDN, which can be REALLY long in many cases. Or the short name, which can be duplicated (how many web00s do I have in various facilities across the country?) so then doesn't solve the problem. 3) I'm not having the problem you describe, thus you're asking me to type more (possibly a LOT more) to solve a problem I don't have. 4) It breaks every single script out there that uses those commands 5) Tied in with #3, there's a REALLY easy way to fix this for those out there who are having trouble with it. I'm unclear why you find the mechanisms built into the system that allow you to fix this yourself to be inadequate? -- Bill Moran http://www.potentialtech.com