• 15.0-ALPHA1: _localbase not set in /usr/sbin/periodic

    From J.R. Oldroyd@fbsd@opal.com to muc.lists.freebsd.stable on Wed Sep 17 09:17:29 2025
    From Newsgroup: muc.lists.freebsd.stable

    Commit c8b89c11a1181e900acb638cfde7a55e92553175 removes the initialization
    of $_localbase in /usr/sbin/periodic.

    This causes $dirlist to be set to:
    " /etc/periodic /etc/periodic"
    and that causes all scripts in /etc/periodic to be executed twice per
    security run (the security run emails show everything happening twice). $dirlist should be:
    " /etc/periodic /usr/local/etc/periodic"

    Need to partially revert that commit to re-add the initialization of $_localbase.

    -jr




    # git diff usr.sbin/periodic/periodic.sh
    diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh
    old mode 100644
    new mode 100755
    index a310f04864da..7fba93d4d948
    --- a/usr.sbin/periodic/periodic.sh
    +++ b/usr.sbin/periodic/periodic.sh
    @@ -29,6 +29,10 @@ if [ $# -lt 1 ] ; then
    usage
    fi

    +_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
    +# Set default value of _localbase if not previously set
    +: ${_localbase:="/usr/local"}
    +
    # If possible, check the global system configuration file,
    # to see if there are additional dirs to check
    if [ -r /etc/defaults/periodic.conf ]; then


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Juraj Lutter@otis@FreeBSD.org to muc.lists.freebsd.stable on Wed Sep 17 15:26:26 2025
    From Newsgroup: muc.lists.freebsd.stable

    Hi,
    On 17 Sep 2025, at 15:17, J.R. Oldroyd <fbsd@opal.com> wrote:

    Commit c8b89c11a1181e900acb638cfde7a55e92553175 removes the initialization
    of $_localbase in /usr/sbin/periodic.

    This causes $dirlist to be set to:
    " /etc/periodic /etc/periodic"
    and that causes all scripts in /etc/periodic to be executed twice per security run (the security run emails show everything happening twice). $dirlist should be:
    " /etc/periodic /usr/local/etc/periodic"

    Need to partially revert that commit to re-add the initialization of $_localbase.
    Do you happen to have any local modifications to /etc/defaults/periodic.conf? rCo
    Juraj Lutter
    otis@FreeBSD.org
    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=@des@FreeBSD.org to muc.lists.freebsd.stable on Wed Sep 17 18:55:43 2025
    From Newsgroup: muc.lists.freebsd.stable

    "J.R. Oldroyd" <fbsd@opal.com> writes:
    Commit c8b89c11a1181e900acb638cfde7a55e92553175 removes the initialization
    of $_localbase in /usr/sbin/periodic.

    This causes $dirlist to be set to:
    " /etc/periodic /etc/periodic"
    and that causes all scripts in /etc/periodic to be executed twice per security run (the security run emails show everything happening twice). $dirlist should be:
    " /etc/periodic /usr/local/etc/periodic"

    Need to partially revert that commit to re-add the initialization of $_localbase.
    The change in question is effectively a nop. It does not remove the initialization of _localbase as you claim; it moves it from one place (/usr/sbin/periodic) to another (/etc/defaults/periodic.conf). The
    former reads the latter just a few lines below where it previously used
    to initialize _localbase. Did you forget to run etcupdate?
    DES
    --
    Dag-Erling Sm|+rgrav - des@FreeBSD.org
    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From J.R. Oldroyd@fbsd@opal.com to muc.lists.freebsd.stable on Wed Sep 17 14:58:56 2025
    From Newsgroup: muc.lists.freebsd.stable

    On Wed, 17 Sep 2025 18:55:43 +0200 Dag-Erling Sm|+rgrav <des@FreeBSD.org> wrote:

    The change in question is effectively a nop. It does not remove the initialization of _localbase as you claim; it moves it from one place (/usr/sbin/periodic) to another (/etc/defaults/periodic.conf). The
    former reads the latter just a few lines below where it previously used
    to initialize _localbase. Did you forget to run etcupdate?

    DES
    Very interesting... the patch of the _localbase setting in /etc/defaults/periodic.conf had not been applied.
    etcupdate was being run but it wasn't doing much. Turns out that /var/db/etcupdate/current/ on that system was empty save for small
    number of files/dirs. How everything else there got removed, I have
    no idea!
    New etcupdate extract run now and diff applied which has added the
    patch to /etc/defaults/periodic.conf.
    Thanks,
    -jr
    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2