You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Chris Wareham <cw...@visitlondon.com> on 2008/09/09 18:14:29 UTC

Re: Derby init script for Linux / Unix (SOLVED)

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=/home/web
DERBY_USER=web

derby_start () {
     su -l $DERBY_USER -c "$DERBY_HOME/bin/start_derby > 
$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
 
Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR
 
Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753

 
www.visitlondon.com   
 
   
       Save the date for the Visit London Awards 2008! 
      Thursday 27th November, Royal Albert Hall.

  
 
 
 
 
'Visit London Limited' is registered in England under No.761149;
Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.
 

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.
 
  Please don't print this e-mail unless you really need to.