我安装了一个服务来启动jasper报告服务器.我相信它是正确的设置.
原文链接:https://www.f2er.com/centos/373812.html这是位于/etc/init.d/jasperserver中的启动脚本
#!/bin/sh ### BEGIN INIT INFO # Provides: jasperserver # required-Start: # required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start JasperServer at boot time # Description: Enable service provided by JasperServer. ### END INIT INFO JASPER_HOME="/opt/jaspersoft/jasperreports-server-5.5" case "$1" in start) if [ -f $JASPER_HOME/ctlscript.sh ]; then echo "Starting JasperServer" sudo -u ec2-user $JASPER_HOME/ctlscript.sh start fi ;; stop) if [ -f $JASPER_HOME/ctlscript.sh ]; then echo "Stopping JasperServer" sudo -u ec2-user $JASPER_HOME/ctlscript.sh stop fi ;; restart) if [ -f $JASPER_HOME/ctlscript.sh ]; then echo "Restarting JasperServer" sudo -u ec2-user $JASPER_HOME/ctlscript.sh restart fi ;; status) if [ -f $JASPER_HOME/ctlscript.sh ]; then sudo -u ec2-user $JASPER_HOME/ctlscript.sh status fi ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 ;; esac
另外,我运行命令
sudo chmod +x /etc/init.d/jasperserver
然后我运行了命令
sudo chkconfig --add jasperserver sudo chkconfig jasperserver on
如果我跑:
chkconfig --list | grep jasper
我知道了:
jasperserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
我也可以运行:
sudo service jasperserver (start|stop|restart)
顺利
但是,当我发出重新启动时,该服务未运行.我想知道是否有一种方法可以获取日志信息或启用日志记录以解决此问题.
更多详情
uname -a Linux jaspersoft.localdomain 3.10.42-52.145.amzn1.x86_64 #1 SMP Tue Jun 10 23:46:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
在添加行之后:
# chkconfig: 2345 70 30
符号链接如下:
[ec2-user@jaspersoft ~]$ls -laF /etc/rc.d/rc3.d/*jasper* lrwxrwxrwx 1 root root 22 Aug 6 08:09 /etc/rc.d/rc3.d/S70jasperserver -> ../init.d/jasperserver*
同样适用于/etc/rc.d/rc[2-5].d/jasper