Original link: Set up Derby to run as Linux self-booting service mode
Take a post on a blog
1. First create the Service/linux directory in the Derby package
2. Put the following file into it
Derbyservice, used to define Derby's home directory, monitor the machine IP and port
#!/bin/sh
derby_home=/home/kongxx/temp/db-derby-10.10.1.1-bin
derby_host=0.0.0.0
DERBY_PORT=1527 Case
"' in
start '
$DERBY _home/bin/startnetworkserver-h $DERBY _host-p $DERBY _port &
Break
;;
Stop)
$DERBY _home/bin/stopnetworkserver-p $DERBY _port
break
;;
Status)
$DERBY _home/bin/networkservercontrol ping-p $DERBY _port >/dev/null 2>&1
if ["$?" = "0"]; t Hen
echo "The Derby service is running."
Else
echo "Cannot find Derby service."
Fi
break
;;
*)
echo "Usage:/etc/init.d/derbyservice {start|stop|status}"
;;
Esac
create_rc.sh to create Linux RC scripts
#!/bin/sh
service_dir= ' dirname $
service_path= ' CD $SERVICE _dir; pwd '
cp $SERVICE _path/derbyservice/ etc/init.d/
remove_rc.sh to delete Linux RC scripts
#!/bin/sh
rm-f/etc/init.d/derbyservice
3. Test
Run create_rc.sh Create service
Running the remove_rc.sh removal service
Run "/etc/init.d/derbyservice {start|stop|status}" to start/stop/view status.