Lesson 4

Date: 2/12/2009
Start-up and Run Levels. Scheduled jobs (at, cron)
Linux for Engineering and IT Applications


Startup Scripts

  • The event tasks of init in /etc/event.d (rcS, rc0, rc1, rc2 rc3 rc4 rc5 rc6) execute System V kind of scripts in /etc/init.d:
    /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
    
     
    K01gdm           K25hwclock.sh        S01linux-restricted-modules-common  S40umountfs
    K01usplash       K39ufw               S15wpa-ifupdown                     S60umountroot
    K16dhcdbd        K50alsa-utils        S20sendsigs                         S90reboot
    K20apport        K59mountoverflowtmp  S30urandom
    K20avahi-daemon  K99laptop-mode       S31umountnfs.sh
    
    
    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:
    K01gdm, K01usplash, ... K59mountoverflowtmp followed by S20sendsigs, S30urandom, ... S90reboot

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



  • Take me to the Course Website