Suspend instantly restarting - editing acpi/wakeup with systemd serviceWhy does my computer start by itself when I open it?How do I configure WakeOnUSB properly?acpi problems make wakeup every midnightsystemd user service not found after reboot

If the music alphabet had more than 7 letters would octaves still sound like the same note?

Shortest way to get an EOF Error

Fill a bowl with alphabet soup

Can the bass be used instead of drums?

First aid scissors confiscated by Dubai airport security

How can AnyDVD destroy a DVD drive?

What's the current zodiac?

What is the German word for: "It only works when I try to show you how it does not work"?

"Dear Stack Exchange, I am very disappointed in you" - How to construct a strong opening line in a letter?

Future of iTunes and audio files in its library

"Shake your head all you like" meaning

How is the corresponding author on a (math) paper typically chosen?

Did smallpox emerge in 1580?

Random code changes - terminology and tools

How should I tell a professor the answer to something he doesn't know?

Employer says he needs to delay payment by 3 months due to bureaucracy

Sum in bash outside while read line

Having trouble with accidentals - Note-for-note vs traditional?

SSD or HDD for server

What good is the paladin's Divine Sense?

Is consistent disregard for students' time "normal" in undergraduate research?

How to respond when insulted by a grad student in a different department?

What should I upgrade first?

What is the purpose of the redundant "いい人" in this example sentence



Suspend instantly restarting - editing acpi/wakeup with systemd service


Why does my computer start by itself when I open it?How do I configure WakeOnUSB properly?acpi problems make wakeup every midnightsystemd user service not found after reboot






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









3

















My 18.04 Ubuntu Ryzen desktop will wake itself up instantly after it suspends. I've tracked the problem down to /proc/acpi/wakeup
In the list of enabled services there are two services (labeled for what it's worth: AS43 and PTXH) which I can disable using the following shell commands:



sudo -s 
echo AS43 > /proc/acpi/wakeup
echo PTXH > /proc/acpi/wakeup


Once this is done - system wakes from sleep only from keyboard input - all is good.
However I can't seem to automate this process.



One solution (and I'm open to others) is to make a service, /etc/systemd/system/suspendfix.service such as follows:



[Unit]
Description=fix to prevent system from waking immediately after suspend

[Service]
Type=simple
ExecStartPre=/bin/sh -c '/bin/echo GPP2 > /proc/acpi/wakeup'
ExecStart=/bin/sh -c '/bin/echo AS43 > /proc/acpi/wakeup'
ExecStartPost=/bin/sh -c '/bin/echo PTXH > /proc/acpi/wakeup'
RemainAfterExit=yes
TimeoutSec=90s

[Install]
WantedBy=sleep.target
WantedBy=multi-user.target


BUT this doesn't seem to work. Either my service script is incorrect or something is flipping the offending AS43 and PTXH back to enabled regardless of this systemd service file. Any help, much obliged!
~

~










share|improve this question





















  • 1





    Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

    – mikemtnbikes
    Sep 24 '18 at 18:16


















3

















My 18.04 Ubuntu Ryzen desktop will wake itself up instantly after it suspends. I've tracked the problem down to /proc/acpi/wakeup
In the list of enabled services there are two services (labeled for what it's worth: AS43 and PTXH) which I can disable using the following shell commands:



sudo -s 
echo AS43 > /proc/acpi/wakeup
echo PTXH > /proc/acpi/wakeup


Once this is done - system wakes from sleep only from keyboard input - all is good.
However I can't seem to automate this process.



One solution (and I'm open to others) is to make a service, /etc/systemd/system/suspendfix.service such as follows:



[Unit]
Description=fix to prevent system from waking immediately after suspend

[Service]
Type=simple
ExecStartPre=/bin/sh -c '/bin/echo GPP2 > /proc/acpi/wakeup'
ExecStart=/bin/sh -c '/bin/echo AS43 > /proc/acpi/wakeup'
ExecStartPost=/bin/sh -c '/bin/echo PTXH > /proc/acpi/wakeup'
RemainAfterExit=yes
TimeoutSec=90s

[Install]
WantedBy=sleep.target
WantedBy=multi-user.target


BUT this doesn't seem to work. Either my service script is incorrect or something is flipping the offending AS43 and PTXH back to enabled regardless of this systemd service file. Any help, much obliged!
~

~










share|improve this question





















  • 1





    Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

    – mikemtnbikes
    Sep 24 '18 at 18:16














3












3








3


1






My 18.04 Ubuntu Ryzen desktop will wake itself up instantly after it suspends. I've tracked the problem down to /proc/acpi/wakeup
In the list of enabled services there are two services (labeled for what it's worth: AS43 and PTXH) which I can disable using the following shell commands:



sudo -s 
echo AS43 > /proc/acpi/wakeup
echo PTXH > /proc/acpi/wakeup


Once this is done - system wakes from sleep only from keyboard input - all is good.
However I can't seem to automate this process.



One solution (and I'm open to others) is to make a service, /etc/systemd/system/suspendfix.service such as follows:



[Unit]
Description=fix to prevent system from waking immediately after suspend

[Service]
Type=simple
ExecStartPre=/bin/sh -c '/bin/echo GPP2 > /proc/acpi/wakeup'
ExecStart=/bin/sh -c '/bin/echo AS43 > /proc/acpi/wakeup'
ExecStartPost=/bin/sh -c '/bin/echo PTXH > /proc/acpi/wakeup'
RemainAfterExit=yes
TimeoutSec=90s

[Install]
WantedBy=sleep.target
WantedBy=multi-user.target


BUT this doesn't seem to work. Either my service script is incorrect or something is flipping the offending AS43 and PTXH back to enabled regardless of this systemd service file. Any help, much obliged!
~

~










share|improve this question














My 18.04 Ubuntu Ryzen desktop will wake itself up instantly after it suspends. I've tracked the problem down to /proc/acpi/wakeup
In the list of enabled services there are two services (labeled for what it's worth: AS43 and PTXH) which I can disable using the following shell commands:



sudo -s 
echo AS43 > /proc/acpi/wakeup
echo PTXH > /proc/acpi/wakeup


Once this is done - system wakes from sleep only from keyboard input - all is good.
However I can't seem to automate this process.



One solution (and I'm open to others) is to make a service, /etc/systemd/system/suspendfix.service such as follows:



[Unit]
Description=fix to prevent system from waking immediately after suspend

[Service]
Type=simple
ExecStartPre=/bin/sh -c '/bin/echo GPP2 > /proc/acpi/wakeup'
ExecStart=/bin/sh -c '/bin/echo AS43 > /proc/acpi/wakeup'
ExecStartPost=/bin/sh -c '/bin/echo PTXH > /proc/acpi/wakeup'
RemainAfterExit=yes
TimeoutSec=90s

[Install]
WantedBy=sleep.target
WantedBy=multi-user.target


BUT this doesn't seem to work. Either my service script is incorrect or something is flipping the offending AS43 and PTXH back to enabled regardless of this systemd service file. Any help, much obliged!
~

~







18.04 systemd acpi wakeup






share|improve this question













share|improve this question











share|improve this question




share|improve this question



share|improve this question










asked Jun 23 '18 at 23:43









dalaeckdalaeck

163 bronze badges




163 bronze badges










  • 1





    Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

    – mikemtnbikes
    Sep 24 '18 at 18:16













  • 1





    Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

    – mikemtnbikes
    Sep 24 '18 at 18:16








1




1





Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

– mikemtnbikes
Sep 24 '18 at 18:16






Might be related to this bug bugs.launchpad.net/ubuntu/+source/systemd/+bug/1574120

– mikemtnbikes
Sep 24 '18 at 18:16











2 Answers
2






active

oldest

votes


















1


















I had the same problem with a Ryzen 2600 and Ubuntu 18.04.



Your script was very helpful.
To execute it on startup I added your lines



echo AS43 > /proc/acpi/wakeup
echo PTXH > /proc/acpi/wakeup


to a /etc/rc.local file.



Then I added a systemd service to start this script. I followed this tutorial.



Thanks for finding the wakeup triggers!






share|improve this answer



































    0


















    Same issue (USB rewaking) on my Lenovo Yoga 910. solved with the solution of mike-g2 (mikeg-utk):




    1. Create file: /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service
      with following content:



      [Unit]
      Description="Make suspend ignore USB wake up."

      [Service]
      ExecStart=/bin/bash -c "echo XHC >> /proc/acpi/wakeup"

      [Install]
      WantedBy=multi-user.target



    2. Create symbolic link to above script in /etc/systemd/system/multi-user.target.wants/



      ln -s /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service /etc/systemd/system/multi-user.target.wants/



    3. Start service



      sudo systemctl daemon-reload
      sudo systemctl start toggle.XHC.to.fix.suspend.issue.service



    4. Check if service was started



      sudo systemctl status toggle.XHC.to.fix.suspend.issue.service



    5. Enable it on boot



      sudo systemctl enable toggle.XHC.to.fix.suspend.issue.service






    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/4.0/"u003ecc by-sa 4.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%2f1049178%2fsuspend-instantly-restarting-editing-acpi-wakeup-with-systemd-service%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1


















      I had the same problem with a Ryzen 2600 and Ubuntu 18.04.



      Your script was very helpful.
      To execute it on startup I added your lines



      echo AS43 > /proc/acpi/wakeup
      echo PTXH > /proc/acpi/wakeup


      to a /etc/rc.local file.



      Then I added a systemd service to start this script. I followed this tutorial.



      Thanks for finding the wakeup triggers!






      share|improve this answer
































        1


















        I had the same problem with a Ryzen 2600 and Ubuntu 18.04.



        Your script was very helpful.
        To execute it on startup I added your lines



        echo AS43 > /proc/acpi/wakeup
        echo PTXH > /proc/acpi/wakeup


        to a /etc/rc.local file.



        Then I added a systemd service to start this script. I followed this tutorial.



        Thanks for finding the wakeup triggers!






        share|improve this answer






























          1














          1










          1









          I had the same problem with a Ryzen 2600 and Ubuntu 18.04.



          Your script was very helpful.
          To execute it on startup I added your lines



          echo AS43 > /proc/acpi/wakeup
          echo PTXH > /proc/acpi/wakeup


          to a /etc/rc.local file.



          Then I added a systemd service to start this script. I followed this tutorial.



          Thanks for finding the wakeup triggers!






          share|improve this answer
















          I had the same problem with a Ryzen 2600 and Ubuntu 18.04.



          Your script was very helpful.
          To execute it on startup I added your lines



          echo AS43 > /proc/acpi/wakeup
          echo PTXH > /proc/acpi/wakeup


          to a /etc/rc.local file.



          Then I added a systemd service to start this script. I followed this tutorial.



          Thanks for finding the wakeup triggers!







          share|improve this answer















          share|improve this answer




          share|improve this answer



          share|improve this answer








          edited Oct 15 '18 at 18:17









          abu_bua

          4,9888 gold badges18 silver badges36 bronze badges




          4,9888 gold badges18 silver badges36 bronze badges










          answered Oct 15 '18 at 17:42









          user2699453user2699453

          1336 bronze badges




          1336 bronze badges


























              0


















              Same issue (USB rewaking) on my Lenovo Yoga 910. solved with the solution of mike-g2 (mikeg-utk):




              1. Create file: /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service
                with following content:



                [Unit]
                Description="Make suspend ignore USB wake up."

                [Service]
                ExecStart=/bin/bash -c "echo XHC >> /proc/acpi/wakeup"

                [Install]
                WantedBy=multi-user.target



              2. Create symbolic link to above script in /etc/systemd/system/multi-user.target.wants/



                ln -s /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service /etc/systemd/system/multi-user.target.wants/



              3. Start service



                sudo systemctl daemon-reload
                sudo systemctl start toggle.XHC.to.fix.suspend.issue.service



              4. Check if service was started



                sudo systemctl status toggle.XHC.to.fix.suspend.issue.service



              5. Enable it on boot



                sudo systemctl enable toggle.XHC.to.fix.suspend.issue.service






              share|improve this answer






























                0


















                Same issue (USB rewaking) on my Lenovo Yoga 910. solved with the solution of mike-g2 (mikeg-utk):




                1. Create file: /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service
                  with following content:



                  [Unit]
                  Description="Make suspend ignore USB wake up."

                  [Service]
                  ExecStart=/bin/bash -c "echo XHC >> /proc/acpi/wakeup"

                  [Install]
                  WantedBy=multi-user.target



                2. Create symbolic link to above script in /etc/systemd/system/multi-user.target.wants/



                  ln -s /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service /etc/systemd/system/multi-user.target.wants/



                3. Start service



                  sudo systemctl daemon-reload
                  sudo systemctl start toggle.XHC.to.fix.suspend.issue.service



                4. Check if service was started



                  sudo systemctl status toggle.XHC.to.fix.suspend.issue.service



                5. Enable it on boot



                  sudo systemctl enable toggle.XHC.to.fix.suspend.issue.service






                share|improve this answer




























                  0














                  0










                  0









                  Same issue (USB rewaking) on my Lenovo Yoga 910. solved with the solution of mike-g2 (mikeg-utk):




                  1. Create file: /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service
                    with following content:



                    [Unit]
                    Description="Make suspend ignore USB wake up."

                    [Service]
                    ExecStart=/bin/bash -c "echo XHC >> /proc/acpi/wakeup"

                    [Install]
                    WantedBy=multi-user.target



                  2. Create symbolic link to above script in /etc/systemd/system/multi-user.target.wants/



                    ln -s /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service /etc/systemd/system/multi-user.target.wants/



                  3. Start service



                    sudo systemctl daemon-reload
                    sudo systemctl start toggle.XHC.to.fix.suspend.issue.service



                  4. Check if service was started



                    sudo systemctl status toggle.XHC.to.fix.suspend.issue.service



                  5. Enable it on boot



                    sudo systemctl enable toggle.XHC.to.fix.suspend.issue.service






                  share|improve this answer














                  Same issue (USB rewaking) on my Lenovo Yoga 910. solved with the solution of mike-g2 (mikeg-utk):




                  1. Create file: /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service
                    with following content:



                    [Unit]
                    Description="Make suspend ignore USB wake up."

                    [Service]
                    ExecStart=/bin/bash -c "echo XHC >> /proc/acpi/wakeup"

                    [Install]
                    WantedBy=multi-user.target



                  2. Create symbolic link to above script in /etc/systemd/system/multi-user.target.wants/



                    ln -s /etc/systemd/system/toggle.XHC.to.fix.suspend.issue.service /etc/systemd/system/multi-user.target.wants/



                  3. Start service



                    sudo systemctl daemon-reload
                    sudo systemctl start toggle.XHC.to.fix.suspend.issue.service



                  4. Check if service was started



                    sudo systemctl status toggle.XHC.to.fix.suspend.issue.service



                  5. Enable it on boot



                    sudo systemctl enable toggle.XHC.to.fix.suspend.issue.service







                  share|improve this answer













                  share|improve this answer




                  share|improve this answer



                  share|improve this answer










                  answered Apr 29 at 18:25









                  Fabian HorlacherFabian Horlacher

                  1011 silver badge2 bronze badges




                  1011 silver badge2 bronze badges































                      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%2f1049178%2fsuspend-instantly-restarting-editing-acpi-wakeup-with-systemd-service%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

                      Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

                      How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

                      Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü