mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-26 02:21:53 +00:00
Merge pull request #2233 from dave-tucker/ns-detect
getty: Detect if you are in a namespace
This commit is contained in:
@@ -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 &
|
||||
}
|
||||
|
||||
|
||||
# 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
|
||||
|
Reference in New Issue
Block a user