bashrcrunlevelinittab

How could you start all of the scripts in /etc/rc2.d?


So I am in /etc/rc3.d and I want to start all of the "S" scripts and Kill all of the "K" scripts. I am trying # ./S* start but it's not seeing the start argument. How to I adjust my syntax to allow me to pass a start to the Ss and a stop to the Ks?


Solution

  • I have to mention the most direct way: switch to runlevel 2.

    telinit 2
    

    If for some reason you don't want to do that, you could explicitly loop over the scripts.

    for K in /etc/rc2.d/K*; do "$K" stop;  done
    for S in /etc/rc2.d/S*; do "$S" start; done