autoinst

scripts to make automated installations of debian easy
git clone git://deadbeef.fr/autoinst.git
Log | Files | Refs | README | LICENSE

2 (2056B)


      1 #!/bin/sh
      2 
      3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
      4 SVDIR=/var/lib/runit/service
      5 
      6 # found in package console-data, fr.kmap.gz
      7 loadkeys fr
      8 
      9 install -d -m 0750 -o root -g adm $SVDIR
     10 install -d -m 0750 -o root -g adm /var/log/fsck
     11 
     12 # network interfaces
     13 busybox ip link set up lo
     14 for i in $(busybox ip -o link | cut -f2 -d: | grep -v '\<lo\>')
     15 do
     16 	install -d -m 0750 -o root -g adm $SVDIR/$i/log
     17 	ln -s /etc/runit/log.run $SVDIR/$i/log/run
     18 	ln -s /etc/busybox/run/dhcpc.run $SVDIR/$i/run
     19 done
     20 
     21 # gettys
     22 for i in $(seq 1 6)
     23 do
     24 	install -d -m 0750 -o root -g adm $SVDIR/tty$i
     25 	ln -s /etc/busybox/run/getty.run $SVDIR/tty$i/run
     26 done
     27 
     28 # sshd (dropbear)
     29 install -d -m 0750 -o root -g adm $SVDIR/sshd/log
     30 ln -s /etc/runit/log.run $SVDIR/sshd/log/run
     31 ln -s /etc/dropbear/run/dropbear.run $SVDIR/sshd/run
     32 
     33 # klogd (svlogd)
     34 install -d -m 0750 -o root -g adm $SVDIR/klogd
     35 ln -s /etc/runit/klogd.run $SVDIR/klogd/run
     36 
     37 # This script is also invoked in runit-systemd and runit-sysv packages.
     38 # We must start sulogin and sysv scripts only if `runit' is current init
     39 # system.
     40 if [ -f /run/runit.stopit ] ; then
     41 	# single mode
     42 	if grep -q -w -i 'single' /proc/cmdline ; then
     43 		chpst -P /sbin/sulogin -p /dev/tty1
     44 	fi
     45 
     46 
     47 	# Give sysv scripts 90 seconds (hardcoded in async-timeout source) to
     48 	# start. If something goes wrong, they are detached from controlling
     49 	# terminal.
     50 	#
     51 	# In this case tty1 would likely look ugly -- output from sysv scripts
     52 	# is written over terminal session, but at least we would be able to
     53 	# login.
     54 
     55 	/lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc2.d'
     56 fi
     57 
     58 exec env - PATH=$PATH \
     59 runsvdir -P "${SVDIR}" 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'