Thanks. Copy ans paste of that line: unshare --pid -- /bin/sh -c /bin/bash still gave: ./unshare --pid -- /bin/sh -c /bin/bash bash: fork: Cannot allocate memory also tried to tweak a bit and it did not help I am using latest git linux-util on fedora 18 with 3.8.4-202.fc18.x86_64 kernel regards, Andy On Thu, May 9, 2013 at 9:26 PM, Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote: > 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