Cron et PHP 7.4

Bonjour,

J’ai fait une mise à jour vers PHP7.4 qui m’était proposée automatiquement par Debian, puis j’ai supprimé les paquets 7.4 (les 7.3 avaient été installés aussi) à cause de problèmes de mise à jour avec Nextcloud.

Seulement on dirait que ça a cassé quelque chose avec Cron qui cherche toujours les paquets 7.4. Comment je peux refaire fonctionner Cron avec PHP7.3 ?

Voici le message automatique reçu par mail suite à l’échec de la tâche cron :

/etc/cron.daily/logrotate:
logrotate_script: 2: logrotate_script: /usr/lib/php/php7.4-fpm-reopenlogs: not found
error: error running non-shared postrotate script for /var/log/php7.4-fpm.log of '/var/log/php7.4-fpm.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Merci d’avance pour votre aide !

Bonjour,
je n’ai pas de soucis en ce moment avec les dépendances de php, j’ai en effet le dépôt sury et sont installés php-7.0, php-7.3, php-7.4. J’ai aussi OnlyOffice ajouté à Nextcloud pour la collaboration…

Si jamais cela peut aider, je peux te dire ce que je vois dans lograte pour Nextcloud:

# cat /etc/logrotate.d/nextcloud 
/var/log/nextcloud/*.log {
		# Rotate if the logfile exceeds 100Mo
	size 100M
		# Keep 12 old log maximum
	rotate 12
		# Compress the logs with gzip
	compress
		# Compress the log at the next cycle. So keep always 2 non compressed logs
	delaycompress
		# Copy and truncate the log to allow to continue write on it. Instead of move the log.
	copytruncate
		# Do not do an error if the log is missing
	missingok
		# Not rotate if the log is empty
	notifempty
		# Keep old logs in the same dir
	noolddir
	
}

Sinon autre chemins,

# cat /var/log/php7.4-fpm.log
[17-Feb-2020 06:25:06] NOTICE: error log file re-opened
[22-Feb-2020 23:07:05] NOTICE: Terminating ...
[22-Feb-2020 23:07:05] NOTICE: exiting, bye-bye!
[22-Feb-2020 23:07:06] NOTICE: fpm is running, pid 27433
[22-Feb-2020 23:07:06] NOTICE: ready to handle connections
[22-Feb-2020 23:07:06] NOTICE: systemd monitor interval set to 10000ms
[22-Feb-2020 23:07:52] NOTICE: Terminating ...
[22-Feb-2020 23:07:52] NOTICE: exiting, bye-bye!
[22-Feb-2020 23:07:52] NOTICE: fpm is running, pid 23931
[22-Feb-2020 23:07:52] NOTICE: ready to handle connections
[22-Feb-2020 23:07:52] NOTICE: systemd monitor interval set to 10000ms
[22-Feb-2020 23:08:26] NOTICE: Terminating ...
[22-Feb-2020 23:08:26] NOTICE: exiting, bye-bye!
[22-Feb-2020 23:08:26] NOTICE: fpm is running, pid 7443
[22-Feb-2020 23:08:26] NOTICE: ready to handle connections
[22-Feb-2020 23:08:26] NOTICE: systemd monitor interval set to 10000ms

# cat /usr/lib/php/php7.4-fpm-reopenlogs 
#!/bin/sh
CONFFILE=/etc/php/7.4/fpm/php-fpm.conf
[ -r /etc/default/php7.4-fpm ] && . /etc/default/php7.4-fpm
CONF_PIDFILE=$(sed -n 's/^[[:space:]]*pid[[:space:]]*=[[:space:]]*//p' $CONFFILE)
PIDFILE=${CONF_PIDFILE:-/run/php/php7.4-fpm.pid}
[ -r "$PIDFILE" ] && kill -USR1 $(cat "$PIDFILE") > /dev/null
exit 0

Est-ce que tu es sûr que ton soucis vienne de dépendances de Nextcloud ?

Du coup si tu as supprimé php7.4, tu devrais aussi supprimer ce fichier ? C’est peut-être lui qui coince ?

/usr/lib/php/php7.4-fpm-reopenlogs

J’ai réinstallé php7.4-fpm, nextcloud fonctionne. J’attends que le cron se lance pour voir si ça a réglé le problème.

Edit après 1 semaine : Cron s’est lancé, on dirait que y a pas de problème :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.