Description of problem: `db-control stop` do not stop ManagedDB database (same for start) Version-Release number of selected component (if applicable): Beta candidate: Satellite-5.8-RHEL-6-20170118.0-Satellite-x86_64-dvd1.iso How reproducible: always Steps to Reproduce: 1. Install Managed DB 2. Make sure DB is running 3. Attempt to use db-control to stop it Actual results: [root@sat-mandb ~]# service rh-postgresql95-postgresql status postgres (pid 32054) is running... [root@sat-mandb ~]# db-control stop Database already shut down. [root@sat-mandb ~]# service rh-postgresql95-postgresql status postgres (pid 32054) is running... Expected results: Should stop the DB
Note that actually no (? - have not tested all) command works: e.g. report, report-stats, tablesizes, shrink-segments... On the other hand, backup happily starts copying files even when DB is actually running.
Taking...
fixed in upstream. spacewalk.git: 805e594c3b4beb0600bc8066875157734b77a64d
[root@bkr-hv03-guest21 ~]# db-control stop Stopping rh-postgresql95-postgresql service: [ OK ] [root@bkr-hv03-guest21 ~]# db-control status The database is offline. [root@bkr-hv03-guest21 ~]# service rh-postgresql95-postgresql status postgres is stopped [root@bkr-hv03-guest21 ~]# service rh-postgresql95-postgresql start Starting rh-postgresql95-postgresql service: [ OK ] [root@bkr-hv03-guest21 ~]# db-control status The database is running and accepting connections. [root@bkr-hv03-guest21 ~]# db-control backup dbbackup Database is running; please stop before running a cold backup. [root@bkr-hv03-guest21 ~]# service rh-postgresql95-postgresql stop Stopping rh-postgresql95-postgresql service: [ OK ] [root@bkr-hv03-guest21 ~]# db-control backup dbbackup <...> Full cold backup complete. [root@bkr-hv03-guest21 ~]# db-control online-backup /tmp/backupdb/dbback.bk Backing up to file /tmp/backupdb/dbback.bk. pg_dump: [archiver (db)] connection to database "swbase" failed: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? Backup complete. [root@bkr-hv03-guest21 ~]# db-control gather-stats RHN::DB connect('dbname=swbase','postgres',...) failed: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? at /usr/share/perl5/vendor_perl/Dobby/DB.pm line 70 Error: The database must be running to gather statistics. [root@bkr-hv03-guest21 ~]# db-control start Starting rh-postgresql95-postgresql service: [ OK ] [root@bkr-hv03-guest21 ~]# service rh-postgresql95-postgresql status postgres (pid 16556) is running... [root@bkr-hv03-guest21 ~]# db-control online-backup /tmp/backupdb/backup2.bkp <...> pg_dump: dumping contents of table "public.web_user_personal_info" pg_dump: dumping contents of table "public.web_user_prefix" pg_dump: dumping contents of table "public.web_user_site_info" pg_dump: dumping contents of table "public.web_user_site_type" Backup complete. [root@bkr-hv03-guest21 ~]# db-control gather-stats Gathering statistics... WARNING: this may be a very slow process. done. [root@bkr-hv03-guest21 ~]# db-control report Tablespace Size swbase 33 MB [root@bkr-hv03-guest21 ~]# db-control report-stats Tables with empty statistics: 0 Tables with stale statistics: 0 [root@bkr-hv03-guest21 ~]# db-control restore dbbackup Parsing backup log. Database is currently running; please stop it before restoring a backup. [root@bkr-hv03-guest21 ~]# db-control shrink-segments WARNING: this may be a slow process. done. [root@bkr-hv03-guest21 ~]# db-control tablesizes Tables Planner Size Real Size Real Size+Toasts+Idx all_primary_keys 0 bytes 0 bytes 0 bytes all_tab_columns 0 bytes 0 bytes 0 bytes dual 8192 bytes 8192 bytes 40 kB log 8192 bytes 8192 bytes 64 kB pxtsessions 0 bytes 0 bytes 72 kB qrtz_blob_triggers 0 bytes 0 bytes 16 kB qrtz_calendars 0 bytes 0 bytes 16 kB qrtz_cron_triggers 8192 bytes 8192 bytes 64 kB qrtz_fired_triggers 8192 bytes 8192 bytes 208 kB qrtz_job_details 16 kB 16 kB 88 kB qrtz_job_listeners 0 bytes 0 bytes 16 kB qrtz_locks 8192 bytes 8192 bytes 56 kB <...> [root@bkr-hv03-guest21 ~]# db-control verify dbbackup Parsing backup log. Verifying backup from Fri Feb 24 04:04:53 2017... dbbackup/pg_multixact/members/0000.gz... done. Checksum verified. dbbackup/pg_multixact/offsets/0000.gz... done. Checksum verified. dbbackup/base/1/3466_vm.gz... done. Checksum verified. dbbackup/base/1/1259_fsm.gz... done. Checksum verified. dbbackup/base/1/2603_fsm.gz... done. Checksum verified. dbbackup/base/1/2619.gz... done. Checksum verified. <...> [root@bkr-hv03-guest21 ~]# db-control stop Stopping rh-postgresql95-postgresql service: [ OK ] [root@bkr-hv03-guest21 ~]# db-control restore dbbackup <...> Extraction and verification complete, renaming files... done. Removing unnecessary files... done. Restoring empty directories... done. Restoration complete, you may now start the database. [root@bkr-hv03-guest21 ~]# db-control start Starting rh-postgresql95-postgresql service: [ OK ] VERIFIED
Forgot versions - tested on spacewalk-setup-postgresql-2.5.0-15.el6sat, spacewalk-dobby-2.5.2-8.el6sat, Satellite-5.8-RHEL-6-20170222.n.0 compose.
Re-verified with package spacewalk-dobby-2.5.2-11.el6sat.noarch start, stop, status, backup, online-backup, report, report-stats, verify, report-stats, examine, restore, tablesizes, help,..