summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authordNhax2018-02-18 10:10:15 +0100
committerdNhax2018-02-18 10:10:15 +0100
commit7c5aa43bfd98842d66c3650c3a62eb93b36197e1 (patch)
tree56f329d2141fd237f094d3d58643597c1f22f353
parent9035c85cb95e6c9218f6453d17450ae289676e9b (diff)
downloadaur-7c5aa43bfd98842d66c3650c3a62eb93b36197e1.tar.gz
Added example configuration for required sysctl values
-rw-r--r--.SRCINFO6
-rw-r--r--99-sonarqube.conf3
-rw-r--r--PKGBUILD13
-rw-r--r--sonarqube.install8
-rw-r--r--sonarqube.service2
5 files changed, 26 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 08f6845d2144..6b928dcaca2e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = sonarqube
pkgdesc = An open source platform for continuous inspection of code quality
pkgver = 7.0
- pkgrel = 2
+ pkgrel = 3
url = http://www.sonarqube.org/
install = sonarqube.install
arch = x86_64
@@ -20,10 +20,12 @@ pkgbase = sonarqube
source = sonarqube.service
source = sonarqube-tmpfile.conf
source = sonarqube-user.conf
+ source = 99-sonarqube.conf
sha256sums = 263942458279e2cf73fd86671511ac8ef0707e41ed51c9737142f8738bc7c060
- sha256sums = cb3e3e810892e4d7ccf7a843ae1cb7daa14e3395025d0cc505b562f45e4f1ee9
+ sha256sums = 1aeefc9db232d13a3139a27af308e30df72c8c9fd631f713e317e1ab18a24d77
sha256sums = 6e024de469ebb1bc4083274412f0a5d68d5fa511c2139ce4cb1d243c51ff9535
sha256sums = 43ff10bbb495827e952225dce79da79bb800627eaa6f1d933f8f7fb408aafe6d
+ sha256sums = 682b3ab19eee18b39453fa2e99af89ba7e4ecb0f63dcebf137e65aa225a42e68
pkgname = sonarqube
diff --git a/99-sonarqube.conf b/99-sonarqube.conf
new file mode 100644
index 000000000000..2aa402b2d337
--- /dev/null
+++ b/99-sonarqube.conf
@@ -0,0 +1,3 @@
+vm.max_map_count = 262144
+fs.file-max = 65536
+
diff --git a/PKGBUILD b/PKGBUILD
index 970daa96d317..d01dcfc31ca7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname=sonarqube
pkgname=${_pkgname}
pkgver=7.0
-pkgrel=2
+pkgrel=3
pkgdesc="An open source platform for continuous inspection of code quality"
arch=('x86_64')
url="http://www.sonarqube.org/"
@@ -27,12 +27,14 @@ install=${pkgname}.install
source=("https://sonarsource.bintray.com/Distribution/${_pkgname}/${_pkgname}-${pkgver}.zip"
"${_pkgname}.service"
"${_pkgname}-tmpfile.conf"
- "${_pkgname}-user.conf")
+ "${_pkgname}-user.conf"
+ "99-${_pkgname}.conf")
sha256sums=('263942458279e2cf73fd86671511ac8ef0707e41ed51c9737142f8738bc7c060'
- 'cb3e3e810892e4d7ccf7a843ae1cb7daa14e3395025d0cc505b562f45e4f1ee9'
+ '1aeefc9db232d13a3139a27af308e30df72c8c9fd631f713e317e1ab18a24d77'
'6e024de469ebb1bc4083274412f0a5d68d5fa511c2139ce4cb1d243c51ff9535'
- '43ff10bbb495827e952225dce79da79bb800627eaa6f1d933f8f7fb408aafe6d')
+ '43ff10bbb495827e952225dce79da79bb800627eaa6f1d933f8f7fb408aafe6d'
+ '682b3ab19eee18b39453fa2e99af89ba7e4ecb0f63dcebf137e65aa225a42e68')
package() {
cd "${srcdir}/${_pkgname}-${pkgver}"
@@ -60,6 +62,9 @@ package() {
install -Dm644 "${_pkgname}-user.conf" "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf"
install -Dm644 "${_pkgname}-tmpfile.conf" "${pkgdir}/usr/lib/tmpfiles.d/${_pkgname}.conf"
+ # Install an example conf for required sysctl values (vm.max_map_count and fs.file-max); see https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Linux.
+ install -Dm644 "99-sonarqube.conf" "${pkgdir}/usr/share/doc/${_pkgname}/99-sonarqube.conf"
+
# Create symbolic links because SonarQube expects a specific directory layout.
ln -s "/var/log/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/logs"
ln -s "/run/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/run"
diff --git a/sonarqube.install b/sonarqube.install
index 30ff4fb8a2f4..7f40b6c8bde4 100644
--- a/sonarqube.install
+++ b/sonarqube.install
@@ -7,6 +7,9 @@ post_install() {
systemd-sysusers "${username}.conf"
systemd-tmpfiles --create "${username}.conf"
chown -R "$username:$username" /etc/$username /run/$username /usr/share/$username /var/log/$username
+
+ echo "Copy /usr/share/doc/sonarqube/99-sonarqube.conf to /etc/sysctl.d/99-sonarqube.conf for required sysctl values (vm.max_map_count and fs.file-max)."
+ echo "For further information see https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Linux"
}
@@ -14,6 +17,11 @@ post_upgrade() {
getent passwd "${username}" >/dev/null 2>&1 || systemd-sysusers "${username}.conf"
systemd-tmpfiles --create sonarqube.conf
+ if [ ! -f /etc/sysctl.d/99-sonarqube.conf ]; then
+ echo "Copy /usr/share/doc/sonarqube/99-sonarqube.conf to /etc/sysctl.d/99-sonarqube.conf for required sysctl values (vm.max_map_count and fs.file-max)."
+ echo "For further information see https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Linux"
+ fi
+
if [ "$(vercmp $2 5.6)" -lt 0 ]; then
echo " >> "
echo " >> Major version update from 5.2 to 5.6. Please take a look at http://www.sonarqube.org/downloads/ for more information."
diff --git a/sonarqube.service b/sonarqube.service
index 0b6f2dc50895..6fb45d31713b 100644
--- a/sonarqube.service
+++ b/sonarqube.service
@@ -12,6 +12,8 @@ StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sonarqube
RuntimeDirectory=sonarqube
+LimitNOFILE=65536
+LimitNPROC=2048
ExecStart=/usr/share/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/usr/share/sonarqube/bin/linux-x86-64/sonar.sh stop