# running apps off a network



## balanga (Jun 5, 2021)

Is there any reason why I can't run apps off a network rather than locally?

Of course I would need to set up the environment first. Adding a network path should be straightforward but what about adding a library path and are there any other variables which would need to be added for this to work?


----------



## SirDice (Jun 5, 2021)

There's no difference between a "network" path or a local path. Both NFS and SMB simply mount on the filesystem.


----------



## balanga (Jun 5, 2021)

It's more a question of getting the right environment in place so that running any app such mc would be able to locate shared libraries on the network. I can't figure out how to do that.


----------



## cmoerz (Jun 5, 2021)

Well, noone is stopping you from simply pointing `LD_LIBRARY_PATH` to any arbitrary path. That's probably the easiest way to have a network folder provide shared libraries. Order of paths obviously is relevant.
I.e.
`export LD_LIBRARY_PATH=/net/abc:$LD_LIBRARY_PATH` is not the same as `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/net/abc`.

I recommend testing your path settings in an interactive shell first. Otherwise, you might screw yourself over - in particular if you aren't running a built-in shell. I.e. if you're running `bash` without having it statically linked, you could end up unable to log in.


----------



## SirDice (Jun 5, 2021)

cmoerz said:


> I.e.
> `export LD_LIBRARY_PATH=/net/abc:$LD_LIBRARY_PATH` is not the same as `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/net/abc`.


Be careful with constructions like this, especially when `$LD_LIBRARY_PATH` is empty.


----------



## covacat (Jun 5, 2021)

also LD_LIBRARY_PATH is ignored for set[ug]id binaries


----------



## Phishfry (Jun 5, 2021)

I built misc/ytree as a static binary. Perhaps you should try with mc. It has minimal dependencies.
I did static compile of flashrom too. Very useful.

MAKE_ARGS+=    STATIC=1









						How to run an application without installing
					

I want to be able to run an application without installing it and can't figure out how to do it.  Basically I want to find all the dependencies of a particular program and then copy them along with the progam to a USB stick so that I can insert the USB stick, mount it and run 'myprog.sh' which...




					forums.freebsd.org


----------



## ralphbsz (Jun 5, 2021)

You can just mount /usr and /lib from an NFS server. That used to be part of the setup of diskless workstations (we used to call them "dickless workstations", today we call it "stateless computing").

When I say "just", that really means: There are lots of configuration issues to overcome, to make sure /etc and /var are matched to /usr and /lib.


----------



## Alain De Vos (Jun 5, 2021)

After mounting /usr/local/ late i had to run,

```
ldconfig -v -m -R /usr/local/lib
```
This in order for the libraries to be found.
For the rest you can use nfs,iscsi,etc...


----------

