On Dec 10, Marc Haber <mh+debian-de...@zugschlus.de> wrote:

> Is there any way to fire up a pid-1-systemd isntance inside a debspawn
> container, so that the container could have an IP address and run its
> own sshd? Or is there any way to get a login prompt from an already
> running debspawn container?
I am not familiar with debspawn, but looks like this should help:

#!/bin/sh -e

C_NAME=$1

if [ -z "$C_NAME" ]; then
  echo "Usage: $0 NAME"
fi

C_PID="$(machinectl show --property=Leader --value $C_NAME)"

[ "$C_PID" ] || exit 1

kill -0 $C_PID || exit 2

exec nsenter \
  --mount --uts --ipc --net --pid --cgroup \
  --target $C_PID $SHELL

-- 
ciao,
Marco

Attachment: signature.asc
Description: PGP signature

Reply via email to