@@ -125,8 +125,13 @@ function mysql_setup() {
125
125
vvv_info " * Copied /srv/provision/core/mariadb/config/debian.cnf to /etc/mysql/debian.cnf"
126
126
127
127
# Due to systemd dependencies, in docker, mysql service is not auto started
128
+ # also docker isn't systemd based, so thee service name is different: see: https://mariadb.com/kb/en/systemd/ vs https://mariadb.com/kb/en/sysvinit/
128
129
vvv_info " * Ensuring MariaDB service is started"
129
- service mariadb status > /dev/null || service mariadb start
130
+ if [ ! -f /.dockerenv ]; then
131
+ service mariadb status > /dev/null || service mariadb start
132
+ else
133
+ service mysql status > /dev/null || service mysql start
134
+ fi
130
135
131
136
if [ ! -f /.dockerenv ]; then
132
137
check_mysql_root_password
@@ -135,21 +140,40 @@ function mysql_setup() {
135
140
# MySQL gives us an error if we restart a non running service, which
136
141
# happens after a `vagrant halt`. Check to see if it's running before
137
142
# deciding whether to start or restart.
138
- if service mariadb status > /dev/null; then
139
- vvv_info " * Restarting the mariadb service"
140
- if ! service mariadb restart; then
141
- vvv_error " * Restarting the MariaDB failed! Fetching service status."
142
- service mariadb status
143
- exit 1
144
- fi
143
+ if [ ! -f /.dockerenv ]; then
144
+ if service mariadb status > /dev/null; then
145
+ vvv_info " * Restarting the mariadb service"
146
+ if ! service mariadb restart; then
147
+ vvv_error " * Restarting the MariaDB failed! Fetching service status."
148
+ service mariadb status
149
+ exit 1
150
+ fi
151
+ else
152
+ vvv_info " * Restarting mariadb service"
153
+ service mariadb start
154
+ if ! service mariadb start; then
155
+ vvv_error " * Starting MariaDB failed! Fetching service status."
156
+ service mariadb status
157
+ exit 1
158
+ fi
159
+ fi
145
160
else
146
- vvv_info " * Restarting mariadb service"
147
- service mariadb start
148
- if ! service mariadb start; then
149
- vvv_error " * Starting MariaDB failed! Fetching service status."
150
- service mariadb status
151
- exit 1
152
- fi
161
+ if service mysql status > /dev/null; then
162
+ vvv_info " * Restarting the mariadb service"
163
+ if ! service mysql restart; then
164
+ vvv_error " * Restarting the MariaDB failed! Fetching service status."
165
+ service mysql status
166
+ exit 1
167
+ fi
168
+ else
169
+ vvv_info " * Restarting mariadb service"
170
+ service mysql start
171
+ if ! service mysql start; then
172
+ vvv_error " * Starting MariaDB failed! Fetching service status."
173
+ service mysql status
174
+ exit 1
175
+ fi
176
+ fi
153
177
fi
154
178
155
179
# IMPORT SQL
0 commit comments