mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1757] Cleaning named overlay #1194
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1194
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @janisdd on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1757
I couldn't find any option to clean only a specific (named) overlay. Is there such an option or is this planned?
Background:
I have a web service to execute code remotely. For every request a new worker is started to run the code and return the result. If I create named overlays (for every run) and clear all overlays after one run has finished this might affect the other runs...
Cleaning only the used overlay could help here.
@netblue30 commented on GitHub (Feb 3, 2018):
It is not possible to clean it when the sandbox is closed. The kernel can shut down processes without giving any kind of notification, not even a message in the log. You can use --overlay-tmpfs. It removes the temporary overlay automatically.
@janisdd commented on GitHub (Feb 3, 2018):
Unfortunately compiling and execution are 2 separate processes in the worker.
With
--overlay-tmpfsthe compiled files would be cleared before the actual execution.I was hoping for an option like
firejail --overlay-clean-named=xwhich I could call after the two processes have finished.I could try to make a PR if this option is desired.
@netblue30 commented on GitHub (Feb 3, 2018):
The problem is the kernel, we cannot guarantee we'll remove it up because the kernel can shut us down at any time and we will not get a chance to clean it. Let's mark it as an enhancement, maybe somebody comes with an idea.
We have similar problems with files hanging around in /run/firejail directory after the sandbox is closed. The workaround was to check and clean /run/firejail next time another sandbox is started.
@janisdd commented on GitHub (Feb 3, 2018):
Uh... so
firejail --overlay-cleancan also fail at any time? I thought about--overlay-clean-namedas one of these one single argument options (no sandbox creation).@oxwivi commented on GitHub (Apr 24, 2018):
Also,
sudo firejail --overlay-cleancannot clean the directories under/root/.firejail/:@chiraag-nataraj commented on GitHub (May 24, 2019):
Why not just run a script which runs both steps, one after the other? Something like:
firejail --overlay-tmpfs ~/path/to/my/script.shwherescript.shlooks like:(and you could do a manual
--profile=path/to/profileif you wanted to lock it down or whatever).@chiraag-nataraj commented on GitHub (May 24, 2019):
This seems to have been fixed at some point. I can't replicate it with the current master.
@janisdd commented on GitHub (May 25, 2019):
You're right. I just wrapped the whole process in another firejail call.
The first uses
firejail --quiet --overlay-tmpfsand runs the java program to handle in-/output and then the java program starts the user program withfirejail --quiet --profile=...Guess this can be closed (as the root/first call can always use
--overlay-tmpfsand wrap all other calls)