summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da9104e)
raw | patch | inline | side by side (parent: da9104e)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 1 Oct 2008 19:48:15 +0000 (19:48 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 1 Oct 2008 19:48:15 +0000 (19:48 +0000) |
the spec file so that it is deployed with the RPM.
There are also some other changes to the spec file so that I could build
an RPM successfully from trunk. I'm happy to tidy up the spec file some
more if no one else wants to mandate the best way to do it.
By default, rrdcached runs as nobody. I've tested this on a server
running Ganglia gmetad.
Regards,
Daniel
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1556 a5681a0c-68f1-0310-ab6d-d61299d08faa
There are also some other changes to the spec file so that I could build
an RPM successfully from trunk. I'm happy to tidy up the spec file some
more if no one else wants to mandate the best way to do it.
By default, rrdcached runs as nobody. I've tested this on a server
running Ganglia gmetad.
Regards,
Daniel
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1556 a5681a0c-68f1-0310-ab6d-d61299d08faa
Makefile.am | patch | blob | history | |
etc/rrdcached-default | [new file with mode: 0644] | patch | blob |
etc/rrdcached-init | [new file with mode: 0644] | patch | blob |
rrdtool.spec | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 9f20a78b96833fbad4f0c68ab8656be6f56e2793..321014c689baba99b2398313f87a218f7139df47 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
rrdtool.spec favicon.ico win32/config.h win32/rrd.dsp \
win32/rrd.vcproj win32/rrdtool.dsp win32/rrdtool.dsw \
win32/rrdtool.vcproj win32/Makefile \
- win32/rrd_config.h.msvc netware/Makefile
+ win32/rrd_config.h.msvc netware/Makefile \
+ etc/rrdcached-default etc/rrdcached-init
diff --git a/etc/rrdcached-default b/etc/rrdcached-default
--- /dev/null
+++ b/etc/rrdcached-default
@@ -0,0 +1,14 @@
+
+RUN_RRDCACHED=0
+
+RRDCACHED_USER="nobody"
+
+OPTS="-w 300 -z 300"
+
+PIDFILE="/var/run/rrdcached/rrdcached.pid"
+
+SOCKFILE="/var/run/rrdcached/rrdcached.sock"
+
+SOCKPERMS=0666
+
+
diff --git a/etc/rrdcached-init b/etc/rrdcached-init
--- /dev/null
+++ b/etc/rrdcached-init
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# chkconfig: 2345 19 81
+# description: rrdcached startup script
+#
+
+RRDCACHED=/usr/bin/rrdcached
+
+. /etc/rc.d/init.d/functions
+
+. /etc/default/rrdcached
+
+RETVAL=0
+
+case "$1" in
+ start)
+ if [ ${RUN_RRDCACHED} -eq 0 ];
+ then
+ echo "Please enable rrdcached in /etc/default/rrdcached"
+ exit 0
+ fi
+
+ echo -n "Starting rrdcached: "
+ [ -f $RRDCACHED ] || exit 1
+
+ daemon --user=$RRDCACHED_USER --pidfile=$PIDFILE \
+ $RRDCACHED $OPTS -p $PIDFILE -l $SOCKFILE
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rrdcached
+ [ $RETVAL -eq 0 ] && chmod $SOCKPERMS "${SOCKFILE}"
+ ;;
+
+ stop)
+ echo -n "Shutting down rrdcached: "
+ killproc rrdcached
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rrdcached
+ ;;
+
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status rrdcached
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
+
diff --git a/rrdtool.spec b/rrdtool.spec
index 6208ff167cf10f2217979d446a794a9fc6d15597..8df98fa921097b581ad4c41f5685dab73d09013d 100644 (file)
--- a/rrdtool.spec
+++ b/rrdtool.spec
Summary: Round Robin Database Tool to store and display time-series data
Name: rrdtool
-Version: 1.3.2
+Version: 1.3.99908093000
Release: 0.20%{?pre:.%{pre}}%{?dist}
License: GPLv2+ with exceptions
Group: Applications/Databases
URL: http://oss.oetiker.ch/rrdtool/
#Source0: http://oss.oetiker.ch/%{name}/pub/%{name}-%{version}.tar.gz
-Source0: http://oss.oetiker.ch/rrdtool/pub/beta/%{name}-%{version}%{pre}.tar.gz
+Source0: http://oss.oetiker.ch/rrdtool/pub/beta/%{name}-%{version}.tar.gz
%if %{with_php}
Source1: php4-%{svnrev}.tar.gz
Patch1: rrdtool-1.3.0-beta4-fix-rrd_update-in-php-bindings.patch
Requires: dejavu-lgc-fonts
BuildRequires: gcc-c++, openssl-devel, freetype-devel
BuildRequires: libpng-devel, zlib-devel, intltool >= 0.35.0
-BuildRequires: cairo-devel >= 1.4.6, pango-devel >= 1.17
+BuildRequires: cairo-devel >= 1.2, pango-devel >= 1.14
BuildRequires: libtool, groff
BuildRequires: gettext, libxml2-devel
%if 0%{?fedora} >= 7
%prep
%if %{with_php}
-%setup -q -n %{name}-%{version}%{pre} -a 1
+%setup -q -n %{name}-%{version} -a 1
%patch1 -p1
%else
-%setup -q -n %{name}-%{version}%{pre}
+%setup -q -n %{name}-%{version}
%endif
# Fix to find correct python dir on lib64
%build
%configure \
+ CFLAGS="-g -O0" \
--with-perl-options='INSTALLDIRS="vendor"' \
%if %{with_tcl}
--enable-tcl-site \
$RPM_BUILD_ROOT%{_datadir}/%{name}/examples \
$RPM_BUILD_ROOT%{perl_vendorarch}/auto/*/{.packlist,*.bs}
+# Set up rrdcached
+%__install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/default
+%__install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+%__install -m 0644 etc/rrdcached-default $RPM_BUILD_ROOT/%{_sysconfdir}/default/rrdcached
+%__install -m 0755 etc/rrdcached-init $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/rrdcached
+%__install -d -m 0755 -o nobody -g nobody $RPM_BUILD_ROOT/%{_localstatedir}/run/rrdcached
+
%clean
%{__rm} -rf $RPM_BUILD_ROOT
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+/sbin/chkconfig --add rrdcached
+/sbin/service rrdcached start
+
+%preun
+/sbin/service rrdcached stop
-%postun -p /sbin/ldconfig
+%postun
+/sbin/chkconfig --del rrdcached
+/sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%{_datadir}/%{name}
%{_mandir}/man1/*
+%config %{_sysconfdir}/default/*
+%config %{_sysconfdir}/rc.d/init.d/*
+%attr(0775 nobody nobody) %dir %{_localstatedir}/run/rrdcached
%files devel
%defattr(-,root,root,-)