Using exec
allows me to run commands within an allocation. This is very handy.
[my-laptop] $ nomad job allocs job-name
> alloc id: abcd1234
[my-laptop] $ nomad alloc exec -task app abcd1234 /bin/bash
[nomad-alloc] $
However, if I try to open an editor via the exec
environment, I am unable.
[nomad-alloc] $ nano
Error opening terminal: vt100.
Is it possible to run an editor via the exec
command?
Hi, I just tested raw_exec, exec and docker and I can run nano, vim on all of them started from interactive login and non-login shell.
Something to notice is that TERM
changes for me between drivers:
driver |
TERM |
docker |
xterm |
exec |
dumb |
raw_exec |
dumb |
The error suggests that ncurses is not able to find terminal definitions somewhere in /usr/share/terminfo/
or /home/<USER>/.terminfo
. Debug it normally, run nano
it under strace and see what it tries to access. There are ncurses has also it’s own debugging.
Guessing, because exec
driver does some mounts, I would guess you have to run a login shell on your system and it initlialized TERMINFO (or TERMINFO_DIRS) specially, or the directory with terminfo is not available inside exec environment.
1 Like