1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
7 This file is part of systemd.
9 Copyright 2011 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 #include <dbus/dbus.h>
33 #include "cgroup-util.h"
39 * add display symlinks also per-session
42 * drop redundant udev_device_get_is_initialized() use as soon as libudev is fixed
43 * properly escape/remove : and . from seat names in udev rules
44 * use device_has_tag() as soon as it is available
45 * trigger based on libudev if available
46 * enumerate recursively with libudev when triggering
47 * use sysfs in device hash table, not sysname, when fb driver is fixed
48 * fix ACL enumeration as soon as libudev can properly handle two match tags when enumerating
50 * non-local X11 server
51 * reboot/shutdown halt management
54 typedef struct Manager Manager;
56 #include "logind-device.h"
57 #include "logind-seat.h"
58 #include "logind-session.h"
59 #include "logind-user.h"
69 LIST_HEAD(Seat, seat_gc_queue);
70 LIST_HEAD(Session, session_gc_queue);
71 LIST_HEAD(User, user_gc_queue);
74 struct udev_monitor *udev_seat_monitor, *udev_vcsa_monitor;
79 int console_active_fd;
88 char **controllers, **reset_controllers;
90 char **kill_only_users, **kill_exclude_users;
92 bool kill_user_processes;
94 unsigned long session_counter;
108 Manager *manager_new(void);
109 void manager_free(Manager *m);
111 int manager_add_device(Manager *m, const char *sysfs, Device **_device);
112 int manager_add_seat(Manager *m, const char *id, Seat **_seat);
113 int manager_add_session(Manager *m, User *u, const char *id, Session **_session);
114 int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user);
115 int manager_add_user_by_name(Manager *m, const char *name, User **_user);
116 int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user);
118 int manager_process_seat_device(Manager *m, struct udev_device *d);
119 int manager_dispatch_seat_udev(Manager *m);
120 int manager_dispatch_vcsa_udev(Manager *m);
121 int manager_dispatch_console(Manager *m);
123 int manager_enumerate_devices(Manager *m);
124 int manager_enumerate_seats(Manager *m);
125 int manager_enumerate_sessions(Manager *m);
126 int manager_enumerate_users(Manager *m);
128 int manager_startup(Manager *m);
129 int manager_run(Manager *m);
130 int manager_spawn_autovt(Manager *m, int vtnr);
132 void manager_cgroup_notify_empty(Manager *m, const char *cgroup);
134 void manager_gc(Manager *m, bool drop_not_started);
136 int manager_get_idle_hint(Manager *m, dual_timestamp *t);
138 extern const DBusObjectPathVTable bus_manager_vtable;
140 DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *message, void *userdata);
142 int manager_send_changed(Manager *manager, const char *properties);