linux fix for relogin, left pipe as blocking caused the whole function just wait to read data from pipe