创建npc.service文件
vim /etc/systemd/system/npc.service
内如如下:
[Unit]
Description=My NPC Service
After=network.target
[Service]
ExecStart=/usr/local/npc/npc -server=host:port -vkey=ugx9zttszac5p6s9 -type=tcp
Restart=always
[Install]
WantedBy=multi-user.target
启动命令
启动
systemctl start npc.service
查看状态
systemctl status npc.service
停止
systemctl stop npc.service
重启
systemctl restart npc.service
开机启动
systemctl enable npc.service
取消开机启动
systemctl disable npc.service