Linux开机启动指定服务(Tomcat、Openfire)
近期需要在centos中开机启动Openfire,正常的思路是在/etc/rc.local添加启动脚本,效果如下
/home/user/openfire-3.7.1/bin/openfire start
结果报错如下,主要是环境变量在root用户下没有配置。
No suitable Java Virtual Machine could be found on your system. The version of the JVM must be at least 1.5. Please define INSTALL4J_JAVA_HOME to point to a suitable JVM. You can also try to delete the JVM cache file /root/.install4j
解决思路:
在user用户下新增启动脚本/home/user/openfire-3.7.1/bin/start.sh, 然后在/etc/rc.local中,添加使用制定用户运行脚本
/etc/rc.local文件中添加脚本如下:
su - user-c /home/user/openfire-3.7.1/bin/start.sh
/home/user/openfire-3.7.1/bin/start.sh文件内容如下:
#/home/user/openfire-3.7.1/bin/start.sh /home/user/openfire-3.7.1/bin/openfire start
相关推荐
tsolin 2013-07-13
daveztong 2011-05-22
XPY 2013-12-26
HelloC先生 2017-10-03
老谢的自留地 2011-02-11
youmuontheway 2018-01-09
WilliamLin 2013-04-30
lovelily 2011-10-30
fengyun0 2016-07-04
紫川琴秀 2013-07-25
88447616 2013-06-12
阿赞 2012-03-26
ahbbwangpei 2013-06-29
小网管 2013-06-24
lzqlawrence 2013-06-15
zhaojp0 2019-06-21
卷确 2015-08-20