在 ubuntu 20.04 中启动时的自定义脚本失败

问题描述

我正在尝试使用以下方法custom shell script 上启动时运行 daemon fileUbuntu-20.04-LTS

$ sudo nano /etc/systemd/system/custom-startup.service
            
[Unit]
Description=Custom Startup
            
[Service]
ExecStart=/home/test/Folder-1/tools/project/custom.sh
ExecStart=/home/test/Folder-1/tools/project/daemon-linux
            
[Install]
WantedBy=multi-user.target
            
            
$ sudo systemctl daemon-reload
$ sudo systemctl enable custom-startup.service
            
$ sudo systemctl start custom-startup.service
    
Failed to start custom-startup.service: Unit custom-startup.service has a bad unit file setting.
See system logs and 'systemctl status custom-startup.service' for details.
            
$ sudo systemctl status custom-startup.service
● custom-startup.service - Custom Startup
Loaded: bad-setting (Reason: Unit custom-startup.service has a bad unit file setting.)
Active: inactive (dead)
            
Jan 13 13:17:59 Marketing systemd[1]: custom-startup.service: Service has more than one ExecStart= setting,which is only allo>
Jan 13 13:30:55 Marketing systemd[1]: custom-startup.service: Service has more than one ExecStart= setting,which is only allo>
Jan 13 13:32:28 Marketing systemd[1]: custom-startup.service: Service has more than one ExecStart= setting,which is only allo>
Jan 13 13:36:29 Marketing systemd[1]: custom-startup.service: Service has more than one ExecStart= setting,which is only allo>

我不能运行多个 ExecStart?即使使用单个 ExecStart 它也不起作用。任何纠正配置的指针都会有所帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)