From nobody Sun Dec 29 11:26:59 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YLcQF6PZnz5j0mS for ; Sun, 29 Dec 2024 11:27:01 +0000 (UTC) (envelope-from matthias@d2ux.net) Received: from www444.your-server.de (www444.your-server.de [136.243.160.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YLcQF29qQz4WkQ for ; Sun, 29 Dec 2024 11:27:01 +0000 (UTC) (envelope-from matthias@d2ux.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of matthias@d2ux.net designates 136.243.160.50 as permitted sender) smtp.mailfrom=matthias@d2ux.net; dmarc=none Received: from sslproxy03.your-server.de ([88.198.220.132]) by www444.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tRrRj-000NjG-2s for freebsd-questions@freebsd.org; Sun, 29 Dec 2024 12:26:59 +0100 Received: from [84.160.194.4] (helo=mail.localdomain) by sslproxy03.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tRrRj-00045p-2S for freebsd-questions@freebsd.org; Sun, 29 Dec 2024 12:26:59 +0100 Received: from [192.168.2.29] (celsius.fritz.box [192.168.2.29]) by mail.localdomain (Postfix) with ESMTPSA id 63C028497 for ; Sun, 29 Dec 2024 12:26:59 +0100 (CET) Message-ID: <1de29b99-b23d-4aad-9bbd-2b9df298008b@d2ux.net> Date: Sun, 29 Dec 2024 12:26:59 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Matthias Petermann Subject: Using the jail Module with (Base-)Lua on FreeBSD To: FreeBSD questions Content-Language: de-DE Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-Sender: mpeterma@petermann-it.de X-Virus-Scanned: Clear (ClamAV 1.0.7/27502/Sun Dec 29 10:36:30 2024) X-Spamd-Result: default: False [-3.29 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip4:136.243.160.50/32:c]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; TO_DN_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:24940, ipnet:136.243.0.0/16, country:DE]; ARC_NA(0.00)[]; R_DKIM_NA(0.00)[]; HAS_X_AS(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[d2ux.net]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_ONE(0.00)[1] X-Rspamd-Queue-Id: 4YLcQF29qQz4WkQ X-Spamd-Bar: --- Dear FreeBSD Community, I am currently working on a FreeBSD system where I am managing multiple Jails using Bastille. Here's a snapshot of the active Jails for context: ``` user@microserver:~ $ jls JID IP Address Hostname Path 1 10.0.0.1 dns /usr/local/bastille/jails/dns/root 2 10.0.0.10 redmine /usr/local/bastille/jails/redmine/root ... (truncated for brevity) ... 63 10.0.0.18 webproxy /usr/local/bastille/jails/webproxy/root ``` I attempted to use the jail module with Lua (via /usr/libexec/flua), but I encountered issues when trying to load or interact with it. Below are the steps and results: ``` user@microserver:~ $ /usr/libexec/flua Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio > package.cpath /usr/lib/flua/?.so;/usr/lib/flua/loadall.so;./?.so > local jail = require("jail") > print(jail) nil > jail.list() stdin:1: attempt to index a nil value (global 'jail') stack traceback: stdin:1: in main chunk [C]: in ? > local path = package.searchpath("jail", package.path) > print(path) nil > local path = package.searchpath("jail", package.cpath) > print(path) nil ``` It seems that the jail module is not accessible through Lua’s require() function, and package.searchpath doesn't locate it either in package.path or package.cpath. Questions: - Is the jail module supposed to be available by default in /usr/libexec/flua? - If not, what are the steps to install or enable it? - Are there any specific dependencies or configurations needed for Lua to interact with the jail subsystem on FreeBSD? I’d appreciate any guidance, as I am trying to leverage Lua scripting for automating jail management tasks. Thank you in advance for your time and help! Best regards Matthias