downcycle / cronnix

Automatically exported from code.google.com/p/cronnix
0 stars 0 forks source link

Status Window does not close when output redirected #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create crontab entry in Cronnix using > or >> to redirect standard output. 
(e.g. 0 7 * * * /scripts/test.sh >> /log/testlog
2. Click on Task --> Run
3. Status window opens and displays the following:

Running command
/scripts/test.sh >> /log/testlog
The output will appear below when the command has finished executing

4. The output is not displayed because it has been redirected and the status 
window never closes until the user closes the window manually, which can be 
difficult unless the user does a ps -A |grep test.sh to determine if the 
process is done running.

What is the expected output? What do you see instead?

I can take a guess at two things that cronnix could do in this case:
1. perform a ps-A |grep for the shell script and close the window when the 
process no longer is found.
2. Cat the redirected output to the display window and then close the window 
once the process is complete.

What version of the product are you using? On what operating system?
Version 3.0.2 (3.0.2)

Please provide any additional information below.

cronnix is being used on a late 2009 Mac Pro running Snow Leopard Server 10.6.6

Original issue reported on code.google.com by snyder.j...@gmail.com on 10 Feb 2011 at 3:10

GoogleCodeExporter commented 8 years ago
Also getting this... cant close status window, script never completes, dont 
know what issue is. 

Original comment by amityweb...@gmail.com on 18 Apr 2012 at 8:10

GoogleCodeExporter commented 8 years ago
Thanks for reporting this. I've implemented the status window years ago to 
allow easier testing of scripts before you deploy them. I remember vaguely that 
I considered but eventually gave up trying to handle all instances where this 
could fail, because it's very hard to determine automatically and reliably if a 
script terminated, if there was any output etc.

It's very unlikely that I'll be able to touch this code again any time soon. 
The relevant method is 'runSelectedCommand' in crController.m and then 
'runCliCommand:WithArgs:'. Note that the script is run via /usr/bin/tcsh -c" 
which may have some effect as well. Sorry that I can be of no further help at 
this time.

My only other advice would be to leave off the redirect for testing of the 
script (which is what the "Run Now" command was originally intended for, 
although it admittedly does have other uses) and once everything is in order 
add it back.

Cheers,
Sven

Original comment by sven.a.s...@gmail.com on 18 Apr 2012 at 8:43