没找到官方文档,但是具体使用可参考 systemd的unit配置文件详解 - 知乎
1. 在/etc/system/system位置下创建xxx.service文件
vi /etc/system/system/tomcat.service
2.配置文件内容为(ExecStart中的内容根据实际情况写)
[Unit]
Description=nginx service
[Service]
ExecStart=/usr/local/nginx/sbin/nginx
[Install]
WantedBy=multi-user.target
3.命令
○ 设置开机启动
■ systemctl enable **
○ 关闭开机启动
■ systemctl disable **
○ 启动
■ systemctl start **
○ 停止
■ systemctl stop **
○ 重启
■ systemctl restart **