[systemd-commits] src/core

Michael Biebl mbiebl at kemper.freedesktop.org
Wed Mar 6 14:30:34 PST 2013


 src/core/service.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11dac832c75cbdd0015fb0417b9877396ea57f6f
Author: Michael Biebl <biebl at debian.org>
Date:   Wed Mar 6 23:24:31 2013 +0100

    service: sysv - properly handle init scripts with .sh suffix
    
    Dropping the distribution specific #ifdefs in
    88516c0c952b9502e8ef1d6a1481af61b0fb422d broke the .sh suffix stripping
    since we now always used the else clause of the rc. check.
    
    We eventually want to drop the rc. prefix stripping, but for now we
    assume that no sysv init script uses both an rc. prefix and .sh suffix,
    so make the check for the .sh suffix and rc. prefix mutually exclusive.

diff --git a/src/core/service.c b/src/core/service.c
index 61b150c..3fbb0a1 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -331,7 +331,7 @@ static char *sysv_translate_name(const char *name) {
         if (endswith(name, ".sh"))
                 /* Drop .sh suffix */
                 strcpy(stpcpy(r, name) - 3, ".service");
-        if (startswith(name, "rc."))
+        else if (startswith(name, "rc."))
                 /* Drop rc. prefix */
                 strcpy(stpcpy(r, name + 3), ".service");
         else



More information about the systemd-commits mailing list