From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2C9001381F3 for ; Fri, 9 Aug 2013 00:57:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 646D0E0AF1; Fri, 9 Aug 2013 00:57:22 +0000 (UTC) Received: from mail.xunit.de (mail.xunit.de [178.33.39.247]) by pigeon.gentoo.org (Postfix) with ESMTP id BDAADE0A64 for ; Fri, 9 Aug 2013 00:57:21 +0000 (UTC) Received: from me.fritz.box (pD95EE1EB.dip0.t-ipconnect.de [217.94.225.235]) by mail.xunit.de (Postfix) with ESMTPSA id 98994193953 for ; Fri, 9 Aug 2013 02:57:04 +0200 (CEST) Date: Fri, 9 Aug 2013 02:58:16 +0200 From: assabajanischer_hinterwaeldler@xunit.de To: gentoo-java@lists.gentoo.org Subject: Re: [gentoo-java] Packaging scm-manager Message-ID: <20130809005816.GA5301@me.fritz.box> References: <15148336.2obGtzaLKW@basis> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@lists.gentoo.org Reply-To: gentoo-java@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15148336.2obGtzaLKW@basis> User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: 3df847f1-9322-484d-ada4-2bf177ae811f X-Archives-Hash: a6b89ce161f013019fe4132ea4bab0a0 Hi Taahir, iirc init scripts should read the given values from /etc/conf.d folder, but it's definitly possible to access parts of the real filesystem. you only have to take care to not exceed the root filesystem (at least it lead to some failure in an init script i've written). i'm not sure if this is the best idea, but placing a copy of the JAVA_HOME value should work quiet well. to achieve this i see two ways: 1) setting the value within the depend part 2) append the update to the shutdown of this script as i'm not sure when the depend is called this may lead to some errors, if the things change. in both cases you have to take care, that the necessary config values have be never written at all (hope there is a feasible value). imo this should be a much cleaner way. > BASEDIR=/home/scm-user/scm-server > REPO="$BASEDIR"/lib should definitely be placed within the config part to allow changes to it without the need to modify the init script. greets martin On Thu, Aug 08, 2013 at 06:48:24PM -0500, Taahir Ahmed wrote: > I'm starting by writing an init script for my existing install (attached). > I've got it mostly working, I think, but I am wondering if there's a gentoo- > approved way of setting a proper value for JAVA_HOME in the init script. > > There is a file (/etc/profile.d/java-config-2.sh) that sets a value for > several java-related environment variables. Is it good practice to source > this file from an init script? Right now I'm just using a sub-shell call to > java-config to detect the active system vm.