I need to do something apparently quite simple: run a script on a Debian 8.2 machine during boot (or during shutdown, both of them are fine).

The script just moves and renames some files, so the only thing it needs is that the root filesystem is mounted. However, it must run before networking is started.

I tried putting the script in /etc/init.d, and symlinking it to /etc/rc3.d/S12-a-scriptname.sh so that it runs just before networking. However... it just doesn't run.

I also tried symlinking it automatically using update-rc.d, but it still doesn't work. Can someone help me, please?

  • You need to edit the question and tell the world what version of Debian Linux this is. It's important. – JdeBP Dec 10 '15 at 12:26

Networking in Debian starts at run level S, which comes before run level 3.

Sources, for reference:



  • As mentioned in a comment to the question, the version of Debian is important. The above is no longer actually the case for Debian version 8, for example, as is pointed out (albeit perhaps not emphatically enough) earlier in that very same manual. – JdeBP Dec 10 '15 at 12:30

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.