Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 am writing a script to do some tasks at boot up time in my Debian Wheezy AWS EC2 AMI. Sources on the internet say that usual way to do this is to use update-rc.d to install the symlinks needed to set it up to run at boot time.

However, when I try this, I get the error

$ update-rc.d
-bash: update-rc.d: command not found

This method has been working for me till Debian Squeeze. Has the standard way to do this changed in Debian 7.0? I am not able to find any documentation that explains how to do it in the official way.

share|improve this question
up vote 2 down vote accepted

Looks like you're trying to use update-rc.d as an unprivileged user? Since this tool is located in /usr/sbin/ you probably don't have it in your $PATH. So try running it as root user or call it via sudo update-rc.d.

share|improve this answer

Your script has to contain a LSB (Linux Standards Base) header which indicates its dependencies and capabilities (see https://wiki.debian.org/LSBInitScripts for more about LSB headers).

If a LSB header is present, you can use insserv to include your script in the boot process (see https://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for more information).

share|improve this answer

A part from creating a new LSB script and add is as a start up service which is a more standard approach.

You can also add any minor scripting (like - generate a report, cleanup tasks) to /etc/init.d/rc.local.

However make sure rc.local is present and enabled to your run level (usually 3 on debian) - find /etc/rc*.d | grep rc.local

share|improve this answer

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.