Actions
Bug #6699
closedRudder-reports does not find correct postgresql service when using systemctl
Pull Request:
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
Actions