FS#62366 - Pacman overwrites symlink with a directory despite being listed under NoUpgrade
Attached to Project:
Pacman
Opened by Dimitrios Apostolou (jimis) - Tuesday, 16 April 2019, 14:12 GMT
Last edited by Andrew Gregory (andrewgregory) - Monday, 22 April 2019, 05:04 GMT
Opened by Dimitrios Apostolou (jimis) - Tuesday, 16 April 2019, 14:12 GMT
Last edited by Andrew Gregory (andrewgregory) - Monday, 22 April 2019, 05:04 GMT
|
Details
Summary: I want to stop pacman from installing the /home
empty directory, contained in the filesystem package.
Details: I have moved all my /home folder to a subdirectory of a new disk, by means of a symlink: ``` # ls -l /home lrwxrwxrwx 1 root root 13 Apr 16 17:02 /home -> /mnt/newdisk/home/ ``` The problem is that every time the `filesystem` package gets upgraded, the symlink `/home` is overwritten and replaced with an empty directory. *No warnings or messages are printed whatsoever*, I found out at first because users could not login. I have tried to list `home` in pacman.conf under `NoUpgrade` and `NoExtract` but no luck: symlink is overwritten with no warning. For now I have a workaround: list `filesystem` in `IgnorePkg` and hope nothing breaks in the future. Any ideas how to stop pacman from touching my symlink? |
This task depends upon
Closed by Andrew Gregory (andrewgregory)
Monday, 22 April 2019, 05:04 GMT
Reason for closing: Not a bug
Monday, 22 April 2019, 05:04 GMT
Reason for closing: Not a bug
However pacman is not able to handle symlinks where directories are expected instead of symlinks bind mounts should be used.
FS#58804-- pacman bug, not general arch-projects bug.pacman is buggy and really should fatally abort, refusing to allow you to upgrade your system at all until you stop using symlinks and start using bind mounts.
However, the solution is still that you should not be using symlinks at all. It's invalid to replace a directory with a file (even if that file is of type "symbolic link").
Note that another solution, instead of using bind mounts, is to correctly configure the `useradd` command via the file /etc/default/useradd, and set HOME=/some/other/base/directory
This would result in an /etc/passwd which natively contains the correct locations, and is IMHO a far better solution.
I will leave this bug open for a bit, because I'd like Allan or Andrew to confirm if NoUpgrade is supposed to display this behavior of extracting a directory (in this case /home/ which is indeed a directory as far as makepkg is concerned) -- the manpage only specifies that it accepts files, so I'm unsure whether this is correct, a bug, or "undefined behavior" that could be implemented.
The bind mount sounds like a good workaround, I appreciate the advice and I'll apply it. Changing /etc/default/useradd not so much though, it will definitely have side-effects as there are many scripts that presume homes under /home. (yes these tools shouldn't assume /home, but they do)
Looking forward to getting feedback on NoUpgrade, it would definitely be nice to be able to upgrade the system with such symlinks in place.
Otherwise I'm OK with closing this as DUPLICATE, since the one you pointed to (
FS#58804) is open and acknowledged as a bug.