From nobody Tue Aug 06 20:13:46 2024 X-Original-To: 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 4WdkzD0Vltz5SZhL for ; Tue, 06 Aug 2024 20:14:00 +0000 (UTC) (envelope-from sr@genyosha.net) Received: from ns0.genyosha.net (ns0.genyosha.net [50.39.243.220]) (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 (2048 bits) client-digest SHA256) (Client CN "float.home.genyosha.net", Issuer "float.home.genyosha.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WdkzC1ypLz4Q2b for ; Tue, 6 Aug 2024 20:13:59 +0000 (UTC) (envelope-from sr@genyosha.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sr@genyosha.net designates 50.39.243.220 as permitted sender) smtp.mailfrom=sr@genyosha.net Received: from dragon.home.genyosha.net (ops0.genyosha.net [50.39.243.219]) by ns0.genyosha.net (8.18.1/8.18.1) with ESMTPS id 476KDps5057850 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 6 Aug 2024 13:13:51 -0700 (PDT) (envelope-from sr@genyosha.net) Received: from dragon.home.genyosha.net (localhost [127.0.0.1]) by dragon.home.genyosha.net (8.14.7/8.14.7) with ESMTP id 476KDk1Z007267 for ; Tue, 6 Aug 2024 13:13:46 -0700 Received: (from sr@localhost) by dragon.home.genyosha.net (8.14.7/8.14.7/Submit) id 476KDkHr007266 for questions@freebsd.org; Tue, 6 Aug 2024 13:13:46 -0700 Date: Tue, 6 Aug 2024 13:13:46 -0700 From: Steve Rikli To: questions@freebsd.org Subject: Re: periodic(8) pkg_* tasks not in /etc/defaults/periodic.conf ? Message-ID: References: <54896639-d782-4bb5-a712-e41471840913@FreeBSD.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Greylist: inspected by milter-greylist-4.6.4 (ns0.genyosha.net [50.39.243.220]); Tue, 06 Aug 2024 13:13:51 -0700 (PDT) for IP:'50.39.243.219' DOMAIN:'ops0.genyosha.net' HELO:'dragon.home.genyosha.net' FROM:'sr@genyosha.net' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (ns0.genyosha.net [50.39.243.220]); Tue, 06 Aug 2024 13:13:51 -0700 (PDT) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.21 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.91)[-0.913]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; MISSING_XM_UA(0.00)[]; DMARC_NA(0.00)[genyosha.net]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ASN(0.00)[asn:20055, ipnet:50.39.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4WdkzC1ypLz4Q2b On Thu, Aug 01, 2024 at 08:56:38AM -0700, Steve Rikli wrote: > On Thu, Aug 01, 2024 at 08:39:50AM +0100, Matthew Seaman wrote: > > On 31/07/2024 17:32, Steve Rikli wrote: > > > I usually start with /etc/defaults/periodic.conf for candidates I might > > > want for customizing periodic(8) behavior. I also check the various > > > periodic man pages, and scripts themselves occasionally. > > > > > > Recently I checked periodic.conf(5) and found there are some documented > > > variables which do not also appear in /etc/defaults/periodic.conf e.g.: > > > > > > weekly_status_pkg_enable > > > > > > as well as pkg_version and pkg_version_index, possibly others. > > > > > > It seems like most of the man page variables have default settings in > > > /etc/defaults/periodic.conf so maybe the missing pkg_* variable(s) > > > entries are a simple omission? > > > > > > Adding weekly_status_pkg_enable="YES" to /etc/periodic.conf[.local] > > > works as expected, it just seems atypical there's no default for it. > > > > > > Happy to file a bug if that's appropriate. > > > > /etc/defaults/periodic.conf documents the variables used by the periodic > > scripts shipped with the base OS. However, installing pkg(8) adds some > > periodic scripts that aren't part of the base. There isn't really a > > mechanism to gather the defaults for (effectively) 3rd party periodic > > scripts into one place -- which might be a nice enhancement if someone can > > come up with a clean way of doing it. > > > > Basically the same thing applies to rc scripts installed from ports. > > That makes sense, though one could argue pkg(8) itself is (nearly) part > of base. It somewhat straddles the line, and I recognize it's possible > to have a system without bootstrapping pkg(8) or installing additional > pkgs (or ports). > > One difference I see between pkg(8) periodic defaults and periodics > from other pkgs/ports is > > pkg(8) has periodic defaults documented in a base man page > (i.e. periodic.conf(5)), whereas other ports and pkgs do not > > That's generally a good thing -- more docs usually is :-). But it seems > like having info in a base man page means (implies?) that base defaults > entries for it should also be present. The man page info alone is much > better than having neither, of course. > ... Followup to myself... This is probably a smaller issue, but there should likely be some change to periodic.conf(5) man page regardless of pkg_ variables inclusion in the /etc/defaults/periodic.conf file. That is, today the pkg_* periodic variables are described in the man page section which begins with this text: The following variables are used by the standard scripts that reside in /etc/periodic/weekly: ... but that appears to not be accurate; i.e. these variables: weekly_status_pkg_enable pkg_version pkg_version_index are used in ${_localbase}/etc/periodic/ rather than /etc/periodic/: $ grep -Rl pkg_ /etc/periodic/weekly/ $ $ grep -Rl pkg_ /usr/local/etc/periodic/weekly/ /usr/local/etc/periodic/weekly/400.status-pkg $ uname -rv 14.1-STABLE FreeBSD 14.1-STABLE stable/14-n268238-4f5440f2abe9 GENERIC It's not a fatal problem, because at least the variables are documented. But perhaps an additional man page section (after the daily, weekly, monthly, and security variables sections?) which has something like: The following variables are used by the pkg scripts that reside in ${_localbase}/etc/periodic/weekly: ... Cheers, sr.