Bug 888615

Summary: /var/lib/random-seed file is not functional under readonly root enabled
Product: [Fedora] Fedora Reporter: Joey Boggs <jboggs>
Component: initscriptsAssignee: Václav Pavlín <vpavlin>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: dsd, huli, iarlyy, johannbg, jonathan, lnykryn, metherid, msekleta, notting, plautrba, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: initscripts-9.45-1.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 808907 Environment:
Last Closed: 2013-03-15 14:41:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 808907    
Bug Blocks:    

Description Joey Boggs 2012-12-19 02:21:45 UTC
+++ This bug was initially created as a clone of Bug #808907 +++

Description of problem:
/var/lib/random-seed file is not functional under readonly root enabled. This file cannot be removed due to "Read-only file system" error and the system will show the error message when booting: "systemd-random-seed[517]: Failed to write new random seed file: Bad file descriptor".

Version-Release number of selected component (if applicable):
initscripts-9.34.2-1.fc16.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Just install base and core groups
2. Enable readonly root function in /etc/sysconfig/readonly-root file, set READONLY=yes and TEMPORARY_STATE=yes.
3. Add mount option ro in /etc/fstab for / directory.
4. Reboot
  
Actual results:
"systemd-random-seed[517]: Failed to write new random seed file: Bad file descriptor" and the file cannot be removed/modified.

Expected results:
No error for /var/lib/random-seed.


Seeing the same error in Fedora 18 alpha still.

Comment 1 Lukáš Nykrýn 2013-03-13 09:55:17 UTC
*** Bug 888618 has been marked as a duplicate of this bug. ***

Comment 2 Václav Pavlín 2013-03-14 09:16:22 UTC
Hi, this is not bug in readonly-root, but in systemd-random-seed.service. Adding fedora-readonly.service to systemd-randomd-seed's After solves this issue - /var/lib/random-seed is bind mounted as rw before it is used.

-After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service fedora-readonly.service

There is another issue with selinux involved bz #921456.

Comment 3 Václav Pavlín 2013-03-14 11:58:30 UTC
Proper solution is to add random-seed to Before= in fedora-readonly.service - switching back to initscipts

Comment 4 Václav Pavlín 2013-03-14 12:13:15 UTC
Patch commited to git -> http://git.fedorahosted.org/cgit/initscripts.git/commit/?id=d43d856ff2c8fd144a0d2030cb4655e7acea6084 -> post