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@ From owner-freebsd-jail@freebsd.org Fri Jul 19 22:01:47 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 EC3F6ACCC4 for ; Fri, 19 Jul 2019 22:01:47 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id B26D287C0B for ; Fri, 19 Jul 2019 22:01:47 +0000 (UTC) (envelope-from jamie@gritton.org) Received: by mailman.nyi.freebsd.org (Postfix) id B0025ACCC2; Fri, 19 Jul 2019 22:01:47 +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 AFBDFACCC1 for ; Fri, 19 Jul 2019 22:01:47 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 F064987C02 for ; Fri, 19 Jul 2019 22:01:45 +0000 (UTC) (envelope-from jamie@gritton.org) Received: by mail-wr1-x436.google.com with SMTP id 31so33628353wrm.1 for ; Fri, 19 Jul 2019 15:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gritton.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zzPqod1+3Q9kgJvaOTFQcmoisU3bKPtagUQ409Ae5cY=; b=RmskmzXli7Z+LYtWPPU5Gx2iq7gifWFjYXnnXt6I1wfvjgdiMn+waV9pMgNXVaUjQ+ jWEZz6Bha40+JEpR3TdwKwr9CmAbYj/auoV4wtximRIl4vKUZivVUFcDzt1ANAliAQI1 9QHIub7x1sBU9lGNAfDQC2se63wlsjOHuYYhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zzPqod1+3Q9kgJvaOTFQcmoisU3bKPtagUQ409Ae5cY=; b=C7ZGn75o6pp6uD3ZfCeaOgOMhhrL2Cy4rmHi9G2TO6RP/XeKARVknxh7y5jPkhp4l+ 4kWe3U/XxiyRf2RpLP/2PobYcuptk1rCyrWDYtH+0lDKW6jYSkzDPC8u8E8Nh3Z8Inma MnYIC/AIgEeaLvPcAi05ofRhcPbznelJF9/6zxq9FPOkngqMw/DuuX3haT/ktzvE8Xa8 MFJQ1L2ecNW39C1f8xG0UizFHrQg38vaMuoBeQ8Cs3TbRo2qghur2dwtvKe+RO0frX1A XoMUnGODFx1ECOFx9IH6jzYE1ig9e32DkhmFjTNY6r4oM0ivy7okLtUx/VjZwNwT+wpM iATA== X-Gm-Message-State: APjAAAUOjdnHt6MLwS+0XJ9L/8UtdmpG3+93EstrIIF88AdJsd5Lm+EU Yg/lPSvRs6M5aDG0aQTXjr/hrS1gX7Y8Z/SCCWUR80PHiM0= X-Google-Smtp-Source: APXvYqxUAMOGA0CkEhJnqViEF0VPCRBr0+UgwYyhmozq29g1koDSRmxGpoc7LytnDfYUQsPrFJ8DUvlg1+mmrWxv64A= X-Received: by 2002:adf:f8cf:: with SMTP id f15mr56956033wrq.333.1563573704557; Fri, 19 Jul 2019 15:01:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: James Gritton Date: Fri, 19 Jul 2019 16:01:33 -0600 Message-ID: Subject: Re: Defaults in jail.conf not applied if jail block is not existing To: Luca Pizzamiglio Cc: jail@freebsd.org X-Rspamd-Queue-Id: F064987C02 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gritton.org header.s=google header.b=RmskmzXl; spf=pass (mx1.freebsd.org: domain of jamie@gritton.org designates 2a00:1450:4864:20::436 as permitted sender) smtp.mailfrom=jamie@gritton.org X-Spamd-Result: default: False [-6.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gritton.org:s=google]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[jail@freebsd.org]; DMARC_NA(0.00)[gritton.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gritton.org:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[6.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx5.googlemail.com,alt2.aspmx.l.google.com,aspmx2.googlemail.com]; IP_SCORE(-2.95)[ip: (-9.32), ipnet: 2a00:1450::/32(-2.93), asn: 15169(-2.43), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] 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 22:01:48 -0000 If I'm reading it right, then yes the behavior on creating jails if intended. The defaults in jail.conf are only defaults to the jails listed in jail.conf, not defaults to command-line-generated jails. So even if you only include an empty block for the jail, it then is a jail.conf jail and not a command-line jail. For the non-persistent jail poststop scripts, the only way to run them outside the jail is to have a process outside the jail to run them from. Cron isn't a perfect solution, but a pretty workable one. If your jail has a single process that runs from start to finish (i.e. not something like a typical "command=sh /etc/rc"), then you could simply have a subshell that runs the jail and then runs the poststop script itself: # (jail -c name=foo command=sleep 10; echo doing cleanup) & You may be interested in the suggested patch for jail notifications in devctl. That way, a jail-watch process can tell when jails start and stop. - Jamie On Fri, Jul 19, 2019 at 10:29 AM Luca Pizzamiglio wrote: > 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@ > _______________________________________________ > freebsd-jail@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-jail > To unsubscribe, send any mail to "freebsd-jail-unsubscribe@freebsd.org" > From owner-freebsd-jail@freebsd.org Sat Jul 20 16:24:57 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 C98E8C1E9F for ; Sat, 20 Jul 2019 16:24:57 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 3378F87C2C for ; Sat, 20 Jul 2019 16:24:57 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 32F78C1E9A; Sat, 20 Jul 2019 16:24:57 +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 329B8C1E99 for ; Sat, 20 Jul 2019 16:24:57 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 C169A87C29 for ; Sat, 20 Jul 2019 16:24:56 +0000 (UTC) (envelope-from luca.pizzamiglio@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id c19so23763153lfm.10 for ; Sat, 20 Jul 2019 09:24:56 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LBzT85rp8IDICK2CglxWb6Pcw3T8S2DXvfTSQYOiLRs=; b=cfmTfqRfONlG1keGw+RRxIUZxVgakChnzMQvkLyU2CyT9gM5TEsJc0dKfrBHjFwQMn /QUiVpHUMzxozj2HmkHfpH6lFzwr/dvJsgDF2bRISry//OY9oydDn/FU1yV6wMKv8QI5 3iSd5HLhgqKDDHSkyeFIUydwGiPxs9fOyxIYI6njmKmpBBTazD90q0cHIy8U+2ZJQ5yc WRMUkRJm7xzOoXUh/WInG5LYFRWPovgjTrtur64G3UEx1WSiBBTL/ihGRpBa7XMA0uG4 D4u912RCqfrp2xiQVTt0cry5rDMlKS4DkwXi5zVNWIItyID4szOII1rqeovzwqofaqey aNCA== X-Gm-Message-State: APjAAAU5SCvRj1xiSJurc0ZSlmDwrp6KXR6MsbJgsj0yWuH5gjJCXCGi DaeCL6ZXMrhBL9IU8df2YxbMu56iDXU= X-Google-Smtp-Source: APXvYqx8X8CcBw3TryOdil2lebcCoiQyOm41lWXtWAq2r2ie5T6MmKGJ3WG+qPPyHAB1jl93dIzvEw== X-Received: by 2002:a19:8c08:: with SMTP id o8mr26566547lfd.57.1563639889054; Sat, 20 Jul 2019 09:24:49 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id p28sm5219609lfh.55.2019.07.20.09.24.48 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jul 2019 09:24:48 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id h10so33592384ljg.0 for ; Sat, 20 Jul 2019 09:24:48 -0700 (PDT) X-Received: by 2002:a2e:6c14:: with SMTP id h20mr30637982ljc.38.1563639888415; Sat, 20 Jul 2019 09:24:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Luca Pizzamiglio Date: Sat, 20 Jul 2019 18:24:31 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Defaults in jail.conf not applied if jail block is not existing To: James Gritton Cc: jail@freebsd.org X-Rspamd-Queue-Id: C169A87C29 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; TAGGED_FROM(0.00)[] 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: Sat, 20 Jul 2019 16:24:57 -0000 Hi Jamie, Thanks for the quick answer. I guess I have to decide to go full command-line or full jail.conf. The devctl patch seems pretty cool. Actually, I like the idea to have a jaild daemon that take care of all the pre/post start/stop stuff, doable if the devctl notifications system is in place, but it adds more complexity. Probably, it's something I can work on in the future, even if it can overlap with what an orchestrator does. Thanks again for the support Best regards, pizzamig@ On Sat, Jul 20, 2019 at 12:01 AM James Gritton wrote: > If I'm reading it right, then yes the behavior on creating jails if > intended. The defaults in jail.conf are only defaults to the jails listed > in jail.conf, not defaults to command-line-generated jails. So even if you > only include an empty block for the jail, it then is a jail.conf jail and > not a command-line jail. > > For the non-persistent jail poststop scripts, the only way to run them > outside the jail is to have a process outside the jail to run them from. > Cron isn't a perfect solution, but a pretty workable one. If your jail has > a single process that runs from start to finish (i.e. not something like a > typical "command=sh /etc/rc"), then you could simply have a subshell that > runs the jail and then runs the poststop script itself: > # (jail -c name=foo command=sleep 10; echo doing cleanup) & > > You may be interested in the suggested patch for jail notifications in > devctl. That way, a jail-watch process can tell when jails start and stop. > > - Jamie > > On Fri, Jul 19, 2019 at 10:29 AM Luca Pizzamiglio > wrote: > >> 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@ >> _______________________________________________ >> freebsd-jail@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-jail >> To unsubscribe, send any mail to "freebsd-jail-unsubscribe@freebsd.org" >> >