2

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.

3 Answers 3

2

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.

1

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).

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .