summaryrefslogtreecommitdiff
path: root/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-24 04:26:33 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-24 04:26:33 +0200
commitdb06e3b6a5254ec247de5bc1a1b6a8670c2f4b2b (patch)
treee0703cc30360f14305184d45529579279463919c /manager.c
parentab8cabad2643f392cf9fd3bf97c665c4d159692f (diff)
service: sysv priorities in link names should take precedence, since they are possibly fixed up by chkconfig
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/manager.c b/manager.c
index c6555d40bc..cf1c1481c1 100644
--- a/manager.c
+++ b/manager.c
@@ -1536,15 +1536,15 @@ unsigned manager_dispatch_load_queue(Manager *m) {
return n;
}
-int manager_load_unit(Manager *m, const char *name, const char *path, Unit **_ret) {
+int manager_load_unit_prepare(Manager *m, const char *name, const char *path, Unit **_ret) {
Unit *ret;
int r;
assert(m);
assert(name || path);
- /* This will load the service information files, but not actually
- * start any services or anything. */
+ /* This will prepare the unit for loading, but not actually
+ * load anything from disk. */
if (path && !is_path(path))
return -EINVAL;
@@ -1577,6 +1577,24 @@ int manager_load_unit(Manager *m, const char *name, const char *path, Unit **_re
unit_add_to_load_queue(ret);
unit_add_to_dbus_queue(ret);
+ if (_ret)
+ *_ret = ret;
+
+ return 0;
+}
+
+int manager_load_unit(Manager *m, const char *name, const char *path, Unit **_ret) {
+ Unit *ret;
+ int r;
+
+ assert(m);
+
+ /* This will load the service information files, but not actually
+ * start any services or anything. */
+
+ if ((r = manager_load_unit_prepare(m, name, path, &ret)) < 0)
+ return r;
+
manager_dispatch_load_queue(m);
if (_ret)
@@ -1767,6 +1785,8 @@ static int manager_process_signal_fd(Manager *m) {
case SIGTERM:
if (m->running_as == MANAGER_INIT)
+ /* This is for compatibility with the
+ * original sysvinit */
m->exit_code = MANAGER_REEXECUTE;
else
m->exit_code = MANAGER_EXIT;