FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-20-2012, 04:32 PM
Lukáš Jirkovský
 
Default tmp files no longer removed

On 20 June 2012 18:28, Tom Gundersen <teg@jklm.no> wrote:
> On Jun 20, 2012 6:05 PM, "Lukáš Jirkovský" <l.jirkovsky@gmail.com> wrote:
>>
>> Hello,
>> before submitting bug report I want to make sure this isn't feature.
>> My problem is that my /tmp folder is no longer cleaned up during boot.
>> Now I have to do that manually which is really annoying.
>>
>> I dug through the git of initscripts and it seems to be caused by the
>> replacement of the original code by the systemd-tmpfiles tool. I've
>> just tried to run systemd-tmpfiles manually and it seems that it is
>> not able to do even a simple task such as rm -rf /tmp/*.
>
> There was a slight change in behavior. Earlier we would delete all files at
> boot, now we (or rather systemd-tmpfiles on our behalf) delete all 'old
> files'. That is, all files that have not been accessed within the last then
> days.
>
> This behavior is configured in /usr/lib/tmpfiles.d/tmp.conf. To change the
> behavior, copy the file to /etc/tmpfiles.d/ and edit it there. You can
> easily configure it to get the old behavior back.
>
> Alternatively, you could put /tmp on a tmpfs, to throw away all contents on
> reboot; or create a cron job that calls systemd-tmpfiles regularly (say
> once a day) to also delete old files at runtime, rather than only at boot.
>
> Check 'man tmpfiles.d' for more details.
>
> Cheers,
>
> Tom

Already did that. I changed the config to:
d /tmp 1777 root root 0d
d /var/tmp 1777 root root 0d

but it doesn't clean anything.
 
Old 06-20-2012, 04:47 PM
Tom Gundersen
 
Default tmp files no longer removed

On Jun 20, 2012 6:32 PM, "Lukáš Jirkovský" <l.jirkovsky@gmail.com> wrote:
>
> On 20 June 2012 18:28, Tom Gundersen <teg@jklm.no> wrote:
> > On Jun 20, 2012 6:05 PM, "Lukáš Jirkovský" <l.jirkovsky@gmail.com>
wrote:
> >>
> >> Hello,
> >> before submitting bug report I want to make sure this isn't feature.
> >> My problem is that my /tmp folder is no longer cleaned up during boot.
> >> Now I have to do that manually which is really annoying.
> >>
> >> I dug through the git of initscripts and it seems to be caused by the
> >> replacement of the original code by the systemd-tmpfiles tool. I've
> >> just tried to run systemd-tmpfiles manually and it seems that it is
> >> not able to do even a simple task such as rm -rf /tmp/*.
> >
> > There was a slight change in behavior. Earlier we would delete all
files at
> > boot, now we (or rather systemd-tmpfiles on our behalf) delete all 'old
> > files'. That is, all files that have not been accessed within the last
then
> > days.
> >
> > This behavior is configured in /usr/lib/tmpfiles.d/tmp.conf. To change
the
> > behavior, copy the file to /etc/tmpfiles.d/ and edit it there. You can
> > easily configure it to get the old behavior back.
> >
> > Alternatively, you could put /tmp on a tmpfs, to throw away all
contents on
> > reboot; or create a cron job that calls systemd-tmpfiles regularly (say
> > once a day) to also delete old files at runtime, rather than only at
boot.
> >
> > Check 'man tmpfiles.d' for more details.
> >
> > Cheers,
> >
> > Tom
>
> Already did that. I changed the config to:
> d /tmp 1777 root root 0d
> d /var/tmp 1777 root root 0d

Looks like a bug, if you create a bug report I'll look into it.

That said, I think you want to use 'D' rather than 'd' (check the man
page). Alternatively, you can specify an age in milliseconds, rather than
days...

Tom
 
Old 06-20-2012, 04:47 PM
Lukáš Jirkovský
 
Default tmp files no longer removed

On 20 June 2012 18:32, Lukáš Jirkovský <l.jirkovsky@gmail.com> wrote:
> On 20 June 2012 18:28, Tom Gundersen <teg@jklm.no> wrote:
>> On Jun 20, 2012 6:05 PM, "Lukáš Jirkovský" <l.jirkovsky@gmail.com> wrote:
>>>
>>> Hello,
>>> before submitting bug report I want to make sure this isn't feature.
>>> My problem is that my /tmp folder is no longer cleaned up during boot.
>>> Now I have to do that manually which is really annoying.
>>>
>>> I dug through the git of initscripts and it seems to be caused by the
>>> replacement of the original code by the systemd-tmpfiles tool. I've
>>> just tried to run systemd-tmpfiles manually and it seems that it is
>>> not able to do even a simple task such as rm -rf /tmp/*.
>>
>> There was a slight change in behavior. Earlier we would delete all files at
>> boot, now we (or rather systemd-tmpfiles on our behalf) delete all 'old
>> files'. That is, all files that have not been accessed within the last then
>> days.
>>
>> This behavior is configured in /usr/lib/tmpfiles.d/tmp.conf. To change the
>> behavior, copy the file to /etc/tmpfiles.d/ and edit it there. You can
>> easily configure it to get the old behavior back.
>>
>> Alternatively, you could put /tmp on a tmpfs, to throw away all contents on
>> reboot; or create a cron job that calls systemd-tmpfiles regularly (say
>> once a day) to also delete old files at runtime, rather than only at boot.
>>
>> Check 'man tmpfiles.d' for more details.
>>
>> Cheers,
>>
>> Tom
>
> Already did that. I changed the config to:
> d /tmp 1777 root root 0d
> d /var/tmp 1777 root root 0d
>
> but it doesn't clean anything.

I finally achieved the desired result by using
R /tmp/*
d /tmp 1777 root root 0d
d /var/tmp 1777 root root 0d

However the cleanup functionality seems to be broken – even if I
selected 0d, 1s or any similar short interval, the systemd-tmpfiles
didn't clean the /tmp. And even it did nothing, it still took about a
second to finish.

Lukas
 
Old 06-20-2012, 05:04 PM
Lukáš Jirkovský
 
Default tmp files no longer removed

On 20 June 2012 18:47, Tom Gundersen <teg@jklm.no> wrote:
>
> Looks like a bug, if you create a bug report I'll look into it.

Done, it's FS#30384

> That said, I think you want to use 'D' rather than 'd' (check the man
> page). Alternatively, you can specify an age in milliseconds, rather than
> days...

Thanks, this works too. And it's probably cleaner than using 'R'.

Lukas
 
Old 06-20-2012, 06:09 PM
Kevin Chadwick
 
Default tmp files no longer removed

> I've
> just tried to run systemd-tmpfiles manually and it seems that it is
> not able to do even a simple task such as rm -rf /tmp/*.

For my own understanding is it possible to add an exec line to these
systemd files like for the inittab replacements getty.service so that
you can add anything you like such as /bin/rm -R /tmp/.* /tmp/* to any
systemd unit. I know the systemd author wants rid of shell altogether
but I'm pretty confident and hoping that will never be allowed to
happen.

I like the goal of cross platform and eventually a single gui tool
(arches simple list is far better though) but the full systemd such as
fedora uses certainly seems a chore and non intuitive on the console
compared to /etc/inittab editing.


__________________________________________________ ______

Why not do something good every day and install BOINC.
__________________________________________________ ______
 
Old 06-21-2012, 12:46 AM
David Benfell
 
Default tmp files no longer removed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/20/12 09:15, Klaus wrote:
>
> Is there a line like "tmpfs /tmp tmpfs nodev,nosuid 0 0" which
> creates a ramdisk and mounts it on /tmp. I think that is the
> standard configuration of Arch Linux.

I believe this is correct. However, I would point out that I had to
disable tmpfs on my Linode because it was taking too much memory. The
ability to clean /tmp at boot should probably be preserved.

- --
David Benfell
benfell@parts-unknown.org


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP4m7dAAoJELT202JKF+xpwD8P/3PsPV1z6szEDV3n5qim1k2L
Q9T8ZeCm2yzhdt53Jd7qD5nRsLH8PICHRwo7mQ5VYHLLjHqpwi IWjli+vbhnGTF3
/E71OBLQhel1+9bQXFOgGDxilTkh0D4gxV0az7mGvAnHUg/QZ9Pu0TcVWoyv2zao
fxAXMJV2ktyM71rQK5mz4dmYHX6gM5/lOUZpmGUO9fP5cDzDKj+eWT6UgHkFljq+
830YyBj7qfRL2ugLMKz5tPvjxugULDG7oOEhoWQ7kouEXRqEfE ZtAgUFT1hOUUpV
mPHLXuyGFDXHWN19AVfXmFbysfsRtkq2oFU5hu9cCy7BKo0o3Y JZ/1A/+LaZV6oG
8zYvm4mbl91OsCnfSv7keWUinfVvJf1RgeZI5HFP36O5Vi0WwH/VNM5lQxlWLDcP
NxFBgaCYef9/4Ivhrz32kVOUyn3dsZR7xVMD2/eUNZgz9QqgeGUeri/Ov7m/RS9b
aYZUFOeMlMMZEDTRHqgwT8+9VN85mAJt8+Se2JzuzffjIt75dC UWImx5kQD+V7pf
QbRwuALGgE6MTsMVi0p3Ho4FkXgaKisMJYA6Qxg14GcxItFDK3 k4iSk0KNH11j3Q
YKppEfP5R+NNU52oLyy5Frsfr84Dy+D7jmRBceCBwDGEYJzJvR HlzCGT3ZppAIjD
p+IOPObrSMiJJoG2PSyx
=uOvd
-----END PGP SIGNATURE-----
 
Old 06-21-2012, 09:11 AM
Kevin Chadwick
 
Default tmp files no longer removed

> I believe this is correct. However, I would point out that I had to
> disable tmpfs on my Linode because it was taking too much memory.

What are you doing that uses so much memory? I enable a small memory
filesystem that doesn't grow for /tmp on my web servers. You just have
to configure the cleanup (and security) routines.

> The
> ability to clean /tmp at boot should probably be preserved.

The ability I would certainly agree with but has it been removed?
Is the question, Where is the best place to add /bin/rm to init
nowadays?


__________________________________________________ ______

Why not do something good every day and install BOINC.
__________________________________________________ ______
 
Old 06-21-2012, 09:20 AM
David Benfell
 
Default tmp files no longer removed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/21/12 02:11, Kevin Chadwick wrote:
>
> The ability I would certainly agree with but has it been removed?
> Is the question, Where is the best place to add /bin/rm to init
> nowadays?
>
Elsewhere in this thread, someone mentions tmpfiles.d.

There is a configuration file in /usr/lib/tmpfiles.d named tmp.conf
which can be copied to /etc/conf.d and modified as needed.

- From what I've been able to piece together, one can then run
"systemd-tmpfiles --clean" in a cron job. But in a Linode with both
limited memory and limited disk, this seems like a really good idea.

It's hard to tell if this actually works from a directory listing
because unless you specify the right options, it won't tell you the
last date since any of these files have been accessed.

- --
David Benfell
benfell@parts-unknown.org


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP4ud4AAoJELT202JKF+xp1DgQAKv1Rv4uXe 7Ro+HEvrIE5vdk
WjZUaBKzDkbFuSe3yYkcKZv0y9iBlDX3gI+67sDdr7C4pSTnJP EVbfqdl1BPFPQW
X/qS6u4LPvLXByAnnO7lnz8FgJjSEdy21EdAf5xrfIA73FP4T1nO ra9VEIJ5JUHn
IDUFLSw0avMCK/0SZBsO4AY8ZaG9MpU51/SW7ckC6JUkngdxC0nyk3oSGokYhmhX
D0YSHXn/c12jxUA4j4LrZyfomGNk2RKjnrHOUUKuamGatONk87wsKhHmTj UDnIZN
EnATwRNPyrXTpLzSm/inYxfgUeotFtcIq1d4PkdQKvAF3H11By0hmqQqx8tNyBbr
0KKNA1y/cxE/nAAefeshdKhLWZhqz7zpcrrIMtuke9hgq+VWKCtJoyVGJuy/mjBU
LzrPsWJ7PhN2ozMAVyF5cKP3gyKwmTKO5q3qL+aFeE5DaXpiVc QbQv5eBF1PxHv1
PG3JYOiJOXFIzkKF3f5fOvAH8Q8pMSnKICu58y5MuZog2I9SX9 8bCifrl8cxkzX4
g9XkeqvRQQdDVG6Sr7S007If//hx2Gds+t3X3k4lCEk3+v5f8dkYPqKs0XBnt37G
3lFi+ORrMdCmsRF1mFboA1ODc2F1nrotXu/njM3GXkxUmlXcqD0wnlb5LS+D+nE5
SkcJ7RL82KOz8YEzrQT1
=qGTU
-----END PGP SIGNATURE-----
 
Old 06-21-2012, 11:13 AM
Kevin Chadwick
 
Default tmp files no longer removed

> There is a configuration file in /usr/lib/tmpfiles.d named tmp.conf
> which can be copied to /etc/conf.d and modified as needed.
>

I meant a place for any shell incarnation though not a rigid??
pre-ordained facility.

> - From what I've been able to piece together, one can then run
> "systemd-tmpfiles --clean" in a cron job. But in a Linode with both
> limited memory and limited disk, this seems like a really good idea.

That would depend on the application though, the tmp files may vary in
lifetime etc.. You can always add shell to cron of course in that case
or use php or apache facilities for example.

__________________________________________________ ______

Why not do something good every day and install BOINC.
__________________________________________________ ______
 
Old 06-21-2012, 11:19 PM
Tom Gundersen
 
Default tmp files no longer removed

On Jun 21, 2012 1:16 PM, "Kevin Chadwick" <ma1l1ists@yahoo.co.uk> wrote:
> > There is a configuration file in /usr/lib/tmpfiles.d named tmp.conf
> > which can be copied to /etc/conf.d and modified as needed.
>
> I meant a place for any shell incarnation though not a rigid??
> pre-ordained facility.

Nothing has changed in this respect. If you want to add your own stuff to
the initscripts it should be done by using our hooks system or
/etc/rc.local. For the record, editing rc.sysinit directly itself is
probably not a good idea as it will be overwritten on upgrade.

-t
 

Thread Tools




All times are GMT. The time now is 12:55 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org