Skip to content

Commit 265cad2

Browse files
committed
wait for db, ghost misfire
1 parent dbb9952 commit 265cad2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nodeapp.php

+11
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ public function hcpp_runuser( $cmd ) {
4343
*/
4444
public function hcpp_rebooted() {
4545

46+
// Wait up to 60 additional seconds for MySQL to start
47+
$i = 0;
48+
while ( $i < 60 ) {
49+
$i++;
50+
$mysql = shell_exec( 'systemctl is-active mysql' );
51+
if ( trim( $mysql ) == 'active' ) {
52+
break;
53+
}
54+
sleep( 1 );
55+
}
56+
4657
// Restart all PM2 apps for all user accounts
4758
$users = scandir('/home');
4859
global $hcpp;

0 commit comments

Comments
 (0)