Linux-LXC

 view release on metacpan or  search on metacpan

lib/Linux/LXC.pm  view on Meta::CPAN

	shift @folders;
	my $abs_folder = '';
	while (my $cur_folder = shift @folders) {
		$abs_folder .= '/' . $cur_folder;
		# If the current folder is not existing or if it is not a symlink, we create it.
		if (!$this->_check_folder_existence($container_root, $abs_folder)) {
			`chroot $container_root mkdir $abs_folder`;
			# This instruction is the cause we can not simply use a `mkdir -p` command for creating the path: we need
			# to set the good rights to folder in order to copy it.
			# Note: we set right only if we have to create the folder, for avoiding to create too much mess.
			`chroot $container_root chown $uid:$uid $abs_folder` if (defined $uid);
		}
	}
	`chroot $container_root mv /tmp/lxc-transit $dest_from_container_root`;
	`chroot $container_root chown -R $uid:$uid $dest_from_container_root` if defined $uid;
}

sub del_config {
	my ($this, $attr, $filter) = @_;
	if (defined $filter and ref($filter) ne 'Regexp') {
		croak '$filter should be a regular expression';
	}
	$filter //= qr/(.*)/;
	open my $CONF_R, '<', $this->get_lxc_path() . '/config';
	my $CONF_W = new File::Temp();

lib/Linux/LXC.pod  view on Meta::CPAN


Retrun true if the container with the given utsname is running. False otherwise.

=head3 is_stopped()

Return true if the container with the given utsname is stopped. False otherwise.

=head3 put($input, $destination)

Will copy the $input file or folder on the $destination path in the container instance.
This method also takes care of ownership and will chown $destination to the container root uid.
The ownership will also be set for all intermediate folders we have to create.

=over 15

=item $input

String corresponding to a relative or absolute path of a folder or a file we want to copy on the container root fs.
This path should be readable by the user executing this script.

=item $output



( run in 1.455 second using v1.01-cache-2.11-cpan-71847e10f99 )