Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 361867 - dev-lang/python: Use target pydoc script in pydoc init.d script
Summary: dev-lang/python: Use target pydoc script in pydoc init.d script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: Normal minor (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard: python-overlay
Keywords: InOverlay, InVCS
Depends on:
Blocks:
 
Reported: 2011-04-04 07:08 UTC by Balint SZENTE
Modified: 2011-10-27 14:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
The python ebuild patch. (python.ebuild.patch,514 bytes, patch)
2011-04-04 07:09 UTC, Balint SZENTE
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balint SZENTE 2011-04-04 07:08:03 UTC
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.
Comment 1 Balint SZENTE 2011-04-04 07:09:26 UTC
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.
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-04-17 17:37:32 UTC
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
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-05-17 15:17:10 UTC
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.
Comment 4 Balint SZENTE 2011-06-25 14:22:19 UTC
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.
Comment 5 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-25 16:53:27 UTC
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?
Comment 6 Balint SZENTE 2011-06-25 18:29:52 UTC
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?
Comment 7 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-25 20:27:49 UTC
Please test changes implemented in python overlay.
Comment 8 Balint SZENTE 2011-06-27 07:43:38 UTC
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.
Comment 9 Jesus Rivero (RETIRED) gentoo-dev 2011-10-27 14:37:22 UTC
Committed to tree. 
Closing bug.

Thanks Balint. 

Best regards,