What I should change in systemd configuration to enable hibernation with suspend-to-disk…
- User
What I should change in systemd configuration to enable hibernation with suspend-to-disk (swap file) support? And finally what command to put linux in hibernation with suspend-to-disk?
/etc/systemd/sleep.conf: [Sleep] AllowSuspend=yes AllowHibernation=no AllowSuspendThenHibernate=no AllowHybridSleep=no #SuspendMode= #SuspendState=mem standby freeze #HibernateMode=platform shutdown #HibernateState=disk #HybridSleepMode=suspend platform shutdown #HybridSleepState=disk #HibernateDelaySec= #SuspendEstimationSec=60min
/etc/systemd/logind.conf: [Login] #NAutoVTs=6 #ReserveVT=6 #KillUserProcesses=no #KillOnlyUsers= #KillExcludeUsers=root #InhibitDelayMaxSec=5 #UserStopDelaySec=10 HandlePowerKey=ignore HandlePowerKeyLongPress=ignore #HandleRebootKey=reboot #HandleRebootKeyLongPress=poweroff #HandleSuspendKey=suspend #HandleSuspendKeyLongPress=hibernate HandleHibernateKey=ignore HandleHibernateKeyLongPress=ignore HandleLidSwitch=suspend HandleLidSwitchExternalPower=suspend HandleLidSwitchDocked=ignore #PowerKeyIgnoreInhibited=no #SuspendKeyIgnoreInhibited=no #HibernateKeyIgnoreInhibited=no #LidSwitchIgnoreInhibited=yes #RebootKeyIgnoreInhibited=no #HoldoffTimeoutSec=30s #IdleAction=suspend #IdleActionSec=15min #RuntimeDirectorySize=10% #RuntimeDirectoryInodesMax= #RemoveIPC=yes #InhibitorsMax=8192 #SessionsMax=8192 #StopIdleSessionSec=infinity
- Assistant
- User
How to apply changed logind.conf and sleep.conf configuration without reboot?
- Assistant
You can apply changes made to
logind.confandsleep.confwithout rebooting by using the following commands:1. For
logind.confAfter modifying
/etc/systemd/logind.conf, you need to restart thesystemd-logindservice for the changes to take effect:bashsudo systemctl restart systemd-logind.service2. For
sleep.confChanges in
/etc/systemd/sleep.conftypically do not require a specific command to reload because these settings are usually applied the next time a suspend or hibernation command is issued. However, if you want to ensure that any related services are aware of the new settings, you can trigger the suspend/hibernate service, though typically a restart of affected services would be overkill.In practice, the settings will generally be applied next time you attempt to suspend, hibernate, or wake from either state. However, if you're in doubt, reloading systemd can be done, but it is not strictly necessary for just changes: