Script ends abruptly with a Terminated message
When you are calling pkill -f resque
it is also matching your script, sending it a SIGTERM. If you are unable to add additional restrictions on the pkill
commands such as more exact matching, you will need to kill PIDs one at a time to ensure the script is not killing itself. Here is an example:
pids=( $(pgrep -f resque) )
for pid in "${pids[@]}"; do
if [[ $pid != $$ ]]; then
kill "$pid"
fi
done
Related videos on Youtube
David
Updated on September 18, 2022Comments
-
David over 1 year
I am running the following javascript:
$('img').each( function(){ var w = parseInt(this.width); alert(w); alert(this.src); if(w > 300){ var percent = parseInt((w/666)*100); $(this).removeAttr('width height').css('width',percent + "%"); } });
And I am getting the following error:
Error: uncaught exception: [Exception... "String contains an invalid character" code: "5" nsresult: "0x80530005 (NS_ERROR_DOM_INVALID_CHARACTER_ERR)" location: "http://code.jquery.com/jquery-1.6.4.min.js Line: 2"]
I'm having trouble actually trying to track this one down as it isn't very descriptive of the problem or the source of the problem. Can anyone shed some light on the problem?
Thanks
-
Platinum Azure about 12 yearsWhy are you using escaped quotes? Use
$('img').each(/*...*/);
-
Rodaine about 12 yearsAre the escapes (\) in your actual code?
-
Jasper about 12 yearsThat's a pretty accurate error code :) --
String contains an invalid character
. -
Hersheezy about 12 yearsThis is a lot of code for a simple bug. I would recommend trying to narrow down where in the code the problem occurs by removing lines until you find the one that it is on. Might even find the solution yourself before having to post it :)
-
David about 12 yearsstupid me, ignore the escapes, thats because they are in a php string. They aren't actually done when the document is printed.
-
jordanm over 10 yearsI provided an answer to the question, but I also want to note that the script is broken by design. See: mywiki.wooledge.org/ProcessManagement
-
theTuxRacer over 10 yearsThank you. I am taking a look at it, especially the process killing part.
-
ChuckCottrill over 10 yearsPlease provide the name of the script when you are using ps :-)
-
-
ChuckCottrill over 10 yearsmypid=$$; pids=($(pgrep -f resque|grep -v $mypid))