Startup and reboot: firewall, ready FPM, then Nginx
Verify service ordering, FPM notify readiness, HTTP and persisted data after an ordinary reboot of a disposable test environment.
Installation and subsequent steps require PHP 8.5.12 or a newer stable release in the 8.5 branch. PHP 8.5.12 is a security release; the coordinated disclosure is discussed in OpenAI’s report. Check both CLI and the running FPM version: an updated package on disk alone does not establish that an existing process has been updated.
Explicitly starting Nginx and PHP-FPM does not show that they will return in the right order after a reboot. On a disposable local Debian VM we separately enabled our own services and checked a normal new boot. We first used the manual fixture, then repeated configuration and startup through the CLI on a separate local VM.
Firewall must precede PHP and Nginx
Our firewall service loads a checked nftables file as a oneshot with RemainAfterExit=yes. Its rules belong to the isolated fixture: loopback, controlled SSH and necessary control traffic. This is not a ready-made public VPS policy. FPM explicitly Requires and runs After that service:
[Unit]
Requires=solution200-manual-firewall.service
After=solution200-manual-firewall.service
[Service]
Type=notify
NotifyAccess=main
The excerpt also shows the subsequent FPM transition from Type=simple to Type=notify. With simple, systemd can report active before a worker prepares its socket. The tested PHP-FPM supports readiness notification; NotifyAccess=main admits it from the main process. We waited for Ready to handle connections and existing sockets before starting Nginx.
Nginx depends on both firewall and FPM. A shortened drop-in:
[Unit]
Requires=deploy-cli-php85.service solution200-manual-firewall.service
After=deploy-cli-php85.service solution200-manual-firewall.service
Requires expresses a dependency requirement; After expresses ordering. Writing those lines is insufficient: we checked the effective unit and actual order of the new start. The FPM BPF guard also confirmed ingress/egress programs in the cgroup before startup.
Enable does not establish a successful reboot
We enabled our units and two maintenance timers as a separate action. A command without --now does not replace startup after boot:
systemctl enable solution200-manual-firewall.service \
deploy-cli-php85.service nginx.service \
solution200-session-clean.timer solution200-logrotate.timer
Packaged services that must not manage this fixture remained masked/inactive; stock nftables startup was disabled. After the new boot, the cleaner and logrotate timers were active/waiting. An enabled timer schedules work; it does not prove that cleanup or rotation happened again at the instant of observation.
Confirm the new boot independently
Before reboot we checked an independent serial console and a fresh SSH login with the selected key and password-required sudo. We requested a normal systemctl reboot once. SSH closing during reboot was not a reason to repeat the command or force a reset: we first read the state and confirmed a different boot.
After the first reboot, the old boot-bound request was actually refused. We then refreshed independent console evidence and checked SSH/sudo again. On that boot both hosts returned 200 through the intended workers; static also returned 200, while private paths and an unknown Host returned 404. Sockets retained root:www-data 0660, configurations retained the expected contents, and the master log contained the current process PID. A control session advanced from 1 to 2.
A further joint boot after data services
We next added separate MySQL, Redis and Elasticsearch services; their configuration has its own articles. Already-active custom data units were explicitly enabled for the next boot. Elasticsearch received a private temporary directory on an executable filesystem. After these changed inputs we performed another normal reboot. This was a separate experiment, not a retry of the preceding command after an unknown outcome.
The new boot confirmed firewall → ready FPM → Nginx, local HTTP, socket permissions, BPF and unchanged owned configurations. PDO read the persisted MySQL emoji marker and runtime DDL was denied. Redis returned its AOF marker and refused deletion of a foreign key. Elasticsearch preserved the document, alias, users and roles.
Elasticsearch READY did not mean its indices had recovered. The first search check did not yet meet its expected condition; its response was not retained separately, so we did not establish the exact cause. Successful HTTP/PDO/Redis observations were retained as a completed portion, not described as success for the whole experiment. After recovery we read search 200, green cluster state and access-denial controls. Installation, database initialization and completed writes were not replayed.
Fixture resources do not determine production sizing
The final check ran in a VM configured with 2 GiB RAM. The guest reported about 1936 MiB MemTotal and 869 MiB MemAvailable, with no swap. No OOM was observed; all five main services ran without automatic restarts. This was an idle fixture with diagnostic requests, not a Symfony load test or a server-sizing recommendation.
After reboot we had a checked local path from firewall to two PHP responses and persisted control data. Public ingress and actual application delivery have separate stages; the CLI repetition follows below.
Check package state after a new boot
On a separate CLI fixture, we resumed the retained VM disk after completing its configuration. An independent serial-console login confirmed the new boot. The firewall returned automatically, while Nginx, PHP, MySQL, Redis and Elasticsearch remained inactive/disabled: startup had not yet been enabled for them in this run.
A separate check of the retained package history stopped the continuation. The current /var/lib/dpkg/status differed from the state recorded after installation: 389 records were unchanged, while three had different versions. No packages had been added or removed:
| Package | Recorded version | Current version |
|---|---|---|
| bind9-host | 1:9.20.29-1~deb13u1 | 1:9.20.30-1~deb13u1 |
| bind9-libs | 1:9.20.29-1~deb13u1 | 1:9.20.30-1~deb13u1 |
| ca-certificates | 20250419 | 20250419+deb13u1 |
The dpkg log contained actual upgrade events for all three packages. Separately, we read the state of the background APT timers:
systemctl show apt-daily.timer apt-daily-upgrade.timer \
--property=Id,ActiveState,SubState,UnitFileState
Both timers were enabled and active/waiting. This left another route for changing packages on the learning fixture alongside our CLI. A timer's state alone does not identify the process responsible for a particular update; the package manager's log confirms that the versions changed.
A post-reboot check must distinguish an expected boot ID change from a change to installed software. The CLI did not rewrite the retained history to match the current state or repeat MySQL initialization or credential creation. We retained this disk for diagnosis and prepared a clean VM with controlled background updates before establishing its package history.
On a new clean VM, combined installation and checks of Nginx, two PHP pools and three data services completed separately; 20 HTTP controls ran before reboot. After one ordinary systemctl reboot, runtime-history boot-inspect accepted all nine history transitions. Only the boot hash changed in package state; 21 journals remained exact. The five main services were inactive/disabled, and the reader did not start them. This separately established acceptance of unchanged packages in a new boot, with startup verification remaining the next step.
Resuming a VM and checking its package history do not yet constitute a completed CLI startup run for the entire stack. That requires its own enable plan, dependency ordering, an explicit reboot and fresh service and HTTP checks.
A separate CLI startup transition for PHP-FPM
After checking the packages, we made PHP recovery a separate plan. It references the completed initial setup, its configuration, layout, signed packages and firewall. The original request remained unchanged; execution used a different request with independent confirmation of the current boot. In the Bash array below, variables contain private paths and previously recorded identifiers:
php_startup=(
--env-file "$ADMIN_ENV"
--request-file "$ORIGINAL_REQUEST"
--current-request-file "$STARTUP_REQUEST"
--fpm-file "$PHP_PROFILE"
--key-file "$PHP_REPOSITORY_KEY"
--key-sha256 "$PHP_REPOSITORY_KEY_SHA256"
--references-file "$PACKAGE_HISTORY"
--activation-file "$PHP_ACTIVATION"
--firewall-pin-file "$FIREWALL_PIN"
--plan-file "$PHP_STARTUP_PLAN"
)
deploy-cli host runtime-startup fpm plan "${php_startup[@]}"
php_startup_sha=$(sha256sum "$PHP_STARTUP_PLAN")
php_startup_sha=${php_startup_sha%% *}
deploy-cli host runtime-startup fpm apply "${php_startup[@]}" \
--plan-sha256 "$php_startup_sha" --approve-privileges
The plan checks the inactive/disabled state and the absence of foreign drop-ins or startup links. Package-manager locks remain held until the checks finish. Before each change, the CLI records its intent in its own journal; an incomplete step does not authorize another start.
The new /etc/systemd/system/deploy-cli-php85.service.d/80-deploy-cli-startup.conf file declares the dependency on the actual CLI firewall service and readiness through notify:
[Unit]
Requires=deploy-cli-firewall-boot.service
After=deploy-cli-firewall-boot.service
[Service]
Type=notify
NotifyAccess=main
The CLI first starts PHP once and reads both Unix sockets: it checks ping, worker identities, required extensions, PDO mysql and active OPcache. Only after readiness does it create its own /etc/systemd/system/multi-user.target.wants/deploy-cli-php85.service link. The next check uses a separate SSH connection. The original configuration files and initial activation journal remain intact.
Checking startup in a new boot
We then performed another ordinary reboot of this VM. The fixture operator requested it separately; the CLI host reboot command was not used in this experiment. A new serial-console login confirmed the same machine and a different boot ID. The post-reboot reader also received the exact completed startup-journal identifier returned by apply:
deploy-cli host runtime-startup fpm boot-verify "${php_startup[@]}" \
--plan-sha256 "$php_startup_sha" \
--manifest-sha256 "$PHP_STARTUP_MANIFEST_SHA256" \
--new-boot-request-file "$AFTER_REBOOT_REQUEST" \
--output-file "$PHP_BOOT_PROOF"
The reader does not start PHP again: it checks the unchanged journal and configuration, admits all nine package transitions, and collects new processes, sockets and FastCGI responses. Old PIDs and socket inodes are not substituted into the new observation. An excerpt of the actual systemd response after boot:
systemctl show deploy-cli-php85.service \
--property=Id,Type,NotifyAccess,ActiveState,SubState,UnitFileState
Type=notify
NotifyAccess=main
Id=deploy-cli-php85.service
ActiveState=active
SubState=running
UnitFileState=enabled
Live FPM was running PHP 8.5.12. Both pools returned ping 200; OPcache was running and memory_limit remained 128M. The package status and 22 journal files, including the new startup journal, were unchanged. PHP-FPM returned automatically in this separate CLI experiment. The following sections cover the other services, timers and the combined reboot.
The next CLI step: three data services
After verified PHP startup, separate new transactions started and enabled MySQL, Redis and Elasticsearch. Each apply completed with independent reads over a new SSH connection. MySQL initialization, root-password protection and tenant creation were not replayed. Reads of the retained control records and access-boundary checks passed for all three services.
Before starting Elasticsearch, the CLI found that the package elasticsearch.conf set vm.max_map_count=262144 after our 80-* file during boot. A separate new same-name override under /etc/sysctl.d restored 1048576 while preserving the original files and journals. The Elasticsearch article gives the full explanation and commands.
This was the data-service startup stage in the current boot. Nginx, timers and the separate combined new-boot acceptance follow below.
A separate CLI successor for Nginx startup
After rebooting the retained CLI fixture, Nginx was inactive and disabled, while PHP had independently verified startup in the new boot. The new startup step does not replay configuration or activation. It checks their original plans and journals, signed archives, the vendor unit, every stock configuration file and the actual readiness of both PHP pools.
The original 40-deploy-cli-origin.conf remains in nginx.service.d, retaining the owned origin commands and firewall dependency. The new 80-deploy-cli-runtime-startup.conf adds only the PHP-FPM dependency:
[Unit]
Requires=deploy-cli-php85.service
After=deploy-cli-php85.service
Both dependencies are checked in systemd. Immediately before start, the CLI rechecks stopped/disabled Nginx, exact configuration and live PHP. Seven separate journalled steps write the drop-in, reload units, start the service, verify HTTP, create the exact enable link, reload units again and verify the enabled runtime. Successful apply includes independent reads over a new SSH connection.
PRIVATE_DIR is an absolute private directory. nginx-startup-inputs.json contains schema_version: 1 and the original php and nginx references: PHP activation_file, startup_request_file and startup plan/SHA/manifest; Nginx profile_file, dependencies_file, configuration and activation plan/SHA/manifest. The original PHP startup request retains its startup boot; current-console-request independently confirms the current boot.
NGINX_STARTUP_ARGS=(
--env-file "$PRIVATE_DIR/administrator.env"
--request-file "$PRIVATE_DIR/install-request.json"
--fpm-file "$PRIVATE_DIR/php-profile.json"
--key-file "$PRIVATE_DIR/php-archive-keyring.gpg"
--key-sha256 "$PHP_PUBLIC_KEY_SHA256"
--references-file "$PRIVATE_DIR/history-references.json"
--current-request-file "$PRIVATE_DIR/current-console-request.json"
--firewall-pin-file "$PRIVATE_DIR/firewall-pin.json"
--startup-inputs-file "$PRIVATE_DIR/nginx-startup-inputs.json"
--plan-file "$PRIVATE_DIR/nginx-startup-plan.json"
)
deploy-cli host runtime-startup nginx plan "${NGINX_STARTUP_ARGS[@]}"
deploy-cli host runtime-startup nginx apply "${NGINX_STARTUP_ARGS[@]}" \
--plan-sha256 "$APPROVED_STARTUP_PLAN_SHA256" --approve-privileges
The following is a reduced summary of the actual journal and independent readback, rather than the literal JSON output of one command:
{
"unit": "nginx.service",
"active": "active",
"sub": "running",
"startup": "enabled",
"startup_journal_steps": 7,
"http_controls": 20,
"http_status_counts": {
"200": 2,
"400": 3,
"403": 3,
"404": 12
},
"php_execution_probes": 2,
"original_files_unchanged": 86,
"original_journal_files_unchanged": 53
}
Two 200 responses executed PHP in different pools. Other requests checked the default host, method, unexpected query parameters, direct PHP files, path-info, .env and traversal. The /../private.txt check used http.client with an explicit URI, preserving the path before sending it. Original configuration, journals and dpkg state remained unchanged.
This was the start/enable stage before the combined reboot. Acceptance of the new boot follows below.
Nginx after the combined reboot
After starting the timers, we performed one ordinary reboot of the same local VM. A new serial-console login confirmed the machine and changed boot ID. The original NGINX_STARTUP_ARGS remain bound to the boot where start/enable ran; the new console request is passed separately:
deploy-cli host runtime-startup nginx boot-verify "${NGINX_STARTUP_ARGS[@]}" \
--plan-sha256 "$APPROVED_STARTUP_PLAN_SHA256" \
--manifest-sha256 "$COMMITTED_STARTUP_MANIFEST_SHA256" \
--new-boot-request-file "$PRIVATE_DIR/new-boot-console-request.json" \
--output-file "$PRIVATE_DIR/nginx-new-boot-proof.json"
The reader checked unchanged configuration, startup links and the completed journal. It rebuilt PIDs, sockets and current PHP readiness. Nginx returned automatically as active/running and enabled. All 20 HTTP checks again produced the expected result: two 200 responses executed PHP in separate pools, three responses were 400, three were 403 and twelve were 404. The original /../private.txt URI was again sent through http.client without normalization.
Three timers: separate CLI start and startup enablement
After PHP-FPM and Nginx, we separately started maintenance timers for both pools and the master log on the same local educational VM. Configuration files, session-clean.py and logrotate remained from the initial setup. The new plan references the completed PHP startup and maintenance; it does not replay the original maintenance oneshots.
Variables below contain private paths and previously recorded identifiers. php-maintenance-reference.json contains plan_file, plan_sha256 and manifest_sha256 for the original completed maintenance. The timer plan is reviewed before apply; its SHA identifies those exact approved bytes.
TIMER_STARTUP_ARGS=(
--env-file "$ADMIN_ENV"
--request-file "$PRIVATE_DIR/original-request.json"
--fpm-file "$PRIVATE_DIR/php-profile.json"
--key-file "$PHP_REPOSITORY_KEY"
--key-sha256 "$PHP_REPOSITORY_KEY_SHA256"
--references-file "$PRIVATE_DIR/history-references.json"
--php-startup-request-file "$PRIVATE_DIR/php-startup-console-request.json"
--activation-file "$PRIVATE_DIR/php-activation-reference.json"
--firewall-pin-file "$PRIVATE_DIR/firewall-pin.json"
--php-startup-plan-file "$PRIVATE_DIR/php-startup-plan.json"
--php-startup-plan-sha256 "$PHP_STARTUP_PLAN_SHA256"
--php-startup-manifest-sha256 "$PHP_STARTUP_MANIFEST_SHA256"
--current-request-file "$PRIVATE_DIR/timer-startup-console-request.json"
--maintenance-reference-file "$PRIVATE_DIR/php-maintenance-reference.json"
--plan-file "$PRIVATE_DIR/timer-startup-plan.json"
)
deploy-cli host runtime-startup timers plan "${TIMER_STARTUP_ARGS[@]}"
deploy-cli host runtime-startup timers apply "${TIMER_STARTUP_ARGS[@]}" \
--plan-sha256 "$TIMER_STARTUP_PLAN_SHA256" --approve-privileges
The CLI first starts only the three .timer units, checks active/waiting, then creates three links in timers.target.wants and verifies enabled through a new SSH connection. The files retain OnActiveSec=30min and OnUnitActiveSec=30min: an initial run 30 minutes after timer activation, then an interval from the last activation of the associated service. This is not a calendar schedule or an exact-second guarantee: AccuracySec is 1min.
At observation, maintenance services were inactive/dead with Result=success; timers were active/waiting and enabled. This establishes a ready schedule, not a new cleanup happening at that instant.
One reboot of the complete CLI fixture
After the separately completed PHP, data-service, Nginx and timer steps, we performed one ordinary systemctl --check-inhibitors=yes reboot. This was an operator command on the local educational VM; a general managed-reboot CLI command was not part of this run. A new login through the independent serial console confirmed the same machine and a changed boot ID.
In the new boot, the CLI only read state. PHP-FPM, Nginx, MySQL, Redis and Elasticsearch were active/running and enabled; the firewall was active/exited; all three timers were active/waiting and enabled. Both PHP pools again executed an HTTP request, and all 20 control requests had their expected statuses.
MySQL and Redis retained control data and denials outside the allowed scope. Elasticsearch returned green through setup_ops with TLS and CA verification; all three application roles still received 403 for cluster health and an unrelated index. vm.max_map_count was 1048576 after boot.
Before reboot, we recorded 90 files, including 57 journal files and the package status. After the new boot, all those bytes remained unchanged. systemd restored the services; the CLI readers did not repeat installation, data initialization, site writes or the original maintenance oneshots. The separate timer reader receives the original plan and a new console request:
deploy-cli host runtime-startup timers boot-verify "${TIMER_STARTUP_ARGS[@]}" \
--plan-sha256 "$TIMER_STARTUP_PLAN_SHA256" \
--manifest-sha256 "$TIMER_STARTUP_MANIFEST_SHA256" \
--new-boot-request-file "$PRIVATE_DIR/new-boot-console-request.json" \
--output-file "$PRIVATE_DIR/timer-new-boot-proof.json"
This run completes startup acceptance of the local stack. Public ingress, application delivery, scheduled package upgrades and the general CLI setup wizard have separate next steps.


