我做了Spring文档中的所有事情来在AWS上部署我的应用程序。但是得到了一个错误:
deploy-demo.service: Failed at step EXEC spawning /opt/deploy-demo/deploy-demo.jar: Exec format error
Sep 07 21:22:10 ip-172-31-45-166 systemd[1]: deploy-demo.service: Main process exited, code=exited, status=203/EXEC
字符串
我的deploy-demo.service文件位于/etc/systemd/system/deploy-demo.service中,其中包含以下设置:
[Unit]
Description=deploy-demo
After=syslog.target
[Service]
User=gitlab-runner
ExecStart=/opt/deploy-demo/deploy-demo.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
型deploy-demo.jar
和deploy-demo.conf
位于/opt/deploy-demo/
中
deploy-demo.conf文件包含
RUN_ARGS="--spring.datasource.url=jdbc:postgresql://here_is_should_be_my_host:5432/helpfast --spring.datasource.username=postgres --spring.datasource.password=adminadmin"
型
所有权限在我看来都是正确的:
drwxr-xr-x 2 gitlab-runner gitlab-runner 4096 Sep 7 21:21 ./
drwxr-xr-x 3 root root 4096 Sep 7 20:31 ../
-r-------- 1 gitlab-runner gitlab-runner 200 Sep 7 21:21 deploy-demo.conf
-r-x------ 1 gitlab-runner gitlab-runner 42645024 Sep 7 20:31 deploy-demo.jar*
型
任何想法都非常赞赏!
1条答案
按热度按时间gudnpqoy1#
在deploy-demo.service中更改了两行,问题解决了。
字符串