{"id":11123,"date":"2024-01-08T00:04:38","date_gmt":"2024-01-07T23:04:38","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=11123"},"modified":"2024-11-09T12:46:11","modified_gmt":"2024-11-09T11:46:11","slug":"prevent-sleep-suspend-when-not-logged-in","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2024\/01\/08\/prevent-sleep-suspend-when-not-logged-in\/","title":{"rendered":"Prevent sleep\/suspend when not logged in"},"content":{"rendered":"\n<p>Recently I&#8217;ve been logged into a laptop remotely a lot. Logging out from &#8220;main&#8221; session makes my Gnome on Debian 12 go to suspend after a while. To avoid it you just have to tell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">sudo  dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type &#039;nothing&#039;<\/code><\/pre>\n\n\n\n<p>Thanks to <a href=\"https:\/\/askubuntu.com\/users\/307523\/wineunuuchs2unix\">WinEunuuchs2Unix<\/a> for the answer I took from <a href=\"https:\/\/askubuntu.com\/questions\/1101043\/prevent-sleep-suspend-when-not-logged-in-to-a-specific-account\">Prevent sleep\/suspend when not logged in to a specific account<\/a>; the only change is that GDM on Debian runs as root.<\/p>\n\n\n\n<p>See also <a href=\"https:\/\/wiki.debian.org\/Suspend#Disable_suspend_and_hibernation\">https:\/\/wiki.debian.org\/Suspend#Disable_suspend_and_hibernation<\/a>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>For systems which should never attempt any type of suspension, these targets can be disabled at the systemd level with the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target<\/pre>\n\n\n\n<p>To re-enable hibernate and suspend use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target<\/pre>\n\n\n\n<p>A modern <strong>alternative<\/strong> approach for disabling suspend and hibernation is to create \/etc\/systemd\/sleep.conf.d\/nosuspend.conf as<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Sleep]\nAllowSuspend=no\nAllowHibernation=no\nAllowSuspendThenHibernate=no\nAllowHybridSleep=no<\/pre>\n\n\n\n<p>The above technique works on Debian 10 Buster and newer. See systemd-sleep.conf(5) for details.<\/p>\n\n\n\n<p>If you just want to prevent suspending when the lid is closed you can set the following options in \/etc\/systemd\/logind.conf:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Login]\nHandleLidSwitch=ignore\nHandleLidSwitchDocked=ignore<\/pre>\n\n\n\n<p>Then run systemctl&nbsp;restart&nbsp;systemd-logind.service or reboot.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Recently I&#8217;ve been logged into a laptop remotely a lot. Logging out from &#8220;main&#8221; session makes my Gnome on Debian 12 go to suspend after a while. To avoid it you just have to tell: Thanks to WinEunuuchs2Unix for the answer I took from Prevent sleep\/suspend when not logged in to a specific account; the&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2024\/01\/08\/prevent-sleep-suspend-when-not-logged-in\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[104,13,278],"tags":[],"class_list":["post-11123","post","type-post","status-publish","format-standard","hentry","category-gnome","category-gnulinux","category-tricks"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2Tp","jetpack-related-posts":[{"id":11106,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/06\/gnome-merges-rdp-graphical-remote-login-support-phoronix\/","url_meta":{"origin":11123,"position":0},"title":"GNOME Merges RDP Graphical Remote Login Support &#8211; Phoronix","author":"Paolo Redaelli","date":"2024-01-06","format":false,"excerpt":"After the merge request was open since August of 2022, merged today is support within the GNOME Remote Desktop code for handling graphical remote log-ins. Source: GNOME Merges RDP Graphical Remote Login Support - Phoronix","rel":"","context":"In &quot;Gnome&quot;","block_context":{"text":"Gnome","link":"https:\/\/monodes.com\/predaelli\/category\/gnome\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":315,"url":"https:\/\/monodes.com\/predaelli\/2015\/06\/12\/how-to-make-your-linux-pc-wake-from-sleep-automatically\/","url_meta":{"origin":11123,"position":1},"title":"How to Make Your Linux PC Wake From Sleep Automatically","author":"Paolo Redaelli","date":"2015-06-12","format":false,"excerpt":"From How to Make Your Linux PC Wake From Sleep Automatically I use sudo rtcwake -m\u00a0mem -l -t $(date +%s -d \u2018tomorrow 06:30\u2019) or sudo \/usr\/sbin\/rtcwake -m mem -s $(( 8 * 3600)) Want to put your Linux PC into sleep or hibernate mode and have it automatically wake at\u2026","rel":"","context":"In &quot;GNU\/Linux&quot;","block_context":{"text":"GNU\/Linux","link":"https:\/\/monodes.com\/predaelli\/category\/gnulinux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=525%2C300 1.5x"},"classes":[]},{"id":6715,"url":"https:\/\/monodes.com\/predaelli\/2020\/02\/22\/shutter-feature-rich-but-aging-screenshot-tool\/","url_meta":{"origin":11123,"position":2},"title":"Shutter &#8211; Feature-rich but &#8220;aging&#8221; Screenshot Tool","author":"Paolo Redaelli","date":"2020-02-22","format":false,"excerpt":"Screenshots | Shutter - Feature-rich Screenshot Tool Well, it's really a shame that such a tool is slowly fading into Debian's oldstable and oldoldstable. Then I found why: it's written in Perl which is a perfectly good programming language but it is currently considered too \"old-fashioned\". It is also \"stuck\"\u2026","rel":"","context":"In &quot;Mood&quot;","block_context":{"text":"Mood","link":"https:\/\/monodes.com\/predaelli\/category\/mood\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/02\/key_feature_032.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/02\/key_feature_032.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/02\/key_feature_032.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":13816,"url":"https:\/\/monodes.com\/predaelli\/2025\/07\/22\/stop-gnome-software-background\/","url_meta":{"origin":11123,"position":3},"title":"Stop GNOME Software Background","author":"Paolo Redaelli","date":"2025-07-22","format":false,"excerpt":"To avoid GNOME Software from running in the background, you can take several approaches based on the solutions discussed in the context. One effective method is to disable the autostart entry for GNOME Software. This can be done by copying the file \/etc\/xdg\/autostart\/gnome-software-service.desktop to ~\/.config\/autostart and adding X-GNOME-Autostart-enabled=false at the\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6499,"url":"https:\/\/monodes.com\/predaelli\/2020\/01\/25\/l1-di-madbob\/","url_meta":{"origin":11123,"position":4},"title":"L&#8217;1% di MadBob","author":"Paolo Redaelli","date":"2020-01-25","format":false,"excerpt":"MadBob ci lavora nell'informatica, quindi da qualche anno dedica l'Uno Per Cento del suo fatturato ai progetti di software libero che lo aiutano sul lavoro (a proposito Bob, si dice software libero :) cavolo, dovrei fare qualche donazione anche io. Ok, non ci lavoro in informatica, ma sul lavoro ne\u2026","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":624,"url":"https:\/\/monodes.com\/predaelli\/2015\/08\/06\/both-arent-liberi\/","url_meta":{"origin":11123,"position":5},"title":"Both aren&#8217;t &#8220;liberi&#8221;","author":"Paolo Redaelli","date":"2015-08-06","format":false,"excerpt":"Chrome - one of the most widespread browser - is proprietary software with Chromium being is \"open source\" base. According to Debian #Debian Bug report logs for \"786909 - chromium: unconditionally downloads binary blob\" Chromium even when built from source code still try to inject binary blobs - proprietary software\u2026","rel":"","context":"In &quot;Proprietary software&quot;","block_context":{"text":"Proprietary software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/proprietary-software\/"},"img":{"alt_text":"1000px-Chromium_11_Logo.svg","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/08\/1000px-Chromium_11_Logo.svg_-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/11123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=11123"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/11123\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=11123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=11123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=11123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}