bsdpot / potluck

This project contains the FreeBSD pot (jail) (pkg install pot) flavours which are regularly built with Jenkins and published on potluck.honeyguide.net.
BSD 3-Clause "New" or "Revised" License
41 stars 9 forks source link

Error mounting tmpfs failed (git flavor jail) #51

Closed JohnKaul closed 1 month ago

JohnKaul commented 1 month ago

First of all, amazing work/project. Thank you for your efforts.

Second, I tried to create a git JAIL (I am only attempting JAIL creation currently) from the git-nomad image and I ran into a problem durring start about "mounting tmpfs".

I am just getting my feet wet again after a long break away from BSD so I'm very rusty but I got my FreeBSD setup and a net bridge created. I have created my own jail flavors--based on potluck flavors as examples--and they being simple enough--create, add user, add pub key, setup .nextrc, etc--are working great. My next phase was to try using the ready made potluck images.

john[server:~]doas pot import -p git-nomad-amd64-14_0 -t 1.15.1 -U https://potluck.honeyguide.net/git-nomad

===>  importing git-nomad-amd64-14_0 @ 1.15.1 as git-nomad-amd64-14_0_1_15_1
/var/cache/pot/git-nomad-amd64-14_0_1.15.1.xz.         257  B 2092 kBps    00s
/var/cache/pot/git-nomad-amd64-14_0_1.15.1.xz          103 MB  813 kBps 02m11s
/var/cache/pot/git-nomad-amd64-14_0_1.15.1.xz.          50  B  396 kBps    00s
===>  Pot git-nomad-amd64-14_0_1_15_1 depends on freebsd-potluck-amd64-14_0_0_0_26_base (@1720718608)
===>  Installing dependency freebsd-potluck-amd64-14_0_0_0_26_base
===>  importing freebsd-potluck-amd64-14_0_0_0_26 @ base as freebsd-potluck-amd64-14_0_0_0_26_base
/var/cache/pot/freebsd-potluck-amd64-14_0_0_0_         257  B 1974 kBps    00s
/var/cache/pot/freebsd-potluck-amd64-14_0_0_0_         577 MB  793 kBps 12m26s
/var/cache/pot/freebsd-potluck-amd64-14_0_0_0_           2  B   15 kBps    00s
===>  Pot freebsd-potluck-amd64-14_0_0_0_26_base has no dependencies
===>  Assigning new IP: 192.168.0.2
cannot mount 'zroot/jails/jails/git-nomad-amd64-14_0_1_15_1/m': filesystem already mounted
===>  Assigning new IP: 192.168.0.3

john[server:~]doas pot ls
pot name : freebsd-potluck-amd64-14_0_0_0_26_base
    network : public-bridge
    ip : 192.168.0.2
    active : false

pot name : git-nomad-amd64-14_0_1_15_1
    network : public-bridge
    ip : 192.168.0.3
    active : false

john[server:~]doas pot start freebsd-potluck-amd64-14_0_0_0_26_base
===>  Internal network not found! Calling vnet-start to fix the issue
pfctl: pf already enabled
defaultrouter: 10.192.0.1 -> 192.168.0.250
===>  Starting the pot freebsd-potluck-amd64-14_0_0_0_26_base
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
    options=8<VLAN_MTU>
    ether 02:32:6a:53:fa:0b
    inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
    groups: epair
    media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 192.168.0.250
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Updating /var/run/os-release done.
Creating and/or trimming log files.
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting cron.

Wed Jul 31 15:23:15 UTC 2024

john[server:~]doas pot run -p git-nomad-amd64-14_0_1_15_1          
mount: /usr/jails/jails/git-nomad-amd64-14_0_1_15_1/m/tmp: No such file or directory
###>  Error mounting tmpfs
###>  Mount failed 
###>  The pot git-nomad-amd64-14_0_1_15_1 doesn't start
bretton commented 1 month ago

Hi @JohnKaul

The git-nomad image would only run as a nomad job, for which you'd need consul, nomad-server, traefik images running too.

You can see a playbook for a sample environment here which runs some nginx nomad jobs.

You don't need to start the base image either. The pot image is layered over this and does what it needs to.

The git-nomad image isn't the best one to experiment with. The ansible playbook might be more informative for ways to tie things together.

JohnKaul commented 1 month ago

Understood. Thank you. I think I will keep playing with jails for the time being (still taking baby steps) seeing as I essentially only need "a plex (type of) jail" at the moment. Ansible was on my radar (for later) but I will definitely check out the link.

So, please pass on my thanks to all those involved in this project.