gpt4 book ai didi

ubuntu - Systemd 脚本抛出错误设置

转载 作者:行者123 更新时间:2023-12-04 19:24:47 33 4
gpt4 key购买 nike

我尝试使用 nohup 在生产环境中运行节点应用程序。
下面是我的脚本文件、服务文件和错误报告

hemant@zero-ui:/etc/systemd/system$ cat /home/hemant/zeroui.sh 
#!/bin/bash
sudo -i
cd zero-ui
nohup yarn dev &
cd

hemant@zero-ui:/etc/systemd/system$ cat zeroui.service
[service]
Type=forking
ExecStart=/home/hemant/zeroui.sh
RemainAfterExit=yes

hemant@zero-ui:/etc/systemd/system$ sudo systemctl start zeroui
Failed to start zeroui.service: Unit zeroui.service has a bad unit file setting.
See system logs and 'systemctl status zeroui.service' for details.

hemant@zero-ui:/etc/systemd/system$ systemctl status zeroui.service
● zeroui.service
Loaded: bad-setting (Reason: Unit zeroui.service has a bad unit file setting.)
Active: inactive (dead)

May 09 06:43:31 zero-ui systemd[1]: /etc/systemd/system/zeroui.service:1: Unknown section 'service'. Ignoring.

最佳答案

错误消息告诉您问题所在:

May 09 06:43:31 zero-ui systemd[1]: /etc/systemd/system/zeroui.service:1: Unknown section 'service'. Ignoring.
你有 [service]在您的服务文件中,而不是 [Service] (区分大小写)

关于ubuntu - Systemd 脚本抛出错误设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72167985/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com