How can I load the `vsftpd` daemon at system-boot, but have it "start" in a "stopped" state?

Because I only occasionally need to run an ftp server (vsftpd, in my case), I would prefer to just have it fully active only when the need arises.

This suggests two possibilities to me, but I don't know if both (or either) are possible..

Option 1: Do not start the daemon as the system boots up,
but instead, start it manually as the need arises... but I don't know the command(s) for this... Maybe it is just "vsftpd" and it will find its own config file(s)... but would this clash with disabling load-on-boot?

Option 2:. Start the daemon as the system boots up,
but start it in a stop/waiting mode... ie. equivalent to sudo stop vsftpd, or sudo initctl stop vsftpd.

I would prefer Option 1, because I rarely need an ftp server.


The answer to this may depend on which version of Ubuntu you are running. On version 10.10 (and maybe version 10.04) which uses upstart you can edit the /etc/init/vsftpd.conf file and comment out the two lines involved with starting vsftpd as so:

#start on (filesystem
#        and net-device-up IFACE!=lo)

The # at the beginning of the lines indicates a comment and will deactivate starting vsftpd on startup.

When you are ready to start vsftpd, you can simply type:

sudo start vsftpd

at a command prompt to start vsftpd. To stop you would use:

sudo stop vsftpd

I hope this is helpful!


You can stop the daemon using the following command,

sudo service vsftpd stop

Add the above command to startup list so that the daemon will be stopped during time.If you want to start the daemon after bootup.Issue the following command in terminal.

sudo service vsftpd start

Adding the command to Startup list.Goto System>>Preferences>>Startup Applications.Click Add and give your command there.
alt text