centos 8 sonarqube 设置开机自启动解决方案


编写开机自启动脚本

进入到开机自启动调用文件目录

vim /etc/systemd/system/sonarqube.service
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
//根据自己安装目录的启动路径填写
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
//填写启动sonarqube的授权用户和用户组
User=sonar_user
Group=sonar_user
Restart=always
//linux启动调优
LimitNOFILE=65536
LimitNPROC=10240
[Install]
WantedBy=multi-user.target

image

启用服务器重启后自动启动 sonarqube 服务

[root@Sonnarqube-dev ~]# systemctl enable sonarqube.service

查看开机自启动服务列表

[root@Sonnarqube-dev ~]# systemctl list-unit-files

image

查看sonarqube的开机自启动服务

[root@Sonnarqube-dev ~]# systemctl status sonarqube.service -l

image

重启测试

[root@Sonnarqube-dev ~]#reboot

等待片刻后查看进程

[root@Sonnarqube-dev ~]# ss -ltn

image

查看网页

image
至此开机自启动设置成功。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM