使用VM装了个CentOS8,想着装个Tomcat玩一下,照着网上教程装好了,配置完了启动报错,报错的字串忘记截图了,借用下别人的
[root@CentOS8 ~]# journalctl -xe
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- tomcat.service 单元已结束停止操作。
11月 15 10:44:43 openbravo systemd[1]: Starting Apache Tomcat Web Application Container...
-- Subject: tomcat.service 单元已开始启动
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- tomcat.service 单元已开始启动。
11月 15 10:44:43 openbravo systemd[14925]: tomcat.service: Failed to execute command: Permission denied
11月 15 10:44:43 openbravo systemd[14925]: tomcat.service: Failed at step EXEC spawning /opt/tomcat/bin/startup.sh>
-- Subject: 进程 /opt/tomcat/bin/startup.sh 无法执行
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- 进程 /opt/tomcat/bin/startup.sh 无法被执行并已失败。
--
-- 该进程返回的错误代码为 13。
11月 15 10:44:43 openbravo systemd[1]: tomcat.service: Control process exited, code=exited status=203
11月 15 10:44:43 openbravo systemd[1]: tomcat.service: Failed with result 'exit-code'.
11月 15 10:44:43 openbravo systemd[1]: Failed to start Apache Tomcat Web Application Container.
-- Subject: tomcat.service 单元已失败
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- tomcat.service 单元已失败。
--
-- 结果为“RESULT”。
11月 15 10:44:43 openbravo setroubleshoot[14916]: SELinux is preventing /usr/lib/systemd/systemd from execute acce>
11月 15 10:44:43 openbravo platform-python[14916]: SELinux is preventing /usr/lib/systemd/systemd from execute acc>
***** Plugin catchall (100. confidence) suggests **********>
If you believe that systemd should be allowed execute access o>
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c '(artup.sh)' --raw | audit2allow -M my-artupsh
# semodule -X 300 -i my-artupsh.pp
根据提示执行了命令:
# ausearch -c '(artup.sh)' --raw | audit2allow -M my-artupsh
# semodule -X 300 -i my-artupsh.pp
但是还是没用,查了半天资料还是没啥效果,最后想着JAVA-HOME,没配置,配置一下,结果配置了一下,再启动,就行了
虽然可以了,但是还没弄清楚原因,之前弄了半天结果是java-home未配置的问题