Linux::Unshare - Perl interface for Linux unshare system call.
use Linux::Unshare qw(unshare :clone); # as root ... unshare(CLONE_NEWNS) # now your mounts will become private unshare(CLONE_NEWNET) # get a separate network namespace
This trivial module provides an interface to the Linux unshare system call. It also provides the CLONE_* constants that are used to specify which kind of unsharing must be performed. Note that some of these are still not implemented in the Linux kernel, and others are still experimental.
The unshare system call allows a process to 'unshare' part of the process context which was originally shared using clone(2).
unshare(2) Linux man page.
Boris Sukholitko, <boriss@gmail.com> Marian Marinov, <hackman@cpan.org>
Copyright (C) 2009 by Boris Sukholitko Copyright (C) 2014-2023 by Marian Marinov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Linux::Unshare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Unshare
CPAN shell
perl -MCPAN -e shell install Linux::Unshare
For more information on module installation, please visit the detailed CPAN module installation guide.