Fix apparmor_parser not found error in desktop postinst script (#9728)
Add a runtime guard in the postinst so apparmor_parser is only called when available. Previously, packages built on Ubuntu 24+ would fail to install on headless servers or systems without AppArmor tools. A warning is printed when the profile load is skipped to aid debugging.pull/9743/head
parent
a0e6da0772
commit
c8bd75c9a8
|
|
@ -86,7 +86,11 @@ EOF
|
|||
#!/bin/sh
|
||||
|
||||
echo "Load apparmor pgAdmin profile..."
|
||||
apparmor_parser -r /etc/apparmor.d/pgadmin4
|
||||
if command -v apparmor_parser >/dev/null 2>&1; then
|
||||
apparmor_parser -r /etc/apparmor.d/pgadmin4
|
||||
else
|
||||
echo "Warning: apparmor_parser not found, skipping profile load. pgAdmin desktop may not work on Ubuntu 24+ with userns restrictions."
|
||||
fi
|
||||
EOF
|
||||
chmod 755 "${DESKTOPROOT}/DEBIAN/postinst"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue