okay, but si on lit la citation que j’ai faite, intitulée : 2°) Configuration en mode inetd :
et qui finit par cette ligne : service xinetd restart
je n’ai pas l’impression de mélanger, juste de suivre à la lettre ce qui est écrit lol.
Je pourrais aussi suivre à la lettre ce que tu m’a conseillé, de le configurer en mode standalone, mais pour le moment je ne le fait pas pour plusieurs raisons :
-
[quote=“usinagaz”]Avant de le tester en standalone, comme je googlisais un peu, je suis tombé sur un exemple de config pour lancer proftpd en mode indetd[/quote], ainsi, je persevère en inetd, sans désespérer de trouver un bon tuto qui explique comment faire.
-
On nous laisse le choix entre : inetd ou standalone, bien; moi j’ai choisi inetd (manque de bol mais bon… il est dit nul part que ce mode est réservé aux personnes confirmées). Comme j’aime pas qu’on me propose le choix entre m’arracher les cheveux et bien m’amuser, en me disant que c’est pareil, que dans tous les cas je vais bien m’amuser, ce que fait la config de proftpd en me laissant le choix sans autres explications, je cherche à savoir pourquoi inetd ça veut pas, avant de me rabattre sur une autre solution, de facilité …
-
Et je me dis que, puisque inetd ne coule pas de source, je vais m’y atteler, avec votre aide enfin …
Là je me demande juste pourquoi je n’ai pas de repertoire xinetd.d, de meta-daemon xinetd, alors qu’il en est question; bon, si je tente d’adapter, je vois une similitude entre ce qui est dit dans le tuto :
/etc/xinetd.d/proftpd (que je n’ai pas) et /etc/inetd/proftpd (que j’ai), et je suppose qu’il faut que je colle le code :
[quote]service ftp
{
disable = no
flags = REUSE
socket_type = stream
instances = 10
wait = no
protocol = tcp
user = root
server = /usr/local/sbin/in.proftpd
}
[/quote] dans mon fichier proftpd, ce que je fais, ça donne :
#!/bin/sh
# Start the proftpd FTP daemon.
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/proftpd
NAME=proftpd
# Defaults
RUN="no"
OPTIONS=""
# j'ajoute le code ici :
service ftp
{
disable = no
flags = REUSE
socket_type = stream
instances = 10
wait = no
protocol = tcp
user = root
server = /usr/local/sbin/in.proftpd
}
PIDFILE=`grep -i 'pidfile' /etc/proftpd.conf | sed -e 's/pidfile[\t ]\+//i'`
if [ "x$PIDFILE" = "x" ];
then
PIDFILE=/var/run/proftpd.pid
fi
# Read config (will override defaults)
[ -r /etc/default/proftpd ] && . /etc/default/proftpd
trap "" 1
trap "" 15
test -f $DAEMON || exit 0
#
# Servertype could be inetd|standalone|none.
# In all cases check against inetd and xinetd support.
#
if ! egrep -qi "^[[:space:]]*ServerType.*standalone" /etc/proftpd.conf
then
if [ $(dpkg-divert --list xinetd|wc -l) -eq 1 ]
then
if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf -o \
egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null
then
RUN="no"
INETD="yes"
else
if ! egrep -qi "^[[:space:]]*ServerType.*inetd" /etc/proftpd.conf
then
RUN="yes"
INETD="no"
else
RUN="no"
INETD="no"
fi
fi
else
if egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null
then
RUN="no"
INETD="yes"
else
if ! egrep -qi "^[[:space:]]*ServerType.*inetd" /etc/proftpd.conf
then
RUN="yes"
INETD="no"
else
RUN="no"
INETD="no"
fi
fi
fi
fi
start()
{
if start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec $DAEMON -- $OPTIONS ; then
echo "$NAME."
else
echo "."
fi
}
signal()
{
if [ "$1" = "stop" ]; then
SIGNAL="TERM"
else
if [ "$1" = "reload" ]; then
SIGNAL="HUP"
else
echo "ERR: wrong parameter given to signal()"
fi
fi
if start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"; then
echo "$NAME."
else
SIGNAL="KILL"
if start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"; then
echo "$NAME."
else
echo "."
fi
fi
if [ "$SIGNAL" = "KILL" ]; then
rm -f "$PIDFILE"
fi
}
case "$1" in
start)
if [ "x$RUN" = "xyes" ] ; then
echo -n "Starting ProFTPD ftp daemon: "
start
else
if [ "x$INETD" = "xyes" ] ; then
echo "ProFTPd is started from inetd/xinetd."
else
echo "ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
fi
fi
;;
force-start)
if [ "x$INETD" = "xyes" ] ; then
echo "Warning: ProFTPd is started from inetd/xinetd (trying to start anyway)."
fi
echo -n "Starting ProFTPD ftp daemon: "
start
;;
stop)
if [ "x$RUN" = "xyes" ] ; then
echo -n "Stopping ProFTPD ftp daemon: "
signal stop
else
if [ "x$INETD" = "xyes" ] ; then
echo "ProFTPd is started from inetd/xinetd."
else
echo "ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
fi
fi
;;
force-stop)
if [ "x$INETD" = "xyes" ] ; then
echo "Warning: ProFTPd is started from inetd/xinetd (trying to kill anyway)."
fi
echo -n "Stopping ProFTPD ftp daemon: "
signal stop
;;
reload)
echo -n "Reloading $NAME configuration..."
signal reload
echo " done."
;;
force-reload|restart)
if [ "x$RUN" = "xyes" ] ; then
echo -n "Restarting ProFTPD ftp daemon."
signal stop
echo -n "."
sleep 2
echo -n "."
start
echo " done."
else
if [ "x$INETD" = "xyes" ] ; then
echo "ProFTPd is started from inetd."
else
echo "ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
fi
fi
;;
*)
echo "Usage: /etc/init.d/$NAME {start|force-start|stop|force-stop|reload|restart|force-reload}"
exit 1
;;
esac
exit 0
et j’essai : # service initd restart
bash: service: command not found
ben voyons …
debian:/etc/init.d# /etc/init.d/proftpd restart
/etc/init.d/proftpd: line 13: service: command not found
disable: Operation failed: client-error-not-found
/etc/init.d/proftpd: line 16: flags: command not found
/etc/init.d/proftpd: line 17: socket_type: command not found
/etc/init.d/proftpd: line 18: instances: command not found
/etc/init.d/proftpd: line 19: wait: `=': not a pid or valid job spec
/etc/init.d/proftpd: line 19: wait: `no': not a pid or valid job spec
/etc/init.d/proftpd: line 20: protocol: command not found
/etc/init.d/proftpd: line 21: user: command not found
/etc/init.d/proftpd: line 22: server: command not found
ProFTPd is started from inetd.
..............
jcode@debian:/etc/init.d$ /etc/init.d/inetd restart
Restarting internet superserver: inetd/etc/init.d/inetd: line 53: start-stop-daemon: command not found
/etc/init.d/inetd: line 55: start-stop-daemon: command not found
.