/etc/init.d với nội dung như sau.
#!/bin/bash#
# chkconfig: 2345 85 15
# description: jira
# processname: jira
# source function library
. /etc/init.d/functions
JAVA_HOME="/app/jdk"
JRE_HOME="/app/jdk"
CATALINA_HOME="/app/jira"
RETVAL=0
start() {
echo -n $"Starting jira services: "
. /app/jira/bin/catalina.sh start
RETVAL=$?
echo
}
stop() {
echo -n $"Shutting down jira services: "
. /app/jira/bin/catalina.sh stop
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
status)
status jira
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
Tiếp tới bạn vào thư mục
/etc/init.d
# cd /etc/init.d
Cấp quyền execute
# chmod a+x jira
Thêm nó vào danh sách chkconfig:
# chkconfig --add jira
Ok rồi
Bạn có thể test thử
start
# /etc/init.d/jira start
stop
# /etc/init.d/jira stop
restart
# /etc/init.d/jira restart
No comments:
Post a Comment