]> git.proxmox.com Git - pve-cluster.git/commit
pvecm add: require user to navigate out of /etc/pve
authorFriedrich Weber <f.weber@proxmox.com>
Thu, 9 Mar 2023 12:30:19 +0000 (13:30 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 11 Mar 2023 17:01:09 +0000 (18:01 +0100)
commit91c2593616204b89dc0714e944ac177211bccda0
tree5a1828f3d82f3050c2b483e9a62b6e664be259b8
parentdeeedc09ae7b88b8fc39d061a702885c1ed1d9fe
pvecm add: require user to navigate out of /etc/pve

If `pvecm add` is issued from /etc/pve (or any subdirectory), it
prints some errors:

    [...]
    shell-init: error retrieving current directory: getcwd: cannot
    access parent directories: Transport endpoint is not connected
    [...]
    successfully added node 'pve-c2' to cluster.
    cannot fetch initial working directory: Transport endpoint is not
    connected at /usr/share/perl5/PVE/CLI/pvecm.pm line 446.

The reason is that `pvecm add` restarts pmxcfs, which re-mounts the
fuse mount at /etc/pve, invalidating pvecm's working directory.

The error messages give the impression that something went wrong.
Indeed, the second error indicates the temporary directory is not
cleaned up. The cluster join itself actually works, though.

The issue could be fixed by chdir'ing to / in `pvecm add`. However,
the user's shell would still remain in the now-invalid /etc/pve,
potentially leading to confusing "transport endpoint not connected"
messages in future interactions.

To avoid this, require the user to chdir out of /etc/pve before
running `pvecm add`.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
data/PVE/CLI/pvecm.pm