a4b143
From 40810e62f4df958b2465dcc1923b8b827fb778e8 Mon Sep 17 00:00:00 2001
a4b143
From: Harald Hoyer <harald@redhat.com>
a4b143
Date: Wed, 30 Oct 2013 18:22:49 +0100
a4b143
Subject: [PATCH] remove user@.service
a4b143
a4b143
fixes rhbz#1019738
a4b143
---
a4b143
 Makefile.am             |  2 --
a4b143
 src/login/logind-user.c | 42 ------------------------------------------
a4b143
 2 files changed, 44 deletions(-)
a4b143
a4b143
diff --git a/Makefile.am b/Makefile.am
a4b143
index eae001b..25bfd91 100644
a4b143
--- a/Makefile.am
a4b143
+++ b/Makefile.am
a4b143
@@ -435,7 +435,6 @@ nodist_systemunit_DATA = \
a4b143
 	units/systemd-sysctl.service \
a4b143
 	units/emergency.service \
a4b143
 	units/rescue.service \
a4b143
-	units/user@.service \
a4b143
 	units/systemd-hibernate.service \
a4b143
 	units/systemd-hybrid-sleep.service \
a4b143
 	units/systemd-suspend.service \
a4b143
@@ -484,7 +483,6 @@ EXTRA_DIST += \
a4b143
 	units/user/systemd-exit.service.in \
a4b143
 	units/systemd-fsck@.service.in \
a4b143
 	units/systemd-fsck-root.service.in \
a4b143
-	units/user@.service.in \
a4b143
 	units/systemd-udevd.service \
a4b143
 	units/systemd-udev-trigger.service \
a4b143
 	units/systemd-udev-settle.service \
a4b143
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
a4b143
index adbe638..9cc186b 100644
a4b143
--- a/src/login/logind-user.c
a4b143
+++ b/src/login/logind-user.c
a4b143
@@ -365,43 +365,6 @@ static int user_start_slice(User *u) {
a4b143
         return 0;
a4b143
 }
a4b143
 
a4b143
-static int user_start_service(User *u) {
a4b143
-        DBusError error;
a4b143
-        char *job;
a4b143
-        int r;
a4b143
-
a4b143
-        assert(u);
a4b143
-
a4b143
-        dbus_error_init(&error);
a4b143
-
a4b143
-        if (!u->service) {
a4b143
-                char lu[DECIMAL_STR_MAX(unsigned long) + 1], *service;
a4b143
-                sprintf(lu, "%lu", (unsigned long) u->uid);
a4b143
-
a4b143
-                service = unit_name_build("user", lu, ".service");
a4b143
-                if (!service)
a4b143
-                        return log_oom();
a4b143
-
a4b143
-                r = manager_start_unit(u->manager, service, &error, &job;;
a4b143
-                if (r < 0) {
a4b143
-                        log_error("Failed to start user service: %s", bus_error(&error, r));
a4b143
-                        dbus_error_free(&error);
a4b143
-
a4b143
-                        free(service);
a4b143
-                } else {
a4b143
-                        u->service = service;
a4b143
-
a4b143
-                        free(u->service_job);
a4b143
-                        u->service_job = job;
a4b143
-                }
a4b143
-        }
a4b143
-
a4b143
-        if (u->service)
a4b143
-                hashmap_put(u->manager->user_units, u->service, u);
a4b143
-
a4b143
-        return 0;
a4b143
-}
a4b143
-
a4b143
 int user_start(User *u) {
a4b143
         int r;
a4b143
 
a4b143
@@ -422,11 +385,6 @@ int user_start(User *u) {
a4b143
         if (r < 0)
a4b143
                 return r;
a4b143
 
a4b143
-        /* Spawn user systemd */
a4b143
-        r = user_start_service(u);
a4b143
-        if (r < 0)
a4b143
-                return r;
a4b143
-
a4b143
         if (!dual_timestamp_is_set(&u->timestamp))
a4b143
                 dual_timestamp_get(&u->timestamp);
a4b143