[SOLVED] Proxmox Shell for Upgrades logs in wrong directory

Hi,

I'm facing a strange behaviour.
I have a 3xNodes cluster working find for month (almost a year and a half), now it begins to have this behiviour:

On Node1, when I start the shell from the Updates to Upgrade, it logs in / directory instead of /root
On Node2 and Node3 it rightly logs in /root

On all of the three nodes, if I start a Shell, it rightly logs in /root

On all of the three nodes, if I SSH, i trightly logs in /root

So, why only for the Updates-Upgrade shell on just one node it fails to log in the right directory?

Thank you.
 
i think this is as side effect on how console/shell is spawned internally. i don't think this can be changed.

why is this a problem for you ?

to explain what you see - the parent process (in both cases) has it's homedir set to "/" and sub-processes are inheriting that, as long they don't change the dir (what login -f root does)

Code:
# pstree -a -p -g|grep -A2 termproxy
  |   |       `-termproxy,3249282,3249281 5900 --path /nodes/pve-pc1 --perm Sys.Console -- /usr/bin/pveupgrade --shell
  |   |           `-pveupgrade,3249285,3249285 /usr/bin/pveupgrade --shell
  |   |               `-bash,3249369,3249369 -l
--
  |           `-termproxy,3255725,3255724 5900 --path /nodes/pve-pc1 --perm Sys.Console -- /bin/login -f root
  |               `-login,3255727,3255727 -f
  |                   `-bash,3255732,3255732


# ls -la /proc/3249282/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:26 /proc/3249282/cwd -> /
# ls -la /proc/3249285/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:35 /proc/3249285/cwd -> /
# ls -la /proc/3249369/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:35 /proc/3249369/cwd -> /
# ls -la /proc/3255725/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:26 /proc/3255725/cwd -> /
# ls -la /proc/3255727/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:36 /proc/3255727/cwd -> /
# ls -la /proc/3255732/cwd
lrwxrwxrwx 1 root root 0 Feb 11 14:36 /proc/3255732/cwd -> /root
 
Last edited:
It actually does what it must do: run upgrades, so no actual problem.

I'd like to understand why it is so, and it is so on just one node, to prevent/solve moments in which it could be a problem (say it begins doing it on normal GUI shell, and not reading env settings from the right dir).
 
that it's different on one node is weird indeed. please double check if you're not observing wrong

i showed you how to investigate, i.e. how to determine what's the current working directory of a process, so you can analyze this
 
Ok,

Thank you for the insight, I found out it works different if I update a node I'm directly connected to on GUI (node1) or not (node2):

Code:
pstree -a -p -g|grep -A2 termproxy
  |       |   `-termproxy,2386260,2386259 5900 --path /nodes/pvenode1 --perm Sys.Console -- /usr/bin/pveupgrade --shell
  |       |       `-pveupgrade,2386262,2386262 /usr/bin/pveupgrade --shell
  |       |           `-bash,2386666,2386666 -l
--
  |           `-termproxy,2388437,2388436 5900 --path /nodes/pvenode2 --perm Sys.Console -- /usr/bin/ssh -e none -t 10.0.100.12 ...
  |               `-ssh,2388439,2388439 -e none -t 10.0.100.12 -- /usr/bin/pveupgrade --shell
  |-pvefw-logger,1727664,1727664
--
  |           |-grep,2389326,2389325 -A2 termproxy
  |           `-pstree,2389325,2389325 -a -p -g
  |-systemd,2387104,2387104 --user

Everytime I upgrade from gui, it just launches pveupgrade directly if I'm on the right node, but it goes ssh on other nodes, so that's why they run from different directories.

I think I'm fine with it, knowing it's substancially a pveupgrade thing between the gui-connected node and the other cluster nodes, even if a more coherent behiviour could be better cluster and feature-wide.

Thank you very much again!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!