logind.h revision b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f
#pragma once
/***
This file is part of systemd.
Copyright 2011 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdbool.h>
#include "libudev.h"
#include "sd-bus.h"
#include "sd-event.h"
#include "hashmap.h"
#include "list.h"
#include "set.h"
#include "logind-action.h"
#include "logind-button.h"
#include "logind-device.h"
#include "logind-inhibit.h"
struct Manager {
struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev_vcsa_monitor, *udev_button_monitor;
int console_active_fd;
unsigned n_autovts;
unsigned reserve_vt;
int reserve_vt_fd;
char **kill_only_users, **kill_exclude_users;
bool kill_user_processes;
unsigned long session_counter;
unsigned long inhibit_counter;
/* If an action is currently being executed or is delayed,
* this is != 0 and encodes what is being done */
contains the unit name we are supposed to start after the
delay is over */
const char *action_unit;
* the job of it */
char *action_job;
char *scheduled_shutdown_type;
char *scheduled_shutdown_tty;
bool unlink_nologin;
char *wall_message;
unsigned enable_wall_messages;
bool shutdown_dry_run;
bool remove_ipc;
};
extern const sd_bus_vtable manager_vtable[];
int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error);
int manager_start_slice(Manager *manager, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job);
int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job);
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error);
/* gperf lookup function */
int config_parse_tmpfs_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret);
int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret);
int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret);
int manager_setup_wall_message_timer(Manager *m);