add support for logind 

I'm forwarding this commit by Rex Dieter to add logind support.