From 1be26d51ffd355e1e38fd66c76b296594daf5ed0 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 1 Jun 2018 20:20:09 +0200 Subject: Prep v238: Applied some upstream updates to man (1/5) --- man/elogind.xml | 14 +- man/rules/meson.build | 787 ------------------------------------------- man/sd-login.xml | 277 +++++++++++++++ man/sd_machine_get_class.xml | 2 +- man/sd_pid_get_owner_uid.xml | 363 ++++++++++++++++++++ man/sd_pid_get_session.xml | 359 -------------------- 6 files changed, 650 insertions(+), 1152 deletions(-) create mode 100644 man/sd-login.xml create mode 100644 man/sd_pid_get_owner_uid.xml delete mode 100644 man/sd_pid_get_session.xml diff --git a/man/elogind.xml b/man/elogind.xml index 274f155e8..3b632560d 100644 --- a/man/elogind.xml +++ b/man/elogind.xml @@ -342,20 +342,24 @@ to all zeros. + + + + Globally enable/disable all service watchdog timeouts and emergency + actions. This setting may also be specified during boot, on the kernel + command line via the systemd.service_watchdogs= + option, see below. Defaults to enabled. + + else --> - Daemonize elogind by double-forking into background. - Globally enable/disable all service watchdog timeouts and emergency - actions. This setting may also be specified during boot, on the kernel - command line via the elogind.service_watchdogs= - option, see below. Defaults to enabled. diff --git a/man/rules/meson.build b/man/rules/meson.build index 5248d3267..e1fb22e90 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -1,791 +1,4 @@ # Do not edit. Generated by make-man-rules.py. manpages = [ -['binfmt.d', '5', [], 'ENABLE_BINFMT'], - ['bootctl', '1', [], 'ENABLE_EFI'], - ['bootup', '7', [], ''], - ['busctl', '1', [], ''], - ['coredump.conf', '5', ['coredump.conf.d'], 'ENABLE_COREDUMP'], - ['coredumpctl', '1', [], 'ENABLE_COREDUMP'], - ['crypttab', '5', [], 'HAVE_LIBCRYPTSETUP'], - ['daemon', '7', [], ''], - ['dnssec-trust-anchors.d', - '5', - ['elogind.negative', 'elogind.positive'], - 'ENABLE_RESOLVE'], - ['environment.d', '5', [], 'ENABLE_ENVIRONMENT_D'], - ['file-hierarchy', '7', [], ''], - ['halt', '8', ['poweroff', 'reboot'], ''], - ['hostname', '5', [], ''], - ['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'], - ['hwdb', '7', [], 'ENABLE_HWDB'], - ['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'], - ['journal-upload.conf', '5', ['journal-upload.conf.d'], 'HAVE_MICROHTTPD'], - ['journalctl', '1', [], ''], - ['journald.conf', '5', ['journald.conf.d'], ''], - ['kernel-command-line', '7', [], ''], - ['kernel-install', '8', [], ''], - ['libudev', '3', [], ''], - ['locale.conf', '5', [], ''], - ['localectl', '1', [], 'ENABLE_LOCALED'], - ['localtime', '5', [], ''], - ['loginctl', '1', [], 'ENABLE_LOGIND'], - ['logind.conf', '5', ['logind.conf.d'], 'ENABLE_LOGIND'], - ['machine-id', '5', [], ''], - ['machine-info', '5', [], ''], - ['machinectl', '1', [], 'ENABLE_MACHINED'], - ['modules-load.d', '5', [], 'HAVE_KMOD'], - ['networkctl', '1', [], 'ENABLE_NETWORKD'], - ['networkd.conf', '5', ['networkd.conf.d'], 'ENABLE_NETWORKD'], - ['nss-myhostname', '8', ['libnss_myhostname.so.2'], 'ENABLE_MYHOSTNAME'], - ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_MACHINED'], - ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_RESOLVE'], - ['nss-elogind', '8', ['libnss_elogind.so.2'], 'ENABLE_NSS_SYSTEMD'], - ['os-release', '5', [], ''], - ['pam_elogind', '8', [], 'HAVE_PAM'], - ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVE'], - ['runlevel', '8', [], 'ENABLE_UTMP'], - ['sd-bus-errors', - '3', - ['SD_BUS_ERROR_ACCESS_DENIED', - 'SD_BUS_ERROR_ADDRESS_IN_USE', - 'SD_BUS_ERROR_AUTH_FAILED', - 'SD_BUS_ERROR_BAD_ADDRESS', - 'SD_BUS_ERROR_DISCONNECTED', - 'SD_BUS_ERROR_FAILED', - 'SD_BUS_ERROR_FILE_EXISTS', - 'SD_BUS_ERROR_FILE_NOT_FOUND', - 'SD_BUS_ERROR_INCONSISTENT_MESSAGE', - 'SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED', - 'SD_BUS_ERROR_INVALID_ARGS', - 'SD_BUS_ERROR_INVALID_SIGNATURE', - 'SD_BUS_ERROR_IO_ERROR', - 'SD_BUS_ERROR_LIMITS_EXCEEDED', - 'SD_BUS_ERROR_MATCH_RULE_INVALID', - 'SD_BUS_ERROR_MATCH_RULE_NOT_FOUND', - 'SD_BUS_ERROR_NAME_HAS_NO_OWNER', - 'SD_BUS_ERROR_NOT_SUPPORTED', - 'SD_BUS_ERROR_NO_MEMORY', - 'SD_BUS_ERROR_NO_NETWORK', - 'SD_BUS_ERROR_NO_REPLY', - 'SD_BUS_ERROR_NO_SERVER', - 'SD_BUS_ERROR_PROPERTY_READ_ONLY', - 'SD_BUS_ERROR_SERVICE_UNKNOWN', - 'SD_BUS_ERROR_TIMEOUT', - 'SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN', - 'SD_BUS_ERROR_UNKNOWN_INTERFACE', - 'SD_BUS_ERROR_UNKNOWN_METHOD', - 'SD_BUS_ERROR_UNKNOWN_OBJECT', - 'SD_BUS_ERROR_UNKNOWN_PROPERTY'], - ''], - ['sd-bus', '3', [], ''], - ['sd-daemon', - '3', - ['SD_ALERT', - 'SD_CRIT', - 'SD_DEBUG', - 'SD_EMERG', - 'SD_ERR', - 'SD_INFO', - 'SD_NOTICE', - 'SD_WARNING'], - ''], - ['sd-event', '3', [], ''], - ['sd-id128', - '3', - ['SD_ID128_CONST_STR', - 'SD_ID128_FORMAT_STR', - 'SD_ID128_FORMAT_VAL', - 'SD_ID128_MAKE', - 'SD_ID128_MAKE_STR', - 'SD_ID128_NULL', - 'sd_id128_equal', - 'sd_id128_is_null', - 'sd_id128_t'], - ''], - ['sd-journal', '3', [], ''], - ['sd-login', '3', [], 'HAVE_PAM'], - ['sd_booted', '3', [], ''], - ['sd_bus_add_match', - '3', - ['sd_bus_add_match_async', - 'sd_bus_match_signal', - 'sd_bus_match_signal_async'], - ''], - ['sd_bus_creds_get_pid', - '3', - ['sd_bus_creds_get_audit_login_uid', - 'sd_bus_creds_get_audit_session_id', - 'sd_bus_creds_get_cgroup', - 'sd_bus_creds_get_cmdline', - 'sd_bus_creds_get_comm', - 'sd_bus_creds_get_description', - 'sd_bus_creds_get_egid', - 'sd_bus_creds_get_euid', - 'sd_bus_creds_get_exe', - 'sd_bus_creds_get_fsgid', - 'sd_bus_creds_get_fsuid', - 'sd_bus_creds_get_gid', - 'sd_bus_creds_get_owner_uid', - 'sd_bus_creds_get_ppid', - 'sd_bus_creds_get_selinux_context', - 'sd_bus_creds_get_session', - 'sd_bus_creds_get_sgid', - 'sd_bus_creds_get_slice', - 'sd_bus_creds_get_suid', - 'sd_bus_creds_get_supplementary_gids', - 'sd_bus_creds_get_tid', - 'sd_bus_creds_get_tid_comm', - 'sd_bus_creds_get_tty', - 'sd_bus_creds_get_uid', - 'sd_bus_creds_get_unique_name', - 'sd_bus_creds_get_unit', - 'sd_bus_creds_get_user_slice', - 'sd_bus_creds_get_user_unit', - 'sd_bus_creds_get_well_known_names', - 'sd_bus_creds_has_bounding_cap', - 'sd_bus_creds_has_effective_cap', - 'sd_bus_creds_has_inheritable_cap', - 'sd_bus_creds_has_permitted_cap'], - ''], - ['sd_bus_creds_new_from_pid', - '3', - ['sd_bus_creds_get_augmented_mask', - 'sd_bus_creds_get_mask', - 'sd_bus_creds_ref', - 'sd_bus_creds_unref', - 'sd_bus_creds_unrefp'], - ''], - ['sd_bus_default', - '3', - ['sd_bus_default_system', - 'sd_bus_default_user', - 'sd_bus_open', - 'sd_bus_open_system', - 'sd_bus_open_system_machine', - 'sd_bus_open_system_remote', - 'sd_bus_open_user'], - ''], - ['sd_bus_error', - '3', - ['SD_BUS_ERROR_MAKE_CONST', - 'SD_BUS_ERROR_NULL', - 'sd_bus_error_copy', - 'sd_bus_error_free', - 'sd_bus_error_get_errno', - 'sd_bus_error_has_name', - 'sd_bus_error_is_set', - 'sd_bus_error_set', - 'sd_bus_error_set_const', - 'sd_bus_error_set_errno', - 'sd_bus_error_set_errnof', - 'sd_bus_error_set_errnofv', - 'sd_bus_error_setf'], - ''], - ['sd_bus_error_add_map', - '3', - ['SD_BUS_ERROR_END', 'SD_BUS_ERROR_MAP', 'sd_bus_error_map'], - ''], - ['sd_bus_get_fd', '3', [], ''], - ['sd_bus_get_n_queued_read', '3', ['sd_bus_get_n_queued_write'], ''], - ['sd_bus_is_open', '3', ['sd_bus_is_ready'], ''], - ['sd_bus_message_append', '3', ['sd_bus_message_appendv'], ''], - ['sd_bus_message_append_array', - '3', - ['sd_bus_message_append_array_iovec', - 'sd_bus_message_append_array_memfd', - 'sd_bus_message_append_array_space'], - ''], - ['sd_bus_message_append_basic', '3', [], ''], - ['sd_bus_message_append_string_memfd', - '3', - ['sd_bus_message_append_string_iovec', 'sd_bus_message_append_string_space'], - ''], - ['sd_bus_message_append_strv', '3', [], ''], - ['sd_bus_message_get_cookie', '3', ['sd_bus_message_get_reply_cookie'], ''], - ['sd_bus_message_get_monotonic_usec', - '3', - ['sd_bus_message_get_realtime_usec', 'sd_bus_message_get_seqnum'], - ''], - ['sd_bus_message_read_basic', '3', [], ''], - ['sd_bus_message_set_destination', '3', ['sd_bus_message_set_sender'], ''], - ['sd_bus_negotiate_fds', - '3', - ['sd_bus_negotiate_creds', 'sd_bus_negotiate_timestamp'], - ''], - ['sd_bus_new', '3', ['sd_bus_ref', 'sd_bus_unref', 'sd_bus_unrefp'], ''], - ['sd_bus_path_encode', - '3', - ['sd_bus_path_decode', 'sd_bus_path_decode_many', 'sd_bus_path_encode_many'], - ''], - ['sd_bus_process', '3', [], ''], - ['sd_bus_request_name', - '3', - ['sd_bus_release_name', - 'sd_bus_release_name_async', - 'sd_bus_request_name_async'], - ''], - ['sd_bus_set_connected_signal', '3', ['sd_bus_get_connected_signal'], ''], - ['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''], - ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''], - ['sd_bus_track_add_name', - '3', - ['sd_bus_track_add_sender', - 'sd_bus_track_contains', - 'sd_bus_track_count', - 'sd_bus_track_count_name', - 'sd_bus_track_count_sender', - 'sd_bus_track_first', - 'sd_bus_track_next', - 'sd_bus_track_remove_name', - 'sd_bus_track_remove_sender'], - ''], - ['sd_bus_track_new', - '3', - ['sd_bus_track_get_bus', - 'sd_bus_track_get_recursive', - 'sd_bus_track_get_userdata', - 'sd_bus_track_ref', - 'sd_bus_track_set_recursive', - 'sd_bus_track_set_userdata', - 'sd_bus_track_unref', - 'sd_bus_track_unrefp'], - ''], - ['sd_event_add_child', - '3', - ['sd_event_child_handler_t', 'sd_event_source_get_child_pid'], - ''], - ['sd_event_add_defer', - '3', - ['sd_event_add_exit', 'sd_event_add_post', 'sd_event_handler_t'], - ''], - ['sd_event_add_io', - '3', - ['sd_event_io_handler_t', - 'sd_event_source', - 'sd_event_source_get_io_events', - 'sd_event_source_get_io_fd', - 'sd_event_source_get_io_revents', - 'sd_event_source_set_io_events', - 'sd_event_source_set_io_fd'], - ''], - ['sd_event_add_signal', - '3', - ['sd_event_signal_handler_t', 'sd_event_source_get_signal'], - ''], - ['sd_event_add_time', - '3', - ['sd_event_source_get_time', - 'sd_event_source_get_time_accuracy', - 'sd_event_source_get_time_clock', - 'sd_event_source_set_time', - 'sd_event_source_set_time_accuracy', - 'sd_event_time_handler_t'], - ''], - ['sd_event_exit', '3', ['sd_event_get_exit_code'], ''], - ['sd_event_get_fd', '3', [], ''], - ['sd_event_new', - '3', - ['sd_event', - 'sd_event_default', - 'sd_event_get_tid', - 'sd_event_ref', - 'sd_event_unref', - 'sd_event_unrefp'], - ''], - ['sd_event_now', '3', [], ''], - ['sd_event_run', '3', ['sd_event_loop'], ''], - ['sd_event_set_watchdog', '3', ['sd_event_get_watchdog'], ''], - ['sd_event_source_get_event', '3', [], ''], - ['sd_event_source_get_pending', '3', [], ''], - ['sd_event_source_set_description', - '3', - ['sd_event_source_get_description'], - ''], - ['sd_event_source_set_enabled', - '3', - ['SD_EVENT_OFF', - 'SD_EVENT_ON', - 'SD_EVENT_ONESHOT', - 'sd_event_source_get_enabled'], - ''], - ['sd_event_source_set_prepare', '3', [], ''], - ['sd_event_source_set_priority', - '3', - ['SD_EVENT_PRIORITY_IDLE', - 'SD_EVENT_PRIORITY_IMPORTANT', - 'SD_EVENT_PRIORITY_NORMAL', - 'sd_event_source_get_priority'], - ''], - ['sd_event_source_set_userdata', '3', ['sd_event_source_get_userdata'], ''], - ['sd_event_source_unref', - '3', - ['sd_event_source_ref', 'sd_event_source_unrefp'], - ''], - ['sd_event_wait', - '3', - ['SD_EVENT_ARMED', - 'SD_EVENT_EXITING', - 'SD_EVENT_FINISHED', - 'SD_EVENT_INITIAL', - 'SD_EVENT_PENDING', - 'SD_EVENT_PREPARING', - 'SD_EVENT_RUNNING', - 'sd_event_dispatch', - 'sd_event_get_iteration', - 'sd_event_get_state', - 'sd_event_prepare'], - ''], - ['sd_get_seats', - '3', - ['sd_get_machine_names', 'sd_get_sessions', 'sd_get_uids'], - 'HAVE_PAM'], - ['sd_id128_get_machine', - '3', - ['sd_id128_get_boot', - 'sd_id128_get_invocation', - 'sd_id128_get_machine_app_specific'], - ''], - ['sd_id128_randomize', '3', [], ''], - ['sd_id128_to_string', '3', ['sd_id128_from_string'], ''], - ['sd_is_fifo', - '3', - ['sd_is_mq', - 'sd_is_socket', - 'sd_is_socket_inet', - 'sd_is_socket_sockaddr', - 'sd_is_socket_unix', - 'sd_is_special'], - ''], - ['sd_journal_add_match', - '3', - ['sd_journal_add_conjunction', - 'sd_journal_add_disjunction', - 'sd_journal_flush_matches'], - ''], - ['sd_journal_enumerate_fields', - '3', - ['SD_JOURNAL_FOREACH_FIELD', 'sd_journal_restart_fields'], - ''], - ['sd_journal_get_catalog', '3', ['sd_journal_get_catalog_for_message_id'], ''], - ['sd_journal_get_cursor', '3', ['sd_journal_test_cursor'], ''], - ['sd_journal_get_cutoff_realtime_usec', - '3', - ['sd_journal_get_cutoff_monotonic_usec'], - ''], - ['sd_journal_get_data', - '3', - ['SD_JOURNAL_FOREACH_DATA', - 'sd_journal_enumerate_data', - 'sd_journal_get_data_threshold', - 'sd_journal_restart_data', - 'sd_journal_set_data_threshold'], - ''], - ['sd_journal_get_fd', - '3', - ['SD_JOURNAL_APPEND', - 'SD_JOURNAL_INVALIDATE', - 'SD_JOURNAL_NOP', - 'sd_journal_get_events', - 'sd_journal_get_timeout', - 'sd_journal_process', - 'sd_journal_reliable_fd', - 'sd_journal_wait'], - ''], - ['sd_journal_get_realtime_usec', '3', ['sd_journal_get_monotonic_usec'], ''], - ['sd_journal_get_usage', '3', [], ''], - ['sd_journal_has_runtime_files', '3', ['sd_journal_has_persistent_files'], ''], - ['sd_journal_next', - '3', - ['SD_JOURNAL_FOREACH', - 'SD_JOURNAL_FOREACH_BACKWARDS', - 'sd_journal_next_skip', - 'sd_journal_previous', - 'sd_journal_previous_skip'], - ''], - ['sd_journal_open', - '3', - ['SD_JOURNAL_CURRENT_USER', - 'SD_JOURNAL_LOCAL_ONLY', - 'SD_JOURNAL_OS_ROOT', - 'SD_JOURNAL_RUNTIME_ONLY', - 'SD_JOURNAL_SYSTEM', - 'sd_journal', - 'sd_journal_close', - 'sd_journal_open_directory', - 'sd_journal_open_directory_fd', - 'sd_journal_open_files', - 'sd_journal_open_files_fd'], - ''], - ['sd_journal_print', - '3', - ['SD_JOURNAL_SUPPRESS_LOCATION', - 'sd_journal_perror', - 'sd_journal_printv', - 'sd_journal_send', - 'sd_journal_sendv'], - ''], - ['sd_journal_query_unique', - '3', - ['SD_JOURNAL_FOREACH_UNIQUE', - 'sd_journal_enumerate_unique', - 'sd_journal_restart_unique'], - ''], - ['sd_journal_seek_head', - '3', - ['sd_journal_seek_cursor', - 'sd_journal_seek_monotonic_usec', - 'sd_journal_seek_realtime_usec', - 'sd_journal_seek_tail'], - ''], - ['sd_journal_stream_fd', '3', [], ''], - ['sd_listen_fds', - '3', - ['SD_LISTEN_FDS_START', 'sd_listen_fds_with_names'], - ''], - ['sd_login_monitor_new', - '3', - ['sd_login_monitor', - 'sd_login_monitor_flush', - 'sd_login_monitor_get_events', - 'sd_login_monitor_get_fd', - 'sd_login_monitor_get_timeout', - 'sd_login_monitor_unref', - 'sd_login_monitor_unrefp'], - 'HAVE_PAM'], - ['sd_machine_get_class', '3', ['sd_machine_get_ifindices'], ''], - ['sd_notify', - '3', - ['sd_notifyf', 'sd_pid_notify', 'sd_pid_notify_with_fds', 'sd_pid_notifyf'], - ''], - ['sd_pid_get_owner_uid', - '3', - ['sd_peer_get_cgroup', - 'sd_peer_get_machine_name', - 'sd_peer_get_owner_uid', - 'sd_peer_get_session', - 'sd_peer_get_slice', - 'sd_peer_get_unit', - 'sd_peer_get_user_slice', - 'sd_peer_get_user_unit', - 'sd_pid_get_cgroup', - 'sd_pid_get_machine_name', - 'sd_pid_get_session', - 'sd_pid_get_slice', - 'sd_pid_get_unit', - 'sd_pid_get_user_slice', - 'sd_pid_get_user_unit'], - 'HAVE_PAM'], - ['sd_seat_get_active', - '3', - ['sd_seat_can_graphical', - 'sd_seat_can_multi_session', - 'sd_seat_can_tty', - 'sd_seat_get_sessions'], - 'HAVE_PAM'], - ['sd_session_is_active', - '3', - ['sd_session_get_class', - 'sd_session_get_desktop', - 'sd_session_get_display', - 'sd_session_get_remote_host', - 'sd_session_get_remote_user', - 'sd_session_get_seat', - 'sd_session_get_service', - 'sd_session_get_state', - 'sd_session_get_tty', - 'sd_session_get_type', - 'sd_session_get_uid', - 'sd_session_get_vt', - 'sd_session_is_remote'], - 'HAVE_PAM'], - ['sd_uid_get_state', - '3', - ['sd_uid_get_display', - 'sd_uid_get_seats', - 'sd_uid_get_sessions', - 'sd_uid_is_on_seat'], - 'HAVE_PAM'], - ['sd_watchdog_enabled', '3', [], ''], - ['shutdown', '8', [], ''], - ['sysctl.d', '5', [], ''], - ['systemctl', '1', [], ''], - ['elogind-analyze', '1', [], ''], - ['elogind-ask-password-console.service', - '8', - ['elogind-ask-password-console.path', - 'elogind-ask-password-wall.path', - 'elogind-ask-password-wall.service'], - ''], - ['elogind-ask-password', '1', [], ''], - ['elogind-backlight@.service', '8', ['elogind-backlight'], 'ENABLE_BACKLIGHT'], - ['elogind-binfmt.service', '8', ['elogind-binfmt'], 'ENABLE_BINFMT'], - ['elogind-cat', '1', [], ''], - ['elogind-cgls', '1', [], ''], - ['elogind-cgtop', '1', [], ''], - ['elogind-coredump', - '8', - ['elogind-coredump.socket', 'elogind-coredump@.service'], - 'ENABLE_COREDUMP'], - ['elogind-cryptsetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'], - ['elogind-cryptsetup@.service', - '8', - ['elogind-cryptsetup'], - 'HAVE_LIBCRYPTSETUP'], - ['elogind-debug-generator', '8', [], ''], - ['elogind-delta', '1', [], ''], - ['elogind-detect-virt', '1', [], ''], - ['elogind-environment-d-generator', - '8', - ['30-elogind-environment-d-generator'], - 'ENABLE_ENVIRONMENT_D'], - ['elogind-escape', '1', [], ''], - ['elogind-firstboot', '1', ['elogind-firstboot.service'], 'ENABLE_FIRSTBOOT'], - ['elogind-fsck@.service', - '8', - ['elogind-fsck', 'elogind-fsck-root.service'], - ''], - ['elogind-fstab-generator', '8', [], ''], - ['elogind-getty-generator', '8', [], ''], - ['elogind-gpt-auto-generator', '8', [], ''], - ['elogind-halt.service', - '8', - ['elogind-kexec.service', - 'elogind-poweroff.service', - 'elogind-reboot.service', - 'elogind-shutdown'], - ''], - ['elogind-hibernate-resume-generator', '8', [], 'ENABLE_HIBERNATE'], - ['elogind-hibernate-resume@.service', - '8', - ['elogind-hibernate-resume'], - 'ENABLE_HIBERNATE'], - ['elogind-hostnamed.service', '8', ['elogind-hostnamed'], 'ENABLE_HOSTNAMED'], - ['elogind-hwdb', '8', [], 'ENABLE_HWDB'], - ['elogind-importd.service', '8', ['elogind-importd'], 'ENABLE_IMPORTD'], - ['elogind-inhibit', '1', [], ''], - ['elogind-initctl.service', - '8', - ['elogind-initctl', 'elogind-initctl.socket'], - ''], - ['elogind-journal-gatewayd.service', - '8', - ['elogind-journal-gatewayd', 'elogind-journal-gatewayd.socket'], - 'HAVE_MICROHTTPD'], - ['elogind-journal-remote', '8', [], 'HAVE_MICROHTTPD'], - ['elogind-journal-upload', '8', [], 'HAVE_MICROHTTPD'], - ['elogind-journald.service', - '8', - ['elogind-journald', - 'elogind-journald-audit.socket', - 'elogind-journald-dev-log.socket', - 'elogind-journald.socket'], - ''], - ['elogind-localed.service', '8', ['elogind-localed'], 'ENABLE_LOCALED'], - ['elogind.service', '8', ['elogind'], 'ENABLE_LOGIND'], - ['elogind-machine-id-commit.service', '8', [], ''], - ['elogind-machine-id-setup', '1', [], ''], - ['elogind-machined.service', '8', ['elogind-machined'], 'ENABLE_MACHINED'], - ['elogind-makefs@.service', - '8', - ['elogind-growfs', - 'elogind-growfs@.service', - 'elogind-makefs', - 'elogind-makeswap@.service'], - ''], - ['elogind-modules-load.service', '8', ['elogind-modules-load'], 'HAVE_KMOD'], - ['elogind-mount', '1', ['elogind-umount'], ''], - ['elogind-networkd-wait-online.service', - '8', - ['elogind-networkd-wait-online'], - 'ENABLE_NETWORKD'], - ['elogind-networkd.service', '8', ['elogind-networkd'], 'ENABLE_NETWORKD'], - ['elogind-notify', '1', [], ''], - ['elogind-nspawn', '1', [], ''], - ['elogind-path', '1', [], ''], - ['elogind-quotacheck.service', - '8', - ['elogind-quotacheck'], - 'ENABLE_QUOTACHECK'], - ['elogind-random-seed.service', - '8', - ['elogind-random-seed'], - 'ENABLE_RANDOMSEED'], - ['elogind-rc-local-generator', '8', [], ''], - ['elogind-remount-fs.service', '8', ['elogind-remount-fs'], ''], - ['elogind-resolve', '1', [], 'ENABLE_RESOLVE'], - ['elogind-resolved.service', '8', ['elogind-resolved'], 'ENABLE_RESOLVE'], - ['elogind-rfkill.service', - '8', - ['elogind-rfkill', 'elogind-rfkill.socket'], - 'ENABLE_RFKILL'], - ['elogind-run', '1', [], ''], - ['elogind-sleep.conf', '5', ['sleep.conf.d'], ''], - ['elogind-socket-activate', '1', [], ''], - ['elogind-socket-proxyd', '8', [], ''], - ['elogind-suspend.service', - '8', - ['elogind-hibernate.service', - 'elogind-hybrid-sleep.service', - 'elogind-sleep'], - ''], - ['elogind-sysctl.service', '8', ['elogind-sysctl'], ''], - ['elogind-system-update-generator', '8', [], ''], - ['elogind-system.conf', - '5', - ['system.conf.d', 'elogind-user.conf', 'user.conf.d'], - ''], - ['elogind-sysusers', '8', ['elogind-sysusers.service'], ''], - ['elogind-sysv-generator', '8', [], 'HAVE_SYSV_COMPAT'], - ['elogind-timedated.service', '8', ['elogind-timedated'], 'ENABLE_TIMEDATED'], - ['elogind-timesyncd.service', '8', ['elogind-timesyncd'], 'ENABLE_TIMESYNCD'], - ['elogind-tmpfiles', - '8', - ['elogind-tmpfiles-clean.service', - 'elogind-tmpfiles-clean.timer', - 'elogind-tmpfiles-setup-dev.service', - 'elogind-tmpfiles-setup.service'], - ''], - ['elogind-tty-ask-password-agent', '1', [], ''], - ['elogind-udevd.service', - '8', - ['elogind-udevd', - 'elogind-udevd-control.socket', - 'elogind-udevd-kernel.socket'], - ''], - ['elogind-update-done.service', '8', ['elogind-update-done'], ''], - ['elogind-update-utmp.service', - '8', - ['elogind-update-utmp', 'elogind-update-utmp-runlevel.service'], - 'ENABLE_UTMP'], - ['elogind-user-sessions.service', '8', ['elogind-user-sessions'], 'HAVE_PAM'], - ['elogind-vconsole-setup.service', - '8', - ['elogind-vconsole-setup'], - 'ENABLE_VCONSOLE'], - ['elogind-veritysetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'], - ['elogind-veritysetup@.service', - '8', - ['elogind-veritysetup'], - 'HAVE_LIBCRYPTSETUP'], - ['elogind-volatile-root.service', '8', ['elogind-volatile-root'], ''], - ['elogind', '1', ['init'], ''], - ['elogind.automount', '5', [], ''], - ['elogind.device', '5', [], ''], - ['elogind.dnssd', '5', [], 'ENABLE_RESOLVE'], - ['elogind.environment-generator', '7', [], 'ENABLE_ENVIRONMENT_D'], - ['elogind.exec', '5', [], ''], - ['elogind.generator', '7', [], ''], - ['elogind.journal-fields', '7', [], ''], - ['elogind.kill', '5', [], ''], - ['elogind.link', '5', [], ''], - ['elogind.mount', '5', [], ''], - ['elogind.netdev', '5', [], 'ENABLE_NETWORKD'], - ['elogind.network', '5', [], 'ENABLE_NETWORKD'], - ['elogind.nspawn', '5', [], ''], - ['elogind.offline-updates', '7', [], ''], - ['elogind.path', '5', [], ''], - ['elogind.preset', '5', [], ''], - ['elogind.resource-control', '5', [], ''], - ['elogind.scope', '5', [], ''], - ['elogind.service', '5', [], ''], - ['elogind.slice', '5', [], ''], - ['elogind.socket', '5', [], ''], - ['elogind.special', '7', [], ''], - ['elogind.swap', '5', [], ''], - ['elogind.target', '5', [], ''], - ['elogind.time', '7', [], ''], - ['elogind.timer', '5', [], ''], - ['elogind.unit', '5', [], ''], - ['sysusers.d', '5', [], 'ENABLE_SYSUSERS'], - ['telinit', '8', [], ''], - ['timedatectl', '1', [], 'ENABLE_TIMEDATED'], - ['timesyncd.conf', '5', ['timesyncd.conf.d'], 'ENABLE_TIMESYNCD'], - ['tmpfiles.d', '5', [], ''], - ['udev', '7', [], ''], - ['udev.conf', '5', [], ''], - ['udev_device_get_syspath', - '3', - ['udev_device_get_action', - 'udev_device_get_devnode', - 'udev_device_get_devnum', - 'udev_device_get_devpath', - 'udev_device_get_devtype', - 'udev_device_get_driver', - 'udev_device_get_is_initialized', - 'udev_device_get_parent', - 'udev_device_get_parent_with_subsystem_devtype', - 'udev_device_get_subsystem', - 'udev_device_get_sysname', - 'udev_device_get_sysnum', - 'udev_device_get_udev'], - ''], - ['udev_device_has_tag', - '3', - ['udev_device_get_devlinks_list_entry', - 'udev_device_get_properties_list_entry', - 'udev_device_get_property_value', - 'udev_device_get_sysattr_list_entry', - 'udev_device_get_sysattr_value', - 'udev_device_get_tags_list_entry', - 'udev_device_set_sysattr_value'], - ''], - ['udev_device_new_from_syspath', - '3', - ['udev_device_new_from_device_id', - 'udev_device_new_from_devnum', - 'udev_device_new_from_environment', - 'udev_device_new_from_subsystem_sysname', - 'udev_device_ref', - 'udev_device_unref'], - ''], - ['udev_enumerate_add_match_subsystem', - '3', - ['udev_enumerate_add_match_is_initialized', - 'udev_enumerate_add_match_parent', - 'udev_enumerate_add_match_property', - 'udev_enumerate_add_match_sysattr', - 'udev_enumerate_add_match_sysname', - 'udev_enumerate_add_match_tag', - 'udev_enumerate_add_nomatch_subsystem', - 'udev_enumerate_add_nomatch_sysattr'], - ''], - ['udev_enumerate_new', - '3', - ['udev_enumerate_ref', 'udev_enumerate_unref'], - ''], - ['udev_enumerate_scan_devices', - '3', - ['udev_enumerate_add_syspath', - 'udev_enumerate_get_list_entry', - 'udev_enumerate_get_udev', - 'udev_enumerate_scan_subsystems'], - ''], - ['udev_list_entry', - '3', - ['udev_list_entry_get_by_name', - 'udev_list_entry_get_name', - 'udev_list_entry_get_next', - 'udev_list_entry_get_value'], - ''], - ['udev_monitor_filter_update', - '3', - ['udev_monitor_filter_add_match_subsystem_devtype', - 'udev_monitor_filter_add_match_tag', - 'udev_monitor_filter_remove'], - ''], - ['udev_monitor_new_from_netlink', - '3', - ['udev_monitor_ref', 'udev_monitor_unref'], - ''], - ['udev_monitor_receive_device', - '3', - ['udev_monitor_enable_receiving', - 'udev_monitor_get_fd', - 'udev_monitor_get_udev', - 'udev_monitor_set_receive_buffer_size'], - ''], - ['udev_new', '3', ['udev_ref', 'udev_unref'], ''], - ['udevadm', '8', [], ''], - ['vconsole.conf', '5', [], 'ENABLE_VCONSOLE'] ] # Really, do not edit. diff --git a/man/sd-login.xml b/man/sd-login.xml new file mode 100644 index 000000000..148dd19ce --- /dev/null +++ b/man/sd-login.xml @@ -0,0 +1,277 @@ + + + + + + + + + sd-login + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd-login + 3 + + + + sd-login + APIs for + tracking logins + + + + + #include <systemd/sd-login.h> + + + + pkg-config --cflags --libs libsystemd + + + + + Description + + sd-login.h provides APIs to introspect + and monitor seat, login session and user status information on the + local system. + + Note that these APIs only allow purely passive access and + monitoring of seats, sessions and users. To actively make changes + to the seat configuration, terminate login sessions, or switch + session on a seat you need to utilize the D-Bus API of + systemd-logind, instead. + + These functions synchronously access data in + /proc, /sys/fs/cgroup + and /run. All of these are virtual file + systems, hence the runtime cost of the accesses is relatively + cheap. + + It is possible (and often a very good choice) to mix calls + to the synchronous interface of sd-login.h + with the asynchronous D-Bus interface of systemd-logind. However, + if this is done you need to think a bit about possible races since + the stream of events from D-Bus and from + sd-login.h interfaces such as the login + monitor are asynchronous and not ordered against each + other. + + If the functions return string arrays, these are generally + NULL terminated and need to be freed by the + caller with the libc + free3 + call after use, including the strings referenced therein. + Similarly, individual strings returned need to be freed, as + well. + + As a special exception, instead of an empty string array + NULL may be returned, which should be treated + equivalent to an empty string array. + + See + sd_pid_get_session3, + sd_uid_get_state3, + sd_session_is_active3, + sd_seat_get_active3, + sd_get_seats3, + sd_login_monitor_new3 + for more information about the functions + implemented. + + + + Definition of Terms + + + + seat + + A seat consists of all hardware devices assigned to a specific + workplace. It consists of at least one graphics device, and usually also includes + keyboard, mouse. It can also include video cameras, sound cards and more. Seats + are identified by seat names, which are strings (<= 255 characters), that start + with the four characters seat followed by at least one + character from the range [a-zA-Z0-9], _ and + -. They are suitable for use as file names. Seat names may or + may not be stable and may be reused if a seat becomes available again. + + + + + session + + A session is defined by the time a user is logged in until they + log out. A session is bound to one or no seats (the latter for 'virtual' ssh + logins). Multiple sessions can be attached to the same seat, but only one of them + can be active, the others are in the background. A session is identified by a + short string. + + + systemd1 + ensures that audit sessions are identical to systemd sessions, and uses the audit + session ID as session ID in systemd (if auditing is enabled). In general the + session identifier is a short string consisting only of [a-zA-Z0-9], + _ and -, suitable for use as a file name. + Session IDs are unique on the local machine and are + never reused as long as the machine is online. A user (the way we know it on UNIX) + corresponds to the person using a computer. A single user can have multiple + sessions open at the same time. A user is identified by a numeric user id (UID) or + a user name (a string). A multi-session system allows multiple user sessions on + the same seat at the same time. A multi-seat system allows multiple independent + seats that can be individually and simultaneously used by different users. + + + + + All hardware devices that are eligible to being assigned to a seat, are assigned + to one. A device can be assigned to only one seat at a time. If a device is not + assigned to any particular other seat it is implicitly assigned to the special default + seat called seat0. + + Note that hardware like printers, hard disks or network cards is generally not + assigned to a specific seat. They are available to all seats equally. (Well, with one + exception: USB sticks can be assigned to a seat.) + + seat0 always exists. + + + + udev Rules + + Assignment of hardware devices to seats is managed inside the udev database, via + settings on the devices: + + + + Tag seat + + When set, a device is eligible to be assigned to a seat. This tag + is set for graphics devices, mice, keyboards, video cards, sound cards and + more. Note that some devices like sound cards consist of multiple subdevices + (i.e. a PCM for input and another one for output). This tag will be set only for + the originating device, not for the individual subdevices. A UI for configuring + assignment of devices to seats should enumerate and subscribe to all devices with + this tag set and show them in the UI. Note that USB hubs can be assigned to a seat + as well, in which case all (current and future) devices plugged into it will also + be assigned to the same seat (unless they are explicitly assigned to another + seat). + + + + + Tag master-of-seat + + When set, this device is enough for a seat to be considered + existent. This tag is usually set for the framebuffer device of graphics cards. A + seat hence consists of an arbitrary number of devices marked with the + seat tag, but (at least) one of these devices needs to be + tagged with master-of-seat before the seat is actually + considered to be around. + + + + Property ID_SEAT + + This property specifies the name of the seat a specific device is + assigned to. If not set the device is assigned to seat0. Also, + to speed up enumeration of hardware belonging to a specific seat, the seat is also + set as tag on the device. I.e. if the property + ID_SEAT=seat-waldo is set for a device, the tag + seat-waldo will be set as well. Note that if a device is + assigned to seat0, it will usually not carry such a tag and you + need to enumerate all devices and check the ID_SEAT property + manually. Again, if a device is assigned to seat0 this is visible on the device in + two ways: with a property ID_SEAT=seat0 and with no property + ID_SEAT set for it at all. + + + + Property ID_AUTOSEAT + + When set to 1, this device automatically + generates a new and independent seat, which is named after the path of the + device. This is set for specialized USB hubs like the Plugable devices, which when + plugged in should create a hotplug seat without further configuration. + + + + + Property ID_FOR_SEAT + + When creating additional (manual) seats starting from a graphics + device this is a good choice to name the seat after. It is created from the path + of the device. This is useful in UIs for configuring seats: as soon as you create + a new seat from a graphics device, read this property and prefix it with + seat- and use it as name for the seat. + + + + A seat exists only and exclusively because a properly tagged device with the + right ID_SEAT property exists. Besides udev rules there is no + persistent data about seats stored on disk. + + Note that + systemd-logind8 + manages ACLs on a number of device classes, to allow user code to access the device + nodes attached to a seat as long as the user has an active session on it. This is + mostly transparent to applications. As mentioned above, for certain user software it + might be a good idea to watch whether they can access device nodes instead of thinking + about seats. + + + + + + See Also + + systemd1, + sd_pid_get_session3, + sd_uid_get_state3, + sd_session_is_active3, + sd_seat_get_active3, + sd_get_seats3, + sd_login_monitor_new3, + sd-daemon3, + pkg-config1 + + + + Multi-Seat on Linux + for an introduction to multi-seat support on Linux and the background for this set of APIs. + + + + diff --git a/man/sd_machine_get_class.xml b/man/sd_machine_get_class.xml index 7f60088d1..a99097476 100644 --- a/man/sd_machine_get_class.xml +++ b/man/sd_machine_get_class.xml @@ -146,11 +146,11 @@ elogind8, sd-login3, - elogind-machined.service8, sd_pid_get_machine_name3 diff --git a/man/sd_pid_get_owner_uid.xml b/man/sd_pid_get_owner_uid.xml new file mode 100644 index 000000000..fcedcfcd1 --- /dev/null +++ b/man/sd_pid_get_owner_uid.xml @@ -0,0 +1,363 @@ + + + + + + + + + sd_pid_get_owner_uid + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_pid_get_owner_uid + 3 + + + + sd_pid_get_owner_uid + sd_pid_get_session + sd_pid_get_user_unit + sd_pid_get_unit + sd_pid_get_machine_name + sd_pid_get_slice + sd_pid_get_user_slice + sd_pid_get_cgroup + sd_peer_get_owner_uid + sd_peer_get_session + sd_peer_get_user_unit + sd_peer_get_unit + sd_peer_get_machine_name + sd_peer_get_slice + sd_peer_get_user_slice + sd_peer_get_cgroup + Determine the owner uid of the user unit or session, + or the session, user unit, system unit, container/VM or slice that + a specific PID or socket peer belongs to. + + + + + #include <systemd/sd-login.h> + + + int sd_pid_get_owner_uid + pid_t pid + uid_t *uid + + + + int sd_pid_get_session + pid_t pid + char **session + + + + int sd_pid_get_user_unit + pid_t pid + char **unit + + + + int sd_pid_get_unit + pid_t pid + char **unit + + + + int sd_pid_get_machine_name + pid_t pid + char **name + + + + int sd_pid_get_slice + pid_t pid + char **slice + + + + int sd_pid_get_user_slice + pid_t pid + char **slice + + + + int sd_pid_get_cgroup + pid_t pid + char **cgroup + + + + int sd_peer_get_owner_uid + int fd + uid_t *uid + + + + int sd_peer_get_session + int fd + char **session + + + + int sd_peer_get_user_unit + int fd + char **unit + + + + int sd_peer_get_unit + int fd + char **unit + + + + int sd_peer_get_machine_name + int fd + char **name + + + + int sd_peer_get_slice + int fd + char **slice + + + + int sd_peer_get_user_slice + int fd + char **slice + + + + int sd_peer_get_cgroup + int fd + char **cgroup + + + + + + Description + + sd_pid_get_owner_uid() may be used to + determine the Unix UID (user identifier) which owns the login + session or systemd user unit of a process identified by the + specified PID. For processes which are not part of a login session + and not managed by a user manager, this function will fail with + -ENODATA. + + sd_pid_get_session() may be used to + determine the login session identifier of a process identified by + the specified process identifier. The session identifier is a + short string, suitable for usage in file system paths. Please + note the login session may be limited to a stub process or two. + User processes may instead be started from their systemd user + manager, e.g. GUI applications started using DBus activation, as + well as service processes which are shared between multiple logins + of the same user. For processes which are not part of a login + session, this function will fail with -ENODATA. + The returned string needs to be freed with the libc free3 + call after use. + + sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service or scope unit) + identifier of a process identified by the specified PID. The + unit name is a short string, suitable for usage in file system + paths. For processes which are not managed by a user manager, this + function will fail with -ENODATA. The + returned string needs to be freed with the libc free3 + call after use. + + sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service or scope + unit) identifier of a process identified by the specified PID. The + unit name is a short string, suitable for usage in file system + paths. Note that not all processes are part of a system + unit/service. For processes not being part of a systemd system + unit, this function will fail with -ENODATA. + (More specifically, this call will not work for kernel threads.) + The returned string needs to be freed with the libc free3 + call after use. + + sd_pid_get_machine_name() may be used + to determine the name of the VM or container is a member of. The + machine name is a short string, suitable for usage in file system + paths. The returned string needs to be freed with the libc + free3 + call after use. For processes not part of a VM or container, this + function fails with -ENODATA. + + sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice5 + for details about slices. The returned string needs to be freed + with the libc + free3 + call after use. + + Similarly, sd_pid_get_user_slice() + returns the user slice (as managed by the user's systemd instance) + of a process. + + sd_pid_get_cgroup() returns the control + group path of the specified process, relative to the root of the + hierarchy. Returns the path without trailing slash, except for + processes located in the root control group, where "/" is + returned. To find the actual control group path in the file system, + the returned path needs to be prefixed with + /sys/fs/cgroup/ (if the unified control group + setup is used), or + /sys/fs/cgroup/HIERARCHY/ + (if the legacy multi-hierarchy control group setup is used). + + If the pid parameter of any of these + functions is passed as 0, the operation is executed for the + calling process. + + The sd_peer_get_owner_uid(), + sd_peer_get_session(), + sd_peer_get_user_unit(), + sd_peer_get_unit(), + sd_peer_get_machine_name(), + sd_peer_get_slice(), + sd_peer_get_user_slice() and + sd_peer_get_cgroup() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process. Note + that these fields are retrieved via /proc, + and hence are not suitable for authorization purposes, as they are + subject to races. + + + + Return Value + + On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code. + + + + Errors + + Returned errors may indicate the following problems: + + + + + -ESRCH + + The specified PID does not refer to a running + process. + + + + + -EBADF + + The specified socket file descriptor was + invalid. + + + + -ENODATA + + The given field is not specified for the described + process or peer. + + + + + -EINVAL + + An input parameter was invalid (out of range, + or NULL, where that is not accepted). + + + + -ENOMEM + + Memory allocation failed. + + + + + + Notes + + The sd_pid_get_session(), + sd_pid_get_unit(), + sd_pid_get_user_unit(), + sd_pid_get_owner_uid(), + sd_pid_get_machine_name(), + sd_pid_get_slice(), + sd_pid_get_user_slice(), + sd_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name(), + sd_peer_get_slice() and + sd_peer_get_user_slice() interfaces are + available as a shared library, which can be compiled and linked to + with the libsystemd pkg-config1 + file. + + Note that the login session identifier as + returned by sd_pid_get_session() + is completely unrelated to the process session + identifier as returned by + getsid2. + + + + See Also + + + systemd1, + sd-login3, + sd_session_is_active3, + getsid2, + systemd.slice5, + systemd-machined.service8 + + + + diff --git a/man/sd_pid_get_session.xml b/man/sd_pid_get_session.xml deleted file mode 100644 index a4be941de..000000000 --- a/man/sd_pid_get_session.xml +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - sd_pid_get_session - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_pid_get_session - 3 - - - - sd_pid_get_session - sd_pid_get_unit - sd_pid_get_user_unit - sd_pid_get_owner_uid - sd_pid_get_machine_name - sd_pid_get_slice - sd_pid_get_user_slice - sd_pid_get_cgroup - sd_peer_get_session - sd_peer_get_unit - sd_peer_get_user_unit - sd_peer_get_owner_uid - sd_peer_get_machine_name - sd_peer_get_slice - sd_peer_get_user_slice - sd_peer_get_cgroup - Determine session, unit, owner of a session, - container/VM or slice of a specific PID or socket - peer - - - - - #include <systemd/sd-login.h> - - - int sd_pid_get_session - pid_t pid - char **session - - - - int sd_pid_get_unit - pid_t pid - char **unit - - - - int sd_pid_get_user_unit - pid_t pid - char **unit - - - - int sd_pid_get_owner_uid - pid_t pid - uid_t *uid - - - - int sd_pid_get_machine_name - pid_t pid - char **name - - - - int sd_pid_get_slice - pid_t pid - char **slice - - - - int sd_pid_get_user_slice - pid_t pid - char **slice - - - - int sd_pid_get_cgroup - pid_t pid - char **cgroup - - - - int sd_peer_get_session - int fd - char **session - - - - int sd_peer_get_unit - int fd - char **unit - - - - int sd_peer_get_user_unit - int fd - char **unit - - - - int sd_peer_get_owner_uid - int fd - uid_t *uid - - - - int sd_peer_get_machine_name - int fd - char **name - - - - int sd_peer_get_slice - int fd - char **slice - - - - int sd_peer_get_user_slice - int fd - char **slice - - - - int sd_peer_get_cgroup - int fd - char **cgroup - - - - - - Description - - sd_pid_get_session() may be used to - determine the login session identifier of a process identified by - the specified process identifier. The session identifier is a - short string, suitable for usage in file system paths. Note that - not all processes are part of a login session (e.g. system service - processes, user processes that are shared between multiple - sessions of the same user, or kernel threads). For processes not - being part of a login session, this function will fail with - -ENODATA. The returned string needs to be freed with the libc - free3 - call after use. - - sd_pid_get_unit() may be used to - determine the systemd system unit (i.e. system service or scope - unit) identifier of a process identified by the specified PID. The - unit name is a short string, suitable for usage in file system - paths. Note that not all processes are part of a system - unit/service (e.g. user processes, or kernel threads). For - processes not being part of a systemd system unit, this function - will fail with -ENODATA. (More specifically, this call will not - work for kernel threads.) The returned string needs to be freed - with the libc free3 - call after use. - - sd_pid_get_user_unit() may be used to - determine the systemd user unit (i.e. user service or scope unit) - identifier of a process identified by the specified PID. This is - similar to sd_pid_get_unit(), but applies to - user units instead of system units. - - sd_pid_get_owner_uid() may be used to - determine the Unix UID (user identifier) of the owner of the - session of a process identified the specified PID. Note that this - function will succeed for user processes which are shared between - multiple login sessions of the same user, whereas - sd_pid_get_session() will fail. For processes - not being part of a login session and not being a shared process - of a user, this function will fail with -ENODATA. - - sd_pid_get_machine_name() may be used - to determine the name of the VM or container is a member of. The - machine name is a short string, suitable for usage in file system - paths. The returned string needs to be freed with the libc - free3 - call after use. For processes not part of a VM or containers, this - function fails with -ENODATA. - - sd_pid_get_slice() may be used to - determine the slice unit the process is a member of. See - systemd.slice5 - for details about slices. The returned string needs to be freed - with the libc - free3 - call after use. - - Similarly, sd_pid_get_user_slice() - returns the user slice (as managed by the user's systemd instance) - of a process. - - sd_pid_get_cgroup() returns the control - group path of the specified process, relative to the root of the - hierarchy. Returns the path without trailing slash, except for - processes located in the root control group, where "/" is - returned. To find the actual control group path in the file system, - the returned path needs to be prefixed with - /sys/fs/cgroup/ (if the unified control group - setup is used), or - /sys/fs/cgroup/HIERARCHY/ - (if the legacy multi-hierarchy control group setup is used). - - If the pid parameter of any of these - functions is passed as 0, the operation is executed for the - calling process. - - The sd_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name(), - sd_peer_get_slice(), - sd_peer_get_user_slice() and - sd_peer_get_cgroup() calls operate similar to - their PID counterparts, but operate on a connected AF_UNIX socket - and retrieve information about the connected peer process. Note - that these fields are retrieved via /proc, - and hence are not suitable for authorization purposes, as they are - subject to races. - - - - Return Value - - On success, these calls return 0 or a positive integer. On - failure, these calls return a negative errno-style error - code. - - - - Errors - - Returned errors may indicate the following problems: - - - - - -ESRCH - - The specified PID does not refer to a running - process. - - - - - -EBADF - - The specified socket file descriptor was - invalid. - - - - -ENODATA - - The given field is not specified for the described - process or peer. - - - - - -EINVAL - - An input parameter was invalid (out of range, - or NULL, where that is not accepted). - - - - -ENOMEM - - Memory allocation failed. - - - - - - Notes - - The sd_pid_get_session(), - sd_pid_get_unit(), - sd_pid_get_user_unit(), - sd_pid_get_owner_uid(), - sd_pid_get_machine_name(), - sd_pid_get_slice(), - sd_pid_get_user_slice(), - sd_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name(), - sd_peer_get_slice() and - sd_peer_get_user_slice() interfaces are - available as a shared library, which can be compiled and linked to - with the libelogind pkg-config1 - file. - - Note that the login session identifier as - returned by sd_pid_get_session() - is completely unrelated to the process session - identifier as returned by - getsid2. - - - - See Also - - - systemd1, - sd-login3, - sd_session_is_active3, - getsid2, - systemd.slice5, - systemd-machined.service8 - - - - -- cgit v1.2.3