Dê uma olhada em journalctl -u mdc_freespace_vldy_fusion_node.service
.
Este serviço foi encerrado com 0. Há algo sobre o estado inicial de inicialização que o /usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node
não gostou.
Eu quero usar systemd
para fazer uma inicialização de serviço na inicialização. No entanto, recebo a mensagem dizendo que o serviço está inativo (inativo):
root@mdchost:/lib/systemd/system# systemctl status mdc_freespace_vldy_fusion_node.service
● mdc_freespace_vldy_fusion_node.service - MDC Freespace Vldy Fusion Node
Loaded: loaded (/lib/systemd/system/mdc_freespace_vldy_fusion_node.service; enabled; vendor preset:
Active: inactive (dead) since Sat 2018-08-04 01:06:48 BST; 5min ago
Process: 3841 ExecStartPost=/bin/bash /usr/bin/mdc/base/set_limit.sh FUSI mdc_freespace_vldy_fusion_
Process: 3838 ExecStart=/usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node (code=exited, status=0/SU
Process: 3090 ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/kinematics_dynamic
Process: 2266 ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/freespace_vldy_fus
Main PID: 3838 (code=exited, status=0/SUCCESS)
Mas posso fazer isso manualmente, executando o comando:
systemctl restart mdc_freespace_vldy_fusion_node.service
E agora o status do serviço se torna ativo (em execução):
root@mdchost:/lib/systemd/system# systemctl status mdc_freespace_vldy_fusion_node.service
● mdc_freespace_vldy_fusion_node.service - MDC Freespace Vldy Fusion Node
Loaded: loaded (/lib/systemd/system/mdc_freespace_vldy_fusion_node.service; enabled; vendor preset:
Active: active (running) since Sat 2018-08-04 01:29:31 BST; 1s ago
Process: 2065 ExecStartPost=/bin/bash /usr/bin/mdc/base/set_limit.sh FUSI mdc_freespace_vldy_fusion_
Process: 2017 ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/kinematics_dynamic
Process: 1991 ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/freespace_vldy_fus
Main PID: 2063 (mdc_freespace_v)
Tasks: 6
Memory: 3.5M
CPU: 469ms
CGroup: /system.slice/mdc_freespace_vldy_fusion_node.service
└─2063 /usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node
Aqui está o meu arquivo de serviço:
[Unit]
Description=My Node
Requires=start_roscore.service
After=start_roscore.service
[Service]
User=mdc
Group=mdc
Type=simple
KillMode=proces
Restart=on-failure
RestartSec=16
StartLimitInterval=0
EnvironmentFile=/usr/bin/mdc/base/env.cfg
EnvironmentFile=/usr/bin/mdc/ros/ros.cfg
ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/freespace_vldy_fusion_config.yaml
ExecStartPre=/opt/x86/ros/kinetic/bin/rosparam load /etc/mdc/fusion/kinematics_dynamics.yaml
ExecStart=/usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node
ExecReload=/usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node
ExecStartPost=/bin/bash /usr/bin/mdc/base/set_limit.sh FUSI mdc_freespace_vldy_fusion_node