Skip to content

Conversation

@t-mon
Copy link

@t-mon t-mon commented Feb 3, 2026

TMPDIR points to /srv/rauc-tmp, so it persists across reboots.
Clear the directory in ExecStartPre to avoid stale RAUC downloads filling /srv.

What a nice oxymoron: "persistent TMPDIR"

@t-mon t-mon requested review from barsnick and mhei February 3, 2026 15:52
@t-mon t-mon force-pushed the rauc-tmpdir-configuration branch 3 times, most recently from ccf1f78 to 94289fb Compare February 3, 2026 15:58
TMPDIR points to /srv/rauc-tmp, so it persists across reboots.
Clear the directory in ExecStartPre to avoid stale RAUC downloads filling /srv.

Signed-off-by: Simon Stürz <simon.stuerz@chargebyte.com>
@t-mon t-mon force-pushed the rauc-tmpdir-configuration branch from 94289fb to bd8d453 Compare February 3, 2026 15:59
Copy link
Member

@mhei mhei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: we could "save" the shell glob stuff when we just do

ExecStartPre=/bin/rm -rf "$TMPDIR"
ExecStartPre=/bin/mkdir -p "$TMPDIR"

Or did I miss anything?
Other than this, LGTM

@t-mon
Copy link
Author

t-mon commented Feb 4, 2026

If the TMPDIR does not exist for whatever reason, the RAUC service would failed to start because rm would return non zero value. The shell glob stuff is only required for using the wildcard rm of the folder content, i thought this way it is the most fail-save, independent of the folder existence or it's content.

@mhei
Copy link
Member

mhei commented Feb 4, 2026

rm -rf ... always returns success in my tests, even for non-existent dirs?
I was only concerned regarding the (here very very unlikely) case that TMPDIR does not make it into the call and is empty because then /bin/sh -c 'rm -rf "$TMPDIR"/*' would become effective /bin/sh -c 'rm -rf /*' 😄
Feel free to merge as-is.

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

Successfully merging this pull request may close these issues.

2 participants