Skip to content

Commit

Permalink
sigh actually start them
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter committed Jan 12, 2025
1 parent 07b1cc5 commit 55d2459
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsystems/viamagent/viamagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ func (a *agentSubsystem) Update(ctx context.Context, cfg *pb.DeviceSubsystemConf
expectedPath := filepath.Join(agent.ViamDirs["bin"], subsysName)
if runtime.GOOS == "windows" {
// no systemd on windows -- check if binary is runnable, then restart service.
if err := exec.Command(expectedPath, "--version").Wait(); err != nil {
if _, err := exec.Command(expectedPath, "--version").Output(); err != nil {

Check failure on line 75 in subsystems/viamagent/viamagent.go

View workflow job for this annotation

GitHub Actions / Test lint and build

G204: Subprocess launched with variable (gosec)
return false, errw.Wrap(err, "testing binary")
}
// note: sc.exe doesn't have a restart command it seems.
if err := exec.Command("powershell", "-command", "Restart-Service viam-agent").Wait(); err != nil {
if _, err := exec.Command("powershell", "-command", "Restart-Service viam-agent").Output(); err != nil {
return false, errw.Wrap(err, "restarting windows service")
}
return true, nil
Expand Down

0 comments on commit 55d2459

Please sign in to comment.