diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-11-15 22:12:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-11-15 22:13:26 +0100 |
commit | af2d49f70bcff20efaf2d69aecaf4b3e898ff1fa (patch) | |
tree | 3b2e21237d67459424f5e276dda07a9be3575e62 /src | |
parent | 62347bc24a695bc0527f663af5fe136b1a993573 (diff) |
drop support for MANAGER_SESSION, introduce MANAGER_USER instead
Diffstat (limited to 'src')
-rw-r--r-- | src/dbus-manager.c | 2 | ||||
-rw-r--r-- | src/dbus.c | 2 | ||||
-rw-r--r-- | src/main.c | 18 | ||||
-rw-r--r-- | src/manager.c | 10 | ||||
-rw-r--r-- | src/manager.h | 2 | ||||
-rw-r--r-- | src/path-lookup.c | 28 | ||||
-rw-r--r-- | src/path-lookup.h | 2 | ||||
-rw-r--r-- | src/sd-daemon.h | 2 | ||||
-rw-r--r-- | src/service.c | 2 | ||||
-rw-r--r-- | src/systemadm.vala | 10 | ||||
-rw-r--r-- | src/systemctl-bash-completion.sh | 2 | ||||
-rw-r--r-- | src/systemctl.c | 40 |
12 files changed, 60 insertions, 60 deletions
diff --git a/src/dbus-manager.c b/src/dbus-manager.c index 769035f607..d1d3b4784e 100644 --- a/src/dbus-manager.c +++ b/src/dbus-manager.c @@ -854,7 +854,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Exit")) { if (m->running_as == MANAGER_SYSTEM) { - dbus_set_error(&error, BUS_ERROR_NOT_SUPPORTED, "Exit is only supported for session managers."); + dbus_set_error(&error, BUS_ERROR_NOT_SUPPORTED, "Exit is only supported for user service managers."); return bus_send_error_reply(m, connection, message, &error, -ENOTSUP); } diff --git a/src/dbus.c b/src/dbus.c index 4365bca7bf..66076f021c 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -864,7 +864,7 @@ static int bus_init_api(Manager *m) { if (m->running_as == MANAGER_SYSTEM && m->system_bus) m->api_bus = m->system_bus; else { - if (!(m->api_bus = dbus_bus_get_private(m->running_as == MANAGER_SESSION ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error))) { + if (!(m->api_bus = dbus_bus_get_private(m->running_as == MANAGER_USER ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error))) { log_debug("Failed to get API D-Bus connection, retrying later: %s", error.message); r = 0; goto fail; diff --git a/src/main.c b/src/main.c index 71e684b1bd..4bdc6763fa 100644 --- a/src/main.c +++ b/src/main.c @@ -514,7 +514,7 @@ static int parse_config_file(void) { const char *fn; int r; - fn = arg_running_as == MANAGER_SYSTEM ? SYSTEM_CONFIG_FILE : SESSION_CONFIG_FILE; + fn = arg_running_as == MANAGER_SYSTEM ? SYSTEM_CONFIG_FILE : USER_CONFIG_FILE; if (!(f = fopen(fn, "re"))) { if (errno == ENOENT) @@ -573,7 +573,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_LOG_LOCATION, ARG_UNIT, ARG_SYSTEM, - ARG_SESSION, + ARG_USER, ARG_TEST, ARG_DUMP_CONFIGURATION_ITEMS, ARG_DUMP_CORE, @@ -592,7 +592,7 @@ static int parse_argv(int argc, char *argv[]) { { "log-location", optional_argument, NULL, ARG_LOG_LOCATION }, { "unit", required_argument, NULL, ARG_UNIT }, { "system", no_argument, NULL, ARG_SYSTEM }, - { "session", no_argument, NULL, ARG_SESSION }, + { "user", no_argument, NULL, ARG_USER }, { "test", no_argument, NULL, ARG_TEST }, { "help", no_argument, NULL, 'h' }, { "dump-configuration-items", no_argument, NULL, ARG_DUMP_CONFIGURATION_ITEMS }, @@ -671,8 +671,8 @@ static int parse_argv(int argc, char *argv[]) { arg_running_as = MANAGER_SYSTEM; break; - case ARG_SESSION: - arg_running_as = MANAGER_SESSION; + case ARG_USER: + arg_running_as = MANAGER_USER; break; case ARG_TEST: @@ -794,14 +794,14 @@ static int parse_argv(int argc, char *argv[]) { static int help(void) { printf("%s [OPTIONS...]\n\n" - "Starts up and maintains the system or a session.\n\n" + "Starts up and maintains the system or user services.\n\n" " -h --help Show this help\n" " --test Determine startup sequence, dump it and exit\n" " --dump-configuration-items Dump understood unit configuration items\n" " --introspect[=INTERFACE] Extract D-Bus interface data\n" " --unit=UNIT Set default unit\n" " --system Run a system instance, even if PID != 1\n" - " --session Run a session instance\n" + " --user Run a user instance\n" " --dump-core Dump core on crash\n" " --crash-shell Run shell on crash\n" " --confirm-spawn Ask for confirmation when spawning processes\n" @@ -951,7 +951,7 @@ int main(int argc, char *argv[]) { if (label_init() < 0) goto finish; } else { - arg_running_as = MANAGER_SESSION; + arg_running_as = MANAGER_USER; log_set_target(LOG_TARGET_CONSOLE); } @@ -1235,7 +1235,7 @@ finish: if (arg_running_as == MANAGER_SYSTEM) args[i++] = "--system"; else - args[i++] = "--session"; + args[i++] = "--user"; if (arg_dump_core) args[i++] = "--dump-core"; diff --git a/src/manager.c b/src/manager.c index 204a88e791..25d85eaf11 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2015,7 +2015,7 @@ static int manager_start_target(Manager *m, const char *name, JobMode mode) { dbus_error_init(&error); - log_info("Activating special unit %s", name); + log_debug("Activating special unit %s", name); if ((r = manager_add_job_by_name(m, JOB_START, name, mode, true, &error, NULL)) < 0) log_error("Failed to enqueue %s job: %s", name, bus_error(&error, r)); @@ -2839,7 +2839,7 @@ void manager_run_generators(Manager *m) { assert(m); - generator_path = m->running_as == MANAGER_SYSTEM ? SYSTEM_GENERATOR_PATH : SESSION_GENERATOR_PATH; + generator_path = m->running_as == MANAGER_SYSTEM ? SYSTEM_GENERATOR_PATH : USER_GENERATOR_PATH; if (!(d = opendir(generator_path))) { if (errno == ENOENT) @@ -2852,9 +2852,9 @@ void manager_run_generators(Manager *m) { if (!m->generator_unit_path) { char *p; char system_path[] = "/dev/.systemd/generator-XXXXXX", - session_path[] = "/tmp/systemd-generator-XXXXXX"; + user_path[] = "/tmp/systemd-generator-XXXXXX"; - if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : session_path))) { + if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : user_path))) { log_error("Failed to generate generator directory: %m"); goto finish; } @@ -2990,7 +2990,7 @@ void manager_undo_generators(Manager *m) { static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = { [MANAGER_SYSTEM] = "system", - [MANAGER_SESSION] = "session" + [MANAGER_USER] = "user" }; DEFINE_STRING_TABLE_LOOKUP(manager_running_as, ManagerRunningAs); diff --git a/src/manager.h b/src/manager.h index e61194ad41..c7ace2dd5e 100644 --- a/src/manager.h +++ b/src/manager.h @@ -51,7 +51,7 @@ typedef enum ManagerExitCode { typedef enum ManagerRunningAs { MANAGER_SYSTEM, - MANAGER_SESSION, + MANAGER_USER, _MANAGER_RUNNING_AS_MAX, _MANAGER_RUNNING_AS_INVALID = -1 } ManagerRunningAs; diff --git a/src/path-lookup.c b/src/path-lookup.c index c746e5e1ad..f094969ada 100644 --- a/src/path-lookup.c +++ b/src/path-lookup.c @@ -30,11 +30,11 @@ #include "path-lookup.h" -int session_config_home(char **config_home) { +int user_config_home(char **config_home) { const char *e; if ((e = getenv("XDG_CONFIG_HOME"))) { - if (asprintf(config_home, "%s/systemd/session", e) < 0) + if (asprintf(config_home, "%s/systemd/user", e) < 0) return -ENOMEM; return 1; @@ -42,7 +42,7 @@ int session_config_home(char **config_home) { const char *home; if ((home = getenv("HOME"))) { - if (asprintf(config_home, "%s/.config/systemd/session", home) < 0) + if (asprintf(config_home, "%s/.config/systemd/user", home) < 0) return -ENOMEM; return 1; @@ -52,7 +52,7 @@ int session_config_home(char **config_home) { return 0; } -static char** session_dirs(void) { +static char** user_dirs(void) { const char *home, *e; char *config_home = NULL, *data_home = NULL; char **config_dirs = NULL, **data_dirs = NULL; @@ -67,7 +67,7 @@ static char** session_dirs(void) { * as data, and allow overriding as configuration. */ - if (session_config_home(&config_home) < 0) + if (user_config_home(&config_home) < 0) goto fail; home = getenv("HOME"); @@ -81,11 +81,11 @@ static char** session_dirs(void) { * /etc/systemd/ anyway. */ if ((e = getenv("XDG_DATA_HOME"))) { - if (asprintf(&data_home, "%s/systemd/session", e) < 0) + if (asprintf(&data_home, "%s/systemd/user", e) < 0) goto fail; } else if (home) { - if (asprintf(&data_home, "%s/.local/share/systemd/session", home) < 0) + if (asprintf(&data_home, "%s/.local/share/systemd/user", home) < 0) goto fail; /* There is really no need for two unit dirs in $HOME, @@ -96,7 +96,7 @@ static char** session_dirs(void) { * one. */ mkdir_parents(data_home, 0777); - (void) symlink("../../../.config/systemd/session", data_home); + (void) symlink("../../../.config/systemd/user", data_home); } if ((e = getenv("XDG_DATA_DIRS"))) @@ -115,12 +115,12 @@ static char** session_dirs(void) { r = t; } - if (!(t = strv_merge_concat(r, config_dirs, "/systemd/session"))) + if (!(t = strv_merge_concat(r, config_dirs, "/systemd/user"))) goto finish; strv_free(r); r = t; - if (!(t = strv_append(r, SESSION_CONFIG_UNIT_PATH))) + if (!(t = strv_append(r, USER_CONFIG_UNIT_PATH))) goto fail; strv_free(r); r = t; @@ -132,12 +132,12 @@ static char** session_dirs(void) { r = t; } - if (!(t = strv_merge_concat(r, data_dirs, "/systemd/session"))) + if (!(t = strv_merge_concat(r, data_dirs, "/systemd/user"))) goto fail; strv_free(r); r = t; - if (!(t = strv_append(r, SESSION_DATA_UNIT_PATH))) + if (!(t = strv_append(r, USER_DATA_UNIT_PATH))) goto fail; strv_free(r); r = t; @@ -176,8 +176,8 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) { /* Nothing is set, so let's figure something out. */ strv_free(p->unit_path); - if (running_as == MANAGER_SESSION) { - if (!(p->unit_path = session_dirs())) + if (running_as == MANAGER_USER) { + if (!(p->unit_path = user_dirs())) return -ENOMEM; } else if (!(p->unit_path = strv_new( diff --git a/src/path-lookup.h b/src/path-lookup.h index dca8b55e15..e06f9793d2 100644 --- a/src/path-lookup.h +++ b/src/path-lookup.h @@ -32,7 +32,7 @@ typedef struct LookupPaths { #include "manager.h" -int session_config_home(char **config_home); +int user_config_home(char **config_home); int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as); void lookup_paths_free(LookupPaths *p); diff --git a/src/sd-daemon.h b/src/sd-daemon.h index fdf3cc0354..d0a0a9459a 100644 --- a/src/sd-daemon.h +++ b/src/sd-daemon.h @@ -252,7 +252,7 @@ int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_( fine. You should NOT protect them with a call to this function. Also note that this function checks whether the system, not the user session is controlled by systemd. However the functions above work - for both session and system services. + for both user and system services. See sd_booted(3) for more information. */ diff --git a/src/service.c b/src/service.c index 0b54e5bfcf..184ddf9143 100644 --- a/src/service.c +++ b/src/service.c @@ -1014,7 +1014,7 @@ static int service_add_default_dependencies(Service *s) { if ((r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_BASIC_TARGET, NULL, true)) < 0) return r; - } else if (s->meta.manager->running_as == MANAGER_SESSION) { + } else if (s->meta.manager->running_as == MANAGER_USER) { if ((r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SOCKETS_TARGET, NULL, true)) < 0) return r; diff --git a/src/systemadm.vala b/src/systemadm.vala index 2f3aed205a..3a01efd3c3 100644 --- a/src/systemadm.vala +++ b/src/systemadm.vala @@ -22,7 +22,7 @@ using GLib; using DBus; using Pango; -static bool session = false; +static bool user = false; public class LeftLabel : Label { public LeftLabel(string? text = null) { @@ -103,7 +103,7 @@ public class MainWindow : Window { private ComboBox unit_type_combo_box; public MainWindow() throws DBus.Error { - title = session ? "systemd Session Manager" : "systemd System Manager"; + title = user ? "systemd User Service Manager" : "systemd System Manager"; position = WindowPosition.CENTER; set_default_size(1000, 700); set_border_width(12); @@ -297,7 +297,7 @@ public class MainWindow : Window { bbox.pack_start(cancel_button, false, true, 0); - bus = DBus.Bus.get(session ? DBus.BusType.SESSION : DBus.BusType.SYSTEM); + bus = DBus.Bus.get(user ? DBus.BusType.SESSION : DBus.BusType.SYSTEM); manager = bus.get_object( "org.freedesktop.systemd1", @@ -967,8 +967,8 @@ public class MainWindow : Window { } static const OptionEntry entries[] = { - { "session", 0, 0, OptionArg.NONE, out session, "Connect to session bus", null }, - { "system", 0, OptionFlags.REVERSE, OptionArg.NONE, out session, "Connect to system bus", null }, + { "user", 0, 0, OptionArg.NONE, out user, "Connect to user service manager", null }, + { "system", 0, OptionFlags.REVERSE, OptionArg.NONE, out user, "Connect to system manager", null }, { null } }; diff --git a/src/systemctl-bash-completion.sh b/src/systemctl-bash-completion.sh index 53f8e52aaa..3e3380c8e0 100644 --- a/src/systemctl-bash-completion.sh +++ b/src/systemctl-bash-completion.sh @@ -44,7 +44,7 @@ _systemctl () { local -A OPTS=( [STANDALONE]='--all -a --defaults --fail --force -f --full --global --help -h --no-ask-password --no-block --no-reload --no-wall - --order --require --quiet -q --session --system --version' + --order --require --quiet -q --system --user --version' [ARG]='--kill-mode --kill-who --property -p --signal -s --type -t' ) diff --git a/src/systemctl.c b/src/systemctl.c index 372b3d0ca6..9d6e012309 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -61,7 +61,7 @@ static const char *arg_type = NULL; static char **arg_property = NULL; static bool arg_all = false; static bool arg_fail = false; -static bool arg_session = false; +static bool arg_user = false; static bool arg_global = false; static bool arg_immediate = false; static bool arg_no_block = false; @@ -1234,7 +1234,7 @@ static int start_unit_one( if (need_daemon_reload(bus, name)) log_warning("Unit file of created job changed on disk, 'systemctl %s daemon-reload' recommended.", - arg_session ? "--session" : "--system"); + arg_user ? "--user" : "--system"); if (!arg_no_block) { char *p; @@ -1937,7 +1937,7 @@ static void print_status_info(UnitStatusInfo *i) { printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %s daemon-reload' recommended.\n", ansi_highlight(true), ansi_highlight(false), - arg_session ? "--session" : "--system"); + arg_user ? "--user" : "--system"); } static int status_property(const char *name, DBusMessageIter *iter, UnitStatusInfo *i) { @@ -3919,13 +3919,13 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo static char *get_config_path(void) { - if (arg_session && arg_global) - return strdup(SESSION_CONFIG_UNIT_PATH); + if (arg_user && arg_global) + return strdup(USER_CONFIG_UNIT_PATH); - if (arg_session) { + if (arg_user) { char *p; - if (session_config_home(&p) < 0) + if (user_config_home(&p) < 0) return NULL; return p; @@ -3946,7 +3946,7 @@ static int enable_unit(DBusConnection *bus, char **args, unsigned n) { dbus_error_init(&error); zero(paths); - if ((r = lookup_paths_init(&paths, arg_session ? MANAGER_SESSION : MANAGER_SYSTEM)) < 0) { + if ((r = lookup_paths_init(&paths, arg_user ? MANAGER_USER : MANAGER_SYSTEM)) < 0) { log_error("Failed to determine lookup paths: %s", strerror(-r)); goto finish; } @@ -4010,9 +4010,9 @@ static int enable_unit(DBusConnection *bus, char **args, unsigned n) { /* Don't try to reload anything when updating a unit globally */ !arg_global && /* Don't try to reload anything if we are called for system changes but the system wasn't booted with systemd */ - (arg_session || sd_booted() > 0) && + (arg_user || sd_booted() > 0) && /* Don't try to reload anything if we are running in a chroot environment */ - (arg_session || running_in_chroot() <= 0) ) { + (arg_user || running_in_chroot() <= 0) ) { int q; if ((q = daemon_reload(bus, args, n)) < 0) @@ -4047,8 +4047,8 @@ static int systemctl_help(void) { " pending\n" " -q --quiet Suppress output\n" " --no-block Do not wait until operation finished\n" - " --system Connect to system bus\n" - " --session Connect to session bus\n" + " --system Connect to system manager\n" + " --user Connect to user service manager\n" " --order When generating graph for dot, show only order\n" " --require When generating graph for dot, show only requirement\n" " --no-wall Don't send wall message before halt/power-off/reboot\n" @@ -4105,7 +4105,7 @@ static int systemctl_help(void) { " poweroff Shut down and power-off the system\n" " reboot Shut down and reboot the system\n" " kexec Shut down and reboot the system with kexec\n" - " exit Ask for session termination\n", + " exit Ask for user instance termination\n", program_invocation_short_name); return 0; @@ -4182,7 +4182,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { enum { ARG_FAIL = 0x100, ARG_VERSION, - ARG_SESSION, + ARG_USER, ARG_SYSTEM, ARG_GLOBAL, ARG_NO_BLOCK, @@ -4205,7 +4205,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { { "all", no_argument, NULL, 'a' }, { "full", no_argument, NULL, ARG_FULL }, { "fail", no_argument, NULL, ARG_FAIL }, - { "session", no_argument, NULL, ARG_SESSION }, + { "user", no_argument, NULL, ARG_USER }, { "system", no_argument, NULL, ARG_SYSTEM }, { "global", no_argument, NULL, ARG_GLOBAL }, { "no-block", no_argument, NULL, ARG_NO_BLOCK }, @@ -4273,12 +4273,12 @@ static int systemctl_parse_argv(int argc, char *argv[]) { arg_fail = true; break; - case ARG_SESSION: - arg_session = true; + case ARG_USER: + arg_user = true; break; case ARG_SYSTEM: - arg_session = false; + arg_user = false; break; case ARG_NO_BLOCK: @@ -4315,7 +4315,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { case ARG_GLOBAL: arg_global = true; - arg_session = true; + arg_user = true; break; case ARG_DEFAULTS: @@ -5236,7 +5236,7 @@ int main(int argc, char*argv[]) { goto finish; } - bus_connect(arg_session ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &bus, &private_bus, &error); + bus_connect(arg_user ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &bus, &private_bus, &error); switch (arg_action) { |