Re: Blacklisted Shell Script? --- SOLVED ---

Dave <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
Joe, my friend, I owe you, again. You were completely right about the 
reason for my difficulty.

`cat running_flag` was, as you suspected, "runnig". No wonder there was 
no output from "echo probes" after the first "if" statement (since 
execution had jumped to the end of the script). An "external reset" was 
required, and the script _immediately_ recommenced working.

I was annoyed at my naivety, but am pleased with the outcome of the 
hand-holding learning experience. What would I do without friends?

The script had likely been interrupted during a system crash at that 
time (I was trying a new video card).

I've  added the line

echo "foolsafe"> /home/whacker/IP-Update/running_flag

immediately ahead of

running_flag=`cat /home/whacker/IP-Update/running_flag`

at the beginning of the script to prevent a reoccurrence of this.

Tomorrow I'll have a critical look at those 13 "if" and 13 "fi" 
occurrences.

Thank you all who suffered through this with me;
Dave

Joe Burpee wrote:
> On Sat, Jul 04, 2009 at 21:34:41 -0400, Dave wrote:
> ...
>   
>> --- extract from script working directory ---
>> -rw-rw-r-- 1 whacker whacker      7 2009-06-29 13:25 running_flag
>>     
> ...
>   
>> A snippet of logging the "echo" statements output at one-minute intervals is ...
>> ""
>> Another pass started
>> Line-2
>> 1246740301
>> Line-before first IF statement
>>
>> Another pass started
>> Line-2
>> 1246740361
>> Line-before first IF statement
>> "".................
>>
>> Output was "dead" for  ....
>>
>> echo "Line-before second IF statement" >> ~barnett.log
>>     
> ...
>   
>> Joe Burpee wrote:
>>     
>>> if the script is ever interrupted prematurely, running_flag will not be
>>> reset to its not-running state.  If running_flag is not re-initialized
>>> externally, the script will never again do anything.
>>>       
>  
> If I'm reading your above notes correctly Dave, they suggest you have a
> stale running_flag file from June 29.  If it contains the
> script-already-running code ("runnig"?) it would prevent the main if
> block from executing.  Try
>   cat running_flag
> and if that's the case, overwrite it with the not-running code
> ("dunnie"?) -- or anything other than "runnig".
>
> Joe
>
>   
-- 
OCLUG general discussion list
[email protected]
http://oclug.on.ca/mailman/listinfo/oclug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.