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

Also available in: Atom PDF