代码=倾倒,单= ABRT尝试运行dotnet core应用程序作为ubuntu中的服务

发布于 2025-02-11 19:45:36 字数 1220 浏览 1 评论 0原文

我有简单的控制台应用程序,我想在Ubuntu中运行应用程序。 我已经创建了.service /etc/etc/systemd/systemd/systemd/code>文件夹helloworld.service如下所示,

[Unit]
Description=HelloWorld Application
[Service]
ExecStart=/usr/share/dotnet/dotnet  /home/prasadg/HelloWorld/dev/HelloWorld.dll

SyslogIdentifier=HelloWorld

Restart=always

RestartSec=5

[Install]
WantedBy=multi-user.target

我保存了文件,我将重新加载守护程序带有命令 systemctl守护程序 - 重新加载

然后我已经启动了新创建的服务systemctl start helloworld

它开始了,没有发生任何事情,一段时间后,当我使用命令systemctl status status status status status status status status helloworld显示错误如下,

HelloWorld.service - HelloWorld Application
   Loaded: loaded (/etc/systemd/system/HelloWorld.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: core-dump) since Tue 2022-06-28 21:20:13 IST; 4s ago
  Process: 28389 ExecStart=/usr/share/dotnet/dotnet /home/prasadg/HelloWorld/dev/HelloWorld.dll (code=dumped, signal=ABRT)
 Main PID: 28389 (code=dumped, signal=ABRT)

如果尝试直接使用命令运行为/usr/share/dotnet/dotnet/home/prasadg/helledorld/dev/helledorld.dll.dll它成功运行

I have simple console application, I want to run application as service in ubuntu.
I have created .service file in /etc/systemd/system folder HelloWorld.service as below

[Unit]
Description=HelloWorld Application
[Service]
ExecStart=/usr/share/dotnet/dotnet  /home/prasadg/HelloWorld/dev/HelloWorld.dll

SyslogIdentifier=HelloWorld

Restart=always

RestartSec=5

[Install]
WantedBy=multi-user.target

after I saved file I have reload daemon with command
systemctl daemon-reload

then I have started newly created service systemctl start HelloWorld

it get started and nothing happens, after sometime, when I checked status using command systemctl status HelloWorld it shows error as below

HelloWorld.service - HelloWorld Application
   Loaded: loaded (/etc/systemd/system/HelloWorld.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: core-dump) since Tue 2022-06-28 21:20:13 IST; 4s ago
  Process: 28389 ExecStart=/usr/share/dotnet/dotnet /home/prasadg/HelloWorld/dev/HelloWorld.dll (code=dumped, signal=ABRT)
 Main PID: 28389 (code=dumped, signal=ABRT)

if try run directly with command as /usr/share/dotnet/dotnet /home/prasadg/HelloWorld/dev/HelloWorld.dll it runs successfully

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

比忠 2025-02-18 19:45:37

完整的日志消息将有所帮助,但我想您需要添加 workingDirectory 到您的helloworld.service

A full log message would help more, but I guess you need to add a WorkingDirectory to your HelloWorld.service.

枫以 2025-02-18 19:45:37

从我这边,我必须从工作目录中删除所有现有的二进制文件,然后重新发布并将所有新的二进制文件复制到工作目录。
并停止并再次开始过程。
运行良好。 ^^

From my side, I must delete all existing binary files from Working Directory, then re-publish and copy all new binary files to Working Directory.
And stop and start the process again.
It's working well. ^^

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文