Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59B218A34 for ; Fri, 26 Aug 2011 03:52:05 +0000 (UTC) Received: (qmail 80540 invoked by uid 500); 26 Aug 2011 03:52:02 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 80472 invoked by uid 500); 26 Aug 2011 03:51:55 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 80458 invoked by uid 99); 26 Aug 2011 03:51:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2011 03:51:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eevans@acunu.com designates 209.85.210.66 as permitted sender) Received: from [209.85.210.66] (HELO mail-pz0-f66.google.com) (209.85.210.66) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2011 03:51:42 +0000 Received: by pzk34 with SMTP id 34so919428pzk.1 for ; Thu, 25 Aug 2011 20:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acunu.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=MyaF5yiUKqhV92y/jF+VTWyjRBuSwoxcTor5S1fEq/g=; b=W7C2zsMI9hRttcbZrYuonkYXAZYSxo5gH5FHai/fTVuCwz1JGDKpWtDWOedFtzhbu6 Xp/DCVxVy+BgO9RfjlIGSMPFtbDI6sGhC9X/Gd8JH26/0wYZuxJsUYT4jJpPnumYyfLC pVKLSQ+6eWf+bsB4Wj9GDuiEULNrTHg2V553s= MIME-Version: 1.0 Received: by 10.143.82.5 with SMTP id j5mr264598wfl.280.1314330680757; Thu, 25 Aug 2011 20:51:20 -0700 (PDT) Received: by 10.142.98.9 with HTTP; Thu, 25 Aug 2011 20:51:20 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 Aug 2011 22:51:20 -0500 Message-ID: Subject: Re: question about cassandra.in.sh From: Eric Evans To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2011 at 10:13 AM, Koert Kuipers wrote: > hey eric, the one thing i do not agree that it is the element of least > surprise. i would argue that the default behavior for *nix appplications = is > that they find out what their home directory is and operate relative to > that. something like: I'm not sure what you mean by "home directory" here, but *nix applications tend to have binaries installed to path, library locations resolved, and other resource locations fixed at compile-time. But Java apps seldom adhere to platform conventions anyway. cassandra.in.sh is meant (was originally meant) to be site config, providing the means to customize the install. The one checked in to bin/ is simply a default, and is (hopefully )setup with what will work for most people, most of the time. I guess least surprising might depend on who you ask, but for what it's worth, the search order has been like that all along and this is the first time that I'm aware of it coming up. > script_dir=3D"$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" > home_dir=3D${script_dir%/bin} > > or production quality code from hadoop-config.sh which is sourced by the > main hadoop script: > this=3D"${BASH_SOURCE-$0}" > bin=3D$(cd -P -- "$(dirname -- "$this")" && pwd -P) > script=3D"$(basename -- "$this")" > this=3D"$bin/$script" > # the root of the Hadoop installation > if [ -z "$HADOOP_HOME" ]; then > =A0 export HADOOP_HOME=3D`dirname "$this"`/.. > fi > > i find setting a variable in your shell like CASSANDRA_INCLUDE to be erro= r > prone. at some point i will forget what i set it to and them i am by > accident using the wrong application. once applications are aware of thei= r > home dir all i have to do is "ln -s /usr/lib/cassandra-0.7/bin/nodetool > /usr/sbin/nodetool-0.7" and then i can use it without risk of confusion. Having multiple independent versions, one or more of which are "installed" to the usual site-wide locations is not at all common that I can see. I'd also classify it as falling squarely in the Better Know What You're Doing category. Seen that way, editing cassandra.in.sh, or passing an alternate using CASSANDRA_INCLUDE doesn't seem unreasonable, but YMMV. Your welcome to open a ticket though. -- Eric Evans Acunu |=A0http://www.acunu.com=A0| @acunu