Yocto systemd服务脚本问题

Yocto systemd服务脚本问题

我有一个 C 代码,我将其保留systemd在启动时启动。重新启动后,它成功启动,但一段时间后,它被杀死并再次成功启动,因为类型集正在分叉。错误日志

● mqtt_to_REST.service - TCUP MQTT to RESTful connector
   Loaded: loaded (/lib/systemd/system/mqtt_to_REST.service; enabled)
   Active: activating (auto-restart) (Result: timeout) since Wed 2015-04-08 12:19:18 UTC; 648ms ago
  Process: 289 ExecStart=/usr/bin/sim (code=killed, signal=TERM)

Apr 08 12:19:18 edison systemd[1]: Failed to start TCUP MQTT to RESTful connector.
Apr 08 12:19:18 edison systemd[1]: Unit mqtt_to_REST.service entered failed state.

启动脚本:

[Unit]
Description=TCUP MQTT to RESTful connector
#Documentation=NA
#DefaultDependencies=no
#Before=xdk-daemon.service
#After=mqtt.service

[Service]
Type=forking
ExecStart=/usr/bin/sim
#ExecStart=/home/root/jsmn/example/sim /dev/null 2>&1
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=10
#WatchdogSec=1min

[Install]
WantedBy=multi-user.target

那么问题到底出在哪里呢?

相关内容