我正在使用Suse 12 SP1,并尝试使用systemd脚本在SO启动时启动WebSphere Application Server。 如果我手动运行它,它可以很好地工作,但是当使用systemd运行时,它没有。
以下是我在SO启动时使用的脚本。
ibmbpm.service
[Unit]
Description=IBM Business Process Management
[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStart=/opt/ibm/startBPM.sh
[Install]
WantedBy=multi-user.target
startBPM.sh
#!/bin/bash
/opt/ibm/BPM/v8.5/profiles/Node1Profile/bin/startNode.sh
/opt/ibm/BPM/v8.5/profiles/Node1Profile/bin/startServer.sh SingleClusterMember1
我用systemctl status命令检查了服务的状态,这里是输出
systemctl status ibmbpm.service -l </ strong>
ibmbpm.service - IBM Business Process Management
Loaded: loaded (/etc/systemd/system/ibmbpm.service; enabled)
Active: active (exited) since Thu 2016-11-17 09:06:37 BRST; 33min ago
Process: 2887 ExecStart=/opt/ibm/startBPM.sh (code=exited, status=0/SUCCESS)
Main PID: 2887 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/ibmbpm.service
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:282)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EFactory
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at java.net.URLClassLoader.findClass(URLClassLoader.java:600)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:243)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:777)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at java.lang.ClassLoader.loadClass(ClassLoader.java:754)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:134)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at java.lang.ClassLoader.loadClass(ClassLoader.java:731)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: at java.lang.ClassLoader.defineClassImpl(Native Method)
Nov 17 09:06:37 bpm857 startBPM.sh[2887]: ... 31 more
如上面的日志所示,当它尝试启动服务器时发生了错误,但我真的不明白发生了什么,因为以root身份手动运行(/opt/ibm/startBPM.sh一切正常。
我真的很感激任何帮助。
答案 0 :(得分:0)
我找到了解决方案。如果您遇到同样的问题,请查看https://ranierimazili.wordpress.com/2016/11/18/starting-websphere-as-a-systemd-service/
上的解决方案