FLUSH LOGS command introduces a long sleep I am using Percona mysql 5.0-92-log on Centos 6.6 final.

I have logged in as a privileged user to mysql. If I issue command 

mysql&gt; FLUSH LOGS;


The terminal goes for a long sleep

Below is the output of processlist

mysql&gt; show processlist;

+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  9 | root | localhost | NULL | Sleep   |  393 |       | NULL             | 
| 10 | root | localhost | NULL | Query   |    0 | NULL  | show processlist | 
+----+------+-----------+------+---------+------+-------+------------------+

2 rows in set (0.00 sec)


If I kill the process below is the error I get

mysql&gt; FLUSH LOGS;
ERROR 2013 (HY000): Lost connection to MySQL server during query


Same issue I face while trying to take a mysqldump by issuing command

/usr/bin/mysqldump --user=root --password='****' --host=localhost --verbose --master-data=2 --flush-logs test &gt; $DUMPFILE 
-- Connecting to localhost...


And than it hangs.

If I don't use --flush-logs option I get the dump generated properly.

Any pointers as to why it happens?
There was issue with the log-error file to which I was suppose to log mysql errors.
I had this line in my.cnf

log-error=/var/lib/mysqld.log


Due to permission issue mysql was not able to create this log file nor an error was thrown suggesting the same.

I selectively removed and toggled the settings which helped me reach to the problem.