Run command after resumeHow to run a command at startup with systemd?Prevent suspend before completion of command run from TerminalCannot make a systemd script runSystemd service run binary and after run script?Run command on startup with SystemdBug: 100% brightness on resume?'systemctl suspend' seems to hang and doesn't execute script in system-sleepNo network connection after suspendresumeUbuntu Mate 16.04 restarts after boot menuResume script does nothing

Do creatures with a speed 0ft., fly 30ft. (hover) ever touch the ground?

Can compressed videos be decoded back to their uncompresed original format?

Could neural networks be considered metaheuristics?

How do I exit BASH while loop using modulus operator?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Is this draw by repetition?

How can I prove that a state of equilibrium is unstable?

What do you call someone who asks many questions?

Where would I need my direct neural interface to be implanted?

Why do I get negative height?

Blending or harmonizing

Are British MPs missing the point, with these 'Indicative Votes'?

Can someone clarify Hamming's notion of important problems in relation to modern academia?

Avoiding the "not like other girls" trope?

What Exploit Are These User Agents Trying to Use?

Machine learning testing data

Why didn't Boeing produce its own regional jet?

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

Is it possible to map the firing of neurons in the human brain so as to stimulate artificial memories in someone else?

What is the most common color to indicate the input-field is disabled?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

How can a day be of 24 hours?

Can I hook these wires up to find the connection to a dead outlet?

In Bayesian inference, why are some terms dropped from the posterior predictive?



Run command after resume


How to run a command at startup with systemd?Prevent suspend before completion of command run from TerminalCannot make a systemd script runSystemd service run binary and after run script?Run command on startup with SystemdBug: 100% brightness on resume?'systemctl suspend' seems to hang and doesn't execute script in system-sleepNo network connection after suspendresumeUbuntu Mate 16.04 restarts after boot menuResume script does nothing













0















A previous post used info that is out of date for Ubuntu Mate 18.04.



NOT a duplicate.



According to this info



https://blog.christophersmart.com/2016/05/11/running-scripts-before-and-after-suspend-with-systemd/



I have this script in /lib/systemd/system-sleep/



#!/bin/bash 
#
# located in /lib/systemd/system-sleep/
# Created 4/2/19
exec 2> /tmp/systemd_suspend_test_err.txt
if [ "$1" = "pre" ]; then
# Do the thing you want before suspend here
echo "we are suspending." > /tmp/systemd_suspend_test.txt
elif [ "$1" = "post" ]; then
# Do the thing you want after resume here
echo "and we are back from being suspended" >> /tmp/systemd_suspend_test.txt
fi


None of the echo statements work.










share|improve this question


























    0















    A previous post used info that is out of date for Ubuntu Mate 18.04.



    NOT a duplicate.



    According to this info



    https://blog.christophersmart.com/2016/05/11/running-scripts-before-and-after-suspend-with-systemd/



    I have this script in /lib/systemd/system-sleep/



    #!/bin/bash 
    #
    # located in /lib/systemd/system-sleep/
    # Created 4/2/19
    exec 2> /tmp/systemd_suspend_test_err.txt
    if [ "$1" = "pre" ]; then
    # Do the thing you want before suspend here
    echo "we are suspending." > /tmp/systemd_suspend_test.txt
    elif [ "$1" = "post" ]; then
    # Do the thing you want after resume here
    echo "and we are back from being suspended" >> /tmp/systemd_suspend_test.txt
    fi


    None of the echo statements work.










    share|improve this question
























      0












      0








      0








      A previous post used info that is out of date for Ubuntu Mate 18.04.



      NOT a duplicate.



      According to this info



      https://blog.christophersmart.com/2016/05/11/running-scripts-before-and-after-suspend-with-systemd/



      I have this script in /lib/systemd/system-sleep/



      #!/bin/bash 
      #
      # located in /lib/systemd/system-sleep/
      # Created 4/2/19
      exec 2> /tmp/systemd_suspend_test_err.txt
      if [ "$1" = "pre" ]; then
      # Do the thing you want before suspend here
      echo "we are suspending." > /tmp/systemd_suspend_test.txt
      elif [ "$1" = "post" ]; then
      # Do the thing you want after resume here
      echo "and we are back from being suspended" >> /tmp/systemd_suspend_test.txt
      fi


      None of the echo statements work.










      share|improve this question














      A previous post used info that is out of date for Ubuntu Mate 18.04.



      NOT a duplicate.



      According to this info



      https://blog.christophersmart.com/2016/05/11/running-scripts-before-and-after-suspend-with-systemd/



      I have this script in /lib/systemd/system-sleep/



      #!/bin/bash 
      #
      # located in /lib/systemd/system-sleep/
      # Created 4/2/19
      exec 2> /tmp/systemd_suspend_test_err.txt
      if [ "$1" = "pre" ]; then
      # Do the thing you want before suspend here
      echo "we are suspending." > /tmp/systemd_suspend_test.txt
      elif [ "$1" = "post" ]; then
      # Do the thing you want after resume here
      echo "and we are back from being suspended" >> /tmp/systemd_suspend_test.txt
      fi


      None of the echo statements work.







      systemd ubuntu-mate






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      fixit7fixit7

      703424




      703424




















          1 Answer
          1






          active

          oldest

          votes


















          2














          I feel kind of stupid, but I forgot to set the execute bit.



          Now the script works.



          I used chmod +x






          share|improve this answer

























          • Can you please add the command that you used to 'set the execute bit'?

            – earthmeLon
            1 hour ago












          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%2f1130747%2frun-command-after-resume%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          I feel kind of stupid, but I forgot to set the execute bit.



          Now the script works.



          I used chmod +x






          share|improve this answer

























          • Can you please add the command that you used to 'set the execute bit'?

            – earthmeLon
            1 hour ago
















          2














          I feel kind of stupid, but I forgot to set the execute bit.



          Now the script works.



          I used chmod +x






          share|improve this answer

























          • Can you please add the command that you used to 'set the execute bit'?

            – earthmeLon
            1 hour ago














          2












          2








          2







          I feel kind of stupid, but I forgot to set the execute bit.



          Now the script works.



          I used chmod +x






          share|improve this answer















          I feel kind of stupid, but I forgot to set the execute bit.



          Now the script works.



          I used chmod +x







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 16 mins ago

























          answered 1 hour ago









          fixit7fixit7

          703424




          703424












          • Can you please add the command that you used to 'set the execute bit'?

            – earthmeLon
            1 hour ago


















          • Can you please add the command that you used to 'set the execute bit'?

            – earthmeLon
            1 hour ago

















          Can you please add the command that you used to 'set the execute bit'?

          – earthmeLon
          1 hour ago






          Can you please add the command that you used to 'set the execute bit'?

          – earthmeLon
          1 hour ago


















          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%2f1130747%2frun-command-after-resume%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

          Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

          Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

          Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org