Opened 3 years ago

Closed 3 years ago

#11078 closed defect (fixed)

minicom, lockdev and screen don't work after reboot due to rwtab tmpfs mounts

Reported by: martin.langhoff Owned by: dsd
Priority: normal Milestone: 11.3.0
Component: distro Version: not specified
Keywords: Cc: pbrobinson
Blocked By: Blocking:
Deployments affected: Action Needed: test in build
Verified: no

Description

Our varlock-and-other-dirs-in-tmpfs setup loses directories on reboot.

Packages from Fedora repos that create dirs and files in the affected directories will see breakage after the first reboot. Here is an example of how it impacts minicom/lockdev: https://bugzilla.redhat.com/show_bug.cgi?id=722814

This is because we have implemented the feature ahead of Fedora -- in F15 the packages have an entry in /etc/tmpdirs.d/<packagename.conf> or in /usr/lib/tmpfiles.d

One possible workaround is to doublecheck that we are using the same tmpdirs as Fedora. If that is the case, we can query the yum sqlite database to see what packages install files into those 2 tmpfiles.d and evaluate impact and possible fixes.

Marking this for 11.2.0-final as it definitely deserves to be relnoted.

Attachments (1)

0001-Add-support-for-tmpfiles.d-fix-screen-and-lockdev-DL.patch (3.6 KB) - added by martin.langhoff 3 years ago.
Patch adding support for tmpfiles.d

Download all attachments as: .zip

Change History (21)

comment:1 Changed 3 years ago by dsd

I don't think we've implemented anything "ahead of Fedora", we don't do anything special here to my knowledge. I remember running into that exact minicom issue back in 2009 - I think this is even documented on the wiki somewhere. Something similar applies for screen. But yes, can definitely be mentioned in the release notes.

comment:2 Changed 3 years ago by pbrobinson

/var/run and /var/lock running as tmpfs was a F-15 feature https://fedoraproject.org/wiki/Features/var-run-tmpfs and we're using it in F-14 so in this case we did.

comment:3 Changed 3 years ago by dsd

That's actually a very old feature - it has just been optional until now. You just had to flip the switch in /etc/sysconfig/readonly-root and this is exactly what OLPC has done for longer than I have been involved. /var/run and /var/lock are both in the Fedora-shipped lists of directories which are turned into tmpfs as a result (see /etc/rwtab) and have been for years.

comment:4 Changed 3 years ago by dsd

  • Milestone changed from 11.3.0 to Future Release
  • Summary changed from Directories in tmpfs owned by fedora packages are lost on reboot to minicom, lockdev and screen don't work after reboot due to rwtab tmpfs mounts

Using (e.g.):

rpm -qa --filesbypkg | grep var.*tmp

(and similarly for the other directories that are put in tmpfs by this feature) I couldn't really identify any problems. Yes, there are quite a few packages installed which put things in these directories (especially for /var/run), but we rarely see any negative effects of this issue. Packages generally deal with that fine.

We do have the 3 cases of failure: minicom, lockdev, and screen(unless run as root), so I'll leave this ticket open. These cases could be fixed in Fedora 14, or we could wait til we rebase on future Fedora releases.

comment:5 Changed 3 years ago by martin.langhoff

Well, we could query the 'files' sqlite database, to get a more complete list (so as to cover a wider range of packages, not just strictly what we ship), and then consider including an /etc/tmpdir.d file in olpc-utils -- strictly for the 11.3.0 series.

comment:6 Changed 3 years ago by wad

Short answer, for those who don't want to read through everything, is to create /var/lock/lockdev

Changed 3 years ago by martin.langhoff

Patch adding support for tmpfiles.d

comment:7 Changed 3 years ago by martin.langhoff

Upstart on F15 has a nice config file that adds support for /etc/tmpfiles.d. We can add this to olpc-utils (which already drives upstart config), and include the tmpfiles.d create the relevant dirs for screen and minicom.

Attached a tested patch to olpc-utils. Tested on intall from src on os42 -- tmpdirs are recreated w the correct permissions. Packages install properly - do not complain about pre-existing directories. No issues on boot or shutdown.

comment:8 Changed 3 years ago by martin.langhoff

  • Action Needed changed from never set to review

comment:9 Changed 3 years ago by martin.langhoff

  • Milestone changed from Future Release to 1.75-software

comment:10 Changed 3 years ago by dsd

This looks fine, but as olpc-utils is already being packaged for F15+ it adds a little nitch on the packaging side. Just creating the directories from olpc-configure if they don't exist already would be easier. Would that be OK with you?

comment:11 Changed 3 years ago by martin.langhoff

Ah, true, it would add the burden of keeping separate versions right now, for F14 vs F15.

I took the high road of the modular conf.d stuff to match upstream, but it is way overengineered: a couple of mkdir -p ; chmod ; chown in olpc-configure get the job done just fine.

comment:12 Changed 3 years ago by dsd

  • Action Needed changed from review to package

yep, the important thing when adding little hacks like this is to have it fixed already upstream. pushed as olpc-utils 63c6fa63d

comment:13 Changed 3 years ago by dsd

  • Action Needed changed from package to add to build
  • Milestone changed from 1.75-software to 11.3.0

shipped in olpc-utils-1.3.4

comment:14 Changed 3 years ago by dsd

  • Action Needed changed from add to build to test in build

test in 11.3.0 build 7

comment:15 Changed 3 years ago by greenfeld

  • Action Needed changed from test in build to diagnose

Screen for normal users wants its directory set to 0775 in order to work. The same appears to be true with lockdev, although minicom seems to ignore if it cannot write a file there.

The olpc-configure approach does not do this, although the initial tmpfiles.d approach does.

Is this safe permissions change we can add?

comment:16 Changed 3 years ago by dsd

  • Action Needed changed from diagnose to add to build

fixed in olpc-utils-1.3.5

comment:17 Changed 3 years ago by dsd

  • Action Needed changed from add to build to test in build

test in 11.3.0 build 8

comment:18 Changed 3 years ago by dsd

Test case: yum install minicom screen. Reboot. Then run minicom and screen, check that they don't fail to launch with errors.

tested 11.3.0 candidate build 880 on XO-1.75, seems fine.

comment:19 Changed 3 years ago by martin.langhoff

Yay! Right on time for bringup! :-)

comment:20 Changed 3 years ago by godiard

  • Resolution set to fixed
  • Status changed from new to closed

Tested in os880

Note: See TracTickets for help on using tickets.