X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fservice.c;h=1dc3e1ea00d3b38fac9ca7159ce31f3cbb40d342;hb=e702c2c07df401a3cf5f7e107b3b2560a8c35af1;hp=6539a24102d086463dffdd4f762ec13bd83b97d1;hpb=c68364b790d1a13ef1df0e2fbb99ded6d67e60e3;p=elogind.git diff --git a/src/service.c b/src/service.c index 6539a2410..1dc3e1ea0 100644 --- a/src/service.c +++ b/src/service.c @@ -824,22 +824,6 @@ static int service_load_sysv(Service *s) { return 0; } -static int service_add_bus_name(Service *s) { - char *n; - int r; - - assert(s); - assert(s->bus_name); - - if (asprintf(&n, "dbus-%s.service", s->bus_name) < 0) - return 0; - - r = unit_merge_by_name(UNIT(s), n); - free(n); - - return r; -} - static int service_verify(Service *s) { assert(s); @@ -929,13 +913,9 @@ static int service_load(Unit *u) { if ((r = sysv_fix_order(s)) < 0) return r; - if (s->bus_name) { - if ((r = service_add_bus_name(s)) < 0) - return r; - + if (s->bus_name) if ((r = unit_watch_bus_name(u, s->bus_name)) < 0) return r; - } if (s->type == SERVICE_NOTIFY && s->notify_access == NOTIFY_NONE) s->notify_access = NOTIFY_MAIN; @@ -2747,11 +2727,12 @@ static int service_enumerate(Manager *m) { if (de->d_name[0] == 'S') { - SERVICE(service)->sysv_start_priority = - MAX(a*10 + b, SERVICE(service)->sysv_start_priority); + if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) { + SERVICE(service)->sysv_start_priority = + MAX(a*10 + b, SERVICE(service)->sysv_start_priority); - if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) SERVICE(service)->sysv_enabled = true; + } if ((r = set_ensure_allocated(&runlevel_services[i], trivial_hash_func, trivial_compare_func)) < 0) goto finish;