php / php/php-src

Use of PIDFile= in php-fpm.service

Open Beginner friendly
#21,740 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug SAPI: fpm Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.2k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the php-fpm.service unit and read its PIDFile= setting alongside the default php-fpm.conf, where pid = is commented out. Review the systemd.service(5) guidance linked in the issue, then verify that removing the directive leaves the service definition unchanged in behavior and that the unit no longer contains PIDFile=.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devops
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.