首先需要创建一个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,守护 From: https://blog.51cto.com/u_13128132/6096459