Re: how to automatically clean /tmp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2016-01-27 at 20:29 +0100, Walter Cazzola wrote:
> Dear Linux Experts,
> 
> I've recently passed from Fedora 20 to Fedora 23 on my laptop.
> 
> I've a separate partition for /tmp that I'm used to see it wiped out
> at
> any reboot on my previous installation but now this is never wiped
> out.
> 
> This is a real partition:
> 
>    /dev/sda10       5029504   1154204   3596772  25% /tmp
> 
> whereas previously it was a tmpfs partition. I've read on the web
> that
> after Fedora 20 the tmpfs has been dropped in favor of real partition
> but I was expecting anacron/cron entry that wipe the content of the
> partition at boot but my system doesn't have any.
> 
> It is also difficult to create my own anacron/cron entry because this
> should take effect before the system starts and create its temp
> files/sockets in there.
> 
> I'm also puzzled because I also have a couple of tmpfs partitions:
> 
>    tmpfs            1633640         0   1633640   0% /run/user/989
>    tmpfs            1633640        16   1633624   1% /run/user/526
> 
> that I don't what they are for and if I can (and how) rid of them.
> 
> Probably I could add an entry like this
>    tmpfs                   /tmp            tmpfs           rw,seclabe
> l 0 0
> 
> in /etc/fstab but this would means a waste of the space I currently
> have
> reserved for /tmp (4Gb not much but I would prefer to use them).
> 
> So there is a way to wipe out the /tmp partition before it has been
> mounted and the system creates its files and use the current
> partition
> for it?


I did a fully default install in a Virtualbox using:
Fedora-Workstation-netinst-x86_64-23.iso

That install did use tmpfs for /tmp as seen below.

[root@localhost temp03]# df
Filesystem              1K-blocks    Used Available Use% Mounted on
devtmpfs                  1014436       0   1014436   0% /dev
tmpfs                     1024720     308   1024412   1% /dev/shm
tmpfs                     1024720    1184   1023536   1% /run
tmpfs                     1024720       0   1024720   0% /sys/fs/cgroup
/dev/mapper/fedora-root  10504444 5544500   4403300  56% /
tmpfs                     1024720      48   1024672   1% /tmp
/dev/sda1                  487652  243549    214407  54% /boot
tmpfs                      204944      36    204908   1% /run/user/1000
[root@localhost temp03]# uname -a
Linux localhost.localdomain 4.2.8-300.fc23.x86_64 #1 SMP Tue Dec 15
16:49:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost temp03]# cat /etc/fedora-release 
Fedora release 23 (Twenty Three)


If tmpfs is still the standard then that should explain why it is not
cleaning it.  As for how to run a shutdown version of rc.local it looks
like it is pretty well expained in the first few hits using:

fedora run script at shutdown

Looks like you just create your own script (could call it
rc.local.shutdown) and wrap it into a new systemd service.


-- 
Doug H.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux