#startup
Posts
-
Digging into Gradle's Source 3: From the gradle Command to the Daemon — the Launcher, the Wrapper and the Daemon Protocol
When you type gradle in a terminal, the build is not done by that process but by a daemon JVM hiding behind it. This post follows the 64 MiB client the shell script starts, the three paths that decide whether a daemon is used and what --no-daemon really means, how registry.bin is used to find a daemon and judge compatibility, the order in which a daemon is started and connected to, the 16-step command chain and the Idle/Busy states inside the daemon, the conditions under which a daemon stops itself, and how gradlew and IDEs reach the same daemon — all checked against the source at a fixed commit and with Docker examples.
-
Digging into Kafka's Source 2: The Big Picture — Clients, Brokers, Controllers and Partitions
A big-picture map for intermediate developers opening the Kafka source for the first time. Starting from the main method of kafka.Kafka that kafka-server-start.sh calls, we follow how process.roles decides whether BrokerServer, ControllerServer and SharedServer get built, what a broker creates when it starts, how the controller decides topics, partitions and leaders through the metadata log and spreads them to the brokers, how a client finds a leader through a Metadata response, and which way the modules depend on each other — all checked against the real source and examples I actually ran — and we mark which part of the map Parts 3–12 zoom into.
-
Digging into MariaDB's Source 3: Startup and Plugins — Until mariadbd Takes Its First Connection
What happens between starting mariadbd and its first connection? We follow mysqld_main() in sql/mysqld.cc — how a line in my.cnf becomes a system variable, how plugin_init() registers and initializes everything as a plugin (even InnoDB and Aria), where ha_initialize_handlerton() lets an engine fill its handlerton, the signal thread and the poll() loop, and how shutdown runs startup in reverse — checked with the error log and gdb.
-
Digging into nginx's Source 4: Startup and Reading the Config — From main() to ngx_init_cycle
When you start nginx, main() reads the command line, and ngx_init_cycle() reads nginx.conf and builds one complete set of configuration called a cycle — only then does the master process start running. We follow how one parser function handles three cases (a file, a block, and the -g command-line string), how ngx_conf_read_token() splits text into words one character at a time, where the error messages come from, and how reload calls the same ngx_init_cycle() again and inherits listening sockets and shared memory from the old cycle — using the nginx 1.31.9 source and gdb and strace examples.
-
Digging into Apache httpd's Source 5: main() and Startup — Why the Config Is Read Twice, and Restarts
What happens inside main() when you start httpd, followed through all 914 lines of server/main.c. Why the config file is read twice, how one apachectl graceful makes main()'s loop go round once more, and where a server started as root drops to User — checked against the source and against real log output.
-
Digging into Tomcat's Source 3: Lifecycle and Startup — What Happens After catalina.sh start
We follow the source from catalina.sh start to a running server — Bootstrap building class loaders, Catalina turning server.xml into a tree of objects with the Digester, and every component being initialized and started by the same Lifecycle state machine. With a listener and small examples we check the order in which parents start their children, why the server still comes up when a connector fails, and what the shutdown port 8005 does.
-
Digging into Tomcat's Source 10: Deploying a Web App — From a WAR to a Running Context
We follow in the source what happens inside Tomcat when you drop a WAR file into the webapps folder. HostConfig checks the folder every 10 seconds and creates a Context, ContextConfig merges web.xml, conf/web.xml and annotations and finds ServletContainerInitializers, and StandardContext.startInternal() wakes up SCIs, listeners, filters and servlets in a fixed order. We also look, from Tomcat's side, at where Spring's SpringServletContainerInitializer gets called.