Jip-Hop / jailmaker

Persistent Linux 'jails' on TrueNAS SCALE to install software (docker-compose, portainer, podman, etc.) with full access to all files via bind mounts thanks to systemd-nspawn!
GNU Lesser General Public License v3.0
313 stars 31 forks source link

Move jailmaker install location #175

Closed LordJuice1 closed 2 weeks ago

LordJuice1 commented 2 weeks ago

I needed to change my pool name. Long story short, I changed my name that had a space in it, we can call it "test test", to "test_test". Doing that made my existing apps break despite me telling them where to look at. So I had to change it back to "test test". But naturally, when I run jlmkr list, it says it cant find /mnt/test_test/jailmaker. Is there an easy way to tell it the new path? And also have it handle a path with a space in it?

Lockszmith-GH commented 2 weeks ago

There should be a way to edit stuff, but until someone who knows how to do that provides an answer, I'll provide a hack that might workaround your issue - at least temporarily.

You can try a symbolic link (which might work), or a bind mount which should work.

⚠️ NOTE: Both these options here are not permanent in TrueNAS SCALE, as the /mnt folder is part of the boot-pool, which is reset after an upgrade. To make them permanent, you'll need to run them everytime the system boots.

A symbolic link:

# ln -s '/mnt/test test' /mnt/test_test
# ls -lahF /mnt

total ...
drwxr-xr-x ## root     root ... ./
drwxr-xr-x ## root     root ... ../
drwxrwxrwx ## apps     apps ... test test/
lrwxrwxrwx ## root     root ... test_test -> '/mnt/test test'

A bind mount:

# mkdir /mnt/test_test
# chown apps:apps /mnt/test_test
# mount -o bind '/mnt/test test' /mnt/test_test

# ls -lahF /mnt

total ...
drwxr-xr-x ## root     root ... ./
drwxr-xr-x ## root     root ... ../
drwxrwxrwx ## apps     apps ... test test/
drwxrwxrwx ## apps     apps ... test_test/
Jip-Hop commented 2 weeks ago

Which version of SCALE are you using? Are you using the latest version of jailmaker?

LordJuice1 commented 2 weeks ago

Which version of SCALE are you using? Are you using the latest version of jailmaker?

I'm on Dragonfish-24.04.0 and I installed jailmaker yesterday, so I should be

Jip-Hop commented 2 weeks ago

Then you're invoking jailmaker with the shell alias. Check the contents of /root/.zshrc and /root/.bashrc. You can fix your jailmaker alias in there.

LordJuice1 commented 2 weeks ago

I did see the old path in there and made the change from /mnt/test_test/jailmaker/jlmkr.py to /mnt/test\ test/jailmaker/jlmkr.py. But when I run 'jlmkr list', it still gives the error zsh: no such file or directory: /mnt/test_test/jailmaker/jlmkr.py. But I'm respecting a reboot is needed or restart of a service is needed

Lockszmith-GH commented 2 weeks ago

the ...rc files are loaded when you login. if you don't want to re-login, you can just run

exec $SHELL -l

and the envrionment will be reloaded.

LordJuice1 commented 2 weeks ago

the ...rc files are loaded when you login. if you don't want to re-login, you can just run

exec $SHELL -l

and the envrionment will be reloaded.

Thanks for the info!