Le démarrage du service fonctionne pourtant lorsque je passe par gproftpd et pas si je le lance sans lui. Alors, comment savoir pourquoi ? Quelle est la différence entre le lancement du service par l'outil de config des services et le bouton "activer" de gproftpd ?
A priori, gproftpd n'est qu'une interface qui permer d'éditer /etc/proftpd.conf ou est-ce que je me trompe ?
Sinon, si ça peut être utile, voici mon proftpd.conf actuel :
-- COPIE --
ServerType standalone
DefaultServer on
Umask 022
ServerName "0.0.0.0"
ServerIdent off ""
ServerAdmin
Admin@this.domain.topdomain
IdentLookups off
UseReverseDNS off
Port 21
PassivePorts 49152 65534
#MasqueradeAddress None
TimesGMT off
MaxInstances 30
MaxLoginAttempts 3
TimeoutLogin 300
TimeoutNoTransfer 240
TimeoutIdle 240
DisplayLogin welcome.msg
DisplayFirstChdir .message
User nobody
Group nobody
DirFakeUser off nobody
DirFakeGroup off nobody
DefaultTransferMode binary
AllowForeignAddress on
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
TransferRate RETR 30
TransferRate STOR 40
TransferRate STOU 40
TransferRate APPE 40
SystemLog /var/log/secure
RequireValidShell off
#gp_random_username_length 6
#gp_random_password_length 6
#gp_randomize_case lower
#gp_useradd_homedir_path /var/ftp
#gp_useradd_upload_path /upload
#gp_html_path /var/www/html/ftp.htm
#gp_welcome_name welcome.msg
<IfModule mod_tls.c>
TLSEngine off
TLSRequired off
TLSVerifyClient off
TLSProtocol TLSv1
TLSLog /var/log/proftpd_tls.log
TLSRSACertificateFile /etc/gproftpd/gproftpd.pem
</IfModule>
<Limit LOGIN>
AllowUser anonymous
AllowUser webmaster
DenyALL
</Limit>
<Anonymous /var/ftp>
User anonymous
Group standard
AnonRequirePassword off
MaxClients 5 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayFirstChdir .msg
<Limit LOGIN>
Allow from all
Deny from all
</Limit>
<Limit LIST NLST RETR PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit STOR STOU APPE RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM >
DenyAll
</Limit>
</Anonymous>
<Anonymous /var/www>
User webmaster
Group web
AnonRequirePassword on
MaxClients 5 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayFirstChdir .msg
<Limit LOGIN>
Allow from all
Deny from all
</Limit>
<Limit LIST NLST RETR DELE PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit STOR STOU APPE RNFR RNTO MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM >
DenyAll
</Limit>
<Directory /var/www/cgi-bin>
AllowOverwrite on
<Limit LIST NLST STOR STOU APPE RETR RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit NOTHING >
DenyAll
</Limit>
</Directory>
<Directory /var/www/html>
AllowOverwrite on
<Limit LIST NLST STOR STOU APPE RETR RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit NOTHING >
DenyAll
</Limit>
</Directory>
</Anonymous>
-- FIN DE COPIE --
EDIT #1 :
------------
Aussi, voici ce que j'ai dans /var/log/messages quand je cherche à démarrer le service proftpd via l'outil de config des services :
-- COPIE --
Nov 3 11:27:05 localhost kernel: audit(1162549625.047:30): avc: denied { use } for pid=11669 comm="proftpd" name="null" dev=tmpfs ino=1127 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:xdm_t:s0-s0:c0.c255 tclass=fd
Nov 3 11:27:05 localhost kernel: audit(1162549625.047:31): avc: denied { write } for pid=11669 comm="proftpd" name="[19312]" dev=pipefs ino=19312 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:unconfined_t:s0 tclass=fifo_file
Nov 3 11:27:05 localhost kernel: audit(1162549625.047:32): avc: denied { write } for pid=11669 comm="proftpd" name="[19312]" dev=pipefs ino=19312 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:unconfined_t:s0 tclass=fifo_file
Nov 3 11:27:05 localhost kernel: audit(1162549625.059:33): avc: denied { read } for pid=11669 comm="proftpd" name="proftpd.conf" dev=dm-0 ino=720989 scontext=system_u:system_r:ftpd_t:s0 tcontext=root:object_r:rpm_script_tmp_t:s0 tclass=file
-- FIN DE COPIE ---
Alors qu'il n'y a rien (service bien démarré) lorsque je passe par gproftpd.
EDIT # 2 :
------------
Je continue à chercher et voici confirmation que le service proftpd ne se lance pas, alors que rien ne bloque le port 21 :
-- COPIE --
[root@localhost ~]# netstat --listen -n -p | grep :21
[root@localhost ~]# service proftpd start
Starting proftpd: [ÉCHOUÉ]
[root@localhost ~]# tail -1 /var/log/messages
Nov 3 11:46:33 localhost kernel: audit(1162550793.316:3022): avc: denied { read } for pid=12242 comm="proftpd" name="proftpd.conf" dev=dm-0 ino=720989 scontext=root:system_r:ftpd_t:s0 tcontext=root:object_r:rpm_script_tmp_t:s0 tclass=file
[root@localhost ~]#
-- FIN COPIE --
Mais comment donc fait gproftpd pour réussir à le lancer (ce service proftpd) ?
EDIT # 3 :
------------
Il me semble que gproftpd ne lance pas proftpd en tant que service : si je fais "proftpd" et [enter] en terminal, le serveur est correctement lancé (donné pour "activated" ds gproftpd et accessible). Alors, il reste à savoir pourquoi celà ne fonctionne pas qd je tente de le lancer en tant que service (au démarrage ou plus tard) par "service proftpd start"...
EDIT # 4 :
------------
Bien, j'avance. J'ai compris que le subsys verouillé signifiait que des fichiers de verouillages (ou d'indication de processus lancé) étaient restés derrière alors que le service s'était arrêté.
A partir de ce point, j'ai tenté de supprimer le fichier "/var/lock/subsys/proftpd" avant de tenter un démarrage du service (via "service proftpd start" donc, pas "proftpd" tout court) : c'est idem, toujours le même message d'erreur "proftpd mort mais subsys...".
Ensuite, j'ai repéré un répertoire "/var/run/proftpd" contenant deux fichiers : proftpd.scoreboard et proftpd.delay. J'ai brutalement renommé ce répertoire en "/var/run/OLDproftpd" pour qu'il ne gène plus et là ça marche : un "service proftpd start" démarre correctement le service ("proftpd (pid 12870) en cours d'exécution..." visible dans l'outil de config des services ou via "chkconfig --list"). Par contre, à noter qu'aucun répertoire "/var/run/proftpd" n'a été recréé.
A ce stade, je pensais avoir avancé, mais un arrêt du service et nouveau démarrage me montre que non : j'obtiens de nouveau le message d'erreur "proftpd est mort mais subsys est verrouillé" alors qu'il n'y a pas de répertoire "/var/run/proftpd" ni de fichier "/var/lock/subsys/proftpd".
le log messages dit de nouveau :
-- COPIE --
Nov 3 12:53:19 localhost kernel: audit(1162554799.811:3056): avc: denied { use } for pid=13436 comm="proftpd" name="null" dev=tmpfs ino=1127 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:xdm_t:s0-s0:c0.c255 tclass=fd
Nov 3 12:53:19 localhost kernel: audit(1162554799.811:3057): avc: denied { write } for pid=13436 comm="proftpd" name="[29981]" dev=pipefs ino=29981 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:unconfined_t:s0 tclass=fifo_file
Nov 3 12:53:19 localhost kernel: audit(1162554799.811:3058): avc: denied { write } for pid=13436 comm="proftpd" name="[29981]" dev=pipefs ino=29981 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_u:system_r:unconfined_t:s0 tclass=fifo_file
Nov 3 12:53:19 localhost kernel: audit(1162554799.823:3059): avc: denied { read } for pid=13436 comm="proftpd" name="proftpd.conf" dev=dm-0 ino=720989 scontext=system_u:system_r:ftpd_t:s0 tcontext=root:object_r:rpm_script_tmp_t:s0 tclass=file
-- FIN DE COPIE --
Pourquoi est-ce que ça a marché une fois (en renommant "/var/run/proftpd" pourt qu'il ne le trouve pas) et plus ensuite ?