coding cci-agent服务

启用服务文件

vim /lib/systemd/system/cci-agent.service

填写内容

[Unit]
Description=cci-agent
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/root/cci-agent up -d
ExecStop=/root/cci-agent stop

[Install]
WantedBy=multi-user.target

设置开机启动

systemctl enable cci-agent.service 
systemctl daemon-reload

测试

systemctl start cci-agent.service
systemctl status cci-agent.service

推荐阅读更多精彩内容