Project

General

Profile

Bug #6699

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

Added by Vincent MEMBRÉ over 5 years ago. Updated about 5 years ago.

Status:
Released
Priority:
N/A
Category:
Packaging
Target version:
Severity:
User visibility:
Effort required:
Priority:

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

Bug #6839: Fix the rudder init script as well to detect the right servicesReleased2015-06-26Matthieu CERDAActions

Related issues

Related to Rudder - Bug #6546: rudder-reports package should use the correct PostgreSQL serviceReleased2015-04-29Benoît PECCATTEActions
Has duplicate Rudder - Bug #6686: Error while installing rudder-reports on centos 7Rejected2015-06-01Matthieu CERDAActions
#1

Updated by Vincent MEMBRÉ over 5 years ago

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

Updated by Vincent MEMBRÉ over 5 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  
#3

Updated by Matthieu CERDA over 5 years ago

  • Target version changed from 3.0.6 to 2.11.12

Fixing this on all impacted versions !

#4

Updated by Matthieu CERDA over 5 years ago

  • Status changed from New to In progress
#5

Updated by Matthieu CERDA over 5 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
#6

Updated by Matthieu CERDA over 5 years ago

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

Updated by Vincent MEMBRÉ over 5 years ago

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

Updated by Vincent MEMBRÉ about 5 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
#10

Updated by Vincent MEMBRÉ about 5 years ago

  • Category changed from System integration to Packaging
#11

Updated by Vincent MEMBRÉ about 5 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.

Also available in: Atom PDF