plugins/dbus: Start dbus-daemon with absolut path

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-10-15 22:45:01 +02:00
parent 2b173e831f
commit ddeed15191
+10 -6
View File
@@ -31,19 +31,22 @@
#include "service.h"
#define DAEMON "dbus-daemon"
#define ARGS " --nofork --system"
#define DESC " -- D-Bus message bus daemon"
#define ARGS "--nofork --system"
#define DESC "-- D-Bus message bus daemon"
static void setup(void *arg)
{
if (!whichp(DAEMON)) {
_d("Skipping D-Bus plugin, %s is not installed.", DAEMON);
char *cmd;
char line[80];
cmd = which(DAEMON);
if (!cmd) {
_d("Skipping plugin, %s is not installed.", DAEMON);
return;
}
umask(0);
_d("Starting D-Bus ...");
makedir("/var/run/dbus", 0755);
makedir("/var/lock/subsys", 0755);
makedir("/var/lock/subsys/messagebus", 0755);
@@ -54,7 +57,8 @@ static void setup(void *arg)
erase("/var/run/dbus/pid");
/* Register service with Finit */
if (service_register(SVC_TYPE_SERVICE, "[S12345] " DAEMON ARGS DESC, NULL))
snprintf(line, sizeof(line), "[S12345] %s %s -- %s", DAEMON, ARGS, DESC);
if (service_register(SVC_TYPE_SERVICE, line, NULL))
_pe("Failed registering %s", DAEMON);
umask(022);