systemd
부팅 시 서비스를 시작하는 데 사용하고 싶습니다 . 하지만 서비스가 비활성(죽음)이라는 메시지를 받았습니다.
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)
하지만 다음 명령을 실행하여 수동으로 시작할 수 있습니다.
systemctl restart mdc_freespace_vldy_fusion_node.service
이제 서비스 상태가 활성(실행 중)으로 변경됩니다.
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
이것은 내 서비스 파일입니다.
[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
답변1
보세요 journalctl -u mdc_freespace_vldy_fusion_node.service
.
서비스가 0으로 종료되었습니다. 초기 시동 상태에는 뭔가 마음에 들지 않는 부분이 있습니다 /usr/bin/mdc/fusion/mdc_freespace_vldy_fusion_node
.