fs

morpheus filesystem files
git clone git://git.2f30.org/fs
Log | Files | Refs

commit f1c84e397e8924409e1285684808763017fc4e64
parent 98bbf22cca5f221d05db9e2227efc073089bcd99
Author: sin <sin@2f30.org>
Date:   Fri, 21 Feb 2014 16:21:17 +0000

Respawn 4 gettys by default

Diffstat:
Mbin/rc.init | 6+++++-
Abin/respawn | 29+++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/bin/rc.init b/bin/rc.init @@ -70,4 +70,8 @@ if [ -x /bin/rc.svc ]; then /bin/rc.svc fi -exec sh -c 'while :; do echo; getty /dev/tty1 linux; done' +echo +sh -c 'respawn getty /dev/tty1 linux' & +sh -c 'respawn getty /dev/tty2 linux' & +sh -c 'respawn getty /dev/tty3 linux' & +sh -c 'respawn getty /dev/tty4 linux' & diff --git a/bin/respawn b/bin/respawn @@ -0,0 +1,29 @@ +#!/bin/sh + +usage() { + echo "usage $(basename $0) [-d delay] cmd arg..." 1>&2 + exit 1 +} + +delay=0 +while getopts ":d:" opt; do + case $opt in + d) + delay=$OPTARG + ;; + \?|:) + usage + ;; + esac +done + +shift $((OPTIND-1)) + +if test -z $1; then + usage +fi + +while :; do + $* + sleep $delay +done