From 4048fba10ef855f21d454c75c729ba78cded6e64 Mon Sep 17 00:00:00 2001 From: ComixHe Date: Wed, 20 Nov 2024 17:05:02 +0800 Subject: [PATCH] chore: use su instead of sudo in dpkg postinst Signed-off-by: ComixHe --- debian/linglong-bin.postinst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/linglong-bin.postinst b/debian/linglong-bin.postinst index c1a37c30a..fba1478ab 100644 --- a/debian/linglong-bin.postinst +++ b/debian/linglong-bin.postinst @@ -6,8 +6,9 @@ case "$1" in configure) - sudo -u deepin-linglong ll-cli migrate || true - sudo -u deepin-linglong rm /var/lib/linglong/state.json 2>/dev/null || true + # deepin-linglong doesn't has a login shell, use /bin/sh to execute 'migrate' + su -s /bin/sh -c "ll-cli migrate" deepin-linglong 2>/dev/null || true + rm /var/lib/linglong/state.json 2>/dev/null || true ;; *) ;; esac