From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0FF31158095 for ; Thu, 8 Sep 2022 06:43:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17AF4E07F9; Thu, 8 Sep 2022 06:43:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EC74AE07F9 for ; Thu, 8 Sep 2022 06:43:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D38C8335DA5 for ; Thu, 8 Sep 2022 06:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2334F56A for ; Thu, 8 Sep 2022 06:43:12 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1662619332.cb81fce5810abaf904df8bf3df43cb07b18bf376.juippis@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lxcfs/files/, sys-fs/lxcfs/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/lxcfs/files/lxcfs-5.0.2.confd sys-fs/lxcfs/files/lxcfs-5.0.2.initd sys-fs/lxcfs/files/lxcfs-5.0.2.service sys-fs/lxcfs/lxcfs-5.0.2-r1.ebuild X-VCS-Directories: sys-fs/lxcfs/ sys-fs/lxcfs/files/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: cb81fce5810abaf904df8bf3df43cb07b18bf376 X-VCS-Branch: master Date: Thu, 8 Sep 2022 06:43:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cddf2fb8-81f3-4522-9e23-3159026c2e06 X-Archives-Hash: d15d1102e0d9092c39919e8563906a0c commit: cb81fce5810abaf904df8bf3df43cb07b18bf376 Author: Joonas Niilola gentoo org> AuthorDate: Thu Sep 8 06:38:36 2022 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Thu Sep 8 06:42:12 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb81fce5 sys-fs/lxcfs: tweak init/service files for fuse:3 - dependency is on fuse:3 instead of fuse:0, - update openrc files to call fusermount3, - update openrc files to have LXCFS_PATH config option, - update systemd service file to call fusermount3. Closes: https://bugs.gentoo.org/868477 Signed-off-by: Joonas Niilola gentoo.org> sys-fs/lxcfs/files/lxcfs-5.0.2.confd | 8 ++++ sys-fs/lxcfs/files/lxcfs-5.0.2.initd | 27 ++++++++++++ sys-fs/lxcfs/files/lxcfs-5.0.2.service | 18 ++++++++ sys-fs/lxcfs/lxcfs-5.0.2-r1.ebuild | 77 ++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) diff --git a/sys-fs/lxcfs/files/lxcfs-5.0.2.confd b/sys-fs/lxcfs/files/lxcfs-5.0.2.confd new file mode 100644 index 000000000000..bc853aa681be --- /dev/null +++ b/sys-fs/lxcfs/files/lxcfs-5.0.2.confd @@ -0,0 +1,8 @@ +# /etc/conf.d/lxcfs: config file for /etc/init.d/lxcfs + +# lxcfs options: +# -l == calculate container load average instead of displaying host load average +# -u == don't display swap usage to containers + +LXCFS_OPTS="-l -u" +LXCFS_PATH="/var/lib/lxcfs" diff --git a/sys-fs/lxcfs/files/lxcfs-5.0.2.initd b/sys-fs/lxcfs/files/lxcfs-5.0.2.initd new file mode 100644 index 000000000000..f3119f2e8e82 --- /dev/null +++ b/sys-fs/lxcfs/files/lxcfs-5.0.2.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +DAEMON=/usr/bin/lxcfs +PIDFILE=/run/lxcfs.pid + +start() { + ebegin "Starting lxcfs." + /sbin/modprobe -q fuse + install -d "${LXCFS_PATH}" + start-stop-daemon --start \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} \ + --background \ + --make-pidfile \ + -- ${LXCFS_OPTS} \ + "${LXCFS_PATH}" + eend ${?} +} + +stop() { + ebegin "Stopping lxcfs." + /usr/bin/fusermount3 -u "${LXCFS_PATH}" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend ${?} +} diff --git a/sys-fs/lxcfs/files/lxcfs-5.0.2.service b/sys-fs/lxcfs/files/lxcfs-5.0.2.service new file mode 100644 index 000000000000..dc3dc9f18f63 --- /dev/null +++ b/sys-fs/lxcfs/files/lxcfs-5.0.2.service @@ -0,0 +1,18 @@ +[Unit] +Description=FUSE filesystem for LXC +ConditionVirtualization=!container +Before=lxc.service +Documentation=man:lxcfs(1) + +[Service] +ExecStartPre=/sbin/modprobe -q fuse +ExecStartPre=install -d /var/lib/lxcfs +ExecStart=/usr/bin/lxcfs /var/lib/lxcfs +KillMode=process +Restart=on-failure +ExecStopPost=-/usr/bin/fusermount3 -u /var/lib/lxcfs +Delegate=yes +ExecReload=/bin/kill -USR1 ${MAINPID} + +[Install] +WantedBy=multi-user.target diff --git a/sys-fs/lxcfs/lxcfs-5.0.2-r1.ebuild b/sys-fs/lxcfs/lxcfs-5.0.2-r1.ebuild new file mode 100644 index 000000000000..23eccfc4b1f7 --- /dev/null +++ b/sys-fs/lxcfs/lxcfs-5.0.2-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) + +inherit cmake meson python-any-r1 systemd verify-sig + +DESCRIPTION="FUSE filesystem for LXC" +HOMEPAGE="https://linuxcontainers.org/lxcfs/introduction/ https://github.com/lxc/lxcfs/" +SRC_URI="https://linuxcontainers.org/downloads/lxcfs/${P}.tar.gz + verify-sig? ( https://linuxcontainers.org/downloads/lxcfs/${P}.tar.gz.asc )" + +LICENSE="Apache-2.0 LGPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~riscv ~x86" +IUSE="doc test" + +DEPEND="sys-fs/fuse:3" +RDEPEND="${DEPEND}" +BDEPEND="${PYTHON_DEPS} + $(python_gen_any_dep ' + dev-python/jinja[${PYTHON_USEDEP}] + ') + doc? ( sys-apps/help2man ) + verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )" + +# Needs some black magic to work inside container/chroot. +RESTRICT="test" + +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc + +python_check_deps() { + python_has_version -b "dev-python/jinja[${PYTHON_USEDEP}]" +} + +pkg_setup() { + python-any-r1_pkg_setup +} + +src_prepare() { + default + + # Fix python shebangs for python-exec[-native-symlinks], #851480 + local shebangs=($(grep -rl "#!/usr/bin/env python3" || die)) + python_fix_shebang -q ${shebangs[*]} +} + +src_configure() { + local emesonargs=( + $(meson_use doc docs) + $(meson_use test tests) + + -Dfuse-version=3 + -Dinit-script="" + -Dwith-init-script="" + ) + + meson_src_configure +} + +src_test() { + cd "${BUILD_DIR}"/tests || die "failed to change into tests/ directory." + ./main.sh || die +} + +src_install() { + meson_src_install + + newconfd "${FILESDIR}"/lxcfs-5.0.2.confd lxcfs + newinitd "${FILESDIR}"/lxcfs-5.0.2.initd lxcfs + + # Provide our own service file (copy of upstream) due to paths being different from upstream, + # #728470 + systemd_newunit "${FILESDIR}"/lxcfs-5.0.2.service lxcfs.service +}