Set the default boot for resin under Linux

Source: Internet
Author: User

The first way:

Add a startup script under/etc/init.d/

#vi resin.sh

#!/bin/sh#chkconfig:345 10#description:auto start Resin#/etc/init.d/resin.shexport export java_home=/usr/java/ Jdk1.7export classpath= $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/libexport path= $JAVA _home/bin: $JAVA _home/jre/bin        : $PATH: $HOME/binretval=0resin_path=/usr/local/resin/bin/httpd.shstart () {if [-f $RESIN _path];                Then echo $ "Starting Resin" $RESIN _path start retval=$?        echo "OK" return $RETVAL fi}stop () {if [-f $RESIN _path];                Then echo $ "stopping Resin" $RESIN _path stop retval=$? Sleep 1 echo "OK" return $RETVAL fi}case "$" instart) start; stop) stop;; Restart) echo $ "Restarting Resin" $ stop sleep 1 $ start; *) echo $ "Usage:$0{start|stop|restart}" exit 1;; Esacexit $RETVAL

Save Exit

#chmod u+x resin.sh

#chkconfig--add resin.sh

#service resin.sh Start

#service resin.sh Stop off

The second method:

# vi/usr/local/resin/bin/httpd.sh

The original

Java code

If Test-n "${java_home}"; Then  if Test-z "${java_exe}", then    java_exe= $JAVA _home/bin/java  Fifi

instead

Java code

If Test-n "${java_home}"; Then  if Test-z "${java_exe}", then    java_exe= $JAVA _home/bin/java  fielse    java_exe=/usr/ Java/jdk1.7/bin/java fi

Save Exit

#切换到

/ETC/INIT.D below

#ln-S/usr/local/resin/bin/httpd.sh httpd

#chmod u+x httpd

#chkconfig--add httpd

#service httpd Start

#service httpd Stop off

Remove default boot with Chkconfig--del httpd

Set the default boot for resin under Linux

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.