Skip to content

Commit a5bf06b

Browse files
committed
Adjusted database stop code to give more time to smart shutdown
On a slow raspberry pi 4 I found that the current smart and then immediate stop (immediate) did not work well. The system needed more time. Ticket: ENT-12750 Changelog: title
1 parent b6854e6 commit a5bf06b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packaging/common/cfengine-hub/postinstall.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,10 @@ if [ -n "$httpds" ]; then
10561056
fi
10571057
fi
10581058

1059-
(cd /tmp && su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data -m smart" || su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data -m fast")
1059+
if ! (cd /tmp && su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data -m smart"); then
1060+
sleep 300
1061+
su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data -m fast"
1062+
fi
10601063

10611064
# Have to be careful here because httpd/php/bin wants to be root:root
10621065
chown root:$MP_APACHE_USER $PREFIX/httpd/php

0 commit comments

Comments
 (0)