[systemd-commits] 2 commits - src/shared units/getty at .service.m4

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sat Jul 13 07:10:13 PDT 2013


 src/shared/install.c    |   38 +++++---------------------------------
 units/getty at .service.m4 |    6 +++---
 2 files changed, 8 insertions(+), 36 deletions(-)

New commits:
commit 7aa4fa34f76b0d9b031f0a5ea941c7fa10cebbee
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat Jul 13 09:59:35 2013 -0400

    units: do not special-case getty at tty1.service installation
    
    Since a long while we can use "systemctl enable getty at tty1.service"
    which does the right thing, so there's no need to abuse Alias=
    for installation.

diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index f32ca99..7853652 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -20,9 +20,9 @@ After=rc-local.service
 Before=getty.target
 IgnoreOnIsolate=yes
 
-# On systems without virtual consoles, don't start any getty. (Note
+# On systems without virtual consoles, don't start any getty. Note
 # that serial gettys are covered by serial-getty at .service, not this
-# unit
+# unit.
 ConditionPathExists=/dev/tty0
 
 [Service]
@@ -48,4 +48,4 @@ Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETA
 KillSignal=SIGHUP
 
 [Install]
-Alias=getty.target.wants/getty at tty1.service
+WantedBy=getty.target

commit 92d430a9e03056c0f62ed49149d59aed0046d0dd
Author: Ross Lagerwall <rosslagerwall at gmail.com>
Date:   Mon Jun 17 19:11:50 2013 +0100

    install: make "reenable" work with templated units
    
    Before, "systemctl reenable getty at tty1.service" would fail with:
    Failed to issue method call: File exists
    To fix this, reimplement "reenable" explicitly as a disable followed by
    an enable.
    This is shorter and is how the man page documents its behavior.

diff --git a/src/shared/install.c b/src/shared/install.c
index eb9a5fc..1161068 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1534,43 +1534,15 @@ int unit_file_reenable(
                 bool force,
                 UnitFileChange **changes,
                 unsigned *n_changes) {
+        int r;
 
-        _cleanup_lookup_paths_free_ LookupPaths paths = {};
-        _cleanup_install_context_done_ InstallContext c = {};
-        char **i;
-        _cleanup_free_ char *config_path = NULL;
-        _cleanup_set_free_free_ Set *remove_symlinks_to = NULL;
-        int r, q;
-
-        assert(scope >= 0);
-        assert(scope < _UNIT_FILE_SCOPE_MAX);
-
-        r = lookup_paths_init_from_scope(&paths, scope);
-        if (r < 0)
-                return r;
-
-        r = get_config_path(scope, runtime, root_dir, &config_path);
+        r = unit_file_disable(scope, runtime, root_dir, files,
+                              changes, n_changes);
         if (r < 0)
                 return r;
 
-        STRV_FOREACH(i, files) {
-                r = mark_symlink_for_removal(&remove_symlinks_to, *i);
-                if (r < 0)
-                        return r;
-
-                r = install_info_add_auto(&c, *i);
-                if (r < 0)
-                        return r;
-        }
-
-        r = remove_marked_symlinks(remove_symlinks_to, config_path, changes, n_changes, files);
-
-        /* Returns number of symlinks that where supposed to be installed. */
-        q = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes);
-        if (r == 0)
-                r = q;
-
-        return r;
+        return unit_file_enable(scope, runtime, root_dir, files, force,
+                                changes, n_changes);
 }
 
 int unit_file_set_default(



More information about the systemd-commits mailing list