diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-06-28 21:08:15 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-06-28 21:08:15 +0000 |
commit | 44424456f97d9fb1f8a4dc688a8e065e46c836d9 (patch) | |
tree | ab42d893b8d272f1b6be61c3dfd5b567d14c57c6 /system/gettys-openrc/gettys.initd | |
parent | 715edc6d997b0b7cd03029ca32a67cbb79727121 (diff) | |
parent | 0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e (diff) | |
download | packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.gz packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.bz2 packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.xz packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.zip |
Merge branch 'skaware.20190515' into 'master'
skaware 2019-05-15
See merge request !234
Diffstat (limited to 'system/gettys-openrc/gettys.initd')
-rw-r--r-- | system/gettys-openrc/gettys.initd | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/system/gettys-openrc/gettys.initd b/system/gettys-openrc/gettys.initd index cf74b0e8a..5181d9af2 100644 --- a/system/gettys-openrc/gettys.initd +++ b/system/gettys-openrc/gettys.initd @@ -14,25 +14,47 @@ makeservice() { if test -z "$baud" ; then baud=38400 fi - mkdir -p -m 0755 "/run/early-services/getty-$tty" + mkdir -p -m 0755 "/var/lib/s6/services/getty-$tty" { echo '#!/bin/execlineb -P' echo echo "/sbin/agetty $options -- $baud $tty linux" - } > "/run/early-services/getty-$tty/run" - chmod 0755 "/run/early-services/getty-$tty/run" + } > "/var/lib/s6/services/getty-$tty/run" + chmod 0755 "/var/lib/s6/services/getty-$tty/run" } -start() -{ +nomatchname() { + for j in $GETTYS ; do + if test "$j" = "$1" ; then + return 1 + fi + done + return 0 +} + +start() { set -e - mkdir -m 0755 -p /run/early-services + ebegin "Applying getty configuration" . /etc/conf.d/gettys + + todel="" + for i in `ls -1 /var/lib/s6/services | grep ^getty-` ; do + if nomatchname "${i##getty-}" ; then + rm -f "/run/service/$i" + todel="$todel $i" + fi + done + for i in $GETTYS ; do if test -c /dev/"$i" ; then - ebegin "Creating getty service for $i" - makeservice "$i" - eend $? + makeservice "$i" + ln -nsf "/var/lib/s6/services/getty-$i" "/run/service/getty-$i" fi done + + s6-svscanctl -an /run/service + if test -n "$todel" ; then + ( sleep 1 && rm -rf $todel ) & + fi + eend $? } |