Skip to contentSkip to conversation

debian: don't fail postinst when upgrading chroot

PATCH In review Darrick J. Wong 2 participants 2 messages Feb 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debian: don't fail postinst when upgrading chroot

From: Darrick J. Wong <[email protected]>

If we're upgrading a systemd-enabled chroot we'll fail because systemctl can't connect to a running systemd (nor should it). We don't need to issue daemon-reload inside a chroot that doesn't have a running systemd, so we can ignore the return value.

---
 debian/postinst |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
debian/postinst +1 -1
index 11693a6..2ad9174 100644
@@ -9,7 +9,7 @@ case "${1}" in
 			update-initramfs -u
 		fi
 		if [ -x /bin/systemctl ]; then
-			/bin/systemctl daemon-reload
+			/bin/systemctl daemon-reload 2>&1 || true
 		fi
 		;;
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

If we're upgrading a systemd-enabled chroot we'll fail because systemctl can't connect to a running systemd (nor should it). We don't need to issue daemon-reload inside a chroot that doesn't have a running systemd, so we can ignore the return value.

LGTM.

Quoted 1 line

cheers.

--
Nathan