Skip to content

Commit 2a9f84b

Browse files
committed
MDEV-9354: Debian: unmask the mysql.service on installation
Unmask the systemd mysql.service if left behind by mysql-server-5.6 Without this a simple 'apt-get install mariadb-server' would end up with a system where mysqld is not running despite it was running OK with mysql-server-5.6 installed, and users might wrongly think mariadb-server package is broken when the real cause was the removal of mysql-server-5.6 that left a /etc/systemd/system/ file behind pointing to /dev/null.
1 parent 3730d8a commit 2a9f84b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

debian/dist/Debian/mariadb-server-10.0.postinst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ fi
264264

265265
db_stop # in case invoke failes
266266

267+
# If we upgrade from MySQL mysql.service may be masked, which also
268+
# means init.d script is disabled. Unmask mysql service explicitely.
269+
# Ignore exit code as command is not available everywhere.
270+
deb-systemd-helper unmask mysql.service > /dev/null || true
271+
267272
#DEBHELPER#
268273

269274
exit 0

debian/dist/Ubuntu/mariadb-server-10.0.postinst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ fi
280280

281281
db_stop # in case invoke failes
282282

283+
# If we upgrade from MySQL mysql.service may be masked, which also
284+
# means init.d script is disabled. Unmask mysql service explicitely.
285+
# Ignore exit code as command is not available everywhere.
286+
deb-systemd-helper unmask mysql.service > /dev/null || true
287+
283288
#DEBHELPER#
284289

285290
exit 0

0 commit comments

Comments
 (0)