In case of multiple Python installations the pydoc rc script executes the default pydoc command regardless of the Python version. It is not enough to rename the slotted pydoc rc files, but the pydoc paths should be fixed as well. Se attached patch for the python ebuilds. Each ebuild should be modified accordingly. Reproducible: Always Steps to Reproduce: 1. emerge system (will install python2 and python3 - the default interpreter will be python2) 2. execute /etc/init.d/pydoc-3.1 Actual Results: The pydoc-2.6 server will be executed. Expected Results: The pydoc-3.1 should be executed.
Created attachment 268455 [details, diff] The python ebuild patch. This patch (or something equivalent) should be applied to all python ebuilds in order to avoid pydoc rc script confusion.
Fixed in Python 2.7.2_pre20110410, 3.0.1, 3.1.4_pre20110410, 3.2.1_pre20110410 and 3.3_pre20110410 in r441. http://overlays.gentoo.org/proj/python/changeset/441
Fixed also in Python 2.4.6, 2.5.4-r4, 2.6.5-r3, 2.6.6-r2, 2.7.1-r1, 3.1.3-r1 and 3.2.
There is one issue with your modification: the pid filename does not contain the python version thus it will be shared among the init scripts. This way it is not possible to start more pydoc daemons. You should patch also the pid file's name, as you did with the pydoc command like this: ... --pidfile /var/run/pydoc2.7.pid \ --startas /usr/bin/pydoc2.7 -- -p ... My example patch modified both filenames.
What about PYDOC_PORT variable? Is it possible to start multiple pydoc servers on the same port? Should we add possibility to set port only for pydoc server from specific Python slot?
Actually I don't find an issue the PYDOC_PORT variable. It can be easily modified to a custom value by each Gentoo user who wants to run multiple pydoc servers. In my personal opinion the PYDOC_PORT should remain on the default port for each python slot. The common case is that people run only one server, and the default port must be in this case to avoid confusion. If somebody wants to run two or more pydoc servers, than he knows anyway he must set different port numbers. I think an elog message is enough to notify the user about the collision of the PYDOC_PORT default values. Do you have any better idea?
Please test changes implemented in python overlay.
The changes are ok. I can run now simultaneously two servers on different ports. A remark: the servers can be started on the same port, but only the first server will show its content. Perhaps the pydoc server does not check the port and blindly starts. So it is necessary to specify different port numbers for each pydoc server, but this is now the users concern. Maybe you can add an post install elog info with a message something like this: "Don't forget to set the PYDOC${SLOT}_PORT variable if you want to run simultaneously multiple pydoc servers." Thanks.
Committed to tree. Closing bug. Thanks Balint. Best regards,