Bug 518954 - service nfslock fails to start with readonly-root
Summary: service nfslock fails to start with readonly-root
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-24 10:52 UTC by Alexander Todorov
Modified: 2009-11-26 12:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-13 18:06:21 UTC


Attachments (Terms of Use)
/etc/sysconfig/readonly-root (546 bytes, text/plain)
2009-08-24 10:52 UTC, Alexander Todorov
no flags Details

Description Alexander Todorov 2009-08-24 10:52:30 UTC
Created attachment 358437 [details]
/etc/sysconfig/readonly-root

Description of problem:
service nfslock fails to start with readonly-root. /var/log/messages says:

Aug 24 06:44:13 localhost rpc.statd[2410]: Version 1.0.9 Starting
Aug 24 06:44:13 localhost rpc.statd[2410]: open (/var/lib/nfs/statd/state): Read-only file system


Version-Release number of selected component (if applicable):
nfs-utils-1.0.9-42.el5

How reproducible:
always

Steps to Reproduce:
1. Perform default install of RHEL 5.4
2. Configure /etc/sysconfig/readonly-root
3. Reboot
  
Actual results:
Service fails to start

Expected results:


Additional info:
/etc/sysconfig/readonly-root is attached

Comment 1 Steve Dickson 2009-10-13 16:05:17 UTC
Where statd write its state file when the root is read only?? 
Meaning how do other apps, like syslog, write to their logs 
in /var when its a read only root?

Comment 2 Steve Dickson 2009-10-13 18:00:44 UTC
To answer my own question, it appears /var/log is tmpfs file system
which is not persistent over reboots... Unfortunately the rpc.statd
state file has to be persistent over reboots so its not clear
we can do anything to fix this problem... Other than having the
rpc.statd startup script not start up on read-only roots...

Comment 3 RHEL Product and Program Management 2009-10-13 18:06:21 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Comment 4 Alexander Todorov 2009-10-14 07:40:44 UTC
Hi Steve,
see /etc/rwtab for files and directories which are mounted as tmpfs when readonly root. Why does the rpc.statd file needs to be persistent?

Comment 5 Jeff Layton 2009-10-14 11:06:42 UTC
(In reply to comment #4)
> Hi Steve,
> see /etc/rwtab for files and directories which are mounted as tmpfs when
> readonly root. Why does the rpc.statd file needs to be persistent?  

rpc.statd provides reboot notification for clients and servers. When a client reboots it notifies all of the servers that it had mounted that it has rebooted so that any locks that it held can be dropped.

When statd starts up, it expects to find:

1) a "sm" directory that holds files for each of the hosts it should notify of a reboot

2) a "state" file that it uses to determine what "state" it should send to the host

So really, all of /var/lib/nfs/statd need to be writable when statd starts, and its contents need to be persistent across reboots.

Comment 6 Dmitry Bolkhovityanov 2009-11-26 12:07:58 UTC
(In reply to comment #5)

> 1) a "sm" directory that holds files for each of the hosts it should notify of
> a reboot
> 
> 2) a "state" file that it uses to determine what "state" it should send to the
> host
> 
> So really, all of /var/lib/nfs/statd need to be writable when statd starts, and
> its contents need to be persistent across reboots.  

1. Does readonly-root'ed machine have to run nfslockd at all?  In most scenarios it will probably have all exports "ro", so that locking isn't needed.

2. If nfs-locking IS really required with readonly-root, then placing /var/lib/nfs on some other, rw-filesystem would do the trick.

Is that right?


Note You need to log in before you can comment on or make changes to this bug.