Skip to content

Commit f2b3ca3

Browse files
committed
Adjusted install scriptlets to give more time for shutting down database
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 f2b3ca3

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+
# wait 5 minutes for smart shutdown to happen, on slower machines it might take a while
1060+
if ! (cd /tmp && su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data --timeout=300 -m smart"); then
1061+
su cfpostgres -c "$PREFIX/bin/pg_ctl stop -D $PREFIX/state/pg/data --timeout=300 -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)