The problem happens when the --daemonize option is used, and we have no permission to access to the PID file.
I reproduced it as follows (logged in as a regular user) :
> pt-kill --daemonize --busy-time 10 --kill --pid /var/run/percona-toolkit/pt-kill.pid -u xxxxx -p xxxxx
> Cannot open PID file /var/run/percona-toolkit/pt-kill.pid: No such file or directory at pt-kill line 2398.
> echo $?
> 0
After the fix the same command exits with error 1.
So, in essence, the process "successfully" forks, but child dies immediately for whatever reason. We now capture this by waiting a couple of seconds to see if it started correctly.
Daniel,
The problem happens when the --daemonize option is used, and we have no permission to access to the PID file.
I reproduced it as follows (logged in as a regular user) :
> pt-kill --daemonize --busy-time 10 --kill --pid /var/run/ percona- toolkit/ pt-kill. pid -u xxxxx -p xxxxx percona- toolkit/ pt-kill. pid: No such file or directory at pt-kill line 2398.
> Cannot open PID file /var/run/
> echo $?
> 0
After the fix the same command exits with error 1.
So, in essence, the process "successfully" forks, but child dies immediately for whatever reason. We now capture this by waiting a couple of seconds to see if it started correctly.