You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packaging/common/cfengine-hub/postinstall.sh
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -518,7 +518,7 @@ check_disk_space() {
518
518
# and then importing it into new one
519
519
520
520
migrate_db_using_pg_upgrade() {
521
-
su cfpostgres -c "LD_LIBRARY_PATH=$BACKUP_DIR/lib/ $PREFIX/bin/pg_upgrade --old-bindir=$BACKUP_DIR/bin --new-bindir=$PREFIX/bin --old-datadir=$BACKUP_DIR/data --new-datadir=$PREFIX/state/pg/data"
521
+
su cfpostgres -c "$PREFIX/bin/pg_upgrade --old-bindir=$BACKUP_DIR/bin --new-bindir=$PREFIX/bin --old-datadir=$BACKUP_DIR/data --new-datadir=$PREFIX/state/pg/data"
522
522
}
523
523
524
524
migrate_db_using_pipe() {
@@ -699,16 +699,23 @@ do_migration() {
699
699
cd /tmp
700
700
cf_console echo"Migrating database using pg_upgrade utility..."
701
701
cf_console echo
702
-
if migrate_db_using_pg_upgrade && [ $DEBUG-lt 1 ];then
702
+
_pg_upgrade_log="/tmp/cfengine_pg_upgrade.log"
703
+
if migrate_db_using_pg_upgrade >"${_pg_upgrade_log}"2>&1&& [ $DEBUG-lt 1 ];then
703
704
# Succeeded
705
+
cat "${_pg_upgrade_log}"# might as well see the details of how it worked
706
+
rm "${_pg_upgrade_log}"# clean up
704
707
exit 0 # exits only from (...)
705
708
fi
706
709
cf_console echo"Migration using pg_upgrade failed."
707
-
# here pg_upgrade probably said something like
708
-
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
709
-
cf_console echo"Showing last lines of any related log files:"
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
715
+
cf_console echo"Showing last lines of any related log files:"
0 commit comments