I know what you're thinking. "Did he launch six procs or only five?" Well to tell you the truth in all this excitement I kinda lost track myself. But being this is a bash script with access to production data, you'
-
if ([ ${OUTPUT} -eq 127 ] && (! (set -o noclobber; exec 2>'/dev/null'; printf '' 1>"${PID_FILE}"))); then
Well, do ya, punk?
Filed under: I just deleted the pidfile — what's the worst that could happen?
-
Actually, they
set -o noclobber
, so the PID file should only be touched if it is nonexistent.This is a really complicated way of writing
if [ ${OUTPUT} -eq 127 -a ! -e "${PID_FILE}" ]; then touch "${PID_FILE}"
-
Ok, but say you just started getting emails every hour about the existence of some pidfile you've never even heard of. Wouldn't it be nice if there were some way to determine if the related process was currently running?
-
This [gibberish] is a really complicated way of writing <gibberish>
And now I remember why I despise bash.