Why do we need that?
What namespaces do we have?
General Setup -> Namespaces support -> *
#include int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ... /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ); clone() creates a new process...CLONE_NEWUTSCLONE_NEWIPCCLONE_NEWNETCLONE_NEWPIDCLONE_NEWNSCLONE_NEWUSER
#include int setns(int fd, int nstype); Given a file descriptor referring to a namespace, reassociate the calling thread with that namespace.
CLONE_NEWIPC CLONE_NEWNET CLONE_NEWUTS
The server is installed in Chicago.Timezone: North America -> US -> ChicagoApp requires timezone: Europe -> London
If the app can not handle the timezone change by its own... we have three choices:1. Create a chrooted environment with different default timezone2. Create a virtual machine and put the app there3. Create a new UTS namespace and start the app in it
User authentication and mapping files:/etc/passwd
- What if we want to create a username called pesho, but such user already exists?
- What if we want to create user joan with UID 1005, but there is already user pesho with UID 1005?
Unix/Linux IPCs- unix domain sockets- shared memory- semaphores- message queues/proc/PID/fd/ |- 3 -> socket:
Unix/Linux IPCs- unix domain sockets- shared memory- semaphores- message queues
key shmid owner perms bytes nattch 0x0052e2c1 1139834880 postgres 600 37879808 4
- IP - IPv6- Routing- TCP- UDP- SCTP- DCCP- RDS
loopback device for a processOr simply test the MySQL
server on the same IPCompletely different routing
for a process
the most complex one...having only one / is a problem...
- at around 22000 mounts everything on your machine starts to lag... no matter how many cores or ram you have :(
- having a different /proc/mounts per process would be nice and very interesting to implement... :)
Migration of processes between machines (CRIU)It allows you to have a two or more processes running with the same PID.PID- is the PID on the host machineNSPID- is the PID that the process sees PIDNSPID 1421 5420ssh-agent 1730 5420xchat 1756 5420firefox