bashism in "one" script
|Assignee:||Ruben S. Montero||% Done:|
|Category:||Core & System|
|Target version:||Release 1.2|
The "one" script has a bashism that causes a race condition when /bin/sh isn't bash.
It does this:
cat $ONE_PID &> /dev/null
cat $ONE_SCHEDPID &> /dev/null
...and removes the PID files immediately afterwards.
"foo &> bar" in bash is equivalent to "foo > bar", but in dash, it's equivalent to "foo > bar &", so "kill" and "rm" race to get to the PID file first. Every once in a while, rm wins and you get something like:
kill: 147: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
..and either the scheduler or oned is still running.
The attached patch fixes this problem.