Periodic retry after cifs mount failure

I’m asking out of some combination of laziness (sorry) with desire to not “reinvent the wheel”. I could research a few details I don’t have memorized and then write a script launched by some part of system startup that checks until my one cifs mount is mounted and until it is periodically retries mounting it. But I expect it is a common enough requirement that it is already implemented somewhere that I didn’t know how to search for.

My etc/fstab mounts a Windows share. But often the Windows system boots up later than the Fedora system.

I would not want the attempted cifs mount to stall the later parts of Linux startup. I want to use the Linux system whether that mount has happened yet or not. But I do want the cifs mount to keep trying in the background, so that once the Windows system is visible, that mount finishes.

Edit: The marked solution from grumpey was not exactly what I originally thought I wanted but it was a way to solve the actual issue. It did need the extra detail grumpey added in his next reply, so user,nofail,x-systemd.automount added to the options on that line of /etc/fstab. But even that didn’t do the job, just got me close enough to google the remaining problem, which was solved by:
sudo chmod u+s /sbin/mount.cifs

I use, nofail,x-systemd.automount as options in fstab for a situation similar to that.
nofail so that it doesn’t report errors at boot
x-systemd.automount so it mounts when it is first accessed.

1 Like

I tried it. It didn’t work. I’ll find time later to try to diagnose what I might have done wrong.

I half remember having a similar feature enabled in a different linux long ago. Some kinds of attempt to use the mount just saw the empty directory, while others triggered the auto mount. I recall the file browser was one that worked.

Just now I tried Dolphin and it did not trigger the auto mount. If Dolphin doesn’t trigger the auto mount in my current environment, there is no point.

I tried googling the error text (found in 'dmesg`) and found nothing.

[ 2856.530119] CIFS: Attempting to mount \\john-central\share
[ 2874.441884] CIFS: VFS: \\john-central No task to wake, unknown frame received! NumMids 2
[ 2874.441894] 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
[ 2874.441896] 00000010: 00000001 00000000 ffffffff ffffffff  ................
[ 2874.441896] 00000020: 00000000 00000000 00000000 00000000  ................
[ 2874.441897] 00000030: 00000000 00000000 00000000 00000000  ................

You may want to also try adding user to the mount options.

Thanks, that addition moved me forward to a different error whose solution was easily found via google (see my edit to the first post).