We have a lot of Python stuff that are used in contexts where the compiled bytecode cannot be written back to disk. Most commonly this happens when normal users run some ThinLinc command, but it can also happen from some daemons (e.g. cupsd) and/or as the result of SELinux or AppArmor. The issue this causes is: a) Annoying log messages here and there, most notably when we hit a SELinux restriction as that also pops up a graphical notification. b) Python (at least some version) is a stupid bastard and loads the .pyc even when it could not write to it. That means that if a ThinLinc component gets updated, normal users won't start using the new code until an unrestricted user loads that particular .py. We could solve this by having tl-setup precompiling everything. Might also be possible to work around it using -B in relevant scripts.
Need to check: - Does solaris support flags in the hash-bang? Can we turn of compilation files from within python? - What's the performance hit of not having .pyc files? E.g. the VDI module is rather big.
Python documentation states that the feature to disable .pyc generation wasn't added until 2.6. :/ Python 3.0 takes a new approach: http://docs.python.org/dev/whatsnew/3.2.html#pep-3147-pyc-repository-directories
(In reply to comment #0) > b) Python (at least some version) is a stupid bastard and loads the .pyc even > when it could not write to it. That means that if a ThinLinc component gets > updated, normal users won't start using the new code until an unrestricted user > loads that particular .py. Need proof, haven't been able to reproduce. Also searched the Python bug DB. The docs are also pretty clear: http://docs.python.org/tutorial/modules.html#compiled-python-files: "The modification time of the version of spam.py used to create spam.pyc is recorded in spam.pyc, and the .pyc file is ignored if these don’t match."
(In reply to comment #0) > a) Annoying log messages here and there, most notably when we hit a SELinux > restriction as that also pops up a graphical notification. Failed to reproduce this on RHEL6, even after manually installing: setroubleshoot-plugins.noarch setroubleshoot.x86_64 setroubleshoot-server.x86_64 Since this is a non critical bug, we'll postpone it. Also, we need more information about if this is really a problem worth solving.
(In reply to comment #4) > (In reply to comment #0) > > > a) Annoying log messages here and there, most notably when we hit a SELinux > > restriction as that also pops up a graphical notification. > > Failed to reproduce this on RHEL6, even after manually installing: > Happens on a default install of Fedora 20. When installing the printer queues, cupsd will try to create lowxmlrpc.pyc, which it isn't allowed to do. Since nothing else will have had an opportunity to create this file earlier, this will happen for more or less every Fedora user that tries out ThinLinc.
*** Bug 5565 has been marked as a duplicate of this bug. ***
*** Bug 5977 has been marked as a duplicate of this bug. ***