我添加了一个脚本文件
#!/bin/bash
if ! (ps aux | grep evercam_media/bin/evercam_media | grep -v grep > /dev/null); then
/opt/evercam_media/bin/evercam_media start
fi
并将其保存在/usr/local/bin/run_evercam_media.sh
路径中..
我创建了一个非常简单的systemD单元文件
[Unit]
Description=Evercam
[Service]
ExecStart=/usr/local/bin/run_evercam_media.sh
[Install]
WantedBy=default.target
我也启用了它。但是,当我开始它时,什么也没发生。我只是在systemctl status evercam.service
● evercam.service - Evercam
Loaded: loaded (/etc/systemd/system/evercam.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2017-07-18 14:10:08 CEST; 167ms ago
Process: 7329 ExecStart=/usr/local/bin/run_evercam_media.sh (code=exited, status=0/SUCCESS)
Main PID: 7329 (code=exited, status=0/SUCCESS)
你能指出这里有什么问题吗?