Skip to content
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

Use Firejail as shell - shutdown issue #2433

Open
gaellalire opened this issue Feb 20, 2019 · 1 comment
Open

Use Firejail as shell - shutdown issue #2433

gaellalire opened this issue Feb 20, 2019 · 1 comment

Comments

@gaellalire
Copy link

When we use Firejail to launch background job and then exit the bash session Firejail is waiting all background jobs to finish before exiting.

SSHd is waiting for Firejail which is waiting for all its children.

I think following method could work :

  • Firejail-Launcher launch Firejail
  • SSHd is waiting for Firejail-Launcher
  • Firejail-Launcher is waiting only on its first grand child (bash by default)
  • Firejail is still waiting for all its children

When the first grand child exit, Firejail-Launcher will exit and SSHd will stop the connection. But Firejail will continue to run while there is at least one child of bash which run.

@gaellalire
Copy link
Author

@rusty-snake this ticket is nothing like #3042 and probably not like #2786 .
When initial process finishes I don't want its children to be killed.
When initial process finishes I want firejail to die so SSHd will stop the connection.

But if firejail die children of initial process will not work.
That why I proposed to separate firejail-launcher from firejail

SSHd (pid:1, wait:2) -> firejail-launcher (pid:2, wait:4) -> firejail (pid:3, wait:all children) -> initial process (pid:4) -> sub process (pid:5)

When pid 4 die, pid 2 will stop.
Because their parent die, pid 5 and pid 3 will have their grand parent as parent.
So we will get

SSHd (pid:1) -> firejail (pid:3, wait:all children) -> sub process (pid:5)

And when all children of pid 3 die, pid 3 will die too

SSHd (pid:1) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant