Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Aug 2022 17:43:21 +0800
From:      Alastair Hogge <agh@riseup.net>
To:        Michael Gmelin <grembo@freebsd.org>
Cc:        freebsd@oldach.net, Cy.Schubert@cschubert.com, otis@freebsd.org, freebsd@walstatt-de.de, freebsd-current@freebsd.org, freebsd-ports@freebsd.org, yasu@freebsd.org
Subject:   Re: security/clamav: /ar/run on TMPFS renders the port broken by design
Message-ID:  <20220828174321.59b23cbc@direwolf.home.arpa>
In-Reply-To: <163333B4-76A1-4E46-B7C3-60492D379C6E@freebsd.org>
References:  <202208280842.27S8gDXn055868@nuc.oldach.net> <163333B4-76A1-4E46-B7C3-60492D379C6E@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 28 Aug 2022 11:37:16 +0200
Michael Gmelin <grembo@freebsd.org> wrote:

> > On 28. Aug 2022, at 10:42, freebsd@oldach.net wrote:
> >=20
> > =EF=BB=BFCy Schubert wrote on Sat, 27 Aug 2022 17:26:38 +0200 (CEST): =
=20
> >> As stated before in this thread, replacing /var/run with tmpfs is
> >> not a supported configuration. =20
> >=20
> > Not supported? What is the purpose of /etc/rc.d/var then? That
> > creates a tmpfs backed /var, populates it through mtree, and makes
> > a proper /var/run available.
> >=20
> > However it doesn't (yet) create /var/run/clamav of course.
> >=20
> > It would be fairly easy to extend /etc/rc.d/var by a logic that
> > walks through /usr/local/etc/mtree/* and runs mtree on each of the
> > files found as needed. All that the security/clamav port would need
> > to do then is to drop an appropriate small mtree file as
> > /usr/local/etc/mtree/clamav. From a port's perspective that is the
> > same logic as dropping service scripts as
> > /usr/local/etc/rc.d/clamav-*. =20
>=20
> From a user's perspective, it would be preferable to have this happen
> at service start though, as (unlike in the setup described) reboots
> don't happen that frequently, but files in /var/run might get deleted
> manually. Maybe some rc framework based solution would make sense,
> e.g., a variable `mtree_files`, which, if set, is applied in the
> default start_precmd. Besides being more resilient, this would also
> have the advantage that all required file systems should be available
> at that point and the separation between system and ports would be
> more clear. Another advantage would be that directories are only
> created for services that are actually enabled/started.

Yes, something in the RC framework would be nice.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220828174321.59b23cbc>