[icinga-checkins] icinga.org: icinga-core/rbartels/cgi-current: install: fix DEBUG_LOG_PATH in p1.pl, will now be using configurable log-dir #1715; update icinga.spec from previos changes

git at icinga.org git at icinga.org
Sat Jul 16 00:19:54 CEST 2011


Module: icinga-core
Branch: rbartels/cgi-current
Commit: 32d155676e4c8f548b7c799561276a8187569549
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=32d155676e4c8f548b7c799561276a8187569549

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Jul 12 18:41:12 2011 +0200

install: fix DEBUG_LOG_PATH in p1.pl, will now be using configurable log-dir #1715; update icinga.spec from previos changes

---

 .gitignore        |    1 +
 Changelog         |    1 +
 Makefile.in       |    2 +-
 configure         |    3 ++-
 configure.in      |    2 +-
 icinga.spec       |   53 +++++++++++++++++++++++++++++------------------------
 p1.pl => p1.pl.in |    2 +-
 7 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/.gitignore b/.gitignore
index 12a0ed9..4b41221 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ daemon-init-redhat
 rc.ido2db
 Makefile
 Debug
+p1.pl
 .cproject
 .project
 .settings
diff --git a/Changelog b/Changelog
index f7e04f9..8d63056 100644
--- a/Changelog
+++ b/Changelog
@@ -47,6 +47,7 @@ FIXES
 * install: fix event handlers cmd file location in contrib #1501
 * install: fix make install-idoutils overwrites sample - adding idoutils.cfg-sample instead #1625
 * install: fix icinga.cmd and log dir replacement in icinga-api aubmodule #1573 #1715
+* install: fix DEBUG_LOG_PATH in p1.pl, will now be using configurable log-dir #1715
 
 * config: deprecate log_external_commands_user #1619
 * config: tune icinga.cfg for performance, enable_environment_macros=0, enable_embedded_perl=0 by default #1635
diff --git a/Makefile.in b/Makefile.in
index b0ad0de..7309726 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -281,7 +281,7 @@ distclean: clean
 	rm -f sample-config/*.cfg sample-config/*.conf sample-config/template-object/*.cfg
 	rm -f daemon-init pkginfo rc.ido2db daemon-init-redhat
 	rm -f include/dh.h
-	rm -f Makefile subst
+	rm -f Makefile subst p1.pl
 	rm -f config.log config.status config.cache
 	rm -f t/var/objects.precache.generated t/var/objects.precache
 
diff --git a/configure b/configure
index 9a80fc0..76f50ea 100755
--- a/configure
+++ b/configure
@@ -8392,7 +8392,7 @@ $as_echo_n "checking for -Wall based on os/compiler... " >&6; }
         esac
 
 
-ac_config_files="$ac_config_files Makefile subst solaris/pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init daemon-init-redhat rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql"
+ac_config_files="$ac_config_files Makefile subst solaris/pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init daemon-init-redhat rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql p1.pl"
 
 
 
@@ -9035,6 +9035,7 @@ do
     "module/idoutils/db/scripts/installdb") CONFIG_FILES="$CONFIG_FILES module/idoutils/db/scripts/installdb" ;;
     "module/idoutils/db/scripts/upgradedb") CONFIG_FILES="$CONFIG_FILES module/idoutils/db/scripts/upgradedb" ;;
     "module/idoutils/db/scripts/prepsql") CONFIG_FILES="$CONFIG_FILES module/idoutils/db/scripts/prepsql" ;;
+    "p1.pl") CONFIG_FILES="$CONFIG_FILES p1.pl" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/configure.in b/configure.in
index 365bbc5..959198e 100644
--- a/configure.in
+++ b/configure.in
@@ -1264,7 +1264,7 @@ AC_MSG_CHECKING(for -Wall based on os/compiler)
 
 
 dnl OUTPUT
-AC_OUTPUT(Makefile subst solaris/pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init daemon-init-redhat rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql)
+AC_OUTPUT(Makefile subst solaris/pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init daemon-init-redhat rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql p1.pl)
 
 perl subst $srcdir/include/locations.h
 
diff --git a/icinga.spec b/icinga.spec
index 0ec7737..32ed424 100644
--- a/icinga.spec
+++ b/icinga.spec
@@ -103,6 +103,9 @@ Documentation for %{name}
     --enable-idoutils \
     --with-httpd-conf=%{apacheconfdir} \
     --with-init-dir=%{_initrddir} \
+    --with-log-dir=%{logdir} \
+    --with-cgi-log-dir=%{logdir}/gui \
+    --with-phpapi-log-dir=%{logdir}/api \
     --with-p1-file-dir="%{_libdir}/icinga"
 %{__make} %{?_smp_mflags} all
 
@@ -127,35 +130,35 @@ Documentation for %{name}
 %{__strip} %{buildroot}%{_libdir}/icinga/cgi/*.cgi
 
 ### FIX log-paths
-%{__perl} -pi -e '
-        s|log_file.*|log_file=%{logdir}/icinga.log|;
-        s|log_archive_path=.*|log_archive_path=%{logdir}/archives|;
-        s|debug_file=.*|debug_file=%{logdir}/icinga.debug|;
-   ' %{buildroot}%{_sysconfdir}/icinga/icinga.cfg
+#%{__perl} -pi -e '
+#        s|log_file.*|log_file=%{logdir}/icinga.log|;
+#        s|log_archive_path=.*|log_archive_path=%{logdir}/archives|;
+#        s|debug_file=.*|debug_file=%{logdir}/icinga.debug|;
+#   ' %{buildroot}%{_sysconfdir}/icinga/icinga.cfg
 
 ### make logdirs
-%{__mkdir} -p %{buildroot}%{logdir}/
-%{__mkdir} -p %{buildroot}%{logdir}/api/
-%{__mkdir} -p %{buildroot}%{logdir}/gui/
-%{__mkdir} -p %{buildroot}%{logdir}/archives/
+#%{__mkdir} -p %{buildroot}%{logdir}/
+#%{__mkdir} -p %{buildroot}%{logdir}/api/
+#%{__mkdir} -p %{buildroot}%{logdir}/gui/
+#%{__mkdir} -p %{buildroot}%{logdir}/archives/
 
 ### remove PLACEHOLDER
-rm %{buildroot}%{_datadir}/icinga/icinga-api/log/PLACEHOLDER
+#rm %{buildroot}%{_datadir}/icinga/icinga-api/log/PLACEHOLDER
 ### Move all logging to logdir
-rmdir %{buildroot}%{_datadir}/icinga/icinga-api/log
-%{__perl} -pi -e '
-        s|define\("DEFAULT_API_LOG_FILE",.*|define\("DEFAULT_API_LOG_FILE","%{logdir}/api/icinga-api.log"\);|;
-   ' %{buildroot}%{_datadir}/icinga/icinga-api/objects/debug/debugTargets/icingaApiFileDebugger.php
-mv %{buildroot}%{_datadir}/icinga/log/{.htaccess,index.htm} %{buildroot}%{logdir}/gui
-rmdir %{buildroot}%{_datadir}/icinga/log/
-
-%{__perl} -pi -e '
-        s|cgi_log_file.*|cgi_log_file=%{logdir}/gui/icinga-cgi.log|;
-        s|cgi_log_archive_path=.*|cgi_log_archive_path=%{logdir}/archives|;
-   ' %{buildroot}%{_sysconfdir}/icinga/cgi.cfg
-%{__perl} -pi -e "
-        s|^use constant\tDEBUG_LOG_PATH.*|use constant\tDEBUG_LOG_PATH\t=> '/var/log/icinga/' ;|
-   " %{buildroot}%{_bindir}/p1.pl
+#rmdir %{buildroot}%{_datadir}/icinga/icinga-api/log
+#%{__perl} -pi -e '
+#        s|define\("DEFAULT_API_LOG_FILE",.*|define\("DEFAULT_API_LOG_FILE","%{logdir}/api/icinga-api.log"\);|;
+#   ' %{buildroot}%{_datadir}/icinga/icinga-api/objects/debug/debugTargets/icingaApiFileDebugger.php
+#mv %{buildroot}%{_datadir}/icinga/log/{.htaccess,index.htm} %{buildroot}%{logdir}/gui
+#rmdir %{buildroot}%{_datadir}/icinga/log/
+
+#%{__perl} -pi -e '
+#        s|cgi_log_file.*|cgi_log_file=%{logdir}/gui/icinga-cgi.log|;
+#        s|cgi_log_archive_path=.*|cgi_log_archive_path=%{logdir}/archives|;
+#   ' %{buildroot}%{_sysconfdir}/icinga/cgi.cfg
+#%{__perl} -pi -e "
+#        s|^use constant\tDEBUG_LOG_PATH.*|use constant\tDEBUG_LOG_PATH\t=> '/var/log/icinga/' ;|
+#   " %{buildroot}%{_bindir}/p1.pl
 
 
 ### move idoutils sample configs to final name
@@ -280,6 +283,8 @@ fi
 * Wed June 29 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.5.0-1
 - set to 1.5.0 target, remove provides nagios version, set idoutils.cfg-sample
 - move all logging to one location https://bugzilla.redhat.com/show_bug.cgi?id=693608
+- add log-dir, cgi-log-dir, phpapi-log-dir to configure, remove the manual creation
+- add objects/notifications.cfg for further examples
 - fix file perms and locations of cfgs
 - fix group for doc
 
diff --git a/p1.pl b/p1.pl.in
similarity index 99%
rename from p1.pl
rename to p1.pl.in
index 3716ec4..0b7dff9 100644
--- a/p1.pl
+++ b/p1.pl.in
@@ -16,7 +16,7 @@ use constant	DEBUG_LEVEL		=> 0 ;
 # use constant	DEBUG_LEVEL		=> LEAVE_MSG | CACHE_DUMP ;
 # use constant	DEBUG_LEVEL		=> LEAVE_MSG | CACHE_DUMP | PLUGIN_DUMP ;
 
-use constant	DEBUG_LOG_PATH		=> '/usr/local/icinga/var/' ;
+use constant	DEBUG_LOG_PATH		=> '@LOGDIR@' ;
 # use constant	DEBUG_LOG_PATH		=> './' ;
 use constant	LEAVE_MSG_STREAM	=> DEBUG_LOG_PATH . 'epn_leave-msgs.log' ;
 use constant	CACHE_DUMP_STREAM	=> DEBUG_LOG_PATH . 'epn_cache-dump.log' ;





More information about the icinga-checkins mailing list