[systemd-commits] 4 commits - fixme src/automount.c src/logger.c src/service.c

Lennart Poettering lennart at kemper.freedesktop.org
Tue May 18 18:44:45 PDT 2010


 fixme           |    3 ++-
 src/automount.c |    5 +++++
 src/logger.c    |    2 +-
 src/service.c   |   43 ++++++++++++++++++++++++++-----------------
 4 files changed, 34 insertions(+), 19 deletions(-)

New commits:
commit 56d748b47e289fc0fcdf7925df1580afbc2d220a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 19 03:44:37 2010 +0200

    service: sysv_chkconfig_order() actually has nothing to do with chkconfig anymore, so rename it

diff --git a/src/service.c b/src/service.c
index dbef725..2515cd3 100644
--- a/src/service.c
+++ b/src/service.c
@@ -225,7 +225,7 @@ finish:
         return 1;
 }
 
-static int sysv_chkconfig_order(Service *s) {
+static int sysv_fix_order(Service *s) {
         Meta *other;
         int r;
 
@@ -789,7 +789,7 @@ static int service_load(Unit *u) {
                 if ((r = unit_add_default_cgroup(u)) < 0)
                         return r;
 
-                if ((r = sysv_chkconfig_order(s)) < 0)
+                if ((r = sysv_fix_order(s)) < 0)
                         return r;
 
                 if (s->bus_name) {
commit b7ccee3c8490407ecd681024a39c9d2a0ab4fc97
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 19 03:44:07 2010 +0200

    service: properly drop boot. prefix and .sh suffix from dependency names in the LSB headers

diff --git a/src/service.c b/src/service.c
index bf91561..dbef725 100644
--- a/src/service.c
+++ b/src/service.c
@@ -169,7 +169,26 @@ static void service_done(Unit *u) {
         unit_unwatch_timer(u, &s->timer_watch);
 }
 
-static int sysv_translate_name(const char *name, char **_r) {
+static char *sysv_translate_name(const char *name) {
+        char *r;
+
+        if (!(r = new(char, strlen(name) + sizeof(".service"))))
+                return NULL;
+
+        if (startswith(name, "boot."))
+                /* Drop SuSE-style boot. prefix */
+                strcpy(stpcpy(r, name + 5), ".service");
+        else if (endswith(name, ".sh"))
+                /* Drop Debian-style .sh suffix */
+                strcpy(stpcpy(r, name) - 3, ".service");
+        else
+                /* Normal init scripts */
+                strcpy(stpcpy(r, name), ".service");
+
+        return r;
+}
+
+static int sysv_translate_facility(const char *name, char **_r) {
 
         static const char * const table[] = {
                 "$local_fs",  SPECIAL_LOCAL_FS_TARGET,
@@ -195,7 +214,7 @@ static int sysv_translate_name(const char *name, char **_r) {
         if (*name == '$')
                 return 0;
 
-        if (asprintf(&r, "%s.service", name) < 0)
+        if (!(r = sysv_translate_name(name)))
                 return -ENOMEM;
 
 finish:
@@ -474,7 +493,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
-                                        r = sysv_translate_name(n, &m);
+                                        r = sysv_translate_facility(n, &m);
                                         free(n);
 
                                         if (r < 0)
@@ -511,7 +530,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
-                                        r = sysv_translate_name(n, &m);
+                                        r = sysv_translate_facility(n, &m);
                                         free(n);
 
                                         if (r < 0)
@@ -2208,21 +2227,11 @@ static int service_enumerate(Manager *m) {
                                 }
 
                                 free(name);
-                                if (!(name = new(char, strlen(de->d_name) - 3 + 8 + 1))) {
+                                if (!(name = sysv_translate_name(de->d_name + 3))) {
                                         r = -ENOMEM;
                                         goto finish;
                                 }
 
-                                if (startswith(de->d_name+3, "boot."))
-                                        /* Drop SuSE-style boot. prefix */
-                                        strcpy(stpcpy(name, de->d_name + 3 + 5), ".service");
-                                else if (endswith(de->d_name+3, ".sh"))
-                                        /* Drop Debian-style .sh suffix */
-                                        strcpy(stpcpy(name, de->d_name + 3) - 3, ".service");
-                                else
-                                        /* Normal init scripts */
-                                        strcpy(stpcpy(name, de->d_name + 3), ".service");
-
                                 if ((r = manager_load_unit_prepare(m, name, NULL, &service)) < 0) {
                                         log_warning("Failed to prepare unit %s: %s", name, strerror(-r));
                                         continue;
commit 9c5c00f9fe36d630e20fb6f424fc4fce09df3c14
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 19 03:42:24 2010 +0200

    logger: use the right enum type

diff --git a/src/logger.c b/src/logger.c
index f81d2c5..e7c2be0 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -75,7 +75,7 @@ struct Stream {
 
         int fd;
 
-        LogTarget target;
+        StreamTarget target;
         int priority;
         char *process;
         pid_t pid;
commit 1b5601907efffd364b660bb75156b2aed49c46a4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 19 03:42:05 2010 +0200

    automount: never consider our own mount point a prefix mount of us

diff --git a/fixme b/fixme
index 969c6cd..0894c47 100644
--- a/fixme
+++ b/fixme
@@ -65,7 +65,8 @@
 
 * teach dbus to talk to systemd when autospawning services
 
-* unix sockets chown()/chgrp()
+* Figure out which signal handlers we actually have to reset in the
+  forked off child
 
 Regularly:
 
diff --git a/src/automount.c b/src/automount.c
index 465354f..3268046 100644
--- a/src/automount.c
+++ b/src/automount.c
@@ -59,6 +59,8 @@ static void repeat_unmout(const char *path) {
         assert(path);
 
         for (;;) {
+                /* If there are multiple mounts on a mount point, this
+                 * removes them all */
 
                 if (umount2(path, MNT_DETACH) >= 0)
                         continue;
@@ -118,6 +120,9 @@ int automount_add_one_mount_link(Automount *a, Mount *m) {
         if (!path_startswith(a->where, m->where))
                 return 0;
 
+        if (path_equal(a->where, m->where))
+                return 0;
+
         if ((r = unit_add_dependency(UNIT(m), UNIT_BEFORE, UNIT(a), true)) < 0)
                 return r;
 


More information about the systemd-commits mailing list