Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm installing Neo4j server as a linux service, but when I install it, I get the following message:

/sbin/insserv: Permission denied

What is this? What should I do? I'm running everything with sudo.

Update - Scenario:

  1. I had installed it properly the first time, but then I moved the neo4j-directory to a different location.

  2. The neo4j-service was not recognized now.

  3. I removed the neo4j-service manually by removing from /etc/init.d and then running update-rc.d -f neo4j-service remove

  4. When I re-install it said /sbin/insserv no such directory, so I googled and did this:

    ln -s /usr/lib/insserv/insserv /sbin/insserv

  5. Now when I re-install it - it says /sbin/insserv: Permission denied

Using Ubuntu.


# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults        env_reset
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Permissions on neo4j install script:

-rwxr-xr-x 1 username username 15K Feb 27 09:38 neo4j


When I do a ls -lah on /sbin:

lrwxrwxrwx 1 root root 16 May 15 20:29 insserv -> /usr/lib/insserv

and a ls -lah on /usr/lib:

drwxr-xr-x 2 root root 4.0K Feb 14 03:37 insserv

share|improve this question
Give steps that you have done cause that error. – cuonglm May 15 '13 at 9:50
What OS (I assume Ubuntu), what part of the install throws this error, what commands did you run? – NickW May 15 '13 at 9:50
What does /sbin/insserv point to? Is it a symlink, but you moved where it needs to look? – vgoff May 15 '13 at 9:57
Can you ls -lah on /sbin/insserv too ? – Tom O'Connor May 15 '13 at 10:05
@TomO'Connor updated – user May 15 '13 at 10:09

rsuarez makes some good points about your init/upstart configuration. However, it is not clear if you are getting the same error when running the insserv program as root manually. There are two things you can do to debug the insserv permissions directly:

  1. See if the /sbin/insserv command gives the same error when running from a command line manually
  2. If you get the same permission denied from #1, try to run it with strace to see what file or permissions it is failing on. If #1 does not give you permission denied, then follow the rsuarez and @TomO'Connor guidance to look at the potential upstart or Neo4j problems because it is probably not directly related to the /sbin/insserv binary.
share|improve this answer
And in addition: "which" insserv to avoid the binary existing in multiple path locations leaving you wondering about the right permissions on the binary you would expected to be executed rather then the one which actually is tried to be executed by your command. – Peter Jan 8 '14 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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