launchd wrapper
0.6S JOB, 12 HOUR SLEEP
A finished job took twelve hours to notice it was done
I typed a command to check one job, it finished in six tenths of a second, and my terminal just sat there. Two minutes later it was still sitting there, and if I had left it alone it would have sat there for twelve hours.
Every scheduled job here starts a background timer first, set to twelve hours, to kill anything still running by then. That timer writes to the same place the job writes to. Under launchd that place is a log file, so nothing ever noticed.
Run the same job by hand and the output goes down a pipe instead, and whoever is reading it waits for everyone holding the far end to let go. The job let go in under a second. The timer still had eleven hours and fifty nine minutes to sleep.
Killing that timer killed the wrapper around it, not the sleep inside it, which went on holding the pipe by itself. So I gave the timer nowhere to write at all, and made it kill its own children before it goes.
#software