From owner-freebsd-jail@freebsd.org Tue May 15 11:17:22 2018 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C865EAE9B2 for ; Tue, 15 May 2018 11:17:22 +0000 (UTC) (envelope-from andreas.sommer87@googlemail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7E9E6D4D4 for ; Tue, 15 May 2018 11:17:21 +0000 (UTC) (envelope-from andreas.sommer87@googlemail.com) Received: by mail-wr0-x22b.google.com with SMTP id y15-v6so15562779wrg.11 for ; Tue, 15 May 2018 04:17:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=geKzpGS5cBmNgRJuwG7qVwpA758aukaaMLR+3STfH5g=; b=l3svocSn+ELqw1CUfD6VvJkYBYaO3Op7LpP1bzF8pH8kxJbbJ1ZeOz49ZrrSI1VCed bs7x/RM74AxXcPputqeZIRmE7imFAyinYcXGTFkovNUxpXg7Lg+LtAZGv7agpifOo0YC XPEWwffrPVihjK1UKSExa518iHv+gz1CSQskncfxdfgIVpBAs0qbBf0CJMG5HcTAMcxh YSFStI1JuyN8lDbMuvJBZxg4sKyXyqh12TeEWFrQrFbzXSxBREVSkp2jwhZROuTyd+uP ogLqFMWJ+EM+oqb79g5mcSk8CnaA5/VUFxY5QDclYz/27VJRZboxSlV8diH2FS/fCpkn 1VmA== X-Gm-Message-State: ALKqPwdALlDS0l7pMyq+CEAd8+F1Mt61EEjt5xNuh4xPppNBxKqW/xk/ r8ZuwIuqUt/36glRWUKpuP8Xgg== X-Google-Smtp-Source: AB8JxZoS9cujMrIPxMhBlUjfmMATnAaACyrqAhCz3tai5KQDHw7oxrKCoqOt5S3pYkh8Ob/Yh7MwHw== X-Received: by 2002:adf:87d4:: with SMTP id c20-v6mr10126828wrc.197.1526383040436; Tue, 15 May 2018 04:17:20 -0700 (PDT) Received: from asommer-mac.local ([195.30.121.97]) by smtp.googlemail.com with ESMTPSA id w6-v6sm13901050wra.16.2018.05.15.04.17.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 04:17:19 -0700 (PDT) To: freebsd-jail@freebsd.org From: Andreas Sommer Subject: Configure jail in /etc/jail.my-jail-name.conf while allowing auto-start with "service jail start" Message-ID: Date: Tue, 15 May 2018 13:17:18 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 11:17:22 -0000 Hi all, as I can see, this combination simply isn't part of /etc/rc.d/jail and jail(8). In fact, jail(8) always only reads one config file (`-f` parameter, default /etc/jail.conf). This also relates to why ezjail was still not ported to use jail.conf [0][1]. It would be a great fit to automated configuration management (e.g. via Ansible or pkg POST-INSTALL scripts) because it allows overwriting complete files instead of having to edit the global jail.conf to make changes. Jail configured only in /etc/jail.my-jail-name.conf: > # service jail onestart > Starting jails:. (nothing started because jail not recognized as configured) Jail configured in /etc/jail.my-jail-name.conf and "mentioned" as `jail my-jail-name {}` in /etc/jail.conf: > # service jail onestart > Starting jails:jail: my-jail-name: new jail must persist or attach (this means only /etc/jail.conf was parsed) Any way to achieve this? I assume the answer is no, so here's a suggestion: what about having jail(8) read/merge configuration from another file? Example: > # cat /etc/jail.conf > my-jail-name { config = "/etc/jail.my-jail-name.conf"; } > # cat /etc/jail.my-jail-name.conf > my-jail-name { ...config goes here... } Thanks, Andreas [0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218849 [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218849#c13 (ezjail maintainer comment)