Kit Stube
unread,Sep 2, 2010, 5:47:58 PM9/2/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi everyone. I am attempting to add this line to /etc/inittab so that a user will be forced to enter a password to get into single user mode:
~:S:wait:/sbin/sulogin
I have tried all kinds of things, but seem to be having no luck. Here is the puppet class I am trying to make:
class gen000020 {
# Description: The UNIX host is bootable in single user mode without a password.
# Insert "~~:S:wait:/sbin/sulogin" into /etc/inittab
augeas { "inittab" :
context => "/files/etc/inittab",
changes => [
"set ~ /~",
"set ~/runlevels S",
"set ~/action wait",
"set ~/process /sbin/sulogin",
]
}
}
Here is the pertinent debug output from a manual run feeding that code to puppet:
debug: Augeas[inittab](provider=augeas): Opening augeas with root /, lens path , flags 0
debug: Augeas[inittab](provider=augeas): Augeas version 0.5.0 is installed
debug: Augeas[inittab](provider=augeas): Will attempt to save and only run if files changed
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~", "/~"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/runlevels", "S"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/action", "wait"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/process", "/sbin/sulogin"]
debug: Augeas[inittab](provider=augeas): Files changed, should execute
debug: Augeas[inittab](provider=augeas): Closed the augeas connection
debug: //ia/Augeas[inittab]: Changing returns
debug: //ia/Augeas[inittab]: 1 change(s)
debug: Augeas[inittab](provider=augeas): Opening augeas with root /, lens path , flags 0
debug: Augeas[inittab](provider=augeas): Augeas version 0.5.0 is installed
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~", "/~"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/runlevels", "S"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/action", "wait"]
debug: Augeas[inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/~/process", "/sbin/sulogin"]
debug: Augeas[inittab](provider=augeas): Closed the augeas connection
err: //ia/Augeas[inittab]/returns: change from need_to_run to 0 failed: Save failed with return code false
debug: Finishing transaction -612453418 with 1 changes
Can anyone show me the proper way to insert this line into inittab using augeas and puppet?
Thanks
Kit Stube