[pve-devel] [PATCH pve-container] Add new pct fsck command, to check the rootfs of a container for consistency

Dietmar Maurer dietmar at proxmox.com
Tue Oct 6 11:54:45 CEST 2015


Please can you use PVE::LXC::lock_container()

> +	#begin critical path: from here we need to lock the container
> +	PVE::LXC::lock_aquire($vmid);
> +	if (PVE::LXC::check_running($vmid)) {
> +		PVE::LXC::lock_release($vmid);
> +		die "Cannot run command on active container\n";
> +	} else {
> +		PVE::Tools::run_command($command);
> +		PVE::LXC::lock_release($vmid);
> +	}
> +
> +	return undef;
> +    }});



More information about the pve-devel mailing list