php-fpm.service.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # It's not recommended to modify this file in-place, because it
  2. # will be overwritten during upgrades. If you want to customize,
  3. # the best way is to use the "systemctl edit" command.
  4. [Unit]
  5. Description=The PHP FastCGI Process Manager
  6. After=network.target
  7. [Service]
  8. Type=@php_fpm_systemd@
  9. PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
  10. ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
  11. ExecReload=/bin/kill -USR2 $MAINPID
  12. # Set up a new file system namespace and mounts private /tmp and /var/tmp directories
  13. # so this service cannot access the global directories and other processes cannot
  14. # access this service's directories.
  15. PrivateTmp=true
  16. # Mounts the /usr, /boot, and /etc directories read-only for processes invoked by this unit.
  17. ProtectSystem=full
  18. # Sets up a new /dev namespace for the executed processes and only adds API pseudo devices
  19. # such as /dev/null, /dev/zero or /dev/random (as well as the pseudo TTY subsystem) to it,
  20. # but no physical devices such as /dev/sda.
  21. PrivateDevices=true
  22. # Explicit module loading will be denied. This allows to turn off module load and unload
  23. # operations on modular kernels. It is recommended to turn this on for most services that
  24. # do not need special file systems or extra kernel modules to work.
  25. ProtectKernelModules=true
  26. # Kernel variables accessible through /proc/sys, /sys, /proc/sysrq-trigger, /proc/latency_stats,
  27. # /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq will be made read-only to all processes
  28. # of the unit. Usually, tunable kernel variables should only be written at boot-time, with the
  29. # sysctl.d(5) mechanism. Almost no services need to write to these at runtime; it is hence
  30. # recommended to turn this on for most services.
  31. ProtectKernelTunables=true
  32. # The Linux Control Groups (cgroups(7)) hierarchies accessible through /sys/fs/cgroup will be
  33. # made read-only to all processes of the unit. Except for container managers no services should
  34. # require write access to the control groups hierarchies; it is hence recommended to turn this on
  35. # for most services
  36. ProtectControlGroups=true
  37. # Any attempts to enable realtime scheduling in a process of the unit are refused.
  38. RestrictRealtime=true
  39. # Restricts the set of socket address families accessible to the processes of this unit.
  40. # Protects against vulnerabilities such as CVE-2016-8655
  41. RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
  42. # Takes away the ability to create or manage any kind of namespace
  43. RestrictNamespaces=true
  44. [Install]
  45. WantedBy=multi-user.target