命令行后台运行:
nohup /usr/local/soft/chfs/chfs --file /usr/local/soft/chfs/chfs.ini &
重新加载systemctl配置
systemctl daemon-reload
允许开机启动
systemctl enable chfs.service
systemctl方式启动
systemctl start chfs.service
systemctl方式重启
systemctl restart chfs.service
systemctl方式停止
systemctl stop chfs.service
systemctl disable chfs.service
查看状态
systemctl status chfs.service
chfs.service脚本:
[Unit]
Description=CHFS Service
After=network.target
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/soft/chfs/chfs --file=/usr/local/soft/chfs/chfs.ini
ExecReload=
ExecStop=
[Install]
WantedBy=multi-user.target