[systemd-devel] systemd-nspawn and process spawning using nsenter issue

Aliaksei Sheshka sheshkaoss at gmail.com
Mon Nov 2 06:27:42 PST 2015


I have some systemd-nspawn and namespace related question.
Assume following commands,

$ systemctl start c7-test #starring our container
$ systemctl status c7-test #checking if it is running and looking for
inside /usr/lib/systemd/systemd process
$ nsenter -t 22333 -n /usr/local/sbin/custom-network-daemon  #starting
our network daemon located on the host filesystem but withing
container network namespace

I have a strong reason doing so, let say one need to modify clock on
the host machine, while container provides very special routing table
- it is oversimplification, but somewhat my use case.

My questions are
a) Once container c7-test shut down using 'machinectl poweroff
c7-test' how one can know what some processes are still running
withing that network context?
My  /usr/local/sbin/custom-network-daemon is perfectly running after
c7-tets was shut down, which it obviously expected behavior.

b) Is there a generic method to list currently active namespaces?
machinectl does not show as expected, since it's a machine lister and
machine is not running.
'ip netns list' is not listing them either, if there any other utility
for that? If not is there a kernel interface to create one?

c) Since /usr/local/sbin/custom-network-daemon is still running
withing previously created by 'systemctl start c7-test' network
namespace, one can't start same container again properly -
while container starts, networking fails silently in case of
--network-macvlan=eth0, one just can't bring inside interface UP.
Should systemd-nspawn fail with error in such cases?


More information about the systemd-devel mailing list