Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Better way to do this with launchctl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Better way to do this with launchctl
Authored by: leamanc on Aug 06, '11 12:28:16AM

While this hint will work as stated, it's pretty much incorrect usage of launchctl for the purpose of the hint.

launchctl load...loads the FTP service into launchd's database of services. When you do an unload, you are telling launchd to not manage it anymore.

So a better way to do this--probably the proper way--is to first issue the command to load the service:

sudo launchctl load -w /System/Library/LaunchDaemons/ftp.plist

Then, if you'd like to stop FTP, issue this command:

sudo launchctl stop com.apple.ftpd

And if you decide you'd like to bring it back up, use this command:

sudo launchctl start com.apple.ftpd

If you'd like for launchd to forget about FTP, that is when you would run this:

sudo launchctl unload /System/Library/LaunchDaemons/ftp.plist

The hint as-is will work, but seems a little counter-productive to make launchd remember and forget about FTP all the time.



[ Reply to This | # ]
Better way to do this with launchctl
Authored by: poenn on Aug 06, '11 02:48:25AM

@leamanc: Absolutely correct. I entered the comments wanting to post this, too. You beat me at it. :-)

Edited on Aug 06, '11 02:48:53AM by poenn



[ Reply to This | # ]