Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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!

share|improve this answer
    
Thanks Dennis: Yes! Right on target: "Option 1"... I am using 10.04 Lucid.. and 'vsftpd' is "upstart"-ed. –  Peter.O Dec 5 '10 at 6:30
    
Will /etc/init/vsftpd.conf be overwritten when vsftpd is upgraded? ... or is this considered by the upgrade process as root's private customization (like my custom $HOME configs)... I mean: Can I make the mod and expect it to stay there unaltered, regardless of upgrades/updates? –  Peter.O Dec 5 '10 at 7:11
    
I was concerned about this myself. It should not normally be overwritten since you have modified the file. I did try uninstalling then re-installing vsftpd and my edits to /etc/init/vsftpd.conf were preserved. –  Dennis VanMeter Dec 5 '10 at 15:22
add comment

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

share|improve this answer
    
Thanks karthick87... An interesting approach for Option 2.. Start it normally, and then quickly stop it... but I think this would require a manual addition to each user's "startup-list", as it is unknown who logs on first... Things like that tend to get forgotten 6 month down the track when another user is added... or is there an "all users" startup list? (there probably is: Linux seems to have most options covered ;) –  Peter.O Dec 5 '10 at 6:35
    
Also, doesn't the second thing require the sudo password, so might not work? rc.local may be better –  Wilf Feb 18 at 22:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.