正在屏蔽/删除 PHP7.4-FPM

正在屏蔽/删除 PHP7.4-FPM

我在 Ubuntu 服务器 20.04 上,运行带有 php7.4-fpm 的 LAMP。

我刚刚执行了最新的更新/升级并确认一切正常:

● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-08-26 00:50:45 CST; 7min ago
       Docs: man:php-fpm7.4(8)
   Main PID: 120871 (php-fpm7.4)
     Status: "Processes active: 0, idle: 2, Requests: 24, slow: 0, Traffic: 0.1req/sec"
      Tasks: 3 (limit: 4380)
     Memory: 80.8M
     CGroup: /system.slice/php7.4-fpm.service
             ├─120871 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
             ├─120892 php-fpm: pool www
             └─120893 php-fpm: pool www

几分钟后...我的 Nextcloud 安装突然停止同步,因此我重新检查 php-fpm 的状态并得到:

● php7.4-fpm.service
     Loaded: masked (Reason: Unit php7.4-fpm.service is masked.)
     Active: inactive (dead) since Fri 2022-08-26 01:07:14 CST; 5min ago
   Main PID: 120871 (code=exited, status=0/SUCCESS)
     Status: "Processes active: 0, idle: 2, Requests: 44, slow: 0, Traffic: 0req/sec"

Aug 26 01:07:14 admin.example.com systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...
Aug 26 01:07:14 admin.example.com systemd[1]: php7.4-fpm.service: Succeeded.
Aug 26 01:07:14 admin.example.com systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.
Warning: journal has been rotated since unit was started, output may be incomplete.`

而且实际上/lib/systemd/system/php7.4-fpm.service已经不存在了

# stat /lib/systemd/system/php7.4-fpm.service
stat: cannot stat '/lib/systemd/system/php7.4-fpm.service': No such file or directory

我检查了syslog根据时间戳屏蔽服务时发生的情况......但日志中根本没有任何内容可以解释发生了什么:

Aug 26 01:07:14 admin systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.
Aug 26 01:07:14 admin systemd[1]: php7.4-fpm.service: Succeeded.
Aug 26 01:07:14 admin systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...
Aug 26 01:07:14 admin systemd[1]: Configuration file /etc/systemd/system/gitea.service is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.
Aug 26 01:07:14 admin systemd[1]: Reloading.
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module readline for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module pspell for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module ctype for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module redis for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module dom for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module soap for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module iconv for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module apcu_bc for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module phar for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module mysqlnd for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module imap for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module xsl for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module sysvshm for PHP 7.4 fpm sapi

更新: 当我尝试使用 揭示 php7.4-fpm 时systemctl unmask php7.4-fpm,发生了两件事:

  1. /etc/systemd/system/php7.4-fpm.service被删除。/etc/systemd/system/php7.4-fpm.service是 /dev/null 的符号链接

  2. php7.4-fpm.service 已使用以下方式启动init.d

● php7.4-fpm.service - LSB: starts php7.4-fpm
     Loaded: loaded (/etc/init.d/php7.4-fpm; generated)
     Active: active (exited) since Fri 2022-08-26 09:09:10 CST; 6min ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 0 (limit: 4380)
     Memory: 0B
     CGroup: /system.slice/php7.4-fpm.service

如果我尝试使用以下方法重新安装 php7.4fpm,apt-get install --reinstall php7.4-fpm我会得到:

root@admin:~# apt-get install --reinstall php7.4-fpm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.4-fpm : Depends: php7.4-common (= 7.4.3-4ubuntu2.12) but 7.4.3-4ubuntu2.13 is to be installed
E: Unable to correct problems, you have held broken packages.

以上所有步骤均基于此帖子: https://askubuntu.com/questions/804946/systemctl-how-to-unmask

我目前被破损的包裹困住了

是的,我尝试过:
apt install -f
dpkg --configure -a

没什么帮助。

答案1

从根本上来说,这个问题似乎是上游 ubuntu 存储库的打包问题,维护人员可能需要一些时间来解决。

The following packages have unmet dependencies:
 php7.4-fpm : Depends: php7.4-common (= 7.4.3-4ubuntu2.12) but 7.4.3-4ubuntu2.13 is to be installed
E: Unable to correct problems, you have held broken packages.

与此同时,解决这个问题的唯一办法似乎是-前-您执行了最新的 php 更新...确保您的机器上安装了这个 repo:

sudo add-apt-repository ppa:ondrej/php

如果在更新之前安装了这个 repo,您​​可以避免上述的噩梦。

相关内容