mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
add hint about systemd ReadWritePaths if hardlinking fails on linux due to cross-device link
may help admin figure out more easily how to work around this. for issue #170 by rdelaage
This commit is contained in:
parent
4d28a02621
commit
44a6927379
1 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,9 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mjl-/bstore"
|
"github.com/mjl-/bstore"
|
||||||
|
@ -234,7 +236,11 @@ func backupctl(ctx context.Context, ctl *ctl) {
|
||||||
// No point in trying with regular copy, we would warn twice.
|
// No point in trying with regular copy, we would warn twice.
|
||||||
return false, err
|
return false, err
|
||||||
} else if !warnedHardlink {
|
} else if !warnedHardlink {
|
||||||
xwarnx("creating hardlink to message failed, will be doing regular file copies and not warn again", err, slog.String("srcpath", srcpath), slog.String("dstpath", dstpath))
|
var hardlinkHint string
|
||||||
|
if runtime.GOOS == "linux" && errors.Is(err, syscall.EXDEV) {
|
||||||
|
hardlinkHint = " (hint: if running under systemd, ReadWritePaths in mox.service may cause multiple mountpoints; consider merging paths into a single parent directory to prevent cross-device/mountpoint hardlinks)"
|
||||||
|
}
|
||||||
|
xwarnx("creating hardlink to message failed, will be doing regular file copies and not warn again"+hardlinkHint, err, slog.String("srcpath", srcpath), slog.String("dstpath", dstpath))
|
||||||
warnedHardlink = true
|
warnedHardlink = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue