I store my documents in a Camlistore, with a local instance running on my workstation and sync to an s3 bucket and a fixed server. Since I set this up 2 years ago, I've been manually starting camlistored
and cammount
inside a tmux
session each time I log in to OSX.
Today I finally got around to setting up these processes to to start using the native OSX facility, launchd plists.
camlistored
andcammount
should be in/usr/local/bin
. I have them symlinked via
cd /usr/local/bin && ln -s ~/go/camlistore.org/bin/cam* . && cd - ```
- Copy these plists to
~/Library/LaunchAgents
. plists require absolute paths so replace each/Users/eric
with your home dir.launchctl load ~/Library/LaunchAgents/camlistored.plist launchctl load ~/Library/LaunchAgents/cammount.plist
-
Robust to failures (keep alive)
-
Camlistored activates when cammount activates (but doesn't deactivate, after cammount deactivates, which seems like a bug in Launchd, if I understand the docs. To stop both, run:
launchctl unload ~/Library/LaunchAgents/cammount.plist launchctl unload ~/Library/LaunchAgents/camlistored.plist
-
Service logs in
~/Library/Logs
. You can view them inConsole.app
. -
If you run a remote server, you could just use
cammount.plist
-
If you want to edit these files, you might want to download the LaunchControl.app editor, which provides a number of niceties:
- Inline docs for plist directives
- Continuous validation
- Auto reload on save
- ...