You are not logged in.

#1 2024-10-24 12:18:38

jronald
Member
Registered: 2022-05-09
Posts: 105

[SOLVED] Connected samba blocks dolphin when samba service is down

Env:
plasma-desktop 6.2.2

Reproduce:
1. add an entry for samba in /etc/fstab
2.  open dolphin, click the folder to mount the samba file system
3. close dolphin
4. shutdown samba service
5. open dolphin, dolphin blocks for a long time, when the window shows, it doesn't respond, and a message asks whether to terminate dolphin
6. open konsole, run "ls", it blocks for a few seconds, then shows "ls: cannot access 'samba_share': Host is down"
7. if "# sudo umount ~/samba_share", it shows "umount: /path/to/samba_share: target is busy."

After step 4, I've tried logout & login, it's very very blocky. Rebooting solves the problem.

Last edited by jronald (2024-10-25 04:51:15)

Offline

#2 2024-10-24 13:45:43

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

1. add an entry for samba in /etc/fstab

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Post your fstab.

2.  open dolphin, click the folder to mount the samba file system

Does that automount or utilize a premounted CIFS share or access the share via the smb:// kio module?

4. shutdown samba service

Why?

Offline

#3 2024-10-24 14:24:39

jronald
Member
Registered: 2022-05-09
Posts: 105

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

seth wrote:

1. add an entry for samba in /etc/fstab

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Post your fstab.

//192.168.0.123/Downloads /home/user/samba_share cifs uid=user,gid=user,noatime,credentials=/home/user/.config/samba_credentials,iocharset=utf8,noauto,user 0 0
seth wrote:

2.  open dolphin, click the folder to mount the samba file system

Does that automount or utilize a premounted CIFS share or access the share via the smb:// kio module?

no automount and no premount, it mounts when I click the folder "/home/user/samba_share"

seth wrote:

4. shutdown samba service

Why?

I got two mini PCs, each with a samba server, one server is always on, the other is less used, to save power,  I'd like to turn it off when idle.

Offline

#4 2024-10-24 14:33:39

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

You're not using x-systemd.automount, though?
What's the output of "mount" after successfully opening the mount in dolphin?

https://man.archlinux.org/man/extra/cif … .8.en#soft - but that's supposed to be default anyway.

I got two mini PCs, each with a samba server, one server is always on, the other is less used, to save power,  I'd like to turn it off when idle.

So you're not stopping anything on the client, you're basically shutting down the server?

Try to add "_netdev,soft,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=300"
https://www.freedesktop.org/software/sy … .automount

Offline

#5 2024-10-24 15:18:08

jronald
Member
Registered: 2022-05-09
Posts: 105

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

seth wrote:

You're not using x-systemd.automount, though?
What's the output of "mount" after successfully opening the mount in dolphin?

https://man.archlinux.org/man/extra/cif … .8.en#soft - but that's supposed to be default anyway.

Just add entries in /etc/fstab as above on client, that all.
I even don't know what x-systemd is.

$ mount
...
//192.168.0.123/share on /home/username/samba_share type cifs (rw,nosuid,nodev,relatime,vers=3.1.1,cache=strict,username=username,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.0.123,file_mode=0755,dir_mode=0755,iocharset=utf8,soft,nounix,serverino,mapposix,reparse=nfs,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1,user=username)
...
seth wrote:

I got two mini PCs, each with a samba server, one server is always on, the other is less used, to save power,  I'd like to turn it off when idle.

So you're not stopping anything on the client, you're basically shutting down the server?

Yes, everything is basic.

seth wrote:

Try to add "_netdev,soft,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=300"
https://www.freedesktop.org/software/sy … .automount

The problem is not critical, I'd like to keep it simple.
Thanks all the same.

Last edited by jronald (2024-10-24 16:02:23)

Offline

#6 2024-10-24 15:42:33

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

x-systemd.automount will mount the share on access (ie. even "ls  /home/username/nuc_share" will mount it), the other options provide a 10s timeout in case that fails and automatically unmount the share ater a 5 minute cooldown

I'm not sure what actually mounts it (thoug I guess you're getting an entry in the location bar and click that and then dolphin just mounts the share) but for transient remote FS you're better off w/ a transient protocol implementation like kio smb:// or a self-destructing mount via x-systemd.idle-timeout=300

Although it's kinda odd that dolphin hangs.
How long does it currently take for "ls  /home/username/nuc_share" to timeout on a lost share?

Offline

#7 2024-10-24 16:10:23

jronald
Member
Registered: 2022-05-09
Posts: 105

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

seth wrote:

x-systemd.automount will mount the share on access (ie. even "ls  /home/username/nuc_share" will mount it), the other options provide a 10s timeout in case that fails and automatically unmount the share ater a 5 minute cooldown

I'm not sure what actually mounts it (thoug I guess you're getting an entry in the location bar and click that and then dolphin just mounts the share) but for transient remote FS you're better off w/ a transient protocol implementation like kio smb:// or a self-destructing mount via x-systemd.idle-timeout=300

In dolphin, there is a side pane on the left as a convention.
After adding entries for samba in /etc/fstab, the mount points will show there automatically, and it'll try to be mounted by clicking.
BTW a solution based on timer is not ideal,  an async mechanism is ideal.

seth wrote:

Although it's kinda odd that dolphin hangs.
How long does it currently take for "ls  /home/username/nuc_share" to timeout on a lost share?

About 20 seconds.

Last edited by jronald (2024-10-24 16:11:57)

Offline

#8 2024-10-24 16:38:20

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

BTW a solution based on timer is not ideal,  an async mechanism is ideal.

Use smb://, not a cifs mount

You can "umount -l" or "umount -f" the share
There's no way to automgically know "ok, this server will definitevly not respond" - idk why dolphin tries to access the share (last open directory) and it probably would benefit from a threaded filesystem model, but you'll always get some stall before an error because the filesystem didn't respond.

Offline

#9 2024-10-25 04:50:37

jronald
Member
Registered: 2022-05-09
Posts: 105

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

seth wrote:

BTW a solution based on timer is not ideal,  an async mechanism is ideal.

Use smb://, not a cifs mount

It works.

seth wrote:

You can "umount -l" or "umount -f" the share

"umount -l" works, maybe the best workaround
"umount -f" doesn't work

$ sudo umount -f ./samba_share 
umount: /home/username/samba_share: target is busy.

BTW "umount" without "-l" or "-f" before any block action works.

seth wrote:

There's no way to automgically know "ok, this server will definitevly not respond" - idk why dolphin tries to access the share (last open directory) and it probably would benefit from a threaded filesystem model, but you'll always get some stall before an error because the filesystem didn't respond.

It could show a blank folder for latency before contents or errors show, without any blocking.

Last edited by jronald (2024-10-25 05:49:58)

Offline

#10 2024-10-25 07:10:31

seth
Member
Registered: 2012-09-03
Posts: 60,779

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

It could show a blank folder for latency before contents or errors show, without any blocking.

seth wrote:

it probably would benefit from a threaded filesystem model

https://bugs.kde.org/buglist.cgi?compon … esolution=---

Offline

#11 2024-10-28 10:22:21

jronald
Member
Registered: 2022-05-09
Posts: 105

Re: [SOLVED] Connected samba blocks dolphin when samba service is down

Offline

Board footer

Powered by FluxBB