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.
06-20-2012, 04:47 PM
Tom Gundersen
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
06-20-2012, 04:47 PM
Lukáš Jirkovský
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
06-20-2012, 05:04 PM
Lukáš Jirkovský
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
06-20-2012, 06:09 PM
Kevin Chadwick
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.
__________________________________________________ ______
06-21-2012, 12:46 AM
David Benfell
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/
> 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.
__________________________________________________ ______
06-21-2012, 09:20 AM
David Benfell
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/
> 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.
__________________________________________________ ______
06-21-2012, 11:19 PM
Tom Gundersen
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.