<div dir="ltr">Hi list,<div><br></div><div><div><div>In some cases users may want to clean up the files under /tmp only during boot with the following configuration</div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_0" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:1.2;font-family:"Droid Sans Mono",Menlo,Monaco,"Courier New",Courier,monospace;width:50em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border-bottom:1px solid rgba(0,0,0,0.2);margin-top:1px;margin-bottom:0px;overflow:auto;padding:10px;color:rgb(64,64,64)"># cat /etc/tmpfiles.d/fs-tmp.conf
#Type Path Mode User Group Age Argument
d! /tmp 1777 root root 14d</pre></div><div><div>But according to the man page of tmpfiles.d</div><div><br></div><div>'''</div><div>If the exclamation mark ("!") is used, this line is only safe to execute during boot, and can break a running system. Lines without the exclamation mark are<br>presumed to be safe to execute at any time, e.g. on package upgrades.  systemd-tmpfiles will take lines with an exclamation mark only into consideration, if the<br>--boot option is given.</div><div>'''</div></div><div>we have to make the following change to systemd-tmpfiles-setup.service to make it work as described above.</div><div>diff --git a/units/systemd-tmpfiles-setup.service b/units/systemd-tmpfiles-setup.service<br>index 6cae32850f..71d967aa48 100644<br>--- a/units/systemd-tmpfiles-setup.service<br>+++ b/units/systemd-tmpfiles-setup.service<br>@@ -21,7 +21,7 @@ RefuseManualStop=yes<br> [Service]<br> Type=oneshot<br> RemainAfterExit=yes<br>-ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev<br>+ExecStart=systemd-tmpfiles --clean --create --remove --boot --exclude-prefix=/dev<br> SuccessExitStatus=DATAERR CANTCREAT<br> ImportCredential=tmpfiles.*<br> ImportCredential=login.motd<br></div><div><br></div><div>Is there any reason why "--clean" is omitted in this service file?</div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,<div>Lidong Zhong</div></div></div></div></div></div>