On Mon, Jan 17, 2011 at 19:26, pl <patrick.b....@gmail.com> wrote: >> Can you instrument your code to >> dump Process.uid and Process.gid from Ruby-space in the block? That >> way we can help narrow down where things are going wrong. > > Process.uid was telling me 500, which was the intended user. whoami > inside the execpipe was root though.
Hmmmm. I wonder what was convincing whoami that you were root, not UID 500, then. > I've ended up doing this > > def self.exec_as_user(op, pkg) > > Puppet::Util::SUIDManager.asuser("node", "node") do > s = execute ["my", "command", "and", "args"] > s.split("\n").collect do | line | > yield line > end > end > end It might be worth looking at puppet/util.rb to see the handful of "run this command" helpers hidden away in there, just to make sure you are not duplicating effort. Anyway, sounds like you got it working, so glad to hear that. Regards, Daniel -- ✉ Daniel Pittman <dan...@rimspace.net> ⌨ dan...@rimspace.net (XMPP) ☎ +1 503 893 2285 ♻ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.