Skip to content

Commit

Permalink
set user/group under systemd (#11789) (#11791)
Browse files Browse the repository at this point in the history
(cherry picked from commit bd1a925)
  • Loading branch information
graphaelli committed Apr 12, 2019
1 parent 23c70f0 commit 52ab6e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dev-tools/packaging/templates/linux/systemd.unit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Wants=network-online.target
After=network-online.target

[Service]
{{ if ne .BeatUser "root" -}}
User={{ .BeatUser }}
Group={{ .BeatUser }}
{{- end }}
Environment="BEAT_LOG_OPTS=-e"
Environment="BEAT_CONFIG_OPTS=-c /etc/{{.BeatName}}/{{.BeatName}}.yml"
Environment="BEAT_PATH_OPTS=-path.home /usr/share/{{.BeatName}} -path.config /etc/{{.BeatName}} -path.data /var/lib/{{.BeatName}} -path.logs /var/log/{{.BeatName}}"
Expand Down

0 comments on commit 52ab6e8

Please sign in to comment.