Index: src/oidentd.h
--- src/oidentd.h.orig	2003-07-11 16:11:25.000000000 +0200
+++ src/oidentd.h	2003-11-02 12:57:59.000000000 +0100
@@ -33,6 +33,12 @@
 #define UPREFIX			"user"
 
 /*
+** System-wide PID file.
+*/
+
+#define PIDFILE		"/var/run/oidentd.pid"
+
+/*
 ** System-wide configuration file.
 */
 
Index: src/oidentd.c
--- src/oidentd.c.orig	2003-04-24 02:03:54.000000000 +0200
+++ src/oidentd.c	2003-11-02 12:58:23.000000000 +0100
@@ -97,6 +97,18 @@
 		exit(-1);
 	}
 
+    {
+        pid_t pid;
+        FILE *fp;
+        pid = getpid();
+        if ((fp = fopen(PIDFILE, "w")) == NULL) {
+            o_log(NORMAL, "Fatal: Error writing to pidfile: %s", PIDFILE);
+		    exit(-1);
+        }
+        fprintf(fp, "%ld\n", (long)pid);
+        fclose(fp);
+    }
+
 	if (!opt_enabled(STDIO)) {
 		listen_fds = setup_listen(addr, htons(listen_port));
 		if (listen_fds == NULL || listen_fds[0] == -1) {
