Merge pull request #2233 from dave-tucker/ns-detect

getty: Detect if you are in a namespace
This commit is contained in:
Avi Deitcher
2017-07-27 16:50:02 +03:00
committed by GitHub
23 changed files with 29 additions and 22 deletions

View File

@@ -1 +0,0 @@
export PS1="(ns: getty) $PS1"

View File

@@ -41,6 +41,14 @@ start_getty() {
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 "$INITGETTY" ]; then
cat >/etc/profile.d/namespace.sh <<"EOF"
export PS1="(ns: getty) $PS1"
EOF
fi
# check if we have /etc/getty.shadow
ROOTSHADOW=/hostroot/etc/getty.shadow
if [ -f $ROOTSHADOW ]; then