Document in RTD that cloud-init users shouldn't write to /tmp due races with systemd LP:1707222

Bug #1727876 reported by Chad Smith
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Chad Smith

Bug Description

Since cloud-init races with systemd cleanup of /tmp per LP: #1707222. We need to change doc examples which mention this issue when writing things to /tmp. We should also add a note or special consideration to cloud-init RTD about this case where pertinent so that users don't go down this route.
affects cloud-init 17.1

Tags: docs

Related branches

Chad Smith (chad.smith)
Changed in cloud-init:
importance: Undecided → Medium
assignee: nobody → Chad Smith (chad.smith)
status: New → Triaged
summary: - Document in RTD that cloud-init can't write to /tmp due races with
- systemd LP:1707222
+ Document in RTD that cloud-init users shouldn't write to /tmp due races
+ with systemd LP:1707222
Revision history for this message
Scott Moser (smoser) wrote :

copied from
for some background that would probably be useful to include or reference:

At first I was not keen on the use of /var/tmp, as I knew that Ubuntu was carrying a patch to systemd upstream for that behavior, and figured that we were really just buying time before someone decided "oh lets remove /var/tmp/ also".

I dug a bit, patch [1] that does this is to fix Debian bug 675422 [2].
That bug references the FHS [3] which at least gives us a reasonable justification for
our use:

| The /var/tmp directory is made available for programs that require
| temporary files or directories that are preserved between system
| reboots. Therefore, data stored in /var/tmp is more persistent than
| data in /tmp.

| Files and directories located in /var/tmp must not be deleted when the
| system is booted. Although data stored in /var/tmp is typically deleted
| in a site-specific manner, it is recommended that deletions occur at a
| less frequent interval than /tmp.

So, it seems sane that /var/tmp can be used.
But for some use cases /run/my-dir is better (in that it is guaranteed
to *not* have stale data across a boot).


do3meli (d-info-e)
tags: added: docs
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit 2e62cb8a to cloud-init on branch master.
To view that commit see the following URL:

Changed in cloud-init:
status: Triaged → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in cloud-init version 18.4.

This bug is believed to be fixed in cloud-init in version 18.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.