Shell comments: tomcat-general Linux technology-Linux technology and application information. For more information, see. Hello everyone, I have a problem. I want to start tomcat automatically now. I have created a file named tomcat under/etc/init. d as follows (the following content is an example of readhat4)
For more information, see chkconfig -- add tomcat on other websites. However, it cannot be added.
However, I found that I only need to add comments to delete chkconfig -- add tomcat.
Why ???
#! /Bin/bash
#
# Tomcat Starts Tomcat Java server.
#
#
# Chkconfig: 345 88 12
# Description: Tomcat is the server for Java servlet applications.
### BEGIN INIT INFO
# Provides: $ tomcat
### END INIT INFO
# Source function library.
./Etc/init. d/functions
Start (){
Echo-n $ "Starting Tomcat Java server :"
Daemon su-c/home/tomcat/tcstart. sh tomcat
Echo
Return $ RETVAL
}
Stop (){
Echo-n $ "Shutting down Tomcat Java server :"
Daemon su-c/home/tomcat/tcstop. sh tomcat
Echo
Return $ RETVAL
}
Restart (){
Stop
Start
}
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Restart | reload)
Restart
;;
*)
Echo $ "Usage: $0 {start | stop | restart }"
Exit 1
Esac
Exit $?
Here,/home/tomcat/is my installation path, and tcstart. sh tcstop. sh of the two files is available.
The following content can be deleted successfully.
### BEGIN INIT INFO
# Provides: $ tomcat
### END INIT INFO
Please leave a message
Online !!!
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