Skip to content.

plope

Personal tools
You are here: Home » Members » chrism's Home » An rc.local equivalent for Debian
 
 

An rc.local equivalent for Debian

I'm all over the map when it comes to Linux distributions. I use RedHat on my laptop, Xandros (a Debian-based distro) on my main desktop, and straight Debian on several other laptops I've got stting around. I'm mainly used to RedHat's take on Sys V init, so not having an rc.local has mystified me on Debian-based distros. I found a handy way to emulate it. I know it's simple, but I never thought of it.

Stolen from here

In many distributions you can add commands to run certain programs at the end of the boot process after all system services have been started into the /etc/rc.d/rc.local file, however there is no such file in a Debian system. Here is the way to accomplish the same thing the debian way:

  1. Make a file called /etc/init.d/local with a text editor. This file is a script so it should always start with the following line:
      #! /bin/sh
    
  2. Next, for example I have an always on cable modem and I want to use rdate to update the system time to atomic clock time at startup, so I add the following command to the file:
      rdate -s clock-1.cs.cmu.edu && hwclock --systohc
    

(The rdate command updates your system time, then the hwclock command updates the bios clock)

  1. Make this file executable with:
      chmod +x /etc/init.d/local
    
  2. Next, link the new local file by running:
      update-rc.d local defaults 80
    
Created by chrism
Last modified 2005-06-30 03:24 PM