作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 VM 的 Ubuntu 18 中安装 Worker Service。当我使用以下命令时出现错误
sudo systemctl start myservice.service
错误:
● myservice.service - dummyservice in .NET Loaded: loaded
(/lib/systemd/system/myservice.service; disabled; vendor preset:
enabled) Active: failed (Result: exit-code) since Tue 2020-05-26
23:53:20 IST; 10min ago Process: 3634 ExecStart=/usr/bin/dotnet
/home/linux/bin/Downloads/myservice.dll (code=exited,
status=1/FAILURE)
May 26 23:53:19 arvind systemd[1]: Starting myservice in .NET... May
26 23:53:20 arvind dotnet[3634]: The user's home directory could not
be determined. Set the 'DOTNET_CLI_HOME' environment variable to spec
May 26 23:53:20 arvind systemd[1]: myservice.service: Control process
exited, code=exited status=1 May 26 23:53:20 arvind systemd[1]:
myservice.service: Failed with result 'exit-code'. May 26 23:53:20
arvind systemd[1]: Failed to start myservice in .NET.
这是我的.service文件
[Unit]
Description=my Service in .NET
# Requires=xyz.service
# After=xyz.service
[Service]
Type=forking
ExecStart=/usr/bin/dotnet /home/linux/Downloads/myService.dll
[Install]
WantedBy=multi-user.target
我该如何解决这个问题?
最佳答案
我已将 DOTNET_CLI_HOME
添加到 .service
文件
Environment=DOTNET_CLI_HOME=/temp
现在那个文件看起来像它了
[Unit]
Description=my Service in .NET
# Requires=xyz.service
# After=xyz.service
[Service]
Type=simple
ExecStart=/usr/bin/dotnet /home/linux/Downloads/myService.dll
Environment=DOTNET_CLI_HOME=/temp
[Install]
WantedBy=multi-user.target
关于.net - 如何将环境变量 'DOTNET_CLI_HOME' 添加到 .Net Systemd 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62039353/
我正在 VM 的 Ubuntu 18 中安装 Worker Service。当我使用以下命令时出现错误 sudo systemctl start myservice.service 错误: ● my
我是一名优秀的程序员,十分优秀!