Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does 12factor recommend not to daemonize processes?

12factor recommends not to daemonize processes. What are the disadvantages of doing so?

like image 301
Aravind Yarram Avatar asked Mar 18 '23 00:03

Aravind Yarram


1 Answers

They are looking not at the daemon process itself, but at managing that process and ensuring it's running properly. They cite instances of kludgey frameworks built around daemons where the daemon was not written with an eye towards that management, thus requiring an excess of resources to restart it, clean up after it, etc.

They point out and recommend the use of system management facility software, including smf (Solaris), upstart (Linux), launchd (OSX), and even hoary old init and ttys (older Unix versions and BSD based distros). They don't mention systemd (also Linux), but that could be timing. They also don't mention inetd or xinetd that also make management and restart of network based daemon processes easy and simple.

So they aren't really recommending not to daemonize processes; they're recommending that after you invent your nifty daemon service process, you don't reinvent a management framework around it. Develop your server with an awareness of how it will be managed, and that will likely make the total effort involved much less. In current terms, this is a devops attitude.

like image 80
mpez0 Avatar answered Apr 26 '23 08:04

mpez0