Bug 868822

Summary: put to inittab fails unless nodes are created in a particular order
Product: [Fedora] Fedora Reporter: Matthew Booth <mbooth>
Component: augeasAssignee: Hugh Brock <hbrock>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: apevec, hbrock, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-31 20:31:31 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Matthew Booth 2012-10-22 04:36:39 EDT
Description of problem:
When adding a line to /etc/inittab, nodes must be created in a particular order, or the subsequent save will fail.

An example adding to /etc/inittab in F17, which does not initially contain any uncommented lines. This works:
augtool> set /files/etc/inittab/1/runlevels 2345
augtool> set /files/etc/inittab/1/action respawn
augtool> set /files/etc/inittab/1/process "/sbin/mingetty tty1"
augtool> save
Saved 1 file(s)

This does not work:
augtool> set /files/etc/inittab/2/process "/sbin/mingetty tty"
augtool> set /files/etc/inittab/2/action respawn
augtool> set /files/etc/inittab/2/runlevels 2345
augtool> save
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)
augtool> print /augeas/files/etc/inittab/error
/augeas/files/etc/inittab/error = "put_failed"
/augeas/files/etc/inittab/error/path = "/files/etc/inittab/2"
/augeas/files/etc/inittab/error/lens = "/usr/share/augeas/lenses/dist/inittab.aug:19.9-22.38:"
/augeas/files/etc/inittab/error/message = "Failed to match \n    { /runlevels/ = /[^\\001-\\004\\n#:]*/ }{ /action/ = /[^\\001-\\004\\n#:]*/ }{ /process/ = /[^\\001-\\004\\n#]*/ }{ /#comment/ = /[^\\001-\\004\\t\\n ][^\\001-\\004\\n]*[^\\001-\\004\\t\\n ]|[^\\001-\\004\\t\\n ]?/ }?\n  with tree\n    { \"process\" = \"/sbin/mingetty tty\" } { \"action\" = \"respawn\" } { \"runlevels\" = \"2345\" }"

Note the difference in the order the nodes are created.

Version-Release number of selected component (if applicable):
Comment 1 David Lutterkort 2013-01-04 16:23:04 EST
In general, the augeas tree is ordered, and it therefore matters in which order nodes appear in the tree.

For this particular annoyance, where there is no real danger in reordering tree nodes before writing them out, it would be possible to add a mechanism that allows a lens writer to express that. I haven't thought through the repercussions of this though, and it seems like it would be a fair amount of work ...
Comment 3 Fedora End Of Life 2013-07-03 18:33:49 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 4 Fedora End Of Life 2013-07-31 20:31:35 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.