File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,20 @@ ln -sf log/nginx /config/logs
37
37
[ -f /config/production.json ] || cp /defaults/production.json /config/
38
38
[ -f $XDG_CONFIG_HOME /letsencrypt/cli.ini ] || cp /defaults/cli.ini $XDG_CONFIG_HOME /letsencrypt/
39
39
40
+ # Protect against database initialization failure: make sure to remove the
41
+ # database directory if it didn't initialized properly.
42
+ if [ -d /config/mysql ] && [ -f /config/db_init_in_progress ]; then
43
+ rm -r /config/mysql
44
+ fi
45
+
40
46
# Initialize the database data directory.
41
47
if [ ! -d /config/mysql ]; then
42
48
MYSQL_DATABASE=nginxproxymanager
43
49
MYSQL_USER=nginxproxymanager
44
50
MYSQL_PASSWORD=password123
45
51
52
+ touch /config/db_init_in_progress
53
+
46
54
log " Initializing database data directory..."
47
55
mysql_install_db --datadir=/config/mysql > /config/log/init_db.log 2>&1
48
56
log " Database data directory initialized."
@@ -86,6 +94,9 @@ if [ ! -d /config/mysql ]; then
86
94
fi
87
95
fi
88
96
97
+ # Database initialized properly.
98
+ rm -f /config/db_init_in_progress
99
+
89
100
# Generate dummy self-signed certificate.
90
101
if [ ! -f /config/nginx/dummycert.pem ] || [ ! -f /config/nginx/dummykey.pem ]
91
102
then
You can’t perform that action at this time.
0 commit comments