untie(8)

πŸ“¦ version 0.3, in nixos 26.05, nixpkgs unstable

πŸ’… untie(8) β€” the namespace creator that ate ✨

okay bestie, so this is untie, from the manual page for section 8 (system administration commands). It's giving "run a command in a whole new namespace" and honestly? iconic. Let me walk you through it 🫢


🌸 NAME 🌸

untie β€” run a command in a new namespace πŸ’–

✨ SYNOPSIS ✨

untie [OPTIONS]... [COMMAND]...

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: untie uses Linux virtualization features to run commands in separate namespaces. Basically you're giving your command its own little pocket dimension 🧚✨

If no command is given, a shell is launched in the new namespace. cute, right?

⚠️ okay important thing β€” only root can create new namespaces. no cap. so like, check your privileges before you come for this βœ‹

πŸŽ€ OPTIONS πŸŽ€

The options define which namespaces to share with the parent or to fork. All the options can be combined, only --mask can be given more than once. (yes bestie, that's the one exception, don't @ me)

  • -h, --help β€” print help and exit πŸ’…
  • -V, --version β€” print version and exit ✨
  • --mount β€” new mount namespace. Mounts in a namespace are invisible in other namespaces. In order to have mounts crossing namespaces, you have to use the shared subtrees feature of Linux. See http://lwn.net/Articles/159092/ for more details πŸ‘€
  • --uname β€” new uname. An uname namespace can have its own hostname 🏷️
  • --ipc β€” new IPC context. This permits a group of applications to have a private namespace for System V IPC. These include message queues, semaphores and shared memory segments πŸ’¬
  • --mask=MASK β€” pass user defined flag. This flag allows to virtualize a resource that was not virtualizable at the time this program was written. For example, to clone the uname namespace without the --uname option, you would use untie --mask=0x04000000 because 0x04000000 is the value of CLONE_NEWUTS as per the header file sched.h 🧠
  • --chroot=DIRECTORY β€” chroot in the specified directory. This will let the child process perform a chroot before executing its command. The chroot is followed by a chdir("/") to prevent the simplest form of chroot escape πŸ”’
  • --uid=UID β€” change to the specified UID. This makes the child process run with the specified UID. If no GID argument is given, the GID will be set to the given UID and the child process groups will be the single element list with the given UID πŸͺͺ
  • --username=USERNAME β€” change to the specified username. This option has the same role as the previous one, except it takes a user name string instead of a UID number. This option and the previous one are mutually exclusive πŸ™…β€β™€οΈ
  • --gid=GID β€” add the specified GID. This argument can be given many times and will build the process groups list for the child process. The GID will be the first element in the list πŸ‘‘
  • --groupname=GROUP β€” add the specified group. This option has the same role as the previous one, except it takes a group name string instead of a GID number. This option as well as the previous one can be given any number of times. The previous option takes precedence to determine the GID of the child process ⭐
  • --daemonize β€” run as daemon. With this option, the child process will run as a background daemon πŸŒ™
  • --alarm=SECONDS β€” set an alarm after the specified delay. This option uses the alarm(2) facility to cause the termination of the child process after the specified timeout. The limitations of the alarm(2) system call apply, so if the child process uses alarm(2) it will cancel this specific timeout ⏰
  • --nice=NICE β€” run as the specified nice level. This sets the nice(1) value of the child process, levels typically range from -20 (highest priority) to 19 (lowest priority) πŸ“ˆ
  • --sched=SCHED β€” use the specified (possibly RT) scheduling policy. Accepted values are 'rr', 'fifo', 'normal', 'other' case insensitive. The policy can also be given in numerical form πŸ—“οΈ
  • --schedprio=PRIO β€” set the priority according to the given scheduler. This is typically used to set the priority between 1 and 100 when an RT scheduling policy is choosen 🎚️

πŸ’œ AUTHOR πŸ’œ

Guillaume Chazarain <guichaz@yahoo.fr>

See http://guichaz.free.fr/untie 🌈


and that's a wrap bestie πŸŽ€ this page is version 0.3, dated with the author credit above β€” shoutout Guillaume Chazarain for putting this whole thing together. go forth and namespace responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from