Keep Ubuntu Server running on a laptop with the lid closed?





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







33















I decided to use my Eee PC 1001HA as a home server. I have it connected through Wi-Fi to the router, running Ubuntu Server 12.04. Everything works fine except this annoying problem:



when I close the lid, the ssh server stops working and, I guess, wlan0 too.



Tried the BIOS and nothing, no option about the lid. My wlan0 is a RaLink RT3090.



Tried ls -lrt /var/log between lid derivatives, but I can't understand those satanic logs. I can share them if needed.



pm-powersave.log seems to be updated between lid movements. So I guess I've to disable this "powersave" service. Can I do this? I don't mind if the server runs all day.



Remember that there is no UI, this is a netbook with a lid and its connected to the ac adapter.



edit: This is just a workaround but I am able to click the power-button and close the lid quickly. This way the server boots normally and connects to the wireless network automatically. (found here)










share|improve this question

























  • Try: sudo nano /etc/default/acpi-support

    – user164045
    Jun 3 '13 at 7:46











  • The answers at this location helped me - askubuntu.com/questions/360615/…

    – Sepero
    Jun 4 '14 at 15:34











  • See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

    – imz -- Ivan Zakharyaschev
    Jul 20 '15 at 9:59


















33















I decided to use my Eee PC 1001HA as a home server. I have it connected through Wi-Fi to the router, running Ubuntu Server 12.04. Everything works fine except this annoying problem:



when I close the lid, the ssh server stops working and, I guess, wlan0 too.



Tried the BIOS and nothing, no option about the lid. My wlan0 is a RaLink RT3090.



Tried ls -lrt /var/log between lid derivatives, but I can't understand those satanic logs. I can share them if needed.



pm-powersave.log seems to be updated between lid movements. So I guess I've to disable this "powersave" service. Can I do this? I don't mind if the server runs all day.



Remember that there is no UI, this is a netbook with a lid and its connected to the ac adapter.



edit: This is just a workaround but I am able to click the power-button and close the lid quickly. This way the server boots normally and connects to the wireless network automatically. (found here)










share|improve this question

























  • Try: sudo nano /etc/default/acpi-support

    – user164045
    Jun 3 '13 at 7:46











  • The answers at this location helped me - askubuntu.com/questions/360615/…

    – Sepero
    Jun 4 '14 at 15:34











  • See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

    – imz -- Ivan Zakharyaschev
    Jul 20 '15 at 9:59














33












33








33


17






I decided to use my Eee PC 1001HA as a home server. I have it connected through Wi-Fi to the router, running Ubuntu Server 12.04. Everything works fine except this annoying problem:



when I close the lid, the ssh server stops working and, I guess, wlan0 too.



Tried the BIOS and nothing, no option about the lid. My wlan0 is a RaLink RT3090.



Tried ls -lrt /var/log between lid derivatives, but I can't understand those satanic logs. I can share them if needed.



pm-powersave.log seems to be updated between lid movements. So I guess I've to disable this "powersave" service. Can I do this? I don't mind if the server runs all day.



Remember that there is no UI, this is a netbook with a lid and its connected to the ac adapter.



edit: This is just a workaround but I am able to click the power-button and close the lid quickly. This way the server boots normally and connects to the wireless network automatically. (found here)










share|improve this question
















I decided to use my Eee PC 1001HA as a home server. I have it connected through Wi-Fi to the router, running Ubuntu Server 12.04. Everything works fine except this annoying problem:



when I close the lid, the ssh server stops working and, I guess, wlan0 too.



Tried the BIOS and nothing, no option about the lid. My wlan0 is a RaLink RT3090.



Tried ls -lrt /var/log between lid derivatives, but I can't understand those satanic logs. I can share them if needed.



pm-powersave.log seems to be updated between lid movements. So I guess I've to disable this "powersave" service. Can I do this? I don't mind if the server runs all day.



Remember that there is no UI, this is a netbook with a lid and its connected to the ac adapter.



edit: This is just a workaround but I am able to click the power-button and close the lid quickly. This way the server boots normally and connects to the wireless network automatically. (found here)







power-management






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 '14 at 14:25









Braiam

52.6k20138223




52.6k20138223










asked May 25 '12 at 0:07









ffunengaffunenga

189237




189237













  • Try: sudo nano /etc/default/acpi-support

    – user164045
    Jun 3 '13 at 7:46











  • The answers at this location helped me - askubuntu.com/questions/360615/…

    – Sepero
    Jun 4 '14 at 15:34











  • See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

    – imz -- Ivan Zakharyaschev
    Jul 20 '15 at 9:59



















  • Try: sudo nano /etc/default/acpi-support

    – user164045
    Jun 3 '13 at 7:46











  • The answers at this location helped me - askubuntu.com/questions/360615/…

    – Sepero
    Jun 4 '14 at 15:34











  • See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

    – imz -- Ivan Zakharyaschev
    Jul 20 '15 at 9:59

















Try: sudo nano /etc/default/acpi-support

– user164045
Jun 3 '13 at 7:46





Try: sudo nano /etc/default/acpi-support

– user164045
Jun 3 '13 at 7:46













The answers at this location helped me - askubuntu.com/questions/360615/…

– Sepero
Jun 4 '14 at 15:34





The answers at this location helped me - askubuntu.com/questions/360615/…

– Sepero
Jun 4 '14 at 15:34













See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

– imz -- Ivan Zakharyaschev
Jul 20 '15 at 9:59





See also How can I tell Ubuntu to do nothing when I close my laptop lid?.

– imz -- Ivan Zakharyaschev
Jul 20 '15 at 9:59










7 Answers
7






active

oldest

votes


















60














To disable entering the sleep mode I had to edit the /etc/systemd/logind.conf file and modify the line:



#HandleLidSwitch=suspend


to



HandleLidSwitch=ignore


Then do



sudo service systemd-logind restart





share|improve this answer





















  • 3





    sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

    – FreeSoftwareServers
    Dec 22 '15 at 5:38











  • Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

    – FreeSoftwareServers
    Dec 22 '15 at 5:38








  • 3





    Worked for me on 16.06 (Lenovo Thinkpad P50)

    – Simon B
    Aug 9 '16 at 7:23






  • 1





    meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

    – Pas_
    Nov 14 '16 at 18:39








  • 3





    HandleLidSwitch=lock If you want the extra security

    – myol
    Dec 24 '16 at 23:00



















9














just to confirm, 14.04 LTS Server user here on a Dell X100e.



sudo apt-get install acpi-support
sudo vi /etc/default/acpi-support # and then set SUSPEND_METHODS="none"
sudo /etc/init.d/acpid restart


Instantly able to close lid, no issues.



Just posting to confirm the previous posters' solution as the only fix needed. No need (currently) to do anything else in addition to this.






share|improve this answer





















  • 2





    This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

    – lonstar
    Dec 13 '14 at 16:04











  • This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

    – VeenarM
    Dec 24 '15 at 12:10



















5














Everything stops working because...the laptop goes to sleep! (suspend mode).



To stop, just disable the ACPI lid-button event.



Edit /etc/acpi/event/lidbtn and comment out the bottom two lines:





# /etc/acpi/events/lidbtn
# Called when the user closes or opens the lid
event=button[ /]lid # comment this out with a # at the beginning
action=/etc/acpi/lid.sh # same here


Reboot, and that should be it.






share|improve this answer



















  • 7





    Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

    – ffunenga
    May 25 '12 at 5:54



















3














I am using 14.04 LTS with ASUS EEE.



The solution by Stephan above didn't work for me. However, this answer worked.






share|improve this answer


























  • I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

    – imz -- Ivan Zakharyaschev
    Jul 20 '15 at 9:56



















2














I think setting the SUSPEND_METHODS="none" option in /etc/default/acpi-support, does the same thing






share|improve this answer

































    1














    Turn off laptop screen when closed



    This works for me on a new install of Ubuntu Server LTS 18.04.1.



    The answer from @user386160 worked great to prevent my laptop from going to sleep. But I found out that my monitor was staying on even when the lid was closed (a.k.a. generating unnecessary heat).



    Here's the additional steps I took to turn off the laptop monitor when the screen was closed:



    sudo apt-get install acpi-support vbetool
    sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
    sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
    sudo touch /etc/acpi/lid.sh
    sudo chmod +x /etc/acpi/lid.sh
    sudo nano /etc/acpi/lid.sh


    Then set the contents of the lid.sh file to the following:



    #!/bin/bash

    grep -q close /proc/acpi/button/lid/*/state

    if [ $? = 0 ]; then
    sleep 0.2 && vbetool dpms off
    fi

    grep -q open /proc/acpi/button/lid/*/state

    if [ $? = 0 ]; then
    vbetool dpms on
    fi





    share|improve this answer































      0














      This worked for me - my Ubuntu Server install didn't have /etc/acpi/event/lidbtn either, but I installed the acpi-support package and then it showed up.



      The package installs a whole bunch of other X11 related packages but doesn't enable graphical mode, don't worry.



      Once I commented the last two lines as above then my laptop stayed running with the lid closed.






      share|improve this answer
























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        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: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        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%2faskubuntu.com%2fquestions%2f141866%2fkeep-ubuntu-server-running-on-a-laptop-with-the-lid-closed%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        7 Answers
        7






        active

        oldest

        votes








        7 Answers
        7






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        60














        To disable entering the sleep mode I had to edit the /etc/systemd/logind.conf file and modify the line:



        #HandleLidSwitch=suspend


        to



        HandleLidSwitch=ignore


        Then do



        sudo service systemd-logind restart





        share|improve this answer





















        • 3





          sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

          – FreeSoftwareServers
          Dec 22 '15 at 5:38











        • Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

          – FreeSoftwareServers
          Dec 22 '15 at 5:38








        • 3





          Worked for me on 16.06 (Lenovo Thinkpad P50)

          – Simon B
          Aug 9 '16 at 7:23






        • 1





          meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

          – Pas_
          Nov 14 '16 at 18:39








        • 3





          HandleLidSwitch=lock If you want the extra security

          – myol
          Dec 24 '16 at 23:00
















        60














        To disable entering the sleep mode I had to edit the /etc/systemd/logind.conf file and modify the line:



        #HandleLidSwitch=suspend


        to



        HandleLidSwitch=ignore


        Then do



        sudo service systemd-logind restart





        share|improve this answer





















        • 3





          sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

          – FreeSoftwareServers
          Dec 22 '15 at 5:38











        • Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

          – FreeSoftwareServers
          Dec 22 '15 at 5:38








        • 3





          Worked for me on 16.06 (Lenovo Thinkpad P50)

          – Simon B
          Aug 9 '16 at 7:23






        • 1





          meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

          – Pas_
          Nov 14 '16 at 18:39








        • 3





          HandleLidSwitch=lock If you want the extra security

          – myol
          Dec 24 '16 at 23:00














        60












        60








        60







        To disable entering the sleep mode I had to edit the /etc/systemd/logind.conf file and modify the line:



        #HandleLidSwitch=suspend


        to



        HandleLidSwitch=ignore


        Then do



        sudo service systemd-logind restart





        share|improve this answer















        To disable entering the sleep mode I had to edit the /etc/systemd/logind.conf file and modify the line:



        #HandleLidSwitch=suspend


        to



        HandleLidSwitch=ignore


        Then do



        sudo service systemd-logind restart






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 25 '17 at 8:59









        luator

        1039




        1039










        answered Mar 9 '15 at 0:59









        user386160user386160

        60152




        60152








        • 3





          sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

          – FreeSoftwareServers
          Dec 22 '15 at 5:38











        • Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

          – FreeSoftwareServers
          Dec 22 '15 at 5:38








        • 3





          Worked for me on 16.06 (Lenovo Thinkpad P50)

          – Simon B
          Aug 9 '16 at 7:23






        • 1





          meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

          – Pas_
          Nov 14 '16 at 18:39








        • 3





          HandleLidSwitch=lock If you want the extra security

          – myol
          Dec 24 '16 at 23:00














        • 3





          sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

          – FreeSoftwareServers
          Dec 22 '15 at 5:38











        • Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

          – FreeSoftwareServers
          Dec 22 '15 at 5:38








        • 3





          Worked for me on 16.06 (Lenovo Thinkpad P50)

          – Simon B
          Aug 9 '16 at 7:23






        • 1





          meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

          – Pas_
          Nov 14 '16 at 18:39








        • 3





          HandleLidSwitch=lock If you want the extra security

          – myol
          Dec 24 '16 at 23:00








        3




        3





        sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

        – FreeSoftwareServers
        Dec 22 '15 at 5:38





        sudo sh -c 'echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf' && reboot

        – FreeSoftwareServers
        Dec 22 '15 at 5:38













        Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

        – FreeSoftwareServers
        Dec 22 '15 at 5:38







        Worked for me on 14.04 x64 server (Lenovo ThinkPad T410)

        – FreeSoftwareServers
        Dec 22 '15 at 5:38






        3




        3





        Worked for me on 16.06 (Lenovo Thinkpad P50)

        – Simon B
        Aug 9 '16 at 7:23





        Worked for me on 16.06 (Lenovo Thinkpad P50)

        – Simon B
        Aug 9 '16 at 7:23




        1




        1





        meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

        – Pas_
        Nov 14 '16 at 18:39







        meybe systemctl restart systemd-logind ?? on Ubuntu 16.4 LTS

        – Pas_
        Nov 14 '16 at 18:39






        3




        3





        HandleLidSwitch=lock If you want the extra security

        – myol
        Dec 24 '16 at 23:00





        HandleLidSwitch=lock If you want the extra security

        – myol
        Dec 24 '16 at 23:00













        9














        just to confirm, 14.04 LTS Server user here on a Dell X100e.



        sudo apt-get install acpi-support
        sudo vi /etc/default/acpi-support # and then set SUSPEND_METHODS="none"
        sudo /etc/init.d/acpid restart


        Instantly able to close lid, no issues.



        Just posting to confirm the previous posters' solution as the only fix needed. No need (currently) to do anything else in addition to this.






        share|improve this answer





















        • 2





          This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

          – lonstar
          Dec 13 '14 at 16:04











        • This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

          – VeenarM
          Dec 24 '15 at 12:10
















        9














        just to confirm, 14.04 LTS Server user here on a Dell X100e.



        sudo apt-get install acpi-support
        sudo vi /etc/default/acpi-support # and then set SUSPEND_METHODS="none"
        sudo /etc/init.d/acpid restart


        Instantly able to close lid, no issues.



        Just posting to confirm the previous posters' solution as the only fix needed. No need (currently) to do anything else in addition to this.






        share|improve this answer





















        • 2





          This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

          – lonstar
          Dec 13 '14 at 16:04











        • This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

          – VeenarM
          Dec 24 '15 at 12:10














        9












        9








        9







        just to confirm, 14.04 LTS Server user here on a Dell X100e.



        sudo apt-get install acpi-support
        sudo vi /etc/default/acpi-support # and then set SUSPEND_METHODS="none"
        sudo /etc/init.d/acpid restart


        Instantly able to close lid, no issues.



        Just posting to confirm the previous posters' solution as the only fix needed. No need (currently) to do anything else in addition to this.






        share|improve this answer















        just to confirm, 14.04 LTS Server user here on a Dell X100e.



        sudo apt-get install acpi-support
        sudo vi /etc/default/acpi-support # and then set SUSPEND_METHODS="none"
        sudo /etc/init.d/acpid restart


        Instantly able to close lid, no issues.



        Just posting to confirm the previous posters' solution as the only fix needed. No need (currently) to do anything else in addition to this.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 14 '15 at 10:55









        0fnt

        1035




        1035










        answered Aug 8 '14 at 8:52









        StephanStephan

        9111




        9111








        • 2





          This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

          – lonstar
          Dec 13 '14 at 16:04











        • This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

          – VeenarM
          Dec 24 '15 at 12:10














        • 2





          This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

          – lonstar
          Dec 13 '14 at 16:04











        • This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

          – VeenarM
          Dec 24 '15 at 12:10








        2




        2





        This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

        – lonstar
        Dec 13 '14 at 16:04





        This did not work for me on server 14.04 LTS. After applying these changes, when I close the lid, the disk drive runs for a second and then wifi goes out.

        – lonstar
        Dec 13 '14 at 16:04













        This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

        – VeenarM
        Dec 24 '15 at 12:10





        This did nothing for me on my Asus G73JW, Ubuntu server 15 , HandleLidSwitch did

        – VeenarM
        Dec 24 '15 at 12:10











        5














        Everything stops working because...the laptop goes to sleep! (suspend mode).



        To stop, just disable the ACPI lid-button event.



        Edit /etc/acpi/event/lidbtn and comment out the bottom two lines:





        # /etc/acpi/events/lidbtn
        # Called when the user closes or opens the lid
        event=button[ /]lid # comment this out with a # at the beginning
        action=/etc/acpi/lid.sh # same here


        Reboot, and that should be it.






        share|improve this answer



















        • 7





          Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

          – ffunenga
          May 25 '12 at 5:54
















        5














        Everything stops working because...the laptop goes to sleep! (suspend mode).



        To stop, just disable the ACPI lid-button event.



        Edit /etc/acpi/event/lidbtn and comment out the bottom two lines:





        # /etc/acpi/events/lidbtn
        # Called when the user closes or opens the lid
        event=button[ /]lid # comment this out with a # at the beginning
        action=/etc/acpi/lid.sh # same here


        Reboot, and that should be it.






        share|improve this answer



















        • 7





          Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

          – ffunenga
          May 25 '12 at 5:54














        5












        5








        5







        Everything stops working because...the laptop goes to sleep! (suspend mode).



        To stop, just disable the ACPI lid-button event.



        Edit /etc/acpi/event/lidbtn and comment out the bottom two lines:





        # /etc/acpi/events/lidbtn
        # Called when the user closes or opens the lid
        event=button[ /]lid # comment this out with a # at the beginning
        action=/etc/acpi/lid.sh # same here


        Reboot, and that should be it.






        share|improve this answer













        Everything stops working because...the laptop goes to sleep! (suspend mode).



        To stop, just disable the ACPI lid-button event.



        Edit /etc/acpi/event/lidbtn and comment out the bottom two lines:





        # /etc/acpi/events/lidbtn
        # Called when the user closes or opens the lid
        event=button[ /]lid # comment this out with a # at the beginning
        action=/etc/acpi/lid.sh # same here


        Reboot, and that should be it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 25 '12 at 1:00









        ishish

        117k32270295




        117k32270295








        • 7





          Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

          – ffunenga
          May 25 '12 at 5:54














        • 7





          Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

          – ffunenga
          May 25 '12 at 5:54








        7




        7





        Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

        – ffunenga
        May 25 '12 at 5:54





        Hi izx, I dont have that file. My "/etc/acpi/" has one file "powerbtn". And the "/etc/acpi/events" has another file with same name: "powerbtn"

        – ffunenga
        May 25 '12 at 5:54











        3














        I am using 14.04 LTS with ASUS EEE.



        The solution by Stephan above didn't work for me. However, this answer worked.






        share|improve this answer


























        • I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

          – imz -- Ivan Zakharyaschev
          Jul 20 '15 at 9:56
















        3














        I am using 14.04 LTS with ASUS EEE.



        The solution by Stephan above didn't work for me. However, this answer worked.






        share|improve this answer


























        • I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

          – imz -- Ivan Zakharyaschev
          Jul 20 '15 at 9:56














        3












        3








        3







        I am using 14.04 LTS with ASUS EEE.



        The solution by Stephan above didn't work for me. However, this answer worked.






        share|improve this answer















        I am using 14.04 LTS with ASUS EEE.



        The solution by Stephan above didn't work for me. However, this answer worked.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:25









        Community

        1




        1










        answered Oct 10 '14 at 7:36









        MaxMax

        1466




        1466













        • I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

          – imz -- Ivan Zakharyaschev
          Jul 20 '15 at 9:56



















        • I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

          – imz -- Ivan Zakharyaschev
          Jul 20 '15 at 9:56

















        I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

        – imz -- Ivan Zakharyaschev
        Jul 20 '15 at 9:56





        I.e., editing /etc/systemd/logind.conf. This also worked for me on a non-Ubuntu system, with a special needed for the behavior of the DE started by the DM.

        – imz -- Ivan Zakharyaschev
        Jul 20 '15 at 9:56











        2














        I think setting the SUSPEND_METHODS="none" option in /etc/default/acpi-support, does the same thing






        share|improve this answer






























          2














          I think setting the SUSPEND_METHODS="none" option in /etc/default/acpi-support, does the same thing






          share|improve this answer




























            2












            2








            2







            I think setting the SUSPEND_METHODS="none" option in /etc/default/acpi-support, does the same thing






            share|improve this answer















            I think setting the SUSPEND_METHODS="none" option in /etc/default/acpi-support, does the same thing







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 27 '18 at 12:41









            Peter Souter

            1034




            1034










            answered Jan 11 '14 at 5:13









            OmPSOmPS

            46938




            46938























                1














                Turn off laptop screen when closed



                This works for me on a new install of Ubuntu Server LTS 18.04.1.



                The answer from @user386160 worked great to prevent my laptop from going to sleep. But I found out that my monitor was staying on even when the lid was closed (a.k.a. generating unnecessary heat).



                Here's the additional steps I took to turn off the laptop monitor when the screen was closed:



                sudo apt-get install acpi-support vbetool
                sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
                sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
                sudo touch /etc/acpi/lid.sh
                sudo chmod +x /etc/acpi/lid.sh
                sudo nano /etc/acpi/lid.sh


                Then set the contents of the lid.sh file to the following:



                #!/bin/bash

                grep -q close /proc/acpi/button/lid/*/state

                if [ $? = 0 ]; then
                sleep 0.2 && vbetool dpms off
                fi

                grep -q open /proc/acpi/button/lid/*/state

                if [ $? = 0 ]; then
                vbetool dpms on
                fi





                share|improve this answer




























                  1














                  Turn off laptop screen when closed



                  This works for me on a new install of Ubuntu Server LTS 18.04.1.



                  The answer from @user386160 worked great to prevent my laptop from going to sleep. But I found out that my monitor was staying on even when the lid was closed (a.k.a. generating unnecessary heat).



                  Here's the additional steps I took to turn off the laptop monitor when the screen was closed:



                  sudo apt-get install acpi-support vbetool
                  sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
                  sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
                  sudo touch /etc/acpi/lid.sh
                  sudo chmod +x /etc/acpi/lid.sh
                  sudo nano /etc/acpi/lid.sh


                  Then set the contents of the lid.sh file to the following:



                  #!/bin/bash

                  grep -q close /proc/acpi/button/lid/*/state

                  if [ $? = 0 ]; then
                  sleep 0.2 && vbetool dpms off
                  fi

                  grep -q open /proc/acpi/button/lid/*/state

                  if [ $? = 0 ]; then
                  vbetool dpms on
                  fi





                  share|improve this answer


























                    1












                    1








                    1







                    Turn off laptop screen when closed



                    This works for me on a new install of Ubuntu Server LTS 18.04.1.



                    The answer from @user386160 worked great to prevent my laptop from going to sleep. But I found out that my monitor was staying on even when the lid was closed (a.k.a. generating unnecessary heat).



                    Here's the additional steps I took to turn off the laptop monitor when the screen was closed:



                    sudo apt-get install acpi-support vbetool
                    sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
                    sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
                    sudo touch /etc/acpi/lid.sh
                    sudo chmod +x /etc/acpi/lid.sh
                    sudo nano /etc/acpi/lid.sh


                    Then set the contents of the lid.sh file to the following:



                    #!/bin/bash

                    grep -q close /proc/acpi/button/lid/*/state

                    if [ $? = 0 ]; then
                    sleep 0.2 && vbetool dpms off
                    fi

                    grep -q open /proc/acpi/button/lid/*/state

                    if [ $? = 0 ]; then
                    vbetool dpms on
                    fi





                    share|improve this answer













                    Turn off laptop screen when closed



                    This works for me on a new install of Ubuntu Server LTS 18.04.1.



                    The answer from @user386160 worked great to prevent my laptop from going to sleep. But I found out that my monitor was staying on even when the lid was closed (a.k.a. generating unnecessary heat).



                    Here's the additional steps I took to turn off the laptop monitor when the screen was closed:



                    sudo apt-get install acpi-support vbetool
                    sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
                    sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
                    sudo touch /etc/acpi/lid.sh
                    sudo chmod +x /etc/acpi/lid.sh
                    sudo nano /etc/acpi/lid.sh


                    Then set the contents of the lid.sh file to the following:



                    #!/bin/bash

                    grep -q close /proc/acpi/button/lid/*/state

                    if [ $? = 0 ]; then
                    sleep 0.2 && vbetool dpms off
                    fi

                    grep -q open /proc/acpi/button/lid/*/state

                    if [ $? = 0 ]; then
                    vbetool dpms on
                    fi






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 12 at 7:31









                    EverPresentEverPresent

                    1112




                    1112























                        0














                        This worked for me - my Ubuntu Server install didn't have /etc/acpi/event/lidbtn either, but I installed the acpi-support package and then it showed up.



                        The package installs a whole bunch of other X11 related packages but doesn't enable graphical mode, don't worry.



                        Once I commented the last two lines as above then my laptop stayed running with the lid closed.






                        share|improve this answer




























                          0














                          This worked for me - my Ubuntu Server install didn't have /etc/acpi/event/lidbtn either, but I installed the acpi-support package and then it showed up.



                          The package installs a whole bunch of other X11 related packages but doesn't enable graphical mode, don't worry.



                          Once I commented the last two lines as above then my laptop stayed running with the lid closed.






                          share|improve this answer


























                            0












                            0








                            0







                            This worked for me - my Ubuntu Server install didn't have /etc/acpi/event/lidbtn either, but I installed the acpi-support package and then it showed up.



                            The package installs a whole bunch of other X11 related packages but doesn't enable graphical mode, don't worry.



                            Once I commented the last two lines as above then my laptop stayed running with the lid closed.






                            share|improve this answer













                            This worked for me - my Ubuntu Server install didn't have /etc/acpi/event/lidbtn either, but I installed the acpi-support package and then it showed up.



                            The package installs a whole bunch of other X11 related packages but doesn't enable graphical mode, don't worry.



                            Once I commented the last two lines as above then my laptop stayed running with the lid closed.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Oct 14 '13 at 3:00









                            El DubyaEl Dubya

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • 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%2faskubuntu.com%2fquestions%2f141866%2fkeep-ubuntu-server-running-on-a-laptop-with-the-lid-closed%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

                                How to send String Array data to Server using php in android

                                Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                                Is anime1.com a legal site for watching anime?