I have set timeouts in /etc/profile.d/ to disconnect inactive users using TMOUT and this works great however now I am seeing users just holding their connection open by keeping some foreground process open e.g. mysql. I realise this could be anything vim / less / etc, however as the mysql-cli has options for various timeouts and reconnecting dropped connection (or not) has anyone discovered a way to forcably quit the mysql-cli on a broken connection / timeout thus dumping the user back into bash?

  • 1
    Is there a good reason why you need to inconvenience your users? Clearly they want to have open idle connections. And who says I'm not watching that tail -f? You might be able to find some way to do this, but then your users will just find some other way of keeping their connections open. – Michael Hampton Sep 22 '15 at 20:28
  • @MichaelHampton All your points are valid, however I know the users and it is not a case of want but forgetfulness. I know this as the users use laptops, have a connection open all day, take their laptop home. I realise they there are many ways round this and they could use anything like tail -f or as in my supplied examples vim / less / etc to do this, hence why my question was directed specifically at the mysql-cli client but until they intentionally try and keep the connection open (which I will notice when use w and it not being the mysql client) I dont mind. – Alasdair Sep 23 '15 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.