Compare commits

...

5 Commits

Author SHA1 Message Date
Jakob Borg 780b8fd3bc Merge branch 'main' into v2
* main:
  build: push artifacts to Azure (#10044)
  fix(syncthing): use separate lock file instead of locking the certificate (fixes #10053) (#10054)
  fix(syncthing): use separate lock file instead of locking the certificate (fixes #10053) (#10054)
2025-04-12 15:16:36 +02:00
Jakob Borg 7db3f7eaac Merge branch 'release-1.29.5'
* release-1.29.5:
  build: push artifacts to Azure (#10044)
  fix(syncthing): use separate lock file instead of locking the certificate (fixes #10053) (#10054)
2025-04-12 14:57:04 +02:00
Jakob Borg f0b666269b build: push artifacts to Azure (#10044)
Provider migration
2025-04-12 14:55:24 +02:00
Jakob Borg 190a59842c fix(syncthing): use separate lock file instead of locking the certificate (fixes #10053) (#10054)
Apparently that nukes the cert under some circumstances on some Windows
🤷
2025-04-12 14:49:23 +02:00
Jakob Borg 40888c1a66 fix(syncthing): use separate lock file instead of locking the certificate (fixes #10053) (#10054)
Apparently that nukes the cert under some circumstances on some Windows
🤷
2025-04-12 14:46:57 +02:00
2 changed files with 8 additions and 4 deletions
+6 -4
View File
@@ -22,7 +22,6 @@ import (
"path"
"path/filepath"
"regexp"
"runtime"
"runtime/pprof"
"sort"
"strconv"
@@ -442,7 +441,7 @@ func (c *serveCmd) syncthingMain() {
}
// Ensure we are the only running instance
lf := flock.New(locations.Get(locations.CertFile))
lf := flock.New(locations.Get(locations.LockFile))
locked, err := lf.TryLock()
if err != nil {
l.Warnln("Failed to acquire lock:", err)
@@ -585,7 +584,10 @@ func (c *serveCmd) syncthingMain() {
pprof.StopCPUProfile()
}
runtime.KeepAlive(lf) // ensure lock is still held to this point
// Best effort remove lockfile, doesn't matter if it succeeds
_ = lf.Unlock()
_ = os.Remove(locations.Get(locations.LockFile))
os.Exit(int(status))
}
@@ -887,7 +889,7 @@ func (u upgradeCmd) Run() error {
release, err := checkUpgrade()
if err == nil {
lf := flock.New(locations.Get(locations.CertFile))
lf := flock.New(locations.Get(locations.LockFile))
locked, err := lf.TryLock()
if err != nil {
l.Warnln("Upgrade:", err)
+2
View File
@@ -34,6 +34,7 @@ const (
AuditLog LocationEnum = "auditLog"
GUIAssets LocationEnum = "guiAssets"
DefFolder LocationEnum = "defFolder"
LockFile LocationEnum = "lockFile"
)
type BaseDirEnum string
@@ -127,6 +128,7 @@ var locationTemplates = map[LocationEnum]string{
AuditLog: "${data}/audit-%{timestamp}.log",
GUIAssets: "${config}/gui",
DefFolder: "${userHome}/Sync",
LockFile: "${data}/syncthing.lock",
}
var locations = make(map[LocationEnum]string)