我在debian squeeze上运行tomcat 7.0.42。如何设置Tomcat以在启动时启动
感谢您的帮助
答案 0 :(得分:0)
我认为这是最简单的版本。只需更改Tomcat路径并将其复制到/etc/init.d。
#!/bin/bash
### BEGIN INIT INFO
# Provides: Apache Tomcat Server
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start:
# Should-Stop:
# Short-Description: Starts the Tomcat Server.
### END INIT INFO
TOMCAT_HOME=[PATH-TO-TOMCAT-DIR]
case "$1" in
start)
echo "Starting Tomcat Server ..."
$TOMCAT_HOME/bin/startup.sh
;;
stop)
echo "Stopping Tomcat Server ..."
$TOMCAT_HOME/bin/shutdown.sh
;;
*)
echo "Usage: /etc/init.d/tomcat {start|stop}"
exit 1
;;
esac
exit 0