代码=倾倒,单= ABRT尝试运行dotnet core应用程序作为ubuntu中的服务
我有简单的控制台应用程序,我想在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 commandsystemctl 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
完整的日志消息将有所帮助,但我想您需要添加 workingDirectory 到您的
helloworld.service
。A full log message would help more, but I guess you need to add a WorkingDirectory to your
HelloWorld.service
.从我这边,我必须从工作目录中删除所有现有的二进制文件,然后重新发布并将所有新的二进制文件复制到工作目录。
并停止并再次开始过程。
运行良好。 ^^
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. ^^