wanders/separate-ns — pull request #1 by knirch (2012-08-18 21:40:30+00:00)
Title: Rewrote it for unshare(2)

separate-ns.c | 72 +++++++++++++++++++++++++++---------------------------------------------
1 file changed, 27 insertions(+), 45 deletions(-)

whee, and it doesn't fail the silly signal test I concocted;

$ separate-ns-clone bash -c 'trap "while :; do read ; sleep 1; done" ERR ; { trap "false" 2 ; echo "press ctrl-c please" ; sleep 1000 ; }'
press ctrl-c please
^C
bash: line 1: read: read error: 0: Input/output error
knirch@traktor:~/s-ns-fail (master *$%)$ bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error
bash: line 1: read: read error: 0: Input/output error

knirch@traktor:~/s-ns-fail (master *$%)$ separate-ns-unshare bash -c 'trap "while :; do read ; sleep 1; done" ERR ; { trap "false" 2 ; echo "press ctrl-c please" ; sleep 1000 ; }'
press ctrl-c please
^C^Cknirch@traktor:~/s-ns-fail (master *$%)$