0

I am on Ubuntu server 20.04, running LAMP with php7.4-fpm.

I just performed the latest update/upgrade and confirmed everything was working correctly:

● 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

Then several minutes later... my Nextcloud installation suddenly stops syncing, so I re-check the status of php-fpm and I get:

● 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.`

And, quite literally, /lib/systemd/system/php7.4-fpm.service no longer exists

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

I checked syslog to see what was happening when the service was masked according to the timestamp... and there is simply nothing in the log to explain what's happening:

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

Things I tried to fix this:

When I attempt to unmask php7.4-fpm using systemctl unmask php7.4-fpm, two things happen:

  1. /etc/systemd/system/php7.4-fpm.service is removed. /etc/systemd/system/php7.4-fpm.service is a symlink to /dev/null

  2. php7.4-fpm.service is started using 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

If I try to reinstall php7.4fpm using apt-get install --reinstall php7.4-fpm I get:

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.

All of the above steps are based upon this post: https://askubuntu.com/questions/804946/systemctl-how-to-unmask

I am currently stuck with broken packages

Yes, I have tried:
apt install -f
dpkg --configure -a

Nothing is helping.. Anyone know how to get PHP reinstalled?

  • Cross-posted: https://askubuntu.com/questions/1425688/something-is-masking-removing-php7-4-fpm-service https://superuser.com/questions/1739035/something-is-masking-removing-php7-4-fpm – muru Aug 26 '22 at 02:45

1 Answers1

0

This problem fundamentally seems to be a packaging problem with the upstream ubuntu repos that maintainers probably need some time to address.

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.

In the meanwhile, the one and only solution to this problem seems to be that -before- you do the latest php update... ensure that you have this repo installed on your machine:

sudo add-apt-repository ppa:ondrej/php

If this repo is installed before your update, you can avoid the nightmare above.