(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Kerio and Fortigate Reseller
Printer Friendly Version

tftp and launchctl on MacOSX


2008/01/30

I needed to upgrade the firmware in a Fortinet Firewall. That's done by pointing the Fortinet at a tftp server that has the new firmware image. Simple enough.. except where do I have a tftp server?

Well, not on my main Linux server, because it apparently isn't important enough to install on spec. I could of course go get it, but instead I took a look on my Mac. I honestly didn't expect to find it: I thought they might reserve that for the Server version of Mac OS X, but no, there it was, man page and all. The man page warns:


Hate these ads?

This server should not be started manually; instead, it should be run using launchd(8) using the plist /System/Library/LaunchDaemons/tftp.plist. It may be started using the launchctl(1) load command.

Well, I don't normally want tftpd running, so launchctl is the obvious choice. Fire that up with "sudo launchctl" and then type:



load -F /System/Library/LaunchDaemons/tftp.plist


Why "-F"? Because by default, the tftp.plist contains:



        <key>Disabled</key>
        <true/>


If you leave out -F, launchctl will say "nothing found to load", which isn't very helpful - what it really should say is "I can't load this because it's presently disabled". The -F forces it to ignore that little impediment..if you don't use sudo, it will say:



bind(): Permission denied


Assuming you had neither problem, some fraction of a second later, tftpd is ready to run (well, LaunchD is ready to listen for tftpd requests and start it up, but you get the idea). Where's your tftpd directory? Not in /tftpboot where you might expect to find it on a Unix system.. the tfpt.plist actually specifies the program arguments, and by default it looks like this:



        <key>ProgramArguments</key>
        <array>
                <string>/usr/libexec/tftpd</string>
                <string>-i</string>
                <string>/private/tftpboot</string>
        </array>


So "/private/tftpboot" is where you want to put the files to be accessed. When you are ready to shut tftp off, just tell launchctl:



unload /System/Library/LaunchDaemons/tftp.plist


If you did want tftpd to run all the time, you would use



load -w  /System/Library/LaunchDaemons/tftp.plist


That changes the "Disabled" key so that the file now has this:



        <key>InitGroups</key>
        <true/>


"tftpd" would now be enabled at each boot. Should you later change your mind, "unload -w /System/Library/LaunchDaemons/tftp.plist" will put things back as they were.


Technorati tags:   

Comments /MacOSX/tftp.html


Add your comments

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner





Views for this page
Today This Week This Month This Year  Overall
11542472,326 2,326

numly esn 42021-080130-337349-12
numly barcode

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - MacOSX
       - Fortinet




Unix/Linux Consultants


http://www.m3ipinc.com Security, firewalls, ids, audits, vulnerability assesments, BS7799, HIPAA, GLB, incident handling


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!


Your ad here - $24.00 yearly!

Twitter
  • May 12 16:04
    Hmmm.. think I'm doing something at the gym that is hurting my neck.. not sure what.. I'll have to eliminate something for a few days to see
  • May 12 05:02
    It's not good to sound annoyed with customers:







Coming Attractions

My Favorites

Change Congress

Related Posts