Opened 7 years ago

Closed 7 years ago

#17983 closed Bug (fixed)

Command line example for symbolic link may cause problems

Reported by: Anonymous Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: lemaire.adrien@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


On this page:

The command line "ln -s WORKING-DIR/django-trunk/django/bin/ /usr/local/bin"
is suggested. This creates a linked file named "bin" inside /usr/local/, instead of creating a link inside the directory /usr/local/bin/.

The suggested command line should be "ln -s WORKING-DIR/django-trunk/django/bin/ /usr/local/bin/"
(slash on the end).

Attachments (1)

patch_17983.diff (542 bytes) - added by noria 7 years ago.
The (very hard) patch :)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by Adrien Lemaire

Cc: lemaire.adrien@… added
Triage Stage: UnreviewedAccepted

I don't see any problem with adding a slash to the doc.

But I don't understand either what problems this lack of slash may engender. Could you give me an example ? As far as I know, /usr/local/bin is a directory in any unix directory structure, and ln -s should work as expected, slash or not

comment:2 Changed 7 years ago by noria

The top of the LN man page :


ln - make links between files


ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)


In the 1st form, create a link to TARGET with the name LINK_NAME. In
the 2nd form, create a link to TARGET in the current directory. In the
3rd and 4th forms, create links to each TARGET in DIRECTORY. Create
hard links by default, symbolic links with --symbolic. When creating
hard links, each TARGET must exist. Symbolic links can hold arbitrary
text; if later resolved, a relative link is interpreted in relation to
its parent directory.

The only case that a link named '/usr/local/bin' is created is when the directory '/usr/local/bin' does not exists. If it exists, ln will create the link in the directory.

I suggest to insist in the documentation that the directory must exist.

Or we can add the command mkdir before the command ln like 'mkdir -p /usr/local/bin ; ln ...', but I think its not django related things (this directory should be create by the system admin, and not by the django user).

comment:3 Changed 7 years ago by Claude Paroz

Or use the 4th form: ln -s -t /usr/local/bin WORKING-DIR/django-trunk/django/bin/

comment:4 Changed 7 years ago by noria

Yes, this command tests that the -t parameter is an existing directory, so it seems to be a better solution.

Last edited 7 years ago by noria (previous) (diff)

Changed 7 years ago by noria

Attachment: patch_17983.diff added

The (very hard) patch :)

comment:5 Changed 7 years ago by noria

Has patch: set

comment:6 Changed 7 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:7 Changed 7 years ago by Claude Paroz

Resolution: fixed
Status: newclosed

In [17855]:

Fixed #17983 -- Use a non-ambiguous syntax of the ln command in install docs.

comment:8 Changed 7 years ago by Claude Paroz

Resolution: fixed
Status: closedreopened

It appears that the -t option is not standard ( It might be Linux-specific, at least not available on OSX. Will use the trailing slash solution instead.

comment:9 Changed 7 years ago by Claude Paroz

Resolution: fixed
Status: reopenedclosed

In [17859]:

Fixed #17983 -- Re-fixed the ln syntax by adding a trailing slash to the destination directory.

The -t argument is not a POSIX standard. Thanks Aymeric Augustin for pointing the problem.

Note: See TracTickets for help on using tickets.
Back to Top