Unit service is not loaded properly: Exec format error. on ubuntu18.04 creating .net service

扶醉桌前 提交于 2020-07-02 03:12:14

问题


I am trying to create a service to run by .net application on ubuntu 18.04.

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
~

I have my application on /home/yp_app.

when I run:systemd start YellowPages.service I get Excess arguments.

so I tried with: systemctl start YellowPages.service I get

 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.

When I look into cat /var/log/syslog

I could see

systemd[1]: /lib/systemd/system/YellowPages.service:7: Executable path is not 
absolute: dotnet /home/yp_app/YellowPages.dll

I am new to Linux I am wondering where I am wrong. Could anyone help me with this?

来源:https://stackoverflow.com/questions/62671161/unit-service-is-not-loaded-properly-exec-format-error-on-ubuntu18-04-creating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!