Project

General

Profile

Actions

Bug #6699

closed

Rudder-reports does not find correct postgresql service when using systemctl

Added by Vincent MEMBRÉ almost 9 years ago. Updated over 8 years ago.

Status:
Released
Priority:
N/A
Category:
Packaging
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

When i install rudder-reports on debian jessie, I got a failure directly since it does not use the correct service to use

When we run this part:

    if type systemctl >/dev/null 2>&1; then
      POSTGRESQL_SERVICE_NAME=$(systemctl -a | awk -F'.' '{print $1}' | grep "postgresql" | tail -n 1)
    elif type chkconfig >/dev/null 2>&1; then
      POSTGRESQL_SERVICE_NAME=$(chkconfig 2>/dev/null | awk '{ print $1 }' | grep "postgresql" | tail -n 1)
    else
      POSTGRESQL_SERVICE_NAME=$(ls -1 /etc/init.d | grep "postgresql" | tail -n 1)
    fi

We are in the first case, but running that command:

systemctl -a | awk -F'.' '{print $1}' | grep "postgresql" | tail -n 1
  system-postgresql

If i remove the tail, I can see that we have three result on debian:

systemctl -a | awk -F'.' '{print $1}' | grep "postgresql" 
  postgresql
  postgresql@9
  system-postgresql

More details when removing the awk part:

systemctl -a |  grep "postgresql" 
  postgresql.service                                                                       loaded    active   exited    PostgreSQL RDBMS
  postgresql@9.4-main.service                                                              loaded    active   running   PostgreSQL Cluster 9.4-main
  system-postgresql.slice                                                                  loaded    active   active    system-postgresql.slice

I'm not sure what should be done here.

I need to test on other systems using systemd.

Since it only happens in debian8 and we support debian8 in 3.0, I assign it to 3.0, but since it was introduced in 2.11.11 it may also happens on some systems in 2.11


Subtasks 1 (0 open1 closed)

Bug #6839: Fix the rudder init script as well to detect the right servicesReleasedMatthieu CERDA2015-06-26Actions

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #6546: rudder-reports package should use the correct PostgreSQL serviceReleasedBenoît PECCATTE2015-04-29Actions
Has duplicate Rudder - Bug #6686: Error while installing rudder-reports on centos 7RejectedMatthieu CERDA2015-06-01Actions
Actions #1

Updated by Vincent MEMBRÉ almost 9 years ago

  • Related to Bug #6546: rudder-reports package should use the correct PostgreSQL service added
Actions #2

Updated by Vincent MEMBRÉ almost 9 years ago

  • Subject changed from rudder-reports does not find correct postgresql service on debian jessie and fails to install to rudder-reports does not find correct postgresql service when using systemctl

This also happens in RHEL7

systemctl -a | grep "postgresql" 

gives nothing

You need to run:

systemctl list-unit-files --type service | grep postgresql
postgresql.service  
Actions #3

Updated by Matthieu CERDA almost 9 years ago

  • Target version changed from 3.0.6 to 2.11.12

Fixing this on all impacted versions !

Actions #4

Updated by Matthieu CERDA almost 9 years ago

  • Status changed from New to In progress
Actions #5

Updated by Matthieu CERDA almost 9 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Matthieu CERDA to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/677
Actions #6

Updated by Matthieu CERDA almost 9 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #8

Updated by Vincent MEMBRÉ almost 9 years ago

  • Has duplicate Bug #6686: Error while installing rudder-reports on centos 7 added
Actions #9

Updated by Vincent MEMBRÉ over 8 years ago

  • Subject changed from rudder-reports does not find correct postgresql service when using systemctl to Rudder-reports does not find correct postgresql service when using systemctl
Actions #10

Updated by Vincent MEMBRÉ over 8 years ago

  • Category changed from System integration to Packaging
Actions #11

Updated by Vincent MEMBRÉ over 8 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.11.12, 3.0.7 and 3.1.0 which were released today.

Actions

Also available in: Atom PDF