#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
export JAVA_HOME=/usr/local/jdk
su jaychang -c "/usr/local/tomcat/bin/startup.sh"
exit 0
本文介绍了一种在系统启动时自动运行Tomcat的方法。通过设置rc.local脚本,指定JAVA_HOME环境变量,并使用su命令切换到特定用户来启动Tomcat服务。此方法适用于需要在多用户环境下自动启动应用服务器的场景。
4276

被折叠的 条评论
为什么被折叠?



