mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
plugins/dbus: Start dbus-daemon with absolut path
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+10
-6
@@ -31,19 +31,22 @@
|
|||||||
#include "service.h"
|
#include "service.h"
|
||||||
|
|
||||||
#define DAEMON "dbus-daemon"
|
#define DAEMON "dbus-daemon"
|
||||||
#define ARGS " --nofork --system"
|
#define ARGS "--nofork --system"
|
||||||
#define DESC " -- D-Bus message bus daemon"
|
#define DESC "-- D-Bus message bus daemon"
|
||||||
|
|
||||||
static void setup(void *arg)
|
static void setup(void *arg)
|
||||||
{
|
{
|
||||||
if (!whichp(DAEMON)) {
|
char *cmd;
|
||||||
_d("Skipping D-Bus plugin, %s is not installed.", DAEMON);
|
char line[80];
|
||||||
|
|
||||||
|
cmd = which(DAEMON);
|
||||||
|
if (!cmd) {
|
||||||
|
_d("Skipping plugin, %s is not installed.", DAEMON);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
umask(0);
|
umask(0);
|
||||||
|
|
||||||
_d("Starting D-Bus ...");
|
|
||||||
makedir("/var/run/dbus", 0755);
|
makedir("/var/run/dbus", 0755);
|
||||||
makedir("/var/lock/subsys", 0755);
|
makedir("/var/lock/subsys", 0755);
|
||||||
makedir("/var/lock/subsys/messagebus", 0755);
|
makedir("/var/lock/subsys/messagebus", 0755);
|
||||||
@@ -54,7 +57,8 @@ static void setup(void *arg)
|
|||||||
erase("/var/run/dbus/pid");
|
erase("/var/run/dbus/pid");
|
||||||
|
|
||||||
/* Register service with Finit */
|
/* 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);
|
_pe("Failed registering %s", DAEMON);
|
||||||
|
|
||||||
umask(022);
|
umask(022);
|
||||||
|
|||||||
Reference in New Issue
Block a user