]> err.no Git - systemd/commitdiff
manager: write serialization to /dev/.systemd/ instead of /dev/shm
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Jul 2010 18:54:33 +0000 (20:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Jul 2010 18:54:33 +0000 (20:54 +0200)
fixme
src/main.c
src/manager.c
src/manager.h

diff --git a/fixme b/fixme
index ff00436e4a2bf0a357b44bc808c1cfcddc023581..3fd02eda74e6773af9b303757809fd4974f3bc4b 100644 (file)
--- a/fixme
+++ b/fixme
 
 * In command lines, support both "$FOO" and $FOO
 * /etc must always take precedence even if we follow symlinks!
-* fix merging of device units
 * color aus bei stdout auf !tty
 
-getty before prefdm
-
-* /lib/init/rw
-
 * vielleicht implizit immer auf syslog dependen?
 
 * debian deadlock when partition auf noauto is.
index d3c01b4a6764756ee03f387901b1c0253fa52775..aaddce86e0543fb83216fe2dadf6a62a74a3d656 100644 (file)
@@ -773,7 +773,7 @@ static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds) {
         assert(_f);
         assert(_fds);
 
-        if ((r = manager_open_serialization(&f)) < 0) {
+        if ((r = manager_open_serialization(m, &f)) < 0) {
                 log_error("Failed to create serialization faile: %s", strerror(-r));
                 goto fail;
         }
index 8a9b9dd44edf9f98e070d4adca09af1a334499b2..bdb2b8ba3e8b9849ce430ddbef3795d6867de83d 100644 (file)
@@ -2279,7 +2279,7 @@ void manager_dispatch_bus_query_pid_done(
         UNIT_VTABLE(u)->bus_query_pid_done(u, name, pid);
 }
 
-int manager_open_serialization(FILE **_f) {
+int manager_open_serialization(Manager *m, FILE **_f) {
         char *path;
         mode_t saved_umask;
         int fd;
@@ -2287,8 +2287,15 @@ int manager_open_serialization(FILE **_f) {
 
         assert(_f);
 
-        if (asprintf(&path, "/dev/shm/systemd-%u.dump-XXXXXX", (unsigned) getpid()) < 0)
-                return -ENOMEM;
+        if (m->running_as == MANAGER_SYSTEM) {
+                mkdir_p("/dev/.systemd", 0755);
+
+                if (asprintf(&path, "/dev/.systemd/dump-%lu-XXXXXX", (unsigned long) getpid()) < 0)
+                        return -ENOMEM;
+        } else {
+                if (asprintf(&path, "/tmp/systemd-dump-%lu-XXXXXX", (unsigned long) getpid()) < 0)
+                        return -ENOMEM;
+        }
 
         saved_umask = umask(0077);
         fd = mkostemp(path, O_RDWR|O_CLOEXEC);
@@ -2396,7 +2403,7 @@ int manager_reload(Manager *m) {
 
         assert(m);
 
-        if ((r = manager_open_serialization(&f)) < 0)
+        if ((r = manager_open_serialization(m, &f)) < 0)
                 return r;
 
         if (!(fds = fdset_new())) {
index 7328724b090b44bdf205e3b2e286a6cdf81032aa..a5bc9202ffe5a7b87b5a5dcdd295b28364b04e45 100644 (file)
@@ -239,7 +239,7 @@ void manager_write_utmp_runlevel(Manager *m, Unit *t);
 void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name, const char* old_owner, const char *new_owner);
 void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_t pid);
 
-int manager_open_serialization(FILE **_f);
+int manager_open_serialization(Manager *m, FILE **_f);
 
 int manager_serialize(Manager *m, FILE *f, FDSet *fds);
 int manager_deserialize(Manager *m, FILE *f, FDSet *fds);