java service wrapper 在linux下实现jar用服务启动
br />#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=WebAPFWonline Service \\看英文 名字
#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
# using this configuration file has been installed as a service.
# Please uninstall the service before modifying this section. The
# service can then be reinstalled.
# Name of the service
wrapper.ntservice.name=Servername \\服务名
# Display name of the service
wrapper.ntservice.displayname=Servername Service \\显示的服务名
# Description of the service
wrapper.ntservice.description=Servername Service \\服务描述
# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=
# Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START //自动启动
# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false
把ln -s /usr/asc/Servername /etc/init.d
注意( /usr/asc/Servername一定要全路径,否则是一个复制的是个无效文件)
/etc/init.d/Appserver start 这样就可以了 测试了
注意:
如果我把wrapper.java.command=%JAVA_HOME%/bin/java
写成系统jdk的全路径 /usr/java/jdk/bin/java
那么 /usr/asc路径下 运行 ./Appserver start 是可以的
其他路径下 运行 service Appserver start 也可以运行.
估计service这个命令 不给他指定JAVA_HOME 可能读不到JAVA_HOME了
这个我也不太清楚
(service Appserver start 会出现
Unable to locate any of the following binaries:
/etc/rc.d/init.d/./wrapper-linux-x86-32
/etc/rc.d/init.d/./wrapper-linux-x86-64
/etc/rc.d/init.d/./wrapper 错误)
或者无法启动jvm(service Appserver console中提示)
推荐文章 |
