I am trying to setup a Ubuntu 12.04 LTS with chef. I am getting this error, which I'm assuming is related to my user permissions:

Chef Client failed. 3 resources updated in 5.613887095 seconds
[2014-04-13T09:44:41+09:00] ERROR: service[ssh] (basic-security-tlq::default line 59) had an error: Errno::EACCES: Permission denied - /usr/sbin/update-rc.d -n -f ssh remove
[2014-04-13T09:44:41+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

edit: these are the permissions for the file mentioned in the err log:

-rwxr-xr-x 1 root    root     16894 Apr 14  2012 update-rc.d

I've setup other servers (with ubuntu 12.04) using this recipe with no issues, but this is being run on a machine with a different hosting provider. I'm temped to ssh in and start chmoding file, but that seems a bit drastic. The chef recipe is cooked as root which is confusing me even more as I thought this user had full permissions?

This may be more appropriate for stackOverflow, but since it's permissions related I thought I'd try here first.

update2: I tried doing chown root update-rc.d and it still throws the same error. I am starting to wonder if it isn't an SSL problem because of this line in the error ERROR: service[ssh], but not sure how to investigate that.


It's trying to update the ssh daemon using update-rc.d and it's not being allowed to. Try doing it by hand to see what the problem is. It'll be far easier to diagnose from the errors you see from running it from the command line as root. Try this:

/usr/sbin/update-rc.d -n -f ssh remove

It really doesn't have anything to do with the permissions you revealed of update-rc.d.

  • cheers, running it from command line gave me -bash: /usr/sbin/update-rc.d: /usr/bin/perl: bad interpreter: Permission denied which I fixed by doing chmod on the perl file. I'm not sure if that was the correct way to fix the issue, but the chef script completes now – user2936314 Apr 13 '14 at 6:29
  • That was exactly the right way to fix it. Good going. There's no good reason at all why that perl binary didn't have its world executable bit set. – A H Apr 13 '14 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.