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 | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
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
Related branches
~chad.smith/cloud-init:ubuntu/xenial
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1095 lines (+657/-91)20 files modifiedcloudinit/config/cc_bootcmd.py (+7/-1)
cloudinit/config/cc_runcmd.py (+5/-0)
cloudinit/config/cc_write_files.py (+6/-1)
cloudinit/event.py (+17/-0)
cloudinit/gpg.py (+42/-10)
cloudinit/sources/__init__.py (+77/-1)
cloudinit/sources/tests/test_init.py (+82/-1)
cloudinit/stages.py (+10/-4)
cloudinit/tests/test_gpg.py (+54/-0)
cloudinit/tests/test_stages.py (+231/-0)
cloudinit/tests/test_util.py (+68/-1)
cloudinit/util.py (+18/-10)
debian/changelog (+17/-0)
dev/null (+0/-49)
doc/examples/cloud-config-run-cmds.txt (+4/-1)
doc/examples/cloud-config.txt (+4/-1)
doc/rtd/topics/format.rst (+1/-1)
integration-requirements.txt (+1/-1)
tests/unittests/test_datasource/test_azure_helper.py (+3/-1)
tools/run-container (+10/-8)
~chad.smith/cloud-init:ubuntu/artful
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1095 lines (+657/-91)20 files modifiedcloudinit/config/cc_bootcmd.py (+7/-1)
cloudinit/config/cc_runcmd.py (+5/-0)
cloudinit/config/cc_write_files.py (+6/-1)
cloudinit/event.py (+17/-0)
cloudinit/gpg.py (+42/-10)
cloudinit/sources/__init__.py (+77/-1)
cloudinit/sources/tests/test_init.py (+82/-1)
cloudinit/stages.py (+10/-4)
cloudinit/tests/test_gpg.py (+54/-0)
cloudinit/tests/test_stages.py (+231/-0)
cloudinit/tests/test_util.py (+68/-1)
cloudinit/util.py (+18/-10)
debian/changelog (+17/-0)
dev/null (+0/-49)
doc/examples/cloud-config-run-cmds.txt (+4/-1)
doc/examples/cloud-config.txt (+4/-1)
doc/rtd/topics/format.rst (+1/-1)
integration-requirements.txt (+1/-1)
tests/unittests/test_datasource/test_azure_helper.py (+3/-1)
tools/run-container (+10/-8)
~chad.smith/cloud-init:ubuntu/bionic
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1095 lines (+657/-91)20 files modifiedcloudinit/config/cc_bootcmd.py (+7/-1)
cloudinit/config/cc_runcmd.py (+5/-0)
cloudinit/config/cc_write_files.py (+6/-1)
cloudinit/event.py (+17/-0)
cloudinit/gpg.py (+42/-10)
cloudinit/sources/__init__.py (+77/-1)
cloudinit/sources/tests/test_init.py (+82/-1)
cloudinit/stages.py (+10/-4)
cloudinit/tests/test_gpg.py (+54/-0)
cloudinit/tests/test_stages.py (+231/-0)
cloudinit/tests/test_util.py (+68/-1)
cloudinit/util.py (+18/-10)
debian/changelog (+17/-0)
dev/null (+0/-49)
doc/examples/cloud-config-run-cmds.txt (+4/-1)
doc/examples/cloud-config.txt (+4/-1)
doc/rtd/topics/format.rst (+1/-1)
integration-requirements.txt (+1/-1)
tests/unittests/test_datasource/test_azure_helper.py (+3/-1)
tools/run-container (+10/-8)
~chad.smith/cloud-init:ubuntu/devel
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1094 lines (+656/-91)20 files modifiedcloudinit/config/cc_bootcmd.py (+7/-1)
cloudinit/config/cc_runcmd.py (+5/-0)
cloudinit/config/cc_write_files.py (+6/-1)
cloudinit/event.py (+17/-0)
cloudinit/gpg.py (+42/-10)
cloudinit/sources/__init__.py (+77/-1)
cloudinit/sources/tests/test_init.py (+82/-1)
cloudinit/stages.py (+10/-4)
cloudinit/tests/test_gpg.py (+54/-0)
cloudinit/tests/test_stages.py (+231/-0)
cloudinit/tests/test_util.py (+68/-1)
cloudinit/util.py (+18/-10)
debian/changelog (+16/-0)
dev/null (+0/-49)
doc/examples/cloud-config-run-cmds.txt (+4/-1)
doc/examples/cloud-config.txt (+4/-1)
doc/rtd/topics/format.rst (+1/-1)
integration-requirements.txt (+1/-1)
tests/unittests/test_datasource/test_azure_helper.py (+3/-1)
tools/run-container (+10/-8)
~chad.smith/cloud-init:docs/dont-use-tmp-during-boot
Merged
into
cloud-init:master
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Approve
-
Diff: 81 lines (+25/-3)5 files modifiedcloudinit/config/cc_bootcmd.py (+7/-1)
cloudinit/config/cc_runcmd.py (+5/-0)
cloudinit/config/cc_write_files.py (+5/-0)
doc/examples/cloud-config-run-cmds.txt (+4/-1)
doc/examples/cloud-config.txt (+4/-1)
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 |
tags: | added: docs |
To post a comment you must log in.
copied from https:/ /code.launchpad .net/~powersj/ cloud-init/ +git/cloud- init/+merge/ 331736
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).
[1] https:/ /git.launchpad. net/~usd- import- team/ubuntu/ +source/ systemd/ tree/debian/ patches/ debian/ Bring-tmpfiles. d-tmp.conf- in-line- with-Debian- defaul. patch?h= applied/ ubuntu/ artful /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 675422 www.pathname. com/fhs/ pub/fhs- 2.3.html# VARTMPTEMPORARY FILESPRESERVEDB ETWEE
[2] https:/
[3] http://