Bug 556970

Summary: Make /usr/bin/python a symlink
Product: [Fedora] Fedora Reporter: Toshio Ernie Kuratomi <a.badger>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dmalcolm, ivazqueznet, james.antill, jonathansteffan, rpandit
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-11 20:49:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Toshio Ernie Kuratomi 2010-01-19 23:08:13 UTC
Description of problem:
Both python2 contains a ${_bindir}/python file which is a copy of its python interpreter (/usr/bin/python2.6). Instead, it should be a symlink.

Comment 1 Dave Malcolm 2010-01-19 23:28:35 UTC
Relevant code in Makefile.pre.in is this line within the "bininstall" target:
	(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))

This translates to this in the build log (see e.g. http://koji.fedoraproject.org/koji/getfile?taskID=1930186&name=build.log)
  (cd /builddir/build/BUILDROOT/python-2.6.4-6.fc13.x86_64/usr/bin; ln python2.6 python)

and for python3 (e.g. http://koji.fedoraproject.org/koji/getfile?taskID=1930070&name=build.log):
  (cd /builddir/build/BUILDROOT/python3-3.1.1-17.fc13.x86_64/usr/bin; ln python3.1 python3)

Comment 2 Dave Malcolm 2010-02-11 20:49:57 UTC
It's a hardlink, not a copy.

In the following, note how both /usr/bin/python and /usr/bin/python2.6 are names for Inode 93896:

[david@brick ~]$ stat /usr/bin/python
  File: `/usr/bin/python'
  Size: 5916      	Blocks: 16         IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 93896       Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-11 07:58:36.147851467 -0500
Modify: 2010-01-25 13:24:26.000000000 -0500
Change: 2010-01-26 03:37:39.571857466 -0500
[david@brick ~]$ stat /usr/bin/python2.6
  File: `/usr/bin/python2.6'
  Size: 5916      	Blocks: 16         IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 93896       Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-11 07:58:36.147851467 -0500
Modify: 2010-01-25 13:24:26.000000000 -0500
Change: 2010-01-26 03:37:39.571857466 -0500

...and from rpm -qlv python:
-rwxr-xr-x    2 root    root                     3564 Jan 25 13:24 /usr/bin/python
lrwxrwxrwx    1 root    root                        6 Jan 25 13:24 /usr/bin/python2 -> python
-rwxr-xr-x    2 root    root                     3564 Jan 25 13:24 /usr/bin/python2.6

...note the "2" in the link count column, whereas /usr/bin/python2 is a symlink to the first of the two names.

[david@brick ~]$ stat /usr/bin/python2
  File: `/usr/bin/python2' -> `python'
  Size: 6         	Blocks: 0          IO Block: 4096   symbolic link
Device: fd01h/64769d	Inode: 98197       Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-10 14:27:49.609851030 -0500
Modify: 2010-01-25 13:37:25.414865416 -0500
Change: 2010-01-25 13:37:25.442865973 -0500


Similarly, for python3 and python3.1, both are hardlinks for the same Inode , 113214 in the case below:
-rwxr-xr-x    2 root    root                     5340 Feb  8 22:35 /usr/bin/python3
-rwxr-xr-x    2 root    root                     5340 Feb  8 22:35 /usr/bin/python3.1

[david@brick ~]$ stat /usr/bin/python3
  File: `/usr/bin/python3'
  Size: 7824      	Blocks: 16         IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 113214      Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-10 08:36:46.542666568 -0500
Modify: 2010-02-08 22:35:30.000000000 -0500
Change: 2010-02-09 03:14:15.580211521 -0500
[david@brick ~]$ stat /usr/bin/python3.1
  File: `/usr/bin/python3.1'
  Size: 7824      	Blocks: 16         IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 113214      Links: 2
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-10 08:36:46.542666568 -0500
Modify: 2010-02-08 22:35:30.000000000 -0500
Change: 2010-02-09 03:14:15.580211521 -0500

This behavior follows upstream and seems reasonable, so I'm going to closing this out as NOTABUG.

It looks like I was in error when I wrote the material referring to this bug that's now in the preamble of https://fedoraproject.org/wiki/Packaging:Python, and that they will require a slight rewording.  

Sorry about this.

Comment 3 Rakesh Pandit 2010-05-17 07:34:44 UTC
(In reply to comment #2)
[..]
> 
> It looks like I was in error when I wrote the material referring to this bug
> that's now in the preamble of https://fedoraproject.org/wiki/Packaging:Python,
> and that they will require a slight rewording.  
> 

May you update the wiki page or request someone with appropriate permission to do it ? Toshio ?

Regards,
Rakesh Pandit

> Sorry about this.

Comment 4 Toshio Ernie Kuratomi 2010-05-17 15:40:33 UTC
Updated by removing the pull box noting this bug and changing the paragraph about system runtimes to this:

One of these python runtimes is the "system runtime" which is what we run when invoking <code>/usr/bin/python</code>.  On Fedora 13 this is <code>/usr/bin/python-2.6</code>

Comment 5 Rakesh Pandit 2010-05-18 05:05:09 UTC
(In reply to comment #4)
> Updated by removing the pull box noting this bug and changing the paragraph
> about system runtimes to this:
> 
> One of these python runtimes is the "system runtime" which is what we run when
> invoking <code>/usr/bin/python</code>.  On Fedora 13 this is
> <code>/usr/bin/python-2.6</code>    

Thanks for looking into it. :)

Regards,
Rakesh Pandit