In KDE System Settings | Hardware | Power Management | Energy Saving, if ‘Suspend session’ is checked (with option ‘Automatically Sleep after x min’), this causes an NFS client to hang when the server goes into sleep mode.
My question:
How could I inhibit sleep on the server when there is an active NFS mount?
Of course I could stop the server from going into sleep mode altogether by unchecking ‘Suspend session’, however, I’d rather avoid that.
though this post is from a while back and I’m not sure if the info is correct for fedora. If there is an active nfs mount I can see it with netstat -an | grep server-ip:nfs-port as suggested in the post.
Let me ask if you intend only to inhibit sleep when an nfs connection is already active or if you also intend to wake the machine when a new nfs connection is being made.
Those are different situations and would require different (additional) configs.
Note that blank screen is quite possible without actually sleeping (suspending), and that sleeping actually does power down a lot of otherwise active processes and hardware.
Thanks for your response. I wanted to do both: inhibit sleep when an nfs connection is already active and also to wake the machine when a new nfs connection is made.
I was hoping that the following would successfully enable wake-on-lan:
nmcli c modify "con-name" 802-3-ethernet.wake-on-lan magic
though I have not tested this properly yet.
But from what you are saying, it might be better to stop the machine from sleeping and simply switch off the screen after a period of inactivity?
Personally I run my home desktop system as a media server for my home.
I switched off the default “suspend after 15 minutes idle time” behavior and have the blank and lock screen set for the desired time-out. (idle is defined as no keyboard or mouse activity – which rules out the network activity (of any type) from counting for keeping the system awake)
Thus my “server” is still active on the network and available for ssh access as well as continuing to provide the services even when the screen is blanked and locked.
There may be a way to allow hibernation and WoL access but I chose to not follow that path.
That is how I configure my home linux systems. With systems running 7x24 you can schedule backups and updates (e.g., with dnf-automatic) to download at night. I do like to see the list of updates before applying them, but don’t like to wait while they download. I have UPS on 7x24 systems configured to shutdown after power is off for more than 15 minutes.
I didn’t know about dnf-automatic so thanks for that pointer.
Re scheduling backups, I had this running successfully with a systemd timer when my system was in sleep mode. My unit timer file includes the following Timer section:
[Timer]
Unit=daily-backup.service
# Run daily at 2:00am
OnCalendar=*-*-* 02:00:00
# Wake system from sleep if need be
# Note that WakeSystem requires privileges and is thus generally only available
# in the system service manager
WakeSystem=true