You are not logged in.

#1 2011-09-20 12:47:40

jorge.costa
Member
From: UK
Registered: 2010-02-18
Posts: 24
Website

[SOLVED] /tmp files removed at boot

Hi there,

I had been using /tmp as a tmpfs for a while, however I've lost precious work files on a couple of occasions - mostly because I'm stupid - by rebooting the laptop, prior to saving those files.

Now, after losing 6 hours work again I've decided to move /tmp out of tmpfs and just leave it as part of the / filesystems.
However it seems that arch likes to clean /tmp on boot, I've grep'ed and re'gredp around /etc and I can't find any entry that removes /tmp files on boot or shutdown.
Does anyone know where is this done ?

$ sudo pacman -Q | grep initscripts
initscripts 2011.07.3-1

Last edited by jorge.costa (2011-09-20 13:06:22)

Offline

#2 2011-09-20 12:51:36

jorge.costa
Member
From: UK
Registered: 2010-02-18
Posts: 24
Website

Re: [SOLVED] /tmp files removed at boot

got it :
/usr/lib/tmpfiles.d/arch.conf

Offline

#3 2011-09-20 13:04:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] /tmp files removed at boot

Or place your files in /var/tmp that's not getting cleaned at boot.
https://bbs.archlinux.org/viewtopic.php?id=126325

Last edited by karol (2011-09-20 13:05:37)

Offline

#4 2011-09-20 13:58:35

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,109
Website

Re: [SOLVED] /tmp files removed at boot

Fix the problem where it exists, don't hack around it. /usr/lib/tmpfiles.d is not under your control and it will be overwritten on initscripts upgrade. If you want to use this broken solution, override arch.conf in /etc/tmpfiles.d/arch.conf. It's important that the file have the same name.

Offline

#5 2011-09-21 07:31:04

jorge.costa
Member
From: UK
Registered: 2010-02-18
Posts: 24
Website

Re: [SOLVED] /tmp files removed at boot

/etc/tmpfiles.d/arch.conf doesn't exist, what should it contain ?

and what's its purpose ?

Offline

#6 2011-09-21 07:37:22

jorge.costa
Member
From: UK
Registered: 2010-02-18
Posts: 24
Website

Re: [SOLVED] /tmp files removed at boot

hold on, found a scroogle post about it,
http://mailman.archlinux.org/pipermail/ … 01577.html

its something fairly new,

+_x() {
+    # Ignore a path during cleaning. Use this type to exclude paths from clean-up as
+    # controlled with the Age parameter. Note that lines of this type do not
+    # influence the effect of r or R lines. Lines of this type accept shell-style
+    # globs in place of of normal path names.
+    :
+    # XXX: we don't implement this

*worried about that last XXX

+++ b/tmpfiles.conf
@@ -0,0 +1,20 @@
+#
+# /usr/lib/tmpfiles.d/arch.conf
+#
+
+d /tmp/.X11-unix 1777 root root 10d
+d /tmp/.ICE-unix 1777 root root 10d
+d /tmp/.XIM-unix 1777 root root 10d
+d /tmp/.font-unix 1777 root root 10d
+d /tmp/.Test-unix 1777 root root 10d
+
+f /var/run/tmp 0664 - utmp
+
+r /tmp/.X[0-9]-lock
+r /etc/nologin
+r /etc/shutdownpid
+r /forcefsck
+
+D /tmp/
+D /var/run/daemons
+

trying it with:
cat /etc/tmpfiles.d/arch.conf
#
### FILE FORMAT ###
# XXX: We ignore the final 'Age' parameter
# 0    1              2    3    4    5
# Type Path           Mode UID  GID  Age
# d    /run/user      0755 root root 10d

x /tmp/

Offline

#7 2011-09-21 07:40:03

jorge.costa
Member
From: UK
Registered: 2010-02-18
Posts: 24
Website

Re: [SOLVED] /tmp files removed at boot

seems to work

thankz falconindy

Offline

#8 2011-09-21 11:42:28

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,917

Re: [SOLVED] /tmp files removed at boot

Much better solution imo: use $HOME/tmp instead of messing around in /
(added advantage of no risc of messing up your system by filling up / by accident)

/tmp and friends are really ment to be TEmPorary, so just don't put anything you want to keep in it.


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB