summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
blob: 699a1ead1a402a5f50576db4fd23942837185de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# busybox' getty does this itself, util-linux' agetty needs extra help
getty="/sbin/getty"
case $(readlink -f "${getty}") in
    */busybox*)
        ;;
    *)
        if [ -x "/usr/bin/setsid" ] ; then
            setsid="/usr/bin/setsid"
        fi
        ;;
esac

if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then
	${setsid:-} ${getty} -L $1 $2 $3
fi