adb-atomic-developer-bundle
adb-atomic-developer-bundle copied to clipboard
Better messaging when user try to mount '/root' using sshfs plugin
So currently if a developer execute vagrant up using root as user then as per our Vagrantfile vagrant-sshfs try to do /root => /root which will fail because /root on the guest is non-empty and sshfs avoid it. Now we also want a developer should not do any vagrant operation using root user so we will add a better warning message in the respective Vagrantfile.
Current logging (Not understood by user)
==> default: Mounting folder via SSHFS: /root => /root
==> default: Checking Mount..
Warning: Permanently added '192.168.121.225' (ECDSA) to the list of known hosts.
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
Mounting SSHFS shared via slave SSHFS mount failed. Please look at your
terminal scrollback to look for any error messages from the processes that
were run.
Proposed:
==> default: Mounting folder via SSHFS: /root => /root
==> default: <Whatever suitable message we want>
Gracefully exit.
@dustymabe Please comment if you have any other suggestions.
@praveenkumar almost perfect :). The only change I would make is that we don't actually get to the point where sshfs is trying to mount something. The ==> default: Mounting folder via SSHFS: /root => /root message is coming from the plugin. We need to detect and print our "message" before that.
Also we could choose to Gracefully exit. or to simply warn that we are refusing to automatically mount that mountpoint, and continue.
Isn't the choice of using root or non-root is up to the user. IMO root should be able to mount it, but we should explicitly warn the user and if he agrees (like typing yes twice) to it then we should go ahead and mount it.
@LalatenduMohanty yes, we are just saying that we aren't going to automatically mount it for them and we actually can't mount to /root in the box because it isn't empty.
if they want to mount /root/ from the host somewhere in the container then they can do that by adding another statement to the vagrantfile to do so.