From nobody Tue Sep 28 11:59:42 2021 X-Original-To: freebsd-rc@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 193BC17E60C2; Tue, 28 Sep 2021 11:59:55 +0000 (UTC) (envelope-from SRS0=WfAV=OS=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJdNV6RNQz4qTQ; Tue, 28 Sep 2021 11:59:54 +0000 (UTC) (envelope-from SRS0=WfAV=OS=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 6427528417; Tue, 28 Sep 2021 13:59:47 +0200 (CEST) Received: from illbsd.quip.test (ip-78-45-215-131.net.upcbroadband.cz [78.45.215.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 6506828411; Tue, 28 Sep 2021 13:59:43 +0200 (CEST) Subject: Re: Quick fun question: only set an rc.d variable sometimes? To: "Dan Mahoney (Gushi)" , ports@freebsd.org References: <5dabceea-7f3c-efbe-3778-67ca360547a@prime.gushi.org> Cc: freebsd-rc@freebsd.org From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <7d0ec8d5-1be3-dbd0-5f00-0cf51e3fa18f@quip.cz> Date: Tue, 28 Sep 2021 13:59:42 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 List-Id: Discussion related to /etc/rc.d design and implementation List-Archive: https://lists.freebsd.org/archives/freebsd-rc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org MIME-Version: 1.0 In-Reply-To: <5dabceea-7f3c-efbe-3778-67ca360547a@prime.gushi.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HJdNV6RNQz4qTQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 28/09/2021 05:23, Dan Mahoney (Gushi) wrote: > Hey all, > > I'm dealing with rc.d scripting and reading > https://docs.freebsd.org/en/articles/rc-scripting/ > > Here's my question: Is there a sane way to have something like foo_pid > *completely unset* in one case, but overridable by rc.conf after? > > It took me a bit to wrap my head around the: > > : ${dummy_enable:=no} > : ${dummy_msg="Nothing started."} > > Examples.  (Why that first colon, what is this := syntax), etc. The first colon is builtin function same as /bin/true A useful application for : is if you're only interested in using parameter expansions for their side-effects rather than actually passing their result to a command. You can use the parameter expansion as an argument to : : "${var:=$1}" There is as many variants to handle this as many rc scripts are installed on your system. Each have it slightly different (syntax) but with the same meaning: Apache [ -z "$apache24_enable" ] && apache24_enable="NO" [ -z "$apache24limits_enable" ] && apache24limits_enable="NO" [ -z "$apache24limits_args" ] && apache24limits_args="-e -C daemon" [ -z "$apache24_http_accept_enable" ] && apache24_http_accept_enable="NO" [ -z "$apache24_configcheck_disable" ] && apache24_configcheck_disable="NO" Amavisd : ${amavisd_enable:=NO} pidfile=${amavisd_pidfile-"/var/amavis/amavisd.pid"} ISC DHCPD # default name to "dhcpd" if guessing failed # Trailing semicolon also for service(8)'s benefit: name="${name:-dhcpd}" ; name=${name##*/isc-} Some more explanation: To get the assigned value, or default if it's missing: FOO="${VARIABLE:-default}" Or to assign default to VARIABLE at the same time: FOO="${VARIABLE:=default}" Or check the link https://bash.cyberciti.biz/guide/Default_shell_variables_value > What I'm trying to say in rc.subr language is: > > If the user has set something in rc.conf, use it.  Otherwise, leave it > TOTALLY UNSET.  Not to the null string.  Undefined. Easily readable syntax can be like this: [ -n "$kdc_pid" ] && pidfile="$kdc_pid" Variable pidfile will be set to a value of $kdc_pid only if $kdc_pid is set and is not empty. Miroslav Lachman From nobody Sat Oct 2 17:54:07 2021 X-Original-To: rc@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 5FD3717EFCFA for ; Sat, 2 Oct 2021 17:54:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMF3M28Rxz4p11 for ; Sat, 2 Oct 2021 17:54:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A559175EF for ; Sat, 2 Oct 2021 17:54:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 192Hs7DG062163 for ; Sat, 2 Oct 2021 17:54:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 192Hs7la062162 for rc@FreeBSD.org; Sat, 2 Oct 2021 17:54:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: rc@FreeBSD.org Subject: [Bug 258871] rc: Fix firstboot fs mount logic Date: Sat, 02 Oct 2021 17:54:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jlduran@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_file_loc op_sys bug_status bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion related to /etc/rc.d design and implementation List-Archive: https://lists.freebsd.org/archives/freebsd-rc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258871 Bug ID: 258871 Summary: rc: Fix firstboot fs mount logic Product: Base System Version: CURRENT Hardware: Any URL: https://github.com/freebsd/freebsd-src/pull/524 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: conf Assignee: bugs@FreeBSD.org Reporter: jlduran@gmail.com CC: rc@FreeBSD.org Created attachment 228380 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228380&action= =3Dedit rc: Fix firstboot fs mount logic I'll post this patch here with cc/@rc. This change was introduced in 40adda8665bbcda1bad7e3a6a3c1031027faf39a, and partially fixed in 1ce07411fae8986f3acc293c9fb9ebee5211056a. Restore the ability to remove the `firstboot_sentinel` file on read-only mounted file systems. --=20 You are receiving this mail because: You are on the CC list for the bug.= From nobody Sat Oct 2 23:29:49 2021 X-Original-To: rc@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 0909317E8D20 for ; Sat, 2 Oct 2021 23:29:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMNVh6mTXz3NjG for ; Sat, 2 Oct 2021 23:29:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C50961BA34 for ; Sat, 2 Oct 2021 23:29:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 192NTmxT049760 for ; Sat, 2 Oct 2021 23:29:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 192NTmnv049759 for rc@FreeBSD.org; Sat, 2 Oct 2021 23:29:48 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: rc@FreeBSD.org Subject: [Bug 258871] rc: Fix firstboot fs mount logic Date: Sat, 02 Oct 2021 23:29:49 +0000 X-Bugzilla-Reason: CC AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: linimon@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: rc@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion related to /etc/rc.d design and implementation List-Archive: https://lists.freebsd.org/archives/freebsd-rc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258871 Mark Linimon changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@FreeBSD.org |rc@FreeBSD.org --=20 You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.= From nobody Sun Oct 3 21:00:49 2021 X-Original-To: rc@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 245D317C6219 for ; Sun, 3 Oct 2021 21:00:51 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMx8K4Lrfz4WjM for ; Sun, 3 Oct 2021 21:00:49 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58EE05095 for ; Sun, 3 Oct 2021 21:00:49 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 193L0nNN041636 for ; Sun, 3 Oct 2021 21:00:49 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 193L0nAE041635 for rc@FreeBSD.org; Sun, 3 Oct 2021 21:00:49 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202110032100.193L0nAE041635@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: rc@FreeBSD.org Subject: Problem reports for rc@FreeBSD.org that need special attention Date: Sun, 3 Oct 2021 21:00:49 +0000 List-Id: Discussion related to /etc/rc.d design and implementation List-Archive: https://lists.freebsd.org/archives/freebsd-rc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="16332948490.F9E20f9F.40234" Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: Y --16332948490.F9E20f9F.40234 Date: Sun, 3 Oct 2021 21:00:49 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 178818 | gmirror savecore support / gmirror(8) says to use Open | 235122 | rc.subr limits call breaks non-root usage 2 problems total for which you should take action. --16332948490.F9E20f9F.40234--