Set up Derby to run the Linux self-booting service __linux

Source: Internet
Author: User

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.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.