From owner-freebsd-jail@freebsd.org Fri Jul 19 16:29:14 2019 Return-Path: Delivered-To: freebsd-jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53515A67DA for ; Fri, 19 Jul 2019 16:29:14 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id EC79874B55 for ; Fri, 19 Jul 2019 16:29:13 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id EC090A67D9; Fri, 19 Jul 2019 16:29:13 +0000 (UTC) Delivered-To: jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC88A67D8 for ; Fri, 19 Jul 2019 16:29:13 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 516F374B54 for ; Fri, 19 Jul 2019 16:29:13 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: by mail-lj1-f177.google.com with SMTP id v18so31308327ljh.6 for ; Fri, 19 Jul 2019 09:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PWjdM2+A7K5h+j8M8e1PmpJ+rCGJMCXGAeFWp5X1jOA=; b=QZZ1l+dL2MiDl2EL0lwdS+Gch0qXY01pjZh2l3rdvMK9qf4mS8cnW+tar17+EeKC9+ 9n/4L/5tzxXWHbwr4fCligHUFPHacs3SQmOUEKvSMHZO0Fnfp0NJOSbKFUGZWDdXSjZw 7CUyTQm7PeAaE6+U9C1RTjd3JsroNViR1/sVk64PNvpqSe9xxLOJ/VUetT7QhBGNuFug AhQCSQXNZYQt03DGaD4lvfUqwtAzhrAZUUWQXgeNRBr6Ie3BktUuDcFioQbcKNX7xhfJ 9wTpb6F1rPC6Cympw6sPKR/Ul9sMetejsOEgGWKqB3b4q6i9DSZO/ImCktlJAfFEQOhg kO5w== X-Gm-Message-State: APjAAAXJN1PK9IBJ0otZ6+duFUBDen9/+xj5OIWxSD+sltO38UZnVLaO XMarw8My5bYNWLFeCnwEWxce73QjraE= X-Google-Smtp-Source: APXvYqxMxK4fxaXBNuxuAdbzlLWrTioUBNfIFQ6SXvnhELD9d9DqzAf1M3ro9AT+1/5qZIg4PVMsCw== X-Received: by 2002:a2e:c51:: with SMTP id o17mr28139232ljd.157.1563553745666; Fri, 19 Jul 2019 09:29:05 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id x67sm5799391ljb.13.2019.07.19.09.29.05 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jul 2019 09:29:05 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id p197so22129182lfa.2 for ; Fri, 19 Jul 2019 09:29:05 -0700 (PDT) X-Received: by 2002:ac2:4c37:: with SMTP id u23mr10590384lfq.119.1563553745436; Fri, 19 Jul 2019 09:29:05 -0700 (PDT) MIME-Version: 1.0 From: Luca Pizzamiglio Date: Fri, 19 Jul 2019 18:28:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Defaults in jail.conf not applied if jail block is not existing To: jail@freebsd.org X-Rspamd-Queue-Id: EC79874B55 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=softfail (mx1.freebsd.org: 2610:1c1:1:606c::50:13 is neither permitted nor denied by domain of lucapizzamiglio@gmail.com) smtp.mailfrom=lucapizzamiglio@gmail.com X-Spamd-Result: default: False [-3.97 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; FORWARDED(0.00)[jail@mailman.nyi.freebsd.org]; SPF_FAIL_FORWARDING(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.85)[-0.850,0]; FORGED_SENDER(0.00)[pizzamig@freebsd.org,lucapizzamiglio@gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+,1:+]; R_DKIM_NA(0.00)[]; FORGED_RECIPIENTS(0.00)[jail@freebsd.org,freebsd-jail@freebsd.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; TAGGED_FROM(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[pizzamig@freebsd.org,lucapizzamiglio@gmail.com]; FROM_HAS_DN(0.00)[]; FORGED_SENDER_FORWARDING(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.11)[ip: (1.32), ipnet: 2610:1c1:1::/48(-3.86), asn: 11403(-2.96), country: US(-0.05)]; RCVD_COUNT_SEVEN(0.00)[7] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 16:29:14 -0000 Hi all, I have 2 silly questions and I think I know the answer. I'd like to use the command line jail tool start and configure my jails; however, I'd like to have defaults set up in a central place. I thought I could put those defaults in /etc/jail.conf and then dynamically create my jails with the cli tool. However, if the jail create (or stop) is not explicitly listed in jail.conf, the defaults are not applied. If I add an empty configuration block, then the default values are applied. Is this an intended behavior? The second question is about not persistent jails. Once all processes in the jail exits, the jail is automatically destroyed. However, without invoking jail -r , there is no way (that I'm aware of) to invoke a poststop script automatically. Is there a workaround or a suggested way to have a callback/script invoked when a jail disappear? (currently, I'm not happily considering a cronjob as a solution) Thanks in advance for the support! Best regards. pizzamig@