Skip to content

Commit

Permalink
Align service parameters to documentation (elastic#19616) (elastic#19620
Browse files Browse the repository at this point in the history
)

Use 2 dashes when using parameters on init scripts.
  • Loading branch information
111andre111 authored and melchiormoulin committed Oct 14, 2020
1 parent 19f9ce6 commit c732056
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev-tools/packaging/templates/deb/init.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="{{.Description}}"
NAME="{{.BeatName}}"
DAEMON=/usr/share/${NAME}/bin/${NAME}
DAEMON_ARGS="-c /etc/${NAME}/${NAME}.yml -path.home /usr/share/${NAME} -path.config /etc/${NAME} -path.data /var/lib/${NAME} -path.logs /var/log/${NAME}"
DAEMON_ARGS="-c /etc/${NAME}/${NAME}.yml --path.home /usr/share/${NAME} --path.config /etc/${NAME} --path.data /var/lib/${NAME} --path.logs /var/log/${NAME}"
TEST_ARGS="-e test config"
PIDFILE=/var/run/{{.ServiceName}}.pid
WRAPPER="/usr/share/${NAME}/bin/${NAME}-god"
Expand Down
8 changes: 4 additions & 4 deletions dev-tools/packaging/templates/linux/beatname.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# the init script / systemd unit file would do.

exec /usr/share/{{.BeatName}}/bin/{{.BeatName}} \
-path.home /usr/share/{{.BeatName}} \
-path.config /etc/{{.BeatName}} \
-path.data /var/lib/{{.BeatName}} \
-path.logs /var/log/{{.BeatName}} \
--path.home /usr/share/{{.BeatName}} \
--path.config /etc/{{.BeatName}} \
--path.data /var/lib/{{.BeatName}} \
--path.logs /var/log/{{.BeatName}} \
"$@"
2 changes: 1 addition & 1 deletion dev-tools/packaging/templates/linux/systemd.unit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Group={{ .BeatUser }}
{{- end }}
Environment="BEAT_LOG_OPTS="
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}}"
Environment="BEAT_PATH_OPTS=--path.home /usr/share/{{.BeatName}} --path.config /etc/{{.BeatName}} --path.data /var/lib/{{.BeatName}} --path.logs /var/log/{{.BeatName}}"
ExecStart=/usr/share/{{.BeatName}}/bin/{{.BeatName}} -environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS
Restart=always

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/packaging/templates/rpm/init.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export PATH
[ -f /etc/sysconfig/{{.ServiceName}} ] && . /etc/sysconfig/{{.ServiceName}}
pidfile=${PIDFILE-/var/run/{{.ServiceName}}.pid}
agent=${BEATS_AGENT-/usr/share/{{.BeatName}}/bin/{{.BeatName}}}
args="-c /etc/{{.BeatName}}/{{.BeatName}}.yml -path.home /usr/share/{{.BeatName}} -path.config /etc/{{.BeatName}} -path.data /var/lib/{{.BeatName}} -path.logs /var/log/{{.BeatName}}"
args="-c /etc/{{.BeatName}}/{{.BeatName}}.yml --path.home /usr/share/{{.BeatName}} --path.config /etc/{{.BeatName}} --path.data /var/lib/{{.BeatName}} --path.logs /var/log/{{.BeatName}}"
test_args="-e test config"
beat_user="${BEAT_USER:-{{.BeatUser}}}"
wrapper="/usr/share/{{.BeatName}}/bin/{{.BeatName}}-god"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $workdir = Split-Path $MyInvocation.MyCommand.Path
# Create the new service.
New-Service -name {{.BeatName}} `
-displayName {{.BeatName | title}} `
-binaryPathName "`"$workdir\{{.BeatName}}.exe`" -environment=windows_service -c `"$workdir\{{.BeatName}}.yml`" -path.home `"$workdir`" -path.data `"C:\ProgramData\{{.BeatName}}`" -path.logs `"C:\ProgramData\{{.BeatName}}\logs`" -E logging.files.redirect_stderr=true"
-binaryPathName "`"$workdir\{{.BeatName}}.exe`" -environment=windows_service -c `"$workdir\{{.BeatName}}.yml`" --path.home `"$workdir`" --path.data `"C:\ProgramData\{{.BeatName}}`" --path.logs `"C:\ProgramData\{{.BeatName}}\logs`" -E logging.files.redirect_stderr=true"

# Attempt to set the service to delayed start using sc config.
Try {
Expand Down

0 comments on commit c732056

Please sign in to comment.