Lesson 7

Dates: 3/5/2014
Start-up and Run Levels. Scheduled jobs (at, cron)
Linux for Engineering and IT Applications


Startup Scripts

  • The event tasks of init in /etc/init (12.04 LTS) execute startup scripts depending on the events and then the legacy System V kind of scripts:
    /etc/init.d/rcS (at startup)
    /etc/init.d/rc (when changing run levels)
    These two execute scripts in directories specific for different run levels located in the following directories: /etc/rcS.d /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d
    
    ls /etc/rc6.d
    
     
    K10unattended-upgrades  S20sendsigs      S35networking  S90reboot
    K70ebtables             S30urandom       S40umountfs
                            S31umountnfs.sh  S60umountroot
    
    
    S - means "start"
    K - means "kill" or "stop"
    The number - means kill/start sequence number.
    By default n(K) = 100 - n(S)

    In this example, when system enters run level 6, the scripts are executed in the following order:
    K10unattended-upgrades, K70ebtables, ... followed by S20sendsigs, S30urandom, ... S90reboot

    Manual start/stop:
    
    /etc/rc2.d/S50rsync start
    /etc/rc2.d/S50rsync stop
    



  • Take me to the Course Website