{"id":1,"date":"2017-03-04T16:46:41","date_gmt":"2017-03-04T15:46:41","guid":{"rendered":"http:\/\/thomashartung.it\/?p=1"},"modified":"2021-04-06T19:26:48","modified_gmt":"2021-04-06T17:26:48","slug":"disable-hibernate-suspend","status":"publish","type":"post","link":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/","title":{"rendered":"Completely disable hibernation, suspend and sleep mode"},"content":{"rendered":"

I have an old netbook, a Samsung NC-10 to be precise, which i like to use as a server at home.<\/p>\n

So i decided to install Debian on it without any desktop or graphical interface – No Problem but it actually started to fall asleep after a while. Not very good for a 24\/7 server \ud83d\ude42<\/p>\n

So after googling a bit i found a solution to completely disable all power-management and stop the machine from hibernating, suspend and sleep.<\/p>\n

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target<\/pre>\n

So what does this actually do?<\/p>\n

Sudo<\/strong> executes it as root because we need root rights to change the settings.<\/p>\n

systemctl<\/strong> is the actual command and it says in the man-pages:<\/p>\n

systemctl may be used to introspect and control the state of the systemd(1) system and service manager.<\/p><\/blockquote>\n

So it changes the “systemsettings”.<\/p>\n

The mask<\/strong> command does the following according to the man-pages:<\/p>\n

Mask one or more unit files, as specified on the command line. This will link these units to \/dev\/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of activation of the unit, including manual activation. Use this option with care. This honors the –runtime option to only mask temporarily until the next reboot of the system.<\/p><\/blockquote>\n

So it disables everything that we define afterwards:<\/p>\n

sleep.target suspend.target hibernate.target hybrid-sleep.target<\/pre>\n

Now the netbook runs through, even if i close the lid. Perfect.<\/p>\n

The reason why i chose an old netbook over a raspberry pi or similar is because of the battery. It will work for a few hours even if there is a power cut. So it is kinda like a build in UPS. And i already had the netbook and no other use for it.<\/p>\n

To save the battery it is advisable to NOT charge the battery all the time 100%. So it comes in very handy that the NC10 has a BIOS setting to charge the battery only to 80%. Which i checked with:<\/p>\n

sudo acpitool<\/pre>\n

and it shows me 79%.<\/p>\n

If you have any questions or remarks please use the comments.<\/p>\n

Cheers<\/p>\n","protected":false},"excerpt":{"rendered":"

I have an old netbook, a Samsung NC-10 to be precise, which i like to use as a server at home. So i decided to install Debian on it without any desktop or graphical interface – No Problem but it actually started to fall asleep after a while. Not very good for a 24\/7 server […]<\/p>\n","protected":false},"author":1,"featured_media":4502524,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[174],"tags":[],"yoast_head":"\nCompletely disable hibernation, suspend and sleep mode - AHOI 7<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Completely disable hibernation, suspend and sleep mode - AHOI 7\" \/>\n<meta property=\"og:description\" content=\"I have an old netbook, a Samsung NC-10 to be precise, which i like to use as a server at home. So i decided to install Debian on it without any desktop or graphical interface – No Problem but it actually started to fall asleep after a while. Not very good for a 24\/7 server […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/\" \/>\n<meta property=\"og:site_name\" content=\"AHOI 7\" \/>\n<meta property=\"article:author\" content=\"thomas.hartung\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-04T15:46:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-06T17:26:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@target_tom\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp.hartung.blog\/#website\",\"url\":\"https:\/\/wp.hartung.blog\/\",\"name\":\"AHOI 7\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp.hartung.blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#primaryimage\",\"inLanguage\":\"de-DE\",\"url\":\"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg\",\"contentUrl\":\"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#webpage\",\"url\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/\",\"name\":\"Completely disable hibernation, suspend and sleep mode - AHOI 7\",\"isPartOf\":{\"@id\":\"https:\/\/wp.hartung.blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#primaryimage\"},\"datePublished\":\"2017-03-04T15:46:41+00:00\",\"dateModified\":\"2021-04-06T17:26:48+00:00\",\"author\":{\"@id\":\"https:\/\/wp.hartung.blog\/#\/schema\/person\/ddf9979c78804a13e09deb428622b731\"},\"breadcrumb\":{\"@id\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\/\/wp.hartung.blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Completely disable hibernation, suspend and sleep mode\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wp.hartung.blog\/#\/schema\/person\/ddf9979c78804a13e09deb428622b731\",\"name\":\"Tom\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/wp.hartung.blog\/#personlogo\",\"inLanguage\":\"de-DE\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c50ddda1bdce51a3b96392b456c89a7b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c50ddda1bdce51a3b96392b456c89a7b?s=96&d=mm&r=g\",\"caption\":\"Tom\"},\"description\":\"Entspannter Typ\",\"sameAs\":[\"http:\/\/www.thomashartung.com\",\"thomas.hartung\",\"https:\/\/twitter.com\/target_tom\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Completely disable hibernation, suspend and sleep mode - AHOI 7","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/","og_locale":"de_DE","og_type":"article","og_title":"Completely disable hibernation, suspend and sleep mode - AHOI 7","og_description":"I have an old netbook, a Samsung NC-10 to be precise, which i like to use as a server at home. So i decided to install Debian on it without any desktop or graphical interface – No Problem but it actually started to fall asleep after a while. Not very good for a 24\/7 server […]","og_url":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/","og_site_name":"AHOI 7","article_author":"thomas.hartung","article_published_time":"2017-03-04T15:46:41+00:00","article_modified_time":"2021-04-06T17:26:48+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_creator":"@target_tom","twitter_misc":{"Verfasst von":"Tom","Gesch\u00e4tzte Lesezeit":"2 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/wp.hartung.blog\/#website","url":"https:\/\/wp.hartung.blog\/","name":"AHOI 7","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp.hartung.blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"ImageObject","@id":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#primaryimage","inLanguage":"de-DE","url":"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg","contentUrl":"https:\/\/wp.hartung.blog\/wp-content\/uploads\/laptop-5671064_1920.jpg","width":1920,"height":1080},{"@type":"WebPage","@id":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#webpage","url":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/","name":"Completely disable hibernation, suspend and sleep mode - AHOI 7","isPartOf":{"@id":"https:\/\/wp.hartung.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#primaryimage"},"datePublished":"2017-03-04T15:46:41+00:00","dateModified":"2021-04-06T17:26:48+00:00","author":{"@id":"https:\/\/wp.hartung.blog\/#\/schema\/person\/ddf9979c78804a13e09deb428622b731"},"breadcrumb":{"@id":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wp.hartung.blog\/disable-hibernate-suspend\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wp.hartung.blog\/"},{"@type":"ListItem","position":2,"name":"Completely disable hibernation, suspend and sleep mode"}]},{"@type":"Person","@id":"https:\/\/wp.hartung.blog\/#\/schema\/person\/ddf9979c78804a13e09deb428622b731","name":"Tom","image":{"@type":"ImageObject","@id":"https:\/\/wp.hartung.blog\/#personlogo","inLanguage":"de-DE","url":"https:\/\/secure.gravatar.com\/avatar\/c50ddda1bdce51a3b96392b456c89a7b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c50ddda1bdce51a3b96392b456c89a7b?s=96&d=mm&r=g","caption":"Tom"},"description":"Entspannter Typ","sameAs":["http:\/\/www.thomashartung.com","thomas.hartung","https:\/\/twitter.com\/target_tom"]}]}},"_links":{"self":[{"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":1,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":4502526,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/4502526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/media\/4502524"}],"wp:attachment":[{"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.hartung.blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}