Opened 4 years ago

Closed 4 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 4 years ago.
The (very hard) patch :)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 years ago by Fandekasp

  • Cc lemaire.adrien@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 4 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 4 years ago by claudep

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

comment:4 Changed 4 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 4 years ago by noria (previous) (diff)

Changed 4 years ago by noria

The (very hard) patch :)

comment:5 Changed 4 years ago by noria

  • Has patch set

comment:6 Changed 4 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 4 years ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

In [17855]:

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

comment:8 Changed 4 years ago by claudep

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 4 years ago by claudep

  • Resolution set to fixed
  • Status changed from reopened to closed

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