Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
projects
:
monitoring
>
monit
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 6
[-]
[+]
Changed
monit.spec
@@ -1,100 +1,203 @@ -%define logmsg logger -t %{name}/rpm +Name: monit +Version: 5.3.1 +Release: 6%{?dist} +Summary: Manages and monitors processes, files, directories and devices + +Group: Applications/Internet +License: AGPLv3 +URL: http://www.tildeslash.com/monit +Source0: http://www.tildeslash.com/monit/dist/monit-%{version}.tar.gz +Source2: monit.logrotate +Source3: monit.service +Source4: monit-logging-conf +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: flex +BuildRequires: openssl-devel +BuildRequires: pam-devel +BuildRequires: byacc +BuildRequires: systemd-units + +Requires(post): systemd-units +Requires(post): systemd-sysv +Requires(preun): systemd-units +Requires(postun): systemd-units -Summary: Process monitor and restart utility -Name: monit -Version: 5.6 -Release: 99ix -License: GPLv3 -Group: Applications/Internet - - -Source0: monit-%{version}.tar.gz -Source1: mmonit.pem -BuildRoot: %{_tmppath}/%{name}-%{version}-root - -BuildRequires: binutils, byacc, flex, gcc, make, openssl-devel, perl, pam-devel %description -Monit is an utility for monitoring daemons or similar programs running on -a Unix system. It will start specified programs if they are not running -and restart programs not responding. +monit is a utility for managing and monitoring, processes, files, directories +and devices on a UNIX system. Monit conducts automatic maintenance and repair +and can execute meaningful causal actions in error situations. + %prep %setup -q -%{__perl} -pi.orig -e 's|\bmonitrc\b|monit.conf|' src/monit.h -%{__perl} -pi.orig -e 's|^#\s+(include .*)$|$1|' monitrc +%build +%configure --disable-static +make %{?_smp_mflags} -# store id and state files in /var/monit -%{__perl} -pi.orig -e 's|^#(\s+)set (id\|state)file /var/\.monit\.(id\|state)$|set $2file /var/monit/$3|' monitrc +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT -# fix config path in /etc/init.d/monit -%{__perl} -pi.orig -e 's|monitrc|monit.conf|' contrib/rc.monit +install -p -D -m0600 monitrc $RPM_BUILD_ROOT%{_sysconfdir}/monitrc +install -p -D -m0755 monit $RPM_BUILD_ROOT%{_bindir}/monit -%build -%configure \ - --with-ssl-lib-dir="%{_libdir}" \ - --enable-optimized +# Log file & logrotate config +install -p -D -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/monit +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log +install -m0600 /dev/null $RPM_BUILD_ROOT%{_localstatedir}/log/monit.log + +# systemd service file +mkdir -p ${RPM_BUILD_ROOT}%{_unitdir} +install -m0644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_unitdir}/monit.service + +# Let's include some good defaults +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/monit.d +install -p -D -m0644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/monit.d/logging -%install -%{__rm} -rf %{buildroot} -%makeinstall \ - BINDIR="%{buildroot}%{_bindir}" \ - MANDIR="%{buildroot}%{_mandir}/man1/" - -%{__install} -Dp -m0755 contrib/rc.monit %{buildroot}%{_initrddir}/monit -%{__install} -Dp -m0600 monitrc %{buildroot}%{_sysconfdir}/monit.conf -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/monit.d/ -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/monit.ssl/ -%{__install} -Dp -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/monit.ssl/ -%{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/monit/ - -# create folder where state and id are stored -%{__install} -d -m0755 %{buildroot}%{_localstatedir}/monit/ -%{__install} -d -m0755 %{buildroot}%{_localstatedir}/monit/state -%{__install} -d -m0755 %{buildroot}%{_localstatedir}/monit/id - -%pre -if ! /usr/bin/id monit &>/dev/null; then - /usr/sbin/useradd -M -r -d %{_localstatedir}/lib/monit -s /bin/sh -c "monit daemon" monit || \ - %logmsg "Unexpected error adding user \"monit\". Aborting installation." -fi +%{__sed} -i 's/# set daemon 120.*/set daemon 60 # check services at 1-minute intervals/' \ + $RPM_BUILD_ROOT%{_sysconfdir}/monitrc -%post -/sbin/chkconfig --add monit +%{__sed} -i 's/# include \/etc\/monit.d\/\*/include \/etc\/monit.d\/\*/' \ + $RPM_BUILD_ROOT%{_sysconfdir}/monitrc -# Moving old style configuration file to conf standard location -if [ -f %{_sysconfdir}/monitrc ]; then - mv -f %{_sysconfdir}/monitrc %{_sysconfdir}/monit.conf +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if [ $1 -eq 1 ]; then + /bin/systemctl enable monit.service > /dev/null 2>&1 || : fi +# Moving old style configuration file to upstream's default location +[ -f %{_sysconfdir}/monit.conf ] && + touch -r %{_sysconfdir}/monitrc %{_sysconfdir}/monit.conf && + mv -f %{_sysconfdir}/monit.conf %{_sysconfdir}/monitrc 2> /dev/null || : + %preun if [ $1 -eq 0 ]; then - service monit stop &>/dev/null || : - /sbin/chkconfig --del monit + /bin/systemctl --no-reload disable monit.service > /dev/null 2>&1 || : + /bin/systemctl stop monit.service > /dev/null 2>&1 || : fi %postun -/sbin/service monit condrestart &>/dev/null || : -if [ $1 -eq 0 ]; then - /usr/sbin/userdel monit || %logmsg "User \"monit\" could not be deleted." +/bin/systemctl daemon-reload > /dev/null 2>&1 || : +if [ $1 -ge 1 ]; then + /bin/systemctl try-restart monit.service > /dev/null 2>&1 || : fi -%clean -%{__rm} -rf %{buildroot} +%triggerun -- monit < 5.3.1-1 +/usr/bin/systemd-sysv-convert --save monit > /dev/null 2>&1 || : +/bin/systemctl --no-reload enable monit.service > /dev/null 2>&1 || : +/sbin/chkconfig --del monit > /dev/null 2>&1 || : +/bin/systemctl try-restart monit.server > /dev/null 2>&1 || : %files -%defattr(-, root, root, 0755) -%doc CHANGES COPYING README* -%doc %{_mandir}/man?/* -%{_initrddir}/monit -%config %{_sysconfdir}/monit.d/ -%config %{_sysconfdir}/monit.ssl/ -%config %{_localstatedir}/monit/ -%config %{_localstatedir}/monit/id -%config %{_localstatedir}/monit/state -%{_localstatedir}/lib/monit/ -%attr(0755, root, root) %{_bindir}/monit -%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/monit.conf -%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/monit.ssl/mmonit.pem +%defattr(-,root,root,-) +%doc CHANGES COPYING doc/PLATFORMS README +%config(noreplace) %{_sysconfdir}/monitrc +%config(noreplace) %{_sysconfdir}/monit.d/logging +%config(noreplace) %{_sysconfdir}/logrotate.d/monit +%config %ghost %{_localstatedir}/log/monit.log +%{_unitdir}/monit.service +%{_sysconfdir}/monit.d/ +%{_bindir}/%{name} +%{_mandir}/man1/monit.1* + + %changelog +* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jan 9 2012 Maxim Burgerhout <wzzrd@fedoraproject.org> - 5.3.1-3 +- Fix systemd unit file + +* Sun Jan 8 2012 Maxim Burgerhout <wzzrd@fedoraproject.org> - 5.3.1-2 +- Rebuild for gcc 4.7