Tomcat SonarQube Gerrit 设置 systemd 服务

Tomcat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# /usr/lib/systemd/system/tomcat.service
[Unit]
Description=Tomcat
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/tomcat/bin/startup.sh
ExecStop=/usr/local/tomcat/bin/shutdown.sh
ExecReload=/bin/kill -s HUP $MAINPID
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

SonarQube

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# /usr/lib/systemd/system/sonar.service
[Unit]
Description=SonarQube
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/sonarqube-7.5/bin/linux-x86-64/sonar.sh start
ExecStop=/usr/local/sonarqube-7.5/bin/linux-x86-64/sonar.sh stop
ExecReload=/usr/local/sonarqube-7.5/bin/linux-x86-64/sonar.sh restart
User=sonar
Group=sonar

[Install]
WantedBy=multi-user.target
Alias=sonarqube

Gerrit Code Review

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# /usr/lib/systemd/system/gerrit.service
[Unit]
Description=Gerrit Code Review
After=network.target httpd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/review_site/bin/gerrit.sh start
ExecStop=/usr/local/review_site/bin/gerrit.sh stop
ExecReload=/usr/local/review_site/bin/gerrit.sh restart

[Install]
WantedBy=multi-user.target
-------------本文结束感谢您的阅读-------------
请站长喝杯咖啡吧´◡`