fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 111 forks source link

Adding JUNEST_HOME variable during the installation as a parameter of junest setup #266

Open crsegerie opened 3 years ago

crsegerie commented 3 years ago

I am installing junest on a server on which I do not have the root access. On the server, there is the workbench (/local) and my private repository (/home) but there is not enough space on my home, so I changed the junest/lib/core/common.sh file by just changing JUNEST_HOME in the bash variable:

# JUNEST_HOME=${JUNEST_HOME:-~/.${CMD}}
JUNEST_HOME="/local/junest/exe"
JUNEST_TEMPDIR=${JUNEST_TEMPDIR:-/tmp}

Then, after changing the JUNEST_HOME variable, I ran the junest setup command.

But it seems that changing the JUNEST_HOME is not permitted because now I run into lots of problems:

scampo01@v100alpha:/local/jun/junest/lib$ junest proot -f
proot warning: can't chdir("/local/jun/junest/lib/./.") in the guest rootfs: No such file or directory
proot info: default working directory is now "/"
proot info: pid 716: terminated with signal 11
proot warning: can't chdir("/local/jun/junest/lib/./.") in the guest rootfs: No such file or directory
proot info: default working directory is now "/"
Warn: Proot is not properly working. Disabling SECCOMP and expect the application to run slowly in particular when it uses syscalls intensively.
Try to use Linux namespace instead as it is more reliable: junest ns
proot warning: can't chdir("/local/jun/junest/lib/./.") in the guest rootfs: No such file or directory
proot info: default working directory is now "/"
root@v100alpha:/# ls
ls: cannot access 'lib64': No such file or directory
ls: cannot access 'mnt': No such file or directory
ls: cannot access 'root': No such file or directory
ls: cannot access 'usr': No such file or directory
ls: cannot access 'lib': No such file or directory
ls: cannot access 'run': No such file or directory
ls: cannot access 'proc': No such file or directory
ls: cannot access 'boot': No such file or directory
ls: cannot access 'bin': No such file or directory
ls: cannot access 'srv': No such file or directory
ls: cannot access 'opt': No such file or directory
ls: cannot access 'etc': No such file or directory
ls: cannot access 'home': No such file or directory
ls: cannot access 'sbin': No such file or directory
ls: cannot access 'sys': No such file or directory
ls: cannot access 'var': No such file or directory
ls: cannot access 'dev': No such file or directory
ls: cannot access 'tmp': No such file or directory
bin  boot  dev  etc  home  lib  lib64  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@v100alpha:/# 

My take would be to change the default working directory to the same path as JUNEST_HOME, but I looked a bit in the code and I can't find any way to do it. I will be very grateful if you help me on those problems.

But the main point of this issue is really to make it more easy to setup junest in a custom directory, otherwise I would have posted on stack overflow.

Thank you very much for your help, and thank you for maintaining this very cool package.

fsquillace commented 3 years ago

Hi,

Sorry I am not sure I follow. You should be able to change the JUNEST_HOME env variable without changing any code (doc here).

JUNEST_HOME=/local/junest/exe junest setup
crsegerie commented 3 years ago

That's what I did, but you can see on my capture that it broke the installation