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 C91D11381F3 for ; Thu, 8 Aug 2013 23:48:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 146A5E0A44; Thu, 8 Aug 2013 23:48:29 +0000 (UTC) Received: from os-mail-1.tamu.edu (os-mail-1.tamu.edu [165.91.23.62]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 32DF1E0996 for ; Thu, 8 Aug 2013 23:48:28 +0000 (UTC) X-TAMU-Auth-ID: t551 X-TAMU-SenderIP: 75.90.93.226 X-HAT: SG None, P $RELAY, L outlook_auth X-SRBS: None X-EXTLoop1: 75.90.93.226 X-IronPort-AV: E=Sophos;i="4.89,842,1367989200"; d="scan'208";a="433390359" From: Taahir Ahmed To: gentoo-java@lists.gentoo.org Subject: [gentoo-java] Packaging scm-manager Date: Thu, 08 Aug 2013 18:48:24 -0500 Message-ID: <15148336.2obGtzaLKW@basis> Organization: TAMU-CS-DAIRL User-Agent: KMail/4.10.5 (Linux/3.10.4-gentoo; KDE/4.10.5; x86_64; ; ) 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: multipart/mixed; boundary="nextPart1669406.5MEtArG5D4" Content-Transfer-Encoding: 7Bit X-Archives-Salt: 9be070a8-aa3a-4609-b603-7056c5ed7e8a X-Archives-Hash: e68346fb161e97f24ff9dae8c9b81135 This is a multi-part message in MIME format. --nextPart1669406.5MEtArG5D4 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Hi all, I'm interested in packaging scm-manager [http://www.scm-manager.org/]. It's a very nice java servlet that handles hosting git, mercurial, bazaar, and subversion repositories. 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. Thanks, Taahir Ahmed --nextPart1669406.5MEtArG5D4 Content-Disposition: attachment; filename="scm-manager" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="scm-manager" #!/sbin/runscript # Taahir Ahmed # OpenRC init script for scm-manager. It's installed in scm-user's home # directory, and we drop root priveleges before we invoke it. It's a java # webapp, so my trust in it isn't particularly high. depend() { # Doesn't make sense to run without network access. At the very least, we # need a loopback. need net # I'm pretty sure it can talk to syslog. use logger } JAVA_HOME=$(java-config --jre-home) BASEDIR=/home/scm-user/scm-server REPO="$BASEDIR"/lib CLASSPATH=${CLASSPATH}:"$BASEDIR"/conf CLASSPATH=${CLASSPATH}:"$REPO"/scm-server-1.32.jar CLASSPATH=${CLASSPATH}:"$REPO"/commons-daemon-1.0.10.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-server-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/javax.servlet-2.5.0.v201103041518.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-continuation-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-http-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-io-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-webapp-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-xml-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-servlet-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-security-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-jmx-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-util-7.6.11.v20130520.jar CLASSPATH=${CLASSPATH}:"$REPO"/jetty-ajp-7.6.11.v20130520.jar start() { # if [ "${RC_CMD}" = "restart" ]; # then # # I don't think a restart requires anything special # fi ebegin "Starting scm-manager" # Launch the daemon using jsvc (from the dev-java/commons-daemon package). /usr/bin/jsvc \ -java-home $JAVA_HOME \ -cp "$CLASSPATH" \ -Djava.awt.headless=true \ -Dlogback.configurationFile=logging.xml \ -user scm-user \ -outfile "$BASEDIR/var/log/scm-server.out" \ -errfile "$BASEDIR/var/log/scm-server.err" \ -pidfile "$BASEDIR/var/scm-server.pid" \ -Dapp.name="scm-server" \ -Dapp.repo="$REPO" \ -Dbasedir="$BASEDIR" \ sonia.scm.server.ScmServerDaemon eend $? } stop() { ebegin "Stopping scm-manager" # Stop using jsvc and the pidfile created during "start". /usr/bin/jsvc \ -verbose \ -stop \ -java-home $JAVA_HOME \ -cp "$CLASSPATH" \ -user scm-user \ -outfile "$BASEDIR/var/log/scm-server.out" \ -errfile "$BASEDIR/var/log/scm-server.err" \ -pidfile "$BASEDIR/var/scm-server.pid" \ -Dapp.name="scm-server" \ -Dapp.repo="$REPO" \ -Dbasedir="$BASEDIR" \ -Djava.awt.headless=true \ -Dlogback.configurationFile=logging.xml \ sonia.scm.server.ScmServerDaemon eend $? } --nextPart1669406.5MEtArG5D4--