Re: Cannot allocate memory when calling unshare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andy Johnson <johnsonzjo@xxxxxxxxx> writes:

> Hello,
> I use git last update of util-linux.
>
> ./unshare -n /bin/bash
> works ok.
>
> From a different terminal I run:
>
> ./unshare -p /bin/bash
> and get:
> bash: fork: Cannot allocate memory
>
> typing:
> shows 141 Mb free.
>
> the machine has x86_64 ubuntu, 13.04, Raring Ringtail
>
> any advice ?

Pid namespaces are funny.  What you are seeing is expected and correct
behavior.  The process that calls unshare is not put into the pid
namespace it's first child is.  Which means that the first child of bash
becomes the init in the pid namespace and the next child of bash.

The following should do what you want.
unshare --pid -- /bin/sh -c /bin/bash

Eric
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux