OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
156 stars 87 forks source link

Make sure that applet.py is running one instance per user #251

Closed Monsterovich closed 2 years ago

Monsterovich commented 2 years ago

Fixes https://github.com/OpenPrinting/system-config-printer/issues/175#issuecomment-977968336

zdohnal commented 2 years ago

Hi @Monsterovich ,

IMHO the PR mitigates the issue #175 - the process will still linger after logout under an old session - the PR prevents creation of new applet processes.

Does the applet work correctly with the fix? I'm not completely sure what will happen to connections the old applet.py created (cups, dbus) - you could end up with broken old applet, because the old connections don't work anymore.

Killing the applet process on logout would be cleaner, but if the applet works with the PR, I'm willing to merge it as mitigation.

Monsterovich commented 2 years ago

Does the applet work correctly with the fix?

Yes, it prevents the process from running multiple times. The same result can be achieved by using the lock files.

> system-config-printer-applet 
Process already running (98:Address already in use). Exiting.

I'm not completely sure what will happen to connections the old applet.py created (cups, dbus) - you could end up with broken old applet, because the old connections don't work anymore.

Me neither, how can I break it?

Killing the applet process on logout would be cleaner, but if the applet works with the PR, I'm willing to merge it as mitigation.

It seems to work. I do not often use logout, but the printer notification works clearly after login.

zdohnal commented 2 years ago

It seems to work. I do not often use logout, but the printer notification works clearly after login.

Ok, let's merge it as a mitigation of #175 , since there will be still an applet process after logout and it will end only with system restart/turning off.