Description of problem: When running run-parts, it'll instantiate an awk program, this is all good and ok, until you start to do some real things. Assumine you have a script such as this : example.sh : #!/bin/bash echo "hello" sleep 10 & And you would run : ./example.sh It won't wait for the 'sleep 10 &' statement as it will be put in background. But if you'd run : ./example.sh | awk '{print $1}' You'd expect it to still quit immediately, but it doesn't, and I believe here this is some normal awk behavior - I'm not reporting a bug on awk. Problem comes when you'd use /usr/bin/run-parts, which does use awk to process some output from the program, and just as well can cause any cronjob putting some stuff in the background to halt, and wait. Personally I witnessed it when combining a restart of mailman with run-parts, which uses the 'daemon' function to run stuff in background - the result - the cronjob would halt forever. Some steps to reproduce, because I must provide it : 1. Create a new directory, say X for instance, and a script in it including the lines : #!/bin/bash sleep 10 & 2. /usr/bin/run-parts X Actual results: It takes 10 seconds to complete. Expected results: Should complete immediately. Additional info: I'm including a patch, if what I'm describing is desired behavior, then a fix should be done to the mailman service, or perhaps to the 'daemon' function.
Created attachment 145037 [details] a patch for run-parts to not wait for background processes
Hello, thanks for report. I don't think it's a bug but behaviour of bash/awk. It's a problem of correct scripts for operation such these.