This procedure was tested on FreeBSD-CURRENT build from d8819d88af52.
- Enable linuxulator and install linux userland:
# sysrc linux_enable="YES" # service linux start # pkg install linux_base-c7
This procedure was tested on FreeBSD-CURRENT build from d8819d88af52.
# sysrc linux_enable="YES"
# service linux start
# pkg install linux_base-c7
More schreenshots uploaded here.
Commands Colorized so far...
You may have found many great resources on how to set up jails on latest FreeBSD, however there is scant information on how to go about creating a barebones jail with nothing but the one process that you want to isolate.
I was curious if I could contain a statically compiled web server that I wrote while learning Rust all by itself in a jail instead of having a full userland.
kern.maxproc: Maximum number of processes | |
kern.ngroups: Maximum number of supplemental groups a user can belong to | |
kern.ipc.shm_allow_removed: Enable/Disable attachment to attached segments marked for removal | |
kern.ipc.shm_use_phys: Enable/Disable locking of shared memory pages in core | |
kern.ipc.shmall: Maximum number of pages available for shared memory | |
kern.ipc.shmseg: Number of segments per process | |
kern.ipc.shmmni: Number of shared memory identifiers | |
kern.ipc.shmmin: Minimum shared memory segment size | |
kern.ipc.shmmax: Maximum shared memory segment size | |
kern.ipc.semaem: Adjust on exit max value |
/usr/local/bin/beep -p 659 46 | |
/usr/local/bin/beep -p 784 34 | |
/usr/local/bin/beep -p 659 23 | |
/usr/local/bin/beep -p 659 11 | |
/usr/local/bin/beep -p 880 23 | |
/usr/local/bin/beep -p 659 23 | |
/usr/local/bin/beep -p 587 23 | |
/usr/local/bin/beep -p 659 46 | |
/usr/local/bin/beep -p 988 34 | |
/usr/local/bin/beep -p 659 23 |
# Enable gzip. Highly recommending for best peformance | |
gzip on; | |
gzip_comp_level 6; | |
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript; | |
# By default, do not set expire headers | |
expires 0; | |
# Set expires header for console CSS and JS. | |
# These files are timestamped with each new release, so it is safe to cache them agressively. |