How to disable auto suspend when I close laptop lid?Debian 8 (Jessie) - Laptop stops working after closing...

How to disable Two-factor authentication for Apple ID?

Single word that parallels "Recent" when discussing the near future

Do we have C++20 ranges library in GCC 9?

Why didn't the Avengers use this object earlier?

Show solution to recurrence is never a square

What information exactly does an instruction cache store?

Why can't I share a one use code with anyone else?

How to make a not so good looking person more appealing?

Is Valonqar prophecy unfulfilled?

Use of さ as a filler

Filter a data-frame and add a new column according to the given condition

Wireless headphones interfere with Wi-Fi signal on laptop

Extract the characters before last colon

Can a tourist shoot a gun for recreational purpose in the USA?

Offered a new position but unknown about salary?

Is this possible when it comes to the relations of P, NP, NP-Hard and NP-Complete?

How do I adjust encounters to challenge my lycanthrope players without negating their cool new abilities?

Should I communicate in my applications that I'm unemployed out of choice rather than because nobody will have me?

Promotion comes with unexpected 24/7/365 on-call

Ansible: use group_vars directly without with_items

Why are BJTs common in output stages of power amplifiers?

Motorola 6845 and bitwise graphics

Is there any way to adjust the damage type of the Eldritch Blast cantrip so that it does fire damage?

is it correct to say "When it started to rain, I was in the open air."



How to disable auto suspend when I close laptop lid?


Debian 8 (Jessie) - Laptop stops working after closing the laptop lidHow to disable suspend on close laptop lid on NixOS?How can one make a laptop remain pingable and continue running its daemons even after the lid is closed?Disabling hibernation in debian testing (lxde)How to completely inhibit lid switch events?Laptop lid closing freeze - UbuntuArch suspend when I close laptop lid?Asus UX303UA rebooting instead of resuming from suspend (ubuntu 15.10)How to disable suspend on close laptop lid on NixOS?Resuming from Suspend causes computer to shutdown under Linux MintDifference between suspend by echo “mem” > /sys/power/state and by suspend in XFCE?Checking battery level when ACPI has problemsTroubleshooting tips for Suspend-to-RAMHow does systemctl suspend work?Linux Mint Instant Resume When SuspendSuspend delayed after lid close






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







127















I'm using archlinux. It never auto-suspend before a recent system upgrade(maybe I updated the kernel?).



I think it is related to laptop-mode or acpid, so I stop them:



/etc/rc.d/laptop-mode stop
/etc/rc.d/acpid stop


I also edit /etc/laptop-mode/laptop-mode.conf:



ENABLE_LAPTOP_MODE_TOOLS=0


Then I edit /etc/acpi/actions/lm_lid.sh, commented out the last line:



# /usr/sbin/laptop_mode auto


But all of above don't work. Following lines were found in /var/log/kernel.log(unrelated lines omitted):



Oct 23 15:29:20 localhost kernel: [18617.549098] PM: Syncing filesystems ... done.
Oct 23 15:29:20 localhost kernel: [18618.001898] PM: Preparing system for mem sleep
Oct 23 15:29:30 localhost kernel: [18618.039565] Freezing user space processes ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.052596] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.065999] PM: Entering mem sleep
Oct 23 15:29:30 localhost kernel: [18618.066167] Suspending console(s) (use no_console_suspend to debug)
Oct 23 15:29:30 localhost kernel: [18618.097917] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Oct 23 15:29:30 localhost kernel: [18618.098103] sd 0:0:0:0: [sda] Stopping disk
Oct 23 15:29:30 localhost kernel: [18618.270537] snd_hda_intel 0000:00:14.2: power state changed by ACPI to D3hot
Oct 23 15:29:30 localhost kernel: [18619.274374] PM: suspend of devices complete after 1196.192 msecs
Oct 23 15:29:30 localhost kernel: [18619.274691] PM: late suspend of devices complete after 0.313 msecs
Oct 23 15:29:30 localhost kernel: [18619.440877] ohci_hcd 0000:00:14.5: wake-up capability enabled by ACPI
Oct 23 15:29:30 localhost kernel: [18619.642144] ACPI: Waking up from system sleep state S3
Oct 23 15:29:30 localhost kernel: [18620.049424] PM: noirq resume of devices complete after 333.503 msecs
Oct 23 15:29:30 localhost kernel: [18620.049852] PM: early resume of devices complete after 0.334 msecs
Oct 23 15:29:30 localhost kernel: [18622.418605] PM: resume of devices complete after 2371.906 msecs
Oct 23 15:29:30 localhost kernel: [18622.419018] PM: Finishing wakeup.
Oct 23 15:29:30 localhost kernel: [18622.419019] Restarting tasks ... done.
Oct 23 15:29:30 localhost kernel: [18622.464752] video LNXVIDEO:01: Restoring backlight state


I think this is not caused by pm-susend, because /var/log/pm-suspend.log don't log anything.



I don't want my laptop go to sleep when I close the lid. How to do it?



Kernel version: 3.6.2-1-ARCH










share|improve this question




















  • 2





    I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

    – cjm
    Nov 11 '12 at 1:04








  • 1





    On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

    – CDuv
    Oct 17 '15 at 21:39


















127















I'm using archlinux. It never auto-suspend before a recent system upgrade(maybe I updated the kernel?).



I think it is related to laptop-mode or acpid, so I stop them:



/etc/rc.d/laptop-mode stop
/etc/rc.d/acpid stop


I also edit /etc/laptop-mode/laptop-mode.conf:



ENABLE_LAPTOP_MODE_TOOLS=0


Then I edit /etc/acpi/actions/lm_lid.sh, commented out the last line:



# /usr/sbin/laptop_mode auto


But all of above don't work. Following lines were found in /var/log/kernel.log(unrelated lines omitted):



Oct 23 15:29:20 localhost kernel: [18617.549098] PM: Syncing filesystems ... done.
Oct 23 15:29:20 localhost kernel: [18618.001898] PM: Preparing system for mem sleep
Oct 23 15:29:30 localhost kernel: [18618.039565] Freezing user space processes ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.052596] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.065999] PM: Entering mem sleep
Oct 23 15:29:30 localhost kernel: [18618.066167] Suspending console(s) (use no_console_suspend to debug)
Oct 23 15:29:30 localhost kernel: [18618.097917] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Oct 23 15:29:30 localhost kernel: [18618.098103] sd 0:0:0:0: [sda] Stopping disk
Oct 23 15:29:30 localhost kernel: [18618.270537] snd_hda_intel 0000:00:14.2: power state changed by ACPI to D3hot
Oct 23 15:29:30 localhost kernel: [18619.274374] PM: suspend of devices complete after 1196.192 msecs
Oct 23 15:29:30 localhost kernel: [18619.274691] PM: late suspend of devices complete after 0.313 msecs
Oct 23 15:29:30 localhost kernel: [18619.440877] ohci_hcd 0000:00:14.5: wake-up capability enabled by ACPI
Oct 23 15:29:30 localhost kernel: [18619.642144] ACPI: Waking up from system sleep state S3
Oct 23 15:29:30 localhost kernel: [18620.049424] PM: noirq resume of devices complete after 333.503 msecs
Oct 23 15:29:30 localhost kernel: [18620.049852] PM: early resume of devices complete after 0.334 msecs
Oct 23 15:29:30 localhost kernel: [18622.418605] PM: resume of devices complete after 2371.906 msecs
Oct 23 15:29:30 localhost kernel: [18622.419018] PM: Finishing wakeup.
Oct 23 15:29:30 localhost kernel: [18622.419019] Restarting tasks ... done.
Oct 23 15:29:30 localhost kernel: [18622.464752] video LNXVIDEO:01: Restoring backlight state


I think this is not caused by pm-susend, because /var/log/pm-suspend.log don't log anything.



I don't want my laptop go to sleep when I close the lid. How to do it?



Kernel version: 3.6.2-1-ARCH










share|improve this question




















  • 2





    I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

    – cjm
    Nov 11 '12 at 1:04








  • 1





    On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

    – CDuv
    Oct 17 '15 at 21:39














127












127








127


56






I'm using archlinux. It never auto-suspend before a recent system upgrade(maybe I updated the kernel?).



I think it is related to laptop-mode or acpid, so I stop them:



/etc/rc.d/laptop-mode stop
/etc/rc.d/acpid stop


I also edit /etc/laptop-mode/laptop-mode.conf:



ENABLE_LAPTOP_MODE_TOOLS=0


Then I edit /etc/acpi/actions/lm_lid.sh, commented out the last line:



# /usr/sbin/laptop_mode auto


But all of above don't work. Following lines were found in /var/log/kernel.log(unrelated lines omitted):



Oct 23 15:29:20 localhost kernel: [18617.549098] PM: Syncing filesystems ... done.
Oct 23 15:29:20 localhost kernel: [18618.001898] PM: Preparing system for mem sleep
Oct 23 15:29:30 localhost kernel: [18618.039565] Freezing user space processes ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.052596] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.065999] PM: Entering mem sleep
Oct 23 15:29:30 localhost kernel: [18618.066167] Suspending console(s) (use no_console_suspend to debug)
Oct 23 15:29:30 localhost kernel: [18618.097917] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Oct 23 15:29:30 localhost kernel: [18618.098103] sd 0:0:0:0: [sda] Stopping disk
Oct 23 15:29:30 localhost kernel: [18618.270537] snd_hda_intel 0000:00:14.2: power state changed by ACPI to D3hot
Oct 23 15:29:30 localhost kernel: [18619.274374] PM: suspend of devices complete after 1196.192 msecs
Oct 23 15:29:30 localhost kernel: [18619.274691] PM: late suspend of devices complete after 0.313 msecs
Oct 23 15:29:30 localhost kernel: [18619.440877] ohci_hcd 0000:00:14.5: wake-up capability enabled by ACPI
Oct 23 15:29:30 localhost kernel: [18619.642144] ACPI: Waking up from system sleep state S3
Oct 23 15:29:30 localhost kernel: [18620.049424] PM: noirq resume of devices complete after 333.503 msecs
Oct 23 15:29:30 localhost kernel: [18620.049852] PM: early resume of devices complete after 0.334 msecs
Oct 23 15:29:30 localhost kernel: [18622.418605] PM: resume of devices complete after 2371.906 msecs
Oct 23 15:29:30 localhost kernel: [18622.419018] PM: Finishing wakeup.
Oct 23 15:29:30 localhost kernel: [18622.419019] Restarting tasks ... done.
Oct 23 15:29:30 localhost kernel: [18622.464752] video LNXVIDEO:01: Restoring backlight state


I think this is not caused by pm-susend, because /var/log/pm-suspend.log don't log anything.



I don't want my laptop go to sleep when I close the lid. How to do it?



Kernel version: 3.6.2-1-ARCH










share|improve this question
















I'm using archlinux. It never auto-suspend before a recent system upgrade(maybe I updated the kernel?).



I think it is related to laptop-mode or acpid, so I stop them:



/etc/rc.d/laptop-mode stop
/etc/rc.d/acpid stop


I also edit /etc/laptop-mode/laptop-mode.conf:



ENABLE_LAPTOP_MODE_TOOLS=0


Then I edit /etc/acpi/actions/lm_lid.sh, commented out the last line:



# /usr/sbin/laptop_mode auto


But all of above don't work. Following lines were found in /var/log/kernel.log(unrelated lines omitted):



Oct 23 15:29:20 localhost kernel: [18617.549098] PM: Syncing filesystems ... done.
Oct 23 15:29:20 localhost kernel: [18618.001898] PM: Preparing system for mem sleep
Oct 23 15:29:30 localhost kernel: [18618.039565] Freezing user space processes ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.052596] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Oct 23 15:29:30 localhost kernel: [18618.065999] PM: Entering mem sleep
Oct 23 15:29:30 localhost kernel: [18618.066167] Suspending console(s) (use no_console_suspend to debug)
Oct 23 15:29:30 localhost kernel: [18618.097917] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Oct 23 15:29:30 localhost kernel: [18618.098103] sd 0:0:0:0: [sda] Stopping disk
Oct 23 15:29:30 localhost kernel: [18618.270537] snd_hda_intel 0000:00:14.2: power state changed by ACPI to D3hot
Oct 23 15:29:30 localhost kernel: [18619.274374] PM: suspend of devices complete after 1196.192 msecs
Oct 23 15:29:30 localhost kernel: [18619.274691] PM: late suspend of devices complete after 0.313 msecs
Oct 23 15:29:30 localhost kernel: [18619.440877] ohci_hcd 0000:00:14.5: wake-up capability enabled by ACPI
Oct 23 15:29:30 localhost kernel: [18619.642144] ACPI: Waking up from system sleep state S3
Oct 23 15:29:30 localhost kernel: [18620.049424] PM: noirq resume of devices complete after 333.503 msecs
Oct 23 15:29:30 localhost kernel: [18620.049852] PM: early resume of devices complete after 0.334 msecs
Oct 23 15:29:30 localhost kernel: [18622.418605] PM: resume of devices complete after 2371.906 msecs
Oct 23 15:29:30 localhost kernel: [18622.419018] PM: Finishing wakeup.
Oct 23 15:29:30 localhost kernel: [18622.419019] Restarting tasks ... done.
Oct 23 15:29:30 localhost kernel: [18622.464752] video LNXVIDEO:01: Restoring backlight state


I think this is not caused by pm-susend, because /var/log/pm-suspend.log don't log anything.



I don't want my laptop go to sleep when I close the lid. How to do it?



Kernel version: 3.6.2-1-ARCH







arch-linux laptop suspend acpi laptop-mode






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 23 '12 at 8:13







heiz

















asked Oct 23 '12 at 8:05









heizheiz

763267




763267








  • 2





    I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

    – cjm
    Nov 11 '12 at 1:04








  • 1





    On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

    – CDuv
    Oct 17 '15 at 21:39














  • 2





    I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

    – cjm
    Nov 11 '12 at 1:04








  • 1





    On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

    – CDuv
    Oct 17 '15 at 21:39








2




2





I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

– cjm
Nov 11 '12 at 1:04







I was just about to ask this myself when your question popped up in "Questions that may already have your answer." It did. Thanks.

– cjm
Nov 11 '12 at 1:04






1




1





On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

– CDuv
Oct 17 '15 at 21:39





On Debian 8 "Jessie" the command systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target disables every type suspension.

– CDuv
Oct 17 '15 at 21:39










3 Answers
3






active

oldest

votes


















156














Edit /etc/systemd/logind.conf and make sure you have,



HandleLidSwitch=ignore


which will make it ignore the lid being closed. (You may need to also undo the other changes you've made).



Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments):



systemctl restart systemd-logind


Full details over at the archlinux Wiki.



The man page for logind.conf also has the relevant information,



   HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=,
HandleLidSwitch=
Controls whether logind shall handle the system power and sleep
keys and the lid switch to trigger actions such as system power-off
or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
suspend, hibernate, hybrid-sleep and lock. If ignore logind will
never handle these keys. If lock all running sessions will be
screen locked. Otherwise the specified action will be taken in the
respective event. Only input devices with the power-switch udev tag
will be watched for key/lid switch events. HandlePowerKey=
defaults to poweroff. HandleSuspendKey= and HandleLidSwitch=
default to suspend. HandleHibernateKey= defaults to hibernate.





share|improve this answer





















  • 16





    After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

    – Ehtesh Choudhury
    Jul 4 '13 at 7:08








  • 11





    Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

    – cedbeu
    Aug 1 '13 at 12:29






  • 2





    it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

    – Ehtesh Choudhury
    Dec 9 '13 at 21:26






  • 1





    The related topic is moved to Power management on Arch Wiki.

    – day
    Apr 1 '14 at 20:08








  • 3





    systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

    – Mehdi Sadeghi
    Nov 14 '16 at 13:25





















22














You can use this to temporarily disable lid-switch events:



systemd-inhibit --what=handle-lid-switch sleep 1d





share|improve this answer



















  • 3





    Never knew of systemd-inhibit before now, very cool

    – Hubro
    Jun 10 '16 at 10:34











  • I think it used to be in the arch-wiki -- idk what happened.

    – user3467349
    Jun 10 '16 at 12:31






  • 2





    That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

    – CMCDragonkai
    Jul 3 '16 at 11:17






  • 3





    What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

    – user3467349
    Jul 9 '16 at 0:09













  • Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

    – malan
    Jun 18 '18 at 21:58



















0














Thank you thank you thank you! I was trying to boot my linux box from power up while the lid is closed, and you trick saved my day. 4 years later!






share|improve this answer








New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

    – 0xSheepdog
    1 hour ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f52643%2fhow-to-disable-auto-suspend-when-i-close-laptop-lid%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









156














Edit /etc/systemd/logind.conf and make sure you have,



HandleLidSwitch=ignore


which will make it ignore the lid being closed. (You may need to also undo the other changes you've made).



Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments):



systemctl restart systemd-logind


Full details over at the archlinux Wiki.



The man page for logind.conf also has the relevant information,



   HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=,
HandleLidSwitch=
Controls whether logind shall handle the system power and sleep
keys and the lid switch to trigger actions such as system power-off
or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
suspend, hibernate, hybrid-sleep and lock. If ignore logind will
never handle these keys. If lock all running sessions will be
screen locked. Otherwise the specified action will be taken in the
respective event. Only input devices with the power-switch udev tag
will be watched for key/lid switch events. HandlePowerKey=
defaults to poweroff. HandleSuspendKey= and HandleLidSwitch=
default to suspend. HandleHibernateKey= defaults to hibernate.





share|improve this answer





















  • 16





    After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

    – Ehtesh Choudhury
    Jul 4 '13 at 7:08








  • 11





    Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

    – cedbeu
    Aug 1 '13 at 12:29






  • 2





    it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

    – Ehtesh Choudhury
    Dec 9 '13 at 21:26






  • 1





    The related topic is moved to Power management on Arch Wiki.

    – day
    Apr 1 '14 at 20:08








  • 3





    systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

    – Mehdi Sadeghi
    Nov 14 '16 at 13:25


















156














Edit /etc/systemd/logind.conf and make sure you have,



HandleLidSwitch=ignore


which will make it ignore the lid being closed. (You may need to also undo the other changes you've made).



Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments):



systemctl restart systemd-logind


Full details over at the archlinux Wiki.



The man page for logind.conf also has the relevant information,



   HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=,
HandleLidSwitch=
Controls whether logind shall handle the system power and sleep
keys and the lid switch to trigger actions such as system power-off
or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
suspend, hibernate, hybrid-sleep and lock. If ignore logind will
never handle these keys. If lock all running sessions will be
screen locked. Otherwise the specified action will be taken in the
respective event. Only input devices with the power-switch udev tag
will be watched for key/lid switch events. HandlePowerKey=
defaults to poweroff. HandleSuspendKey= and HandleLidSwitch=
default to suspend. HandleHibernateKey= defaults to hibernate.





share|improve this answer





















  • 16





    After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

    – Ehtesh Choudhury
    Jul 4 '13 at 7:08








  • 11





    Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

    – cedbeu
    Aug 1 '13 at 12:29






  • 2





    it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

    – Ehtesh Choudhury
    Dec 9 '13 at 21:26






  • 1





    The related topic is moved to Power management on Arch Wiki.

    – day
    Apr 1 '14 at 20:08








  • 3





    systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

    – Mehdi Sadeghi
    Nov 14 '16 at 13:25
















156












156








156







Edit /etc/systemd/logind.conf and make sure you have,



HandleLidSwitch=ignore


which will make it ignore the lid being closed. (You may need to also undo the other changes you've made).



Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments):



systemctl restart systemd-logind


Full details over at the archlinux Wiki.



The man page for logind.conf also has the relevant information,



   HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=,
HandleLidSwitch=
Controls whether logind shall handle the system power and sleep
keys and the lid switch to trigger actions such as system power-off
or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
suspend, hibernate, hybrid-sleep and lock. If ignore logind will
never handle these keys. If lock all running sessions will be
screen locked. Otherwise the specified action will be taken in the
respective event. Only input devices with the power-switch udev tag
will be watched for key/lid switch events. HandlePowerKey=
defaults to poweroff. HandleSuspendKey= and HandleLidSwitch=
default to suspend. HandleHibernateKey= defaults to hibernate.





share|improve this answer















Edit /etc/systemd/logind.conf and make sure you have,



HandleLidSwitch=ignore


which will make it ignore the lid being closed. (You may need to also undo the other changes you've made).



Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments):



systemctl restart systemd-logind


Full details over at the archlinux Wiki.



The man page for logind.conf also has the relevant information,



   HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=,
HandleLidSwitch=
Controls whether logind shall handle the system power and sleep
keys and the lid switch to trigger actions such as system power-off
or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
suspend, hibernate, hybrid-sleep and lock. If ignore logind will
never handle these keys. If lock all running sessions will be
screen locked. Otherwise the specified action will be taken in the
respective event. Only input devices with the power-switch udev tag
will be watched for key/lid switch events. HandlePowerKey=
defaults to poweroff. HandleSuspendKey= and HandleLidSwitch=
default to suspend. HandleHibernateKey= defaults to hibernate.






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 29 '15 at 5:31









Wildcard

23.5k1068174




23.5k1068174










answered Oct 23 '12 at 8:24









EightBitTonyEightBitTony

16.6k34454




16.6k34454








  • 16





    After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

    – Ehtesh Choudhury
    Jul 4 '13 at 7:08








  • 11





    Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

    – cedbeu
    Aug 1 '13 at 12:29






  • 2





    it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

    – Ehtesh Choudhury
    Dec 9 '13 at 21:26






  • 1





    The related topic is moved to Power management on Arch Wiki.

    – day
    Apr 1 '14 at 20:08








  • 3





    systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

    – Mehdi Sadeghi
    Nov 14 '16 at 13:25
















  • 16





    After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

    – Ehtesh Choudhury
    Jul 4 '13 at 7:08








  • 11





    Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

    – cedbeu
    Aug 1 '13 at 12:29






  • 2





    it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

    – Ehtesh Choudhury
    Dec 9 '13 at 21:26






  • 1





    The related topic is moved to Power management on Arch Wiki.

    – day
    Apr 1 '14 at 20:08








  • 3





    systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

    – Mehdi Sadeghi
    Nov 14 '16 at 13:25










16




16





After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

– Ehtesh Choudhury
Jul 4 '13 at 7:08







After changing HandleLidSwitch, how do I reload logind.conf on the fly? Nevermind, it's systemctl stop systemd-logind && systemctl start systemd-logind.

– Ehtesh Choudhury
Jul 4 '13 at 7:08






11




11





Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

– cedbeu
Aug 1 '13 at 12:29





Or maybe systemctl restart systemd-logind, or even just systemctl reload systemd-logind? not sure it's enough, thus, looking forward for a reply before trying to close my lid (long computation in progress... (: ). Also, isn't there an userspace tool that can manage such acpi features?

– cedbeu
Aug 1 '13 at 12:29




2




2





it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

– Ehtesh Choudhury
Dec 9 '13 at 21:26





it's definitely not on the wiki anymore, and I don't see a logind.conf article (short of the small section on that page).

– Ehtesh Choudhury
Dec 9 '13 at 21:26




1




1





The related topic is moved to Power management on Arch Wiki.

– day
Apr 1 '14 at 20:08







The related topic is moved to Power management on Arch Wiki.

– day
Apr 1 '14 at 20:08






3




3





systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

– Mehdi Sadeghi
Nov 14 '16 at 13:25







systemctl restart systemd-logind caused my Archlinux with GNOME-shell desktop freeze. Be prepared.

– Mehdi Sadeghi
Nov 14 '16 at 13:25















22














You can use this to temporarily disable lid-switch events:



systemd-inhibit --what=handle-lid-switch sleep 1d





share|improve this answer



















  • 3





    Never knew of systemd-inhibit before now, very cool

    – Hubro
    Jun 10 '16 at 10:34











  • I think it used to be in the arch-wiki -- idk what happened.

    – user3467349
    Jun 10 '16 at 12:31






  • 2





    That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

    – CMCDragonkai
    Jul 3 '16 at 11:17






  • 3





    What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

    – user3467349
    Jul 9 '16 at 0:09













  • Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

    – malan
    Jun 18 '18 at 21:58
















22














You can use this to temporarily disable lid-switch events:



systemd-inhibit --what=handle-lid-switch sleep 1d





share|improve this answer



















  • 3





    Never knew of systemd-inhibit before now, very cool

    – Hubro
    Jun 10 '16 at 10:34











  • I think it used to be in the arch-wiki -- idk what happened.

    – user3467349
    Jun 10 '16 at 12:31






  • 2





    That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

    – CMCDragonkai
    Jul 3 '16 at 11:17






  • 3





    What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

    – user3467349
    Jul 9 '16 at 0:09













  • Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

    – malan
    Jun 18 '18 at 21:58














22












22








22







You can use this to temporarily disable lid-switch events:



systemd-inhibit --what=handle-lid-switch sleep 1d





share|improve this answer













You can use this to temporarily disable lid-switch events:



systemd-inhibit --what=handle-lid-switch sleep 1d






share|improve this answer












share|improve this answer



share|improve this answer










answered May 26 '16 at 2:34









user3467349user3467349

26926




26926








  • 3





    Never knew of systemd-inhibit before now, very cool

    – Hubro
    Jun 10 '16 at 10:34











  • I think it used to be in the arch-wiki -- idk what happened.

    – user3467349
    Jun 10 '16 at 12:31






  • 2





    That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

    – CMCDragonkai
    Jul 3 '16 at 11:17






  • 3





    What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

    – user3467349
    Jul 9 '16 at 0:09













  • Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

    – malan
    Jun 18 '18 at 21:58














  • 3





    Never knew of systemd-inhibit before now, very cool

    – Hubro
    Jun 10 '16 at 10:34











  • I think it used to be in the arch-wiki -- idk what happened.

    – user3467349
    Jun 10 '16 at 12:31






  • 2





    That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

    – CMCDragonkai
    Jul 3 '16 at 11:17






  • 3





    What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

    – user3467349
    Jul 9 '16 at 0:09













  • Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

    – malan
    Jun 18 '18 at 21:58








3




3





Never knew of systemd-inhibit before now, very cool

– Hubro
Jun 10 '16 at 10:34





Never knew of systemd-inhibit before now, very cool

– Hubro
Jun 10 '16 at 10:34













I think it used to be in the arch-wiki -- idk what happened.

– user3467349
Jun 10 '16 at 12:31





I think it used to be in the arch-wiki -- idk what happened.

– user3467349
Jun 10 '16 at 12:31




2




2





That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

– CMCDragonkai
Jul 3 '16 at 11:17





That just inhibits handle-lid-switch for a particular command, in this case sleep 1d. But it doesn't disable auto-suspend when closing the laptop lid in general.

– CMCDragonkai
Jul 3 '16 at 11:17




3




3





What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

– user3467349
Jul 9 '16 at 0:09







What I wrote was You can use this to temporarily disable lid-switch events -- which is most commonly what I or other people may want. So I'm not sure what your comment is about?

– user3467349
Jul 9 '16 at 0:09















Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

– malan
Jun 18 '18 at 21:58





Does 1d mean 1 day? If so, what are the other options? h, m, s? I cannot find anything explicitly explaining the final portion of your command.

– malan
Jun 18 '18 at 21:58











0














Thank you thank you thank you! I was trying to boot my linux box from power up while the lid is closed, and you trick saved my day. 4 years later!






share|improve this answer








New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

    – 0xSheepdog
    1 hour ago
















0














Thank you thank you thank you! I was trying to boot my linux box from power up while the lid is closed, and you trick saved my day. 4 years later!






share|improve this answer








New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

    – 0xSheepdog
    1 hour ago














0












0








0







Thank you thank you thank you! I was trying to boot my linux box from power up while the lid is closed, and you trick saved my day. 4 years later!






share|improve this answer








New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









Thank you thank you thank you! I was trying to boot my linux box from power up while the lid is closed, and you trick saved my day. 4 years later!







share|improve this answer








New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this answer



share|improve this answer






New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








answered 2 hours ago









ZizZiz

1




1




New contributor



Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Ziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

    – 0xSheepdog
    1 hour ago



















  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

    – 0xSheepdog
    1 hour ago

















Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

– 0xSheepdog
1 hour ago





Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review

– 0xSheepdog
1 hour ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f52643%2fhow-to-disable-auto-suspend-when-i-close-laptop-lid%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...