It appears that this bug no longer affects newer versions of Ubuntu. It's unclear to me exactly how this change happened, but in 23.04, running "setsid pkexec echo hello" for example no longer prints the "Refusing to render service to dead parents." message, and instead works correctly. The original reproduction steps with Firefox/Chrome also don't cause the problem anymore.
The difference seems to be that when you run pkexec like that, it now gets parented to "systemd --user" in modern Ubuntu versions instead of init, so pkexec is no longer unhappy about it.
I can still spend some time tweaking the merge request as per Julian's feedback if there is any chance that this would result in new builds of gdebi for the older affected versions like 20.04 and 22.04.
It appears that this bug no longer affects newer versions of Ubuntu. It's unclear to me exactly how this change happened, but in 23.04, running "setsid pkexec echo hello" for example no longer prints the "Refusing to render service to dead parents." message, and instead works correctly. The original reproduction steps with Firefox/Chrome also don't cause the problem anymore.
The difference seems to be that when you run pkexec like that, it now gets parented to "systemd --user" in modern Ubuntu versions instead of init, so pkexec is no longer unhappy about it.
I can still spend some time tweaking the merge request as per Julian's feedback if there is any chance that this would result in new builds of gdebi for the older affected versions like 20.04 and 22.04.