From b0b2985065d50856b152aa35830e67b94931e4e1 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Jun 21 2011 14:07:56 +0000 Subject: New upstream. Honors sysconfig. sysv->systemd. --- diff --git a/.gitignore b/.gitignore index f7a6120..6956a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ atop-1.23.tar.gz +/atop-1.26.tar.gz diff --git a/atop.d b/atop.d index c985ad3..0195ad1 100644 --- a/atop.d +++ b/atop.d @@ -4,15 +4,15 @@ [ -f /etc/sysconfig/atop ] && . /etc/sysconfig/atop # Current Day format -[ -z $CURDAY ] || CURDAY=`date +%Y%m%d` +[ -z $CURDAY ] && CURDAY=`date +%Y%m%d` # Log files path -[ -z $LOGPATH ] || LOGPATH=/var/log/atop +[ -z $LOGPATH ] && LOGPATH=/var/log/atop # Binaries path -[ -z $BINPATH ] || BINPATH=/usr/bin +[ -z $BINPATH ] && BINPATH=/usr/bin # PID File -[ -z $PIDFILE ] || PIDFILE=/var/run/atop.pid +[ -z $PIDFILE ] && PIDFILE=/var/run/atop.pid # interval (default 10 minutes) -[ -z $INTERVAL ] || INTERVAL=600 +[ -z $INTERVAL ] && INTERVAL=600 start_atop() { diff --git a/atop.service b/atop.service new file mode 100644 index 0000000..5903945 --- /dev/null +++ b/atop.service @@ -0,0 +1,9 @@ +[Unit] +Description=advanced interactive monitor +After=syslog.target + +[Service] +ExecStart=/usr/bin/atop + +[Install] +WantedBy=multi-user.target diff --git a/atop.spec b/atop.spec index a8e3bdd..d1cc5b7 100644 --- a/atop.spec +++ b/atop.spec @@ -1,6 +1,6 @@ Name: atop -Version: 1.23 -Release: 11%{?dist} +Version: 1.26 +Release: 1%{?dist} Summary: An advanced interactive monitor to view the load on system and process level Group: Applications/System @@ -8,20 +8,23 @@ License: GPLv2+ URL: http://www.atcomputing.nl/Tools/atop/ Source0: http://www.atcomputing.nl/Tools/%{name}/packages/%{name}-%{version}.tar.gz Source1: atop.logrotate -Source2: atop.init +#Source2: atop.init Source3: atop.crondaily Source4: atop.sysconfig Source5: atop.d +Source6: atop.service Patch0: atop-1.23-cron.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: ncurses -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service - BuildRequires: zlib-devel BuildRequires: ncurses-devel +BuildRequires: systemd-units + +Requires(post): systemd-units +Requires(post): systemd-sysv +Requires(preun): systemd-units +Requires(postun): systemd-units + %description An advanced interactive monitor for Linux-systems to view the load on @@ -55,29 +58,47 @@ install -Dp -m 0644 man/atop.1 $RPM_BUILD_ROOT%{_mandir}/man1/atop.1 install -Dp -m 0644 man/atopsar.1 $RPM_BUILD_ROOT%{_mandir}/man1/atopsar.1 install -Dp -m 0644 atop.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/atop install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/atop -install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/atop +#install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/atop install -Dp -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/atop install -Dp -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/atop install -Dp -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/atopd +install -Dp -m 0644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/atop.service install -d $RPM_BUILD_ROOT%{_localstatedir}/log/atop %clean rm -rf $RPM_BUILD_ROOT %post -/sbin/chkconfig --add atop +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi %preun -if [ $1 -eq 0 ]; then - /sbin/service atop stop &>/dev/null || : - /sbin/chkconfig --del atop +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable atop.service > /dev/null 2>&1 || : + /bin/systemctl stop atop.service > /dev/null 2>&1 || : fi %postun -if [ $1 -ge 1 ]; then - /sbin/service atop condrestart &>/dev/null || : +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart atop.service >/dev/null 2>&1 || : fi +%triggerun -- atop < 1.26-1 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply atop +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save atop >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del atop >/dev/null 2>&1 || : +/bin/systemctl try-restart atop.service >/dev/null 2>&1 || : + + %files %defattr(-,root,root,-) %doc AUTHOR COPYING README ChangeLog @@ -85,16 +106,22 @@ fi %config(noreplace) %{_sysconfdir}/logrotate.d/atop %config(noreplace) %{_sysconfdir}/sysconfig/atop %{_sysconfdir}/cron.daily/atop -%{_initrddir}/atop +#%{_initrddir}/atop %{_bindir}/atopsar %{_bindir}/atop %{_bindir}/atopd %{_mandir}/man1/atop.1.gz %{_mandir}/man1/atopsar.1.gz %attr(0755,root,root) %dir %{_localstatedir}/log/atop - +%{_unitdir}/atop.service %changelog +* Tue Jun 21 2011 Jon Ciesla - 1.26-1 +- New upstream, BZ 657207. +- Migrated from sysv to systemd, BZ 659629. +- Modified to respect sysconfig settings, BZ 609124. +- Dropped explicit Requires for ncurses. + * Mon Feb 07 2011 Fedora Release Engineering - 1.23-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild diff --git a/sources b/sources index 002cc30..77c30fc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ba1d733b9f0fcf8469a8e6c8e4d2d3b7 atop-1.23.tar.gz +9a72baf4c8f330973f1e2703f5a6c041 atop-1.26.tar.gz