Closed richardk2016 closed 2 years ago
The log file is in the Remote-SSH output channel. But yeah, flock is required right now, we will have to find another file locking solution for this sort of case.
Having the same problem. I'm using ubuntu 18.04 LTS. Passphrase always prompting and remote-ssh channel error "flock: command not found". I can successfully login using putty so ssh configuration is not the cause. BTW, I'm trying to remote my project uploaded in a cloud hosting site.
So this is just normal ubuntu 18.04? What happens if you run flock
in a terminal on that machine? For me it is installed at /usr/bin/flock
I just encountered this with a cPanel host. No idea what the os is, but flock is not installed anywhere.
I think the install script should just continue without locking if flock is not available.
That would work most of the time but I'm afraid of ending up with even harder to understand issues and logfiles. :/
What is the flock used for? Won't an atomic rename work just as well?
We are using the lock to make sure that only one client is installing/starting the server at a time. Possibly, can you tell me more?
@roblourens each client should create a temp random dir, and make a symlink from it to the correct name. If creating the symlink fails, or reading the symlink (*) doesn't link to the random dir, another client is installing.
Frankly though, the install script seems quite complex to get right on all unices, and I think it would be better to install from a node script. To do that, SSH in multiple times:
~/.vscode/node
and check if it is there + the correct versionnode
works and is the minimum version you need~/.vscode/node
.
ssh remotehost .vscode/node < script
and it works immediately(*): hmm not all unices have readlink
installed, so another option is to also create a file with unique contents and reading it through the symlink
Thanks for the suggestion, I will experiment with that. But I will stick with the bash script because running multiple ssh commands requires users to enter their passwords multiple times.
running multiple ssh commands requires users to enter their passwords multiple times
actually, you can set up a master connection and then run as many connections as you like, and if you use the node ssh2
module, you can do it from javascript, just call client.exec() on an open client as many times as you like.
The master connection multiplexing is not supported on windows. And originally I used ssh2, but long story short, I want to stay as close to ssh myHost
as possible for debugging purposes, and OpenSSH does a lot of other stuff that I didn't want to reinvent.
what could be done is:
or use a scripting language if its available
perl https://stackoverflow.com/questions/10526651/mac-os-x-equivalent-of-linux-flock1-command/13343904
python http://blog.e-shell.org/309
maybe check if flock is available and offer a replacement if not?
We have actually had this for some time, with the remote.SSH.useFlock
setting.
When trying to connect to my ssh host, I get the error message
bash: line 48: flock: command not found
after I entered my password. Logging in from the same machine with the built-in ssh client (Windows 10 Ver. 1903, fully patched) with 'ssh user@domain.tld' works without any problem. So password and connection are not the cause.
Unfortunately I can't find a logfile where the connection attempt is stored after the connection attempt. The message didn't stop in the console either. I had to shoot a video! to read the error output. Not nice! The screenshot is extracted from the video.
My shh host is located at a shared hosting provider. I don't have root rights there and the tool 'flock' is not available there for security reasons. Furthermore, it is impossible for me to install anything there. I can only perform file operations (create, copy, move and delete) and a handful of safe linux commands. I need ssh access mainly to edit files directly. The shared hoster uses Linux, the exact version is not known. How can I use the extension without flock?