SafeEyes
SafeEyes copied to clipboard
Can't run SafeEyes for two users at the same time
Hi, thank you for making SafeEyes. I've tried many break reminders and it's the only one that works for me.
When I switch to a different user and forget to close SafeEyes, it doesn't open in the other session. If I try to run it from the terminal, I get the following traceback:
Traceback (most recent call last):
File "/usr/bin/safeeyes", line 11, in <module>
load_entry_point('safeeyes==2.0.6', 'console_scripts', 'safeeyes')()
File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 141, in main
safeeyes = SafeEyes(system_locale, config)
File "/usr/lib/python3/dist-packages/safeeyes/SafeEyes.py", line 91, in __init__
self.rpc_server = RPCServer(self.config.get('rpc_port'), self.context)
File "/usr/lib/python3/dist-packages/safeeyes/rpc.py", line 36, in __init__
self.__server = SimpleXMLRPCServer(("localhost", port), logRequests=False, allow_none=True)
File "/usr/lib/python3.8/xmlrpc/server.py", line 605, in __init__
socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
Your code checks the process list to see if SafeEyes is already running. My proc filesystem is mounted with hidepid=2, so that doesn't work and I get this error. I'm using version 2.0.6, but it seems that the code for this hasn't changed.
Either way, would it be possible to let two users have SafeEyes open at the same time?
Hi @eafer this is a good catch. I will take a look at this issue. Thanks