* what are you trying to achieve:
Try to run from sonar user
what have you tried so far to achieve this:
???
Error in sonar.log log file:
2019.03.04 15:01:17 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/sonarqube-6.7.6/temp
2019.03.04 15:01:17 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.03.04 15:01:17 INFO app[o.s.a.p.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/sonarqube-6.7.6/elasticsearch]: /opt/sonar/sonarqube-6.7.6/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/sonarqube-6.7.6/temp/conf/es
2019.03.04 15:01:17 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.03.04 15:01:17 INFO app[o.e.p.PluginsService] no modules loaded
2019.03.04 15:01:17 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.03.04 15:01:19 INFO app[o.s.a.SchedulerImpl] Stopping SonarQube
2019.03.04 15:01:19 INFO app[o.s.a.SchedulerImpl] Process [es] is stopped
2019.03.04 15:01:19 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
2019.03.04 15:01:19 WARN app[o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
← Wrapper Stopped
→ Wrapper Started as Daemon
Launching a JVM…
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
TERM trapped. Shutting down.
So if I run from root / any sudo account with systemd unit (even i have sonar User/Group explicitly specified) → I get an error.
My reply was based on a quick skim, and this (emphasis in original):
and this
On closer reading, one might think you’re asking, “Why does my service run as root even though user and group are specified for it?” But you’re not running the service when you directly invoke /opt/.../sonar.sh start; you’re running a script, and passing the string “start” as an argument. Probably if you started the service, it would work just fine.