mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +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"
|
||||
|
||||
#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);
|
||||
|
||||
Reference in New Issue
Block a user