From b086eb9d1eb37def0bc7b821a202e2a498a3230094d5feebef9539236389acc1 Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Date: Thu, 7 Jul 2016 16:27:19 +0000 Subject: [PATCH] Accepting request 407150 from home:chbrauner We're trying to move lxc to Virtualization:containers. lxc uses lxcfs to virtualize proc which allows for some nice features. LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel. Specifically, it's providing two main things A set of files which can be bind-mounted over their /proc originals to provide CGroup-aware values. A cgroupfs-like tree which is container aware. The code is pretty simple, written in C using libfuse and glib. The main driver for this work was the need to run systemd based containers as a regular unprivileged user while still allowing systemd inside the container to interact with cgroups. Now with the introduction of the cgroup namespace in the Linux kernel, that part is no longer necessary on recent kernels and focus is now on making containers feel more like a real independent system through the proc masking feature. OBS-URL: https://build.opensuse.org/request/show/407150 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxcfs?expand=0&rev=1 --- .gitattributes | 23 +++++++++ .gitignore | 1 + lxcfs-2.0.2.tar.gz | 3 ++ lxcfs.changes | 26 ++++++++++ lxcfs.spec | 115 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 168 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 lxcfs-2.0.2.tar.gz create mode 100644 lxcfs.changes create mode 100644 lxcfs.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/lxcfs-2.0.2.tar.gz b/lxcfs-2.0.2.tar.gz new file mode 100644 index 0000000..cd0301f --- /dev/null +++ b/lxcfs-2.0.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74d4e5935510a2e0553f188db796f3689e893537143c08a727e60282446f9621 +size 402563 diff --git a/lxcfs.changes b/lxcfs.changes new file mode 100644 index 0000000..e193fa1 --- /dev/null +++ b/lxcfs.changes @@ -0,0 +1,26 @@ +------------------------------------------------------------------- +Thu Jul 7 16:13:57 UTC 2016 - cbrauner@suse.de + +- Remove lxcfs-devel. +- Install shared library liblxcfs.so into /usr/lib/lxcfs as it is not supposed + to be used by any other program. + +------------------------------------------------------------------- +Thu Jul 7 13:40:24 UTC 2016 - cbrauner@suse.de + +- rename devel package from liblxcfs-devel to lxcfs-devel + +------------------------------------------------------------------- +Thu Jul 7 13:29:53 UTC 2016 - cbrauner@suse.de + +- make sure that lxcfs install the shared library liblxcfs.so: + The lxcfs executable requires liblxcfs.so be installed. It calls dlopen() to + dynamically reload the shared library on upgrade. This is important. Do *not* + split into a separate package and do not turn this into a versioned shared + library! (This shared library allows lxcfs to be updated without having to + restart running containers!) + +------------------------------------------------------------------- +Thu Jul 7 11:44:02 UTC 2016 - cbrauner@suse.de + +- add lxcfs package diff --git a/lxcfs.spec b/lxcfs.spec new file mode 100644 index 0000000..631f6a3 --- /dev/null +++ b/lxcfs.spec @@ -0,0 +1,115 @@ +# +# spec file for package lxcfs +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +Name: lxcfs +Version: 2.0.2 +Release: 0 +License: Apache-2.0 +Summary: FUSE filesystem for LXC +Url: http://linuxcontainers.org +Group: System/Management +Source: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz +BuildRequires: pkg-config +BuildRequires: pkgconfig(fuse) +BuildRequires: pam-devel +BuildRequires: help2man +Provides: pam_cgfs = %{version} +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel. + +Specifically, it's providing two main things + +A set of files which can be bind-mounted over their /proc originals +to provide CGroup-aware values. +A cgroupfs-like tree which is container aware. +The code is pretty simple, written in C using libfuse and glib. + +The main driver for this work was the need to run systemd based containers as a regular unprivileged user +while still allowing systemd inside the container to interact with cgroups. + +Now with the introduction of the cgroup namespace in the Linux kernel, that part is no longer necessary +on recent kernels and focus is now on making containers feel more like a real independent system through +the proc masking feature. + +%package -n pam_cgfs +Summary: CGroup FS pam module +Group: System/Libraries + +%description -n pam_cgfs +When a user logs in, this pam module will create cgroups which the user may +administer, either for all controllers or for any controllers listed on the +command line. + +%prep +%setup -q + +%build +%configure --with-distro=suse +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} %{?_smp_mflags} +install -d -m 0755 %{buildroot}%{_unitdir} +install -p -m 0644 config/init/systemd/*.service %{buildroot}%{_unitdir}/ +install -d -m 0755 %{buildroot}%{_sbindir} +ln -sf service %{buildroot}%{_sbindir}/rc%{name} +install -d -m 0755 %{buildroot}%{_includedir}/%{name} +rm bindings.h +install -d -m 0755 %{buildroot}%{_localstatedir}/lib/%{name}/ + +# The shared library liblxcfs.so used by lxcfs is not supposed to be used by +# any other program. So we follow best practice and install it in +# /usr/lib/lxcfs. Note that lxcfs *expects* liblxcfs.so to be found in +# /usr/lib/lxcfs when it cannot find it in the lib.so path. +mkdir -p %{buildroot}/usr/lib/%{name}/ +install -p -m 0755 .libs/liblxcfs.so %{buildroot}/usr/lib/%{name}/ +rm -f %{buildroot}%{_libdir}/liblxcfs.so* +rm -f %{buildroot}%{_libdir}/liblxcfs.la + +%pre +%service_add_pre lxcfs.service + +%post +%service_add_post lxcfs.service + +%preun +%service_del_preun lxcfs.service + +%postun +%service_del_postun lxcfs.service + +%files +%defattr(-,root,root) +%doc AUTHORS ChangeLog README COPYING +%{_sbindir}/* +%{_bindir}/* +%{_datadir}/lxc +%{_datadir}/%{name} +%{_mandir}/man1/* +%{_unitdir}/* +/%{_lib}/security/* +%dir %{_localstatedir}/lib/%{name} + +# The lxcfs executable requires liblxcfs.so be installed. It calls dlopen() to +# dynamically reload the shared library on upgrade. This is important. Do *not* +# split into a separate package and do not turn this into a versioned shared +# library! (This shared library allows lxcfs to be updated without having to +# restart it which is good when you have important system containers running!) +%dir /usr/lib/%{name} +/usr/lib/%{name}/liblxcfs.so