mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +00:00
getty: Detect if you are in a namespace
This is an attempt at fixing #2213 If `INITGETTY` has been set then we are not in a namespace. Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
parent
4327329265
commit
f41c976406
@ -1 +0,0 @@
|
|||||||
export PS1="(ns: getty) $PS1"
|
|
@ -41,6 +41,14 @@ start_getty() {
|
|||||||
infinite_loop setsid.getty -w /sbin/agetty $loginargs $line $speed $tty $term &
|
infinite_loop setsid.getty -w /sbin/agetty $loginargs $line $speed $tty $term &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# check if we are namespaced, and, if so, indicate in the PS1
|
||||||
|
if [ -z "$INIGETTY" ]; then
|
||||||
|
cat >/etc/profile.d/namespace.sh <<"EOF"
|
||||||
|
export PS1="(ns: getty) $PS1"
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
# check if we have /etc/getty.shadow
|
# check if we have /etc/getty.shadow
|
||||||
ROOTSHADOW=/hostroot/etc/getty.shadow
|
ROOTSHADOW=/hostroot/etc/getty.shadow
|
||||||
if [ -f $ROOTSHADOW ]; then
|
if [ -f $ROOTSHADOW ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user