I'm new to this forum and I really like Cacti, very good software.
I've created an RPM for CentOS5 and everything works fine.
I also created an RPM for cactid. It works also fine , when I use the default path for cactid.conf file.
I would like to use the cactid.conf file into a different directory, not /etc.
For example /etc/cacti/cactid.conf
I would like a confirmation from one of the cactid devs if my procedure is correct.
Because I did not wanted to use the -C argument into poller.php file (line 101), I decided to modify the cactid.h file in the archive:
Code: Select all
--- cactid.h.orig 2006-10-22 21:31:41.000000000 -0400
+++ cactid.h 2007-05-27 02:25:05.000000000 -0400
@@ -130,7 +130,7 @@
/* locations to search for the config file */
#define CONFIG_PATHS 2
#define CONFIG_PATH_1 ""
-#define CONFIG_PATH_2 "/etc/"
+#define CONFIG_PATH_2 "/etc/cacti/"
/* config file defaults */
#define DEFAULT_CONF_FILE "cactid.conf"
Code: Select all
Summary: Threaded poller for Cacti written in C
Name: cacti-cactid
Version: 0.8.6i
Release: 1.el5
License: LGPL
Group: Application/System
URL: http://www.cacti.net/
Source: http://www.cacti.net/downloads/cactid/%{name}-%{version}.tar.gz
Patch: cacti-cactid.0.8.6i.config_path.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: mysql-devel, net-snmp-devel
Requires: cacti, mysql, net-snmp
%description
Cactid is a supplemental poller for Cacti that makes use of pthreads to achieve
excellent performance.
%prep
%setup -q
%patch -p0
%build
%configure
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
%{__install} -D -p -m 0640 cactid.conf \
%{buildroot}%{_sysconfdir}/cacti/cactid.conf
%{__rm} -rf %{buildroot}%{_sysconfdir}/cactid.conf
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS
%doc LICENSE LICENSE.LGPL README README-WINDOWS
%attr(-,cactid,lighttpd) %config(noreplace) %{_sysconfdir}/cacti/cactid.conf
%{_bindir}/cactid
%changelog
* Sun May 27 2007 Floren Munteanu <http://www.yqed.com/> 0.8.6i-1
- Initial build.
Do you recommend another method? To tell you the truth, I'm not really experienced with RPM's. I'm not sure why cactid.conf is added automatically into %{buildroot} folder, is it because is there by default in BUILD/cacti-0.8.6j directory?
I solved the orphan RPM file presence with this line:
%{__rm} -rf %{buildroot}%{_sysconfdir}/cactid.conf
but I'm not positive this is the right way.
Thank you for reading this.
Edit: I forgot to mention that everything is OK with the changes listed above.
The graphs are updated properly by the modified cactid.