92
submitted 6 months ago by petsoi@discuss.tchncs.de to c/linux@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Morphit@feddit.uk 1 points 6 months ago* (last edited 6 months ago)

For sure, I don't know the internals of Samba, but surely the server knows that it's serving a file no matter how the client accesses it. I don't think a few dbus messages would cause issues.

I have my own service that looks at the network traffic via /proc and a few other things. That sends the system to sleep itself if everything looks truly idle.

I do think it would be nice for a file server like samba to inhibit sleep using the standard interface for it. But yeah, I appreciate there are complications, like video playback is presumably pulling a small extent of a file at a time, so there would have to be some kind of timer before releasing the inhibition or the system would sleep between transfers.

EDIT: I just took a look; with loglevel set to 3 for smb and smb2 I see log messages like:

smbd_smb2_read: fnum 1712966762, file my_video.mkv, length=262144 offset=82366464 read=262144

These occur at most 10 seconds apart when playing a video over a share from another host. I don't see why the smbd daemon couldn't inhibit sleep untill smbd_smb2_read hasn't run for a minute or so. You could have a script that monitors that log output and does this externally but it'd be nice to have built in.

[-] just_another_person@lemmy.world 0 points 6 months ago* (last edited 6 months ago)

The server side should never be expected to sleep at all, so that's just a totally different thing. I was under the impression you were having issues with the client. If you have sleep enabled on the server/service side of things and you expect it to work, then there's yer problem. You'll need some custom work to prevent your power profiles and such from overriding systemd-sleep or whatever you intend to happen.

[-] Morphit@feddit.uk 4 points 6 months ago

Ah, that's the misunderstanding. The original comment was talking about "watching something on another pc". Like playing a video from a desktop PC on a laptop in another room. So it's the samba server we want to prevent from sleeping, not the client. Yes it'd be nice to have a 24/7 media server set up, but for the simple case of sharing a file from one PC to another, it'd be nice for the server not to sleep in the middle of it by default.

this post was submitted on 29 Mar 2024
92 points (95.1% liked)

Linux

47760 readers
867 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS