chiark / gitweb /
OS X support
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 25 Apr 2010 10:25:16 +0000 (11:25 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 25 Apr 2010 10:25:16 +0000 (11:25 +0100)
.gitignore
Makefile.am
README
fingerd.plist.in [new file with mode: 0644]

index 93e8f61..3fb4f23 100644 (file)
@@ -14,3 +14,4 @@ configure
 *.o
 stamp-h1
 trivial.fingerd
+fingerd.plist
index 9f7d1a1..514fe56 100644 (file)
@@ -1,4 +1,26 @@
 sbin_PROGRAMS=trivial.fingerd
 trivial_fingerd_SOURCES=fingerd.c
 man_MANS=trivial.fingerd.8
-EXTRA_DIST=autogen.sh
+EXTRA_DIST=autogen.sh fingerd.plist.in
+
+# launchd config for OS X systems
+# http://developer.apple.com/macosx/launchd.html
+all: fingerd.plist
+
+fingerd.plist: fingerd.plist.in Makefile
+       sed < fingerd.plist.in > fingerd.plist \
+               's,_sbindir_,${sbindir},g'
+
+install-data-local:
+       @if [ -w /Library/LaunchDaemons ]; then \
+         echo ${INSTALL} -m 644 fingerd.plist /Library/LaunchDaemons/uk.org.greenend.fingerd.plist ;\
+         ${INSTALL} -m 644 fingerd.plist /Library/LaunchDaemons/uk.org.greenend.fingerd.plist ;\
+       fi
+
+uninstall-local:
+       @if [ -w /Library/LaunchDaemons ]; then \
+         echo launchctl unload /Library/LaunchDaemons/uk.org.greenend.fingerd.plist ;\
+         launchctl unload /Library/LaunchDaemons/uk.org.greenend.fingerd.plist || true ;\
+         echo rm -f /Library/LaunchDaemons/uk.org.greenend.fingerd.plist ;\
+         rm -f /Library/LaunchDaemons/uk.org.greenend.fingerd.plist ;\
+       fi
diff --git a/README b/README
index a7c6c0b..4669eb0 100644 (file)
--- a/README
+++ b/README
@@ -4,12 +4,29 @@ trivial.fingerd
 This is a trivial finger server that reveals only very limited amounts
 of information.
 
-Installation:
+Installation (all platforms)
+----------------------------
+
    ./configure
    make
    sudo make install
 
-Then update your inetd.conf (or similar) to run on TCP port 79.  For
-example:
+inetd configuration (Linux etc)
+-------------------------------
+
+Add the following line to your /etc/inetd.conf:
 
 finger stream tcp nowait nobody.nogroup /usr/local/sbin/trivial.fingerd /usr/local/sbin/trivial.fingerd
+
+Then restart or reload inetd.
+
+launchd configuraiton (OS X)
+----------------------------
+
+'make install' will install a suitable plist into
+/Library/LaunchDaemons.  To enable it you must use launchctl:
+
+$ sudo launchctl load /Library/LaunchDaemons/uk.org.greenend.fingerd.plist
+
+To disable it do the same but with 'unload'.  'make uninstall' will
+also perform this step.
diff --git a/fingerd.plist.in b/fingerd.plist.in
new file mode 100644 (file)
index 0000000..304dbb1
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+  <dict>
+    <key>Disabled</key>
+    <false/>
+    <key>Label</key>
+    <string>uk.org.greenend.fingerd</string>
+    <key>ProgramArguments</key>
+    <array>
+      <string>_sbindir_/trivial.fingerd</string>
+    </array>
+    <key>inetdCompatibility</key>
+    <dict>
+      <key>Wait</key>
+      <false/>
+    </dict>
+    <key>UserName</key>
+    <string>nobody</string>
+    <key>GroupName</key>
+    <string>nogroup</string>
+    <key>InitGroups</key>
+    <true/>
+    <key>Sockets</key>
+    <dict>
+      <key>Listeners</key>
+      <dict>
+        <key>SockServiceName</key>
+        <string>finger</string>
+      </dict>
+    </dict>
+  </dict>
+</plist>