restart serwera proftpd

Instalacja i konfiguracja oprogramowania sieciowego.
zonta
Piegowaty Guziec
Piegowaty Guziec
Posty: 10
Rejestracja: 26 kwie 2011, 11:14
Płeć: Mężczyzna

restart serwera proftpd

Post autor: zonta »

Witam,
Podczas restartu serwera: sudo /etc/init.d/proftpd restart
wywala komunikat: - unknown parameter: 'restart'

oto zawartość pliku /etc/init.d/proftpd:

Kod: Zaznacz cały

#!/bin/sh 

### BEGIN INIT INFO
# Provides:          proftpd
# Required-Start:    $syslog $local_fs $network
# Required-Stop:     $syslog $local_fs $network
# Should-Start:      $remote_fs $named
# Should-Stop:       $remote_fs $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts ProFTPD daemon
# Description:       This script runs the FTP service offered
#                    by the ProFTPD daemon
### END INIT INFO

# Start the proftpd FTP daemon.

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/proftpd
NAME=proftpd

# Defaults
RUN="no"
OPTIONS=""

PIDFILE=`grep -i 'pidfile' /etc/proftpd/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

. /lib/lsb/init-functions

#
# Servertype could be inetd|standalone|none.
# In all cases check against inetd and xinetd support.
#
if ! egrep -qi "^[[:space:]]*ServerType.*standalone" /etc/proftpd/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 2>/dev/null || \
	   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/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/proftpd.conf
		then
    			RUN="yes"
			INETD="no"
		else
			RUN="no"
			INETD="no"
		fi
    	fi
    fi
fi

# /var/run could be on a tmpfs

[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd

start()
{
    log_daemon_msg "Starting ftp server" "$NAME"

    start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- $OPTIONS  
    if [ $? != 0 ]; then
        log_end_msg 1
        exit 1
    else
        log_end_msg 0
    fi
}

signal()
{

    if [ "$1" = "stop" ]; then
	SIGNAL="TERM"
    	log_daemon_msg "Stopping ftp server" "$NAME"
    else
	if [ "$1" = "reload" ]; then
	    SIGNAL="HUP"
    	    log_daemon_msg "Reloading ftp server" "$NAME"
	else
	    echo "ERR: wrong parameter given to signal()"
	    exit 1
	fi
    fi
    if [ -f "$PIDFILE" ]; then
    	start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
   	 if [ $? = 0 ]; then
        	log_end_msg 0
    	else
		SIGNAL="KILL"
		start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
    		if [ $? != 0 ]; then
        		log_end_msg 1
        		[ $2 != 0 ] || exit 0
    		else
        		log_end_msg 0
    		fi
    	fi
   	if [ "$SIGNAL" = "KILL" ]; then
		rm -f "$PIDFILE"
    	fi
    else
        log_end_msg 0
    fi
}

case "$1" in
    start)
	if [ "x$RUN" = "xyes" ] ; then
	    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
	start
	;;	
    
    stop)
	if [ "x$RUN" = "xyes" ] ; then
	    signal stop 0
	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
	signal stop 0
	;;

    reload)
	signal reload 0
	;;

    force-reload|restart)
	if [ "x$RUN" = "xyes" ] ; then
	    signal stop 1
	    sleep 2
	    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
	;;

    status)
	if [ "x$INETD" = "xyes" ] ; then
	    echo "ProFTPd is started from inetd/xinetd."
		exit 0
	else 
	    if [ -f "$PIDFILE" ]; then
	    	pid=$(cat $PIDFILE)
	    else
	    	pid="x"
	    fi
	    if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then
	    	echo "ProFTPd is started in standalone mode, currently running."
			exit 0
	    else
	    	echo "ProFTPd is started in standalone mode, currently not running."
			exit 3
	    fi
	fi
	;;

    check-config)
        $DAEMON -t >/dev/null && echo "ProFTPd configuration OK" && exit 0
        exit 1
        ;;

    *)
	echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}"
	exit 1
	;;
esac

exit 0
a to mój plik /etc/proftpd/proftpd.conf:

Kod: Zaznacz cały

#
# Includes required DSO modules. This is mandatory in proftpd 1.3
#

AllowOverwrite on
AuthAliasOnly on
#
UserAlias tomasz user100
UserAlias kazik user101
#
ServerName "ftp Piotrka"
ServerType standalone
DeferWelcome on
#
MultilineRFC2228 on
DefaultServer on
ShowSymlinks off
#
TimeoutNoTransfer 600
TimeoutStalled 100
TimeoutIdle 2200
#
DisplayChdir .message
ListOptions "-l"
#
RequireValidShell off
#
TimeoutLogin 30
#
RootLogin off
#logi
ExtendedLog /var/log/ftp.log
TransferLog /var/log/xferlog
SystemLog /var/log/syslog.log
#
UseFtpUsers off
#
AllowStoreRestart on
#
Port 1980
#
MaxInstances 30
#
User nobody
Group nobody
#
Umask 022
#
PersistentPasswd off
#
MaxClients 10 "The server is full, hosting %m users"
MaxClientsPerHost 10
MaxClientsPerUser 10
MaxHostsPerUser 10
#
AccessGrantMsg "Witaj !!!"
#
ServerIdent on "PiotrekFTP"
#
DefaultRoot /home/ftp/
#
DefaultRoot ~
#
MaxLoginAttempts 5
#


#ServerAdmin email@example.org
#IdentLookups off
#UseReverseDNS off
#PassivePorts 49152 65534
#MasqueradeAddress None
#TimesGMT off
#DisplayLogin welcome.msg
#DirFakeUser off nobody
#DirFakeGroup off nobody
#DefaultTransferMode binary
#AllowForeignAddress off
#AllowRetrieveRestart on
#DeleteAbortedStores off
#TransferRate RETR 220
#TransferRate STOR 250
#TransferRate STOU 250
#TransferRate APPE 250


<Limit LOGIN>
  AllowUser user100,user101
  DenyALL
</Limit>

<Directory /home/ftp>
  Umask 022 022
  AllowOverwrite on
</Directory>

<Directory /home/ftp/user100/*>
  Umask 022 022
  AllowOverwrite on
</Directory>

<Directory /home/ftp/user101/*>
  Umask 022 022
  AllowOverwrite on
</Directory>
Dodatkowo powiem że polecenie
sudo proftpd -td5
wyświetla, że config jest ok.
Wersja proftpd: 1.3.2c

Macie jakieś pomysły?
Awatar użytkownika
soulreaver1
Wytworny Kaczor
Wytworny Kaczor
Posty: 409
Rejestracja: 13 mar 2009, 10:03
Płeć: Mężczyzna
Wersja Ubuntu: inny OS
Środowisko graficzne: Inne
Architektura: x86_64
Lokalizacja: 127.0.0.1

Re: restart serwera proftpd

Post autor: soulreaver1 »

Zamiast "restart" użyj "reload".
zonta
Piegowaty Guziec
Piegowaty Guziec
Posty: 10
Rejestracja: 26 kwie 2011, 11:14
Płeć: Mężczyzna

Re: restart serwera proftpd

Post autor: zonta »

niestety efekt taki sam...
co dziwne poprzez gui można resetować
Awatar użytkownika
brezniew
Przyjaciel
Przyjaciel
Posty: 2680
Rejestracja: 12 kwie 2011, 16:48
Wersja Ubuntu: inny OS
Środowisko graficzne: Fluxbox
Architektura: x86_64

Re: restart serwera proftpd

Post autor: brezniew »

Spróbuj:

Kod: Zaznacz cały

sudo /sbin/service proftpd restart
lub

Kod: Zaznacz cały

sudo /etc/rc.d/proftpd restart
zonta
Piegowaty Guziec
Piegowaty Guziec
Posty: 10
Rejestracja: 26 kwie 2011, 11:14
Płeć: Mężczyzna

Re: restart serwera proftpd

Post autor: zonta »

problem rozwiązany poleceniem: sudo invoke-rc.d proftpd restart
ODPOWIEDZ

Wróć do „Sieci, serwery, Internet”

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 7 gości