【systemctl】让程序以守护进程的方式在后台运行
作者:互联网
首先需要创建一个systemd unit 配置文件,比如:verdaccio.service,一般放在 /lib/systemd/system/ 下
添加配置如下:
[Unit]
Description=Verdaccio lightweight npm proxy registry
[Service]
Type=simple
Restart=on-failure
User=verdaccio
ExecStart=/usr/bin/verdaccio --config /etc/verdaccio/config.yaml
[Install]
WantedBy=multi-user.target
开机自启动:
systemctl enable verdaccio.service
立即启动:
systemctl start verdaccio.service
重新启动:
systemctl restart verdaccio.service
运行状态:
systemctl status verdaccio.service
标签:systemd,自启动,service,verdaccio,systemctl,后台,config,守护 来源: https://blog.csdn.net/for_cxc/article/details/116331662