Red Hat Bugzilla – Bug 814427
Unexpected /sbin/securetty failure with read-only root file system
Last modified: 2016-11-25 08:05:08 EST
Description of problem: During startup, a host with a read-only NFS root file system triggers /etc/init/serial.conf which attempts to run "/sbin/securetty ttyS0". Even though "ttyS0" already exists in the /etc/securetty file, the command fails with the following error: securetty: Couldn't open /etc/securetty: Permission denied The permissions are correct, and the root user can successfully run "cat /etc/securetty". Version-Release number of selected component (if applicable): initscripts-9.03.27-1.el6 How reproducible: Always Steps to Reproduce: 1. Boot system with read-only root file system 2. Run "/sbin/securetty $DEV" where $DEV is a device name that already exists in /etc/securetty. Actual results: Command failure (rc=1) Expected results: Command should succeed. Because the device already exists in /etc/securetty, the file does not need to be modified. Additional info: Looking at the source code, it appears that /sbin/securetty attempts to open /etc/securetty in read-write mode before even checking if the file needs to be modified. If the root file system is mounted read-only, the results in a failure. A better approach would be to check if the file needs to be modified, and if not, exit with rc=0.
Created attachment 578786 [details] lightly tested patch Here's a lightly tested patch to do just that.
Created attachment 578789 [details] better patch And a better one that removes the now-obsolete check in rewrite_securetty.
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux.
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development. This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
this never made 6.4 as far as I can tell. I have the exact same problem.
No, this will be fixed in 6.5.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1679.html