chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow up to 4096 simultaneous connections
[elogind.git]
/
src
/
core
/
service.c
diff --git
a/src/core/service.c
b/src/core/service.c
index 120510c6c130f01dbe50c87cac36c3908c5fb11b..a89ff3f96c3e8c1d640ac580c244f95d10c242d1 100644
(file)
--- a/
src/core/service.c
+++ b/
src/core/service.c
@@
-21,7
+21,6
@@
#include <errno.h>
#include <signal.h>
#include <errno.h>
#include <signal.h>
-#include <dirent.h>
#include <unistd.h>
#include "async.h"
#include <unistd.h>
#include "async.h"
@@
-562,7
+561,7
@@
static int service_add_extras(Service *s) {
if (r < 0)
return r;
if (r < 0)
return r;
- n = str
append
a(s->bus_name, ".busname");
+ n = str
join
a(s->bus_name, ".busname");
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
if (r < 0)
return r;
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
if (r < 0)
return r;
@@
-619,7
+618,7
@@
static void service_dump(Unit *u, FILE *f, const char *prefix) {
assert(s);
prefix = strempty(prefix);
assert(s);
prefix = strempty(prefix);
- prefix2 = str
append
a(prefix, "\t");
+ prefix2 = str
join
a(prefix, "\t");
fprintf(f,
"%sService State: %s\n"
fprintf(f,
"%sService State: %s\n"
@@
-1058,7
+1057,11
@@
static int service_spawn(
assert(c);
assert(_pid);
assert(c);
assert(_pid);
- unit_realize_cgroup(UNIT(s));
+ (void) unit_realize_cgroup(UNIT(s));
+ if (s->reset_cpu_usage) {
+ (void) unit_reset_cpu_usage(UNIT(s));
+ s->reset_cpu_usage = false;
+ }
r = unit_setup_exec_runtime(UNIT(s));
if (r < 0)
r = unit_setup_exec_runtime(UNIT(s));
if (r < 0)
@@
-1123,7
+1126,7
@@
static int service_spawn(
}
if (is_control && UNIT(s)->cgroup_path) {
}
if (is_control && UNIT(s)->cgroup_path) {
- path = str
append
a(UNIT(s)->cgroup_path, "/control");
+ path = str
join
a(UNIT(s)->cgroup_path, "/control");
cg_create(SYSTEMD_CGROUP_CONTROLLER, path);
} else
path = UNIT(s)->cgroup_path;
cg_create(SYSTEMD_CGROUP_CONTROLLER, path);
} else
path = UNIT(s)->cgroup_path;
@@
-1489,7
+1492,7
@@
static void service_kill_control_processes(Service *s) {
if (!UNIT(s)->cgroup_path)
return;
if (!UNIT(s)->cgroup_path)
return;
- p = str
append
a(UNIT(s)->cgroup_path, "/control");
+ p = str
join
a(UNIT(s)->cgroup_path, "/control");
cg_kill_recursive(SYSTEMD_CGROUP_CONTROLLER, p, SIGKILL, true, true, true, NULL);
}
cg_kill_recursive(SYSTEMD_CGROUP_CONTROLLER, p, SIGKILL, true, true, true, NULL);
}
@@
-1829,6
+1832,7
@@
static int service_start(Unit *u) {
s->main_pid_known = false;
s->main_pid_alien = false;
s->forbid_restart = false;
s->main_pid_known = false;
s->main_pid_alien = false;
s->forbid_restart = false;
+ s->reset_cpu_usage = true;
free(s->status_text);
s->status_text = NULL;
free(s->status_text);
s->status_text = NULL;
@@
-1837,7
+1841,7
@@
static int service_start(Unit *u) {
s->notify_state = NOTIFY_UNKNOWN;
service_enter_start_pre(s);
s->notify_state = NOTIFY_UNKNOWN;
service_enter_start_pre(s);
- return
0
;
+ return
1
;
}
static int service_stop(Unit *u) {
}
static int service_stop(Unit *u) {
@@
-1878,7
+1882,7
@@
static int service_stop(Unit *u) {
s->state == SERVICE_EXITED);
service_enter_stop(s, SERVICE_SUCCESS);
s->state == SERVICE_EXITED);
service_enter_stop(s, SERVICE_SUCCESS);
- return
0
;
+ return
1
;
}
static int service_reload(Unit *u) {
}
static int service_reload(Unit *u) {