Bug#783509: systemd: /tmp purged on every reboot

2015-06-10 Thread Martin Pitt
Hello all,

Michael and I just discussed this. Our current patches are shaky at
best, and e. g. in the current 220-5 tmp.mount came back by default. I
committed another bandaid for that, but it's a disaster waiting to
happen.

So we agreed on the following:

 - Stop shipping /lib/systemd/system/tmp.mount
 - Ship it in /usr/share/systemd/ instead
 - On upgrade: if tmp.mount is enabled, copy tmp.mount from /usr/share
   to /etc/
   + Bonus (not required, but cleaner): update the enablement symlink
 accordingly
 - On new install: If RAMTMP==yes, copy tmp.mount from /usr/share and
   enable it
 - Update documentation about recommendation how to enable tmpfs /tmp:
   Add it to fstab, or do the copy/enable steps

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


signature.asc
Description: Digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Didier Roche

Le 28/04/2015 01:11, Michael Biebl a écrit :

Am 27.04.2015 um 21:56 schrieb Michael Biebl:

Ok, I can confirm that adding such a bind mount to /tmp activates
tmp.mount, even if tmp.mount has been disabled. Retitling the bug report
accordingly.

I can also confirm, that this is a regression from -12 to -13 by
installing those two versions from snapshot.d.o.

I did a test build with
debian/patches/PrivateTmp-shouldn-t-require-tmpfs.patch reverted, and
that seems indeed to fix this particular issue.
Interesting side-effect.

Didier, any idea?



It's a weird side-effect indeed. The patch only downgrades the 
relationship with this mount, which already exists in systemd mem. I 
have no immediate idea what's happening there and a quick look at the 
code this morning didn't help either.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Am 27.04.2015 um 21:56 schrieb Michael Biebl:
>> Ok, I can confirm that adding such a bind mount to /tmp activates
>> tmp.mount, even if tmp.mount has been disabled. Retitling the bug report
>> accordingly.
> 
> I can also confirm, that this is a regression from -12 to -13 by
> installing those two versions from snapshot.d.o.

I did a test build with
debian/patches/PrivateTmp-shouldn-t-require-tmpfs.patch reverted, and
that seems indeed to fix this particular issue.
Interesting side-effect.

Didier, any idea?

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Control: found -1 215-13

Am 27.04.2015 um 21:14 schrieb Michael Biebl:
> Control: tags -1 confirmed
> Control: retitle -1 tmp.mount activated accidentally via bind mount
> 
> Am 27.04.2015 um 20:30 schrieb Andreas Metzler:
>> On 2015-04-27 Michael Biebl  wrote:
>>> Who is creating those mounts? Maybe they didn't exist when you have -12
>>> installed? How are they created? Are those bind mounts (via fstab)?
>>
>> They have been setup (manually) in fstab:
>> /tmp /chroots/wheezy/tmpnonebind,auto 0  0
> 
> Ok, I can confirm that adding such a bind mount to /tmp activates
> tmp.mount, even if tmp.mount has been disabled. Retitling the bug report
> accordingly.

I can also confirm, that this is a regression from -12 to -13 by
installing those two versions from snapshot.d.o.

Updating the found version.



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Control: tags -1 confirmed
Control: retitle -1 tmp.mount activated accidentally via bind mount

Am 27.04.2015 um 20:30 schrieb Andreas Metzler:
> On 2015-04-27 Michael Biebl  wrote:
>> Who is creating those mounts? Maybe they didn't exist when you have -12
>> installed? How are they created? Are those bind mounts (via fstab)?
> 
> They have been setup (manually) in fstab:
> /tmp /chroots/wheezy/tmpnonebind,auto 0  0

Ok, I can confirm that adding such a bind mount to /tmp activates
tmp.mount, even if tmp.mount has been disabled. Retitling the bug report
accordingly.

Unless you actually want to use tmp-on-tmpfs, you can apply the
following workaround for the time being:

systemctl mask tmp.mount

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Am 27.04.2015 um 20:30 schrieb Andreas Metzler:
> On 2015-04-27 Michael Biebl  wrote:
>> So you're saying, with 215-12, tmp.mount was not automatically mounted?
> Yes, unless the logfile has suddenly increased in verbosity ATM. The
> "Mounting Temporary Directory..." message started appearing after that
> upgrade.

That's odd. As mentioned in my other email, the changes in 215-13 should
actually make it less likely that tmp.mount is activated by accident.
Anyway, I guess I have enough information now to reproduce the issue and
verify if we regressed somewhere.


That aside, if you have some RAM to spare, tmp-on-tmpfs is actually not
such a bad idea :-)



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Andreas Metzler
On 2015-04-27 Michael Biebl  wrote:
> Am 27.04.2015 um 19:15 schrieb Andreas Metzler:
>> On 2015-04-27 Michael Biebl  wrote:
[...]
>>> Or maybe, have you tmpfs-on-tmp enabled?

>> thanks for the help, that is exactly what seems to have happened:
[...]
>> ametzler@argenau:~$ mount | grep ' /tmp'
>> tmpfs on /tmp type tmpfs (rw)
>> ametzler@argenau:~$ systemctl list-dependencies --reverse tmp.mount
>> tmp.mount
>> ● ├─chroots-amd64\x2djessie-tmp.mount
>> ● ├─chroots-amd64\x2dwheezy-tmp.mount
>> ● ├─chroots-etch-tmp.mount
>> [...]
>> ● └─chroots-wheezy-tmp.mount
>> --

>> The reverse dependencies are just bind-mounts:
>> ametzler@argenau:~$ grep /wheezy.*tmp /etc/fstab
>> /tmp/chroots/wheezy/tmpnonebind,auto0   0

>> It looks like this started on April 5 (journalctl history goes back to
>> 2014):
[...]
>> /var/log/apt/history.log marks the upgrade to systemd 215-14 from -12 as
>> triggering point:

> So you're saying, with 215-12, tmp.mount was not automatically mounted?

Hello,

Yes, unless the logfile has suddenly increased in verbosity ATM. The
"Mounting Temporary Directory..." message started appearing after that
upgrade.

> Can you verify that by downgrading the packages from snapshot.debian.org?

I am reluctant to do so, since this is my main system and downgrades
are generally not handled (that well) in package maintainer-scripts.

> Regarding those chroots-*-tmp.mount dependencies?

> Who is creating those mounts? Maybe they didn't exist when you have -12
> installed? How are they created? Are those bind mounts (via fstab)?

They have been setup (manually) in fstab:
/tmp /chroots/wheezy/tmpnonebind,auto 0  0

> Can you attach a systemd-analyze dump, please.

Sure.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'


systemd-analyze_dump.xz
Description: application/xz


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Am 27.04.2015 um 19:15 schrieb Andreas Metzler:
> On 2015-04-27 Michael Biebl  wrote:
>> Am 27.04.2015 um 18:15 schrieb Andreas Metzler:
>>> Package: systemd
>>> Version: 215-17
>>> Severity: normal
> 
>>> I am not sure for how long but I guess less than two months (jessie),
>>> systemd has started purging my /tmp on every reboot, although I have
>>> these settings:
> [...] 
>> Or maybe, have you tmpfs-on-tmp enabled?
> 
>> What's the output of systemctl status tmp.mount ?
> 
> Hello,
> 
> thanks for the help, that is exactly what seems to have happened:
> 
> --
> ametzler@argenau:~$ systemctl status tmp.mount
> ● tmp.mount - Temporary Directory
>Loaded: loaded (/lib/systemd/system/tmp.mount; disabled)
>Active: active (mounted) since Mon 2015-04-27 17:07:24 CEST; 1h 33min ago
> Where: /tmp
>  What: tmpfs
>  Docs: man:hier(7)
>http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
>   Process: 178 ExecMount=/bin/mount -n tmpfs /tmp -t tmpfs -o 
> mode=1777,strictatime (code=exited, status=0/SUCCESS)
> 
> Warning: Journal has been rotated since unit was started. Log output is 
> incomplete or unavailable.
> ametzler@argenau:~$ mount | grep ' /tmp'
> tmpfs on /tmp type tmpfs (rw)
> ametzler@argenau:~$ systemctl list-dependencies --reverse tmp.mount
> tmp.mount
> ● ├─chroots-amd64\x2djessie-tmp.mount
> ● ├─chroots-amd64\x2dwheezy-tmp.mount
> ● ├─chroots-etch-tmp.mount
> [...]
> ● └─chroots-wheezy-tmp.mount
> --
> 
> The reverse dependencies are just bind-mounts:
> ametzler@argenau:~$ grep /wheezy.*tmp /etc/fstab
> /tmp/chroots/wheezy/tmpnonebind,auto0   0
> 
> It looks like this started on April 5 (journalctl history goes back to
> 2014):
> ametzler@argenau:~$ journalctl --since=2015-03-15 | grep tmp.mount
> Apr 05 15:20:55 argenau systemd[1]: tmp.mount: Directory /tmp to mount over 
> is not empty, mounting anyway.
> Apr 06 13:38:42 argenau systemd[1]: tmp.mount: Directory /tmp to mount over 
> is not empty, mounting anyway.
> [...]
> 
> /var/log/apt/history.log marks the upgrade to systemd 215-14 from -12 as
> triggering point:


So you're saying, with 215-12, tmp.mount was not automatically mounted?
Can you verify that by downgrading the packages from snapshot.debian.org?

Regarding those chroots-*-tmp.mount dependencies?

Who is creating those mounts? Maybe they didn't exist when you have -12
installed? How are they created? Are those bind mounts (via fstab)?



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Am 27.04.2015 um 19:15 schrieb Andreas Metzler:
> Looking at the respective changelog, only the fix for 779902 ("/tmp
> can be mounted as tmpfs against user's will") seems to be
> tmpfs-related.

That change is actually making it less likely that tmp.mount is
activated accidentally, by not making PrivateTmp=yes pull in tmp.mount,
if disabled.

In your case, something else is pulling in tmp.mount.

Can you attach a systemd-analyze dump, please.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Andreas Metzler
On 2015-04-27 Michael Biebl  wrote:
> Am 27.04.2015 um 18:15 schrieb Andreas Metzler:
> > Package: systemd
> > Version: 215-17
> > Severity: normal

> > I am not sure for how long but I guess less than two months (jessie),
> > systemd has started purging my /tmp on every reboot, although I have
> > these settings:
[...] 
> Or maybe, have you tmpfs-on-tmp enabled?

> What's the output of systemctl status tmp.mount ?

Hello,

thanks for the help, that is exactly what seems to have happened:

--
ametzler@argenau:~$ systemctl status tmp.mount
● tmp.mount - Temporary Directory
   Loaded: loaded (/lib/systemd/system/tmp.mount; disabled)
   Active: active (mounted) since Mon 2015-04-27 17:07:24 CEST; 1h 33min ago
Where: /tmp
 What: tmpfs
 Docs: man:hier(7)
   http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
  Process: 178 ExecMount=/bin/mount -n tmpfs /tmp -t tmpfs -o 
mode=1777,strictatime (code=exited, status=0/SUCCESS)

Warning: Journal has been rotated since unit was started. Log output is 
incomplete or unavailable.
ametzler@argenau:~$ mount | grep ' /tmp'
tmpfs on /tmp type tmpfs (rw)
ametzler@argenau:~$ systemctl list-dependencies --reverse tmp.mount
tmp.mount
● ├─chroots-amd64\x2djessie-tmp.mount
● ├─chroots-amd64\x2dwheezy-tmp.mount
● ├─chroots-etch-tmp.mount
[...]
● └─chroots-wheezy-tmp.mount
--

The reverse dependencies are just bind-mounts:
ametzler@argenau:~$ grep /wheezy.*tmp /etc/fstab
/tmp/chroots/wheezy/tmpnonebind,auto0   0

It looks like this started on April 5 (journalctl history goes back to
2014):
ametzler@argenau:~$ journalctl --since=2015-03-15 | grep tmp.mount
Apr 05 15:20:55 argenau systemd[1]: tmp.mount: Directory /tmp to mount over is 
not empty, mounting anyway.
Apr 06 13:38:42 argenau systemd[1]: tmp.mount: Directory /tmp to mount over is 
not empty, mounting anyway.
[...]

/var/log/apt/history.log marks the upgrade to systemd 215-14 from -12 as
triggering point:
8X--
End-Date: 2015-04-04  13:09:01

Start-Date: 2015-04-05  07:39:52
Commandline: apt --option APT::Get::Purge=true full-upgrade
Upgrade: libcap2:i386 (2.24-7, 2.24-8), libudev1:i386 (215-12, 215-14), systemd-
sysv:i386 (215-12, 215-14), systemd:i386 (215-12, 215-14), libsystemd0:i386 (215
-12, 215-14), libcap2-bin:i386 (2.24-7, 2.24-8), udev:i386 (215-12, 215-14), lib
gudev-1.0-0:i386 (215-12, 215-14)
End-Date: 2015-04-05  07:40:28

Start-Date: 2015-04-10  19:31:11
8X

Looking at the respective changelog, only the fix for 779902 ("/tmp
can be mounted as tmpfs against user's will") seems to be
tmpfs-related.

cu Andreas

-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Michael Biebl
Am 27.04.2015 um 18:15 schrieb Andreas Metzler:
> Package: systemd
> Version: 215-17
> Severity: normal
> 
> Hello,
> 
> I am not sure for how long but I guess less than two months (jessie),
> systemd has started purging my /tmp on every reboot, although I have
> these settings:
> 
> /etc/default/rcS:
> TMPTIME=2
> 
> which seems to have been migrated to /etc/tmpfiles.d/tmp.conf
> (attached, I have made a manual change from 5d to 2d iirc).
> 
> I am a litle bit at loss what goes wrong here, any idea on how to
> debug this?

Are you sure, it's sytemd-tmpfiles, which cleans /tmp?

What if you disable cleaning of /tmp altogether in your tmp.conf?
Is there another config file which overrides that setting?

Or maybe, have you tmpfs-on-tmp enabled?

What's the output of systemctl status tmp.mount ?


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#783509: systemd: /tmp purged on every reboot

2015-04-27 Thread Andreas Metzler
Package: systemd
Version: 215-17
Severity: normal

Hello,

I am not sure for how long but I guess less than two months (jessie),
systemd has started purging my /tmp on every reboot, although I have
these settings:

/etc/default/rcS:
TMPTIME=2

which seems to have been migrated to /etc/tmpfiles.d/tmp.conf
(attached, I have made a manual change from 5d to 2d iirc).

I am a litle bit at loss what goes wrong here, any idea on how to
debug this?

thanks cu Andreas

-- Package-specific info:

-- System Information:
Debian Release: 8.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  acl 2.2.52-2
ii  adduser 3.113+nmu3
ii  initscripts 2.88dsf-59
ii  libacl1 2.2.52-2
ii  libaudit1   1:2.4-1+b1
ii  libblkid1   2.25.2-6
ii  libc6   2.19-18
ii  libcap2 1:2.24-8
ii  libcap2-bin 1:2.24-8
ii  libcryptsetup4  2:1.6.6-5
ii  libgcrypt20 1.6.3-2
ii  libkmod218-3
ii  liblzma55.1.1alpha+20120614-2+b3
ii  libpam0g1.1.8-3.1
ii  libselinux1 2.3-2
ii  libsystemd0 215-17
ii  mount   2.25.2-6
ii  sysv-rc 2.88dsf-59
ii  udev215-17
ii  util-linux  2.25.2-6

Versions of packages systemd recommends:
ii  dbus1.8.16-1
pn  libpam-systemd  

Versions of packages systemd suggests:
pn  systemd-ui  

-- no debconf information
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Clear tmp directories separately, to make them easier to override
d /tmp 1777 root root 2d
#d /var/tmp 1777 root root 30d

# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-*
x /var/tmp/systemd-private-*
X /tmp/systemd-private-*/tmp
X /var/tmp/systemd-private-*/tmp