Create PID file with O_TRUNC, so that it is emptied before it is written to.
Otherwise, if the previous run ended with a crash, and the PID was 1234, and you have rebooted the machine and the new PID is 99 then in the PID file you will have 9934. Note: users of mysqld_safe did not have the problem because this script deletes the PID file before starting mysqld.
Showing
Please register or sign in to comment