diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-12-07 22:25:26 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | eb4fb6ebb1b639fceafd729ab1bbc47f4db64873 (patch) | |
tree | fd10ff4fc025fd85db4014a6b6152f4ba56dc217 /src/login/logind-dbus.c | |
parent | a574cd708cec217e8e948b63aa02c082128c4a3e (diff) |
Use a dash-truncated drop-in for user-%j.slice configuration
This removes the UserTasksMax= setting in logind.conf. Instead, the generic
TasksMax= setting on the slice should be used. Instead of a transient unit we
use a drop-in to tweak the default definition of a .slice. It's better to use
the normal unit mechanisms instead of creating units on the fly. This will also
make it easier to start user@.service independently of logind, or set
additional settings like MemoryMax= for user slices.
The setting in logind is removed, because otherwise we would have two sources
of "truth": the slice on disk and the logind config. Instead of trying to
coordinate those two sources of configuration (and maintainer overrides to
both), let's just convert to the new one fully.
Right now now automatic transition mechanism is provided. logind will emit a
hint when it encounters the setting, but otherwise it will be ignored.
Fixes #2556.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 533206027..cfcbc601d 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -335,6 +335,20 @@ static int property_get_current_inhibitors( return sd_bus_message_append(reply, "t", (uint64_t) hashmap_size(m->inhibitors)); } +static int property_get_compat_user_tasks_max( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + assert(reply); + + return sd_bus_message_append(reply, "t", CGROUP_LIMIT_MAX); +} + static int method_get_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; @@ -1260,7 +1274,7 @@ static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu } static int trigger_device(Manager *m, struct udev_device *d) { - _cleanup_(udev_enumerate_unrefp) struct udev_enumerate *e = NULL; + _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL; struct udev_list_entry *first, *item; int r; @@ -1298,7 +1312,7 @@ static int trigger_device(Manager *m, struct udev_device *d) { } static int attach_device(Manager *m, const char *seat, const char *sysfs) { - _cleanup_(udev_device_unrefp) struct udev_device *d = NULL; + _cleanup_udev_device_unref_ struct udev_device *d = NULL; _cleanup_free_ char *rule = NULL, *file = NULL; const char *id_for_seat; int r; @@ -2876,7 +2890,7 @@ const sd_bus_vtable manager_vtable[] = { SD_BUS_PROPERTY("NCurrentInhibitors", "t", property_get_current_inhibitors, 0, 0), SD_BUS_PROPERTY("SessionsMax", "t", NULL, offsetof(Manager, sessions_max), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("NCurrentSessions", "t", property_get_current_sessions, 0, 0), - SD_BUS_PROPERTY("UserTasksMax", "t", NULL, offsetof(Manager, user_tasks_max), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("UserTasksMax", "t", property_get_compat_user_tasks_max, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), SD_BUS_METHOD("GetSession", "s", "o", method_get_session, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetSessionByPID", "u", "o", method_get_session_by_pid, SD_BUS_VTABLE_UNPRIVILEGED), |