Other users of Debian might want to take notice that the path to place the files under for that distribution is /lib/systemd/system-sleep/, i.e. without the initial /usr. Although this actually is properly documented with the correct path in the man page, it is a detail which is easy to miss.
So you should be using /lib/systemd/system-sleep/ as you are using Ubuntu, which is a Debian-based system. If you are not using Ubuntu, why are you posting to an Ubuntu sub forum?
Absolutely! I was about to write the same, you beat me to it.
Quote:
Originally Posted by drew77
The script is in /usr/lib/systemd/system-sleep/.
I found this in syslog.
Exactly what apmcd47 already said: /lib/systemd/system-sleep/On_Resume.sh is not the same as /usr/lib/systemd/system-sleep/On_Resume.sh and you are simply debugging the wrong script.
I am not sure what that means: in post #6 you said your script is named /usr/lib/systemd/system-sleep/On_Resume. You need to not only move it to another directory (which would make it /lib/systemd/system-sleep/On_Resume) but also name it differently: /lib/systemd/system-sleep/On_Resume.sh Have you done both? If yes, there should at least be some message in /tmp/systemd_suspend_test_err.txt now, otherwise your script has most probably NOT run.
Quote:
Originally Posted by drew77
Format looks different.
It not only looks differently - it is! It does something completely different: first, this script expects TWO parameters, not just one. If the second is not "hibernate" or "hybrid-sleep", it does simply nothing at all. Second, this script is most probably run by a different shell: /bin/sh instead of bash. Depending on what /bin/sh links to (in Ubuntu perhaps dash) this will not be dash. Third, even if this script would do something (which is now, given the parameters with which you called the first script, unlikely) it would be something completely different from what the first script does.
Just for the fun of it, please change the following line in your script:
to:
and then show us what appears in /tmp/systemd_suspend_test_err.txt after your script is invoked by the system.
This User Gave Thanks to Don Cragun For This Post:
I'm not familiar with gxmessage, but from what we are seeing in the log, one might guess that some service it depends upon has already been shutdown before your script is called when the system is suspending and that the service hasn't been restarted yet before your script is called when the system is coming back up.
At least now we know what arguments are being supplied to your script when it is invoked.
Don't forget to remove your temp files after you have examined what happened after your script is invoked.
This User Gave Thanks to Don Cragun For This Post:
Hi,
I am trying to get squid up and running using a redirector process, and every time I try to load a web page, squid fails miserably.
Can some one with perl and squid knowledge take a look at these codes and tell if something is wrong here.
#!/usr/bin/perl
#
$| = 1;
@endings = qw/... (0 Replies)
Hello,
is it possible to debug a script that is already running "on-demand"?
Somehow a command like "set -x" but once you've executed the script. And another one to disable debugging?
Thank you (0 Replies)
Hi I am relatively new in shell scripting Below is the code which i developed but for some reason, it keeps giving me error:
/apps/bss/BatchProg/at1/batch/scripts/ksh/TBATLC02.ksh: syntax error at line 41 : `then' unmatched
#!/usr/bin/ksh... (4 Replies)
Hi,
I have this script, searches and sets variables, then searches and sets more variables from multiple files.
I'd need to debug it a bit.
#!/bin/bash
egrep $1 `find | grep MAGT` >/tmp/resRA-$$
thread=`sed -n '/{0x/ {s/^.*{0x\(*\).*/\1/p;q}' /tmp/resRA-$$`
tag=`sed -n '/Tag=/... (5 Replies)
Hi,
When i run the script ./script.sh sun, this give me no output, it should give me the list of file.
If i run the script without the argument it should send me echo inside usage().
What is the problem?
please help
-Adsi
#!/bin/sh
ROOT_PATH=/net/icebox/vol/local_images/spins... (2 Replies)
Hi All,
I have a script which is based on calculating current time
The script looks like this:
whenever i try to run the script it gives me error:Please advice wherther i have made mistake with if condition or with for loop??
The code :
set -x
#!/usr/bin/ksh
set -x... (7 Replies)
Hi all,
i have two simple questions here...
1. i want to know that how to debug the UNIX shell script?
2. is there any way to handling the exception in UNIX shell script like oracle exception handling?
Please provide me those details it would be great help/
Thanks and Regards,
MPS... (3 Replies)
Hi,
How can I debug an awk script?
I know that set -x can be used to debug a script. But this will not suite for awk scripts.
Can anyone help me?
Thanks in advance,
Chella (2 Replies)
I would like to extract the following fields from the text file attached. I copied the contents from a pdf file and pasted them into the text file so I can use awk to extract them. The layout is as listed below.
name1,name2,name3,name4,Title,designation,nationality,dob,
national ... (1 Reply)