You are not logged in.

#1 2012-10-13 23:36:41

toothandnail
Member
From: Oxfordshire, UK
Registered: 2012-05-05
Posts: 88

[Solved] /tmp under systemd

I use MC a lot with large archive files. As a result, I've found that I need /tmp as physical hard drive space - otherwise MC keeps running out of space to extract archive contents to.

I edited /etc/fstab, commented out the tmpfs        /tmp    tmpfs    nodev,nosuid    0    0 line. Which worked fine until I converted the machine to systemd. Now, looking at the journal, I get this:

Oct 13 22:05:33 sirius systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway. (To see the over-mounted files, please manually mount the underlying file system to a secondary l
Oct 13 22:05:33 sirius systemd[1]: Starting Load Random Seed...
Oct 13 22:05:33 sirius systemd[1]: Mounted Temporary Directory.

Sure enough, if I run mount, I get this:

tmpfs on /tmp type tmpfs (rw)

I must have missed something, but can someone tell me how to get /tmp left as part of the hard drive?

Paul.

Last edited by toothandnail (2012-10-15 14:08:25)

Offline

#2 2012-10-13 23:39:17

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] /tmp under systemd

/usr/lib/tmpfiles.d/tmp.conf

Offline

#3 2012-10-14 03:22:00

toothandnail
Member
From: Oxfordshire, UK
Registered: 2012-05-05
Posts: 88

Re: [Solved] /tmp under systemd

WonderWoofy wrote:

/usr/lib/tmpfiles.d/tmp.conf

Thanks. Read that (and the associated man page), but it doesn't help much so far as I can see.

After a bit more digging, I found /usr/lib/systemd/system/tmp.mount, which looks like its the culprit:

[Unit]
Description=Temporary Directory
Documentation=man:hier(7)
Before=local-fs.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime

Trouble is, so far, I've not worked out how to override it, or even if its possible. I guess I could edit it, if necessary, but I really don't like that idea - any changes I make would be overwritten on the next systemd update, not to mention I don't really know what changes would be necessary to make it do what I want.

More reading is necessary, I guess....

Paul.

Offline

#4 2012-10-14 03:31:45

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] /tmp under systemd

Well, you could mask tmp.mount.  But I am pretty sure systemd-tmpfiles would still want to clear out the now non-tmpfile after 10 days. 

BTW, you are right, that tmpfiles.d file is just there to make sure that the directory is cleaned every 10 days.

Offline

#5 2012-10-14 03:34:04

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: [Solved] /tmp under systemd

Copy it to /etc/systemd/system, and edit that instead. This won't be overwritten, and will override the stock file.

Or in this case, since you just want to disable it, you might try "systemctl mask tmp.mount", which creates a symlink of that name in /etc/systemd/system which points to /dev/null.

Offline

#6 2012-10-15 14:06:34

toothandnail
Member
From: Oxfordshire, UK
Registered: 2012-05-05
Posts: 88

Re: [Solved] /tmp under systemd

WonderWoofy wrote:

Well, you could mask tmp.mount.  But I am pretty sure systemd-tmpfiles would still want to clear out the now non-tmpfile after 10 days.

Thanks. I'm finding the systemd docs less than crystal clear - hadn't even seen the 'mask' command. That did it...

BTW, you are right, that tmpfiles.d file is just there to make sure that the directory is cleaned every 10 days.

smile That is something I'll need, since /tmp is no longer on volatile media. I was looking at installing tmpreaper, but I'll see what systemd does.

Paul.

Offline

#7 2012-10-15 14:07:35

toothandnail
Member
From: Oxfordshire, UK
Registered: 2012-05-05
Posts: 88

Re: [Solved] /tmp under systemd

ataraxia wrote:

Copy it to /etc/systemd/system, and edit that instead. This won't be overwritten, and will override the stock file.

Useful to know, though in this instance, I'm not at all sure what edit would work.

Or in this case, since you just want to disable it, you might try "systemctl mask tmp.mount", which creates a symlink of that name in /etc/systemd/system which points to /dev/null.

That did it. Thanks.

Paul.

Offline

#8 2013-02-15 07:56:10

quite
Member
Registered: 2013-02-15
Posts: 24

Re: [Solved] /tmp under systemd

I tried out the masking, but ended up with booting troubles. Lots of messages which I cannot remember, but to the effect that root / was read-only. Probably systemd (?) scripts relying on /tmp being writable (as it would have, had it been on tmpfs), even though root has not yet been remounted as rw. Could that be...

Last edited by quite (2013-02-15 07:56:40)

Offline

#9 2014-08-26 18:55:30

lava
Member
From: /belarus/minsk
Registered: 2010-12-06
Posts: 6

Re: [Solved] /tmp under systemd

In case if anyone interested, I've met the behavior described by quite. The reason was that I've masked tmpfs with systemctl but left the entry in /etc/fstab. After removing /tmp from fstab the issue disappeared.

Offline

Board footer

Powered by FluxBB