Compare commits

...
This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

2 commits

Author SHA1 Message Date
Jochen Schmitt
667ddde12d Rework and.service to fix #713432 2011-06-15 21:35:32 +02:00
Jochen Schmitt
3b3bfa08c9 Rework for systemd 2011-03-31 22:03:20 +02:00
2 changed files with 43 additions and 10 deletions

View file

@ -3,7 +3,11 @@ Description=auto nice daemon
After=syslog.target
[Service]
ExecStart=/usr/sbin/and
Type=forking
EnvironmentFile=/etc/sysconfig/and
ExecStart=/usr/sbin/and $AND_FLAGS
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target

View file

@ -1,6 +1,6 @@
Name: and
Version: 1.2.2
Release: 11%{?dist}
Release: 13%{?dist}
Summary: Auto nice daemon
License: GPLv2
@ -20,6 +20,21 @@ Provides: and-sysvinit = %{version}-%{release}
Obsoletes: and-units < %{version}-%{release}
Provides: and-units = %{version}-%{release}
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
provides: and-sysvinit = %{version}-%{release}
Obsoletes: and-sysvinit < 1.2.2-11
provides: and-units = %{version}-%{release}
Obsoletes: and-units < 1.2.2-11
Buildroot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
%description
The auto nice daemon renices and even kills jobs according to their CPU time,
owner, and command name. This is especially useful on production machines with
@ -52,18 +67,26 @@ make PREFIX=%{buildroot}%{_prefix} \
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/and
mkdir -p %{buildroot}/lib/systemd/system
install -p -m 0644 %{SOURCE2} %{buildroot}/lib/systemd/system
mkdir -p %{buildroot}%{_unitdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
%clean
rm -rf %{buildroot}
%post
/usr/bin/systemd-install --realize=minimal enable amd.service >/dev/null 2>&1 || :
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [$1 -eq ß ]; then
/usr/bin/system-install --realize disable amd.service </dev/null 2>&1 || :
if [ $1 -eq 1 ]; then
/bin/systemctl --no-reload disable and.service >/dev/null 2>&1 || :
/bin/systemctl stop and.service >/dev/null 2>&1 || :
fi
%postun
if [ $0 -en 0 ]; then
/bin/systemctl try-restart and.service >/dev/null 2>&1 || :
fi
%files
@ -74,16 +97,22 @@ fi
%{_sbindir}/*
%{_mandir}/man5/*.gz
%{_mandir}/man8/*.gz
/lib/systemd/system/and.service
%{_unitdir}/and.service
%changelog
* Wed Jun 15 2011 Jochen Schmitt <Jochen herr-schmitt de> 1.2.2-13
- Rework and.service to fix #713432
* Thu Mar 31 2011 Jochen Schmitt <Jochen herr-schmitt de> 1.2.2-12
- Rework for systemd
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Nov 28 2010 Jochen Schmitt <Jochen herr-schmitt de> - 1.2.2-10
* Sun Nov 28 2010 Jochen Schmitt <Jochen herr-schmitt de> 1.2.2-10
- Remove SysVInit support
* Sun Jul 18 2010 Jochen Schmitt <Jochen herr-schmitt de> - 1.2.2-9
* Sun Jul 18 2010 Jochen Schmitt <Jochen herr-schmitt de> 1.2.2-9
- Try to add systemd support
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-8