[mosh-users] issues with PATH on ubuntu

Keith Winstein keithw at MIT.EDU
Tue Apr 10 23:25:20 EDT 2012


Hello David,

Unfortunately, non-interactive shells don't read bashrc, and I think
you will have the same problem if you run:

$ ssh dmoore at server 'echo $PATH'

I.e., the problem isn't specific to mosh.

I think you're probably going to have to give a --server argument.
This could be as simple as "mosh dmoore at server --server=./mosh-server"
to specify it's in your home directory. (Perhaps you can make a local
alias for this to save typing for now...)

Regarding LD_LIBRARY_PATH, your best option may be to make a short
shell script that sets these variables and then execs the "real"
mosh-server binary.

Another approach is to cram it all into the --server argument:

$ mosh dmoore at server --server='LD_LIBRARY_PATH=x ./mosh-server'

And a third approach is to link statically with protobuf. If you
recompile mosh-server (make V=1) and replace "-lprotobuf" with the
path to "libprotobuf.a" on your system, that will eliminate the
runtime dependency.

Good luck, and thanks for using mosh!

Best regards,
Keith

On Tue, Apr 10, 2012 at 9:01 PM, David Moore <dmoore at cs.berkeley.edu> wrote:
> Hi,
>
> I'm trying to set up mosh on an Ubuntu 10.04 machine to which I don't
> have root access. I compiled mosh from git and installed it and its
> dependencies under my home directory, i.e. with prefix ~/local/ so
> mosh-server is at ~/local/bin/mosh-server. My .bashrc thus contains
> entries updating the appropriate paths:
>
> export PATH="${PATH}:/home/dmoore/local/bin/"
> export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/home/dmoore/local/lib/pkgconfig"
> export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/dmoore/local/lib/"
>
> and I can log in and run mosh-server directly from the shell. However,
> when I try using "mosh" to connect to the machine, I get the error
>
> bash: mosh-server: command not found
> Connection to patmos.banatao.berkeley.edu closed.
> /usr/bin/mosh: Did not find mosh server startup message.
>
> If I try specifying the server location on the command line ("mosh
> --mosh-server=/home/dmoore/local/bin/mosh-server dmoore at server"), then
> I get
>
> /home/dmoore/local/bin/mosh-server: error while loading shared
> libraries: libprotobuf.so.7: cannot open shared object file: No such
> file or directory
> Connection to patmos.banatao.berkeley.edu closed.
> /usr/bin/mosh: Did not find mosh server startup message.
>
> which indicates that it's not using the correct LD_LIBRARY_PATH. I
> tested this by running "mosh --server='echo $PATH' dmoore at server",
> which shows that mosh is seeing the PATH as
> "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games";
> i.e. it doesn't seem to be running the commands in my .bashrc file and
> so it's not seeing the updated path to the local installation.
>
> Any advice on how to get mosh working when installed under a nonstandard path?
>
> Thanks,
> Dave
> _______________________________________________
> mosh-users mailing list
> mosh-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-users


More information about the mosh-users mailing list