public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Joonas Niilola" <juippis@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lxcfs/files/, sys-fs/lxcfs/
Date: Thu,  8 Sep 2022 06:43:12 +0000 (UTC)	[thread overview]
Message-ID: <1662619332.cb81fce5810abaf904df8bf3df43cb07b18bf376.juippis@gentoo> (raw)

commit:     cb81fce5810abaf904df8bf3df43cb07b18bf376
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  8 06:38:36 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> 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 <juippis <AT> 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
+}


             reply	other threads:[~2022-09-08  6:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  6:43 Joonas Niilola [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-10-14  6:24 [gentoo-commits] repo/gentoo:master commit in: sys-fs/lxcfs/files/, sys-fs/lxcfs/ Joonas Niilola
2022-08-16  7:55 Joonas Niilola
2022-08-02  5:35 Joonas Niilola
2020-06-26  8:13 Joonas Niilola
2019-02-07  4:32 Erik Mackdanz
2019-02-07  4:28 Erik Mackdanz
2018-10-13 22:40 Erik Mackdanz
2018-10-13 22:38 Erik Mackdanz
2017-03-20  5:02 Erik Mackdanz
2016-10-11  3:39 Erik Mackdanz
2016-09-03 20:33 Erik Mackdanz
2016-04-02 16:02 Erik Mackdanz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1662619332.cb81fce5810abaf904df8bf3df43cb07b18bf376.juippis@gentoo \
    --to=juippis@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox