I never found an up-to-date and conclusive article on how to install Leafnode on OS X. So, I decided to publish one that is based on Configuring LeafNode on OSX by David Thole written in May 2010. He’s everywhere (GitHub, Twitter, YouTube, Stackoverflow, etc.) but his own site is often down and, therefore, the link above points to his article on archive.org.
As stated by David the it’s not really difficult to install Leafnode on OS X, but getting it configured is where the problem is.
Install Leafnode on OS X
Installing Leafnode on OS X is dead simple if you use MacPorts. For the rest of the article I assume this is the case with you. Open the terminal and type
sudo port install leafnode
Afterwards check the installation by running
port contents leafnode
If you’re interested in what the port script actually executed you need to check the port file.
Once Leafnode is installed, you have a few commands (i.e. applications) that you can use at this point. Among others there are:
- fetchnews
This will be used to get the listing of groups, which once read, will start pulling the actual documents themselves. - leafnode
This can be run a few different ways, but with the MacPorts option it’s really not a bad idea to run this through launchctl (assuming you’re on a later version of OS X).
Configure Leafnode
Once you’re done installing Leafnode on OS X the configuration file that you’ll need to edit is in /opt/local/etc/leafnode/config
. Most of the stuff in the config.example
will help in configuring Leafnode. Besides, the comments in the file are really good. You might also find answers in the old but good FAQ.
To manually test the installation & configuration you may run:
sudo -u _news /opt/local/sbin/fetchnews -vvvv
OS X launchdeamon
The plists for launchctl are located in /opt/local/etc/LaunchDaemons/org.macports.leafnode
One way to load this right away is:
sudo launchctl load /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.leafnode.plist
I also created a symlink to the above location in /Library/LaunchDaemons
cd /Library/LaunchDaemons sudo ln -s /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.leafnode.plist
Furthermore I also loaded the fetchnews plist to ensure that messages are pulled in from upstream servers every 30min (default).
sudo launchctl load /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.fetchnews.plist cd /Library/LaunchDaemons sudo ln -s /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.fetchnews.plist