diff options
author | Arnaud Rebillout <arnaudr@kali.org> | 2021-03-19 17:11:04 +0700 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2021-04-06 17:20:43 +0200 |
commit | 82a2ea64b47ba7d4f10019418f84a0f3131d1c11 (patch) | |
tree | 5ff49df05385f06a5df615a737a41c13fa414665 | |
parent | c32edd75155129fbfe353aed6402374d40e63b65 (diff) | |
download | mariadb-git-82a2ea64b47ba7d4f10019418f84a0f3131d1c11.tar.gz |
Fix postinst trigger when systemd is not running (Closes: #983563)bb-10.2-anel-systemdpatch
Checking for the existence of the systemctl command only tells us that
systemd is installed, however it does not tell us if systemd is running.
What we really want to do here is reload systemd if it's installed AND
if it's running. The usual way to check if systemd is running is to
check for the existence of '/run/systemd/system'.
Why would systemd be installed but not running? This is something that
happens when one sets up or upgrade a system in a chroot or container.
For more details refer to the bug report:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983563>
Closes PR #1787
-rw-r--r-- | debian/mariadb-server-10.2.postinst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/debian/mariadb-server-10.2.postinst b/debian/mariadb-server-10.2.postinst index 063f0d8c58b..057b1bf540e 100644 --- a/debian/mariadb-server-10.2.postinst +++ b/debian/mariadb-server-10.2.postinst @@ -247,8 +247,8 @@ EOF ;; triggered) - if [ -x "$(command -v systemctl)" ]; then - systemctl daemon-reload + if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload fi invoke restart ;; |