This library is useful if you wish to make a service which is automatically started by launchd.
Please read the Unix API documentation (and the Lwt_unix version).
First build the code
make
Assuming you are running under OS X, install the example services as LaunchAgents for the current user:
$ ./install-example.sh
Check the agents have registered:
$ launchctl list | grep org.recoil
34787 0 org.recoil.dave.anotherd
- 0 org.recoil.dave.exampled
One of them is listening on port 8081:
$ telnet localhost 8081
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello there!
Connection closed by foreign host.
And the other is listening on a Unix domain socket:
$ ls -l /var/run/org.recoil*
srw-rw-rw- 1 djs staff 0 9 Oct 14:06 /var/run/org.recoil.dave.exampled
Run this script to remove the agents:
$ ./uninstall-example.sh