Project

General

Profile

Actions

Bug #3075

closed

During a migration from 2.4.0~rc1 to 2.4.0~rc2, rudder-inventory-ldap postinst and rudder-upgrade script display two disturbing messages about LDAP and rudder-web.properties

Added by Nicolas PERRON about 12 years ago. Updated almost 10 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
Nicolas PERRON
Category:
Packaging
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Pull Request URL: https://github.com/Normation/rudder-packages/pull/8

$ sudo aptitude install rudder-server-root
The following packages will be upgraded: 
  rudder-agent rudder-inventory-endpoint rudder-inventory-ldap rudder-jetty rudder-reports rudder-server-root rudder-techniques rudder-webapp 
8 packages upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Need to get 137 MB of archives. After unpacking 32.8 kB will be used.
Do you want to continue? [Y/n/?] y
[...]
Setting up rudder-inventory-ldap (2.4.0~rc2-squeeze0) ...
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.
0a1
> activeTechniqueId
2a4
> directiveId
6a9,11
> machineId
> nodeGroupId
> nodeId
7a13
> ruleId
8a15
> softwareId
9a17,18
> techniqueCategoryId
> techniqueId
OpenLDAP indexes are not up to date, reindexing...
[...]
/opt/rudder/etc/rudder-users.xml is conform
<configuration><appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><Pattern>%d{[yyyy-MM-dd HH:mm:ss]} %-5level %logger - %msg%n%xEx{0}</Pattern></encoder></appender><property name="OPSLOG_DIR" value="/var/log/rudder/core" /><appender name="OPSLOG" class="ch.qos.logback.core.FileAppender"><file>${OPSLOG_DIR}/rudder-webapp.log</file><append>true</append><encoder><pattern>%d{MMM dd HH:mm:ss} ${HOSTNAME} rudder[%logger]: [%level] %msg%n</pattern></encoder></appender><root level="info"><appender-ref ref="STDOUT" /></root><logger name="trace.ldif.in.file" level="off" /><logger name="comet_trace" level="info" /><logger name="org.springframework" level="warn" /><logger name="net.liftweb.util.TimeHelpers" level="warn" /><logger name="report" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger><logger name="application" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger><logger name="migration" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger><logger name="historization" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger></configuration>
Restarting Rudder webapp and inventory-endpoint
[...]
Actions #1

Updated by Nicolas PERRON about 12 years ago

The first display come from rudder-inventory-ldap when upgrading indexes (#2900). It is due to some commands which are not redirected to /dev/null and then appeared in the output.

The second one come from a test for the migration of the file logback.xml (#3037) which is not correctly set (it should be put in a variable).

Actions #2

Updated by Nicolas PERRON about 12 years ago

Nicolas PERRON wrote:

The first display come from rudder-inventory-ldap when upgrading indexes (#2900). It is due to some commands which are not redirected to /dev/null and then appeared in the output.

For this part, the patch is harmless:

diff --git a/rudder-inventory-ldap/debian/postinst b/rudder-inventory-ldap/debian/postinst
index b15ed6e..8e812b5 100644
--- a/rudder-inventory-ldap/debian/postinst
+++ b/rudder-inventory-ldap/debian/postinst
@@ -123,7 +123,7 @@ case "$1" in
                if [ -r /opt/rudder/etc/openldap/slapd.conf -a -e /var/rudder/ldap/openldap-data/id2entry.bdb ]; then
                        grep ^index /opt/rudder/etc/openldap/slapd.conf | sed 's/\s\+/\t/g' | cut -f2 | sed 's/,/\n/g' | sort > ${SLAPD_DEFINED_INDEXES}
                        ls  /var/rudder/ldap/openldap-data/*.bdb | xargs -n 1 -I{} basename {} .bdb | sort | egrep -v '^(dn2id|id2entry)' > ${SLAPD_ACTUAL_INDEXES}
-                       if ! diff ${SLAPD_DEFINED_INDEXES} ${SLAPD_ACTUAL_INDEXES}; then
+                       if ! diff ${SLAPD_DEFINED_INDEXES} ${SLAPD_ACTUAL_INDEXES} > /dev/null; then
                                echo "OpenLDAP indexes are not up to date, reindexing..." 
                                invoke-rc.d slapd stop
                                /opt/rudder/sbin/slapindex

The second one come from a test for the migration of the file logback.xml (#3037) which is not correctly set (it should be put in a variable).

For this part, the patch is harmless too:

diff --git a/rudder-webapp/SOURCES/rudder-upgrade b/rudder-webapp/SOURCES/rudder-upgrade
index 262062d..d334505 100755
--- a/rudder-webapp/SOURCES/rudder-upgrade
+++ b/rudder-webapp/SOURCES/rudder-upgrade
@@ -561,7 +561,8 @@ if [ ${CHECK_BASEURL_ATTR} -ge 1 ]; then
 fi

 # - 2.4.0 : Update logback.xml in order to have information about name historization
-if ! cat /opt/rudder/etc/logback.xml | perl -p0e 's/\n//g' | perl -p0e 's/<!--.(?:(?!-->).)*-->//g' | perl -p0e 's/> *</></g' | grep '<logger name="historization" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appen
+CHECK_LOGBACK_UPGRADE=`cat /opt/rudder/etc/logback.xml | perl -p0e 's/\n//g' | perl -p0e 's/<!--.(?:(?!-->).)*-->//g' | perl -p0e 's/> *</></g' | grep '<logger name="historization" level="info" additivity="false"><appender-ref ref
+if [ ${CHECK_LOGBACK_UPGRADE} -lt 1 ]
 then
     sed -i 's%^ *</configuration>%   <logger name="historization" level="info" additivity="false">\n     <appender-ref ref="OPSLOG" />\n     <!-- comment the following appender if you dont want to have logs about report in both st
 fi
Actions #3

Updated by Nicolas PERRON about 12 years ago

This fix should be added to the 2.4.0

Actions #4

Updated by Nicolas PERRON about 12 years ago

The second patch should be more like this:

diff --git a/rudder-webapp/SOURCES/rudder-upgrade b/rudder-webapp/SOURCES/rudder-upgrade
index 262062d..3fb7fd4 100755
--- a/rudder-webapp/SOURCES/rudder-upgrade
+++ b/rudder-webapp/SOURCES/rudder-upgrade
@@ -561,7 +561,7 @@ if [ ${CHECK_BASEURL_ATTR} -ge 1 ]; then
 fi

 # - 2.4.0 : Update logback.xml in order to have information about name historization
-if ! cat /opt/rudder/etc/logback.xml | perl -p0e 's/\n//g' | perl -p0e 's/<!--.(?:(?!-->).)*-->//g' | perl -p0e 's/> *</></g' | grep '<logger name="historization" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger>'
+if ! cat /opt/rudder/etc/logback.xml | perl -p0e 's/\n//g' | perl -p0e 's/<!--.(?:(?!-->).)*-->//g' | perl -p0e 's/> *</></g' | grep '<logger name="historization" level="info" additivity="false"><appender-ref ref="OPSLOG" /><appender-ref ref="STDOUT" /></logger>' > /dev/null
 then
     sed -i 's%^ *</configuration>%   <logger name="historization" level="info" additivity="false">\n     <appender-ref ref="OPSLOG" />\n     <!-- comment the following appender if you dont want to have logs about report in both stdout and opslog -->\n     <appender-ref ref="STDOUT" />\n   </logger>\n </configuration>%' /opt/rudder/etc/logback.xml
 fi

Actions #5

Updated by Nicolas PERRON about 12 years ago

  • Description updated (diff)
  • Status changed from New to Pending technical review
  • Assignee set to Jonathan CLARKE
  • Priority changed from N/A to 1 (highest)

Ok, the patch have been submitted by a Pull Request

Jon, could you review this bug, please ?

Actions #6

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from Pending technical review to Pending release
  • Assignee changed from Jonathan CLARKE to Nicolas PERRON

Awesome, merged.

Actions #7

Updated by Nicolas PERRON about 12 years ago

  • % Done changed from 0 to 100

Applied in changeset commit:b9c0c474f5a2d3ea271c98dd4f5fb8d82698073e.

Actions #8

Updated by Jonathan CLARKE about 12 years ago

Applied in changeset commit:e7330fa86f6b1577f00a196279379d78b673b781.

Actions #9

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from Pending release to Released
Actions #10

Updated by Nicolas PERRON almost 12 years ago

  • Project changed from Rudder to 34
  • Category deleted (11)
Actions #11

Updated by Benoît PECCATTE almost 10 years ago

  • Project changed from 34 to Rudder
  • Category set to Packaging
Actions

Also available in: Atom PDF