Public bug reported:

Steps to reproduce (drop the "pgbouncer" for below commands if you only
test barebones postgresql):

systemctl start postgresql pgbouncer && \
systemctl stop pgbouncer postgresql && \
ps auxw | grep ^postgre

No output is expected. However, in reality you get up to 6 running
processes because /lib/systemd/system/postgresql.service is incorrectly
implemented and does not follow the documentation:

man -P cat systemctl | grep -A4 no-block
       --no-block
           Do not synchronously wait for the requested operation to finish. If
           this is not specified, the job will be verified, enqueued and
           systemctl will wait until the unit's start-up is completed. By
           passing this argument, it is only verified and enqueued.

As such, because --no-block was not used, the "systemctl stop" should wait 
until the operation
has finished.

The command "systemctl stop postgresql" should be running something
along the lines

systemctl list-units 'postgresql*' | grep ^postgresql@ | awk '{print
$1}' | xargs -r systemctl stop

before returning unless --no-block is given.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: postgresql-common 173ubuntu0.2
ProcVersionSignature: Ubuntu 4.15.0-47.50~16.04.1-generic 4.15.18
Uname: Linux 4.15.0-47-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
Date: Wed Feb  5 16:46:04 2020
InstallationDate: Installed on 2017-04-25 (1016 days ago)
InstallationMedia: Ubuntu-Server 16.04.2 LTS "Xenial Xerus" - Release amd64 
(20170215.8)
PackageArchitecture: all
SourcePackage: postgresql-common
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: postgresql-common (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1862138

Title:
  "systemctl stop postgresql" fails to stop postgresql

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/1862138/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to