4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Monit 5.6 for CentOS5.x

Last updated at Posted at 2013-09-07

monit-5.6 インストール

cd /usr/local/src/
wget http://mmonit.com/monit/dist/monit-5.6.tar.gz
cp -av monit-5.6.tar.gz /usr/src/redhat/SOURCES/
vi /usr/src/redhat/SOURCES/monit-rhel-config-name.patch
monit-rhel-config-name.patch
--- src/monit.h.renamed_config  2013-08-28 06:35:08.000000000 +0900
+++ src/monit.h 2013-09-07 14:56:04.000000000 +0900
@@ -87,7 +87,7 @@
 #include "util/StringBuffer.h"
>
>
-#define MONITRC            "monitrc"
+#define MONITRC            "monit.conf"
 #define TIMEFORMAT         "%Z %b %e %T"
 #define STRERROR            strerror(errno)
 #define STRLEN             256
tar zxvf monit-5.6.tar.gz
cp -av /usr/local/src/monit-5.6/contrib/packages/redhat/monit.spec /usr/src/redhat/SPECS/
vi /usr/src/redhat/SPECS/monit.spec
monit.spec
Name: monit
Summary: Process monitor and restart utility
Version: 5.6
Release: 1.el5
Source: http://www.mmonit.com/monit/dist/%{name}-%{version}.tar.gz
Group: Utilities/Console
URL: http://www.mmonit.com/monit/
BuildRoot: %{_tmppath}/%{name}-buildroot
License: AGPL
BuildRequires: flex
BuildRequires: bison
BuildRequires: openssl-devel
Patch0: monit-rhel-config-name.patch
>
%description
Monit is a utility for managing and monitoring processes,
files, directories and filesystems on a Unix system. Monit conducts
automatic maintenance and repair and can execute meaningful causal
actions in error situations.
>
%prep
%setup
%patch0 -b .confname
>
%build
%{configure}
make
>
%install
if [ -d %{buildroot} ] ; then
  rm -rf %{buildroot}
fi
>
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}/etc/init.d
mkdir -p %{buildroot}/etc/monit.d
install -m 755 monit %{buildroot}%{_bindir}/monit
install -m 644 monit.1 %{buildroot}%{_mandir}/man1/monit.1
install -m 600 monitrc %{buildroot}/etc/monit.conf
install -m 755 contrib/rc.monit %{buildroot}/etc/init.d/%{name}
>
%post
/sbin/chkconfig --add %{name}
/sbin/chkconfig %{name} off
>
%preun
if [ $1 = 0 ]; then
   /etc/init.d/%{name} stop >/dev/null 2>&1
   /sbin/chkconfig --del %{name}
fi
>
%clean
if [ -d %{buildroot} ] ; then
  rm -rf %{buildroot}
fi
>
%files
%defattr(-,root,root)
%doc CHANGES COPYING README
%config /etc/monit.conf
%config /etc/init.d/%{name}
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
>
%changelog
* Sat Sep  7 2013 monit-5.6 <hoge at example dot jp>
- Create the inital spec file
- Created a sample config file and a rc startup script
cd /usr/src/redhat/SPECS/
rpmbuild -bb --clean monit.spec
rpm -ivh /usr/src/redhat/RPMS/x86_64/monit-5.6-1.el5.x86_64.rpm
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?