Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How prevent systemd from mounting /tmp as tmpfs?

1,086 views
Skip to first unread message

William Unruh

unread,
Nov 30, 2014, 12:59:53 PM11/30/14
to
How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
file to be on a disk. I want to be able to assume that the contents of
/tmp will survive reboot. I can clean out /tmp every once in while
myself. It used to be that the mounting of /tmp as tmpfs was in
/etc/fstab. That has disappeared in Mageia 4.1. It is now done
automatically which is stupid.

Bit Twister

unread,
Nov 30, 2014, 1:11:12 PM11/30/14
to
On Sun, 30 Nov 2014 17:59:36 +0000 (UTC), William Unruh wrote:
> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
> file to be on a disk. I want to be able to assume that the contents of
> /tmp will survive reboot.

Heheh, you need to embrace the new borg methodology.

I believe /var/tmp will survive reboot.

Personally I want all tmp work in the user's ~/tmp directory.
That keeps mine pretty clean

$ ls -Al /tmp
total 4
drwxr-xr-x 2 pulse pulse 60 Nov 29 23:12 .esd-91
drwxrwxrwt 2 root root 40 Nov 29 23:12 .font-unix
drwxrwxrwt 2 root root 60 Nov 29 23:13 .ICE-unix
drwx------ 2 pulse pulse 40 Nov 29 23:12 .orc
drwxrwxrwt 2 root root 40 Nov 29 23:12 .Test-unix
-r--r--r-- 1 root bittwister 11 Nov 29 23:13 .X0-lock
drwxrwxrwt 2 root root 60 Nov 29 23:13 .X11-unix
drwxrwxrwt 2 root root 40 Nov 29 23:12 .XIM-unix

$ ls -Al /var/tmp
total 4
drwx------ 4 root root 4096 Nov 30 03:06 kdecache-root

For all my local custom stuff, I have that in /local/tmp

To force user's /tmp usage I set global variables as part of their login.

$ grep tmp /etc/profile.d/xx_local.sh
export TMPDIR=$HOME/tmp
export TMP=$TMPDIR
export TEMP=$TMPDIR
export GCONF_TMPDIR=$TMPDIR
export KDETMP=$TMPDIR
export KDEVARTMP=$TMPDIR
mkdir -p $TMPDIR

Richard Kettlewell

unread,
Nov 30, 2014, 1:15:12 PM11/30/14
to
Bit Twister <BitTw...@mouse-potato.com> writes:
> On Sun, 30 Nov 2014 17:59:36 +0000 (UTC), William Unruh wrote:
>> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
>> file to be on a disk. I want to be able to assume that the contents
>> of /tmp will survive reboot.
>
> Heheh, you need to embrace the new borg methodology.

Or you could disable the relevant unit (tmp.mount in Debian, no idea if
it’s the same in Mageia).

--
http://www.greenend.org.uk/rjk/

Bit Twister

unread,
Nov 30, 2014, 1:23:55 PM11/30/14
to
Yeah, systemd is a bit different.
$ uservers tmp
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of Temporary Directories
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-update-utmp-runlevel.service loaded inactive dead Update UTMP about System Runlevel Changes
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown

William Unruh

unread,
Nov 30, 2014, 2:08:53 PM11/30/14
to
On 2014-11-30, Richard Kettlewell <r...@greenend.org.uk> wrote:
> Bit Twister <BitTw...@mouse-potato.com> writes:
>> On Sun, 30 Nov 2014 17:59:36 +0000 (UTC), William Unruh wrote:
>>> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
>>> file to be on a disk. I want to be able to assume that the contents
>>> of /tmp will survive reboot.
>>
>> Heheh, you need to embrace the new borg methodology.
>
> Or you could disable the relevant unit (tmp.mount in Debian, no idea if
> it???s the same in Mageia).

I tried systemctl disable tmp.mount
but all I got in the journalctl -a logs was that systemd restarting. and
a message about and invalic cgroup.
(Yes, /usr/lib/systemd/system/tmp.mount does exist, but it seems that
diabling it triggers some king of crash of systemd.)
Note that after I did that I tried to reboot twice. It made no
difference-- tmp was still tmpfs

>

William Unruh

unread,
Nov 30, 2014, 3:16:29 PM11/30/14
to
On 2014-11-30, Richard Kettlewell <r...@greenend.org.uk> wrote:
> Bit Twister <BitTw...@mouse-potato.com> writes:
>> On Sun, 30 Nov 2014 17:59:36 +0000 (UTC), William Unruh wrote:
>>> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
>>> file to be on a disk. I want to be able to assume that the contents
>>> of /tmp will survive reboot.
>>
>> Heheh, you need to embrace the new borg methodology.
>
> Or you could disable the relevant unit (tmp.mount in Debian, no idea if
> it???s the same in Mageia).

systemctl disable tmp.mount
does not work. It simply initiates a restart of systemd
I finally moved /usr/lib/systemd/system/tmp.{mount,mounnnttt}
and that worked. /tmp is now a regular directory in /

Of course what happens when an update for systemd arrives, I do not
know, but probably it will be replaced.



>

Chris Ahlstrom

unread,
Nov 30, 2014, 4:17:43 PM11/30/14
to
William Unruh wrote this copyrighted missive and expects royalties:
You might want to ping the systemd guys (and hope they treat your
respectfully).

--
... relaxed in the manner of a man who has no need to put up a front of
any kind.
-- John Ball, "Mark One: the Dummy"

Bit Twister

unread,
Nov 30, 2014, 4:18:07 PM11/30/14
to
On Sun, 30 Nov 2014 20:16:12 +0000 (UTC), William Unruh wrote:

> I finally moved /usr/lib/systemd/system/tmp.{mount,mounnnttt}
> and that worked. /tmp is now a regular directory in /
>
> Of course what happens when an update for systemd arrives, I do not
> know, but probably it will be replaced.

Yup. instead of removing anything all you need to do is
systemctl disable whatever_u_.removed
if you do not want it starting on next boot.

I have two scripts, enable_servers and disable_servers.

Might not hurt for you to run "man systemctl"

William Unruh

unread,
Nov 30, 2014, 5:23:16 PM11/30/14
to
As I said, I tried
systemctl disable tmp.mount
All that happened was in the journalctl logs I got two lines saying
systemd[1]: Reloading
systemd[1] [/usr/lib/systemd/system/rtkit-daemon.service:32] Unknown
lvalue 'ControlGroup' in section 'Service'.

And when I rebooted, tmp was again mounted as tmpfs

I then tried the above again, rebooted and again the above was all that
happened.

It was only be renaming /usr/lib/systemd/system/tmp.mount that I was
able to get the system to NOT mount a tmpfs /tmp

So, any other suggestions?

And exactly which part of man systemctl are you advising me to read that
might help with this problem?

Since you apparently know systemd, what exactly is
systemd disable tmp.mount
supposed to do. It clearly is supposed to change some file or files to let systemd
know not to user tmp.mount next time. But what exactly are the files
that are changed, and what are the changes to those files?





>

David W. Hodgins

unread,
Nov 30, 2014, 5:24:34 PM11/30/14
to
On Sun, 30 Nov 2014 12:59:36 -0500, William Unruh <un...@invalid.ca> wrote:

> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
> file to be on a disk. I want to be able to assume that the contents of

[dave@hodgins ~]$ df|grep /tmp
/dev/mapper/bk-tmp 3.9G 8.3M 3.6G 1% /tmp
[dave@hodgins ~]$ grep /tmp /etc/fstab
/dev/mapper/bk-tmp /tmp ext4 acl,commit=0,user_xattr 1 2

If /tmp has an entry in /etc/fstab, then systemd will not mount it as a
tmpfs filesystem.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

Bit Twister

unread,
Nov 30, 2014, 5:58:18 PM11/30/14
to
On Sun, 30 Nov 2014 22:22:59 +0000 (UTC), William Unruh wrote:

> As I said, I tried
> systemctl disable tmp.mount

Sorry about that, I need to go back through speed reading 101.

All I was trying to suggest is, you do not usually remove files in
systemd directories.

> Since you apparently know systemd,

Not really, I know just enough to be dangerous to myself.

> what exactly is systemd disable tmp.mount supposed to do. It clearly
> is supposed to change some file or files to let systemd know not to
> user tmp.mount next time.
> But what exactly are the files
> that are changed, and what are the changes to those files?

Nothing is changed in files.

The enable/disable commands create/delete links.

Example:

# systemctl disable mysqld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/mysqld.service.

# systemctl enable mysqld.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mysqld.service to /usr/lib/systemd/system/mysqld.service.

If you have it installed, running systemadm as root will make doing
research easier when trying to figure out what runs before/after an item.

PS: when running systemadm you need to use the mouse to drag the bottom of
the white area up to see more information about a selected item you
have clicked.

systemadm is in the systemd-ui rpm.

William Unruh

unread,
Nov 30, 2014, 6:04:35 PM11/30/14
to
On 2014-11-30, David W. Hodgins <dwho...@nomail.afraid.org> wrote:
> On Sun, 30 Nov 2014 12:59:36 -0500, William Unruh <un...@invalid.ca> wrote:
>
>> How do I prevent systemd from mounting /tmp as tmpfs. I WANT my /tmp
>> file to be on a disk. I want to be able to assume that the contents of
>
> [dave@hodgins ~]$ df|grep /tmp
> /dev/mapper/bk-tmp 3.9G 8.3M 3.6G 1% /tmp
> [dave@hodgins ~]$ grep /tmp /etc/fstab
> /dev/mapper/bk-tmp /tmp ext4 acl,commit=0,user_xattr 1 2
>
> If /tmp has an entry in /etc/fstab, then systemd will not mount it as a
> tmpfs filesystem.

But I simply want it as a directory in /. I do not want to mount
anything on top of it. Unfortunately I do not think that there is any
"don't mount " commands what I can put into /etc/fstab/
I suppose I could try
/tmp /tmp none bind,nofail 0 0
but that just makes me shudder ( and I have no idea whether it would
work. It might just put my whole system into an eternal loop and
crash:-)

>
> Regards, Dave Hodgins
>

William Unruh

unread,
Nov 30, 2014, 6:38:59 PM11/30/14
to
On 2014-11-30, Bit Twister <BitTw...@mouse-potato.com> wrote:
> On Sun, 30 Nov 2014 22:22:59 +0000 (UTC), William Unruh wrote:
>
>> As I said, I tried
>> systemctl disable tmp.mount
>
> Sorry about that, I need to go back through speed reading 101.
>
> All I was trying to suggest is, you do not usually remove files in
> systemd directories.

As below, you remove links.

>
>> Since you apparently know systemd,
>
> Not really, I know just enough to be dangerous to myself.
>
>> what exactly is systemd disable tmp.mount supposed to do. It clearly
>> is supposed to change some file or files to let systemd know not to
>> user tmp.mount next time.
>> But what exactly are the files
>> that are changed, and what are the changes to those files?
>
> Nothing is changed in files.
>
> The enable/disable commands create/delete links.

Ahha.
I renamed it back to tmp.mount I run
systemctl enable tmp.mount
and I get an error message which says tmp.mount has no [Install}
secion.
I do find a link in systemd/system/local-fs.target.wants/tmp.mount
but it seems that it is impossible to disable this without manually
erasing that tmp.mount link.
If I do
systemctl disable tmp.mount
it give no error message or anything (even journalctl only give that
"Reload" message) but
it does NOT erase that link probably again because it has no idea where
that link is because it has no [Install].
Actually none of the .mount files have any [Install] section.

Is tmp.mount a Mageia addition, or is it part of systemd? If it is part
of Mageia addition, it seems that either they forgot to put an
[Install] stanza into the file, or they decided that noone should ever
want a real tmp/ directory.
From the lack in any of the .mount files, it seems it is systemd that is
acting like a petty dictator.

David W. Hodgins

unread,
Nov 30, 2014, 6:40:17 PM11/30/14
to
On Sun, 30 Nov 2014 18:04:19 -0500, William Unruh <un...@invalid.ca> wrote:

> But I simply want it as a directory in /. I do not want to mount
> anything on top of it. Unfortunately I do not think that there is any
> "don't mount " commands what I can put into /etc/fstab/
> I suppose I could try
> /tmp /tmp none bind,nofail 0 0

As root run "systemctl mask tmp.mount". The command systemctl status
tmp.mount prior to running the mask command will show it's a static,
i.e. builtin to systemd service, so just disableing it won't work, it
has to be masked to stop it from starting.

Bit Twister

unread,
Nov 30, 2014, 7:02:56 PM11/30/14
to
On Sun, 30 Nov 2014 23:38:43 +0000 (UTC), William Unruh wrote:
> On 2014-11-30, Bit Twister <BitTw...@mouse-potato.com> wrote:


> Is tmp.mount a Mageia addition, or is it part of systemd?

Not a clue on my part and I do not have a RedHat VM guest to check
against.


> If it is part of Mageia addition, it seems that either they forgot to put an
> [Install] stanza into the file, or they decided that noone should ever
> want a real tmp/ directory.

Heheh. Install VirtualBox, get a RedHat iso and you can find out. :-D

> From the lack in any of the .mount files, it seems it is systemd that is
> acting like a petty dictator.

I hear that. Putting aside Pottering and crew problems, you need to
keep in mind what the goal of the changes/application is trying to achieve.

You need to minimize the downtime of a virtual cloud server and reboot
time is a big chunk of the time. Those servers need to be fast so /tmp
in memory is an obvious default.

The other goal is to be able to reset a server to a known state which
means all the configurations in /etc need to go somewhere else when
systemd gets that "feature" working. :(

My recommendation is to quit fighting systemd's design and work with
it. I.E use /var/tmp for your temp work and if you need temp file
access speed use /tmp.

Aragorn

unread,
Nov 30, 2014, 7:06:58 PM11/30/14
to
On Monday 01 December 2014 01:02, Bit Twister conveyed the following to
alt.os.linux...

> Putting aside Pottering and crew problems [...]

I don't like the guy either, but his name /is/ correctly spelled
"Poettering", not "Pottering", with or without umlaut. :-)

--
= Aragorn =

http://www.linuxcounter.net - registrant #223157

Bit Twister

unread,
Nov 30, 2014, 7:23:41 PM11/30/14
to
On Mon, 01 Dec 2014 01:06:57 +0100, Aragorn wrote:
> On Monday 01 December 2014 01:02, Bit Twister conveyed the following to
> alt.os.linux...
>
>> Putting aside Pottering and crew problems [...]
>
> I don't like the guy either, but his name /is/ correctly spelled
> "Poettering", not "Pottering", with or without umlaut. :-)

Sorry, I was probably thinking Poettering and a chamber pot while typing. :)

William Unruh

unread,
Nov 30, 2014, 7:45:38 PM11/30/14
to
On 2014-11-30, David W. Hodgins <dwho...@nomail.afraid.org> wrote:
> On Sun, 30 Nov 2014 18:04:19 -0500, William Unruh <un...@invalid.ca> wrote:
>
>> But I simply want it as a directory in /. I do not want to mount
>> anything on top of it. Unfortunately I do not think that there is any
>> "don't mount " commands what I can put into /etc/fstab/
>> I suppose I could try
>> /tmp /tmp none bind,nofail 0 0
>
> As root run "systemctl mask tmp.mount". The command systemctl status
> tmp.mount prior to running the mask command will show it's a static,
> i.e. builtin to systemd service, so just disableing it won't work, it
> has to be masked to stop it from starting.

That also does not work. I get "file exists" error message.

I have now put in a copy of tmp.mount into /etc/systemd/system with an
[Install] section with WantedBy=local-fs.target
When I removed the current link from local-fs.targe.wants I could
thereafer run systemctl enable tmp.mount and systemctl disable tmp.mount
successfully.


>
> Regards, Dave Hodgins
>

Wildman

unread,
Nov 30, 2014, 8:13:24 PM11/30/14
to
That's probable more accurate than you think. After all
systemd is a turd. There is a rumor circulating that it
is nothing but a ported version of svchost.

--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!

William Unruh

unread,
Nov 30, 2014, 9:25:42 PM11/30/14
to
On 2014-12-01, William Unruh <un...@invalid.ca> wrote:
> On 2014-11-30, David W. Hodgins <dwho...@nomail.afraid.org> wrote:
>> On Sun, 30 Nov 2014 18:04:19 -0500, William Unruh <un...@invalid.ca> wrote:
>>
>>> But I simply want it as a directory in /. I do not want to mount
>>> anything on top of it. Unfortunately I do not think that there is any
>>> "don't mount " commands what I can put into /etc/fstab/
>>> I suppose I could try
>>> /tmp /tmp none bind,nofail 0 0
>>
>> As root run "systemctl mask tmp.mount". The command systemctl status
>> tmp.mount prior to running the mask command will show it's a static,
>> i.e. builtin to systemd service, so just disableing it won't work, it
>> has to be masked to stop it from starting.
>
> That also does not work. I get "file exists" error message.

And the reason it does not work is because I had already done the below,
ie placed a file into /etc/systemd/system/tmp.mount
It was THAT file which the "file exists" message referred to. It was
trying to put a link from /etc/systemd/system/tmp.mount to /dev/null.

Aragorn

unread,
Dec 1, 2014, 9:46:15 AM12/1/14
to
On Monday 01 December 2014 01:23, Bit Twister conveyed the following to
alt.os.linux...

> On Mon, 01 Dec 2014 01:06:57 +0100, Aragorn wrote:
>> On Monday 01 December 2014 01:02, Bit Twister conveyed the following
>> to alt.os.linux...
>>
>>> Putting aside Pottering and crew problems [...]
>>
>> I don't like the guy either, but his name /is/ correctly spelled
>> "Poettering", not "Pottering", with or without umlaut. :-)
>
> Sorry, I was probably thinking Poettering and a chamber pot while
> typing. :)

Well, I have no knowledge on whether he smokes pot or not, but I
wouldn't be surprised if he did, given his lack of touch with reality.
:p

Aragorn

unread,
Dec 1, 2014, 9:53:42 AM12/1/14
to
On Monday 01 December 2014 02:13, Wildman conveyed the following to
alt.os.linux...

> On Mon, 1 Dec 2014 00:23:24 +0000 (UTC)
> Bit Twister <BitTw...@mouse-potato.com> wrote:
>
>> On Mon, 01 Dec 2014 01:06:57 +0100, Aragorn wrote:
>>
>> > On Monday 01 December 2014 01:02, Bit Twister conveyed the
>> > following to alt.os.linux...
>> >
>> >> Putting aside Pottering and crew problems [...]
>> >
>> > I don't like the guy either, but his name /is/ correctly spelled
>> > "Poettering", not "Pottering", with or without umlaut. :-)
>>
>> Sorry, I was probably thinking Poettering and a chamber pot while
>> typing. :)
>
> That's probable more accurate than you think. After all
> systemd is a turd. There is a rumor circulating that it
> is nothing but a ported version of svchost.

Well, systemd certainly does have a huge impact on the FLOSS community.
For one, Debian has now officially been forked ─ as I understand it, the
fork is called Devuan, and makes use of a Devuan-specific port of eudev,
which is the udev fork created by Gentoo developers.

I'm not sure what they use as the actual init system yet ─ I've only
just read the official news and I still have to look into things ─ but
there's a good chance that it may end up being either Upstart or
Gentoo's OpenRC (which was already supported in Debian).

This is the way the world /should/ work; whenever a wannabe tyrant
stands up, the people should learn to say "No, go away, we don't want
you ruling our lives. We want to be free."

Society can learn a thing or two from FLOSS. ;-)

Wildman

unread,
Dec 1, 2014, 10:10:21 AM12/1/14
to
On Mon, 01 Dec 2014 15:53:41 +0100
Aragorn <thor...@telenet.be.invalid> wrote:

> On Monday 01 December 2014 02:13, Wildman conveyed the following to
> alt.os.linux...
>
> > On Mon, 1 Dec 2014 00:23:24 +0000 (UTC)
> > Bit Twister <BitTw...@mouse-potato.com> wrote:
> >
> >> On Mon, 01 Dec 2014 01:06:57 +0100, Aragorn wrote:
> >>
> >> > On Monday 01 December 2014 01:02, Bit Twister conveyed the
> >> > following to alt.os.linux...
> >> >
> >> >> Putting aside Pottering and crew problems [...]
> >> >
> >> > I don't like the guy either, but his name /is/ correctly spelled
> >> > "Poettering", not "Pottering", with or without umlaut. :-)
> >>
> >> Sorry, I was probably thinking Poettering and a chamber pot while
> >> typing. :)
> >
> > That's probable more accurate than you think. After all
> > systemd is a turd. There is a rumor circulating that it
> > is nothing but a ported version of svchost.
>
> Well, systemd certainly does have a huge impact on the FLOSS
> community. For one, Debian has now officially been forked ─ as I
> understand it, the fork is called Devuan, and makes use of a
> Devuan-specific port of eudev, which is the udev fork created by
> Gentoo developers.

May be of interest...

http://www.theregister.co.uk/2014/12/01/ttsystemdtt_row_ends_with_debian_getting_forked/

> I'm not sure what they use as the actual init system yet ─ I've only
> just read the official news and I still have to look into things ─
> but there's a good chance that it may end up being either Upstart or
> Gentoo's OpenRC (which was already supported in Debian).

Here is an interesting link posted by Big Bad Bob in alt.hacker...

http://www.zdnet.com/linus-torvalds-and-others-on-linuxs-systemd-7000033847/

> This is the way the world /should/ work; whenever a wannabe tyrant
> stands up, the people should learn to say "No, go away, we don't want
> you ruling our lives. We want to be free."

Well said.

> Society can learn a thing or two from FLOSS. ;-)
>

But they won't. :-(

Aragorn

unread,
Dec 1, 2014, 11:59:46 AM12/1/14
to
On Monday 01 December 2014 16:10, Wildman conveyed the following to
Yep, saw it earlier today, and I've already visited the Devuan website.
;-)

>> I'm not sure what they use as the actual init system yet ─ I've only
>> just read the official news and I still have to look into things ─
>> but there's a good chance that it may end up being either Upstart or
>> Gentoo's OpenRC (which was already supported in Debian).
>
> Here is an interesting link posted by Big Bad Bob in alt.hacker...
>
> http://www.zdnet.com/linus-torvalds-and-others-on-linuxs-
systemd-7000033847/

Saw that one too, albeit that I'm no fan of the opinions espoused at
ZDnet ─ they're a bit too /Microsofty/ for my taste.

>> This is the way the world /should/ work; whenever a wannabe tyrant
>> stands up, the people should learn to say "No, go away, we don't want
>> you ruling our lives. We want to be free."
>
> Well said.
>
>> Society can learn a thing or two from FLOSS. ;-)
>
> But they won't. :-(

Alas... :-/ Maybe we'll have to fork Earth? :p

Wildman

unread,
Dec 1, 2014, 12:48:06 PM12/1/14
to
On Mon, 01 Dec 2014 17:59:44 +0100
Aragorn <thor...@telenet.be.invalid> wrote:

> Alas... :-/ Maybe we'll have to fork Earth? :p

It has already been f... no wait. You said fork.
0 new messages