On Mon, Aug 30, 2010 at 12:14:02PM +0200, Michael Biebl wrote:
[...]
> Given this, patching upower/udisks to write a pid file is probably the 
> cleanest
> but also most invasive solution.

I fail to see why it has to be invasive. Please point out why
a simple hack like the one attached won't work.

-- 
Andreas Henriksson
--- udisks-1.0.1+git20100614/src/main.c	2010-03-12 16:13:09.000000000 +0100
+++ udisks-1.0.1+git20100614.pidfile/src/main.c	2010-08-30 14:13:04.000000000 +0200
@@ -129,6 +129,16 @@
   return ret;
 }
 
+static void
+write_pid()
+{
+	FILE *f;
+
+	f = g_fopen ("/var/run/udisks.pid", "w");
+	g_fprintf (f, "%d\n", getpid());
+	fclose (f);
+}
+
 int
 main (int argc,
       char **argv)
@@ -221,6 +231,8 @@
       goto out;
     }
 
+  write_pid();
+
   PROFILE ("main(): starting main loop");
   loop = g_main_loop_new (NULL, FALSE);
 

Attachment: signature.asc
Description: Digital signature

Reply via email to