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
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
add a comment |
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
add a comment |
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
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
systemd ubuntu-mate
asked 2 hours ago
fixit7fixit7
703424
703424
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I feel kind of stupid, but I forgot to set the execute bit.
Now the script works.
I used chmod +x
Can you please add the command that you used to 'set the execute bit'?
– earthmeLon
1 hour ago
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
I feel kind of stupid, but I forgot to set the execute bit.
Now the script works.
I used chmod +x
Can you please add the command that you used to 'set the execute bit'?
– earthmeLon
1 hour ago
add a comment |
I feel kind of stupid, but I forgot to set the execute bit.
Now the script works.
I used chmod +x
Can you please add the command that you used to 'set the execute bit'?
– earthmeLon
1 hour ago
add a comment |
I feel kind of stupid, but I forgot to set the execute bit.
Now the script works.
I used chmod +x
I feel kind of stupid, but I forgot to set the execute bit.
Now the script works.
I used chmod +x
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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