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

前端 未结 1 957
Happy的楠姐
Happy的楠姐 2020-12-12 04:47

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 page         


        
相关标签:
1条回答
  • 2020-12-12 05:04

    There are a couple of issues with your daemon:

    [Unit]
    Description = Yellow pages .NET service
    

    Remove spaces around equal sign:

    [Unit]
    Description=Yellow pages .NET service
    

    ExecStart needs an absolute path (hence the error):

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

    Your dotnet executable might be located elsewhere, although you can find out its absolute path by doing:

    $ which dotnet
    

    Whatever is returned would be the absolute path to use.

    0 讨论(0)
提交回复
热议问题