Skip to content

Commit 41218f1

Browse files
committed
Release 2.4.9
2 parents 7ea714f + 836c274 commit 41218f1

File tree

9 files changed

+47
-28
lines changed

9 files changed

+47
-28
lines changed

agent/agent.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import (
1616
"context"
1717
"errors"
1818
"fmt"
19-
"io/ioutil"
2019
"math"
2120
"os"
2221
"os/exec"
2322
"path/filepath"
2423
"runtime"
2524
"strconv"
2625
"strings"
26+
"syscall"
2727

2828
"time"
2929

@@ -322,8 +322,21 @@ func (a *Agent) CmdV2(c *CmdOptions) CmdStatus {
322322
}
323323
}()
324324

325-
// Run and wait for Cmd to return, discard Status
326-
envCmd.Start()
325+
// workaround for https://github.com/golang/go/issues/22315
326+
for i := 0; i < 5; i++ {
327+
<-envCmd.Start()
328+
329+
<-doneChan
330+
331+
status := envCmd.Status()
332+
333+
if errors.Is(status.Error, syscall.ETXTBSY) {
334+
a.Logger.Errorln("CmdV2 syscall.ETXTBSY, retrying...")
335+
time.Sleep(500 * time.Millisecond)
336+
} else {
337+
break
338+
}
339+
}
327340

328341
go func() {
329342
select {
@@ -505,7 +518,7 @@ func (a *Agent) CleanupAgentUpdates() {
505518

506519
func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string, error) {
507520
content := []byte(code)
508-
tmpfn, _ := ioutil.TempFile(a.WinTmpDir, "*.py")
521+
tmpfn, _ := os.CreateTemp(a.WinTmpDir, "*.py")
509522
if _, err := tmpfn.Write(content); err != nil {
510523
a.Logger.Debugln(err)
511524
return "", err

agent/agent_windows.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"context"
1717
"errors"
1818
"fmt"
19-
"io/ioutil"
2019
"os"
2120
"os/exec"
2221
"path/filepath"
@@ -124,7 +123,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int,
124123
tmpDir = a.WinRunAsUserTmpDir
125124
}
126125

127-
tmpfn, err := ioutil.TempFile(tmpDir, ext)
126+
tmpfn, err := os.CreateTemp(tmpDir, ext)
128127
if err != nil {
129128
a.Logger.Errorln(err)
130129
return "", err.Error(), 85, err
@@ -623,8 +622,9 @@ func (a *Agent) AgentUpdate(url, inno, version string) error {
623622
return err
624623
}
625624
if r.IsError() {
626-
a.Logger.Errorln("Download failed with status code", r.StatusCode())
627-
return err
625+
ret := fmt.Sprintf("Download failed with status code %d", r.StatusCode())
626+
a.Logger.Errorln(ret)
627+
return errors.New(ret)
628628
}
629629

630630
innoLogFile := filepath.Join(a.WinTmpDir, fmt.Sprintf("tacticalagent_update_v%s.txt", version))

agent/svc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ func (a *Agent) AgentSvc(nc *nats.Conn) {
5555
a.Logger.Debugf("AgentSvc() sleeping for %v seconds", sleepDelay)
5656
time.Sleep(time.Duration(sleepDelay) * time.Second)
5757

58+
if runtime.GOOS == "windows" {
59+
a.KillHungUpdates()
60+
time.Sleep(1 * time.Second)
61+
a.CleanupAgentUpdates()
62+
}
63+
5864
conf := a.GetAgentCheckInConfig(a.GetCheckInConfFromAPI())
5965
a.Logger.Debugf("+%v\n", conf)
6066
for _, s := range natsCheckin {

build/rmm.exe.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<assemblyIdentity
44
type="win32"
55
name="TacticalRMM"
6-
version="2.4.8.0"
6+
version="2.4.9.0"
77
processorArchitecture="*"/>
88
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
99
<security>

build/setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define MyAppName "Tactical RMM Agent"
2-
#define MyAppVersion "2.4.8"
2+
#define MyAppVersion "2.4.9"
33
#define MyAppPublisher "AmidaWare LLC"
44
#define MyAppURL "https://github.com/amidaware"
55
#define MyAppExeName "tacticalrmm.exe"

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ go 1.20
44

55
require (
66
github.com/StackExchange/wmi v1.2.1
7-
github.com/elastic/go-sysinfo v1.10.1
7+
github.com/elastic/go-sysinfo v1.10.2
88
github.com/go-ole/go-ole v1.2.6
99
github.com/go-ping/ping v1.1.0
1010
github.com/go-resty/resty/v2 v2.7.0
1111
github.com/gonutz/w32/v2 v2.4.0
1212
github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d
13-
github.com/nats-io/nats-server/v2 v2.9.16 // indirect
14-
github.com/nats-io/nats.go v1.25.0
13+
github.com/nats-io/nats-server/v2 v2.9.17 // indirect
14+
github.com/nats-io/nats.go v1.26.0
1515
github.com/rickb777/date v1.19.1
1616
github.com/shirou/gopsutil/v3 v3.23.4
1717
github.com/sirupsen/logrus v1.9.0
@@ -44,6 +44,7 @@ require (
4444
github.com/hashicorp/hcl v1.0.0 // indirect
4545
github.com/jaypipes/pcidb v1.0.0 // indirect
4646
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
47+
github.com/klauspost/compress v1.16.5 // indirect
4748
github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect
4849
github.com/magiconair/properties v1.8.7 // indirect
4950
github.com/mitchellh/go-homedir v1.1.0 // indirect

go.sum

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz
5858
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5959
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6060
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
61-
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
61+
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
6262
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
6363
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
6464
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
65-
github.com/elastic/go-sysinfo v1.10.1 h1:qAfoDsw3lnShqqTHVBZbK4+PN3Lz5FBi3o9sM5n9O9s=
66-
github.com/elastic/go-sysinfo v1.10.1/go.mod h1:QElTrQ6akcnAVCRwdkZtoAkwuTv8UVM4+qe0hPxT4NU=
65+
github.com/elastic/go-sysinfo v1.10.2 h1:DK4pBq7AHwUY+3gcBykvFmWJQWEtv01Jes3v7ss1RVI=
66+
github.com/elastic/go-sysinfo v1.10.2/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E=
6767
github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0=
6868
github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss=
6969
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -197,7 +197,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
197197
github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60=
198198
github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
199199
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
200-
github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU=
200+
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
201+
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
201202
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
202203
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
203204
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -216,10 +217,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
216217
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
217218
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
218219
github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4=
219-
github.com/nats-io/nats-server/v2 v2.9.16 h1:SuNe6AyCcVy0g5326wtyU8TdqYmcPqzTjhkHojAjprc=
220-
github.com/nats-io/nats-server/v2 v2.9.16/go.mod h1:z1cc5Q+kqJkz9mLUdlcSsdYnId4pyImHjNgoh6zxSC0=
221-
github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE=
222-
github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg=
220+
github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw=
221+
github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s=
222+
github.com/nats-io/nats.go v1.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE=
223+
github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc=
223224
github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA=
224225
github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
225226
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
@@ -263,11 +264,9 @@ github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXE
263264
github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA=
264265
github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o=
265266
github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8=
266-
github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ=
267267
github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ=
268268
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
269269
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
270-
github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c=
271270
github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
272271
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
273272
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
var (
28-
version = "2.4.8"
28+
version = "2.4.9"
2929
log = logrus.New()
3030
logFile *os.File
3131
)

versioninfo.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"FileVersion": {
44
"Major": 2,
55
"Minor": 4,
6-
"Patch": 8,
6+
"Patch": 9,
77
"Build": 0
88
},
99
"ProductVersion": {
1010
"Major": 2,
1111
"Minor": 4,
12-
"Patch": 8,
12+
"Patch": 9,
1313
"Build": 0
1414
},
1515
"FileFlagsMask": "3f",
@@ -22,14 +22,14 @@
2222
"Comments": "",
2323
"CompanyName": "AmidaWare LLC",
2424
"FileDescription": "Tactical RMM Agent",
25-
"FileVersion": "v2.4.8.0",
25+
"FileVersion": "v2.4.9.0",
2626
"InternalName": "tacticalrmm.exe",
2727
"LegalCopyright": "Copyright (c) 2023 AmidaWare LLC",
2828
"LegalTrademarks": "",
2929
"OriginalFilename": "tacticalrmm.exe",
3030
"PrivateBuild": "",
3131
"ProductName": "Tactical RMM Agent",
32-
"ProductVersion": "v2.4.8.0",
32+
"ProductVersion": "v2.4.9.0",
3333
"SpecialBuild": ""
3434
},
3535
"VarFileInfo": {

0 commit comments

Comments
 (0)