From derby-user-return-9753-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue Sep 09 16:17:17 2008 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 2846 invoked from network); 9 Sep 2008 16:17:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 16:17:16 -0000 Received: (qmail 25773 invoked by uid 500); 9 Sep 2008 16:17:12 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 25748 invoked by uid 500); 9 Sep 2008 16:17:11 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 25737 invoked by uid 99); 9 Sep 2008 16:17:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 09:17:11 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.168.70.188] (HELO relay8.mail.uk.clara.net) (80.168.70.188) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 16:16:11 +0000 Received: from [217.158.27.252] (port=58853 helo=SRV-VL-EX-01.visitlondon.com) by relay8.mail.uk.clara.net with esmtp (Exim 4.69) (envelope-from ) id 1Kd5tQ-0004ds-Ua for derby-user@db.apache.org; Tue, 09 Sep 2008 17:16:41 +0100 Thread-Index: AckSl3iHEkQmhUHPSCK0RAIaEMq0jA== Received: from tietokone.visitlondon.com ([10.112.20.6]) by SRV-VL-EX-01.visitlondon.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 9 Sep 2008 17:16:52 +0100 Message-ID: <48C6A0E5.50803@visitlondon.com> Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 Date: Tue, 09 Sep 2008 17:14:29 +0100 From: "Chris Wareham" Organization: Visit London User-Agent: Thunderbird 2.0.0.16 (X11/20080822) MIME-Version: 1.0 To: "Derby Discussion" Subject: Re: Derby init script for Linux / Unix (SOLVED) References: <48C685B7.7000104@visitlondon.com> <48C69E79.6070609@visitlondon.com> In-Reply-To: <48C69E79.6070609@visitlondon.com> Content-Type: text/plain; format=flowed; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 09 Sep 2008 16:16:52.0748 (UTC) FILETIME=[787B54C0:01C91297] X-Virus-Checked: Checked by ClamAV on apache.org Still not sure if this is a manifestation of the ssh hang-on-exit bug, but redirecting stderr to a file as well as stdout solves the problem. It's probably a good idea not to overwrite that file when shutting down, so with both changes the init script becomes: #!/bin/sh # Starts and stops the derby database DERBY_HOME=3D/home/web DERBY_USER=3Dweb derby_start () { su -l $DERBY_USER -c "$DERBY_HOME/bin/start_derby >=20 $DERBY_HOME/logs/derby.log 2>&1 &" } derby_stop () { su -l $DERBY_USER -c "$DERBY_HOME/bin/stop_derby" } case "$1" in start) derby_start ;; stop) derby_stop ;; restart) derby_stop sleep 5 derby_start ;; *) echo "Usage: /etc/init.d/derby {start|stop|restart}" exit 1 ;; esac exit 0 =20 Chris Wareham Senior Software Engineer Visit London Ltd 6th floor, 2 More London Riverside, London SE1 2RR =20 Tel: +44 (0)20 7234 5848 Fax: +44 (0)20 7234 5753 =20 www.visitlondon.com =20 =20 =20 Save the date for the Visit London Awards 2008!=20 Thursday 27th November, Royal Albert Hall. =20 =20 =20 =20 =20 'Visit London Limited' is registered in England under No.761149; Registered Office: Visit London, 2 More London Riverside, London SE1 = 2RR. =20 Visit London is the official visitor organisation for London. Visit = London is partly funded by Partnership, the Mayor's London Development = Agency and London Councils. The information contained in this e-mail is confidential and intended = for the named recipient(s) only. If you have received it in error, = please notify the sender immediately and then delete the message. If = you are not the intended recipient, you must not use, disclose, copy or = distribute this email. The views expressed in this e-mail are those of = the individual and not of Visit London. We reserve the right to read and = monitor any email or attachment entering or leaving our systems without = prior notice. =20 Please don't print this e-mail unless you really need to.