cpuns

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: BSD-3-Clause Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

This program is used when cpud is not available. It takes a mount point environment variable, LC_CPU_FSTAB, and environment specified by -env, and invokes itself several times, as needed, to create a private name space for a user command. This all gets a bit tricky as we must do a few things as root, and setuid back in the end. In an earlier version, we used unshare, but that introduces a dependency we would prefer not to have. The sequence: 1st pass: check if we are uid 0, if not, sudo os.Executable 2nd pass: we are uid 0, check if namespace is private, if not,

execute ourselves with cmd.SysProcattr.Unshareflags set to NS_PRIVATE
This will only succeed or fail; it won't start the process
with a non-private namespace.

3rd pass: create the proper mounts, and execute the user command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL