Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[pure-ftpd] patcher le script d'init
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
selyne
n00b
n00b


Joined: 07 May 2008
Posts: 63

PostPosted: Fri Sep 12, 2008 6:15 pm    Post subject: [pure-ftpd] patcher le script d'init Reply with quote

coucou a tous :wink:

j'ai installé Pure-ftpd et ça ne veux pas démarrer ça me dit:

Code:
* Caching service dependencies ...                                       [ ok ]
 * Starting Pure-FTPd ...
 * Could not launch Pure-FTPd                                             [ !! ]


il y a un bug de referencé pour l'init script : https://bugs.gentoo.org/173365

à priori il y a un patch qui corrige le le problème.

mais je ne sais pas comment appliquer un patch a un script d'init ? :oops:

j'ai pas trouver comment faire alors j'ai modifié le script a la main mais ça ne marche pas.

le patch c'est ça :

Code:
--- pure-ftpd.rc6   2007-07-05 14:45:22.000000000 +0000
+++ pure-ftpd   2007-07-04 13:27:24.000000000 +0000
@@ -18,10 +18,11 @@
    checkconfig || return 1
    UPSCRIPT=""
    if [ -n "$UPLOADSCRIPT" ] ; then
+      OKNODO="--oknodo" #Pure-ftpd don't actually start until pure-uploadscript starts
       UPSCRIPT="--uploadscript"
    fi
    ebegin "Starting Pure-FTPd"
-   start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/pure-ftpd.pid --exec /usr/sbin/pure-ftpd -- $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG $TIMEOUT $CHARCONV $MISC_OTHER $UPSCRIPT
+   start-stop-daemon --start --quiet --make-pidfile $OKNODO --pidfile /var/run/pure-ftpd.pid --exec /usr/sbin/pure-ftpd -- $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG $TIMEOUT $CHARCONV $MISC_OTHER $UPSCRIPT
    result=$?
    if [ $result -ne 0 ] ; then
       eend 1 "Could not launch Pure-FTPd"


et maintenant mon script c'est ça:

Code:
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-ftp/pure-ftpd/files/pure-ftpd.rc6,v 1.11 2008/04/18 11:00:43 chtekk Exp $

depend() {
   need net
}

checkconfig() {
   if [ -z "$IS_CONFIGURED" ] ; then
      eerror "You need to setup /etc/conf.d/pure-ftpd first!"
      return 1
   fi
}

start() {
   checkconfig || return 1
   OKNODO=""   
   UPSCRIPT=""
      if [ -n "$UPLOADSCRIPT" ] ; then
      OKNODO="--oknodo"      
      UPSCRIPT="--uploadscript"
      
   fi
   ebegin "Starting Pure-FTPd"
   start-stop-daemon --start --quiet --make-pidfile $OKNODO --pidfile /var/run/pure-ftpd.pid --exec /usr/sbin/pure-ftpd -- $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG $TIMEOUT $CHARCONV $MISC_OTHER $UPSCRIPT
    
   result=$?
   if [ $result -ne 0 ] ; then
      eend 1 "Could not launch Pure-FTPd"
   else
      eend $result
      if [ -n "$UPLOADSCRIPT" ] ; then
         ebegin "Starting Pure-FTPd upload script"
         start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/pure-uploadscript.pid --exec /usr/sbin/pure-uploadscript -- -B -r $UPLOADSCRIPT
         eend $?
      fi
   fi
}

stop() {
   ebegin "Stopping Pure-FTPd"
   start-stop-daemon --stop --retry 20 --quiet --pidfile /var/run/pure-ftpd.pid
   eend $?
   if [ -n "$UPLOADSCRIPT" ] ; then
      ebegin "Stopping Pure-FTPd upload script"
      start-stop-daemon --stop --retry 20 --quiet --pidfile /var/run/pure-uploadscript.pid
      eend $?
   fi
}


ok j'imagine que la bonne methode c'est pas editer le fichier et le corriger avec ses petites papattes mais je me suis dis ça devrait être la même chose à l'arrivée! be non perdu selyne :?

qu'est ce que je pourrais faire :?:

merci d'avance
Back to top
View user's profile Send private message
Jamesbch
Apprentice
Apprentice


Joined: 30 Sep 2007
Posts: 185

PostPosted: Fri Sep 12, 2008 7:07 pm    Post subject: Reply with quote

Salut,

il me semble que `patch` fasse ce que tu demandes. Je ne l'ai jamais utilisé mais je l'ai trouvé il y a un moment. Il prend en paramètre le fichier à patché et le fichier patch. Plus d'info avec `man patch`.

Bonne chance, en espérant t'avoir aidé.
Back to top
View user's profile Send private message
selyne
n00b
n00b


Joined: 07 May 2008
Posts: 63

PostPosted: Fri Sep 12, 2008 9:24 pm    Post subject: Reply with quote

chic j'ai appris a patcher 8) !

merci pour l'info, en fait c'était fastoche

par contre je ne comprends pas une chose, deja biensur ça ne marche pas (selyne inside) et en plus l'erreur est bizarre:

Code:
Hunk #1 FAILED at 18.
1 out of 1 hunk FAILED -- saving rejects to file /etc/init.d/pure-ftpd.rej


mais en fait en ligne 18 il y a ce qu'il lui faut je ne comprends pas pourquoi ça ne fonctionne pas.

avant de patcher j'ai re emerger pure-ftpd pour avoir un script stock! j'avais fait un back up mais bon, on sait jamais.

et donc je sais comment on patch maintenant merci james :P

mais ça veut pas marcher pour ce fichier :( la loooose.

personne aurait un script d'init qui marche pour pure-ftpd-1.0.21-r1 ? à votre bon coeur

merci :)
Back to top
View user's profile Send private message
Bio
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 197
Location: Geneva which should be in Switzerland...

PostPosted: Sat Sep 13, 2008 12:23 pm    Post subject: Reply with quote

AMHA ce n'est pas ton init script qui est en cause. A ta place je resterai avec la version originale. J'ai un pure-ftpd-1.0.21-r1 qui tourne sans problème et je n'ai pas eu besoin de patcher quoi que ce soit.

Tu devrais plutôt regarder du côté des options de lancements de pure-ftpd à mon avis c'est là que ça coince : /etc/conf.d/pure-ftpd, et le site de référence : http://download.pureftpd.org/pub/pure-ftpd/doc/README

Tu peux aussi regarder ce que disent tes logs après une tentative de démarrage de pure-ftp?
_________________
I'm all in !
Back to top
View user's profile Send private message
NEOxAKIRA
Guru
Guru


Joined: 20 May 2007
Posts: 302
Location: France

PostPosted: Sat Sep 13, 2008 12:41 pm    Post subject: Reply with quote

j'ai ce problème là aussi avec pure-ftpd 1.0.21-r1 au boot de ma machine, par contre je sais pas si t'a remarqué, bien que ça affiche que le serveur ftp a pas pu se lancer, le ftp est bien en route...

remarque : je n'ai jamais touché au init script, ni a un quelconque patch concernant pure-ftpd
Back to top
View user's profile Send private message
selyne
n00b
n00b


Joined: 07 May 2008
Posts: 63

PostPosted: Sat Sep 13, 2008 2:17 pm    Post subject: Reply with quote

ben non justement :(

quand je tape /etc/init.d/pure-ftpd start ça ne marche pas, je ne peux pas me connecter en local.

si par contre je tape en console en root, pure-ftpd, là ça marche je peux me connecter.

et le bug collait exactement avec mon fichier de config c'est pour ça que je me battais avec.
Back to top
View user's profile Send private message
NEOxAKIRA
Guru
Guru


Joined: 20 May 2007
Posts: 302
Location: France

PostPosted: Sat Sep 13, 2008 3:55 pm    Post subject: Reply with quote

selyne wrote:
quand je tape /etc/init.d/pure-ftpd start ça ne marche pas, je ne peux pas me connecter en local.


pareil, sauf que je peux me connecter en local...
alors que pure-ftpd n'est pas affiché comme étant démarré.

Je précise que ça me le fait pas à chaque fois que je boot, que quelques fois.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum