avoid hang when restarting service via ssh