daemon   3510

« earlier    

Install - Dropbox
Note that this does not (yet) work on a Raspberry Pi, since it assumes an x86 or x86_64 architecture
daemon  headless  linux  IFTTT  Pocket  dropbox 
7 weeks ago by janhoek
Docker and the PID 1 zombie reaping problem
Let's look at a concrete example. Suppose that your container contains a web server that runs a CGI script that's written in bash. The CGI script calls grep. Then the web server decides that the CGI script is taking too long and kills the script, but grep is not affected and keeps running. When grep finishes, it becomes a zombie and is adopted by the PID 1 (the web server). The web server doesn't know about grep, so it doesn't reap it, and the grep zombie stays in the system.

Every time a process exits even though it has child processes, it's expecting the init process to perform the cleanup later on.

So how does this relate to Docker? Well, we see that a lot of people run only one process in their container, and they think that when they run this single process, they're done. But most likely, this process is not written to behave like a proper init process. That is, instead of properly reaping adopted processes, it's probably expecting another init process to do that job, and rightly so.


When building Docker containers, you should be aware of the PID 1 zombie reaping problem. That problem can cause unexpected and obscure-looking issues when you least expect it. This article explains the PID 1 problem, explains how you can solve it, and presents a pre-built solution that you can use: Baseimage-docker.

Consider Nginx as an example, which daemonizes into the background by default. This works as follows. First, Nginx creates a child process. Second, the original Nginx process exits. Third, the Nginx child process is adopted by the init process.

Orphaned process adoption

You may see where I am going. The operating system kernel automatically handles adoption, so this means that the kernel expects the init process to have a special responsibility: the operating system expects the init process to reap adopted children too.

This is a very important responsibility in Unix systems. It is such a fundamental responsibility that many many pieces of software are written to make use of this. Pretty much all daemon software expect that daemonized child processes are adopted and reaped by init.
docker  gotcha  pid  devops  unix  linux  daemon  init  zombie  reaping 
10 weeks ago by hellsten
abraunegg/onedrive: Free Client for OneDrive on Linux
Free Client for OneDrive on Linux. Contribute to abraunegg/onedrive development by creating an account on GitHub.
onedrive  client  linux  daemon  systemd  sync  office365  microsoft 
10 weeks ago by plaxx

« earlier    

related tags

agent  alternativeto  analytics  annex  api  application  article  atomic  audio  aws  background  backup  bash  benutzerverwaltung  bestpractice  bin  bitcoin  blockchain  blog  c  camera  capture  cdrom  cgi  cli  client  cloud  cmd  collectd  collection  command  computers  config  configuration  connect  container  cryptocurrencies  cryptocurrency  cue  daemontools  debian  demons  deployment  dev  devops  docker  documentation  dotnetcore  dropbox  dunning-kruger  elisp  emacs  emacsclient  email  entrypoint  epistemic-bubble  erc20  esnipe  ethereum  example  examples  exit  facebook  fix  for  fork  forum  games  git  github  gnome  go  golang  gotcha  gradle  graphs  grive  group  gtk  guide  hardware  headless  health  home  hosting  hotkey  howto  ifttt  image  important  information  init  intel  internet  israel  issue  javascript  js  k8s  kernel  keyboard  kill  launchctl  launchd  library  lightning  linux  macos  mdf  mds  metrics  microsoft  mirror  monitor  monitoring  motion  network  nginx  node.js  node  nodejs  not  office365  onedrive  performance  permission  pid  pocket  process  processmanagement  programming  psychology  python  reading  reaping  reference  restart  routing  rsync  ruby  run  script  scripting  security  server-start  server  service  session  settings  shell  sid  signal  smtp  socket  software  soros  ssh  stackoverflow  start  starting  statistics  stderr  stdin  stdio  stdout  stop  supervisor  swap  sync  sysadmin  sysemd  system  systemd  sysvinit  technology  timeout  timer  toc  tolearn  tools  tootme  toread  totry  tounderstand  transmission  troubleshoot  tutorial  ubuntu  universal  unix  upstart  user  virtual  vmware  war  web  webdev  webdevel  webhooks  webmaster  webservice  websocket  websockets  wiki  windows  yaws  zombie 

Copy this bookmark:



description:


tags: