A small extension:
 * implement read_int_file() for reading small files with single int values
 * implement read_int_daemon_file() wrapper for reading daemon-specific files
 * add modifiable startup timeout (and ability to disable it when zero);
   controlled by daemon/start_wait_time
BUGS: no manpage entry

diff -urN depinit-0.1.4.orig/depinit/update.c depinit-0.1.4/depinit/update.c
--- depinit-0.1.4.orig/depinit/update.c	2003-08-30 23:38:04.000000000 +0200
+++ depinit-0.1.4/depinit/update.c	2005-05-20 19:59:22.034925120 +0200
@@ -17,6 +17,7 @@
 #include "lib/log.h"
 #include "lib/sig.h"
 #include "shutdown.h"
+#include "lib/cfile.h"
 
 // EXTERN
 #include "daemon.h"
@@ -40,6 +41,19 @@
 	return filename;
 }
 
+static int
+read_int_daemon_file (
+	daemon_t *daemon,
+	char *name,
+	int value
+)	{
+	char *filename;
+	do_or_warn(asprintf, &filename, "%s/%s/%s", args.config_dir_name, daemon->name, name);
+	value = read_int_file(filename, value);
+	free(filename);
+	return value;
+}
+
 static void 
 restart_now (
 	at_t *at,
@@ -278,13 +292,17 @@
 		do_or_die(execl, command, command, NULL);
 	default:
 		if (dt_service == i) {
+			long sec;
 			add_process(&daemon->process, pid, started_service);
-			add_at(&daemon->at, NULL, 300, 0, starter_timed_out);
+			sec = read_int_daemon_file(daemon, "start_wait_time", 300);
+			if (sec > 0)
+				add_at(&daemon->at, NULL, sec, 0, starter_timed_out);
 		} else	{
 			add_process(&daemon->process, pid, restart_daemon);
 			add_at(&daemon->at, NULL, 0, 500000L, started_daemon);
 		}
 	}
+	free(command);
 	return 0;
 }
 
diff -urN depinit-0.1.4.orig/lib/cfile.c depinit-0.1.4/lib/cfile.c
--- depinit-0.1.4.orig/lib/cfile.c	1970-01-01 01:00:00.000000000 +0100
+++ depinit-0.1.4/lib/cfile.c	2005-05-20 19:58:50.225199404 +0200
@@ -0,0 +1,38 @@
+/* lib/cfile.c - short configuration files */
+// EXTERN
+// Copyright 2005 Michał Mirosław
+// May be used and distributed under Version 2 of the GNU public license
+// No Warranty. See COPYING for details.
+// END
+
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+EXTERN int
+read_int_file (
+	const char *filename,
+	int default_value
+)	{
+	int fd, value, n;
+	char buf[32];	/* we read ints (even 64-bit ones will fit) */
+
+	if (!filename)
+		return default_value;
+
+	fd = open(filename, O_RDONLY);
+	if (fd < 0)
+		return default_value;
+
+	n = read(fd, buf, sizeof(buf) - 1);
+	close(fd);
+	if (n <= 0)
+		return default_value;
+	buf[n] = 0;
+
+	if (sscanf(buf, "%i", &value) != 1)
+		return default_value;
+
+	return value;
+}
+
