carbon-s6-init

s6-linux-init configuration for Carbon
git clone https://ccx.te2000.cz/git/carbon-s6-init
Log | Files | Refs

rc.init (1546B)


      1 #!/bin/sh -e
      2 
      3 rl="$1"
      4 shift
      5 
      6 ### argv now contains the arguments of the kernel command line that are
      7 ### not of the form key=value. (The key=value arguments were stored by
      8 ### s6-linux-init into an envdir, if instructed so via the -s option.)
      9 ### Normally this argv remains unused because programs that need the
     10 ### kernel command line usually read it later on from /proc/cmdline -
     11 ### but just in case, it's available here.
     12 
     13 
     14 ### 1. Early preparation
     15 ### This is done only once at boot time.
     16 ### Ideally, this phase should just initialize the service manager.
     17 
     18 ### If your services are managed by sysv-rc:
     19 # /etc/init.d/rcS
     20 
     21 ### If your services are managed by OpenRC:
     22 # /sbin/openrc sysinit
     23 # /sbin/openrc boot
     24 
     25 ### If your services are managed by s6-rc:
     26 ### (replace /run/service with your scandir)
     27 # s6-rc-init /run/service
     28 
     29 
     30 ### 2. Starting the wanted set of services
     31 ### This is also called every time you change runlevels with telinit.
     32 ### (edit the location to suit your installation)
     33 ### By default, $rl is the string "default", unless you changed it
     34 ### via the -D option to s6-linux-init-maker.
     35 ### Numeric arguments from 1 to 5 on the kernel command line will
     36 ### override the default.
     37 
     38 # exec /etc/s6-linux-init/current/scripts/runlevel "$rl"
     39 
     40 
     41 ### If this script is run in a container, then 1. and 2. above do not
     42 ### apply and you should just call your CMD, if any, or let your
     43 ### services run.
     44 ### Something like this:
     45 
     46 # if test -z "$*" ; then return 0 ; fi
     47 # $@
     48 # echo $? > /run/s6-linux-init-container-results/exitcode
     49 # halt