php / php/php-src

Use of PIDFile= in php-fpm.service

Offen Anfängerfreundlich
#21,740 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bug SAPI: fpm Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

When using Type=simple or Type=notify services, the process executed in ExecStart= is monitored directly by systemd and is automatically the main PID. The use of PIDFile= is useless and discouraged by the systemd.service(5) manual page:

Note that PID files should be avoided in modern projects. Use Type=notify, Type=notify-reload or Type=simple where possible, which does not require use of PID files to determine the main process of a service and avoids needless forking.

Source: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#PIDFile=

Furthermore, the default configuration of php-fpm.conf has pid = commented out, which is equivalent to not having a PID file.

From systemd's point of view, the service remains exactly the same without the PIDFile= directive. I suggest, therefore, that it be dropped.

PHP Version
PHP 8.5.5 (cli) (built: Apr  8 2026 14:36:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.5, Copyright (c), by Zend Technologies
Operating System

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Unit php-fpm.service zu finden und ihre Einstellung PIDFile= zusammen mit der standardmäßigen php-fpm.conf zu lesen, in der pid = auskommentiert ist. Sieh dir anschließend die im Issue verlinkte Anleitung zu systemd.service(5) an und überprüfe dann, dass das Entfernen der Direktive das Verhalten der Servicedefinition unverändert lässt und die Unit PIDFile= nicht mehr enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
devops
Issue-Typ
Refactoring
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.