Chef client run root.sh for NMO setuid status

96 views Asked by At

I need to run root.sh as root user and then restart the OEM agent as user "xxxxx". Which involves changing permissions of some folders and files and setting the SETUID bit along with permission changes.

And this will resolve an error called "NMO error".

Now Chef runs the root.sh as root and also restarts OEM agent as "xxxxxx". Each step returns correct output, without any error. But the issue doesn't get resolved.

And if we run the same steps manually, the issue will get resolve immediately.

execute 'rootSH' do
  user 'root'
  command "root.sh"
  action :nothing
end
resources(execute: 'rootSH').run_action(:run)
1

There are 1 answers

2
Abhishek Prusty On

You have not provided any logs or anything to look at!!! Will try to answer though..

Make a small change as below :

execute 'rootSH' do
  user 'root'
  command "sh root.sh"
  cwd "/path/to/root.sh" # ENTER THE PATH TO ROOT.SH HERE
  live_stream true  
end.run_action(:run)

Let me know if it works. Else, post the logs.