pgbouncer init.d fails to start with no message when start=0

Bug #1322186 reported by Jason on 2014-05-22
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pgbouncer (Ubuntu)
Undecided
Unassigned

Bug Description

Command:
sudo service pgbouncer start or /etc/init.d/pgbouncer start

Expectation:
When starting pgbouncer through the init script, it should start or fail with an error.

What is actually happening:
When you start pgbouncer it exits with 0 and no error, Pgbouncer has not started.

Version Info:

Description: Ubuntu 12.10
Release: 12.10
pgbouncer:
  Installed: 1.5.4-3.pgdg12.4+1
  Candidate: 1.5.4-3.pgdg12.4+1
  Version table:
 *** 1.5.4-3.pgdg12.4+1 0
        500 http://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main amd64 Packages
        100 /var/lib/dpkg/status
     1.5.2-2ubuntu0.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ quantal-security/universe amd64 Packages
     1.5.2-2 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages

DETAILS:

When you install pgbouncer on ubuntu and go to start the service it fails without a message.

after digging around google and through the init.d script, i found that start needs to be set to 1 in the defaults file.

This is far from standard installation, and highly confusing to anyone installing pgbouncer for the first time, not to mention, there is no documentation i can easily find on this behavior, and no error message when start=0.

it would make more sense to have pgbouncer start unconfigured, show errors in a log that i needs to be properly configured, then having the startup just fail with no warning.

if for some god awful reason you insist on leaving this ridiculous /etc/default/pgbouncer start=0 variable, there needs to be an error message explaining why pgbouncer doesn't start.

original init.d code:

case "$1" in
  start)
    # Check if we are still disabled in /etc/default/pgbouncer
    [ "${START:-}" = "0" ] && exit 0
    log_daemon_msg "Starting PgBouncer" $NAME
    test -d $PIDDIR || install -d -o postgres -g postgres -m 2775 $PIDDIR
    $SSD --start --chuid $RUNASUSER --oknodo -- $OPTS 2> /dev/null
    log_end_msg $?
    ;;

modified init.d:

case "$1" in
  start)
    log_daemon_msg "Starting PgBouncer" $NAME
    test -d $PIDDIR || install -d -o postgres -g postgres -m 2775 $PIDDIR
    $SSD --start --chuid $RUNASUSER --oknodo -- $OPTS 2> /dev/null
    log_end_msg $?
    ;;

or

case "$1" in
  start)
    # Check if we are still disabled in /etc/default/pgbouncer
    if [ "${START:-}" = "0" ]; then
       log_daemon_msg "Pgbouncer could not start. Please configure the pgbouncer.ini script, and set START=1 in /etc/default/pgcouncer " $NAME
       exit 0
    fi
    log_daemon_msg "Starting PgBouncer" $NAME
    test -d $PIDDIR || install -d -o postgres -g postgres -m 2775 $PIDDIR
    $SSD --start --chuid $RUNASUSER --oknodo -- $OPTS 2> /dev/null
    log_end_msg $?
    ;;

Jason (jasoncwatt) on 2014-05-22
summary: - init.d fails to start with no message when start=0
+ pgbouncer init.d fails to start with no message when start=0
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pgbouncer (Ubuntu):
status: New → Confirmed
lekksi (aleksi-lekksi) wrote :

I agree. Silently refusing to start without any error message whatsoever if start=0 cannot be considered good behavior, was the user installing pgbouncer for the first time or not.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers