案例
lighthouse@.service
[Unit] Description=Lighthouse %i After=network.target [Service] Type=simple User=root Group=root WorkingDirectory=/home/s/apps Environment="CONSUL_HTTP_TOKEN=er-34-34fd-34-fd" ExecStart=/home/s/apps/lighthouse %i -c config.hcl Restart=always [Install] WantedBy=multi-user.target
启动命令
systemctl restart lighthouse@web
systemctl status lighthouse@web
查看启动日志
查看后 50 行。
journalctl -u lighthouse@web.service -n 50
末尾持续度
journalctl -u lighthouse@web.service -f
已启动的所有systemd-service
systemctl list-units --type=service | grep web