script works from CL but not cron? 
Author Message
 script works from CL but not cron?

I am trying to write a script to run scheduled by crontab.
Here is the essence of the problem.

#!/usr/bin/tclsh
set pid [exec cat /var/run/diald.pid]
puts $pid

From the command line, this works fine, prints out the pid.
When run from cron, I get this:

1435
error waiting for process to exit: child process lost (is SIGCHLD
ignored or trapped?)
    while executing
"exec cat /var/run/diald.pid"
        (file "/home/holmes/prog/dchk.tcl" line 3)

Can somebody tell me what I'm doing wrong?  The error stops the script, which
is intended to continue on and do something useful.

Thanks,

Tim Holmes



Tue, 27 Feb 2001 03:00:00 GMT  
 script works from CL but not cron?

Quote:

> I am trying to write a script to run scheduled by crontab.
> Here is the essence of the problem.

> #!/usr/bin/tclsh
> set pid [exec cat /var/run/diald.pid]
> puts $pid

> From the command line, this works fine, prints out the pid.
> When run from cron, I get this:

> 1435
> error waiting for process to exit: child process lost (is SIGCHLD
> ignored or trapped?)
>     while executing
> "exec cat /var/run/diald.pid"
>         (file "/home/holmes/prog/dchk.tcl" line 3)

> Can somebody tell me what I'm doing wrong?  The error stops the script, which
> is intended to continue on and do something useful.

> Thanks,

> Tim Holmes

 Try opening up the file and reading the contents, rather than the UNIX cat
command.

set f [open "/var/run/diald.pid" r]
while {[gets $f line] >= 0} {
    set pid "$line"

Quote:
}

close $f
puts "$pid"

Hope this helps...
--
Ron Riesenberger   Edward Jones   St. Louis, MO. U.S.A.
 UNIX System Administration and Automation

   These are my words and opinions, not my employers.

"Only those who dare to fail greatly can ever achieve greatly."
        -Robert F. Kennedy



Sun, 04 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. expect script doesn't work with cron - please help

2. EXPECT: works from command line but not from cron

3. awk script not working on SUN Solaris

4. Block formatting script not working

5. Simple awk script does not work?

6. Apple Scripts do not work under X

7. Window.status call in a VRML Script node - not working

8. Simple PHP beginner script not working!

9. Script works on one page, but not another...

10. PyApache - scripts now not working

11. ftpmirror script in python dist. not working

12. Basic Cygwin Expect script does not work

 

 
Powered by phpBB® Forum Software