Skip to content

Commit 802843e

Browse files
committed
MDEV-9643: Don't emit any "deb-systemd-helper not found" warnings
1 parent e7d50ef commit 802843e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,10 @@ db_stop # in case invoke failes
266266

267267
# If we upgrade from MySQL mysql.service may be masked, which also
268268
# 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
269+
# Check first that the command exists, to avoid emitting any warning messages.
270+
if [ -x "$(command -v deb-systemd-helper)" ]; then
271+
deb-systemd-helper unmask mysql.service > /dev/null
272+
fi
271273

272274
#DEBHELPER#
273275

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,10 @@ db_stop # in case invoke failes
282282

283283
# If we upgrade from MySQL mysql.service may be masked, which also
284284
# 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
285+
# Check first that the command exists, to avoid emitting any warning messages.
286+
if [ -x "$(command -v deb-systemd-helper)" ]; then
287+
deb-systemd-helper unmask mysql.service > /dev/null
288+
fi
287289

288290
#DEBHELPER#
289291

0 commit comments

Comments
 (0)