Jenkins安装目录为 /usr/local/jenkins-tomcat/
添加文档
/usr/lib/systemd/system/jenkins.service
[Unit]Description``=``jenkinsAfter``=``network.target[Service]Type``=``forking#PIDFile=/usr/local/tomcat/tomcat.pidExecStart``=``/``usr``/``local``/``jenkins``-``tomcat``/``bin``/``startup.shExecReload``=ExecStop``=``/``usr``/``local``/``jenkins``-``tomcat``/``bin``/``shutdown.shPrivateTmp``=``true[Install]WantedBy``=``multi``-``user.target
重新导入systemctl
systemctl daemon-reload
手动关闭jenkins然后使用systemctl启动并且添加至自启动
/usr/local/jenkins-tomcat/bin/shutdown.sh
systemctl start jenkins
systemctl enable jenkins
