# pure-ftpd init script

## st. anger

when i try to start pure-ftpd from the init scrpt, it doesnt quite work.

```
# /etc/init.d/pure-ftpd start

 * Starting Pure-FTPd...                                                  [ ok ]
```

it says [ ok ], but its not really running.  

then when  try

```
# /etc/init.d/pure-ftpd stop 

 * Stopping Pure-FTPd...                                                  [ !! ]
```

```
# /etc/init.d/pure-ftpd start

 * WARNING:  "pure-ftpd" has already been started.

```

what gves?

 i know it works because i can start t from the command line: #pure-ftpd&

and  can log n just fne from a remote location.

----------

## st. anger

i have tried re-emerging, but it just  seems the int script is broken. s this a bug?

anybody have this problem?

----------

## sa

I would examine /etc/conf.d/pure-ftpd (or simmilar) and check the settings. and mabey run pureftpd from the command line with those options, to see what happens.

It looks like it starts up but stops for some reason, but it doesnnt tell the gentoo system that it stopped, so the lock file is still there, thus the init.d script thinks it is still running, because the lockfile is still there...

you can fix that by running: 

```
/etc/init.d/pure-ftpd zap
```

cya,

sa,

ps. If you cant figure it out, post your /etc/conf.d/purftpd file and Ill have alook.

----------

## st. anger

i dont see anything suspcious, maybe you can spot something

/etc/conf.d/pure-ftpd :

```
# Config file for /etc/init.d/pure-ftpd

##Comment variables out to disable its features, or change the values in it... ##

## This variable must be uncommented in order for the server to start ##

IS_CONFIGURED="yes"

## FTP Server,Port (separated by comma) ##

## If you prefer host names over IP addresses, it's your choice :

## SERVER="-S ftp.rtchat.com,21"

## IPv6 addresses are supported.

SERVER="-S 192.168.0.1,21"

## Number of simultaneous connections in total, and per ip ##

MAX_CONN="-c 30"

MAX_CONN_IP="-C 10"

## Start daemonized in background ##

DAEMON="-B"

## Don't allow uploads if the partition is more full then this var ##

DISK_FULL="-k 30%"

## If your FTP server is behind a NAT box, uncomment this ##

#USE_NAT="-N"

## Authentication (others are 'pam', ...)##

## Further infos in the README file.

AUTH="-l unix"

## Change the maximum idle time. (in minutes. default 15)

#TIMEOUT="-I <timeout>'"

## Use that facility for syslog logging. It defaults to 'ftp'

## Logging can be disabled with '-f none' .

#LOG="-f facility"

## Misc. Others ##

MISC_OTHER="-A -x -j -R"

#

# Use these inside $MISC_OTHER

# More can be found on "http://pureftpd.sourceforge.net/README"

#

# -A [ chroot() everyone, but root ]

# -e [ Only allow anonymous users ]

# -E [ Only allow authenticated users. Anonymous logins are prohibited. ]

# -i [ Disallow upload for anonymous users, whatever directory perms are ]

# -j [ If the home directory of a user doesn't exist, auto-create it ]

# -M [ Allow anonymous users to create directories. ]

# -R [ Disallow users (even non-anonymous ones) usage of the CHMOD command ]

# -x [ Authenticated users can read/write files beginning with a dot ('.')

#       Anonymous users can't, for security reasons ]

# -X [ Users can't write/read files and directories starting with a dot ('.') ]

# -D [ List files beginning with a dot ('.') even when the client doesn't

#      append the '-a' option to the list command. A workaround for badly

#      configured FTP clients. ]

# -G [ Disallow renaming. ]

# -d [ Send various debugging messages to the syslog. ONLY for DEBUG ]

# -F <fortune file> [ Display a fortune cookie on login. Check the README file ]

# -H [ By default, fully-qualified host names are logged. The '-H' flag avoids host names resolut$

```

/etc/init.d/pure-ftpd :

```

#!/sbin/runscript

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# $Header: /home/cvsroot/gentoo-x86/net-ftp/pure-ftpd/files/pure-ftpd.rc6,v 1.5 2002/10/12 14:41:$

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

        ebegin "Starting Pure-FTPd"

        /usr/sbin/pure-ftpd $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG$

        eend $?

}

stop() {

        ebegin "Stopping Pure-FTPd"

        start-stop-daemon --stop --quiet --pidfile /var/run/pure-ftpd.pid

        eend $?

}

```

----------

## sa

I have the same problem as you, with that conf file.

so I ran pureftpd with all the arguments (minus -B so It wouldnt run in the backgound)

```
pure-ftpd -S 192.168.0.1,21 -c 30 -C 10 -k 30% -N -l unix -A -x -j -R
```

and I got the error:

```
Unable to start a standalone server: Cannot assign requested address
```

I found that If I take off the "-S 192.168.0.1,21" It works.

does this fix it for you?

cya,

sa

----------

## st. anger

well, the problem is not pure-ftp,  its just getting it started.

i can run it just fine f i start t manually.:

#pure-ftpd&

lke i said in the original post.

the init script just doesnt work

----------

## sa

actually the problem isnt the init script, because in this case when you execute pure-ftpd with an incorrect "-S" argument, pure-ftpd passes "0" as the return status, meaning "everything is ok", thus the init script thinks nothing is wrong. 

```
k sa # pure-ftpd -S 192.168.0.1,21 -c 30 -C 10 -k 30% -N -l unix -A -x -j -R; echo $?

Unable to start a standalone server: Cannot assign requested address

0

k sa # 
```

It should return something other than 0.

Anyway, have you tried commenting out the "-S 192.168.0.1,21" in you conf file?

----------

## st. anger

that did the trick. thanks

----------

## digitalnick

nice thanks for the post i hadnt gotten around to posting about it but i had the exact same problem 

/me runst off to fix it now

----------

## st. anger

what is that line used for anyway?

shouldnt it be commented out by default if thats the desired setting?

----------

## sa

 *xamn wrote:*   

> what is that line used for anyway?
> 
> shouldnt it be commented out by default if thats the desired setting?

 

I think it should be set to the IP address of your machine, possibly for use If your machine has more than one ip address. or if you have some funky configuration...

this is what the pure-ftpd man page says:

```
         -S [{ip address|hostname}] [,{port|service name}]

              This option is only effective when the server is launched  as  a

              standalone server.  Connections are accepted on the specified IP

              and port. IPv4 and IPv6 are supported. Numeric and  fully-quali-

              fied host names are accepted. A service name (see /etc/services)

              can be used instead of a numeric port number.

```

But I agree with you that it should be commented out by default.

cya,

sa

----------

