gpt4 book ai didi

.net - 在 ubuntu 18.4 上为 .net 应用程序创建服务期间出错。可执行路径不是绝对的 :

转载 作者:行者123 更新时间:2023-12-04 18:43:57 25 4
gpt4 key购买 nike

我正在尝试为我的 .net 运行命令创建服务。
cd/lib/systemd/system/YellowPages.service

[Unit]
Description = Yellow pages .NET service

[Service]
Type=forking
WorkingDirectory=/home
ExecStart=dotnet /home/yp_app/YellowPages.dll

[Install]
WantedBy=multi-user.target
我在/home/yp_app 上有我的应用程序。
当我运行时:systemd 启动 YellowPages.service
我明白了
多余的论据。
所以我尝试了: systemctl start YellowPages.service
我明白了
   Failed to start YellowPages.service: Unit YellowPages.service is not loaded properly: Exec format error.
See system logs and 'systemctl status YellowPages.service' for details.
当我查看 cat/var/log/syslog
我能看见
systemd[1]: /lib/systemd/system/YellowPages.service:7: Executable path is not 
absolute: dotnet /home/yp_app/YellowPages.dll
我是 Linux 新手,我想知道我错在哪里。
谁能帮我解决这个问题?

最佳答案

根据手册,ExecStart必须是可执行文件的绝对路径。但是,您只是在使用 dotnet ,只需将其更改为:

ExecStart=/[path]/dotnet  /home/yp_app/YellowPages.dll
更多信息,您可以引用 https://www.freedesktop.org/software/systemd/man/systemd.service.html

关于.net - 在 ubuntu 18.4 上为 .net 应用程序创建服务期间出错。可执行路径不是绝对的 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62674662/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com