Skip to content

Commit

Permalink
windows: use "Alloy" as service name (#81)
Browse files Browse the repository at this point in the history
Previously, the Windows service used the name "Grafana Alloy," which
didn't align with the other services names (Linux, macOS) or other
release assets (Helm chart, binaries, etc).

This commit changes the service name to Alloy to be consistent across
the board with when the Grafana prefix is included to just
documentation.
  • Loading branch information
rfratto authored Mar 26, 2024
1 parent dd69d5e commit 9818a2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/alloy-service/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"golang.org/x/sys/windows/svc"
)

const serviceName = "Grafana Alloy"
const serviceName = "Alloy"

func main() {
logger, err := newLogger()
Expand Down
12 changes: 6 additions & 6 deletions packaging/alloy/windows/install_script.nsis
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Section "install"
# stack, and must be popped after calling.

# Preemptively stop the existing service if it's running.
nsExec::ExecToLog 'sc stop "Grafana Alloy"'
nsExec::ExecToLog 'sc stop "Alloy"'
Pop $0

# Configure the out path and copy files to it.
Expand Down Expand Up @@ -97,15 +97,15 @@ Section "install"
Call InitializeRegistry

# Create the service.
nsExec::ExecToLog 'sc create "Grafana Alloy" start= delayed-auto binpath= "$INSTDIR\alloy-service-windows-amd64.exe"'
nsExec::ExecToLog 'sc create "Alloy" start= delayed-auto binpath= "$INSTDIR\alloy-service-windows-amd64.exe"'
Pop $0

# Start the service.
nsExec::ExecToLog 'sc start "Grafana Alloy"'
nsExec::ExecToLog 'sc start "Alloy"'
Pop $0

# Auto-restart Alloy on failure. Reset failure counter after 60 seconds without failure
nsExec::ExecToLog `sc failure "Grafana Alloy" reset= 60 actions= restart/5000 reboot= "Grafana Alloy has failed. Restarting in 5 seconds"`
nsExec::ExecToLog `sc failure "Alloy" reset= 60 actions= restart/5000 reboot= "Alloy has failed. Restarting in 5 seconds"`
Pop $0
SectionEnd

Expand Down Expand Up @@ -209,9 +209,9 @@ Section "uninstall"
DetailPrint "Starting uninstaller."

# Stop and remove service.
nsExec::ExecToLog 'sc stop "Grafana Alloy"'
nsExec::ExecToLog 'sc stop "Alloy"'
Pop $0
nsExec::ExecToLog 'sc delete "Grafana Alloy"'
nsExec::ExecToLog 'sc delete "Alloy"'
Pop $0

RMDir /r "$SMPROGRAMS\${APPNAME}" # Start Menu folder.
Expand Down

0 comments on commit 9818a2b

Please sign in to comment.