mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +07:00
plugin/dbus.c: Register dbus-daemon as a service
This patch changes how the D-Bus plugin starts dbus-daemon, from being started in the background to letting Finit start and monitor it. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+9
-4
@@ -28,11 +28,16 @@
|
||||
#include "config.h"
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
#include "service.h"
|
||||
|
||||
#define DAEMON "dbus-daemon"
|
||||
#define ARGS " --nofork --system"
|
||||
#define DESC " -- D-Bus message bus daemon"
|
||||
|
||||
static void setup(void *arg)
|
||||
{
|
||||
if (!whichp("dbus-daemon")) {
|
||||
_d("Skipping D-Bus plugin, dbus-daemon is not installed.");
|
||||
if (!whichp(DAEMON)) {
|
||||
_d("Skipping D-Bus plugin, %s is not installed.", DAEMON);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,8 +52,8 @@ static void setup(void *arg)
|
||||
|
||||
/* Clean up from any previous pre-bootstrap run */
|
||||
erase("/var/run/dbus/pid");
|
||||
|
||||
run_interactive("dbus-daemon --system", "Starting D-Bus");
|
||||
if (service_register(SVC_TYPE_SERVICE, "[S12345] " DAEMON ARGS DESC, NULL))
|
||||
_pe("Failed registering %s", DAEMON);
|
||||
|
||||
umask(022);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user