You are not logged in.

#1 2012-06-18 11:13:37

mgmartins
Member
From: Spain
Registered: 2009-06-18
Posts: 26

[SOLVED] tmp not cleared

After initscripts update, my /tmp dir isn't cleared after every boot.

Last edited by mgmartins (2012-06-25 10:21:22)


Spanish Arch Linux user since 2009

Offline

#2 2012-06-18 11:43:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] tmp not cleared

Are you certain?  Is it mounted as tmpfs?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2012-06-18 11:54:30

mgmartins
Member
From: Spain
Registered: 2009-06-18
Posts: 26

Re: [SOLVED] tmp not cleared

I've /tmp as a root folder and not as a partition.


Spanish Arch Linux user since 2009

Offline

#4 2012-06-18 12:22:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] tmp not cleared

mgmartins wrote:

I've /tmp as a root folder and not as a partition.

So you've modified the default scripts and made tmp as a dir on a physical disk... Why would you expect it to clear on a reboot?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2012-06-18 13:11:44

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: [SOLVED] tmp not cleared

Since the new initscripts, Archlinux advices to mount /tmp on tmpfs
More info:
http://www.h-online.com/open/news/item/ … 99432.html

Offline

#6 2012-06-18 15:47:07

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] tmp not cleared

graysky wrote:
mgmartins wrote:

I've /tmp as a root folder and not as a partition.

So you've modified the default scripts and made tmp as a dir on a physical disk... Why would you expect it to clear on a reboot?

If i am not mistaken, /tmp used to be cleared on every reboot, even before migration to tmpfs.

Offline

#7 2012-06-18 19:59:20

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [SOLVED] tmp not cleared

the behavior changed slightly: we now delete any files that have not been accessed in 10 days. The functionality can be tweaked by copying /usr/lib/tmpfiles.d/tmp.conf to /etc/tmpfiles.d/ and editing it there. To learn about the format check out "man tmpfiles.d".

If you wish you could call "/usr/bin/systemd-tmpfiles --clean" from a cronjob every day or so, and it will then delete all files older than 10 days as well (or whatever you configured).

Offline

#8 2012-06-18 21:22:54

cgarcia
Member
Registered: 2010-08-09
Posts: 39

Re: [SOLVED] tmp not cleared

Yes, I have the same issue. My tmp is no longer mounted by default in tmpfs. I have garbage in /tmp since 10 june (just the day after initscripts were upgraded to 2012.06.1-1).

EDIT: I just have tested another machine and indeed /tmp was not mounted as tmpfs (as I incorrectly believed)!. Well, time to do it...

Last edited by cgarcia (2012-06-18 21:31:49)

Offline

#9 2012-06-18 21:57:45

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [SOLVED] tmp not cleared

@cgarcia: the default fstab mounts /tmp as tmpfs, but if you overwrite that, we don't force it.

Offline

#10 2012-07-15 11:07:58

replabrobin
Member
Registered: 2010-05-06
Posts: 226

Re: [SOLVED] tmp not cleared

I have some other entries in fstab which I'm not sure about; I checked the latest fstab and it only has tmpfs; can anyone say if these entries are actually required?

devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

Offline

#11 2012-07-15 11:54:41

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [SOLVED] tmp not cleared

replabrobin wrote:

I have some other entries in fstab which I'm not sure about; I checked the latest fstab and it only has tmpfs; can anyone say if these entries are actually required?

devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

They are not needed. Only add them if you want to override the standard mount options we use in initsctipts/systemd.

Offline

#12 2012-08-08 13:59:50

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,390

Re: [SOLVED] tmp not cleared

tomegun wrote:

the behavior changed slightly: we now delete any files that have not been accessed in 10 days. The functionality can be tweaked by copying /usr/lib/tmpfiles.d/tmp.conf to /etc/tmpfiles.d/ and editing it there. To learn about the format check out "man tmpfiles.d".

If you wish you could call "/usr/bin/systemd-tmpfiles --clean" from a cronjob every day or so, and it will then delete all files older than 10 days as well (or whatever you configured).

i'm not using any tmpfs because my install is very old and i don't like to worry about ram everytime i copy something to /tmp.
Now i've in /tmp a file from june, something isn't working?

Going to try tmp.conf ...

-edit
For some reason the access time of all of my files in /tmp is set to the time i boot the system, so it never get cleared.
Seems:

D /tmp 1777 root root 

will mimic the old behaviour

Last edited by kokoko3k (2012-08-08 14:25:53)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB