-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell script fails to kill-off child processes upon app closure and sandbox termination #5897
Comments
These are possibly relevant: #3224 (comment) Maybe I could try something like this #3224 (comment), but to me it looks it may be better to find a native solution. |
Enable |
However, killing zombie processes does not help because killing them is a no-op. Maybe runit can not collect zombie processes inside pid-namespaces or has some other bug with it? |
I just modified the script with And no, those zombie processes still linger. Indeed, it may be a |
Okay, I had a chat with Void Linux devs on IRC: They say those blocks of
Are not technically zombie processes. Indeed, since those were spawned with |
OK, just to clarify, since the documentation isn't entirely helpful on this: Here Is this supported, or should I just close-down the issue? |
OK, some more chats have confirmed that this probably is not a Closing this. |
Yes, systemd apparently does some dbus-related things by itself as it depends
The user dbus process is indeed intended to stay around, but it's usually only What happens if dbus-launch is executed in the sway config and then (after a See for example: And the following file, which is provided by #!/bin/sh
# launches a session dbus instance
dbuslaunch="$(command -v dbus-launch)"
if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
if [ -n "$command" ]; then
command="$dbuslaunch --exit-with-session $command"
else
eval " $($dbuslaunch --sh-syntax --exit-with-session)"
fi
fi Maybe Void has something similar. |
Upon more testing, I have confirmed that, in fact I have no need (Anymore, at least) to use In every case, it is better to dismiss such an heavy usage of Indeed, I have discovered that In every case, Void devs have promised to eventually clarify this matter, and their preferred method of setting-up window managers, on their own handbook, thus the matter should eventually be cleared. Thanks for your help. |
Description
It seems that, at least on non-
systemd
distros (Utilizingrunit
as init, in my case) varying zombie processes are leftover upon sandbox termination given interaction withdbus-launch gsettings
command (Which, on non-systemd
distros, is largely necessary to properly set-up custom GTK themes, icons, cursors, and similar) in a custom script.May be at least partially related to #3949 and #3224
Steps to Reproduce
It is given the following:
A non-
systemd
distro (Void Linux, in my case, which runs onrunit
as init system)sway
as window manager.No login manager (
sway
is run on a custom config through a custom script)A
LibreWolf
AppImage (From https://gitlab.com/librewolf-community/browser/appimage/-/packages)A custom
.local/share/applications/LibreWolf_Firejailed/
freedesktop-based app setup, which operates as follows:LibreWolf_Firejailed.desktop
Hence,
LibreWolf_Firejailed.desktop
loadslibrewolf_firejailed.sh
, the latter being thus compiled:Thus,
librewolf_firejailed.sh
executesdbus-launch gsettings
to import relevant custom theming, and relies upon a customlibrewolf_firejailed.profile
, the latter being here described:Expected behavior
This fairly involved custom setup was necessary on my side to properly sandbox an AppImage-based browser, and correctly import
$gnome_schema
variables. Indeed, the AppImage-based browser runs perfectly, and correctly imports system themes with this setup (While, without utilizing thedbus-launch gsettings
-based schemes, it would absolutely not import custom theming), while otherwise appearing to be properly firejailed. However...Actual behavior
...It appears that, although the AppImage-based browser runs fine, and is properly terminated by the
sway
WM (Default keys Super + Shift + Q, depending onsway
config, thus I remark that the AppImage-based browser is closed-down by the WM), child processes presumably spawned by thedbus-launch gsettings
commands to remain lingering after the sandbox has been closed.In fact:
syslog
reports the following:It never however reports on those
dbus-daemon
being terminated. Also:pstree
:Those
dbus-daemon
are not visible onpstree
. And also:firejail --list
:4486:username::firejail --appimage --apparmor --profile=/home/username/.local/share/applications/LibreWolf_Firejailed/librewolf_firejailed.profile /home/username/.bin/LibreWolf.x86_64.AppImage
Indeed,
firejail --list
does not list suchdbus-daemon
.ps auxf
, however:Those blocks of
remain lingering after EACH sandbox is terminated. Thus, each time the AppImage-browser is closed, a new block of those
is spawned, and remains lingering until system shut-off, or manual termination.
It is even easier to locate such blocks with
htop
, but unfortunately pastinghtop
output is fairly difficult.Behavior without a profile
Not applicable here.
Additional context
Not sure. The above wall of text should be fairly self-evident. This is an edge case, after all, and largely depends upon usage of
dbus-launch gsettings
, which is however necessary on nonsystemd
distros to ensure that GTK custom theming "sticks".It should also be noted that
sway
DM also launches its own scheme ofYet that is not sufficient to force sandboxed applications to import
$gnome_schema
variables.Environment
Void Linux with
runit
as init.firejail version 0.9.72
Compile time support:
- always force nonewprivs support is disabled
- AppArmor support is enabled
- AppImage support is enabled
- chroot support is enabled
- D-BUS proxy support is enabled
- file transfer support is enabled
- firetunnel support is disabled
- IDS support is disabled
- networking support is enabled
- output logging is enabled
- overlayfs support is disabled
- private-home support is enabled
- private-cache and tmpfs as user enabled
- SELinux support is disabled
- user namespace support is enabled
- X11 sandboxing support is enabled
Checklist
firejail
, since there would never be any use of thedbus-launch gsettings
workaround).--profile=PROFILENAME
to set the right profile. (Only relevant for AppImages). Indeed I have, and you can read for yourself the contents of such a custom profile above.Log
Logs are provided above, this is an edge case. I can perform more tests if necessary.
The text was updated successfully, but these errors were encountered: