[Résolu] Pb fetchmail après migration 64bits

Bonsoir,

Matériel: RaspBerry PI 4B 8Go
Version de YunoHost: 11.0.10.2 (stable). 64bits
J’ai accès à mon serveur : En SSH et par la webadmin

J’ai un problème… suite à la migration 32 vers 64bits… je n’arrive plus à faire fonctionner fetchmail…

J’assaille d’utiliser la solution de benou :
https://forum.yunohost.org/t/guide-to-setting-up-fetchmail-on-yunohost/16761
et cela ne fonctionne pas!

$ sudo systemctl daemon-reload
$ sudo service fetchmail stop
$ sudo service fetchmail start
Job for fetchmail.service failed because the control process exited with error code.
See "systemctl status fetchmail.service" and "journalctl -xe" for details.
$ systemctl status fetchmail.service
● fetchmail.service - LSB: init-Script for system wide fetchmail daemon
     Loaded: loaded (/etc/init.d/fetchmail; generated)
     Active: failed (Result: exit-code) since Wed 2022-12-21 01:03:56 CET; 9s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 5320 ExecStart=/etc/init.d/fetchmail start (code=exited, status=1/FAILURE)
        CPU: 40ms
$ sudo journalctl -xe
Dec 21 01:06:00 bidule.fr systemd[1]: Failed to start LSB: init-Script for system wide fetchmail daemon.
░░ Subject: A start job for unit fetchmail.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit fetchmail.service has finished with a failure.
░░ 
░░ The job identifier is 2114 and the job result is failed.
Dec 21 01:06:00 bidule.fr sudo[5440]: pam_unix(sudo:session): session closed for user root
Dec 21 01:06:04 bidule.fr sudo[5458]:    admin : TTY=pts/0 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Dec 21 01:06:04 bidule.fr sudo[5458]: pam_unix(sudo:session): session opened for user root(uid=0) by admin(uid=1007)

Une idée ?

JM

Et la commande:

$ fetchmail -c
fetchmail: no mailservers have been specified.

retourne ça!
Pourquoi elle me retourne ça… Le fichier de conf fonctionne sur la version 32bits!

JM

Pour que cela fonctionne comme sur mon YunoHost 32bits, je force l’utilisateur vmail:

$ sudo vim /etc/init.d/fetchmail
...
...
#USER=fetchmail
USER=vmail
...
...
$

Et je donne des droits à certain répertoires:

$
$ sudo chown vmail /var/run/fetchmail
$
...
# chown vmail /var/lib/fetchmail

Mais malgré cela, ça ne fonctionne pas!
Une idée ?

JM

Suite au message de benou du 27 janvier:
https://forum.yunohost.org/t/beta-stage-testing-for-yunohost-11-0-bullseye-and-buster-bullseye-migration/18531/26?page=2

J’ai trouvé la solution…
Il faut créer un répertoire:
/var/vmail
avec comme droit: vmail:mail

# ls -l /var/ | grep vmail
drwxr-xr-x   2 vmail     mail          4096 Dec 21 14:25 vmail

Dedans y coller le fichier: fetchmailrc
avec les bons droits:

# ls -l /var/vmail/
total 4
-rw------- 1 vmail mail 509 Dec 21 13:53 fetchmailrc

On peut éventuellement tester par:

# sudo -u vmail fetchmail --daemon 0 -v -f /var/vmail/fetchmailrc

Puis créer une tache crontab:

# sudo -u vmail crontab -l
...
...
@reboot         fetchmail -d 120 -f /var/vmail/fetchmailrc

Y a plus qu’à redémarrer, puis:

# ps -ef | grep fetchmail 
vmail       1454       1  0 14:25 ?        00:00:00 fetchmail -d 120 -f /var/vmail/fetchmailrc
root        2712    2421  0 14:37 pts/0    00:00:00 grep fetchmail

Voilou,

JM

Ne pas oublier pour faire cette solution de désactiver le démarrage automatique de fetchmail, dans:

$ cat /etc/default/fetchmail
...
...
START_DAEMON=no
...

JM

Petit ajout pour les néophytes… Pour obtenir le prompt root:

#

pour y taper les commandes plus haut… il faut faire un:

$ sudo su -
#

Voilou,

JM

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