fix(cli,fuse): keep answering the systemd watchdog while the daemon retries

The watchdog is armed when the process starts, but only the mount's supervisor
pinged it. A daemon waiting for a login or backing off after a failed mount
(#26: key unlock failing) was aborted after WatchdogSec and left a coredump
instead of its error. Sleep through idle_sleep in those stretches; the mounted
ping still has to pass the control-socket probe.
This commit is contained in:
nvrl committed 2026-10-07 08:17:50 +02:00
1 parent a14a63c94c
commit f105159186
3 files changed
+24 -3

No files matched your search

+3 -3
View File
@@ -2027,7 +2027,7 @@ fn cmd_daemon(mountpoint: Option<PathBuf>) -> Result<()> {
loop {
// Wait until a session is stored. The GUI enables this service on login,
// but the service may also start at boot before the user has logged in.
wait_for_session(|| auth::load().map(|_| ()), std::thread::sleep)?;
wait_for_session(|| auth::load().map(|_| ()), pdfs_fuse::idle_sleep)?;
match mount_once(mountpoint.clone()) {
Ok(pdfs_fuse::MountOutcome::Shutdown) => {
@@ -2036,13 +2036,13 @@ fn cmd_daemon(mountpoint: Option<PathBuf>) -> Result<()> {
}
Ok(pdfs_fuse::MountOutcome::Unmounted) => {
tracing::warn!("mount ended externally; remounting in 2s");
std::thread::sleep(std::time::Duration::from_secs(2));
pdfs_fuse::idle_sleep(std::time::Duration::from_secs(2));
}
Err(e) => {
// `{:#}` so the whole anyhow chain lands in the log — the top
// context alone ("mount failed") never says *why*.
tracing::error!(error = format!("{e:#}"), "mount failed; retrying in 5s");
std::thread::sleep(std::time::Duration::from_secs(5));
pdfs_fuse::idle_sleep(std::time::Duration::from_secs(5));
}
}
}