尝试在Ubuntu 16.04下运行asp .netcore应用时出现core-dump错误

时间:2019-09-10 11:05:49

标签: ubuntu asp.net-core .net-core coredump systemctl

我正在尝试在Ubuntu 16.04下将asp .net核心应用程序作为服务运行。 我已经根据this文档

创建了服务配置
[Unit]
Description=TNW Main Service

[Service]
WorkingDirectory=/home/tnw
ExecStart=/usr/bin/dotnet /home/tnw/Tnw.MealsApi.dll
Restart=always
RestartSec=10
SyslogIdentifier=tnw
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

我已启用我的服务:

sudo systemctl enable tnw.service

最后我尝试运行它,但是得到异常:

● tnw.service - TNW Main Service Loaded: loaded (/etc/systemd/system/tnw.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: core-dump) since Tue 2019-09-10 12:57:20 CEST; 118ms ago
Process: 15160 ExecStart=/usr/bin/dotnet /home/tnw/Tnw.MealsApi.dll (code=dumped, signal=ABRT)
Main PID: 15160 (code=dumped, signal=ABRT)

Sep 10 12:57:20 server767126 systemd[1]: tnw.service: Unit entered failed state.
Sep 10 12:57:20 server767126 systemd[1]: tnw.service: Failed with result 'core-dump'.

当我手动运行此应用程序时,它运行正常。

sudo dotnet Tnw.MealsApi.dll

//编辑我在日志中发现以下异常:

 System.Net.Sockets.SocketException (13): Permission denied

1 个答案:

答案 0 :(得分:0)

为此,请使用from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MailList(object): def setupUi(self, MailList): MailList.setObjectName("MailList") MailList.resize(647, 279) self.centralwidget = QtWidgets.QWidget(MailList) self.centralwidget.setObjectName("centralwidget") self.path = QtWidgets.QLineEdit(self.centralwidget) self.path.setGeometry(QtCore.QRect(50, 30, 511, 41)) self.path.setObjectName("path") self.browse = QtWidgets.QPushButton(self.centralwidget) self.browse.setGeometry(QtCore.QRect(450, 90, 112, 41)) self.browse.setObjectName("browse") MailList.setCentralWidget(self.centralwidget) self.retranslateUi(MailList) QtCore.QMetaObject.connectSlotsByName(MailList) def retranslateUi(self, MailList): _translate = QtCore.QCoreApplication.translate MailList.setWindowTitle(_translate("MailList", "MailList")) self.browse.setText(_translate("MailList", "Browse")) 文件夹保留您的Downloads。以下dll文件的配置

.service

根据您的情况,此路径[Unit] Description=MyService in .NET # Requires=xyz.service # After=xyz.service [Service] Type=simple ExecStart=/usr/bin/dotnet /home/linux/Downloads/MyService.dll [Install] WantedBy=multi-user.target 可以不同。

然后运行

/home/linux/Downloads/MyService.dll