diff --git a/README.md b/README.md deleted file mode 100644 index 7342728d557c602f51c6d278bba9f3dd9faaf356..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Anolis OS -======================================= -# 代码仓库说明 -## 分支说明 ->进行代码开发工作时,请注意选择当前版本对应的分支 -* aX分支为对应大版本的主分支,如a8分支对应当前最新版本 -* aX.Y分支为对应小版本的维护分支,如a8.2分支对应8.2版本 -## 开发流程 -1. 首先fork目标分支到自己的namespace -2. 在自己的fork分支上做出修改 -3. 向对应的仓库中提交merge request,源分支为fork分支 diff --git a/cgconfig.service b/cgconfig.service new file mode 100644 index 0000000000000000000000000000000000000000..6be383f99dc294153019da97b20782373441da4b --- /dev/null +++ b/cgconfig.service @@ -0,0 +1,18 @@ +[Unit] +Description=Control Group configuration service + +# The service should be able to start as soon as possible, +# before any 'normal' services: +DefaultDependencies=no +Conflicts=shutdown.target +Before=basic.target shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=yes +Delegate=yes +ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf -s 1664 +ExecStop=/usr/sbin/cgclear -l /etc/cgconfig.conf -e + +[Install] +WantedBy=sysinit.target diff --git a/libcgroup-2.0.tar.bz2 b/libcgroup-2.0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..ba2ed8065f7d5b2102e7da21a08ab98e15c702f3 Binary files /dev/null and b/libcgroup-2.0.tar.bz2 differ diff --git a/libcgroup.spec b/libcgroup.spec new file mode 100644 index 0000000000000000000000000000000000000000..fb4aa564f8851f1379df924c2d6967f882037887 --- /dev/null +++ b/libcgroup.spec @@ -0,0 +1,134 @@ +Name: libcgroup +Version: 2.0 +Release: 1%{?dist} +Summary: iLibrary to control and monitor control groups + +License: LGPLv2+ +URL: http://libcg.sourceforge.net/ +Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.bz2 +Source1: cgconfig.service + +BuildRequires: autoconf automake libtool gcc gcc-c++ make byacc coreutils flex pam-devel systemd-units +Requires(pre): shadow-utils +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +Control groups infrastructure. The library helps manipulate, control, +administrate and monitor control groups and the associated controllers. + +%package tools +Summary: Command-line utility programs, services and daemons for libcgroup +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: systemd + +%description tools +This package contains command-line programs, services and a daemon for +manipulating control groups using the libcgroup library. + +%package pam +Summary: A Pluggable Authentication Module for libcgroup +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description pam +Linux-PAM module, which allows administrators to classify the user's login +processes to pre-configured control group. + +%package devel +Summary: Development libraries to develop applications that utilize control groups +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +It provides API to create/delete and modify cgroup nodes. It will also in the +future allow creation of persistent configuration for control groups and +provide scripts to manage that configuration. + + +%prep +%autosetup + + +%build +autoreconf -vif +%configure --enable-pam-module-dir=%{_libdir}/security \ + --enable-opaque-hierarchy="name=systemd" \ + --disable-daemon + +%make_build + +%install +rm -rf $RPM_BUILD_ROOT +%make_install + +install -d ${RPM_BUILD_ROOT}%{_sysconfdir} +install -m 644 samples/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf +install -m 644 samples/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgsnapshot_blacklist.conf + +mv -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so +rm -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.{,l}a $RPM_BUILD_ROOT/%{_libdir}/security/pam_cgroup.so.* +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{,l}a +rm -f $RPM_BUILD_ROOT/%{_libdir}/libcgroupfortesting.* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/cgred.conf.5* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/cgrules.conf.5* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cgrulesengd.8* + +install -d ${RPM_BUILD_ROOT}%{_unitdir} +install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/ +install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig + +%post tools +%systemd_post cgconfig.service + +%preun tools +%systemd_preun cgconfig.service + +%postun tools +%systemd_postun_with_restart cgconfig.service + +%triggerun -- libcgroup < 0.38 +/usr/bin/systemd-sysv-convert --save cgconfig >/dev/null 2>&1 ||: + +/sbin/chkconfig --del cgconfig >/dev/null 2>&1 || : +/bin/systemctl try-restart cgconfig.service >/dev/null 2>&1 || : + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc README +%{_libdir}/libcgroup.so.1* +%{_libdir}/libcgset.so.0* + +%files tools +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc README README_systemd +%config(noreplace) %{_sysconfdir}/cgconfig.conf +%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf +%{_bindir}/* +%{_sbindir}/* +%attr(0755, root, root) %{_bindir}/cgexec +%attr(0644, root, root) %{_mandir}/man1/* +%attr(0644, root, root) %{_mandir}/man5/* +%attr(0644, root, root) %{_mandir}/man8/* +%{_unitdir}/cgconfig.service + +%files pam +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc README +%attr(0755,root,root) %{_libdir}/security/pam_cgroup.so + +%files devel +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc README +%{_includedir}/libcgroup.h +%{_includedir}/libcgroup/*.h +%{_libdir}/libcgroup.so +%{_libdir}/libcgset.so +%{_libdir}/pkgconfig/libcgroup.pc + +%changelog +* Tue Mar 8 2022 forrest_ly - 2.0-1 +- Init for Anolis OS 23