1

For some reason (most probably happened during an upgrade more than one year ago), my system has a directory called /etc/../run (strange, right?). It is empty but I cannot remove it:

$ ls /etc/../run
$ sudo rmdir /etc/../run
rmdir: échec de suppression de «/etc/../run»: Périphérique ou ressource occupé
$ ls -iald /etc/../run
393217 drwxr-xr-x 2 root root 4096 sep  6 19:18 /etc/../run
$ ls -iald /run
9221 drwxr-xr-x 31 root root 1060 sep 25 22:55 /run
$ ls -d /etc/../run | od -ha
0000000    652f    6374    2e2f    2f2e    7572    0a6e
          /   e   t   c   /   .   .   /   r   u   n  nl
0000014
$ ls -d /run | od -ha
0000000    722f    6e75    000a
          /   r   u   n  nl
0000005
$ ls -al /etc
total 1524
drwxr-xr-x 166 root     root      12288 sep 24 19:18 .
drwxr-xr-x  22 root     root       4096 sep  6 19:54 ..
drwxr-xr-x   3 root     root       4096 aoû 25 20:03 acpi
-rw-r--r--   1 root     root       2981 avr 23  2012 adduser.conf
...
$`

As I suspect this is the cause of some troubles, I would like to suppress it. How?

10
  • try to post ls -lad /etc/../run. This should be really /run, but it's quite strange that's empty... Are you sure these are really to dots and not some different (unicode) char?
    – Rmano
    Sep 24, 2014 at 9:05
  • I edited the question to answer your comment. Also added the result of $ ls -lad /run Sep 24, 2014 at 17:35
  • This is really strange. This .. directory is not what it seems. What is the result of ls -al /etc (trim it down to show just ., .. and a few files) and ls /etc/../run | od -ha ? (Rationale: trying to see if the ".." is a fake).
    – Rmano
    Sep 24, 2014 at 17:50
  • I edited the question to give those results. Sep 24, 2014 at 18:13
  • There is really something pesky here; even od acts strange. The ASCII code of .. should be 0x2f 0x2f, see: ls -d /etc/../run | od -ha returns: 0000000 652f 6374 2e2f 2f2e 7572 0a6e / e t c / . . / r u n nl (on two lines). I would recommend a shutdown followed by a fsck of the filesystem.
    – Rmano
    Sep 25, 2014 at 8:00

1 Answer 1

0

Unless you quite literally have a directory named .. in /etc, no, that directory is not in /etc. .. refers to the parent directory of the current directory, (like . refers to itself) and exist for every directory:

$ ls -al /
total 16
drwxr-xr-x 1 root root   0 Jun  1  2013 .
drwxr-xr-x 1 root root 122 Jul 14 05:33 ..

So /etc/../ actually refers to /, and /etc/../run refers to /run, which is a very important folder. Do NOT delete it.

Some configuration files, most notably resolv.conf maybe symbolic links to files in /run, but that is absolutely normal:

$ ls /etc/resolv.conf -l
lrwxrwxrwx 1 root root 27 Jun 23 17:54 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
3
  • This is what I thought as well but I guess I have a directory named ... You are right as well about the DNS symbolink link: this is where I started my investigation. That led my to create the following link: $ ls /etc/resolv.conf -l lrwxrwxrwx 1 root root 27 sep 6 19:36 /etc/resolv.conf -> /run/resolvconf/resolv.conf. Please note the absence of the two dots. If I create the original link (with the dots), I have no DNS resolution. BTW thank you for editing my question. It looks much clearer now. Sep 24, 2014 at 17:28
  • @MarcVanhoomissen I have access to a lab with ~200 systems, and a few servers. All of them (even the couple of 12.04 ones, others all 14.04), without fail, have the relative symbolic link (with ..). It looks like a bug of some sort. Perhaps you should have a new question ("Why don't I get name resolution with the normal, relative link?")
    – muru
    Sep 24, 2014 at 23:09
  • Thanks, I will try to formulate another question, based on the findings so far. Sep 26, 2014 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .