From e735f4d4eafc8c8c296cefc8228cf91c3fcfe822 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 17 Feb 2015 11:22:16 +0100 Subject: [PATCH] Imported Upstream version 219 --- Makefile-man.am | 61 +- Makefile.am | 602 ++- Makefile.in | 3293 ++++++++++++----- NEWS | 334 +- README | 18 +- TODO | 192 +- catalog/systemd.catalog | 22 +- catalog/systemd.fr.catalog | 8 +- catalog/systemd.pl.catalog | 14 +- catalog/systemd.pt_BR.catalog | 264 ++ config.h.in | 43 +- configure | 657 +++- configure.ac | 154 +- docs/gudev/Makefile.in | 8 +- docs/gudev/html/index.html | 2 +- docs/gudev/version.xml | 2 +- docs/libudev/Makefile.am | 2 +- docs/libudev/Makefile.in | 10 +- docs/libudev/html/index.html | 2 +- docs/libudev/version.xml | 2 +- hwdb/20-OUI.hwdb | 818 +++- hwdb/20-bluetooth-vendor-product.hwdb | 157 +- hwdb/20-pci-vendor-model.hwdb | 498 ++- hwdb/20-usb-vendor-model.hwdb | 324 +- hwdb/60-keyboard.hwdb | 22 +- hwdb/70-mouse.hwdb | 194 +- hwdb/70-touchpad.hwdb | 39 + man/SD_ALERT.html | 85 +- man/SD_CRIT.html | 85 +- man/SD_DEBUG.html | 85 +- man/SD_EMERG.html | 85 +- man/SD_ERR.html | 85 +- man/SD_ID128_CONST_STR.html | 122 +- man/SD_ID128_FORMAT_STR.html | 122 +- man/SD_ID128_FORMAT_VAL.html | 122 +- man/SD_ID128_MAKE.html | 122 +- man/SD_INFO.html | 85 +- man/SD_JOURNAL_APPEND.html | 349 +- man/SD_JOURNAL_CURRENT_USER.html | 196 +- man/SD_JOURNAL_FOREACH.html | 138 +- man/SD_JOURNAL_FOREACH_BACKWARDS.html | 138 +- man/SD_JOURNAL_FOREACH_DATA.html | 189 +- man/SD_JOURNAL_FOREACH_UNIQUE.html | 161 +- man/SD_JOURNAL_INVALIDATE.html | 349 +- man/SD_JOURNAL_LOCAL_ONLY.html | 196 +- man/SD_JOURNAL_NOP.html | 349 +- man/SD_JOURNAL_RUNTIME_ONLY.html | 196 +- man/SD_JOURNAL_SUPPRESS_LOCATION.html | 244 +- man/SD_JOURNAL_SYSTEM.html | 196 +- man/SD_LISTEN_FDS_START.html | 130 +- man/SD_NOTICE.html | 85 +- man/SD_WARNING.html | 85 +- man/binfmt.d.5 | 2 +- man/binfmt.d.html | 35 +- man/binfmt.d.xml | 153 +- man/bootchart.conf.5 | 4 +- man/bootchart.conf.d.html | 73 +- man/bootchart.conf.html | 73 +- man/bootchart.conf.xml | 290 +- man/bootctl.1 | 2 +- man/bootctl.html | 30 +- man/bootctl.xml | 180 +- man/bootup.7 | 2 +- man/bootup.html | 195 +- man/bootup.xml | 319 +- man/busctl.1 | 26 +- man/busctl.html | 29 +- man/busctl.xml | 43 +- man/coredump.conf.5 | 2 +- man/coredump.conf.d.html | 6 +- man/coredump.conf.html | 6 +- man/coredump.conf.xml | 1 - man/coredumpctl.1 | 6 +- man/coredumpctl.html | 79 +- man/coredumpctl.xml | 435 ++- man/crypttab.5 | 15 +- man/crypttab.html | 295 +- man/crypttab.xml | 731 ++-- man/custom-html.xsl | 12 + man/daemon.7 | 18 +- man/daemon.html | 1106 +++--- man/daemon.xml | 1596 ++++---- man/file-hierarchy.7 | 8 +- man/file-hierarchy.html | 769 ++-- man/file-hierarchy.xml | 1742 ++++----- man/halt.8 | 14 +- man/halt.html | 43 +- man/halt.xml | 290 +- man/hostname.5 | 2 +- man/hostname.html | 60 +- man/hostname.xml | 157 +- man/hostnamectl.1 | 5 +- man/hostnamectl.html | 223 +- man/hostnamectl.xml | 507 ++- man/hwdb.7 | 60 + man/hwdb.html | 53 + man/hwdb.xml | 86 + man/index.html | 4 +- man/init.html | 1121 +++--- man/journalctl.1 | 51 +- man/journalctl.html | 846 ++--- man/journalctl.xml | 1763 ++++----- man/journald.conf.5 | 8 +- man/journald.conf.d.html | 514 +-- man/journald.conf.html | 514 +-- man/journald.conf.xml | 815 ++-- man/kernel-command-line.7 | 2 +- man/kernel-command-line.html | 182 +- man/kernel-command-line.xml | 716 ++-- man/kernel-install.8 | 2 +- man/kernel-install.html | 8 +- man/libnss_myhostname.so.2.8 | 1 + man/libnss_myhostname.so.2.html | 77 + man/libnss_mymachines.so.2.8 | 1 + man/libnss_mymachines.so.2.html | 55 + man/locale.conf.5 | 2 +- man/locale.conf.html | 125 +- man/locale.conf.xml | 258 +- man/localectl.1 | 13 +- man/localectl.html | 153 +- man/localectl.xml | 417 +-- man/localtime.5 | 6 +- man/localtime.html | 57 +- man/localtime.xml | 158 +- man/loginctl.1 | 70 +- man/loginctl.html | 318 +- man/loginctl.xml | 818 ++-- man/logind.conf.5 | 2 +- man/logind.conf.d.html | 340 +- man/logind.conf.html | 340 +- man/logind.conf.xml | 609 ++- man/machine-id.5 | 2 +- man/machine-id.html | 97 +- man/machine-id.xml | 231 +- man/machine-info.5 | 6 +- man/machine-info.html | 155 +- man/machine-info.xml | 338 +- man/machinectl.1 | 497 ++- man/machinectl.html | 442 ++- man/machinectl.xml | 1007 +++-- man/modules-load.d.5 | 2 +- man/modules-load.d.html | 41 +- man/modules-load.d.xml | 153 +- man/networkctl.1 | 121 + man/networkctl.html | 74 + man/networkctl.xml | 175 + man/nss-myhostname.8 | 105 +- man/nss-myhostname.html | 89 +- man/nss-myhostname.xml | 207 +- man/nss-mymachines.8 | 82 + man/nss-mymachines.html | 55 + man/nss-mymachines.xml | 112 + man/os-release.5 | 32 +- man/os-release.html | 380 +- man/os-release.xml | 656 ++-- man/pam_systemd.8 | 5 +- man/pam_systemd.html | 256 +- man/pam_systemd.xml | 568 ++- man/poweroff.html | 43 +- man/reboot.html | 43 +- man/resolved.conf.5 | 2 +- man/resolved.conf.d.html | 87 +- man/resolved.conf.html | 87 +- man/resolved.conf.xml | 228 +- man/runlevel.8 | 2 +- man/runlevel.html | 44 +- man/runlevel.xml | 253 +- man/sd-daemon.3 | 2 +- man/sd-daemon.html | 85 +- man/sd-daemon.xml | 225 +- man/sd-id128.3 | 30 +- man/sd-id128.html | 122 +- man/sd-id128.xml | 271 +- man/sd-journal.3 | 2 +- man/sd-journal.html | 98 +- man/sd-journal.xml | 202 +- man/sd-login.3 | 2 +- man/sd-login.html | 99 +- man/sd-login.xml | 223 +- man/sd_booted.3 | 2 +- man/sd_booted.html | 24 +- man/sd_booted.xml | 142 +- man/sd_bus_creds_get_audit_login_uid.html | 10 +- man/sd_bus_creds_get_audit_session_id.html | 10 +- man/sd_bus_creds_get_cgroup.html | 10 +- man/sd_bus_creds_get_cmdline.html | 10 +- man/sd_bus_creds_get_comm.html | 10 +- man/sd_bus_creds_get_connection_name.html | 10 +- man/sd_bus_creds_get_exe.html | 10 +- man/sd_bus_creds_get_gid.html | 10 +- man/sd_bus_creds_get_mask.html | 14 +- man/sd_bus_creds_get_owner_uid.html | 10 +- man/sd_bus_creds_get_pid.3 | 2 +- man/sd_bus_creds_get_pid.html | 10 +- man/sd_bus_creds_get_selinux_context.html | 10 +- man/sd_bus_creds_get_session.html | 10 +- man/sd_bus_creds_get_slice.html | 10 +- man/sd_bus_creds_get_tid.html | 10 +- man/sd_bus_creds_get_tid_comm.html | 10 +- man/sd_bus_creds_get_uid.html | 10 +- man/sd_bus_creds_get_unique_name.html | 10 +- man/sd_bus_creds_get_unit.html | 10 +- man/sd_bus_creds_get_user_unit.html | 10 +- man/sd_bus_creds_get_well_known_names.html | 10 +- man/sd_bus_creds_has_bounding_cap.html | 10 +- man/sd_bus_creds_has_effective_cap.html | 10 +- man/sd_bus_creds_has_inheritable_cap.html | 10 +- man/sd_bus_creds_has_permitted_cap.html | 10 +- man/sd_bus_creds_new_from_pid.3 | 2 +- man/sd_bus_creds_new_from_pid.html | 14 +- man/sd_bus_creds_new_from_pid.xml | 24 +- man/sd_bus_creds_ref.html | 14 +- man/sd_bus_creds_unref.html | 14 +- man/sd_bus_default_system.html | 12 +- man/sd_bus_default_user.html | 12 +- man/sd_bus_error.3 | 2 +- man/sd_bus_error.html | 14 +- man/sd_bus_error_copy.html | 14 +- man/sd_bus_error_free.html | 14 +- man/sd_bus_error_get_errno.html | 14 +- man/sd_bus_error_has_name.html | 14 +- man/sd_bus_error_is_set.html | 14 +- man/sd_bus_error_set.html | 14 +- man/sd_bus_error_set_const.html | 14 +- man/sd_bus_error_set_errno.html | 14 +- man/sd_bus_error_set_errnof.html | 14 +- man/sd_bus_message_append.3 | 2 +- man/sd_bus_message_append.html | 12 +- man/sd_bus_message_append.xml | 24 +- man/sd_bus_message_append_array.3 | 2 +- man/sd_bus_message_append_array.html | 8 +- man/sd_bus_message_append_array_iovec.html | 8 +- man/sd_bus_message_append_array_memfd.html | 8 +- man/sd_bus_message_append_array_space.html | 8 +- man/sd_bus_message_append_basic.3 | 2 +- man/sd_bus_message_append_basic.html | 8 +- man/sd_bus_message_append_basic.xml | 24 +- man/sd_bus_message_append_string_iovec.html | 8 +- man/sd_bus_message_append_string_memfd.3 | 2 +- man/sd_bus_message_append_string_memfd.html | 8 +- man/sd_bus_message_append_string_space.html | 8 +- man/sd_bus_message_append_strv.3 | 2 +- man/sd_bus_message_append_strv.html | 8 +- man/sd_bus_message_append_strv.xml | 24 +- man/sd_bus_message_get_cookie.3 | 2 +- man/sd_bus_message_get_cookie.html | 62 +- man/sd_bus_message_get_cookie.xml | 246 +- man/sd_bus_message_get_monotonic_usec.3 | 6 +- man/sd_bus_message_get_monotonic_usec.html | 109 +- man/sd_bus_message_get_monotonic_usec.xml | 319 +- man/sd_bus_message_get_realtime_usec.html | 109 +- man/sd_bus_message_get_reply_cookie.html | 62 +- man/sd_bus_message_get_seqnum.html | 109 +- man/sd_bus_negotiate_creds.html | 10 +- man/sd_bus_negotiate_fds.3 | 4 +- man/sd_bus_negotiate_fds.html | 10 +- man/sd_bus_negotiate_fds.xml | 2 +- man/sd_bus_negotiate_timestamps.html | 10 +- man/sd_bus_new.3 | 2 +- man/sd_bus_new.html | 8 +- man/sd_bus_new.xml | 24 +- man/sd_bus_open_system.html | 12 +- man/sd_bus_open_system_container.html | 12 +- man/sd_bus_open_system_remote.html | 12 +- man/sd_bus_open_user.3 | 2 +- man/sd_bus_open_user.html | 12 +- man/sd_bus_path_decode.html | 8 +- man/sd_bus_path_encode.3 | 4 +- man/sd_bus_path_encode.html | 8 +- man/sd_bus_path_encode.xml | 26 +- man/sd_bus_ref.html | 8 +- man/sd_bus_release_name.html | 104 +- man/sd_bus_request_name.3 | 2 +- man/sd_bus_request_name.html | 104 +- man/sd_bus_request_name.xml | 386 +- man/sd_bus_unref.html | 8 +- man/sd_event_add_child.3 | 8 +- man/sd_event_add_child.html | 16 +- man/sd_event_add_child.xml | 6 +- man/sd_event_add_defer.3 | 2 +- man/sd_event_add_defer.html | 8 +- man/sd_event_add_defer.xml | 24 +- man/sd_event_add_exit.html | 8 +- man/sd_event_add_post.html | 8 +- man/sd_event_add_signal.3 | 4 +- man/sd_event_add_signal.html | 12 +- man/sd_event_add_signal.xml | 2 +- man/sd_event_add_time.3 | 2 +- man/sd_event_add_time.html | 8 +- man/sd_event_add_time.xml | 24 +- man/sd_event_default.html | 8 +- man/sd_event_get_fd.3 | 2 +- man/sd_event_get_fd.html | 12 +- man/sd_event_get_name.html | 10 +- man/sd_event_new.3 | 2 +- man/sd_event_new.html | 8 +- man/sd_event_new.xml | 24 +- man/sd_event_ref.html | 8 +- man/sd_event_set_name.3 | 2 +- man/sd_event_set_name.html | 10 +- man/sd_event_source_get_child_pid.html | 16 +- man/sd_event_source_get_signal.html | 12 +- man/sd_event_source_get_time.html | 8 +- man/sd_event_source_get_time_accuracy.html | 8 +- man/sd_event_source_get_time_clock.html | 8 +- man/sd_event_source_set_time.html | 8 +- man/sd_event_source_set_time_accuracy.html | 8 +- man/sd_event_unref.html | 8 +- man/sd_get_machine_names.html | 60 +- man/sd_get_seats.3 | 2 +- man/sd_get_seats.html | 60 +- man/sd_get_seats.xml | 230 +- man/sd_get_sessions.html | 60 +- man/sd_get_uids.html | 60 +- man/sd_id128_equal.html | 122 +- man/sd_id128_from_string.html | 74 +- man/sd_id128_get_boot.html | 72 +- man/sd_id128_get_machine.3 | 2 +- man/sd_id128_get_machine.html | 72 +- man/sd_id128_get_machine.xml | 214 +- man/sd_id128_randomize.3 | 2 +- man/sd_id128_randomize.html | 48 +- man/sd_id128_randomize.xml | 178 +- man/sd_id128_t.html | 122 +- man/sd_id128_to_string.3 | 2 +- man/sd_id128_to_string.html | 74 +- man/sd_id128_to_string.xml | 216 +- man/sd_is_fifo.3 | 2 +- man/sd_is_fifo.html | 126 +- man/sd_is_fifo.xml | 358 +- man/sd_is_mq.html | 126 +- man/sd_is_socket.html | 126 +- man/sd_is_socket_inet.html | 126 +- man/sd_is_socket_unix.html | 126 +- man/sd_is_special.html | 126 +- man/sd_journal.html | 196 +- man/sd_journal_add_conjunction.html | 184 +- man/sd_journal_add_disjunction.html | 184 +- man/sd_journal_add_match.3 | 16 +- man/sd_journal_add_match.html | 184 +- man/sd_journal_add_match.xml | 366 +- man/sd_journal_close.html | 196 +- man/sd_journal_enumerate_data.html | 189 +- man/sd_journal_enumerate_unique.html | 161 +- man/sd_journal_flush_matches.html | 184 +- man/sd_journal_get_catalog.3 | 2 +- man/sd_journal_get_catalog.html | 76 +- man/sd_journal_get_catalog.xml | 226 +- ...sd_journal_get_catalog_for_message_id.html | 76 +- man/sd_journal_get_cursor.3 | 2 +- man/sd_journal_get_cursor.html | 100 +- man/sd_journal_get_cursor.xml | 242 +- man/sd_journal_get_cutoff_monotonic_usec.html | 99 +- man/sd_journal_get_cutoff_realtime_usec.3 | 2 +- man/sd_journal_get_cutoff_realtime_usec.html | 99 +- man/sd_journal_get_cutoff_realtime_usec.xml | 247 +- man/sd_journal_get_data.3 | 10 +- man/sd_journal_get_data.html | 189 +- man/sd_journal_get_data.xml | 425 +-- man/sd_journal_get_data_threshold.html | 189 +- man/sd_journal_get_events.html | 349 +- man/sd_journal_get_fd.3 | 114 +- man/sd_journal_get_fd.html | 349 +- man/sd_journal_get_fd.xml | 595 ++- man/sd_journal_get_monotonic_usec.html | 91 +- man/sd_journal_get_realtime_usec.3 | 6 +- man/sd_journal_get_realtime_usec.html | 91 +- man/sd_journal_get_realtime_usec.xml | 235 +- man/sd_journal_get_timeout.html | 349 +- man/sd_journal_get_usage.3 | 2 +- man/sd_journal_get_usage.html | 31 +- man/sd_journal_get_usage.xml | 151 +- man/sd_journal_next.3 | 40 +- man/sd_journal_next.html | 138 +- man/sd_journal_next.xml | 352 +- man/sd_journal_next_skip.html | 138 +- man/sd_journal_open.3 | 2 +- man/sd_journal_open.html | 196 +- man/sd_journal_open.xml | 440 ++- man/sd_journal_open_container.html | 196 +- man/sd_journal_open_directory.html | 196 +- man/sd_journal_open_files.html | 196 +- man/sd_journal_perror.html | 244 +- man/sd_journal_previous.html | 138 +- man/sd_journal_previous_skip.html | 138 +- man/sd_journal_print.3 | 6 +- man/sd_journal_print.html | 244 +- man/sd_journal_print.xml | 474 ++- man/sd_journal_printv.html | 244 +- man/sd_journal_process.html | 349 +- man/sd_journal_query_unique.3 | 38 +- man/sd_journal_query_unique.html | 161 +- man/sd_journal_query_unique.xml | 353 +- man/sd_journal_reliable_fd.html | 349 +- man/sd_journal_restart_data.html | 189 +- man/sd_journal_restart_unique.html | 161 +- man/sd_journal_seek_cursor.html | 107 +- man/sd_journal_seek_head.3 | 2 +- man/sd_journal_seek_head.html | 107 +- man/sd_journal_seek_head.xml | 299 +- man/sd_journal_seek_monotonic_usec.html | 107 +- man/sd_journal_seek_realtime_usec.html | 107 +- man/sd_journal_seek_tail.html | 107 +- man/sd_journal_send.html | 244 +- man/sd_journal_sendv.html | 244 +- man/sd_journal_set_data_threshold.html | 189 +- man/sd_journal_stream_fd.3 | 36 +- man/sd_journal_stream_fd.html | 118 +- man/sd_journal_stream_fd.xml | 263 +- man/sd_journal_test_cursor.html | 100 +- man/sd_journal_wait.html | 349 +- man/sd_listen_fds.3 | 15 +- man/sd_listen_fds.html | 130 +- man/sd_listen_fds.xml | 300 +- man/sd_login_monitor.html | 202 +- man/sd_login_monitor_flush.html | 202 +- man/sd_login_monitor_get_events.html | 202 +- man/sd_login_monitor_get_fd.html | 202 +- man/sd_login_monitor_get_timeout.html | 202 +- man/sd_login_monitor_new.3 | 14 +- man/sd_login_monitor_new.html | 202 +- man/sd_login_monitor_new.xml | 414 +-- man/sd_login_monitor_unref.html | 202 +- man/sd_machine_get_class.3 | 2 +- man/sd_machine_get_class.html | 57 +- man/sd_machine_get_class.xml | 197 +- man/sd_machine_get_ifindices.html | 57 +- man/sd_notify.3 | 81 +- man/sd_notify.html | 261 +- man/sd_notify.xml | 644 ++-- man/sd_notifyf.html | 261 +- man/sd_peer_get_machine_name.html | 177 +- man/sd_peer_get_owner_uid.html | 177 +- man/sd_peer_get_session.html | 177 +- man/sd_peer_get_slice.html | 177 +- man/sd_peer_get_unit.html | 177 +- man/sd_peer_get_user_unit.html | 177 +- man/sd_pid_get_machine_name.html | 177 +- man/sd_pid_get_owner_uid.html | 177 +- man/sd_pid_get_session.3 | 2 +- man/sd_pid_get_session.html | 177 +- man/sd_pid_get_session.xml | 481 ++- man/sd_pid_get_slice.html | 177 +- man/sd_pid_get_unit.html | 177 +- man/sd_pid_get_user_unit.html | 177 +- man/sd_pid_notify.3 | 1 + man/sd_pid_notify.html | 159 + man/sd_pid_notify_with_fds.3 | 1 + man/sd_pid_notify_with_fds.html | 159 + man/sd_pid_notifyf.3 | 1 + man/sd_pid_notifyf.html | 159 + man/sd_seat_can_graphical.html | 112 +- man/sd_seat_can_multi_session.html | 112 +- man/sd_seat_can_tty.html | 112 +- man/sd_seat_get_active.3 | 2 +- man/sd_seat_get_active.html | 112 +- man/sd_seat_get_active.xml | 306 +- man/sd_seat_get_sessions.html | 112 +- man/sd_session_get_class.html | 257 +- man/sd_session_get_desktop.html | 257 +- man/sd_session_get_display.html | 257 +- man/sd_session_get_remote_host.html | 257 +- man/sd_session_get_remote_user.html | 257 +- man/sd_session_get_seat.html | 257 +- man/sd_session_get_service.html | 257 +- man/sd_session_get_state.html | 257 +- man/sd_session_get_tty.html | 257 +- man/sd_session_get_type.html | 257 +- man/sd_session_get_uid.html | 257 +- man/sd_session_get_vt.html | 257 +- man/sd_session_is_active.3 | 2 +- man/sd_session_is_active.html | 257 +- man/sd_session_is_active.xml | 611 ++- man/sd_session_is_remote.html | 257 +- man/sd_uid_get_display.html | 157 +- man/sd_uid_get_seats.html | 157 +- man/sd_uid_get_sessions.html | 157 +- man/sd_uid_get_state.3 | 14 +- man/sd_uid_get_state.html | 157 +- man/sd_uid_get_state.xml | 367 +- man/sd_uid_is_on_seat.html | 157 +- man/sd_watchdog_enabled.3 | 4 +- man/sd_watchdog_enabled.html | 124 +- man/sd_watchdog_enabled.xml | 314 +- man/shutdown.8 | 6 +- man/shutdown.html | 73 +- man/shutdown.xml | 306 +- man/sleep.conf.d.html | 8 +- man/standard-options.xml | 9 + man/sysctl.d.5 | 2 +- man/sysctl.d.html | 119 +- man/sysctl.d.xml | 275 +- man/system.conf.d.html | 399 +- man/systemctl.1 | 160 +- man/systemctl.html | 125 +- man/systemctl.xml | 275 +- man/systemd-activate.8 | 2 +- man/systemd-activate.html | 8 +- man/systemd-activate.xml | 24 +- man/systemd-analyze.1 | 24 +- man/systemd-analyze.html | 247 +- man/systemd-analyze.xml | 655 ++-- man/systemd-ask-password-console.path.html | 43 +- man/systemd-ask-password-console.service.8 | 2 +- man/systemd-ask-password-console.service.html | 43 +- man/systemd-ask-password-console.service.xml | 121 +- man/systemd-ask-password-wall.path.html | 43 +- man/systemd-ask-password-wall.service.html | 43 +- man/systemd-ask-password.1 | 2 +- man/systemd-ask-password.html | 104 +- man/systemd-ask-password.xml | 314 +- man/systemd-backlight.html | 30 +- man/systemd-backlight@.service.8 | 6 +- man/systemd-backlight@.service.html | 30 +- man/systemd-backlight@.service.xml | 136 +- man/systemd-binfmt.html | 19 +- man/systemd-binfmt.service.8 | 2 +- man/systemd-binfmt.service.html | 19 +- man/systemd-binfmt.service.xml | 85 +- man/systemd-bootchart.1 | 6 +- man/systemd-bootchart.html | 221 +- man/systemd-bootchart.xml | 602 ++- man/systemd-bus-proxyd.8 | 2 +- man/systemd-bus-proxyd.html | 6 +- man/systemd-bus-proxyd.socket.html | 4 +- man/systemd-bus-proxyd@.service.8 | 2 +- man/systemd-bus-proxyd@.service.html | 4 +- man/systemd-bus-proxyd@.service.xml | 24 +- man/systemd-cat.1 | 2 +- man/systemd-cat.html | 104 +- man/systemd-cat.xml | 322 +- man/systemd-cgls.1 | 2 +- man/systemd-cgls.html | 52 +- man/systemd-cgls.xml | 234 +- man/systemd-cgtop.1 | 2 +- man/systemd-cgtop.html | 127 +- man/systemd-cgtop.xml | 473 ++- man/systemd-coredump.8 | 2 +- man/systemd-coredump.html | 4 +- man/systemd-cryptsetup-generator.8 | 17 +- man/systemd-cryptsetup-generator.html | 160 +- man/systemd-cryptsetup-generator.xml | 364 +- man/systemd-cryptsetup.html | 34 +- man/systemd-cryptsetup@.service.8 | 2 +- man/systemd-cryptsetup@.service.html | 34 +- man/systemd-cryptsetup@.service.xml | 104 +- man/systemd-debug-generator.8 | 2 +- man/systemd-debug-generator.html | 53 +- man/systemd-debug-generator.xml | 145 +- man/systemd-delta.1 | 6 +- man/systemd-delta.html | 109 +- man/systemd-delta.xml | 365 +- man/systemd-detect-virt.1 | 2 +- man/systemd-detect-virt.html | 62 +- man/systemd-detect-virt.xml | 404 +- man/systemd-efi-boot-generator.8 | 2 +- man/systemd-efi-boot-generator.html | 46 +- man/systemd-efi-boot-generator.xml | 110 +- man/systemd-escape.1 | 6 +- man/systemd-escape.html | 93 +- man/systemd-escape.xml | 307 +- man/systemd-firstboot.1 | 7 +- man/systemd-firstboot.html | 161 +- man/systemd-firstboot.service.html | 161 +- man/systemd-firstboot.xml | 497 ++- man/systemd-fsck-root.service.html | 114 +- man/systemd-fsck.html | 114 +- man/systemd-fsck@.service.8 | 2 +- man/systemd-fsck@.service.html | 114 +- man/systemd-fsck@.service.xml | 248 +- man/systemd-fstab-generator.8 | 2 +- man/systemd-fstab-generator.html | 129 +- man/systemd-fstab-generator.xml | 333 +- man/systemd-getty-generator.8 | 5 +- man/systemd-getty-generator.html | 60 +- man/systemd-getty-generator.xml | 130 +- man/systemd-gpt-auto-generator.8 | 2 +- man/systemd-gpt-auto-generator.html | 106 +- man/systemd-gpt-auto-generator.xml | 316 +- man/systemd-halt.service.8 | 2 +- man/systemd-halt.service.html | 83 +- man/systemd-halt.service.xml | 191 +- man/systemd-hibernate-resume-generator.8 | 2 +- man/systemd-hibernate-resume-generator.html | 30 +- man/systemd-hibernate-resume-generator.xml | 136 +- man/systemd-hibernate-resume.html | 27 +- man/systemd-hibernate-resume@.service.8 | 2 +- man/systemd-hibernate-resume@.service.html | 27 +- man/systemd-hibernate-resume@.service.xml | 95 +- man/systemd-hibernate.service.html | 104 +- man/systemd-hostnamed.html | 30 +- man/systemd-hostnamed.service.8 | 2 +- man/systemd-hostnamed.service.html | 30 +- man/systemd-hostnamed.service.xml | 120 +- man/systemd-hwdb.8 | 57 + man/systemd-hwdb.html | 35 + man/systemd-hwdb.xml | 93 + man/systemd-hybrid-sleep.service.html | 104 +- man/systemd-inhibit.1 | 2 +- man/systemd-inhibit.html | 111 +- man/systemd-inhibit.xml | 321 +- man/systemd-initctl.html | 16 +- man/systemd-initctl.service.8 | 2 +- man/systemd-initctl.service.html | 16 +- man/systemd-initctl.service.xml | 86 +- man/systemd-initctl.socket.html | 16 +- man/systemd-journal-gatewayd.html | 16 +- man/systemd-journal-gatewayd.service.8 | 2 +- man/systemd-journal-gatewayd.service.html | 16 +- man/systemd-journal-gatewayd.socket.html | 16 +- man/systemd-journal-remote.8 | 2 +- man/systemd-journal-remote.html | 12 +- man/systemd-journal-remote.xml | 24 +- man/systemd-journal-upload.8 | 2 +- man/systemd-journal-upload.html | 10 +- man/systemd-journald-dev-log.socket.html | 192 +- man/systemd-journald.html | 192 +- man/systemd-journald.service.8 | 2 +- man/systemd-journald.service.html | 192 +- man/systemd-journald.service.xml | 473 ++- man/systemd-journald.socket.html | 192 +- man/systemd-kexec.service.html | 83 +- man/systemd-localed.html | 34 +- man/systemd-localed.service.8 | 2 +- man/systemd-localed.service.html | 34 +- man/systemd-localed.service.xml | 124 +- man/systemd-logind.html | 58 +- man/systemd-logind.service.8 | 2 +- man/systemd-logind.service.html | 58 +- man/systemd-logind.service.xml | 200 +- man/systemd-machine-id-commit.1 | 2 +- man/systemd-machine-id-commit.html | 64 +- man/systemd-machine-id-commit.service.8 | 4 +- man/systemd-machine-id-commit.service.html | 63 +- man/systemd-machine-id-commit.service.xml | 151 +- man/systemd-machine-id-commit.xml | 198 +- man/systemd-machine-id-setup.1 | 2 +- man/systemd-machine-id-setup.html | 66 +- man/systemd-machine-id-setup.xml | 216 +- man/systemd-machined.html | 32 +- man/systemd-machined.service.8 | 14 +- man/systemd-machined.service.html | 32 +- man/systemd-machined.service.xml | 123 +- man/systemd-modules-load.html | 28 +- man/systemd-modules-load.service.8 | 2 +- man/systemd-modules-load.service.html | 28 +- man/systemd-modules-load.service.xml | 146 +- man/systemd-networkd-wait-online.html | 35 +- man/systemd-networkd-wait-online.service.8 | 12 +- man/systemd-networkd-wait-online.service.html | 35 +- man/systemd-networkd-wait-online.service.xml | 153 +- man/systemd-networkd.html | 53 +- man/systemd-networkd.service.8 | 2 +- man/systemd-networkd.service.html | 53 +- man/systemd-networkd.service.xml | 153 +- man/systemd-notify.1 | 10 +- man/systemd-notify.html | 108 +- man/systemd-notify.xml | 310 +- man/systemd-nspawn.1 | 192 +- man/systemd-nspawn.html | 804 ++-- man/systemd-nspawn.xml | 1448 ++++---- man/systemd-path.1 | 2 +- man/systemd-path.html | 34 +- man/systemd-path.xml | 168 +- man/systemd-poweroff.service.html | 83 +- man/systemd-quotacheck.html | 40 +- man/systemd-quotacheck.service.8 | 2 +- man/systemd-quotacheck.service.html | 40 +- man/systemd-quotacheck.service.xml | 146 +- man/systemd-random-seed.html | 22 +- man/systemd-random-seed.service.8 | 2 +- man/systemd-random-seed.service.html | 22 +- man/systemd-random-seed.service.xml | 86 +- man/systemd-reboot.service.html | 83 +- man/systemd-remount-fs.html | 48 +- man/systemd-remount-fs.service.8 | 2 +- man/systemd-remount-fs.service.html | 48 +- man/systemd-remount-fs.service.xml | 115 +- man/systemd-resolved.html | 41 +- man/systemd-resolved.service.8 | 2 +- man/systemd-resolved.service.html | 41 +- man/systemd-resolved.service.xml | 129 +- man/systemd-rfkill.html | 24 +- man/systemd-rfkill@.service.8 | 2 +- man/systemd-rfkill@.service.html | 24 +- man/systemd-rfkill@.service.xml | 130 +- man/systemd-run.1 | 62 +- man/systemd-run.html | 47 +- man/systemd-run.xml | 60 +- man/systemd-shutdown.html | 83 +- man/systemd-shutdownd.html | 18 +- man/systemd-shutdownd.service.8 | 2 +- man/systemd-shutdownd.service.html | 18 +- man/systemd-shutdownd.service.xml | 88 +- man/systemd-shutdownd.socket.html | 18 +- man/systemd-sleep.conf.5 | 2 +- man/systemd-sleep.conf.html | 8 +- man/systemd-sleep.conf.xml | 1 - man/systemd-sleep.html | 104 +- man/systemd-socket-proxyd.8 | 2 +- man/systemd-socket-proxyd.html | 86 +- man/systemd-socket-proxyd.xml | 262 +- man/systemd-suspend.service.8 | 2 +- man/systemd-suspend.service.html | 104 +- man/systemd-suspend.service.xml | 250 +- man/systemd-sysctl.html | 21 +- man/systemd-sysctl.service.8 | 2 +- man/systemd-sysctl.service.html | 21 +- man/systemd-sysctl.service.xml | 87 +- man/systemd-system-update-generator.8 | 2 +- man/systemd-system-update-generator.html | 26 +- man/systemd-system-update-generator.xml | 91 +- man/systemd-system.conf.5 | 2 +- man/systemd-system.conf.html | 399 +- man/systemd-system.conf.xml | 748 ++-- man/systemd-sysusers.8 | 2 +- man/systemd-sysusers.html | 44 +- man/systemd-sysusers.service.html | 44 +- man/systemd-sysusers.xml | 186 +- man/systemd-sysv-generator.8 | 2 +- man/systemd-sysv-generator.html | 4 +- man/systemd-timedated.html | 31 +- man/systemd-timedated.service.8 | 2 +- man/systemd-timedated.service.html | 31 +- man/systemd-timedated.service.xml | 121 +- man/systemd-timesyncd.html | 46 +- man/systemd-timesyncd.service.8 | 8 +- man/systemd-timesyncd.service.html | 46 +- man/systemd-timesyncd.service.xml | 144 +- man/systemd-tmpfiles-clean.service.html | 125 +- man/systemd-tmpfiles-clean.timer.html | 125 +- man/systemd-tmpfiles-setup-dev.service.html | 125 +- man/systemd-tmpfiles-setup.service.html | 125 +- man/systemd-tmpfiles.8 | 28 +- man/systemd-tmpfiles.html | 125 +- man/systemd-tmpfiles.xml | 345 +- man/systemd-tty-ask-password-agent.1 | 2 +- man/systemd-tty-ask-password-agent.html | 56 +- man/systemd-tty-ask-password-agent.xml | 253 +- man/systemd-udevd-control.socket.html | 8 +- man/systemd-udevd-kernel.socket.html | 8 +- man/systemd-udevd.html | 8 +- man/systemd-udevd.service.8 | 2 +- man/systemd-udevd.service.html | 8 +- man/systemd-udevd.service.xml | 1 - man/systemd-update-done.html | 60 +- man/systemd-update-done.service.8 | 2 +- man/systemd-update-done.service.html | 60 +- man/systemd-update-done.service.xml | 148 +- man/systemd-update-utmp-runlevel.service.html | 20 +- man/systemd-update-utmp.html | 20 +- man/systemd-update-utmp.service.8 | 2 +- man/systemd-update-utmp.service.html | 20 +- man/systemd-update-utmp.service.xml | 88 +- man/systemd-user-sessions.html | 25 +- man/systemd-user-sessions.service.8 | 2 +- man/systemd-user-sessions.service.html | 25 +- man/systemd-user-sessions.service.xml | 89 +- man/systemd-user.conf.html | 399 +- man/systemd-vconsole-setup.html | 44 +- man/systemd-vconsole-setup.service.8 | 2 +- man/systemd-vconsole-setup.service.html | 44 +- man/systemd-vconsole-setup.service.xml | 182 +- man/systemd.1 | 4 +- man/systemd.automount.5 | 2 +- man/systemd.automount.html | 117 +- man/systemd.automount.xml | 272 +- man/systemd.device.5 | 2 +- man/systemd.device.html | 146 +- man/systemd.device.xml | 316 +- man/systemd.directives.7 | 396 +- man/systemd.directives.html | 26 +- man/systemd.directives.xml | 220 +- man/systemd.exec.5 | 6 +- man/systemd.exec.html | 1806 ++++----- man/systemd.exec.xml | 2900 +++++++-------- man/systemd.generator.7 | 344 ++ man/systemd.generator.html | 184 + man/systemd.generator.xml | 346 ++ man/systemd.html | 1121 +++--- man/systemd.index.7 | 34 +- man/systemd.index.html | 4 +- man/systemd.index.xml | 4 +- man/systemd.journal-fields.7 | 2 +- man/systemd.journal-fields.html | 409 +- man/systemd.journal-fields.xml | 1065 +++--- man/systemd.kill.5 | 2 +- man/systemd.kill.html | 196 +- man/systemd.kill.xml | 349 +- man/systemd.link.5 | 26 +- man/systemd.link.html | 232 +- man/systemd.link.xml | 717 ++-- man/systemd.mount.5 | 2 +- man/systemd.mount.html | 346 +- man/systemd.mount.xml | 647 ++-- man/systemd.netdev.5 | 210 +- man/systemd.netdev.html | 325 +- man/systemd.netdev.xml | 1215 +++--- man/systemd.network.5 | 86 +- man/systemd.network.html | 330 +- man/systemd.network.xml | 1218 +++--- man/systemd.path.5 | 2 +- man/systemd.path.html | 201 +- man/systemd.path.xml | 380 +- man/systemd.preset.5 | 2 +- man/systemd.preset.html | 148 +- man/systemd.preset.xml | 322 +- man/systemd.resource-control.5 | 14 +- man/systemd.resource-control.html | 20 +- man/systemd.resource-control.xml | 37 +- man/systemd.scope.5 | 2 +- man/systemd.scope.html | 4 +- man/systemd.scope.xml | 1 - man/systemd.service.5 | 361 +- man/systemd.service.html | 1617 ++++---- man/systemd.service.xml | 2548 ++++++------- man/systemd.slice.5 | 2 +- man/systemd.slice.html | 4 +- man/systemd.slice.xml | 25 +- man/systemd.snapshot.5 | 2 +- man/systemd.snapshot.html | 40 +- man/systemd.snapshot.xml | 105 +- man/systemd.socket.5 | 2 +- man/systemd.socket.html | 1021 +++-- man/systemd.socket.xml | 1640 ++++---- man/systemd.special.7 | 2 +- man/systemd.special.html | 1018 ++--- man/systemd.special.xml | 1988 +++++----- man/systemd.swap.5 | 8 +- man/systemd.swap.html | 232 +- man/systemd.swap.xml | 450 ++- man/systemd.target.5 | 2 +- man/systemd.target.html | 72 +- man/systemd.target.xml | 161 +- man/systemd.time.7 | 66 +- man/systemd.time.html | 269 +- man/systemd.time.xml | 525 ++- man/systemd.timer.5 | 2 +- man/systemd.timer.html | 299 +- man/systemd.timer.xml | 514 ++- man/systemd.unit.5 | 169 +- man/systemd.unit.html | 1747 ++++----- man/systemd.unit.xml | 2950 +++++++-------- man/systemd.xml | 2327 ++++++------ man/sysusers.d.5 | 2 +- man/sysusers.d.html | 187 +- man/sysusers.d.xml | 427 +-- man/telinit.8 | 2 +- man/telinit.html | 80 +- man/telinit.xml | 324 +- man/timedatectl.1 | 20 +- man/timedatectl.html | 147 +- man/timedatectl.xml | 399 +- man/timesyncd.conf.5 | 2 +- man/timesyncd.conf.d.html | 52 +- man/timesyncd.conf.html | 52 +- man/timesyncd.conf.xml | 181 +- man/tmpfiles.d.5 | 82 +- man/tmpfiles.d.html | 502 ++- man/tmpfiles.d.xml | 1069 +++--- man/udev.7 | 35 +- man/udev.conf.5 | 2 +- man/udev.conf.html | 4 +- man/udev.conf.xml | 1 - man/udev.html | 35 +- man/udev.xml | 40 +- man/udevadm.8 | 39 +- man/udevadm.html | 30 +- man/udevadm.xml | 54 - man/user.conf.d.html | 399 +- man/vconsole.conf.5 | 4 +- man/vconsole.conf.html | 71 +- man/vconsole.conf.xml | 236 +- network/80-container-host0.network | 4 +- network/80-container-ve.network | 4 +- po/LINGUAS | 3 + po/POTFILES.in | 4 +- po/de.po | 128 +- po/el.po | 20 +- po/fr.po | 210 +- po/hu.po | 413 +++ po/it.po | 207 +- po/pl.po | 192 +- po/pt_BR.po | 421 +++ po/ru.po | 58 +- po/sv.po | 403 ++ po/uk.po | 20 +- rules/60-cdrom_id.rules | 5 + rules/60-persistent-storage.rules | 2 +- rules/70-mouse.rules | 3 + rules/70-touchpad.rules | 12 + shell-completion/bash/busctl | 109 +- shell-completion/bash/coredumpctl | 2 +- shell-completion/bash/hostnamectl | 2 +- shell-completion/bash/journalctl | 10 +- shell-completion/bash/localectl | 2 +- shell-completion/bash/loginctl | 7 +- shell-completion/bash/systemd-analyze | 2 +- shell-completion/bash/systemd-cgtop | 3 +- shell-completion/bash/systemd-nspawn | 40 +- shell-completion/bash/timedatectl | 2 +- shell-completion/zsh/_coredumpctl | 3 + shell-completion/zsh/_sd_outputmodes | 2 +- shell-completion/zsh/_systemctl.in | 2 +- shell-completion/zsh/_systemd-analyze | 14 +- shell-completion/zsh/_systemd-run | 13 + shell-completion/zsh/_systemd-tmpfiles | 5 +- shell-completion/zsh/_timedatectl | 1 + src/analyze/analyze-verify.h | 2 + src/analyze/analyze.c | 73 +- src/ask-password/ask-password.c | 2 +- src/backlight/backlight.c | 5 +- src/boot/boot-loader.h | 2 + src/bootchart/bootchart.c | 42 +- src/bootchart/bootchart.conf | 1 + src/bootchart/bootchart.h | 1 + src/bootchart/svg.c | 65 +- src/bus-proxyd/bus-proxyd.c | 1759 +-------- .../{bus-policy.c => bus-xml-policy.c} | 379 +- .../{bus-policy.h => bus-xml-policy.h} | 55 +- src/bus-proxyd/driver.c | 608 +++ .../bus-common.c => bus-proxyd/driver.h} | 20 +- src/bus-proxyd/proxy.c | 856 +++++ src/bus-proxyd/proxy.h | 52 + src/bus-proxyd/stdio-bridge.c | 263 ++ src/bus-proxyd/synthesize.c | 228 ++ src/bus-proxyd/synthesize.h | 34 + ...est-bus-policy.c => test-bus-xml-policy.c} | 68 +- src/cgls/cgls.c | 2 +- src/compat-libs/linkwarning.h | 2 + src/console/consoled.h | 2 - src/core/automount.c | 30 +- src/core/bus-endpoint.c | 56 +- src/core/bus-endpoint.h | 4 +- src/core/bus-policy.c | 174 + src/core/bus-policy.h | 66 + src/core/busname.c | 36 +- src/core/busname.h | 17 - src/core/cgroup.c | 47 +- src/core/cgroup.h | 3 + src/core/dbus-cgroup.c | 2 +- src/core/dbus-execute.c | 89 +- src/core/dbus-manager.c | 2 +- src/core/dbus-service.c | 7 +- src/core/dbus-unit.c | 50 + src/core/device.c | 16 +- src/core/execute.c | 535 +-- src/core/execute.h | 4 +- src/core/ima-setup.c | 2 +- src/core/job.c | 86 +- src/core/job.h | 3 +- src/core/load-dropin.c | 138 +- src/core/load-dropin.h | 9 +- src/core/load-fragment-gperf.gperf.m4 | 3 +- src/core/load-fragment.c | 301 +- src/core/load-fragment.h | 1 + src/core/loopback-setup.c | 63 +- src/core/machine-id-setup.c | 10 +- src/core/main.c | 76 +- src/core/manager.c | 186 +- src/core/manager.h | 13 +- src/core/mount-setup.c | 48 +- src/core/mount.c | 152 +- src/core/mount.h | 2 + src/core/namespace.c | 27 +- src/core/namespace.h | 2 +- src/core/path.c | 8 +- src/core/path.h | 1 + src/core/scope.c | 4 +- src/core/selinux-access.c | 20 +- src/core/service.c | 332 +- src/core/service.h | 14 + src/core/shutdown.c | 6 +- src/core/slice.c | 4 +- src/core/snapshot.c | 4 +- src/core/socket.c | 13 +- src/core/swap.c | 139 +- src/core/target.c | 4 +- src/core/timer.c | 4 +- src/core/umount.c | 10 +- src/core/unit-printf.c | 2 +- src/core/unit.c | 96 +- src/core/unit.h | 14 +- src/cryptsetup/cryptsetup-generator.c | 40 +- src/cryptsetup/cryptsetup.c | 52 +- src/dbus1-generator/dbus1-generator.c | 17 +- src/delta/delta.c | 2 +- src/efi-boot-generator/efi-boot-generator.c | 6 +- src/firstboot/firstboot.c | 16 +- src/fsck/fsck.c | 5 +- src/fstab-generator/fstab-generator.c | 74 +- src/getty-generator/getty-generator.c | 8 +- src/gpt-auto-generator/gpt-auto-generator.c | 57 +- src/hostname/hostnamectl.c | 2 +- src/hostname/hostnamed.c | 6 +- src/hwdb/hwdb.c | 740 ++++ src/import/aufs-util.c | 73 + src/import/aufs-util.h | 24 + src/import/curl-util.c | 449 +++ src/import/curl-util.h | 57 + src/import/import-common.c | 530 +++ src/import/import-common.h | 41 + src/import/import-dkr.c | 891 +++++ src/import/import-dkr.h | 36 + src/import/import-job.c | 733 ++++ src/import/import-job.h | 119 + src/import/import-pubring.gpg | Bin 0 -> 9551 bytes src/import/import-raw.c | 513 +++ src/import/import-raw.h | 37 + src/import/import-tar.c | 410 ++ src/import/import-tar.h | 37 + src/import/importd.c | 1104 ++++++ src/import/org.freedesktop.import1.conf | 66 + src/import/org.freedesktop.import1.policy.in | 29 + src/import/org.freedesktop.import1.service | 12 + src/import/pull.c | 440 +++ src/import/qcow2-util.c | 353 ++ src/import/qcow2-util.h | 25 + src/import/test-qcow2.c | 55 + src/initctl/initctl.c | 2 +- src/journal-remote/journal-gatewayd.c | 49 +- src/journal-remote/journal-remote-parse.c | 10 +- src/journal-remote/journal-remote.c | 12 +- src/journal-remote/journal-upload-journal.c | 2 +- src/journal-remote/journal-upload.c | 25 +- src/journal-remote/microhttpd-util.c | 2 +- src/journal/catalog.c | 1 - src/journal/compress.c | 8 +- src/journal/coredump.c | 69 +- src/journal/coredumpctl.c | 27 +- src/journal/journal-authenticate.c | 4 +- src/journal/journal-authenticate.h | 2 +- src/journal/journal-def.h | 6 +- src/journal/journal-file.c | 385 +- src/journal/journal-file.h | 56 +- src/journal/journal-internal.h | 15 +- src/journal/journal-send.c | 18 +- src/journal/journal-vacuum.c | 9 +- src/journal/journal-verify.c | 12 +- src/journal/journalctl.c | 59 +- src/journal/journald-audit.c | 8 +- src/journal/journald-console.c | 9 +- src/journal/journald-kmsg.c | 9 +- src/journal/journald-native.c | 8 +- src/journal/journald-server.c | 142 +- src/journal/journald-server.h | 3 +- src/journal/journald-stream.c | 380 +- src/journal/journald-stream.h | 3 +- src/journal/journald-syslog.c | 63 +- src/journal/journald-syslog.h | 1 - src/journal/journald.c | 4 + src/journal/mmap-cache.c | 232 +- src/journal/mmap-cache.h | 13 +- src/journal/sd-journal.c | 294 +- src/journal/test-compress-benchmark.c | 18 +- src/journal/test-compress.c | 4 +- src/journal/test-journal-flush.c | 10 +- src/journal/test-journal-interleaving.c | 34 +- src/journal/test-journal-stream.c | 3 +- src/journal/test-journal.c | 19 +- src/journal/test-mmap-cache.c | 10 +- src/libsystemd-network/dhcp-identifier.c | 100 + src/libsystemd-network/dhcp-identifier.h | 65 + src/libsystemd-network/dhcp-network.c | 2 +- src/libsystemd-network/dhcp-server-internal.h | 2 + src/libsystemd-network/lldp-internal.c | 533 +++ src/libsystemd-network/lldp-internal.h | 99 + src/libsystemd-network/lldp-network.c | 112 + src/libsystemd-network/lldp-network.h | 28 + src/libsystemd-network/lldp-port.c | 116 + src/libsystemd-network/lldp-port.h | 63 + src/libsystemd-network/lldp-tlv.c | 321 ++ src/libsystemd-network/lldp-tlv.h | 87 + src/libsystemd-network/lldp-util.h | 26 + src/libsystemd-network/lldp.h | 115 + src/libsystemd-network/network-internal.c | 82 +- src/libsystemd-network/network-internal.h | 12 +- src/libsystemd-network/sd-dhcp-client.c | 101 +- src/libsystemd-network/sd-dhcp-lease.c | 16 +- src/libsystemd-network/sd-dhcp-server.c | 2 +- src/libsystemd-network/sd-dhcp6-client.c | 103 +- src/libsystemd-network/sd-dhcp6-lease.c | 28 +- src/libsystemd-network/sd-icmp6-nd.c | 391 +- src/libsystemd-network/sd-ipv4ll.c | 2 +- src/libsystemd-network/sd-lldp.c | 687 ++++ src/libsystemd-network/test-dhcp-client.c | 62 +- src/libsystemd-network/test-dhcp-option.c | 4 +- src/libsystemd-network/test-dhcp6-client.c | 45 +- src/libsystemd-network/test-icmp6-rs.c | 219 +- src/libsystemd-network/test-lldp.c | 236 ++ src/libsystemd-network/test-pppoe.c | 4 +- src/libsystemd-terminal/grdev-drm.c | 2 +- src/libsystemd-terminal/grdev.c | 2 +- src/libsystemd-terminal/idev-keyboard.c | 4 +- src/libsystemd-terminal/subterm.c | 13 +- src/libsystemd-terminal/term-internal.h | 2 +- src/libsystemd-terminal/term-parser.c | 43 - src/libsystemd-terminal/term-screen.c | 5 +- src/libsystemd-terminal/term.h | 1 - src/libsystemd-terminal/test-term-parser.c | 3 +- src/libsystemd-terminal/unifont-def.h | 2 +- .../unifont-glyph-array.bin | Bin 2621472 -> 2621392 bytes src/libsystemd/libsystemd.sym.m4 | 11 +- src/libsystemd/sd-bus/DIFFERENCES | 7 +- src/libsystemd/sd-bus/GVARIANT-SERIALIZATION | 79 +- src/libsystemd/sd-bus/bus-bloom.h | 2 + src/libsystemd/sd-bus/bus-common-errors.c | 8 +- src/libsystemd/sd-bus/bus-common-errors.h | 4 + src/libsystemd/sd-bus/bus-container.c | 26 +- src/libsystemd/sd-bus/bus-control.c | 109 +- src/libsystemd/sd-bus/bus-convenience.c | 2 +- src/libsystemd/sd-bus/bus-creds.c | 46 +- src/libsystemd/sd-bus/bus-creds.h | 3 +- src/libsystemd/sd-bus/bus-dump.c | 36 +- src/libsystemd/sd-bus/bus-error.c | 6 +- src/libsystemd/sd-bus/bus-gvariant.c | 60 + src/libsystemd/sd-bus/bus-gvariant.h | 6 + src/libsystemd/sd-bus/bus-internal.h | 4 +- src/libsystemd/sd-bus/bus-kernel.c | 490 +-- src/libsystemd/sd-bus/bus-kernel.h | 10 +- src/libsystemd/sd-bus/bus-match.c | 2 +- src/libsystemd/sd-bus/bus-message.c | 738 ++-- src/libsystemd/sd-bus/bus-message.h | 50 +- src/libsystemd/sd-bus/bus-objects.c | 371 +- src/libsystemd/sd-bus/bus-protocol.h | 35 +- src/libsystemd/sd-bus/bus-socket.c | 10 +- src/libsystemd/sd-bus/bus-type.h | 1 + src/libsystemd/sd-bus/bus-util.c | 277 +- src/libsystemd/sd-bus/bus-util.h | 13 +- src/libsystemd/sd-bus/busctl-introspect.h | 1 + src/libsystemd/sd-bus/busctl.c | 49 +- src/libsystemd/sd-bus/kdbus.h | 715 ++-- src/libsystemd/sd-bus/sd-bus.c | 130 +- src/libsystemd/sd-bus/test-bus-chat.c | 7 +- src/libsystemd/sd-bus/test-bus-gvariant.c | 205 +- src/libsystemd/sd-bus/test-bus-marshal.c | 13 + src/libsystemd/sd-bus/test-bus-match.c | 4 +- src/libsystemd/sd-bus/test-bus-objects.c | 48 + src/libsystemd/sd-daemon/sd-daemon.c | 94 +- src/libsystemd/sd-event/sd-event.c | 10 +- src/libsystemd/sd-event/test-event.c | 19 +- .../sd-hwdb/hwdb-internal.h} | 6 +- .../sd-hwdb/hwdb-util.h} | 20 +- src/libsystemd/sd-hwdb/sd-hwdb.c | 471 +++ src/libsystemd/sd-id128/sd-id128.c | 2 +- src/libsystemd/sd-login/sd-login.c | 6 +- src/libsystemd/sd-login/test-login.c | 2 +- src/libsystemd/sd-network/sd-network.c | 28 +- src/libsystemd/sd-resolve/sd-resolve.c | 2 +- src/libsystemd/sd-resolve/test-resolve.c | 11 +- src/libsystemd/sd-rtnl/rtnl-message.c | 210 +- src/libsystemd/sd-rtnl/rtnl-types.c | 118 +- src/libsystemd/sd-rtnl/rtnl-types.h | 12 + src/libsystemd/sd-rtnl/rtnl-util.c | 4 +- src/libsystemd/sd-rtnl/sd-rtnl.c | 107 +- src/libsystemd/sd-rtnl/test-rtnl.c | 31 +- src/libudev/libudev-device.c | 174 +- src/libudev/libudev-hwdb.c | 332 +- src/libudev/libudev-monitor.c | 71 +- src/libudev/libudev-private.h | 10 +- src/locale/kbd-model-map | 4 + src/locale/language-fallback-map | 9 + src/locale/localectl.c | 6 +- src/locale/localed.c | 84 +- src/login/loginctl.c | 572 +-- src/login/logind-acl.c | 2 - src/login/logind-button.c | 2 +- src/login/logind-core.c | 2 +- src/login/logind-dbus.c | 242 +- src/login/logind-seat-dbus.c | 40 +- src/login/logind-seat.c | 16 +- src/login/logind-session-dbus.c | 44 +- src/login/logind-session-device.c | 2 +- src/login/logind-session.c | 13 +- src/login/logind-user-dbus.c | 48 +- src/login/logind-user.c | 38 +- src/login/logind.h | 4 + src/login/org.freedesktop.login1.policy.in | 20 +- src/login/pam_systemd.c | 5 +- src/{core => login}/sysfs-show.h | 0 src/login/test-inhibit.c | 2 +- src/machine/image-dbus.c | 267 ++ src/machine/image-dbus.h | 36 + src/machine/machine-dbus.c | 156 +- src/machine/machine-dbus.h | 41 + src/machine/machine.c | 29 +- src/machine/machine.h | 15 - src/machine/machinectl.c | 2096 +++++++++-- src/machine/machined-dbus.c | 231 +- src/machine/machined.c | 22 +- src/machine/machined.h | 7 + src/machine/org.freedesktop.machine1.conf | 16 + .../org.freedesktop.machine1.policy.in | 29 + src/network/networkctl.c | 518 ++- src/network/networkd-address.c | 70 +- src/network/networkd-dhcp4.c | 2 +- src/network/networkd-dhcp6.c | 165 +- src/network/networkd-fdb.c | 253 ++ src/network/networkd-ipv4ll.c | 2 +- src/network/networkd-link-bus.c | 138 + src/network/networkd-link.c | 600 ++- src/network/networkd-link.h | 41 +- src/network/networkd-manager-bus.c | 51 + src/network/networkd-manager.c | 543 ++- src/network/networkd-netdev-gperf.gperf | 2 + src/network/networkd-netdev-ipvlan.c | 75 + src/network/networkd-netdev-ipvlan.h | 47 + src/network/networkd-netdev-tunnel.c | 235 +- src/network/networkd-netdev-tunnel.h | 28 + src/network/networkd-netdev.c | 12 +- src/network/networkd-netdev.h | 11 + src/network/networkd-network-bus.c | 160 + src/network/networkd-network-gperf.gperf | 19 +- src/network/networkd-network.c | 214 +- src/network/networkd-route.c | 41 + src/network/networkd-wait-online-link.c | 9 - src/network/networkd-wait-online-manager.c | 37 +- src/network/networkd-wait-online.c | 38 +- src/network/networkd-wait-online.h | 12 +- src/network/networkd.c | 26 +- src/network/networkd.h | 135 +- src/network/org.freedesktop.network1.conf | 42 + src/network/org.freedesktop.network1.service | 12 + src/network/test-network-tables.c | 3 +- src/network/test-network.c | 5 +- src/notify/notify.c | 12 +- src/nspawn/nspawn.c | 1451 ++++++-- src/nss-myhostname/nss-myhostname.c | 47 +- src/random-seed/random-seed.c | 30 +- src/reply-password/reply-password.c | 2 +- src/resolve/resolved-bus.c | 2 +- src/resolve/resolved-dns-domain.h | 2 + src/resolve/resolved-dns-packet.c | 2 +- src/resolve/resolved-dns-scope.c | 2 +- src/resolve/resolved-manager.c | 14 +- src/resolve/resolved.c | 1 + src/resolve/test-dns-domain.c | 3 +- src/run/run.c | 526 ++- src/shared/acl-util.c | 189 +- src/shared/acl-util.h | 21 +- src/shared/ask-password-api.c | 2 +- src/shared/async.c | 12 +- src/shared/btrfs-ctree.h | 92 + src/shared/btrfs-util.c | 649 ++++ src/shared/btrfs-util.h | 66 + src/{core => shared}/build.h | 0 src/shared/calendarspec.c | 2 +- src/shared/cap-list.c | 4 + src/shared/cap-list.h | 1 + src/shared/capability.c | 35 +- src/shared/cgroup-show.c | 55 +- src/shared/cgroup-util.c | 90 +- src/shared/cgroup-util.h | 3 + src/shared/clock-util.c | 4 +- src/shared/clock-util.h | 2 + src/shared/condition.c | 7 +- src/shared/condition.h | 2 +- src/shared/conf-files.c | 2 +- src/shared/conf-parser.c | 10 +- src/shared/conf-parser.h | 11 +- src/shared/copy.c | 225 +- src/shared/copy.h | 11 +- src/shared/def.h | 3 + src/shared/dropin.c | 138 +- src/shared/dropin.h | 29 + src/shared/env-util.c | 11 +- src/shared/env-util.h | 6 +- src/shared/fdset.c | 56 +- src/shared/fdset.h | 11 +- src/shared/fileio-label.c | 5 +- src/shared/fstab-util.c | 150 + src/shared/fstab-util.h | 48 + src/shared/fw-util.c | 344 ++ src/shared/fw-util.h | 82 + src/shared/generator.c | 43 +- src/shared/gpt.h | 4 + src/shared/gunicode.h | 2 + src/shared/hashmap.c | 32 +- src/shared/hashmap.h | 8 +- src/shared/import-util.c | 182 + src/shared/import-util.h | 47 + src/shared/in-addr-util.c | 54 +- src/shared/in-addr-util.h | 6 +- src/shared/install-printf.c | 2 +- src/shared/install.c | 28 +- src/shared/json.c | 446 +++ src/shared/json.h | 50 + src/shared/label.c | 4 +- src/shared/label.h | 4 +- src/shared/list.h | 20 + src/shared/locale-util.c | 2 +- src/shared/log.c | 53 +- src/shared/log.h | 3 +- src/shared/login-shared.h | 2 + src/shared/logs-show.c | 28 +- src/shared/logs-show.h | 5 +- src/shared/machine-image.c | 660 ++++ src/shared/machine-image.h | 70 + src/shared/macro.h | 35 +- src/shared/missing.h | 138 +- src/shared/pager.c | 2 +- src/shared/path-lookup.c | 144 +- src/shared/path-lookup.h | 6 + src/shared/path-util.c | 70 +- src/shared/pty.c | 13 +- src/shared/ptyfwd.c | 69 +- src/shared/ptyfwd.h | 9 +- src/shared/seccomp-util.h | 1 + src/shared/set.h | 2 +- src/shared/sigbus.c | 152 + src/shared/sigbus.h | 27 + src/shared/sleep-config.c | 6 +- src/shared/sleep-config.h | 2 + src/shared/socket-label.c | 3 +- src/shared/spawn-polkit-agent.c | 7 +- src/shared/strv.c | 45 +- src/shared/strv.h | 14 + src/shared/switch-root.c | 3 +- src/shared/time-dst.c | 3 +- src/shared/time-util.c | 2 +- src/shared/time-util.h | 4 +- src/shared/udev-util.h | 2 - src/shared/uid-range.h | 1 + src/shared/utf8.c | 92 +- src/shared/utf8.h | 13 + src/shared/util.c | 1175 ++++-- src/shared/util.h | 192 +- src/shared/utmp-wtmp.c | 2 +- src/shared/verbs.c | 90 + src/shared/verbs.h | 34 + src/shared/virt.c | 20 + src/shared/xml.h | 2 +- src/shutdownd/shutdownd.c | 2 +- src/sleep/sleep.c | 5 +- src/sysctl/sysctl.c | 30 +- .../system-update-generator.c | 4 +- src/systemctl/systemctl.c | 1023 +++-- src/systemd/sd-bus.h | 6 +- src/systemd/sd-daemon.h | 13 + src/systemd/sd-dhcp6-lease.h | 13 +- src/systemd/sd-hwdb.h | 47 + src/systemd/sd-icmp6-nd.h | 30 +- src/systemd/sd-id128.h | 2 +- src/systemd/sd-journal.h | 10 +- src/systemd/sd-lldp.h | 53 + src/systemd/sd-login.h | 2 +- src/systemd/sd-network.h | 2 + src/systemd/sd-rtnl.h | 8 + src/sysusers/sysusers.c | 13 +- src/sysv-generator/sysv-generator.c | 87 +- src/test/test-async.c | 2 + src/test/test-btrfs.c | 106 + src/test/test-cap-list.c | 70 +- src/test/test-cgroup-util.c | 1 + src/test/test-condition.c | 47 +- src/test/test-conf-files.c | 8 +- src/test/test-copy.c | 18 +- src/test/test-execute.c | 6 + src/test/test-fileio.c | 2 +- src/test/test-fstab-util.c | 138 + src/test/test-fw-util.c | 60 + src/test/test-hashmap-plain.c | 7 +- src/test/test-json.c | 107 + src/test/test-list.c | 45 + src/test/test-loopback.c | 4 + src/test/test-namespace.c | 5 +- src/test/test-path-lookup.c | 74 + src/test/test-path-util.c | 4 +- src/test/test-path.c | 10 +- src/test/test-pty.c | 2 +- src/test/test-ring.c | 2 +- src/test/test-sigbus.c | 62 + src/test/test-strbuf.c | 2 +- src/test/test-strv.c | 105 +- src/test/test-strxcpyx.c | 2 +- src/test/test-tables.c | 3 +- src/test/test-tmpfiles.c | 2 +- src/test/test-udev.c | 1 + src/test/test-unit-file.c | 201 +- src/test/test-unit-name.c | 37 + src/test/test-utf8.c | 13 + src/test/test-util.c | 319 +- src/test/test-verbs.c | 78 + src/timedate/timedatectl.c | 67 +- src/timedate/timedated.c | 2 +- src/timesync/timesyncd-manager.c | 21 +- src/timesync/timesyncd.c | 4 + src/tmpfiles/tmpfiles.c | 1000 +++-- .../tty-ask-password-agent.c | 6 +- src/udev/accelerometer/accelerometer.c | 14 +- src/udev/ata_id/ata_id.c | 132 +- src/udev/cdrom_id/cdrom_id.c | 20 +- src/udev/collect/collect.c | 14 +- src/udev/mtd_probe/mtd_probe.h | 2 + src/udev/net/link-config-gperf.gperf | 8 +- src/udev/net/link-config.c | 96 +- src/udev/net/link-config.h | 8 +- src/udev/scsi_id/scsi.h | 2 + src/udev/scsi_id/scsi_id.c | 28 +- src/udev/scsi_id/scsi_id.h | 2 + src/udev/udev-builtin-blkid.c | 17 +- src/udev/udev-builtin-btrfs.c | 5 +- src/udev/udev-builtin-hwdb.c | 40 +- src/udev/udev-builtin-input_id.c | 75 +- src/udev/udev-builtin-keyboard.c | 24 +- src/udev/udev-builtin-kmod.c | 2 +- src/udev/udev-builtin-net_id.c | 14 +- src/udev/udev-builtin-net_setup_link.c | 4 +- src/udev/udev-builtin-path_id.c | 2 +- src/udev/udev-builtin-uaccess.c | 2 +- src/udev/udev-builtin-usb_id.c | 2 +- src/udev/udev-builtin.c | 2 +- src/udev/udev-ctrl.c | 6 +- src/udev/udev-event.c | 57 +- src/udev/udev-node.c | 3 +- src/udev/udevadm-control.c | 25 +- src/udev/udevadm-hwdb.c | 19 +- src/udev/udevadm-info.c | 58 +- src/udev/udevadm-monitor.c | 19 +- src/udev/udevadm-settle.c | 34 +- src/udev/udevadm-test-builtin.c | 14 +- src/udev/udevadm-test.c | 19 +- src/udev/udevadm-trigger.c | 39 +- src/udev/udevadm-util.c | 2 +- src/udev/udevadm-util.h | 2 + src/udev/udevadm.c | 10 +- src/udev/udevd.c | 55 +- src/udev/v4l_id/v4l_id.c | 19 +- src/update-done/update-done.c | 1 + system-preset/90-systemd.preset | 2 + test-libsystemd-sym.c | 7 +- test/{end.service => end.service.in} | 2 +- test/exec-umask-0177.service | 7 + test/exec-umask-default.service | 6 + test/rule-syntax-check.py | 23 +- test/rules-test.sh | 28 - test/sysv-generator-test.py | 384 ++ test/udev-test.pl | 4 +- tmpfiles.d/etc.conf.m4 | 2 +- tmpfiles.d/systemd.conf | 6 + tmpfiles.d/tmp.conf | 4 +- tmpfiles.d/var.conf | 2 +- units/console-shell.service.m4.in | 2 +- units/container-getty@.service.m4.in | 4 +- units/emergency.service.in | 2 +- units/graphical.target | 4 +- units/machines.target | 17 + units/org.freedesktop.import1.busname | 14 + units/org.freedesktop.network1.busname | 20 + units/org.freedesktop.resolve1.busname | 5 + units/org.freedesktop.systemd1.busname | 2 +- units/rescue.service.in | 2 +- units/systemd-backlight@.service.in | 1 + ...ce.in => systemd-bus-proxyd.service.m4.in} | 11 +- units/systemd-bus-proxyd.socket | 1 - units/systemd-bus-proxyd@.service.m4.in | 22 - ...vice.in => systemd-hwdb-update.service.in} | 4 +- units/systemd-importd.service.in | 20 + .../systemd-journal-catalog-update.service.in | 1 + units/systemd-journal-flush.service.in | 1 + units/systemd-journal-gatewayd.service.in | 4 + units/systemd-journal-upload.service.in | 4 + units/systemd-journald.service.in | 5 +- units/systemd-machined.service.in | 2 +- units/systemd-networkd.service.in | 3 +- units/systemd-networkd.socket | 21 + units/systemd-nspawn@.service.in | 8 +- units/systemd-resolved.service.in | 6 + units/user/systemd-bus-proxyd.service.in | 13 + units/user/systemd-bus-proxyd.socket | 1 - units/user/systemd-consoled.service.in | 15 + units/user@.service.m4.in | 4 - xorg/50-systemd-user.sh | 3 + 1473 files changed, 109983 insertions(+), 80367 deletions(-) create mode 100644 catalog/systemd.pt_BR.catalog create mode 100644 hwdb/70-touchpad.hwdb create mode 100644 man/hwdb.7 create mode 100644 man/hwdb.html create mode 100644 man/hwdb.xml create mode 100644 man/libnss_myhostname.so.2.8 create mode 100644 man/libnss_myhostname.so.2.html create mode 100644 man/libnss_mymachines.so.2.8 create mode 100644 man/libnss_mymachines.so.2.html create mode 100644 man/networkctl.1 create mode 100644 man/networkctl.html create mode 100644 man/networkctl.xml create mode 100644 man/nss-mymachines.8 create mode 100644 man/nss-mymachines.html create mode 100644 man/nss-mymachines.xml create mode 100644 man/sd_pid_notify.3 create mode 100644 man/sd_pid_notify.html create mode 100644 man/sd_pid_notify_with_fds.3 create mode 100644 man/sd_pid_notify_with_fds.html create mode 100644 man/sd_pid_notifyf.3 create mode 100644 man/sd_pid_notifyf.html create mode 100644 man/systemd-hwdb.8 create mode 100644 man/systemd-hwdb.html create mode 100644 man/systemd-hwdb.xml create mode 100644 man/systemd.generator.7 create mode 100644 man/systemd.generator.html create mode 100644 man/systemd.generator.xml create mode 100644 po/hu.po create mode 100644 po/pt_BR.po create mode 100644 po/sv.po create mode 100644 rules/70-touchpad.rules rename src/bus-proxyd/{bus-policy.c => bus-xml-policy.c} (75%) rename src/bus-proxyd/{bus-policy.h => bus-xml-policy.h} (62%) create mode 100644 src/bus-proxyd/driver.c rename src/{core/bus-common.c => bus-proxyd/driver.h} (63%) create mode 100644 src/bus-proxyd/proxy.c create mode 100644 src/bus-proxyd/proxy.h create mode 100644 src/bus-proxyd/stdio-bridge.c create mode 100644 src/bus-proxyd/synthesize.c create mode 100644 src/bus-proxyd/synthesize.h rename src/bus-proxyd/{test-bus-policy.c => test-bus-xml-policy.c} (55%) create mode 100644 src/core/bus-policy.c create mode 100644 src/core/bus-policy.h create mode 100644 src/hwdb/hwdb.c create mode 100644 src/import/aufs-util.c create mode 100644 src/import/aufs-util.h create mode 100644 src/import/curl-util.c create mode 100644 src/import/curl-util.h create mode 100644 src/import/import-common.c create mode 100644 src/import/import-common.h create mode 100644 src/import/import-dkr.c create mode 100644 src/import/import-dkr.h create mode 100644 src/import/import-job.c create mode 100644 src/import/import-job.h create mode 100644 src/import/import-pubring.gpg create mode 100644 src/import/import-raw.c create mode 100644 src/import/import-raw.h create mode 100644 src/import/import-tar.c create mode 100644 src/import/import-tar.h create mode 100644 src/import/importd.c create mode 100644 src/import/org.freedesktop.import1.conf create mode 100644 src/import/org.freedesktop.import1.policy.in create mode 100644 src/import/org.freedesktop.import1.service create mode 100644 src/import/pull.c create mode 100644 src/import/qcow2-util.c create mode 100644 src/import/qcow2-util.h create mode 100644 src/import/test-qcow2.c create mode 100644 src/libsystemd-network/dhcp-identifier.c create mode 100644 src/libsystemd-network/dhcp-identifier.h create mode 100644 src/libsystemd-network/lldp-internal.c create mode 100644 src/libsystemd-network/lldp-internal.h create mode 100644 src/libsystemd-network/lldp-network.c create mode 100644 src/libsystemd-network/lldp-network.h create mode 100644 src/libsystemd-network/lldp-port.c create mode 100644 src/libsystemd-network/lldp-port.h create mode 100644 src/libsystemd-network/lldp-tlv.c create mode 100644 src/libsystemd-network/lldp-tlv.h create mode 100644 src/libsystemd-network/lldp-util.h create mode 100644 src/libsystemd-network/lldp.h create mode 100644 src/libsystemd-network/sd-lldp.c create mode 100644 src/libsystemd-network/test-lldp.c rename src/{libudev/libudev-hwdb-def.h => libsystemd/sd-hwdb/hwdb-internal.h} (96%) rename src/{core/bus-common.h => libsystemd/sd-hwdb/hwdb-util.h} (65%) create mode 100644 src/libsystemd/sd-hwdb/sd-hwdb.c create mode 100644 src/locale/language-fallback-map rename src/{core => login}/sysfs-show.h (100%) create mode 100644 src/machine/image-dbus.c create mode 100644 src/machine/image-dbus.h create mode 100644 src/machine/machine-dbus.h create mode 100644 src/machine/org.freedesktop.machine1.policy.in create mode 100644 src/network/networkd-fdb.c create mode 100644 src/network/networkd-link-bus.c create mode 100644 src/network/networkd-manager-bus.c create mode 100644 src/network/networkd-netdev-ipvlan.c create mode 100644 src/network/networkd-netdev-ipvlan.h create mode 100644 src/network/networkd-network-bus.c create mode 100644 src/network/org.freedesktop.network1.conf create mode 100644 src/network/org.freedesktop.network1.service create mode 100644 src/shared/btrfs-ctree.h create mode 100644 src/shared/btrfs-util.c create mode 100644 src/shared/btrfs-util.h rename src/{core => shared}/build.h (100%) create mode 100644 src/shared/fstab-util.c create mode 100644 src/shared/fstab-util.h create mode 100644 src/shared/fw-util.c create mode 100644 src/shared/fw-util.h create mode 100644 src/shared/import-util.c create mode 100644 src/shared/import-util.h create mode 100644 src/shared/json.c create mode 100644 src/shared/json.h create mode 100644 src/shared/machine-image.c create mode 100644 src/shared/machine-image.h create mode 100644 src/shared/sigbus.c create mode 100644 src/shared/sigbus.h create mode 100644 src/shared/verbs.c create mode 100644 src/shared/verbs.h create mode 100644 src/systemd/sd-hwdb.h create mode 100644 src/systemd/sd-lldp.h create mode 100644 src/test/test-btrfs.c create mode 100644 src/test/test-fstab-util.c create mode 100644 src/test/test-fw-util.c create mode 100644 src/test/test-json.c create mode 100644 src/test/test-path-lookup.c create mode 100644 src/test/test-sigbus.c create mode 100644 src/test/test-verbs.c rename test/{end.service => end.service.in} (57%) create mode 100644 test/exec-umask-0177.service create mode 100644 test/exec-umask-default.service mode change 100755 => 100644 test/rule-syntax-check.py delete mode 100755 test/rules-test.sh create mode 100644 test/sysv-generator-test.py create mode 100644 units/machines.target create mode 100644 units/org.freedesktop.import1.busname create mode 100644 units/org.freedesktop.network1.busname rename units/{user/systemd-bus-proxyd@.service.in => systemd-bus-proxyd.service.m4.in} (65%) delete mode 100644 units/systemd-bus-proxyd@.service.m4.in rename units/{systemd-udev-hwdb-update.service.in => systemd-hwdb-update.service.in} (87%) create mode 100644 units/systemd-importd.service.in create mode 100644 units/systemd-networkd.socket create mode 100644 units/user/systemd-bus-proxyd.service.in create mode 100644 units/user/systemd-consoled.service.in create mode 100755 xorg/50-systemd-user.sh diff --git a/Makefile-man.am b/Makefile-man.am index 6a40b7680..d0fb9aa1a 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -22,6 +22,7 @@ MANPAGES += \ man/localtime.5 \ man/machine-id.5 \ man/machine-info.5 \ + man/networkctl.1 \ man/os-release.5 \ man/sd-daemon.3 \ man/sd-id128.3 \ @@ -64,7 +65,6 @@ MANPAGES += \ man/systemd-detect-virt.1 \ man/systemd-efi-boot-generator.8 \ man/systemd-escape.1 \ - man/systemd-firstboot.1 \ man/systemd-fsck@.service.8 \ man/systemd-fstab-generator.8 \ man/systemd-getty-generator.8 \ @@ -99,6 +99,7 @@ MANPAGES += \ man/systemd.automount.5 \ man/systemd.device.5 \ man/systemd.exec.5 \ + man/systemd.generator.7 \ man/systemd.journal-fields.7 \ man/systemd.kill.5 \ man/systemd.link.5 \ @@ -198,12 +199,14 @@ MANPAGES_ALIAS += \ man/sd_journal_wait.3 \ man/sd_machine_get_ifindices.3 \ man/sd_notifyf.3 \ + man/sd_pid_notify.3 \ + man/sd_pid_notify_with_fds.3 \ + man/sd_pid_notifyf.3 \ man/sleep.conf.d.5 \ man/system.conf.d.5 \ man/systemd-ask-password-console.path.8 \ man/systemd-ask-password-wall.path.8 \ man/systemd-ask-password-wall.service.8 \ - man/systemd-firstboot.service.1 \ man/systemd-fsck-root.service.8 \ man/systemd-fsck.8 \ man/systemd-hibernate-resume.8 \ @@ -308,12 +311,14 @@ man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3 man/sd_journal_wait.3: man/sd_journal_get_fd.3 man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3 man/sd_notifyf.3: man/sd_notify.3 +man/sd_pid_notify.3: man/sd_notify.3 +man/sd_pid_notify_with_fds.3: man/sd_notify.3 +man/sd_pid_notifyf.3: man/sd_notify.3 man/sleep.conf.d.5: man/systemd-sleep.conf.5 man/system.conf.d.5: man/systemd-system.conf.5 man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8 man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8 man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8 -man/systemd-firstboot.service.1: man/systemd-firstboot.1 man/systemd-fsck-root.service.8: man/systemd-fsck@.service.8 man/systemd-fsck.8: man/systemd-fsck@.service.8 man/systemd-hibernate-resume.8: man/systemd-hibernate-resume@.service.8 @@ -566,6 +571,15 @@ man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html man/sd_notifyf.html: man/sd_notify.html $(html-alias) +man/sd_pid_notify.html: man/sd_notify.html + $(html-alias) + +man/sd_pid_notify_with_fds.html: man/sd_notify.html + $(html-alias) + +man/sd_pid_notifyf.html: man/sd_notify.html + $(html-alias) + man/sleep.conf.d.html: man/systemd-sleep.conf.html $(html-alias) @@ -581,9 +595,6 @@ man/systemd-ask-password-wall.path.html: man/systemd-ask-password-console.servic man/systemd-ask-password-wall.service.html: man/systemd-ask-password-console.service.html $(html-alias) -man/systemd-firstboot.service.html: man/systemd-firstboot.html - $(html-alias) - man/systemd-fsck-root.service.html: man/systemd-fsck@.service.html $(html-alias) @@ -732,6 +743,17 @@ MANPAGES_ALIAS += \ endif +if ENABLE_FIRSTBOOT +MANPAGES += \ + man/systemd-firstboot.1 +MANPAGES_ALIAS += \ + man/systemd-firstboot.service.1 +man/systemd-firstboot.service.1: man/systemd-firstboot.1 +man/systemd-firstboot.service.html: man/systemd-firstboot.html + $(html-alias) + +endif + if ENABLE_HOSTNAMED MANPAGES += \ man/hostnamectl.1 \ @@ -744,6 +766,16 @@ man/systemd-hostnamed.html: man/systemd-hostnamed.service.html endif +if ENABLE_HWDB +MANPAGES += \ + man/hwdb.7 \ + man/systemd-hwdb.8 +MANPAGES_ALIAS += \ + # + + +endif + if ENABLE_KDBUS MANPAGES += \ man/sd_bus_creds_get_pid.3 \ @@ -1146,10 +1178,16 @@ endif if ENABLE_MACHINED MANPAGES += \ man/machinectl.1 \ + man/nss-mymachines.8 \ man/systemd-machined.service.8 MANPAGES_ALIAS += \ + man/libnss_mymachines.so.2.8 \ man/systemd-machined.8 +man/libnss_mymachines.so.2.8: man/nss-mymachines.8 man/systemd-machined.8: man/systemd-machined.service.8 +man/libnss_mymachines.so.2.html: man/nss-mymachines.html + $(html-alias) + man/systemd-machined.html: man/systemd-machined.service.html $(html-alias) @@ -1312,8 +1350,10 @@ if HAVE_MYHOSTNAME MANPAGES += \ man/nss-myhostname.8 MANPAGES_ALIAS += \ - # - + man/libnss_myhostname.so.2.8 +man/libnss_myhostname.so.2.8: man/nss-myhostname.8 +man/libnss_myhostname.so.2.html: man/nss-myhostname.html + $(html-alias) endif @@ -1593,6 +1633,7 @@ EXTRA_DIST += \ man/halt.xml \ man/hostname.xml \ man/hostnamectl.xml \ + man/hwdb.xml \ man/journalctl.xml \ man/journald.conf.xml \ man/kernel-command-line.xml \ @@ -1608,7 +1649,9 @@ EXTRA_DIST += \ man/machine-info.xml \ man/machinectl.xml \ man/modules-load.d.xml \ + man/networkctl.xml \ man/nss-myhostname.xml \ + man/nss-mymachines.xml \ man/os-release.xml \ man/pam_systemd.xml \ man/resolved.conf.xml \ @@ -1702,6 +1745,7 @@ EXTRA_DIST += \ man/systemd-hibernate-resume-generator.xml \ man/systemd-hibernate-resume@.service.xml \ man/systemd-hostnamed.service.xml \ + man/systemd-hwdb.xml \ man/systemd-inhibit.xml \ man/systemd-initctl.service.xml \ man/systemd-journal-gatewayd.service.xml \ @@ -1748,6 +1792,7 @@ EXTRA_DIST += \ man/systemd.device.xml \ man/systemd.directives.xml \ man/systemd.exec.xml \ + man/systemd.generator.xml \ man/systemd.index.xml \ man/systemd.journal-fields.xml \ man/systemd.kill.xml \ diff --git a/Makefile.am b/Makefile.am index ac7924ed8..bf04d3184 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,9 +46,9 @@ LIBGUDEV_CURRENT=2 LIBGUDEV_REVISION=0 LIBGUDEV_AGE=2 -LIBSYSTEMD_CURRENT=5 -LIBSYSTEMD_REVISION=1 -LIBSYSTEMD_AGE=5 +LIBSYSTEMD_CURRENT=6 +LIBSYSTEMD_REVISION=0 +LIBSYSTEMD_AGE=6 # The following four libraries only exist for compatibility reasons, # their version info should not be bumped anymore @@ -74,7 +74,6 @@ dbussessionservicedir=@dbussessionservicedir@ dbussystemservicedir=@dbussystemservicedir@ pamlibdir=@pamlibdir@ pamconfdir=@pamconfdir@ -pkgconfigdatadir=$(datadir)/pkgconfig pkgconfiglibdir=$(libdir)/pkgconfig polkitpolicydir=$(datadir)/polkit-1/actions bashcompletiondir=@bashcompletiondir@ @@ -85,6 +84,7 @@ sysvrcnddir=$(SYSTEM_SYSVRCND_PATH) varlogdir=$(localstatedir)/log systemdstatedir=$(localstatedir)/lib/systemd catalogstatedir=$(systemdstatedir)/catalog +xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d # Our own, non-special dirs pkgsysconfdir=$(sysconfdir)/systemd @@ -148,6 +148,8 @@ check_PROGRAMS = check_DATA = tests= manual_tests = +TEST_EXTENSIONS = .py +PY_LOG_COMPILER = $(PYTHON) if ENABLE_TESTS noinst_PROGRAMS = $(manual_tests) $(tests) TESTS = $(tests) @@ -188,6 +190,7 @@ AM_CPPFLAGS = \ -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \ -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \ -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \ + -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \ -DX_SERVER=\"$(bindir)/X\" \ -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \ -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \ @@ -217,6 +220,7 @@ AM_CPPFLAGS = \ -I $(top_srcdir)/src/libsystemd/sd-event \ -I $(top_srcdir)/src/libsystemd/sd-rtnl \ -I $(top_srcdir)/src/libsystemd/sd-network \ + -I $(top_srcdir)/src/libsystemd/sd-hwdb \ -I $(top_srcdir)/src/libsystemd-network \ -I $(top_srcdir)/src/libsystemd-terminal \ $(OUR_CPPFLAGS) @@ -367,6 +371,7 @@ bin_PROGRAMS = \ systemd-delta \ systemd-analyze \ systemd-run \ + systemd-stdio-bridge \ systemd-path dist_bin_SCRIPTS = \ @@ -505,7 +510,8 @@ dist_systemunit_DATA = \ units/systemd-udevd-control.socket \ units/systemd-udevd-kernel.socket \ units/system-update.target \ - units/initrd-switch-root.target + units/initrd-switch-root.target \ + units/machines.target if ENABLE_KDBUS dist_systemunit_DATA += \ @@ -541,7 +547,7 @@ nodist_systemunit_DATA = \ units/systemd-udevd.service \ units/systemd-udev-trigger.service \ units/systemd-udev-settle.service \ - units/systemd-udev-hwdb-update.service \ + units/systemd-hwdb-update.service \ units/debug-shell.service \ units/initrd-parse-etc.service \ units/initrd-cleanup.service \ @@ -767,6 +773,8 @@ libsystemd_shared_la_SOURCES = \ src/shared/architecture.h \ src/shared/efivars.c \ src/shared/efivars.h \ + src/shared/fstab-util.c \ + src/shared/fstab-util.h \ src/shared/path-util.c \ src/shared/path-util.h \ src/shared/time-util.c \ @@ -867,6 +875,8 @@ libsystemd_shared_la_SOURCES = \ src/shared/audit.h \ src/shared/xml.c \ src/shared/xml.h \ + src/shared/json.c \ + src/shared/json.h \ src/shared/bus-label.c \ src/shared/bus-label.h \ src/shared/gpt.h \ @@ -882,15 +892,20 @@ libsystemd_shared_la_SOURCES = \ src/shared/pty.h \ src/shared/async.c \ src/shared/async.h \ - src/shared/copy.c \ - src/shared/copy.h \ src/shared/base-filesystem.c \ src/shared/base-filesystem.h \ src/shared/memfd-util.c \ src/shared/memfd-util.h \ src/shared/uid-range.c \ src/shared/uid-range.h \ - src/shared/nss-util.h + src/shared/nss-util.h \ + src/shared/verbs.c \ + src/shared/verbs.h \ + src/shared/sigbus.c \ + src/shared/sigbus.h \ + src/shared/build.h \ + src/shared/import-util.c \ + src/shared/import-util.h if HAVE_UTMP libsystemd_shared_la_SOURCES += \ @@ -914,7 +929,8 @@ libsystemd_shared_la_CFLAGS = \ -pthread libsystemd_shared_la_LIBADD = \ - $(CAP_LIBS) + $(CAP_LIBS) \ + -lm # ------------------------------------------------------------------------------ noinst_LTLIBRARIES += \ @@ -954,7 +970,14 @@ libsystemd_label_la_SOURCES = \ src/shared/condition.c \ src/shared/condition.h \ src/shared/generator.h \ - src/shared/generator.c + src/shared/generator.c \ + src/shared/btrfs-util.c \ + src/shared/btrfs-util.h \ + src/shared/btrfs-ctree.h \ + src/shared/machine-image.c \ + src/shared/machine-image.h \ + src/shared/copy.c \ + src/shared/copy.h libsystemd_label_la_CFLAGS = \ $(AM_CFLAGS) \ @@ -965,6 +988,24 @@ libsystemd_label_la_LIBADD = \ # ----------------------------------------------------------------------------- +if HAVE_LIBIPTC +noinst_LTLIBRARIES += \ + libsystemd-fw.la + +libsystemd_fw_la_SOURCES = \ + src/shared/fw-util.h \ + src/shared/fw-util.c + +libsystemd_fw_la_CFLAGS = \ + $(AM_CFLAGS) \ + $(LIBIPTC_CFLAGS) + +libsystemd_fw_la_LIBADD = \ + $(LIBIPTC_LIBS) +endif + +# ----------------------------------------------------------------------------- + if ENABLE_LDCONFIG dist_systemunit_DATA += \ units/ldconfig.service @@ -1039,10 +1080,10 @@ libsystemd_core_la_SOURCES = \ src/core/socket.h \ src/core/busname.c \ src/core/busname.h \ - src/core/bus-common.c \ - src/core/bus-common.h \ src/core/bus-endpoint.c \ src/core/bus-endpoint.h \ + src/core/bus-policy.c \ + src/core/bus-policy.h \ src/core/target.c \ src/core/target.h \ src/core/snapshot.c \ @@ -1133,8 +1174,6 @@ libsystemd_core_la_SOURCES = \ src/core/loopback-setup.c \ src/core/namespace.c \ src/core/namespace.h \ - src/core/build.h \ - src/core/sysfs-show.h \ src/core/killall.h \ src/core/killall.c \ src/core/audit-fd.c \ @@ -1249,7 +1288,7 @@ src/shared/cap-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - $@ src/shared/cap-to-name.h: src/shared/cap-list.txt - $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ + $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@ src/shared/cap-from-name.gperf: src/shared/cap-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ @@ -1293,7 +1332,7 @@ dist_dbussystemservice_DATA += \ polkitpolicy_in_in_files += \ src/core/org.freedesktop.systemd1.policy.in.in -pkgconfigdata_DATA = \ +pkgconfiglib_DATA += \ src/core/systemd.pc nodist_rpmmacros_DATA = \ @@ -1318,7 +1357,13 @@ manual_tests += \ test-install \ test-watchdog \ test-log \ - test-ipcrm + test-ipcrm \ + test-btrfs + +if HAVE_LIBIPTC +manual_tests += \ + test-fw-util +endif if HAVE_KMOD manual_tests += \ @@ -1340,6 +1385,7 @@ tests += \ test-utf8 \ test-ellipsize \ test-util \ + test-path-lookup \ test-ring \ test-barrier \ test-pty \ @@ -1352,6 +1398,7 @@ tests += \ test-calendarspec \ test-strip-tab-ansi \ test-cgroup-util \ + test-fstab-util \ test-prioq \ test-fileio \ test-time \ @@ -1362,6 +1409,7 @@ tests += \ test-tables \ test-device-nodes \ test-xml \ + test-json \ test-architecture \ test-socket-util \ test-fdset \ @@ -1375,7 +1423,9 @@ tests += \ test-locale-util \ test-execute \ test-copy \ - test-cap-list + test-cap-list \ + test-sigbus \ + test-verbs EXTRA_DIST += \ test/a.service \ @@ -1384,7 +1434,7 @@ EXTRA_DIST += \ test/c.service \ test/daughter.service \ test/d.service \ - test/end.service \ + test/end.service.in \ test/e.service \ test/f.service \ test/grandchild.service \ @@ -1442,6 +1492,8 @@ EXTRA_DIST += \ test/exec-systemcallfilter-not-failing.service \ test/exec-user.service \ test/exec-workingdirectory.service \ + test/exec-umask-0177.service \ + test/exec-umask-default.service \ test/bus-policy/hello.conf \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ @@ -1565,6 +1617,13 @@ test_copy_SOURCES = \ src/test/test-copy.c test_copy_LDADD = \ + libsystemd-label.la \ + libsystemd-shared.la + +test_sigbus_SOURCES = \ + src/test/test-sigbus.c + +test_sigbus_LDADD = \ libsystemd-shared.la test_condition_SOURCES = \ @@ -1582,6 +1641,12 @@ test_fdset_LDADD = \ libsystemd-shared.la \ libsystemd-internal.la +test_fstab_util_SOURCES = \ + src/test/test-fstab-util.c + +test_fstab_util_LDADD = \ + libsystemd-shared.la + test_ratelimit_SOURCES = \ src/test/test-ratelimit.c @@ -1592,7 +1657,14 @@ test_util_SOURCES = \ src/test/test-util.c test_util_LDADD = \ + libsystemd-shared.la + +test_path_lookup_SOURCES = \ + src/test/test-path-lookup.c + +test_path_lookup_LDADD = \ -lm \ + libsystemd-units.la \ libsystemd-shared.la test_uid_range_SOURCES = \ @@ -1640,6 +1712,12 @@ test_tmpfiles_LDADD = \ test_namespace_SOURCES = \ src/test/test-namespace.c +test_verbs_SOURCES = \ + src/test/test-verbs.c + +test_verbs_LDADD = \ + libsystemd-shared.la + test_namespace_LDADD = \ libsystemd-core.la @@ -1680,6 +1758,12 @@ test_xml_SOURCES = \ test_xml_LDADD = \ libsystemd-shared.la +test_json_SOURCES = \ + src/test/test-json.c + +test_json_LDADD = \ + libsystemd-shared.la + test_list_SOURCES = \ src/test/test-list.c @@ -1695,8 +1779,8 @@ test_unaligned_SOURCES = \ test_tables_SOURCES = \ src/test/test-tables.c \ src/shared/test-tables.h \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h \ + src/bus-proxyd/bus-xml-policy.c \ + src/bus-proxyd/bus-xml-policy.h \ src/journal/journald-server.c \ src/journal/journald-server.h @@ -1753,6 +1837,27 @@ test_ipcrm_LDADD = \ libsystemd-shared.la \ -lrt +test_btrfs_SOURCES = \ + src/test/test-btrfs.c + +test_btrfs_LDADD = \ + libsystemd-label.la \ + libsystemd-shared.la + +if HAVE_LIBIPTC +test_fw_util_SOURCES = \ + src/test/test-fw-util.c + +test_fw_util_CFLAGS = \ + $(AM_CFLAGS) \ + $(LIBIPTC_CFLAGS) + +test_fw_util_LDADD = \ + libsystemd-fw.la \ + libsystemd-shared.la \ + $(LIBIPTC_LIBS) +endif + test_rtnl_manual_SOURCES = \ src/test/test-rtnl-manual.c @@ -1924,11 +2029,10 @@ test_conf_files_LDADD = \ libsystemd-shared.la test_bus_policy_SOURCES = \ - src/bus-proxyd/test-bus-policy.c \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h + src/bus-proxyd/test-bus-xml-policy.c test_bus_policy_LDADD = \ + libsystemd-proxy.la \ libsystemd-internal.la \ libsystemd-shared.la @@ -2090,6 +2194,11 @@ systemd_tmpfiles_LDADD = \ libsystemd-internal.la \ libsystemd-shared.la +if HAVE_ACL +systemd_tmpfiles_LDADD += \ + libsystemd-acl.la +endif + rootbin_PROGRAMS += \ systemd-tmpfiles @@ -2432,6 +2541,9 @@ dbus1-generator-install-hook: dbus1-generator-uninstall-hook: rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator +dist_xinitrc_SCRIPTS = \ + xorg/50-systemd-user.sh + INSTALL_EXEC_HOOKS += dbus1-generator-install-hook UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook endif @@ -2562,6 +2674,11 @@ systemd_nspawn_LDADD += \ $(SECCOMP_LIBS) endif +if HAVE_LIBIPTC +systemd_nspawn_LDADD += \ + libsystemd-fw.la +endif + # ------------------------------------------------------------------------------ systemd_run_SOURCES = \ src/run/run.c @@ -2572,46 +2689,67 @@ systemd_run_LDADD = \ libsystemd-shared.la # ------------------------------------------------------------------------------ +noinst_LTLIBRARIES += \ + libsystemd-proxy.la + +libsystemd_proxy_la_SOURCES = \ + src/bus-proxyd/bus-xml-policy.c \ + src/bus-proxyd/bus-xml-policy.h \ + src/bus-proxyd/driver.c \ + src/bus-proxyd/driver.h \ + src/bus-proxyd/proxy.c \ + src/bus-proxyd/proxy.h \ + src/bus-proxyd/synthesize.c \ + src/bus-proxyd/synthesize.h + +libsystemd_proxy_la_CFLAGS = \ + $(AM_CFLAGS) \ + -pthread + +libsystemd_proxy_la_LIBADD = \ + libsystemd-internal.la \ + libsystemd-shared.la + systemd_bus_proxyd_SOURCES = \ - src/bus-proxyd/bus-proxyd.c \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h + src/bus-proxyd/bus-proxyd.c + +systemd_bus_proxyd_CFLAGS = \ + $(AM_CFLAGS) \ + -pthread systemd_bus_proxyd_LDADD = \ + libsystemd-proxy.la \ libsystemd-internal.la \ libsystemd-shared.la -bus-proxyd-install-hook: - $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) - $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge - $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge +systemd_stdio_bridge_SOURCES = \ + src/bus-proxyd/stdio-bridge.c -bus-proxyd-uninstall-hook: - rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge - -INSTALL_EXEC_HOOKS += bus-proxyd-install-hook -UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook +systemd_stdio_bridge_LDADD = \ + libsystemd-proxy.la \ + libsystemd-internal.la \ + libsystemd-shared.la if ENABLE_KDBUS nodist_systemunit_DATA += \ - units/systemd-bus-proxyd@.service + units/systemd-bus-proxyd.service dist_systemunit_DATA += \ units/systemd-bus-proxyd.socket nodist_userunit_DATA += \ - units/user/systemd-bus-proxyd@.service + units/user/systemd-bus-proxyd.service dist_userunit_DATA += \ units/user/systemd-bus-proxyd.socket endif EXTRA_DIST += \ - units/systemd-bus-proxyd@.service.m4.in \ - units/user/systemd-bus-proxyd@.service.in + units/systemd-bus-proxyd.service.m4.in \ + units/user/systemd-bus-proxyd.service.in CLEANFILES += \ - units/systemd-bus-proxyd@.service.m4 + units/systemd-bus-proxyd.service.m4 if HAVE_SMACK bus-proxyd-set-cap-hook: @@ -2642,6 +2780,7 @@ libsystemd_internal_la_SOURCES = \ src/systemd/sd-daemon.h \ src/systemd/sd-path.h \ src/systemd/sd-network.h \ + src/systemd/sd-hwdb.h \ src/libsystemd/sd-bus/sd-bus.c \ src/libsystemd/sd-bus/bus-control.c \ src/libsystemd/sd-bus/bus-control.h \ @@ -2702,7 +2841,10 @@ libsystemd_internal_la_SOURCES = \ src/libsystemd/sd-path/sd-path.c \ src/libsystemd/sd-network/sd-network.c \ src/libsystemd/sd-network/network-util.h \ - src/libsystemd/sd-network/network-util.c + src/libsystemd/sd-network/network-util.c \ + src/libsystemd/sd-hwdb/sd-hwdb.c \ + src/libsystemd/sd-hwdb/hwdb-util.h \ + src/libsystemd/sd-hwdb/hwdb-internal.h nodist_libsystemd_internal_la_SOURCES = \ src/libsystemd/libsystemd.sym @@ -3027,6 +3169,7 @@ libsystemd_network_la_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/systemd/sd-dhcp6-lease.h \ src/systemd/sd-pppoe.h \ + src/systemd/sd-lldp.h \ src/libsystemd-network/sd-dhcp-client.c \ src/libsystemd-network/sd-dhcp-server.c \ src/libsystemd-network/dhcp-network.c \ @@ -3051,7 +3194,20 @@ libsystemd_network_la_SOURCES = \ src/libsystemd-network/dhcp6-network.c \ src/libsystemd-network/dhcp6-option.c \ src/libsystemd-network/dhcp6-lease-internal.h \ - src/libsystemd-network/sd-dhcp6-lease.c + src/libsystemd-network/sd-dhcp6-lease.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c \ + src/libsystemd-network/lldp.h \ + src/libsystemd-network/lldp-tlv.h \ + src/libsystemd-network/lldp-tlv.c \ + src/libsystemd-network/lldp-network.h \ + src/libsystemd-network/lldp-network.c \ + src/libsystemd-network/lldp-port.h \ + src/libsystemd-network/lldp-port.c \ + src/libsystemd-network/lldp-internal.h \ + src/libsystemd-network/lldp-internal.c \ + src/libsystemd-network/lldp-util.h \ + src/libsystemd-network/sd-lldp.c libsystemd_network_la_LIBADD = \ libudev-internal.la \ @@ -3113,7 +3269,9 @@ test_icmp6_rs_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/systemd/sd-icmp6-nd.h \ src/libsystemd-network/dhcp6-internal.h \ - src/libsystemd-network/test-icmp6-rs.c + src/libsystemd-network/test-icmp6-rs.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c test_icmp6_rs_LDADD = \ libsystemd-network.la \ @@ -3123,20 +3281,34 @@ test_icmp6_rs_LDADD = \ test_dhcp6_client_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/libsystemd-network/dhcp6-internal.h \ - src/libsystemd-network/test-dhcp6-client.c + src/libsystemd-network/test-dhcp6-client.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c test_dhcp6_client_LDADD = \ libsystemd-network.la \ libsystemd-internal.la \ libsystemd-shared.la +test_lldp_SOURCES = \ + src/libsystemd-network/lldp.h \ + src/libsystemd-network/lldp-tlv.h \ + src/libsystemd-network/lldp-tlv.c \ + src/libsystemd-network/test-lldp.c + +test_lldp_LDADD = \ + libsystemd-network.la \ + libsystemd-internal.la \ + libsystemd-shared.la + tests += \ test-dhcp-option \ test-dhcp-client \ test-dhcp-server \ test-ipv4ll \ test-icmp6-rs \ - test-dhcp6-client + test-dhcp6-client \ + test-lldp manual_tests += \ test-pppoe @@ -3155,7 +3327,7 @@ noinst_PROGRAMS += \ systemd-subterm dist_pkgdata_DATA += \ - src/libsystemd-terminal/unifont-glyph-array.bin + src/libsystemd-terminal/unifont-glyph-array.bin nodist_userunit_DATA += \ units/user/systemd-consoled.service @@ -3163,15 +3335,15 @@ nodist_userunit_DATA += \ USER_DEFAULT_TARGET_WANTS += \ systemd-consoled.service -EXTRA_DIST += \ - units/user/systemd-consoled.service.in - tests += \ test-term-page \ test-term-parser \ test-unifont endif +EXTRA_DIST += \ + units/user/systemd-consoled.service.in + libsystemd_terminal_la_CFLAGS = \ $(AM_CFLAGS) \ $(TERMINAL_CFLAGS) @@ -3283,12 +3455,8 @@ test_unifont_LDADD = \ libsystemd-internal.la \ libsystemd-shared.la -.PHONY: update-unifont -update-unifont: tools/compile-unifont.py - $(AM_V_GEN)$(PYTHON) $< \ - <$(top_srcdir)/src/libsystemd-terminal/unifont.hex \ - >$(top_srcdir)/src/libsystemd-terminal/unifont-glyph-array.bin - @echo "unifont-glyph-array.bin has been regenerated" +src/libsystemd-terminal/unifont-glyph-array.bin: tools/compile-unifont.py $(UNIFONT) + $(AM_V_GEN)$(PYTHON) $< <$(UNIFONT) >$@ # ------------------------------------------------------------------------------ if ENABLE_GTK_DOC @@ -3316,7 +3484,6 @@ libudev_la_SOURCES =\ src/libudev/libudev-enumerate.c \ src/libudev/libudev-monitor.c \ src/libudev/libudev-queue.c \ - src/libudev/libudev-hwdb-def.h \ src/libudev/libudev-hwdb.c libudev_la_CFLAGS = \ @@ -3375,8 +3542,7 @@ libudev_internal_la_CFLAGS = \ # ------------------------------------------------------------------------------ INSTALL_DIRS += \ - $(sysconfdir)/udev/rules.d \ - $(sysconfdir)/udev/hwdb.d + $(sysconfdir)/udev/rules.d dist_network_DATA = \ network/99-default.link \ @@ -3388,13 +3554,14 @@ dist_udevrules_DATA += \ rules/50-udev-default.rules \ rules/60-drm.rules \ rules/60-keyboard.rules \ - rules/70-mouse.rules \ rules/60-persistent-storage-tape.rules \ rules/60-persistent-serial.rules \ rules/60-persistent-input.rules \ rules/60-persistent-alsa.rules \ rules/60-persistent-storage.rules \ rules/64-btrfs.rules \ + rules/70-mouse.rules \ + rules/70-touchpad.rules \ rules/75-net-description.rules \ rules/75-tty-description.rules \ rules/78-sound-card.rules \ @@ -3404,20 +3571,6 @@ dist_udevrules_DATA += \ nodist_udevrules_DATA += \ rules/99-systemd.rules -dist_udevhwdb_DATA = \ - hwdb/20-pci-vendor-model.hwdb \ - hwdb/20-pci-classes.hwdb \ - hwdb/20-usb-vendor-model.hwdb \ - hwdb/20-usb-classes.hwdb \ - hwdb/20-sdio-vendor-model.hwdb \ - hwdb/20-sdio-classes.hwdb \ - hwdb/20-bluetooth-vendor-product.hwdb \ - hwdb/20-acpi-vendor.hwdb \ - hwdb/20-OUI.hwdb \ - hwdb/20-net-ifname.hwdb \ - hwdb/60-keyboard.hwdb \ - hwdb/70-mouse.hwdb - udevconfdir = $(sysconfdir)/udev dist_udevconf_DATA = \ src/udev/udev.conf @@ -3437,14 +3590,12 @@ CLEANFILES += \ EXTRA_DIST += \ units/systemd-udevd.service.in \ units/systemd-udev-trigger.service.in \ - units/systemd-udev-settle.service.in \ - units/systemd-udev-hwdb-update.service.in + units/systemd-udev-settle.service.in CLEANFILES += \ units/systemd-udevd.service \ units/systemd-udev-trigger.service \ - units/systemd-udev-settle.service \ - units/systemd-udev-hwdb-update.service + units/systemd-udev-settle.service SOCKETS_TARGET_WANTS += \ systemd-udevd-control.socket \ @@ -3452,8 +3603,7 @@ SOCKETS_TARGET_WANTS += \ SYSINIT_TARGET_WANTS += \ systemd-udevd.service \ - systemd-udev-trigger.service \ - systemd-udev-hwdb-update.service + systemd-udev-trigger.service rootbin_PROGRAMS += \ udevadm @@ -3574,21 +3724,70 @@ udevadm_SOURCES = \ udevadm_LDADD = \ libudev-core.la +# ------------------------------------------------------------------------------ +if ENABLE_HWDB +INSTALL_DIRS += \ + $(sysconfdir)/udev/hwdb.d + +systemd_hwdb_SOURCES = \ + src/libsystemd/sd-hwdb/hwdb-internal.h \ + src/hwdb/hwdb.c + +systemd_hwdb_LDADD = \ + libsystemd-shared.la \ + libsystemd-internal.la \ + libudev-internal.la + +rootbin_PROGRAMS += \ + systemd-hwdb + +dist_udevhwdb_DATA = \ + hwdb/20-pci-vendor-model.hwdb \ + hwdb/20-pci-classes.hwdb \ + hwdb/20-usb-vendor-model.hwdb \ + hwdb/20-usb-classes.hwdb \ + hwdb/20-sdio-vendor-model.hwdb \ + hwdb/20-sdio-classes.hwdb \ + hwdb/20-bluetooth-vendor-product.hwdb \ + hwdb/20-acpi-vendor.hwdb \ + hwdb/20-OUI.hwdb \ + hwdb/20-net-ifname.hwdb \ + hwdb/60-keyboard.hwdb \ + hwdb/70-mouse.hwdb \ + hwdb/70-touchpad.hwdb + +EXTRA_DIST += \ + units/systemd-hwdb-update.service.in + +CLEANFILES += \ + units/systemd-hwdb-update.service + +SYSINIT_TARGET_WANTS += \ + systemd-hwdb-update.service + # Update hwdb on installation. Do not bother if installing # in DESTDIR, since this is likely for packaging purposes. hwdb-update-hook: - -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update + -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update INSTALL_DATA_HOOKS += \ hwdb-update-hook hwdb-remove-hook: -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin +endif # ------------------------------------------------------------------------------ TESTS += \ test/udev-test.pl \ - test/rules-test.sh + $(NULL) + +if HAVE_PYTHON +TESTS += \ + test/rule-syntax-check.py \ + test/sysv-generator-test.py \ + $(NULL) +endif manual_tests += \ test-libudev \ @@ -3600,7 +3799,8 @@ test_libudev_SOURCES = \ test_libudev_LDADD = \ libsystemd-label.la \ libudev-internal.la \ - libsystemd-shared.la + libsystemd-shared.la \ + libsystemd-internal.la test_udev_SOURCES = \ src/test/test-udev.c @@ -3631,8 +3831,10 @@ DISTCLEAN_LOCAL_HOOKS += test-sys-distclean EXTRA_DIST += \ test/sys.tar.xz \ test/udev-test.pl \ - test/rules-test.sh \ - test/rule-syntax-check.py + test/rule-syntax-check.py \ + test/sysv-generator-test.py \ + $(NULL) + # ------------------------------------------------------------------------------ ata_id_SOURCES = \ @@ -3692,7 +3894,8 @@ v4l_id_SOURCES = \ src/udev/v4l_id/v4l_id.c v4l_id_LDADD = \ - libudev-internal.la + libudev-internal.la \ + libsystemd-shared.la udevlibexec_PROGRAMS += \ v4l_id @@ -3705,7 +3908,7 @@ accelerometer_SOURCES = \ src/udev/accelerometer/accelerometer.c accelerometer_LDADD = \ - libudev-internal.la -lm \ + libudev-internal.la \ libsystemd-shared.la udevlibexec_PROGRAMS += \ @@ -4252,16 +4455,15 @@ libsystemd_journal_internal_la_SOURCES = \ src/journal/catalog.c \ src/journal/catalog.h \ src/journal/mmap-cache.c \ - src/journal/mmap-cache.h + src/journal/mmap-cache.h \ + src/journal/compress.c # using _CFLAGS = in the conditional below would suppress AM_CFLAGS libsystemd_journal_internal_la_CFLAGS = \ $(AM_CFLAGS) -libsystemd_journal_internal_la_LIBADD = - -libsystemd_journal_internal_la_SOURCES += \ - src/journal/compress.c +libsystemd_journal_internal_la_LIBADD = \ + libsystemd-label.la if HAVE_XZ libsystemd_journal_internal_la_CFLAGS += \ @@ -4321,6 +4523,7 @@ dist_catalog_DATA = \ catalog/systemd.fr.catalog \ catalog/systemd.it.catalog \ catalog/systemd.pl.catalog \ + catalog/systemd.pt_BR.catalog \ catalog/systemd.ru.catalog \ catalog/systemd.catalog @@ -4788,10 +4991,8 @@ BUSNAMES_TARGET_WANTS += \ org.freedesktop.locale1.busname dist_pkgdata_DATA += \ - src/locale/kbd-model-map - -dist_noinst_SCRIPT = \ - src/locale/generate-kbd-model-map + src/locale/kbd-model-map \ + src/locale/language-fallback-map localectl_SOURCES = \ src/locale/localectl.c @@ -4901,8 +5102,7 @@ systemd_timesyncd_LDADD = \ libsystemd-network.la \ libsystemd-label.la \ libsystemd-internal.la \ - libsystemd-shared.la \ - -lm + libsystemd-shared.la rootlibexec_PROGRAMS += \ systemd-timesyncd @@ -4962,10 +5162,13 @@ rootlibexec_PROGRAMS += \ systemd-machined libsystemd_machine_core_la_SOURCES = \ - src/machine/machined-dbus.c \ src/machine/machine.c \ src/machine/machine.h \ - src/machine/machine-dbus.c + src/machine/machined-dbus.c \ + src/machine/machine-dbus.c \ + src/machine/machine-dbus.h \ + src/machine/image-dbus.c \ + src/machine/image-dbus.h libsystemd_machine_core_la_LIBADD = \ libsystemd-label.la \ @@ -4981,6 +5184,8 @@ machinectl_SOURCES = \ machinectl_LDADD = \ libsystemd-internal.la \ + libsystemd-logs.la \ + libsystemd-journal-internal.la \ libsystemd-shared.la rootbin_PROGRAMS += \ @@ -5013,6 +5218,12 @@ dist_dbussystemservice_DATA += \ dist_dbuspolicy_DATA += \ src/machine/org.freedesktop.machine1.conf +polkitpolicy_files += \ + src/machine/org.freedesktop.machine1.policy + +polkitpolicy_in_files += \ + src/machine/org.freedesktop.machine1.policy.in + dist_zshcompletion_DATA += \ shell-completion/zsh/_machinectl \ shell-completion/zsh/_sd_machines @@ -5045,6 +5256,126 @@ libnss_mymachines_la_LIBADD = \ lib_LTLIBRARIES += \ libnss_mymachines.la + +endif + +# ------------------------------------------------------------------------------ +if ENABLE_IMPORTD + +if HAVE_LIBCURL +if HAVE_XZ +if HAVE_ZLIB +if HAVE_BZIP2 +if HAVE_GCRYPT + +rootlibexec_PROGRAMS += \ + systemd-importd \ + systemd-pull + +systemd_importd_SOURCES = \ + src/import/importd.c + +systemd_importd_CFLAGS = \ + $(AM_CFLAGS) \ + -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\" + +systemd_importd_LDADD = \ + libsystemd-internal.la \ + libsystemd-label.la \ + libsystemd-shared.la + +systemd_pull_SOURCES = \ + src/import/pull.c \ + src/import/import-raw.c \ + src/import/import-raw.h \ + src/import/import-tar.c \ + src/import/import-tar.h \ + src/import/import-dkr.c \ + src/import/import-dkr.h \ + src/import/import-job.c \ + src/import/import-job.h \ + src/import/import-common.c \ + src/import/import-common.h \ + src/import/curl-util.c \ + src/import/curl-util.h \ + src/import/aufs-util.c \ + src/import/aufs-util.h \ + src/import/qcow2-util.c \ + src/import/qcow2-util.h + +systemd_pull_CFLAGS = \ + $(AM_CFLAGS) \ + $(LIBCURL_CFLAGS) \ + $(XZ_CFLAGS) \ + $(ZLIB_CFLAGS) \ + $(GCRYPT_CFLAGS) \ + -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \ + -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\" + +systemd_pull_LDADD = \ + libsystemd-internal.la \ + libsystemd-label.la \ + libsystemd-shared.la \ + $(LIBCURL_LIBS) \ + $(XZ_LIBS) \ + $(ZLIB_LIBS) \ + -lbz2 \ + $(GCRYPT_LIBS) + +dist_rootlibexec_DATA = \ + src/import/import-pubring.gpg + +nodist_systemunit_DATA += \ + units/systemd-importd.service + +EXTRA_DIST += \ + units/systemd-importd.service.in + +dist_systemunit_DATA_busnames += \ + units/org.freedesktop.import1.busname + +BUSNAMES_TARGET_WANTS += \ + org.freedesktop.import1.busname + +SYSTEM_UNIT_ALIASES += \ + systemd-importd.service dbus-org.freedesktop.import1.service + +dist_dbussystemservice_DATA += \ + src/import/org.freedesktop.import1.service + +dist_dbuspolicy_DATA += \ + src/import/org.freedesktop.import1.conf + +polkitpolicy_files += \ + src/import/org.freedesktop.import1.policy + +polkitpolicy_in_files += \ + src/import/org.freedesktop.import1.policy.in + +manual_tests += \ + test-qcow2 + +test_qcow2_SOURCES = \ + src/import/test-qcow2.c \ + src/import/qcow2-util.c \ + src/import/qcow2-util.h + +test_qcow2_CFLAGS = \ + $(AM_CFLAGS) \ + $(ZLIB_CFLAGS) + +test_qcow2_LDADD = \ + libsystemd-internal.la \ + libsystemd-label.la \ + libsystemd-shared.la \ + $(ZLIB_LIBS) + +endif +endif +endif +endif +endif + endif # ------------------------------------------------------------------------------ @@ -5104,7 +5435,6 @@ systemd_resolved_LDADD = \ libsystemd-label.la \ libsystemd-internal.la \ libsystemd-shared.la \ - -lm \ $(LIBIDN_LIBS) rootlibexec_PROGRAMS += \ @@ -5172,8 +5502,8 @@ libnss_resolve_la_LDFLAGS = \ -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym libnss_resolve_la_LIBADD = \ - libsystemd-shared.la \ - libsystemd-internal.la + libsystemd-internal.la \ + libsystemd-shared.la lib_LTLIBRARIES += \ libnss_resolve.la @@ -5198,7 +5528,6 @@ systemd_resolve_host_SOURCES = \ systemd_resolve_host_LDADD = \ libsystemd-internal.la \ libsystemd-shared.la \ - -lm \ $(LIBIDN_LIBS) rootlibexec_PROGRAMS += \ @@ -5217,6 +5546,11 @@ systemd_networkd_SOURCES = \ systemd_networkd_LDADD = \ libsystemd-networkd-core.la +if HAVE_LIBIPTC +systemd_networkd_LDADD += \ + libsystemd-fw.la +endif + noinst_LTLIBRARIES += \ libsystemd-networkd-core.la @@ -5233,6 +5567,7 @@ libsystemd_networkd_core_la_SOURCES = \ src/network/networkd-netdev-vxlan.h \ src/network/networkd-netdev-vlan.h \ src/network/networkd-netdev-macvlan.h \ + src/network/networkd-netdev-ipvlan.h \ src/network/networkd-netdev-dummy.h \ src/network/networkd-netdev-tuntap.h \ src/network/networkd-netdev-bond.h \ @@ -5243,18 +5578,23 @@ libsystemd_networkd_core_la_SOURCES = \ src/network/networkd-netdev-vxlan.c \ src/network/networkd-netdev-vlan.c \ src/network/networkd-netdev-macvlan.c \ + src/network/networkd-netdev-ipvlan.c \ src/network/networkd-netdev-dummy.c \ src/network/networkd-netdev-tuntap.c \ src/network/networkd-netdev-bond.c \ src/network/networkd-netdev-bridge.c \ src/network/networkd-link.c \ + src/network/networkd-link-bus.c \ src/network/networkd-ipv4ll.c \ src/network/networkd-dhcp4.c \ src/network/networkd-dhcp6.c \ src/network/networkd-network.c \ + src/network/networkd-network-bus.c \ src/network/networkd-address.c \ src/network/networkd-route.c \ src/network/networkd-manager.c \ + src/network/networkd-manager-bus.c \ + src/network/networkd-fdb.c \ src/network/networkd-address-pool.c nodist_libsystemd_networkd_core_la_SOURCES = \ @@ -5306,6 +5646,11 @@ test_network_SOURCES = \ test_network_LDADD = \ libsystemd-networkd-core.la +if HAVE_LIBIPTC +test_network_LDADD += \ + libsystemd-fw.la +endif + test_network_tables_SOURCES = \ src/network/test-network-tables.c \ src/shared/test-tables.h @@ -5314,18 +5659,42 @@ test_network_tables_LDADD = \ libsystemd-networkd-core.la \ libudev-core.la +if HAVE_LIBIPTC +test_network_tables_LDADD += \ + libsystemd-fw.la +endif + tests += \ test-network \ test-network-tables +dist_systemunit_DATA += \ + units/systemd-networkd.socket + nodist_systemunit_DATA += \ units/systemd-networkd.service \ units/systemd-networkd-wait-online.service +dist_systemunit_DATA_busnames += \ + units/org.freedesktop.network1.busname + +dist_dbussystemservice_DATA += \ + src/network/org.freedesktop.network1.service + +dist_dbuspolicy_DATA += \ + src/network/org.freedesktop.network1.conf + GENERAL_ALIASES += \ + $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \ $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \ $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service +SYSTEM_UNIT_ALIASES += \ + systemd-networkd.service dbus-org.freedesktop.network1.service + +BUSNAMES_TARGET_WANTS += \ + org.freedesktop.network1.busname + EXTRA_DIST += \ src/network/networkd-network-gperf.gperf \ src/network/networkd-netdev-gperf.gperf \ @@ -5402,10 +5771,13 @@ rootlibexec_PROGRAMS += \ loginctl_SOURCES = \ src/login/loginctl.c \ + src/login/sysfs-show.h \ src/login/sysfs-show.c loginctl_LDADD = \ libsystemd-internal.la \ + libsystemd-logs.la \ + libsystemd-journal-internal.la \ libudev-internal.la \ libsystemd-shared.la @@ -5867,6 +6239,7 @@ substitutions = \ '|rootprefix=$(rootprefix)|' \ '|udevlibexecdir=$(udevlibexecdir)|' \ '|SUSHELL=$(SUSHELL)|' \ + '|SULOGIN=$(SULOGIN)|' \ '|DEBUGTTY=$(DEBUGTTY)|' \ '|KILL=$(KILL)|' \ '|KMOD=$(KMOD)|' \ @@ -5949,7 +6322,7 @@ units/%: units/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@ -units/user/%: units/%.m4 +units/user/%: units/user/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@ @@ -5966,7 +6339,6 @@ EXTRA_DIST += \ CLEANFILES += \ $(nodist_systemunit_DATA) \ $(nodist_userunit_DATA) \ - $(pkgconfigdata_DATA) \ $(pkgconfiglib_DATA) \ $(nodist_polkitpolicy_DATA) @@ -6207,7 +6579,7 @@ endif # # Require python when making dist # -.PHONY: dist-check-python +.PHONY: dist-check-python dist-check-compat-libs dist-check-help dist-check-python: if !HAVE_PYTHON @echo "*** python and python-lxml module must be installed and enabled in order to make dist" @@ -6220,6 +6592,14 @@ if !ENABLE_COMPAT_LIBS @false endif +dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS) + for i in $(abspath $^); do \ + if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \ + echo "$(basename $$i) --help output is too wide:"; \ + $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \ + exit 1; \ + fi; done + dist: dist-check-python dist-check-compat-libs # check "broken" platforms limited toolchains for link breakage before we release @@ -6387,3 +6767,9 @@ git-contrib: EXTRA_DIST += \ tools/gdb-sd_dump_hashmaps.py + +list-keys: + gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys + +add-key: + gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import - diff --git a/Makefile.in b/Makefile.in index 3b3503087..49f9f2b96 100644 --- a/Makefile.in +++ b/Makefile.in @@ -105,11 +105,11 @@ build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = @ENABLE_TESTS_FALSE@noinst_PROGRAMS = $(am__EXEEXT_6) -@ENABLE_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_11) $(am__EXEEXT_18) \ +@ENABLE_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_13) $(am__EXEEXT_20) \ @ENABLE_TESTS_TRUE@ $(am__EXEEXT_6) -@ENABLE_TESTS_FALSE@TESTS = test/udev-test.pl test/rules-test.sh -@ENABLE_TESTS_TRUE@TESTS = $(am__EXEEXT_18) test/udev-test.pl \ -@ENABLE_TESTS_TRUE@ test/rules-test.sh +@ENABLE_TESTS_FALSE@TESTS = test/udev-test.pl $(am__EXEEXT_59) +@ENABLE_TESTS_TRUE@TESTS = $(am__EXEEXT_20) test/udev-test.pl \ +@ENABLE_TESTS_TRUE@ $(am__EXEEXT_59) udevlibexec_PROGRAMS = ata_id$(EXEEXT) cdrom_id$(EXEEXT) \ collect$(EXEEXT) scsi_id$(EXEEXT) v4l_id$(EXEEXT) \ accelerometer$(EXEEXT) mtd_probe$(EXEEXT) @@ -120,15 +120,16 @@ rootbin_PROGRAMS = systemctl$(EXEEXT) systemd-notify$(EXEEXT) \ systemd-ask-password$(EXEEXT) \ systemd-tty-ask-password-agent$(EXEEXT) \ systemd-machine-id-setup$(EXEEXT) systemd-escape$(EXEEXT) \ - $(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \ - udevadm$(EXEEXT) journalctl$(EXEEXT) $(am__EXEEXT_22) \ - $(am__EXEEXT_23) $(am__EXEEXT_24) + $(am__EXEEXT_21) $(am__EXEEXT_22) $(am__EXEEXT_23) \ + udevadm$(EXEEXT) $(am__EXEEXT_24) journalctl$(EXEEXT) \ + $(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) bin_PROGRAMS = systemd-cgls$(EXEEXT) systemd-cgtop$(EXEEXT) \ systemd-nspawn$(EXEEXT) systemd-detect-virt$(EXEEXT) \ systemd-delta$(EXEEXT) systemd-analyze$(EXEEXT) \ - systemd-run$(EXEEXT) systemd-path$(EXEEXT) $(am__EXEEXT_1) \ - busctl$(EXEEXT) systemd-cat$(EXEEXT) $(am__EXEEXT_2) \ - $(am__EXEEXT_3) $(am__EXEEXT_4) $(am__EXEEXT_5) + systemd-run$(EXEEXT) systemd-stdio-bridge$(EXEEXT) \ + systemd-path$(EXEEXT) $(am__EXEEXT_1) busctl$(EXEEXT) \ + systemd-cat$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \ + $(am__EXEEXT_4) $(am__EXEEXT_5) rootlibexec_PROGRAMS = systemd$(EXEEXT) systemd-cgroups-agent$(EXEEXT) \ systemd-initctl$(EXEEXT) systemd-shutdownd$(EXEEXT) \ systemd-shutdown$(EXEEXT) systemd-remount-fs$(EXEEXT) \ @@ -136,25 +137,25 @@ rootlibexec_PROGRAMS = systemd$(EXEEXT) systemd-cgroups-agent$(EXEEXT) \ systemd-machine-id-commit$(EXEEXT) systemd-ac-power$(EXEEXT) \ systemd-sysctl$(EXEEXT) systemd-sleep$(EXEEXT) \ systemd-bus-proxyd$(EXEEXT) systemd-socket-proxyd$(EXEEXT) \ - systemd-update-done$(EXEEXT) $(am__EXEEXT_25) $(am__EXEEXT_26) \ - $(am__EXEEXT_27) $(am__EXEEXT_28) systemd-udevd$(EXEEXT) \ - systemd-activate$(EXEEXT) $(am__EXEEXT_29) $(am__EXEEXT_30) \ - systemd-journald$(EXEEXT) $(am__EXEEXT_31) $(am__EXEEXT_32) \ - $(am__EXEEXT_33) $(am__EXEEXT_34) $(am__EXEEXT_35) \ + systemd-update-done$(EXEEXT) $(am__EXEEXT_28) $(am__EXEEXT_29) \ + $(am__EXEEXT_30) $(am__EXEEXT_31) systemd-udevd$(EXEEXT) \ + systemd-activate$(EXEEXT) $(am__EXEEXT_32) $(am__EXEEXT_33) \ + systemd-journald$(EXEEXT) $(am__EXEEXT_34) $(am__EXEEXT_35) \ $(am__EXEEXT_36) $(am__EXEEXT_37) $(am__EXEEXT_38) \ $(am__EXEEXT_39) $(am__EXEEXT_40) $(am__EXEEXT_41) \ $(am__EXEEXT_42) $(am__EXEEXT_43) $(am__EXEEXT_44) \ $(am__EXEEXT_45) $(am__EXEEXT_46) $(am__EXEEXT_47) \ - $(am__EXEEXT_48) + $(am__EXEEXT_48) $(am__EXEEXT_49) $(am__EXEEXT_50) \ + $(am__EXEEXT_51) $(am__EXEEXT_52) @HAVE_UTMP_TRUE@am__append_2 = \ @HAVE_UTMP_TRUE@ systemd-update-utmp systemgenerator_PROGRAMS = systemd-getty-generator$(EXEEXT) \ systemd-fstab-generator$(EXEEXT) \ systemd-system-update-generator$(EXEEXT) \ - systemd-debug-generator$(EXEEXT) $(am__EXEEXT_49) \ - $(am__EXEEXT_50) $(am__EXEEXT_51) $(am__EXEEXT_52) \ - $(am__EXEEXT_53) $(am__EXEEXT_54) + systemd-debug-generator$(EXEEXT) $(am__EXEEXT_53) \ + $(am__EXEEXT_54) $(am__EXEEXT_55) $(am__EXEEXT_56) \ + $(am__EXEEXT_57) $(am__EXEEXT_58) @ENABLE_KDBUS_TRUE@am__append_3 = \ @ENABLE_KDBUS_TRUE@ $(dist_systemunit_DATA_busnames) @@ -174,6 +175,7 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(srcdir)/config.h.in \ $(dist_bin_SCRIPTS) $(dist_kernelinstall_SCRIPTS) \ + $(am__dist_xinitrc_SCRIPTS_DIST) \ $(top_srcdir)/build-aux/depcomp \ $(am__dist_pkgpyexec_PYTHON_DIST) \ $(top_srcdir)/build-aux/py-compile \ @@ -184,10 +186,10 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ $(am__dist_gatewayddocumentroot_DATA_DIST) \ $(dist_network_DATA) $(am__dist_pamconf_DATA_DIST) \ $(am__dist_pkgdata_DATA_DIST) $(am__dist_pkgsysconf_DATA_DIST) \ - $(dist_sysctl_DATA) $(dist_systempreset_DATA) \ - $(am__dist_systemunit_DATA_DIST) \ + $(am__dist_rootlibexec_DATA_DIST) $(dist_sysctl_DATA) \ + $(dist_systempreset_DATA) $(am__dist_systemunit_DATA_DIST) \ $(am__dist_sysusers_DATA_DIST) $(am__dist_tmpfiles_DATA_DIST) \ - $(dist_udevconf_DATA) $(dist_udevhwdb_DATA) \ + $(dist_udevconf_DATA) $(am__dist_udevhwdb_DATA_DIST) \ $(am__dist_udevrules_DATA_DIST) $(am__dist_userunit_DATA_DIST) \ $(am__dist_zshcompletion_DATA_DIST) $(include_HEADERS) \ $(am__libgudev_include_HEADERS_DIST) \ @@ -236,14 +238,27 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @ENABLE_EFI_TRUE@am__append_16 = \ @ENABLE_EFI_TRUE@ # -@ENABLE_HOSTNAMED_TRUE@am__append_17 = \ +@ENABLE_FIRSTBOOT_TRUE@am__append_17 = \ +@ENABLE_FIRSTBOOT_TRUE@ man/systemd-firstboot.1 + +@ENABLE_FIRSTBOOT_TRUE@am__append_18 = \ +@ENABLE_FIRSTBOOT_TRUE@ man/systemd-firstboot.service.1 + +@ENABLE_HOSTNAMED_TRUE@am__append_19 = \ @ENABLE_HOSTNAMED_TRUE@ man/hostnamectl.1 \ @ENABLE_HOSTNAMED_TRUE@ man/systemd-hostnamed.service.8 -@ENABLE_HOSTNAMED_TRUE@am__append_18 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_20 = \ @ENABLE_HOSTNAMED_TRUE@ man/systemd-hostnamed.8 -@ENABLE_KDBUS_TRUE@am__append_19 = \ +@ENABLE_HWDB_TRUE@am__append_21 = \ +@ENABLE_HWDB_TRUE@ man/hwdb.7 \ +@ENABLE_HWDB_TRUE@ man/systemd-hwdb.8 + +@ENABLE_HWDB_TRUE@am__append_22 = \ +@ENABLE_HWDB_TRUE@ # + +@ENABLE_KDBUS_TRUE@am__append_23 = \ @ENABLE_KDBUS_TRUE@ man/sd_bus_creds_get_pid.3 \ @ENABLE_KDBUS_TRUE@ man/sd_bus_creds_new_from_pid.3 \ @ENABLE_KDBUS_TRUE@ man/sd_bus_error.3 \ @@ -269,7 +284,7 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @ENABLE_KDBUS_TRUE@ man/systemd-bus-proxyd.8 \ @ENABLE_KDBUS_TRUE@ man/systemd-bus-proxyd@.service.8 -@ENABLE_KDBUS_TRUE@am__append_20 = \ +@ENABLE_KDBUS_TRUE@am__append_24 = \ @ENABLE_KDBUS_TRUE@ man/sd_bus_creds_get_audit_login_uid.3 \ @ENABLE_KDBUS_TRUE@ man/sd_bus_creds_get_audit_session_id.3 \ @ENABLE_KDBUS_TRUE@ man/sd_bus_creds_get_cgroup.3 \ @@ -339,118 +354,120 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @ENABLE_KDBUS_TRUE@ man/sd_event_unref.3 \ @ENABLE_KDBUS_TRUE@ man/systemd-bus-proxyd.socket.8 -@ENABLE_LOCALED_TRUE@am__append_21 = \ +@ENABLE_LOCALED_TRUE@am__append_25 = \ @ENABLE_LOCALED_TRUE@ man/localectl.1 \ @ENABLE_LOCALED_TRUE@ man/systemd-localed.service.8 -@ENABLE_LOCALED_TRUE@am__append_22 = \ +@ENABLE_LOCALED_TRUE@am__append_26 = \ @ENABLE_LOCALED_TRUE@ man/systemd-localed.8 -@ENABLE_LOGIND_TRUE@am__append_23 = \ +@ENABLE_LOGIND_TRUE@am__append_27 = \ @ENABLE_LOGIND_TRUE@ man/loginctl.1 \ @ENABLE_LOGIND_TRUE@ man/logind.conf.5 \ @ENABLE_LOGIND_TRUE@ man/systemd-logind.service.8 -@ENABLE_LOGIND_TRUE@am__append_24 = \ +@ENABLE_LOGIND_TRUE@am__append_28 = \ @ENABLE_LOGIND_TRUE@ man/logind.conf.d.5 \ @ENABLE_LOGIND_TRUE@ man/systemd-logind.8 -@ENABLE_MACHINED_TRUE@am__append_25 = \ +@ENABLE_MACHINED_TRUE@am__append_29 = \ @ENABLE_MACHINED_TRUE@ man/machinectl.1 \ +@ENABLE_MACHINED_TRUE@ man/nss-mymachines.8 \ @ENABLE_MACHINED_TRUE@ man/systemd-machined.service.8 -@ENABLE_MACHINED_TRUE@am__append_26 = \ +@ENABLE_MACHINED_TRUE@am__append_30 = \ +@ENABLE_MACHINED_TRUE@ man/libnss_mymachines.so.2.8 \ @ENABLE_MACHINED_TRUE@ man/systemd-machined.8 -@ENABLE_NETWORKD_TRUE@am__append_27 = \ +@ENABLE_NETWORKD_TRUE@am__append_31 = \ @ENABLE_NETWORKD_TRUE@ man/systemd-networkd-wait-online.service.8 \ @ENABLE_NETWORKD_TRUE@ man/systemd-networkd.service.8 \ @ENABLE_NETWORKD_TRUE@ man/systemd.netdev.5 \ @ENABLE_NETWORKD_TRUE@ man/systemd.network.5 -@ENABLE_NETWORKD_TRUE@am__append_28 = \ +@ENABLE_NETWORKD_TRUE@am__append_32 = \ @ENABLE_NETWORKD_TRUE@ man/systemd-networkd-wait-online.8 \ @ENABLE_NETWORKD_TRUE@ man/systemd-networkd.8 -@ENABLE_QUOTACHECK_TRUE@am__append_29 = \ +@ENABLE_QUOTACHECK_TRUE@am__append_33 = \ @ENABLE_QUOTACHECK_TRUE@ man/systemd-quotacheck.service.8 -@ENABLE_QUOTACHECK_TRUE@am__append_30 = \ +@ENABLE_QUOTACHECK_TRUE@am__append_34 = \ @ENABLE_QUOTACHECK_TRUE@ man/systemd-quotacheck.8 -@ENABLE_RANDOMSEED_TRUE@am__append_31 = \ +@ENABLE_RANDOMSEED_TRUE@am__append_35 = \ @ENABLE_RANDOMSEED_TRUE@ man/systemd-random-seed.service.8 -@ENABLE_RANDOMSEED_TRUE@am__append_32 = \ +@ENABLE_RANDOMSEED_TRUE@am__append_36 = \ @ENABLE_RANDOMSEED_TRUE@ man/systemd-random-seed.8 -@ENABLE_RESOLVED_TRUE@am__append_33 = \ +@ENABLE_RESOLVED_TRUE@am__append_37 = \ @ENABLE_RESOLVED_TRUE@ man/resolved.conf.5 \ @ENABLE_RESOLVED_TRUE@ man/systemd-resolved.service.8 -@ENABLE_RESOLVED_TRUE@am__append_34 = \ +@ENABLE_RESOLVED_TRUE@am__append_38 = \ @ENABLE_RESOLVED_TRUE@ man/resolved.conf.d.5 \ @ENABLE_RESOLVED_TRUE@ man/systemd-resolved.8 -@ENABLE_RFKILL_TRUE@am__append_35 = \ +@ENABLE_RFKILL_TRUE@am__append_39 = \ @ENABLE_RFKILL_TRUE@ man/systemd-rfkill@.service.8 -@ENABLE_RFKILL_TRUE@am__append_36 = \ +@ENABLE_RFKILL_TRUE@am__append_40 = \ @ENABLE_RFKILL_TRUE@ man/systemd-rfkill.8 -@ENABLE_TIMEDATED_TRUE@am__append_37 = \ +@ENABLE_TIMEDATED_TRUE@am__append_41 = \ @ENABLE_TIMEDATED_TRUE@ man/systemd-timedated.service.8 \ @ENABLE_TIMEDATED_TRUE@ man/timedatectl.1 -@ENABLE_TIMEDATED_TRUE@am__append_38 = \ +@ENABLE_TIMEDATED_TRUE@am__append_42 = \ @ENABLE_TIMEDATED_TRUE@ man/systemd-timedated.8 -@ENABLE_TIMESYNCD_TRUE@am__append_39 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_43 = \ @ENABLE_TIMESYNCD_TRUE@ man/systemd-timesyncd.service.8 \ @ENABLE_TIMESYNCD_TRUE@ man/timesyncd.conf.5 -@ENABLE_TIMESYNCD_TRUE@am__append_40 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_44 = \ @ENABLE_TIMESYNCD_TRUE@ man/systemd-timesyncd.8 \ @ENABLE_TIMESYNCD_TRUE@ man/timesyncd.conf.d.5 -@ENABLE_VCONSOLE_TRUE@am__append_41 = \ +@ENABLE_VCONSOLE_TRUE@am__append_45 = \ @ENABLE_VCONSOLE_TRUE@ man/systemd-vconsole-setup.service.8 \ @ENABLE_VCONSOLE_TRUE@ man/vconsole.conf.5 -@ENABLE_VCONSOLE_TRUE@am__append_42 = \ +@ENABLE_VCONSOLE_TRUE@am__append_46 = \ @ENABLE_VCONSOLE_TRUE@ man/systemd-vconsole-setup.8 -@HAVE_KMOD_TRUE@am__append_43 = \ +@HAVE_KMOD_TRUE@am__append_47 = \ @HAVE_KMOD_TRUE@ man/modules-load.d.5 \ @HAVE_KMOD_TRUE@ man/systemd-modules-load.service.8 -@HAVE_KMOD_TRUE@am__append_44 = \ +@HAVE_KMOD_TRUE@am__append_48 = \ @HAVE_KMOD_TRUE@ man/systemd-modules-load.8 -@HAVE_LIBCRYPTSETUP_TRUE@am__append_45 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_49 = \ @HAVE_LIBCRYPTSETUP_TRUE@ man/crypttab.5 \ @HAVE_LIBCRYPTSETUP_TRUE@ man/systemd-cryptsetup-generator.8 \ @HAVE_LIBCRYPTSETUP_TRUE@ man/systemd-cryptsetup@.service.8 -@HAVE_LIBCRYPTSETUP_TRUE@am__append_46 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_50 = \ @HAVE_LIBCRYPTSETUP_TRUE@ man/systemd-cryptsetup.8 -@HAVE_MICROHTTPD_TRUE@am__append_47 = \ +@HAVE_MICROHTTPD_TRUE@am__append_51 = \ @HAVE_MICROHTTPD_TRUE@ man/systemd-journal-gatewayd.service.8 \ @HAVE_MICROHTTPD_TRUE@ man/systemd-journal-remote.8 \ @HAVE_MICROHTTPD_TRUE@ man/systemd-journal-upload.8 -@HAVE_MICROHTTPD_TRUE@am__append_48 = \ +@HAVE_MICROHTTPD_TRUE@am__append_52 = \ @HAVE_MICROHTTPD_TRUE@ man/systemd-journal-gatewayd.8 \ @HAVE_MICROHTTPD_TRUE@ man/systemd-journal-gatewayd.socket.8 -@HAVE_MYHOSTNAME_TRUE@am__append_49 = \ +@HAVE_MYHOSTNAME_TRUE@am__append_53 = \ @HAVE_MYHOSTNAME_TRUE@ man/nss-myhostname.8 -@HAVE_MYHOSTNAME_TRUE@am__append_50 = \ -@HAVE_MYHOSTNAME_TRUE@ # +@HAVE_MYHOSTNAME_TRUE@am__append_54 = \ +@HAVE_MYHOSTNAME_TRUE@ man/libnss_myhostname.so.2.8 -@HAVE_PAM_TRUE@am__append_51 = \ +@HAVE_PAM_TRUE@am__append_55 = \ @HAVE_PAM_TRUE@ man/pam_systemd.8 \ @HAVE_PAM_TRUE@ man/sd-login.3 \ @HAVE_PAM_TRUE@ man/sd_get_seats.3 \ @@ -461,7 +478,7 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @HAVE_PAM_TRUE@ man/sd_uid_get_state.3 \ @HAVE_PAM_TRUE@ man/systemd-user-sessions.service.8 -@HAVE_PAM_TRUE@am__append_52 = \ +@HAVE_PAM_TRUE@am__append_56 = \ @HAVE_PAM_TRUE@ man/sd_get_machine_names.3 \ @HAVE_PAM_TRUE@ man/sd_get_sessions.3 \ @HAVE_PAM_TRUE@ man/sd_get_uids.3 \ @@ -505,214 +522,228 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @HAVE_PAM_TRUE@ man/sd_uid_is_on_seat.3 \ @HAVE_PAM_TRUE@ man/systemd-user-sessions.8 -@HAVE_PYTHON_TRUE@am__append_53 = \ +@HAVE_PYTHON_TRUE@am__append_57 = \ @HAVE_PYTHON_TRUE@ man/systemd.directives.7 \ @HAVE_PYTHON_TRUE@ man/systemd.index.7 -@HAVE_PYTHON_TRUE@am__append_54 = \ +@HAVE_PYTHON_TRUE@am__append_58 = \ @HAVE_PYTHON_TRUE@ # -@HAVE_SYSV_COMPAT_TRUE@am__append_55 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_59 = \ @HAVE_SYSV_COMPAT_TRUE@ man/systemd-sysv-generator.8 -@HAVE_SYSV_COMPAT_TRUE@am__append_56 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_60 = \ @HAVE_SYSV_COMPAT_TRUE@ # -@HAVE_UTMP_TRUE@am__append_57 = \ +@HAVE_UTMP_TRUE@am__append_61 = \ @HAVE_UTMP_TRUE@ man/runlevel.8 \ @HAVE_UTMP_TRUE@ man/systemd-update-utmp.service.8 -@HAVE_UTMP_TRUE@am__append_58 = \ +@HAVE_UTMP_TRUE@am__append_62 = \ @HAVE_UTMP_TRUE@ man/systemd-update-utmp-runlevel.service.8 \ @HAVE_UTMP_TRUE@ man/systemd-update-utmp.8 -@ENABLE_MANPAGES_TRUE@am__append_59 = $(HTML_FILES) $(HTML_ALIAS) \ +@ENABLE_MANPAGES_TRUE@am__append_63 = $(HTML_FILES) $(HTML_ALIAS) \ @ENABLE_MANPAGES_TRUE@ docs/html/man -@ENABLE_MANPAGES_TRUE@am__append_60 = $(man_MANS) $(HTML_FILES) \ +@ENABLE_MANPAGES_TRUE@am__append_64 = $(man_MANS) $(HTML_FILES) \ @ENABLE_MANPAGES_TRUE@ $(HTML_ALIAS) docs/html/man -@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_61 = \ +@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_65 = \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/index.html -@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_62 = \ +@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_66 = \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/index.html \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/systemd.index.xml \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/systemd.directives.xml -@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_63 = \ +@ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@am__append_67 = \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/systemd.index.xml \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/index.html \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/systemd.directives.xml \ @ENABLE_MANPAGES_TRUE@@HAVE_PYTHON_TRUE@ man/glib-event-glue.c -@HAVE_UTMP_TRUE@am__append_64 = \ +@HAVE_UTMP_TRUE@am__append_68 = \ @HAVE_UTMP_TRUE@ src/shared/utmp-wtmp.c # ----------------------------------------------------------------------------- -@ENABLE_LDCONFIG_TRUE@am__append_65 = \ +@HAVE_LIBIPTC_TRUE@am__append_69 = \ +@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la + + +# ----------------------------------------------------------------------------- +@ENABLE_LDCONFIG_TRUE@am__append_70 = \ @ENABLE_LDCONFIG_TRUE@ units/ldconfig.service -@ENABLE_LDCONFIG_TRUE@am__append_66 = \ +@ENABLE_LDCONFIG_TRUE@am__append_71 = \ @ENABLE_LDCONFIG_TRUE@ ldconfig.service # ------------------------------------------------------------------------------ -@HAVE_SECCOMP_TRUE@am__append_67 = \ +@HAVE_SECCOMP_TRUE@am__append_72 = \ @HAVE_SECCOMP_TRUE@ libsystemd-seccomp.la # ------------------------------------------------------------------------------ -@HAVE_ACL_TRUE@am__append_68 = \ +@HAVE_ACL_TRUE@am__append_73 = \ @HAVE_ACL_TRUE@ libsystemd-acl.la -@HAVE_SECCOMP_TRUE@am__append_69 = \ +@HAVE_SECCOMP_TRUE@am__append_74 = \ @HAVE_SECCOMP_TRUE@ libsystemd-seccomp.la -@HAVE_KMOD_TRUE@am__append_70 = \ +@HAVE_LIBIPTC_TRUE@am__append_75 = \ +@HAVE_LIBIPTC_TRUE@ test-fw-util + +@HAVE_KMOD_TRUE@am__append_76 = \ @HAVE_KMOD_TRUE@ test-rtnl-manual -@ENABLE_EFI_TRUE@am__append_71 = \ +@ENABLE_EFI_TRUE@am__append_77 = \ @ENABLE_EFI_TRUE@ test-boot-timestamp -@HAVE_KMOD_TRUE@am__append_72 = \ +@HAVE_KMOD_TRUE@am__append_78 = \ @HAVE_KMOD_TRUE@ systemd-modules-load -@HAVE_KMOD_TRUE@am__append_73 = \ +@HAVE_KMOD_TRUE@am__append_79 = \ @HAVE_KMOD_TRUE@ units/systemd-modules-load.service -@HAVE_KMOD_TRUE@am__append_74 = \ +@HAVE_KMOD_TRUE@am__append_80 = \ @HAVE_KMOD_TRUE@ systemd-modules-load.service -@ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@am__append_75 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@am__append_81 = \ @ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@ units/kmod-static-nodes.service -@ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@am__append_76 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@am__append_82 = \ @ENABLE_TMPFILES_TRUE@@HAVE_KMOD_TRUE@ kmod-static-nodes.service -@ENABLE_TMPFILES_TRUE@am__append_77 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_ACL_TRUE@am__append_83 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_ACL_TRUE@ libsystemd-acl.la + +@ENABLE_TMPFILES_TRUE@am__append_84 = \ @ENABLE_TMPFILES_TRUE@ systemd-tmpfiles -@ENABLE_TMPFILES_TRUE@am__append_78 = \ +@ENABLE_TMPFILES_TRUE@am__append_85 = \ @ENABLE_TMPFILES_TRUE@ units/systemd-tmpfiles-clean.timer -@ENABLE_TMPFILES_TRUE@am__append_79 = \ +@ENABLE_TMPFILES_TRUE@am__append_86 = \ @ENABLE_TMPFILES_TRUE@ units/systemd-tmpfiles-setup-dev.service \ @ENABLE_TMPFILES_TRUE@ units/systemd-tmpfiles-setup.service \ @ENABLE_TMPFILES_TRUE@ units/systemd-tmpfiles-clean.service -@ENABLE_TMPFILES_TRUE@@HAVE_SYSV_COMPAT_TRUE@am__append_80 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_SYSV_COMPAT_TRUE@am__append_87 = \ @ENABLE_TMPFILES_TRUE@@HAVE_SYSV_COMPAT_TRUE@ tmpfiles.d/legacy.conf -@ENABLE_TMPFILES_TRUE@am__append_81 = \ +@ENABLE_TMPFILES_TRUE@am__append_88 = \ @ENABLE_TMPFILES_TRUE@ systemd-tmpfiles-setup-dev.service \ @ENABLE_TMPFILES_TRUE@ systemd-tmpfiles-setup.service -@ENABLE_TMPFILES_TRUE@am__append_82 = \ +@ENABLE_TMPFILES_TRUE@am__append_89 = \ @ENABLE_TMPFILES_TRUE@ shell-completion/zsh/_systemd-tmpfiles -@ENABLE_TMPFILES_TRUE@am__append_83 = \ +@ENABLE_TMPFILES_TRUE@am__append_90 = \ @ENABLE_TMPFILES_TRUE@ systemd-tmpfiles-clean.timer -@ENABLE_TMPFILES_TRUE@am__append_84 = \ +@ENABLE_TMPFILES_TRUE@am__append_91 = \ @ENABLE_TMPFILES_TRUE@ $(tmpfilesdir) \ @ENABLE_TMPFILES_TRUE@ $(sysconfdir)/tmpfiles.d -@ENABLE_SYSUSERS_TRUE@am__append_85 = \ +@ENABLE_SYSUSERS_TRUE@am__append_92 = \ @ENABLE_SYSUSERS_TRUE@ systemd-sysusers -@ENABLE_SYSUSERS_TRUE@am__append_86 = \ +@ENABLE_SYSUSERS_TRUE@am__append_93 = \ @ENABLE_SYSUSERS_TRUE@ units/systemd-sysusers.service -@ENABLE_SYSUSERS_TRUE@am__append_87 = \ +@ENABLE_SYSUSERS_TRUE@am__append_94 = \ @ENABLE_SYSUSERS_TRUE@ systemd-sysusers.service -@ENABLE_SYSUSERS_TRUE@am__append_88 = \ +@ENABLE_SYSUSERS_TRUE@am__append_95 = \ @ENABLE_SYSUSERS_TRUE@ units/systemd-sysusers.service.in \ @ENABLE_SYSUSERS_TRUE@ sysusers.d/basic.conf.in -@ENABLE_SYSUSERS_TRUE@am__append_89 = \ +@ENABLE_SYSUSERS_TRUE@am__append_96 = \ @ENABLE_SYSUSERS_TRUE@ sysusers.d/basic.conf -@ENABLE_SYSUSERS_TRUE@am__append_90 = \ +@ENABLE_SYSUSERS_TRUE@am__append_97 = \ @ENABLE_SYSUSERS_TRUE@ $(sysusersdir) -@ENABLE_FIRSTBOOT_TRUE@am__append_91 = \ +@ENABLE_FIRSTBOOT_TRUE@am__append_98 = \ @ENABLE_FIRSTBOOT_TRUE@ systemd-firstboot -@ENABLE_FIRSTBOOT_TRUE@am__append_92 = \ +@ENABLE_FIRSTBOOT_TRUE@am__append_99 = \ @ENABLE_FIRSTBOOT_TRUE@ units/systemd-firstboot.service -@ENABLE_FIRSTBOOT_TRUE@am__append_93 = \ +@ENABLE_FIRSTBOOT_TRUE@am__append_100 = \ @ENABLE_FIRSTBOOT_TRUE@ units/systemd-firstboot.service.in -@ENABLE_FIRSTBOOT_TRUE@am__append_94 = \ +@ENABLE_FIRSTBOOT_TRUE@am__append_101 = \ @ENABLE_FIRSTBOOT_TRUE@ systemd-firstboot.service # ------------------------------------------------------------------------------ -@ENABLE_HIBERNATE_TRUE@am__append_95 = \ +@ENABLE_HIBERNATE_TRUE@am__append_102 = \ @ENABLE_HIBERNATE_TRUE@ systemd-hibernate-resume-generator -@ENABLE_HIBERNATE_TRUE@am__append_96 = \ +@ENABLE_HIBERNATE_TRUE@am__append_103 = \ @ENABLE_HIBERNATE_TRUE@ systemd-hibernate-resume -@ENABLE_HIBERNATE_TRUE@am__append_97 = \ +@ENABLE_HIBERNATE_TRUE@am__append_104 = \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hibernate.service.in \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hibernate-resume@.service.in \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hybrid-sleep.service.in -@ENABLE_HIBERNATE_TRUE@am__append_98 = \ +@ENABLE_HIBERNATE_TRUE@am__append_105 = \ @ENABLE_HIBERNATE_TRUE@ units/hibernate.target \ @ENABLE_HIBERNATE_TRUE@ units/hybrid-sleep.target -@ENABLE_HIBERNATE_TRUE@am__append_99 = \ +@ENABLE_HIBERNATE_TRUE@am__append_106 = \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hibernate.service \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hibernate-resume@.service \ @ENABLE_HIBERNATE_TRUE@ units/systemd-hybrid-sleep.service # ------------------------------------------------------------------------------ -@ENABLE_EFI_TRUE@am__append_100 = \ +@ENABLE_EFI_TRUE@am__append_107 = \ @ENABLE_EFI_TRUE@ systemd-efi-boot-generator -@ENABLE_EFI_TRUE@am__append_101 = \ +@ENABLE_EFI_TRUE@am__append_108 = \ @ENABLE_EFI_TRUE@ bootctl -@ENABLE_EFI_TRUE@am__append_102 = \ +@ENABLE_EFI_TRUE@am__append_109 = \ @ENABLE_EFI_TRUE@ shell-completion/bash/bootctl -@ENABLE_EFI_TRUE@am__append_103 = \ +@ENABLE_EFI_TRUE@am__append_110 = \ @ENABLE_EFI_TRUE@ shell-completion/zsh/_bootctl # ------------------------------------------------------------------------------ -@HAVE_BLKID_TRUE@am__append_104 = \ +@HAVE_BLKID_TRUE@am__append_111 = \ @HAVE_BLKID_TRUE@ systemd-gpt-auto-generator # ------------------------------------------------------------------------------ -@ENABLE_KDBUS_TRUE@am__append_105 = \ +@ENABLE_KDBUS_TRUE@am__append_112 = \ @ENABLE_KDBUS_TRUE@ systemd-dbus1-generator -@ENABLE_KDBUS_TRUE@am__append_106 = dbus1-generator-install-hook -@ENABLE_KDBUS_TRUE@am__append_107 = dbus1-generator-uninstall-hook -@HAVE_SECCOMP_TRUE@am__append_108 = \ +@ENABLE_KDBUS_TRUE@am__append_113 = dbus1-generator-install-hook +@ENABLE_KDBUS_TRUE@am__append_114 = dbus1-generator-uninstall-hook +@HAVE_SECCOMP_TRUE@am__append_115 = \ @HAVE_SECCOMP_TRUE@ libsystemd-seccomp.la \ @HAVE_SECCOMP_TRUE@ $(SECCOMP_LIBS) -@ENABLE_KDBUS_TRUE@am__append_109 = \ -@ENABLE_KDBUS_TRUE@ units/systemd-bus-proxyd@.service +@HAVE_LIBIPTC_TRUE@am__append_116 = \ +@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la + +@ENABLE_KDBUS_TRUE@am__append_117 = \ +@ENABLE_KDBUS_TRUE@ units/systemd-bus-proxyd.service -@ENABLE_KDBUS_TRUE@am__append_110 = \ +@ENABLE_KDBUS_TRUE@am__append_118 = \ @ENABLE_KDBUS_TRUE@ units/systemd-bus-proxyd.socket -@ENABLE_KDBUS_TRUE@am__append_111 = \ -@ENABLE_KDBUS_TRUE@ units/user/systemd-bus-proxyd@.service +@ENABLE_KDBUS_TRUE@am__append_119 = \ +@ENABLE_KDBUS_TRUE@ units/user/systemd-bus-proxyd.service -@ENABLE_KDBUS_TRUE@am__append_112 = \ +@ENABLE_KDBUS_TRUE@am__append_120 = \ @ENABLE_KDBUS_TRUE@ units/user/systemd-bus-proxyd.socket -@HAVE_SMACK_TRUE@am__append_113 = bus-proxyd-set-cap-hook -@ENABLE_KDBUS_TRUE@am__append_114 = \ +@HAVE_SMACK_TRUE@am__append_121 = bus-proxyd-set-cap-hook +@ENABLE_KDBUS_TRUE@am__append_122 = \ @ENABLE_KDBUS_TRUE@ src/systemd/sd-bus.h \ @ENABLE_KDBUS_TRUE@ src/systemd/sd-bus-protocol.h \ @ENABLE_KDBUS_TRUE@ src/systemd/sd-bus-vtable.h \ @@ -724,685 +755,778 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ # ------------------------------------------------------------------------------ -@ENABLE_TERMINAL_TRUE@am__append_115 = \ +@ENABLE_TERMINAL_TRUE@am__append_123 = \ @ENABLE_TERMINAL_TRUE@ libsystemd-terminal.la -@ENABLE_TERMINAL_TRUE@am__append_116 = \ +@ENABLE_TERMINAL_TRUE@am__append_124 = \ @ENABLE_TERMINAL_TRUE@ systemd-consoled -@ENABLE_TERMINAL_TRUE@am__append_117 = \ +@ENABLE_TERMINAL_TRUE@am__append_125 = \ @ENABLE_TERMINAL_TRUE@ systemd-evcat \ @ENABLE_TERMINAL_TRUE@ systemd-modeset \ @ENABLE_TERMINAL_TRUE@ systemd-subterm -@ENABLE_TERMINAL_TRUE@am__append_118 = \ -@ENABLE_TERMINAL_TRUE@ src/libsystemd-terminal/unifont-glyph-array.bin +@ENABLE_TERMINAL_TRUE@am__append_126 = \ +@ENABLE_TERMINAL_TRUE@ src/libsystemd-terminal/unifont-glyph-array.bin -@ENABLE_TERMINAL_TRUE@am__append_119 = \ +@ENABLE_TERMINAL_TRUE@am__append_127 = \ @ENABLE_TERMINAL_TRUE@ units/user/systemd-consoled.service -@ENABLE_TERMINAL_TRUE@am__append_120 = \ +@ENABLE_TERMINAL_TRUE@am__append_128 = \ @ENABLE_TERMINAL_TRUE@ systemd-consoled.service -@ENABLE_TERMINAL_TRUE@am__append_121 = \ -@ENABLE_TERMINAL_TRUE@ units/user/systemd-consoled.service.in - -@ENABLE_TERMINAL_TRUE@am__append_122 = \ +@ENABLE_TERMINAL_TRUE@am__append_129 = \ @ENABLE_TERMINAL_TRUE@ test-term-page \ @ENABLE_TERMINAL_TRUE@ test-term-parser \ @ENABLE_TERMINAL_TRUE@ test-unifont # ------------------------------------------------------------------------------ -@ENABLE_GTK_DOC_TRUE@am__append_123 = \ +@ENABLE_GTK_DOC_TRUE@am__append_130 = \ @ENABLE_GTK_DOC_TRUE@ docs/libudev -@ENABLE_GTK_DOC_TRUE@am__append_124 = \ +@ENABLE_GTK_DOC_TRUE@am__append_131 = \ @ENABLE_GTK_DOC_TRUE@ docs/html/libudev \ @ENABLE_GTK_DOC_TRUE@ docs/html/gudev -@HAVE_KMOD_TRUE@am__append_125 = \ +@HAVE_KMOD_TRUE@am__append_132 = \ @HAVE_KMOD_TRUE@ src/udev/udev-builtin-kmod.c -@HAVE_KMOD_TRUE@am__append_126 = \ +@HAVE_KMOD_TRUE@am__append_133 = \ @HAVE_KMOD_TRUE@ rules/80-drivers.rules -@HAVE_BLKID_TRUE@am__append_127 = \ +@HAVE_BLKID_TRUE@am__append_134 = \ @HAVE_BLKID_TRUE@ src/udev/udev-builtin-blkid.c -@HAVE_ACL_TRUE@am__append_128 = \ +@HAVE_ACL_TRUE@am__append_135 = \ @HAVE_ACL_TRUE@ src/udev/udev-builtin-uaccess.c \ @HAVE_ACL_TRUE@ src/login/logind-acl.c \ @HAVE_ACL_TRUE@ src/libsystemd/sd-login/sd-login.c \ @HAVE_ACL_TRUE@ src/systemd/sd-login.h -@HAVE_ACL_TRUE@am__append_129 = \ +@HAVE_ACL_TRUE@am__append_136 = \ @HAVE_ACL_TRUE@ libsystemd-acl.la -@HAVE_ACL_TRUE@am__append_130 = \ + +# ------------------------------------------------------------------------------ +@ENABLE_HWDB_TRUE@am__append_137 = \ +@ENABLE_HWDB_TRUE@ $(sysconfdir)/udev/hwdb.d + +@ENABLE_HWDB_TRUE@am__append_138 = \ +@ENABLE_HWDB_TRUE@ systemd-hwdb + +@ENABLE_HWDB_TRUE@am__append_139 = \ +@ENABLE_HWDB_TRUE@ units/systemd-hwdb-update.service.in + +@ENABLE_HWDB_TRUE@am__append_140 = \ +@ENABLE_HWDB_TRUE@ units/systemd-hwdb-update.service + +@ENABLE_HWDB_TRUE@am__append_141 = \ +@ENABLE_HWDB_TRUE@ systemd-hwdb-update.service + +@ENABLE_HWDB_TRUE@am__append_142 = \ +@ENABLE_HWDB_TRUE@ hwdb-update-hook + +@HAVE_PYTHON_TRUE@am__append_143 = \ +@HAVE_PYTHON_TRUE@ test/rule-syntax-check.py \ +@HAVE_PYTHON_TRUE@ test/sysv-generator-test.py \ +@HAVE_PYTHON_TRUE@ $(NULL) + +@HAVE_ACL_TRUE@am__append_144 = \ @HAVE_ACL_TRUE@ libsystemd-acl.la # ------------------------------------------------------------------------------ -@ENABLE_GTK_DOC_TRUE@@ENABLE_GUDEV_TRUE@am__append_131 = \ +@ENABLE_GTK_DOC_TRUE@@ENABLE_GUDEV_TRUE@am__append_145 = \ @ENABLE_GTK_DOC_TRUE@@ENABLE_GUDEV_TRUE@ docs/gudev -@ENABLE_GUDEV_TRUE@am__append_132 = libgudev-1.0.la -@ENABLE_GUDEV_TRUE@am__append_133 = \ +@ENABLE_GUDEV_TRUE@am__append_146 = libgudev-1.0.la +@ENABLE_GUDEV_TRUE@am__append_147 = \ @ENABLE_GUDEV_TRUE@ src/gudev/gudev-1.0.pc -@ENABLE_GUDEV_TRUE@am__append_134 = \ +@ENABLE_GUDEV_TRUE@am__append_148 = \ @ENABLE_GUDEV_TRUE@ src/gudev/gudev-1.0.pc -@ENABLE_GUDEV_TRUE@am__append_135 = \ +@ENABLE_GUDEV_TRUE@am__append_149 = \ @ENABLE_GUDEV_TRUE@ $(nodist_libgudev_1_0_la_SOURCES) -@ENABLE_GUDEV_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_136 = $(gir_DATA) $(typelibs_DATA) -@HAVE_MICROHTTPD_TRUE@am__append_137 = \ +@ENABLE_GUDEV_TRUE@@HAVE_INTROSPECTION_TRUE@am__append_150 = $(gir_DATA) $(typelibs_DATA) +@HAVE_MICROHTTPD_TRUE@am__append_151 = \ @HAVE_MICROHTTPD_TRUE@ systemd-journal-remote -@ENABLE_SYSUSERS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_138 = \ +@ENABLE_SYSUSERS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_152 = \ @ENABLE_SYSUSERS_TRUE@@HAVE_MICROHTTPD_TRUE@ sysusers.d/systemd-remote.conf -@ENABLE_TMPFILES_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_139 = \ +@ENABLE_TMPFILES_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_153 = \ @ENABLE_TMPFILES_TRUE@@HAVE_MICROHTTPD_TRUE@ tmpfiles.d/systemd-remote.conf -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_140 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_154 = \ @HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@ $(GNUTLS_LIBS) # systemd-journal-remote make sense mostly with full crypto stack -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_141 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_155 = \ @HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@ units/systemd-journal-remote.socket -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_142 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_156 = \ @HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@ units/systemd-journal-remote.service -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_143 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_157 = \ @HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@ units/systemd-journal-remote.service.in -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_144 = journal-remote-install-hook -@HAVE_MICROHTTPD_TRUE@am__append_145 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_158 = journal-remote-install-hook +@HAVE_MICROHTTPD_TRUE@am__append_159 = \ @HAVE_MICROHTTPD_TRUE@ src/journal-remote/journal-remote.conf -@HAVE_MICROHTTPD_TRUE@am__append_146 = \ +@HAVE_MICROHTTPD_TRUE@am__append_160 = \ @HAVE_MICROHTTPD_TRUE@ src/journal-remote/journal-remote.conf.in -@HAVE_MICROHTTPD_TRUE@am__append_147 = \ +@HAVE_MICROHTTPD_TRUE@am__append_161 = \ @HAVE_MICROHTTPD_TRUE@ src/journal-remote/journal-remote.conf -@HAVE_LIBCURL_TRUE@am__append_148 = \ +@HAVE_LIBCURL_TRUE@am__append_162 = \ @HAVE_LIBCURL_TRUE@ systemd-journal-upload -@HAVE_LIBCURL_TRUE@am__append_149 = \ +@HAVE_LIBCURL_TRUE@am__append_163 = \ @HAVE_LIBCURL_TRUE@ units/systemd-journal-upload.service -@HAVE_LIBCURL_TRUE@am__append_150 = \ +@HAVE_LIBCURL_TRUE@am__append_164 = \ @HAVE_LIBCURL_TRUE@ units/systemd-journal-upload.service.in \ @HAVE_LIBCURL_TRUE@ src/journal-remote/journal-upload.conf.in -@HAVE_LIBCURL_TRUE@am__append_151 = \ +@HAVE_LIBCURL_TRUE@am__append_165 = \ @HAVE_LIBCURL_TRUE@ src/journal-remote/journal-upload.conf -@HAVE_LIBCURL_TRUE@am__append_152 = \ +@HAVE_LIBCURL_TRUE@am__append_166 = \ @HAVE_LIBCURL_TRUE@ src/journal-remote/journal-upload.conf -@HAVE_ACL_TRUE@am__append_153 = \ +@HAVE_ACL_TRUE@am__append_167 = \ @HAVE_ACL_TRUE@ libsystemd-acl.la -@HAVE_QRENCODE_TRUE@am__append_154 = \ +@HAVE_QRENCODE_TRUE@am__append_168 = \ @HAVE_QRENCODE_TRUE@ src/journal/journal-qrcode.c \ @HAVE_QRENCODE_TRUE@ src/journal/journal-qrcode.h -@HAVE_QRENCODE_TRUE@am__append_155 = \ +@HAVE_QRENCODE_TRUE@am__append_169 = \ @HAVE_QRENCODE_TRUE@ $(QRENCODE_CFLAGS) -@HAVE_QRENCODE_TRUE@am__append_156 = \ +@HAVE_QRENCODE_TRUE@am__append_170 = \ @HAVE_QRENCODE_TRUE@ $(QRENCODE_LIBS) -@HAVE_ACL_TRUE@am__append_157 = \ +@HAVE_ACL_TRUE@am__append_171 = \ @HAVE_ACL_TRUE@ libsystemd-acl.la -@HAVE_COMPRESSION_TRUE@am__append_158 = \ +@HAVE_COMPRESSION_TRUE@am__append_172 = \ @HAVE_COMPRESSION_TRUE@ test-compress \ @HAVE_COMPRESSION_TRUE@ test-compress-benchmark -@HAVE_XZ_TRUE@am__append_159 = \ +@HAVE_XZ_TRUE@am__append_173 = \ @HAVE_XZ_TRUE@ $(XZ_CFLAGS) -@HAVE_XZ_TRUE@am__append_160 = \ +@HAVE_XZ_TRUE@am__append_174 = \ @HAVE_XZ_TRUE@ $(XZ_LIBS) -@HAVE_LZ4_TRUE@am__append_161 = \ +@HAVE_LZ4_TRUE@am__append_175 = \ @HAVE_LZ4_TRUE@ -llz4 -@HAVE_GCRYPT_TRUE@am__append_162 = \ +@HAVE_GCRYPT_TRUE@am__append_176 = \ @HAVE_GCRYPT_TRUE@ src/journal/journal-authenticate.c \ @HAVE_GCRYPT_TRUE@ src/journal/journal-authenticate.h \ @HAVE_GCRYPT_TRUE@ src/journal/fsprg.c \ @HAVE_GCRYPT_TRUE@ src/journal/fsprg.h -@HAVE_GCRYPT_TRUE@am__append_163 = \ +@HAVE_GCRYPT_TRUE@am__append_177 = \ @HAVE_GCRYPT_TRUE@ $(GCRYPT_LIBS) # fsprg.c is a drop-in file using void pointer arithmetic -@HAVE_GCRYPT_TRUE@am__append_164 = \ +@HAVE_GCRYPT_TRUE@am__append_178 = \ @HAVE_GCRYPT_TRUE@ $(GCRYPT_CFLAGS) \ @HAVE_GCRYPT_TRUE@ -Wno-pointer-arith -@HAVE_MICROHTTPD_TRUE@am__append_165 = \ +@HAVE_MICROHTTPD_TRUE@am__append_179 = \ @HAVE_MICROHTTPD_TRUE@ systemd-journal-gatewayd -@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_166 = \ +@HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@am__append_180 = \ @HAVE_GNUTLS_TRUE@@HAVE_MICROHTTPD_TRUE@ $(GNUTLS_LIBS) -@HAVE_MICROHTTPD_TRUE@am__append_167 = \ +@HAVE_MICROHTTPD_TRUE@am__append_181 = \ @HAVE_MICROHTTPD_TRUE@ units/systemd-journal-gatewayd.socket -@HAVE_MICROHTTPD_TRUE@am__append_168 = \ +@HAVE_MICROHTTPD_TRUE@am__append_182 = \ @HAVE_MICROHTTPD_TRUE@ units/systemd-journal-gatewayd.service -@ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@am__append_169 = \ +@ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@am__append_183 = \ @ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@ src/journal/stacktrace.c \ @ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@ src/journal/stacktrace.h -@ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@am__append_170 = \ +@ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@am__append_184 = \ @ENABLE_COREDUMP_TRUE@@HAVE_ELFUTILS_TRUE@ $(ELFUTILS_LIBS) -@ENABLE_COREDUMP_TRUE@am__append_171 = \ +@ENABLE_COREDUMP_TRUE@am__append_185 = \ @ENABLE_COREDUMP_TRUE@ systemd-coredump -@ENABLE_COREDUMP_TRUE@am__append_172 = \ +@ENABLE_COREDUMP_TRUE@am__append_186 = \ @ENABLE_COREDUMP_TRUE@ src/journal/coredump.conf -@ENABLE_COREDUMP_TRUE@@HAVE_ACL_TRUE@am__append_173 = \ +@ENABLE_COREDUMP_TRUE@@HAVE_ACL_TRUE@am__append_187 = \ @ENABLE_COREDUMP_TRUE@@HAVE_ACL_TRUE@ libsystemd-acl.la -@ENABLE_COREDUMP_TRUE@am__append_174 = \ +@ENABLE_COREDUMP_TRUE@am__append_188 = \ @ENABLE_COREDUMP_TRUE@ coredumpctl -@ENABLE_COREDUMP_TRUE@am__append_175 = \ +@ENABLE_COREDUMP_TRUE@am__append_189 = \ @ENABLE_COREDUMP_TRUE@ test-coredump-vacuum -@ENABLE_COREDUMP_TRUE@am__append_176 = \ +@ENABLE_COREDUMP_TRUE@am__append_190 = \ @ENABLE_COREDUMP_TRUE@ shell-completion/bash/coredumpctl -@ENABLE_COREDUMP_TRUE@am__append_177 = \ +@ENABLE_COREDUMP_TRUE@am__append_191 = \ @ENABLE_COREDUMP_TRUE@ shell-completion/zsh/_coredumpctl -@ENABLE_COREDUMP_TRUE@am__append_178 = \ +@ENABLE_COREDUMP_TRUE@am__append_192 = \ @ENABLE_COREDUMP_TRUE@ sysctl.d/50-coredump.conf -@ENABLE_BINFMT_TRUE@am__append_179 = \ +@ENABLE_BINFMT_TRUE@am__append_193 = \ @ENABLE_BINFMT_TRUE@ systemd-binfmt -@ENABLE_BINFMT_TRUE@am__append_180 = \ +@ENABLE_BINFMT_TRUE@am__append_194 = \ @ENABLE_BINFMT_TRUE@ units/proc-sys-fs-binfmt_misc.automount \ @ENABLE_BINFMT_TRUE@ units/proc-sys-fs-binfmt_misc.mount -@ENABLE_BINFMT_TRUE@am__append_181 = \ +@ENABLE_BINFMT_TRUE@am__append_195 = \ @ENABLE_BINFMT_TRUE@ units/systemd-binfmt.service -@ENABLE_BINFMT_TRUE@am__append_182 = \ +@ENABLE_BINFMT_TRUE@am__append_196 = \ @ENABLE_BINFMT_TRUE@ $(prefix)/lib/binfmt.d \ @ENABLE_BINFMT_TRUE@ $(sysconfdir)/binfmt.d -@ENABLE_BINFMT_TRUE@am__append_183 = \ +@ENABLE_BINFMT_TRUE@am__append_197 = \ @ENABLE_BINFMT_TRUE@ systemd-binfmt.service \ @ENABLE_BINFMT_TRUE@ proc-sys-fs-binfmt_misc.automount -@ENABLE_VCONSOLE_TRUE@am__append_184 = \ +@ENABLE_VCONSOLE_TRUE@am__append_198 = \ @ENABLE_VCONSOLE_TRUE@ systemd-vconsole-setup -@ENABLE_VCONSOLE_TRUE@am__append_185 = \ +@ENABLE_VCONSOLE_TRUE@am__append_199 = \ @ENABLE_VCONSOLE_TRUE@ units/systemd-vconsole-setup.service -@ENABLE_VCONSOLE_TRUE@am__append_186 = \ +@ENABLE_VCONSOLE_TRUE@am__append_200 = \ @ENABLE_VCONSOLE_TRUE@ src/vconsole/90-vconsole.rules -@ENABLE_VCONSOLE_TRUE@am__append_187 = \ +@ENABLE_VCONSOLE_TRUE@am__append_201 = \ @ENABLE_VCONSOLE_TRUE@ systemd-vconsole-setup.service -@ENABLE_VCONSOLE_TRUE@am__append_188 = \ +@ENABLE_VCONSOLE_TRUE@am__append_202 = \ @ENABLE_VCONSOLE_TRUE@ src/vconsole/90-vconsole.rules -@ENABLE_BOOTCHART_TRUE@am__append_189 = \ +@ENABLE_BOOTCHART_TRUE@am__append_203 = \ @ENABLE_BOOTCHART_TRUE@ systemd-bootchart -@ENABLE_BOOTCHART_TRUE@am__append_190 = \ +@ENABLE_BOOTCHART_TRUE@am__append_204 = \ @ENABLE_BOOTCHART_TRUE@ src/bootchart/bootchart.conf -@ENABLE_BOOTCHART_TRUE@am__append_191 = \ +@ENABLE_BOOTCHART_TRUE@am__append_205 = \ @ENABLE_BOOTCHART_TRUE@ units/systemd-bootchart.service -@ENABLE_BOOTCHART_TRUE@am__append_192 = \ +@ENABLE_BOOTCHART_TRUE@am__append_206 = \ @ENABLE_BOOTCHART_TRUE@ units/systemd-bootchart.service.in -@ENABLE_BOOTCHART_TRUE@am__append_193 = \ +@ENABLE_BOOTCHART_TRUE@am__append_207 = \ @ENABLE_BOOTCHART_TRUE@ units/systemd-bootchart.service # ------------------------------------------------------------------------------ -@ENABLE_QUOTACHECK_TRUE@am__append_194 = \ +@ENABLE_QUOTACHECK_TRUE@am__append_208 = \ @ENABLE_QUOTACHECK_TRUE@ systemd-quotacheck -@ENABLE_QUOTACHECK_TRUE@am__append_195 = \ +@ENABLE_QUOTACHECK_TRUE@am__append_209 = \ @ENABLE_QUOTACHECK_TRUE@ units/systemd-quotacheck.service # ------------------------------------------------------------------------------ -@ENABLE_RANDOMSEED_TRUE@am__append_196 = \ +@ENABLE_RANDOMSEED_TRUE@am__append_210 = \ @ENABLE_RANDOMSEED_TRUE@ systemd-random-seed -@ENABLE_RANDOMSEED_TRUE@am__append_197 = \ +@ENABLE_RANDOMSEED_TRUE@am__append_211 = \ @ENABLE_RANDOMSEED_TRUE@ units/systemd-random-seed.service -@ENABLE_RANDOMSEED_TRUE@am__append_198 = \ +@ENABLE_RANDOMSEED_TRUE@am__append_212 = \ @ENABLE_RANDOMSEED_TRUE@ systemd-random-seed.service # ------------------------------------------------------------------------------ -@ENABLE_BACKLIGHT_TRUE@am__append_199 = \ +@ENABLE_BACKLIGHT_TRUE@am__append_213 = \ @ENABLE_BACKLIGHT_TRUE@ systemd-backlight -@ENABLE_BACKLIGHT_TRUE@am__append_200 = \ +@ENABLE_BACKLIGHT_TRUE@am__append_214 = \ @ENABLE_BACKLIGHT_TRUE@ units/systemd-backlight@.service # ------------------------------------------------------------------------------ -@ENABLE_RFKILL_TRUE@am__append_201 = \ +@ENABLE_RFKILL_TRUE@am__append_215 = \ @ENABLE_RFKILL_TRUE@ systemd-rfkill -@ENABLE_RFKILL_TRUE@am__append_202 = \ +@ENABLE_RFKILL_TRUE@am__append_216 = \ @ENABLE_RFKILL_TRUE@ units/systemd-rfkill@.service # ------------------------------------------------------------------------------ -@HAVE_LIBCRYPTSETUP_TRUE@am__append_203 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_217 = \ @HAVE_LIBCRYPTSETUP_TRUE@ systemd-cryptsetup -@HAVE_LIBCRYPTSETUP_TRUE@am__append_204 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_218 = \ @HAVE_LIBCRYPTSETUP_TRUE@ systemd-cryptsetup-generator -@HAVE_LIBCRYPTSETUP_TRUE@am__append_205 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_219 = \ @HAVE_LIBCRYPTSETUP_TRUE@ units/cryptsetup.target \ @HAVE_LIBCRYPTSETUP_TRUE@ units/cryptsetup-pre.target -@HAVE_LIBCRYPTSETUP_TRUE@am__append_206 = \ +@HAVE_LIBCRYPTSETUP_TRUE@am__append_220 = \ @HAVE_LIBCRYPTSETUP_TRUE@ cryptsetup.target -@ENABLE_HOSTNAMED_TRUE@am__append_207 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_221 = \ @ENABLE_HOSTNAMED_TRUE@ systemd-hostnamed -@ENABLE_HOSTNAMED_TRUE@am__append_208 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_222 = \ @ENABLE_HOSTNAMED_TRUE@ units/systemd-hostnamed.service -@ENABLE_HOSTNAMED_TRUE@am__append_209 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_223 = \ @ENABLE_HOSTNAMED_TRUE@ units/org.freedesktop.hostname1.busname -@ENABLE_HOSTNAMED_TRUE@am__append_210 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_224 = \ @ENABLE_HOSTNAMED_TRUE@ src/hostname/org.freedesktop.hostname1.conf -@ENABLE_HOSTNAMED_TRUE@am__append_211 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_225 = \ @ENABLE_HOSTNAMED_TRUE@ src/hostname/org.freedesktop.hostname1.service -@ENABLE_HOSTNAMED_TRUE@am__append_212 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_226 = \ @ENABLE_HOSTNAMED_TRUE@ src/hostname/org.freedesktop.hostname1.policy -@ENABLE_HOSTNAMED_TRUE@am__append_213 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_227 = \ @ENABLE_HOSTNAMED_TRUE@ systemd-hostnamed.service dbus-org.freedesktop.hostname1.service -@ENABLE_HOSTNAMED_TRUE@am__append_214 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_228 = \ @ENABLE_HOSTNAMED_TRUE@ org.freedesktop.hostname1.busname -@ENABLE_HOSTNAMED_TRUE@am__append_215 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_229 = \ @ENABLE_HOSTNAMED_TRUE@ hostnamectl -@ENABLE_HOSTNAMED_TRUE@am__append_216 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_230 = \ @ENABLE_HOSTNAMED_TRUE@ shell-completion/bash/hostnamectl -@ENABLE_HOSTNAMED_TRUE@am__append_217 = \ +@ENABLE_HOSTNAMED_TRUE@am__append_231 = \ @ENABLE_HOSTNAMED_TRUE@ shell-completion/zsh/_hostnamectl -@ENABLE_LOCALED_TRUE@am__append_218 = \ +@ENABLE_LOCALED_TRUE@am__append_232 = \ @ENABLE_LOCALED_TRUE@ units/systemd-localed.service -@ENABLE_LOCALED_TRUE@am__append_219 = \ +@ENABLE_LOCALED_TRUE@am__append_233 = \ @ENABLE_LOCALED_TRUE@ units/org.freedesktop.locale1.busname -@ENABLE_LOCALED_TRUE@am__append_220 = \ +@ENABLE_LOCALED_TRUE@am__append_234 = \ @ENABLE_LOCALED_TRUE@ systemd-localed -@ENABLE_LOCALED_TRUE@am__append_221 = \ +@ENABLE_LOCALED_TRUE@am__append_235 = \ @ENABLE_LOCALED_TRUE@ src/locale/org.freedesktop.locale1.conf -@ENABLE_LOCALED_TRUE@am__append_222 = \ +@ENABLE_LOCALED_TRUE@am__append_236 = \ @ENABLE_LOCALED_TRUE@ src/locale/org.freedesktop.locale1.service -@ENABLE_LOCALED_TRUE@am__append_223 = \ +@ENABLE_LOCALED_TRUE@am__append_237 = \ @ENABLE_LOCALED_TRUE@ src/locale/org.freedesktop.locale1.policy -@ENABLE_LOCALED_TRUE@am__append_224 = \ +@ENABLE_LOCALED_TRUE@am__append_238 = \ @ENABLE_LOCALED_TRUE@ systemd-localed.service dbus-org.freedesktop.locale1.service -@ENABLE_LOCALED_TRUE@am__append_225 = \ +@ENABLE_LOCALED_TRUE@am__append_239 = \ @ENABLE_LOCALED_TRUE@ org.freedesktop.locale1.busname -@ENABLE_LOCALED_TRUE@am__append_226 = \ -@ENABLE_LOCALED_TRUE@ src/locale/kbd-model-map +@ENABLE_LOCALED_TRUE@am__append_240 = \ +@ENABLE_LOCALED_TRUE@ src/locale/kbd-model-map \ +@ENABLE_LOCALED_TRUE@ src/locale/language-fallback-map -@ENABLE_LOCALED_TRUE@am__append_227 = \ +@ENABLE_LOCALED_TRUE@am__append_241 = \ @ENABLE_LOCALED_TRUE@ localectl -@ENABLE_LOCALED_TRUE@am__append_228 = \ +@ENABLE_LOCALED_TRUE@am__append_242 = \ @ENABLE_LOCALED_TRUE@ shell-completion/bash/localectl -@ENABLE_LOCALED_TRUE@am__append_229 = \ +@ENABLE_LOCALED_TRUE@am__append_243 = \ @ENABLE_LOCALED_TRUE@ shell-completion/zsh/_localectl -@ENABLE_TIMEDATED_TRUE@am__append_230 = \ +@ENABLE_TIMEDATED_TRUE@am__append_244 = \ @ENABLE_TIMEDATED_TRUE@ systemd-timedated -@ENABLE_TIMEDATED_TRUE@am__append_231 = \ +@ENABLE_TIMEDATED_TRUE@am__append_245 = \ @ENABLE_TIMEDATED_TRUE@ src/timedate/org.freedesktop.timedate1.service -@ENABLE_TIMEDATED_TRUE@am__append_232 = \ +@ENABLE_TIMEDATED_TRUE@am__append_246 = \ @ENABLE_TIMEDATED_TRUE@ src/timedate/org.freedesktop.timedate1.conf -@ENABLE_TIMEDATED_TRUE@am__append_233 = \ +@ENABLE_TIMEDATED_TRUE@am__append_247 = \ @ENABLE_TIMEDATED_TRUE@ units/systemd-timedated.service -@ENABLE_TIMEDATED_TRUE@am__append_234 = \ +@ENABLE_TIMEDATED_TRUE@am__append_248 = \ @ENABLE_TIMEDATED_TRUE@ units/org.freedesktop.timedate1.busname -@ENABLE_TIMEDATED_TRUE@am__append_235 = \ +@ENABLE_TIMEDATED_TRUE@am__append_249 = \ @ENABLE_TIMEDATED_TRUE@ src/timedate/org.freedesktop.timedate1.policy -@ENABLE_TIMEDATED_TRUE@am__append_236 = \ +@ENABLE_TIMEDATED_TRUE@am__append_250 = \ @ENABLE_TIMEDATED_TRUE@ systemd-timedated.service dbus-org.freedesktop.timedate1.service -@ENABLE_TIMEDATED_TRUE@am__append_237 = \ +@ENABLE_TIMEDATED_TRUE@am__append_251 = \ @ENABLE_TIMEDATED_TRUE@ org.freedesktop.timedate1.busname -@ENABLE_TIMEDATED_TRUE@am__append_238 = \ +@ENABLE_TIMEDATED_TRUE@am__append_252 = \ @ENABLE_TIMEDATED_TRUE@ timedatectl -@ENABLE_TIMEDATED_TRUE@am__append_239 = \ +@ENABLE_TIMEDATED_TRUE@am__append_253 = \ @ENABLE_TIMEDATED_TRUE@ shell-completion/bash/timedatectl -@ENABLE_TIMEDATED_TRUE@am__append_240 = \ +@ENABLE_TIMEDATED_TRUE@am__append_254 = \ @ENABLE_TIMEDATED_TRUE@ shell-completion/zsh/_timedatectl -@ENABLE_TIMESYNCD_TRUE@am__append_241 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_255 = \ @ENABLE_TIMESYNCD_TRUE@ src/timesync/timesyncd-gperf.gperf \ @ENABLE_TIMESYNCD_TRUE@ units/systemd-timesyncd.service.in \ @ENABLE_TIMESYNCD_TRUE@ src/timesync/timesyncd.conf.in -@ENABLE_TIMESYNCD_TRUE@am__append_242 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_256 = \ @ENABLE_TIMESYNCD_TRUE@ src/timesync/timesyncd-gperf.c \ @ENABLE_TIMESYNCD_TRUE@ src/timesync/timesyncd.conf -@ENABLE_TIMESYNCD_TRUE@am__append_243 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_257 = \ @ENABLE_TIMESYNCD_TRUE@ systemd-timesyncd -@ENABLE_TIMESYNCD_TRUE@am__append_244 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_258 = \ @ENABLE_TIMESYNCD_TRUE@ units/systemd-timesyncd.service -@ENABLE_TIMESYNCD_TRUE@am__append_245 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_259 = \ @ENABLE_TIMESYNCD_TRUE@ $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/sysinit.target.wants/systemd-timesyncd.service -@ENABLE_TIMESYNCD_TRUE@am__append_246 = \ +@ENABLE_TIMESYNCD_TRUE@am__append_260 = \ @ENABLE_TIMESYNCD_TRUE@ src/timesync/timesyncd.conf -@HAVE_MYHOSTNAME_TRUE@am__append_247 = \ +@HAVE_MYHOSTNAME_TRUE@am__append_261 = \ @HAVE_MYHOSTNAME_TRUE@ libnss_myhostname.la -@ENABLE_MACHINED_TRUE@am__append_248 = \ +@ENABLE_MACHINED_TRUE@am__append_262 = \ @ENABLE_MACHINED_TRUE@ systemd-machined -@ENABLE_MACHINED_TRUE@am__append_249 = \ +@ENABLE_MACHINED_TRUE@am__append_263 = \ @ENABLE_MACHINED_TRUE@ libsystemd-machine-core.la -@ENABLE_MACHINED_TRUE@am__append_250 = \ +@ENABLE_MACHINED_TRUE@am__append_264 = \ @ENABLE_MACHINED_TRUE@ machinectl -@ENABLE_MACHINED_TRUE@am__append_251 = \ +@ENABLE_MACHINED_TRUE@am__append_265 = \ @ENABLE_MACHINED_TRUE@ shell-completion/bash/machinectl -@ENABLE_MACHINED_TRUE@am__append_252 = \ +@ENABLE_MACHINED_TRUE@am__append_266 = \ @ENABLE_MACHINED_TRUE@ test-machine-tables -@ENABLE_MACHINED_TRUE@am__append_253 = \ +@ENABLE_MACHINED_TRUE@am__append_267 = \ @ENABLE_MACHINED_TRUE@ units/systemd-machined.service -@ENABLE_MACHINED_TRUE@am__append_254 = \ +@ENABLE_MACHINED_TRUE@am__append_268 = \ @ENABLE_MACHINED_TRUE@ units/machine.slice -@ENABLE_MACHINED_TRUE@am__append_255 = \ +@ENABLE_MACHINED_TRUE@am__append_269 = \ @ENABLE_MACHINED_TRUE@ units/org.freedesktop.machine1.busname -@ENABLE_MACHINED_TRUE@am__append_256 = \ +@ENABLE_MACHINED_TRUE@am__append_270 = \ @ENABLE_MACHINED_TRUE@ src/machine/org.freedesktop.machine1.service -@ENABLE_MACHINED_TRUE@am__append_257 = \ +@ENABLE_MACHINED_TRUE@am__append_271 = \ @ENABLE_MACHINED_TRUE@ src/machine/org.freedesktop.machine1.conf -@ENABLE_MACHINED_TRUE@am__append_258 = \ +@ENABLE_MACHINED_TRUE@am__append_272 = \ +@ENABLE_MACHINED_TRUE@ src/machine/org.freedesktop.machine1.policy + +@ENABLE_MACHINED_TRUE@am__append_273 = \ +@ENABLE_MACHINED_TRUE@ src/machine/org.freedesktop.machine1.policy.in + +@ENABLE_MACHINED_TRUE@am__append_274 = \ @ENABLE_MACHINED_TRUE@ shell-completion/zsh/_machinectl \ @ENABLE_MACHINED_TRUE@ shell-completion/zsh/_sd_machines -@ENABLE_MACHINED_TRUE@am__append_259 = \ +@ENABLE_MACHINED_TRUE@am__append_275 = \ @ENABLE_MACHINED_TRUE@ systemd-machined.service dbus-org.freedesktop.machine1.service -@ENABLE_MACHINED_TRUE@am__append_260 = \ +@ENABLE_MACHINED_TRUE@am__append_276 = \ @ENABLE_MACHINED_TRUE@ org.freedesktop.machine1.busname -@ENABLE_MACHINED_TRUE@am__append_261 = \ +@ENABLE_MACHINED_TRUE@am__append_277 = \ @ENABLE_MACHINED_TRUE@ units/systemd-machined.service.in -@ENABLE_MACHINED_TRUE@am__append_262 = \ +@ENABLE_MACHINED_TRUE@am__append_278 = \ @ENABLE_MACHINED_TRUE@ libnss_mymachines.la -@ENABLE_RESOLVED_TRUE@am__append_263 = \ + +# ------------------------------------------------------------------------------ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_279 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ systemd-importd \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ systemd-pull + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_280 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ units/systemd-importd.service + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_281 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ units/systemd-importd.service.in + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_282 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ units/org.freedesktop.import1.busname + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_283 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ org.freedesktop.import1.busname + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_284 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ systemd-importd.service dbus-org.freedesktop.import1.service + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_285 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/org.freedesktop.import1.service + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_286 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/org.freedesktop.import1.conf + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_287 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/org.freedesktop.import1.policy + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_288 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/org.freedesktop.import1.policy.in + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__append_289 = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ test-qcow2 + +@ENABLE_RESOLVED_TRUE@am__append_290 = \ @ENABLE_RESOLVED_TRUE@ src/resolve/resolved-gperf.gperf \ @ENABLE_RESOLVED_TRUE@ src/resolve/dns_type-from-name.gperf \ @ENABLE_RESOLVED_TRUE@ units/systemd-resolved.service.in \ @ENABLE_RESOLVED_TRUE@ src/resolve/resolved.conf.in -@ENABLE_RESOLVED_TRUE@am__append_264 = src/resolve/resolved-gperf.c \ +@ENABLE_RESOLVED_TRUE@am__append_291 = src/resolve/resolved-gperf.c \ @ENABLE_RESOLVED_TRUE@ src/resolve/resolved.conf -@ENABLE_RESOLVED_TRUE@am__append_265 = systemd-resolved \ +@ENABLE_RESOLVED_TRUE@am__append_292 = systemd-resolved \ @ENABLE_RESOLVED_TRUE@ systemd-resolve-host -@ENABLE_RESOLVED_TRUE@am__append_266 = \ +@ENABLE_RESOLVED_TRUE@am__append_293 = \ @ENABLE_RESOLVED_TRUE@ units/systemd-resolved.service -@ENABLE_RESOLVED_TRUE@am__append_267 = \ +@ENABLE_RESOLVED_TRUE@am__append_294 = \ @ENABLE_RESOLVED_TRUE@ units/org.freedesktop.resolve1.busname -@ENABLE_RESOLVED_TRUE@am__append_268 = \ +@ENABLE_RESOLVED_TRUE@am__append_295 = \ @ENABLE_RESOLVED_TRUE@ src/resolve/org.freedesktop.resolve1.conf -@ENABLE_RESOLVED_TRUE@am__append_269 = \ +@ENABLE_RESOLVED_TRUE@am__append_296 = \ @ENABLE_RESOLVED_TRUE@ src/resolve/org.freedesktop.resolve1.service -@ENABLE_RESOLVED_TRUE@am__append_270 = \ +@ENABLE_RESOLVED_TRUE@am__append_297 = \ @ENABLE_RESOLVED_TRUE@ systemd-resolved.service dbus-org.freedesktop.resolve1.service -@ENABLE_RESOLVED_TRUE@am__append_271 = \ +@ENABLE_RESOLVED_TRUE@am__append_298 = \ @ENABLE_RESOLVED_TRUE@ org.freedesktop.resolve1.busname -@ENABLE_RESOLVED_TRUE@am__append_272 = \ +@ENABLE_RESOLVED_TRUE@am__append_299 = \ @ENABLE_RESOLVED_TRUE@ $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service -@ENABLE_RESOLVED_TRUE@am__append_273 = \ +@ENABLE_RESOLVED_TRUE@am__append_300 = \ @ENABLE_RESOLVED_TRUE@ src/resolve/resolved.conf -@ENABLE_RESOLVED_TRUE@am__append_274 = \ +@ENABLE_RESOLVED_TRUE@am__append_301 = \ @ENABLE_RESOLVED_TRUE@ test-dns-domain -@ENABLE_RESOLVED_TRUE@am__append_275 = \ +@ENABLE_RESOLVED_TRUE@am__append_302 = \ @ENABLE_RESOLVED_TRUE@ libnss_resolve.la # ------------------------------------------------------------------------------ -@ENABLE_NETWORKD_TRUE@am__append_276 = systemd-networkd \ +@ENABLE_NETWORKD_TRUE@am__append_303 = systemd-networkd \ @ENABLE_NETWORKD_TRUE@ systemd-networkd-wait-online -@ENABLE_NETWORKD_TRUE@am__append_277 = \ +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@am__append_304 = \ +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la + +@ENABLE_NETWORKD_TRUE@am__append_305 = \ @ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la -@ENABLE_NETWORKD_TRUE@am__append_278 = \ +@ENABLE_NETWORKD_TRUE@am__append_306 = \ @ENABLE_NETWORKD_TRUE@ networkctl -@ENABLE_NETWORKD_TRUE@am__append_279 = \ +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@am__append_307 = \ +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la + +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@am__append_308 = \ +@ENABLE_NETWORKD_TRUE@@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la + +@ENABLE_NETWORKD_TRUE@am__append_309 = \ @ENABLE_NETWORKD_TRUE@ test-network \ @ENABLE_NETWORKD_TRUE@ test-network-tables -@ENABLE_NETWORKD_TRUE@am__append_280 = \ +@ENABLE_NETWORKD_TRUE@am__append_310 = \ +@ENABLE_NETWORKD_TRUE@ units/systemd-networkd.socket + +@ENABLE_NETWORKD_TRUE@am__append_311 = \ @ENABLE_NETWORKD_TRUE@ units/systemd-networkd.service \ @ENABLE_NETWORKD_TRUE@ units/systemd-networkd-wait-online.service -@ENABLE_NETWORKD_TRUE@am__append_281 = \ +@ENABLE_NETWORKD_TRUE@am__append_312 = \ +@ENABLE_NETWORKD_TRUE@ units/org.freedesktop.network1.busname + +@ENABLE_NETWORKD_TRUE@am__append_313 = \ +@ENABLE_NETWORKD_TRUE@ src/network/org.freedesktop.network1.service + +@ENABLE_NETWORKD_TRUE@am__append_314 = \ +@ENABLE_NETWORKD_TRUE@ src/network/org.freedesktop.network1.conf + +@ENABLE_NETWORKD_TRUE@am__append_315 = \ +@ENABLE_NETWORKD_TRUE@ $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \ @ENABLE_NETWORKD_TRUE@ $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \ @ENABLE_NETWORKD_TRUE@ $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service -@ENABLE_NETWORKD_TRUE@am__append_282 = \ +@ENABLE_NETWORKD_TRUE@am__append_316 = \ +@ENABLE_NETWORKD_TRUE@ systemd-networkd.service dbus-org.freedesktop.network1.service + +@ENABLE_NETWORKD_TRUE@am__append_317 = \ +@ENABLE_NETWORKD_TRUE@ org.freedesktop.network1.busname + +@ENABLE_NETWORKD_TRUE@am__append_318 = \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-network-gperf.gperf \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-gperf.gperf \ @ENABLE_NETWORKD_TRUE@ units/systemd-networkd.service.in \ @ENABLE_NETWORKD_TRUE@ units/systemd-networkd-wait-online.service.in -@ENABLE_NETWORKD_TRUE@am__append_283 = \ +@ENABLE_NETWORKD_TRUE@am__append_319 = \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-network-gperf.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-gperf.c -@ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@am__append_284 = \ +@ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@am__append_320 = \ @ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@ src/login/logind-acl.c -@ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@am__append_285 = \ +@ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@am__append_321 = \ @ENABLE_LOGIND_TRUE@@HAVE_ACL_TRUE@ libsystemd-acl.la -@ENABLE_LOGIND_TRUE@am__append_286 = \ +@ENABLE_LOGIND_TRUE@am__append_322 = \ @ENABLE_LOGIND_TRUE@ libsystemd-logind-core.la -@ENABLE_LOGIND_TRUE@am__append_287 = \ +@ENABLE_LOGIND_TRUE@am__append_323 = \ @ENABLE_LOGIND_TRUE@ systemd-logind \ @ENABLE_LOGIND_TRUE@ systemd-user-sessions -@ENABLE_LOGIND_TRUE@am__append_288 = loginctl systemd-inhibit -@ENABLE_LOGIND_TRUE@am__append_289 = \ +@ENABLE_LOGIND_TRUE@am__append_324 = loginctl systemd-inhibit +@ENABLE_LOGIND_TRUE@am__append_325 = \ @ENABLE_LOGIND_TRUE@ shell-completion/bash/loginctl -@ENABLE_LOGIND_TRUE@am__append_290 = \ +@ENABLE_LOGIND_TRUE@am__append_326 = \ @ENABLE_LOGIND_TRUE@ shell-completion/zsh/_loginctl \ @ENABLE_LOGIND_TRUE@ shell-completion/zsh/_systemd-inhibit -@ENABLE_LOGIND_TRUE@am__append_291 = \ +@ENABLE_LOGIND_TRUE@am__append_327 = \ @ENABLE_LOGIND_TRUE@ test-login \ @ENABLE_LOGIND_TRUE@ test-inhibit -@ENABLE_LOGIND_TRUE@am__append_292 = \ +@ENABLE_LOGIND_TRUE@am__append_328 = \ @ENABLE_LOGIND_TRUE@ test-login-tables \ @ENABLE_LOGIND_TRUE@ test-login-shared -@ENABLE_LOGIND_TRUE@am__append_293 = \ +@ENABLE_LOGIND_TRUE@am__append_329 = \ @ENABLE_LOGIND_TRUE@ units/systemd-logind.service \ @ENABLE_LOGIND_TRUE@ units/systemd-user-sessions.service -@ENABLE_LOGIND_TRUE@am__append_294 = \ +@ENABLE_LOGIND_TRUE@am__append_330 = \ @ENABLE_LOGIND_TRUE@ units/user.slice -@ENABLE_LOGIND_TRUE@am__append_295 = \ +@ENABLE_LOGIND_TRUE@am__append_331 = \ @ENABLE_LOGIND_TRUE@ units/org.freedesktop.login1.busname -@ENABLE_LOGIND_TRUE@am__append_296 = \ +@ENABLE_LOGIND_TRUE@am__append_332 = \ @ENABLE_LOGIND_TRUE@ src/login/org.freedesktop.login1.service -@ENABLE_LOGIND_TRUE@am__append_297 = \ +@ENABLE_LOGIND_TRUE@am__append_333 = \ @ENABLE_LOGIND_TRUE@ src/login/org.freedesktop.login1.conf -@ENABLE_LOGIND_TRUE@am__append_298 = \ +@ENABLE_LOGIND_TRUE@am__append_334 = \ @ENABLE_LOGIND_TRUE@ src/login/logind.conf -@ENABLE_LOGIND_TRUE@am__append_299 = \ +@ENABLE_LOGIND_TRUE@am__append_335 = \ @ENABLE_LOGIND_TRUE@ src/login/org.freedesktop.login1.policy -@ENABLE_LOGIND_TRUE@am__append_300 = \ +@ENABLE_LOGIND_TRUE@am__append_336 = \ @ENABLE_LOGIND_TRUE@ $(systemdstatedir) -@ENABLE_LOGIND_TRUE@am__append_301 = \ +@ENABLE_LOGIND_TRUE@am__append_337 = \ @ENABLE_LOGIND_TRUE@ systemd-logind.service \ @ENABLE_LOGIND_TRUE@ systemd-user-sessions.service -@ENABLE_LOGIND_TRUE@am__append_302 = \ +@ENABLE_LOGIND_TRUE@am__append_338 = \ @ENABLE_LOGIND_TRUE@ systemd-logind.service dbus-org.freedesktop.login1.service -@ENABLE_LOGIND_TRUE@am__append_303 = \ +@ENABLE_LOGIND_TRUE@am__append_339 = \ @ENABLE_LOGIND_TRUE@ org.freedesktop.login1.busname -@ENABLE_LOGIND_TRUE@am__append_304 = \ +@ENABLE_LOGIND_TRUE@am__append_340 = \ @ENABLE_LOGIND_TRUE@ src/login/70-uaccess.rules \ @ENABLE_LOGIND_TRUE@ src/login/70-power-switch.rules -@ENABLE_LOGIND_TRUE@am__append_305 = \ +@ENABLE_LOGIND_TRUE@am__append_341 = \ @ENABLE_LOGIND_TRUE@ src/login/71-seat.rules \ @ENABLE_LOGIND_TRUE@ src/login/73-seat-late.rules -@ENABLE_LOGIND_TRUE@am__append_306 = \ +@ENABLE_LOGIND_TRUE@am__append_342 = \ @ENABLE_LOGIND_TRUE@ src/login/logind-gperf.c \ @ENABLE_LOGIND_TRUE@ src/login/71-seat.rules \ @ENABLE_LOGIND_TRUE@ src/login/73-seat-late.rules -@HAVE_PYTHON_DEVEL_TRUE@am__append_307 = \ +@HAVE_PYTHON_DEVEL_TRUE@am__append_343 = \ @HAVE_PYTHON_DEVEL_TRUE@ src/python-systemd/id128-constants.h # ------------------------------------------------------------------------------ -@ENABLE_COMPAT_LIBS_TRUE@am__append_308 = \ +@ENABLE_COMPAT_LIBS_TRUE@am__append_344 = \ @ENABLE_COMPAT_LIBS_TRUE@ src/compat-libs/linkwarning.h -@ENABLE_COMPAT_LIBS_TRUE@am__append_309 = \ +@ENABLE_COMPAT_LIBS_TRUE@am__append_345 = \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-journal.c \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-login.c \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-id128.c \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-daemon.c -@ENABLE_COMPAT_LIBS_TRUE@am__append_310 = \ +@ENABLE_COMPAT_LIBS_TRUE@am__append_346 = \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-journal.la \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-login.la \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-id128.la \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-daemon.la -@ENABLE_COMPAT_LIBS_TRUE@am__append_311 = \ +@ENABLE_COMPAT_LIBS_TRUE@am__append_347 = \ @ENABLE_COMPAT_LIBS_TRUE@ src/compat-libs/libsystemd-journal.pc \ @ENABLE_COMPAT_LIBS_TRUE@ src/compat-libs/libsystemd-login.pc \ @ENABLE_COMPAT_LIBS_TRUE@ src/compat-libs/libsystemd-id128.pc \ @ENABLE_COMPAT_LIBS_TRUE@ src/compat-libs/libsystemd-daemon.pc -@ENABLE_COMPAT_LIBS_TRUE@am__append_312 = compat-lib-install-hook -@ENABLE_COMPAT_LIBS_TRUE@am__append_313 = compat-lib-uninstall-hook -@ENABLE_MANPAGES_TRUE@am__append_314 = \ +@ENABLE_COMPAT_LIBS_TRUE@am__append_348 = compat-lib-install-hook +@ENABLE_COMPAT_LIBS_TRUE@am__append_349 = compat-lib-uninstall-hook +@ENABLE_MANPAGES_TRUE@am__append_350 = \ @ENABLE_MANPAGES_TRUE@ man/custom-entities.ent -@HAVE_SYSV_COMPAT_TRUE@am__append_315 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_351 = \ @HAVE_SYSV_COMPAT_TRUE@ docs/sysvinit/README \ @HAVE_SYSV_COMPAT_TRUE@ docs/var-log/README -@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_316 = \ +@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_352 = \ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@ systemd-update-utmp-runlevel.service -@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_317 = \ +@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_353 = \ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@ systemd-update-utmp-runlevel.service -@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_318 = \ +@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_354 = \ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@ systemd-update-utmp-runlevel.service -@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_319 = \ +@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_355 = \ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@ systemd-update-utmp-runlevel.service -@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_320 = \ +@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_356 = \ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@ systemd-update-utmp-runlevel.service -@HAVE_UTMP_TRUE@am__append_321 = \ +@HAVE_UTMP_TRUE@am__append_357 = \ @HAVE_UTMP_TRUE@ systemd-update-utmp.service -@HAVE_SYSV_COMPAT_TRUE@am__append_322 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_358 = \ @HAVE_SYSV_COMPAT_TRUE@ poweroff.target runlevel0.target \ @HAVE_SYSV_COMPAT_TRUE@ rescue.target runlevel1.target \ @HAVE_SYSV_COMPAT_TRUE@ multi-user.target runlevel2.target \ @@ -1411,28 +1535,28 @@ DIST_COMMON = $(srcdir)/Makefile-man.am $(srcdir)/Makefile.in \ @HAVE_SYSV_COMPAT_TRUE@ graphical.target runlevel5.target \ @HAVE_SYSV_COMPAT_TRUE@ reboot.target runlevel6.target -@ENABLE_KDBUS_TRUE@am__append_323 = \ +@ENABLE_KDBUS_TRUE@am__append_359 = \ @ENABLE_KDBUS_TRUE@ $(systemunitdir)/busnames.target busnames.target -@HAVE_SYSV_COMPAT_TRUE@am__append_324 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_360 = \ @HAVE_SYSV_COMPAT_TRUE@ $(systemunitdir)/runlevel1.target.wants \ @HAVE_SYSV_COMPAT_TRUE@ $(systemunitdir)/runlevel2.target.wants \ @HAVE_SYSV_COMPAT_TRUE@ $(systemunitdir)/runlevel3.target.wants \ @HAVE_SYSV_COMPAT_TRUE@ $(systemunitdir)/runlevel4.target.wants \ @HAVE_SYSV_COMPAT_TRUE@ $(systemunitdir)/runlevel5.target.wants -@HAVE_SYSV_COMPAT_TRUE@am__append_325 = \ +@HAVE_SYSV_COMPAT_TRUE@am__append_361 = \ @HAVE_SYSV_COMPAT_TRUE@ --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \ @HAVE_SYSV_COMPAT_TRUE@ --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir) -@HAVE_SYSV_COMPAT_FALSE@am__append_326 = \ +@HAVE_SYSV_COMPAT_FALSE@am__append_362 = \ @HAVE_SYSV_COMPAT_FALSE@ --with-sysvinit-path= \ @HAVE_SYSV_COMPAT_FALSE@ --with-sysvrcnd-path= -@HAVE_PYTHON_TRUE@am__append_327 = \ +@HAVE_PYTHON_TRUE@am__append_363 = \ @HAVE_PYTHON_TRUE@ --with-python -@ENABLE_GTK_DOC_TRUE@am__append_328 = \ +@ENABLE_GTK_DOC_TRUE@am__append_364 = \ @ENABLE_GTK_DOC_TRUE@ --enable-gtk-doc subdir = . @@ -1482,28 +1606,29 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pamlibdir)" \ "$(DESTDIR)$(rootbindir)" "$(DESTDIR)$(rootlibexecdir)" \ "$(DESTDIR)$(systemgeneratordir)" \ "$(DESTDIR)$(udevlibexecdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(kernelinstalldir)" "$(DESTDIR)$(pkgpyexecdir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ - "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(bashcompletiondir)" \ - "$(DESTDIR)$(catalogdir)" "$(DESTDIR)$(dbuspolicydir)" \ + "$(DESTDIR)$(kernelinstalldir)" "$(DESTDIR)$(xinitrcdir)" \ + "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" \ + "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" \ + "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(catalogdir)" \ + "$(DESTDIR)$(dbuspolicydir)" \ "$(DESTDIR)$(dbussystemservicedir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(factory_etcdir)" "$(DESTDIR)$(factory_pamdir)" \ "$(DESTDIR)$(gatewayddocumentrootdir)" \ "$(DESTDIR)$(networkdir)" "$(DESTDIR)$(pamconfdir)" \ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)" \ - "$(DESTDIR)$(sysctldir)" "$(DESTDIR)$(systempresetdir)" \ - "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" \ - "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevconfdir)" \ - "$(DESTDIR)$(udevhwdbdir)" "$(DESTDIR)$(udevrulesdir)" \ - "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" \ - "$(DESTDIR)$(girdir)" "$(DESTDIR)$(bashcompletiondir)" \ - "$(DESTDIR)$(pkgsysconfdir)" "$(DESTDIR)$(polkitpolicydir)" \ - "$(DESTDIR)$(rpmmacrosdir)" "$(DESTDIR)$(systemunitdir)" \ + "$(DESTDIR)$(rootlibexecdir)" "$(DESTDIR)$(sysctldir)" \ + "$(DESTDIR)$(systempresetdir)" "$(DESTDIR)$(systemunitdir)" \ "$(DESTDIR)$(sysusersdir)" "$(DESTDIR)$(tmpfilesdir)" \ + "$(DESTDIR)$(udevconfdir)" "$(DESTDIR)$(udevhwdbdir)" \ "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(userunitdir)" \ - "$(DESTDIR)$(zshcompletiondir)" \ - "$(DESTDIR)$(pkgconfigdatadir)" "$(DESTDIR)$(pkgconfiglibdir)" \ + "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(pkgsysconfdir)" \ + "$(DESTDIR)$(polkitpolicydir)" "$(DESTDIR)$(rpmmacrosdir)" \ + "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" \ + "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevrulesdir)" \ + "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" \ + "$(DESTDIR)$(pkgconfiglibdir)" \ "$(DESTDIR)$(sharepkgconfigdir)" "$(DESTDIR)$(sysctldir)" \ "$(DESTDIR)$(sysvinitdir)" "$(DESTDIR)$(typelibsdir)" \ "$(DESTDIR)$(varlogdir)" "$(DESTDIR)$(includedir)" \ @@ -1614,8 +1739,8 @@ libnss_mymachines_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(LDFLAGS) -o $@ @ENABLE_MACHINED_TRUE@am_libnss_mymachines_la_rpath = -rpath $(libdir) @ENABLE_RESOLVED_TRUE@libnss_resolve_la_DEPENDENCIES = \ -@ENABLE_RESOLVED_TRUE@ libsystemd-shared.la \ -@ENABLE_RESOLVED_TRUE@ libsystemd-internal.la +@ENABLE_RESOLVED_TRUE@ libsystemd-internal.la \ +@ENABLE_RESOLVED_TRUE@ libsystemd-shared.la am__libnss_resolve_la_SOURCES_DIST = src/nss-resolve/nss-resolve.sym \ src/nss-resolve/nss-resolve.c @ENABLE_RESOLVED_TRUE@am_libnss_resolve_la_OBJECTS = \ @@ -1642,7 +1767,7 @@ libsystemd_core_la_DEPENDENCIES = libsystemd-units.la \ libsystemd-internal.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__append_69) + $(am__DEPENDENCIES_1) $(am__append_74) am_libsystemd_core_la_OBJECTS = src/core/libsystemd_core_la-unit.lo \ src/core/libsystemd_core_la-unit-printf.lo \ src/core/libsystemd_core_la-job.lo \ @@ -1652,8 +1777,8 @@ am_libsystemd_core_la_OBJECTS = src/core/libsystemd_core_la-unit.lo \ src/core/libsystemd_core_la-service.lo \ src/core/libsystemd_core_la-socket.lo \ src/core/libsystemd_core_la-busname.lo \ - src/core/libsystemd_core_la-bus-common.lo \ src/core/libsystemd_core_la-bus-endpoint.lo \ + src/core/libsystemd_core_la-bus-policy.lo \ src/core/libsystemd_core_la-target.lo \ src/core/libsystemd_core_la-snapshot.lo \ src/core/libsystemd_core_la-device.lo \ @@ -1728,6 +1853,18 @@ libsystemd_daemon_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ libsystemd_dump_la_LIBADD = am_libsystemd_dump_la_OBJECTS = src/libsystemd/sd-bus/bus-dump.lo libsystemd_dump_la_OBJECTS = $(am_libsystemd_dump_la_OBJECTS) +@HAVE_LIBIPTC_TRUE@libsystemd_fw_la_DEPENDENCIES = \ +@HAVE_LIBIPTC_TRUE@ $(am__DEPENDENCIES_1) +am__libsystemd_fw_la_SOURCES_DIST = src/shared/fw-util.h \ + src/shared/fw-util.c +@HAVE_LIBIPTC_TRUE@am_libsystemd_fw_la_OBJECTS = \ +@HAVE_LIBIPTC_TRUE@ src/shared/libsystemd_fw_la-fw-util.lo +libsystemd_fw_la_OBJECTS = $(am_libsystemd_fw_la_OBJECTS) +libsystemd_fw_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libsystemd_fw_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +@HAVE_LIBIPTC_TRUE@am_libsystemd_fw_la_rpath = @ENABLE_COMPAT_LIBS_TRUE@libsystemd_id128_la_DEPENDENCIES = \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-internal.la \ @ENABLE_COMPAT_LIBS_TRUE@ libsystemd-shared.la @@ -1776,7 +1913,8 @@ am_libsystemd_internal_la_OBJECTS = \ src/libsystemd/sd-login/libsystemd_internal_la-sd-login.lo \ src/libsystemd/sd-path/libsystemd_internal_la-sd-path.lo \ src/libsystemd/sd-network/libsystemd_internal_la-sd-network.lo \ - src/libsystemd/sd-network/libsystemd_internal_la-network-util.lo + src/libsystemd/sd-network/libsystemd_internal_la-network-util.lo \ + src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo nodist_libsystemd_internal_la_OBJECTS = libsystemd_internal_la_OBJECTS = $(am_libsystemd_internal_la_OBJECTS) \ $(nodist_libsystemd_internal_la_OBJECTS) @@ -1787,7 +1925,7 @@ libsystemd_internal_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ libsystemd_journal_core_la_DEPENDENCIES = \ libsystemd-journal-internal.la libudev-internal.la \ libsystemd-label.la libsystemd-internal.la \ - libsystemd-shared.la $(am__append_157) + libsystemd-shared.la $(am__append_171) am_libsystemd_journal_core_la_OBJECTS = src/journal/journald-kmsg.lo \ src/journal/journald-syslog.lo src/journal/journald-stream.lo \ src/journal/journald-server.lo src/journal/journald-console.lo \ @@ -1801,8 +1939,9 @@ libsystemd_journal_core_la_OBJECTS = \ $(nodist_libsystemd_journal_core_la_OBJECTS) @HAVE_XZ_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @HAVE_GCRYPT_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) -libsystemd_journal_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) +libsystemd_journal_internal_la_DEPENDENCIES = libsystemd-label.la \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_3) am__libsystemd_journal_internal_la_SOURCES_DIST = \ src/journal/sd-journal.c src/systemd/sd-journal.h \ src/systemd/_sd-common.h src/journal/journal-file.c \ @@ -1861,7 +2000,10 @@ am_libsystemd_label_la_OBJECTS = \ src/shared/libsystemd_label_la-dev-setup.lo \ src/shared/libsystemd_label_la-dropin.lo \ src/shared/libsystemd_label_la-condition.lo \ - src/shared/libsystemd_label_la-generator.lo + src/shared/libsystemd_label_la-generator.lo \ + src/shared/libsystemd_label_la-btrfs-util.lo \ + src/shared/libsystemd_label_la-machine-image.lo \ + src/shared/libsystemd_label_la-copy.lo libsystemd_label_la_OBJECTS = $(am_libsystemd_label_la_OBJECTS) libsystemd_label_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -1883,7 +2025,7 @@ libsystemd_login_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @ENABLE_LOGIND_TRUE@libsystemd_logind_core_la_DEPENDENCIES = \ @ENABLE_LOGIND_TRUE@ libsystemd-label.la libsystemd-internal.la \ @ENABLE_LOGIND_TRUE@ libudev-internal.la libsystemd-shared.la \ -@ENABLE_LOGIND_TRUE@ $(am__append_285) +@ENABLE_LOGIND_TRUE@ $(am__append_321) am__libsystemd_logind_core_la_SOURCES_DIST = src/login/logind-core.c \ src/login/logind-device.c src/login/logind-device.h \ src/login/logind-button.c src/login/logind-button.h \ @@ -1924,13 +2066,15 @@ libsystemd_logs_la_OBJECTS = $(am_libsystemd_logs_la_OBJECTS) @ENABLE_MACHINED_TRUE@ libsystemd-label.la \ @ENABLE_MACHINED_TRUE@ libsystemd-internal.la \ @ENABLE_MACHINED_TRUE@ libudev-internal.la libsystemd-shared.la -am__libsystemd_machine_core_la_SOURCES_DIST = \ - src/machine/machined-dbus.c src/machine/machine.c \ - src/machine/machine.h src/machine/machine-dbus.c +am__libsystemd_machine_core_la_SOURCES_DIST = src/machine/machine.c \ + src/machine/machine.h src/machine/machined-dbus.c \ + src/machine/machine-dbus.c src/machine/machine-dbus.h \ + src/machine/image-dbus.c src/machine/image-dbus.h @ENABLE_MACHINED_TRUE@am_libsystemd_machine_core_la_OBJECTS = \ -@ENABLE_MACHINED_TRUE@ src/machine/machined-dbus.lo \ @ENABLE_MACHINED_TRUE@ src/machine/machine.lo \ -@ENABLE_MACHINED_TRUE@ src/machine/machine-dbus.lo +@ENABLE_MACHINED_TRUE@ src/machine/machined-dbus.lo \ +@ENABLE_MACHINED_TRUE@ src/machine/machine-dbus.lo \ +@ENABLE_MACHINED_TRUE@ src/machine/image-dbus.lo libsystemd_machine_core_la_OBJECTS = \ $(am_libsystemd_machine_core_la_OBJECTS) @ENABLE_MACHINED_TRUE@am_libsystemd_machine_core_la_rpath = @@ -1952,7 +2096,13 @@ am_libsystemd_network_la_OBJECTS = src/libsystemd-network/libsystemd_network_la- src/libsystemd-network/libsystemd_network_la-sd-dhcp6-client.lo \ src/libsystemd-network/libsystemd_network_la-dhcp6-network.lo \ src/libsystemd-network/libsystemd_network_la-dhcp6-option.lo \ - src/libsystemd-network/libsystemd_network_la-sd-dhcp6-lease.lo + src/libsystemd-network/libsystemd_network_la-sd-dhcp6-lease.lo \ + src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo \ + src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo \ + src/libsystemd-network/libsystemd_network_la-lldp-network.lo \ + src/libsystemd-network/libsystemd_network_la-lldp-port.lo \ + src/libsystemd-network/libsystemd_network_la-lldp-internal.lo \ + src/libsystemd-network/libsystemd_network_la-sd-lldp.lo libsystemd_network_la_OBJECTS = $(am_libsystemd_network_la_OBJECTS) libsystemd_network_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -1972,6 +2122,7 @@ am__libsystemd_networkd_core_la_SOURCES_DIST = \ src/network/networkd-netdev-vxlan.h \ src/network/networkd-netdev-vlan.h \ src/network/networkd-netdev-macvlan.h \ + src/network/networkd-netdev-ipvlan.h \ src/network/networkd-netdev-dummy.h \ src/network/networkd-netdev-tuntap.h \ src/network/networkd-netdev-bond.h \ @@ -1982,14 +2133,18 @@ am__libsystemd_networkd_core_la_SOURCES_DIST = \ src/network/networkd-netdev-vxlan.c \ src/network/networkd-netdev-vlan.c \ src/network/networkd-netdev-macvlan.c \ + src/network/networkd-netdev-ipvlan.c \ src/network/networkd-netdev-dummy.c \ src/network/networkd-netdev-tuntap.c \ src/network/networkd-netdev-bond.c \ src/network/networkd-netdev-bridge.c \ - src/network/networkd-link.c src/network/networkd-ipv4ll.c \ - src/network/networkd-dhcp4.c src/network/networkd-dhcp6.c \ - src/network/networkd-network.c src/network/networkd-address.c \ - src/network/networkd-route.c src/network/networkd-manager.c \ + src/network/networkd-link.c src/network/networkd-link-bus.c \ + src/network/networkd-ipv4ll.c src/network/networkd-dhcp4.c \ + src/network/networkd-dhcp6.c src/network/networkd-network.c \ + src/network/networkd-network-bus.c \ + src/network/networkd-address.c src/network/networkd-route.c \ + src/network/networkd-manager.c \ + src/network/networkd-manager-bus.c src/network/networkd-fdb.c \ src/network/networkd-address-pool.c @ENABLE_NETWORKD_TRUE@am_libsystemd_networkd_core_la_OBJECTS = src/network/libsystemd_networkd_core_la-networkd-netdev.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-tunnel.lo \ @@ -1997,18 +2152,23 @@ am__libsystemd_networkd_core_la_SOURCES_DIST = \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-vxlan.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-vlan.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-macvlan.lo \ +@ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-dummy.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-tuntap.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-bond.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-bridge.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-link.lo \ +@ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-link-bus.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-ipv4ll.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-dhcp4.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-dhcp6.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-network.lo \ +@ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-network-bus.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-address.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-route.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-manager.lo \ +@ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo \ +@ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-fdb.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-address-pool.lo @ENABLE_NETWORKD_TRUE@nodist_libsystemd_networkd_core_la_OBJECTS = src/network/libsystemd_networkd_core_la-networkd-network-gperf.lo \ @ENABLE_NETWORKD_TRUE@ src/network/libsystemd_networkd_core_la-networkd-netdev-gperf.lo @@ -2020,6 +2180,18 @@ libsystemd_networkd_core_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_NETWORKD_TRUE@am_libsystemd_networkd_core_la_rpath = +libsystemd_proxy_la_DEPENDENCIES = libsystemd-internal.la \ + libsystemd-shared.la +am_libsystemd_proxy_la_OBJECTS = \ + src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo \ + src/bus-proxyd/libsystemd_proxy_la-driver.lo \ + src/bus-proxyd/libsystemd_proxy_la-proxy.lo \ + src/bus-proxyd/libsystemd_proxy_la-synthesize.lo +libsystemd_proxy_la_OBJECTS = $(am_libsystemd_proxy_la_OBJECTS) +libsystemd_proxy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ libsystemd_resolve_la_DEPENDENCIES = am_libsystemd_resolve_la_OBJECTS = \ src/libsystemd/sd-resolve/libsystemd_resolve_la-sd-resolve.lo @@ -2050,7 +2222,8 @@ am__libsystemd_shared_la_SOURCES_DIST = src/shared/capability.c \ src/shared/device-nodes.h src/shared/util.c src/shared/util.h \ src/shared/virt.c src/shared/virt.h src/shared/architecture.c \ src/shared/architecture.h src/shared/efivars.c \ - src/shared/efivars.h src/shared/path-util.c \ + src/shared/efivars.h src/shared/fstab-util.c \ + src/shared/fstab-util.h src/shared/path-util.c \ src/shared/path-util.h src/shared/time-util.c \ src/shared/time-util.h src/shared/locale-util.c \ src/shared/locale-util.h src/shared/mempool.c \ @@ -2095,16 +2268,18 @@ am__libsystemd_shared_la_SOURCES_DIST = src/shared/capability.c \ src/shared/arphrd-list.c src/shared/arphrd-list.h \ src/shared/cap-list.c src/shared/cap-list.h src/shared/audit.c \ src/shared/audit.h src/shared/xml.c src/shared/xml.h \ - src/shared/bus-label.c src/shared/bus-label.h src/shared/gpt.h \ - src/shared/clean-ipc.h src/shared/clean-ipc.c \ - src/shared/login-shared.c src/shared/login-shared.h \ - src/shared/ring.c src/shared/ring.h src/shared/barrier.c \ - src/shared/barrier.h src/shared/pty.c src/shared/pty.h \ - src/shared/async.c src/shared/async.h src/shared/copy.c \ - src/shared/copy.h src/shared/base-filesystem.c \ - src/shared/base-filesystem.h src/shared/memfd-util.c \ - src/shared/memfd-util.h src/shared/uid-range.c \ - src/shared/uid-range.h src/shared/nss-util.h \ + src/shared/json.c src/shared/json.h src/shared/bus-label.c \ + src/shared/bus-label.h src/shared/gpt.h src/shared/clean-ipc.h \ + src/shared/clean-ipc.c src/shared/login-shared.c \ + src/shared/login-shared.h src/shared/ring.c src/shared/ring.h \ + src/shared/barrier.c src/shared/barrier.h src/shared/pty.c \ + src/shared/pty.h src/shared/async.c src/shared/async.h \ + src/shared/base-filesystem.c src/shared/base-filesystem.h \ + src/shared/memfd-util.c src/shared/memfd-util.h \ + src/shared/uid-range.c src/shared/uid-range.h \ + src/shared/nss-util.h src/shared/verbs.c src/shared/verbs.h \ + src/shared/sigbus.c src/shared/sigbus.h src/shared/build.h \ + src/shared/import-util.c src/shared/import-util.h \ src/shared/utmp-wtmp.c @HAVE_UTMP_TRUE@am__objects_3 = \ @HAVE_UTMP_TRUE@ src/shared/libsystemd_shared_la-utmp-wtmp.lo @@ -2115,6 +2290,7 @@ am_libsystemd_shared_la_OBJECTS = \ src/shared/libsystemd_shared_la-virt.lo \ src/shared/libsystemd_shared_la-architecture.lo \ src/shared/libsystemd_shared_la-efivars.lo \ + src/shared/libsystemd_shared_la-fstab-util.lo \ src/shared/libsystemd_shared_la-path-util.lo \ src/shared/libsystemd_shared_la-time-util.lo \ src/shared/libsystemd_shared_la-locale-util.lo \ @@ -2163,6 +2339,7 @@ am_libsystemd_shared_la_OBJECTS = \ src/shared/libsystemd_shared_la-cap-list.lo \ src/shared/libsystemd_shared_la-audit.lo \ src/shared/libsystemd_shared_la-xml.lo \ + src/shared/libsystemd_shared_la-json.lo \ src/shared/libsystemd_shared_la-bus-label.lo \ src/shared/libsystemd_shared_la-clean-ipc.lo \ src/shared/libsystemd_shared_la-login-shared.lo \ @@ -2170,10 +2347,13 @@ am_libsystemd_shared_la_OBJECTS = \ src/shared/libsystemd_shared_la-barrier.lo \ src/shared/libsystemd_shared_la-pty.lo \ src/shared/libsystemd_shared_la-async.lo \ - src/shared/libsystemd_shared_la-copy.lo \ src/shared/libsystemd_shared_la-base-filesystem.lo \ src/shared/libsystemd_shared_la-memfd-util.lo \ - src/shared/libsystemd_shared_la-uid-range.lo $(am__objects_3) + src/shared/libsystemd_shared_la-uid-range.lo \ + src/shared/libsystemd_shared_la-verbs.lo \ + src/shared/libsystemd_shared_la-sigbus.lo \ + src/shared/libsystemd_shared_la-import-util.lo \ + $(am__objects_3) nodist_libsystemd_shared_la_OBJECTS = libsystemd_shared_la_OBJECTS = $(am_libsystemd_shared_la_OBJECTS) \ $(nodist_libsystemd_shared_la_OBJECTS) @@ -2209,8 +2389,8 @@ am_libsystemd_units_la_OBJECTS = src/shared/install.lo \ src/shared/specifier.lo libsystemd_units_la_OBJECTS = $(am_libsystemd_units_la_OBJECTS) am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) -am__DEPENDENCIES_5 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_3) +am__DEPENDENCIES_5 = libsystemd-label.la $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) libsystemd_la_DEPENDENCIES = libsystemd-shared.la \ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ $(am__DEPENDENCIES_1) @@ -2220,7 +2400,8 @@ am__libsystemd_la_SOURCES_DIST = src/systemd/sd-bus.h \ src/systemd/sd-rtnl.h src/systemd/sd-resolve.h \ src/systemd/sd-login.h src/systemd/sd-id128.h \ src/systemd/sd-daemon.h src/systemd/sd-path.h \ - src/systemd/sd-network.h src/libsystemd/sd-bus/sd-bus.c \ + src/systemd/sd-network.h src/systemd/sd-hwdb.h \ + src/libsystemd/sd-bus/sd-bus.c \ src/libsystemd/sd-bus/bus-control.c \ src/libsystemd/sd-bus/bus-control.h \ src/libsystemd/sd-bus/bus-error.c \ @@ -2280,6 +2461,9 @@ am__libsystemd_la_SOURCES_DIST = src/systemd/sd-bus.h \ src/libsystemd/sd-network/sd-network.c \ src/libsystemd/sd-network/network-util.h \ src/libsystemd/sd-network/network-util.c \ + src/libsystemd/sd-hwdb/sd-hwdb.c \ + src/libsystemd/sd-hwdb/hwdb-util.h \ + src/libsystemd/sd-hwdb/hwdb-internal.h \ src/libsystemd/sd-resolve/sd-resolve.c \ src/libsystemd/sd-resolve/resolve-util.h \ src/journal/sd-journal.c src/systemd/sd-journal.h \ @@ -2327,7 +2511,8 @@ am__objects_4 = src/libsystemd/sd-bus/libsystemd_la-sd-bus.lo \ src/libsystemd/sd-login/libsystemd_la-sd-login.lo \ src/libsystemd/sd-path/libsystemd_la-sd-path.lo \ src/libsystemd/sd-network/libsystemd_la-sd-network.lo \ - src/libsystemd/sd-network/libsystemd_la-network-util.lo + src/libsystemd/sd-network/libsystemd_la-network-util.lo \ + src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo am__objects_5 = src/libsystemd/sd-resolve/libsystemd_la-sd-resolve.lo @HAVE_GCRYPT_TRUE@am__objects_6 = src/journal/libsystemd_la-journal-authenticate.lo \ @HAVE_GCRYPT_TRUE@ src/journal/libsystemd_la-fsprg.lo @@ -2352,7 +2537,7 @@ libsystemd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ libudev_core_la_DEPENDENCIES = libudev-internal.la libsystemd-label.la \ libsystemd-internal.la libsystemd-network.la \ libsystemd-shared.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__append_129) + $(am__DEPENDENCIES_1) $(am__append_136) am__libudev_core_la_SOURCES_DIST = src/udev/udev.h \ src/udev/udev-event.c src/udev/udev-watch.c \ src/udev/udev-node.c src/udev/udev-rules.c \ @@ -2462,52 +2647,57 @@ pam_systemd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @ENABLE_TERMINAL_TRUE@am__EXEEXT_6 = systemd-evcat$(EXEEXT) \ @ENABLE_TERMINAL_TRUE@ systemd-modeset$(EXEEXT) \ @ENABLE_TERMINAL_TRUE@ systemd-subterm$(EXEEXT) -@HAVE_KMOD_TRUE@am__EXEEXT_7 = test-rtnl-manual$(EXEEXT) -@ENABLE_EFI_TRUE@am__EXEEXT_8 = test-boot-timestamp$(EXEEXT) -@ENABLE_COREDUMP_TRUE@am__EXEEXT_9 = test-coredump-vacuum$(EXEEXT) -@ENABLE_LOGIND_TRUE@am__EXEEXT_10 = test-login$(EXEEXT) \ +@HAVE_LIBIPTC_TRUE@am__EXEEXT_7 = test-fw-util$(EXEEXT) +@HAVE_KMOD_TRUE@am__EXEEXT_8 = test-rtnl-manual$(EXEEXT) +@ENABLE_EFI_TRUE@am__EXEEXT_9 = test-boot-timestamp$(EXEEXT) +@ENABLE_COREDUMP_TRUE@am__EXEEXT_10 = test-coredump-vacuum$(EXEEXT) +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__EXEEXT_11 = test-qcow2$(EXEEXT) +@ENABLE_LOGIND_TRUE@am__EXEEXT_12 = test-login$(EXEEXT) \ @ENABLE_LOGIND_TRUE@ test-inhibit$(EXEEXT) -am__EXEEXT_11 = test-ns$(EXEEXT) test-loopback$(EXEEXT) \ +am__EXEEXT_13 = test-ns$(EXEEXT) test-loopback$(EXEEXT) \ test-hostname$(EXEEXT) test-daemon$(EXEEXT) \ test-cgroup$(EXEEXT) test-install$(EXEEXT) \ test-watchdog$(EXEEXT) test-log$(EXEEXT) test-ipcrm$(EXEEXT) \ - $(am__EXEEXT_7) $(am__EXEEXT_8) test-pppoe$(EXEEXT) \ - test-libudev$(EXEEXT) test-udev$(EXEEXT) \ - test-journal-enum$(EXEEXT) $(am__EXEEXT_9) $(am__EXEEXT_10) -@ENABLE_TERMINAL_TRUE@am__EXEEXT_12 = test-term-page$(EXEEXT) \ + test-btrfs$(EXEEXT) $(am__EXEEXT_7) $(am__EXEEXT_8) \ + $(am__EXEEXT_9) test-pppoe$(EXEEXT) test-libudev$(EXEEXT) \ + test-udev$(EXEEXT) test-journal-enum$(EXEEXT) $(am__EXEEXT_10) \ + $(am__EXEEXT_11) $(am__EXEEXT_12) +@ENABLE_TERMINAL_TRUE@am__EXEEXT_14 = test-term-page$(EXEEXT) \ @ENABLE_TERMINAL_TRUE@ test-term-parser$(EXEEXT) \ @ENABLE_TERMINAL_TRUE@ test-unifont$(EXEEXT) -@HAVE_COMPRESSION_TRUE@am__EXEEXT_13 = test-compress$(EXEEXT) \ +@HAVE_COMPRESSION_TRUE@am__EXEEXT_15 = test-compress$(EXEEXT) \ @HAVE_COMPRESSION_TRUE@ test-compress-benchmark$(EXEEXT) -@ENABLE_MACHINED_TRUE@am__EXEEXT_14 = test-machine-tables$(EXEEXT) -@ENABLE_RESOLVED_TRUE@am__EXEEXT_15 = test-dns-domain$(EXEEXT) -@ENABLE_NETWORKD_TRUE@am__EXEEXT_16 = test-network$(EXEEXT) \ +@ENABLE_MACHINED_TRUE@am__EXEEXT_16 = test-machine-tables$(EXEEXT) +@ENABLE_RESOLVED_TRUE@am__EXEEXT_17 = test-dns-domain$(EXEEXT) +@ENABLE_NETWORKD_TRUE@am__EXEEXT_18 = test-network$(EXEEXT) \ @ENABLE_NETWORKD_TRUE@ test-network-tables$(EXEEXT) -@ENABLE_LOGIND_TRUE@am__EXEEXT_17 = test-login-tables$(EXEEXT) \ +@ENABLE_LOGIND_TRUE@am__EXEEXT_19 = test-login-tables$(EXEEXT) \ @ENABLE_LOGIND_TRUE@ test-login-shared$(EXEEXT) -am__EXEEXT_18 = test-engine$(EXEEXT) test-cgroup-mask$(EXEEXT) \ +am__EXEEXT_20 = test-engine$(EXEEXT) test-cgroup-mask$(EXEEXT) \ test-job-type$(EXEEXT) test-env-replace$(EXEEXT) \ test-strbuf$(EXEEXT) test-strv$(EXEEXT) test-path$(EXEEXT) \ test-path-util$(EXEEXT) test-strxcpyx$(EXEEXT) \ test-unit-name$(EXEEXT) test-unit-file$(EXEEXT) \ test-utf8$(EXEEXT) test-ellipsize$(EXEEXT) test-util$(EXEEXT) \ - test-ring$(EXEEXT) test-barrier$(EXEEXT) test-pty$(EXEEXT) \ - test-tmpfiles$(EXEEXT) test-namespace$(EXEEXT) \ - test-date$(EXEEXT) test-sleep$(EXEEXT) \ + test-path-lookup$(EXEEXT) test-ring$(EXEEXT) \ + test-barrier$(EXEEXT) test-pty$(EXEEXT) test-tmpfiles$(EXEEXT) \ + test-namespace$(EXEEXT) test-date$(EXEEXT) test-sleep$(EXEEXT) \ test-replace-var$(EXEEXT) test-sched-prio$(EXEEXT) \ test-calendarspec$(EXEEXT) test-strip-tab-ansi$(EXEEXT) \ - test-cgroup-util$(EXEEXT) test-prioq$(EXEEXT) \ - test-fileio$(EXEEXT) test-time$(EXEEXT) test-hashmap$(EXEEXT) \ - test-set$(EXEEXT) test-list$(EXEEXT) test-unaligned$(EXEEXT) \ - test-tables$(EXEEXT) test-device-nodes$(EXEEXT) \ - test-xml$(EXEEXT) test-architecture$(EXEEXT) \ + test-cgroup-util$(EXEEXT) test-fstab-util$(EXEEXT) \ + test-prioq$(EXEEXT) test-fileio$(EXEEXT) test-time$(EXEEXT) \ + test-hashmap$(EXEEXT) test-set$(EXEEXT) test-list$(EXEEXT) \ + test-unaligned$(EXEEXT) test-tables$(EXEEXT) \ + test-device-nodes$(EXEEXT) test-xml$(EXEEXT) \ + test-json$(EXEEXT) test-architecture$(EXEEXT) \ test-socket-util$(EXEEXT) test-fdset$(EXEEXT) \ test-conf-files$(EXEEXT) test-capability$(EXEEXT) \ test-async$(EXEEXT) test-ratelimit$(EXEEXT) \ test-condition$(EXEEXT) test-uid-range$(EXEEXT) \ test-bus-policy$(EXEEXT) test-locale-util$(EXEEXT) \ test-execute$(EXEEXT) test-copy$(EXEEXT) \ - test-cap-list$(EXEEXT) test-bus-marshal$(EXEEXT) \ + test-cap-list$(EXEEXT) test-sigbus$(EXEEXT) \ + test-verbs$(EXEEXT) test-bus-marshal$(EXEEXT) \ test-bus-signature$(EXEEXT) test-bus-chat$(EXEEXT) \ test-bus-cleanup$(EXEEXT) test-bus-server$(EXEEXT) \ test-bus-match$(EXEEXT) test-bus-kernel$(EXEEXT) \ @@ -2520,60 +2710,63 @@ am__EXEEXT_18 = test-engine$(EXEEXT) test-cgroup-mask$(EXEEXT) \ test-resolve$(EXEEXT) test-dhcp-option$(EXEEXT) \ test-dhcp-client$(EXEEXT) test-dhcp-server$(EXEEXT) \ test-ipv4ll$(EXEEXT) test-icmp6-rs$(EXEEXT) \ - test-dhcp6-client$(EXEEXT) $(am__EXEEXT_12) \ + test-dhcp6-client$(EXEEXT) test-lldp$(EXEEXT) $(am__EXEEXT_14) \ test-id128$(EXEEXT) test-journal$(EXEEXT) \ test-journal-send$(EXEEXT) test-journal-syslog$(EXEEXT) \ test-journal-match$(EXEEXT) test-journal-stream$(EXEEXT) \ test-journal-init$(EXEEXT) test-journal-verify$(EXEEXT) \ test-journal-interleaving$(EXEEXT) test-journal-flush$(EXEEXT) \ test-mmap-cache$(EXEEXT) test-catalog$(EXEEXT) \ - $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \ - $(am__EXEEXT_16) $(am__EXEEXT_17) test-libsystemd-sym$(EXEEXT) \ + $(am__EXEEXT_15) $(am__EXEEXT_16) $(am__EXEEXT_17) \ + $(am__EXEEXT_18) $(am__EXEEXT_19) test-libsystemd-sym$(EXEEXT) \ test-libudev-sym$(EXEEXT) -@ENABLE_TMPFILES_TRUE@am__EXEEXT_19 = systemd-tmpfiles$(EXEEXT) -@ENABLE_SYSUSERS_TRUE@am__EXEEXT_20 = systemd-sysusers$(EXEEXT) -@ENABLE_FIRSTBOOT_TRUE@am__EXEEXT_21 = systemd-firstboot$(EXEEXT) -@ENABLE_MACHINED_TRUE@am__EXEEXT_22 = machinectl$(EXEEXT) -@ENABLE_NETWORKD_TRUE@am__EXEEXT_23 = networkctl$(EXEEXT) -@ENABLE_LOGIND_TRUE@am__EXEEXT_24 = loginctl$(EXEEXT) \ +@ENABLE_TMPFILES_TRUE@am__EXEEXT_21 = systemd-tmpfiles$(EXEEXT) +@ENABLE_SYSUSERS_TRUE@am__EXEEXT_22 = systemd-sysusers$(EXEEXT) +@ENABLE_FIRSTBOOT_TRUE@am__EXEEXT_23 = systemd-firstboot$(EXEEXT) +@ENABLE_HWDB_TRUE@am__EXEEXT_24 = systemd-hwdb$(EXEEXT) +@ENABLE_MACHINED_TRUE@am__EXEEXT_25 = machinectl$(EXEEXT) +@ENABLE_NETWORKD_TRUE@am__EXEEXT_26 = networkctl$(EXEEXT) +@ENABLE_LOGIND_TRUE@am__EXEEXT_27 = loginctl$(EXEEXT) \ @ENABLE_LOGIND_TRUE@ systemd-inhibit$(EXEEXT) -@HAVE_UTMP_TRUE@am__EXEEXT_25 = systemd-update-utmp$(EXEEXT) -@HAVE_KMOD_TRUE@am__EXEEXT_26 = systemd-modules-load$(EXEEXT) -@ENABLE_HIBERNATE_TRUE@am__EXEEXT_27 = \ +@HAVE_UTMP_TRUE@am__EXEEXT_28 = systemd-update-utmp$(EXEEXT) +@HAVE_KMOD_TRUE@am__EXEEXT_29 = systemd-modules-load$(EXEEXT) +@ENABLE_HIBERNATE_TRUE@am__EXEEXT_30 = \ @ENABLE_HIBERNATE_TRUE@ systemd-hibernate-resume$(EXEEXT) -@ENABLE_TERMINAL_TRUE@am__EXEEXT_28 = systemd-consoled$(EXEEXT) -@HAVE_MICROHTTPD_TRUE@am__EXEEXT_29 = systemd-journal-remote$(EXEEXT) -@HAVE_LIBCURL_TRUE@am__EXEEXT_30 = systemd-journal-upload$(EXEEXT) -@HAVE_MICROHTTPD_TRUE@am__EXEEXT_31 = \ +@ENABLE_TERMINAL_TRUE@am__EXEEXT_31 = systemd-consoled$(EXEEXT) +@HAVE_MICROHTTPD_TRUE@am__EXEEXT_32 = systemd-journal-remote$(EXEEXT) +@HAVE_LIBCURL_TRUE@am__EXEEXT_33 = systemd-journal-upload$(EXEEXT) +@HAVE_MICROHTTPD_TRUE@am__EXEEXT_34 = \ @HAVE_MICROHTTPD_TRUE@ systemd-journal-gatewayd$(EXEEXT) -@ENABLE_COREDUMP_TRUE@am__EXEEXT_32 = systemd-coredump$(EXEEXT) -@ENABLE_BINFMT_TRUE@am__EXEEXT_33 = systemd-binfmt$(EXEEXT) -@ENABLE_VCONSOLE_TRUE@am__EXEEXT_34 = systemd-vconsole-setup$(EXEEXT) -@ENABLE_BOOTCHART_TRUE@am__EXEEXT_35 = systemd-bootchart$(EXEEXT) -@ENABLE_QUOTACHECK_TRUE@am__EXEEXT_36 = systemd-quotacheck$(EXEEXT) -@ENABLE_RANDOMSEED_TRUE@am__EXEEXT_37 = systemd-random-seed$(EXEEXT) -@ENABLE_BACKLIGHT_TRUE@am__EXEEXT_38 = systemd-backlight$(EXEEXT) -@ENABLE_RFKILL_TRUE@am__EXEEXT_39 = systemd-rfkill$(EXEEXT) -@HAVE_LIBCRYPTSETUP_TRUE@am__EXEEXT_40 = systemd-cryptsetup$(EXEEXT) -@ENABLE_HOSTNAMED_TRUE@am__EXEEXT_41 = systemd-hostnamed$(EXEEXT) -@ENABLE_LOCALED_TRUE@am__EXEEXT_42 = systemd-localed$(EXEEXT) -@ENABLE_TIMEDATED_TRUE@am__EXEEXT_43 = systemd-timedated$(EXEEXT) -@ENABLE_TIMESYNCD_TRUE@am__EXEEXT_44 = systemd-timesyncd$(EXEEXT) -@ENABLE_MACHINED_TRUE@am__EXEEXT_45 = systemd-machined$(EXEEXT) -@ENABLE_RESOLVED_TRUE@am__EXEEXT_46 = systemd-resolved$(EXEEXT) \ +@ENABLE_COREDUMP_TRUE@am__EXEEXT_35 = systemd-coredump$(EXEEXT) +@ENABLE_BINFMT_TRUE@am__EXEEXT_36 = systemd-binfmt$(EXEEXT) +@ENABLE_VCONSOLE_TRUE@am__EXEEXT_37 = systemd-vconsole-setup$(EXEEXT) +@ENABLE_BOOTCHART_TRUE@am__EXEEXT_38 = systemd-bootchart$(EXEEXT) +@ENABLE_QUOTACHECK_TRUE@am__EXEEXT_39 = systemd-quotacheck$(EXEEXT) +@ENABLE_RANDOMSEED_TRUE@am__EXEEXT_40 = systemd-random-seed$(EXEEXT) +@ENABLE_BACKLIGHT_TRUE@am__EXEEXT_41 = systemd-backlight$(EXEEXT) +@ENABLE_RFKILL_TRUE@am__EXEEXT_42 = systemd-rfkill$(EXEEXT) +@HAVE_LIBCRYPTSETUP_TRUE@am__EXEEXT_43 = systemd-cryptsetup$(EXEEXT) +@ENABLE_HOSTNAMED_TRUE@am__EXEEXT_44 = systemd-hostnamed$(EXEEXT) +@ENABLE_LOCALED_TRUE@am__EXEEXT_45 = systemd-localed$(EXEEXT) +@ENABLE_TIMEDATED_TRUE@am__EXEEXT_46 = systemd-timedated$(EXEEXT) +@ENABLE_TIMESYNCD_TRUE@am__EXEEXT_47 = systemd-timesyncd$(EXEEXT) +@ENABLE_MACHINED_TRUE@am__EXEEXT_48 = systemd-machined$(EXEEXT) +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am__EXEEXT_49 = systemd-importd$(EXEEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ systemd-pull$(EXEEXT) +@ENABLE_RESOLVED_TRUE@am__EXEEXT_50 = systemd-resolved$(EXEEXT) \ @ENABLE_RESOLVED_TRUE@ systemd-resolve-host$(EXEEXT) -@ENABLE_NETWORKD_TRUE@am__EXEEXT_47 = systemd-networkd$(EXEEXT) \ +@ENABLE_NETWORKD_TRUE@am__EXEEXT_51 = systemd-networkd$(EXEEXT) \ @ENABLE_NETWORKD_TRUE@ systemd-networkd-wait-online$(EXEEXT) -@ENABLE_LOGIND_TRUE@am__EXEEXT_48 = systemd-logind$(EXEEXT) \ +@ENABLE_LOGIND_TRUE@am__EXEEXT_52 = systemd-logind$(EXEEXT) \ @ENABLE_LOGIND_TRUE@ systemd-user-sessions$(EXEEXT) -@HAVE_SYSV_COMPAT_TRUE@am__EXEEXT_49 = \ +@HAVE_SYSV_COMPAT_TRUE@am__EXEEXT_53 = \ @HAVE_SYSV_COMPAT_TRUE@ systemd-sysv-generator$(EXEEXT) \ @HAVE_SYSV_COMPAT_TRUE@ systemd-rc-local-generator$(EXEEXT) -@ENABLE_HIBERNATE_TRUE@am__EXEEXT_50 = systemd-hibernate-resume-generator$(EXEEXT) -@ENABLE_EFI_TRUE@am__EXEEXT_51 = systemd-efi-boot-generator$(EXEEXT) -@HAVE_BLKID_TRUE@am__EXEEXT_52 = systemd-gpt-auto-generator$(EXEEXT) -@ENABLE_KDBUS_TRUE@am__EXEEXT_53 = systemd-dbus1-generator$(EXEEXT) -@HAVE_LIBCRYPTSETUP_TRUE@am__EXEEXT_54 = systemd-cryptsetup-generator$(EXEEXT) +@ENABLE_HIBERNATE_TRUE@am__EXEEXT_54 = systemd-hibernate-resume-generator$(EXEEXT) +@ENABLE_EFI_TRUE@am__EXEEXT_55 = systemd-efi-boot-generator$(EXEEXT) +@HAVE_BLKID_TRUE@am__EXEEXT_56 = systemd-gpt-auto-generator$(EXEEXT) +@ENABLE_KDBUS_TRUE@am__EXEEXT_57 = systemd-dbus1-generator$(EXEEXT) +@HAVE_LIBCRYPTSETUP_TRUE@am__EXEEXT_58 = systemd-cryptsetup-generator$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(rootbin_PROGRAMS) \ $(rootlibexec_PROGRAMS) $(systemgenerator_PROGRAMS) \ $(udevlibexec_PROGRAMS) @@ -2627,7 +2820,7 @@ journalctl_OBJECTS = $(am_journalctl_OBJECTS) @HAVE_QRENCODE_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) journalctl_DEPENDENCIES = libsystemd-journal-internal.la \ libsystemd-internal.la libsystemd-logs.la libsystemd-shared.la \ - $(am__append_153) $(am__DEPENDENCIES_6) + $(am__append_167) $(am__DEPENDENCIES_6) journalctl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(journalctl_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -2638,12 +2831,14 @@ localectl_OBJECTS = $(am_localectl_OBJECTS) @ENABLE_LOCALED_TRUE@localectl_DEPENDENCIES = libsystemd-internal.la \ @ENABLE_LOCALED_TRUE@ libsystemd-shared.la am__loginctl_SOURCES_DIST = src/login/loginctl.c \ - src/login/sysfs-show.c + src/login/sysfs-show.h src/login/sysfs-show.c @ENABLE_LOGIND_TRUE@am_loginctl_OBJECTS = \ @ENABLE_LOGIND_TRUE@ src/login/loginctl.$(OBJEXT) \ @ENABLE_LOGIND_TRUE@ src/login/sysfs-show.$(OBJEXT) loginctl_OBJECTS = $(am_loginctl_OBJECTS) @ENABLE_LOGIND_TRUE@loginctl_DEPENDENCIES = libsystemd-internal.la \ +@ENABLE_LOGIND_TRUE@ libsystemd-logs.la \ +@ENABLE_LOGIND_TRUE@ libsystemd-journal-internal.la \ @ENABLE_LOGIND_TRUE@ libudev-internal.la libsystemd-shared.la am__machinectl_SOURCES_DIST = src/machine/machinectl.c @ENABLE_MACHINED_TRUE@am_machinectl_OBJECTS = \ @@ -2651,6 +2846,8 @@ am__machinectl_SOURCES_DIST = src/machine/machinectl.c machinectl_OBJECTS = $(am_machinectl_OBJECTS) @ENABLE_MACHINED_TRUE@machinectl_DEPENDENCIES = \ @ENABLE_MACHINED_TRUE@ libsystemd-internal.la \ +@ENABLE_MACHINED_TRUE@ libsystemd-logs.la \ +@ENABLE_MACHINED_TRUE@ libsystemd-journal-internal.la \ @ENABLE_MACHINED_TRUE@ libsystemd-shared.la am_mtd_probe_OBJECTS = src/udev/mtd_probe/mtd_probe.$(OBJEXT) \ src/udev/mtd_probe/probe_smartmedia.$(OBJEXT) @@ -2722,11 +2919,15 @@ systemd_bootchart_OBJECTS = $(am_systemd_bootchart_OBJECTS) @ENABLE_BOOTCHART_TRUE@systemd_bootchart_DEPENDENCIES = \ @ENABLE_BOOTCHART_TRUE@ libsystemd-journal-internal.la \ @ENABLE_BOOTCHART_TRUE@ libsystemd-shared.la -am_systemd_bus_proxyd_OBJECTS = src/bus-proxyd/bus-proxyd.$(OBJEXT) \ - src/bus-proxyd/bus-policy.$(OBJEXT) +am_systemd_bus_proxyd_OBJECTS = \ + src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.$(OBJEXT) systemd_bus_proxyd_OBJECTS = $(am_systemd_bus_proxyd_OBJECTS) -systemd_bus_proxyd_DEPENDENCIES = libsystemd-internal.la \ - libsystemd-shared.la +systemd_bus_proxyd_DEPENDENCIES = libsystemd-proxy.la \ + libsystemd-internal.la libsystemd-shared.la +systemd_bus_proxyd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(systemd_bus_proxyd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ am_systemd_cat_OBJECTS = src/journal/cat.$(OBJEXT) systemd_cat_OBJECTS = $(am_systemd_cat_OBJECTS) systemd_cat_DEPENDENCIES = libsystemd-journal-core.la @@ -2772,7 +2973,7 @@ systemd_coredump_OBJECTS = $(am_systemd_coredump_OBJECTS) @ENABLE_COREDUMP_TRUE@ libsystemd-label.la \ @ENABLE_COREDUMP_TRUE@ libsystemd-internal.la \ @ENABLE_COREDUMP_TRUE@ libsystemd-shared.la \ -@ENABLE_COREDUMP_TRUE@ $(am__DEPENDENCIES_7) $(am__append_173) +@ENABLE_COREDUMP_TRUE@ $(am__DEPENDENCIES_7) $(am__append_187) am__systemd_cryptsetup_SOURCES_DIST = src/cryptsetup/cryptsetup.c @HAVE_LIBCRYPTSETUP_TRUE@am_systemd_cryptsetup_OBJECTS = src/cryptsetup/systemd_cryptsetup-cryptsetup.$(OBJEXT) systemd_cryptsetup_OBJECTS = $(am_systemd_cryptsetup_OBJECTS) @@ -2896,6 +3097,22 @@ systemd_hostnamed_OBJECTS = $(am_systemd_hostnamed_OBJECTS) @ENABLE_HOSTNAMED_TRUE@ libsystemd-label.la \ @ENABLE_HOSTNAMED_TRUE@ libsystemd-internal.la \ @ENABLE_HOSTNAMED_TRUE@ libsystemd-shared.la +am__systemd_hwdb_SOURCES_DIST = \ + src/libsystemd/sd-hwdb/hwdb-internal.h src/hwdb/hwdb.c +@ENABLE_HWDB_TRUE@am_systemd_hwdb_OBJECTS = src/hwdb/hwdb.$(OBJEXT) +systemd_hwdb_OBJECTS = $(am_systemd_hwdb_OBJECTS) +@ENABLE_HWDB_TRUE@systemd_hwdb_DEPENDENCIES = libsystemd-shared.la \ +@ENABLE_HWDB_TRUE@ libsystemd-internal.la libudev-internal.la +am__systemd_importd_SOURCES_DIST = src/import/importd.c +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am_systemd_importd_OBJECTS = src/import/systemd_importd-importd.$(OBJEXT) +systemd_importd_OBJECTS = $(am_systemd_importd_OBJECTS) +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_importd_DEPENDENCIES = libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la +systemd_importd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(systemd_importd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ am__systemd_inhibit_SOURCES_DIST = src/login/inhibit.c @ENABLE_LOGIND_TRUE@am_systemd_inhibit_OBJECTS = \ @ENABLE_LOGIND_TRUE@ src/login/inhibit.$(OBJEXT) @@ -3038,7 +3255,8 @@ am__systemd_networkd_SOURCES_DIST = src/network/networkd.c @ENABLE_NETWORKD_TRUE@ src/network/networkd.$(OBJEXT) systemd_networkd_OBJECTS = $(am_systemd_networkd_OBJECTS) @ENABLE_NETWORKD_TRUE@systemd_networkd_DEPENDENCIES = \ -@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la +@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ +@ENABLE_NETWORKD_TRUE@ $(am__append_304) am__systemd_networkd_wait_online_SOURCES_DIST = \ src/libsystemd-network/network-internal.h \ src/network/networkd-wait-online.h \ @@ -3074,7 +3292,7 @@ systemd_nspawn_OBJECTS = $(am_systemd_nspawn_OBJECTS) systemd_nspawn_DEPENDENCIES = libsystemd-label.la \ libsystemd-internal.la libudev-internal.la \ libsystemd-shared.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_9) + $(am__DEPENDENCIES_9) $(am__append_116) systemd_nspawn_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(systemd_nspawn_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ @@ -3083,6 +3301,35 @@ am_systemd_path_OBJECTS = src/path/path.$(OBJEXT) systemd_path_OBJECTS = $(am_systemd_path_OBJECTS) systemd_path_DEPENDENCIES = libsystemd-internal.la \ libsystemd-shared.la +am__systemd_pull_SOURCES_DIST = src/import/pull.c \ + src/import/import-raw.c src/import/import-raw.h \ + src/import/import-tar.c src/import/import-tar.h \ + src/import/import-dkr.c src/import/import-dkr.h \ + src/import/import-job.c src/import/import-job.h \ + src/import/import-common.c src/import/import-common.h \ + src/import/curl-util.c src/import/curl-util.h \ + src/import/aufs-util.c src/import/aufs-util.h \ + src/import/qcow2-util.c src/import/qcow2-util.h +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am_systemd_pull_OBJECTS = src/import/systemd_pull-pull.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-import-raw.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-import-tar.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-import-dkr.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-import-job.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-import-common.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-curl-util.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-aufs-util.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/systemd_pull-qcow2-util.$(OBJEXT) +systemd_pull_OBJECTS = $(am_systemd_pull_OBJECTS) +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_pull_DEPENDENCIES = libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(am__DEPENDENCIES_1) +systemd_pull_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(systemd_pull_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__systemd_quotacheck_SOURCES_DIST = src/quotacheck/quotacheck.c @ENABLE_QUOTACHECK_TRUE@am_systemd_quotacheck_OBJECTS = \ @ENABLE_QUOTACHECK_TRUE@ src/quotacheck/quotacheck.$(OBJEXT) @@ -3225,6 +3472,11 @@ systemd_socket_proxyd_OBJECTS = $(am_systemd_socket_proxyd_OBJECTS) systemd_socket_proxyd_DEPENDENCIES = libsystemd-logs.la \ libsystemd-internal.la libsystemd-journal-internal.la \ libsystemd-shared.la libsystemd-resolve.la +am_systemd_stdio_bridge_OBJECTS = \ + src/bus-proxyd/stdio-bridge.$(OBJEXT) +systemd_stdio_bridge_OBJECTS = $(am_systemd_stdio_bridge_OBJECTS) +systemd_stdio_bridge_DEPENDENCIES = libsystemd-proxy.la \ + libsystemd-internal.la libsystemd-shared.la am_systemd_subterm_OBJECTS = \ src/libsystemd-terminal/subterm.$(OBJEXT) systemd_subterm_OBJECTS = $(am_systemd_subterm_OBJECTS) @@ -3287,7 +3539,7 @@ systemd_tmpfiles_OBJECTS = $(am_systemd_tmpfiles_OBJECTS) @ENABLE_TMPFILES_TRUE@systemd_tmpfiles_DEPENDENCIES = \ @ENABLE_TMPFILES_TRUE@ libsystemd-units.la libsystemd-label.la \ @ENABLE_TMPFILES_TRUE@ libsystemd-internal.la \ -@ENABLE_TMPFILES_TRUE@ libsystemd-shared.la +@ENABLE_TMPFILES_TRUE@ libsystemd-shared.la $(am__append_83) am_systemd_tty_ask_password_agent_OBJECTS = \ src/tty-ask-password-agent/tty-ask-password-agent.$(OBJEXT) systemd_tty_ask_password_agent_OBJECTS = \ @@ -3340,6 +3592,9 @@ am__test_boot_timestamp_SOURCES_DIST = \ test_boot_timestamp_OBJECTS = $(am_test_boot_timestamp_OBJECTS) @ENABLE_EFI_TRUE@test_boot_timestamp_DEPENDENCIES = \ @ENABLE_EFI_TRUE@ libsystemd-shared.la +am_test_btrfs_OBJECTS = src/test/test-btrfs.$(OBJEXT) +test_btrfs_OBJECTS = $(am_test_btrfs_OBJECTS) +test_btrfs_DEPENDENCIES = libsystemd-label.la libsystemd-shared.la am_test_bus_chat_OBJECTS = \ src/libsystemd/sd-bus/test_bus_chat-test-bus-chat.$(OBJEXT) test_bus_chat_OBJECTS = $(am_test_bus_chat_OBJECTS) @@ -3418,11 +3673,11 @@ test_bus_objects_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_bus_objects_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ -am_test_bus_policy_OBJECTS = src/bus-proxyd/test-bus-policy.$(OBJEXT) \ - src/bus-proxyd/bus-policy.$(OBJEXT) +am_test_bus_policy_OBJECTS = \ + src/bus-proxyd/test-bus-xml-policy.$(OBJEXT) test_bus_policy_OBJECTS = $(am_test_bus_policy_OBJECTS) -test_bus_policy_DEPENDENCIES = libsystemd-internal.la \ - libsystemd-shared.la +test_bus_policy_DEPENDENCIES = libsystemd-proxy.la \ + libsystemd-internal.la libsystemd-shared.la am_test_bus_server_OBJECTS = src/libsystemd/sd-bus/test_bus_server-test-bus-server.$(OBJEXT) test_bus_server_OBJECTS = $(am_test_bus_server_OBJECTS) test_bus_server_DEPENDENCIES = libsystemd-internal.la \ @@ -3490,7 +3745,7 @@ test_conf_files_OBJECTS = $(am_test_conf_files_OBJECTS) test_conf_files_DEPENDENCIES = libsystemd-shared.la am_test_copy_OBJECTS = src/test/test-copy.$(OBJEXT) test_copy_OBJECTS = $(am_test_copy_OBJECTS) -test_copy_DEPENDENCIES = libsystemd-shared.la +test_copy_DEPENDENCIES = libsystemd-label.la libsystemd-shared.la am__test_coredump_vacuum_SOURCES_DIST = \ src/journal/test-coredump-vacuum.c \ src/journal/coredump-vacuum.c src/journal/coredump-vacuum.h @@ -3526,7 +3781,8 @@ test_dhcp_server_OBJECTS = $(am_test_dhcp_server_OBJECTS) test_dhcp_server_DEPENDENCIES = libsystemd-network.la \ libsystemd-internal.la libsystemd-shared.la am_test_dhcp6_client_OBJECTS = \ - src/libsystemd-network/test-dhcp6-client.$(OBJEXT) + src/libsystemd-network/test-dhcp6-client.$(OBJEXT) \ + src/libsystemd-network/dhcp-identifier.$(OBJEXT) test_dhcp6_client_OBJECTS = $(am_test_dhcp6_client_OBJECTS) test_dhcp6_client_DEPENDENCIES = libsystemd-network.la \ libsystemd-internal.la libsystemd-shared.la @@ -3570,6 +3826,17 @@ test_fdset_DEPENDENCIES = libsystemd-shared.la libsystemd-internal.la am_test_fileio_OBJECTS = src/test/test-fileio.$(OBJEXT) test_fileio_OBJECTS = $(am_test_fileio_OBJECTS) test_fileio_DEPENDENCIES = libsystemd-shared.la +am_test_fstab_util_OBJECTS = src/test/test-fstab-util.$(OBJEXT) +test_fstab_util_OBJECTS = $(am_test_fstab_util_OBJECTS) +test_fstab_util_DEPENDENCIES = libsystemd-shared.la +am__test_fw_util_SOURCES_DIST = src/test/test-fw-util.c +@HAVE_LIBIPTC_TRUE@am_test_fw_util_OBJECTS = src/test/test_fw_util-test-fw-util.$(OBJEXT) +test_fw_util_OBJECTS = $(am_test_fw_util_OBJECTS) +@HAVE_LIBIPTC_TRUE@test_fw_util_DEPENDENCIES = libsystemd-fw.la \ +@HAVE_LIBIPTC_TRUE@ libsystemd-shared.la $(am__DEPENDENCIES_1) +test_fw_util_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_fw_util_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_hashmap_OBJECTS = src/test/test-hashmap.$(OBJEXT) \ src/test/test-hashmap-plain.$(OBJEXT) nodist_test_hashmap_OBJECTS = src/test/test-hashmap-ordered.$(OBJEXT) @@ -3580,7 +3847,8 @@ am_test_hostname_OBJECTS = src/test/test-hostname.$(OBJEXT) test_hostname_OBJECTS = $(am_test_hostname_OBJECTS) test_hostname_DEPENDENCIES = libsystemd-core.la am_test_icmp6_rs_OBJECTS = \ - src/libsystemd-network/test-icmp6-rs.$(OBJEXT) + src/libsystemd-network/test-icmp6-rs.$(OBJEXT) \ + src/libsystemd-network/dhcp-identifier.$(OBJEXT) test_icmp6_rs_OBJECTS = $(am_test_icmp6_rs_OBJECTS) test_icmp6_rs_DEPENDENCIES = libsystemd-network.la \ libsystemd-internal.la libsystemd-shared.la @@ -3652,13 +3920,16 @@ am_test_journal_verify_OBJECTS = \ src/journal/test-journal-verify.$(OBJEXT) test_journal_verify_OBJECTS = $(am_test_journal_verify_OBJECTS) test_journal_verify_DEPENDENCIES = libsystemd-journal-core.la +am_test_json_OBJECTS = src/test/test-json.$(OBJEXT) +test_json_OBJECTS = $(am_test_json_OBJECTS) +test_json_DEPENDENCIES = libsystemd-shared.la am_test_libsystemd_sym_OBJECTS = test-libsystemd-sym.$(OBJEXT) test_libsystemd_sym_OBJECTS = $(am_test_libsystemd_sym_OBJECTS) test_libsystemd_sym_DEPENDENCIES = libsystemd.la am_test_libudev_OBJECTS = src/test/test-libudev.$(OBJEXT) test_libudev_OBJECTS = $(am_test_libudev_OBJECTS) test_libudev_DEPENDENCIES = libsystemd-label.la libudev-internal.la \ - libsystemd-shared.la + libsystemd-shared.la libsystemd-internal.la am_test_libudev_sym_OBJECTS = \ test_libudev_sym-test-libudev-sym.$(OBJEXT) test_libudev_sym_OBJECTS = $(am_test_libudev_sym_OBJECTS) @@ -3670,6 +3941,11 @@ test_libudev_sym_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ am_test_list_OBJECTS = src/test/test-list.$(OBJEXT) test_list_OBJECTS = $(am_test_list_OBJECTS) test_list_DEPENDENCIES = libsystemd-shared.la +am_test_lldp_OBJECTS = src/libsystemd-network/lldp-tlv.$(OBJEXT) \ + src/libsystemd-network/test-lldp.$(OBJEXT) +test_lldp_OBJECTS = $(am_test_lldp_OBJECTS) +test_lldp_DEPENDENCIES = libsystemd-network.la libsystemd-internal.la \ + libsystemd-shared.la am_test_local_addresses_OBJECTS = \ src/libsystemd/sd-rtnl/test-local-addresses.$(OBJEXT) test_local_addresses_OBJECTS = $(am_test_local_addresses_OBJECTS) @@ -3719,14 +3995,15 @@ am__test_network_SOURCES_DIST = src/network/test-network.c @ENABLE_NETWORKD_TRUE@ src/network/test-network.$(OBJEXT) test_network_OBJECTS = $(am_test_network_OBJECTS) @ENABLE_NETWORKD_TRUE@test_network_DEPENDENCIES = \ -@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la +@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ +@ENABLE_NETWORKD_TRUE@ $(am__append_307) am__test_network_tables_SOURCES_DIST = \ src/network/test-network-tables.c src/shared/test-tables.h @ENABLE_NETWORKD_TRUE@am_test_network_tables_OBJECTS = src/network/test-network-tables.$(OBJEXT) test_network_tables_OBJECTS = $(am_test_network_tables_OBJECTS) @ENABLE_NETWORKD_TRUE@test_network_tables_DEPENDENCIES = \ @ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ -@ENABLE_NETWORKD_TRUE@ libudev-core.la +@ENABLE_NETWORKD_TRUE@ libudev-core.la $(am__append_308) am_test_ns_OBJECTS = src/test/test_ns-test-ns.$(OBJEXT) test_ns_OBJECTS = $(am_test_ns_OBJECTS) test_ns_DEPENDENCIES = libsystemd-core.la @@ -3739,6 +4016,10 @@ test_path_DEPENDENCIES = libsystemd-core.la test_path_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_path_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_test_path_lookup_OBJECTS = src/test/test-path-lookup.$(OBJEXT) +test_path_lookup_OBJECTS = $(am_test_path_lookup_OBJECTS) +test_path_lookup_DEPENDENCIES = libsystemd-units.la \ + libsystemd-shared.la am_test_path_util_OBJECTS = src/test/test-path-util.$(OBJEXT) test_path_util_OBJECTS = $(am_test_path_util_OBJECTS) test_path_util_DEPENDENCIES = libsystemd-shared.la @@ -3751,6 +4032,18 @@ test_prioq_DEPENDENCIES = libsystemd-shared.la am_test_pty_OBJECTS = src/test/test-pty.$(OBJEXT) test_pty_OBJECTS = $(am_test_pty_OBJECTS) test_pty_DEPENDENCIES = libsystemd-core.la +am__test_qcow2_SOURCES_DIST = src/import/test-qcow2.c \ + src/import/qcow2-util.c src/import/qcow2-util.h +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@am_test_qcow2_OBJECTS = src/import/test_qcow2-test-qcow2.$(OBJEXT) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/test_qcow2-qcow2-util.$(OBJEXT) +test_qcow2_OBJECTS = $(am_test_qcow2_OBJECTS) +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@test_qcow2_DEPENDENCIES = libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(am__DEPENDENCIES_1) +test_qcow2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_qcow2_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_ratelimit_OBJECTS = src/test/test-ratelimit.$(OBJEXT) test_ratelimit_OBJECTS = $(am_test_ratelimit_OBJECTS) test_ratelimit_DEPENDENCIES = libsystemd-shared.la @@ -3792,6 +4085,9 @@ test_sched_prio_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ am_test_set_OBJECTS = src/test/test-set.$(OBJEXT) test_set_OBJECTS = $(am_test_set_OBJECTS) test_set_DEPENDENCIES = libsystemd-shared.la +am_test_sigbus_OBJECTS = src/test/test-sigbus.$(OBJEXT) +test_sigbus_OBJECTS = $(am_test_sigbus_OBJECTS) +test_sigbus_DEPENDENCIES = libsystemd-shared.la am_test_sleep_OBJECTS = src/test/test-sleep.$(OBJEXT) test_sleep_OBJECTS = $(am_test_sleep_OBJECTS) test_sleep_DEPENDENCIES = libsystemd-core.la @@ -3813,7 +4109,7 @@ am_test_strxcpyx_OBJECTS = src/test/test-strxcpyx.$(OBJEXT) test_strxcpyx_OBJECTS = $(am_test_strxcpyx_OBJECTS) test_strxcpyx_DEPENDENCIES = libsystemd-shared.la am_test_tables_OBJECTS = src/test/test_tables-test-tables.$(OBJEXT) \ - src/bus-proxyd/test_tables-bus-policy.$(OBJEXT) \ + src/bus-proxyd/test_tables-bus-xml-policy.$(OBJEXT) \ src/journal/test_tables-journald-server.$(OBJEXT) test_tables_OBJECTS = $(am_test_tables_OBJECTS) test_tables_DEPENDENCIES = libsystemd-logs.la \ @@ -3841,7 +4137,7 @@ test_tmpfiles_DEPENDENCIES = libsystemd-shared.la am_test_udev_OBJECTS = src/test/test-udev.$(OBJEXT) test_udev_OBJECTS = $(am_test_udev_OBJECTS) test_udev_DEPENDENCIES = libudev-core.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_130) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_144) am_test_uid_range_OBJECTS = src/test/test-uid-range.$(OBJEXT) test_uid_range_OBJECTS = $(am_test_uid_range_OBJECTS) test_uid_range_DEPENDENCIES = libsystemd-shared.la @@ -3875,6 +4171,9 @@ test_utf8_DEPENDENCIES = libsystemd-shared.la am_test_util_OBJECTS = src/test/test-util.$(OBJEXT) test_util_OBJECTS = $(am_test_util_OBJECTS) test_util_DEPENDENCIES = libsystemd-shared.la +am_test_verbs_OBJECTS = src/test/test-verbs.$(OBJEXT) +test_verbs_OBJECTS = $(am_test_verbs_OBJECTS) +test_verbs_DEPENDENCIES = libsystemd-shared.la am_test_watchdog_OBJECTS = src/test/test-watchdog.$(OBJEXT) test_watchdog_OBJECTS = $(am_test_watchdog_OBJECTS) test_watchdog_DEPENDENCIES = libsystemd-shared.la @@ -3902,8 +4201,10 @@ udevadm_OBJECTS = $(am_udevadm_OBJECTS) udevadm_DEPENDENCIES = libudev-core.la am_v4l_id_OBJECTS = src/udev/v4l_id/v4l_id.$(OBJEXT) v4l_id_OBJECTS = $(am_v4l_id_OBJECTS) -v4l_id_DEPENDENCIES = libudev-internal.la -SCRIPTS = $(dist_bin_SCRIPTS) $(dist_kernelinstall_SCRIPTS) +v4l_id_DEPENDENCIES = libudev-internal.la libsystemd-shared.la +am__dist_xinitrc_SCRIPTS_DIST = xorg/50-systemd-user.sh +SCRIPTS = $(dist_bin_SCRIPTS) $(dist_kernelinstall_SCRIPTS) \ + $(dist_xinitrc_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -3947,7 +4248,7 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(libsystemd_acl_la_SOURCES) $(libsystemd_core_la_SOURCES) \ $(nodist_libsystemd_core_la_SOURCES) \ $(libsystemd_daemon_la_SOURCES) $(libsystemd_dump_la_SOURCES) \ - $(libsystemd_id128_la_SOURCES) \ + $(libsystemd_fw_la_SOURCES) $(libsystemd_id128_la_SOURCES) \ $(libsystemd_internal_la_SOURCES) \ $(nodist_libsystemd_internal_la_SOURCES) \ $(libsystemd_journal_core_la_SOURCES) \ @@ -3961,6 +4262,7 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(libsystemd_network_la_SOURCES) \ $(libsystemd_networkd_core_la_SOURCES) \ $(nodist_libsystemd_networkd_core_la_SOURCES) \ + $(libsystemd_proxy_la_SOURCES) \ $(libsystemd_resolve_la_SOURCES) \ $(libsystemd_seccomp_la_SOURCES) \ $(libsystemd_shared_la_SOURCES) \ @@ -3997,7 +4299,8 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(systemd_gpt_auto_generator_SOURCES) \ $(systemd_hibernate_resume_SOURCES) \ $(systemd_hibernate_resume_generator_SOURCES) \ - $(systemd_hostnamed_SOURCES) $(systemd_inhibit_SOURCES) \ + $(systemd_hostnamed_SOURCES) $(systemd_hwdb_SOURCES) \ + $(systemd_importd_SOURCES) $(systemd_inhibit_SOURCES) \ $(systemd_initctl_SOURCES) $(systemd_journal_gatewayd_SOURCES) \ $(systemd_journal_remote_SOURCES) \ $(systemd_journal_upload_SOURCES) $(systemd_journald_SOURCES) \ @@ -4009,8 +4312,8 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(systemd_modules_load_SOURCES) $(systemd_networkd_SOURCES) \ $(systemd_networkd_wait_online_SOURCES) \ $(systemd_notify_SOURCES) $(systemd_nspawn_SOURCES) \ - $(systemd_path_SOURCES) $(systemd_quotacheck_SOURCES) \ - $(systemd_random_seed_SOURCES) \ + $(systemd_path_SOURCES) $(systemd_pull_SOURCES) \ + $(systemd_quotacheck_SOURCES) $(systemd_random_seed_SOURCES) \ $(systemd_rc_local_generator_SOURCES) \ $(systemd_remount_fs_SOURCES) \ $(systemd_reply_password_SOURCES) \ @@ -4018,7 +4321,8 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(nodist_systemd_resolved_SOURCES) $(systemd_rfkill_SOURCES) \ $(systemd_run_SOURCES) $(systemd_shutdown_SOURCES) \ $(systemd_shutdownd_SOURCES) $(systemd_sleep_SOURCES) \ - $(systemd_socket_proxyd_SOURCES) $(systemd_subterm_SOURCES) \ + $(systemd_socket_proxyd_SOURCES) \ + $(systemd_stdio_bridge_SOURCES) $(systemd_subterm_SOURCES) \ $(systemd_sysctl_SOURCES) \ $(systemd_system_update_generator_SOURCES) \ $(systemd_sysusers_SOURCES) $(systemd_sysv_generator_SOURCES) \ @@ -4031,10 +4335,11 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(systemd_user_sessions_SOURCES) \ $(systemd_vconsole_setup_SOURCES) $(test_architecture_SOURCES) \ $(test_async_SOURCES) $(test_barrier_SOURCES) \ - $(test_boot_timestamp_SOURCES) $(test_bus_chat_SOURCES) \ - $(test_bus_cleanup_SOURCES) $(test_bus_creds_SOURCES) \ - $(test_bus_error_SOURCES) $(test_bus_gvariant_SOURCES) \ - $(test_bus_introspect_SOURCES) $(test_bus_kernel_SOURCES) \ + $(test_boot_timestamp_SOURCES) $(test_btrfs_SOURCES) \ + $(test_bus_chat_SOURCES) $(test_bus_cleanup_SOURCES) \ + $(test_bus_creds_SOURCES) $(test_bus_error_SOURCES) \ + $(test_bus_gvariant_SOURCES) $(test_bus_introspect_SOURCES) \ + $(test_bus_kernel_SOURCES) \ $(test_bus_kernel_benchmark_SOURCES) \ $(test_bus_kernel_bloom_SOURCES) $(test_bus_marshal_SOURCES) \ $(test_bus_match_SOURCES) $(test_bus_objects_SOURCES) \ @@ -4054,6 +4359,7 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(test_engine_SOURCES) $(test_env_replace_SOURCES) \ $(test_event_SOURCES) $(test_execute_SOURCES) \ $(test_fdset_SOURCES) $(test_fileio_SOURCES) \ + $(test_fstab_util_SOURCES) $(test_fw_util_SOURCES) \ $(test_hashmap_SOURCES) $(nodist_test_hashmap_SOURCES) \ $(test_hostname_SOURCES) $(test_icmp6_rs_SOURCES) \ $(test_id128_SOURCES) $(test_inhibit_SOURCES) \ @@ -4064,31 +4370,34 @@ SOURCES = $(_daemon_la_SOURCES) $(_journal_la_SOURCES) \ $(test_journal_interleaving_SOURCES) \ $(test_journal_match_SOURCES) $(test_journal_send_SOURCES) \ $(test_journal_stream_SOURCES) $(test_journal_syslog_SOURCES) \ - $(test_journal_verify_SOURCES) $(test_libsystemd_sym_SOURCES) \ - $(test_libudev_SOURCES) $(test_libudev_sym_SOURCES) \ - $(test_list_SOURCES) $(test_local_addresses_SOURCES) \ + $(test_journal_verify_SOURCES) $(test_json_SOURCES) \ + $(test_libsystemd_sym_SOURCES) $(test_libudev_SOURCES) \ + $(test_libudev_sym_SOURCES) $(test_list_SOURCES) \ + $(test_lldp_SOURCES) $(test_local_addresses_SOURCES) \ $(test_locale_util_SOURCES) $(test_log_SOURCES) \ $(test_login_SOURCES) $(test_login_shared_SOURCES) \ $(test_login_tables_SOURCES) $(test_loopback_SOURCES) \ $(test_machine_tables_SOURCES) $(test_mmap_cache_SOURCES) \ $(test_namespace_SOURCES) $(test_network_SOURCES) \ $(test_network_tables_SOURCES) $(test_ns_SOURCES) \ - $(test_path_SOURCES) $(test_path_util_SOURCES) \ - $(test_pppoe_SOURCES) $(test_prioq_SOURCES) \ - $(test_pty_SOURCES) $(test_ratelimit_SOURCES) \ + $(test_path_SOURCES) $(test_path_lookup_SOURCES) \ + $(test_path_util_SOURCES) $(test_pppoe_SOURCES) \ + $(test_prioq_SOURCES) $(test_pty_SOURCES) \ + $(test_qcow2_SOURCES) $(test_ratelimit_SOURCES) \ $(test_replace_var_SOURCES) $(test_resolve_SOURCES) \ $(test_ring_SOURCES) $(test_rtnl_SOURCES) \ $(test_rtnl_manual_SOURCES) $(test_sched_prio_SOURCES) \ - $(test_set_SOURCES) $(test_sleep_SOURCES) \ - $(test_socket_util_SOURCES) $(test_strbuf_SOURCES) \ - $(test_strip_tab_ansi_SOURCES) $(test_strv_SOURCES) \ - $(test_strxcpyx_SOURCES) $(test_tables_SOURCES) \ - $(test_term_page_SOURCES) $(test_term_parser_SOURCES) \ - $(test_time_SOURCES) $(test_tmpfiles_SOURCES) \ - $(test_udev_SOURCES) $(test_uid_range_SOURCES) \ - $(test_unaligned_SOURCES) $(test_unifont_SOURCES) \ - $(test_unit_file_SOURCES) $(test_unit_name_SOURCES) \ - $(test_utf8_SOURCES) $(test_util_SOURCES) \ + $(test_set_SOURCES) $(test_sigbus_SOURCES) \ + $(test_sleep_SOURCES) $(test_socket_util_SOURCES) \ + $(test_strbuf_SOURCES) $(test_strip_tab_ansi_SOURCES) \ + $(test_strv_SOURCES) $(test_strxcpyx_SOURCES) \ + $(test_tables_SOURCES) $(test_term_page_SOURCES) \ + $(test_term_parser_SOURCES) $(test_time_SOURCES) \ + $(test_tmpfiles_SOURCES) $(test_udev_SOURCES) \ + $(test_uid_range_SOURCES) $(test_unaligned_SOURCES) \ + $(test_unifont_SOURCES) $(test_unit_file_SOURCES) \ + $(test_unit_name_SOURCES) $(test_utf8_SOURCES) \ + $(test_util_SOURCES) $(test_verbs_SOURCES) \ $(test_watchdog_SOURCES) $(test_xml_SOURCES) \ $(timedatectl_SOURCES) $(udevadm_SOURCES) $(v4l_id_SOURCES) DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ @@ -4102,6 +4411,7 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(libsystemd_core_la_SOURCES) \ $(am__libsystemd_daemon_la_SOURCES_DIST) \ $(libsystemd_dump_la_SOURCES) \ + $(am__libsystemd_fw_la_SOURCES_DIST) \ $(am__libsystemd_id128_la_SOURCES_DIST) \ $(libsystemd_internal_la_SOURCES) \ $(libsystemd_journal_core_la_SOURCES) \ @@ -4114,6 +4424,7 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(am__libsystemd_machine_core_la_SOURCES_DIST) \ $(libsystemd_network_la_SOURCES) \ $(am__libsystemd_networkd_core_la_SOURCES_DIST) \ + $(libsystemd_proxy_la_SOURCES) \ $(libsystemd_resolve_la_SOURCES) \ $(am__libsystemd_seccomp_la_SOURCES_DIST) \ $(am__libsystemd_shared_la_SOURCES_DIST) \ @@ -4155,6 +4466,8 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(am__systemd_hibernate_resume_SOURCES_DIST) \ $(am__systemd_hibernate_resume_generator_SOURCES_DIST) \ $(am__systemd_hostnamed_SOURCES_DIST) \ + $(am__systemd_hwdb_SOURCES_DIST) \ + $(am__systemd_importd_SOURCES_DIST) \ $(am__systemd_inhibit_SOURCES_DIST) $(systemd_initctl_SOURCES) \ $(am__systemd_journal_gatewayd_SOURCES_DIST) \ $(am__systemd_journal_remote_SOURCES_DIST) \ @@ -4170,7 +4483,8 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(am__systemd_networkd_SOURCES_DIST) \ $(am__systemd_networkd_wait_online_SOURCES_DIST) \ $(systemd_notify_SOURCES) $(systemd_nspawn_SOURCES) \ - $(systemd_path_SOURCES) $(am__systemd_quotacheck_SOURCES_DIST) \ + $(systemd_path_SOURCES) $(am__systemd_pull_SOURCES_DIST) \ + $(am__systemd_quotacheck_SOURCES_DIST) \ $(am__systemd_random_seed_SOURCES_DIST) \ $(systemd_rc_local_generator_SOURCES) \ $(systemd_remount_fs_SOURCES) \ @@ -4180,7 +4494,8 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(am__systemd_rfkill_SOURCES_DIST) $(systemd_run_SOURCES) \ $(systemd_shutdown_SOURCES) $(systemd_shutdownd_SOURCES) \ $(systemd_sleep_SOURCES) $(systemd_socket_proxyd_SOURCES) \ - $(systemd_subterm_SOURCES) $(systemd_sysctl_SOURCES) \ + $(systemd_stdio_bridge_SOURCES) $(systemd_subterm_SOURCES) \ + $(systemd_sysctl_SOURCES) \ $(systemd_system_update_generator_SOURCES) \ $(am__systemd_sysusers_SOURCES_DIST) \ $(systemd_sysv_generator_SOURCES) \ @@ -4194,7 +4509,7 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(am__systemd_vconsole_setup_SOURCES_DIST) \ $(test_architecture_SOURCES) $(test_async_SOURCES) \ $(test_barrier_SOURCES) \ - $(am__test_boot_timestamp_SOURCES_DIST) \ + $(am__test_boot_timestamp_SOURCES_DIST) $(test_btrfs_SOURCES) \ $(test_bus_chat_SOURCES) $(test_bus_cleanup_SOURCES) \ $(test_bus_creds_SOURCES) $(test_bus_error_SOURCES) \ $(test_bus_gvariant_SOURCES) $(test_bus_introspect_SOURCES) \ @@ -4219,6 +4534,7 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(test_engine_SOURCES) $(test_env_replace_SOURCES) \ $(test_event_SOURCES) $(test_execute_SOURCES) \ $(test_fdset_SOURCES) $(test_fileio_SOURCES) \ + $(test_fstab_util_SOURCES) $(am__test_fw_util_SOURCES_DIST) \ $(test_hashmap_SOURCES) $(test_hostname_SOURCES) \ $(test_icmp6_rs_SOURCES) $(test_id128_SOURCES) \ $(am__test_inhibit_SOURCES_DIST) $(test_install_SOURCES) \ @@ -4229,9 +4545,10 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(test_journal_interleaving_SOURCES) \ $(test_journal_match_SOURCES) $(test_journal_send_SOURCES) \ $(test_journal_stream_SOURCES) $(test_journal_syslog_SOURCES) \ - $(test_journal_verify_SOURCES) $(test_libsystemd_sym_SOURCES) \ - $(test_libudev_SOURCES) $(test_libudev_sym_SOURCES) \ - $(test_list_SOURCES) $(test_local_addresses_SOURCES) \ + $(test_journal_verify_SOURCES) $(test_json_SOURCES) \ + $(test_libsystemd_sym_SOURCES) $(test_libudev_SOURCES) \ + $(test_libudev_sym_SOURCES) $(test_list_SOURCES) \ + $(test_lldp_SOURCES) $(test_local_addresses_SOURCES) \ $(test_locale_util_SOURCES) $(test_log_SOURCES) \ $(am__test_login_SOURCES_DIST) \ $(am__test_login_shared_SOURCES_DIST) \ @@ -4240,22 +4557,24 @@ DIST_SOURCES = $(am___daemon_la_SOURCES_DIST) \ $(test_mmap_cache_SOURCES) $(test_namespace_SOURCES) \ $(am__test_network_SOURCES_DIST) \ $(am__test_network_tables_SOURCES_DIST) $(test_ns_SOURCES) \ - $(test_path_SOURCES) $(test_path_util_SOURCES) \ - $(test_pppoe_SOURCES) $(test_prioq_SOURCES) \ - $(test_pty_SOURCES) $(test_ratelimit_SOURCES) \ + $(test_path_SOURCES) $(test_path_lookup_SOURCES) \ + $(test_path_util_SOURCES) $(test_pppoe_SOURCES) \ + $(test_prioq_SOURCES) $(test_pty_SOURCES) \ + $(am__test_qcow2_SOURCES_DIST) $(test_ratelimit_SOURCES) \ $(test_replace_var_SOURCES) $(test_resolve_SOURCES) \ $(test_ring_SOURCES) $(test_rtnl_SOURCES) \ $(test_rtnl_manual_SOURCES) $(test_sched_prio_SOURCES) \ - $(test_set_SOURCES) $(test_sleep_SOURCES) \ - $(test_socket_util_SOURCES) $(test_strbuf_SOURCES) \ - $(test_strip_tab_ansi_SOURCES) $(test_strv_SOURCES) \ - $(test_strxcpyx_SOURCES) $(test_tables_SOURCES) \ - $(test_term_page_SOURCES) $(test_term_parser_SOURCES) \ - $(test_time_SOURCES) $(test_tmpfiles_SOURCES) \ - $(test_udev_SOURCES) $(test_uid_range_SOURCES) \ - $(test_unaligned_SOURCES) $(test_unifont_SOURCES) \ - $(test_unit_file_SOURCES) $(test_unit_name_SOURCES) \ - $(test_utf8_SOURCES) $(test_util_SOURCES) \ + $(test_set_SOURCES) $(test_sigbus_SOURCES) \ + $(test_sleep_SOURCES) $(test_socket_util_SOURCES) \ + $(test_strbuf_SOURCES) $(test_strip_tab_ansi_SOURCES) \ + $(test_strv_SOURCES) $(test_strxcpyx_SOURCES) \ + $(test_tables_SOURCES) $(test_term_page_SOURCES) \ + $(test_term_parser_SOURCES) $(test_time_SOURCES) \ + $(test_tmpfiles_SOURCES) $(test_udev_SOURCES) \ + $(test_uid_range_SOURCES) $(test_unaligned_SOURCES) \ + $(test_unifont_SOURCES) $(test_unit_file_SOURCES) \ + $(test_unit_name_SOURCES) $(test_utf8_SOURCES) \ + $(test_util_SOURCES) $(test_verbs_SOURCES) \ $(test_watchdog_SOURCES) $(test_xml_SOURCES) \ $(am__timedatectl_SOURCES_DIST) $(udevadm_SOURCES) \ $(v4l_id_SOURCES) @@ -4310,7 +4629,9 @@ am__dist_dbuspolicy_DATA_DIST = \ src/locale/org.freedesktop.locale1.conf \ src/timedate/org.freedesktop.timedate1.conf \ src/machine/org.freedesktop.machine1.conf \ + src/import/org.freedesktop.import1.conf \ src/resolve/org.freedesktop.resolve1.conf \ + src/network/org.freedesktop.network1.conf \ src/login/org.freedesktop.login1.conf am__dist_dbussystemservice_DATA_DIST = \ src/core/org.freedesktop.systemd1.service \ @@ -4318,7 +4639,9 @@ am__dist_dbussystemservice_DATA_DIST = \ src/locale/org.freedesktop.locale1.service \ src/timedate/org.freedesktop.timedate1.service \ src/machine/org.freedesktop.machine1.service \ + src/import/org.freedesktop.import1.service \ src/resolve/org.freedesktop.resolve1.service \ + src/network/org.freedesktop.network1.service \ src/login/org.freedesktop.login1.service am__dist_factory_pam_DATA_DIST = factory/etc/pam.d/system-auth \ factory/etc/pam.d/other @@ -4327,11 +4650,12 @@ am__dist_gatewayddocumentroot_DATA_DIST = \ am__dist_pamconf_DATA_DIST = src/login/systemd-user am__dist_pkgdata_DATA_DIST = \ src/libsystemd-terminal/unifont-glyph-array.bin \ - src/locale/kbd-model-map + src/locale/kbd-model-map src/locale/language-fallback-map am__dist_pkgsysconf_DATA_DIST = src/core/system.conf \ src/core/user.conf src/journal/journald.conf \ src/journal/coredump.conf src/bootchart/bootchart.conf \ src/login/logind.conf +am__dist_rootlibexec_DATA_DIST = src/import/import-pubring.gpg am__dist_systemunit_DATA_DIST = units/graphical.target \ units/multi-user.target units/emergency.target \ units/sysinit.target units/basic.target units/getty.target \ @@ -4358,13 +4682,15 @@ am__dist_systemunit_DATA_DIST = units/graphical.target \ units/systemd-ask-password-console.path \ units/systemd-udevd-control.socket \ units/systemd-udevd-kernel.socket units/system-update.target \ - units/initrd-switch-root.target units/busnames.target \ - units/org.freedesktop.hostname1.busname \ + units/initrd-switch-root.target units/machines.target \ + units/busnames.target units/org.freedesktop.hostname1.busname \ units/org.freedesktop.systemd1.busname \ units/org.freedesktop.locale1.busname \ units/org.freedesktop.timedate1.busname \ units/org.freedesktop.machine1.busname \ + units/org.freedesktop.import1.busname \ units/org.freedesktop.resolve1.busname \ + units/org.freedesktop.network1.busname \ units/org.freedesktop.login1.busname units/ldconfig.service \ units/systemd-tmpfiles-clean.timer units/hibernate.target \ units/hybrid-sleep.target units/systemd-bus-proxyd.socket \ @@ -4376,20 +4702,27 @@ am__dist_systemunit_DATA_DIST = units/graphical.target \ units/proc-sys-fs-binfmt_misc.automount \ units/proc-sys-fs-binfmt_misc.mount units/cryptsetup.target \ units/cryptsetup-pre.target units/machine.slice \ - units/user.slice + units/systemd-networkd.socket units/user.slice am__dist_sysusers_DATA_DIST = sysusers.d/systemd.conf \ sysusers.d/systemd-remote.conf am__dist_tmpfiles_DATA_DIST = tmpfiles.d/systemd.conf \ tmpfiles.d/systemd-nologin.conf tmpfiles.d/tmp.conf \ tmpfiles.d/x11.conf tmpfiles.d/var.conf tmpfiles.d/legacy.conf \ tmpfiles.d/systemd-remote.conf +am__dist_udevhwdb_DATA_DIST = hwdb/20-pci-vendor-model.hwdb \ + hwdb/20-pci-classes.hwdb hwdb/20-usb-vendor-model.hwdb \ + hwdb/20-usb-classes.hwdb hwdb/20-sdio-vendor-model.hwdb \ + hwdb/20-sdio-classes.hwdb \ + hwdb/20-bluetooth-vendor-product.hwdb hwdb/20-acpi-vendor.hwdb \ + hwdb/20-OUI.hwdb hwdb/20-net-ifname.hwdb hwdb/60-keyboard.hwdb \ + hwdb/70-mouse.hwdb hwdb/70-touchpad.hwdb am__dist_udevrules_DATA_DIST = rules/42-usb-hid-pm.rules \ rules/50-udev-default.rules rules/60-drm.rules \ - rules/60-keyboard.rules rules/70-mouse.rules \ - rules/60-persistent-storage-tape.rules \ + rules/60-keyboard.rules rules/60-persistent-storage-tape.rules \ rules/60-persistent-serial.rules \ rules/60-persistent-input.rules rules/60-persistent-alsa.rules \ rules/60-persistent-storage.rules rules/64-btrfs.rules \ + rules/70-mouse.rules rules/70-touchpad.rules \ rules/75-net-description.rules rules/75-tty-description.rules \ rules/78-sound-card.rules rules/80-net-setup-link.rules \ rules/95-udev-late.rules rules/80-drivers.rules \ @@ -4425,20 +4758,20 @@ DATA = $(dist_bashcompletion_DATA) $(dist_catalog_DATA) \ $(dist_doc_DATA) $(dist_factory_etc_DATA) \ $(dist_factory_pam_DATA) $(dist_gatewayddocumentroot_DATA) \ $(dist_network_DATA) $(dist_pamconf_DATA) $(dist_pkgdata_DATA) \ - $(dist_pkgsysconf_DATA) $(dist_sysctl_DATA) \ - $(dist_systempreset_DATA) $(dist_systemunit_DATA) \ - $(dist_sysusers_DATA) $(dist_tmpfiles_DATA) \ - $(dist_udevconf_DATA) $(dist_udevhwdb_DATA) \ - $(dist_udevrules_DATA) $(dist_userunit_DATA) \ - $(dist_zshcompletion_DATA) $(gir_DATA) \ + $(dist_pkgsysconf_DATA) $(dist_rootlibexec_DATA) \ + $(dist_sysctl_DATA) $(dist_systempreset_DATA) \ + $(dist_systemunit_DATA) $(dist_sysusers_DATA) \ + $(dist_tmpfiles_DATA) $(dist_udevconf_DATA) \ + $(dist_udevhwdb_DATA) $(dist_udevrules_DATA) \ + $(dist_userunit_DATA) $(dist_zshcompletion_DATA) $(gir_DATA) \ $(nodist_bashcompletion_DATA) $(nodist_pkgsysconf_DATA) \ $(nodist_polkitpolicy_DATA) $(nodist_rpmmacros_DATA) \ $(nodist_systemunit_DATA) $(nodist_sysusers_DATA) \ $(nodist_tmpfiles_DATA) $(nodist_udevrules_DATA) \ $(nodist_userunit_DATA) $(nodist_zshcompletion_DATA) \ - $(noinst_DATA) $(pkgconfigdata_DATA) $(pkgconfiglib_DATA) \ - $(sharepkgconfig_DATA) $(sysctl_DATA) $(sysvinit_DATA) \ - $(typelibs_DATA) $(varlog_DATA) + $(noinst_DATA) $(pkgconfiglib_DATA) $(sharepkgconfig_DATA) \ + $(sysctl_DATA) $(sysvinit_DATA) $(typelibs_DATA) \ + $(varlog_DATA) am__libgudev_include_HEADERS_DIST = src/gudev/gudev.h \ src/gudev/gudevenums.h src/gudev/gudevenumtypes.h \ src/gudev/gudevtypes.h src/gudev/gudevclient.h \ @@ -4638,8 +4971,9 @@ am__set_TESTS_bases = \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) +@HAVE_PYTHON_TRUE@am__EXEEXT_59 = test/rule-syntax-check.py \ +@HAVE_PYTHON_TRUE@ test/sysv-generator-test.py TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ @@ -4654,10 +4988,9 @@ am__set_b = \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) +TEST_LOGS = $(am__test_logs2:.py.log=.log) +PY_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +PY_LOG_COMPILE = $(PY_LOG_COMPILER) $(AM_PY_LOG_FLAGS) $(PY_LOG_FLAGS) DIST_SUBDIRS = . po docs/libudev docs/gudev DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -4730,6 +5063,7 @@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEBUGTTY = @DEBUGTTY@ +DEFAULT_DKR_INDEX_URL = @DEFAULT_DKR_INDEX_URL@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -4799,6 +5133,8 @@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ +LIBIPTC_CFLAGS = @LIBIPTC_CFLAGS@ +LIBIPTC_LIBS = @LIBIPTC_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -4866,6 +5202,7 @@ SHELL = @SHELL@ SPHINX_BUILD = @SPHINX_BUILD@ STRINGS = @STRINGS@ STRIP = @STRIP@ +SULOGIN = @SULOGIN@ SUSHELL = @SUSHELL@ SYSTEM_GID_MAX = @SYSTEM_GID_MAX@ SYSTEM_SYSVINIT_PATH = @SYSTEM_SYSVINIT_PATH@ @@ -4875,6 +5212,7 @@ TELINIT = @TELINIT@ TERMINAL_CFLAGS = @TERMINAL_CFLAGS@ TERMINAL_LIBS = @TERMINAL_LIBS@ TTY_GID = @TTY_GID@ +UNIFONT = @UNIFONT@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ @@ -4883,6 +5221,8 @@ XKBCOMMON_LIBS = @XKBCOMMON_LIBS@ XSLTPROC = @XSLTPROC@ XZ_CFLAGS = @XZ_CFLAGS@ XZ_LIBS = @XZ_LIBS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -4905,7 +5245,6 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ -dbusinterfacedir = @dbusinterfacedir@ # Dirs of external packages dbuspolicydir = @dbuspolicydir@ @@ -4960,16 +5299,16 @@ zshcompletiondir = @zshcompletiondir@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AM_MAKEFLAGS = --no-print-directory AUTOMAKE_OPTIONS = color-tests parallel-tests -SUBDIRS = . po $(am__append_123) $(am__append_131) +SUBDIRS = . po $(am__append_130) $(am__append_145) LIBUDEV_CURRENT = 7 LIBUDEV_REVISION = 2 LIBUDEV_AGE = 6 LIBGUDEV_CURRENT = 2 LIBGUDEV_REVISION = 0 LIBGUDEV_AGE = 2 -LIBSYSTEMD_CURRENT = 5 -LIBSYSTEMD_REVISION = 1 -LIBSYSTEMD_AGE = 5 +LIBSYSTEMD_CURRENT = 6 +LIBSYSTEMD_REVISION = 0 +LIBSYSTEMD_AGE = 6 # The following four libraries only exist for compatibility reasons, # their version info should not be bumped anymore @@ -4985,7 +5324,6 @@ LIBSYSTEMD_ID128_AGE = 0 LIBSYSTEMD_JOURNAL_CURRENT = 11 LIBSYSTEMD_JOURNAL_REVISION = 5 LIBSYSTEMD_JOURNAL_AGE = 11 -pkgconfigdatadir = $(datadir)/pkgconfig pkgconfiglibdir = $(libdir)/pkgconfig polkitpolicydir = $(datadir)/polkit-1/actions rpmmacrosdir = $(prefix)/lib/rpm/macros.d @@ -4994,6 +5332,7 @@ sysvrcnddir = $(SYSTEM_SYSVRCND_PATH) varlogdir = $(localstatedir)/log systemdstatedir = $(localstatedir)/lib/systemd catalogstatedir = $(systemdstatedir)/catalog +xinitrcdir = $(sysconfdir)/X11/xinit/xinitrc.d # Our own, non-special dirs pkgsysconfdir = $(sysconfdir)/systemd @@ -5025,7 +5364,7 @@ CLEANFILES = $(BUILT_SOURCES) $(nodist_bashcompletion_DATA) \ $(nodist_zshcompletion_DATA) units/console-shell.service.m4 \ units/console-getty.service.m4 \ units/container-getty@.service.m4 units/user@.service.m4 \ - $(am__append_60) $(am__append_62) \ + $(am__append_64) $(am__append_66) \ src/core/load-fragment-gperf.gperf \ src/core/load-fragment-gperf.c \ src/core/load-fragment-gperf-nulstr.c \ @@ -5037,24 +5376,23 @@ CLEANFILES = $(BUILT_SOURCES) $(nodist_bashcompletion_DATA) \ src/resolve/dns_type-from-name.gperf src/core/macros.systemd \ src/core/org.freedesktop.systemd1.policy.in \ src/test/test-hashmap-ordered.c tmpfiles.d/etc.conf \ - $(am__append_89) units/systemd-bus-proxyd@.service.m4 \ + $(am__append_96) units/systemd-bus-proxyd.service.m4 \ src/libsystemd/libsystemd.sym src/libudev/libudev.pc \ docs/html/libudev docs/html/gudev rules/99-systemd.rules \ src/udev/udev.pc units/systemd-udevd.service \ units/systemd-udev-trigger.service \ units/systemd-udev-settle.service \ - units/systemd-udev-hwdb-update.service \ src/udev/keyboard-keys-from-name.gperf \ src/udev/keyboard-keys.txt src/udev/net/link-config-gperf.c \ - $(am__append_134) $(am__append_136) $(am__append_147) \ - $(am__append_152) src/journal/journald-gperf.c \ - $(am__append_178) $(am__append_188) $(am__append_193) \ - $(am__append_242) $(am__append_264) $(am__append_283) \ - $(am__append_306) $(nodist_systemunit_DATA) \ - $(nodist_userunit_DATA) $(pkgconfigdata_DATA) \ + $(am__append_140) $(am__append_148) $(am__append_150) \ + $(am__append_161) $(am__append_166) \ + src/journal/journald-gperf.c $(am__append_192) \ + $(am__append_202) $(am__append_207) $(am__append_256) \ + $(am__append_291) $(am__append_319) $(am__append_342) \ + $(nodist_systemunit_DATA) $(nodist_userunit_DATA) \ $(pkgconfiglib_DATA) $(nodist_polkitpolicy_DATA) \ - $(am__append_315) defined undefined -DISTCLEANFILES = $(am__append_314) + $(am__append_351) defined undefined +DISTCLEANFILES = $(am__append_350) # Really, do not edit this file. EXTRA_DIST = shell-completion/bash/systemctl.in \ @@ -5090,14 +5428,15 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ man/bootchart.conf.xml man/bootctl.xml man/bootup.xml \ man/busctl.xml man/coredump.conf.xml man/coredumpctl.xml \ man/crypttab.xml man/daemon.xml man/file-hierarchy.xml \ - man/halt.xml man/hostname.xml man/hostnamectl.xml \ + man/halt.xml man/hostname.xml man/hostnamectl.xml man/hwdb.xml \ man/journalctl.xml man/journald.conf.xml \ man/kernel-command-line.xml man/kernel-install.xml \ man/less-variables.xml man/libsystemd-pkgconfig.xml \ man/locale.conf.xml man/localectl.xml man/localtime.xml \ man/loginctl.xml man/logind.conf.xml man/machine-id.xml \ man/machine-info.xml man/machinectl.xml man/modules-load.d.xml \ - man/nss-myhostname.xml man/os-release.xml man/pam_systemd.xml \ + man/networkctl.xml man/nss-myhostname.xml \ + man/nss-mymachines.xml man/os-release.xml man/pam_systemd.xml \ man/resolved.conf.xml man/runlevel.xml man/sd-daemon.xml \ man/sd-id128.xml man/sd-journal.xml man/sd-login.xml \ man/sd_booted.xml man/sd_bus_creds_get_pid.xml \ @@ -5150,8 +5489,8 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ man/systemd-halt.service.xml \ man/systemd-hibernate-resume-generator.xml \ man/systemd-hibernate-resume@.service.xml \ - man/systemd-hostnamed.service.xml man/systemd-inhibit.xml \ - man/systemd-initctl.service.xml \ + man/systemd-hostnamed.service.xml man/systemd-hwdb.xml \ + man/systemd-inhibit.xml man/systemd-initctl.service.xml \ man/systemd-journal-gatewayd.service.xml \ man/systemd-journal-remote.xml man/systemd-journal-upload.xml \ man/systemd-journald.service.xml \ @@ -5185,27 +5524,27 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ man/systemd-vconsole-setup.service.xml \ man/systemd.automount.xml man/systemd.device.xml \ man/systemd.directives.xml man/systemd.exec.xml \ - man/systemd.index.xml man/systemd.journal-fields.xml \ - man/systemd.kill.xml man/systemd.link.xml \ - man/systemd.mount.xml man/systemd.netdev.xml \ - man/systemd.network.xml man/systemd.path.xml \ - man/systemd.preset.xml man/systemd.resource-control.xml \ - man/systemd.scope.xml man/systemd.service.xml \ - man/systemd.slice.xml man/systemd.snapshot.xml \ - man/systemd.socket.xml man/systemd.special.xml \ - man/systemd.swap.xml man/systemd.target.xml \ - man/systemd.time.xml man/systemd.timer.xml \ - man/systemd.unit.xml man/systemd.xml man/sysusers.d.xml \ - man/telinit.xml man/timedatectl.xml man/timesyncd.conf.xml \ - man/tmpfiles.d.xml man/udev.conf.xml man/udev.xml \ - man/udevadm.xml man/user-system-options.xml \ - man/vconsole.conf.xml $(am__append_63) $(XML_FILES) \ + man/systemd.generator.xml man/systemd.index.xml \ + man/systemd.journal-fields.xml man/systemd.kill.xml \ + man/systemd.link.xml man/systemd.mount.xml \ + man/systemd.netdev.xml man/systemd.network.xml \ + man/systemd.path.xml man/systemd.preset.xml \ + man/systemd.resource-control.xml man/systemd.scope.xml \ + man/systemd.service.xml man/systemd.slice.xml \ + man/systemd.snapshot.xml man/systemd.socket.xml \ + man/systemd.special.xml man/systemd.swap.xml \ + man/systemd.target.xml man/systemd.time.xml \ + man/systemd.timer.xml man/systemd.unit.xml man/systemd.xml \ + man/sysusers.d.xml man/telinit.xml man/timedatectl.xml \ + man/timesyncd.conf.xml man/tmpfiles.d.xml man/udev.conf.xml \ + man/udev.xml man/udevadm.xml man/user-system-options.xml \ + man/vconsole.conf.xml $(am__append_67) $(XML_FILES) \ $(HTML_FILES) $(HTML_ALIAS) $(man_MANS) \ tools/make-man-index.py tools/make-directive-index.py \ tools/xml_helper.py src/core/load-fragment-gperf.gperf.m4 \ src/core/systemd.pc.in src/core/macros.systemd.in \ test/a.service test/basic.target test/b.service test/c.service \ - test/daughter.service test/d.service test/end.service \ + test/daughter.service test/d.service test/end.service.in \ test/e.service test/f.service test/grandchild.service \ test/g.service test/hello-after-sleep.target \ test/hello.service test/h.service test/parent-deep.slice \ @@ -5240,6 +5579,7 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ test/exec-systemcallfilter-not-failing2.service \ test/exec-systemcallfilter-not-failing.service \ test/exec-user.service test/exec-workingdirectory.service \ + test/exec-umask-0177.service test/exec-umask-default.service \ test/bus-policy/hello.conf test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf test/bus-policy/signals.conf \ test/bus-policy/check-own-rules.conf \ @@ -5248,27 +5588,27 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ units/kmod-static-nodes.service.in tmpfiles.d/etc.conf.m4 \ units/systemd-tmpfiles-setup-dev.service.in \ units/systemd-tmpfiles-setup.service.in \ - units/systemd-tmpfiles-clean.service.in $(am__append_88) \ - $(am__append_93) $(am__append_97) \ - units/systemd-bus-proxyd@.service.m4.in \ - units/user/systemd-bus-proxyd@.service.in \ + units/systemd-tmpfiles-clean.service.in $(am__append_95) \ + $(am__append_100) $(am__append_104) \ + units/systemd-bus-proxyd.service.m4.in \ + units/user/systemd-bus-proxyd.service.in \ src/libsystemd/libsystemd.sym.m4 \ src/libsystemd/libsystemd.pc.in \ src/libsystemd/sd-bus/DIFFERENCES \ - src/libsystemd/sd-bus/GVARIANT-SERIALIZATION $(am__append_121) \ + src/libsystemd/sd-bus/GVARIANT-SERIALIZATION \ + units/user/systemd-consoled.service.in \ src/libudev/libudev.pc.in rules/99-systemd.rules.in \ src/udev/udev.pc.in units/systemd-udevd.service.in \ units/systemd-udev-trigger.service.in \ units/systemd-udev-settle.service.in \ - units/systemd-udev-hwdb-update.service.in \ - src/udev/net/link-config-gperf.gperf test/sys.tar.xz \ - test/udev-test.pl test/rules-test.sh test/rule-syntax-check.py \ - src/udev/scsi_id/README src/gudev/gudev-1.0.pc.in \ - src/gudev/gudevmarshal.list \ + src/udev/net/link-config-gperf.gperf $(am__append_139) \ + test/sys.tar.xz test/udev-test.pl test/rule-syntax-check.py \ + test/sysv-generator-test.py $(NULL) src/udev/scsi_id/README \ + src/gudev/gudev-1.0.pc.in src/gudev/gudevmarshal.list \ src/gudev/gudevenumtypes.h.template \ src/gudev/gudevenumtypes.c.template src/gudev/gjs-example.js \ src/gudev/seed-example-enum.js src/gudev/seed-example.js \ - $(am__append_143) $(am__append_146) $(am__append_150) \ + $(am__append_157) $(am__append_160) $(am__append_164) \ units/systemd-journald.service.in \ units/systemd-journal-flush.service.in \ units/systemd-journal-catalog-update.service.in \ @@ -5276,19 +5616,19 @@ EXTRA_DIST = shell-completion/bash/systemctl.in \ units/systemd-journal-gatewayd.service.in \ sysctl.d/50-coredump.conf.in units/systemd-binfmt.service.in \ src/vconsole/90-vconsole.rules.in \ - units/systemd-vconsole-setup.service.in $(am__append_192) \ + units/systemd-vconsole-setup.service.in $(am__append_206) \ units/systemd-quotacheck.service.in \ units/systemd-random-seed.service.in \ units/systemd-backlight@.service.in \ units/systemd-rfkill@.service.in \ units/systemd-hostnamed.service.in \ units/systemd-localed.service.in \ - units/systemd-timedated.service.in $(am__append_241) \ - $(am__append_261) $(am__append_263) $(am__append_282) \ - src/login/logind-gperf.gperf src/login/71-seat.rules.in \ - src/login/73-seat-late.rules.in \ + units/systemd-timedated.service.in $(am__append_255) \ + $(am__append_277) $(am__append_281) $(am__append_290) \ + $(am__append_318) src/login/logind-gperf.gperf \ + src/login/71-seat.rules.in src/login/73-seat-late.rules.in \ units/systemd-logind.service.in \ - units/systemd-user-sessions.service.in $(am__append_308) \ + units/systemd-user-sessions.service.in $(am__append_344) \ src/compat-libs/libsystemd-journal.pc.in \ src/compat-libs/libsystemd-login.pc.in \ src/compat-libs/libsystemd-id128.pc.in \ @@ -5304,26 +5644,25 @@ BUILT_SOURCES = src/shared/errno-from-name.h \ src/shared/cap-to-name.h src/resolve/dns_type-from-name.h \ src/resolve/dns_type-to-name.h src/test/test-hashmap-ordered.c \ src/libsystemd/libsystemd.sym \ - $(nodist_libudev_core_la_SOURCES) $(am__append_135) \ - $(am__append_307) $(am__append_309) \ + $(nodist_libudev_core_la_SOURCES) $(am__append_149) \ + $(am__append_343) $(am__append_345) \ $(test_libsystemd_sym_SOURCES) $(test_libudev_sym_SOURCES) INSTALL_EXEC_HOOKS = install-target-wants-hook \ install-directories-hook install-aliases-hook \ install-touch-usr-hook $(am__append_1) \ - systemd-detect-virt-install-hook $(am__append_106) \ - bus-proxyd-install-hook $(am__append_113) \ - libsystemd-install-hook libudev-install-hook $(am__append_144) \ - journal-install-hook $(am__append_312) -UNINSTALL_EXEC_HOOKS = $(am__append_107) bus-proxyd-uninstall-hook \ - libsystemd-uninstall-hook libudev-uninstall-hook \ - journal-uninstall-hook $(am__append_313) -INSTALL_DATA_HOOKS = units-install-hook hwdb-update-hook \ + systemd-detect-virt-install-hook $(am__append_113) \ + $(am__append_121) libsystemd-install-hook libudev-install-hook \ + $(am__append_158) journal-install-hook $(am__append_348) +UNINSTALL_EXEC_HOOKS = $(am__append_114) libsystemd-uninstall-hook \ + libudev-uninstall-hook journal-uninstall-hook \ + $(am__append_349) +INSTALL_DATA_HOOKS = units-install-hook $(am__append_142) \ catalog-update-hook UNINSTALL_DATA_HOOKS = units-uninstall-hook catalog-remove-hook DISTCLEAN_LOCAL_HOOKS = test-sys-distclean CLEAN_LOCAL_HOOKS = clean-sphinx pkginclude_HEADERS = src/systemd/sd-login.h src/systemd/sd-id128.h \ - src/systemd/sd-daemon.h $(am__append_114) \ + src/systemd/sd-daemon.h $(am__append_122) \ src/systemd/sd-journal.h src/systemd/sd-messages.h \ src/systemd/_sd-common.h @@ -5339,99 +5678,111 @@ pkginclude_HEADERS = src/systemd/sd-login.h src/systemd/sd-id128.h \ # ------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ noinst_LTLIBRARIES = libsystemd-shared.la libsystemd-units.la \ - libsystemd-label.la $(am__append_67) libsystemd-logs.la \ - $(am__append_68) libsystemd-core.la libsystemd-internal.la \ + libsystemd-label.la $(am__append_69) $(am__append_72) \ + libsystemd-logs.la $(am__append_73) libsystemd-core.la \ + libsystemd-proxy.la libsystemd-internal.la \ libsystemd-resolve.la libsystemd-dump.la libsystemd-network.la \ - $(am__append_115) libudev-internal.la libudev-core.la \ + $(am__append_123) libudev-internal.la libudev-core.la \ libsystemd-journal-core.la libsystemd-journal-internal.la \ - $(am__append_249) $(am__append_277) $(am__append_286) -lib_LTLIBRARIES = libsystemd.la libudev.la $(am__append_132) \ - $(am__append_247) $(am__append_262) $(am__append_275) \ - $(am__append_310) + $(am__append_263) $(am__append_305) $(am__append_322) +lib_LTLIBRARIES = libsystemd.la libudev.la $(am__append_146) \ + $(am__append_261) $(am__append_278) $(am__append_302) \ + $(am__append_346) include_HEADERS = src/libudev/libudev.h -noinst_DATA = $(am__append_59) $(am__append_61) $(am__append_124) -pkgconfiglib_DATA = src/libsystemd/libsystemd.pc \ - src/libudev/libudev.pc $(am__append_133) $(am__append_311) +noinst_DATA = $(am__append_63) $(am__append_65) $(am__append_131) +pkgconfiglib_DATA = src/core/systemd.pc src/libsystemd/libsystemd.pc \ + src/libudev/libudev.pc $(am__append_147) $(am__append_347) polkitpolicy_in_in_files = \ src/core/org.freedesktop.systemd1.policy.in.in polkitpolicy_in_files = \ src/hostname/org.freedesktop.hostname1.policy.in \ src/locale/org.freedesktop.locale1.policy.in \ src/timedate/org.freedesktop.timedate1.policy.in \ + $(am__append_273) $(am__append_288) \ src/login/org.freedesktop.login1.policy.in -polkitpolicy_files = $(am__append_212) $(am__append_223) \ - $(am__append_235) $(am__append_299) +polkitpolicy_files = $(am__append_226) $(am__append_237) \ + $(am__append_249) $(am__append_272) $(am__append_287) \ + $(am__append_335) dist_udevrules_DATA = rules/42-usb-hid-pm.rules \ rules/50-udev-default.rules rules/60-drm.rules \ - rules/60-keyboard.rules rules/70-mouse.rules \ - rules/60-persistent-storage-tape.rules \ + rules/60-keyboard.rules rules/60-persistent-storage-tape.rules \ rules/60-persistent-serial.rules \ rules/60-persistent-input.rules rules/60-persistent-alsa.rules \ rules/60-persistent-storage.rules rules/64-btrfs.rules \ + rules/70-mouse.rules rules/70-touchpad.rules \ rules/75-net-description.rules rules/75-tty-description.rules \ rules/78-sound-card.rules rules/80-net-setup-link.rules \ - rules/95-udev-late.rules $(am__append_126) \ + rules/95-udev-late.rules $(am__append_133) \ rules/60-cdrom_id.rules rules/60-persistent-v4l.rules \ rules/61-accelerometer.rules rules/75-probe_mtd.rules \ - $(am__append_304) -nodist_udevrules_DATA = rules/99-systemd.rules $(am__append_186) \ - $(am__append_305) + $(am__append_340) +nodist_udevrules_DATA = rules/99-systemd.rules $(am__append_200) \ + $(am__append_341) dist_pkgsysconf_DATA = src/core/system.conf src/core/user.conf \ - src/journal/journald.conf $(am__append_172) $(am__append_190) \ - $(am__append_298) -nodist_pkgsysconf_DATA = $(am__append_145) $(am__append_151) \ - $(am__append_246) $(am__append_273) -dist_pkgdata_DATA = $(am__append_118) $(am__append_226) + src/journal/journald.conf $(am__append_186) $(am__append_204) \ + $(am__append_334) +nodist_pkgsysconf_DATA = $(am__append_159) $(am__append_165) \ + $(am__append_260) $(am__append_300) +dist_pkgdata_DATA = $(am__append_126) $(am__append_240) dist_dbuspolicy_DATA = src/core/org.freedesktop.systemd1.conf \ - $(am__append_210) $(am__append_221) $(am__append_232) \ - $(am__append_257) $(am__append_268) $(am__append_297) + $(am__append_224) $(am__append_235) $(am__append_246) \ + $(am__append_271) $(am__append_286) $(am__append_295) \ + $(am__append_314) $(am__append_333) dist_dbussystemservice_DATA = \ - src/core/org.freedesktop.systemd1.service $(am__append_211) \ - $(am__append_222) $(am__append_231) $(am__append_256) \ - $(am__append_269) $(am__append_296) + src/core/org.freedesktop.systemd1.service $(am__append_225) \ + $(am__append_236) $(am__append_245) $(am__append_270) \ + $(am__append_285) $(am__append_296) $(am__append_313) \ + $(am__append_332) # ------------------------------------------------------------------------------ dist_systemunit_DATA_busnames = units/busnames.target \ - $(am__append_209) units/org.freedesktop.systemd1.busname \ - $(am__append_219) $(am__append_234) $(am__append_255) \ - $(am__append_267) $(am__append_295) + $(am__append_223) units/org.freedesktop.systemd1.busname \ + $(am__append_233) $(am__append_248) $(am__append_269) \ + $(am__append_282) $(am__append_294) $(am__append_312) \ + $(am__append_331) check_DATA = test/sys tests = test-engine test-cgroup-mask test-job-type test-env-replace \ test-strbuf test-strv test-path test-path-util test-strxcpyx \ test-unit-name test-unit-file test-utf8 test-ellipsize \ - test-util test-ring test-barrier test-pty test-tmpfiles \ - test-namespace test-date test-sleep test-replace-var \ - test-sched-prio test-calendarspec test-strip-tab-ansi \ - test-cgroup-util test-prioq test-fileio test-time test-hashmap \ - test-set test-list test-unaligned test-tables \ - test-device-nodes test-xml test-architecture test-socket-util \ + test-util test-path-lookup test-ring test-barrier test-pty \ + test-tmpfiles test-namespace test-date test-sleep \ + test-replace-var test-sched-prio test-calendarspec \ + test-strip-tab-ansi test-cgroup-util test-fstab-util \ + test-prioq test-fileio test-time test-hashmap test-set \ + test-list test-unaligned test-tables test-device-nodes \ + test-xml test-json test-architecture test-socket-util \ test-fdset test-conf-files test-capability test-async \ test-ratelimit test-condition test-uid-range test-bus-policy \ test-locale-util test-execute test-copy test-cap-list \ - test-bus-marshal test-bus-signature test-bus-chat \ - test-bus-cleanup test-bus-server test-bus-match \ + test-sigbus test-verbs test-bus-marshal test-bus-signature \ + test-bus-chat test-bus-cleanup test-bus-server test-bus-match \ test-bus-kernel test-bus-kernel-bloom \ test-bus-kernel-benchmark test-bus-zero-copy \ test-bus-introspect test-bus-objects test-bus-error \ test-bus-creds test-bus-gvariant test-event test-rtnl \ test-local-addresses test-resolve test-dhcp-option \ test-dhcp-client test-dhcp-server test-ipv4ll test-icmp6-rs \ - test-dhcp6-client $(am__append_122) test-id128 test-journal \ - test-journal-send test-journal-syslog test-journal-match \ - test-journal-stream test-journal-init test-journal-verify \ - test-journal-interleaving test-journal-flush test-mmap-cache \ - test-catalog $(am__append_158) $(am__append_252) \ - $(am__append_274) $(am__append_279) $(am__append_292) \ - test-libsystemd-sym test-libudev-sym + test-dhcp6-client test-lldp $(am__append_129) test-id128 \ + test-journal test-journal-send test-journal-syslog \ + test-journal-match test-journal-stream test-journal-init \ + test-journal-verify test-journal-interleaving \ + test-journal-flush test-mmap-cache test-catalog \ + $(am__append_172) $(am__append_266) $(am__append_301) \ + $(am__append_309) $(am__append_328) test-libsystemd-sym \ + test-libudev-sym # ------------------------------------------------------------------------------ manual_tests = test-ns test-loopback test-hostname test-daemon \ test-cgroup test-install test-watchdog test-log test-ipcrm \ - $(am__append_70) $(am__append_71) test-pppoe test-libudev \ - test-udev test-journal-enum $(am__append_175) \ - $(am__append_291) + test-btrfs $(am__append_75) $(am__append_76) $(am__append_77) \ + test-pppoe test-libudev test-udev test-journal-enum \ + $(am__append_189) $(am__append_289) $(am__append_327) +TEST_EXTENSIONS = .py +PY_LOG_COMPILER = $(PYTHON) AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \ @@ -5459,6 +5810,7 @@ AM_CPPFLAGS = \ -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \ -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \ -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \ + -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \ -DX_SERVER=\"$(bindir)/X\" \ -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \ -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \ @@ -5488,6 +5840,7 @@ AM_CPPFLAGS = \ -I $(top_srcdir)/src/libsystemd/sd-event \ -I $(top_srcdir)/src/libsystemd/sd-rtnl \ -I $(top_srcdir)/src/libsystemd/sd-network \ + -I $(top_srcdir)/src/libsystemd/sd-hwdb \ -I $(top_srcdir)/src/libsystemd-network \ -I $(top_srcdir)/src/libsystemd-terminal \ $(OUR_CPPFLAGS) @@ -5496,9 +5849,9 @@ AM_CFLAGS = $(OUR_CFLAGS) AM_LDFLAGS = $(OUR_LDFLAGS) # ------------------------------------------------------------------------------ -INSTALL_DIRS = $(am__append_84) $(am__append_90) \ - $(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d \ - $(am__append_182) $(am__append_300) $(am__append_324) \ +INSTALL_DIRS = $(am__append_91) $(am__append_97) \ + $(sysconfdir)/udev/rules.d $(am__append_137) $(am__append_196) \ + $(am__append_336) $(am__append_360) \ $(prefix)/lib/modules-load.d $(sysconfdir)/modules-load.d \ $(prefix)/lib/systemd/network $(sysconfdir)/systemd/network \ $(prefix)/lib/sysctl.d $(sysconfdir)/sysctl.d \ @@ -5509,24 +5862,24 @@ INSTALL_DIRS = $(am__append_84) $(am__append_90) \ $(pkgsysconfdir)/system/getty.target.wants \ $(pkgsysconfdir)/user $(dbussessionservicedir) \ $(sysconfdir)/xdg/systemd -RUNLEVEL1_TARGET_WANTS = $(am__append_316) -RUNLEVEL2_TARGET_WANTS = $(am__append_317) -RUNLEVEL3_TARGET_WANTS = $(am__append_318) -RUNLEVEL4_TARGET_WANTS = $(am__append_319) -RUNLEVEL5_TARGET_WANTS = $(am__append_320) +RUNLEVEL1_TARGET_WANTS = $(am__append_352) +RUNLEVEL2_TARGET_WANTS = $(am__append_353) +RUNLEVEL3_TARGET_WANTS = $(am__append_354) +RUNLEVEL4_TARGET_WANTS = $(am__append_355) +RUNLEVEL5_TARGET_WANTS = $(am__append_356) SHUTDOWN_TARGET_WANTS = LOCAL_FS_TARGET_WANTS = systemd-remount-fs.service tmp.mount -MULTI_USER_TARGET_WANTS = $(am__append_301) getty.target \ +MULTI_USER_TARGET_WANTS = $(am__append_337) getty.target \ systemd-ask-password-wall.path -SYSINIT_TARGET_WANTS = $(am__append_66) $(am__append_74) \ - $(am__append_76) $(am__append_81) $(am__append_87) \ - $(am__append_94) systemd-machine-id-commit.service \ +SYSINIT_TARGET_WANTS = $(am__append_71) $(am__append_80) \ + $(am__append_82) $(am__append_88) $(am__append_94) \ + $(am__append_101) systemd-machine-id-commit.service \ systemd-udevd.service systemd-udev-trigger.service \ - systemd-udev-hwdb-update.service systemd-journald.service \ + $(am__append_141) systemd-journald.service \ systemd-journal-flush.service \ - systemd-journal-catalog-update.service $(am__append_183) \ - $(am__append_187) $(am__append_198) $(am__append_206) \ - $(am__append_321) systemd-update-done.service \ + systemd-journal-catalog-update.service $(am__append_197) \ + $(am__append_201) $(am__append_212) $(am__append_220) \ + $(am__append_357) systemd-update-done.service \ dev-hugepages.mount dev-mqueue.mount sys-kernel-config.mount \ sys-kernel-debug.mount sys-fs-fuse-connections.mount \ systemd-sysctl.service systemd-ask-password-console.path @@ -5534,19 +5887,20 @@ SOCKETS_TARGET_WANTS = systemd-udevd-control.socket \ systemd-udevd-kernel.socket systemd-journald.socket \ systemd-journald-dev-log.socket systemd-journald-audit.socket \ systemd-initctl.socket systemd-shutdownd.socket -BUSNAMES_TARGET_WANTS = $(am__append_214) \ - org.freedesktop.systemd1.busname $(am__append_225) \ - $(am__append_237) $(am__append_260) $(am__append_271) \ - $(am__append_303) -TIMERS_TARGET_WANTS = $(am__append_83) +BUSNAMES_TARGET_WANTS = $(am__append_228) \ + org.freedesktop.systemd1.busname $(am__append_239) \ + $(am__append_251) $(am__append_276) $(am__append_283) \ + $(am__append_298) $(am__append_317) $(am__append_339) +TIMERS_TARGET_WANTS = $(am__append_90) USER_SOCKETS_TARGET_WANTS = -USER_DEFAULT_TARGET_WANTS = $(am__append_120) +USER_DEFAULT_TARGET_WANTS = $(am__append_128) USER_BUSNAMES_TARGET_WANTS = -SYSTEM_UNIT_ALIASES = $(am__append_213) $(am__append_224) \ - $(am__append_236) $(am__append_259) $(am__append_270) \ - $(am__append_302) $(am__append_322) graphical.target \ - default.target reboot.target ctrl-alt-del.target \ - getty@.service autovt@.service +SYSTEM_UNIT_ALIASES = $(am__append_227) $(am__append_238) \ + $(am__append_250) $(am__append_275) $(am__append_284) \ + $(am__append_297) $(am__append_316) $(am__append_338) \ + $(am__append_358) graphical.target default.target \ + reboot.target ctrl-alt-del.target getty@.service \ + autovt@.service USER_UNIT_ALIASES = $(systemunitdir)/shutdown.target shutdown.target \ $(systemunitdir)/sockets.target sockets.target \ $(systemunitdir)/timers.target timers.target \ @@ -5555,9 +5909,9 @@ USER_UNIT_ALIASES = $(systemunitdir)/shutdown.target shutdown.target \ $(systemunitdir)/printer.target printer.target \ $(systemunitdir)/sound.target sound.target \ $(systemunitdir)/smartcard.target smartcard.target \ - $(am__append_323) -GENERAL_ALIASES = $(am__append_245) $(am__append_272) \ - $(am__append_281) $(systemunitdir)/remote-fs.target \ + $(am__append_359) +GENERAL_ALIASES = $(am__append_259) $(am__append_299) \ + $(am__append_315) $(systemunitdir)/remote-fs.target \ $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \ $(systemunitdir)/getty@.service \ $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \ @@ -5599,9 +5953,9 @@ dist_bashcompletion_DATA = shell-completion/bash/busctl \ shell-completion/bash/systemd-nspawn \ shell-completion/bash/systemd-run \ shell-completion/bash/udevadm \ - shell-completion/bash/kernel-install $(am__append_102) \ - $(am__append_176) $(am__append_216) $(am__append_228) \ - $(am__append_239) $(am__append_251) $(am__append_289) + shell-completion/bash/kernel-install $(am__append_109) \ + $(am__append_190) $(am__append_230) $(am__append_242) \ + $(am__append_253) $(am__append_265) $(am__append_325) nodist_bashcompletion_DATA = \ shell-completion/bash/systemctl @@ -5615,10 +5969,10 @@ dist_zshcompletion_DATA = shell-completion/zsh/_journalctl \ shell-completion/zsh/_sd_outputmodes \ shell-completion/zsh/_sd_unit_files \ shell-completion/zsh/_systemd-delta \ - shell-completion/zsh/_systemd $(am__append_82) \ - $(am__append_103) $(am__append_177) $(am__append_217) \ - $(am__append_229) $(am__append_240) $(am__append_258) \ - $(am__append_290) + shell-completion/zsh/_systemd $(am__append_89) \ + $(am__append_110) $(am__append_191) $(am__append_231) \ + $(am__append_243) $(am__append_254) $(am__append_274) \ + $(am__append_326) nodist_zshcompletion_DATA = \ shell-completion/zsh/_systemctl @@ -5650,14 +6004,14 @@ dist_systemunit_DATA = units/graphical.target units/multi-user.target \ units/systemd-ask-password-console.path \ units/systemd-udevd-control.socket \ units/systemd-udevd-kernel.socket units/system-update.target \ - units/initrd-switch-root.target $(am__append_3) \ - $(am__append_65) $(am__append_78) $(am__append_98) \ - $(am__append_110) $(am__append_141) \ + units/initrd-switch-root.target units/machines.target \ + $(am__append_3) $(am__append_70) $(am__append_85) \ + $(am__append_105) $(am__append_118) $(am__append_155) \ units/systemd-journald.socket \ units/systemd-journald-dev-log.socket \ - units/systemd-journald-audit.socket $(am__append_167) \ - $(am__append_180) $(am__append_205) $(am__append_254) \ - $(am__append_294) + units/systemd-journald-audit.socket $(am__append_181) \ + $(am__append_194) $(am__append_219) $(am__append_268) \ + $(am__append_310) $(am__append_330) nodist_systemunit_DATA = units/getty@.service \ units/serial-getty@.service units/console-shell.service \ units/console-getty.service units/container-getty@.service \ @@ -5674,28 +6028,27 @@ nodist_systemunit_DATA = units/getty@.service \ units/systemd-machine-id-commit.service \ units/systemd-udevd.service units/systemd-udev-trigger.service \ units/systemd-udev-settle.service \ - units/systemd-udev-hwdb-update.service \ - units/debug-shell.service units/initrd-parse-etc.service \ - units/initrd-cleanup.service \ + units/systemd-hwdb-update.service units/debug-shell.service \ + units/initrd-parse-etc.service units/initrd-cleanup.service \ units/initrd-udevadm-cleanup-db.service \ units/initrd-switch-root.service units/systemd-nspawn@.service \ units/systemd-update-done.service $(am__append_4) \ - $(am__append_5) $(am__append_73) $(am__append_75) \ - $(am__append_79) $(am__append_86) $(am__append_92) \ - $(am__append_99) $(am__append_109) $(am__append_142) \ - $(am__append_149) units/systemd-journald.service \ + $(am__append_5) $(am__append_79) $(am__append_81) \ + $(am__append_86) $(am__append_93) $(am__append_99) \ + $(am__append_106) $(am__append_117) $(am__append_156) \ + $(am__append_163) units/systemd-journald.service \ units/systemd-journal-flush.service \ - units/systemd-journal-catalog-update.service $(am__append_168) \ - $(am__append_181) $(am__append_185) $(am__append_191) \ - $(am__append_195) units/quotaon.service $(am__append_197) \ - $(am__append_200) $(am__append_202) $(am__append_208) \ - $(am__append_218) $(am__append_233) $(am__append_244) \ - $(am__append_253) $(am__append_266) $(am__append_280) \ - $(am__append_293) + units/systemd-journal-catalog-update.service $(am__append_182) \ + $(am__append_195) $(am__append_199) $(am__append_205) \ + $(am__append_209) units/quotaon.service $(am__append_211) \ + $(am__append_214) $(am__append_216) $(am__append_222) \ + $(am__append_232) $(am__append_247) $(am__append_258) \ + $(am__append_267) $(am__append_280) $(am__append_293) \ + $(am__append_311) $(am__append_329) dist_userunit_DATA = units/user/basic.target units/user/default.target \ - units/user/exit.target $(am__append_112) + units/user/exit.target $(am__append_120) nodist_userunit_DATA = units/user/systemd-exit.service \ - $(am__append_111) $(am__append_119) + $(am__append_119) $(am__append_127) dist_systempreset_DATA = \ system-preset/90-systemd.preset @@ -5720,12 +6073,12 @@ MANPAGES = man/bootup.7 man/busctl.1 man/daemon.7 man/file-hierarchy.7 \ man/halt.8 man/hostname.5 man/journalctl.1 man/journald.conf.5 \ man/kernel-command-line.7 man/kernel-install.8 \ man/locale.conf.5 man/localtime.5 man/machine-id.5 \ - man/machine-info.5 man/os-release.5 man/sd-daemon.3 \ - man/sd-id128.3 man/sd-journal.3 man/sd_booted.3 \ - man/sd_id128_get_machine.3 man/sd_id128_randomize.3 \ - man/sd_id128_to_string.3 man/sd_is_fifo.3 \ - man/sd_journal_add_match.3 man/sd_journal_get_catalog.3 \ - man/sd_journal_get_cursor.3 \ + man/machine-info.5 man/networkctl.1 man/os-release.5 \ + man/sd-daemon.3 man/sd-id128.3 man/sd-journal.3 \ + man/sd_booted.3 man/sd_id128_get_machine.3 \ + man/sd_id128_randomize.3 man/sd_id128_to_string.3 \ + man/sd_is_fifo.3 man/sd_journal_add_match.3 \ + man/sd_journal_get_catalog.3 man/sd_journal_get_cursor.3 \ man/sd_journal_get_cutoff_realtime_usec.3 \ man/sd_journal_get_data.3 man/sd_journal_get_fd.3 \ man/sd_journal_get_realtime_usec.3 man/sd_journal_get_usage.3 \ @@ -5740,10 +6093,9 @@ MANPAGES = man/bootup.7 man/busctl.1 man/daemon.7 man/file-hierarchy.7 \ man/systemd-cgls.1 man/systemd-cgtop.1 \ man/systemd-debug-generator.8 man/systemd-delta.1 \ man/systemd-detect-virt.1 man/systemd-efi-boot-generator.8 \ - man/systemd-escape.1 man/systemd-firstboot.1 \ - man/systemd-fsck@.service.8 man/systemd-fstab-generator.8 \ - man/systemd-getty-generator.8 man/systemd-gpt-auto-generator.8 \ - man/systemd-halt.service.8 \ + man/systemd-escape.1 man/systemd-fsck@.service.8 \ + man/systemd-fstab-generator.8 man/systemd-getty-generator.8 \ + man/systemd-gpt-auto-generator.8 man/systemd-halt.service.8 \ man/systemd-hibernate-resume-generator.8 \ man/systemd-hibernate-resume@.service.8 man/systemd-inhibit.1 \ man/systemd-initctl.service.8 man/systemd-journald.service.8 \ @@ -5760,11 +6112,11 @@ MANPAGES = man/bootup.7 man/busctl.1 man/daemon.7 man/file-hierarchy.7 \ man/systemd-tmpfiles.8 man/systemd-tty-ask-password-agent.1 \ man/systemd-udevd.service.8 man/systemd-update-done.service.8 \ man/systemd.1 man/systemd.automount.5 man/systemd.device.5 \ - man/systemd.exec.5 man/systemd.journal-fields.7 \ - man/systemd.kill.5 man/systemd.link.5 man/systemd.mount.5 \ - man/systemd.path.5 man/systemd.preset.5 \ - man/systemd.resource-control.5 man/systemd.scope.5 \ - man/systemd.service.5 man/systemd.slice.5 \ + man/systemd.exec.5 man/systemd.generator.7 \ + man/systemd.journal-fields.7 man/systemd.kill.5 \ + man/systemd.link.5 man/systemd.mount.5 man/systemd.path.5 \ + man/systemd.preset.5 man/systemd.resource-control.5 \ + man/systemd.scope.5 man/systemd.service.5 man/systemd.slice.5 \ man/systemd.snapshot.5 man/systemd.socket.5 \ man/systemd.special.7 man/systemd.swap.5 man/systemd.target.5 \ man/systemd.time.7 man/systemd.timer.5 man/systemd.unit.5 \ @@ -5777,7 +6129,8 @@ MANPAGES = man/bootup.7 man/busctl.1 man/daemon.7 man/file-hierarchy.7 \ $(am__append_35) $(am__append_37) $(am__append_39) \ $(am__append_41) $(am__append_43) $(am__append_45) \ $(am__append_47) $(am__append_49) $(am__append_51) \ - $(am__append_53) $(am__append_55) $(am__append_57) + $(am__append_53) $(am__append_55) $(am__append_57) \ + $(am__append_59) $(am__append_61) MANPAGES_ALIAS = man/SD_ALERT.3 man/SD_CRIT.3 man/SD_DEBUG.3 \ man/SD_EMERG.3 man/SD_ERR.3 man/SD_ID128_CONST_STR.3 \ man/SD_ID128_FORMAT_STR.3 man/SD_ID128_FORMAT_VAL.3 \ @@ -5818,11 +6171,11 @@ MANPAGES_ALIAS = man/SD_ALERT.3 man/SD_CRIT.3 man/SD_DEBUG.3 \ man/sd_journal_set_data_threshold.3 \ man/sd_journal_test_cursor.3 man/sd_journal_wait.3 \ man/sd_machine_get_ifindices.3 man/sd_notifyf.3 \ - man/sleep.conf.d.5 man/system.conf.d.5 \ + man/sd_pid_notify.3 man/sd_pid_notify_with_fds.3 \ + man/sd_pid_notifyf.3 man/sleep.conf.d.5 man/system.conf.d.5 \ man/systemd-ask-password-console.path.8 \ man/systemd-ask-password-wall.path.8 \ man/systemd-ask-password-wall.service.8 \ - man/systemd-firstboot.service.1 \ man/systemd-fsck-root.service.8 man/systemd-fsck.8 \ man/systemd-hibernate-resume.8 man/systemd-hibernate.service.8 \ man/systemd-hybrid-sleep.service.8 man/systemd-initctl.8 \ @@ -5849,7 +6202,8 @@ MANPAGES_ALIAS = man/SD_ALERT.3 man/SD_CRIT.3 man/SD_DEBUG.3 \ $(am__append_36) $(am__append_38) $(am__append_40) \ $(am__append_42) $(am__append_44) $(am__append_46) \ $(am__append_48) $(am__append_50) $(am__append_52) \ - $(am__append_54) $(am__append_56) $(am__append_58) + $(am__append_54) $(am__append_56) $(am__append_58) \ + $(am__append_60) $(am__append_62) XML_FILES = \ ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}} @@ -5876,7 +6230,8 @@ libsystemd_shared_la_SOURCES = src/shared/capability.c \ src/shared/device-nodes.h src/shared/util.c src/shared/util.h \ src/shared/virt.c src/shared/virt.h src/shared/architecture.c \ src/shared/architecture.h src/shared/efivars.c \ - src/shared/efivars.h src/shared/path-util.c \ + src/shared/efivars.h src/shared/fstab-util.c \ + src/shared/fstab-util.h src/shared/path-util.c \ src/shared/path-util.h src/shared/time-util.c \ src/shared/time-util.h src/shared/locale-util.c \ src/shared/locale-util.h src/shared/mempool.c \ @@ -5921,16 +6276,19 @@ libsystemd_shared_la_SOURCES = src/shared/capability.c \ src/shared/arphrd-list.c src/shared/arphrd-list.h \ src/shared/cap-list.c src/shared/cap-list.h src/shared/audit.c \ src/shared/audit.h src/shared/xml.c src/shared/xml.h \ - src/shared/bus-label.c src/shared/bus-label.h src/shared/gpt.h \ - src/shared/clean-ipc.h src/shared/clean-ipc.c \ - src/shared/login-shared.c src/shared/login-shared.h \ - src/shared/ring.c src/shared/ring.h src/shared/barrier.c \ - src/shared/barrier.h src/shared/pty.c src/shared/pty.h \ - src/shared/async.c src/shared/async.h src/shared/copy.c \ - src/shared/copy.h src/shared/base-filesystem.c \ - src/shared/base-filesystem.h src/shared/memfd-util.c \ - src/shared/memfd-util.h src/shared/uid-range.c \ - src/shared/uid-range.h src/shared/nss-util.h $(am__append_64) + src/shared/json.c src/shared/json.h src/shared/bus-label.c \ + src/shared/bus-label.h src/shared/gpt.h src/shared/clean-ipc.h \ + src/shared/clean-ipc.c src/shared/login-shared.c \ + src/shared/login-shared.h src/shared/ring.c src/shared/ring.h \ + src/shared/barrier.c src/shared/barrier.h src/shared/pty.c \ + src/shared/pty.h src/shared/async.c src/shared/async.h \ + src/shared/base-filesystem.c src/shared/base-filesystem.h \ + src/shared/memfd-util.c src/shared/memfd-util.h \ + src/shared/uid-range.c src/shared/uid-range.h \ + src/shared/nss-util.h src/shared/verbs.c src/shared/verbs.h \ + src/shared/sigbus.c src/shared/sigbus.h src/shared/build.h \ + src/shared/import-util.c src/shared/import-util.h \ + $(am__append_68) nodist_libsystemd_shared_la_SOURCES = \ src/shared/errno-from-name.h \ src/shared/errno-to-name.h \ @@ -5948,7 +6306,8 @@ libsystemd_shared_la_CFLAGS = \ -pthread libsystemd_shared_la_LIBADD = \ - $(CAP_LIBS) + $(CAP_LIBS) \ + -lm libsystemd_units_la_SOURCES = \ src/shared/install.c \ @@ -5980,7 +6339,14 @@ libsystemd_label_la_SOURCES = \ src/shared/condition.c \ src/shared/condition.h \ src/shared/generator.h \ - src/shared/generator.c + src/shared/generator.c \ + src/shared/btrfs-util.c \ + src/shared/btrfs-util.h \ + src/shared/btrfs-ctree.h \ + src/shared/machine-image.c \ + src/shared/machine-image.h \ + src/shared/copy.c \ + src/shared/copy.h libsystemd_label_la_CFLAGS = \ $(AM_CFLAGS) \ @@ -5989,6 +6355,17 @@ libsystemd_label_la_CFLAGS = \ libsystemd_label_la_LIBADD = \ $(SELINUX_LIBS) +@HAVE_LIBIPTC_TRUE@libsystemd_fw_la_SOURCES = \ +@HAVE_LIBIPTC_TRUE@ src/shared/fw-util.h \ +@HAVE_LIBIPTC_TRUE@ src/shared/fw-util.c + +@HAVE_LIBIPTC_TRUE@libsystemd_fw_la_CFLAGS = \ +@HAVE_LIBIPTC_TRUE@ $(AM_CFLAGS) \ +@HAVE_LIBIPTC_TRUE@ $(LIBIPTC_CFLAGS) + +@HAVE_LIBIPTC_TRUE@libsystemd_fw_la_LIBADD = \ +@HAVE_LIBIPTC_TRUE@ $(LIBIPTC_LIBS) + @HAVE_SECCOMP_TRUE@libsystemd_seccomp_la_SOURCES = \ @HAVE_SECCOMP_TRUE@ src/shared/seccomp-util.h \ @HAVE_SECCOMP_TRUE@ src/shared/seccomp-util.c @@ -6034,10 +6411,10 @@ libsystemd_core_la_SOURCES = \ src/core/socket.h \ src/core/busname.c \ src/core/busname.h \ - src/core/bus-common.c \ - src/core/bus-common.h \ src/core/bus-endpoint.c \ src/core/bus-endpoint.h \ + src/core/bus-policy.c \ + src/core/bus-policy.h \ src/core/target.c \ src/core/target.h \ src/core/snapshot.c \ @@ -6128,8 +6505,6 @@ libsystemd_core_la_SOURCES = \ src/core/loopback-setup.c \ src/core/namespace.c \ src/core/namespace.h \ - src/core/build.h \ - src/core/sysfs-show.h \ src/core/killall.h \ src/core/killall.c \ src/core/audit-fd.c \ @@ -6157,7 +6532,7 @@ libsystemd_core_la_LIBADD = libsystemd-units.la libsystemd-label.la \ libudev-internal.la libsystemd-shared.la \ libsystemd-internal.la $(PAM_LIBS) $(AUDIT_LIBS) $(KMOD_LIBS) \ $(APPARMOR_LIBS) $(SECCOMP_LIBS) $(MOUNT_LIBS) \ - $(am__append_69) + $(am__append_74) # ------------------------------------------------------------------------------ systemd_SOURCES = \ @@ -6171,9 +6546,6 @@ systemd_LDADD = \ libsystemd-core.la \ $(RT_LIBS) -pkgconfigdata_DATA = \ - src/core/systemd.pc - nodist_rpmmacros_DATA = \ src/core/macros.systemd @@ -6283,6 +6655,13 @@ test_copy_SOURCES = \ src/test/test-copy.c test_copy_LDADD = \ + libsystemd-label.la \ + libsystemd-shared.la + +test_sigbus_SOURCES = \ + src/test/test-sigbus.c + +test_sigbus_LDADD = \ libsystemd-shared.la test_condition_SOURCES = \ @@ -6300,6 +6679,12 @@ test_fdset_LDADD = \ libsystemd-shared.la \ libsystemd-internal.la +test_fstab_util_SOURCES = \ + src/test/test-fstab-util.c + +test_fstab_util_LDADD = \ + libsystemd-shared.la + test_ratelimit_SOURCES = \ src/test/test-ratelimit.c @@ -6310,7 +6695,14 @@ test_util_SOURCES = \ src/test/test-util.c test_util_LDADD = \ + libsystemd-shared.la + +test_path_lookup_SOURCES = \ + src/test/test-path-lookup.c + +test_path_lookup_LDADD = \ -lm \ + libsystemd-units.la \ libsystemd-shared.la test_uid_range_SOURCES = \ @@ -6358,6 +6750,12 @@ test_tmpfiles_LDADD = \ test_namespace_SOURCES = \ src/test/test-namespace.c +test_verbs_SOURCES = \ + src/test/test-verbs.c + +test_verbs_LDADD = \ + libsystemd-shared.la + test_namespace_LDADD = \ libsystemd-core.la @@ -6383,6 +6781,12 @@ test_xml_SOURCES = \ test_xml_LDADD = \ libsystemd-shared.la +test_json_SOURCES = \ + src/test/test-json.c + +test_json_LDADD = \ + libsystemd-shared.la + test_list_SOURCES = \ src/test/test-list.c @@ -6398,8 +6802,8 @@ test_unaligned_SOURCES = \ test_tables_SOURCES = \ src/test/test-tables.c \ src/shared/test-tables.h \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h \ + src/bus-proxyd/bus-xml-policy.c \ + src/bus-proxyd/bus-xml-policy.h \ src/journal/journald-server.c \ src/journal/journald-server.h @@ -6456,6 +6860,25 @@ test_ipcrm_LDADD = \ libsystemd-shared.la \ -lrt +test_btrfs_SOURCES = \ + src/test/test-btrfs.c + +test_btrfs_LDADD = \ + libsystemd-label.la \ + libsystemd-shared.la + +@HAVE_LIBIPTC_TRUE@test_fw_util_SOURCES = \ +@HAVE_LIBIPTC_TRUE@ src/test/test-fw-util.c + +@HAVE_LIBIPTC_TRUE@test_fw_util_CFLAGS = \ +@HAVE_LIBIPTC_TRUE@ $(AM_CFLAGS) \ +@HAVE_LIBIPTC_TRUE@ $(LIBIPTC_CFLAGS) + +@HAVE_LIBIPTC_TRUE@test_fw_util_LDADD = \ +@HAVE_LIBIPTC_TRUE@ libsystemd-fw.la \ +@HAVE_LIBIPTC_TRUE@ libsystemd-shared.la \ +@HAVE_LIBIPTC_TRUE@ $(LIBIPTC_LIBS) + test_rtnl_manual_SOURCES = \ src/test/test-rtnl-manual.c @@ -6627,11 +7050,10 @@ test_conf_files_LDADD = \ libsystemd-shared.la test_bus_policy_SOURCES = \ - src/bus-proxyd/test-bus-policy.c \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h + src/bus-proxyd/test-bus-xml-policy.c test_bus_policy_LDADD = \ + libsystemd-proxy.la \ libsystemd-internal.la \ libsystemd-shared.la @@ -6731,20 +7153,18 @@ systemd_shutdown_LDADD = \ @ENABLE_TMPFILES_TRUE@systemd_tmpfiles_SOURCES = \ @ENABLE_TMPFILES_TRUE@ src/tmpfiles/tmpfiles.c -@ENABLE_TMPFILES_TRUE@systemd_tmpfiles_LDADD = \ -@ENABLE_TMPFILES_TRUE@ libsystemd-units.la \ +@ENABLE_TMPFILES_TRUE@systemd_tmpfiles_LDADD = libsystemd-units.la \ @ENABLE_TMPFILES_TRUE@ libsystemd-label.la \ @ENABLE_TMPFILES_TRUE@ libsystemd-internal.la \ -@ENABLE_TMPFILES_TRUE@ libsystemd-shared.la - +@ENABLE_TMPFILES_TRUE@ libsystemd-shared.la $(am__append_83) @ENABLE_TMPFILES_TRUE@nodist_tmpfiles_DATA = \ @ENABLE_TMPFILES_TRUE@ tmpfiles.d/etc.conf @ENABLE_TMPFILES_TRUE@dist_tmpfiles_DATA = tmpfiles.d/systemd.conf \ @ENABLE_TMPFILES_TRUE@ tmpfiles.d/systemd-nologin.conf \ @ENABLE_TMPFILES_TRUE@ tmpfiles.d/tmp.conf tmpfiles.d/x11.conf \ -@ENABLE_TMPFILES_TRUE@ tmpfiles.d/var.conf $(am__append_80) \ -@ENABLE_TMPFILES_TRUE@ $(am__append_139) +@ENABLE_TMPFILES_TRUE@ tmpfiles.d/var.conf $(am__append_87) \ +@ENABLE_TMPFILES_TRUE@ $(am__append_153) # ------------------------------------------------------------------------------ @ENABLE_SYSUSERS_TRUE@systemd_sysusers_SOURCES = \ @@ -6757,7 +7177,7 @@ systemd_shutdown_LDADD = \ @ENABLE_SYSUSERS_TRUE@ libsystemd-shared.la @ENABLE_SYSUSERS_TRUE@dist_sysusers_DATA = sysusers.d/systemd.conf \ -@ENABLE_SYSUSERS_TRUE@ $(am__append_138) +@ENABLE_SYSUSERS_TRUE@ $(am__append_152) @ENABLE_SYSUSERS_TRUE@nodist_sysusers_DATA = \ @ENABLE_SYSUSERS_TRUE@ sysusers.d/basic.conf @@ -6951,6 +7371,9 @@ systemd_system_update_generator_LDADD = \ @ENABLE_KDBUS_TRUE@ libsystemd-internal.la \ @ENABLE_KDBUS_TRUE@ libsystemd-shared.la +@ENABLE_KDBUS_TRUE@dist_xinitrc_SCRIPTS = \ +@ENABLE_KDBUS_TRUE@ xorg/50-systemd-user.sh + # ------------------------------------------------------------------------------ systemd_sysv_generator_SOURCES = \ @@ -7079,7 +7502,7 @@ systemd_nspawn_CFLAGS = \ systemd_nspawn_LDADD = libsystemd-label.la libsystemd-internal.la \ libudev-internal.la libsystemd-shared.la $(BLKID_LIBS) \ - $(am__append_108) + $(am__append_115) $(am__append_116) # ------------------------------------------------------------------------------ systemd_run_SOURCES = \ @@ -7090,14 +7513,41 @@ systemd_run_LDADD = \ libsystemd-internal.la \ libsystemd-shared.la +libsystemd_proxy_la_SOURCES = \ + src/bus-proxyd/bus-xml-policy.c \ + src/bus-proxyd/bus-xml-policy.h \ + src/bus-proxyd/driver.c \ + src/bus-proxyd/driver.h \ + src/bus-proxyd/proxy.c \ + src/bus-proxyd/proxy.h \ + src/bus-proxyd/synthesize.c \ + src/bus-proxyd/synthesize.h + +libsystemd_proxy_la_CFLAGS = \ + $(AM_CFLAGS) \ + -pthread + +libsystemd_proxy_la_LIBADD = \ + libsystemd-internal.la \ + libsystemd-shared.la -# ------------------------------------------------------------------------------ systemd_bus_proxyd_SOURCES = \ - src/bus-proxyd/bus-proxyd.c \ - src/bus-proxyd/bus-policy.c \ - src/bus-proxyd/bus-policy.h + src/bus-proxyd/bus-proxyd.c + +systemd_bus_proxyd_CFLAGS = \ + $(AM_CFLAGS) \ + -pthread systemd_bus_proxyd_LDADD = \ + libsystemd-proxy.la \ + libsystemd-internal.la \ + libsystemd-shared.la + +systemd_stdio_bridge_SOURCES = \ + src/bus-proxyd/stdio-bridge.c + +systemd_stdio_bridge_LDADD = \ + libsystemd-proxy.la \ libsystemd-internal.la \ libsystemd-shared.la @@ -7125,6 +7575,7 @@ libsystemd_internal_la_SOURCES = \ src/systemd/sd-daemon.h \ src/systemd/sd-path.h \ src/systemd/sd-network.h \ + src/systemd/sd-hwdb.h \ src/libsystemd/sd-bus/sd-bus.c \ src/libsystemd/sd-bus/bus-control.c \ src/libsystemd/sd-bus/bus-control.h \ @@ -7185,7 +7636,10 @@ libsystemd_internal_la_SOURCES = \ src/libsystemd/sd-path/sd-path.c \ src/libsystemd/sd-network/sd-network.c \ src/libsystemd/sd-network/network-util.h \ - src/libsystemd/sd-network/network-util.c + src/libsystemd/sd-network/network-util.c \ + src/libsystemd/sd-hwdb/sd-hwdb.c \ + src/libsystemd/sd-hwdb/hwdb-util.h \ + src/libsystemd/sd-hwdb/hwdb-internal.h nodist_libsystemd_internal_la_SOURCES = \ src/libsystemd/libsystemd.sym @@ -7431,6 +7885,7 @@ libsystemd_network_la_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/systemd/sd-dhcp6-lease.h \ src/systemd/sd-pppoe.h \ + src/systemd/sd-lldp.h \ src/libsystemd-network/sd-dhcp-client.c \ src/libsystemd-network/sd-dhcp-server.c \ src/libsystemd-network/dhcp-network.c \ @@ -7455,7 +7910,20 @@ libsystemd_network_la_SOURCES = \ src/libsystemd-network/dhcp6-network.c \ src/libsystemd-network/dhcp6-option.c \ src/libsystemd-network/dhcp6-lease-internal.h \ - src/libsystemd-network/sd-dhcp6-lease.c + src/libsystemd-network/sd-dhcp6-lease.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c \ + src/libsystemd-network/lldp.h \ + src/libsystemd-network/lldp-tlv.h \ + src/libsystemd-network/lldp-tlv.c \ + src/libsystemd-network/lldp-network.h \ + src/libsystemd-network/lldp-network.c \ + src/libsystemd-network/lldp-port.h \ + src/libsystemd-network/lldp-port.c \ + src/libsystemd-network/lldp-internal.h \ + src/libsystemd-network/lldp-internal.c \ + src/libsystemd-network/lldp-util.h \ + src/libsystemd-network/sd-lldp.c libsystemd_network_la_LIBADD = \ libudev-internal.la \ @@ -7517,7 +7985,9 @@ test_icmp6_rs_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/systemd/sd-icmp6-nd.h \ src/libsystemd-network/dhcp6-internal.h \ - src/libsystemd-network/test-icmp6-rs.c + src/libsystemd-network/test-icmp6-rs.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c test_icmp6_rs_LDADD = \ libsystemd-network.la \ @@ -7527,13 +7997,26 @@ test_icmp6_rs_LDADD = \ test_dhcp6_client_SOURCES = \ src/systemd/sd-dhcp6-client.h \ src/libsystemd-network/dhcp6-internal.h \ - src/libsystemd-network/test-dhcp6-client.c + src/libsystemd-network/test-dhcp6-client.c \ + src/libsystemd-network/dhcp-identifier.h \ + src/libsystemd-network/dhcp-identifier.c test_dhcp6_client_LDADD = \ libsystemd-network.la \ libsystemd-internal.la \ libsystemd-shared.la +test_lldp_SOURCES = \ + src/libsystemd-network/lldp.h \ + src/libsystemd-network/lldp-tlv.h \ + src/libsystemd-network/lldp-tlv.c \ + src/libsystemd-network/test-lldp.c + +test_lldp_LDADD = \ + libsystemd-network.la \ + libsystemd-internal.la \ + libsystemd-shared.la + libsystemd_terminal_la_CFLAGS = \ $(AM_CFLAGS) \ $(TERMINAL_CFLAGS) @@ -7655,7 +8138,6 @@ libudev_la_SOURCES = \ src/libudev/libudev-enumerate.c \ src/libudev/libudev-monitor.c \ src/libudev/libudev-queue.c \ - src/libudev/libudev-hwdb-def.h \ src/libudev/libudev-hwdb.c libudev_la_CFLAGS = \ @@ -7684,20 +8166,6 @@ dist_network_DATA = \ network/80-container-host0.network \ network/80-container-ve.network -dist_udevhwdb_DATA = \ - hwdb/20-pci-vendor-model.hwdb \ - hwdb/20-pci-classes.hwdb \ - hwdb/20-usb-vendor-model.hwdb \ - hwdb/20-usb-classes.hwdb \ - hwdb/20-sdio-vendor-model.hwdb \ - hwdb/20-sdio-classes.hwdb \ - hwdb/20-bluetooth-vendor-product.hwdb \ - hwdb/20-acpi-vendor.hwdb \ - hwdb/20-OUI.hwdb \ - hwdb/20-net-ifname.hwdb \ - hwdb/60-keyboard.hwdb \ - hwdb/70-mouse.hwdb - udevconfdir = $(sysconfdir)/udev dist_udevconf_DATA = \ src/udev/udev.conf @@ -7717,7 +8185,7 @@ libudev_core_la_SOURCES = src/udev/udev.h src/udev/udev-event.c \ src/udev/udev-builtin-path_id.c src/udev/udev-builtin-usb_id.c \ src/udev/net/link-config.h src/udev/net/link-config.c \ src/udev/net/ethtool-util.h src/udev/net/ethtool-util.c \ - $(am__append_125) $(am__append_127) $(am__append_128) + $(am__append_132) $(am__append_134) $(am__append_135) nodist_libudev_core_la_SOURCES = \ src/udev/keyboard-keys-from-name.h \ src/udev/keyboard-keys-to-name.h \ @@ -7731,7 +8199,7 @@ libudev_core_la_CFLAGS = \ libudev_core_la_LIBADD = libudev-internal.la libsystemd-label.la \ libsystemd-internal.la libsystemd-network.la \ libsystemd-shared.la $(BLKID_LIBS) $(KMOD_LIBS) \ - $(am__append_129) + $(am__append_136) systemd_udevd_SOURCES = \ src/udev/udevd.c @@ -7754,19 +8222,44 @@ udevadm_SOURCES = \ udevadm_LDADD = \ libudev-core.la +@ENABLE_HWDB_TRUE@systemd_hwdb_SOURCES = \ +@ENABLE_HWDB_TRUE@ src/libsystemd/sd-hwdb/hwdb-internal.h \ +@ENABLE_HWDB_TRUE@ src/hwdb/hwdb.c + +@ENABLE_HWDB_TRUE@systemd_hwdb_LDADD = \ +@ENABLE_HWDB_TRUE@ libsystemd-shared.la \ +@ENABLE_HWDB_TRUE@ libsystemd-internal.la \ +@ENABLE_HWDB_TRUE@ libudev-internal.la + +@ENABLE_HWDB_TRUE@dist_udevhwdb_DATA = \ +@ENABLE_HWDB_TRUE@ hwdb/20-pci-vendor-model.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-pci-classes.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-usb-vendor-model.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-usb-classes.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-sdio-vendor-model.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-sdio-classes.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-bluetooth-vendor-product.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-acpi-vendor.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-OUI.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/20-net-ifname.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/60-keyboard.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/70-mouse.hwdb \ +@ENABLE_HWDB_TRUE@ hwdb/70-touchpad.hwdb + test_libudev_SOURCES = \ src/test/test-libudev.c test_libudev_LDADD = \ libsystemd-label.la \ libudev-internal.la \ - libsystemd-shared.la + libsystemd-shared.la \ + libsystemd-internal.la test_udev_SOURCES = \ src/test/test-udev.c test_udev_LDADD = libudev-core.la $(BLKID_LIBS) $(KMOD_LIBS) \ - $(SELINUX_LIBS) $(am__append_130) + $(SELINUX_LIBS) $(am__append_144) # ------------------------------------------------------------------------------ ata_id_SOURCES = \ @@ -7812,7 +8305,8 @@ v4l_id_SOURCES = \ src/udev/v4l_id/v4l_id.c v4l_id_LDADD = \ - libudev-internal.la + libudev-internal.la \ + libsystemd-shared.la # ------------------------------------------------------------------------------ @@ -7820,7 +8314,7 @@ accelerometer_SOURCES = \ src/udev/accelerometer/accelerometer.c accelerometer_LDADD = \ - libudev-internal.la -lm \ + libudev-internal.la \ libsystemd-shared.la @ENABLE_GUDEV_TRUE@libgudev_includedir = \ @@ -7971,7 +8465,7 @@ systemd_cat_LDADD = \ @HAVE_MICROHTTPD_TRUE@systemd_journal_remote_LDADD = \ @HAVE_MICROHTTPD_TRUE@ libsystemd-internal.la \ @HAVE_MICROHTTPD_TRUE@ libsystemd-journal-core.la \ -@HAVE_MICROHTTPD_TRUE@ $(MICROHTTPD_LIBS) $(am__append_140) +@HAVE_MICROHTTPD_TRUE@ $(MICROHTTPD_LIBS) $(am__append_154) @HAVE_MICROHTTPD_TRUE@systemd_journal_remote_CFLAGS = \ @HAVE_MICROHTTPD_TRUE@ $(AM_CFLAGS) \ @HAVE_MICROHTTPD_TRUE@ $(MICROHTTPD_CFLAGS) @@ -7993,11 +8487,11 @@ systemd_cat_LDADD = \ # using _CFLAGS = in the conditional below would suppress AM_CFLAGS -journalctl_CFLAGS = $(AM_CFLAGS) $(am__append_155) -journalctl_SOURCES = src/journal/journalctl.c $(am__append_154) +journalctl_CFLAGS = $(AM_CFLAGS) $(am__append_169) +journalctl_SOURCES = src/journal/journalctl.c $(am__append_168) journalctl_LDADD = libsystemd-journal-internal.la \ libsystemd-internal.la libsystemd-logs.la libsystemd-shared.la \ - $(am__append_153) $(am__append_156) + $(am__append_167) $(am__append_170) test_journal_SOURCES = \ src/journal/test-journal.c @@ -8114,7 +8608,7 @@ nodist_libsystemd_journal_core_la_SOURCES = \ libsystemd_journal_core_la_LIBADD = libsystemd-journal-internal.la \ libudev-internal.la libsystemd-label.la libsystemd-internal.la \ - libsystemd-shared.la $(am__append_157) + libsystemd-shared.la $(am__append_171) libsystemd_journal_internal_la_SOURCES = src/journal/sd-journal.c \ src/systemd/sd-journal.h src/systemd/_sd-common.h \ src/journal/journal-file.c src/journal/journal-file.h \ @@ -8125,17 +8619,18 @@ libsystemd_journal_internal_la_SOURCES = src/journal/sd-journal.c \ src/journal/compress.h src/journal/catalog.c \ src/journal/catalog.h src/journal/mmap-cache.c \ src/journal/mmap-cache.h src/journal/compress.c \ - $(am__append_162) + $(am__append_176) # using _CFLAGS = in the conditional below would suppress AM_CFLAGS -libsystemd_journal_internal_la_CFLAGS = $(AM_CFLAGS) $(am__append_159) \ - $(am__append_164) -libsystemd_journal_internal_la_LIBADD = $(am__append_160) \ - $(am__append_161) $(am__append_163) +libsystemd_journal_internal_la_CFLAGS = $(AM_CFLAGS) $(am__append_173) \ + $(am__append_178) +libsystemd_journal_internal_la_LIBADD = libsystemd-label.la \ + $(am__append_174) $(am__append_175) $(am__append_177) dist_catalog_DATA = \ catalog/systemd.fr.catalog \ catalog/systemd.it.catalog \ catalog/systemd.pl.catalog \ + catalog/systemd.pt_BR.catalog \ catalog/systemd.ru.catalog \ catalog/systemd.catalog @@ -8152,7 +8647,7 @@ dist_catalog_DATA = \ @HAVE_MICROHTTPD_TRUE@ libsystemd-journal-internal.la \ @HAVE_MICROHTTPD_TRUE@ libsystemd-internal.la \ @HAVE_MICROHTTPD_TRUE@ libsystemd-shared.la $(MICROHTTPD_LIBS) \ -@HAVE_MICROHTTPD_TRUE@ $(am__append_166) +@HAVE_MICROHTTPD_TRUE@ $(am__append_180) @HAVE_MICROHTTPD_TRUE@systemd_journal_gatewayd_CFLAGS = \ @HAVE_MICROHTTPD_TRUE@ $(AM_CFLAGS) \ @HAVE_MICROHTTPD_TRUE@ $(MICROHTTPD_CFLAGS) @@ -8182,13 +8677,13 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_COREDUMP_TRUE@ src/journal/coredump.c \ @ENABLE_COREDUMP_TRUE@ src/journal/coredump-vacuum.c \ @ENABLE_COREDUMP_TRUE@ src/journal/coredump-vacuum.h \ -@ENABLE_COREDUMP_TRUE@ $(am__append_169) +@ENABLE_COREDUMP_TRUE@ $(am__append_183) @ENABLE_COREDUMP_TRUE@systemd_coredump_LDADD = \ @ENABLE_COREDUMP_TRUE@ libsystemd-journal-internal.la \ @ENABLE_COREDUMP_TRUE@ libsystemd-label.la \ @ENABLE_COREDUMP_TRUE@ libsystemd-internal.la \ -@ENABLE_COREDUMP_TRUE@ libsystemd-shared.la $(am__append_170) \ -@ENABLE_COREDUMP_TRUE@ $(am__append_173) +@ENABLE_COREDUMP_TRUE@ libsystemd-shared.la $(am__append_184) \ +@ENABLE_COREDUMP_TRUE@ $(am__append_187) @ENABLE_COREDUMP_TRUE@coredumpctl_SOURCES = \ @ENABLE_COREDUMP_TRUE@ src/journal/coredumpctl.c @@ -8320,9 +8815,6 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_LOCALED_TRUE@ $(AM_CFLAGS) \ @ENABLE_LOCALED_TRUE@ $(XKBCOMMON_CFLAGS) -@ENABLE_LOCALED_TRUE@dist_noinst_SCRIPT = \ -@ENABLE_LOCALED_TRUE@ src/locale/generate-kbd-model-map - @ENABLE_LOCALED_TRUE@localectl_SOURCES = \ @ENABLE_LOCALED_TRUE@ src/locale/localectl.c @@ -8366,8 +8858,7 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_TIMESYNCD_TRUE@ libsystemd-network.la \ @ENABLE_TIMESYNCD_TRUE@ libsystemd-label.la \ @ENABLE_TIMESYNCD_TRUE@ libsystemd-internal.la \ -@ENABLE_TIMESYNCD_TRUE@ libsystemd-shared.la \ -@ENABLE_TIMESYNCD_TRUE@ -lm +@ENABLE_TIMESYNCD_TRUE@ libsystemd-shared.la # ------------------------------------------------------------------------------ @@ -8398,10 +8889,13 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_MACHINED_TRUE@ libsystemd-machine-core.la @ENABLE_MACHINED_TRUE@libsystemd_machine_core_la_SOURCES = \ -@ENABLE_MACHINED_TRUE@ src/machine/machined-dbus.c \ @ENABLE_MACHINED_TRUE@ src/machine/machine.c \ @ENABLE_MACHINED_TRUE@ src/machine/machine.h \ -@ENABLE_MACHINED_TRUE@ src/machine/machine-dbus.c +@ENABLE_MACHINED_TRUE@ src/machine/machined-dbus.c \ +@ENABLE_MACHINED_TRUE@ src/machine/machine-dbus.c \ +@ENABLE_MACHINED_TRUE@ src/machine/machine-dbus.h \ +@ENABLE_MACHINED_TRUE@ src/machine/image-dbus.c \ +@ENABLE_MACHINED_TRUE@ src/machine/image-dbus.h @ENABLE_MACHINED_TRUE@libsystemd_machine_core_la_LIBADD = \ @ENABLE_MACHINED_TRUE@ libsystemd-label.la \ @@ -8414,6 +8908,8 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_MACHINED_TRUE@machinectl_LDADD = \ @ENABLE_MACHINED_TRUE@ libsystemd-internal.la \ +@ENABLE_MACHINED_TRUE@ libsystemd-logs.la \ +@ENABLE_MACHINED_TRUE@ libsystemd-journal-internal.la \ @ENABLE_MACHINED_TRUE@ libsystemd-shared.la @ENABLE_MACHINED_TRUE@test_machine_tables_SOURCES = \ @@ -8439,6 +8935,74 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_MACHINED_TRUE@ libsystemd-shared.la \ @ENABLE_MACHINED_TRUE@ libsystemd-internal.la +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_importd_SOURCES = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/importd.c + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_importd_CFLAGS = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(AM_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\" + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_importd_LDADD = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_pull_SOURCES = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/pull.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-raw.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-raw.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-tar.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-tar.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-dkr.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-dkr.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-job.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-job.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-common.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-common.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/curl-util.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/curl-util.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/aufs-util.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/aufs-util.h \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/qcow2-util.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/qcow2-util.h + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_pull_CFLAGS = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(AM_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(LIBCURL_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(XZ_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(ZLIB_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(GCRYPT_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\" + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@systemd_pull_LDADD = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(LIBCURL_LIBS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(XZ_LIBS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(ZLIB_LIBS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ -lbz2 \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(GCRYPT_LIBS) + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@dist_rootlibexec_DATA = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/import-pubring.gpg + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@test_qcow2_SOURCES = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/test-qcow2.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/qcow2-util.c \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ src/import/qcow2-util.h + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@test_qcow2_CFLAGS = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(AM_CFLAGS) \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(ZLIB_CFLAGS) + +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@test_qcow2_LDADD = \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-internal.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-label.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ libsystemd-shared.la \ +@ENABLE_IMPORTD_TRUE@@HAVE_BZIP2_TRUE@@HAVE_GCRYPT_TRUE@@HAVE_LIBCURL_TRUE@@HAVE_XZ_TRUE@@HAVE_ZLIB_TRUE@ $(ZLIB_LIBS) + # ------------------------------------------------------------------------------ @ENABLE_RESOLVED_TRUE@systemd_resolved_SOURCES = \ @@ -8489,7 +9053,6 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_RESOLVED_TRUE@ libsystemd-label.la \ @ENABLE_RESOLVED_TRUE@ libsystemd-internal.la \ @ENABLE_RESOLVED_TRUE@ libsystemd-shared.la \ -@ENABLE_RESOLVED_TRUE@ -lm \ @ENABLE_RESOLVED_TRUE@ $(LIBIDN_LIBS) @ENABLE_RESOLVED_TRUE@test_dns_domain_SOURCES = \ @@ -8518,8 +9081,8 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_RESOLVED_TRUE@ -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym @ENABLE_RESOLVED_TRUE@libnss_resolve_la_LIBADD = \ -@ENABLE_RESOLVED_TRUE@ libsystemd-shared.la \ -@ENABLE_RESOLVED_TRUE@ libsystemd-internal.la +@ENABLE_RESOLVED_TRUE@ libsystemd-internal.la \ +@ENABLE_RESOLVED_TRUE@ libsystemd-shared.la @ENABLE_RESOLVED_TRUE@systemd_resolve_host_SOURCES = \ @ENABLE_RESOLVED_TRUE@ src/resolve-host/resolve-host.c \ @@ -8541,15 +9104,14 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_RESOLVED_TRUE@systemd_resolve_host_LDADD = \ @ENABLE_RESOLVED_TRUE@ libsystemd-internal.la \ @ENABLE_RESOLVED_TRUE@ libsystemd-shared.la \ -@ENABLE_RESOLVED_TRUE@ -lm \ @ENABLE_RESOLVED_TRUE@ $(LIBIDN_LIBS) @ENABLE_NETWORKD_TRUE@systemd_networkd_SOURCES = \ @ENABLE_NETWORKD_TRUE@ src/network/networkd.c -@ENABLE_NETWORKD_TRUE@systemd_networkd_LDADD = \ -@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la - +@ENABLE_NETWORKD_TRUE@systemd_networkd_LDADD = \ +@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ +@ENABLE_NETWORKD_TRUE@ $(am__append_304) @ENABLE_NETWORKD_TRUE@libsystemd_networkd_core_la_CFLAGS = \ @ENABLE_NETWORKD_TRUE@ $(AM_CFLAGS) @@ -8563,6 +9125,7 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-vxlan.h \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-vlan.h \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-macvlan.h \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-ipvlan.h \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-dummy.h \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-tuntap.h \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-bond.h \ @@ -8573,18 +9136,23 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-vxlan.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-vlan.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-macvlan.c \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-ipvlan.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-dummy.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-tuntap.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-bond.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-netdev-bridge.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-link.c \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-link-bus.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-ipv4ll.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-dhcp4.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-dhcp6.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-network.c \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-network-bus.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-address.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-route.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-manager.c \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-manager-bus.c \ +@ENABLE_NETWORKD_TRUE@ src/network/networkd-fdb.c \ @ENABLE_NETWORKD_TRUE@ src/network/networkd-address-pool.c @ENABLE_NETWORKD_TRUE@nodist_libsystemd_networkd_core_la_SOURCES = \ @@ -8627,17 +9195,16 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_NETWORKD_TRUE@test_network_SOURCES = \ @ENABLE_NETWORKD_TRUE@ src/network/test-network.c -@ENABLE_NETWORKD_TRUE@test_network_LDADD = \ -@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la - +@ENABLE_NETWORKD_TRUE@test_network_LDADD = \ +@ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ +@ENABLE_NETWORKD_TRUE@ $(am__append_307) @ENABLE_NETWORKD_TRUE@test_network_tables_SOURCES = \ @ENABLE_NETWORKD_TRUE@ src/network/test-network-tables.c \ @ENABLE_NETWORKD_TRUE@ src/shared/test-tables.h -@ENABLE_NETWORKD_TRUE@test_network_tables_LDADD = \ +@ENABLE_NETWORKD_TRUE@test_network_tables_LDADD = \ @ENABLE_NETWORKD_TRUE@ libsystemd-networkd-core.la \ -@ENABLE_NETWORKD_TRUE@ libudev-core.la - +@ENABLE_NETWORKD_TRUE@ libudev-core.la $(am__append_308) # ------------------------------------------------------------------------------ @ENABLE_LOGIND_TRUE@systemd_logind_SOURCES = \ @@ -8672,11 +9239,11 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_LOGIND_TRUE@ src/login/logind-session-dbus.c \ @ENABLE_LOGIND_TRUE@ src/login/logind-seat-dbus.c \ @ENABLE_LOGIND_TRUE@ src/login/logind-user-dbus.c \ -@ENABLE_LOGIND_TRUE@ src/login/logind-acl.h $(am__append_284) +@ENABLE_LOGIND_TRUE@ src/login/logind-acl.h $(am__append_320) @ENABLE_LOGIND_TRUE@libsystemd_logind_core_la_LIBADD = \ @ENABLE_LOGIND_TRUE@ libsystemd-label.la libsystemd-internal.la \ @ENABLE_LOGIND_TRUE@ libudev-internal.la libsystemd-shared.la \ -@ENABLE_LOGIND_TRUE@ $(am__append_285) +@ENABLE_LOGIND_TRUE@ $(am__append_321) @ENABLE_LOGIND_TRUE@systemd_user_sessions_SOURCES = \ @ENABLE_LOGIND_TRUE@ src/login/user-sessions.c @@ -8685,10 +9252,13 @@ systemd_socket_proxyd_LDADD = \ @ENABLE_LOGIND_TRUE@loginctl_SOURCES = \ @ENABLE_LOGIND_TRUE@ src/login/loginctl.c \ +@ENABLE_LOGIND_TRUE@ src/login/sysfs-show.h \ @ENABLE_LOGIND_TRUE@ src/login/sysfs-show.c @ENABLE_LOGIND_TRUE@loginctl_LDADD = \ @ENABLE_LOGIND_TRUE@ libsystemd-internal.la \ +@ENABLE_LOGIND_TRUE@ libsystemd-logs.la \ +@ENABLE_LOGIND_TRUE@ libsystemd-journal-internal.la \ @ENABLE_LOGIND_TRUE@ libudev-internal.la \ @ENABLE_LOGIND_TRUE@ libsystemd-shared.la @@ -8983,6 +9553,7 @@ substitutions = \ '|rootprefix=$(rootprefix)|' \ '|udevlibexecdir=$(udevlibexecdir)|' \ '|SUSHELL=$(SUSHELL)|' \ + '|SULOGIN=$(SULOGIN)|' \ '|DEBUGTTY=$(DEBUGTTY)|' \ '|KILL=$(KILL)|' \ '|KMOD=$(KMOD)|' \ @@ -9047,8 +9618,8 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-pamlibdir=$$dc_install_base/$(pamlibdir) \ --with-pamconfdir=$$dc_install_base/$(pamconfdir) \ --with-rootprefix=$$dc_install_base --disable-split-usr \ - --enable-kdbus --enable-compat-libs $(am__append_325) \ - $(am__append_326) $(am__append_327) $(am__append_328) + --enable-kdbus --enable-compat-libs $(am__append_361) \ + $(am__append_362) $(am__append_363) $(am__append_364) www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd OBJECT_VARIABLES := $(filter %_OBJECTS,$(.VARIABLES)) ALL_OBJECTS := $(foreach v,$(OBJECT_VARIABLES),$($(v))) @@ -9072,7 +9643,7 @@ all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +.SUFFIXES: .c .lo .log .o .obj .py .py$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile-man.am $(am__configure_deps) @@ -9366,10 +9937,10 @@ src/core/libsystemd_core_la-socket.lo: src/core/$(am__dirstamp) \ src/core/$(DEPDIR)/$(am__dirstamp) src/core/libsystemd_core_la-busname.lo: src/core/$(am__dirstamp) \ src/core/$(DEPDIR)/$(am__dirstamp) -src/core/libsystemd_core_la-bus-common.lo: src/core/$(am__dirstamp) \ - src/core/$(DEPDIR)/$(am__dirstamp) src/core/libsystemd_core_la-bus-endpoint.lo: src/core/$(am__dirstamp) \ src/core/$(DEPDIR)/$(am__dirstamp) +src/core/libsystemd_core_la-bus-policy.lo: src/core/$(am__dirstamp) \ + src/core/$(DEPDIR)/$(am__dirstamp) src/core/libsystemd_core_la-target.lo: src/core/$(am__dirstamp) \ src/core/$(DEPDIR)/$(am__dirstamp) src/core/libsystemd_core_la-snapshot.lo: src/core/$(am__dirstamp) \ @@ -9490,6 +10061,11 @@ src/libsystemd/sd-bus/bus-dump.lo: \ libsystemd-dump.la: $(libsystemd_dump_la_OBJECTS) $(libsystemd_dump_la_DEPENDENCIES) $(EXTRA_libsystemd_dump_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libsystemd_dump_la_OBJECTS) $(libsystemd_dump_la_LIBADD) $(LIBS) +src/shared/libsystemd_fw_la-fw-util.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +libsystemd-fw.la: $(libsystemd_fw_la_OBJECTS) $(libsystemd_fw_la_DEPENDENCIES) $(EXTRA_libsystemd_fw_la_DEPENDENCIES) + $(AM_V_CCLD)$(libsystemd_fw_la_LINK) $(am_libsystemd_fw_la_rpath) $(libsystemd_fw_la_OBJECTS) $(libsystemd_fw_la_LIBADD) $(LIBS) libsystemd-id128.la: $(libsystemd_id128_la_OBJECTS) $(libsystemd_id128_la_DEPENDENCIES) $(EXTRA_libsystemd_id128_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_id128_la_LINK) $(am_libsystemd_id128_la_rpath) $(libsystemd_id128_la_OBJECTS) $(libsystemd_id128_la_LIBADD) $(LIBS) @@ -9643,6 +10219,15 @@ src/libsystemd/sd-network/libsystemd_internal_la-sd-network.lo: \ src/libsystemd/sd-network/libsystemd_internal_la-network-util.lo: \ src/libsystemd/sd-network/$(am__dirstamp) \ src/libsystemd/sd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd/sd-hwdb/$(am__dirstamp): + @$(MKDIR_P) src/libsystemd/sd-hwdb + @: > src/libsystemd/sd-hwdb/$(am__dirstamp) +src/libsystemd/sd-hwdb/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libsystemd/sd-hwdb/$(DEPDIR) + @: > src/libsystemd/sd-hwdb/$(DEPDIR)/$(am__dirstamp) +src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo: \ + src/libsystemd/sd-hwdb/$(am__dirstamp) \ + src/libsystemd/sd-hwdb/$(DEPDIR)/$(am__dirstamp) libsystemd-internal.la: $(libsystemd_internal_la_OBJECTS) $(libsystemd_internal_la_DEPENDENCIES) $(EXTRA_libsystemd_internal_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_internal_la_LINK) $(libsystemd_internal_la_OBJECTS) $(libsystemd_internal_la_LIBADD) $(LIBS) @@ -9745,6 +10330,14 @@ src/shared/libsystemd_label_la-condition.lo: \ src/shared/libsystemd_label_la-generator.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_label_la-btrfs-util.lo: \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_label_la-machine-image.lo: \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_label_la-copy.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) libsystemd-label.la: $(libsystemd_label_la_OBJECTS) $(libsystemd_label_la_DEPENDENCIES) $(EXTRA_libsystemd_label_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_label_la_LINK) $(libsystemd_label_la_OBJECTS) $(libsystemd_label_la_LIBADD) $(LIBS) @@ -9799,12 +10392,14 @@ src/machine/$(am__dirstamp): src/machine/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/machine/$(DEPDIR) @: > src/machine/$(DEPDIR)/$(am__dirstamp) -src/machine/machined-dbus.lo: src/machine/$(am__dirstamp) \ - src/machine/$(DEPDIR)/$(am__dirstamp) src/machine/machine.lo: src/machine/$(am__dirstamp) \ src/machine/$(DEPDIR)/$(am__dirstamp) +src/machine/machined-dbus.lo: src/machine/$(am__dirstamp) \ + src/machine/$(DEPDIR)/$(am__dirstamp) src/machine/machine-dbus.lo: src/machine/$(am__dirstamp) \ src/machine/$(DEPDIR)/$(am__dirstamp) +src/machine/image-dbus.lo: src/machine/$(am__dirstamp) \ + src/machine/$(DEPDIR)/$(am__dirstamp) libsystemd-machine-core.la: $(libsystemd_machine_core_la_OBJECTS) $(libsystemd_machine_core_la_DEPENDENCIES) $(EXTRA_libsystemd_machine_core_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libsystemd_machine_core_la_rpath) $(libsystemd_machine_core_la_OBJECTS) $(libsystemd_machine_core_la_LIBADD) $(LIBS) @@ -9862,6 +10457,24 @@ src/libsystemd-network/libsystemd_network_la-dhcp6-option.lo: \ src/libsystemd-network/libsystemd_network_la-sd-dhcp6-lease.lo: \ src/libsystemd-network/$(am__dirstamp) \ src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-lldp-network.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-lldp-port.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-lldp-internal.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/libsystemd_network_la-sd-lldp.lo: \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) libsystemd-network.la: $(libsystemd_network_la_OBJECTS) $(libsystemd_network_la_DEPENDENCIES) $(EXTRA_libsystemd_network_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_network_la_LINK) $(libsystemd_network_la_OBJECTS) $(libsystemd_network_la_LIBADD) $(LIBS) @@ -9889,6 +10502,9 @@ src/network/libsystemd_networkd_core_la-networkd-netdev-vlan.lo: \ src/network/libsystemd_networkd_core_la-networkd-netdev-macvlan.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) +src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo: \ + src/network/$(am__dirstamp) \ + src/network/$(DEPDIR)/$(am__dirstamp) src/network/libsystemd_networkd_core_la-networkd-netdev-dummy.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) @@ -9904,6 +10520,9 @@ src/network/libsystemd_networkd_core_la-networkd-netdev-bridge.lo: \ src/network/libsystemd_networkd_core_la-networkd-link.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) +src/network/libsystemd_networkd_core_la-networkd-link-bus.lo: \ + src/network/$(am__dirstamp) \ + src/network/$(DEPDIR)/$(am__dirstamp) src/network/libsystemd_networkd_core_la-networkd-ipv4ll.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) @@ -9916,6 +10535,9 @@ src/network/libsystemd_networkd_core_la-networkd-dhcp6.lo: \ src/network/libsystemd_networkd_core_la-networkd-network.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) +src/network/libsystemd_networkd_core_la-networkd-network-bus.lo: \ + src/network/$(am__dirstamp) \ + src/network/$(DEPDIR)/$(am__dirstamp) src/network/libsystemd_networkd_core_la-networkd-address.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) @@ -9925,6 +10547,12 @@ src/network/libsystemd_networkd_core_la-networkd-route.lo: \ src/network/libsystemd_networkd_core_la-networkd-manager.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) +src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo: \ + src/network/$(am__dirstamp) \ + src/network/$(DEPDIR)/$(am__dirstamp) +src/network/libsystemd_networkd_core_la-networkd-fdb.lo: \ + src/network/$(am__dirstamp) \ + src/network/$(DEPDIR)/$(am__dirstamp) src/network/libsystemd_networkd_core_la-networkd-address-pool.lo: \ src/network/$(am__dirstamp) \ src/network/$(DEPDIR)/$(am__dirstamp) @@ -9937,6 +10565,27 @@ src/network/libsystemd_networkd_core_la-networkd-netdev-gperf.lo: \ libsystemd-networkd-core.la: $(libsystemd_networkd_core_la_OBJECTS) $(libsystemd_networkd_core_la_DEPENDENCIES) $(EXTRA_libsystemd_networkd_core_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_networkd_core_la_LINK) $(am_libsystemd_networkd_core_la_rpath) $(libsystemd_networkd_core_la_OBJECTS) $(libsystemd_networkd_core_la_LIBADD) $(LIBS) +src/bus-proxyd/$(am__dirstamp): + @$(MKDIR_P) src/bus-proxyd + @: > src/bus-proxyd/$(am__dirstamp) +src/bus-proxyd/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/bus-proxyd/$(DEPDIR) + @: > src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) +src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo: \ + src/bus-proxyd/$(am__dirstamp) \ + src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) +src/bus-proxyd/libsystemd_proxy_la-driver.lo: \ + src/bus-proxyd/$(am__dirstamp) \ + src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) +src/bus-proxyd/libsystemd_proxy_la-proxy.lo: \ + src/bus-proxyd/$(am__dirstamp) \ + src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) +src/bus-proxyd/libsystemd_proxy_la-synthesize.lo: \ + src/bus-proxyd/$(am__dirstamp) \ + src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) + +libsystemd-proxy.la: $(libsystemd_proxy_la_OBJECTS) $(libsystemd_proxy_la_DEPENDENCIES) $(EXTRA_libsystemd_proxy_la_DEPENDENCIES) + $(AM_V_CCLD)$(libsystemd_proxy_la_LINK) $(libsystemd_proxy_la_OBJECTS) $(libsystemd_proxy_la_LIBADD) $(LIBS) src/libsystemd/sd-resolve/$(am__dirstamp): @$(MKDIR_P) src/libsystemd/sd-resolve @: > src/libsystemd/sd-resolve/$(am__dirstamp) @@ -9971,6 +10620,9 @@ src/shared/libsystemd_shared_la-architecture.lo: \ src/shared/libsystemd_shared_la-efivars.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_shared_la-fstab-util.lo: \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-path-util.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) @@ -10103,6 +10755,8 @@ src/shared/libsystemd_shared_la-audit.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-xml.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_shared_la-json.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-bus-label.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) @@ -10121,8 +10775,6 @@ src/shared/libsystemd_shared_la-pty.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-async.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) -src/shared/libsystemd_shared_la-copy.lo: src/shared/$(am__dirstamp) \ - src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-base-filesystem.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) @@ -10132,6 +10784,13 @@ src/shared/libsystemd_shared_la-memfd-util.lo: \ src/shared/libsystemd_shared_la-uid-range.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_shared_la-verbs.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_shared_la-sigbus.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libsystemd_shared_la-import-util.lo: \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libsystemd_shared_la-utmp-wtmp.lo: \ src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) @@ -10296,6 +10955,9 @@ src/libsystemd/sd-network/libsystemd_la-sd-network.lo: \ src/libsystemd/sd-network/libsystemd_la-network-util.lo: \ src/libsystemd/sd-network/$(am__dirstamp) \ src/libsystemd/sd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo: \ + src/libsystemd/sd-hwdb/$(am__dirstamp) \ + src/libsystemd/sd-hwdb/$(DEPDIR)/$(am__dirstamp) src/libsystemd/sd-resolve/libsystemd_la-sd-resolve.lo: \ src/libsystemd/sd-resolve/$(am__dirstamp) \ src/libsystemd/sd-resolve/$(DEPDIR)/$(am__dirstamp) @@ -11002,20 +11664,13 @@ src/bootchart/svg.$(OBJEXT): src/bootchart/$(am__dirstamp) \ systemd-bootchart$(EXEEXT): $(systemd_bootchart_OBJECTS) $(systemd_bootchart_DEPENDENCIES) $(EXTRA_systemd_bootchart_DEPENDENCIES) @rm -f systemd-bootchart$(EXEEXT) $(AM_V_CCLD)$(LINK) $(systemd_bootchart_OBJECTS) $(systemd_bootchart_LDADD) $(LIBS) -src/bus-proxyd/$(am__dirstamp): - @$(MKDIR_P) src/bus-proxyd - @: > src/bus-proxyd/$(am__dirstamp) -src/bus-proxyd/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) src/bus-proxyd/$(DEPDIR) - @: > src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) -src/bus-proxyd/bus-proxyd.$(OBJEXT): src/bus-proxyd/$(am__dirstamp) \ - src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) -src/bus-proxyd/bus-policy.$(OBJEXT): src/bus-proxyd/$(am__dirstamp) \ +src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.$(OBJEXT): \ + src/bus-proxyd/$(am__dirstamp) \ src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) systemd-bus-proxyd$(EXEEXT): $(systemd_bus_proxyd_OBJECTS) $(systemd_bus_proxyd_DEPENDENCIES) $(EXTRA_systemd_bus_proxyd_DEPENDENCIES) @rm -f systemd-bus-proxyd$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(systemd_bus_proxyd_OBJECTS) $(systemd_bus_proxyd_LDADD) $(LIBS) + $(AM_V_CCLD)$(systemd_bus_proxyd_LINK) $(systemd_bus_proxyd_OBJECTS) $(systemd_bus_proxyd_LDADD) $(LIBS) src/journal/cat.$(OBJEXT): src/journal/$(am__dirstamp) \ src/journal/$(DEPDIR)/$(am__dirstamp) @@ -11291,6 +11946,31 @@ src/hostname/hostnamed.$(OBJEXT): src/hostname/$(am__dirstamp) \ systemd-hostnamed$(EXEEXT): $(systemd_hostnamed_OBJECTS) $(systemd_hostnamed_DEPENDENCIES) $(EXTRA_systemd_hostnamed_DEPENDENCIES) @rm -f systemd-hostnamed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(systemd_hostnamed_OBJECTS) $(systemd_hostnamed_LDADD) $(LIBS) +src/hwdb/$(am__dirstamp): + @$(MKDIR_P) src/hwdb + @: > src/hwdb/$(am__dirstamp) +src/hwdb/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/hwdb/$(DEPDIR) + @: > src/hwdb/$(DEPDIR)/$(am__dirstamp) +src/hwdb/hwdb.$(OBJEXT): src/hwdb/$(am__dirstamp) \ + src/hwdb/$(DEPDIR)/$(am__dirstamp) + +systemd-hwdb$(EXEEXT): $(systemd_hwdb_OBJECTS) $(systemd_hwdb_DEPENDENCIES) $(EXTRA_systemd_hwdb_DEPENDENCIES) + @rm -f systemd-hwdb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(systemd_hwdb_OBJECTS) $(systemd_hwdb_LDADD) $(LIBS) +src/import/$(am__dirstamp): + @$(MKDIR_P) src/import + @: > src/import/$(am__dirstamp) +src/import/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/import/$(DEPDIR) + @: > src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_importd-importd.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) + +systemd-importd$(EXEEXT): $(systemd_importd_OBJECTS) $(systemd_importd_DEPENDENCIES) $(EXTRA_systemd_importd_DEPENDENCIES) + @rm -f systemd-importd$(EXEEXT) + $(AM_V_CCLD)$(systemd_importd_LINK) $(systemd_importd_OBJECTS) $(systemd_importd_LDADD) $(LIBS) src/login/inhibit.$(OBJEXT): src/login/$(am__dirstamp) \ src/login/$(DEPDIR)/$(am__dirstamp) @@ -11486,6 +12166,36 @@ src/path/path.$(OBJEXT): src/path/$(am__dirstamp) \ systemd-path$(EXEEXT): $(systemd_path_OBJECTS) $(systemd_path_DEPENDENCIES) $(EXTRA_systemd_path_DEPENDENCIES) @rm -f systemd-path$(EXEEXT) $(AM_V_CCLD)$(LINK) $(systemd_path_OBJECTS) $(systemd_path_LDADD) $(LIBS) +src/import/systemd_pull-pull.$(OBJEXT): src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-import-raw.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-import-tar.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-import-dkr.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-import-job.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-import-common.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-curl-util.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-aufs-util.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/systemd_pull-qcow2-util.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) + +systemd-pull$(EXEEXT): $(systemd_pull_OBJECTS) $(systemd_pull_DEPENDENCIES) $(EXTRA_systemd_pull_DEPENDENCIES) + @rm -f systemd-pull$(EXEEXT) + $(AM_V_CCLD)$(systemd_pull_LINK) $(systemd_pull_OBJECTS) $(systemd_pull_LDADD) $(LIBS) src/quotacheck/$(am__dirstamp): @$(MKDIR_P) src/quotacheck @: > src/quotacheck/$(am__dirstamp) @@ -11688,6 +12398,12 @@ src/socket-proxy/socket-proxyd.$(OBJEXT): \ systemd-socket-proxyd$(EXEEXT): $(systemd_socket_proxyd_OBJECTS) $(systemd_socket_proxyd_DEPENDENCIES) $(EXTRA_systemd_socket_proxyd_DEPENDENCIES) @rm -f systemd-socket-proxyd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(systemd_socket_proxyd_OBJECTS) $(systemd_socket_proxyd_LDADD) $(LIBS) +src/bus-proxyd/stdio-bridge.$(OBJEXT): src/bus-proxyd/$(am__dirstamp) \ + src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) + +systemd-stdio-bridge$(EXEEXT): $(systemd_stdio_bridge_OBJECTS) $(systemd_stdio_bridge_DEPENDENCIES) $(EXTRA_systemd_stdio_bridge_DEPENDENCIES) + @rm -f systemd-stdio-bridge$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(systemd_stdio_bridge_OBJECTS) $(systemd_stdio_bridge_LDADD) $(LIBS) src/libsystemd-terminal/subterm.$(OBJEXT): \ src/libsystemd-terminal/$(am__dirstamp) \ src/libsystemd-terminal/$(DEPDIR)/$(am__dirstamp) @@ -11883,6 +12599,12 @@ src/test/test-boot-timestamps.$(OBJEXT): src/test/$(am__dirstamp) \ test-boot-timestamp$(EXEEXT): $(test_boot_timestamp_OBJECTS) $(test_boot_timestamp_DEPENDENCIES) $(EXTRA_test_boot_timestamp_DEPENDENCIES) @rm -f test-boot-timestamp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_boot_timestamp_OBJECTS) $(test_boot_timestamp_LDADD) $(LIBS) +src/test/test-btrfs.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-btrfs$(EXEEXT): $(test_btrfs_OBJECTS) $(test_btrfs_DEPENDENCIES) $(EXTRA_test_btrfs_DEPENDENCIES) + @rm -f test-btrfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_btrfs_OBJECTS) $(test_btrfs_LDADD) $(LIBS) src/libsystemd/sd-bus/test_bus_chat-test-bus-chat.$(OBJEXT): \ src/libsystemd/sd-bus/$(am__dirstamp) \ src/libsystemd/sd-bus/$(DEPDIR)/$(am__dirstamp) @@ -11967,7 +12689,7 @@ src/libsystemd/sd-bus/test_bus_objects-test-bus-objects.$(OBJEXT): \ test-bus-objects$(EXEEXT): $(test_bus_objects_OBJECTS) $(test_bus_objects_DEPENDENCIES) $(EXTRA_test_bus_objects_DEPENDENCIES) @rm -f test-bus-objects$(EXEEXT) $(AM_V_CCLD)$(test_bus_objects_LINK) $(test_bus_objects_OBJECTS) $(test_bus_objects_LDADD) $(LIBS) -src/bus-proxyd/test-bus-policy.$(OBJEXT): \ +src/bus-proxyd/test-bus-xml-policy.$(OBJEXT): \ src/bus-proxyd/$(am__dirstamp) \ src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) @@ -12118,6 +12840,9 @@ test-dhcp-server$(EXEEXT): $(test_dhcp_server_OBJECTS) $(test_dhcp_server_DEPEND src/libsystemd-network/test-dhcp6-client.$(OBJEXT): \ src/libsystemd-network/$(am__dirstamp) \ src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/dhcp-identifier.$(OBJEXT): \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) test-dhcp6-client$(EXEEXT): $(test_dhcp6_client_OBJECTS) $(test_dhcp6_client_DEPENDENCIES) $(EXTRA_test_dhcp6_client_DEPENDENCIES) @rm -f test-dhcp6-client$(EXEEXT) @@ -12171,6 +12896,18 @@ src/test/test-fileio.$(OBJEXT): src/test/$(am__dirstamp) \ test-fileio$(EXEEXT): $(test_fileio_OBJECTS) $(test_fileio_DEPENDENCIES) $(EXTRA_test_fileio_DEPENDENCIES) @rm -f test-fileio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_fileio_OBJECTS) $(test_fileio_LDADD) $(LIBS) +src/test/test-fstab-util.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-fstab-util$(EXEEXT): $(test_fstab_util_OBJECTS) $(test_fstab_util_DEPENDENCIES) $(EXTRA_test_fstab_util_DEPENDENCIES) + @rm -f test-fstab-util$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_fstab_util_OBJECTS) $(test_fstab_util_LDADD) $(LIBS) +src/test/test_fw_util-test-fw-util.$(OBJEXT): \ + src/test/$(am__dirstamp) src/test/$(DEPDIR)/$(am__dirstamp) + +test-fw-util$(EXEEXT): $(test_fw_util_OBJECTS) $(test_fw_util_DEPENDENCIES) $(EXTRA_test_fw_util_DEPENDENCIES) + @rm -f test-fw-util$(EXEEXT) + $(AM_V_CCLD)$(test_fw_util_LINK) $(test_fw_util_OBJECTS) $(test_fw_util_LDADD) $(LIBS) src/test/test-hashmap.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) src/test/test-hashmap-plain.$(OBJEXT): src/test/$(am__dirstamp) \ @@ -12295,6 +13032,12 @@ src/journal/test-journal-verify.$(OBJEXT): \ test-journal-verify$(EXEEXT): $(test_journal_verify_OBJECTS) $(test_journal_verify_DEPENDENCIES) $(EXTRA_test_journal_verify_DEPENDENCIES) @rm -f test-journal-verify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_journal_verify_OBJECTS) $(test_journal_verify_LDADD) $(LIBS) +src/test/test-json.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-json$(EXEEXT): $(test_json_OBJECTS) $(test_json_DEPENDENCIES) $(EXTRA_test_json_DEPENDENCIES) + @rm -f test-json$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_json_OBJECTS) $(test_json_LDADD) $(LIBS) test-libsystemd-sym$(EXEEXT): $(test_libsystemd_sym_OBJECTS) $(test_libsystemd_sym_DEPENDENCIES) $(EXTRA_test_libsystemd_sym_DEPENDENCIES) @rm -f test-libsystemd-sym$(EXEEXT) @@ -12315,6 +13058,16 @@ src/test/test-list.$(OBJEXT): src/test/$(am__dirstamp) \ test-list$(EXEEXT): $(test_list_OBJECTS) $(test_list_DEPENDENCIES) $(EXTRA_test_list_DEPENDENCIES) @rm -f test-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_list_OBJECTS) $(test_list_LDADD) $(LIBS) +src/libsystemd-network/lldp-tlv.$(OBJEXT): \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) +src/libsystemd-network/test-lldp.$(OBJEXT): \ + src/libsystemd-network/$(am__dirstamp) \ + src/libsystemd-network/$(DEPDIR)/$(am__dirstamp) + +test-lldp$(EXEEXT): $(test_lldp_OBJECTS) $(test_lldp_DEPENDENCIES) $(EXTRA_test_lldp_DEPENDENCIES) + @rm -f test-lldp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_lldp_OBJECTS) $(test_lldp_LDADD) $(LIBS) src/libsystemd/sd-rtnl/test-local-addresses.$(OBJEXT): \ src/libsystemd/sd-rtnl/$(am__dirstamp) \ src/libsystemd/sd-rtnl/$(DEPDIR)/$(am__dirstamp) @@ -12403,6 +13156,12 @@ src/test/test_path-test-path.$(OBJEXT): src/test/$(am__dirstamp) \ test-path$(EXEEXT): $(test_path_OBJECTS) $(test_path_DEPENDENCIES) $(EXTRA_test_path_DEPENDENCIES) @rm -f test-path$(EXEEXT) $(AM_V_CCLD)$(test_path_LINK) $(test_path_OBJECTS) $(test_path_LDADD) $(LIBS) +src/test/test-path-lookup.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-path-lookup$(EXEEXT): $(test_path_lookup_OBJECTS) $(test_path_lookup_DEPENDENCIES) $(EXTRA_test_path_lookup_DEPENDENCIES) + @rm -f test-path-lookup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_path_lookup_OBJECTS) $(test_path_lookup_LDADD) $(LIBS) src/test/test-path-util.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) @@ -12428,6 +13187,16 @@ src/test/test-pty.$(OBJEXT): src/test/$(am__dirstamp) \ test-pty$(EXEEXT): $(test_pty_OBJECTS) $(test_pty_DEPENDENCIES) $(EXTRA_test_pty_DEPENDENCIES) @rm -f test-pty$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_pty_OBJECTS) $(test_pty_LDADD) $(LIBS) +src/import/test_qcow2-test-qcow2.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) +src/import/test_qcow2-qcow2-util.$(OBJEXT): \ + src/import/$(am__dirstamp) \ + src/import/$(DEPDIR)/$(am__dirstamp) + +test-qcow2$(EXEEXT): $(test_qcow2_OBJECTS) $(test_qcow2_DEPENDENCIES) $(EXTRA_test_qcow2_DEPENDENCIES) + @rm -f test-qcow2$(EXEEXT) + $(AM_V_CCLD)$(test_qcow2_LINK) $(test_qcow2_OBJECTS) $(test_qcow2_LDADD) $(LIBS) src/test/test-ratelimit.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) @@ -12478,6 +13247,12 @@ src/test/test-set.$(OBJEXT): src/test/$(am__dirstamp) \ test-set$(EXEEXT): $(test_set_OBJECTS) $(test_set_DEPENDENCIES) $(EXTRA_test_set_DEPENDENCIES) @rm -f test-set$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_set_OBJECTS) $(test_set_LDADD) $(LIBS) +src/test/test-sigbus.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-sigbus$(EXEEXT): $(test_sigbus_OBJECTS) $(test_sigbus_DEPENDENCIES) $(EXTRA_test_sigbus_DEPENDENCIES) + @rm -f test-sigbus$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sigbus_OBJECTS) $(test_sigbus_LDADD) $(LIBS) src/test/test-sleep.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) @@ -12516,7 +13291,7 @@ test-strxcpyx$(EXEEXT): $(test_strxcpyx_OBJECTS) $(test_strxcpyx_DEPENDENCIES) $ $(AM_V_CCLD)$(LINK) $(test_strxcpyx_OBJECTS) $(test_strxcpyx_LDADD) $(LIBS) src/test/test_tables-test-tables.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) -src/bus-proxyd/test_tables-bus-policy.$(OBJEXT): \ +src/bus-proxyd/test_tables-bus-xml-policy.$(OBJEXT): \ src/bus-proxyd/$(am__dirstamp) \ src/bus-proxyd/$(DEPDIR)/$(am__dirstamp) src/journal/test_tables-journald-server.$(OBJEXT): \ @@ -12601,6 +13376,12 @@ src/test/test-util.$(OBJEXT): src/test/$(am__dirstamp) \ test-util$(EXEEXT): $(test_util_OBJECTS) $(test_util_DEPENDENCIES) $(EXTRA_test_util_DEPENDENCIES) @rm -f test-util$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_util_OBJECTS) $(test_util_LDADD) $(LIBS) +src/test/test-verbs.$(OBJEXT): src/test/$(am__dirstamp) \ + src/test/$(DEPDIR)/$(am__dirstamp) + +test-verbs$(EXEEXT): $(test_verbs_OBJECTS) $(test_verbs_DEPENDENCIES) $(EXTRA_test_verbs_DEPENDENCIES) + @rm -f test-verbs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_verbs_OBJECTS) $(test_verbs_LDADD) $(LIBS) src/test/test-watchdog.$(OBJEXT): src/test/$(am__dirstamp) \ src/test/$(DEPDIR)/$(am__dirstamp) @@ -12725,6 +13506,41 @@ uninstall-dist_kernelinstallSCRIPTS: files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(kernelinstalldir)'; $(am__uninstall_files_from_dir) +install-dist_xinitrcSCRIPTS: $(dist_xinitrc_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(dist_xinitrc_SCRIPTS)'; test -n "$(xinitrcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(xinitrcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(xinitrcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(xinitrcdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(xinitrcdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-dist_xinitrcSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(dist_xinitrc_SCRIPTS)'; test -n "$(xinitrcdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(xinitrcdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -12737,6 +13553,7 @@ mostlyclean-compile: -rm -f src/boot/*.$(OBJEXT) -rm -f src/bootchart/*.$(OBJEXT) -rm -f src/bus-proxyd/*.$(OBJEXT) + -rm -f src/bus-proxyd/*.lo -rm -f src/cgls/*.$(OBJEXT) -rm -f src/cgroups-agent/*.$(OBJEXT) -rm -f src/cgtop/*.$(OBJEXT) @@ -12759,6 +13576,8 @@ mostlyclean-compile: -rm -f src/gudev/*.lo -rm -f src/hibernate-resume/*.$(OBJEXT) -rm -f src/hostname/*.$(OBJEXT) + -rm -f src/hwdb/*.$(OBJEXT) + -rm -f src/import/*.$(OBJEXT) -rm -f src/initctl/*.$(OBJEXT) -rm -f src/journal-remote/*.$(OBJEXT) -rm -f src/journal/*.$(OBJEXT) @@ -12773,6 +13592,8 @@ mostlyclean-compile: -rm -f src/libsystemd/sd-daemon/*.lo -rm -f src/libsystemd/sd-event/*.$(OBJEXT) -rm -f src/libsystemd/sd-event/*.lo + -rm -f src/libsystemd/sd-hwdb/*.$(OBJEXT) + -rm -f src/libsystemd/sd-hwdb/*.lo -rm -f src/libsystemd/sd-id128/*.$(OBJEXT) -rm -f src/libsystemd/sd-id128/*.lo -rm -f src/libsystemd/sd-login/*.$(OBJEXT) @@ -12871,10 +13692,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/bootchart/$(DEPDIR)/bootchart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/bootchart/$(DEPDIR)/store.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/bootchart/$(DEPDIR)/svg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/bus-policy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/bus-proxyd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/test-bus-policy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-bus-xml-policy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-proxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-synthesize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/stdio-bridge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/test-bus-xml-policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/cgls/$(DEPDIR)/cgls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/cgroups-agent/$(DEPDIR)/cgroups-agent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/cgtop/$(DEPDIR)/cgtop.Po@am__quote@ @@ -12887,8 +13712,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/killall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-audit-fd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-automount.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-bus-common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-bus-endpoint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-bus-policy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-busname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-cgroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/core/$(DEPDIR)/libsystemd_core_la-dbus-automount.Plo@am__quote@ @@ -12976,6 +13801,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/hibernate-resume/$(DEPDIR)/hibernate-resume.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/hostname/$(DEPDIR)/hostnamectl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/hostname/$(DEPDIR)/hostnamed.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/hwdb/$(DEPDIR)/hwdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_importd-importd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-aufs-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-curl-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-import-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-import-dkr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-import-job.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-import-raw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-import-tar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-pull.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/systemd_pull-qcow2-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/test_qcow2-qcow2-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/import/$(DEPDIR)/test_qcow2-test-qcow2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/initctl/$(DEPDIR)/initctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/journal-remote/$(DEPDIR)/systemd_journal_gatewayd-journal-gatewayd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/journal-remote/$(DEPDIR)/systemd_journal_gatewayd-microhttpd-util.Po@am__quote@ @@ -13041,6 +13879,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/journal/$(DEPDIR)/test-mmap-cache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/journal/$(DEPDIR)/test_catalog-test-catalog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/journal/$(DEPDIR)/test_tables-journald-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/dhcp-identifier.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-identifier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-network.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-option.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-packet.Plo@am__quote@ @@ -13048,6 +13888,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp6-option.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-ipv4ll-network.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-ipv4ll-packet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-internal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-network.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-port.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-tlv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-network-internal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-dhcp-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-dhcp-lease.Plo@am__quote@ @@ -13056,13 +13900,16 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-dhcp6-lease.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-icmp6-nd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-ipv4ll.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-lldp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-pppoe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/lldp-tlv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-dhcp-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-dhcp-option.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-dhcp-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-dhcp6-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-icmp6-rs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-ipv4ll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-lldp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-network/$(DEPDIR)/test-pppoe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-terminal/$(DEPDIR)/libsystemd_terminal_la-grdev-drm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd-terminal/$(DEPDIR)/libsystemd_terminal_la-grdev.Plo@am__quote@ @@ -13147,6 +13994,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-event/$(DEPDIR)/libsystemd_internal_la-sd-event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-event/$(DEPDIR)/libsystemd_la-sd-event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-event/$(DEPDIR)/test-event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_internal_la-sd-hwdb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_la-sd-hwdb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-id128/$(DEPDIR)/libsystemd_internal_la-sd-id128.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-id128/$(DEPDIR)/libsystemd_la-sd-id128.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libsystemd/sd-login/$(DEPDIR)/libsystemd_internal_la-sd-login.Plo@am__quote@ @@ -13222,6 +14071,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/login/$(DEPDIR)/user-sessions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/machine-id-commit/$(DEPDIR)/machine-id-commit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/machine-id-setup/$(DEPDIR)/machine-id-setup-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/machine/$(DEPDIR)/image-dbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/machine/$(DEPDIR)/machine-dbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/machine/$(DEPDIR)/machine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/machine/$(DEPDIR)/machinectl.Po@am__quote@ @@ -13233,13 +14083,17 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-dhcp4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-dhcp6.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-fdb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-ipv4ll.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-link-bus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-link.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-manager-bus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-bond.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-bridge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-dummy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-gperf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-ipvlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-macvlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-tunnel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-tuntap.Plo@am__quote@ @@ -13247,6 +14101,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-vlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-vxlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network-bus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network-gperf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-route.Plo@am__quote@ @@ -13303,13 +14158,17 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/install-printf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/install.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_acl_la-acl-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_fw_la-fw-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-ask-password-api.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-btrfs-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-condition.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-copy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-dev-setup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-dropin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-fileio-label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-generator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-label.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-machine-image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-mkdir-label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-selinux-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_label_la-socket-label.Plo@am__quote@ @@ -13336,7 +14195,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-clock-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-conf-files.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-conf-parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-copy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-device-nodes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-efivars.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-env-util.Plo@am__quote@ @@ -13344,10 +14202,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-exit-status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-fdset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-fileio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-fstab-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-gunicode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-hashmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-ima-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-import-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-in-addr-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-locale-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-login-shared.Plo@am__quote@ @@ -13362,6 +14223,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-ratelimit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-replace-var.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-ring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-sigbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-siphash24.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-sleep-config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-smack-util.Plo@am__quote@ @@ -13378,6 +14240,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-utmp-wtmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-verbs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-virt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-watchdog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libsystemd_shared_la-xml.Plo@am__quote@ @@ -13396,6 +14259,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-async.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-barrier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-boot-timestamps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-btrfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-calendarspec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-cap-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-capability.Po@am__quote@ @@ -13411,6 +14275,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-env-replace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-fdset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-fileio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-fstab-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-hashmap-ordered.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-hashmap-plain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-hashmap.Po@am__quote@ @@ -13418,12 +14283,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-id128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-install.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-ipcrm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-libudev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-locale-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-loopback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-namespace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-path-lookup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-path-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-prioq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-pty.Po@am__quote@ @@ -13431,6 +14298,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-replace-var.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-ring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-set.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-sigbus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-sleep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-socket-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-strbuf.Po@am__quote@ @@ -13444,11 +14312,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-unaligned.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-utf8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-verbs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-watchdog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test-xml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_cgroup_mask-test-cgroup-mask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_engine-test-engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_execute-test-execute.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_fw_util-test-fw-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_job_type-test-job-type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_ns-test-ns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/test/$(DEPDIR)/test_path-test-path.Po@am__quote@ @@ -13688,13 +14558,6 @@ src/core/libsystemd_core_la-busname.lo: src/core/busname.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -c -o src/core/libsystemd_core_la-busname.lo `test -f 'src/core/busname.c' || echo '$(srcdir)/'`src/core/busname.c -src/core/libsystemd_core_la-bus-common.lo: src/core/bus-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -MT src/core/libsystemd_core_la-bus-common.lo -MD -MP -MF src/core/$(DEPDIR)/libsystemd_core_la-bus-common.Tpo -c -o src/core/libsystemd_core_la-bus-common.lo `test -f 'src/core/bus-common.c' || echo '$(srcdir)/'`src/core/bus-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/core/$(DEPDIR)/libsystemd_core_la-bus-common.Tpo src/core/$(DEPDIR)/libsystemd_core_la-bus-common.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/core/bus-common.c' object='src/core/libsystemd_core_la-bus-common.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -c -o src/core/libsystemd_core_la-bus-common.lo `test -f 'src/core/bus-common.c' || echo '$(srcdir)/'`src/core/bus-common.c - src/core/libsystemd_core_la-bus-endpoint.lo: src/core/bus-endpoint.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -MT src/core/libsystemd_core_la-bus-endpoint.lo -MD -MP -MF src/core/$(DEPDIR)/libsystemd_core_la-bus-endpoint.Tpo -c -o src/core/libsystemd_core_la-bus-endpoint.lo `test -f 'src/core/bus-endpoint.c' || echo '$(srcdir)/'`src/core/bus-endpoint.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/core/$(DEPDIR)/libsystemd_core_la-bus-endpoint.Tpo src/core/$(DEPDIR)/libsystemd_core_la-bus-endpoint.Plo @@ -13702,6 +14565,13 @@ src/core/libsystemd_core_la-bus-endpoint.lo: src/core/bus-endpoint.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -c -o src/core/libsystemd_core_la-bus-endpoint.lo `test -f 'src/core/bus-endpoint.c' || echo '$(srcdir)/'`src/core/bus-endpoint.c +src/core/libsystemd_core_la-bus-policy.lo: src/core/bus-policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -MT src/core/libsystemd_core_la-bus-policy.lo -MD -MP -MF src/core/$(DEPDIR)/libsystemd_core_la-bus-policy.Tpo -c -o src/core/libsystemd_core_la-bus-policy.lo `test -f 'src/core/bus-policy.c' || echo '$(srcdir)/'`src/core/bus-policy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/core/$(DEPDIR)/libsystemd_core_la-bus-policy.Tpo src/core/$(DEPDIR)/libsystemd_core_la-bus-policy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/core/bus-policy.c' object='src/core/libsystemd_core_la-bus-policy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -c -o src/core/libsystemd_core_la-bus-policy.lo `test -f 'src/core/bus-policy.c' || echo '$(srcdir)/'`src/core/bus-policy.c + src/core/libsystemd_core_la-target.lo: src/core/target.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_core_la_CFLAGS) $(CFLAGS) -MT src/core/libsystemd_core_la-target.lo -MD -MP -MF src/core/$(DEPDIR)/libsystemd_core_la-target.Tpo -c -o src/core/libsystemd_core_la-target.lo `test -f 'src/core/target.c' || echo '$(srcdir)/'`src/core/target.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/core/$(DEPDIR)/libsystemd_core_la-target.Tpo src/core/$(DEPDIR)/libsystemd_core_la-target.Plo @@ -14066,6 +14936,13 @@ libsystemd_daemon_la-libsystemd-daemon.lo: libsystemd-daemon.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystemd_daemon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystemd_daemon_la-libsystemd-daemon.lo `test -f 'libsystemd-daemon.c' || echo '$(srcdir)/'`libsystemd-daemon.c +src/shared/libsystemd_fw_la-fw-util.lo: src/shared/fw-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_fw_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_fw_la-fw-util.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_fw_la-fw-util.Tpo -c -o src/shared/libsystemd_fw_la-fw-util.lo `test -f 'src/shared/fw-util.c' || echo '$(srcdir)/'`src/shared/fw-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_fw_la-fw-util.Tpo src/shared/$(DEPDIR)/libsystemd_fw_la-fw-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/fw-util.c' object='src/shared/libsystemd_fw_la-fw-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_fw_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_fw_la-fw-util.lo `test -f 'src/shared/fw-util.c' || echo '$(srcdir)/'`src/shared/fw-util.c + libsystemd_id128_la-libsystemd-id128.lo: libsystemd-id128.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystemd_id128_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystemd_id128_la-libsystemd-id128.lo -MD -MP -MF $(DEPDIR)/libsystemd_id128_la-libsystemd-id128.Tpo -c -o libsystemd_id128_la-libsystemd-id128.lo `test -f 'libsystemd-id128.c' || echo '$(srcdir)/'`libsystemd-id128.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsystemd_id128_la-libsystemd-id128.Tpo $(DEPDIR)/libsystemd_id128_la-libsystemd-id128.Plo @@ -14311,6 +15188,13 @@ src/libsystemd/sd-network/libsystemd_internal_la-network-util.lo: src/libsystemd @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_internal_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd/sd-network/libsystemd_internal_la-network-util.lo `test -f 'src/libsystemd/sd-network/network-util.c' || echo '$(srcdir)/'`src/libsystemd/sd-network/network-util.c +src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo: src/libsystemd/sd-hwdb/sd-hwdb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_internal_la_CFLAGS) $(CFLAGS) -MT src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo -MD -MP -MF src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_internal_la-sd-hwdb.Tpo -c -o src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo `test -f 'src/libsystemd/sd-hwdb/sd-hwdb.c' || echo '$(srcdir)/'`src/libsystemd/sd-hwdb/sd-hwdb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_internal_la-sd-hwdb.Tpo src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_internal_la-sd-hwdb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd/sd-hwdb/sd-hwdb.c' object='src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_internal_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd/sd-hwdb/libsystemd_internal_la-sd-hwdb.lo `test -f 'src/libsystemd/sd-hwdb/sd-hwdb.c' || echo '$(srcdir)/'`src/libsystemd/sd-hwdb/sd-hwdb.c + src/journal/libsystemd_journal_internal_la-sd-journal.lo: src/journal/sd-journal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_journal_internal_la_CFLAGS) $(CFLAGS) -MT src/journal/libsystemd_journal_internal_la-sd-journal.lo -MD -MP -MF src/journal/$(DEPDIR)/libsystemd_journal_internal_la-sd-journal.Tpo -c -o src/journal/libsystemd_journal_internal_la-sd-journal.lo `test -f 'src/journal/sd-journal.c' || echo '$(srcdir)/'`src/journal/sd-journal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/journal/$(DEPDIR)/libsystemd_journal_internal_la-sd-journal.Tpo src/journal/$(DEPDIR)/libsystemd_journal_internal_la-sd-journal.Plo @@ -14472,6 +15356,27 @@ src/shared/libsystemd_label_la-generator.lo: src/shared/generator.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_label_la-generator.lo `test -f 'src/shared/generator.c' || echo '$(srcdir)/'`src/shared/generator.c +src/shared/libsystemd_label_la-btrfs-util.lo: src/shared/btrfs-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_label_la-btrfs-util.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_label_la-btrfs-util.Tpo -c -o src/shared/libsystemd_label_la-btrfs-util.lo `test -f 'src/shared/btrfs-util.c' || echo '$(srcdir)/'`src/shared/btrfs-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_label_la-btrfs-util.Tpo src/shared/$(DEPDIR)/libsystemd_label_la-btrfs-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/btrfs-util.c' object='src/shared/libsystemd_label_la-btrfs-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_label_la-btrfs-util.lo `test -f 'src/shared/btrfs-util.c' || echo '$(srcdir)/'`src/shared/btrfs-util.c + +src/shared/libsystemd_label_la-machine-image.lo: src/shared/machine-image.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_label_la-machine-image.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_label_la-machine-image.Tpo -c -o src/shared/libsystemd_label_la-machine-image.lo `test -f 'src/shared/machine-image.c' || echo '$(srcdir)/'`src/shared/machine-image.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_label_la-machine-image.Tpo src/shared/$(DEPDIR)/libsystemd_label_la-machine-image.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/machine-image.c' object='src/shared/libsystemd_label_la-machine-image.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_label_la-machine-image.lo `test -f 'src/shared/machine-image.c' || echo '$(srcdir)/'`src/shared/machine-image.c + +src/shared/libsystemd_label_la-copy.lo: src/shared/copy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_label_la-copy.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_label_la-copy.Tpo -c -o src/shared/libsystemd_label_la-copy.lo `test -f 'src/shared/copy.c' || echo '$(srcdir)/'`src/shared/copy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_label_la-copy.Tpo src/shared/$(DEPDIR)/libsystemd_label_la-copy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/copy.c' object='src/shared/libsystemd_label_la-copy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_label_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_label_la-copy.lo `test -f 'src/shared/copy.c' || echo '$(srcdir)/'`src/shared/copy.c + libsystemd_login_la-libsystemd-login.lo: libsystemd-login.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystemd_login_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystemd_login_la-libsystemd-login.lo -MD -MP -MF $(DEPDIR)/libsystemd_login_la-libsystemd-login.Tpo -c -o libsystemd_login_la-libsystemd-login.lo `test -f 'libsystemd-login.c' || echo '$(srcdir)/'`libsystemd-login.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsystemd_login_la-libsystemd-login.Tpo $(DEPDIR)/libsystemd_login_la-libsystemd-login.Plo @@ -14591,6 +15496,48 @@ src/libsystemd-network/libsystemd_network_la-sd-dhcp6-lease.lo: src/libsystemd-n @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-sd-dhcp6-lease.lo `test -f 'src/libsystemd-network/sd-dhcp6-lease.c' || echo '$(srcdir)/'`src/libsystemd-network/sd-dhcp6-lease.c +src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo: src/libsystemd-network/dhcp-identifier.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-identifier.Tpo -c -o src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo `test -f 'src/libsystemd-network/dhcp-identifier.c' || echo '$(srcdir)/'`src/libsystemd-network/dhcp-identifier.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-identifier.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-dhcp-identifier.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/dhcp-identifier.c' object='src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-dhcp-identifier.lo `test -f 'src/libsystemd-network/dhcp-identifier.c' || echo '$(srcdir)/'`src/libsystemd-network/dhcp-identifier.c + +src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo: src/libsystemd-network/lldp-tlv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-tlv.Tpo -c -o src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo `test -f 'src/libsystemd-network/lldp-tlv.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-tlv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-tlv.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-tlv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/lldp-tlv.c' object='src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-lldp-tlv.lo `test -f 'src/libsystemd-network/lldp-tlv.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-tlv.c + +src/libsystemd-network/libsystemd_network_la-lldp-network.lo: src/libsystemd-network/lldp-network.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-lldp-network.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-network.Tpo -c -o src/libsystemd-network/libsystemd_network_la-lldp-network.lo `test -f 'src/libsystemd-network/lldp-network.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-network.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-network.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-network.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/lldp-network.c' object='src/libsystemd-network/libsystemd_network_la-lldp-network.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-lldp-network.lo `test -f 'src/libsystemd-network/lldp-network.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-network.c + +src/libsystemd-network/libsystemd_network_la-lldp-port.lo: src/libsystemd-network/lldp-port.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-lldp-port.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-port.Tpo -c -o src/libsystemd-network/libsystemd_network_la-lldp-port.lo `test -f 'src/libsystemd-network/lldp-port.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-port.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-port.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-port.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/lldp-port.c' object='src/libsystemd-network/libsystemd_network_la-lldp-port.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-lldp-port.lo `test -f 'src/libsystemd-network/lldp-port.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-port.c + +src/libsystemd-network/libsystemd_network_la-lldp-internal.lo: src/libsystemd-network/lldp-internal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-lldp-internal.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-internal.Tpo -c -o src/libsystemd-network/libsystemd_network_la-lldp-internal.lo `test -f 'src/libsystemd-network/lldp-internal.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-internal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-internal.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-lldp-internal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/lldp-internal.c' object='src/libsystemd-network/libsystemd_network_la-lldp-internal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-lldp-internal.lo `test -f 'src/libsystemd-network/lldp-internal.c' || echo '$(srcdir)/'`src/libsystemd-network/lldp-internal.c + +src/libsystemd-network/libsystemd_network_la-sd-lldp.lo: src/libsystemd-network/sd-lldp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -MT src/libsystemd-network/libsystemd_network_la-sd-lldp.lo -MD -MP -MF src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-lldp.Tpo -c -o src/libsystemd-network/libsystemd_network_la-sd-lldp.lo `test -f 'src/libsystemd-network/sd-lldp.c' || echo '$(srcdir)/'`src/libsystemd-network/sd-lldp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-lldp.Tpo src/libsystemd-network/$(DEPDIR)/libsystemd_network_la-sd-lldp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd-network/sd-lldp.c' object='src/libsystemd-network/libsystemd_network_la-sd-lldp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_network_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd-network/libsystemd_network_la-sd-lldp.lo `test -f 'src/libsystemd-network/sd-lldp.c' || echo '$(srcdir)/'`src/libsystemd-network/sd-lldp.c + src/network/libsystemd_networkd_core_la-networkd-netdev.lo: src/network/networkd-netdev.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-netdev.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-netdev.lo `test -f 'src/network/networkd-netdev.c' || echo '$(srcdir)/'`src/network/networkd-netdev.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev.Plo @@ -14633,6 +15580,13 @@ src/network/libsystemd_networkd_core_la-networkd-netdev-macvlan.lo: src/network/ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-netdev-macvlan.lo `test -f 'src/network/networkd-netdev-macvlan.c' || echo '$(srcdir)/'`src/network/networkd-netdev-macvlan.c +src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo: src/network/networkd-netdev-ipvlan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-ipvlan.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo `test -f 'src/network/networkd-netdev-ipvlan.c' || echo '$(srcdir)/'`src/network/networkd-netdev-ipvlan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-ipvlan.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-ipvlan.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/network/networkd-netdev-ipvlan.c' object='src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-netdev-ipvlan.lo `test -f 'src/network/networkd-netdev-ipvlan.c' || echo '$(srcdir)/'`src/network/networkd-netdev-ipvlan.c + src/network/libsystemd_networkd_core_la-networkd-netdev-dummy.lo: src/network/networkd-netdev-dummy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-netdev-dummy.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-dummy.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-netdev-dummy.lo `test -f 'src/network/networkd-netdev-dummy.c' || echo '$(srcdir)/'`src/network/networkd-netdev-dummy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-dummy.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-netdev-dummy.Plo @@ -14668,6 +15622,13 @@ src/network/libsystemd_networkd_core_la-networkd-link.lo: src/network/networkd-l @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-link.lo `test -f 'src/network/networkd-link.c' || echo '$(srcdir)/'`src/network/networkd-link.c +src/network/libsystemd_networkd_core_la-networkd-link-bus.lo: src/network/networkd-link-bus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-link-bus.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-link-bus.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-link-bus.lo `test -f 'src/network/networkd-link-bus.c' || echo '$(srcdir)/'`src/network/networkd-link-bus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-link-bus.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-link-bus.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/network/networkd-link-bus.c' object='src/network/libsystemd_networkd_core_la-networkd-link-bus.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-link-bus.lo `test -f 'src/network/networkd-link-bus.c' || echo '$(srcdir)/'`src/network/networkd-link-bus.c + src/network/libsystemd_networkd_core_la-networkd-ipv4ll.lo: src/network/networkd-ipv4ll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-ipv4ll.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-ipv4ll.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-ipv4ll.lo `test -f 'src/network/networkd-ipv4ll.c' || echo '$(srcdir)/'`src/network/networkd-ipv4ll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-ipv4ll.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-ipv4ll.Plo @@ -14696,6 +15657,13 @@ src/network/libsystemd_networkd_core_la-networkd-network.lo: src/network/network @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-network.lo `test -f 'src/network/networkd-network.c' || echo '$(srcdir)/'`src/network/networkd-network.c +src/network/libsystemd_networkd_core_la-networkd-network-bus.lo: src/network/networkd-network-bus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-network-bus.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network-bus.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-network-bus.lo `test -f 'src/network/networkd-network-bus.c' || echo '$(srcdir)/'`src/network/networkd-network-bus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network-bus.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-network-bus.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/network/networkd-network-bus.c' object='src/network/libsystemd_networkd_core_la-networkd-network-bus.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-network-bus.lo `test -f 'src/network/networkd-network-bus.c' || echo '$(srcdir)/'`src/network/networkd-network-bus.c + src/network/libsystemd_networkd_core_la-networkd-address.lo: src/network/networkd-address.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-address.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-address.lo `test -f 'src/network/networkd-address.c' || echo '$(srcdir)/'`src/network/networkd-address.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address.Plo @@ -14717,6 +15685,20 @@ src/network/libsystemd_networkd_core_la-networkd-manager.lo: src/network/network @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-manager.lo `test -f 'src/network/networkd-manager.c' || echo '$(srcdir)/'`src/network/networkd-manager.c +src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo: src/network/networkd-manager-bus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-manager-bus.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo `test -f 'src/network/networkd-manager-bus.c' || echo '$(srcdir)/'`src/network/networkd-manager-bus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-manager-bus.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-manager-bus.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/network/networkd-manager-bus.c' object='src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-manager-bus.lo `test -f 'src/network/networkd-manager-bus.c' || echo '$(srcdir)/'`src/network/networkd-manager-bus.c + +src/network/libsystemd_networkd_core_la-networkd-fdb.lo: src/network/networkd-fdb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-fdb.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-fdb.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-fdb.lo `test -f 'src/network/networkd-fdb.c' || echo '$(srcdir)/'`src/network/networkd-fdb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-fdb.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-fdb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/network/networkd-fdb.c' object='src/network/libsystemd_networkd_core_la-networkd-fdb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-fdb.lo `test -f 'src/network/networkd-fdb.c' || echo '$(srcdir)/'`src/network/networkd-fdb.c + src/network/libsystemd_networkd_core_la-networkd-address-pool.lo: src/network/networkd-address-pool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -MT src/network/libsystemd_networkd_core_la-networkd-address-pool.lo -MD -MP -MF src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address-pool.Tpo -c -o src/network/libsystemd_networkd_core_la-networkd-address-pool.lo `test -f 'src/network/networkd-address-pool.c' || echo '$(srcdir)/'`src/network/networkd-address-pool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address-pool.Tpo src/network/$(DEPDIR)/libsystemd_networkd_core_la-networkd-address-pool.Plo @@ -14738,6 +15720,34 @@ src/network/libsystemd_networkd_core_la-networkd-netdev-gperf.lo: src/network/ne @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_networkd_core_la_CFLAGS) $(CFLAGS) -c -o src/network/libsystemd_networkd_core_la-networkd-netdev-gperf.lo `test -f 'src/network/networkd-netdev-gperf.c' || echo '$(srcdir)/'`src/network/networkd-netdev-gperf.c +src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo: src/bus-proxyd/bus-xml-policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo -MD -MP -MF src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-bus-xml-policy.Tpo -c -o src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo `test -f 'src/bus-proxyd/bus-xml-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-xml-policy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-bus-xml-policy.Tpo src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-bus-xml-policy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-xml-policy.c' object='src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/libsystemd_proxy_la-bus-xml-policy.lo `test -f 'src/bus-proxyd/bus-xml-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-xml-policy.c + +src/bus-proxyd/libsystemd_proxy_la-driver.lo: src/bus-proxyd/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/libsystemd_proxy_la-driver.lo -MD -MP -MF src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-driver.Tpo -c -o src/bus-proxyd/libsystemd_proxy_la-driver.lo `test -f 'src/bus-proxyd/driver.c' || echo '$(srcdir)/'`src/bus-proxyd/driver.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-driver.Tpo src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-driver.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/driver.c' object='src/bus-proxyd/libsystemd_proxy_la-driver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/libsystemd_proxy_la-driver.lo `test -f 'src/bus-proxyd/driver.c' || echo '$(srcdir)/'`src/bus-proxyd/driver.c + +src/bus-proxyd/libsystemd_proxy_la-proxy.lo: src/bus-proxyd/proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/libsystemd_proxy_la-proxy.lo -MD -MP -MF src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-proxy.Tpo -c -o src/bus-proxyd/libsystemd_proxy_la-proxy.lo `test -f 'src/bus-proxyd/proxy.c' || echo '$(srcdir)/'`src/bus-proxyd/proxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-proxy.Tpo src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-proxy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/proxy.c' object='src/bus-proxyd/libsystemd_proxy_la-proxy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/libsystemd_proxy_la-proxy.lo `test -f 'src/bus-proxyd/proxy.c' || echo '$(srcdir)/'`src/bus-proxyd/proxy.c + +src/bus-proxyd/libsystemd_proxy_la-synthesize.lo: src/bus-proxyd/synthesize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/libsystemd_proxy_la-synthesize.lo -MD -MP -MF src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-synthesize.Tpo -c -o src/bus-proxyd/libsystemd_proxy_la-synthesize.lo `test -f 'src/bus-proxyd/synthesize.c' || echo '$(srcdir)/'`src/bus-proxyd/synthesize.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-synthesize.Tpo src/bus-proxyd/$(DEPDIR)/libsystemd_proxy_la-synthesize.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/synthesize.c' object='src/bus-proxyd/libsystemd_proxy_la-synthesize.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_proxy_la_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/libsystemd_proxy_la-synthesize.lo `test -f 'src/bus-proxyd/synthesize.c' || echo '$(srcdir)/'`src/bus-proxyd/synthesize.c + src/libsystemd/sd-resolve/libsystemd_resolve_la-sd-resolve.lo: src/libsystemd/sd-resolve/sd-resolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_resolve_la_CFLAGS) $(CFLAGS) -MT src/libsystemd/sd-resolve/libsystemd_resolve_la-sd-resolve.lo -MD -MP -MF src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_resolve_la-sd-resolve.Tpo -c -o src/libsystemd/sd-resolve/libsystemd_resolve_la-sd-resolve.lo `test -f 'src/libsystemd/sd-resolve/sd-resolve.c' || echo '$(srcdir)/'`src/libsystemd/sd-resolve/sd-resolve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_resolve_la-sd-resolve.Tpo src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_resolve_la-sd-resolve.Plo @@ -14794,6 +15804,13 @@ src/shared/libsystemd_shared_la-efivars.lo: src/shared/efivars.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-efivars.lo `test -f 'src/shared/efivars.c' || echo '$(srcdir)/'`src/shared/efivars.c +src/shared/libsystemd_shared_la-fstab-util.lo: src/shared/fstab-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-fstab-util.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-fstab-util.Tpo -c -o src/shared/libsystemd_shared_la-fstab-util.lo `test -f 'src/shared/fstab-util.c' || echo '$(srcdir)/'`src/shared/fstab-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-fstab-util.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-fstab-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/fstab-util.c' object='src/shared/libsystemd_shared_la-fstab-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-fstab-util.lo `test -f 'src/shared/fstab-util.c' || echo '$(srcdir)/'`src/shared/fstab-util.c + src/shared/libsystemd_shared_la-path-util.lo: src/shared/path-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-path-util.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-path-util.Tpo -c -o src/shared/libsystemd_shared_la-path-util.lo `test -f 'src/shared/path-util.c' || echo '$(srcdir)/'`src/shared/path-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-path-util.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-path-util.Plo @@ -15130,6 +16147,13 @@ src/shared/libsystemd_shared_la-xml.lo: src/shared/xml.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-xml.lo `test -f 'src/shared/xml.c' || echo '$(srcdir)/'`src/shared/xml.c +src/shared/libsystemd_shared_la-json.lo: src/shared/json.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-json.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-json.Tpo -c -o src/shared/libsystemd_shared_la-json.lo `test -f 'src/shared/json.c' || echo '$(srcdir)/'`src/shared/json.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-json.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-json.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/json.c' object='src/shared/libsystemd_shared_la-json.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-json.lo `test -f 'src/shared/json.c' || echo '$(srcdir)/'`src/shared/json.c + src/shared/libsystemd_shared_la-bus-label.lo: src/shared/bus-label.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-bus-label.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-bus-label.Tpo -c -o src/shared/libsystemd_shared_la-bus-label.lo `test -f 'src/shared/bus-label.c' || echo '$(srcdir)/'`src/shared/bus-label.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-bus-label.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-bus-label.Plo @@ -15179,13 +16203,6 @@ src/shared/libsystemd_shared_la-async.lo: src/shared/async.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-async.lo `test -f 'src/shared/async.c' || echo '$(srcdir)/'`src/shared/async.c -src/shared/libsystemd_shared_la-copy.lo: src/shared/copy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-copy.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-copy.Tpo -c -o src/shared/libsystemd_shared_la-copy.lo `test -f 'src/shared/copy.c' || echo '$(srcdir)/'`src/shared/copy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-copy.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-copy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/copy.c' object='src/shared/libsystemd_shared_la-copy.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-copy.lo `test -f 'src/shared/copy.c' || echo '$(srcdir)/'`src/shared/copy.c - src/shared/libsystemd_shared_la-base-filesystem.lo: src/shared/base-filesystem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-base-filesystem.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-base-filesystem.Tpo -c -o src/shared/libsystemd_shared_la-base-filesystem.lo `test -f 'src/shared/base-filesystem.c' || echo '$(srcdir)/'`src/shared/base-filesystem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-base-filesystem.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-base-filesystem.Plo @@ -15207,6 +16224,27 @@ src/shared/libsystemd_shared_la-uid-range.lo: src/shared/uid-range.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-uid-range.lo `test -f 'src/shared/uid-range.c' || echo '$(srcdir)/'`src/shared/uid-range.c +src/shared/libsystemd_shared_la-verbs.lo: src/shared/verbs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-verbs.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-verbs.Tpo -c -o src/shared/libsystemd_shared_la-verbs.lo `test -f 'src/shared/verbs.c' || echo '$(srcdir)/'`src/shared/verbs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-verbs.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-verbs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/verbs.c' object='src/shared/libsystemd_shared_la-verbs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-verbs.lo `test -f 'src/shared/verbs.c' || echo '$(srcdir)/'`src/shared/verbs.c + +src/shared/libsystemd_shared_la-sigbus.lo: src/shared/sigbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-sigbus.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-sigbus.Tpo -c -o src/shared/libsystemd_shared_la-sigbus.lo `test -f 'src/shared/sigbus.c' || echo '$(srcdir)/'`src/shared/sigbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-sigbus.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-sigbus.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/sigbus.c' object='src/shared/libsystemd_shared_la-sigbus.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-sigbus.lo `test -f 'src/shared/sigbus.c' || echo '$(srcdir)/'`src/shared/sigbus.c + +src/shared/libsystemd_shared_la-import-util.lo: src/shared/import-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-import-util.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-import-util.Tpo -c -o src/shared/libsystemd_shared_la-import-util.lo `test -f 'src/shared/import-util.c' || echo '$(srcdir)/'`src/shared/import-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-import-util.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-import-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/import-util.c' object='src/shared/libsystemd_shared_la-import-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -c -o src/shared/libsystemd_shared_la-import-util.lo `test -f 'src/shared/import-util.c' || echo '$(srcdir)/'`src/shared/import-util.c + src/shared/libsystemd_shared_la-utmp-wtmp.lo: src/shared/utmp-wtmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_shared_la_CFLAGS) $(CFLAGS) -MT src/shared/libsystemd_shared_la-utmp-wtmp.lo -MD -MP -MF src/shared/$(DEPDIR)/libsystemd_shared_la-utmp-wtmp.Tpo -c -o src/shared/libsystemd_shared_la-utmp-wtmp.lo `test -f 'src/shared/utmp-wtmp.c' || echo '$(srcdir)/'`src/shared/utmp-wtmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libsystemd_shared_la-utmp-wtmp.Tpo src/shared/$(DEPDIR)/libsystemd_shared_la-utmp-wtmp.Plo @@ -15536,6 +16574,13 @@ src/libsystemd/sd-network/libsystemd_la-network-util.lo: src/libsystemd/sd-netwo @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd/sd-network/libsystemd_la-network-util.lo `test -f 'src/libsystemd/sd-network/network-util.c' || echo '$(srcdir)/'`src/libsystemd/sd-network/network-util.c +src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo: src/libsystemd/sd-hwdb/sd-hwdb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -MT src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo -MD -MP -MF src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_la-sd-hwdb.Tpo -c -o src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo `test -f 'src/libsystemd/sd-hwdb/sd-hwdb.c' || echo '$(srcdir)/'`src/libsystemd/sd-hwdb/sd-hwdb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_la-sd-hwdb.Tpo src/libsystemd/sd-hwdb/$(DEPDIR)/libsystemd_la-sd-hwdb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libsystemd/sd-hwdb/sd-hwdb.c' object='src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -c -o src/libsystemd/sd-hwdb/libsystemd_la-sd-hwdb.lo `test -f 'src/libsystemd/sd-hwdb/sd-hwdb.c' || echo '$(srcdir)/'`src/libsystemd/sd-hwdb/sd-hwdb.c + src/libsystemd/sd-resolve/libsystemd_la-sd-resolve.lo: src/libsystemd/sd-resolve/sd-resolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -MT src/libsystemd/sd-resolve/libsystemd_la-sd-resolve.lo -MD -MP -MF src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_la-sd-resolve.Tpo -c -o src/libsystemd/sd-resolve/libsystemd_la-sd-resolve.lo `test -f 'src/libsystemd/sd-resolve/sd-resolve.c' || echo '$(srcdir)/'`src/libsystemd/sd-resolve/sd-resolve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_la-sd-resolve.Tpo src/libsystemd/sd-resolve/$(DEPDIR)/libsystemd_la-sd-resolve.Plo @@ -15956,6 +17001,20 @@ src/core/systemd-main.obj: src/core/main.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_CFLAGS) $(CFLAGS) -c -o src/core/systemd-main.obj `if test -f 'src/core/main.c'; then $(CYGPATH_W) 'src/core/main.c'; else $(CYGPATH_W) '$(srcdir)/src/core/main.c'; fi` +src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.o: src/bus-proxyd/bus-proxyd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_bus_proxyd_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.o -MD -MP -MF src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Tpo -c -o src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.o `test -f 'src/bus-proxyd/bus-proxyd.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-proxyd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Tpo src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-proxyd.c' object='src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_bus_proxyd_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.o `test -f 'src/bus-proxyd/bus-proxyd.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-proxyd.c + +src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.obj: src/bus-proxyd/bus-proxyd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_bus_proxyd_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.obj -MD -MP -MF src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Tpo -c -o src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.obj `if test -f 'src/bus-proxyd/bus-proxyd.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-proxyd.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-proxyd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Tpo src/bus-proxyd/$(DEPDIR)/systemd_bus_proxyd-bus-proxyd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-proxyd.c' object='src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_bus_proxyd_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/systemd_bus_proxyd-bus-proxyd.obj `if test -f 'src/bus-proxyd/bus-proxyd.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-proxyd.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-proxyd.c'; fi` + src/console/systemd_consoled-consoled.o: src/console/consoled.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_consoled_CFLAGS) $(CFLAGS) -MT src/console/systemd_consoled-consoled.o -MD -MP -MF src/console/$(DEPDIR)/systemd_consoled-consoled.Tpo -c -o src/console/systemd_consoled-consoled.o `test -f 'src/console/consoled.c' || echo '$(srcdir)/'`src/console/consoled.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/console/$(DEPDIR)/systemd_consoled-consoled.Tpo src/console/$(DEPDIR)/systemd_consoled-consoled.Po @@ -16082,6 +17141,20 @@ src/gpt-auto-generator/systemd_gpt_auto_generator-gpt-auto-generator.obj: src/gp @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_gpt_auto_generator_CFLAGS) $(CFLAGS) -c -o src/gpt-auto-generator/systemd_gpt_auto_generator-gpt-auto-generator.obj `if test -f 'src/gpt-auto-generator/gpt-auto-generator.c'; then $(CYGPATH_W) 'src/gpt-auto-generator/gpt-auto-generator.c'; else $(CYGPATH_W) '$(srcdir)/src/gpt-auto-generator/gpt-auto-generator.c'; fi` +src/import/systemd_importd-importd.o: src/import/importd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_importd_CFLAGS) $(CFLAGS) -MT src/import/systemd_importd-importd.o -MD -MP -MF src/import/$(DEPDIR)/systemd_importd-importd.Tpo -c -o src/import/systemd_importd-importd.o `test -f 'src/import/importd.c' || echo '$(srcdir)/'`src/import/importd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_importd-importd.Tpo src/import/$(DEPDIR)/systemd_importd-importd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/importd.c' object='src/import/systemd_importd-importd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_importd_CFLAGS) $(CFLAGS) -c -o src/import/systemd_importd-importd.o `test -f 'src/import/importd.c' || echo '$(srcdir)/'`src/import/importd.c + +src/import/systemd_importd-importd.obj: src/import/importd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_importd_CFLAGS) $(CFLAGS) -MT src/import/systemd_importd-importd.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_importd-importd.Tpo -c -o src/import/systemd_importd-importd.obj `if test -f 'src/import/importd.c'; then $(CYGPATH_W) 'src/import/importd.c'; else $(CYGPATH_W) '$(srcdir)/src/import/importd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_importd-importd.Tpo src/import/$(DEPDIR)/systemd_importd-importd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/importd.c' object='src/import/systemd_importd-importd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_importd_CFLAGS) $(CFLAGS) -c -o src/import/systemd_importd-importd.obj `if test -f 'src/import/importd.c'; then $(CYGPATH_W) 'src/import/importd.c'; else $(CYGPATH_W) '$(srcdir)/src/import/importd.c'; fi` + src/journal-remote/systemd_journal_gatewayd-journal-gatewayd.o: src/journal-remote/journal-gatewayd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(systemd_journal_gatewayd_CPPFLAGS) $(CPPFLAGS) $(systemd_journal_gatewayd_CFLAGS) $(CFLAGS) -MT src/journal-remote/systemd_journal_gatewayd-journal-gatewayd.o -MD -MP -MF src/journal-remote/$(DEPDIR)/systemd_journal_gatewayd-journal-gatewayd.Tpo -c -o src/journal-remote/systemd_journal_gatewayd-journal-gatewayd.o `test -f 'src/journal-remote/journal-gatewayd.c' || echo '$(srcdir)/'`src/journal-remote/journal-gatewayd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/journal-remote/$(DEPDIR)/systemd_journal_gatewayd-journal-gatewayd.Tpo src/journal-remote/$(DEPDIR)/systemd_journal_gatewayd-journal-gatewayd.Po @@ -16320,6 +17393,132 @@ src/core/systemd_nspawn-loopback-setup.obj: src/core/loopback-setup.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_nspawn_CFLAGS) $(CFLAGS) -c -o src/core/systemd_nspawn-loopback-setup.obj `if test -f 'src/core/loopback-setup.c'; then $(CYGPATH_W) 'src/core/loopback-setup.c'; else $(CYGPATH_W) '$(srcdir)/src/core/loopback-setup.c'; fi` +src/import/systemd_pull-pull.o: src/import/pull.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-pull.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-pull.Tpo -c -o src/import/systemd_pull-pull.o `test -f 'src/import/pull.c' || echo '$(srcdir)/'`src/import/pull.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-pull.Tpo src/import/$(DEPDIR)/systemd_pull-pull.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/pull.c' object='src/import/systemd_pull-pull.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-pull.o `test -f 'src/import/pull.c' || echo '$(srcdir)/'`src/import/pull.c + +src/import/systemd_pull-pull.obj: src/import/pull.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-pull.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-pull.Tpo -c -o src/import/systemd_pull-pull.obj `if test -f 'src/import/pull.c'; then $(CYGPATH_W) 'src/import/pull.c'; else $(CYGPATH_W) '$(srcdir)/src/import/pull.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-pull.Tpo src/import/$(DEPDIR)/systemd_pull-pull.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/pull.c' object='src/import/systemd_pull-pull.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-pull.obj `if test -f 'src/import/pull.c'; then $(CYGPATH_W) 'src/import/pull.c'; else $(CYGPATH_W) '$(srcdir)/src/import/pull.c'; fi` + +src/import/systemd_pull-import-raw.o: src/import/import-raw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-raw.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-raw.Tpo -c -o src/import/systemd_pull-import-raw.o `test -f 'src/import/import-raw.c' || echo '$(srcdir)/'`src/import/import-raw.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-raw.Tpo src/import/$(DEPDIR)/systemd_pull-import-raw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-raw.c' object='src/import/systemd_pull-import-raw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-raw.o `test -f 'src/import/import-raw.c' || echo '$(srcdir)/'`src/import/import-raw.c + +src/import/systemd_pull-import-raw.obj: src/import/import-raw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-raw.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-raw.Tpo -c -o src/import/systemd_pull-import-raw.obj `if test -f 'src/import/import-raw.c'; then $(CYGPATH_W) 'src/import/import-raw.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-raw.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-raw.Tpo src/import/$(DEPDIR)/systemd_pull-import-raw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-raw.c' object='src/import/systemd_pull-import-raw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-raw.obj `if test -f 'src/import/import-raw.c'; then $(CYGPATH_W) 'src/import/import-raw.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-raw.c'; fi` + +src/import/systemd_pull-import-tar.o: src/import/import-tar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-tar.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-tar.Tpo -c -o src/import/systemd_pull-import-tar.o `test -f 'src/import/import-tar.c' || echo '$(srcdir)/'`src/import/import-tar.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-tar.Tpo src/import/$(DEPDIR)/systemd_pull-import-tar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-tar.c' object='src/import/systemd_pull-import-tar.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-tar.o `test -f 'src/import/import-tar.c' || echo '$(srcdir)/'`src/import/import-tar.c + +src/import/systemd_pull-import-tar.obj: src/import/import-tar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-tar.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-tar.Tpo -c -o src/import/systemd_pull-import-tar.obj `if test -f 'src/import/import-tar.c'; then $(CYGPATH_W) 'src/import/import-tar.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-tar.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-tar.Tpo src/import/$(DEPDIR)/systemd_pull-import-tar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-tar.c' object='src/import/systemd_pull-import-tar.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-tar.obj `if test -f 'src/import/import-tar.c'; then $(CYGPATH_W) 'src/import/import-tar.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-tar.c'; fi` + +src/import/systemd_pull-import-dkr.o: src/import/import-dkr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-dkr.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-dkr.Tpo -c -o src/import/systemd_pull-import-dkr.o `test -f 'src/import/import-dkr.c' || echo '$(srcdir)/'`src/import/import-dkr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-dkr.Tpo src/import/$(DEPDIR)/systemd_pull-import-dkr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-dkr.c' object='src/import/systemd_pull-import-dkr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-dkr.o `test -f 'src/import/import-dkr.c' || echo '$(srcdir)/'`src/import/import-dkr.c + +src/import/systemd_pull-import-dkr.obj: src/import/import-dkr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-dkr.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-dkr.Tpo -c -o src/import/systemd_pull-import-dkr.obj `if test -f 'src/import/import-dkr.c'; then $(CYGPATH_W) 'src/import/import-dkr.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-dkr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-dkr.Tpo src/import/$(DEPDIR)/systemd_pull-import-dkr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-dkr.c' object='src/import/systemd_pull-import-dkr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-dkr.obj `if test -f 'src/import/import-dkr.c'; then $(CYGPATH_W) 'src/import/import-dkr.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-dkr.c'; fi` + +src/import/systemd_pull-import-job.o: src/import/import-job.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-job.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-job.Tpo -c -o src/import/systemd_pull-import-job.o `test -f 'src/import/import-job.c' || echo '$(srcdir)/'`src/import/import-job.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-job.Tpo src/import/$(DEPDIR)/systemd_pull-import-job.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-job.c' object='src/import/systemd_pull-import-job.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-job.o `test -f 'src/import/import-job.c' || echo '$(srcdir)/'`src/import/import-job.c + +src/import/systemd_pull-import-job.obj: src/import/import-job.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-job.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-job.Tpo -c -o src/import/systemd_pull-import-job.obj `if test -f 'src/import/import-job.c'; then $(CYGPATH_W) 'src/import/import-job.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-job.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-job.Tpo src/import/$(DEPDIR)/systemd_pull-import-job.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-job.c' object='src/import/systemd_pull-import-job.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-job.obj `if test -f 'src/import/import-job.c'; then $(CYGPATH_W) 'src/import/import-job.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-job.c'; fi` + +src/import/systemd_pull-import-common.o: src/import/import-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-common.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-common.Tpo -c -o src/import/systemd_pull-import-common.o `test -f 'src/import/import-common.c' || echo '$(srcdir)/'`src/import/import-common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-common.Tpo src/import/$(DEPDIR)/systemd_pull-import-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-common.c' object='src/import/systemd_pull-import-common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-common.o `test -f 'src/import/import-common.c' || echo '$(srcdir)/'`src/import/import-common.c + +src/import/systemd_pull-import-common.obj: src/import/import-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-import-common.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-import-common.Tpo -c -o src/import/systemd_pull-import-common.obj `if test -f 'src/import/import-common.c'; then $(CYGPATH_W) 'src/import/import-common.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-import-common.Tpo src/import/$(DEPDIR)/systemd_pull-import-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/import-common.c' object='src/import/systemd_pull-import-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-import-common.obj `if test -f 'src/import/import-common.c'; then $(CYGPATH_W) 'src/import/import-common.c'; else $(CYGPATH_W) '$(srcdir)/src/import/import-common.c'; fi` + +src/import/systemd_pull-curl-util.o: src/import/curl-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-curl-util.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-curl-util.Tpo -c -o src/import/systemd_pull-curl-util.o `test -f 'src/import/curl-util.c' || echo '$(srcdir)/'`src/import/curl-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-curl-util.Tpo src/import/$(DEPDIR)/systemd_pull-curl-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/curl-util.c' object='src/import/systemd_pull-curl-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-curl-util.o `test -f 'src/import/curl-util.c' || echo '$(srcdir)/'`src/import/curl-util.c + +src/import/systemd_pull-curl-util.obj: src/import/curl-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-curl-util.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-curl-util.Tpo -c -o src/import/systemd_pull-curl-util.obj `if test -f 'src/import/curl-util.c'; then $(CYGPATH_W) 'src/import/curl-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/curl-util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-curl-util.Tpo src/import/$(DEPDIR)/systemd_pull-curl-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/curl-util.c' object='src/import/systemd_pull-curl-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-curl-util.obj `if test -f 'src/import/curl-util.c'; then $(CYGPATH_W) 'src/import/curl-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/curl-util.c'; fi` + +src/import/systemd_pull-aufs-util.o: src/import/aufs-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-aufs-util.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-aufs-util.Tpo -c -o src/import/systemd_pull-aufs-util.o `test -f 'src/import/aufs-util.c' || echo '$(srcdir)/'`src/import/aufs-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-aufs-util.Tpo src/import/$(DEPDIR)/systemd_pull-aufs-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/aufs-util.c' object='src/import/systemd_pull-aufs-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-aufs-util.o `test -f 'src/import/aufs-util.c' || echo '$(srcdir)/'`src/import/aufs-util.c + +src/import/systemd_pull-aufs-util.obj: src/import/aufs-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-aufs-util.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-aufs-util.Tpo -c -o src/import/systemd_pull-aufs-util.obj `if test -f 'src/import/aufs-util.c'; then $(CYGPATH_W) 'src/import/aufs-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/aufs-util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-aufs-util.Tpo src/import/$(DEPDIR)/systemd_pull-aufs-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/aufs-util.c' object='src/import/systemd_pull-aufs-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-aufs-util.obj `if test -f 'src/import/aufs-util.c'; then $(CYGPATH_W) 'src/import/aufs-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/aufs-util.c'; fi` + +src/import/systemd_pull-qcow2-util.o: src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-qcow2-util.o -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-qcow2-util.Tpo -c -o src/import/systemd_pull-qcow2-util.o `test -f 'src/import/qcow2-util.c' || echo '$(srcdir)/'`src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-qcow2-util.Tpo src/import/$(DEPDIR)/systemd_pull-qcow2-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/qcow2-util.c' object='src/import/systemd_pull-qcow2-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-qcow2-util.o `test -f 'src/import/qcow2-util.c' || echo '$(srcdir)/'`src/import/qcow2-util.c + +src/import/systemd_pull-qcow2-util.obj: src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -MT src/import/systemd_pull-qcow2-util.obj -MD -MP -MF src/import/$(DEPDIR)/systemd_pull-qcow2-util.Tpo -c -o src/import/systemd_pull-qcow2-util.obj `if test -f 'src/import/qcow2-util.c'; then $(CYGPATH_W) 'src/import/qcow2-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/qcow2-util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/systemd_pull-qcow2-util.Tpo src/import/$(DEPDIR)/systemd_pull-qcow2-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/qcow2-util.c' object='src/import/systemd_pull-qcow2-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_pull_CFLAGS) $(CFLAGS) -c -o src/import/systemd_pull-qcow2-util.obj `if test -f 'src/import/qcow2-util.c'; then $(CYGPATH_W) 'src/import/qcow2-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/qcow2-util.c'; fi` + src/update-utmp/systemd_update_utmp-update-utmp.o: src/update-utmp/update-utmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(systemd_update_utmp_CFLAGS) $(CFLAGS) -MT src/update-utmp/systemd_update_utmp-update-utmp.o -MD -MP -MF src/update-utmp/$(DEPDIR)/systemd_update_utmp-update-utmp.Tpo -c -o src/update-utmp/systemd_update_utmp-update-utmp.o `test -f 'src/update-utmp/update-utmp.c' || echo '$(srcdir)/'`src/update-utmp/update-utmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/update-utmp/$(DEPDIR)/systemd_update_utmp-update-utmp.Tpo src/update-utmp/$(DEPDIR)/systemd_update_utmp-update-utmp.Po @@ -16474,6 +17673,20 @@ src/test/test_execute-test-execute.obj: src/test/test-execute.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_execute_CFLAGS) $(CFLAGS) -c -o src/test/test_execute-test-execute.obj `if test -f 'src/test/test-execute.c'; then $(CYGPATH_W) 'src/test/test-execute.c'; else $(CYGPATH_W) '$(srcdir)/src/test/test-execute.c'; fi` +src/test/test_fw_util-test-fw-util.o: src/test/test-fw-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_fw_util_CFLAGS) $(CFLAGS) -MT src/test/test_fw_util-test-fw-util.o -MD -MP -MF src/test/$(DEPDIR)/test_fw_util-test-fw-util.Tpo -c -o src/test/test_fw_util-test-fw-util.o `test -f 'src/test/test-fw-util.c' || echo '$(srcdir)/'`src/test/test-fw-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/test/$(DEPDIR)/test_fw_util-test-fw-util.Tpo src/test/$(DEPDIR)/test_fw_util-test-fw-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/test/test-fw-util.c' object='src/test/test_fw_util-test-fw-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_fw_util_CFLAGS) $(CFLAGS) -c -o src/test/test_fw_util-test-fw-util.o `test -f 'src/test/test-fw-util.c' || echo '$(srcdir)/'`src/test/test-fw-util.c + +src/test/test_fw_util-test-fw-util.obj: src/test/test-fw-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_fw_util_CFLAGS) $(CFLAGS) -MT src/test/test_fw_util-test-fw-util.obj -MD -MP -MF src/test/$(DEPDIR)/test_fw_util-test-fw-util.Tpo -c -o src/test/test_fw_util-test-fw-util.obj `if test -f 'src/test/test-fw-util.c'; then $(CYGPATH_W) 'src/test/test-fw-util.c'; else $(CYGPATH_W) '$(srcdir)/src/test/test-fw-util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/test/$(DEPDIR)/test_fw_util-test-fw-util.Tpo src/test/$(DEPDIR)/test_fw_util-test-fw-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/test/test-fw-util.c' object='src/test/test_fw_util-test-fw-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_fw_util_CFLAGS) $(CFLAGS) -c -o src/test/test_fw_util-test-fw-util.obj `if test -f 'src/test/test-fw-util.c'; then $(CYGPATH_W) 'src/test/test-fw-util.c'; else $(CYGPATH_W) '$(srcdir)/src/test/test-fw-util.c'; fi` + src/test/test_job_type-test-job-type.o: src/test/test-job-type.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_job_type_CFLAGS) $(CFLAGS) -MT src/test/test_job_type-test-job-type.o -MD -MP -MF src/test/$(DEPDIR)/test_job_type-test-job-type.Tpo -c -o src/test/test_job_type-test-job-type.o `test -f 'src/test/test-job-type.c' || echo '$(srcdir)/'`src/test/test-job-type.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/test/$(DEPDIR)/test_job_type-test-job-type.Tpo src/test/$(DEPDIR)/test_job_type-test-job-type.Po @@ -16530,6 +17743,34 @@ src/test/test_path-test-path.obj: src/test/test-path.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_path_CFLAGS) $(CFLAGS) -c -o src/test/test_path-test-path.obj `if test -f 'src/test/test-path.c'; then $(CYGPATH_W) 'src/test/test-path.c'; else $(CYGPATH_W) '$(srcdir)/src/test/test-path.c'; fi` +src/import/test_qcow2-test-qcow2.o: src/import/test-qcow2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -MT src/import/test_qcow2-test-qcow2.o -MD -MP -MF src/import/$(DEPDIR)/test_qcow2-test-qcow2.Tpo -c -o src/import/test_qcow2-test-qcow2.o `test -f 'src/import/test-qcow2.c' || echo '$(srcdir)/'`src/import/test-qcow2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/test_qcow2-test-qcow2.Tpo src/import/$(DEPDIR)/test_qcow2-test-qcow2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/test-qcow2.c' object='src/import/test_qcow2-test-qcow2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -c -o src/import/test_qcow2-test-qcow2.o `test -f 'src/import/test-qcow2.c' || echo '$(srcdir)/'`src/import/test-qcow2.c + +src/import/test_qcow2-test-qcow2.obj: src/import/test-qcow2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -MT src/import/test_qcow2-test-qcow2.obj -MD -MP -MF src/import/$(DEPDIR)/test_qcow2-test-qcow2.Tpo -c -o src/import/test_qcow2-test-qcow2.obj `if test -f 'src/import/test-qcow2.c'; then $(CYGPATH_W) 'src/import/test-qcow2.c'; else $(CYGPATH_W) '$(srcdir)/src/import/test-qcow2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/test_qcow2-test-qcow2.Tpo src/import/$(DEPDIR)/test_qcow2-test-qcow2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/test-qcow2.c' object='src/import/test_qcow2-test-qcow2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -c -o src/import/test_qcow2-test-qcow2.obj `if test -f 'src/import/test-qcow2.c'; then $(CYGPATH_W) 'src/import/test-qcow2.c'; else $(CYGPATH_W) '$(srcdir)/src/import/test-qcow2.c'; fi` + +src/import/test_qcow2-qcow2-util.o: src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -MT src/import/test_qcow2-qcow2-util.o -MD -MP -MF src/import/$(DEPDIR)/test_qcow2-qcow2-util.Tpo -c -o src/import/test_qcow2-qcow2-util.o `test -f 'src/import/qcow2-util.c' || echo '$(srcdir)/'`src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/test_qcow2-qcow2-util.Tpo src/import/$(DEPDIR)/test_qcow2-qcow2-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/qcow2-util.c' object='src/import/test_qcow2-qcow2-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -c -o src/import/test_qcow2-qcow2-util.o `test -f 'src/import/qcow2-util.c' || echo '$(srcdir)/'`src/import/qcow2-util.c + +src/import/test_qcow2-qcow2-util.obj: src/import/qcow2-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -MT src/import/test_qcow2-qcow2-util.obj -MD -MP -MF src/import/$(DEPDIR)/test_qcow2-qcow2-util.Tpo -c -o src/import/test_qcow2-qcow2-util.obj `if test -f 'src/import/qcow2-util.c'; then $(CYGPATH_W) 'src/import/qcow2-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/qcow2-util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/import/$(DEPDIR)/test_qcow2-qcow2-util.Tpo src/import/$(DEPDIR)/test_qcow2-qcow2-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/import/qcow2-util.c' object='src/import/test_qcow2-qcow2-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_qcow2_CFLAGS) $(CFLAGS) -c -o src/import/test_qcow2-qcow2-util.obj `if test -f 'src/import/qcow2-util.c'; then $(CYGPATH_W) 'src/import/qcow2-util.c'; else $(CYGPATH_W) '$(srcdir)/src/import/qcow2-util.c'; fi` + src/libsystemd/sd-resolve/test_resolve-test-resolve.o: src/libsystemd/sd-resolve/test-resolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_resolve_CFLAGS) $(CFLAGS) -MT src/libsystemd/sd-resolve/test_resolve-test-resolve.o -MD -MP -MF src/libsystemd/sd-resolve/$(DEPDIR)/test_resolve-test-resolve.Tpo -c -o src/libsystemd/sd-resolve/test_resolve-test-resolve.o `test -f 'src/libsystemd/sd-resolve/test-resolve.c' || echo '$(srcdir)/'`src/libsystemd/sd-resolve/test-resolve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libsystemd/sd-resolve/$(DEPDIR)/test_resolve-test-resolve.Tpo src/libsystemd/sd-resolve/$(DEPDIR)/test_resolve-test-resolve.Po @@ -16586,19 +17827,19 @@ src/test/test_tables-test-tables.obj: src/test/test-tables.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -c -o src/test/test_tables-test-tables.obj `if test -f 'src/test/test-tables.c'; then $(CYGPATH_W) 'src/test/test-tables.c'; else $(CYGPATH_W) '$(srcdir)/src/test/test-tables.c'; fi` -src/bus-proxyd/test_tables-bus-policy.o: src/bus-proxyd/bus-policy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/test_tables-bus-policy.o -MD -MP -MF src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Tpo -c -o src/bus-proxyd/test_tables-bus-policy.o `test -f 'src/bus-proxyd/bus-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-policy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Tpo src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-policy.c' object='src/bus-proxyd/test_tables-bus-policy.o' libtool=no @AMDEPBACKSLASH@ +src/bus-proxyd/test_tables-bus-xml-policy.o: src/bus-proxyd/bus-xml-policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/test_tables-bus-xml-policy.o -MD -MP -MF src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Tpo -c -o src/bus-proxyd/test_tables-bus-xml-policy.o `test -f 'src/bus-proxyd/bus-xml-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-xml-policy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Tpo src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-xml-policy.c' object='src/bus-proxyd/test_tables-bus-xml-policy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/test_tables-bus-policy.o `test -f 'src/bus-proxyd/bus-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-policy.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/test_tables-bus-xml-policy.o `test -f 'src/bus-proxyd/bus-xml-policy.c' || echo '$(srcdir)/'`src/bus-proxyd/bus-xml-policy.c -src/bus-proxyd/test_tables-bus-policy.obj: src/bus-proxyd/bus-policy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/test_tables-bus-policy.obj -MD -MP -MF src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Tpo -c -o src/bus-proxyd/test_tables-bus-policy.obj `if test -f 'src/bus-proxyd/bus-policy.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-policy.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-policy.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Tpo src/bus-proxyd/$(DEPDIR)/test_tables-bus-policy.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-policy.c' object='src/bus-proxyd/test_tables-bus-policy.obj' libtool=no @AMDEPBACKSLASH@ +src/bus-proxyd/test_tables-bus-xml-policy.obj: src/bus-proxyd/bus-xml-policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -MT src/bus-proxyd/test_tables-bus-xml-policy.obj -MD -MP -MF src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Tpo -c -o src/bus-proxyd/test_tables-bus-xml-policy.obj `if test -f 'src/bus-proxyd/bus-xml-policy.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-xml-policy.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-xml-policy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Tpo src/bus-proxyd/$(DEPDIR)/test_tables-bus-xml-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bus-proxyd/bus-xml-policy.c' object='src/bus-proxyd/test_tables-bus-xml-policy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/test_tables-bus-policy.obj `if test -f 'src/bus-proxyd/bus-policy.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-policy.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-policy.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -c -o src/bus-proxyd/test_tables-bus-xml-policy.obj `if test -f 'src/bus-proxyd/bus-xml-policy.c'; then $(CYGPATH_W) 'src/bus-proxyd/bus-xml-policy.c'; else $(CYGPATH_W) '$(srcdir)/src/bus-proxyd/bus-xml-policy.c'; fi` src/journal/test_tables-journald-server.o: src/journal/journald-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tables_CPPFLAGS) $(CPPFLAGS) $(test_tables_CFLAGS) $(CFLAGS) -MT src/journal/test_tables-journald-server.o -MD -MP -MF src/journal/$(DEPDIR)/test_tables-journald-server.Tpo -c -o src/journal/test_tables-journald-server.o `test -f 'src/journal/journald-server.c' || echo '$(srcdir)/'`src/journal/journald-server.c @@ -16647,6 +17888,7 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs + -rm -rf src/bus-proxyd/.libs src/bus-proxyd/_libs -rm -rf src/core/.libs src/core/_libs -rm -rf src/gudev/.libs src/gudev/_libs -rm -rf src/journal/.libs src/journal/_libs @@ -16655,6 +17897,7 @@ clean-libtool: -rm -rf src/libsystemd/sd-bus/.libs src/libsystemd/sd-bus/_libs -rm -rf src/libsystemd/sd-daemon/.libs src/libsystemd/sd-daemon/_libs -rm -rf src/libsystemd/sd-event/.libs src/libsystemd/sd-event/_libs + -rm -rf src/libsystemd/sd-hwdb/.libs src/libsystemd/sd-hwdb/_libs -rm -rf src/libsystemd/sd-id128/.libs src/libsystemd/sd-id128/_libs -rm -rf src/libsystemd/sd-login/.libs src/libsystemd/sd-login/_libs -rm -rf src/libsystemd/sd-network/.libs src/libsystemd/sd-network/_libs @@ -17191,6 +18434,27 @@ uninstall-dist_pkgsysconfDATA: @list='$(dist_pkgsysconf_DATA)'; test -n "$(pkgsysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgsysconfdir)'; $(am__uninstall_files_from_dir) +install-dist_rootlibexecDATA: $(dist_rootlibexec_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_rootlibexec_DATA)'; test -n "$(rootlibexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(rootlibexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(rootlibexecdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rootlibexecdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(rootlibexecdir)" || exit $$?; \ + done + +uninstall-dist_rootlibexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_rootlibexec_DATA)'; test -n "$(rootlibexecdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(rootlibexecdir)'; $(am__uninstall_files_from_dir) install-dist_sysctlDATA: $(dist_sysctl_DATA) @$(NORMAL_INSTALL) @list='$(dist_sysctl_DATA)'; test -n "$(sysctldir)" || list=; \ @@ -17632,27 +18896,6 @@ uninstall-nodist_zshcompletionDATA: @list='$(nodist_zshcompletion_DATA)'; test -n "$(zshcompletiondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(zshcompletiondir)'; $(am__uninstall_files_from_dir) -install-pkgconfigdataDATA: $(pkgconfigdata_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfigdata_DATA)'; test -n "$(pkgconfigdatadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdatadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdatadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdatadir)" || exit $$?; \ - done - -uninstall-pkgconfigdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfigdata_DATA)'; test -n "$(pkgconfigdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdatadir)'; $(am__uninstall_files_from_dir) install-pkgconfiglibDATA: $(pkgconfiglib_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfiglib_DATA)'; test -n "$(pkgconfiglibdir)" || list=; \ @@ -18097,13 +19340,6 @@ test/udev-test.pl.log: test/udev-test.pl --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -test/rules-test.sh.log: test/rules-test.sh - @p='test/rules-test.sh'; \ - b='test/rules-test.sh'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) test-engine.log: test-engine$(EXEEXT) @p='test-engine$(EXEEXT)'; \ b='test-engine'; \ @@ -18202,6 +19438,13 @@ test-util.log: test-util$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-path-lookup.log: test-path-lookup$(EXEEXT) + @p='test-path-lookup$(EXEEXT)'; \ + b='test-path-lookup'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-ring.log: test-ring$(EXEEXT) @p='test-ring$(EXEEXT)'; \ b='test-ring'; \ @@ -18286,6 +19529,13 @@ test-cgroup-util.log: test-cgroup-util$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-fstab-util.log: test-fstab-util$(EXEEXT) + @p='test-fstab-util$(EXEEXT)'; \ + b='test-fstab-util'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-prioq.log: test-prioq$(EXEEXT) @p='test-prioq$(EXEEXT)'; \ b='test-prioq'; \ @@ -18356,6 +19606,13 @@ test-xml.log: test-xml$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-json.log: test-json$(EXEEXT) + @p='test-json$(EXEEXT)'; \ + b='test-json'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-architecture.log: test-architecture$(EXEEXT) @p='test-architecture$(EXEEXT)'; \ b='test-architecture'; \ @@ -18454,6 +19711,20 @@ test-cap-list.log: test-cap-list$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sigbus.log: test-sigbus$(EXEEXT) + @p='test-sigbus$(EXEEXT)'; \ + b='test-sigbus'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-verbs.log: test-verbs$(EXEEXT) + @p='test-verbs$(EXEEXT)'; \ + b='test-verbs'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-bus-marshal.log: test-bus-marshal$(EXEEXT) @p='test-bus-marshal$(EXEEXT)'; \ b='test-bus-marshal'; \ @@ -18629,6 +19900,13 @@ test-dhcp6-client.log: test-dhcp6-client$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-lldp.log: test-lldp$(EXEEXT) + @p='test-lldp$(EXEEXT)'; \ + b='test-lldp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-term-page.log: test-term-page$(EXEEXT) @p='test-term-page$(EXEEXT)'; \ b='test-term-page'; \ @@ -18804,19 +20082,19 @@ test-libudev-sym.log: test-libudev-sym$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: +.py.log: @p='$<'; \ $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + $(am__check_pre) $(PY_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + $(am__common_driver_flags) $(AM_PY_LOG_DRIVER_FLAGS) $(PY_LOG_DRIVER_FLAGS) -- $(PY_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@.py$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(PY_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_PY_LOG_DRIVER_FLAGS) $(PY_LOG_DRIVER_FLAGS) -- $(PY_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @@ -19017,7 +20295,7 @@ install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pamlibdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rootbindir)" "$(DESTDIR)$(rootlibexecdir)" "$(DESTDIR)$(systemgeneratordir)" "$(DESTDIR)$(udevlibexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(kernelinstalldir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(catalogdir)" "$(DESTDIR)$(dbuspolicydir)" "$(DESTDIR)$(dbussystemservicedir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(factory_etcdir)" "$(DESTDIR)$(factory_pamdir)" "$(DESTDIR)$(gatewayddocumentrootdir)" "$(DESTDIR)$(networkdir)" "$(DESTDIR)$(pamconfdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)" "$(DESTDIR)$(sysctldir)" "$(DESTDIR)$(systempresetdir)" "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevconfdir)" "$(DESTDIR)$(udevhwdbdir)" "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(pkgsysconfdir)" "$(DESTDIR)$(polkitpolicydir)" "$(DESTDIR)$(rpmmacrosdir)" "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(pkgconfigdatadir)" "$(DESTDIR)$(pkgconfiglibdir)" "$(DESTDIR)$(sharepkgconfigdir)" "$(DESTDIR)$(sysctldir)" "$(DESTDIR)$(sysvinitdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(varlogdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(libgudev_includedir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pamlibdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rootbindir)" "$(DESTDIR)$(rootlibexecdir)" "$(DESTDIR)$(systemgeneratordir)" "$(DESTDIR)$(udevlibexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(kernelinstalldir)" "$(DESTDIR)$(xinitrcdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(catalogdir)" "$(DESTDIR)$(dbuspolicydir)" "$(DESTDIR)$(dbussystemservicedir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(factory_etcdir)" "$(DESTDIR)$(factory_pamdir)" "$(DESTDIR)$(gatewayddocumentrootdir)" "$(DESTDIR)$(networkdir)" "$(DESTDIR)$(pamconfdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)" "$(DESTDIR)$(rootlibexecdir)" "$(DESTDIR)$(sysctldir)" "$(DESTDIR)$(systempresetdir)" "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevconfdir)" "$(DESTDIR)$(udevhwdbdir)" "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(pkgsysconfdir)" "$(DESTDIR)$(polkitpolicydir)" "$(DESTDIR)$(rpmmacrosdir)" "$(DESTDIR)$(systemunitdir)" "$(DESTDIR)$(sysusersdir)" "$(DESTDIR)$(tmpfilesdir)" "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(userunitdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(pkgconfiglibdir)" "$(DESTDIR)$(sharepkgconfigdir)" "$(DESTDIR)$(sysctldir)" "$(DESTDIR)$(sysvinitdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(varlogdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(libgudev_includedir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -19109,6 +20387,10 @@ distclean-generic: -rm -f src/hibernate-resume/$(am__dirstamp) -rm -f src/hostname/$(DEPDIR)/$(am__dirstamp) -rm -f src/hostname/$(am__dirstamp) + -rm -f src/hwdb/$(DEPDIR)/$(am__dirstamp) + -rm -f src/hwdb/$(am__dirstamp) + -rm -f src/import/$(DEPDIR)/$(am__dirstamp) + -rm -f src/import/$(am__dirstamp) -rm -f src/initctl/$(DEPDIR)/$(am__dirstamp) -rm -f src/initctl/$(am__dirstamp) -rm -f src/journal-remote/$(DEPDIR)/$(am__dirstamp) @@ -19125,6 +20407,8 @@ distclean-generic: -rm -f src/libsystemd/sd-daemon/$(am__dirstamp) -rm -f src/libsystemd/sd-event/$(DEPDIR)/$(am__dirstamp) -rm -f src/libsystemd/sd-event/$(am__dirstamp) + -rm -f src/libsystemd/sd-hwdb/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libsystemd/sd-hwdb/$(am__dirstamp) -rm -f src/libsystemd/sd-id128/$(DEPDIR)/$(am__dirstamp) -rm -f src/libsystemd/sd-id128/$(am__dirstamp) -rm -f src/libsystemd/sd-login/$(DEPDIR)/$(am__dirstamp) @@ -19257,7 +20541,7 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) src/ac-power/$(DEPDIR) src/activate/$(DEPDIR) src/analyze/$(DEPDIR) src/ask-password/$(DEPDIR) src/backlight/$(DEPDIR) src/binfmt/$(DEPDIR) src/boot/$(DEPDIR) src/bootchart/$(DEPDIR) src/bus-proxyd/$(DEPDIR) src/cgls/$(DEPDIR) src/cgroups-agent/$(DEPDIR) src/cgtop/$(DEPDIR) src/console/$(DEPDIR) src/core/$(DEPDIR) src/cryptsetup/$(DEPDIR) src/dbus1-generator/$(DEPDIR) src/debug-generator/$(DEPDIR) src/delta/$(DEPDIR) src/detect-virt/$(DEPDIR) src/efi-boot-generator/$(DEPDIR) src/escape/$(DEPDIR) src/firstboot/$(DEPDIR) src/fsck/$(DEPDIR) src/fstab-generator/$(DEPDIR) src/getty-generator/$(DEPDIR) src/gpt-auto-generator/$(DEPDIR) src/gudev/$(DEPDIR) src/hibernate-resume/$(DEPDIR) src/hostname/$(DEPDIR) src/initctl/$(DEPDIR) src/journal-remote/$(DEPDIR) src/journal/$(DEPDIR) src/libsystemd-network/$(DEPDIR) src/libsystemd-terminal/$(DEPDIR) src/libsystemd/sd-bus/$(DEPDIR) src/libsystemd/sd-daemon/$(DEPDIR) src/libsystemd/sd-event/$(DEPDIR) src/libsystemd/sd-id128/$(DEPDIR) src/libsystemd/sd-login/$(DEPDIR) src/libsystemd/sd-network/$(DEPDIR) src/libsystemd/sd-path/$(DEPDIR) src/libsystemd/sd-resolve/$(DEPDIR) src/libsystemd/sd-rtnl/$(DEPDIR) src/libsystemd/sd-utf8/$(DEPDIR) src/libudev/$(DEPDIR) src/locale/$(DEPDIR) src/login/$(DEPDIR) src/machine-id-commit/$(DEPDIR) src/machine-id-setup/$(DEPDIR) src/machine/$(DEPDIR) src/modules-load/$(DEPDIR) src/network/$(DEPDIR) src/notify/$(DEPDIR) src/nspawn/$(DEPDIR) src/nss-myhostname/$(DEPDIR) src/nss-mymachines/$(DEPDIR) src/nss-resolve/$(DEPDIR) src/path/$(DEPDIR) src/python-systemd/$(DEPDIR) src/quotacheck/$(DEPDIR) src/random-seed/$(DEPDIR) src/rc-local-generator/$(DEPDIR) src/remount-fs/$(DEPDIR) src/reply-password/$(DEPDIR) src/resolve-host/$(DEPDIR) src/resolve/$(DEPDIR) src/rfkill/$(DEPDIR) src/run/$(DEPDIR) src/shared/$(DEPDIR) src/shutdownd/$(DEPDIR) src/sleep/$(DEPDIR) src/socket-proxy/$(DEPDIR) src/sysctl/$(DEPDIR) src/system-update-generator/$(DEPDIR) src/systemctl/$(DEPDIR) src/sysusers/$(DEPDIR) src/sysv-generator/$(DEPDIR) src/test/$(DEPDIR) src/timedate/$(DEPDIR) src/timesync/$(DEPDIR) src/tmpfiles/$(DEPDIR) src/tty-ask-password-agent/$(DEPDIR) src/udev/$(DEPDIR) src/udev/accelerometer/$(DEPDIR) src/udev/ata_id/$(DEPDIR) src/udev/cdrom_id/$(DEPDIR) src/udev/collect/$(DEPDIR) src/udev/mtd_probe/$(DEPDIR) src/udev/net/$(DEPDIR) src/udev/scsi_id/$(DEPDIR) src/udev/v4l_id/$(DEPDIR) src/update-done/$(DEPDIR) src/update-utmp/$(DEPDIR) src/vconsole/$(DEPDIR) + -rm -rf ./$(DEPDIR) src/ac-power/$(DEPDIR) src/activate/$(DEPDIR) src/analyze/$(DEPDIR) src/ask-password/$(DEPDIR) src/backlight/$(DEPDIR) src/binfmt/$(DEPDIR) src/boot/$(DEPDIR) src/bootchart/$(DEPDIR) src/bus-proxyd/$(DEPDIR) src/cgls/$(DEPDIR) src/cgroups-agent/$(DEPDIR) src/cgtop/$(DEPDIR) src/console/$(DEPDIR) src/core/$(DEPDIR) src/cryptsetup/$(DEPDIR) src/dbus1-generator/$(DEPDIR) src/debug-generator/$(DEPDIR) src/delta/$(DEPDIR) src/detect-virt/$(DEPDIR) src/efi-boot-generator/$(DEPDIR) src/escape/$(DEPDIR) src/firstboot/$(DEPDIR) src/fsck/$(DEPDIR) src/fstab-generator/$(DEPDIR) src/getty-generator/$(DEPDIR) src/gpt-auto-generator/$(DEPDIR) src/gudev/$(DEPDIR) src/hibernate-resume/$(DEPDIR) src/hostname/$(DEPDIR) src/hwdb/$(DEPDIR) src/import/$(DEPDIR) src/initctl/$(DEPDIR) src/journal-remote/$(DEPDIR) src/journal/$(DEPDIR) src/libsystemd-network/$(DEPDIR) src/libsystemd-terminal/$(DEPDIR) src/libsystemd/sd-bus/$(DEPDIR) src/libsystemd/sd-daemon/$(DEPDIR) src/libsystemd/sd-event/$(DEPDIR) src/libsystemd/sd-hwdb/$(DEPDIR) src/libsystemd/sd-id128/$(DEPDIR) src/libsystemd/sd-login/$(DEPDIR) src/libsystemd/sd-network/$(DEPDIR) src/libsystemd/sd-path/$(DEPDIR) src/libsystemd/sd-resolve/$(DEPDIR) src/libsystemd/sd-rtnl/$(DEPDIR) src/libsystemd/sd-utf8/$(DEPDIR) src/libudev/$(DEPDIR) src/locale/$(DEPDIR) src/login/$(DEPDIR) src/machine-id-commit/$(DEPDIR) src/machine-id-setup/$(DEPDIR) src/machine/$(DEPDIR) src/modules-load/$(DEPDIR) src/network/$(DEPDIR) src/notify/$(DEPDIR) src/nspawn/$(DEPDIR) src/nss-myhostname/$(DEPDIR) src/nss-mymachines/$(DEPDIR) src/nss-resolve/$(DEPDIR) src/path/$(DEPDIR) src/python-systemd/$(DEPDIR) src/quotacheck/$(DEPDIR) src/random-seed/$(DEPDIR) src/rc-local-generator/$(DEPDIR) src/remount-fs/$(DEPDIR) src/reply-password/$(DEPDIR) src/resolve-host/$(DEPDIR) src/resolve/$(DEPDIR) src/rfkill/$(DEPDIR) src/run/$(DEPDIR) src/shared/$(DEPDIR) src/shutdownd/$(DEPDIR) src/sleep/$(DEPDIR) src/socket-proxy/$(DEPDIR) src/sysctl/$(DEPDIR) src/system-update-generator/$(DEPDIR) src/systemctl/$(DEPDIR) src/sysusers/$(DEPDIR) src/sysv-generator/$(DEPDIR) src/test/$(DEPDIR) src/timedate/$(DEPDIR) src/timesync/$(DEPDIR) src/tmpfiles/$(DEPDIR) src/tty-ask-password-agent/$(DEPDIR) src/udev/$(DEPDIR) src/udev/accelerometer/$(DEPDIR) src/udev/ata_id/$(DEPDIR) src/udev/cdrom_id/$(DEPDIR) src/udev/collect/$(DEPDIR) src/udev/mtd_probe/$(DEPDIR) src/udev/net/$(DEPDIR) src/udev/scsi_id/$(DEPDIR) src/udev/v4l_id/$(DEPDIR) src/update-done/$(DEPDIR) src/update-utmp/$(DEPDIR) src/vconsole/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-local distclean-tags @@ -19286,19 +20570,19 @@ install-data-am: install-dist_bashcompletionDATA \ install-dist_sysusersDATA install-dist_tmpfilesDATA \ install-dist_udevconfDATA install-dist_udevhwdbDATA \ install-dist_udevrulesDATA install-dist_userunitDATA \ - install-dist_zshcompletionDATA install-girDATA \ - install-includeHEADERS install-libgudev_includeHEADERS \ - install-man install-nodist_bashcompletionDATA \ + install-dist_xinitrcSCRIPTS install-dist_zshcompletionDATA \ + install-girDATA install-includeHEADERS \ + install-libgudev_includeHEADERS install-man \ + install-nodist_bashcompletionDATA \ install-nodist_pkgsysconfDATA install-nodist_polkitpolicyDATA \ install-nodist_rpmmacrosDATA install-nodist_systemunitDATA \ install-nodist_sysusersDATA install-nodist_tmpfilesDATA \ install-nodist_udevrulesDATA install-nodist_userunitDATA \ install-nodist_zshcompletionDATA install-pamlibLTLIBRARIES \ - install-pkgconfigdataDATA install-pkgconfiglibDATA \ - install-pkgincludeHEADERS install-rootbinPROGRAMS \ - install-sharepkgconfigDATA install-sysctlDATA \ - install-systemgeneratorPROGRAMS install-sysvinitDATA \ - install-typelibsDATA install-varlogDATA + install-pkgconfiglibDATA install-pkgincludeHEADERS \ + install-rootbinPROGRAMS install-sharepkgconfigDATA \ + install-sysctlDATA install-systemgeneratorPROGRAMS \ + install-sysvinitDATA install-typelibsDATA install-varlogDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive @@ -19306,9 +20590,9 @@ install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS \ - install-dist_pkgpyexecPYTHON install-libLTLIBRARIES \ - install-pkgpyexecLTLIBRARIES install-rootlibexecPROGRAMS \ - install-udevlibexecPROGRAMS + install-dist_pkgpyexecPYTHON install-dist_rootlibexecDATA \ + install-libLTLIBRARIES install-pkgpyexecLTLIBRARIES \ + install-rootlibexecPROGRAMS install-udevlibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive @@ -19335,7 +20619,7 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) src/ac-power/$(DEPDIR) src/activate/$(DEPDIR) src/analyze/$(DEPDIR) src/ask-password/$(DEPDIR) src/backlight/$(DEPDIR) src/binfmt/$(DEPDIR) src/boot/$(DEPDIR) src/bootchart/$(DEPDIR) src/bus-proxyd/$(DEPDIR) src/cgls/$(DEPDIR) src/cgroups-agent/$(DEPDIR) src/cgtop/$(DEPDIR) src/console/$(DEPDIR) src/core/$(DEPDIR) src/cryptsetup/$(DEPDIR) src/dbus1-generator/$(DEPDIR) src/debug-generator/$(DEPDIR) src/delta/$(DEPDIR) src/detect-virt/$(DEPDIR) src/efi-boot-generator/$(DEPDIR) src/escape/$(DEPDIR) src/firstboot/$(DEPDIR) src/fsck/$(DEPDIR) src/fstab-generator/$(DEPDIR) src/getty-generator/$(DEPDIR) src/gpt-auto-generator/$(DEPDIR) src/gudev/$(DEPDIR) src/hibernate-resume/$(DEPDIR) src/hostname/$(DEPDIR) src/initctl/$(DEPDIR) src/journal-remote/$(DEPDIR) src/journal/$(DEPDIR) src/libsystemd-network/$(DEPDIR) src/libsystemd-terminal/$(DEPDIR) src/libsystemd/sd-bus/$(DEPDIR) src/libsystemd/sd-daemon/$(DEPDIR) src/libsystemd/sd-event/$(DEPDIR) src/libsystemd/sd-id128/$(DEPDIR) src/libsystemd/sd-login/$(DEPDIR) src/libsystemd/sd-network/$(DEPDIR) src/libsystemd/sd-path/$(DEPDIR) src/libsystemd/sd-resolve/$(DEPDIR) src/libsystemd/sd-rtnl/$(DEPDIR) src/libsystemd/sd-utf8/$(DEPDIR) src/libudev/$(DEPDIR) src/locale/$(DEPDIR) src/login/$(DEPDIR) src/machine-id-commit/$(DEPDIR) src/machine-id-setup/$(DEPDIR) src/machine/$(DEPDIR) src/modules-load/$(DEPDIR) src/network/$(DEPDIR) src/notify/$(DEPDIR) src/nspawn/$(DEPDIR) src/nss-myhostname/$(DEPDIR) src/nss-mymachines/$(DEPDIR) src/nss-resolve/$(DEPDIR) src/path/$(DEPDIR) src/python-systemd/$(DEPDIR) src/quotacheck/$(DEPDIR) src/random-seed/$(DEPDIR) src/rc-local-generator/$(DEPDIR) src/remount-fs/$(DEPDIR) src/reply-password/$(DEPDIR) src/resolve-host/$(DEPDIR) src/resolve/$(DEPDIR) src/rfkill/$(DEPDIR) src/run/$(DEPDIR) src/shared/$(DEPDIR) src/shutdownd/$(DEPDIR) src/sleep/$(DEPDIR) src/socket-proxy/$(DEPDIR) src/sysctl/$(DEPDIR) src/system-update-generator/$(DEPDIR) src/systemctl/$(DEPDIR) src/sysusers/$(DEPDIR) src/sysv-generator/$(DEPDIR) src/test/$(DEPDIR) src/timedate/$(DEPDIR) src/timesync/$(DEPDIR) src/tmpfiles/$(DEPDIR) src/tty-ask-password-agent/$(DEPDIR) src/udev/$(DEPDIR) src/udev/accelerometer/$(DEPDIR) src/udev/ata_id/$(DEPDIR) src/udev/cdrom_id/$(DEPDIR) src/udev/collect/$(DEPDIR) src/udev/mtd_probe/$(DEPDIR) src/udev/net/$(DEPDIR) src/udev/scsi_id/$(DEPDIR) src/udev/v4l_id/$(DEPDIR) src/update-done/$(DEPDIR) src/update-utmp/$(DEPDIR) src/vconsole/$(DEPDIR) + -rm -rf ./$(DEPDIR) src/ac-power/$(DEPDIR) src/activate/$(DEPDIR) src/analyze/$(DEPDIR) src/ask-password/$(DEPDIR) src/backlight/$(DEPDIR) src/binfmt/$(DEPDIR) src/boot/$(DEPDIR) src/bootchart/$(DEPDIR) src/bus-proxyd/$(DEPDIR) src/cgls/$(DEPDIR) src/cgroups-agent/$(DEPDIR) src/cgtop/$(DEPDIR) src/console/$(DEPDIR) src/core/$(DEPDIR) src/cryptsetup/$(DEPDIR) src/dbus1-generator/$(DEPDIR) src/debug-generator/$(DEPDIR) src/delta/$(DEPDIR) src/detect-virt/$(DEPDIR) src/efi-boot-generator/$(DEPDIR) src/escape/$(DEPDIR) src/firstboot/$(DEPDIR) src/fsck/$(DEPDIR) src/fstab-generator/$(DEPDIR) src/getty-generator/$(DEPDIR) src/gpt-auto-generator/$(DEPDIR) src/gudev/$(DEPDIR) src/hibernate-resume/$(DEPDIR) src/hostname/$(DEPDIR) src/hwdb/$(DEPDIR) src/import/$(DEPDIR) src/initctl/$(DEPDIR) src/journal-remote/$(DEPDIR) src/journal/$(DEPDIR) src/libsystemd-network/$(DEPDIR) src/libsystemd-terminal/$(DEPDIR) src/libsystemd/sd-bus/$(DEPDIR) src/libsystemd/sd-daemon/$(DEPDIR) src/libsystemd/sd-event/$(DEPDIR) src/libsystemd/sd-hwdb/$(DEPDIR) src/libsystemd/sd-id128/$(DEPDIR) src/libsystemd/sd-login/$(DEPDIR) src/libsystemd/sd-network/$(DEPDIR) src/libsystemd/sd-path/$(DEPDIR) src/libsystemd/sd-resolve/$(DEPDIR) src/libsystemd/sd-rtnl/$(DEPDIR) src/libsystemd/sd-utf8/$(DEPDIR) src/libudev/$(DEPDIR) src/locale/$(DEPDIR) src/login/$(DEPDIR) src/machine-id-commit/$(DEPDIR) src/machine-id-setup/$(DEPDIR) src/machine/$(DEPDIR) src/modules-load/$(DEPDIR) src/network/$(DEPDIR) src/notify/$(DEPDIR) src/nspawn/$(DEPDIR) src/nss-myhostname/$(DEPDIR) src/nss-mymachines/$(DEPDIR) src/nss-resolve/$(DEPDIR) src/path/$(DEPDIR) src/python-systemd/$(DEPDIR) src/quotacheck/$(DEPDIR) src/random-seed/$(DEPDIR) src/rc-local-generator/$(DEPDIR) src/remount-fs/$(DEPDIR) src/reply-password/$(DEPDIR) src/resolve-host/$(DEPDIR) src/resolve/$(DEPDIR) src/rfkill/$(DEPDIR) src/run/$(DEPDIR) src/shared/$(DEPDIR) src/shutdownd/$(DEPDIR) src/sleep/$(DEPDIR) src/socket-proxy/$(DEPDIR) src/sysctl/$(DEPDIR) src/system-update-generator/$(DEPDIR) src/systemctl/$(DEPDIR) src/sysusers/$(DEPDIR) src/sysv-generator/$(DEPDIR) src/test/$(DEPDIR) src/timedate/$(DEPDIR) src/timesync/$(DEPDIR) src/tmpfiles/$(DEPDIR) src/tty-ask-password-agent/$(DEPDIR) src/udev/$(DEPDIR) src/udev/accelerometer/$(DEPDIR) src/udev/ata_id/$(DEPDIR) src/udev/cdrom_id/$(DEPDIR) src/udev/collect/$(DEPDIR) src/udev/mtd_probe/$(DEPDIR) src/udev/net/$(DEPDIR) src/udev/scsi_id/$(DEPDIR) src/udev/v4l_id/$(DEPDIR) src/update-done/$(DEPDIR) src/update-utmp/$(DEPDIR) src/vconsole/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -19361,11 +20645,12 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_bashcompletionDATA \ uninstall-dist_kernelinstallSCRIPTS uninstall-dist_networkDATA \ uninstall-dist_pamconfDATA uninstall-dist_pkgdataDATA \ uninstall-dist_pkgpyexecPYTHON uninstall-dist_pkgsysconfDATA \ - uninstall-dist_sysctlDATA uninstall-dist_systempresetDATA \ - uninstall-dist_systemunitDATA uninstall-dist_sysusersDATA \ - uninstall-dist_tmpfilesDATA uninstall-dist_udevconfDATA \ - uninstall-dist_udevhwdbDATA uninstall-dist_udevrulesDATA \ - uninstall-dist_userunitDATA uninstall-dist_zshcompletionDATA \ + uninstall-dist_rootlibexecDATA uninstall-dist_sysctlDATA \ + uninstall-dist_systempresetDATA uninstall-dist_systemunitDATA \ + uninstall-dist_sysusersDATA uninstall-dist_tmpfilesDATA \ + uninstall-dist_udevconfDATA uninstall-dist_udevhwdbDATA \ + uninstall-dist_udevrulesDATA uninstall-dist_userunitDATA \ + uninstall-dist_xinitrcSCRIPTS uninstall-dist_zshcompletionDATA \ uninstall-girDATA uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-libgudev_includeHEADERS \ uninstall-man uninstall-nodist_bashcompletionDATA \ @@ -19375,13 +20660,12 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_bashcompletionDATA \ uninstall-nodist_sysusersDATA uninstall-nodist_tmpfilesDATA \ uninstall-nodist_udevrulesDATA uninstall-nodist_userunitDATA \ uninstall-nodist_zshcompletionDATA uninstall-pamlibLTLIBRARIES \ - uninstall-pkgconfigdataDATA uninstall-pkgconfiglibDATA \ - uninstall-pkgincludeHEADERS uninstall-pkgpyexecLTLIBRARIES \ - uninstall-rootbinPROGRAMS uninstall-rootlibexecPROGRAMS \ - uninstall-sharepkgconfigDATA uninstall-sysctlDATA \ - uninstall-systemgeneratorPROGRAMS uninstall-sysvinitDATA \ - uninstall-typelibsDATA uninstall-udevlibexecPROGRAMS \ - uninstall-varlogDATA + uninstall-pkgconfiglibDATA uninstall-pkgincludeHEADERS \ + uninstall-pkgpyexecLTLIBRARIES uninstall-rootbinPROGRAMS \ + uninstall-rootlibexecPROGRAMS uninstall-sharepkgconfigDATA \ + uninstall-sysctlDATA uninstall-systemgeneratorPROGRAMS \ + uninstall-sysvinitDATA uninstall-typelibsDATA \ + uninstall-udevlibexecPROGRAMS uninstall-varlogDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ @@ -19413,11 +20697,12 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ install-dist_kernelinstallSCRIPTS install-dist_networkDATA \ install-dist_pamconfDATA install-dist_pkgdataDATA \ install-dist_pkgpyexecPYTHON install-dist_pkgsysconfDATA \ - install-dist_sysctlDATA install-dist_systempresetDATA \ - install-dist_systemunitDATA install-dist_sysusersDATA \ - install-dist_tmpfilesDATA install-dist_udevconfDATA \ - install-dist_udevhwdbDATA install-dist_udevrulesDATA \ - install-dist_userunitDATA install-dist_zshcompletionDATA \ + install-dist_rootlibexecDATA install-dist_sysctlDATA \ + install-dist_systempresetDATA install-dist_systemunitDATA \ + install-dist_sysusersDATA install-dist_tmpfilesDATA \ + install-dist_udevconfDATA install-dist_udevhwdbDATA \ + install-dist_udevrulesDATA install-dist_userunitDATA \ + install-dist_xinitrcSCRIPTS install-dist_zshcompletionDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-exec-hook install-girDATA install-html install-html-am \ install-includeHEADERS install-info install-info-am \ @@ -19429,11 +20714,11 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ install-nodist_sysusersDATA install-nodist_tmpfilesDATA \ install-nodist_udevrulesDATA install-nodist_userunitDATA \ install-nodist_zshcompletionDATA install-pamlibLTLIBRARIES \ - install-pdf install-pdf-am install-pkgconfigdataDATA \ - install-pkgconfiglibDATA install-pkgincludeHEADERS \ - install-pkgpyexecLTLIBRARIES install-ps install-ps-am \ - install-rootbinPROGRAMS install-rootlibexecPROGRAMS \ - install-sharepkgconfigDATA install-strip install-sysctlDATA \ + install-pdf install-pdf-am install-pkgconfiglibDATA \ + install-pkgincludeHEADERS install-pkgpyexecLTLIBRARIES \ + install-ps install-ps-am install-rootbinPROGRAMS \ + install-rootlibexecPROGRAMS install-sharepkgconfigDATA \ + install-strip install-sysctlDATA \ install-systemgeneratorPROGRAMS install-sysvinitDATA \ install-typelibsDATA install-udevlibexecPROGRAMS \ install-varlogDATA installcheck installcheck-am installdirs \ @@ -19449,11 +20734,12 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ uninstall-dist_kernelinstallSCRIPTS uninstall-dist_networkDATA \ uninstall-dist_pamconfDATA uninstall-dist_pkgdataDATA \ uninstall-dist_pkgpyexecPYTHON uninstall-dist_pkgsysconfDATA \ - uninstall-dist_sysctlDATA uninstall-dist_systempresetDATA \ - uninstall-dist_systemunitDATA uninstall-dist_sysusersDATA \ - uninstall-dist_tmpfilesDATA uninstall-dist_udevconfDATA \ - uninstall-dist_udevhwdbDATA uninstall-dist_udevrulesDATA \ - uninstall-dist_userunitDATA uninstall-dist_zshcompletionDATA \ + uninstall-dist_rootlibexecDATA uninstall-dist_sysctlDATA \ + uninstall-dist_systempresetDATA uninstall-dist_systemunitDATA \ + uninstall-dist_sysusersDATA uninstall-dist_tmpfilesDATA \ + uninstall-dist_udevconfDATA uninstall-dist_udevhwdbDATA \ + uninstall-dist_udevrulesDATA uninstall-dist_userunitDATA \ + uninstall-dist_xinitrcSCRIPTS uninstall-dist_zshcompletionDATA \ uninstall-girDATA uninstall-hook uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-libgudev_includeHEADERS \ uninstall-man uninstall-man1 uninstall-man3 uninstall-man5 \ @@ -19465,13 +20751,12 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ uninstall-nodist_sysusersDATA uninstall-nodist_tmpfilesDATA \ uninstall-nodist_udevrulesDATA uninstall-nodist_userunitDATA \ uninstall-nodist_zshcompletionDATA uninstall-pamlibLTLIBRARIES \ - uninstall-pkgconfigdataDATA uninstall-pkgconfiglibDATA \ - uninstall-pkgincludeHEADERS uninstall-pkgpyexecLTLIBRARIES \ - uninstall-rootbinPROGRAMS uninstall-rootlibexecPROGRAMS \ - uninstall-sharepkgconfigDATA uninstall-sysctlDATA \ - uninstall-systemgeneratorPROGRAMS uninstall-sysvinitDATA \ - uninstall-typelibsDATA uninstall-udevlibexecPROGRAMS \ - uninstall-varlogDATA + uninstall-pkgconfiglibDATA uninstall-pkgincludeHEADERS \ + uninstall-pkgpyexecLTLIBRARIES uninstall-rootbinPROGRAMS \ + uninstall-rootlibexecPROGRAMS uninstall-sharepkgconfigDATA \ + uninstall-sysctlDATA uninstall-systemgeneratorPROGRAMS \ + uninstall-sysvinitDATA uninstall-typelibsDATA \ + uninstall-udevlibexecPROGRAMS uninstall-varlogDATA GCC_COLORS ?= 'ooh, shiny!' @@ -19645,12 +20930,14 @@ man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3 man/sd_journal_wait.3: man/sd_journal_get_fd.3 man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3 man/sd_notifyf.3: man/sd_notify.3 +man/sd_pid_notify.3: man/sd_notify.3 +man/sd_pid_notify_with_fds.3: man/sd_notify.3 +man/sd_pid_notifyf.3: man/sd_notify.3 man/sleep.conf.d.5: man/systemd-sleep.conf.5 man/system.conf.d.5: man/systemd-system.conf.5 man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8 man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8 man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8 -man/systemd-firstboot.service.1: man/systemd-firstboot.1 man/systemd-fsck-root.service.8: man/systemd-fsck@.service.8 man/systemd-fsck.8: man/systemd-fsck@.service.8 man/systemd-hibernate-resume.8: man/systemd-hibernate-resume@.service.8 @@ -19903,6 +21190,15 @@ man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html man/sd_notifyf.html: man/sd_notify.html $(html-alias) +man/sd_pid_notify.html: man/sd_notify.html + $(html-alias) + +man/sd_pid_notify_with_fds.html: man/sd_notify.html + $(html-alias) + +man/sd_pid_notifyf.html: man/sd_notify.html + $(html-alias) + man/sleep.conf.d.html: man/systemd-sleep.conf.html $(html-alias) @@ -19918,9 +21214,6 @@ man/systemd-ask-password-wall.path.html: man/systemd-ask-password-console.servic man/systemd-ask-password-wall.service.html: man/systemd-ask-password-console.service.html $(html-alias) -man/systemd-firstboot.service.html: man/systemd-firstboot.html - $(html-alias) - man/systemd-fsck-root.service.html: man/systemd-fsck@.service.html $(html-alias) @@ -20022,6 +21315,9 @@ man/user.conf.d.html: man/systemd-system.conf.html @ENABLE_COREDUMP_TRUE@man/coredump.conf.d.5: man/coredump.conf.5 @ENABLE_COREDUMP_TRUE@man/coredump.conf.d.html: man/coredump.conf.html @ENABLE_COREDUMP_TRUE@ $(html-alias) +@ENABLE_FIRSTBOOT_TRUE@man/systemd-firstboot.service.1: man/systemd-firstboot.1 +@ENABLE_FIRSTBOOT_TRUE@man/systemd-firstboot.service.html: man/systemd-firstboot.html +@ENABLE_FIRSTBOOT_TRUE@ $(html-alias) @ENABLE_HOSTNAMED_TRUE@man/systemd-hostnamed.8: man/systemd-hostnamed.service.8 @ENABLE_HOSTNAMED_TRUE@man/systemd-hostnamed.html: man/systemd-hostnamed.service.html @ENABLE_HOSTNAMED_TRUE@ $(html-alias) @@ -20306,7 +21602,11 @@ man/user.conf.d.html: man/systemd-system.conf.html @ENABLE_LOGIND_TRUE@man/systemd-logind.html: man/systemd-logind.service.html @ENABLE_LOGIND_TRUE@ $(html-alias) +@ENABLE_MACHINED_TRUE@man/libnss_mymachines.so.2.8: man/nss-mymachines.8 @ENABLE_MACHINED_TRUE@man/systemd-machined.8: man/systemd-machined.service.8 +@ENABLE_MACHINED_TRUE@man/libnss_mymachines.so.2.html: man/nss-mymachines.html +@ENABLE_MACHINED_TRUE@ $(html-alias) + @ENABLE_MACHINED_TRUE@man/systemd-machined.html: man/systemd-machined.service.html @ENABLE_MACHINED_TRUE@ $(html-alias) @ENABLE_NETWORKD_TRUE@man/systemd-networkd-wait-online.8: man/systemd-networkd-wait-online.service.8 @@ -20358,6 +21658,9 @@ man/user.conf.d.html: man/systemd-system.conf.html @HAVE_MICROHTTPD_TRUE@man/systemd-journal-gatewayd.socket.html: man/systemd-journal-gatewayd.service.html @HAVE_MICROHTTPD_TRUE@ $(html-alias) +@HAVE_MYHOSTNAME_TRUE@man/libnss_myhostname.so.2.8: man/nss-myhostname.8 +@HAVE_MYHOSTNAME_TRUE@man/libnss_myhostname.so.2.html: man/nss-myhostname.html +@HAVE_MYHOSTNAME_TRUE@ $(html-alias) @HAVE_PAM_TRUE@man/sd_get_machine_names.3: man/sd_get_seats.3 @HAVE_PAM_TRUE@man/sd_get_sessions.3: man/sd_get_seats.3 @HAVE_PAM_TRUE@man/sd_get_uids.3: man/sd_get_seats.3 @@ -20595,7 +21898,7 @@ src/shared/cap-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - $@ src/shared/cap-to-name.h: src/shared/cap-list.txt - $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ + $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@ src/shared/cap-from-name.gperf: src/shared/cap-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ @@ -20662,14 +21965,6 @@ coverage: all @ENABLE_KDBUS_TRUE@dbus1-generator-uninstall-hook: @ENABLE_KDBUS_TRUE@ rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator -bus-proxyd-install-hook: - $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) - $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge - $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge - -bus-proxyd-uninstall-hook: - rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge - @HAVE_SMACK_TRUE@bus-proxyd-set-cap-hook: @HAVE_SMACK_TRUE@ -$(SETCAP) cap_mac_admin+ei $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd @@ -20679,12 +21974,8 @@ libsystemd-install-hook: libsystemd-uninstall-hook: rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so* -.PHONY: update-unifont -update-unifont: tools/compile-unifont.py - $(AM_V_GEN)$(PYTHON) $< \ - <$(top_srcdir)/src/libsystemd-terminal/unifont.hex \ - >$(top_srcdir)/src/libsystemd-terminal/unifont-glyph-array.bin - @echo "unifont-glyph-array.bin has been regenerated" +src/libsystemd-terminal/unifont-glyph-array.bin: tools/compile-unifont.py $(UNIFONT) + $(AM_V_GEN)$(PYTHON) $< <$(UNIFONT) >$@ docs/html/libudev: $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -20716,11 +22007,11 @@ src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt # Update hwdb on installation. Do not bother if installing # in DESTDIR, since this is likely for packaging purposes. -hwdb-update-hook: - -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update +@ENABLE_HWDB_TRUE@hwdb-update-hook: +@ENABLE_HWDB_TRUE@ -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update -hwdb-remove-hook: - -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin +@ENABLE_HWDB_TRUE@hwdb-remove-hook: +@ENABLE_HWDB_TRUE@ -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin # packed sysfs test tree test/sys: @@ -20873,7 +22164,7 @@ units/%: units/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@ -units/user/%: units/%.m4 +units/user/%: units/user/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@ @@ -20928,7 +22219,7 @@ clean-local: $(CLEAN_LOCAL_HOOKS) # # Require python when making dist # -.PHONY: dist-check-python +.PHONY: dist-check-python dist-check-compat-libs dist-check-help dist-check-python: @HAVE_PYTHON_FALSE@ @echo "*** python and python-lxml module must be installed and enabled in order to make dist" @HAVE_PYTHON_FALSE@ @false @@ -20937,6 +22228,14 @@ dist-check-compat-libs: @ENABLE_COMPAT_LIBS_FALSE@ @echo "*** compat-libs must be enabled in order to make dist" @ENABLE_COMPAT_LIBS_FALSE@ @false +dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS) + for i in $(abspath $^); do \ + if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \ + echo "$(basename $$i) --help output is too wide:"; \ + $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \ + exit 1; \ + fi; done + dist: dist-check-python dist-check-compat-libs # check "broken" platforms limited toolchains for link breakage before we release @@ -21069,6 +22368,12 @@ print-%: git-contrib: @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u +list-keys: + gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys + +add-key: + gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import - + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/NEWS b/NEWS index d5ab21a0b..d78874924 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,329 @@ systemd System and Service Manager +CHANGES WITH 219: + + * Introduce a new API "sd-hwdb.h" for querying the hardware + metadata database. With this minimal interface one can query + and enumerate the udev hwdb, decoupled from the old libudev + library. libudev's interface for this is now only a wrapper + around sd-hwdb. A new tool systemd-hwdb has been added to + interface with and update the database. + + * When any of systemd's tools copies files (for example due to + tmpfiles' C lines) a btrfs reflink will attempted first, + before bytewise copying is done. + + * systemd-nspawn gained a new --ephemeral switch. When + specified a btrfs snapshot is taken of the container's root + directory, and immediately removed when the container + terminates again. Thus, a container can be started whose + changes never alter the container's root directory, and are + lost on container termination. This switch can also be used + for starting a container off the root file system of the + host without affecting the host OS. This switch is only + available on btrfs file systems. + + * systemd-nspawn gained a new --template= switch. It takes the + path to a container tree to use as template for the tree + specified via --directory=, should that directory be + missing. This allows instantiating containers dynamically, + on first run. This switch is only available on btrfs file + systems. + + * When a .mount unit refers to a mount point on which multiple + mounts are stacked, and the .mount unit is stopped all of + the stacked mount points will now be unmounted until no + mount point remains. + + * systemd now has an explicit notion of supported and + unsupported unit types. Jobs enqueued for unsupported unit + types will now fail with an "unsupported" error code. More + specifically .swap, .automount and .device units are not + supported in containers, .busname units are not supported on + non-kdbus systems. .swap and .automount are also not + supported if their respective kernel compile time options + are disabled. + + * machinectl gained support for two new "copy-from" and + "copy-to" commands for copying files from a running + container to the host or vice versa. + + * machinectl gained support for a new "bind" command to bind + mount host directories into local containers. This is + currently only supported for nspawn containers. + + * networkd gained support for configuring bridge forwarding + database entries (fdb) from .network files. + + * A new tiny daemon "systemd-importd" has been added that can + download container images in tar, raw, qcow2 or dkr formats, + and make them available locally in /var/lib/machines, so + that they can run as nspawn containers. The daemon can GPG + verify the downloads (not supported for dkr, since it has no + provisions for verifying downloads). It will transparently + decompress bz2, xz, gzip compressed downloads if necessary, + and restore sparse files on disk. The daemon uses privilege + separation to ensure the actual download logic runs with + fewer privileges than the deamon itself. machinectl has + gained new commands "pull-tar", "pull-raw" and "pull-dkr" to + make the functionality of importd available to the + user. With this in place the Fedora and Ubuntu "Cloud" + images can be downloaded and booted as containers unmodified + (the Fedora images lack the appropriate GPG signature files + currently, so they cannot be verified, but this will change + soon, hopefully). Note that downloading images is currently + only fully supported on btrfs. + + * machinectl is now able to list container images found in + /var/lib/machines, along with some metadata about sizes of + disk and similar. If the directory is located on btrfs and + quota is enabled, this includes quota display. A new command + "image-status" has been added that shows additional + information about images. + + * machinectl is now able to clone container images + efficiently, if the underlying file system (btrfs) supports + it, with the new "machinectl list-images" command. It also + gained commands for renaming and removing images, as well as + marking them read-only or read-write (supported also on + legacy file systems). + + * networkd gained support for collecting LLDP network + announcements, from hardware that supports this. This is + shown in networkctl output. + + * systemd-run gained support for a new -t (--pty) switch for + invoking a binary on a pty whose input and output is + connected to the invoking terminal. This allows executing + processes as system services while interactively + communicating with them via the terminal. Most interestingly + this is supported across container boundaries. Invoking + "systemd-run -t /bin/bash" is an alternative to running a + full login session, the difference being that the former + will not register a session, nor go through the PAM session + setup. + + * tmpfiles gained support for a new "v" line type for creating + btrfs subvolumes. If the underlying file system is a legacy + file system, this automatically degrades to creating a + normal directory. Among others /var/lib/machines is now + created like this at boot, should it be missing. + + * The directory /var/lib/containers/ has been deprecated and + been replaced by /var/lib/machines. The term "machines" has + been used in the systemd context as generic term for both + VMs and containers, and hence appears more appropriate for + this, as the directory can also contain raw images bootable + via qemu/kvm. + + * systemd-nspawn when invoked with -M but without --directory= + or --image= is now capable of searching for the container + root directory, subvolume or disk image automatically, in + /var/lib/machines. systemd-nspawn@.service has been updated + to make use of this, thus allowing it to be used for raw + disk images, too. + + * A new machines.target unit has been introduced that is + supposed to group all containers/VMs invoked as services on + the system. systemd-nspawn@.service has been updated to + integrate with that. + + * machinectl gained a new "start" command, for invoking a + container as a service. "machinectl start foo" is mostly + equivalent to "systemctl start systemd-nspawn@foo.service", + but handles escaping in a nicer way. + + * systemd-nspawn will now mount most of the cgroupfs tree + read-only into each container, with the exception of the + container's own subtree in the name=systemd hierarchy. + + * journald now sets the special FS_NOCOW file flag for its + journal files. This should improve performance on btrfs, by + avoiding heavy fragmentation when journald's write-pattern + is used on COW file systems. It degrades btrfs' data + integrity guarantees for the files to the same levels as for + ext3/ext4 however. This should be OK though as journald does + its own data integrity checks and all its objects are + checksummed on disk. Also, journald should handle btrfs disk + full events a lot more gracefully now, by processing SIGBUS + errors, and not relying on fallocate() anymore. + + * When journald detects that journal files it is writing to + have been deleted it will immediately start new journal + files. + + * systemd now provides a way to store file descriptors + per-service in PID 1.This is useful for daemons to ensure + that fds they require are not lost during a daemon + restart. The fds are passed to the deamon on the next + invocation in the same way socket activation fds are + passed. This is now used by journald to ensure that the + various sockets connected to all the system's stdout/stderr + are not lost when journald is restarted. File descriptors + may be stored in PID 1 via the sd_pid_notify_with_fds() API, + an extension to sd_notify(). Note that a limit is enforced + on the number of fds a service can store in PID 1, and it + defaults to 0, so that no fds may be stored, unless this is + explicitly turned on. + + * The default TERM variable to use for units connected to a + terminal, when no other value is explicitly is set is now + vt220 rather than vt102. This should be fairly safe still, + but allows PgUp/PgDn work. + + * The /etc/crypttab option header= as known from Debian is now + supported. + + * "loginctl user-status" and "loginctl session-status" will + now show the last 10 lines of log messages of the + user/session following the status output. Similar, + "machinectl status" will show the last 10 log lines + associated with a virtual machine or container + service. (Note that this is usually not the log messages + done in the VM/container itself, but simply what the + container manager logs. For nspawn this includes all console + output however.) + + * "loginctl session-status" without further argument will now + show the status of the session of the caller. Similar, + "lock-session", "unlock-session", "activate", + "enable-linger", "disable-linger" may now be called without + session/user parameter in which case they apply to the + caller's session/user. + + * An X11 session scriptlet is now shipped that uploads + $DISPLAY and $XAUTHORITY into the environment of the systemd + --user daemon if a session begins. This should improve + compatibility with X11 enabled applications run as systemd + user services. + + * Generators are now subject to masking via /etc and /run, the + same way as unit files. + + * networkd .network files gained support for configuring + per-link IPv4/IPv6 packet forwarding as well as IPv4 + masquerading. This is by default turned on for veth links to + containers, as registered by systemd-nspawn. This means that + nspawn containers run with --network-veth will now get + automatic routed access to the host's networks without any + further configuration or setup, as long as networkd runs on + the host. + + * systemd-nspawn gained the --port= (-p) switch to expose TCP + or UDP posts of a container on the host. With this in place + it is possible to run containers with private veth links + (--network-veth), and have their functionality exposed on + the host as if their services were running directly on the + host. + + * systemd-nspawn's --network-veth switch now gained a short + version "-n", since with the changes above it is now truly + useful out-of-the-box. The systemd-nspawn@.service has been + updated to make use of it too by default. + + * systemd-nspawn will now maintain a per-image R/W lock, to + ensure that the same image is not started more than once + writable. (It's OK to run an image multiple times + simultaneously in read-only mode.) + + * systemd-nspawn's --image= option is now capable of + dissecting and booting MBR and GPT disk images that contain + only a single active Linux partition. Previously it + supported only GPT disk images with proper GPT type + IDs. This allows running cloud images from major + distributions directly with systemd-nspawn, without + modification. + + * In addition to collecting mouse dpi data in the udev + hardware database, there's now support for collecting angle + information for mouse scroll wheels. The database is + supposed to guarantee similar scrolling behavior on mice + that it knows about. There's also support for collecting + information about Touchpad types. + + * udev's input_id built-in will now also collect touch screen + dimension data and attach it to probed devices. + + * /etc/os-release gained support for a Distribution Privacy + Policy link field. + + * networkd gained support for creating "ipvlan", "gretap", + "ip6gre", "ip6gretap" and "ip6tnl" network devices. + + * systemd-tmpfiles gained support for "a" lines for setting + ACLs on files. + + * systemd-nspawn will now mount /tmp in the container to + tmpfs, automatically. + + * systemd now exposes the memory.usage_in_bytes cgroup + attribute and shows it for each service in the "systemctl + status" output, if available. + + * When the user presses Ctrl-Alt-Del more than 7x within 2s an + immediate reboot is triggered. This useful if shutdown is + hung and is unable to complete, to expedite the + operation. Note that this kind of reboot will still unmount + all file systems, and hence should not result in fsck being + run on next reboot. + + * A .device unit for an optical block device will now be + considered active only when a medium is in the drive. Also, + mount units are now bound to their backing devices thus + triggering automatic unmounting when devices become + unavailable. With this in place systemd will now + automatically unmount left-over mounts when a CD-ROM is + ejected or an USB stick is yanked from the system. + + * networkd-wait-online now has support for waiting for + specific interfaces only (with globbing), and for giving up + after a configurable timeout. + + * networkd now exits when idle. It will be automatically + restarted as soon as interfaces show up, are removed or + change state. networkd will stay around as long as there is + at least one DHCP state machine or similar around, that keep + it non-idle. + + * networkd may now configure IPv6 link-local addressing in + addition to IPv4 link-local addressing. + + * The IPv6 "token" for use in SLAAC may now be configured for + each .network interface in networkd. + + * Routes configured with networkd may now be assigned a scope + in .network files. + + * networkd's [Match] sections now support globbing and lists + of multiple space-separated matches per item. + + Contributions from: Alban Crequy, Alin Rauta, Andrey Chaser, + Bastien Nocera, Bruno Bottazzini, Carlos Garnacho, Carlos + Morata Castillo, Chris Atkinson, Chris J. Arges, Christian + Kirbach, Christian Seiler, Christoph Brill, Colin Guthrie, + Colin Walters, Cristian Rodríguez, Daniele Medri, Daniel Mack, + Dave Reisner, David Herrmann, Djalal Harouni, Erik Auerswald, + Filipe Brandenburger, Frank Theile, Gabor Kelemen, Gabriel de + Perthuis, Harald Hoyer, Hui Wang, Ivan Shapovalov, Jan + Engelhardt, Jan Synacek, Jay Faulkner, Johannes Hölzl, Jonas + Ådahl, Jonathan Boulle, Josef Andersson, Kay Sievers, Ken + Werner, Lennart Poettering, Lucas De Marchi, Lukas Märdian, + Lukas Nykryn, Lukasz Skalski, Luke Shumaker, Mantas Mikulėnas, + Manuel Mendez, Marcel Holtmann, Marc Schmitzer, Marko + Myllynen, Martin Pitt, Maxim Mikityanskiy, Michael Biebl, + Michael Marineau, Michael Olbrich, Michal Schmidt, Mindaugas + Baranauskas, Moez Bouhlel, Naveen Kumar, Patrik Flykt, Paul + Martin, Peter Hutterer, Peter Mattern, Philippe De Swert, + Piotr Drąg, Rafael Ferreira, Rami Rosen, Robert Milasan, Ronny + Chevalier, Sangjung Woo, Sebastien Bacher, Sergey Ptashnick, + Shawn Landden, Stéphane Graber, Susant Sahani, Sylvain + Plantefève, Thomas Hindoe Paaboel Andersen, Tim JP, Tom + Gundersen, Topi Miettinen, Torstein Husebø, Umut Tezduyar + Lindskog, Veres Lajos, Vincent Batts, WaLyong Cho, Wieland + Hoffmann, Zbigniew Jędrzejewski-Szmek + + -- Berlin, 2015-02-16 + CHANGES WITH 218: * When querying unit file enablement status (for example via @@ -985,7 +1309,7 @@ CHANGES WITH 214: fact that many distributions only ship a very small number of LSB/SysV init scripts nowadays. - * Priviliged Xen (dom0) domains are not considered + * Privileged Xen (dom0) domains are not considered virtualization anymore by the virtualization detection logic. After all, they generally have unrestricted access to the hardware and usually are used to manage the unprivileged @@ -2048,8 +2372,8 @@ CHANGES WITH 208: * The memory.use_hierarchy cgroup attribute is now enabled for all cgroups systemd creates in the memory cgroup hierarchy. This option is likely to be come the built-in - default in the kernel anyway, and the non-hierarchial mode - never made much sense in the intrinsically hierarchial + default in the kernel anyway, and the non-hierarchical mode + never made much sense in the intrinsically hierarchical cgroup system. * A new field _SYSTEMD_SLICE= is logged along with all journal @@ -2309,7 +2633,7 @@ CHANGES WITH 205: together, or apply resource limits on them. Slice units may be used to partition system resources in an - hierarchial fashion and then assign other units to them. By + hierarchical fashion and then assign other units to them. By default there are now three slices: system.slice (for all system services), user.slice (for all user sessions), machine.slice (for VMs and containers). @@ -3555,7 +3879,7 @@ CHANGES WITH 190: keys all the time, even in graphical sessions. If DEs want to handle these events on their own they should take the new handle-power-key, handle-sleep-key and handle-lid-switch - inhibitors during their runtime. A simple way to achiveve + inhibitors during their runtime. A simple way to achieve that is to invoke the DE wrapped in an invocation of: systemd-inhibit --what=handle-power-key:handle-sleep-key:handle-lid-switch ... diff --git a/README b/README index 9c80a56d8..c72209262 100644 --- a/README +++ b/README @@ -68,8 +68,11 @@ REQUIREMENTS: create additional symlinks in /dev/disk/ and /dev/tape: CONFIG_BLK_DEV_BSG - Required for PrivateNetwork in service units: + Required for PrivateNetwork and PrivateDevices in service units: CONFIG_NET_NS + CONFIG_DEVPTS_MULTIPLE_INSTANCES + Note that systemd-localed.service and other systemd units use + PrivateNetwork and PrivateDevices so this is effectively required. Optional but strongly recommended: CONFIG_IPV6 @@ -111,7 +114,7 @@ REQUIREMENTS: libcap libmount >= 2.20 (from util-linux) libseccomp >= 1.0.0 (optional) - libblkid >= 2.20 (from util-linux) (optional) + libblkid >= 2.24 (from util-linux) (optional) libkmod >= 15 (optional) PAM >= 1.1.2 (optional) libcryptsetup (optional) @@ -175,14 +178,9 @@ USERS AND GROUPS: During runtime, the journal daemon requires the "systemd-journal" system group to exist. New journal files will be readable by this group (but not writable), which may be used - to grant specific users read access. - - It is also recommended to grant read access to all journal - files to the system groups "wheel" and "adm" with a command - like the following in the post installation script of the - package: - - # setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ + to grant specific users read access. In addition, system + groups "wheel" and "adm" will be given read-only access to + journal files using systemd-tmpfiles.service. The journal gateway daemon requires the "systemd-journal-gateway" system user and group to diff --git a/TODO b/TODO index af7bdefc4..255a4f2d0 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,6 @@ Bugfixes: automount points even when the original .automount file did not exist anymore. Only the .mount unit was still around. -* properly handle .mount unit state tracking when two mount points are stacked one on top of another on the exact same mount point. - * ExecStart with unicode characters fails in strv_split_quoted: [Service] @@ -18,12 +16,13 @@ Bugfixes: str_split_quoted() should return a real return code, so spawn_child can report the failure properly. +* When systemctl --host is used, underlying ssh connection can remain open. + bus_close does not kill children? + External: * Fedora: add an rpmlint check that verifies that all unit files in the RPM are listed in %systemd_post macros. -* Fedora: post FPC ticket to move add %tmpfiles_create to the packaging guidelines - * Fedora: move kernel image to /usr/lib/modules/, kernel-install will take care of populating /boot * Fedora: remove /etc/resolv.conf tmpfiles hack @@ -35,13 +34,140 @@ External: Features: -* port libmount hookup to use API's own inotify interface, as soon as that is table in libmount +* journalctl --verify: don't show files that are currently being + written to as FAIL, but instead show that their are being written + to. + +* nspawn: allow configuring cgroup (and other) properties via + --property= when invoking from the command line. + +* add udev rule construct SYSCTL{} to write to sysctls + +* assign MESSAGE_ID to log messages about failed services + +* coredump: make the handler check /proc/$PID/rlimits for RLIMIT_CORE, + and supress coredump if turned off. Then change RLIMIT_CORE to + infinity by default for all services. This then allows per-service + control of coredumping. + +* introduce some call that iterates through cmsg and closes all fds + passed in, and use it everywhere... + +* generate better errors when people try to set transient properties + that are not supported... + http://lists.freedesktop.org/archives/systemd-devel/2015-February/028076.html + +* nspawn, if stdout/stderr/stdin are non-ttys, don't set up + /dev/console, but instead just pass the fds through directly. + +* When runlevel3.target is used to define dependencies on other units, + then we don't pick it up currently, since nothing ever references + runlevel3.target, and never figure out it actually is just an alias + for multi-user.target. A hackish fix could be to add a .wants link + from multi-user.target to runlevel3.target, if it is a symlink to + it. Best would be to create this .wants/ symlink from + sysv-generator. systemd would then load the referenced unit, figure + out it is just an alias and that the dependency would be on itself + and suppress it. Thus the alias and its deps would be loaded as + desired. + +* PID 1: when invoking systemctl preset-all on first boots, operate in + an exclusively additive way, i.e. never remove any pre-existing + symlinks, only add new ones. + +* Introduce $LISTEN_NAMES to complement $LISTEN_FDS, containing a + colon separated list of identifiers for the fds passed. + +* networkd: implement BindCarrier= logic to .network units that binds + application of the file to the carrier sense on another interface, + in order to implement uplink/downlink logic. + +* make networkd subscribe to PrepareForSleep(false) and refresh all + DHCP leases then. + +* when the fstab-generator runs in the initrd, it should create a /dev/null mask for systemd-fsck-root.service, to avoid that the the root fs is fsck'ed twice. + +* maybe introduce WantsMountsFor=? Usecase: + http://lists.freedesktop.org/archives/systemd-devel/2015-January/027729.html + +* rework kexec logic to use new kexec_file_load() syscall, so that we + don't have to call kexec tool anymore. + +* The udev blkid built-in should expose a property that reflects + whether media was sensed in USB CF/SD card readers. This should then + be used to control SYSTEMD_READY=1/0 so that USB card readers aren't + picked up by systemd unless they contain a medium. This would mirror + the behaviour we already have for CD drives. + +* We should remove really old cruft from cdrom_id + +* nspawn: emulate /dev/kmsg using CUSE and turn off the syslog syscall + with seccomp. That should provide us with a useful log buffer that + systemd can log to during early boot, and disconnect container logs + from the kernel's logs. + +* networkd/udev: implement SR_IOV configuration in .link files: + http://lists.freedesktop.org/archives/systemd-devel/2015-January/027451.html + +* When RLIMIT_NPROC is set from a unit file it currently always is set + for root, not for the user set in User=, which makes it + useless. After fixing this, set RLIMIT_NPROC for + systemd-journal-xyz, and all other of our services that run under + their own user ids, and use User= (but only in a world where userns + is ubiquitous since otherwise we cannot invoke those daemons on the + host AND in a container anymore). Also, if LimitNPROC= is used + without User= we should warn and refuse operation. + +* logind: maybe allow configuration of the StopTimeout for session scopes + +* Set NoNewPriviliges= on all of our own services, where that makes sense + +* Rework systemctl's GetAll property parsing to use the generic bus_map_all_properties() API -* bash completion for busctl, to make it truly useful +* rework journald sigbus stuff to use mutex -* journald: broken file systems are real (btrfs), we need to handle - SIGBUS in some way if we cannot write or read from the disk. - https://bugzilla.redhat.com/show_bug.cgi?id=1151848 +* import-dkr: support tarsum checksum verification, if it becomes reality one day... + +* import-dkr: convert json bits to nspawn configuration + +* import: support import from local files, and export to local files + +* core/cgroup: support net_cls modules, and support automatically allocating class ids, then add support for making firewall changes depending on it, to implement a per-service firewall + +* introduce systemd-nspawn-ephemeral@.service, and hook it into "machinectl start" with a new --ephemeral switch + +* logind,machined: add generic catch-all polkit verbs for most privileged operations, similar to systemd itself + +* "machinectl status" should also show internal logs of the container in question + +* "machinectl list-images" should show os-release data, as well as machine-info data (including deployment level) + +* nspawn: when start a container "foobar" look for its configuration in a file "foobar.nspawn" in /etc/systemd/nspawn/ as well as next to the actualy directory or image to boot + +* Port various tools to make use of verbs.[ch], where applicable + +* "machinectl history" + +* "machinectl diff" + +* "machinectl commit" that takes a writable snapshot of a tree, invokes a shell in it, and marks it read-only after use + +* "machinectl status" should show 10 most recent log lines of both the host logs of the unit of the machine, plus the logs generated in the machine + +* add transparent btrfs pool in a loopback file in /var if btrfs operations (such as systemd-import pull-dkr) are used and /var is not a btrfs file system + +* systemd-nspawn -x should support ephemeral instances of gpt images + +* move machinectl's mount and copy commands into machined + +* hostnamectl: show root image uuid + +* sysfs set api in libudev is not const + +* Find a solution for SMACK capabilities stuff: + http://lists.freedesktop.org/archives/systemd-devel/2014-December/026188.html + +* port libmount hookup to use API's own inotify interface, as soon as that is table in libmount * "systemctl preset-all" should probably order the unit files it operates on lexicographically before starting to work, in order to @@ -54,7 +180,7 @@ Features: * systemd-journal-upload (or a new, related tool): allow pushing out journal messages onto the network in BSD syslog protocol, - continously. Default to some link-local IP mcast group, to make this + continuously. Default to some link-local IP mcast group, to make this useful as a one-stop debugging tool. * synchronize console access with BSD locks: @@ -74,10 +200,6 @@ Features: * timedated should compensate on SetTime for the time spent in polkit -* figure out what to do with libmount and utab? - -* We really should have a FOREACH macro to iterate through inotify events we read, similar to KDBUS_FOREACH_ITEM - * figure out when we can use the coarse timers * sd-resolve: drop res_query wrapping, people should call via the bus to resolved instead @@ -91,8 +213,6 @@ Features: * timesyncd + resolved: add ugly bus calls to set NTP and DNS servers per-interface, for usage by NM -* networkd-wait-online really should have a timeout by default - * add infrastructure to allocate dynamic/transient users and UID ranges, for use in user-namespaced containers, per-seat gdm login screens and gdm guest sessions * machined: add an API so that libvirt-lxc can inform us about network interfaces being removed or added to an existing machine @@ -105,8 +225,6 @@ Features: * systemd --user should issue sd_notify() upon reaching basic.target, not on becoming idle -* configure.ac pretends dbus was optional but actually hardcodes use of dbus' pkg-config file to determine various dbus dirs such as policy and activation dirs - * consider showing the unit names during boot up in the status output, not just the unit descriptions * dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from? @@ -128,7 +246,10 @@ Features: * systemctl: if some operation fails, show log output? -* systemctl edit: add commented help text to the end, like git commit +* systemctl edit: +- allow creation of units from scratch +- use equvalent of cat() to insert existing config as a comment, prepended with #. + Upon editor exit, lines with one # are removed, lines with two # are left with one #, etc. * refcounting in sd-resolve is borked @@ -164,6 +285,7 @@ Features: for all routes to it. possibly a second default for DHCP routes. - allow Name= to be specified repeatedly in the [Match] section. Maybe also support Name=foo*|bar*|baz ? + - duplicate address check for static IPs (like ARPCHECK in network-scripts) * resolved: - put networkd events and rtnl events at a higher priority, so that @@ -249,9 +371,6 @@ Features: desktop UIs such as gnome-shell to freeze apps that are not visible on screen, not unlike how job control works on the shell -* completions: - - manager property enumeration was broken when systemd moved to /usr/lib/ - * cgroups: - implement per-slice CPUFairScheduling=1 switch - handle jointly mounted controllers correctly @@ -300,21 +419,12 @@ Features: ReadOnlyDirectories=... for whitelisting files for a service. * sd-bus: + - GetAllProperties() on a non-existing object does not result in a failure currently - kdbus: process fd=-1 for incoming msgs - - make dsrt happy, and change userspace header for kdbus to yyyyuta{tv}v - - kdbus: remove NameOwnerChanged kernel messages for monitors - - kdbus: PID/TID goes missing for method calls from outside the PID namespace? - - kdbus: the kernel should not allow messages to be delivered that have a reply serial != 0, reply-expect unset, but no appropriate window - - kdbus: timestamps on kernel's NameOwnerChanged messages? - - kdbus' busnames.target should get pulled in by basic.target - - Ignore .busname units on classic D-Bus boots, systemd-resolved cannot be started on kdbus - without the active policy and should get a Wants=org.freedesktop.resolve1.busname to - pull-in the policy. - port to sd-resolve for connecting to TCP dbus servers - - kdbus: maybe add controlling tty and ppid metadata fields + - kdbus: maybe add controlling tty metadata fields - see if we can introduce a new sd_bus_get_owner_machine_id() call to retrieve the machine ID of the machine of the bus itself - when kdbus does not take our message without memfds, try again with memfds - - introduce sd_bus_emit_object_added()/sd_bus_emit_object_removed() that automatically includes the build-in interfaces in the list - see if we can drop more message validation on the sending side - add API to clone sd_bus_message objects - make AddMatch calls on dbus1 transports async? @@ -369,9 +479,6 @@ Features: * teach ConditionKernelCommandLine= globs or regexes (in order to match foobar={no,0,off}) -* after all byte-wise realloc() is slow, even on glibc, so i guess we - need manual exponential loops after all - * BootLoaderSpec: Clarify that the kernel has to be in $BOOT. Clarify that the boot loader should be installed to the ESP. Define a way how an installer can figure out whether a BLS compliant boot loader @@ -464,11 +571,11 @@ Features: - journal: add a setgid "systemd-journal" utility to invoke from libsystemd-journal, which passes fds via STDOUT and does PK access - journactl: support negative filtering, i.e. FOOBAR!="waldo", and !FOOBAR for events without FOOBAR. - - journal: send out marker messages every now and then, and immediately sync with fdatasync() afterwards, in order to have hourly guaranteed syncs. + - journal: store timestamp of journal_file_set_offline() int he header, + so it is possible to display when the file was last synced. - journal-send.c, log.c: when the log socket is clogged, and we drop, count this and write a message about this when it gets unclogged again. - journal: find a way to allow dropping history early, based on priority, other rules - journal: When used on NFS, check payload hashes - - journal live copy, based on libneon (client) and libmicrohttpd (server) - journald: add kernel cmdline option to disable ratelimiting for debug purposes - refuse taking lower-case variable names in sd_journal_send() and friends. - journald: we currently rotate only after MaxUse+MaxFilesize has been reached. @@ -561,12 +668,7 @@ Features: * currently x-systemd.timeout is lost in the initrd, since crypttab is copied into dracut, but fstab is not * nspawn: - - bind mount read-only the cgroup tree higher than nspawn - refuses to boot containers without /etc/machine-id (OK?), and with empty /etc/machine-id (not OK). - - support taking a btrfs snapshot at startup and dropping it afterwards - - introduce machines.target to order after all nspawn instances - - systemd-nspawn@.service should fail if some nspawn arg is invalid, with Type=notify - - PID 1 doesn't apply nspawns devices cgroup policy * cryptsetup: - cryptsetup-generator: allow specification of passwords in crypttab itself @@ -629,6 +731,7 @@ Features: - kill scsi_id - add trigger --subsystem-match=usb/usb_device device - reimport udev db after MOVE events for devices without dev_t + - don't keep stale db in case event processing fails (also notify userspace about the failure) * when a service has the same env var set twice we actually store it twice and return that in systemctl show -p... We should only show the last setting @@ -653,6 +756,8 @@ Features: * tmpfiles: - apply "x" on "D" too (see patch from William Douglas) + - replace F with f+. + - instead of ignoring unknown fields, reject them. * for services: do not set $HOME in services unless requested @@ -763,7 +868,6 @@ Features: - write more test cases - implement and do duplicate address detection, see rfc 4862, 5.4. - implement reconfigure support, see 5.3., 15.11. and 22.20. - - implement information request, see 1.2. and 18.1.5. - implement support for temporary adressess (IA_TA) - implement dhcpv6 authentication - investigate the usefulness of Confirm messages; i.e. are there any diff --git a/catalog/systemd.catalog b/catalog/systemd.catalog index 3c2fe644e..4488c835a 100644 --- a/catalog/systemd.catalog +++ b/catalog/systemd.catalog @@ -23,15 +23,15 @@ # For an explanation why we do all this, see https://xkcd.com/1024/ -- f77379a8490b408bbe5f6940505a777b -Subject: The Journal has been started +Subject: The journal has been started Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -The system journal process has been starting up, opened the journal +The system journal process has started up, opened the journal files for writing and is now ready to process requests. -- d93fb3c9c24d451a97cea615ce59c00b -Subject: The Journal has been stopped +Subject: The journal has been stopped Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -50,8 +50,8 @@ from the service have been dropped. Note that only messages from the service in question have been dropped, other services' messages are unaffected. -The limits when messages are dropped may be configured with -RateLimitInterval= and RateLimitBurst= in +The limits controlling when messages are dropped may be configured +with RateLimitInterval= and RateLimitBurst= in /etc/systemd/journald.conf. See journald.conf(5) for details. -- e9bf28e6e834481bb6f48f548ad13606 @@ -96,7 +96,7 @@ A new session with the ID @SESSION_ID@ has been created for the user @USER_ID@. The leading process of the session is @LEADER@. -- 3354939424b4456d9802ca8333ed424a -Subject: A session @SESSION_ID@ has been terminated +Subject: Session @SESSION_ID@ has been terminated Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat @@ -112,7 +112,7 @@ Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat A new seat @SEAT_ID@ has been configured and is now available. -- e7852bfe46784ed0accde04bc864c2d5 -Subject: A seat @SEAT_ID@ has now been removed +Subject: Seat @SEAT_ID@ has now been removed Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat @@ -178,7 +178,7 @@ Systemd shutdown has been initiated. The shutdown has now begun and all system services are terminated and all file systems unmounted. -- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Unit @UNIT@ has begun with start-up +Subject: Unit @UNIT@ has begun start-up Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -217,11 +217,11 @@ Unit @UNIT@ has failed. The result is @RESULT@. -- d34d037fff1847e6ae669a370e694725 -Subject: Unit @UNIT@ has begun with reloading its configuration +Subject: Unit @UNIT@ has begun reloading its configuration Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -Unit @UNIT@ has begun with reloading its configuration +Unit @UNIT@ has begun reloading its configuration -- 7b05ebc668384222baa8881179cfda54 Subject: Unit @UNIT@ has finished reloading its configuration @@ -239,7 +239,7 @@ Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel The process @EXECUTABLE@ could not be executed and failed. -The error number returned while executing this process is @ERRNO@. +The error number returned by this process is @ERRNO@. -- 0027229ca0644181a76c4e92458afa2e Subject: One or more messages could not be forwarded to syslog diff --git a/catalog/systemd.fr.catalog b/catalog/systemd.fr.catalog index e9dfca777..03a457786 100644 --- a/catalog/systemd.fr.catalog +++ b/catalog/systemd.fr.catalog @@ -1,7 +1,7 @@ # This file is part of systemd. # # Copyright 2012 Lennart Poettering -# Copyright 2013 Sylvain Plantefève +# Copyright 2013-2015 Sylvain Plantefève # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by @@ -23,7 +23,7 @@ # http://www.freedesktop.org/wiki/Software/systemd/catalog -- f77379a8490b408bbe5f6940505a777b -Subject: Le Journal a été démarré +Subject: Le journal a été démarré Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -31,7 +31,7 @@ Le processus du journal système a démarré, ouvert ses fichiers en écriture et est prêt à traiter les requêtes. -- d93fb3c9c24d451a97cea615ce59c00b -Subject: Le Journal a été arrêté +Subject: Le journal a été arrêté Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -55,7 +55,7 @@ paramètres RateLimitInterval= et RateLimitBurst= dans le fichier /etc/systemd/journald.conf. Voir journald.conf(5) pour plus de détails. -- e9bf28e6e834481bb6f48f548ad13606 -Subject: Des messages du Journal ont été manqués +Subject: Des messages du journal ont été manqués Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel diff --git a/catalog/systemd.pl.catalog b/catalog/systemd.pl.catalog index 0a172a2e3..6b8a31d8c 100644 --- a/catalog/systemd.pl.catalog +++ b/catalog/systemd.pl.catalog @@ -1,7 +1,7 @@ # This file is part of systemd. # # Copyright 2012 Lennart Poettering -# Copyright 2014 Piotr Drąg +# Copyright 2014, 2015 Piotr Drąg # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by @@ -25,7 +25,7 @@ # For an explanation why we do all this, see https://xkcd.com/1024/ -- f77379a8490b408bbe5f6940505a777b -Subject: Uruchomiono Journal +Subject: Uruchomiono dziennik Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -33,7 +33,7 @@ Systemowy proces dziennika został uruchomiony, otworzył pliki dziennika do zapisu i jest gotowy do przetwarzania żądań. -- d93fb3c9c24d451a97cea615ce59c00b -Subject: Zatrzymano Journal +Subject: Zatrzymano dziennik Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -52,12 +52,12 @@ zostały pominięte. Proszę zauważyć, że tylko komunikaty z danej usługi zostały pominięte. Nie ma to wpływu na komunikaty innych usług. -Ograniczenia komunikatów mogą być konfigurowane za pomocą opcji -RateLimitInterval= i RateLimitBurst= w pliku +Ograniczenia kontrolujące pomijanie komunikatów mogą być konfigurowane +za pomocą opcji RateLimitInterval= i RateLimitBurst= w pliku /etc/systemd/journald.conf. Strona journald.conf(5) zawiera więcej informacji. -- e9bf28e6e834481bb6f48f548ad13606 -Subject: Utracono komunikaty Journal +Subject: Utracono komunikaty dziennika Defined-By: systemd Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel @@ -223,7 +223,7 @@ Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel Proces @EXECUTABLE@ nie mógł zostać wykonany i się nie powiódł. -Numer błędu zwrócony podczas wykonywania tego procesu: @ERRNO@. +Numer błędu zwrócony przez ten proces: @ERRNO@. -- 0027229ca0644181a76c4e92458afa2e Subject: Nie można przekazać jednego lub więcej komunikatów do syslog diff --git a/catalog/systemd.pt_BR.catalog b/catalog/systemd.pt_BR.catalog new file mode 100644 index 000000000..d9716e30f --- /dev/null +++ b/catalog/systemd.pt_BR.catalog @@ -0,0 +1,264 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015 Rafael Ferreira (translation) +# +# systemd is free software; you can redistribute it and/or modify it +# 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 . + +# Catálogo de mensagens para as mensagens do próprio systemd + +# O formato do catálogo está documentado em +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# Para uma explicação do porquê de fazermos tudo isso, veja +# https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: O jornal foi inciado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O processo jornal do sistema foi iniciado, arquivos foram abertos e está +pronto para processar requisições. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: O jornal foi interrompido +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O processo do jornal do sistema foi desligado e todos os arquivos de jornal +do sistema foram fechados. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Mensagens de um serviço foram suprimidas +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: man:journald.conf(5) + +Um serviço registrou no log um número excessivo de mensagens dentro de um +período de tempo. Mensagens do serviço foram descartadas. + +Note que apenas mensagens de um serviço em questão foram descartadas; outras +mensagens dos serviços não foram afetadas. + +Os controles de limites de quando as mensagens são descartadas pode ser +configurado com RateLimitInterval= e RateLimitBurst= no +/etc/systemd/journald.conf. Veja journald.conf(5) para detalhes. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Mensagens do jornal foram perdidas +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +Mensagens do kernel foram perdidas pois o sistema do jornal não pôde +processá-las em velocidade suficiente para a demanda. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Processo @COREDUMP_PID@ (@COREDUMP_COMM@) despejou núcleo +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: man:core(5) + +Processo @COREDUMP_PID@ (@COREDUMP_COMM@) travou e despejou o núcleo. + +Isso normalmente indica um erro de programação no programa que travou e +deveria ser relatado para seu fabricante como um erro. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: A nova sessão @SESSION_ID@ foi criada para usuário o @USER_ID@ +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Uma nova sessão com o ID @SESSION_ID@ foi criada para o usuário @USER_ID@. + +O processo originador da sessão é @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Sessão @SESSION_ID@ foi terminada +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um sessão com o ID @SESSION_ID@ foi terminada. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Um novo seat @SEAT_ID@ está disponível +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um novo seat @SEAT_ID@ foi configurado e está disponível. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Seat @SEAT_ID@ foi removido agora +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um seat @SEAT_ID@ foi removido e não está mais disponível. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Time change +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O relógio do sistema foi alterado para @REALTIME@ microssegundos após 1º de +janeiro de 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Fuso horário alterado para @TIMEZONE@ +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O fuso horário do sistema foi alterado para @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Inicialização do sistema foi concluída +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +Todos os serviços do sistema necessários que estão enfileirados para +executar na inicialização do sistema, foram iniciados com sucesso. Note +que isso não significa que a máquina está ociosa, pois os serviços podem +ainda estar ocupados com a inicialização completa. + +Inicialização do kernel precisou @KERNEL_USEC@ microssegundos. + +Disco de RAM inicial precisou de @INITRD_USEC@ microssegundos. + +Inicialização do espaço do usuário precisou de @USERSPACE_USEC@ microssegundos. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Estado de suspensão do sistema @SLEEP@ iniciado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O sistema entrou agora no estado de suspensão @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Estado de suspensão do sistema @SLEEP@ finalizado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O sistema saiu agora do estado de suspensão @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Desligamento do sistema iniciado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +Desligamento do sistema foi inicializado. O desligamento se iniciou e todos +os serviços do sistema foram terminados e todos os sistemas desmontados. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Unidade @UNIT@ sendo iniciado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ está sendo iniciada. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Unidade @UNIT@ concluiu a inicialização +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ concluiu a inicialização. + +The start-up result is @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Unidade @UNIT@ sendo desligado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ está sendo desligada. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: A unidade @UNIT@ concluiu o desligamento +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ concluiu o desligamento. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: A unidade @UNIT@ falhou +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ falhou. + +O resultado é @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Unidade @UNIT@ iniciou recarregamento de sua configuração +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ iniciou o recarregamento de sua configuração. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Unidade @UNIT@ concluiu recarregamento de sua configuração +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A unidade @UNIT@ concluiu o recarregamento de sua configuração. + +O resultado é @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Processo @EXECUTABLE@ não pôde ser executado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O processo @EXECUTABLE@ não pôde ser executado e falhou. + +O número de erro retornado por este processo é @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Uma ou mais mensagens não puderam ser encaminhadas para o syslog +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +Uma ou mais mensagens não puderam ser encaminhadas para o serviço do syslog +em execução paralela ao journald. Isso normalmente indica que a implementação +do syslog não foi capaz de se manter com a velocidade das mensagens +enfileiradas. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Ponto de montagem não está vazio +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +O diretório @WHERE@ está especificado como ponto de montagem (o segundo campo +no /etc/fstab ou campo Where= no arquivo de unidade do systemd) e não está +vazio. Isso não interfere com a montagem, mas os arquivos pré-existentes +neste diretório se tornaram inacessívels. Para ver aqueles arquivos, sobre os +quais foi realizada a montagem, por favor monte manualmente o sistema de +arquivos subjacente para uma localização secundária. + +-- 24d8d4452573402496068381a6312df2 +Subject: Uma máquina virtual ou contêiner foi iniciado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A máquina virtual @NAME@ com seu PID @LEADER@ incial foi iniciada e está +pronto para ser usad. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Uma máquina virtual ou contêiner foi terminado +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel + +A máquina virtual @NAME@ com seu PID @LEADER@ incial foi desligada. diff --git a/config.h.in b/config.h.in index 64fbd1d99..945d07671 100644 --- a/config.h.in +++ b/config.h.in @@ -6,15 +6,21 @@ /* Canonical host string. */ #undef CANONICAL_HOST +/* Default index URL to use for image downloads */ +#undef DEFAULT_DKR_INDEX_URL + /* Default DNS Servers */ #undef DNS_SERVERS +/* Define if hashmap debugging is to be enabled */ +#undef ENABLE_DEBUG_HASHMAP + +/* Define if mmap cache debugging is to be enabled */ +#undef ENABLE_DEBUG_MMAP_CACHE + /* Define if EFI support is to be enabled */ #undef ENABLE_EFI -/* Define if hashmap debugging is to be enabled */ -#undef ENABLE_HASHMAP_DEBUG - /* Define if kdbus support is to be enabled */ #undef ENABLE_KDBUS @@ -45,6 +51,12 @@ /* Define if blkid is available */ #undef HAVE_BLKID +/* Define in BZIP2 is available */ +#undef HAVE_BZIP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_BZLIB_H + /* Define if CHKCONFIG is available */ #undef HAVE_CHKCONFIG @@ -71,10 +83,18 @@ to 0 if you don't. */ #undef HAVE_DECL_IFLA_BRPORT_UNICAST_FLOOD +/* Define to 1 if you have the declaration of `IFLA_INET6_ADDR_GEN_MODE', and + to 0 if you don't. */ +#undef HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE + /* Define to 1 if you have the declaration of `IFLA_IPTUN_6RD_RELAY_PREFIXLEN', and to 0 if you don't. */ #undef HAVE_DECL_IFLA_IPTUN_6RD_RELAY_PREFIXLEN +/* Define to 1 if you have the declaration of `IFLA_IPVLAN_MODE', and to 0 if + you don't. */ +#undef HAVE_DECL_IFLA_IPVLAN_MODE + /* Define to 1 if you have the declaration of `IFLA_MACVLAN_FLAGS', and to 0 if you don't. */ #undef HAVE_DECL_IFLA_MACVLAN_FLAGS @@ -95,6 +115,10 @@ you don't. */ #undef HAVE_DECL_IFLA_VXLAN_LOCAL6 +/* Define to 1 if you have the declaration of `kcmp', and to 0 if you don't. + */ +#undef HAVE_DECL_KCMP + /* Define to 1 if you have the declaration of `LO_FLAGS_PARTSCAN', and to 0 if you don't. */ #undef HAVE_DECL_LO_FLAGS_PARTSCAN @@ -107,6 +131,10 @@ don't. */ #undef HAVE_DECL_PIVOT_ROOT +/* Define to 1 if you have the declaration of `renameat2', and to 0 if you + don't. */ +#undef HAVE_DECL_RENAMEAT2 + /* Define to 1 if you have the declaration of `setns', and to 0 if you don't. */ #undef HAVE_DECL_SETNS @@ -144,6 +172,9 @@ /* Define if IMA is available */ #undef HAVE_IMA +/* Importd support available */ +#undef HAVE_IMPORTD + /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA @@ -168,6 +199,9 @@ /* Define if libidn is available */ #undef HAVE_LIBIDN +/* Define if libiptc is available */ +#undef HAVE_LIBIPTC + /* Define if libmount is available */ #undef HAVE_LIBMOUNT @@ -328,6 +362,9 @@ /* Define if XZ is available */ #undef HAVE_XZ +/* Define if ZLIB is available */ +#undef HAVE_ZLIB + /* Define to 1 if you have the `__secure_getenv' function. */ #undef HAVE___SECURE_GETENV diff --git a/configure b/configure index 1b54b50d8..f11e73a79 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for systemd 218. +# Generated by GNU Autoconf 2.69 for systemd 219. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='systemd' PACKAGE_TARNAME='systemd' -PACKAGE_VERSION='218' -PACKAGE_STRING='systemd 218' +PACKAGE_VERSION='219' +PACKAGE_STRING='systemd 219' PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=systemd' PACKAGE_URL='http://www.freedesktop.org/wiki/Software/systemd' @@ -644,7 +644,6 @@ pamconfdir pamlibdir zshcompletiondir bashcompletiondir -dbusinterfacedir dbussystemservicedir dbussessionservicedir dbuspolicydir @@ -652,6 +651,7 @@ ENABLE_TESTS_FALSE ENABLE_TESTS_TRUE ENABLE_GTK_DOC_TESTS_FALSE ENABLE_GTK_DOC_TESTS_TRUE +DEFAULT_DKR_INDEX_URL TTY_GID HAVE_SYSV_COMPAT_FALSE HAVE_SYSV_COMPAT_TRUE @@ -664,6 +664,8 @@ ENABLE_HIBERNATE_FALSE ENABLE_HIBERNATE_TRUE ENABLE_MANPAGES_FALSE ENABLE_MANPAGES_TRUE +ENABLE_HWDB_FALSE +ENABLE_HWDB_TRUE ENABLE_GUDEV_FALSE ENABLE_GUDEV_TRUE GLIB_LIBS @@ -682,6 +684,7 @@ ENABLE_TERMINAL_FALSE ENABLE_TERMINAL_TRUE TERMINAL_LIBS TERMINAL_CFLAGS +UNIFONT ENABLE_EFI_FALSE ENABLE_EFI_TRUE ENABLE_NETWORKD_FALSE @@ -704,6 +707,8 @@ ENABLE_TIMEDATED_FALSE ENABLE_TIMEDATED_TRUE ENABLE_HOSTNAMED_FALSE ENABLE_HOSTNAMED_TRUE +ENABLE_IMPORTD_FALSE +ENABLE_IMPORTD_TRUE ENABLE_MACHINED_FALSE ENABLE_MACHINED_TRUE ENABLE_LOGIND_FALSE @@ -728,6 +733,10 @@ ENABLE_VCONSOLE_FALSE ENABLE_VCONSOLE_TRUE ENABLE_BINFMT_FALSE ENABLE_BINFMT_TRUE +HAVE_LIBIPTC_FALSE +HAVE_LIBIPTC_TRUE +LIBIPTC_LIBS +LIBIPTC_CFLAGS HAVE_LIBIDN_FALSE HAVE_LIBIDN_TRUE LIBIDN_LIBS @@ -775,6 +784,12 @@ HAVE_COMPRESSION_FALSE HAVE_COMPRESSION_TRUE HAVE_LZ4_FALSE HAVE_LZ4_TRUE +HAVE_BZIP2_FALSE +HAVE_BZIP2_TRUE +HAVE_ZLIB_FALSE +HAVE_ZLIB_TRUE +ZLIB_LIBS +ZLIB_CFLAGS HAVE_XZ_FALSE HAVE_XZ_TRUE XZ_LIBS @@ -878,6 +893,7 @@ GTKDOC_CHECK PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG +SULOGIN KEXEC KMOD KILL @@ -1079,6 +1095,8 @@ with_debug_shell with_debug_tty with_certificate_root enable_xz +enable_zlib +enable_bzip2 enable_lz4 enable_pam enable_acl @@ -1094,6 +1112,7 @@ enable_microhttpd enable_gnutls enable_libcurl enable_libidn +enable_libiptc enable_binfmt enable_vconsole enable_bootchart @@ -1106,6 +1125,7 @@ enable_backlight enable_rfkill enable_logind enable_machined +enable_importd enable_hostnamed enable_timedated enable_timesyncd @@ -1120,6 +1140,7 @@ enable_resolved with_dns_servers enable_networkd enable_efi +with_unifont enable_terminal enable_kdbus with_rc_local_script_path_start @@ -1129,6 +1150,7 @@ with_kbd_setfont with_telinit enable_myhostname enable_gudev +enable_hwdb enable_manpages enable_hibernate enable_ldconfig @@ -1138,7 +1160,6 @@ with_tty_gid with_dbuspolicydir with_dbussessionservicedir with_dbussystemservicedir -with_dbusinterfacedir with_bashcompletiondir with_zshcompletiondir with_rootprefix @@ -1146,8 +1167,9 @@ with_rootlibdir with_pamlibdir with_pamconfdir enable_split_usr +with_dkr_index_url enable_tests -enable_hashmap_debug +enable_debug ' ac_precious_vars='build_alias host_alias @@ -1185,6 +1207,8 @@ APPARMOR_CFLAGS APPARMOR_LIBS XZ_CFLAGS XZ_LIBS +ZLIB_CFLAGS +ZLIB_LIBS LIBCRYPTSETUP_CFLAGS LIBCRYPTSETUP_LIBS QRENCODE_CFLAGS @@ -1197,6 +1221,8 @@ LIBCURL_CFLAGS LIBCURL_LIBS LIBIDN_CFLAGS LIBIDN_LIBS +LIBIPTC_CFLAGS +LIBIPTC_LIBS TERMINAL_CFLAGS TERMINAL_LIBS GLIB_CFLAGS @@ -1741,7 +1767,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures systemd 218 to adapt to many kinds of systems. +\`configure' configures systemd 219 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1811,7 +1837,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemd 218:";; + short | recursive ) echo "Configuration of systemd 219:";; esac cat <<\_ACEOF @@ -1858,6 +1884,8 @@ Optional Features: --disable-selinux Disable optional SELINUX support --disable-apparmor Disable optional AppArmor support --disable-xz Disable optional XZ support + --disable-zlib Disable optional ZLIB support + --enable-bzip2 Disable optional BZIP2 support --enable-lz4 Enable optional LZ4 support --disable-pam Disable optional PAM support --disable-acl Disable optional ACL support @@ -1871,6 +1899,7 @@ Optional Features: --disable-gnutls disable gnutls support --disable-libcurl disable libcurl support --disable-libidn Disable optional LIBIDN support + --disable-libiptc Disable optional LIBIPTC support --disable-binfmt disable binfmt tool --disable-vconsole disable vconsole tool --disable-bootchart disable bootchart tool @@ -1883,6 +1912,7 @@ Optional Features: --disable-rfkill disable rfkill tools --disable-logind disable login daemon --disable-machined disable machine daemon + --disable-importd disable import daemon --disable-hostnamed disable hostname daemon --disable-timedated disable timedate daemon --disable-timesyncd disable timesync daemon @@ -1896,12 +1926,13 @@ Optional Features: --enable-kdbus do connect to kdbus by default --disable-myhostname disable nss-myhostname support --disable-gudev disable Gobject libudev support [default=enabled] + --disable-hwdb disable hardware database support --disable-manpages disable manpages --disable-hibernate disable hibernation support --disable-ldconfig disable ldconfig --enable-split-usr Assume that /bin, /sbin aren\'t symlinks into /usr --disable-tests disable tests - --enable-hashmap-debug enable hashmap debugging + --enable-debug[=LIST] enable extra debugging (hashmap,mmap-cache) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1934,6 +1965,7 @@ Optional Packages: --with-dns-servers=DNSSERVERS Space-separated list of default DNS servers + --with-unifont=PATH Path to unifont.hex --with-rc-local-script-path-start=PATH Path to /etc/rc.local --with-rc-local-script-path-stop=PATH @@ -1955,8 +1987,6 @@ Optional Packages: D-Bus session service directory --with-dbussystemservicedir=DIR D-Bus system service directory - --with-dbusinterfacedir=DIR - D-Bus interface directory --with-bashcompletiondir=DIR Bash completions directory --with-zshcompletiondir=DIR @@ -1966,6 +1996,8 @@ Optional Packages: --with-rootlibdir=DIR Root directory for libraries necessary for boot --with-pamlibdir=DIR Directory for PAM modules --with-pamconfdir=DIR Directory for PAM configuration + --dkr-index-url=URL Specify the default index URL to use for image + downloads Some influential environment variables: CC C compiler command @@ -2020,6 +2052,8 @@ Some influential environment variables: linker flags for APPARMOR, overriding pkg-config XZ_CFLAGS C compiler flags for XZ, overriding pkg-config XZ_LIBS linker flags for XZ, overriding pkg-config + ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config + ZLIB_LIBS linker flags for ZLIB, overriding pkg-config LIBCRYPTSETUP_CFLAGS C compiler flags for LIBCRYPTSETUP, overriding pkg-config LIBCRYPTSETUP_LIBS @@ -2042,6 +2076,10 @@ Some influential environment variables: LIBIDN_CFLAGS C compiler flags for LIBIDN, overriding pkg-config LIBIDN_LIBS linker flags for LIBIDN, overriding pkg-config + LIBIPTC_CFLAGS + C compiler flags for LIBIPTC, overriding pkg-config + LIBIPTC_LIBS + linker flags for LIBIPTC, overriding pkg-config TERMINAL_CFLAGS C compiler flags for TERMINAL, overriding pkg-config TERMINAL_LIBS @@ -2116,7 +2154,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemd configure 218 +systemd configure 219 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2768,7 +2806,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by systemd $as_me 218, which was +It was created by systemd $as_me 219, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -5233,7 +5271,7 @@ fi # Define the identity of the package. PACKAGE='systemd' - VERSION='218' + VERSION='219' cat >>confdefs.h <<_ACEOF @@ -14145,6 +14183,49 @@ fi +# Extract the first word of "sulogin", so it can be a program name with args. +set dummy sulogin; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_SULOGIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $SULOGIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_SULOGIN="$SULOGIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/sbin:/sbin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SULOGIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_SULOGIN" && ac_cv_path_SULOGIN="/usr/sbin/sulogin" + ;; +esac +fi +SULOGIN=$ac_cv_path_SULOGIN +if test -n "$SULOGIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SULOGIN" >&5 +$as_echo "$SULOGIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if ! ln --relative --help > /dev/null 2>&1; then : as_fn_error $? "*** ln doesn't support --relative ***" "$LINENO" 5 fi @@ -16436,6 +16517,44 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETRANDOM $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "renameat2" "ac_cv_have_decl_renameat2" " +#include +#include +#include +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_renameat2" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RENAMEAT2 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "kcmp" "ac_cv_have_decl_kcmp" " +#include +#include +#include +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_kcmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KCMP $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "LO_FLAGS_PARTSCAN" "ac_cv_have_decl_LO_FLAGS_PARTSCAN" " #include #include @@ -16457,6 +16576,27 @@ cat >>confdefs.h <<_ACEOF _ACEOF +ac_fn_c_check_decl "$LINENO" "IFLA_INET6_ADDR_GEN_MODE" "ac_cv_have_decl_IFLA_INET6_ADDR_GEN_MODE" " +#include +#include +#include +#include +#include +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_IFLA_INET6_ADDR_GEN_MODE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "IFLA_MACVLAN_FLAGS" "ac_cv_have_decl_IFLA_MACVLAN_FLAGS" " #include #include @@ -16478,6 +16618,27 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_IFLA_MACVLAN_FLAGS $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "IFLA_IPVLAN_MODE" "ac_cv_have_decl_IFLA_IPVLAN_MODE" " +#include +#include +#include +#include +#include +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_IFLA_IPVLAN_MODE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IFLA_IPVLAN_MODE $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "IFLA_VTI_REMOTE" "ac_cv_have_decl_IFLA_VTI_REMOTE" " #include #include @@ -17117,12 +17278,12 @@ if test -n "$BLKID_CFLAGS"; then pkg_cv_BLKID_CFLAGS="$BLKID_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" blkid >= 2.20 \""; } >&5 - ($PKG_CONFIG --exists --print-errors " blkid >= 2.20 ") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" blkid >= 2.24 \""; } >&5 + ($PKG_CONFIG --exists --print-errors " blkid >= 2.24 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_BLKID_CFLAGS=`$PKG_CONFIG --cflags " blkid >= 2.20 " 2>/dev/null` + pkg_cv_BLKID_CFLAGS=`$PKG_CONFIG --cflags " blkid >= 2.24 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -17134,12 +17295,12 @@ if test -n "$BLKID_LIBS"; then pkg_cv_BLKID_LIBS="$BLKID_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" blkid >= 2.20 \""; } >&5 - ($PKG_CONFIG --exists --print-errors " blkid >= 2.20 ") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" blkid >= 2.24 \""; } >&5 + ($PKG_CONFIG --exists --print-errors " blkid >= 2.24 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_BLKID_LIBS=`$PKG_CONFIG --libs " blkid >= 2.20 " 2>/dev/null` + pkg_cv_BLKID_LIBS=`$PKG_CONFIG --libs " blkid >= 2.24 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -17160,9 +17321,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - BLKID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " blkid >= 2.20 " 2>&1` + BLKID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " blkid >= 2.24 " 2>&1` else - BLKID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " blkid >= 2.20 " 2>&1` + BLKID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " blkid >= 2.24 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BLKID_PKG_ERRORS" >&5 @@ -17758,31 +17919,11 @@ fi # Put the nasty error message in config.log where it belongs echo "$XZ_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements ( liblzma ) were not met: - -$XZ_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables XZ_CFLAGS -and XZ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_xz=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables XZ_CFLAGS -and XZ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } + have_xz=no else XZ_CFLAGS=$pkg_cv_XZ_CFLAGS XZ_LIBS=$pkg_cv_XZ_LIBS @@ -17805,6 +17946,140 @@ else fi +# ------------------------------------------------------------------------------ +have_zlib=no +# Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; +fi + +if test "x$enable_zlib" != "xno"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB" >&5 +$as_echo_n "checking for ZLIB... " >&6; } + +if test -n "$ZLIB_CFLAGS"; then + pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" zlib \""; } >&5 + ($PKG_CONFIG --exists --print-errors " zlib ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ZLIB_CFLAGS=`$PKG_CONFIG --cflags " zlib " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ZLIB_LIBS"; then + pkg_cv_ZLIB_LIBS="$ZLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" zlib \""; } >&5 + ($PKG_CONFIG --exists --print-errors " zlib ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ZLIB_LIBS=`$PKG_CONFIG --libs " zlib " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " zlib " 2>&1` + else + ZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " zlib " 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ZLIB_PKG_ERRORS" >&5 + + have_zlib=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_zlib=no +else + ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS + ZLIB_LIBS=$pkg_cv_ZLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h + have_zlib=yes +fi + if test "x$have_zlib" = xno -a "x$enable_zlib" = xyes; then + as_fn_error $? "*** ZLIB support requested but libraries not found" "$LINENO" 5 + fi +fi + if test "$have_zlib" = "yes"; then + HAVE_ZLIB_TRUE= + HAVE_ZLIB_FALSE='#' +else + HAVE_ZLIB_TRUE='#' + HAVE_ZLIB_FALSE= +fi + + +# ------------------------------------------------------------------------------ +have_bzip2=no +# Check whether --enable-bzip2 was given. +if test "${enable_bzip2+set}" = set; then : + enableval=$enable_bzip2; +fi + +if test "x$enable_bzip2" != "xno"; then : + + for ac_header in bzlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_bzlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BZLIB_H 1 +_ACEOF + +$as_echo "#define HAVE_BZIP2 1" >>confdefs.h + + have_bzip2=yes +else + if test "x$have_bzip2" = xyes; then : + as_fn_error $? "*** BZIP2 support requested but headers not found" "$LINENO" 5 +fi + +fi + +done + + +fi + if test "$have_bzip2" = "yes"; then + HAVE_BZIP2_TRUE= + HAVE_BZIP2_FALSE='#' +else + HAVE_BZIP2_TRUE='#' + HAVE_BZIP2_FALSE= +fi + + # ------------------------------------------------------------------------------ have_lz4=no # Check whether --enable-lz4 was given. @@ -17812,7 +18087,7 @@ if test "${enable_lz4+set}" = set; then : enableval=$enable_lz4; fi -if test "x$enable_lz4" == "xyes"; then : +if test "x$enable_lz4" = "xyes"; then : for ac_header in lz4.h do : @@ -18031,6 +18306,7 @@ fi $as_echo "#define HAVE_ACL 1" >>confdefs.h + M4_DEFINES="$M4_DEFINES -DHAVE_ACL" else have_acl=no fi @@ -19148,6 +19424,102 @@ else fi +# ------------------------------------------------------------------------------ +have_libiptc=no +# Check whether --enable-libiptc was given. +if test "${enable_libiptc+set}" = set; then : + enableval=$enable_libiptc; +fi + +if test "x$enable_libiptc" != "xno"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBIPTC" >&5 +$as_echo_n "checking for LIBIPTC... " >&6; } + +if test -n "$LIBIPTC_CFLAGS"; then + pkg_cv_LIBIPTC_CFLAGS="$LIBIPTC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiptc\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libiptc") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBIPTC_CFLAGS=`$PKG_CONFIG --cflags "libiptc" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBIPTC_LIBS"; then + pkg_cv_LIBIPTC_LIBS="$LIBIPTC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiptc\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libiptc") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBIPTC_LIBS=`$PKG_CONFIG --libs "libiptc" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBIPTC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libiptc" 2>&1` + else + LIBIPTC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libiptc" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBIPTC_PKG_ERRORS" >&5 + + have_libiptc=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_libiptc=no +else + LIBIPTC_CFLAGS=$pkg_cv_LIBIPTC_CFLAGS + LIBIPTC_LIBS=$pkg_cv_LIBIPTC_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_LIBIPTC 1" >>confdefs.h + + have_libiptc=yes + M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC" +fi + if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then + as_fn_error $? "*** libiptc support requested but libraries not found" "$LINENO" 5 + fi +fi + if test "$have_libiptc" = "yes"; then + HAVE_LIBIPTC_TRUE= + HAVE_LIBIPTC_FALSE='#' +else + HAVE_LIBIPTC_TRUE='#' + HAVE_LIBIPTC_FALSE= +fi + + # ------------------------------------------------------------------------------ have_binfmt=no # Check whether --enable-binfmt was given. @@ -19386,6 +19758,30 @@ $as_echo "#define HAVE_MACHINED 1" >>confdefs.h fi +# ------------------------------------------------------------------------------ +have_importd=no +# Check whether --enable-importd was given. +if test "${enable_importd+set}" = set; then : + enableval=$enable_importd; +fi + +if test "x$enable_importd" != "xno"; then + have_importd=yes +fi + if test "$have_importd" = "yes"; then + ENABLE_IMPORTD_TRUE= + ENABLE_IMPORTD_FALSE='#' +else + ENABLE_IMPORTD_TRUE='#' + ENABLE_IMPORTD_FALSE= +fi + +if test "$have_importd" = "yes"; then : + +$as_echo "#define HAVE_IMPORTD 1" >>confdefs.h + +fi + # ------------------------------------------------------------------------------ have_hostnamed=no # Check whether --enable-hostnamed was given. @@ -19653,7 +20049,18 @@ fi # ------------------------------------------------------------------------------ + +# Check whether --with-unifont was given. +if test "${with_unifont+set}" = set; then : + withval=$with_unifont; UNIFONT="$withval" +else + UNIFONT="/usr/share/unifont/unifont.hex" +fi + + + have_terminal=no +have_unifont=no # Check whether --enable-terminal was given. if test "${enable_terminal+set}" = set; then : enableval=$enable_terminal; @@ -19751,15 +20158,36 @@ else $as_echo "yes" >&6; } have_terminal=yes fi - if test "x$have_terminal" != xyes -a "x$enable_terminal" = xyes; then : + as_ac_File=`$as_echo "ac_cv_file_$UNIFONT" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $UNIFONT" >&5 +$as_echo_n "checking for $UNIFONT... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$UNIFONT"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + have_unifont=yes +fi + + if test "x$have_terminal" != xyes -o "x$have_unifont" != "xyes" -a "x$enable_terminal" = xyes; then : as_fn_error $? "*** terminal support requested but required dependencies not available" "$LINENO" 5 -elif test "x$have_terminal" = xyes; then : +elif test "x$have_terminal" = xyes -a "x$have_unifont" = "xyes"; then : $as_echo "#define ENABLE_TERMINAL 1" >>confdefs.h fi fi - if test "x$have_terminal" = "xyes"; then + if test "x$have_terminal" = "xyes" -a "x$have_unifont" = "xyes"; then ENABLE_TERMINAL_TRUE= ENABLE_TERMINAL_FALSE='#' else @@ -20440,6 +20868,23 @@ $as_echo "#define HAVE_GLIB 1" >>confdefs.h fi +# ------------------------------------------------------------------------------ +# Check whether --enable-hwdb was given. +if test "${enable_hwdb+set}" = set; then : + enableval=$enable_hwdb; enable_hwdb=$enableval +else + enable_hwdb=yes +fi + + if test x$enable_hwdb = xyes; then + ENABLE_HWDB_TRUE= + ENABLE_HWDB_FALSE='#' +else + ENABLE_HWDB_TRUE='#' + ENABLE_HWDB_FALSE= +fi + + # ------------------------------------------------------------------------------ have_manpages=no # Check whether --enable-manpages was given. @@ -20558,7 +21003,7 @@ _ACEOF if test "${with_dbuspolicydir+set}" = set; then : withval=$with_dbuspolicydir; else - with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d + with_dbuspolicydir=${sysconfdir}/dbus-1/system.d fi @@ -20567,7 +21012,7 @@ fi if test "${with_dbussessionservicedir+set}" = set; then : withval=$with_dbussessionservicedir; else - with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1) + with_dbussessionservicedir=${datadir}/dbus-1/services fi @@ -20576,16 +21021,7 @@ fi if test "${with_dbussystemservicedir+set}" = set; then : withval=$with_dbussystemservicedir; else - with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services) -fi - - - -# Check whether --with-dbusinterfacedir was given. -if test "${with_dbusinterfacedir+set}" = set; then : - withval=$with_dbusinterfacedir; -else - with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces) + with_dbussystemservicedir=${datadir}/dbus-1/system-services fi @@ -20667,6 +21103,22 @@ fi fi + +# Check whether --with-dkr-index-url was given. +if test "${with_dkr_index_url+set}" = set; then : + withval=$with_dkr_index_url; DEFAULT_DKR_INDEX_URL="\"$withval\"" +else + DEFAULT_DKR_INDEX_URL="NULL" +fi + + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_DKR_INDEX_URL $DEFAULT_DKR_INDEX_URL +_ACEOF + + + if test "x${enable_split_usr}" = "xyes"; then : @@ -20707,20 +21159,45 @@ else fi -# Check whether --enable-hashmap-debug was given. -if test "${enable_hashmap_debug+set}" = set; then : - enableval=$enable_hashmap_debug; enable_hashmap_debug=$enableval -else - enable_hashmap_debug=no +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; if test "x$enableval" = "xyes"; then + enableval="hashmap,mmap-cache" + fi + saved_ifs="$IFS" + IFS="$IFS$PATH_SEPARATOR," + for name in $enableval; do + case $name in + hashmap) + enable_debug_hashmap=yes + ;; + mmap-cache) + enable_debug_mmap_cache=yes + ;; + esac + done + IFS="$saved_ifs" fi -if test x$enable_hashmap_debug = xyes; then : +enable_debug="" +if test x$enable_debug_hashmap = xyes; then : + + +$as_echo "#define ENABLE_DEBUG_HASHMAP 1" >>confdefs.h -$as_echo "#define ENABLE_HASHMAP_DEBUG 1" >>confdefs.h + enable_debug="hashmap $enable_debug" +fi +if test x$enable_debug_mmap_cache = xyes; then : + + +$as_echo "#define ENABLE_DEBUG_MMAP_CACHE 1" >>confdefs.h + + enable_debug="mmap-cache $enable_debug" fi +test -z "$enable_debug" && enable_debug="none" dbuspolicydir=$with_dbuspolicydir @@ -20728,8 +21205,6 @@ dbussessionservicedir=$with_dbussessionservicedir dbussystemservicedir=$with_dbussystemservicedir -dbusinterfacedir=$with_dbusinterfacedir - bashcompletiondir=$with_bashcompletiondir zshcompletiondir=$with_zshcompletiondir @@ -20971,6 +21446,14 @@ if test -z "${HAVE_XZ_TRUE}" && test -z "${HAVE_XZ_FALSE}"; then as_fn_error $? "conditional \"HAVE_XZ\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_BZIP2_TRUE}" && test -z "${HAVE_BZIP2_FALSE}"; then + as_fn_error $? "conditional \"HAVE_BZIP2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_LZ4_TRUE}" && test -z "${HAVE_LZ4_FALSE}"; then as_fn_error $? "conditional \"HAVE_LZ4\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21023,6 +21506,10 @@ if test -z "${HAVE_LIBIDN_TRUE}" && test -z "${HAVE_LIBIDN_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBIDN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_LIBIPTC_TRUE}" && test -z "${HAVE_LIBIPTC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBIPTC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_BINFMT_TRUE}" && test -z "${ENABLE_BINFMT_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BINFMT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21071,6 +21558,10 @@ if test -z "${ENABLE_MACHINED_TRUE}" && test -z "${ENABLE_MACHINED_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MACHINED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_IMPORTD_TRUE}" && test -z "${ENABLE_IMPORTD_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_IMPORTD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_HOSTNAMED_TRUE}" && test -z "${ENABLE_HOSTNAMED_FALSE}"; then as_fn_error $? "conditional \"ENABLE_HOSTNAMED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21123,6 +21614,10 @@ if test -z "${ENABLE_GUDEV_TRUE}" && test -z "${ENABLE_GUDEV_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GUDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_HWDB_TRUE}" && test -z "${ENABLE_HWDB_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_HWDB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_MANPAGES_TRUE}" && test -z "${ENABLE_MANPAGES_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MANPAGES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21544,7 +22039,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by systemd $as_me 218, which was +This file was extended by systemd $as_me 219, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21611,7 +22106,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -systemd config.status 218 +systemd config.status 219 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -23414,8 +23909,10 @@ fi SELinux: ${have_selinux} SECCOMP: ${have_seccomp} SMACK: ${have_smack} + ZLIB: ${have_zlib} XZ: ${have_xz} LZ4: ${have_lz4} + BZIP2: ${have_bzip2} ACL: ${have_acl} GCRYPT: ${have_gcrypt} QRENCODE: ${have_qrencode} @@ -23424,6 +23921,7 @@ fi GNUTLS: ${have_gnutls} libcurl: ${have_libcurl} libidn: ${have_libidn} + libiptc: ${have_libiptc} ELFUTILS: ${have_elfutils} binfmt: ${have_binfmt} vconsole: ${have_vconsole} @@ -23437,6 +23935,7 @@ fi rfkill: ${have_rfkill} logind: ${have_logind} machined: ${have_machined} + importd: ${have_importd} hostnamed: ${have_hostnamed} timedated: ${have_timedated} timesyncd: ${have_timesyncd} @@ -23456,6 +23955,7 @@ fi dbus: ${have_dbus} nss-myhostname: ${have_myhostname} gudev: ${enable_gudev} + hwdb: ${enable_hwdb} gintrospection: ${enable_introspection} terminal: ${have_terminal} kdbus: ${have_kdbus} @@ -23468,6 +23968,9 @@ fi SysV compatibility: ${SYSTEM_SYSV_COMPAT} compatibility libraries: ${have_compat_libs} utmp/wtmp support: ${have_utmp} + ldconfig support: ${enable_ldconfig} + hibernate support: ${enable_hibernate} + extra debugging: ${enable_debug} prefix: ${prefix} rootprefix: ${with_rootprefix} @@ -23487,7 +23990,6 @@ fi D-Bus policy dir: ${with_dbuspolicydir} D-Bus session dir: ${with_dbussessionservicedir} D-Bus system dir: ${with_dbussystemservicedir} - D-Bus interfaces dir: ${with_dbusinterfacedir} Bash completions dir: ${with_bashcompletiondir} Zsh completions dir: ${with_zshcompletiondir} Extra start script: ${RC_LOCAL_SCRIPT_PATH_START} @@ -23497,6 +23999,7 @@ fi Maximum System UID: ${SYSTEM_UID_MAX} Maximum System GID: ${SYSTEM_GID_MAX} Certificate root: ${CERTIFICATEROOT} + Default dkr Index ${DEFAULT_DKR_INDEX_URL} CFLAGS: ${OUR_CFLAGS} ${CFLAGS} CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} @@ -23515,8 +24018,10 @@ $as_echo " SELinux: ${have_selinux} SECCOMP: ${have_seccomp} SMACK: ${have_smack} + ZLIB: ${have_zlib} XZ: ${have_xz} LZ4: ${have_lz4} + BZIP2: ${have_bzip2} ACL: ${have_acl} GCRYPT: ${have_gcrypt} QRENCODE: ${have_qrencode} @@ -23525,6 +24030,7 @@ $as_echo " GNUTLS: ${have_gnutls} libcurl: ${have_libcurl} libidn: ${have_libidn} + libiptc: ${have_libiptc} ELFUTILS: ${have_elfutils} binfmt: ${have_binfmt} vconsole: ${have_vconsole} @@ -23538,6 +24044,7 @@ $as_echo " rfkill: ${have_rfkill} logind: ${have_logind} machined: ${have_machined} + importd: ${have_importd} hostnamed: ${have_hostnamed} timedated: ${have_timedated} timesyncd: ${have_timesyncd} @@ -23557,6 +24064,7 @@ $as_echo " dbus: ${have_dbus} nss-myhostname: ${have_myhostname} gudev: ${enable_gudev} + hwdb: ${enable_hwdb} gintrospection: ${enable_introspection} terminal: ${have_terminal} kdbus: ${have_kdbus} @@ -23569,6 +24077,9 @@ $as_echo " SysV compatibility: ${SYSTEM_SYSV_COMPAT} compatibility libraries: ${have_compat_libs} utmp/wtmp support: ${have_utmp} + ldconfig support: ${enable_ldconfig} + hibernate support: ${enable_hibernate} + extra debugging: ${enable_debug} prefix: ${prefix} rootprefix: ${with_rootprefix} @@ -23588,7 +24099,6 @@ $as_echo " D-Bus policy dir: ${with_dbuspolicydir} D-Bus session dir: ${with_dbussessionservicedir} D-Bus system dir: ${with_dbussystemservicedir} - D-Bus interfaces dir: ${with_dbusinterfacedir} Bash completions dir: ${with_bashcompletiondir} Zsh completions dir: ${with_zshcompletiondir} Extra start script: ${RC_LOCAL_SCRIPT_PATH_START} @@ -23598,6 +24108,7 @@ $as_echo " Maximum System UID: ${SYSTEM_UID_MAX} Maximum System GID: ${SYSTEM_GID_MAX} Certificate root: ${CERTIFICATEROOT} + Default dkr Index ${DEFAULT_DKR_INDEX_URL} CFLAGS: ${OUR_CFLAGS} ${CFLAGS} CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} diff --git a/configure.ac b/configure.ac index 9218ed30d..97a29d63f 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.64]) AC_INIT([systemd], - [218], + [219], [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd], [systemd], [http://www.freedesktop.org/wiki/Software/systemd]) @@ -34,7 +34,7 @@ AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_PREFIX_DEFAULT([/usr]) AM_MAINTAINER_MODE([enable]) -AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects]) +AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests]) AM_SILENT_RULES([yes]) AC_CANONICAL_HOST AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.]) @@ -98,6 +98,8 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin]) AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin]) +AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin]) + AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])]) M4_DEFINES= @@ -310,7 +312,7 @@ LIBS="$save_LIBS" AC_CHECK_FUNCS([memfd_create]) AC_CHECK_FUNCS([__secure_getenv secure_getenv]) -AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, LO_FLAGS_PARTSCAN], +AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN], [], [], [[ #include #include @@ -321,7 +323,9 @@ AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, LO_FLAG #include ]]) -AC_CHECK_DECLS([IFLA_MACVLAN_FLAGS, +AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE, + IFLA_MACVLAN_FLAGS, + IFLA_IPVLAN_MODE, IFLA_VTI_REMOTE, IFLA_PHYS_PORT_ID, IFLA_BOND_AD_INFO, @@ -432,7 +436,7 @@ AM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"]) have_blkid=no AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support])) if test "x$enable_blkid" != "xno"; then - PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ], + PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ], [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no) if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then AC_MSG_ERROR([*** blkid support requested but libraries not found]) @@ -556,17 +560,41 @@ have_xz=no AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support])) if test "x$enable_xz" != "xno"; then PKG_CHECK_MODULES(XZ, [ liblzma ], - [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes]) + [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no) if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then AC_MSG_ERROR([*** XZ support requested but libraries not found]) fi fi AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"]) +# ------------------------------------------------------------------------------ +have_zlib=no +AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [Disable optional ZLIB support])) +if test "x$enable_zlib" != "xno"; then + PKG_CHECK_MODULES(ZLIB, [ zlib ], + [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available]) have_zlib=yes], have_zlib=no) + if test "x$have_zlib" = xno -a "x$enable_zlib" = xyes; then + AC_MSG_ERROR([*** ZLIB support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"]) + +# ------------------------------------------------------------------------------ +have_bzip2=no +AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Disable optional BZIP2 support])) +AS_IF([test "x$enable_bzip2" != "xno"], [ + AC_CHECK_HEADERS(bzlib.h, + [AC_DEFINE(HAVE_BZIP2, 1, [Define in BZIP2 is available]) + have_bzip2=yes], + [AS_IF([test "x$have_bzip2" = xyes], [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])]) + ]) +]) +AM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"]) + # ------------------------------------------------------------------------------ have_lz4=no AC_ARG_ENABLE(lz4, AS_HELP_STRING([--enable-lz4], [Enable optional LZ4 support])) -AS_IF([test "x$enable_lz4" == "xyes"], [ +AS_IF([test "x$enable_lz4" = "xyes"], [ AC_CHECK_HEADERS(lz4.h, [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available]) have_lz4=yes], [AC_MSG_ERROR([*** LZ4 support requested but headers not found])]) @@ -643,6 +671,7 @@ if test "x${have_acl}" != xno ; then if test "x$have_acl" = xyes ; then ACL_LIBS="-lacl" AC_DEFINE(HAVE_ACL, 1, [ACL available]) + M4_DEFINES="$M4_DEFINES -DHAVE_ACL" else have_acl=no fi @@ -869,6 +898,21 @@ if test "x$enable_libidn" != "xno"; then fi AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"]) +# ------------------------------------------------------------------------------ +have_libiptc=no +AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [Disable optional LIBIPTC support])) +if test "x$enable_libiptc" != "xno"; then + PKG_CHECK_MODULES(LIBIPTC, [libiptc], + [AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available]) + have_libiptc=yes + M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"], + [have_libiptc=no]) + if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then + AC_MSG_ERROR([*** libiptc support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"]) + # ------------------------------------------------------------------------------ have_binfmt=no AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool])) @@ -967,6 +1011,15 @@ fi AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"]) AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ]) +# ------------------------------------------------------------------------------ +have_importd=no +AC_ARG_ENABLE(importd, AS_HELP_STRING([--disable-importd], [disable import daemon])) +if test "x$enable_importd" != "xno"; then + have_importd=yes +fi +AM_CONDITIONAL(ENABLE_IMPORTD, [test "$have_importd" = "yes"]) +AS_IF([test "$have_importd" = "yes"], [ AC_DEFINE(HAVE_IMPORTD, [1], [Importd support available]) ]) + # ------------------------------------------------------------------------------ have_hostnamed=no AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon])) @@ -1092,16 +1145,25 @@ fi AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"]) # ------------------------------------------------------------------------------ +AC_ARG_WITH(unifont, + AS_HELP_STRING([--with-unifont=PATH], + [Path to unifont.hex]), + [UNIFONT="$withval"], + [UNIFONT="/usr/share/unifont/unifont.hex"]) +AC_SUBST(UNIFONT) + have_terminal=no +have_unifont=no AC_ARG_ENABLE(terminal, AS_HELP_STRING([--enable-terminal], [enable terminal support])) if test "x$enable_terminal" = "xyes"; then PKG_CHECK_MODULES([TERMINAL], [ libevdev >= 1.2 xkbcommon >= 0.5 libdrm >= 2.4], [have_terminal=yes]) - AS_IF([test "x$have_terminal" != xyes -a "x$enable_terminal" = xyes], + AC_CHECK_FILE($UNIFONT, [have_unifont=yes]) + AS_IF([test "x$have_terminal" != xyes -o "x$have_unifont" != "xyes" -a "x$enable_terminal" = xyes], [AC_MSG_ERROR([*** terminal support requested but required dependencies not available])], - [test "x$have_terminal" = xyes], + [test "x$have_terminal" = xyes -a "x$have_unifont" = "xyes"], [AC_DEFINE(ENABLE_TERMINAL, 1, [Define if terminal support is to be enabled])]) fi -AM_CONDITIONAL(ENABLE_TERMINAL, [test "x$have_terminal" = "xyes"]) +AM_CONDITIONAL(ENABLE_TERMINAL, [test "x$have_terminal" = "xyes" -a "x$have_unifont" = "xyes"]) # ------------------------------------------------------------------------------ have_kdbus=no @@ -1190,6 +1252,11 @@ AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"]) AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ]) +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])], + enable_hwdb=$enableval, enable_hwdb=yes) +AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes]) + # ------------------------------------------------------------------------------ have_manpages=no AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages])) @@ -1253,22 +1320,17 @@ AC_SUBST(TTY_GID) AC_ARG_WITH([dbuspolicydir], AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]), [], - [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d]) + [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d]) AC_ARG_WITH([dbussessionservicedir], AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]), [], - [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)]) + [with_dbussessionservicedir=${datadir}/dbus-1/services]) AC_ARG_WITH([dbussystemservicedir], AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]), [], - [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)]) - -AC_ARG_WITH([dbusinterfacedir], - AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]), - [], - [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)]) + [with_dbussystemservicedir=${datadir}/dbus-1/system-services]) AC_ARG_WITH([bashcompletiondir], AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), @@ -1311,6 +1373,14 @@ AC_ARG_ENABLE([split-usr], enable_split_usr=no ])]) +AC_ARG_WITH([dkr-index-url], + [AS_HELP_STRING([--dkr-index-url=URL], [Specify the default index URL to use for image downloads])], + [DEFAULT_DKR_INDEX_URL="\"$withval\""], + [DEFAULT_DKR_INDEX_URL="NULL"]) + +AC_DEFINE_UNQUOTED(DEFAULT_DKR_INDEX_URL, [$DEFAULT_DKR_INDEX_URL], [Default index URL to use for image downloads]) +AC_SUBST(DEFAULT_DKR_INDEX_URL) + AS_IF([test "x${enable_split_usr}" = "xyes"], [ AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr]) ]) @@ -1323,21 +1393,43 @@ AS_IF([test "x$0" != "x./configure"], [ ]) AC_ARG_ENABLE(tests, - [AC_HELP_STRING([--disable-tests], [disable tests])], - enable_tests=$enableval, enable_tests=yes) + [AC_HELP_STRING([--disable-tests], [disable tests])], + enable_tests=$enableval, enable_tests=yes) AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes]) -AC_ARG_ENABLE(hashmap-debug, - [AC_HELP_STRING([--enable-hashmap-debug], [enable hashmap debugging])], - enable_hashmap_debug=$enableval, enable_hashmap_debug=no) -AS_IF([test x$enable_hashmap_debug = xyes], [ - AC_DEFINE(ENABLE_HASHMAP_DEBUG, 1, [Define if hashmap debugging is to be enabled]) +AC_ARG_ENABLE(debug, + [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])], + [if test "x$enableval" = "xyes"; then + enableval="hashmap,mmap-cache" + fi + saved_ifs="$IFS" + IFS="$IFS$PATH_SEPARATOR," + for name in $enableval; do + case $name in + hashmap) + enable_debug_hashmap=yes + ;; + mmap-cache) + enable_debug_mmap_cache=yes + ;; + esac + done + IFS="$saved_ifs"],[]) + +enable_debug="" +AS_IF([test x$enable_debug_hashmap = xyes], [ + AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled]) + enable_debug="hashmap $enable_debug" +]) +AS_IF([test x$enable_debug_mmap_cache = xyes], [ + AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled]) + enable_debug="mmap-cache $enable_debug" ]) +test -z "$enable_debug" && enable_debug="none" AC_SUBST([dbuspolicydir], [$with_dbuspolicydir]) AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir]) AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir]) -AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir]) AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) AC_SUBST([zshcompletiondir], [$with_zshcompletiondir]) AC_SUBST([pamlibdir], [$with_pamlibdir]) @@ -1365,8 +1457,10 @@ AC_MSG_RESULT([ SELinux: ${have_selinux} SECCOMP: ${have_seccomp} SMACK: ${have_smack} + ZLIB: ${have_zlib} XZ: ${have_xz} LZ4: ${have_lz4} + BZIP2: ${have_bzip2} ACL: ${have_acl} GCRYPT: ${have_gcrypt} QRENCODE: ${have_qrencode} @@ -1375,6 +1469,7 @@ AC_MSG_RESULT([ GNUTLS: ${have_gnutls} libcurl: ${have_libcurl} libidn: ${have_libidn} + libiptc: ${have_libiptc} ELFUTILS: ${have_elfutils} binfmt: ${have_binfmt} vconsole: ${have_vconsole} @@ -1388,6 +1483,7 @@ AC_MSG_RESULT([ rfkill: ${have_rfkill} logind: ${have_logind} machined: ${have_machined} + importd: ${have_importd} hostnamed: ${have_hostnamed} timedated: ${have_timedated} timesyncd: ${have_timesyncd} @@ -1407,6 +1503,7 @@ AC_MSG_RESULT([ dbus: ${have_dbus} nss-myhostname: ${have_myhostname} gudev: ${enable_gudev} + hwdb: ${enable_hwdb} gintrospection: ${enable_introspection} terminal: ${have_terminal} kdbus: ${have_kdbus} @@ -1419,6 +1516,9 @@ AC_MSG_RESULT([ SysV compatibility: ${SYSTEM_SYSV_COMPAT} compatibility libraries: ${have_compat_libs} utmp/wtmp support: ${have_utmp} + ldconfig support: ${enable_ldconfig} + hibernate support: ${enable_hibernate} + extra debugging: ${enable_debug} prefix: ${prefix} rootprefix: ${with_rootprefix} @@ -1438,7 +1538,6 @@ AC_MSG_RESULT([ D-Bus policy dir: ${with_dbuspolicydir} D-Bus session dir: ${with_dbussessionservicedir} D-Bus system dir: ${with_dbussystemservicedir} - D-Bus interfaces dir: ${with_dbusinterfacedir} Bash completions dir: ${with_bashcompletiondir} Zsh completions dir: ${with_zshcompletiondir} Extra start script: ${RC_LOCAL_SCRIPT_PATH_START} @@ -1448,6 +1547,7 @@ AC_MSG_RESULT([ Maximum System UID: ${SYSTEM_UID_MAX} Maximum System GID: ${SYSTEM_GID_MAX} Certificate root: ${CERTIFICATEROOT} + Default dkr Index ${DEFAULT_DKR_INDEX_URL} CFLAGS: ${OUR_CFLAGS} ${CFLAGS} CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} diff --git a/docs/gudev/Makefile.in b/docs/gudev/Makefile.in index d5b0988b9..6a66e0006 100644 --- a/docs/gudev/Makefile.in +++ b/docs/gudev/Makefile.in @@ -147,6 +147,7 @@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEBUGTTY = @DEBUGTTY@ +DEFAULT_DKR_INDEX_URL = @DEFAULT_DKR_INDEX_URL@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -216,6 +217,8 @@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ +LIBIPTC_CFLAGS = @LIBIPTC_CFLAGS@ +LIBIPTC_LIBS = @LIBIPTC_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -283,6 +286,7 @@ SHELL = @SHELL@ SPHINX_BUILD = @SPHINX_BUILD@ STRINGS = @STRINGS@ STRIP = @STRIP@ +SULOGIN = @SULOGIN@ SUSHELL = @SUSHELL@ SYSTEM_GID_MAX = @SYSTEM_GID_MAX@ SYSTEM_SYSVINIT_PATH = @SYSTEM_SYSVINIT_PATH@ @@ -292,6 +296,7 @@ TELINIT = @TELINIT@ TERMINAL_CFLAGS = @TERMINAL_CFLAGS@ TERMINAL_LIBS = @TERMINAL_LIBS@ TTY_GID = @TTY_GID@ +UNIFONT = @UNIFONT@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ @@ -300,6 +305,8 @@ XKBCOMMON_LIBS = @XKBCOMMON_LIBS@ XSLTPROC = @XSLTPROC@ XZ_CFLAGS = @XZ_CFLAGS@ XZ_LIBS = @XZ_LIBS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -322,7 +329,6 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ -dbusinterfacedir = @dbusinterfacedir@ dbuspolicydir = @dbuspolicydir@ dbussessionservicedir = @dbussessionservicedir@ dbussystemservicedir = @dbussystemservicedir@ diff --git a/docs/gudev/html/index.html b/docs/gudev/html/index.html index c52c5fcec..2b06c4465 100644 --- a/docs/gudev/html/index.html +++ b/docs/gudev/html/index.html @@ -15,7 +15,7 @@

- For version 218 + For version 219 — the latest version of this documentation can be found at diff --git a/docs/gudev/version.xml b/docs/gudev/version.xml index dc6f4a877..037ba9719 100644 --- a/docs/gudev/version.xml +++ b/docs/gudev/version.xml @@ -1 +1 @@ -218 +219 diff --git a/docs/libudev/Makefile.am b/docs/libudev/Makefile.am index cf9a452e7..2998c3516 100644 --- a/docs/libudev/Makefile.am +++ b/docs/libudev/Makefile.am @@ -57,7 +57,7 @@ EXTRA_HFILES= # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = libudev-private.h libudev-hwdb-def.h +IGNORE_HFILES = libudev-private.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png diff --git a/docs/libudev/Makefile.in b/docs/libudev/Makefile.in index 320088188..be286ef99 100644 --- a/docs/libudev/Makefile.in +++ b/docs/libudev/Makefile.in @@ -147,6 +147,7 @@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEBUGTTY = @DEBUGTTY@ +DEFAULT_DKR_INDEX_URL = @DEFAULT_DKR_INDEX_URL@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -216,6 +217,8 @@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ +LIBIPTC_CFLAGS = @LIBIPTC_CFLAGS@ +LIBIPTC_LIBS = @LIBIPTC_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -283,6 +286,7 @@ SHELL = @SHELL@ SPHINX_BUILD = @SPHINX_BUILD@ STRINGS = @STRINGS@ STRIP = @STRIP@ +SULOGIN = @SULOGIN@ SUSHELL = @SUSHELL@ SYSTEM_GID_MAX = @SYSTEM_GID_MAX@ SYSTEM_SYSVINIT_PATH = @SYSTEM_SYSVINIT_PATH@ @@ -292,6 +296,7 @@ TELINIT = @TELINIT@ TERMINAL_CFLAGS = @TERMINAL_CFLAGS@ TERMINAL_LIBS = @TERMINAL_LIBS@ TTY_GID = @TTY_GID@ +UNIFONT = @UNIFONT@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ @@ -300,6 +305,8 @@ XKBCOMMON_LIBS = @XKBCOMMON_LIBS@ XSLTPROC = @XSLTPROC@ XZ_CFLAGS = @XZ_CFLAGS@ XZ_LIBS = @XZ_LIBS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -322,7 +329,6 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ -dbusinterfacedir = @dbusinterfacedir@ dbuspolicydir = @dbuspolicydir@ dbussessionservicedir = @dbussessionservicedir@ dbussystemservicedir = @dbussystemservicedir@ @@ -428,7 +434,7 @@ EXTRA_HFILES = # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES = libudev-private.h libudev-hwdb-def.h +IGNORE_HFILES = libudev-private.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png diff --git a/docs/libudev/html/index.html b/docs/libudev/html/index.html index a0f83f498..29c10c791 100644 --- a/docs/libudev/html/index.html +++ b/docs/libudev/html/index.html @@ -15,7 +15,7 @@

- For version 218 + For version 219 — the latest version of this documentation can be found at diff --git a/docs/libudev/version.xml b/docs/libudev/version.xml index dc6f4a877..037ba9719 100644 --- a/docs/libudev/version.xml +++ b/docs/libudev/version.xml @@ -1 +1 @@ -218 +219 diff --git a/hwdb/20-OUI.hwdb b/hwdb/20-OUI.hwdb index 4134659cd..6976bdf64 100644 --- a/hwdb/20-OUI.hwdb +++ b/hwdb/20-OUI.hwdb @@ -26405,7 +26405,7 @@ OUI:0010C3* ID_OUI_FROM_DATABASE=CSI-CONTROL SYSTEMS OUI:0010C4* - ID_OUI_FROM_DATABASE=MEDIA LINKS CO., LTD. + ID_OUI_FROM_DATABASE=MEDIA GLOBAL LINKS CO., LTD. OUI:0010C5* ID_OUI_FROM_DATABASE=PROTOCOL TECHNOLOGIES, INC. @@ -26936,7 +26936,7 @@ OUI:001174* ID_OUI_FROM_DATABASE=Wibhu Technologies, Inc. OUI:001175* - ID_OUI_FROM_DATABASE=PathScale, Inc. + ID_OUI_FROM_DATABASE=Intel Corporation OUI:001176* ID_OUI_FROM_DATABASE=Intellambda Systems, Inc. @@ -32924,7 +32924,7 @@ OUI:001944* ID_OUI_FROM_DATABASE=Fossil Partners, L.P. OUI:001945* - ID_OUI_FROM_DATABASE=Ten-Tec Inc. + ID_OUI_FROM_DATABASE=RF COncepts, LLC OUI:001946* ID_OUI_FROM_DATABASE=Cianet Industria e Comercio S/A @@ -34844,7 +34844,7 @@ OUI:001BC4* ID_OUI_FROM_DATABASE=Ultratec, Inc. OUI:001BC5* - ID_OUI_FROM_DATABASE=IEEE Registration Authority + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see OUI36/MA-S public listing for more information. OUI:001BC6* ID_OUI_FROM_DATABASE=Strato Rechenzentrum AG @@ -44317,6 +44317,9 @@ OUI:0036FE* OUI:00376D* ID_OUI_FROM_DATABASE=Murata Manufacturing Co., Ltd. +OUI:0037B7* + ID_OUI_FROM_DATABASE=SAGEMCOM + OUI:003A98* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. @@ -45533,7 +45536,7 @@ OUI:005091* ID_OUI_FROM_DATABASE=NETACCESS, INC. OUI:005092* - ID_OUI_FROM_DATABASE=RIGAKU INDUSTRIAL CORPORATION + ID_OUI_FROM_DATABASE=Rigaku Corporation Osaka Plant OUI:005093* ID_OUI_FROM_DATABASE=BOEING @@ -46681,6 +46684,9 @@ OUI:00789E* OUI:007DFA* ID_OUI_FROM_DATABASE=Volkswagen Group of America +OUI:007E56* + ID_OUI_FROM_DATABASE=China Dragon Technology Limited + OUI:007F28* ID_OUI_FROM_DATABASE=Actiontec Electronics, Inc @@ -51883,6 +51889,9 @@ OUI:048C03* OUI:048D38* ID_OUI_FROM_DATABASE=Netcore Technology Inc. +OUI:0492EE* + ID_OUI_FROM_DATABASE=iway AG + OUI:0494A1* ID_OUI_FROM_DATABASE=CATCH THE WIND INC @@ -51922,6 +51931,9 @@ OUI:04B466* OUI:04BD70* ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD +OUI:04BD88* + ID_OUI_FROM_DATABASE=Aruba Networks + OUI:04BFA8* ID_OUI_FROM_DATABASE=ISB Corporation @@ -51946,6 +51958,9 @@ OUI:04C880* OUI:04C991* ID_OUI_FROM_DATABASE=Phistek INC. +OUI:04C9D9* + ID_OUI_FROM_DATABASE=EchoStar Technologies Corp + OUI:04CB1D* ID_OUI_FROM_DATABASE=Traka plc @@ -52531,6 +52546,9 @@ OUI:081DFB* OUI:081F3F* ID_OUI_FROM_DATABASE=WondaLink Inc. +OUI:081FEB* + ID_OUI_FROM_DATABASE=BinCube + OUI:081FF3* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. @@ -52612,6 +52630,9 @@ OUI:085DDD* OUI:08606E* ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. +OUI:086266* + ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. + OUI:086361* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd @@ -52738,6 +52759,9 @@ OUI:08CD9B* OUI:08D09F* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. +OUI:08D0B7* + ID_OUI_FROM_DATABASE=HISENSE ELECTRIC CO.,LTD. + OUI:08D29A* ID_OUI_FROM_DATABASE=Proformatique @@ -52888,6 +52912,9 @@ OUI:0C3C65* OUI:0C3E9F* ID_OUI_FROM_DATABASE=Apple, Inc +OUI:0C413E* + ID_OUI_FROM_DATABASE=Microsoft Corporation + OUI:0C469D* ID_OUI_FROM_DATABASE=MS Sedco @@ -53041,6 +53068,9 @@ OUI:0CB319* OUI:0CB4EF* ID_OUI_FROM_DATABASE=Digience Co.,Ltd. +OUI:0CB5DE* + ID_OUI_FROM_DATABASE=Alcatel Lucent + OUI:0CBC9F* ID_OUI_FROM_DATABASE=Apple @@ -53260,6 +53290,9 @@ OUI:1027BE* OUI:102831* ID_OUI_FROM_DATABASE=Morion Inc. +OUI:102C83* + ID_OUI_FROM_DATABASE=XIMEA + OUI:102D96* ID_OUI_FROM_DATABASE=Looxcie Inc. @@ -53407,6 +53440,9 @@ OUI:109266* OUI:1093E9* ID_OUI_FROM_DATABASE=Apple +OUI:109836* + ID_OUI_FROM_DATABASE=Dell Inc. + OUI:109AB9* ID_OUI_FROM_DATABASE=Tosibox Oy @@ -53431,6 +53467,9 @@ OUI:10A743* OUI:10A932* ID_OUI_FROM_DATABASE=Beijing Cyber Cloud Technology Co. ,Ltd. +OUI:10AF78* + ID_OUI_FROM_DATABASE=Shenzhen ATUE Technology Co., Ltd + OUI:10B26B* ID_OUI_FROM_DATABASE=base Co.,Ltd. @@ -53449,6 +53488,9 @@ OUI:10BD18* OUI:10BF48* ID_OUI_FROM_DATABASE=ASUSTEK COMPUTER INC. +OUI:10C07C* + ID_OUI_FROM_DATABASE=Blu-ray Disc Association + OUI:10C2BA* ID_OUI_FROM_DATABASE=UTT Co., Ltd. @@ -53476,6 +53518,9 @@ OUI:10CA81* OUI:10CCDB* ID_OUI_FROM_DATABASE=AXIMUM PRODUITS ELECTRONIQUES +OUI:10CDAE* + ID_OUI_FROM_DATABASE=Avaya, Inc + OUI:10D1DC* ID_OUI_FROM_DATABASE=INSTAR Deutschland GmbH @@ -53581,6 +53626,9 @@ OUI:141BF0* OUI:141FBA* ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. +OUI:1422DB* + ID_OUI_FROM_DATABASE=eero inc. + OUI:1423D7* ID_OUI_FROM_DATABASE=EUTRONIX CO., LTD. @@ -53632,6 +53680,9 @@ OUI:143DF2* OUI:143E60* ID_OUI_FROM_DATABASE=Alcatel-Lucent +OUI:144146* + ID_OUI_FROM_DATABASE=Honeywell (China) Co., LTD + OUI:1441E2* ID_OUI_FROM_DATABASE=Monaco Enterprises, Inc. @@ -53725,6 +53776,9 @@ OUI:149448* OUI:1499E2* ID_OUI_FROM_DATABASE=Apple, Inc +OUI:149A10* + ID_OUI_FROM_DATABASE=Microsoft Corporation + OUI:149FE8* ID_OUI_FROM_DATABASE=Lenovo Mobile Communication Technology Ltd. @@ -53743,6 +53797,9 @@ OUI:14A9E3* OUI:14ABF0* ID_OUI_FROM_DATABASE=ARRIS Group, Inc. +OUI:14AEDB* + ID_OUI_FROM_DATABASE=VTech Telecommunications Ltd. + OUI:14B126* ID_OUI_FROM_DATABASE=Industrial Software Co @@ -53959,6 +54016,9 @@ OUI:18422F* OUI:184462* ID_OUI_FROM_DATABASE=Riava Networks, Inc. +OUI:1844E6* + ID_OUI_FROM_DATABASE=zte corporation + OUI:184617* ID_OUI_FROM_DATABASE=Samsung Electronics @@ -54133,6 +54193,9 @@ OUI:18B591* OUI:18B79E* ID_OUI_FROM_DATABASE=Invoxia +OUI:18BDAD* + ID_OUI_FROM_DATABASE=L-TECH CORPORATION + OUI:18C086* ID_OUI_FROM_DATABASE=Broadcom Corporation @@ -54403,6 +54466,9 @@ OUI:1C7E51* OUI:1C7EE5* ID_OUI_FROM_DATABASE=D-Link International +OUI:1C8341* + ID_OUI_FROM_DATABASE=Hefei Bitland Information Technology Co.Ltd + OUI:1C83B0* ID_OUI_FROM_DATABASE=Linked IP GmbH @@ -54481,6 +54547,9 @@ OUI:1CB17F* OUI:1CB243* ID_OUI_FROM_DATABASE=TDC A/S +OUI:1CB72C* + ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. + OUI:1CBA8C* ID_OUI_FROM_DATABASE=Texas Instruments @@ -54502,12 +54571,18 @@ OUI:1CC1DE* OUI:1CC316* ID_OUI_FROM_DATABASE=MileSight Technology Co., Ltd. +OUI:1CC586* + ID_OUI_FROM_DATABASE=Absolute Acoustics + OUI:1CC63C* ID_OUI_FROM_DATABASE=Arcadyan Technology Corporation OUI:1CC72D* ID_OUI_FROM_DATABASE=Shenzhen Huapu Digital CO.,Ltd +OUI:1CCAE3* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:1CD40C* ID_OUI_FROM_DATABASE=Kriwan Industrie-Elektronik GmbH @@ -54538,6 +54613,9 @@ OUI:1CE85D* OUI:1CEEE8* ID_OUI_FROM_DATABASE=Ilshin Elecom +OUI:1CF03E* + ID_OUI_FROM_DATABASE=Wearhaus Inc. + OUI:1CF061* ID_OUI_FROM_DATABASE=SCAPS GmbH @@ -54649,12 +54727,18 @@ OUI:2046A1* OUI:2046F9* ID_OUI_FROM_DATABASE=Advanced Network Devices (dba:AND) +OUI:204747* + ID_OUI_FROM_DATABASE=Dell Inc. + OUI:204AAA* ID_OUI_FROM_DATABASE=Hanscan Spain S.A. OUI:204C6D* ID_OUI_FROM_DATABASE=Hugo Brennenstuhl Gmbh & Co. KG. +OUI:204C9E* + ID_OUI_FROM_DATABASE=Cisco + OUI:204E6B* ID_OUI_FROM_DATABASE=Axxana(israel) ltd @@ -54736,6 +54820,9 @@ OUI:208984* OUI:208986* ID_OUI_FROM_DATABASE=zte corporation +OUI:209148* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:20918A* ID_OUI_FROM_DATABASE=PROFALUX @@ -54835,6 +54922,9 @@ OUI:20D5BF* OUI:20D607* ID_OUI_FROM_DATABASE=Nokia Corporation +OUI:20D75A* + ID_OUI_FROM_DATABASE=Posh Mobile Limited + OUI:20D906* ID_OUI_FROM_DATABASE=Iota, Inc. @@ -54931,12 +55021,18 @@ OUI:241B13* OUI:241B44* ID_OUI_FROM_DATABASE=Hangzhou Tuners Electronics Co., Ltd +OUI:241C04* + ID_OUI_FROM_DATABASE=SHENZHEN JEHE TECHNOLOGY DEVELOPMENT CO., LTD. + OUI:241F2C* ID_OUI_FROM_DATABASE=Calsys, Inc. OUI:2421AB* ID_OUI_FROM_DATABASE=Sony Ericsson Mobile Communications +OUI:24240E* + ID_OUI_FROM_DATABASE=Apple + OUI:242642* ID_OUI_FROM_DATABASE=SHARP Corporation. @@ -54985,6 +55081,9 @@ OUI:2464EF* OUI:246511* ID_OUI_FROM_DATABASE=AVM GmbH +OUI:24693E* + ID_OUI_FROM_DATABASE=innodisk Corporation + OUI:24694A* ID_OUI_FROM_DATABASE=Jasmine Systems Inc. @@ -54994,6 +55093,12 @@ OUI:2469A5* OUI:246AAB* ID_OUI_FROM_DATABASE=IT-IS International +OUI:247189* + ID_OUI_FROM_DATABASE=Texas Instruments + +OUI:247656* + ID_OUI_FROM_DATABASE=Shanghai Net Miles Fiber Optics Technology Co., LTD. + OUI:24767D* ID_OUI_FROM_DATABASE=Cisco SPVTG @@ -55030,6 +55135,9 @@ OUI:249504* OUI:2497ED* ID_OUI_FROM_DATABASE=Techvision Intelligent Technology Limited +OUI:249EAB* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:24A074* ID_OUI_FROM_DATABASE=Apple @@ -55060,6 +55168,9 @@ OUI:24AF4A* OUI:24AF54* ID_OUI_FROM_DATABASE=NEXGEN Mediatech Inc. +OUI:24B0A9* + ID_OUI_FROM_DATABASE=Shanghai Mobiletek Communication Ltd. + OUI:24B657* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. @@ -55291,6 +55402,9 @@ OUI:2852E0* OUI:285767* ID_OUI_FROM_DATABASE=Echostar Technologies Corp +OUI:285AEB* + ID_OUI_FROM_DATABASE=Apple + OUI:285FDB* ID_OUI_FROM_DATABASE=Shenzhen Huawei Communication Technologies Co., Ltd @@ -55327,6 +55441,9 @@ OUI:2872C5* OUI:2872F0* ID_OUI_FROM_DATABASE=ATHENA +OUI:287610* + ID_OUI_FROM_DATABASE=IgniteNet + OUI:287994* ID_OUI_FROM_DATABASE=Realplay Digital Technology(Shenzhen) Co.,Ltd @@ -55417,6 +55534,9 @@ OUI:28BE9B* OUI:28C0DA* ID_OUI_FROM_DATABASE=Juniper Networks +OUI:28C2DD* + ID_OUI_FROM_DATABASE=AzureWave Technologies, Inc. + OUI:28C671* ID_OUI_FROM_DATABASE=Yota Devices OY @@ -55705,6 +55825,9 @@ OUI:2C67FB* OUI:2C69BA* ID_OUI_FROM_DATABASE=RF Controls, LLC +OUI:2C6A6F* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:2C6BF5* ID_OUI_FROM_DATABASE=Juniper networks @@ -55828,6 +55951,9 @@ OUI:2CCD69* OUI:2CD05A* ID_OUI_FROM_DATABASE=Liteon Technology Corporation +OUI:2CD141* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:2CD1DA* ID_OUI_FROM_DATABASE=Sanjole, Inc. @@ -56143,6 +56269,9 @@ OUI:30EFD1* OUI:30F31D* ID_OUI_FROM_DATABASE=zte corporation +OUI:30F335* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:30F33A* ID_OUI_FROM_DATABASE=+plugg srl @@ -56182,9 +56311,18 @@ OUI:3407FB* OUI:340804* ID_OUI_FROM_DATABASE=D-Link Corporation +OUI:340A22* + ID_OUI_FROM_DATABASE=TOP-ACCESS ELECTRONICS CO LTD + OUI:340AFF* ID_OUI_FROM_DATABASE=Qingdao Hisense Communications Co.,Ltd +OUI:340B40* + ID_OUI_FROM_DATABASE=MIOS ELETTRONICA SRL + +OUI:341298* + ID_OUI_FROM_DATABASE=Apple + OUI:3413A8* ID_OUI_FROM_DATABASE=Mediplan Limited @@ -56236,6 +56374,9 @@ OUI:34363B* OUI:3438AF* ID_OUI_FROM_DATABASE=Inlab Software GmbH +OUI:343D98* + ID_OUI_FROM_DATABASE=Fujian JinQianMao Electronic Technology Co.,Ltd. + OUI:3440B5* ID_OUI_FROM_DATABASE=IBM @@ -56476,6 +56617,9 @@ OUI:34C803* OUI:34C99D* ID_OUI_FROM_DATABASE=EIDOLON COMMUNICATIONS TECHNOLOGY CO. LTD. +OUI:34CC28* + ID_OUI_FROM_DATABASE=Nexpring Co. LTD., + OUI:34CD6D* ID_OUI_FROM_DATABASE=CommSky Technologies @@ -56776,6 +56920,9 @@ OUI:38BF33* OUI:38C096* ID_OUI_FROM_DATABASE=ALPS ELECTRIC CO.,LTD. +OUI:38C70A* + ID_OUI_FROM_DATABASE=WiFiSong + OUI:38C7BA* ID_OUI_FROM_DATABASE=CS Services Co.,Ltd. @@ -56845,6 +56992,9 @@ OUI:38F889* OUI:38F8B7* ID_OUI_FROM_DATABASE=V2COM PARTICIPACOES S.A. +OUI:38FACA* + ID_OUI_FROM_DATABASE=Skyworth Digital Technology(Shenzhen) Co.,Ltd + OUI:38FEC5* ID_OUI_FROM_DATABASE=Ellips B.V. @@ -56971,6 +57121,9 @@ OUI:3C438E* OUI:3C46D8* ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD. +OUI:3C4711* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:3C4937* ID_OUI_FROM_DATABASE=ASSMANN Electronic GmbH @@ -57046,6 +57199,9 @@ OUI:3C7DB1* OUI:3C81D8* ID_OUI_FROM_DATABASE=SAGEMCOM SAS +OUI:3C8375* + ID_OUI_FROM_DATABASE=Microsoft Corporation + OUI:3C83B5* ID_OUI_FROM_DATABASE=Advance Vision Electronics Co. Ltd. @@ -57103,6 +57259,9 @@ OUI:3CA315* OUI:3CA72B* ID_OUI_FROM_DATABASE=MRV Communications (Networks) LTD +OUI:3CA82A* + ID_OUI_FROM_DATABASE=Hewlett Packard + OUI:3CA9F4* ID_OUI_FROM_DATABASE=Intel Corporate @@ -57151,12 +57310,18 @@ OUI:3CC99E* OUI:3CCA87* ID_OUI_FROM_DATABASE=Iders Incorporated +OUI:3CCB7C* + ID_OUI_FROM_DATABASE=TCT mobile ltd + OUI:3CCD5A* ID_OUI_FROM_DATABASE=Technische Alternative GmbH OUI:3CCD93* ID_OUI_FROM_DATABASE=LG ELECTRONICS INC +OUI:3CCE15* + ID_OUI_FROM_DATABASE=Mercedes-Benz USA, LLC + OUI:3CCE73* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. @@ -57181,6 +57346,9 @@ OUI:3CD9CE* OUI:3CDF1E* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. +OUI:3CDFA9* + ID_OUI_FROM_DATABASE=ARRIS Group, Inc. + OUI:3CDFBD* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd @@ -57241,6 +57409,9 @@ OUI:400E67* OUI:400E85* ID_OUI_FROM_DATABASE=Samsung Electro Mechanics co.,LTD. +OUI:4011DC* + ID_OUI_FROM_DATABASE=Sonance + OUI:4012E4* ID_OUI_FROM_DATABASE=Compass-EOS @@ -57277,6 +57448,9 @@ OUI:4025C2* OUI:40270B* ID_OUI_FROM_DATABASE=Mobileeco Co., Ltd +OUI:402814* + ID_OUI_FROM_DATABASE=RFI Engineering + OUI:402BA1* ID_OUI_FROM_DATABASE=Sony Ericsson Mobile Communications AB @@ -57394,6 +57568,9 @@ OUI:407A80* OUI:407B1B* ID_OUI_FROM_DATABASE=Mettle Networks Inc. +OUI:407FE0* + ID_OUI_FROM_DATABASE=Glory Star Technics (ShenZhen) Limited + OUI:408256* ID_OUI_FROM_DATABASE=Continental Automotive GmbH @@ -57439,12 +57616,18 @@ OUI:409FC7* OUI:40A5EF* ID_OUI_FROM_DATABASE=Shenzhen Four Seas Global Link Network Technology Co., Ltd. +OUI:40A677* + ID_OUI_FROM_DATABASE=Juniper Networks + OUI:40A6A4* ID_OUI_FROM_DATABASE=PassivSystems Ltd OUI:40A6D9* ID_OUI_FROM_DATABASE=Apple +OUI:40A6E8* + ID_OUI_FROM_DATABASE=Cisco + OUI:40A8F0* ID_OUI_FROM_DATABASE=Hewlett Packard @@ -57475,6 +57658,12 @@ OUI:40B6B1* OUI:40B7F3* ID_OUI_FROM_DATABASE=ARRIS Group, Inc. +OUI:40B837* + ID_OUI_FROM_DATABASE=Sony Mobile Communications AB + +OUI:40B89A* + ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. + OUI:40BA61* ID_OUI_FROM_DATABASE=Arima Communications Corp. @@ -57670,6 +57859,9 @@ OUI:4451DB* OUI:4454C0* ID_OUI_FROM_DATABASE=Thompson Aerospace +OUI:4455B1* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:44568D* ID_OUI_FROM_DATABASE=PNC Technologies Co., Ltd. @@ -57739,6 +57931,9 @@ OUI:447E76* OUI:447E95* ID_OUI_FROM_DATABASE=Alpha and Omega, Inc +OUI:4480EB* + ID_OUI_FROM_DATABASE=Motorola Mobility LLC, a Lenovo Company + OUI:448312* ID_OUI_FROM_DATABASE=Star-Net @@ -57775,6 +57970,9 @@ OUI:4494FC* OUI:4495FA* ID_OUI_FROM_DATABASE=Qingdao Santong Digital Technology Co.Ltd +OUI:44962B* + ID_OUI_FROM_DATABASE=Aidon Oy + OUI:449B78* ID_OUI_FROM_DATABASE=The Now Factory @@ -57829,6 +58027,9 @@ OUI:44C4A9* OUI:44C56F* ID_OUI_FROM_DATABASE=NGN Easy Satfinder (Tianjin) Electronic Co., Ltd +OUI:44C69B* + ID_OUI_FROM_DATABASE=Wuhan Feng Tian Information Network CO.,LTD + OUI:44C9A2* ID_OUI_FROM_DATABASE=Greenwald Industries @@ -57838,6 +58039,9 @@ OUI:44CE7D* OUI:44D15E* ID_OUI_FROM_DATABASE=Shanghai Kingto Information Technology Ltd +OUI:44D244* + ID_OUI_FROM_DATABASE=Seiko Epson Corporation + OUI:44D2CA* ID_OUI_FROM_DATABASE=Anvia TV Oy @@ -57856,6 +58060,9 @@ OUI:44D832* OUI:44D884* ID_OUI_FROM_DATABASE=Apple +OUI:44D9E7* + ID_OUI_FROM_DATABASE=Ubiquiti Networks, Inc. + OUI:44DC91* ID_OUI_FROM_DATABASE=PLANEX COMMUNICATIONS INC. @@ -57904,6 +58111,9 @@ OUI:48022A* OUI:480362* ID_OUI_FROM_DATABASE=DESAY ELECTRONICS(HUIZHOU)CO.,LTD +OUI:48066A* + ID_OUI_FROM_DATABASE=Tempered Networks, Inc. + OUI:480C49* ID_OUI_FROM_DATABASE=NAKAYO TELECOMMUNICATIONS,INC @@ -57925,6 +58135,9 @@ OUI:481A84* OUI:481BD2* ID_OUI_FROM_DATABASE=Intron Scientific co., ltd. +OUI:481D70* + ID_OUI_FROM_DATABASE=Cisco SPVTG + OUI:4826E8* ID_OUI_FROM_DATABASE=Tek-Air Systems, Inc. @@ -58006,6 +58219,9 @@ OUI:486B91* OUI:486E73* ID_OUI_FROM_DATABASE=Pica8, Inc. +OUI:486EFB* + ID_OUI_FROM_DATABASE=Davit System Technology Co., Ltd. + OUI:486FD2* ID_OUI_FROM_DATABASE=StorSimple Inc @@ -58861,6 +59077,9 @@ OUI:54112F* OUI:54115F* ID_OUI_FROM_DATABASE=Atamo Pty Ltd +OUI:541473* + ID_OUI_FROM_DATABASE=Wingtech Group (HongKong) Limited + OUI:541B5D* ID_OUI_FROM_DATABASE=Techno-Innov @@ -58954,6 +59173,9 @@ OUI:545FA9* OUI:5461EA* ID_OUI_FROM_DATABASE=Zaplox AB +OUI:5465DE* + ID_OUI_FROM_DATABASE=ARRIS Group, Inc. + OUI:54724F* ID_OUI_FROM_DATABASE=Apple @@ -59053,6 +59275,9 @@ OUI:54B620* OUI:54B753* ID_OUI_FROM_DATABASE=Hunan Fenghui Yinjia Science And Technology Co.,Ltd +OUI:54B80A* + ID_OUI_FROM_DATABASE=D-Link International + OUI:54BEF7* ID_OUI_FROM_DATABASE=PEGATRON CORPORATION @@ -59086,6 +59311,12 @@ OUI:54DF63* OUI:54E032* ID_OUI_FROM_DATABASE=Juniper Networks +OUI:54E140* + ID_OUI_FROM_DATABASE=INGENICO + +OUI:54E2C8* + ID_OUI_FROM_DATABASE=Dongguan Aoyuan Electronics Technology Co., Ltd + OUI:54E2E0* ID_OUI_FROM_DATABASE=Pace plc @@ -59134,6 +59365,9 @@ OUI:54FDBF* OUI:54FFCF* ID_OUI_FROM_DATABASE=Mopria Alliance +OUI:5804CB* + ID_OUI_FROM_DATABASE=Tianjin Huisun Technology Co.,Ltd. + OUI:580528* ID_OUI_FROM_DATABASE=LABRIS NETWORKS @@ -59185,6 +59419,9 @@ OUI:582136* OUI:58238C* ID_OUI_FROM_DATABASE=Technicolor CH USA +OUI:582AF7* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:582EFE* ID_OUI_FROM_DATABASE=Lighting Science Group @@ -59200,6 +59437,9 @@ OUI:5835D9* OUI:583CC6* ID_OUI_FROM_DATABASE=Omneality Ltd. +OUI:583F54* + ID_OUI_FROM_DATABASE=LG Electronics (Mobile Communications) + OUI:5842E4* ID_OUI_FROM_DATABASE=Sigma International General Medical Apparatus, LLC. @@ -59272,6 +59512,9 @@ OUI:586AB1* OUI:586D8F* ID_OUI_FROM_DATABASE=Cisco-Linksys, LLC +OUI:5870C6* + ID_OUI_FROM_DATABASE=Shanghai Xiaoyi Technology Co., Ltd. + OUI:587521* ID_OUI_FROM_DATABASE=CJSC RTSoft @@ -59290,6 +59533,9 @@ OUI:587BE9* OUI:587E61* ID_OUI_FROM_DATABASE=Hisense Electric Co., Ltd +OUI:587F66* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:587FB7* ID_OUI_FROM_DATABASE=SONAR INDUSTRIAL CO., LTD. @@ -59572,6 +59818,9 @@ OUI:5C57C8* OUI:5C5948* ID_OUI_FROM_DATABASE=Apple +OUI:5C5B35* + ID_OUI_FROM_DATABASE=Mist Systems, Inc. + OUI:5C5BC2* ID_OUI_FROM_DATABASE=YIK Corporation @@ -59644,6 +59893,9 @@ OUI:5C97F3* OUI:5C9AD8* ID_OUI_FROM_DATABASE=Fujitsu Limited +OUI:5CA178* + ID_OUI_FROM_DATABASE=TableTop Media (dba Ziosk) + OUI:5CA39D* ID_OUI_FROM_DATABASE=SAMSUNG ELECTRO-MECHANICS CO., LTD. @@ -59659,6 +59911,9 @@ OUI:5CAAFD* OUI:5CAC4C* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. +OUI:5CB43E* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:5CB524* ID_OUI_FROM_DATABASE=Sony Ericsson Mobile Communications AB @@ -59668,6 +59923,9 @@ OUI:5CB6CC* OUI:5CB8CB* ID_OUI_FROM_DATABASE=Allis Communications +OUI:5CB901* + ID_OUI_FROM_DATABASE=Hewlett Packard + OUI:5CBD9E* ID_OUI_FROM_DATABASE=HONGKONG MIRACLE EAGLE TECHNOLOGY(GROUP) LIMITED @@ -59713,6 +59971,9 @@ OUI:5CD998* OUI:5CDAD4* ID_OUI_FROM_DATABASE=Murata Manufacturing Co., Ltd. +OUI:5CDC96* + ID_OUI_FROM_DATABASE=Arcadyan Technology Corporation + OUI:5CDD70* ID_OUI_FROM_DATABASE=Hangzhou H3C Technologies Co., Limited @@ -59743,6 +60004,9 @@ OUI:5CE8EB* OUI:5CEB4E* ID_OUI_FROM_DATABASE=R. STAHL HMI Systems GmbH +OUI:5CEB68* + ID_OUI_FROM_DATABASE=Cheerstar Technology Co., Ltd + OUI:5CEE79* ID_OUI_FROM_DATABASE=Global Digitech Co LTD @@ -59830,6 +60094,9 @@ OUI:60190C* OUI:601929* ID_OUI_FROM_DATABASE=VOLTRONIC POWER TECHNOLOGY(SHENZHEN) CORP. +OUI:601970* + ID_OUI_FROM_DATABASE=HUIZHOU QIAOXING ELECTRONICS TECHNOLOGY CO., LTD. + OUI:601D0F* ID_OUI_FROM_DATABASE=Midnite Solar @@ -59995,6 +60262,9 @@ OUI:6099D1* OUI:609AA4* ID_OUI_FROM_DATABASE=GVI SECURITY INC. +OUI:609C9F* + ID_OUI_FROM_DATABASE=Brocade Communications Systems, Inc. + OUI:609E64* ID_OUI_FROM_DATABASE=Vivonic GmbH @@ -60109,6 +60379,9 @@ OUI:60E00E* OUI:60E327* ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD. +OUI:60E6BC* + ID_OUI_FROM_DATABASE=Sino-Telecom Technology Co.,Ltd. + OUI:60E701* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd @@ -60199,6 +60472,9 @@ OUI:641084* OUI:641225* ID_OUI_FROM_DATABASE=Cisco +OUI:64167F* + ID_OUI_FROM_DATABASE=Polycom + OUI:64168D* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. @@ -60298,6 +60574,9 @@ OUI:6455B1* OUI:645601* ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD +OUI:6459F8* + ID_OUI_FROM_DATABASE=Vodafone Omnitel B.V. + OUI:645A04* ID_OUI_FROM_DATABASE=Chicony Electronics Co., Ltd. @@ -60331,6 +60610,9 @@ OUI:64680C* OUI:6469BC* ID_OUI_FROM_DATABASE=Hytera Communications Co .,ltd +OUI:646A52* + ID_OUI_FROM_DATABASE=Avaya, Inc + OUI:646CB2* ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd @@ -60455,7 +60737,7 @@ OUI:64B310* ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd OUI:64B370* - ID_OUI_FROM_DATABASE=PowerComm Solutons LLC + ID_OUI_FROM_DATABASE=PowerComm Solutions LLC OUI:64B473* ID_OUI_FROM_DATABASE=Xiaomi inc. @@ -60517,6 +60799,9 @@ OUI:64D989* OUI:64DB18* ID_OUI_FROM_DATABASE=OpenPattern +OUI:64DB81* + ID_OUI_FROM_DATABASE=Syszone Co., Ltd. + OUI:64DC01* ID_OUI_FROM_DATABASE=Static Systems Group PLC @@ -60781,12 +61066,21 @@ OUI:689C5E* OUI:689C70* ID_OUI_FROM_DATABASE=Apple +OUI:689CE2* + ID_OUI_FROM_DATABASE=Cisco + +OUI:689E19* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:68A0F6* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd OUI:68A1B7* ID_OUI_FROM_DATABASE=Honghao Mingchuan Technology (Beijing) CO.,Ltd. +OUI:68A378* + ID_OUI_FROM_DATABASE=FREEBOX SAS + OUI:68A3C4* ID_OUI_FROM_DATABASE=Liteon Technology Corporation @@ -60943,6 +61237,9 @@ OUI:6C1811* OUI:6C198F* ID_OUI_FROM_DATABASE=D-Link International +OUI:6C1E70* + ID_OUI_FROM_DATABASE=Guangzhou YBDS IT Co.,Ltd + OUI:6C2056* ID_OUI_FROM_DATABASE=Cisco @@ -61006,6 +61303,12 @@ OUI:6C40C6* OUI:6C416A* ID_OUI_FROM_DATABASE=Cisco +OUI:6C4418* + ID_OUI_FROM_DATABASE=Zappware + +OUI:6C4598* + ID_OUI_FROM_DATABASE=Antex Electronic Corp. + OUI:6C4B7F* ID_OUI_FROM_DATABASE=Vossloh-Schwabe Deutschland GmbH @@ -61015,6 +61318,9 @@ OUI:6C504D* OUI:6C5779* ID_OUI_FROM_DATABASE=Aclima, Inc. +OUI:6C5940* + ID_OUI_FROM_DATABASE=SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD. + OUI:6C5A34* ID_OUI_FROM_DATABASE=Shenzhen Haitianxiong Electronic Co., Ltd. @@ -61114,6 +61420,9 @@ OUI:6C9CED* OUI:6CA682* ID_OUI_FROM_DATABASE=EDAM information & communications +OUI:6CA75F* + ID_OUI_FROM_DATABASE=zte corporation + OUI:6CA780* ID_OUI_FROM_DATABASE=Nokia Corporation @@ -61249,6 +61558,9 @@ OUI:6CFDB9* OUI:6CFFBE* ID_OUI_FROM_DATABASE=MPB Communications Inc. +OUI:700136* + ID_OUI_FROM_DATABASE=FATEK Automation Corporation + OUI:700258* ID_OUI_FROM_DATABASE=01DB-METRAVIB @@ -61273,6 +61585,9 @@ OUI:701124* OUI:701404* ID_OUI_FROM_DATABASE=Limited Liability Company +OUI:7014A6* + ID_OUI_FROM_DATABASE=Apple, Inc. + OUI:70188B* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. @@ -61414,6 +61729,9 @@ OUI:706417* OUI:706582* ID_OUI_FROM_DATABASE=Suzhou Hanming Technologies Co., Ltd. +OUI:706879* + ID_OUI_FROM_DATABASE=Saijo Denki International Co., Ltd. + OUI:70704C* ID_OUI_FROM_DATABASE=Purple Communications, Inc @@ -61447,6 +61765,9 @@ OUI:7076F0* OUI:7076FF* ID_OUI_FROM_DATABASE=KERLINK +OUI:707781* + ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. + OUI:707BE8* ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD @@ -61495,6 +61816,9 @@ OUI:709BA5* OUI:709BFC* ID_OUI_FROM_DATABASE=Bryton Inc. +OUI:709C8F* + ID_OUI_FROM_DATABASE=Nero AG + OUI:709E29* ID_OUI_FROM_DATABASE=Sony Computer Entertainment Inc. @@ -61597,6 +61921,9 @@ OUI:70E24C* OUI:70E284* ID_OUI_FROM_DATABASE=Wistron InfoComm(Zhongshan) Corporation +OUI:70E72C* + ID_OUI_FROM_DATABASE=Apple + OUI:70E843* ID_OUI_FROM_DATABASE=Beijing C&W Optical Communication Technology Co.,Ltd. @@ -61636,6 +61963,9 @@ OUI:70FF76* OUI:7403BD* ID_OUI_FROM_DATABASE=Buffalo Inc. +OUI:74042B* + ID_OUI_FROM_DATABASE=Lenovo Mobile Communication (Wuhan) Company Limited + OUI:740ABC* ID_OUI_FROM_DATABASE=JSJS Designs (Europe) Limited @@ -61714,6 +62044,9 @@ OUI:744BE9* OUI:744D79* ID_OUI_FROM_DATABASE=Arrive Systems Inc. +OUI:7451BA* + ID_OUI_FROM_DATABASE=XIAOMI INC + OUI:745327* ID_OUI_FROM_DATABASE=COMMSEN CO., LIMITED @@ -61747,6 +62080,9 @@ OUI:7465D1* OUI:746630* ID_OUI_FROM_DATABASE=T:mi Ytti +OUI:746A3A* + ID_OUI_FROM_DATABASE=Aperi Corporation + OUI:746A89* ID_OUI_FROM_DATABASE=Rezolt Corporation @@ -61840,6 +62176,9 @@ OUI:74A02F* OUI:74A063* ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD +OUI:74A2E6* + ID_OUI_FROM_DATABASE=Cisco + OUI:74A34A* ID_OUI_FROM_DATABASE=ZIMI CORPORATION @@ -62137,6 +62476,9 @@ OUI:785968* OUI:785C72* ID_OUI_FROM_DATABASE=Hioso Technology Co., Ltd. +OUI:785F4C* + ID_OUI_FROM_DATABASE=Argox Information Co., Ltd. + OUI:78617C* ID_OUI_FROM_DATABASE=MITSUMI ELECTRIC CO.,LTD @@ -62446,6 +62788,9 @@ OUI:7C0ECE* OUI:7C11BE* ID_OUI_FROM_DATABASE=Apple +OUI:7C11CD* + ID_OUI_FROM_DATABASE=QianTang Technology + OUI:7C1476* ID_OUI_FROM_DATABASE=Damall Technologies SAS @@ -62761,6 +63106,9 @@ OUI:7CE9D3* OUI:7CEBEA* ID_OUI_FROM_DATABASE=ASCT +OUI:7CEC79* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:7CED8D* ID_OUI_FROM_DATABASE=MICROSOFT @@ -62782,6 +63130,9 @@ OUI:7CF0BA* OUI:7CF429* ID_OUI_FROM_DATABASE=NUUO Inc. +OUI:7CF854* + ID_OUI_FROM_DATABASE=Samsung Electronics + OUI:7CFADF* ID_OUI_FROM_DATABASE=Apple @@ -62803,6 +63154,9 @@ OUI:800010* OUI:80006E* ID_OUI_FROM_DATABASE=Apple +OUI:800184* + ID_OUI_FROM_DATABASE=HTC Corporation + OUI:8005DF* ID_OUI_FROM_DATABASE=Montage Technology Group Limited @@ -62851,6 +63205,9 @@ OUI:8020AF* OUI:802275* ID_OUI_FROM_DATABASE=Beijing Beny Wave Technology Co Ltd +OUI:802AA8* + ID_OUI_FROM_DATABASE=Ubiquiti Networks, Inc. + OUI:802AFA* ID_OUI_FROM_DATABASE=Germaneers GmbH @@ -62869,6 +63226,9 @@ OUI:803457* OUI:803773* ID_OUI_FROM_DATABASE=Netgear Inc +OUI:8038BC* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:8038FD* ID_OUI_FROM_DATABASE=LeapFrog Enterprises, Inc. @@ -62908,6 +63268,9 @@ OUI:804F58* OUI:80501B* ID_OUI_FROM_DATABASE=Nokia Corporation +OUI:805067* + ID_OUI_FROM_DATABASE=W & D TECHNOLOGY CORPORATION + OUI:8056F2* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. @@ -62953,6 +63316,9 @@ OUI:80711F* OUI:80717A* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd +OUI:807459* + ID_OUI_FROM_DATABASE=K's Co.,Ltd. + OUI:807693* ID_OUI_FROM_DATABASE=Newag SA @@ -63097,6 +63463,9 @@ OUI:80D733* OUI:80DB31* ID_OUI_FROM_DATABASE=Power Quotient International Co., Ltd. +OUI:80E4DA* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:80E650* ID_OUI_FROM_DATABASE=Apple @@ -63409,6 +63778,9 @@ OUI:84B153* OUI:84B59C* ID_OUI_FROM_DATABASE=Juniper networks +OUI:84B802* + ID_OUI_FROM_DATABASE=Cisco + OUI:84C2E4* ID_OUI_FROM_DATABASE=Jiangsu Qinheng Co., Ltd. @@ -63454,6 +63826,9 @@ OUI:84DE3D* OUI:84DF0C* ID_OUI_FROM_DATABASE=NET2GRID BV +OUI:84DF19* + ID_OUI_FROM_DATABASE=Chuango Security Technology Corporation + OUI:84E058* ID_OUI_FROM_DATABASE=Pace plc @@ -63475,6 +63850,9 @@ OUI:84EB18* OUI:84ED33* ID_OUI_FROM_DATABASE=BBMC Co.,Ltd +OUI:84F129* + ID_OUI_FROM_DATABASE=Metrascale Inc. + OUI:84F493* ID_OUI_FROM_DATABASE=OMS spol. s.r.o. @@ -63535,6 +63913,9 @@ OUI:8823FE* OUI:88252C* ID_OUI_FROM_DATABASE=Arcadyan Technology Corporation +OUI:882593* + ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD + OUI:882950* ID_OUI_FROM_DATABASE=Dalian Netmoon Tech Develop Co.,Ltd @@ -63550,6 +63931,9 @@ OUI:88329B* OUI:883314* ID_OUI_FROM_DATABASE=Texas Instruments +OUI:8833BE* + ID_OUI_FROM_DATABASE=Ivenix, Inc. + OUI:88354C* ID_OUI_FROM_DATABASE=Transics @@ -63613,6 +63997,9 @@ OUI:88685C* OUI:886B76* ID_OUI_FROM_DATABASE=CHINA HOPEFUL GROUP HOPEFUL ELECTRIC CO.,LTD +OUI:887033* + ID_OUI_FROM_DATABASE=Hangzhou Silan Microelectronic Inc + OUI:88708C* ID_OUI_FROM_DATABASE=Lenovo Mobile Communication Technology Ltd. @@ -63685,6 +64072,9 @@ OUI:889CA6* OUI:889FFA* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. +OUI:88A25E* + ID_OUI_FROM_DATABASE=juniper networks + OUI:88A3CC* ID_OUI_FROM_DATABASE=Amatis Controls @@ -63733,6 +64123,9 @@ OUI:88CB87* OUI:88CEFA* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd +OUI:88D37B* + ID_OUI_FROM_DATABASE=FirmTek, LLC + OUI:88D7BC* ID_OUI_FROM_DATABASE=DEP Company @@ -63856,6 +64249,9 @@ OUI:8C3330* OUI:8C3357* ID_OUI_FROM_DATABASE=HiteVision Digital Media Technology Co.,Ltd. +OUI:8C34FD* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:8C3AE3* ID_OUI_FROM_DATABASE=LG Electronics @@ -63955,6 +64351,9 @@ OUI:8C7712* OUI:8C7716* ID_OUI_FROM_DATABASE=LONGCHEER TELECOMMUNICATION LIMITED +OUI:8C7967* + ID_OUI_FROM_DATABASE=zte corporation + OUI:8C7B9D* ID_OUI_FROM_DATABASE=Apple @@ -63985,6 +64384,9 @@ OUI:8C89A5* OUI:8C8A6E* ID_OUI_FROM_DATABASE=ESTUN AUTOMATION TECHNOLOY CO., LTD +OUI:8C8B83* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:8C8E76* ID_OUI_FROM_DATABASE=taskit GmbH @@ -64099,6 +64501,9 @@ OUI:8CE7B3* OUI:8CEEC6* ID_OUI_FROM_DATABASE=Precepscion Pty. Ltd. +OUI:8CF228* + ID_OUI_FROM_DATABASE=SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD. + OUI:8CF813* ID_OUI_FROM_DATABASE=ORANGE POLSKA @@ -64135,6 +64540,9 @@ OUI:9003B7* OUI:900917* ID_OUI_FROM_DATABASE=Far-sighted mobile +OUI:900A39* + ID_OUI_FROM_DATABASE=Wiio, Inc. + OUI:900A3A* ID_OUI_FROM_DATABASE=PSG Plastic Service GmbH @@ -64198,6 +64606,9 @@ OUI:902B34* OUI:902CC7* ID_OUI_FROM_DATABASE=C-MAX Asia Limited +OUI:902E1C* + ID_OUI_FROM_DATABASE=Intel Corporate + OUI:902E87* ID_OUI_FROM_DATABASE=LabJack @@ -64219,6 +64630,9 @@ OUI:9038DF* OUI:903AA0* ID_OUI_FROM_DATABASE=Alcatel-Lucent +OUI:903C92* + ID_OUI_FROM_DATABASE=Apple + OUI:903CAE* ID_OUI_FROM_DATABASE=Yunnan KSEC Digital Technology Co.,Ltd. @@ -64256,7 +64670,7 @@ OUI:90507B* ID_OUI_FROM_DATABASE=Advanced PANMOBIL Systems GmbH & Co. KG OUI:90513F* - ID_OUI_FROM_DATABASE=Elettronica Santerno + ID_OUI_FROM_DATABASE=Elettronica Santerno SpA OUI:905446* ID_OUI_FROM_DATABASE=TES ELECTRONIC SOLUTIONS @@ -64285,6 +64699,9 @@ OUI:90610C* OUI:906717* ID_OUI_FROM_DATABASE=Alphion India Private Limited +OUI:90671C* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:9067B5* ID_OUI_FROM_DATABASE=Alcatel-Lucent @@ -64381,6 +64798,9 @@ OUI:909F33* OUI:909F43* ID_OUI_FROM_DATABASE=Accutron Instruments Inc. +OUI:90A210* + ID_OUI_FROM_DATABASE=United Telecoms Ltd + OUI:90A2DA* ID_OUI_FROM_DATABASE=GHEO SA @@ -64426,6 +64846,9 @@ OUI:90C115* OUI:90C35F* ID_OUI_FROM_DATABASE=Nanjing Jiahao Technology Co., Ltd. +OUI:90C682* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:90C792* ID_OUI_FROM_DATABASE=ARRIS Group, Inc. @@ -64606,6 +65029,9 @@ OUI:944696* OUI:944A09* ID_OUI_FROM_DATABASE=BitWise Controls +OUI:944A0C* + ID_OUI_FROM_DATABASE=Sercomm Corporation + OUI:945047* ID_OUI_FROM_DATABASE=Rechnerbetriebsgruppe @@ -64642,6 +65068,9 @@ OUI:9471AC* OUI:94756E* ID_OUI_FROM_DATABASE=QinetiQ North America +OUI:94772B* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:947C3E* ID_OUI_FROM_DATABASE=Polewall Norge AS @@ -64693,6 +65122,9 @@ OUI:949FB4* OUI:94A1A2* ID_OUI_FROM_DATABASE=AMPAK Technology Inc. +OUI:94A7B7* + ID_OUI_FROM_DATABASE=zte corporation + OUI:94A7BC* ID_OUI_FROM_DATABASE=BodyMedia, Inc. @@ -64834,6 +65266,9 @@ OUI:94EBCD* OUI:94F19E* ID_OUI_FROM_DATABASE=HUIZHOU MAORONG INTELLIGENT TECHNOLOGY CO.,LTD +OUI:94F665* + ID_OUI_FROM_DATABASE=Ruckus Wireless + OUI:94F692* ID_OUI_FROM_DATABASE=Geminico co.,Ltd. @@ -64858,6 +65293,9 @@ OUI:94FEF4* OUI:980284* ID_OUI_FROM_DATABASE=Theobroma Systems GmbH +OUI:9802D8* + ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information. + OUI:9803A0* ID_OUI_FROM_DATABASE=ABB n.v. Power Quality Products @@ -64966,6 +65404,9 @@ OUI:98588A* OUI:985945* ID_OUI_FROM_DATABASE=Texas Instruments +OUI:985AEB* + ID_OUI_FROM_DATABASE=Apple, Inc. + OUI:985C93* ID_OUI_FROM_DATABASE=SBG Systems SAS @@ -64999,12 +65440,18 @@ OUI:9876B6* OUI:987770* ID_OUI_FROM_DATABASE=Pep Digital Technology (Guangzhou) Co., Ltd +OUI:987BF3* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:987E46* ID_OUI_FROM_DATABASE=Emizon Networks Limited OUI:988217* ID_OUI_FROM_DATABASE=Disruptive Ltd +OUI:988389* + ID_OUI_FROM_DATABASE=Samsung Electronics Co.,LTD + OUI:9886B1* ID_OUI_FROM_DATABASE=Flyaudio corporation (China) @@ -65089,6 +65536,9 @@ OUI:98DA92* OUI:98DCD9* ID_OUI_FROM_DATABASE=UNITEC Co., Ltd. +OUI:98E0D9* + ID_OUI_FROM_DATABASE=Apple + OUI:98E165* ID_OUI_FROM_DATABASE=Accutome @@ -65194,6 +65644,9 @@ OUI:9C28EF* OUI:9C2A70* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. +OUI:9C3066* + ID_OUI_FROM_DATABASE=RWE Effizienz GmbH + OUI:9C3178* ID_OUI_FROM_DATABASE=Foshan Huadian Intelligent Communications Teachnologies Co.,Ltd @@ -65203,6 +65656,12 @@ OUI:9C31B6* OUI:9C3583* ID_OUI_FROM_DATABASE=Nipro Diagnostics, Inc +OUI:9C35EB* + ID_OUI_FROM_DATABASE=Apple, Inc. + +OUI:9C37F4* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:9C3AAF* ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd @@ -65377,6 +65836,9 @@ OUI:9CB206* OUI:9CB654* ID_OUI_FROM_DATABASE=Hewlett Packard +OUI:9CB6D0* + ID_OUI_FROM_DATABASE=Rivet Networks + OUI:9CB70D* ID_OUI_FROM_DATABASE=Liteon Technology Corporation @@ -65389,6 +65851,9 @@ OUI:9CBB98* OUI:9CBD9D* ID_OUI_FROM_DATABASE=SkyDisk, Inc. +OUI:9CBEE0* + ID_OUI_FROM_DATABASE=Biosoundlab Co., Ltd. + OUI:9CC077* ID_OUI_FROM_DATABASE=PrintCounts, LLC @@ -65504,7 +65969,7 @@ OUI:A012DB* ID_OUI_FROM_DATABASE=TABUCHI ELECTRIC CO.,LTD OUI:A0133B* - ID_OUI_FROM_DATABASE=Copyright © HiTi Digital, Inc. + ID_OUI_FROM_DATABASE=HiTi Digital, Inc. OUI:A0143D* ID_OUI_FROM_DATABASE=PARROT SA @@ -65575,9 +66040,15 @@ OUI:A04CC1* OUI:A04E04* ID_OUI_FROM_DATABASE=Nokia Corporation +OUI:A04FD4* + ID_OUI_FROM_DATABASE=ADB Broadband Italia + OUI:A051C6* ID_OUI_FROM_DATABASE=Avaya, Inc +OUI:A0554F* + ID_OUI_FROM_DATABASE=Cisco + OUI:A055DE* ID_OUI_FROM_DATABASE=Pace plc @@ -65602,6 +66073,9 @@ OUI:A05DE7* OUI:A05E6B* ID_OUI_FROM_DATABASE=MELPER Co., Ltd. +OUI:A06391* + ID_OUI_FROM_DATABASE=Netgear Inc. + OUI:A06518* ID_OUI_FROM_DATABASE=VNPT TECHNOLOGY @@ -65650,6 +66124,9 @@ OUI:A082C7* OUI:A0861D* ID_OUI_FROM_DATABASE=Chengdu Fuhuaxin Technology co.,Ltd +OUI:A086C6* + ID_OUI_FROM_DATABASE=XIAOMI INC + OUI:A086EC* ID_OUI_FROM_DATABASE=SAEHAN HITEC Co., Ltd @@ -65683,6 +66160,9 @@ OUI:A09805* OUI:A098ED* ID_OUI_FROM_DATABASE=Shandong Intelligent Optical Communication Development Co., Ltd. +OUI:A0999B* + ID_OUI_FROM_DATABASE=Apple + OUI:A09A5A* ID_OUI_FROM_DATABASE=Time Domain @@ -65716,6 +66196,9 @@ OUI:A0B100* OUI:A0B3CC* ID_OUI_FROM_DATABASE=Hewlett Packard +OUI:A0B437* + ID_OUI_FROM_DATABASE=GENERAL DYNAMICS C4 SYSEMS + OUI:A0B4A5* ID_OUI_FROM_DATABASE=Samsung Elec Co.,Ltd @@ -65839,6 +66322,12 @@ OUI:A0F450* OUI:A0F459* ID_OUI_FROM_DATABASE=FN-LINK TECHNOLOGY LIMITED +OUI:A0F6FD* + ID_OUI_FROM_DATABASE=Texas Instruments + +OUI:A0F849* + ID_OUI_FROM_DATABASE=Cisco + OUI:A0FC6E* ID_OUI_FROM_DATABASE=Telegrafia a.s. @@ -65851,6 +66340,9 @@ OUI:A40130* OUI:A4059E* ID_OUI_FROM_DATABASE=STA Infinity LLP +OUI:A408EA* + ID_OUI_FROM_DATABASE=Murata Manufacturing Co., Ltd. + OUI:A409CB* ID_OUI_FROM_DATABASE=Alfred Kaercher GmbH & Co KG @@ -65908,6 +66400,9 @@ OUI:A42C08* OUI:A433D1* ID_OUI_FROM_DATABASE=Fibrlink Communications Co.,Ltd. +OUI:A434D9* + ID_OUI_FROM_DATABASE=Intel Corporate + OUI:A438FC* ID_OUI_FROM_DATABASE=Plastic Logic @@ -65950,6 +66445,9 @@ OUI:A45055* OUI:A4526F* ID_OUI_FROM_DATABASE=ADB Broadband Italia +OUI:A45602* + ID_OUI_FROM_DATABASE=fenglian Technology Co.,Ltd. + OUI:A4561B* ID_OUI_FROM_DATABASE=MCOT Corporation @@ -66001,6 +66499,9 @@ OUI:A47AA4* OUI:A47ACF* ID_OUI_FROM_DATABASE=VIBICOM COMMUNICATIONS INC. +OUI:A47B85* + ID_OUI_FROM_DATABASE=ULTIMEDIA Co Ltd, + OUI:A47C14* ID_OUI_FROM_DATABASE=ChargeStorm AB @@ -66058,6 +66559,9 @@ OUI:A49F89* OUI:A4A1C2* ID_OUI_FROM_DATABASE=Ericsson AB (EAB) +OUI:A4A1E4* + ID_OUI_FROM_DATABASE=Innotube, Inc. + OUI:A4A24A* ID_OUI_FROM_DATABASE=Cisco SPVTG @@ -66232,6 +66736,9 @@ OUI:A81758* OUI:A81B18* ID_OUI_FROM_DATABASE=XTS CORP +OUI:A81B5A* + ID_OUI_FROM_DATABASE=GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD. + OUI:A81B5D* ID_OUI_FROM_DATABASE=Foxtel Management Pty Ltd @@ -66313,6 +66820,9 @@ OUI:A86405* OUI:A865B2* ID_OUI_FROM_DATABASE=DONGGUAN YISHANG ELECTRONIC TECHNOLOGY CO., LIMITED +OUI:A8667F* + ID_OUI_FROM_DATABASE=Apple, Inc. + OUI:A86A6F* ID_OUI_FROM_DATABASE=RIM @@ -66337,9 +66847,15 @@ OUI:A87C01* OUI:A87E33* ID_OUI_FROM_DATABASE=Nokia Danmark A/S +OUI:A88038* + ID_OUI_FROM_DATABASE=ShenZhen MovingComm Technology Co., Limited + OUI:A881F1* ID_OUI_FROM_DATABASE=BMEYE B.V. +OUI:A8827F* + ID_OUI_FROM_DATABASE=CIBN Oriental Network(Beijing) CO.,Ltd + OUI:A886DD* ID_OUI_FROM_DATABASE=Apple, Inc. @@ -66445,6 +66961,9 @@ OUI:A8D236* OUI:A8D3C8* ID_OUI_FROM_DATABASE=Wachendorff Elektronik GmbH & Co. KG +OUI:A8D409* + ID_OUI_FROM_DATABASE=USA 111 Inc + OUI:A8D88A* ID_OUI_FROM_DATABASE=Wyconn @@ -66619,6 +67138,9 @@ OUI:AC51EE* OUI:AC54EC* ID_OUI_FROM_DATABASE=IEEE P1823 Standards Working Group +OUI:AC562C* + ID_OUI_FROM_DATABASE=LAVA INTERNATIONAL(H.K) LIMITED + OUI:AC583B* ID_OUI_FROM_DATABASE=Human Assembler, Inc. @@ -66706,6 +67228,9 @@ OUI:AC9403* OUI:AC9A96* ID_OUI_FROM_DATABASE=Lantiq Deutschland GmbH +OUI:AC9B0A* + ID_OUI_FROM_DATABASE=Sony Corporation + OUI:AC9B84* ID_OUI_FROM_DATABASE=Smak Tecnologia e Automacao @@ -66826,6 +67351,9 @@ OUI:ACD9D6* OUI:ACDBDA* ID_OUI_FROM_DATABASE=Shenzhen Geniatech Inc, Ltd +OUI:ACE010* + ID_OUI_FROM_DATABASE=Liteon Technology Corporation + OUI:ACE069* ID_OUI_FROM_DATABASE=ISAAC Instruments @@ -66886,6 +67414,9 @@ OUI:B000B4* OUI:B00594* ID_OUI_FROM_DATABASE=Liteon Technology Corporation +OUI:B008BF* + ID_OUI_FROM_DATABASE=Vital Connect, Inc. + OUI:B009D3* ID_OUI_FROM_DATABASE=Avizia @@ -67045,6 +67576,9 @@ OUI:B09134* OUI:B09137* ID_OUI_FROM_DATABASE=ISis ImageStream Internet Solutions, Inc +OUI:B0966C* + ID_OUI_FROM_DATABASE=Lanbowan Technology Ltd. + OUI:B0973A* ID_OUI_FROM_DATABASE=E-Fuel Corporation @@ -67081,6 +67615,9 @@ OUI:B0A86E* OUI:B0AA36* ID_OUI_FROM_DATABASE=GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD. +OUI:B0AA77* + ID_OUI_FROM_DATABASE=Cisco + OUI:B0ACFA* ID_OUI_FROM_DATABASE=Fujitsu Limited @@ -67108,6 +67645,9 @@ OUI:B0BDA1* OUI:B0BF99* ID_OUI_FROM_DATABASE=WIZITDONGDO +OUI:B0C287* + ID_OUI_FROM_DATABASE=Technicolor CH USA Inc + OUI:B0C4E7* ID_OUI_FROM_DATABASE=Samsung Electronics @@ -67348,6 +67888,9 @@ OUI:B46698* OUI:B467E9* ID_OUI_FROM_DATABASE=Qingdao GoerTek Technology Co., Ltd. +OUI:B46D35* + ID_OUI_FROM_DATABASE=Dalian Seasky Automation Co;Ltd + OUI:B47356* ID_OUI_FROM_DATABASE=Hangzhou Treebear Networking Co., Ltd. @@ -67438,6 +67981,9 @@ OUI:B4AE6F* OUI:B4B017* ID_OUI_FROM_DATABASE=Avaya, Inc +OUI:B4B265* + ID_OUI_FROM_DATABASE=DAEHO I&T + OUI:B4B362* ID_OUI_FROM_DATABASE=ZTE Corporation @@ -67690,6 +68236,9 @@ OUI:B877C3* OUI:B8782E* ID_OUI_FROM_DATABASE=Apple +OUI:B87879* + ID_OUI_FROM_DATABASE=Roche Diagnostics GmbH + OUI:B8797E* ID_OUI_FROM_DATABASE=Secure Meters (UK) Limited @@ -67747,6 +68296,9 @@ OUI:B898F7* OUI:B89919* ID_OUI_FROM_DATABASE=7signal Solutions, Inc +OUI:B89ACD* + ID_OUI_FROM_DATABASE=ELITE OPTOELECTRONIC(ASIA)CO.,LTD + OUI:B89AED* ID_OUI_FROM_DATABASE=OceanServer Technology, Inc @@ -67789,6 +68341,9 @@ OUI:B8B42E* OUI:B8B7D7* ID_OUI_FROM_DATABASE=2GIG Technologies +OUI:B8B81E* + ID_OUI_FROM_DATABASE=Intel Corporate + OUI:B8B94E* ID_OUI_FROM_DATABASE=Shenzhen iBaby Labs, Inc. @@ -67801,6 +68356,9 @@ OUI:B8BA72* OUI:B8BB6D* ID_OUI_FROM_DATABASE=ENERES Co.,Ltd. +OUI:B8BC1B* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:B8BD79* ID_OUI_FROM_DATABASE=TrendPoint Systems @@ -67813,6 +68371,9 @@ OUI:B8BF83* OUI:B8C1A2* ID_OUI_FROM_DATABASE=Dragon Path Technologies Co., Limited +OUI:B8C3BF* + ID_OUI_FROM_DATABASE=Henan Chengshi NetWork Technology Co.,Ltd + OUI:B8C46F* ID_OUI_FROM_DATABASE=PRIMMCON INDUSTRIES INC @@ -67930,6 +68491,9 @@ OUI:BC0DA5* OUI:BC0F2B* ID_OUI_FROM_DATABASE=FORTUNE TECHGROUP CO.,LTD +OUI:BC0F64* + ID_OUI_FROM_DATABASE=Intel Corporate + OUI:BC125E* ID_OUI_FROM_DATABASE=Beijing WisVideo INC. @@ -67960,6 +68524,9 @@ OUI:BC20A4* OUI:BC20BA* ID_OUI_FROM_DATABASE=Inspur (Shandong) Electronic Information Co., Ltd +OUI:BC25E0* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:BC25F0* ID_OUI_FROM_DATABASE=3D Display Technologies Co., Ltd. @@ -68047,6 +68614,9 @@ OUI:BC52B7* OUI:BC54F9* ID_OUI_FROM_DATABASE=Drogoo Technology Co., Ltd. +OUI:BC5C4C* + ID_OUI_FROM_DATABASE=ELECOM CO.,LTD. + OUI:BC5FF4* ID_OUI_FROM_DATABASE=ASRock Incorporation @@ -68074,6 +68644,9 @@ OUI:BC6A16* OUI:BC6A29* ID_OUI_FROM_DATABASE=Texas Instruments +OUI:BC6A2F* + ID_OUI_FROM_DATABASE=Henge Docks LLC + OUI:BC6B4D* ID_OUI_FROM_DATABASE=Alcatel-Lucent @@ -68194,6 +68767,9 @@ OUI:BCC23A* OUI:BCC342* ID_OUI_FROM_DATABASE=Panasonic System Networks Co., Ltd. +OUI:BCC493* + ID_OUI_FROM_DATABASE=Cisco + OUI:BCC61A* ID_OUI_FROM_DATABASE=SPECTRA EMBEDDED SYSTEMS @@ -68248,6 +68824,9 @@ OUI:BCEC23* OUI:BCEE7B* ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. +OUI:BCF1F2* + ID_OUI_FROM_DATABASE=Cisco + OUI:BCF2AF* ID_OUI_FROM_DATABASE=devolo AG @@ -68260,12 +68839,18 @@ OUI:BCF61C* OUI:BCF685* ID_OUI_FROM_DATABASE=D-Link International +OUI:BCF811* + ID_OUI_FROM_DATABASE=Xiamen DNAKE Technology Co.,Ltd + OUI:BCFE8C* ID_OUI_FROM_DATABASE=Altronic, LLC OUI:BCFFAC* ID_OUI_FROM_DATABASE=TOPCON CORPORATION +OUI:C005C2* + ID_OUI_FROM_DATABASE=ARRIS Group, Inc. + OUI:C00D7E* ID_OUI_FROM_DATABASE=Additech, Inc. @@ -68293,6 +68878,9 @@ OUI:C02506* OUI:C0255C* ID_OUI_FROM_DATABASE=Cisco +OUI:C02567* + ID_OUI_FROM_DATABASE=Nexxt Solutions + OUI:C027B9* ID_OUI_FROM_DATABASE=Beijing National Railway Research & Design Institute of Signal & Communication Co., Ltd. @@ -68449,6 +69037,9 @@ OUI:C09879* OUI:C098E5* ID_OUI_FROM_DATABASE=University of Michigan +OUI:C09A71* + ID_OUI_FROM_DATABASE=XIAMEN MEITU MOBILE TECHNOLOGY CO.LTD + OUI:C09C92* ID_OUI_FROM_DATABASE=COBY @@ -68524,6 +69115,9 @@ OUI:C0C946* OUI:C0CB38* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind. Co.,Ltd. +OUI:C0CECD* + ID_OUI_FROM_DATABASE=Apple + OUI:C0CFA3* ID_OUI_FROM_DATABASE=Creative Electronics & Software, Inc. @@ -68536,6 +69130,9 @@ OUI:C0D962* OUI:C0DA74* ID_OUI_FROM_DATABASE=Hangzhou Sunyard Technology Co., Ltd. +OUI:C0DC6A* + ID_OUI_FROM_DATABASE=Qingdao Eastsoft Communication Technology Co.,LTD + OUI:C0DF77* ID_OUI_FROM_DATABASE=Conrad Electronic SE @@ -68590,6 +69187,9 @@ OUI:C40415* OUI:C40528* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd +OUI:C4072F* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:C4084A* ID_OUI_FROM_DATABASE=Alcatel-Lucent @@ -68611,6 +69211,9 @@ OUI:C40F09* OUI:C4108A* ID_OUI_FROM_DATABASE=Ruckus Wireless +OUI:C413E2* + ID_OUI_FROM_DATABASE=Aerohive Networks Inc. + OUI:C4143C* ID_OUI_FROM_DATABASE=Cisco @@ -68650,6 +69253,9 @@ OUI:C4291D* OUI:C42C03* ID_OUI_FROM_DATABASE=Apple +OUI:C42F90* + ID_OUI_FROM_DATABASE=Hangzhou Hikvision Digital Technology Co.,Ltd. + OUI:C4346B* ID_OUI_FROM_DATABASE=Hewlett Packard @@ -68758,6 +69364,9 @@ OUI:C46413* OUI:C467B5* ID_OUI_FROM_DATABASE=Libratone A/S +OUI:C4693E* + ID_OUI_FROM_DATABASE=Turbulence Design Inc. + OUI:C46AB7* ID_OUI_FROM_DATABASE=Xiaomi Technology,Inc. @@ -68776,6 +69385,9 @@ OUI:C47130* OUI:C471FE* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. +OUI:C47295* + ID_OUI_FROM_DATABASE=Cisco + OUI:C4731E* ID_OUI_FROM_DATABASE=Samsung Eletronics Co., Ltd @@ -68833,6 +69445,9 @@ OUI:C495A2* OUI:C49805* ID_OUI_FROM_DATABASE=Minieum Networks, Inc +OUI:C49A02* + ID_OUI_FROM_DATABASE=LG Electronics (Mobile Communicaitons) + OUI:C4A81D* ID_OUI_FROM_DATABASE=D-Link International @@ -68848,6 +69463,9 @@ OUI:C4B512* OUI:C4BA99* ID_OUI_FROM_DATABASE=I+ME Actia Informatik und Mikro-Elektronik GmbH +OUI:C4BAA3* + ID_OUI_FROM_DATABASE=Beijing Winicssec Technologies Co., Ltd. + OUI:C4BD6A* ID_OUI_FROM_DATABASE=SKF GmbH @@ -68867,7 +69485,7 @@ OUI:C4C919* ID_OUI_FROM_DATABASE=Energy Imports Ltd OUI:C4C9EC* - ID_OUI_FROM_DATABASE=D&D GROUP sp. z o.o. + ID_OUI_FROM_DATABASE=Gugaoo HK Limited OUI:C4CAD9* ID_OUI_FROM_DATABASE=Hangzhou H3C Technologies Co., Limited @@ -68923,6 +69541,9 @@ OUI:C4F57C* OUI:C4FCE4* ID_OUI_FROM_DATABASE=DishTV NZ Ltd +OUI:C80084* + ID_OUI_FROM_DATABASE=Cisco + OUI:C80210* ID_OUI_FROM_DATABASE=LG Innotek @@ -69007,12 +69628,18 @@ OUI:C83E99* OUI:C83EA7* ID_OUI_FROM_DATABASE=KUNBUS GmbH +OUI:C83FB4* + ID_OUI_FROM_DATABASE=ARRIS Group, Inc. + OUI:C84529* ID_OUI_FROM_DATABASE=IMK Networks Co.,Ltd OUI:C84544* ID_OUI_FROM_DATABASE=Shanghai Enlogic Electric Technology Co., Ltd. +OUI:C8458F* + ID_OUI_FROM_DATABASE=Wyler AG + OUI:C848F5* ID_OUI_FROM_DATABASE=MEDISON Xray Co., Ltd @@ -69160,6 +69787,9 @@ OUI:C8C126* OUI:C8C13C* ID_OUI_FROM_DATABASE=RuggedTek Hangzhou Co., Ltd +OUI:C8C50E* + ID_OUI_FROM_DATABASE=Shenzhen Primestone Network Technologies.Co., Ltd. + OUI:C8C791* ID_OUI_FROM_DATABASE=Zero1.tv GmbH @@ -69214,6 +69844,9 @@ OUI:C8DF7C* OUI:C8E0EB* ID_OUI_FROM_DATABASE=Apple +OUI:C8E130* + ID_OUI_FROM_DATABASE=Milkyway Group Ltd + OUI:C8E1A7* ID_OUI_FROM_DATABASE=Vertu Corporation Limited @@ -69313,6 +69946,9 @@ OUI:CC14A6* OUI:CC187B* ID_OUI_FROM_DATABASE=Manzanita Systems, Inc. +OUI:CC19A8* + ID_OUI_FROM_DATABASE=PT Inovação e Sistemas SA + OUI:CC1AFA* ID_OUI_FROM_DATABASE=zte corporation @@ -69325,6 +69961,9 @@ OUI:CC2218* OUI:CC262D* ID_OUI_FROM_DATABASE=Verifi, LLC +OUI:CC29F5* + ID_OUI_FROM_DATABASE=Apple + OUI:CC2A80* ID_OUI_FROM_DATABASE=Micro-Biz intelligence solutions Co.,Ltd @@ -69475,6 +70114,9 @@ OUI:CC944A* OUI:CC95D7* ID_OUI_FROM_DATABASE=VIZIO, Inc +OUI:CC9635* + ID_OUI_FROM_DATABASE=LVS Co.,Ltd. + OUI:CC96A0* ID_OUI_FROM_DATABASE=Shenzhen Huawei Communication Technologies Co., Ltd @@ -69496,6 +70138,9 @@ OUI:CCA374* OUI:CCA462* ID_OUI_FROM_DATABASE=ARRIS Group, Inc. +OUI:CCA4AF* + ID_OUI_FROM_DATABASE=Shenzhen Sowell Technology Co., LTD + OUI:CCA614* ID_OUI_FROM_DATABASE=AIFA TECHNOLOGY CORP. @@ -69643,6 +70288,9 @@ OUI:D00AAB* OUI:D00EA4* ID_OUI_FROM_DATABASE=Porsche Cars North America +OUI:D00ED9* + ID_OUI_FROM_DATABASE=TAICANG T AND W ELECTRONICS CO LTD + OUI:D01242* ID_OUI_FROM_DATABASE=BIOS Corporation @@ -69670,6 +70318,9 @@ OUI:D022BE* OUI:D023DB* ID_OUI_FROM_DATABASE=Apple +OUI:D02516* + ID_OUI_FROM_DATABASE=SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD. + OUI:D02788* ID_OUI_FROM_DATABASE=Hon Hai Precision Ind.Co.Ltd @@ -69694,6 +70345,9 @@ OUI:D039B3* OUI:D046DC* ID_OUI_FROM_DATABASE=Southwest Research Institute +OUI:D048F3* + ID_OUI_FROM_DATABASE=DATTUS Inc + OUI:D04CC1* ID_OUI_FROM_DATABASE=SINTRONES Technology Corp. @@ -69742,6 +70396,9 @@ OUI:D05AF1* OUI:D05BA8* ID_OUI_FROM_DATABASE=zte corporation +OUI:D05C7A* + ID_OUI_FROM_DATABASE=Sartura d.o.o. + OUI:D05FB8* ID_OUI_FROM_DATABASE=Texas Instruments @@ -69769,6 +70426,12 @@ OUI:D0699E* OUI:D069D0* ID_OUI_FROM_DATABASE=Verto Medical Solutions, LLC +OUI:D06A1F* + ID_OUI_FROM_DATABASE=BSE CO.,LTD. + +OUI:D06F4A* + ID_OUI_FROM_DATABASE=TOPWELL INTERNATIONAL HOLDINGS LIMITED + OUI:D072DC* ID_OUI_FROM_DATABASE=Cisco @@ -69799,6 +70462,9 @@ OUI:D07E28* OUI:D07E35* ID_OUI_FROM_DATABASE=Intel Corporate +OUI:D083D4* + ID_OUI_FROM_DATABASE=XTel ApS + OUI:D084B0* ID_OUI_FROM_DATABASE=Sagemcom @@ -69865,6 +70531,9 @@ OUI:D0B523* OUI:D0B53D* ID_OUI_FROM_DATABASE=SEPRO ROBOTIQUE +OUI:D0B5C2* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:D0BB80* ID_OUI_FROM_DATABASE=SHL Telemedicine International Ltd. @@ -69877,6 +70546,9 @@ OUI:D0BE2C* OUI:D0BF9C* ID_OUI_FROM_DATABASE=Hewlett Packard +OUI:D0C0BF* + ID_OUI_FROM_DATABASE=Actions Microelectronics Co., Ltd + OUI:D0C1B1* ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd @@ -70090,6 +70762,9 @@ OUI:D44F80* OUI:D4507A* ID_OUI_FROM_DATABASE=CEIVA Logic, Inc +OUI:D4522A* + ID_OUI_FROM_DATABASE=TangoWiFi.com + OUI:D45251* ID_OUI_FROM_DATABASE=IBT Ingenieurbureau Broennimann Thun @@ -70132,6 +70807,9 @@ OUI:D4684D* OUI:D46867* ID_OUI_FROM_DATABASE=Neoventus Design Group +OUI:D468BA* + ID_OUI_FROM_DATABASE=Shenzhen Sundray Technologies Company Limited + OUI:D46A91* ID_OUI_FROM_DATABASE=Snap AV @@ -70300,6 +70978,9 @@ OUI:D4D50D* OUI:D4D748* ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC. +OUI:D4D7A9* + ID_OUI_FROM_DATABASE=Shanghai Kaixiang Info Tech LTD + OUI:D4D898* ID_OUI_FROM_DATABASE=Korea CNO Tech Co., Ltd @@ -70351,6 +71032,9 @@ OUI:D4F513* OUI:D4F63F* ID_OUI_FROM_DATABASE=IEA S.R.L. +OUI:D4F9A1* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:D8004D* ID_OUI_FROM_DATABASE=Apple @@ -70390,6 +71074,9 @@ OUI:D81BFE* OUI:D81C14* ID_OUI_FROM_DATABASE=Compacta International, Ltd. +OUI:D81D72* + ID_OUI_FROM_DATABASE=Apple + OUI:D81EDE* ID_OUI_FROM_DATABASE=B&W Group Ltd @@ -70462,6 +71149,9 @@ OUI:D850E6* OUI:D8543A* ID_OUI_FROM_DATABASE=Texas Instruments +OUI:D854A2* + ID_OUI_FROM_DATABASE=Aerohive Networks Inc. + OUI:D855A3* ID_OUI_FROM_DATABASE=zte corporation @@ -70588,6 +71278,9 @@ OUI:D89E3F* OUI:D8A25E* ID_OUI_FROM_DATABASE=Apple +OUI:D8ADDD* + ID_OUI_FROM_DATABASE=Sonavation, Inc. + OUI:D8AE90* ID_OUI_FROM_DATABASE=Itibia Technologies @@ -70753,6 +71446,9 @@ OUI:DC0B1A* OUI:DC0EA1* ID_OUI_FROM_DATABASE=COMPAL INFORMATION (KUNSHAN) CO., LTD +OUI:DC15DB* + ID_OUI_FROM_DATABASE=Ge Ruili Intelligent Technology ( Beijing ) Co., Ltd. + OUI:DC16A2* ID_OUI_FROM_DATABASE=Medtronic Diabetes @@ -70801,6 +71497,9 @@ OUI:DC309C* OUI:DC3350* ID_OUI_FROM_DATABASE=TechSAT GmbH +OUI:DC3714* + ID_OUI_FROM_DATABASE=Apple, Inc. + OUI:DC37D2* ID_OUI_FROM_DATABASE=Hunan HKT Electronic Technology Co., Ltd @@ -70837,6 +71536,9 @@ OUI:DC4EDE* OUI:DC537C* ID_OUI_FROM_DATABASE=Compal Broadband Networks, Inc. +OUI:DC56E6* + ID_OUI_FROM_DATABASE=Shenzhen Bococom Technology Co.,LTD + OUI:DC5726* ID_OUI_FROM_DATABASE=Power-One @@ -71074,6 +71776,9 @@ OUI:E03005* OUI:E031D0* ID_OUI_FROM_DATABASE=SZ Telstar CO., LTD +OUI:E03560* + ID_OUI_FROM_DATABASE=Challenger Supply Holdings, LLC + OUI:E036E3* ID_OUI_FROM_DATABASE=Stage One International Co., Ltd. @@ -71098,6 +71803,9 @@ OUI:E03F49* OUI:E0469A* ID_OUI_FROM_DATABASE=NETGEAR +OUI:E04B45* + ID_OUI_FROM_DATABASE=Hi-P Electronics Pte Ltd + OUI:E05597* ID_OUI_FROM_DATABASE=Emergent Vision Technologies Inc. @@ -71143,6 +71851,9 @@ OUI:E0750A* OUI:E0757D* ID_OUI_FROM_DATABASE=Motorola Mobility LLC +OUI:E076D0* + ID_OUI_FROM_DATABASE=AMPAK Technology, Inc. + OUI:E07C62* ID_OUI_FROM_DATABASE=Whistle Labs, Inc. @@ -71239,6 +71950,9 @@ OUI:E0B2F1* OUI:E0B52D* ID_OUI_FROM_DATABASE=Apple +OUI:E0B70A* + ID_OUI_FROM_DATABASE=ARRIS Group, Inc. + OUI:E0B7B1* ID_OUI_FROM_DATABASE=Pace plc @@ -71323,6 +72037,9 @@ OUI:E0DB88* OUI:E0DCA0* ID_OUI_FROM_DATABASE=Siemens Electrical Apparatus Ltd., Suzhou Chengdu Branch +OUI:E0E5CF* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:E0E631* ID_OUI_FROM_DATABASE=SNB TECHNOLOGIES LIMITED @@ -71473,6 +72190,9 @@ OUI:E457A8* OUI:E458E7* ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd +OUI:E45AA2* + ID_OUI_FROM_DATABASE=vivo Mobile Communication Co., Ltd. + OUI:E45D52* ID_OUI_FROM_DATABASE=Avaya, Inc @@ -71536,9 +72256,15 @@ OUI:E48B7F* OUI:E48C0F* ID_OUI_FROM_DATABASE=Discovery Insure +OUI:E48D8C* + ID_OUI_FROM_DATABASE=Routerboard.com + OUI:E49069* ID_OUI_FROM_DATABASE=Rockwell Automation +OUI:E4907E* + ID_OUI_FROM_DATABASE=Motorola Mobility LLC, a Lenovo Company + OUI:E492E7* ID_OUI_FROM_DATABASE=Gridlink Tech. Co.,Ltd. @@ -71596,6 +72322,9 @@ OUI:E4C722* OUI:E4C806* ID_OUI_FROM_DATABASE=Ceiec Electric Technology Inc. +OUI:E4CE70* + ID_OUI_FROM_DATABASE=Health & Life co., Ltd. + OUI:E4CE8F* ID_OUI_FROM_DATABASE=Apple @@ -71671,6 +72400,9 @@ OUI:E8056D* OUI:E80688* ID_OUI_FROM_DATABASE=Apple +OUI:E807BF* + ID_OUI_FROM_DATABASE=SHENZHEN BOOMTECH INDUSTRY CO.,LTD + OUI:E8088B* ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd @@ -71761,6 +72493,9 @@ OUI:E84E84* OUI:E84ECE* ID_OUI_FROM_DATABASE=Nintendo Co., Ltd. +OUI:E8508B* + ID_OUI_FROM_DATABASE=Samsung Electro Mechanics co., LTD. + OUI:E8516E* ID_OUI_FROM_DATABASE=TSMART Inc. @@ -71797,6 +72532,12 @@ OUI:E8617E* OUI:E86183* ID_OUI_FROM_DATABASE=Black Diamond Advanced Technology, LLC +OUI:E861BE* + ID_OUI_FROM_DATABASE=Melec Inc. + +OUI:E866C4* + ID_OUI_FROM_DATABASE=Datawise Systems + OUI:E86CDA* ID_OUI_FROM_DATABASE=Supercomputers and Neurocomputers Research Center @@ -71845,6 +72586,9 @@ OUI:E88DF5* OUI:E88E60* ID_OUI_FROM_DATABASE=NSD Corporation +OUI:E89120* + ID_OUI_FROM_DATABASE=Motorola Mobility LLC, a Lenovo Company + OUI:E89218* ID_OUI_FROM_DATABASE=Arcontia International AB @@ -72013,6 +72757,9 @@ OUI:EC0ED6* OUI:EC1120* ID_OUI_FROM_DATABASE=FloDesign Wind Turbine Corporation +OUI:EC1127* + ID_OUI_FROM_DATABASE=Texas Instruments + OUI:EC13B2* ID_OUI_FROM_DATABASE=Netonix @@ -72049,6 +72796,9 @@ OUI:EC2368* OUI:EC24B8* ID_OUI_FROM_DATABASE=Texas Instruments +OUI:EC26CA* + ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD + OUI:EC2AF0* ID_OUI_FROM_DATABASE=Ypsomed AG @@ -72106,6 +72856,9 @@ OUI:EC4993* OUI:EC4C4D* ID_OUI_FROM_DATABASE=ZAO NPK RoTeK +OUI:EC4F82* + ID_OUI_FROM_DATABASE=Calix Inc. + OUI:EC542E* ID_OUI_FROM_DATABASE=Shanghai XiMei Electronic Technology Co. Ltd @@ -72115,6 +72868,9 @@ OUI:EC55F9* OUI:EC59E7* ID_OUI_FROM_DATABASE=Microsoft Corporation +OUI:EC5A86* + ID_OUI_FROM_DATABASE=Yulong Computer Telecommunication Scientific (Shenzhen) Co.,Ltd + OUI:EC5C69* ID_OUI_FROM_DATABASE=MITSUBISHI HEAVY INDUSTRIES MECHATRONICS SYSTEMS,LTD. @@ -72517,6 +73273,9 @@ OUI:F09CE9* OUI:F09E63* ID_OUI_FROM_DATABASE=Cisco +OUI:F09FC2* + ID_OUI_FROM_DATABASE=Ubiquiti Networks, Inc. + OUI:F0A764* ID_OUI_FROM_DATABASE=GST Co., Ltd. @@ -72574,6 +73333,9 @@ OUI:F0D3A7* OUI:F0D3E7* ID_OUI_FROM_DATABASE=Sensometrix SA +OUI:F0D657* + ID_OUI_FROM_DATABASE=ECHOSENS + OUI:F0D767* ID_OUI_FROM_DATABASE=Axema Passagekontroll AB @@ -72691,6 +73453,9 @@ OUI:F40F1B* OUI:F40F9B* ID_OUI_FROM_DATABASE=WAVELINK +OUI:F41563* + ID_OUI_FROM_DATABASE=F5 Networks, Inc. + OUI:F415FD* ID_OUI_FROM_DATABASE=Shanghai Pateo Electronic Equipment Manufacturing Co., Ltd. @@ -72751,6 +73516,9 @@ OUI:F44450* OUI:F445ED* ID_OUI_FROM_DATABASE=Portable Innovation Technology Ltd. +OUI:F44713* + ID_OUI_FROM_DATABASE=Leading Public Performance Co., Ltd. + OUI:F4472A* ID_OUI_FROM_DATABASE=Nanjing Rousing Sci. and Tech. Industrial Co., Ltd @@ -72802,6 +73570,9 @@ OUI:F46349* OUI:F4645D* ID_OUI_FROM_DATABASE=Toshiba +OUI:F46A92* + ID_OUI_FROM_DATABASE=SHENZHEN FAST TECHNOLOGIES CO.,LTD + OUI:F46ABC* ID_OUI_FROM_DATABASE=Adonit Corp. Ltd. @@ -72943,6 +73714,9 @@ OUI:F4DD9E* OUI:F4E142* ID_OUI_FROM_DATABASE=Delta Elektronika BV +OUI:F4E3FB* + ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd + OUI:F4E6D7* ID_OUI_FROM_DATABASE=Solar Power Technologies, Inc. @@ -73087,9 +73861,6 @@ OUI:F83DFF* OUI:F842FB* ID_OUI_FROM_DATABASE=Yasuda Joho Co.,ltd. -OUI:F84360* - ID_OUI_FROM_DATABASE=INGENICO - OUI:F845AD* ID_OUI_FROM_DATABASE=Konka Group Co., Ltd. @@ -73279,6 +74050,9 @@ OUI:F8C678* OUI:F8C96C* ID_OUI_FROM_DATABASE=Fiberhome Telecommunication Tech.Co.,Ltd. +OUI:F8CFC5* + ID_OUI_FROM_DATABASE=Motorola Mobility LLC, a Lenovo Company + OUI:F8D0AC* ID_OUI_FROM_DATABASE=Sony Computer Entertainment Inc. @@ -73552,6 +74326,9 @@ OUI:FC6C31* OUI:FC6DC0* ID_OUI_FROM_DATABASE=BME CORPORATION +OUI:FC6FB7* + ID_OUI_FROM_DATABASE=Pace plc + OUI:FC7516* ID_OUI_FROM_DATABASE=D-Link International @@ -73576,6 +74353,9 @@ OUI:FC8B97* OUI:FC8E7E* ID_OUI_FROM_DATABASE=Pace plc +OUI:FC8F90* + ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd + OUI:FC8FC4* ID_OUI_FROM_DATABASE=Intelligent Technology Inc. @@ -73591,6 +74371,9 @@ OUI:FC94E3* OUI:FC9947* ID_OUI_FROM_DATABASE=Cisco +OUI:FC9AFA* + ID_OUI_FROM_DATABASE=Motus Global Inc. + OUI:FC9FAE* ID_OUI_FROM_DATABASE=Fidus Systems Inc @@ -73600,6 +74383,9 @@ OUI:FC9FE1* OUI:FCA13E* ID_OUI_FROM_DATABASE=Samsung Electronics +OUI:FCA22A* + ID_OUI_FROM_DATABASE=PT. Callysta Multi Engineering + OUI:FCA841* ID_OUI_FROM_DATABASE=Avaya, Inc @@ -73613,7 +74399,7 @@ OUI:FCAD0F* ID_OUI_FROM_DATABASE=QTS NETWORKS OUI:FCAF6A* - ID_OUI_FROM_DATABASE=Conemtech AB + ID_OUI_FROM_DATABASE=Qulsar Inc OUI:FCAFAC* ID_OUI_FROM_DATABASE=Panasonic System LSI @@ -73684,9 +74470,15 @@ OUI:FCE192* OUI:FCE1D9* ID_OUI_FROM_DATABASE=Stable Imaging Solutions LLC +OUI:FCE1FB* + ID_OUI_FROM_DATABASE=Array Networks + OUI:FCE23F* ID_OUI_FROM_DATABASE=CLAY PAKY SPA +OUI:FCE33C* + ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD + OUI:FCE557* ID_OUI_FROM_DATABASE=Nokia Corporation diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb index 5a4670db0..fb789fd49 100644 --- a/hwdb/20-bluetooth-vendor-product.hwdb +++ b/hwdb/20-bluetooth-vendor-product.hwdb @@ -166,7 +166,7 @@ bluetooth:v0035* ID_VENDOR_FROM_DATABASE=Eclipse (HQ Espana) S.L. bluetooth:v0036* - ID_VENDOR_FROM_DATABASE=Renesas Technology Corp. + ID_VENDOR_FROM_DATABASE=Renesas Electronics Corporation bluetooth:v0037* ID_VENDOR_FROM_DATABASE=Mobilian Corporation @@ -937,7 +937,7 @@ bluetooth:v0135* ID_VENDOR_FROM_DATABASE=Airewear LLC bluetooth:v0136* - ID_VENDOR_FROM_DATABASE=ETC sp. z.o.o. + ID_VENDOR_FROM_DATABASE=Seed Labs, Inc. (formerly ETC sp. z.o.o.) bluetooth:v0137* ID_VENDOR_FROM_DATABASE=Prestigio Plaza Ltd. @@ -1277,3 +1277,156 @@ bluetooth:v01A6* bluetooth:v01A7* ID_VENDOR_FROM_DATABASE=ENERGOUS CORPORATION + +bluetooth:v01A8* + ID_VENDOR_FROM_DATABASE=Taobao + +bluetooth:v01A9* + ID_VENDOR_FROM_DATABASE=Canon Inc. + +bluetooth:v01AA* + ID_VENDOR_FROM_DATABASE=Geophysical Technology Inc. + +bluetooth:v01AB* + ID_VENDOR_FROM_DATABASE=Facebook, Inc. + +bluetooth:v01AC* + ID_VENDOR_FROM_DATABASE=Nipro Diagnostics, Inc. + +bluetooth:v01AD* + ID_VENDOR_FROM_DATABASE=FlightSafety International + +bluetooth:v01AE* + ID_VENDOR_FROM_DATABASE=Earlens Corporation + +bluetooth:v01AF* + ID_VENDOR_FROM_DATABASE=Sunrise Micro Devices, Inc. + +bluetooth:v01B0* + ID_VENDOR_FROM_DATABASE=Star Micronics Co., Ltd. + +bluetooth:v01B1* + ID_VENDOR_FROM_DATABASE=Netizens Sp. z o.o. + +bluetooth:v01B2* + ID_VENDOR_FROM_DATABASE=Nymi Inc. + +bluetooth:v01B3* + ID_VENDOR_FROM_DATABASE=Nytec, Inc. + +bluetooth:v01B4* + ID_VENDOR_FROM_DATABASE=Trineo Sp. z o.o. + +bluetooth:v01B5* + ID_VENDOR_FROM_DATABASE=Nest Labs Inc. + +bluetooth:v01B6* + ID_VENDOR_FROM_DATABASE=LM Technologies Ltd + +bluetooth:v01B7* + ID_VENDOR_FROM_DATABASE=General Electric Company + +bluetooth:v01B8* + ID_VENDOR_FROM_DATABASE=i+D3 S.L. + +bluetooth:v01B9* + ID_VENDOR_FROM_DATABASE=HANA Micron + +bluetooth:v01BA* + ID_VENDOR_FROM_DATABASE=Stages Cycling LLC + +bluetooth:v01BB* + ID_VENDOR_FROM_DATABASE=Cochlear Bone Anchored Solutions AB + +bluetooth:v01BC* + ID_VENDOR_FROM_DATABASE=SenionLab AB + +bluetooth:v01BD* + ID_VENDOR_FROM_DATABASE=Syszone Co., Ltd + +bluetooth:v01BE* + ID_VENDOR_FROM_DATABASE=Pulsate Mobile Ltd. + +bluetooth:v01BF* + ID_VENDOR_FROM_DATABASE=Hong Kong HunterSun Electronic Limited + +bluetooth:v01C0* + ID_VENDOR_FROM_DATABASE=pironex GmbH + +bluetooth:v01C1* + ID_VENDOR_FROM_DATABASE=BRADATECH Corp. + +bluetooth:v01C2* + ID_VENDOR_FROM_DATABASE=Transenergooil AG + +bluetooth:v01C3* + ID_VENDOR_FROM_DATABASE=Bunch + +bluetooth:v01C4* + ID_VENDOR_FROM_DATABASE=DME Microelectronics + +bluetooth:v01C5* + ID_VENDOR_FROM_DATABASE=Bitcraze AB + +bluetooth:v01C6* + ID_VENDOR_FROM_DATABASE=HASWARE Inc. + +bluetooth:v01C7* + ID_VENDOR_FROM_DATABASE=Abiogenix Inc. + +bluetooth:v01C8* + ID_VENDOR_FROM_DATABASE=Poly-Control ApS + +bluetooth:v01C9* + ID_VENDOR_FROM_DATABASE=Avi-on + +bluetooth:v01CA* + ID_VENDOR_FROM_DATABASE=Laerdal Medical AS + +bluetooth:v01CB* + ID_VENDOR_FROM_DATABASE=Fetch My Pet + +bluetooth:v01CC* + ID_VENDOR_FROM_DATABASE=Sam Labs Ltd. + +bluetooth:v01CD* + ID_VENDOR_FROM_DATABASE=Chengdu Synwing Technology Ltd + +bluetooth:v01CE* + ID_VENDOR_FROM_DATABASE=HOUWA SYSTEM DESIGN, k.k. + +bluetooth:v01CF* + ID_VENDOR_FROM_DATABASE=BSH + +bluetooth:v01D0* + ID_VENDOR_FROM_DATABASE=Primus Inter Pares Ltd + +bluetooth:v01D1* + ID_VENDOR_FROM_DATABASE=August + +bluetooth:v01D2* + ID_VENDOR_FROM_DATABASE=Gill Electronics + +bluetooth:v01D3* + ID_VENDOR_FROM_DATABASE=Sky Wave Design + +bluetooth:v01D4* + ID_VENDOR_FROM_DATABASE=Newlab S.r.l. + +bluetooth:v01D5* + ID_VENDOR_FROM_DATABASE=ELAD srl + +bluetooth:v01D6* + ID_VENDOR_FROM_DATABASE=G-wearables inc. + +bluetooth:v01D7* + ID_VENDOR_FROM_DATABASE=Squadrone Systems Inc. + +bluetooth:v01D8* + ID_VENDOR_FROM_DATABASE=Code Corporation + +bluetooth:v01D9* + ID_VENDOR_FROM_DATABASE=Savant Systems LLC + +bluetooth:v01DA* + ID_VENDOR_FROM_DATABASE=Logitech International SA diff --git a/hwdb/20-pci-vendor-model.hwdb b/hwdb/20-pci-vendor-model.hwdb index df9deccd9..6c2208887 100644 --- a/hwdb/20-pci-vendor-model.hwdb +++ b/hwdb/20-pci-vendor-model.hwdb @@ -963,13 +963,13 @@ pci:v00001000d0000005Dsv00001028sd00001F4A* ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC H730 Mini (for blades)) pci:v00001000d0000005Dsv00001028sd00001F4D* - ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC FS33xS) + ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC FD33xS) pci:v00001000d0000005Dsv00001028sd00001F4F* ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC H730P Slim) pci:v00001000d0000005Dsv00001028sd00001F54* - ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC FS33xD) + ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (PERC FD33xD) pci:v00001000d0000005Dsv000017AAsd00001052* ID_MODEL_FROM_DATABASE=MegaRAID SAS-3 3108 [Invader] (ThinkServer RAID 720i) @@ -1383,7 +1383,7 @@ pci:v00001000d00000097sv00001028sd00001F45* ID_MODEL_FROM_DATABASE=SAS3008 PCI-Express Fusion-MPT SAS-3 (12GB/s HBA internal) pci:v00001000d00000097sv00001028sd00001F46* - ID_MODEL_FROM_DATABASE=SAS3008 PCI-Express Fusion-MPT SAS-3 (12GB/s HBA external) + ID_MODEL_FROM_DATABASE=SAS3008 PCI-Express Fusion-MPT SAS-3 (12Gbps HBA) pci:v00001000d00000407* ID_MODEL_FROM_DATABASE=MegaRAID @@ -5834,6 +5834,9 @@ pci:v00001002d0000678Asv00001002sd00000420* pci:v00001002d0000678Asv00001002sd00000422* ID_MODEL_FROM_DATABASE=Tahiti PRO GL [FirePro Series] (Radeon Sky 900) +pci:v00001002d0000678Asv00001002sd00000710* + ID_MODEL_FROM_DATABASE=Tahiti PRO GL [FirePro Series] (FirePro S9050) + pci:v00001002d0000678Asv00001002sd00000B0E* ID_MODEL_FROM_DATABASE=Tahiti PRO GL [FirePro Series] (FirePro S10000 Passive) @@ -5897,6 +5900,9 @@ pci:v00001002d00006798sv00001092sd00003000* pci:v00001002d00006798sv00001458sd00002261* ID_MODEL_FROM_DATABASE=Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] (Tahiti XT2 [Radeon HD 7970 GHz Edition OC]) +pci:v00001002d00006798sv00001458sd00003001* + ID_MODEL_FROM_DATABASE=Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] (Tahiti XTL [Radeon R9 280X OC]) + pci:v00001002d00006798sv00001462sd00002774* ID_MODEL_FROM_DATABASE=Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] (MSI R7970 TF 3GD5/OC BE) @@ -7931,6 +7937,9 @@ pci:v00001002d0000692B* pci:v00001002d0000692F* ID_MODEL_FROM_DATABASE=Tonga XT GL [FirePro W8100] +pci:v00001002d00006938* + ID_MODEL_FROM_DATABASE=Amethyst XT [Radeon R9 M295X Mac Edition] + pci:v00001002d00006939* ID_MODEL_FROM_DATABASE=Tonga PRO [Radeon R9 285] @@ -10313,6 +10322,9 @@ pci:v00001014d0000016E* pci:v00001014d00000170* ID_MODEL_FROM_DATABASE=GXT6000P Graphics Adapter +pci:v00001014d00000170sv00001092sd00000172* + ID_MODEL_FROM_DATABASE=GXT6000P Graphics Adapter (Fire GL2) + pci:v00001014d0000017D* ID_MODEL_FROM_DATABASE=GXT300P Graphics Adapter @@ -11903,6 +11915,9 @@ pci:v00001028d00000016* pci:v00001028d00000016sv00001028sd00001F24* ID_MODEL_FROM_DATABASE=PowerEdge Expandable RAID controller S300 (PERC S300 Controller) +pci:v00001028d00000073* + ID_MODEL_FROM_DATABASE=NV-RAM Adapter + pci:v00001029* ID_VENDOR_FROM_DATABASE=Siemens Nixdorf IS @@ -21011,6 +21026,9 @@ pci:v000010B5d00009056sv00001369sd0000C201* pci:v000010B5d00009056sv000014B4sd0000D10A* ID_MODEL_FROM_DATABASE=PCI9056 32-bit 66MHz PCI <-> IOBus Bridge (DekTec DTA-110T) +pci:v000010B5d00009056sv000014B4sd0000D128* + ID_MODEL_FROM_DATABASE=PCI9056 32-bit 66MHz PCI <-> IOBus Bridge (Dektec DTA-140) + pci:v000010B5d00009056sv000014B4sd0000D140* ID_MODEL_FROM_DATABASE=PCI9056 32-bit 66MHz PCI <-> IOBus Bridge (Dektec DTA-140) @@ -27992,6 +28010,12 @@ pci:v000010DEd00000E0C* pci:v000010DEd00000E0F* ID_MODEL_FROM_DATABASE=GK208 HDMI/DP Audio Controller +pci:v000010DEd00000E12* + ID_MODEL_FROM_DATABASE=TegraK1 PCIe x4 Bridge + +pci:v000010DEd00000E13* + ID_MODEL_FROM_DATABASE=TegraK1 PCIe x1 Bridge + pci:v000010DEd00000E1A* ID_MODEL_FROM_DATABASE=GK110 HDMI Audio @@ -28520,6 +28544,9 @@ pci:v000010DEd000010D8* pci:v000010DEd00001140* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] +pci:v000010DEd00001140sv00001019sd0000999F* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + pci:v000010DEd00001140sv00001025sd00000600* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 620M) @@ -28640,6 +28667,9 @@ pci:v000010DEd00001140sv00001025sd00000823* pci:v000010DEd00001140sv00001025sd00000830* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv00001025sd00000833* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + pci:v000010DEd00001140sv00001025sd00000837* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) @@ -28688,12 +28718,42 @@ pci:v000010DEd00001140sv00001025sd00000881* pci:v000010DEd00001140sv00001025sd0000088A* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv00001025sd0000089B* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001025sd0000090F* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) pci:v000010DEd00001140sv00001025sd00000921* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv00001025sd0000092E* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 810M) + +pci:v000010DEd00001140sv00001025sd0000092F* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd0000093A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd0000093C* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd0000093F* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd00000941* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd00000945* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd00000954* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001025sd00000965* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001028sd0000054D* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 630M) @@ -28751,12 +28811,24 @@ pci:v000010DEd00001140sv00001028sd000005E8* pci:v000010DEd00001140sv00001028sd000005F4* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv00001028sd0000060F* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + pci:v000010DEd00001140sv00001028sd0000064E* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) pci:v000010DEd00001140sv00001028sd00000652* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv00001028sd00000653* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001028sd00000655* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001028sd0000065E* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001028sd00000662* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) @@ -28778,6 +28850,12 @@ pci:v000010DEd00001140sv0000103Csd000018FD* pci:v000010DEd00001140sv0000103Csd000018FF* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 630M) +pci:v000010DEd00001140sv0000103Csd00002335* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv0000103Csd00002337* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv0000103Csd00002AEF* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720A) @@ -28877,9 +28955,66 @@ pci:v000010DEd00001140sv00001043sd0000227A* pci:v000010DEd00001140sv00001043sd0000228A* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv00001043sd0000232A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000233A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000236A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000238A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001043sd00008595* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv00001043sd000085EA* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv00001043sd000085EB* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd000085EC* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd000085EE* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv00001043sd000085F3* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000860E* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000861A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000861B* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd00008628* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd00008643* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd0000864C* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001043sd00008652* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv0000105Bsd00000DAC* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv0000105Bsd00000DAD* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv0000105Bsd00000EF3* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + pci:v000010DEd00001140sv00001072sd0000152D* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) @@ -28976,6 +29111,9 @@ pci:v000010DEd00001140sv0000144Dsd0000C0E3* pci:v000010DEd00001140sv0000144Dsd0000C0E4* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (NVS 5200M) +pci:v000010DEd00001140sv0000144Dsd0000C10D* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv0000144Dsd0000C652* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 620M) @@ -28988,6 +29126,15 @@ pci:v000010DEd00001140sv0000144Dsd0000C711* pci:v000010DEd00001140sv0000144Dsd0000C736* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 710M) +pci:v000010DEd00001140sv0000144Dsd0000C737* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 710M) + +pci:v000010DEd00001140sv0000144Dsd0000C745* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv0000144Dsd0000C750* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001462sd000010B8* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 710M) @@ -29006,9 +29153,27 @@ pci:v000010DEd00001140sv00001462sd0000AAA2* pci:v000010DEd00001140sv00001462sd0000AAA3* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv00001462sd0000ACB2* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv00001462sd0000ACC1* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv00001462sd0000AE61* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 720M) + +pci:v000010DEd00001140sv00001462sd0000AE65* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) + +pci:v000010DEd00001140sv00001462sd0000AE6A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001462sd0000AE71* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv000014C0sd00000083* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv0000152Dsd00000926* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 620M) @@ -29042,6 +29207,9 @@ pci:v000010DEd00001140sv0000152Dsd00001072* pci:v000010DEd00001140sv0000152Dsd00001086* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv0000152Dsd00001092* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv000017AAsd00002200* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (NVS 5200M) @@ -29093,6 +29261,9 @@ pci:v000010DEd00001140sv000017AAsd0000369D* pci:v000010DEd00001140sv000017AAsd0000369E* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820A) +pci:v000010DEd00001140sv000017AAsd000036A9* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820A) + pci:v000010DEd00001140sv000017AAsd00003800* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) @@ -29138,6 +29309,12 @@ pci:v000010DEd00001140sv000017AAsd00003816* pci:v000010DEd00001140sv000017AAsd00003818* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) +pci:v000010DEd00001140sv000017AAsd0000381A* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv000017AAsd0000381C* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv000017AAsd00003901* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 610M / GT 620M) @@ -29153,12 +29330,21 @@ pci:v000010DEd00001140sv000017AAsd00003904* pci:v000010DEd00001140sv000017AAsd00003905* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv000017AAsd00003907* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv000017AAsd00003910* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 720M) pci:v000010DEd00001140sv000017AAsd00003912* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 720M) +pci:v000010DEd00001140sv000017AAsd00003913* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv000017AAsd00003915* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv000017AAsd00003977* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) @@ -29252,9 +29438,18 @@ pci:v000010DEd00001140sv00001B0Asd000020DD* pci:v000010DEd00001140sv00001B0Asd000020DF* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 620M) +pci:v000010DEd00001140sv00001B0Asd0000210E* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001140sv00001B0Asd00002202* ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M) +pci:v000010DEd00001140sv00001B0Asd000090D7* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + +pci:v000010DEd00001140sv00001B0Asd000090DD* + ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M) + pci:v000010DEd00001180* ID_MODEL_FROM_DATABASE=GK104 [GeForce GTX 680] @@ -29678,6 +29873,9 @@ pci:v000010DEd00001296* pci:v000010DEd00001298* ID_MODEL_FROM_DATABASE=GK208M [GeForce GT 720M] +pci:v000010DEd00001299* + ID_MODEL_FROM_DATABASE=GK208M [GeForce 920M] + pci:v000010DEd000012A0* ID_MODEL_FROM_DATABASE=GK208 @@ -29705,6 +29903,12 @@ pci:v000010DEd00001341sv000017AAsd00003699* pci:v000010DEd00001341sv000017AAsd0000369C* ID_MODEL_FROM_DATABASE=GM108M [GeForce 840M] (GeForce 840A) +pci:v000010DEd00001346* + ID_MODEL_FROM_DATABASE=GM108M [GeForce 930M] + +pci:v000010DEd00001347* + ID_MODEL_FROM_DATABASE=GM108M [GeForce 940M] + pci:v000010DEd00001380* ID_MODEL_FROM_DATABASE=GM107 [GeForce GTX 750 Ti] @@ -29715,7 +29919,7 @@ pci:v000010DEd00001382* ID_MODEL_FROM_DATABASE=GM107 [GeForce GTX 745] pci:v000010DEd00001389* - ID_MODEL_FROM_DATABASE=GM107GL [GRID M3] + ID_MODEL_FROM_DATABASE=GM107GL [GRID M30] pci:v000010DEd00001390* ID_MODEL_FROM_DATABASE=GM107M [GeForce 845M] @@ -29735,6 +29939,21 @@ pci:v000010DEd00001392* pci:v000010DEd00001393* ID_MODEL_FROM_DATABASE=GM107M [GeForce 840M] +pci:v000010DEd00001398* + ID_MODEL_FROM_DATABASE=GM107M [GeForce 845M] + +pci:v000010DEd0000139A* + ID_MODEL_FROM_DATABASE=GM107M [GeForce GTX 950M] + +pci:v000010DEd0000139B* + ID_MODEL_FROM_DATABASE=GM107M [GeForce GTX 960M] + +pci:v000010DEd0000139C* + ID_MODEL_FROM_DATABASE=GM107M [GeForce 940M] + +pci:v000010DEd000013B0* + ID_MODEL_FROM_DATABASE=GM107GLM [N16P-Q3] + pci:v000010DEd000013B3* ID_MODEL_FROM_DATABASE=GM107GLM [Quadro K2200M] @@ -29744,8 +29963,11 @@ pci:v000010DEd000013BA* pci:v000010DEd000013BB* ID_MODEL_FROM_DATABASE=GM107GL [Quadro K620] +pci:v000010DEd000013BC* + ID_MODEL_FROM_DATABASE=GM107GL [Quadro K1200] + pci:v000010DEd000013BD* - ID_MODEL_FROM_DATABASE=GM107GL [Tesla M40] + ID_MODEL_FROM_DATABASE=GM107GL [GRID M40] pci:v000010DEd000013C0* ID_MODEL_FROM_DATABASE=GM204 [GeForce GTX 980] @@ -29771,6 +29993,12 @@ pci:v000010DEd000013D8* pci:v000010DEd000013D9* ID_MODEL_FROM_DATABASE=GM204M [GeForce GTX 965M] +pci:v000010DEd00001401* + ID_MODEL_FROM_DATABASE=GM206 [GeForce GTX 960] + +pci:v000010DEd000017F0* + ID_MODEL_FROM_DATABASE=GM200GL [Quadro M6000] + pci:v000010DF* ID_VENDOR_FROM_DATABASE=Emulex Corporation @@ -30236,6 +30464,12 @@ pci:v000010ECd00005249sv0000103Csd00001909* pci:v000010ECd00005288* ID_MODEL_FROM_DATABASE=RTS5288 PCI Express Card Reader +pci:v000010ECd00005289* + ID_MODEL_FROM_DATABASE=RTL8411 PCI Express Card Reader + +pci:v000010ECd00005289sv00001043sd00001457* + ID_MODEL_FROM_DATABASE=RTL8411 PCI Express Card Reader (K55A Laptop) + pci:v000010ECd00008029* ID_MODEL_FROM_DATABASE=RTL-8029(AS) @@ -31532,6 +31766,24 @@ pci:v00001106d00000693* pci:v00001106d00000698* ID_MODEL_FROM_DATABASE=VT82C693A [Apollo Pro133 AGP] +pci:v00001106d00000709* + ID_MODEL_FROM_DATABASE=VX11 Standard Host Bridge + +pci:v00001106d0000070A* + ID_MODEL_FROM_DATABASE=VX11 PCI Express Root Port + +pci:v00001106d0000070B* + ID_MODEL_FROM_DATABASE=VX11 PCI Express Root Port + +pci:v00001106d0000070C* + ID_MODEL_FROM_DATABASE=VX11 PCI Express Root Port + +pci:v00001106d0000070D* + ID_MODEL_FROM_DATABASE=VX11 PCI Express Root Port + +pci:v00001106d0000070E* + ID_MODEL_FROM_DATABASE=VX11 PCI Express Root Port + pci:v00001106d00000926* ID_MODEL_FROM_DATABASE=VT82C926 [Amazon] @@ -32273,6 +32525,30 @@ pci:v00001106d00003189sv00001458sd00005000* pci:v00001106d00003189sv00001849sd00003189* ID_MODEL_FROM_DATABASE=VT8377 [KT400/KT600 AGP] Host Bridge (K7VT series Motherboards) +pci:v00001106d000031B0* + ID_MODEL_FROM_DATABASE=VX11 Standard Host Bridge + +pci:v00001106d000031B1* + ID_MODEL_FROM_DATABASE=VX11 Standard Host Bridge + +pci:v00001106d000031B2* + ID_MODEL_FROM_DATABASE=VX11 DRAM Controller + +pci:v00001106d000031B3* + ID_MODEL_FROM_DATABASE=VX11 Power Management Controller + +pci:v00001106d000031B4* + ID_MODEL_FROM_DATABASE=VX11 I/O APIC + +pci:v00001106d000031B5* + ID_MODEL_FROM_DATABASE=VX11 Scratch Device + +pci:v00001106d000031B7* + ID_MODEL_FROM_DATABASE=VX11 Standard Host Bridge + +pci:v00001106d000031B8* + ID_MODEL_FROM_DATABASE=VX11 PCI to PCI Bridge + pci:v00001106d00003204* ID_MODEL_FROM_DATABASE=K8M800 Host Bridge @@ -32429,6 +32705,15 @@ pci:v00001106d00003410sv000019DAsd0000A179* pci:v00001106d00003432* ID_MODEL_FROM_DATABASE=VL80x xHCI USB 3.0 Controller +pci:v00001106d00003456* + ID_MODEL_FROM_DATABASE=VX11 Standard Host Bridge + +pci:v00001106d0000345B* + ID_MODEL_FROM_DATABASE=VX11 Miscellaneous Bus + +pci:v00001106d00003A01* + ID_MODEL_FROM_DATABASE=VX11 Graphics [Chrome 645/640] + pci:v00001106d00004149* ID_MODEL_FROM_DATABASE=VIA VT6420 (ATA133) Controller @@ -32729,6 +33014,15 @@ pci:v00001106d00008D04* pci:v00001106d00009001* ID_MODEL_FROM_DATABASE=VX900 Serial ATA Controller +pci:v00001106d00009082* + ID_MODEL_FROM_DATABASE=Standard AHCI 1.0 SATA Controller + +pci:v00001106d00009140* + ID_MODEL_FROM_DATABASE=HDMI Audio Device + +pci:v00001106d00009201* + ID_MODEL_FROM_DATABASE=USB3.0 Controller + pci:v00001106d00009530* ID_MODEL_FROM_DATABASE=Secure Digital Memory Card Controller @@ -34295,6 +34589,9 @@ pci:v00001131d00007146sv00001894sd00000020* pci:v00001131d00007146sv00001894sd00000023* ID_MODEL_FROM_DATABASE=SAA7146 (TVStation DVB-C plus) +pci:v00001131d00007146sv00001894sd00000054* + ID_MODEL_FROM_DATABASE=SAA7146 (TV-Station DVB-S) + pci:v00001131d00007160* ID_MODEL_FROM_DATABASE=SAA7160 @@ -34367,6 +34664,9 @@ pci:v00001131d00007164sv00000070sd000089A0* pci:v00001131d00007164sv00000070sd000089A1* ID_MODEL_FROM_DATABASE=SAA7164 (WinTV HVR-2200) +pci:v00001131d00007164sv00000070sd0000F123* + ID_MODEL_FROM_DATABASE=SAA7164 (WinTV HVR-2205) + pci:v00001131d00007231* ID_MODEL_FROM_DATABASE=SAA7231 @@ -36102,7 +36402,10 @@ pci:v0000117C* ID_VENDOR_FROM_DATABASE=ATTO Technology, Inc. pci:v0000117Cd0000002C* - ID_MODEL_FROM_DATABASE=SAS RAID Adapter + ID_MODEL_FROM_DATABASE=ExpressSAS R380 + +pci:v0000117Cd0000002D* + ID_MODEL_FROM_DATABASE=ExpressSAS R348 pci:v0000117Cd00000030* ID_MODEL_FROM_DATABASE=Ultra320 SCSI Host Adapter @@ -36122,6 +36425,18 @@ pci:v0000117Cd00000030sv0000117Csd0000802F* pci:v0000117Cd00000033* ID_MODEL_FROM_DATABASE=SAS Adapter +pci:v0000117Cd00000041* + ID_MODEL_FROM_DATABASE=ExpressSAS R30F + +pci:v0000117Cd00008013* + ID_MODEL_FROM_DATABASE=ExpressPCI UL4D + +pci:v0000117Cd00008014* + ID_MODEL_FROM_DATABASE=ExpressPCI UL4S + +pci:v0000117Cd00008027* + ID_MODEL_FROM_DATABASE=ExpressPCI UL5D + pci:v0000117D* ID_VENDOR_FROM_DATABASE=Becton & Dickinson @@ -37505,6 +37820,9 @@ pci:v000011ABd00007820* pci:v000011ABd00007823* ID_MODEL_FROM_DATABASE=MV78230 [Armada XP] ARM SoC +pci:v000011ABd00007846* + ID_MODEL_FROM_DATABASE=88F6820 [Armada 385] ARM SoC + pci:v000011ABd0000F003* ID_MODEL_FROM_DATABASE=GT-64010 Primary Image Piranha Image Generator @@ -44885,6 +45203,9 @@ pci:v00001425d00005087* pci:v00001425d00005088* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Ethernet Controller +pci:v00001425d00005089* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Ethernet Controller + pci:v00001425d00005401* ID_MODEL_FROM_DATABASE=T520-CR Unified Wire Ethernet Controller @@ -44975,6 +45296,9 @@ pci:v00001425d00005487* pci:v00001425d00005488* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Ethernet Controller +pci:v00001425d00005489* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Ethernet Controller + pci:v00001425d00005501* ID_MODEL_FROM_DATABASE=T520-CR Unified Wire Storage Controller @@ -45065,6 +45389,9 @@ pci:v00001425d00005587* pci:v00001425d00005588* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Storage Controller +pci:v00001425d00005589* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Storage Controller + pci:v00001425d00005601* ID_MODEL_FROM_DATABASE=T520-CR Unified Wire Storage Controller @@ -45155,6 +45482,9 @@ pci:v00001425d00005687* pci:v00001425d00005688* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Storage Controller +pci:v00001425d00005689* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Storage Controller + pci:v00001425d00005701* ID_MODEL_FROM_DATABASE=T520-CR Unified Wire Ethernet Controller @@ -45245,6 +45575,9 @@ pci:v00001425d00005787* pci:v00001425d00005788* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Ethernet Controller +pci:v00001425d00005789* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Ethernet Controller + pci:v00001425d00005801* ID_MODEL_FROM_DATABASE=T520-CR Unified Wire Ethernet Controller [VF] @@ -45335,6 +45668,9 @@ pci:v00001425d00005887* pci:v00001425d00005888* ID_MODEL_FROM_DATABASE=T570-5088 Unified Wire Ethernet Controller [VF] +pci:v00001425d00005889* + ID_MODEL_FROM_DATABASE=T520-5089 Unified Wire Ethernet Controller [VF] + pci:v00001425d0000A000* ID_MODEL_FROM_DATABASE=PE10K Unified Wire Ethernet Controller @@ -46058,6 +46394,9 @@ pci:v000014C3* pci:v000014C3d00007630* ID_MODEL_FROM_DATABASE=MT7630e 802.11bgn Wireless Network Adapter +pci:v000014C3d00007662* + ID_MODEL_FROM_DATABASE=MT7662E 802.11ac PCI Express Wireless Network Adapter + pci:v000014C4* ID_VENDOR_FROM_DATABASE=IWASAKI Information Systems Co Ltd @@ -46304,6 +46643,9 @@ pci:v000014E4d00000811* pci:v000014E4d00000816* ID_MODEL_FROM_DATABASE=BCM3302 Sentry5 MIPS32 CPU +pci:v000014E4d00001570* + ID_MODEL_FROM_DATABASE=720p FaceTime HD Camera + pci:v000014E4d00001600* ID_MODEL_FROM_DATABASE=NetXtreme BCM5752 Gigabit Ethernet PCI Express @@ -47930,6 +48272,9 @@ pci:v000014E4d00004344* pci:v000014E4d00004350* ID_MODEL_FROM_DATABASE=BCM43222 Wireless Network Adapter +pci:v000014E4d00004351* + ID_MODEL_FROM_DATABASE=BCM43222 802.11abgn Wireless Network Adapter + pci:v000014E4d00004353* ID_MODEL_FROM_DATABASE=BCM43224 802.11a/b/g/n @@ -47978,6 +48323,12 @@ pci:v000014E4d00004365sv00001028sd00000016* pci:v000014E4d000043A0* ID_MODEL_FROM_DATABASE=BCM4360 802.11ac Wireless Network Adapter +pci:v000014E4d000043A1* + ID_MODEL_FROM_DATABASE=BCM4360 802.11ac Wireless Network Adapter + +pci:v000014E4d000043A2* + ID_MODEL_FROM_DATABASE=BCM4360 802.11ac Wireless Network Adapter + pci:v000014E4d000043A9* ID_MODEL_FROM_DATABASE=BCM43217 802.11b/g/n @@ -47997,16 +48348,16 @@ pci:v000014E4d000043BC* ID_MODEL_FROM_DATABASE=BCM43602 802.11ac Wireless LAN SoC pci:v000014E4d000043D3* - ID_MODEL_FROM_DATABASE=BCM43567 + ID_MODEL_FROM_DATABASE=BCM43567 802.11ac Wireless Network Adapter pci:v000014E4d000043D9* - ID_MODEL_FROM_DATABASE=BCM43570 + ID_MODEL_FROM_DATABASE=BCM43570 802.11ac Wireless Network Adapter pci:v000014E4d000043DF* ID_MODEL_FROM_DATABASE=BCM4354 802.11ac Wireless LAN SoC pci:v000014E4d000043EC* - ID_MODEL_FROM_DATABASE=BCM4356 + ID_MODEL_FROM_DATABASE=BCM4356 802.11ac Wireless Network Adapter pci:v000014E4d00004401* ID_MODEL_FROM_DATABASE=BCM4401 100Base-T @@ -48989,6 +49340,9 @@ pci:v000014F1d00008852* pci:v000014F1d00008852sv00000070sd00008010* ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (WinTV HVR-1400 ExpressCard) +pci:v000014F1d00008852sv00000070sd0000F038* + ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (WinTV HVR-5525) + pci:v000014F1d00008852sv0000107Dsd00006F22* ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (WinFast PxTV1200) @@ -49004,6 +49358,15 @@ pci:v000014F1d00008852sv0000153Bsd0000117E* pci:v000014F1d00008852sv000018ACsd0000DB78* ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (FusionHDTV DVB-T Dual Express) +pci:v000014F1d00008852sv00004254sd00000950* + ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (S950) + +pci:v000014F1d00008852sv00004254sd00000952* + ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (S952) + +pci:v000014F1d00008852sv00004254sd00000982* + ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (T982) + pci:v000014F1d00008852sv00004254sd00009580* ID_MODEL_FROM_DATABASE=CX23885 PCI Video and Audio Decoder (T9580) @@ -49550,6 +49913,9 @@ pci:v00001542* pci:v00001542d00009260* ID_MODEL_FROM_DATABASE=RCIM-II Real-Time Clock & Interrupt Module +pci:v00001542d00009271* + ID_MODEL_FROM_DATABASE=RCIM-III Real-Time Clock & Interrupt Module (PCIe) + pci:v00001542d00009272* ID_MODEL_FROM_DATABASE=Pulse Width Modulator Card @@ -51539,6 +51905,9 @@ pci:v0000168Cd00000032* pci:v0000168Cd00000032sv0000103Csd00001838* ID_MODEL_FROM_DATABASE=AR9485 Wireless Network Adapter (AR9485/HB125 802.11bgn 1×1 Wi-Fi Adapter) +pci:v0000168Cd00000032sv0000105Bsd0000E044* + ID_MODEL_FROM_DATABASE=AR9485 Wireless Network Adapter (Unex DHXA-225) + pci:v0000168Cd00000033* ID_MODEL_FROM_DATABASE=AR9580 Wireless Network Adapter @@ -51560,6 +51929,9 @@ pci:v0000168Cd00000037sv00001A3Bsd00002100* pci:v0000168Cd0000003C* ID_MODEL_FROM_DATABASE=QCA988x 802.11ac Wireless Network Adapter +pci:v0000168Cd0000003E* + ID_MODEL_FROM_DATABASE=Killer N1525 Wireless-AC + pci:v0000168Cd00000207* ID_MODEL_FROM_DATABASE=AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -51872,6 +52244,24 @@ pci:v000016D5d00006303* pci:v000016D5d00006304* ID_MODEL_FROM_DATABASE=XMC Module with user-configurable Virtex-6 FPGA, 365k logic cells, no front I/O +pci:v000016D5d00007000* + ID_MODEL_FROM_DATABASE=XMC-7K325F: User-configurable Kintex-7 FPGA, 325k logic cells plus SFP front I/O + +pci:v000016D5d00007001* + ID_MODEL_FROM_DATABASE=XMC-7K410F: User-configurable Kintex-7 FPGA, 410k logic cells plus SFP front I/O + +pci:v000016D5d00007002* + ID_MODEL_FROM_DATABASE=XMC-7K325AX: User-Configurable Kintex-7 FPGA, 325k logic cells with AXM Plug-In I/O + +pci:v000016D5d00007003* + ID_MODEL_FROM_DATABASE=XMC-7K410AX: User-Configurable Kintex-7 FPGA, 410k logic cells with AXM Plug-In I/O + +pci:v000016D5d00007004* + ID_MODEL_FROM_DATABASE=XMC-7K325CC: User-Configurable Kintex-7 FPGA, 325k logic cells, conduction-cooled + +pci:v000016D5d00007005* + ID_MODEL_FROM_DATABASE=XMC-7K410CC: User-Configurable Kintex-7 FPGA, 410k logic cells, conduction-cooled + pci:v000016DA* ID_VENDOR_FROM_DATABASE=Advantech Co., Ltd. @@ -52325,6 +52715,9 @@ pci:v00001796d00000011* pci:v00001796d00000012* ID_MODEL_FROM_DATABASE=SIS1100-e quad link +pci:v00001796d00000015* + ID_MODEL_FROM_DATABASE=SIS8100 [Gigabit link, MicroTCA] + pci:v00001797* ID_VENDOR_FROM_DATABASE=Techwell Inc. @@ -55154,6 +55547,12 @@ pci:v00001AE9d00000201* pci:v00001AE9d00000301* ID_MODEL_FROM_DATABASE=Wil6200 802.11ad Wireless Network Adapter +pci:v00001AE9d00000302* + ID_MODEL_FROM_DATABASE=Wil6200 802.11ad Wireless Network Adapter + +pci:v00001AE9d00000310* + ID_MODEL_FROM_DATABASE=Wil6200 802.11ad Wireless Network Adapter + pci:v00001AEC* ID_VENDOR_FROM_DATABASE=Wolfson Microelectronics @@ -55349,6 +55748,12 @@ pci:v00001B37* pci:v00001B37d00000014* ID_MODEL_FROM_DATABASE=ADQ412 +pci:v00001B39* + ID_VENDOR_FROM_DATABASE=sTec, Inc. + +pci:v00001B39d00000001* + ID_MODEL_FROM_DATABASE=S1120 PCIe Accelerator SSD + pci:v00001B3A* ID_VENDOR_FROM_DATABASE=Westar Display Technologies @@ -55463,6 +55868,9 @@ pci:v00001B55d0000F1C4* pci:v00001B66* ID_VENDOR_FROM_DATABASE=Deltacast +pci:v00001B66d00000007* + ID_MODEL_FROM_DATABASE=Delta-3G-elp-11 SDI I/O Board + pci:v00001B6F* ID_VENDOR_FROM_DATABASE=Etron Technology, Inc. @@ -55511,6 +55919,9 @@ pci:v00001B85* pci:v00001B85d00001041* ID_MODEL_FROM_DATABASE=RevoDrive 3 X2 PCI-Express SSD 240 GB (Marvell Controller) +pci:v00001B85d00008788* + ID_MODEL_FROM_DATABASE=RevoDrive Hybrid + pci:v00001B96* ID_VENDOR_FROM_DATABASE=Western Digital @@ -55592,6 +56003,12 @@ pci:v00001C1C* pci:v00001C1Cd00000001* ID_MODEL_FROM_DATABASE=82C101 +pci:v00001C28* + ID_VENDOR_FROM_DATABASE=Lite-On IT Corp. / Plextor + +pci:v00001C28d00000122* + ID_MODEL_FROM_DATABASE=M6e PCI Express SSD [Marvell 88SS9183] + pci:v00001C2C* ID_VENDOR_FROM_DATABASE=Fiberblaze @@ -55691,6 +56108,15 @@ pci:v00001CF7* pci:v00001D21* ID_VENDOR_FROM_DATABASE=Allo +pci:v00001D26* + ID_VENDOR_FROM_DATABASE=Kalray Inc. + +pci:v00001D26d00000040* + ID_MODEL_FROM_DATABASE=Turbocard2 Accelerator + +pci:v00001D26d0000E004* + ID_MODEL_FROM_DATABASE=AB01/EMB01 Development Board + pci:v00001D44* ID_VENDOR_FROM_DATABASE=DPT @@ -55994,6 +56420,12 @@ pci:v000037D9* pci:v000037D9d00001138* ID_MODEL_FROM_DATABASE=SCHD-PH-8 Phase detector +pci:v000037D9d00001140* + ID_MODEL_FROM_DATABASE=VR-12-PCI + +pci:v000037D9d00001141* + ID_MODEL_FROM_DATABASE=PCI-485(422) + pci:v00003842* ID_VENDOR_FROM_DATABASE=eVga.com. Corp. @@ -58874,6 +59306,9 @@ pci:v00008086d00000A26* pci:v00008086d00000A2A* ID_MODEL_FROM_DATABASE=Haswell-ULT Integrated Graphics Controller +pci:v00008086d00000A2E* + ID_MODEL_FROM_DATABASE=Haswell-ULT Integrated Graphics Controller + pci:v00008086d00000BE0* ID_MODEL_FROM_DATABASE=Atom Processor D2xxx/N2xxx Integrated Graphics Controller @@ -59534,6 +59969,9 @@ pci:v00008086d00000F0C* pci:v00008086d00000F0E* ID_MODEL_FROM_DATABASE=Atom Processor Z36xxx/Z37xxx Series LPIO1 SPI Controller +pci:v00008086d00000F12* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series SMBus Controller + pci:v00008086d00000F14* ID_MODEL_FROM_DATABASE=Atom Processor Z36xxx/Z37xxx Series SDIO Controller @@ -59549,6 +59987,18 @@ pci:v00008086d00000F18* pci:v00008086d00000F1C* ID_MODEL_FROM_DATABASE=Atom Processor Z36xxx/Z37xxx Series Power Control Unit +pci:v00008086d00000F20* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series SATA IDE Controller + +pci:v00008086d00000F21* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series SATA IDE Controller + +pci:v00008086d00000F22* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series SATA AHCI Controller + +pci:v00008086d00000F23* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series SATA AHCI Controller + pci:v00008086d00000F28* ID_MODEL_FROM_DATABASE=Atom Processor Z36xxx/Z37xxx Series LPE Audio Controller @@ -59591,6 +60041,21 @@ pci:v00008086d00000F46* pci:v00008086d00000F47* ID_MODEL_FROM_DATABASE=Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #7 +pci:v00008086d00000F48* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series PCI Express Root Port 1 + +pci:v00008086d00000F4A* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series PCI Express Root Port 2 + +pci:v00008086d00000F4C* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series PCI Express Root Port 3 + +pci:v00008086d00000F4E* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series PCI Express Root Port 4 + +pci:v00008086d00000F50* + ID_MODEL_FROM_DATABASE=Atom Processor E3800 Series eMMC 4.5 Controller + pci:v00008086d00001000* ID_MODEL_FROM_DATABASE=82542 Gigabit Ethernet Controller (Fiber) @@ -62213,6 +62678,21 @@ pci:v00008086d000015A2* pci:v00008086d000015A3* ID_MODEL_FROM_DATABASE=Ethernet Connection (3) I218-V +pci:v00008086d000015A8* + ID_MODEL_FROM_DATABASE=Ethernet Connection X552 Virtual Function + +pci:v00008086d000015AA* + ID_MODEL_FROM_DATABASE=Ethernet Connection X552 10 GbE Backplane + +pci:v00008086d000015AB* + ID_MODEL_FROM_DATABASE=Ethernet Connection X552 10 GbE Backplane + +pci:v00008086d000015AC* + ID_MODEL_FROM_DATABASE=Ethernet Connection X552 10 GbE SFP+ + +pci:v00008086d000015AD* + ID_MODEL_FROM_DATABASE=Ethernet Connection X552/X557-AT 10GBASE-T + pci:v00008086d000015B7* ID_MODEL_FROM_DATABASE=Ethernet Connection (2) I219-LM diff --git a/hwdb/20-usb-vendor-model.hwdb b/hwdb/20-usb-vendor-model.hwdb index 987910656..94e0269ce 100644 --- a/hwdb/20-usb-vendor-model.hwdb +++ b/hwdb/20-usb-vendor-model.hwdb @@ -5,9 +5,6 @@ usb:v0001* ID_VENDOR_FROM_DATABASE=Fry's Electronics -usb:v0001p142B* - ID_MODEL_FROM_DATABASE=Arbiter Systems, Inc. - usb:v0001p7778* ID_MODEL_FROM_DATABASE=Counterfeit flash drive [Kingston] @@ -10565,6 +10562,9 @@ usb:v04A9p26DA* usb:v04A9p26E6* ID_MODEL_FROM_DATABASE=iR1024 +usb:v04A9p2736* + ID_MODEL_FROM_DATABASE=I-SENSYS MF4550d + usb:v04A9p2737* ID_MODEL_FROM_DATABASE=MF4410 @@ -11402,6 +11402,18 @@ usb:v04A9p3289* usb:v04A9p328A* ID_MODEL_FROM_DATABASE=PowerShot ELPH 150 IS / IXUS 155 +usb:v04A9p328B* + ID_MODEL_FROM_DATABASE=PowerShot N Facebook(R) Ready + +usb:v04A9p329A* + ID_MODEL_FROM_DATABASE=PowerShot SX60 HS + +usb:v04A9p329B* + ID_MODEL_FROM_DATABASE=PowerShot SX520 HS + +usb:v04A9p329C* + ID_MODEL_FROM_DATABASE=PowerShot SX400 IS + usb:v04AA* ID_VENDOR_FROM_DATABASE=DaeWoo Telecom, Ltd @@ -21701,6 +21713,9 @@ usb:v05E3p0608* usb:v05E3p0610* ID_MODEL_FROM_DATABASE=4-port hub +usb:v05E3p0616* + ID_MODEL_FROM_DATABASE=hub + usb:v05E3p0660* ID_MODEL_FROM_DATABASE=USB 2.0 Hub @@ -30254,6 +30269,9 @@ usb:v0924p3CE8* usb:v0924p3D5B* ID_MODEL_FROM_DATABASE=Phaser 6115MFP TWAIN Scanner +usb:v0924p3D6D* + ID_MODEL_FROM_DATABASE=WorkCentre 6015N/NI + usb:v0924p420F* ID_MODEL_FROM_DATABASE=WorkCentre PE220 Series @@ -30561,7 +30579,7 @@ usb:v0930p6540* ID_MODEL_FROM_DATABASE=TransMemory Flash Memory usb:v0930p6544* - ID_MODEL_FROM_DATABASE=Kingston DataTraveler 2.0 Stick (2GB) + ID_MODEL_FROM_DATABASE=TransMemory-Mini / Kingston DataTraveler 2.0 Stick (2GB) usb:v0930p6545* ID_MODEL_FROM_DATABASE=Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick @@ -30884,6 +30902,9 @@ usb:v0951p1656* usb:v0951p1665* ID_MODEL_FROM_DATABASE=Digital DataTraveler SE9 64GB +usb:v0951p1666* + ID_MODEL_FROM_DATABASE=DataTraveler G4 + usb:v0951p1689* ID_MODEL_FROM_DATABASE=DataTraveler SE9 @@ -30903,7 +30924,7 @@ usb:v0955p7030* ID_MODEL_FROM_DATABASE=Tegra 3 (recovery mode) usb:v0955p7100* - ID_MODEL_FROM_DATABASE=Notion Ink Adam + ID_MODEL_FROM_DATABASE=Tegra Device usb:v0955p7820* ID_MODEL_FROM_DATABASE=Tegra 2 AC100 developer mode @@ -34532,6 +34553,12 @@ usb:v0BC2p2300* usb:v0BC2p2320* ID_MODEL_FROM_DATABASE=USB 3.0 bridge [Portable Expansion Drive] +usb:v0BC2p2321* + ID_MODEL_FROM_DATABASE=Expansion Portable + +usb:v0BC2p2340* + ID_MODEL_FROM_DATABASE=FreeAgent External Hard Drive + usb:v0BC2p3000* ID_MODEL_FROM_DATABASE=FreeAgent Desktop @@ -35735,6 +35762,15 @@ usb:v0C4Bp0100* usb:v0C4Bp0300* ID_MODEL_FROM_DATABASE=cyberJack pinpad(a) +usb:v0C4Bp0400* + ID_MODEL_FROM_DATABASE=cyberJack e-com(a) + +usb:v0C4Bp0401* + ID_MODEL_FROM_DATABASE=cyberJack pinpad(a2) + +usb:v0C4Bp0500* + ID_MODEL_FROM_DATABASE=cyberJack RFID standard dual interface smartcard reader + usb:v0C4Bp0501* ID_MODEL_FROM_DATABASE=cyberJack RFID comfort dual interface smartcard reader @@ -48560,6 +48596,15 @@ usb:v1C26* usb:v1C27* ID_VENDOR_FROM_DATABASE=HuiYang D & S Cable Co., Ltd. +usb:v1C29* + ID_VENDOR_FROM_DATABASE=Elster GmbH + +usb:v1C29p0001* + ID_MODEL_FROM_DATABASE=ExMFE5 Simulator + +usb:v1C29p10FC* + ID_MODEL_FROM_DATABASE=enCore device + usb:v1C31* ID_VENDOR_FROM_DATABASE=LS Cable Ltd. @@ -50475,7 +50520,25 @@ usb:v2639p0013* ID_MODEL_FROM_DATABASE=MTi-300 AHRS usb:v2639p0017* - ID_MODEL_FROM_DATABASE=MTi-G-700 GPS INS + ID_MODEL_FROM_DATABASE=MTi-G 7xx GNSS/INS + +usb:v2639p0100* + ID_MODEL_FROM_DATABASE=Body Pack + +usb:v2639p0101* + ID_MODEL_FROM_DATABASE=Awinda Station + +usb:v2639p0102* + ID_MODEL_FROM_DATABASE=Awinda Dongle + +usb:v2639p0103* + ID_MODEL_FROM_DATABASE=Sync Station + +usb:v2639p0200* + ID_MODEL_FROM_DATABASE=MTw + +usb:v2639pD00D* + ID_MODEL_FROM_DATABASE=Wireless Receiver usb:v2650* ID_VENDOR_FROM_DATABASE=Electronics For Imaging, Inc. [hex] @@ -50735,15 +50798,36 @@ usb:v3125* usb:v3125p0001* ID_MODEL_FROM_DATABASE=TrackerPod Camera Stand +usb:v3136* + ID_VENDOR_FROM_DATABASE=Navini Networks + usb:v3176* ID_VENDOR_FROM_DATABASE=Whanam Electronics Co., Ltd +usb:v3195* + ID_VENDOR_FROM_DATABASE=Link Instruments + +usb:v3195pF190* + ID_MODEL_FROM_DATABASE=MSO-19 + +usb:v3195pF280* + ID_MODEL_FROM_DATABASE=MSO-28 + +usb:v3195pF281* + ID_MODEL_FROM_DATABASE=MSO-28 + usb:v3275* ID_VENDOR_FROM_DATABASE=VidzMedia Pte Ltd usb:v3275p4FB1* ID_MODEL_FROM_DATABASE=MonsterTV P2H +usb:v3333* + ID_VENDOR_FROM_DATABASE=InLine + +usb:v3333p3333* + ID_MODEL_FROM_DATABASE=2 port KVM switch model 60652K + usb:v3334* ID_VENDOR_FROM_DATABASE=AEI @@ -50762,6 +50846,12 @@ usb:v3340p0E3A* usb:v3340pA0A3* ID_MODEL_FROM_DATABASE=deltaX 5 BT (D) PDA +usb:v3344* + ID_VENDOR_FROM_DATABASE=Leaguer Microelectronics (LME) + +usb:v3344p3744* + ID_MODEL_FROM_DATABASE=OEM PC Remote + usb:v3504* ID_VENDOR_FROM_DATABASE=Micro Star @@ -51308,6 +51398,12 @@ usb:v4146p9281* usb:v4146pBA01* ID_MODEL_FROM_DATABASE=Intuix Flash Drive +usb:v4168* + ID_VENDOR_FROM_DATABASE=Targus + +usb:v4168p1010* + ID_MODEL_FROM_DATABASE=Wireless Compact Laser Mouse + usb:v4242* ID_VENDOR_FROM_DATABASE=USB Design by Example @@ -51317,6 +51413,15 @@ usb:v4242p4201* usb:v4242p4220* ID_MODEL_FROM_DATABASE=Echo 1 Camera +usb:v4255* + ID_VENDOR_FROM_DATABASE=GoPro + +usb:v4255p1000* + ID_MODEL_FROM_DATABASE=9FF2 [Digital Photo Display] + +usb:v4255p2000* + ID_MODEL_FROM_DATABASE=HD2-14 [Hero 2 Camera] + usb:v4317* ID_VENDOR_FROM_DATABASE=Broadcom Corp. @@ -51455,6 +51560,18 @@ usb:v5345* usb:v5345p1234* ID_MODEL_FROM_DATABASE=PDS6062T Oscilloscope +usb:v534C* + ID_VENDOR_FROM_DATABASE=SatoshiLabs + +usb:v534Cp0001* + ID_MODEL_FROM_DATABASE=Bitcoin Wallet [TREZOR] + +usb:v5354* + ID_VENDOR_FROM_DATABASE=Meyer Instruments (MIS) + +usb:v5354p0017* + ID_MODEL_FROM_DATABASE=PAXcam2 + usb:v544D* ID_VENDOR_FROM_DATABASE=Transmeta Corp. @@ -51605,6 +51722,9 @@ usb:v5986p02D0* usb:v5986p03D0* ID_MODEL_FROM_DATABASE=Lenovo Integrated Webcam [R5U877] +usb:v59E3* + ID_VENDOR_FROM_DATABASE=Nonolith Labs + usb:v5A57* ID_VENDOR_FROM_DATABASE=Zinwell @@ -51653,6 +51773,93 @@ usb:v6189p182D* usb:v6189p2068* ID_MODEL_FROM_DATABASE=USB to serial cable (v2) +usb:v6244* + ID_VENDOR_FROM_DATABASE=LightingSoft AG + +usb:v6244p0101* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI5A + +usb:v6244p0201* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI5C + +usb:v6244p0300* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI6 Firmware download + +usb:v6244p0301* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI6C + +usb:v6244p0302* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI6A + +usb:v6244p0303* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI6D + +usb:v6244p0400* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK1A + +usb:v6244p0401* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK1A + +usb:v6244p0410* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI7 Firmware Download + +usb:v6244p0411* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI7A + +usb:v6244p0420* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI8A Firmware Download + +usb:v6244p0421* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI8A + +usb:v6244p0430* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI8C Firmware Download + +usb:v6244p0431* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI8C + +usb:v6244p0440* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9A Firmware Download + +usb:v6244p0441* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9A + +usb:v6244p0450* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9C Firmware Download + +usb:v6244p0451* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9C + +usb:v6244p0460* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK2 Firmware download + +usb:v6244p0461* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK2 + +usb:v6244p0470* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK1B Firmware download + +usb:v6244p0471* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK1B + +usb:v6244p0480* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK3 Firmware download + +usb:v6244p0481* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK3 + +usb:v6244p0490* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9D Firmware Download + +usb:v6244p0491* + ID_MODEL_FROM_DATABASE=Intelligent Usb Dmx Interface SIUDI9D + +usb:v6244p0500* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK2B Firmware download + +usb:v6244p0501* + ID_MODEL_FROM_DATABASE=Touch Sensitive Intelligent Control Keypad STICK2B + usb:v6253* ID_VENDOR_FROM_DATABASE=TwinHan Technology Co., Ltd @@ -51926,6 +52133,30 @@ usb:v8341* usb:v8341p2000* ID_MODEL_FROM_DATABASE=Flashdisk +usb:v8564* + ID_VENDOR_FROM_DATABASE=Transcend Information, Inc. + +usb:v8564p1000* + ID_MODEL_FROM_DATABASE=JetFlash + +usb:v8564p4000* + ID_MODEL_FROM_DATABASE=RDF8 + +usb:v8644* + ID_VENDOR_FROM_DATABASE=Intenso GmbG + +usb:v8644p8003* + ID_MODEL_FROM_DATABASE=Micro Line + +usb:v8644p800B* + ID_MODEL_FROM_DATABASE=Micro Line (4GB) + +usb:v8E06* + ID_VENDOR_FROM_DATABASE=CH Products, Inc. + +usb:v8E06pF700* + ID_MODEL_FROM_DATABASE=DT225 Trackball + usb:v9016* ID_VENDOR_FROM_DATABASE=Sitecom @@ -51983,6 +52214,18 @@ usb:v9710p7832* usb:v9710p7840* ID_MODEL_FROM_DATABASE=MCS7820/MCS7840 2/4 port serial adapter +usb:v9849* + ID_VENDOR_FROM_DATABASE=Bestmedia CD Recordable GmbH & Co. KG + +usb:v9849p0701* + ID_MODEL_FROM_DATABASE=Platinum MyDrive HP + +usb:v9999* + ID_VENDOR_FROM_DATABASE=Odeon + +usb:v9999p0001* + ID_MODEL_FROM_DATABASE=JAF Mobile Phone Flasher Interface + usb:v99FA* ID_VENDOR_FROM_DATABASE=Grandtec @@ -52067,12 +52310,30 @@ usb:vA727p6895* usb:vA727p6897* ID_MODEL_FROM_DATABASE=AR5523 +usb:vAAAA* + ID_VENDOR_FROM_DATABASE=MXT + +usb:vAAAAp8815* + ID_MODEL_FROM_DATABASE=microSD CardReader + usb:vABCD* ID_VENDOR_FROM_DATABASE=Unknown usb:vABCDpCDEE* ID_MODEL_FROM_DATABASE=Petcam +usb:vB58E* + ID_VENDOR_FROM_DATABASE=Blue Microphones + +usb:vB58Ep9E84* + ID_MODEL_FROM_DATABASE=Yeti Stereo Microphone + +usb:vC216* + ID_VENDOR_FROM_DATABASE=Card Device Expert Co., LTD + +usb:vC216p0180* + ID_MODEL_FROM_DATABASE=MSR90 MagStripe reader + usb:vC251* ID_VENDOR_FROM_DATABASE=Keil Software, Inc. @@ -52088,6 +52349,15 @@ usb:vCACEp0002* usb:vCACEp0300* ID_MODEL_FROM_DATABASE=AirPcap NX [Atheros AR9001U-(2)NG] +usb:vCD12* + ID_VENDOR_FROM_DATABASE=SMART TECHNOLOGY INDUSTRIAL LTD. + +usb:vD208* + ID_VENDOR_FROM_DATABASE=Ultimarc + +usb:vD208p0310* + ID_MODEL_FROM_DATABASE=Mini-PAC Arcade Control Interface + usb:vD209* ID_VENDOR_FROM_DATABASE=Ultimarc @@ -52097,6 +52367,12 @@ usb:vD209p0301* usb:vD209p0501* ID_MODEL_FROM_DATABASE=Ultra-Stik Ultimarc Ultra-Stik Player 1 +usb:vD904* + ID_VENDOR_FROM_DATABASE=LogiLink + +usb:vD904p0003* + ID_MODEL_FROM_DATABASE=Laser Mouse (ID0009A) + usb:vE4E4* ID_VENDOR_FROM_DATABASE=Xorcom Ltd. @@ -52193,14 +52469,50 @@ usb:vEB1ApE355* usb:vEB2A* ID_VENDOR_FROM_DATABASE=KWorld +usb:vEF18* + ID_VENDOR_FROM_DATABASE=SMART TECHNOLOGY INDUSTRIAL LTD. + usb:vF003* ID_VENDOR_FROM_DATABASE=Hewlett Packard usb:vF003p6002* ID_MODEL_FROM_DATABASE=PhotoSmart C500 +usb:vF182* + ID_VENDOR_FROM_DATABASE=Leap Motion + +usb:vF182p0003* + ID_MODEL_FROM_DATABASE=Controller + usb:vF4EC* ID_VENDOR_FROM_DATABASE=Atten Electronics / Siglent Technologies usb:vF4ECpEE38* ID_MODEL_FROM_DATABASE=Digital Storage Oscilloscope + +usb:vF4ED* + ID_VENDOR_FROM_DATABASE=Shenzhen Siglent Co., Ltd. + +usb:vF4EDpEE37* + ID_MODEL_FROM_DATABASE=SDG1010 Waveform Generator + +usb:vF4EDpEE3A* + ID_MODEL_FROM_DATABASE=SDG1010 Waveform Generator (TMC mode) + +usb:vF766* + ID_VENDOR_FROM_DATABASE=Hama + +usb:vF766p0001* + ID_MODEL_FROM_DATABASE=PC-Gamepad "Greystorm" + +usb:vFC08* + ID_VENDOR_FROM_DATABASE=Conrad Electronic SE + +usb:vFC08p0101* + ID_MODEL_FROM_DATABASE=MIDI Cable UA0037 + +usb:vFFEE* + ID_VENDOR_FROM_DATABASE=FNK Tech + +usb:vFFEEp0100* + ID_MODEL_FROM_DATABASE=Card Reader Controller RTS5101/RTS5111/RTS5116 diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb index 46348b981..1b7d87101 100644 --- a/hwdb/60-keyboard.hwdb +++ b/hwdb/60-keyboard.hwdb @@ -473,6 +473,14 @@ keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr* # KEYBOARD_KEY_3e=fullscreen, no defined key sym +# HP EliteBook 725 G2 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPLicrice:pvr* +# HP ProBook 440 G2 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP440G2:pvr* +# HP ProBook 445 G1 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPProBook445G1NotebookPC:pvr* + KEYBOARD_KEY_81=f20 # Fn+F8; Microphone mute button, should be micmute + ########################################################### # IBM ########################################################### @@ -562,6 +570,10 @@ keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*3000*:pvr* KEYBOARD_KEY_98=suspend # Fn+F12 hibernate KEYBOARD_KEY_b4=prog1 # Lenovo Care +# "Lenovo Care" Key of the 3000 N200 +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO:pn0769AP2:pvr3000N200:* + KEYBOARD_KEY_b4=prog1 + # lenovo-ideapad keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*IdeaPad*:pvr* keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnS10-*:pvr* @@ -586,7 +598,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet* # ThinkPad X6 Tablet keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnThinkPad*X6*:pvr* KEYBOARD_KEY_6c=direction # rotate - KEYBOARD_KEY_68=f13 # toolbox + KEYBOARD_KEY_68=leftmeta # toolbox KEYBOARD_KEY_6b=esc # escape KEYBOARD_KEY_6d=right # right on d-pad KEYBOARD_KEY_6e=left # left on d-pad @@ -597,7 +609,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnThinkPad*X6*:pvr* # ThinkPad X41 Tablet keyboard:dmi:bvn*:bvr*:bd*:svnIBM*:pn18666TU:pvr* KEYBOARD_KEY_6c=direction # rotate - KEYBOARD_KEY_68=f13 # toolbox + KEYBOARD_KEY_68=leftmeta # toolbox KEYBOARD_KEY_6b=esc # escape KEYBOARD_KEY_69=enter # enter on d-pad @@ -796,14 +808,16 @@ keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnGE70*:pvr* keyboard:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*:pvr* KEYBOARD_KEY_c2=ejectcd -# +# some MSI models generate ACPI/input events on the LNXVIDEO input devices, +# plus some extra synthesized ones on atkbd as an echo of actually changing the +# brightness; so ignore those atkbd ones, to avoid loops keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U-100*:pvr* keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U100*:pvr* keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*N033:* KEYBOARD_KEY_f7=reserved KEYBOARD_KEY_f8=reserved -# +# MSI Wind U90/U100 generates separate touchpad on/off keycodes so ignore touchpad toggle keycode keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:* KEYBOARD_KEY_e4=reserved diff --git a/hwdb/70-mouse.hwdb b/hwdb/70-mouse.hwdb index 1a901e736..a62ebc497 100644 --- a/hwdb/70-mouse.hwdb +++ b/hwdb/70-mouse.hwdb @@ -28,11 +28,36 @@ # mouse:usb:v17efp6019:* # mouse:*:name:Lenovo Optical USB Mouse: # +# To add local entries, create a new file +# /etc/udev/hwdb.d/71-mouse-local.hwdb +# and add your rules there. To load the new rules execute (as root): +# udevadm hwdb --update +# udevadm trigger /dev/input/eventXX +# where /dev/input/eventXX is the mouse in question. If in +# doubt, simply use /dev/input/event* to reload all input rules. +# +# If your changes are generally applicable, open a bug report on +# http://bugs.freedesktop.org/enter_bug.cgi?product=systemd +# and include your new rules, a description of the device, and the +# output of +# udevadm info /dev/input/eventXX +# (or /dev/input/event*). +# +# Allowed properties are: +# MOUSE_DPI +# MOUSE_WHEEL_CLICK_ANGLE +# +######################################### +# MOUSE_DPI # +######################################### +# # DPI settings are specified as # MOUSE_DPI=[@] # # Where is the resolution in dots per inch, and the -# optional sampling frequency in Hz. +# sampling frequency in Hz (optional). If a device supports dynamic +# frequency scaling, the maximum frequency should be used. For devices +# supporting multiple fixed frequencies, see below. # # The value of MOUSE_DPI is: # - a single integer for single-resolution mice, e.g. @@ -48,7 +73,7 @@ # ascending order, whichever appropriate. # # The frequency must be given to either none or all resolutions. If the -# device supports multiple frequencies, the order of items is +# device supports multiple fixed frequencies, the order of items is # MOUSE_DPI=r1@f1 r2@f1 r3@f1 r1@f2 r2@f2 r3@f2 # # If the default manufacturer-set resolution is unclear, a resolution of @@ -62,20 +87,27 @@ # third-party software) must not be entered into this file, use a local # hwdb instead. # -# To add local entries, create a new file -# /etc/udev/hwdb.d/71-mouse-local.hwdb -# and add your rules there. To load the new rules execute (as root): -# udevadm hwdb --update -# udevadm trigger /dev/input/eventXX -# where /dev/input/eventXX is the mouse in question. If in -# doubt, simply use /dev/input/event* to reload all input rules. +######################################### +# MOUSE_WHEEL_CLICK_ANGLE # +######################################### # -# If your changes are generally applicable, open a bug report on -# http://bugs.freedesktop.org/enter_bug.cgi?product=systemd -# and include your new rules, a description of the device, and the -# output of -# udevadm info /dev/input/eventXX -# (or /dev/input/event*). +# The angle in degrees per mouse wheel 'click', specified as +# MOUSE_WHEEL_CLICK_ANGLE= +# +# Most mice have a 15 degree click stop (24 clicks per full rotation). +# + +# +# Sort by by brand, type (usb, bluetooth), DPI, frequency. +# For mice with switchable resolution, sort by the starred entry. + +########################################## +# Chicony +########################################## + +# Chicony 2.4G Multimedia Wireless Kit MG-0919 +mouse:usb:v04f2p0963:name:Chicony 2.4G Multimedia Wireless Kit: + MOUSE_DPI=1000@142 ########################################## # Dell @@ -85,6 +117,13 @@ mouse:usb:v046dpc063:name:DELL DELL USB Laser Mouse: MOUSE_DPI=1000@125 +########################################## +# Fujitsu Siemens +########################################## + +mouse:usb:v0461p4d16:name:USB Optical Mouse: + MOUSE_DPI=500@125 + ########################################## # Lenovo ########################################## @@ -106,72 +145,139 @@ mouse:usb:v17efp6044:name:ThinkPad USB Laser Mouse: # model name. The usb vid/pid is the same for all those devices. # Until 3.19 is available, this list just has the Wireless PID entry. -# Logitech B605 Wireless Mouse (also M505) -mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101d: - MOUSE_DPI=900@166 +# Logitech M-BJ58 Optical Mouse +mouse:usb:v046dpc00e:name:Logitech USB-PS/2 Optical Mouse: +# Logitech MX310 Optical Mouse +mouse:usb:v046dpc01b:name:Logitech USB-PS/2 Optical Mouse: +# Logitech USB-PS/2 M-BT58 +mouse:usb:v046dpc03e:name:Logitech USB-PS/2 Optical Mouse: + MOUSE_DPI=400@125 + +# Lenovo USB mouse model MO28UOL +mouse:usb:v04b3p310c:name:USB Optical Mouse: + MOUSE_DPI=400@142 + +# Logitech USB-PS/2 M-BZ96C +mouse:usb:v046dpc045:name:Logitech USB-PS/2 Optical Mouse: + MOUSE_DPI=600@125 + +# Logitech Wireless Mouse M325 +mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:400a: + MOUSE_DPI=600@166 + MOUSE_WHEEL_CLICK_ANGLE=20 +# Logitech MX1000 Laser Cordless Mouse +mouse:usb:v046dpc50e:name:Logitech USB RECEIVER: # Logitech Cordless Click! Plus mouse:usb:v046dpc50e:name:Logitech USB Receiver: +# Logitech, Inc. RX 300 Optical Mouse +mouse:usb:v046dpc040:name:Logitech USB-PS/2 Optical Mouse: MOUSE_DPI=800@125 +# Logitech MX 518 +mouse:usb:v046dpc01e:name:Logitech USB-PS/2 Optical Mouse: + MOUSE_DPI=400@125 *800@125 1600@125 + +# Logitech, Inc. RX 250 Optical Mouse +mouse:usb:v046dpc050:name:Logitech USB-PS/2 Optical Mouse: + MOUSE_DPI=800@142 + +# Logitech G400 (Wired) +mouse:usb:v046dpc245:name:Logitech Gaming Mouse G400: + MOUSE_DPI=400@1000 *800@1000 1800@1000 3600@1000 + +# Logitech G400s (Wired) +mouse:usb:v046dpc24c:name:Logitech G400s Optical Gaming Mouse: + MOUSE_DPI=400@1000 *800@1000 2000@1000 4000@1000 + +# Logitech Wireless Mouse M185 +mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4008: +# Logitech M705 (marathon mouse) +mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101b: + MOUSE_DPI=800@166 + # Logitech G500s Laser Gaming Mouse mouse:usb:v046dpc24e:name:Logitech G500s Laser Gaming Mouse: MOUSE_DPI=400@500 *800@500 2000@500 +# Logitech B605 Wireless Mouse (also M505) +mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101d: + MOUSE_DPI=900@166 + +# Logitech RX1000 Laser Mouse +mouse:usb:v046dpc046:name:Logitech USB Optical Mouse: +# Logitech M100 Optical Mouse +mouse:usb:v046dpc05a:name:Logitech USB Optical Mouse: +# Logitech USB Laser Mouse M-U0011-O rebranded as "terra Laser" +mouse:usb:v046dpc065:name:Logitech USB Laser Mouse: + MOUSE_DPI=1000@125 + +# Logitech MK260 Wireless Combo Receiver aka M-R0011 +mouse:usb:v046dpc52e:name:Logitech USB Receiver: + MOUSE_DPI=1000@200 + # Logitech G700 Laser Mouse (Wired) mouse:usb:v046dpc06b:name:Logitech G700 Laser Mouse: # Logitech G700 Laser Mouse (Wireless) mouse:usb:v046dpc531:name:Logitech USB Receiver: MOUSE_DPI=*1000@500 3800@500 500@1000 1500@1000 2000@1000 -# Logitech Wireless Mouse M185 -mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4008: - MOUSE_DPI=800@166 - -# Logitech M705 (marathon mouse) -mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101b: - MOUSE_DPI=800@166 - -# Logitech ZoneTouch Mouse T400 -mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4026: - MOUSE_DPI=1300@166 +# Logitech USB Laser Mouse M-UAS144 [LS1 Laser Mouse] +mouse:usb:v046dpc062:name:Logitech USB Laser Mouse: +# Logitech USB Laser Mouse M-U0007 +mouse:usb:v046dpc069:name:Logitech USB Laser Mouse: + MOUSE_DPI=1200@125 # Logitech T620 (or, the soap) mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4027: MOUSE_DPI=1200@250 -# Logitech Wirless Mouse M325 -mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:400a: - MOUSE_DPI=600@166 +# Logitech ZoneTouch Mouse T400 +mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4026: + MOUSE_DPI=1300@166 # Logitech Ultrathin Touch Mouse mouse:bluetooth:v046dpb00d:name:Ultrathin Touch Mouse: MOUSE_DPI=1000@1000 -# Logitech USB Optical Mouse -mouse:usb:v046dpc05a:name:Logitech USB Optical Mouse: - MOUSE_DPI=1000@125 - -# Logitech USB-PS/2 M-BZ96C -mouse:usb:v046dpc045:name:Logitech USB-PS/2 Optical Mouse: - MOUSE_DPI=600@125 - -# Logitech USB-PS/2 M-BT58 -mouse:usb:v046dpc03e:name:Logitech USB-PS/2 Optical Mouse: - MOUSE_DPI=400@125 +# ImExPS/2 Logitech Wheel Mouse +mouse:ps2:*:name:ImExPS/2 Logitech Wheel Mouse: + MOUSE_DPI=400@250 ########################################## # Microsoft ########################################## +mouse:usb:v045ep0040:name:Microsoft Microsoft 3-Button Mouse with IntelliEye(TM): + MOUSE_DPI=400@125 + +# Note: unsure that these work, it's likely that all devices on these +# receivers show up with the same vid/pid/name + +# Microsoft Sculpt Ergonomic Mouse +mouse:usb:v045ep07a5:name:Microsoft Microsoft® 2.4GHz Transceiver v9.0: + MOUSE_DPI=1000@142 + # Microsoft Arc Touch Mouse USB mouse:usb:v045ep07b1:name:Microsoft Microsoft® Nano Transceiver v1.0: MOUSE_DPI=1400@142 +# Microsoft Wireless Laser Mouse 8000 +mouse:bluetooth:v045ep0702:name:Microsoft Wireless Laser Mouse 8000: + MOUSE_DPI=1000@1000 + ########################################## # Oklick ########################################## -# Oklick 406S Bluetooth Laster Mouse +# Oklick 406S Bluetooth Laser Mouse mouse:bluetooth:v056ep0061:name:Laser BTmouse: MOUSE_DPI=*800@333 1600@333 + +########################################## +# Razer +########################################## + +# Razer Abyssus +mouse:usb:v1532p0042:name:Razer Razer Abyssus: + MOUSE_DPI=3500@1000 diff --git a/hwdb/70-touchpad.hwdb b/hwdb/70-touchpad.hwdb new file mode 100644 index 000000000..bbf44db77 --- /dev/null +++ b/hwdb/70-touchpad.hwdb @@ -0,0 +1,39 @@ +# This file is part of systemd. +# +# The lookup keys are composed in: +# 70-touchpad.rules +# +# Note: The format of the "touchpad:" prefix match key is a +# contract between the rules file and the hardware data, it might +# change in later revisions to support more or better matches, it +# is not necessarily expected to be a stable ABI. +# +# Match string format: +# touchpad:pnpid:: +# +# To add local entries, create a new file +# /etc/udev/hwdb.d/71-touchpad-local.hwdb +# and add your rules there. To load the new rules execute (as root): +# udevadm hwdb --update +# udevadm trigger /dev/input/eventXX +# where /dev/input/eventXX is the touchpad in question. If in +# doubt, simply use /dev/input/event* to reload all input rules. +# +# If your changes are generally applicable, open a bug report on +# http://bugs.freedesktop.org/enter_bug.cgi?product=systemd +# and include your new rules, a description of the device, and the +# output of +# udevadm info /dev/input/eventXX +# (or /dev/input/event*). +# +# Allowed properties are: +# TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1 +# +# If the TOUCHPAD_HAS_TRACKPOINT_BUTTONS property is set, this +# device has # the trackpoint buttons wired up to the touchpad as +# BTN_0, BTN_1 and BTN_2. This affects the Lenovo X1 Carbon 3rd +# and the *50 series (T450, T550, etc.) + +# Lenovo X1 Carbon 3rd +touchpad:pnpid:*LEN0048*: + TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1 diff --git a/man/SD_ALERT.html b/man/SD_ALERT.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_ALERT.html +++ b/man/SD_ALERT.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_CRIT.html b/man/SD_CRIT.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_CRIT.html +++ b/man/SD_CRIT.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_DEBUG.html b/man/SD_DEBUG.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_DEBUG.html +++ b/man/SD_DEBUG.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_EMERG.html b/man/SD_EMERG.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_EMERG.html +++ b/man/SD_EMERG.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_ERR.html b/man/SD_ERR.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_ERR.html +++ b/man/SD_ERR.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_ID128_CONST_STR.html b/man/SD_ID128_CONST_STR.html index f0ece03fc..618b484f5 100644 --- a/man/SD_ID128_CONST_STR.html +++ b/man/SD_ID128_CONST_STR.html @@ -19,71 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. -

See - sd_id128_to_string(3), - sd_id128_randomize(3) and - sd_id128_get_machine(3) - for more information about the implemented - functions.

A 128-bit ID is implemented as the following - union type:

typedef union sd_id128 {
-        uint8_t bytes[16];
-        uint64_t qwords[2];
-} sd_id128_t;

This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients.

A couple of macros are defined to denote and - decode 128-bit IDs:

SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
-        puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
+  gudev systemd 219

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. +

See + sd_id128_to_string(3), + sd_id128_randomize(3) + and + sd_id128_get_machine(3) + for more information about the implemented functions.

A 128-bit ID is implemented as the following + union type:

typedef union sd_id128 {
+  uint8_t bytes[16];
+  uint64_t qwords[2];
+} sd_id128_t;

This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients.

A couple of macros are defined to denote and decode 128-bit + IDs:

SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
+  puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
 }

SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf(3) - format string, as shown in the following - example:

int main(int argc, char *argv[]) {
-        sd_id128_t id;
-        id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
-        return 0;
+    SD_ID128_FORMAT_VAL() may be used to format a
+    128-bit ID in a
+    printf(3)
+    format string, as shown in the following example:

int main(int argc, char *argv[]) {
+  sd_id128_t id;
+  id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
+  printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
+  return 0;
 }

Use sd_id128_equal() to compare two 128-bit IDs:

int main(int argc, char *argv[]) {
-        sd_id128_t a, b, c;
-        a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e);
-        c = a;
-        assert(sd_id128_equal(a, c));
-        assert(!sd_id128_equal(a, b));
-        return 0;
-}

Note that new, randomized IDs may be generated - with - journalctl(1)'s - --new-id option.

Notes¶

These APIs are implemented as a shared + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; +}

Note that new, randomized IDs may be generated with + journalctl(1)'s + --new-id option.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_ID128_FORMAT_STR.html b/man/SD_ID128_FORMAT_STR.html index f0ece03fc..618b484f5 100644 --- a/man/SD_ID128_FORMAT_STR.html +++ b/man/SD_ID128_FORMAT_STR.html @@ -19,71 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. -

See - sd_id128_to_string(3), - sd_id128_randomize(3) and - sd_id128_get_machine(3) - for more information about the implemented - functions.

A 128-bit ID is implemented as the following - union type:

typedef union sd_id128 {
-        uint8_t bytes[16];
-        uint64_t qwords[2];
-} sd_id128_t;

This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients.

A couple of macros are defined to denote and - decode 128-bit IDs:

SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
-        puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
+  gudev systemd 219

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. +

See + sd_id128_to_string(3), + sd_id128_randomize(3) + and + sd_id128_get_machine(3) + for more information about the implemented functions.

A 128-bit ID is implemented as the following + union type:

typedef union sd_id128 {
+  uint8_t bytes[16];
+  uint64_t qwords[2];
+} sd_id128_t;

This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients.

A couple of macros are defined to denote and decode 128-bit + IDs:

SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
+  puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
 }

SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf(3) - format string, as shown in the following - example:

int main(int argc, char *argv[]) {
-        sd_id128_t id;
-        id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
-        return 0;
+    SD_ID128_FORMAT_VAL() may be used to format a
+    128-bit ID in a
+    printf(3)
+    format string, as shown in the following example:

int main(int argc, char *argv[]) {
+  sd_id128_t id;
+  id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
+  printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
+  return 0;
 }

Use sd_id128_equal() to compare two 128-bit IDs:

int main(int argc, char *argv[]) {
-        sd_id128_t a, b, c;
-        a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e);
-        c = a;
-        assert(sd_id128_equal(a, c));
-        assert(!sd_id128_equal(a, b));
-        return 0;
-}

Note that new, randomized IDs may be generated - with - journalctl(1)'s - --new-id option.

Notes¶

These APIs are implemented as a shared + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; +}

Note that new, randomized IDs may be generated with + journalctl(1)'s + --new-id option.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_ID128_FORMAT_VAL.html b/man/SD_ID128_FORMAT_VAL.html index f0ece03fc..618b484f5 100644 --- a/man/SD_ID128_FORMAT_VAL.html +++ b/man/SD_ID128_FORMAT_VAL.html @@ -19,71 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. -

See - sd_id128_to_string(3), - sd_id128_randomize(3) and - sd_id128_get_machine(3) - for more information about the implemented - functions.

A 128-bit ID is implemented as the following - union type:

typedef union sd_id128 {
-        uint8_t bytes[16];
-        uint64_t qwords[2];
-} sd_id128_t;

This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients.

A couple of macros are defined to denote and - decode 128-bit IDs:

SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
-        puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
+  gudev systemd 219

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. +

See + sd_id128_to_string(3), + sd_id128_randomize(3) + and + sd_id128_get_machine(3) + for more information about the implemented functions.

A 128-bit ID is implemented as the following + union type:

typedef union sd_id128 {
+  uint8_t bytes[16];
+  uint64_t qwords[2];
+} sd_id128_t;

This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients.

A couple of macros are defined to denote and decode 128-bit + IDs:

SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
+  puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
 }

SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf(3) - format string, as shown in the following - example:

int main(int argc, char *argv[]) {
-        sd_id128_t id;
-        id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
-        return 0;
+    SD_ID128_FORMAT_VAL() may be used to format a
+    128-bit ID in a
+    printf(3)
+    format string, as shown in the following example:

int main(int argc, char *argv[]) {
+  sd_id128_t id;
+  id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
+  printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
+  return 0;
 }

Use sd_id128_equal() to compare two 128-bit IDs:

int main(int argc, char *argv[]) {
-        sd_id128_t a, b, c;
-        a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e);
-        c = a;
-        assert(sd_id128_equal(a, c));
-        assert(!sd_id128_equal(a, b));
-        return 0;
-}

Note that new, randomized IDs may be generated - with - journalctl(1)'s - --new-id option.

Notes¶

These APIs are implemented as a shared + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; +}

Note that new, randomized IDs may be generated with + journalctl(1)'s + --new-id option.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_ID128_MAKE.html b/man/SD_ID128_MAKE.html index f0ece03fc..618b484f5 100644 --- a/man/SD_ID128_MAKE.html +++ b/man/SD_ID128_MAKE.html @@ -19,71 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. -

See - sd_id128_to_string(3), - sd_id128_randomize(3) and - sd_id128_get_machine(3) - for more information about the implemented - functions.

A 128-bit ID is implemented as the following - union type:

typedef union sd_id128 {
-        uint8_t bytes[16];
-        uint64_t qwords[2];
-} sd_id128_t;

This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients.

A couple of macros are defined to denote and - decode 128-bit IDs:

SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
-        puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
+  gudev systemd 219

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. +

See + sd_id128_to_string(3), + sd_id128_randomize(3) + and + sd_id128_get_machine(3) + for more information about the implemented functions.

A 128-bit ID is implemented as the following + union type:

typedef union sd_id128 {
+  uint8_t bytes[16];
+  uint64_t qwords[2];
+} sd_id128_t;

This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients.

A couple of macros are defined to denote and decode 128-bit + IDs:

SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
+  puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
 }

SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf(3) - format string, as shown in the following - example:

int main(int argc, char *argv[]) {
-        sd_id128_t id;
-        id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
-        return 0;
+    SD_ID128_FORMAT_VAL() may be used to format a
+    128-bit ID in a
+    printf(3)
+    format string, as shown in the following example:

int main(int argc, char *argv[]) {
+  sd_id128_t id;
+  id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
+  printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
+  return 0;
 }

Use sd_id128_equal() to compare two 128-bit IDs:

int main(int argc, char *argv[]) {
-        sd_id128_t a, b, c;
-        a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e);
-        c = a;
-        assert(sd_id128_equal(a, c));
-        assert(!sd_id128_equal(a, b));
-        return 0;
-}

Note that new, randomized IDs may be generated - with - journalctl(1)'s - --new-id option.

Notes¶

These APIs are implemented as a shared + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; +}

Note that new, randomized IDs may be generated with + journalctl(1)'s + --new-id option.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_INFO.html b/man/SD_INFO.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_INFO.html +++ b/man/SD_INFO.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_JOURNAL_APPEND.html b/man/SD_JOURNAL_APPEND.html index 2bec93736..a998323e0 100644 --- a/man/SD_JOURNAL_APPEND.html +++ b/man/SD_JOURNAL_APPEND.html @@ -19,200 +19,183 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification - interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns - a file descriptor that may be asynchronously polled in - an external event loop and is signaled as soon as the - journal changes, because new entries or files were - added, rotation took place, or files have been - deleted, and similar. The file descriptor is suitable - for usage in - poll(2). Use - sd_journal_get_events() for an - events mask to watch for. The call takes one argument: - the journal context object. Note that not all file - systems are capable of generating the necessary events - for wakeups from this file descriptor for changes to - be noticed immediately. In particular network files - systems do not generate suitable file change events in - all cases. Cases like this can be detected with - sd_journal_reliable_fd(), - below. sd_journal_get_timeout() - will ensure in these cases that wake-ups happen - frequently enough for changes to be noticed, although - with a certain latency.

sd_journal_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN and - POLLOUT and similar to fill into - the ".events" field of - struct pollfd.

sd_journal_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of - CLOCK_MONOTONIC for timing out - poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for, this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout - into relative 'ms', use code like the - following:

uint64_t t;
+  gudev systemd 219

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification + interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns a file + descriptor that may be asynchronously polled in an external event + loop and is signaled as soon as the journal changes, because new + entries or files were added, rotation took place, or files have + been deleted, and similar. The file descriptor is suitable for + usage in + poll(2). + Use sd_journal_get_events() for an events + mask to watch for. The call takes one argument: the journal + context object. Note that not all file systems are capable of + generating the necessary events for wakeups from this file + descriptor for changes to be noticed immediately. In particular + network files systems do not generate suitable file change events + in all cases. Cases like this can be detected with + sd_journal_reliable_fd(), below. + sd_journal_get_timeout() will ensure in these + cases that wake-ups happen frequently enough for changes to be + noticed, although with a certain latency.

sd_journal_get_events() will return the + poll() mask to wait for. This function will + return a combination of POLLIN and + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_journal_get_timeout() will return a + timeout value for usage in poll(). This + returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for, this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_journal_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

After each poll() wake-up - sd_journal_process() needs to be - called to process events. This call will also indicate - what kind of change has been detected (see below; note - that spurious wake-ups are possible).

A synchronous alternative for using - sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout() and - sd_journal_process() is - sd_journal_wait(). It will - synchronously wait until the journal gets changed. The - maximum time this call sleeps may be controlled with - the timeout_usec - parameter. Pass (uint64_t) -1 to - wait indefinitely. Internally this call simply - combines sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout(), - poll() and - sd_journal_process() into - one.

sd_journal_reliable_fd() - may be used to check whether the wakeup events from - the file descriptor returned by - sd_journal_get_fd() are known to - be immediately triggered. On certain file systems - where file change events from the OS are not available - (such as NFS) changes need to be polled for - repeatedly, and hence are detected only with a certain - latency. This call will return a positive value if the - journal changes are detected immediately and zero when - they need to be polled for and hence might be noticed - only with a certain latency. Note that there's usually - no need to invoke this function directly as - sd_journal_get_timeout() on these - file systems will ask for timeouts explicitly - anyway.

Return Value¶

sd_journal_get_fd() returns - a valid file descriptor on success or a negative - errno-style error code.

sd_journal_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike on success or - a negative errno-style error code.

sd_journal_reliable_fd() - returns a positive integer if the file descriptor - returned by sd_journal_get_fd() - will generate wake-ups immediately for all journal - changes. Returns 0 if there might be a latency - involved.

sd_journal_process() and - sd_journal_wait() return one of - SD_JOURNAL_NOP, - SD_JOURNAL_APPEND or - SD_JOURNAL_INVALIDATE on success or - a negative errno-style error code. If - SD_JOURNAL_NOP is returned, the - journal did not change since the last invocation. If - SD_JOURNAL_APPEND is returned, new - entries have been appended to the end of the - journal. If SD_JOURNAL_INVALIDATE, - journal files were added or removed (possibly due to - rotation). In the latter event, live-view UIs should - probably refresh their entire display, while in the - case of SD_JOURNAL_APPEND, it is - sufficient to simply continue reading at the previous - end of the journal.

Notes¶

The sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_reliable_fd(), - sd_journal_process() and - sd_journal_wait() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Iterating through the journal, in a live view tracking all changes:

#include <stdio.h>
+  struct timespec ts;
+  uint64_t n;
+  clock_getttime(CLOCK_MONOTONIC, &ts);
+  n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+  msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

After each poll() wake-up + sd_journal_process() needs to be called to + process events. This call will also indicate what kind of change + has been detected (see below; note that spurious wake-ups are + possible).

A synchronous alternative for using + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout() and + sd_journal_process() is + sd_journal_wait(). It will synchronously wait + until the journal gets changed. The maximum time this call sleeps + may be controlled with the timeout_usec + parameter. Pass (uint64_t) -1 to wait + indefinitely. Internally this call simply combines + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout(), + poll() and + sd_journal_process() into one.

sd_journal_reliable_fd() may be used to + check whether the wakeup events from the file descriptor returned + by sd_journal_get_fd() are known to be + immediately triggered. On certain file systems where file change + events from the OS are not available (such as NFS) changes need to + be polled for repeatedly, and hence are detected only with a + certain latency. This call will return a positive value if the + journal changes are detected immediately and zero when they need + to be polled for and hence might be noticed only with a certain + latency. Note that there's usually no need to invoke this function + directly as sd_journal_get_timeout() on these + file systems will ask for timeouts explicitly anyway.

Return Value¶

sd_journal_get_fd() returns a valid + file descriptor on success or a negative errno-style error + code.

sd_journal_get_events() returns a + combination of POLLIN, + POLLOUT and suchlike on success or a negative + errno-style error code.

sd_journal_reliable_fd() returns a + positive integer if the file descriptor returned by + sd_journal_get_fd() will generate wake-ups + immediately for all journal changes. Returns 0 if there might be a + latency involved.

sd_journal_process() and + sd_journal_wait() return one of + SD_JOURNAL_NOP, + SD_JOURNAL_APPEND or + SD_JOURNAL_INVALIDATE on success or a + negative errno-style error code. If + SD_JOURNAL_NOP is returned, the journal did + not change since the last invocation. If + SD_JOURNAL_APPEND is returned, new entries + have been appended to the end of the journal. If + SD_JOURNAL_INVALIDATE, journal files were + added or removed (possibly due to rotation). In the latter event, + live-view UIs should probably refresh their entire display, while + in the case of SD_JOURNAL_APPEND, it is + sufficient to simply continue reading at the previous end of the + journal.

Notes¶

The sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_reliable_fd(), + sd_journal_process() and + sd_journal_wait() interfaces are available as + a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

Iterating through the journal, in a live view tracking all + changes:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        int r;
-        sd_journal *j;
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        for (;;)  {
-                const void *d;
-                size_t l;
-                r = sd_journal_next(j);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
-                        break;
-                }
-                if (r == 0) {
-                        /* Reached the end, let's wait for changes, and try again */
-                        r = sd_journal_wait(j, (uint64_t) -1);
-                        if (r < 0) {
-                                fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
-                                break;
-                        }
-                        continue;
-                }
-                r = sd_journal_get_data(j, "MESSAGE", &d, &l);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
-                        continue;
-                }
-                printf("%.*s\n", (int) l, (const char*) d);
-        }
-        sd_journal_close(j);
-        return 0;
+  int r;
+  sd_journal *j;
+  r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+  if (r < 0) {
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
+    return 1;
+  }
+  for (;;)  {
+    const void *d;
+    size_t l;
+    r = sd_journal_next(j);
+    if (r < 0) {
+      fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
+      break;
+    }
+    if (r == 0) {
+      /* Reached the end, let's wait for changes, and try again */
+      r = sd_journal_wait(j, (uint64_t) -1);
+      if (r < 0) {
+        fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
+        break;
+      }
+      continue;
+    }
+    r = sd_journal_get_data(j, "MESSAGE", &d, &l);
+    if (r < 0) {
+      fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
+      continue;
+    }
+    printf("%.*s\n", (int) l, (const char*) d);
+  }
+  sd_journal_close(j);
+  return 0;
 }

Waiting with poll() (this - example lacks all error checking for the sake of - simplicity):

#include <sys/poll.h>
+    example lacks all error checking for the sake of
+    simplicity):

#include <poll.h>
 #include <systemd/sd-journal.h>
 
 int wait_for_changes(sd_journal *j) {
-        struct pollfd pollfd;
-        int msec;
+  struct pollfd pollfd;
+  int msec;
 
-        sd_journal_get_timeout(m, &t);
-        if (t == (uint64_t) -1)
-                msec = -1;
-        else {
-                struct timespec ts;
-                uint64_t n;
-                clock_getttime(CLOCK_MONOTONIC, &ts);
-                n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-                msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-        }
+  sd_journal_get_timeout(m, &t);
+  if (t == (uint64_t) -1)
+    msec = -1;
+  else {
+    struct timespec ts;
+    uint64_t n;
+    clock_getttime(CLOCK_MONOTONIC, &ts);
+    n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+    msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+  }
 
-        pollfd.fd = sd_journal_get_fd(j);
-        pollfd.events = sd_journal_get_events(j);
-        poll(&pollfd, 1, msec);
-        return sd_journal_process(j);
-}
+ pollfd.fd = sd_journal_get_fd(j); + pollfd.events = sd_journal_get_events(j); + poll(&pollfd, 1, msec); + return sd_journal_process(j); +}
diff --git a/man/SD_JOURNAL_CURRENT_USER.html b/man/SD_JOURNAL_CURRENT_USER.html index f124e223a..1cba05767 100644 --- a/man/SD_JOURNAL_CURRENT_USER.html +++ b/man/SD_JOURNAL_CURRENT_USER.html @@ -19,108 +19,94 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens - the log journal for reading. It will find all journal - files automatically and interleave them automatically - when reading. As first argument it takes a pointer to - a sd_journal pointer, which on - success will contain a journal context object. The - second argument is a flags field, which may consist of - the following flags ORed together: - SD_JOURNAL_LOCAL_ONLY makes sure - only journal files generated on the local machine will - be opened. SD_JOURNAL_RUNTIME_ONLY - makes sure only volatile journal files will be opened, - excluding those which are stored on persistent - storage. SD_JOURNAL_SYSTEM - will cause journal files of system services and the - kernel (in opposition to user session processes) to - be opened. SD_JOURNAL_CURRENT_USER - will cause journal files of the current user to be - opened. If neither SD_JOURNAL_SYSTEM - nor SD_JOURNAL_CURRENT_USER are - specified, all journal file types will be opened.

sd_journal_open_directory() - is similar to sd_journal_open() - but takes an absolute directory path as argument. All - journal files in this directory will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call.

sd_journal_open_files() - is similar to sd_journal_open() - but takes a NULL-terminated list - of file paths to open. All files will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call. Please note - that in the case of a live journal, this function is only - useful for debugging, because individual journal files - can be rotated at any moment, and the opening of - specific files is inherently racy.

sd_journal_open_container() - is similar to sd_journal_open() - but opens the journal files of a running - OS container. The specified machine name refers to a - container that is registered with - systemd-machined(8).

sd_journal objects cannot be - used in the child after a fork. Functions which take a - journal object as an argument - (sd_journal_next() and others) - will return -ECHILD after a fork. -

sd_journal_close() will - close the journal context allocated with - sd_journal_open() or - sd_journal_open_directory() and - free its resources.

When opening the journal only journal files - accessible to the calling user will be opened. If - journal files are not accessible to the caller, this - will be silently ignored.

See - sd_journal_next(3) - for an example of how to iterate through the journal - after opening it with - sd_journal_open().

A journal context object returned by - sd_journal_open() references a - specific journal entry as current entry, - similar to a file seek index in a classic file system - file, but without absolute positions. It may be - altered with - sd_journal_next(3) - and - sd_journal_seek_head(3) - and related calls. The current entry position may be - exported in cursor strings, as accessible - via - sd_journal_get_cursor(3). Cursor - strings may be used to globally identify a specific - journal entry in a stable way and then later to seek - to it (or if the specific entry is not available - locally, to its closest entry in time) - sd_journal_seek_cursor(3).

Notification of journal changes is available via - sd_journal_get_fd() and related - calls.

Return Value¶

The sd_journal_open(), - sd_journal_open_directory(), and - sd_journal_open_files() calls - return 0 on success or a negative errno-style error - code. sd_journal_close() returns - nothing.

Notes¶

The sd_journal_open(), - sd_journal_open_directory() and - sd_journal_close() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

History¶

sd_journal_open(), - sd_journal_close(), - SD_JOURNAL_LOCAL_ONLY, - SD_JOURNAL_RUNTIME_ONLY, - SD_JOURNAL_SYSTEM_ONLY were added - in systemd-38.

sd_journal_open_directory() - was added in systemd-187.

SD_JOURNAL_SYSTEM, - SD_JOURNAL_CURRENT_USER, - and sd_journal_open_files() - were added in systemd-205. - SD_JOURNAL_SYSTEM_ONLY - was deprecated.

+ gudev systemd 219

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens the log journal + for reading. It will find all journal files automatically and + interleave them automatically when reading. As first argument it + takes a pointer to a sd_journal pointer, which + on success will contain a journal context object. The second + argument is a flags field, which may consist of the following + flags ORed together: SD_JOURNAL_LOCAL_ONLY + makes sure only journal files generated on the local machine will + be opened. SD_JOURNAL_RUNTIME_ONLY makes sure + only volatile journal files will be opened, excluding those which + are stored on persistent storage. + SD_JOURNAL_SYSTEM will cause journal files of + system services and the kernel (in opposition to user session + processes) to be opened. + SD_JOURNAL_CURRENT_USER will cause journal + files of the current user to be opened. If neither + SD_JOURNAL_SYSTEM nor + SD_JOURNAL_CURRENT_USER are specified, all + journal file types will be opened.

sd_journal_open_directory() is similar + to sd_journal_open() but takes an absolute + directory path as argument. All journal files in this directory + will be opened and interleaved automatically. This call also takes + a flags argument, but it must be passed as 0 as no flags are + currently understood for this call.

sd_journal_open_files() is similar to + sd_journal_open() but takes a + NULL-terminated list of file paths to open. + All files will be opened and interleaved automatically. This call + also takes a flags argument, but it must be passed as 0 as no + flags are currently understood for this call. Please note that in + the case of a live journal, this function is only useful for + debugging, because individual journal files can be rotated at any + moment, and the opening of specific files is inherently + racy.

sd_journal_open_container() is similar + to sd_journal_open() but opens the journal + files of a running OS container. The specified machine name refers + to a container that is registered with + systemd-machined(8).

sd_journal objects cannot be used in the + child after a fork. Functions which take a journal object as an + argument (sd_journal_next() and others) will + return -ECHILD after a fork. +

sd_journal_close() will close the + journal context allocated with + sd_journal_open() or + sd_journal_open_directory() and free its + resources.

When opening the journal only journal files accessible to + the calling user will be opened. If journal files are not + accessible to the caller, this will be silently ignored.

See + sd_journal_next(3) + for an example of how to iterate through the journal after opening + it with sd_journal_open().

A journal context object returned by + sd_journal_open() references a specific + journal entry as current entry, similar to a + file seek index in a classic file system file, but without + absolute positions. It may be altered with + sd_journal_next(3) + and + sd_journal_seek_head(3) + and related calls. The current entry position may be exported in + cursor strings, as accessible via + sd_journal_get_cursor(3). + Cursor strings may be used to globally identify a specific journal + entry in a stable way and then later to seek to it (or if the + specific entry is not available locally, to its closest entry in + time) + sd_journal_seek_cursor(3).

Notification of journal changes is available via + sd_journal_get_fd() and related calls.

Return Value¶

The sd_journal_open(), + sd_journal_open_directory(), and + sd_journal_open_files() calls return 0 on + success or a negative errno-style error code. + sd_journal_close() returns nothing.

Notes¶

The sd_journal_open(), + sd_journal_open_directory() and + sd_journal_close() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

History¶

sd_journal_open(), + sd_journal_close(), + SD_JOURNAL_LOCAL_ONLY, + SD_JOURNAL_RUNTIME_ONLY, + SD_JOURNAL_SYSTEM_ONLY were added in + systemd-38.

sd_journal_open_directory() was added + in systemd-187.

SD_JOURNAL_SYSTEM, + SD_JOURNAL_CURRENT_USER, and + sd_journal_open_files() were added in + systemd-205. SD_JOURNAL_SYSTEM_ONLY was + deprecated.

diff --git a/man/SD_JOURNAL_FOREACH.html b/man/SD_JOURNAL_FOREACH.html index 84937125e..ba027b087 100644 --- a/man/SD_JOURNAL_FOREACH.html +++ b/man/SD_JOURNAL_FOREACH.html @@ -19,81 +19,75 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_next, sd_journal_previous, sd_journal_next_skip, sd_journal_previous_skip, SD_JOURNAL_FOREACH, SD_JOURNAL_FOREACH_BACKWARDS — Advance or set back the read pointer in the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_next(sd_journal *j);
 
int sd_journal_previous(sd_journal *j);
 
int sd_journal_next_skip(sd_journal *j,
 uint64_t skip);
 
int sd_journal_previous_skip(sd_journal *j,
 uint64_t skip);
 
SD_JOURNAL_FOREACH(sd_journal *j);
 
SD_JOURNAL_FOREACH_BACKWARDS(sd_journal *j);
 

Description¶

sd_journal_next() advances - the read pointer into the journal by one entry. The - only argument taken is a journal context object as - allocated via - sd_journal_open(3). After - successful invocation the entry may be read with - functions such as - sd_journal_get_data(3).

Similarly, sd_journal_previous() sets - the read pointer back one entry.

sd_journal_next_skip() and - sd_journal_previous_skip() - advance/set back the read pointer by multiple entries - at once, as specified in the skip - parameter.

The journal is strictly ordered by reception - time, and hence advancing to the next entry guarantees - that the entry then pointing to is later in time than - then previous one, or has the same timestamp.

Note that - sd_journal_get_data(3) - and related calls will fail unless - sd_journal_next() has been - invoked at least once in order to position the read - pointer on a journal entry.

Note that the - SD_JOURNAL_FOREACH() macro may be used - as a wrapper around - sd_journal_seek_head(3) - and sd_journal_next() in order to - make iterating through the journal easier. See below - for an example. Similarly, - SD_JOURNAL_FOREACH_BACKWARDS() - may be used for iterating the journal in reverse - order.

Return Value¶

The four calls return the number of entries - advanced/set back on success or a negative errno-style - error code. When the end or beginning of the journal - is reached, a number smaller than requested is - returned. More specifically, if - sd_journal_next() or - sd_journal_previous() reach the - end/beginning of the journal they will return 0, - instead of 1 when they are successful. This should be - considered an EOF marker.

Notes¶

The sd_journal_next(), sd_journal_previous(), - sd_journal_next_skip() and - sd_journal_previous_skip() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Iterating through the journal:

#include <stdio.h>
+  gudev systemd 219

Name

sd_journal_next, sd_journal_previous, sd_journal_next_skip, sd_journal_previous_skip, SD_JOURNAL_FOREACH, SD_JOURNAL_FOREACH_BACKWARDS — Advance or set back the read pointer in the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_next(sd_journal *j);
 
int sd_journal_previous(sd_journal *j);
 
int sd_journal_next_skip(sd_journal *j,
 uint64_t skip);
 
int sd_journal_previous_skip(sd_journal *j,
 uint64_t skip);
 
SD_JOURNAL_FOREACH(sd_journal *j);
 
SD_JOURNAL_FOREACH_BACKWARDS(sd_journal *j);
 

Description¶

sd_journal_next() advances the read + pointer into the journal by one entry. The only argument taken is + a journal context object as allocated via + sd_journal_open(3). + After successful invocation the entry may be read with functions + such as + sd_journal_get_data(3).

Similarly, sd_journal_previous() sets + the read pointer back one entry.

sd_journal_next_skip() and + sd_journal_previous_skip() advance/set back + the read pointer by multiple entries at once, as specified in the + skip parameter.

The journal is strictly ordered by reception time, and hence + advancing to the next entry guarantees that the entry then + pointing to is later in time than then previous one, or has the + same timestamp.

Note that + sd_journal_get_data(3) + and related calls will fail unless + sd_journal_next() has been invoked at least + once in order to position the read pointer on a journal + entry.

Note that the SD_JOURNAL_FOREACH() + macro may be used as a wrapper around + sd_journal_seek_head(3) + and sd_journal_next() in order to make + iterating through the journal easier. See below for an example. + Similarly, SD_JOURNAL_FOREACH_BACKWARDS() may + be used for iterating the journal in reverse order.

Return Value¶

The four calls return the number of entries advanced/set + back on success or a negative errno-style error code. When the end + or beginning of the journal is reached, a number smaller than + requested is returned. More specifically, if + sd_journal_next() or + sd_journal_previous() reach the end/beginning + of the journal they will return 0, instead of 1 when they are + successful. This should be considered an EOF marker.

Notes¶

The sd_journal_next(), + sd_journal_previous(), + sd_journal_next_skip() and + sd_journal_previous_skip() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

Examples¶

Iterating through the journal:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        int r;
-        sd_journal *j;
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        SD_JOURNAL_FOREACH(j) {
-                const char *d;
-                size_t l;
+  int r;
+  sd_journal *j;
+  r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+  if (r < 0) {
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
+    return 1;
+  }
+  SD_JOURNAL_FOREACH(j) {
+    const char *d;
+    size_t l;
 
-                r = sd_journal_get_data(j, "MESSAGE", (const void **)&d, &l);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
-                        continue;
-                }
+    r = sd_journal_get_data(j, "MESSAGE", (const void **)&d, &l);
+    if (r < 0) {
+      fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
+      continue;
+    }
 
-                printf("%.*s\n", (int) l, d);
-        }
-        sd_journal_close(j);
-        return 0;
-}
+ printf("%.*s\n", (int) l, d); + } + sd_journal_close(j); + return 0; +}
diff --git a/man/SD_JOURNAL_FOREACH_BACKWARDS.html b/man/SD_JOURNAL_FOREACH_BACKWARDS.html index 84937125e..ba027b087 100644 --- a/man/SD_JOURNAL_FOREACH_BACKWARDS.html +++ b/man/SD_JOURNAL_FOREACH_BACKWARDS.html @@ -19,81 +19,75 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_next, sd_journal_previous, sd_journal_next_skip, sd_journal_previous_skip, SD_JOURNAL_FOREACH, SD_JOURNAL_FOREACH_BACKWARDS — Advance or set back the read pointer in the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_next(sd_journal *j);
 
int sd_journal_previous(sd_journal *j);
 
int sd_journal_next_skip(sd_journal *j,
 uint64_t skip);
 
int sd_journal_previous_skip(sd_journal *j,
 uint64_t skip);
 
SD_JOURNAL_FOREACH(sd_journal *j);
 
SD_JOURNAL_FOREACH_BACKWARDS(sd_journal *j);
 

Description¶

sd_journal_next() advances - the read pointer into the journal by one entry. The - only argument taken is a journal context object as - allocated via - sd_journal_open(3). After - successful invocation the entry may be read with - functions such as - sd_journal_get_data(3).

Similarly, sd_journal_previous() sets - the read pointer back one entry.

sd_journal_next_skip() and - sd_journal_previous_skip() - advance/set back the read pointer by multiple entries - at once, as specified in the skip - parameter.

The journal is strictly ordered by reception - time, and hence advancing to the next entry guarantees - that the entry then pointing to is later in time than - then previous one, or has the same timestamp.

Note that - sd_journal_get_data(3) - and related calls will fail unless - sd_journal_next() has been - invoked at least once in order to position the read - pointer on a journal entry.

Note that the - SD_JOURNAL_FOREACH() macro may be used - as a wrapper around - sd_journal_seek_head(3) - and sd_journal_next() in order to - make iterating through the journal easier. See below - for an example. Similarly, - SD_JOURNAL_FOREACH_BACKWARDS() - may be used for iterating the journal in reverse - order.

Return Value¶

The four calls return the number of entries - advanced/set back on success or a negative errno-style - error code. When the end or beginning of the journal - is reached, a number smaller than requested is - returned. More specifically, if - sd_journal_next() or - sd_journal_previous() reach the - end/beginning of the journal they will return 0, - instead of 1 when they are successful. This should be - considered an EOF marker.

Notes¶

The sd_journal_next(), sd_journal_previous(), - sd_journal_next_skip() and - sd_journal_previous_skip() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Iterating through the journal:

#include <stdio.h>
+  gudev systemd 219

Name

sd_journal_next, sd_journal_previous, sd_journal_next_skip, sd_journal_previous_skip, SD_JOURNAL_FOREACH, SD_JOURNAL_FOREACH_BACKWARDS — Advance or set back the read pointer in the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_next(sd_journal *j);
 
int sd_journal_previous(sd_journal *j);
 
int sd_journal_next_skip(sd_journal *j,
 uint64_t skip);
 
int sd_journal_previous_skip(sd_journal *j,
 uint64_t skip);
 
SD_JOURNAL_FOREACH(sd_journal *j);
 
SD_JOURNAL_FOREACH_BACKWARDS(sd_journal *j);
 

Description¶

sd_journal_next() advances the read + pointer into the journal by one entry. The only argument taken is + a journal context object as allocated via + sd_journal_open(3). + After successful invocation the entry may be read with functions + such as + sd_journal_get_data(3).

Similarly, sd_journal_previous() sets + the read pointer back one entry.

sd_journal_next_skip() and + sd_journal_previous_skip() advance/set back + the read pointer by multiple entries at once, as specified in the + skip parameter.

The journal is strictly ordered by reception time, and hence + advancing to the next entry guarantees that the entry then + pointing to is later in time than then previous one, or has the + same timestamp.

Note that + sd_journal_get_data(3) + and related calls will fail unless + sd_journal_next() has been invoked at least + once in order to position the read pointer on a journal + entry.

Note that the SD_JOURNAL_FOREACH() + macro may be used as a wrapper around + sd_journal_seek_head(3) + and sd_journal_next() in order to make + iterating through the journal easier. See below for an example. + Similarly, SD_JOURNAL_FOREACH_BACKWARDS() may + be used for iterating the journal in reverse order.

Return Value¶

The four calls return the number of entries advanced/set + back on success or a negative errno-style error code. When the end + or beginning of the journal is reached, a number smaller than + requested is returned. More specifically, if + sd_journal_next() or + sd_journal_previous() reach the end/beginning + of the journal they will return 0, instead of 1 when they are + successful. This should be considered an EOF marker.

Notes¶

The sd_journal_next(), + sd_journal_previous(), + sd_journal_next_skip() and + sd_journal_previous_skip() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

Examples¶

Iterating through the journal:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        int r;
-        sd_journal *j;
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        SD_JOURNAL_FOREACH(j) {
-                const char *d;
-                size_t l;
+  int r;
+  sd_journal *j;
+  r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+  if (r < 0) {
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
+    return 1;
+  }
+  SD_JOURNAL_FOREACH(j) {
+    const char *d;
+    size_t l;
 
-                r = sd_journal_get_data(j, "MESSAGE", (const void **)&d, &l);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
-                        continue;
-                }
+    r = sd_journal_get_data(j, "MESSAGE", (const void **)&d, &l);
+    if (r < 0) {
+      fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
+      continue;
+    }
 
-                printf("%.*s\n", (int) l, d);
-        }
-        sd_journal_close(j);
-        return 0;
-}
+ printf("%.*s\n", (int) l, d); + } + sd_journal_close(j); + return 0; +}
diff --git a/man/SD_JOURNAL_FOREACH_DATA.html b/man/SD_JOURNAL_FOREACH_DATA.html index 0eb93c07e..c8e044e6f 100644 --- a/man/SD_JOURNAL_FOREACH_DATA.html +++ b/man/SD_JOURNAL_FOREACH_DATA.html @@ -19,107 +19,92 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_get_data, sd_journal_enumerate_data, sd_journal_restart_data, SD_JOURNAL_FOREACH_DATA, sd_journal_set_data_threshold, sd_journal_get_data_threshold — Read data fields from the current journal entry

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_data(sd_journal *j,
 const char *field,
 const void **data,
 size_t *length);
 
int sd_journal_enumerate_data(sd_journal *j,
 const void **data,
 size_t *length);
 
void sd_journal_restart_data(sd_journal *j);
 
SD_JOURNAL_FOREACH_DATA(sd_journal *j,
 const void *data,
 size_t length);
 
int sd_journal_set_data_threshold(sd_journal *j,
 size_t sz);
 
int sd_journal_get_data_threshold(sd_journal *j,
 size_t *sz);
 

Description¶

sd_journal_get_data() gets - the data object associated with a specific field from - the current journal entry. It takes four arguments: - the journal context object, a string with the field - name to request, plus a pair of pointers to - pointer/size variables where the data object and its - size shall be stored in. The field name should be an - entry field name. Well-known field names are listed in - systemd.journal-fields(7). The - returned data is in a read-only memory map and is only - valid until the next invocation of - sd_journal_get_data() or - sd_journal_enumerate_data(), or - the read pointer is altered. Note that the data - returned will be prefixed with the field name and - '='. Also note that by default data fields larger than - 64K might get truncated to 64K. This threshold may be - changed and turned off with - sd_journal_set_data_threshold() (see - below).

sd_journal_enumerate_data() - may be used to iterate through all fields of the - current entry. On each invocation the data for the - next field is returned. The order of these fields is - not defined. The data returned is in the same format - as with sd_journal_get_data() and - also follows the same life-time semantics.

sd_journal_restart_data() - resets the data enumeration index to the beginning of - the entry. The next invocation of - sd_journal_enumerate_data() will return the first - field of the entry again.

Note that the - SD_JOURNAL_FOREACH_DATA() macro - may be used as a handy wrapper around - sd_journal_restart_data() and - sd_journal_enumerate_data().

Note that these functions will not work before - sd_journal_next(3) - (or related call) has been called at least - once, in order to position the read pointer at a valid entry.

sd_journal_set_data_threshold() - may be used to change the data field size threshold - for data returned by - sd_journal_get_data(), - sd_journal_enumerate_data() and - sd_journal_enumerate_unique(). This - threshold is a hint only: it indicates that the client - program is interested only in the initial parts of the - data fields, up to the threshold in size -- but the - library might still return larger data objects. That - means applications should not rely exclusively on this - setting to limit the size of the data fields returned, - but need to apply a explicit size limit on the - returned data as well. This threshold defaults to 64K - by default. To retrieve the complete data fields this - threshold should be turned off by setting it to 0, so - that the library always returns the complete data - objects. It is recommended to set this threshold as - low as possible since this relieves the library from - having to decompress large compressed data objects in - full.

sd_journal_get_data_threshold() - returns the currently configured data field size - threshold.

Return Value¶

sd_journal_get_data() - returns 0 on success or a negative errno-style error - code. If the current entry does not include the - specified field, -ENOENT is returned. If - sd_journal_next(3) - has not been called at least once, -EADDRNOTAVAIL is - returned. sd_journal_enumerate_data() - returns a positive integer if the next field has been - read, 0 when no more fields are known, or a negative - errno-style error - code. sd_journal_restart_data() - returns - nothing. sd_journal_set_data_threshold() - and sd_journal_get_threshold() - return 0 on success or a negative errno-style error - code.

Notes¶

The sd_journal_get_data(), - sd_journal_enumerate_data(), - sd_journal_restart_data(), - sd_journal_set_data_threshold() - and - sd_journal_get_data_threshold() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

Examples¶

See - sd_journal_next(3) - for a complete example how to use - sd_journal_get_data().

Use the - SD_JOURNAL_FOREACH_DATA macro to - iterate through all fields of the current journal - entry:

...
+  gudev systemd 219

Name

sd_journal_get_data, sd_journal_enumerate_data, sd_journal_restart_data, SD_JOURNAL_FOREACH_DATA, sd_journal_set_data_threshold, sd_journal_get_data_threshold — Read data fields from the current journal entry

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_data(sd_journal *j,
 const char *field,
 const void **data,
 size_t *length);
 
int sd_journal_enumerate_data(sd_journal *j,
 const void **data,
 size_t *length);
 
void sd_journal_restart_data(sd_journal *j);
 
SD_JOURNAL_FOREACH_DATA(sd_journal *j,
 const void *data,
 size_t length);
 
int sd_journal_set_data_threshold(sd_journal *j,
 size_t sz);
 
int sd_journal_get_data_threshold(sd_journal *j,
 size_t *sz);
 

Description¶

sd_journal_get_data() gets the data + object associated with a specific field from the current journal + entry. It takes four arguments: the journal context object, a + string with the field name to request, plus a pair of pointers to + pointer/size variables where the data object and its size shall be + stored in. The field name should be an entry field name. + Well-known field names are listed in + systemd.journal-fields(7). + The returned data is in a read-only memory map and is only valid + until the next invocation of + sd_journal_get_data() or + sd_journal_enumerate_data(), or the read + pointer is altered. Note that the data returned will be prefixed + with the field name and '='. Also note that by default data fields + larger than 64K might get truncated to 64K. This threshold may be + changed and turned off with + sd_journal_set_data_threshold() (see + below).

sd_journal_enumerate_data() may be used + to iterate through all fields of the current entry. On each + invocation the data for the next field is returned. The order of + these fields is not defined. The data returned is in the same + format as with sd_journal_get_data() and also + follows the same life-time semantics.

sd_journal_restart_data() resets the + data enumeration index to the beginning of the entry. The next + invocation of sd_journal_enumerate_data() + will return the first field of the entry again.

Note that the SD_JOURNAL_FOREACH_DATA() + macro may be used as a handy wrapper around + sd_journal_restart_data() and + sd_journal_enumerate_data().

Note that these functions will not work before + sd_journal_next(3) + (or related call) has been called at least once, in order to + position the read pointer at a valid entry.

sd_journal_set_data_threshold() may be + used to change the data field size threshold for data returned by + sd_journal_get_data(), + sd_journal_enumerate_data() and + sd_journal_enumerate_unique(). This threshold + is a hint only: it indicates that the client program is interested + only in the initial parts of the data fields, up to the threshold + in size -- but the library might still return larger data objects. + That means applications should not rely exclusively on this + setting to limit the size of the data fields returned, but need to + apply a explicit size limit on the returned data as well. This + threshold defaults to 64K by default. To retrieve the complete + data fields this threshold should be turned off by setting it to + 0, so that the library always returns the complete data objects. + It is recommended to set this threshold as low as possible since + this relieves the library from having to decompress large + compressed data objects in full.

sd_journal_get_data_threshold() returns + the currently configured data field size threshold.

Return Value¶

sd_journal_get_data() returns 0 on + success or a negative errno-style error code. If the current entry + does not include the specified field, -ENOENT is returned. If + sd_journal_next(3) + has not been called at least once, -EADDRNOTAVAIL is returned. + sd_journal_enumerate_data() returns a + positive integer if the next field has been read, 0 when no more + fields are known, or a negative errno-style error code. + sd_journal_restart_data() returns nothing. + sd_journal_set_data_threshold() and + sd_journal_get_threshold() return 0 on + success or a negative errno-style error code.

Notes¶

The sd_journal_get_data(), + sd_journal_enumerate_data(), + sd_journal_restart_data(), + sd_journal_set_data_threshold() and + sd_journal_get_data_threshold() interfaces + are available as a shared library, which can be compiled and + linked to with the + libsystemd pkg-config(1) + file.

Examples¶

See + sd_journal_next(3) + for a complete example how to use + sd_journal_get_data().

Use the + SD_JOURNAL_FOREACH_DATA macro to + iterate through all fields of the current journal + entry:

...
 int print_fields(sd_journal *j) {
-        const void *data;
-        size_t length;
-        SD_JOURNAL_FOREACH_DATA(j, data, length)
-                printf("%.*s\n", (int) length, data);
+  const void *data;
+  size_t length;
+  SD_JOURNAL_FOREACH_DATA(j, data, length)
+    printf("%.*s\n", (int) length, data);
 }
-...
+...
diff --git a/man/SD_JOURNAL_FOREACH_UNIQUE.html b/man/SD_JOURNAL_FOREACH_UNIQUE.html index e4d9c109d..109753d9e 100644 --- a/man/SD_JOURNAL_FOREACH_UNIQUE.html +++ b/man/SD_JOURNAL_FOREACH_UNIQUE.html @@ -19,93 +19,84 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_query_unique, sd_journal_enumerate_unique, sd_journal_restart_unique, SD_JOURNAL_FOREACH_UNIQUE — Read unique data fields from the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_query_unique(sd_journal *j,
 const char *field);
 
int sd_journal_enumerate_unique(sd_journal *j,
 const void **data,
 size_t *length);
 
void sd_journal_restart_unique(sd_journal *j);
 
SD_JOURNAL_FOREACH_UNIQUE(sd_journal *j,
 const void *data,
 size_t length);
 

Description¶

sd_journal_query_unique() - queries the journal for all unique values the - specified field can take. It takes two arguments: the - journal to query and the field name to look - for. Well-known field names are listed on - systemd.journal-fields(7). Field - names must be specified without a trailing '='. After - this function has been executed successfully the field - values may be queried using - sd_journal_enumerate_unique(). Invoking - this call a second time will change the field name - being queried and reset the enumeration index to the - first field value that matches.

sd_journal_enumerate_unique() - may be used to iterate through all data fields which - match the previously selected field name as set with - sd_journal_query_unique(). On - each invocation the next field data matching the field - name is returned. The order of the returned data - fields is not defined. It takes three arguments: the - journal context object, plus a pair of pointers to - pointer/size variables where the data object and its - size shall be stored in. The returned data is in a - read-only memory map and is only valid until the next - invocation of - sd_journal_enumerate_unique(). Note - that the data returned will be prefixed with the field - name and '='. Note that this call is subject to the - data field size threshold as controlled by - sd_journal_set_data_threshold().

sd_journal_restart_unique() - resets the data enumeration index to the beginning of - the list. The next invocation of - sd_journal_enumerate_unique() - will return the first field data matching the field - name again.

Note that the - SD_JOURNAL_FOREACH_UNIQUE() macro - may be used as a handy wrapper around - sd_journal_restart_unique() and - sd_journal_enumerate_unique().

Note that these functions currently are not - influenced by matches set with - sd_journal_add_match() but this - might change in a later version of this - software.

Return Value¶

sd_journal_query_unique() - returns 0 on success or a negative errno-style error - code. sd_journal_enumerate_unique() - returns a positive integer if the next field data has - been read, 0 when no more fields are known, or a - negative errno-style error - code. sd_journal_restart_unique() - returns nothing.

Notes¶

The sd_journal_query_unique(), - sd_journal_enumerate_unique() and - sd_journal_restart_unique() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Use the - SD_JOURNAL_FOREACH_UNIQUE macro - to iterate through all values a field of the journal - can take. The following example lists all unit names - referenced in the journal:

#include <stdio.h>
+  gudev systemd 219

Name

sd_journal_query_unique, sd_journal_enumerate_unique, sd_journal_restart_unique, SD_JOURNAL_FOREACH_UNIQUE — Read unique data fields from the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_query_unique(sd_journal *j,
 const char *field);
 
int sd_journal_enumerate_unique(sd_journal *j,
 const void **data,
 size_t *length);
 
void sd_journal_restart_unique(sd_journal *j);
 
SD_JOURNAL_FOREACH_UNIQUE(sd_journal *j,
 const void *data,
 size_t length);
 

Description¶

sd_journal_query_unique() queries the + journal for all unique values the specified field can take. It + takes two arguments: the journal to query and the field name to + look for. Well-known field names are listed on + systemd.journal-fields(7). + Field names must be specified without a trailing '='. After this + function has been executed successfully the field values may be + queried using sd_journal_enumerate_unique(). + Invoking this call a second time will change the field name being + queried and reset the enumeration index to the first field value + that matches.

sd_journal_enumerate_unique() may be + used to iterate through all data fields which match the previously + selected field name as set with + sd_journal_query_unique(). On each invocation + the next field data matching the field name is returned. The order + of the returned data fields is not defined. It takes three + arguments: the journal context object, plus a pair of pointers to + pointer/size variables where the data object and its size shall be + stored in. The returned data is in a read-only memory map and is + only valid until the next invocation of + sd_journal_enumerate_unique(). Note that the + data returned will be prefixed with the field name and '='. Note + that this call is subject to the data field size threshold as + controlled by + sd_journal_set_data_threshold().

sd_journal_restart_unique() resets the + data enumeration index to the beginning of the list. The next + invocation of sd_journal_enumerate_unique() + will return the first field data matching the field name + again.

Note that the + SD_JOURNAL_FOREACH_UNIQUE() macro may be used + as a handy wrapper around + sd_journal_restart_unique() and + sd_journal_enumerate_unique().

Note that these functions currently are not influenced by + matches set with sd_journal_add_match() but + this might change in a later version of this software.

Return Value¶

sd_journal_query_unique() returns 0 on + success or a negative errno-style error code. + sd_journal_enumerate_unique() returns a + positive integer if the next field data has been read, 0 when no + more fields are known, or a negative errno-style error code. + sd_journal_restart_unique() returns + nothing.

Notes¶

The sd_journal_query_unique(), + sd_journal_enumerate_unique() and + sd_journal_restart_unique() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

Examples¶

Use the SD_JOURNAL_FOREACH_UNIQUE macro + to iterate through all values a field of the journal can take. The + following example lists all unit names referenced in the + journal:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        sd_journal *j;
-        const void *d;
-        size_t l;
-        int r;
+  sd_journal *j;
+  const void *d;
+  size_t l;
+  int r;
 
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        r = sd_journal_query_unique(j, "_SYSTEMD_UNIT");
-        if (r < 0) {
-                fprintf(stderr, "Failed to query journal: %s\n", strerror(-r));
-                return 1;
-        }
-        SD_JOURNAL_FOREACH_UNIQUE(j, d, l)
-                printf("%.*s\n", (int) l, (const char*) d);
-        sd_journal_close(j);
-        return 0;
-}
+ r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); + if (r < 0) { + fprintf(stderr, "Failed to open journal: %s\n", strerror(-r)); + return 1; + } + r = sd_journal_query_unique(j, "_SYSTEMD_UNIT"); + if (r < 0) { + fprintf(stderr, "Failed to query journal: %s\n", strerror(-r)); + return 1; + } + SD_JOURNAL_FOREACH_UNIQUE(j, d, l) + printf("%.*s\n", (int) l, (const char*) d); + sd_journal_close(j); + return 0; +}
diff --git a/man/SD_JOURNAL_INVALIDATE.html b/man/SD_JOURNAL_INVALIDATE.html index 2bec93736..a998323e0 100644 --- a/man/SD_JOURNAL_INVALIDATE.html +++ b/man/SD_JOURNAL_INVALIDATE.html @@ -19,200 +19,183 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification - interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns - a file descriptor that may be asynchronously polled in - an external event loop and is signaled as soon as the - journal changes, because new entries or files were - added, rotation took place, or files have been - deleted, and similar. The file descriptor is suitable - for usage in - poll(2). Use - sd_journal_get_events() for an - events mask to watch for. The call takes one argument: - the journal context object. Note that not all file - systems are capable of generating the necessary events - for wakeups from this file descriptor for changes to - be noticed immediately. In particular network files - systems do not generate suitable file change events in - all cases. Cases like this can be detected with - sd_journal_reliable_fd(), - below. sd_journal_get_timeout() - will ensure in these cases that wake-ups happen - frequently enough for changes to be noticed, although - with a certain latency.

sd_journal_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN and - POLLOUT and similar to fill into - the ".events" field of - struct pollfd.

sd_journal_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of - CLOCK_MONOTONIC for timing out - poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for, this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout - into relative 'ms', use code like the - following:

uint64_t t;
+  gudev systemd 219

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification + interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns a file + descriptor that may be asynchronously polled in an external event + loop and is signaled as soon as the journal changes, because new + entries or files were added, rotation took place, or files have + been deleted, and similar. The file descriptor is suitable for + usage in + poll(2). + Use sd_journal_get_events() for an events + mask to watch for. The call takes one argument: the journal + context object. Note that not all file systems are capable of + generating the necessary events for wakeups from this file + descriptor for changes to be noticed immediately. In particular + network files systems do not generate suitable file change events + in all cases. Cases like this can be detected with + sd_journal_reliable_fd(), below. + sd_journal_get_timeout() will ensure in these + cases that wake-ups happen frequently enough for changes to be + noticed, although with a certain latency.

sd_journal_get_events() will return the + poll() mask to wait for. This function will + return a combination of POLLIN and + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_journal_get_timeout() will return a + timeout value for usage in poll(). This + returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for, this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_journal_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

After each poll() wake-up - sd_journal_process() needs to be - called to process events. This call will also indicate - what kind of change has been detected (see below; note - that spurious wake-ups are possible).

A synchronous alternative for using - sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout() and - sd_journal_process() is - sd_journal_wait(). It will - synchronously wait until the journal gets changed. The - maximum time this call sleeps may be controlled with - the timeout_usec - parameter. Pass (uint64_t) -1 to - wait indefinitely. Internally this call simply - combines sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout(), - poll() and - sd_journal_process() into - one.

sd_journal_reliable_fd() - may be used to check whether the wakeup events from - the file descriptor returned by - sd_journal_get_fd() are known to - be immediately triggered. On certain file systems - where file change events from the OS are not available - (such as NFS) changes need to be polled for - repeatedly, and hence are detected only with a certain - latency. This call will return a positive value if the - journal changes are detected immediately and zero when - they need to be polled for and hence might be noticed - only with a certain latency. Note that there's usually - no need to invoke this function directly as - sd_journal_get_timeout() on these - file systems will ask for timeouts explicitly - anyway.

Return Value¶

sd_journal_get_fd() returns - a valid file descriptor on success or a negative - errno-style error code.

sd_journal_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike on success or - a negative errno-style error code.

sd_journal_reliable_fd() - returns a positive integer if the file descriptor - returned by sd_journal_get_fd() - will generate wake-ups immediately for all journal - changes. Returns 0 if there might be a latency - involved.

sd_journal_process() and - sd_journal_wait() return one of - SD_JOURNAL_NOP, - SD_JOURNAL_APPEND or - SD_JOURNAL_INVALIDATE on success or - a negative errno-style error code. If - SD_JOURNAL_NOP is returned, the - journal did not change since the last invocation. If - SD_JOURNAL_APPEND is returned, new - entries have been appended to the end of the - journal. If SD_JOURNAL_INVALIDATE, - journal files were added or removed (possibly due to - rotation). In the latter event, live-view UIs should - probably refresh their entire display, while in the - case of SD_JOURNAL_APPEND, it is - sufficient to simply continue reading at the previous - end of the journal.

Notes¶

The sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_reliable_fd(), - sd_journal_process() and - sd_journal_wait() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Iterating through the journal, in a live view tracking all changes:

#include <stdio.h>
+  struct timespec ts;
+  uint64_t n;
+  clock_getttime(CLOCK_MONOTONIC, &ts);
+  n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+  msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

After each poll() wake-up + sd_journal_process() needs to be called to + process events. This call will also indicate what kind of change + has been detected (see below; note that spurious wake-ups are + possible).

A synchronous alternative for using + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout() and + sd_journal_process() is + sd_journal_wait(). It will synchronously wait + until the journal gets changed. The maximum time this call sleeps + may be controlled with the timeout_usec + parameter. Pass (uint64_t) -1 to wait + indefinitely. Internally this call simply combines + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout(), + poll() and + sd_journal_process() into one.

sd_journal_reliable_fd() may be used to + check whether the wakeup events from the file descriptor returned + by sd_journal_get_fd() are known to be + immediately triggered. On certain file systems where file change + events from the OS are not available (such as NFS) changes need to + be polled for repeatedly, and hence are detected only with a + certain latency. This call will return a positive value if the + journal changes are detected immediately and zero when they need + to be polled for and hence might be noticed only with a certain + latency. Note that there's usually no need to invoke this function + directly as sd_journal_get_timeout() on these + file systems will ask for timeouts explicitly anyway.

Return Value¶

sd_journal_get_fd() returns a valid + file descriptor on success or a negative errno-style error + code.

sd_journal_get_events() returns a + combination of POLLIN, + POLLOUT and suchlike on success or a negative + errno-style error code.

sd_journal_reliable_fd() returns a + positive integer if the file descriptor returned by + sd_journal_get_fd() will generate wake-ups + immediately for all journal changes. Returns 0 if there might be a + latency involved.

sd_journal_process() and + sd_journal_wait() return one of + SD_JOURNAL_NOP, + SD_JOURNAL_APPEND or + SD_JOURNAL_INVALIDATE on success or a + negative errno-style error code. If + SD_JOURNAL_NOP is returned, the journal did + not change since the last invocation. If + SD_JOURNAL_APPEND is returned, new entries + have been appended to the end of the journal. If + SD_JOURNAL_INVALIDATE, journal files were + added or removed (possibly due to rotation). In the latter event, + live-view UIs should probably refresh their entire display, while + in the case of SD_JOURNAL_APPEND, it is + sufficient to simply continue reading at the previous end of the + journal.

Notes¶

The sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_reliable_fd(), + sd_journal_process() and + sd_journal_wait() interfaces are available as + a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

Iterating through the journal, in a live view tracking all + changes:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        int r;
-        sd_journal *j;
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        for (;;)  {
-                const void *d;
-                size_t l;
-                r = sd_journal_next(j);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
-                        break;
-                }
-                if (r == 0) {
-                        /* Reached the end, let's wait for changes, and try again */
-                        r = sd_journal_wait(j, (uint64_t) -1);
-                        if (r < 0) {
-                                fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
-                                break;
-                        }
-                        continue;
-                }
-                r = sd_journal_get_data(j, "MESSAGE", &d, &l);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
-                        continue;
-                }
-                printf("%.*s\n", (int) l, (const char*) d);
-        }
-        sd_journal_close(j);
-        return 0;
+  int r;
+  sd_journal *j;
+  r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+  if (r < 0) {
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
+    return 1;
+  }
+  for (;;)  {
+    const void *d;
+    size_t l;
+    r = sd_journal_next(j);
+    if (r < 0) {
+      fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
+      break;
+    }
+    if (r == 0) {
+      /* Reached the end, let's wait for changes, and try again */
+      r = sd_journal_wait(j, (uint64_t) -1);
+      if (r < 0) {
+        fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
+        break;
+      }
+      continue;
+    }
+    r = sd_journal_get_data(j, "MESSAGE", &d, &l);
+    if (r < 0) {
+      fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
+      continue;
+    }
+    printf("%.*s\n", (int) l, (const char*) d);
+  }
+  sd_journal_close(j);
+  return 0;
 }

Waiting with poll() (this - example lacks all error checking for the sake of - simplicity):

#include <sys/poll.h>
+    example lacks all error checking for the sake of
+    simplicity):

#include <poll.h>
 #include <systemd/sd-journal.h>
 
 int wait_for_changes(sd_journal *j) {
-        struct pollfd pollfd;
-        int msec;
+  struct pollfd pollfd;
+  int msec;
 
-        sd_journal_get_timeout(m, &t);
-        if (t == (uint64_t) -1)
-                msec = -1;
-        else {
-                struct timespec ts;
-                uint64_t n;
-                clock_getttime(CLOCK_MONOTONIC, &ts);
-                n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-                msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-        }
+  sd_journal_get_timeout(m, &t);
+  if (t == (uint64_t) -1)
+    msec = -1;
+  else {
+    struct timespec ts;
+    uint64_t n;
+    clock_getttime(CLOCK_MONOTONIC, &ts);
+    n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+    msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+  }
 
-        pollfd.fd = sd_journal_get_fd(j);
-        pollfd.events = sd_journal_get_events(j);
-        poll(&pollfd, 1, msec);
-        return sd_journal_process(j);
-}
+ pollfd.fd = sd_journal_get_fd(j); + pollfd.events = sd_journal_get_events(j); + poll(&pollfd, 1, msec); + return sd_journal_process(j); +}
diff --git a/man/SD_JOURNAL_LOCAL_ONLY.html b/man/SD_JOURNAL_LOCAL_ONLY.html index f124e223a..1cba05767 100644 --- a/man/SD_JOURNAL_LOCAL_ONLY.html +++ b/man/SD_JOURNAL_LOCAL_ONLY.html @@ -19,108 +19,94 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens - the log journal for reading. It will find all journal - files automatically and interleave them automatically - when reading. As first argument it takes a pointer to - a sd_journal pointer, which on - success will contain a journal context object. The - second argument is a flags field, which may consist of - the following flags ORed together: - SD_JOURNAL_LOCAL_ONLY makes sure - only journal files generated on the local machine will - be opened. SD_JOURNAL_RUNTIME_ONLY - makes sure only volatile journal files will be opened, - excluding those which are stored on persistent - storage. SD_JOURNAL_SYSTEM - will cause journal files of system services and the - kernel (in opposition to user session processes) to - be opened. SD_JOURNAL_CURRENT_USER - will cause journal files of the current user to be - opened. If neither SD_JOURNAL_SYSTEM - nor SD_JOURNAL_CURRENT_USER are - specified, all journal file types will be opened.

sd_journal_open_directory() - is similar to sd_journal_open() - but takes an absolute directory path as argument. All - journal files in this directory will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call.

sd_journal_open_files() - is similar to sd_journal_open() - but takes a NULL-terminated list - of file paths to open. All files will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call. Please note - that in the case of a live journal, this function is only - useful for debugging, because individual journal files - can be rotated at any moment, and the opening of - specific files is inherently racy.

sd_journal_open_container() - is similar to sd_journal_open() - but opens the journal files of a running - OS container. The specified machine name refers to a - container that is registered with - systemd-machined(8).

sd_journal objects cannot be - used in the child after a fork. Functions which take a - journal object as an argument - (sd_journal_next() and others) - will return -ECHILD after a fork. -

sd_journal_close() will - close the journal context allocated with - sd_journal_open() or - sd_journal_open_directory() and - free its resources.

When opening the journal only journal files - accessible to the calling user will be opened. If - journal files are not accessible to the caller, this - will be silently ignored.

See - sd_journal_next(3) - for an example of how to iterate through the journal - after opening it with - sd_journal_open().

A journal context object returned by - sd_journal_open() references a - specific journal entry as current entry, - similar to a file seek index in a classic file system - file, but without absolute positions. It may be - altered with - sd_journal_next(3) - and - sd_journal_seek_head(3) - and related calls. The current entry position may be - exported in cursor strings, as accessible - via - sd_journal_get_cursor(3). Cursor - strings may be used to globally identify a specific - journal entry in a stable way and then later to seek - to it (or if the specific entry is not available - locally, to its closest entry in time) - sd_journal_seek_cursor(3).

Notification of journal changes is available via - sd_journal_get_fd() and related - calls.

Return Value¶

The sd_journal_open(), - sd_journal_open_directory(), and - sd_journal_open_files() calls - return 0 on success or a negative errno-style error - code. sd_journal_close() returns - nothing.

Notes¶

The sd_journal_open(), - sd_journal_open_directory() and - sd_journal_close() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

History¶

sd_journal_open(), - sd_journal_close(), - SD_JOURNAL_LOCAL_ONLY, - SD_JOURNAL_RUNTIME_ONLY, - SD_JOURNAL_SYSTEM_ONLY were added - in systemd-38.

sd_journal_open_directory() - was added in systemd-187.

SD_JOURNAL_SYSTEM, - SD_JOURNAL_CURRENT_USER, - and sd_journal_open_files() - were added in systemd-205. - SD_JOURNAL_SYSTEM_ONLY - was deprecated.

+ gudev systemd 219

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens the log journal + for reading. It will find all journal files automatically and + interleave them automatically when reading. As first argument it + takes a pointer to a sd_journal pointer, which + on success will contain a journal context object. The second + argument is a flags field, which may consist of the following + flags ORed together: SD_JOURNAL_LOCAL_ONLY + makes sure only journal files generated on the local machine will + be opened. SD_JOURNAL_RUNTIME_ONLY makes sure + only volatile journal files will be opened, excluding those which + are stored on persistent storage. + SD_JOURNAL_SYSTEM will cause journal files of + system services and the kernel (in opposition to user session + processes) to be opened. + SD_JOURNAL_CURRENT_USER will cause journal + files of the current user to be opened. If neither + SD_JOURNAL_SYSTEM nor + SD_JOURNAL_CURRENT_USER are specified, all + journal file types will be opened.

sd_journal_open_directory() is similar + to sd_journal_open() but takes an absolute + directory path as argument. All journal files in this directory + will be opened and interleaved automatically. This call also takes + a flags argument, but it must be passed as 0 as no flags are + currently understood for this call.

sd_journal_open_files() is similar to + sd_journal_open() but takes a + NULL-terminated list of file paths to open. + All files will be opened and interleaved automatically. This call + also takes a flags argument, but it must be passed as 0 as no + flags are currently understood for this call. Please note that in + the case of a live journal, this function is only useful for + debugging, because individual journal files can be rotated at any + moment, and the opening of specific files is inherently + racy.

sd_journal_open_container() is similar + to sd_journal_open() but opens the journal + files of a running OS container. The specified machine name refers + to a container that is registered with + systemd-machined(8).

sd_journal objects cannot be used in the + child after a fork. Functions which take a journal object as an + argument (sd_journal_next() and others) will + return -ECHILD after a fork. +

sd_journal_close() will close the + journal context allocated with + sd_journal_open() or + sd_journal_open_directory() and free its + resources.

When opening the journal only journal files accessible to + the calling user will be opened. If journal files are not + accessible to the caller, this will be silently ignored.

See + sd_journal_next(3) + for an example of how to iterate through the journal after opening + it with sd_journal_open().

A journal context object returned by + sd_journal_open() references a specific + journal entry as current entry, similar to a + file seek index in a classic file system file, but without + absolute positions. It may be altered with + sd_journal_next(3) + and + sd_journal_seek_head(3) + and related calls. The current entry position may be exported in + cursor strings, as accessible via + sd_journal_get_cursor(3). + Cursor strings may be used to globally identify a specific journal + entry in a stable way and then later to seek to it (or if the + specific entry is not available locally, to its closest entry in + time) + sd_journal_seek_cursor(3).

Notification of journal changes is available via + sd_journal_get_fd() and related calls.

Return Value¶

The sd_journal_open(), + sd_journal_open_directory(), and + sd_journal_open_files() calls return 0 on + success or a negative errno-style error code. + sd_journal_close() returns nothing.

Notes¶

The sd_journal_open(), + sd_journal_open_directory() and + sd_journal_close() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

History¶

sd_journal_open(), + sd_journal_close(), + SD_JOURNAL_LOCAL_ONLY, + SD_JOURNAL_RUNTIME_ONLY, + SD_JOURNAL_SYSTEM_ONLY were added in + systemd-38.

sd_journal_open_directory() was added + in systemd-187.

SD_JOURNAL_SYSTEM, + SD_JOURNAL_CURRENT_USER, and + sd_journal_open_files() were added in + systemd-205. SD_JOURNAL_SYSTEM_ONLY was + deprecated.

diff --git a/man/SD_JOURNAL_NOP.html b/man/SD_JOURNAL_NOP.html index 2bec93736..a998323e0 100644 --- a/man/SD_JOURNAL_NOP.html +++ b/man/SD_JOURNAL_NOP.html @@ -19,200 +19,183 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification - interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns - a file descriptor that may be asynchronously polled in - an external event loop and is signaled as soon as the - journal changes, because new entries or files were - added, rotation took place, or files have been - deleted, and similar. The file descriptor is suitable - for usage in - poll(2). Use - sd_journal_get_events() for an - events mask to watch for. The call takes one argument: - the journal context object. Note that not all file - systems are capable of generating the necessary events - for wakeups from this file descriptor for changes to - be noticed immediately. In particular network files - systems do not generate suitable file change events in - all cases. Cases like this can be detected with - sd_journal_reliable_fd(), - below. sd_journal_get_timeout() - will ensure in these cases that wake-ups happen - frequently enough for changes to be noticed, although - with a certain latency.

sd_journal_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN and - POLLOUT and similar to fill into - the ".events" field of - struct pollfd.

sd_journal_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of - CLOCK_MONOTONIC for timing out - poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for, this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout - into relative 'ms', use code like the - following:

uint64_t t;
+  gudev systemd 219

Name

sd_journal_get_fd, sd_journal_get_events, sd_journal_get_timeout, sd_journal_process, sd_journal_wait, sd_journal_reliable_fd, SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE — Journal change notification + interface

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_get_fd(sd_journal *j);
 
int sd_journal_get_events(sd_journal *j);
 
int sd_journal_get_timeout(sd_journal *j,
 uint64_t *timeout_usec);
 
int sd_journal_process(sd_journal *j);
 
int sd_journal_wait(sd_journal *j,
 uint64_t timeout_usec);
 
int sd_journal_reliable_fd(sd_journal *j);
 

Description¶

sd_journal_get_fd() returns a file + descriptor that may be asynchronously polled in an external event + loop and is signaled as soon as the journal changes, because new + entries or files were added, rotation took place, or files have + been deleted, and similar. The file descriptor is suitable for + usage in + poll(2). + Use sd_journal_get_events() for an events + mask to watch for. The call takes one argument: the journal + context object. Note that not all file systems are capable of + generating the necessary events for wakeups from this file + descriptor for changes to be noticed immediately. In particular + network files systems do not generate suitable file change events + in all cases. Cases like this can be detected with + sd_journal_reliable_fd(), below. + sd_journal_get_timeout() will ensure in these + cases that wake-ups happen frequently enough for changes to be + noticed, although with a certain latency.

sd_journal_get_events() will return the + poll() mask to wait for. This function will + return a combination of POLLIN and + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_journal_get_timeout() will return a + timeout value for usage in poll(). This + returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for, this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_journal_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

After each poll() wake-up - sd_journal_process() needs to be - called to process events. This call will also indicate - what kind of change has been detected (see below; note - that spurious wake-ups are possible).

A synchronous alternative for using - sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout() and - sd_journal_process() is - sd_journal_wait(). It will - synchronously wait until the journal gets changed. The - maximum time this call sleeps may be controlled with - the timeout_usec - parameter. Pass (uint64_t) -1 to - wait indefinitely. Internally this call simply - combines sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_get_timeout(), - poll() and - sd_journal_process() into - one.

sd_journal_reliable_fd() - may be used to check whether the wakeup events from - the file descriptor returned by - sd_journal_get_fd() are known to - be immediately triggered. On certain file systems - where file change events from the OS are not available - (such as NFS) changes need to be polled for - repeatedly, and hence are detected only with a certain - latency. This call will return a positive value if the - journal changes are detected immediately and zero when - they need to be polled for and hence might be noticed - only with a certain latency. Note that there's usually - no need to invoke this function directly as - sd_journal_get_timeout() on these - file systems will ask for timeouts explicitly - anyway.

Return Value¶

sd_journal_get_fd() returns - a valid file descriptor on success or a negative - errno-style error code.

sd_journal_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike on success or - a negative errno-style error code.

sd_journal_reliable_fd() - returns a positive integer if the file descriptor - returned by sd_journal_get_fd() - will generate wake-ups immediately for all journal - changes. Returns 0 if there might be a latency - involved.

sd_journal_process() and - sd_journal_wait() return one of - SD_JOURNAL_NOP, - SD_JOURNAL_APPEND or - SD_JOURNAL_INVALIDATE on success or - a negative errno-style error code. If - SD_JOURNAL_NOP is returned, the - journal did not change since the last invocation. If - SD_JOURNAL_APPEND is returned, new - entries have been appended to the end of the - journal. If SD_JOURNAL_INVALIDATE, - journal files were added or removed (possibly due to - rotation). In the latter event, live-view UIs should - probably refresh their entire display, while in the - case of SD_JOURNAL_APPEND, it is - sufficient to simply continue reading at the previous - end of the journal.

Notes¶

The sd_journal_get_fd(), - sd_journal_get_events(), - sd_journal_reliable_fd(), - sd_journal_process() and - sd_journal_wait() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

Examples¶

Iterating through the journal, in a live view tracking all changes:

#include <stdio.h>
+  struct timespec ts;
+  uint64_t n;
+  clock_getttime(CLOCK_MONOTONIC, &ts);
+  n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+  msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

After each poll() wake-up + sd_journal_process() needs to be called to + process events. This call will also indicate what kind of change + has been detected (see below; note that spurious wake-ups are + possible).

A synchronous alternative for using + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout() and + sd_journal_process() is + sd_journal_wait(). It will synchronously wait + until the journal gets changed. The maximum time this call sleeps + may be controlled with the timeout_usec + parameter. Pass (uint64_t) -1 to wait + indefinitely. Internally this call simply combines + sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_get_timeout(), + poll() and + sd_journal_process() into one.

sd_journal_reliable_fd() may be used to + check whether the wakeup events from the file descriptor returned + by sd_journal_get_fd() are known to be + immediately triggered. On certain file systems where file change + events from the OS are not available (such as NFS) changes need to + be polled for repeatedly, and hence are detected only with a + certain latency. This call will return a positive value if the + journal changes are detected immediately and zero when they need + to be polled for and hence might be noticed only with a certain + latency. Note that there's usually no need to invoke this function + directly as sd_journal_get_timeout() on these + file systems will ask for timeouts explicitly anyway.

Return Value¶

sd_journal_get_fd() returns a valid + file descriptor on success or a negative errno-style error + code.

sd_journal_get_events() returns a + combination of POLLIN, + POLLOUT and suchlike on success or a negative + errno-style error code.

sd_journal_reliable_fd() returns a + positive integer if the file descriptor returned by + sd_journal_get_fd() will generate wake-ups + immediately for all journal changes. Returns 0 if there might be a + latency involved.

sd_journal_process() and + sd_journal_wait() return one of + SD_JOURNAL_NOP, + SD_JOURNAL_APPEND or + SD_JOURNAL_INVALIDATE on success or a + negative errno-style error code. If + SD_JOURNAL_NOP is returned, the journal did + not change since the last invocation. If + SD_JOURNAL_APPEND is returned, new entries + have been appended to the end of the journal. If + SD_JOURNAL_INVALIDATE, journal files were + added or removed (possibly due to rotation). In the latter event, + live-view UIs should probably refresh their entire display, while + in the case of SD_JOURNAL_APPEND, it is + sufficient to simply continue reading at the previous end of the + journal.

Notes¶

The sd_journal_get_fd(), + sd_journal_get_events(), + sd_journal_reliable_fd(), + sd_journal_process() and + sd_journal_wait() interfaces are available as + a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

Iterating through the journal, in a live view tracking all + changes:

#include <stdio.h>
 #include <string.h>
 #include <systemd/sd-journal.h>
 
 int main(int argc, char *argv[]) {
-        int r;
-        sd_journal *j;
-        r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
-        if (r < 0) {
-                fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
-                return 1;
-        }
-        for (;;)  {
-                const void *d;
-                size_t l;
-                r = sd_journal_next(j);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
-                        break;
-                }
-                if (r == 0) {
-                        /* Reached the end, let's wait for changes, and try again */
-                        r = sd_journal_wait(j, (uint64_t) -1);
-                        if (r < 0) {
-                                fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
-                                break;
-                        }
-                        continue;
-                }
-                r = sd_journal_get_data(j, "MESSAGE", &d, &l);
-                if (r < 0) {
-                        fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
-                        continue;
-                }
-                printf("%.*s\n", (int) l, (const char*) d);
-        }
-        sd_journal_close(j);
-        return 0;
+  int r;
+  sd_journal *j;
+  r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+  if (r < 0) {
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
+    return 1;
+  }
+  for (;;)  {
+    const void *d;
+    size_t l;
+    r = sd_journal_next(j);
+    if (r < 0) {
+      fprintf(stderr, "Failed to iterate to next entry: %s\n", strerror(-r));
+      break;
+    }
+    if (r == 0) {
+      /* Reached the end, let's wait for changes, and try again */
+      r = sd_journal_wait(j, (uint64_t) -1);
+      if (r < 0) {
+        fprintf(stderr, "Failed to wait for changes: %s\n", strerror(-r));
+        break;
+      }
+      continue;
+    }
+    r = sd_journal_get_data(j, "MESSAGE", &d, &l);
+    if (r < 0) {
+      fprintf(stderr, "Failed to read message field: %s\n", strerror(-r));
+      continue;
+    }
+    printf("%.*s\n", (int) l, (const char*) d);
+  }
+  sd_journal_close(j);
+  return 0;
 }

Waiting with poll() (this - example lacks all error checking for the sake of - simplicity):

#include <sys/poll.h>
+    example lacks all error checking for the sake of
+    simplicity):

#include <poll.h>
 #include <systemd/sd-journal.h>
 
 int wait_for_changes(sd_journal *j) {
-        struct pollfd pollfd;
-        int msec;
+  struct pollfd pollfd;
+  int msec;
 
-        sd_journal_get_timeout(m, &t);
-        if (t == (uint64_t) -1)
-                msec = -1;
-        else {
-                struct timespec ts;
-                uint64_t n;
-                clock_getttime(CLOCK_MONOTONIC, &ts);
-                n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-                msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-        }
+  sd_journal_get_timeout(m, &t);
+  if (t == (uint64_t) -1)
+    msec = -1;
+  else {
+    struct timespec ts;
+    uint64_t n;
+    clock_getttime(CLOCK_MONOTONIC, &ts);
+    n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+    msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
+  }
 
-        pollfd.fd = sd_journal_get_fd(j);
-        pollfd.events = sd_journal_get_events(j);
-        poll(&pollfd, 1, msec);
-        return sd_journal_process(j);
-}
+ pollfd.fd = sd_journal_get_fd(j); + pollfd.events = sd_journal_get_events(j); + poll(&pollfd, 1, msec); + return sd_journal_process(j); +}
diff --git a/man/SD_JOURNAL_RUNTIME_ONLY.html b/man/SD_JOURNAL_RUNTIME_ONLY.html index f124e223a..1cba05767 100644 --- a/man/SD_JOURNAL_RUNTIME_ONLY.html +++ b/man/SD_JOURNAL_RUNTIME_ONLY.html @@ -19,108 +19,94 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens - the log journal for reading. It will find all journal - files automatically and interleave them automatically - when reading. As first argument it takes a pointer to - a sd_journal pointer, which on - success will contain a journal context object. The - second argument is a flags field, which may consist of - the following flags ORed together: - SD_JOURNAL_LOCAL_ONLY makes sure - only journal files generated on the local machine will - be opened. SD_JOURNAL_RUNTIME_ONLY - makes sure only volatile journal files will be opened, - excluding those which are stored on persistent - storage. SD_JOURNAL_SYSTEM - will cause journal files of system services and the - kernel (in opposition to user session processes) to - be opened. SD_JOURNAL_CURRENT_USER - will cause journal files of the current user to be - opened. If neither SD_JOURNAL_SYSTEM - nor SD_JOURNAL_CURRENT_USER are - specified, all journal file types will be opened.

sd_journal_open_directory() - is similar to sd_journal_open() - but takes an absolute directory path as argument. All - journal files in this directory will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call.

sd_journal_open_files() - is similar to sd_journal_open() - but takes a NULL-terminated list - of file paths to open. All files will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call. Please note - that in the case of a live journal, this function is only - useful for debugging, because individual journal files - can be rotated at any moment, and the opening of - specific files is inherently racy.

sd_journal_open_container() - is similar to sd_journal_open() - but opens the journal files of a running - OS container. The specified machine name refers to a - container that is registered with - systemd-machined(8).

sd_journal objects cannot be - used in the child after a fork. Functions which take a - journal object as an argument - (sd_journal_next() and others) - will return -ECHILD after a fork. -

sd_journal_close() will - close the journal context allocated with - sd_journal_open() or - sd_journal_open_directory() and - free its resources.

When opening the journal only journal files - accessible to the calling user will be opened. If - journal files are not accessible to the caller, this - will be silently ignored.

See - sd_journal_next(3) - for an example of how to iterate through the journal - after opening it with - sd_journal_open().

A journal context object returned by - sd_journal_open() references a - specific journal entry as current entry, - similar to a file seek index in a classic file system - file, but without absolute positions. It may be - altered with - sd_journal_next(3) - and - sd_journal_seek_head(3) - and related calls. The current entry position may be - exported in cursor strings, as accessible - via - sd_journal_get_cursor(3). Cursor - strings may be used to globally identify a specific - journal entry in a stable way and then later to seek - to it (or if the specific entry is not available - locally, to its closest entry in time) - sd_journal_seek_cursor(3).

Notification of journal changes is available via - sd_journal_get_fd() and related - calls.

Return Value¶

The sd_journal_open(), - sd_journal_open_directory(), and - sd_journal_open_files() calls - return 0 on success or a negative errno-style error - code. sd_journal_close() returns - nothing.

Notes¶

The sd_journal_open(), - sd_journal_open_directory() and - sd_journal_close() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

History¶

sd_journal_open(), - sd_journal_close(), - SD_JOURNAL_LOCAL_ONLY, - SD_JOURNAL_RUNTIME_ONLY, - SD_JOURNAL_SYSTEM_ONLY were added - in systemd-38.

sd_journal_open_directory() - was added in systemd-187.

SD_JOURNAL_SYSTEM, - SD_JOURNAL_CURRENT_USER, - and sd_journal_open_files() - were added in systemd-205. - SD_JOURNAL_SYSTEM_ONLY - was deprecated.

+ gudev systemd 219

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens the log journal + for reading. It will find all journal files automatically and + interleave them automatically when reading. As first argument it + takes a pointer to a sd_journal pointer, which + on success will contain a journal context object. The second + argument is a flags field, which may consist of the following + flags ORed together: SD_JOURNAL_LOCAL_ONLY + makes sure only journal files generated on the local machine will + be opened. SD_JOURNAL_RUNTIME_ONLY makes sure + only volatile journal files will be opened, excluding those which + are stored on persistent storage. + SD_JOURNAL_SYSTEM will cause journal files of + system services and the kernel (in opposition to user session + processes) to be opened. + SD_JOURNAL_CURRENT_USER will cause journal + files of the current user to be opened. If neither + SD_JOURNAL_SYSTEM nor + SD_JOURNAL_CURRENT_USER are specified, all + journal file types will be opened.

sd_journal_open_directory() is similar + to sd_journal_open() but takes an absolute + directory path as argument. All journal files in this directory + will be opened and interleaved automatically. This call also takes + a flags argument, but it must be passed as 0 as no flags are + currently understood for this call.

sd_journal_open_files() is similar to + sd_journal_open() but takes a + NULL-terminated list of file paths to open. + All files will be opened and interleaved automatically. This call + also takes a flags argument, but it must be passed as 0 as no + flags are currently understood for this call. Please note that in + the case of a live journal, this function is only useful for + debugging, because individual journal files can be rotated at any + moment, and the opening of specific files is inherently + racy.

sd_journal_open_container() is similar + to sd_journal_open() but opens the journal + files of a running OS container. The specified machine name refers + to a container that is registered with + systemd-machined(8).

sd_journal objects cannot be used in the + child after a fork. Functions which take a journal object as an + argument (sd_journal_next() and others) will + return -ECHILD after a fork. +

sd_journal_close() will close the + journal context allocated with + sd_journal_open() or + sd_journal_open_directory() and free its + resources.

When opening the journal only journal files accessible to + the calling user will be opened. If journal files are not + accessible to the caller, this will be silently ignored.

See + sd_journal_next(3) + for an example of how to iterate through the journal after opening + it with sd_journal_open().

A journal context object returned by + sd_journal_open() references a specific + journal entry as current entry, similar to a + file seek index in a classic file system file, but without + absolute positions. It may be altered with + sd_journal_next(3) + and + sd_journal_seek_head(3) + and related calls. The current entry position may be exported in + cursor strings, as accessible via + sd_journal_get_cursor(3). + Cursor strings may be used to globally identify a specific journal + entry in a stable way and then later to seek to it (or if the + specific entry is not available locally, to its closest entry in + time) + sd_journal_seek_cursor(3).

Notification of journal changes is available via + sd_journal_get_fd() and related calls.

Return Value¶

The sd_journal_open(), + sd_journal_open_directory(), and + sd_journal_open_files() calls return 0 on + success or a negative errno-style error code. + sd_journal_close() returns nothing.

Notes¶

The sd_journal_open(), + sd_journal_open_directory() and + sd_journal_close() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

History¶

sd_journal_open(), + sd_journal_close(), + SD_JOURNAL_LOCAL_ONLY, + SD_JOURNAL_RUNTIME_ONLY, + SD_JOURNAL_SYSTEM_ONLY were added in + systemd-38.

sd_journal_open_directory() was added + in systemd-187.

SD_JOURNAL_SYSTEM, + SD_JOURNAL_CURRENT_USER, and + sd_journal_open_files() were added in + systemd-205. SD_JOURNAL_SYSTEM_ONLY was + deprecated.

diff --git a/man/SD_JOURNAL_SUPPRESS_LOCATION.html b/man/SD_JOURNAL_SUPPRESS_LOCATION.html index c2205b1f5..fb87ca5ef 100644 --- a/man/SD_JOURNAL_SUPPRESS_LOCATION.html +++ b/man/SD_JOURNAL_SUPPRESS_LOCATION.html @@ -19,132 +19,122 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_print, sd_journal_printv, sd_journal_send, sd_journal_sendv, sd_journal_perror, SD_JOURNAL_SUPPRESS_LOCATION — Submit log entries to the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_print(int priority,
 const char *format,
 ...);
 
int sd_journal_printv(int priority,
 const char *format,
 va_list ap);
 
int sd_journal_send(const char *format,
 ...);
 
int sd_journal_sendv(const struct iovec *iov,
 int n);
 
int sd_journal_perror(const char *message);
 

Description¶

sd_journal_print() may be - used to submit simple, plain text log entries to the - system journal. The first argument is a priority - value. This is followed by a format string and its - parameters, similar to - printf(3) - or - syslog(3). The - priority value is one of - LOG_EMERG, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG, as defined in - syslog.h, see - syslog(3) - for details. It is recommended to use this call to - submit log messages in the application locale or system - locale and in UTF-8 format, but no such restrictions - are enforced.

sd_journal_printv() is - similar to sd_journal_print() but - takes a variable argument list encapsulated in an - object of type va_list (see - stdarg(3) - for more information) instead of the format string. It - is otherwise equivalent in behavior.

sd_journal_send() may be - used to submit structured log entries to the system - journal. It takes a series of format strings, each - immediately followed by their associated parameters, - terminated by NULL. The strings passed should be of - the format "VARIABLE=value". The - variable name must be in uppercase and consist only of - characters, numbers and underscores, and may not begin - with an underscore. (All assignments that do not - follow this syntax will be ignored.) The value can be - of any size and format. It is highly recommended to - submit text strings formatted in the UTF-8 character - encoding only, and submit binary fields only when - formatting in UTF-8 strings is not sensible. A number - of well known fields are defined, see - systemd.journal-fields(7) - for details, but additional application defined fields - may be used. A variable may be assigned more than one - value per entry.

sd_journal_sendv() is - similar to sd_journal_send() but - takes an array of struct iovec (as - defined in uio.h, see - readv(3) - for details) instead of the format string. Each - structure should reference one field of the entry to - submit. The second argument specifies the number of - structures in the array. - sd_journal_sendv() is - particularly useful to submit binary objects to the - journal where that is necessary.

sd_journal_perror() is a - similar to - perror(3) - and writes a message to the journal that consists of - the passed string, suffixed with ": " and a human - readable representation of the current error code - stored in - errno(3). If - the message string is passed as NULL or empty string, - only the error string representation will be written, - prefixed with nothing. An additional journal field - ERRNO= is included in the entry containing the numeric - error code formatted as decimal string. The log - priority used is LOG_ERR (3).

Note that sd_journal_send() - is a wrapper around - sd_journal_sendv() to make it - easier to use when only text strings shall be - submitted. Also, the following two calls are - mostly equivalent:

sd_journal_print(LOG_INFO, "Hello World, this is PID %lu!", (unsigned long) getpid());
+  gudev systemd 219

Name

sd_journal_print, sd_journal_printv, sd_journal_send, sd_journal_sendv, sd_journal_perror, SD_JOURNAL_SUPPRESS_LOCATION — Submit log entries to the journal

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_print(int priority,
 const char *format,
 ...);
 
int sd_journal_printv(int priority,
 const char *format,
 va_list ap);
 
int sd_journal_send(const char *format,
 ...);
 
int sd_journal_sendv(const struct iovec *iov,
 int n);
 
int sd_journal_perror(const char *message);
 

Description¶

sd_journal_print() may be used to + submit simple, plain text log entries to the system journal. The + first argument is a priority value. This is followed by a format + string and its parameters, similar to + printf(3) + or + syslog(3). + The priority value is one of + LOG_EMERG, + LOG_ALERT, + LOG_CRIT, + LOG_ERR, + LOG_WARNING, + LOG_NOTICE, + LOG_INFO, + LOG_DEBUG, as defined in + syslog.h, see + syslog(3) + for details. It is recommended to use this call to submit log + messages in the application locale or system locale and in UTF-8 + format, but no such restrictions are enforced.

sd_journal_printv() is similar to + sd_journal_print() but takes a variable + argument list encapsulated in an object of type + va_list (see + stdarg(3) + for more information) instead of the format string. It is + otherwise equivalent in behavior.

sd_journal_send() may be used to submit + structured log entries to the system journal. It takes a series of + format strings, each immediately followed by their associated + parameters, terminated by NULL. The strings + passed should be of the format "VARIABLE=value". + The variable name must be in uppercase and consist only of + characters, numbers and underscores, and may not begin with an + underscore. (All assignments that do not follow this syntax will + be ignored.) The value can be of any size and format. It is highly + recommended to submit text strings formatted in the UTF-8 + character encoding only, and submit binary fields only when + formatting in UTF-8 strings is not sensible. A number of well + known fields are defined, see + systemd.journal-fields(7) + for details, but additional application defined fields may be + used. A variable may be assigned more than one value per + entry.

sd_journal_sendv() is similar to + sd_journal_send() but takes an array of + struct iovec (as defined in + uio.h, see + readv(3) + for details) instead of the format string. Each structure should + reference one field of the entry to submit. The second argument + specifies the number of structures in the array. + sd_journal_sendv() is particularly useful to + submit binary objects to the journal where that is + necessary.

sd_journal_perror() is a similar to + perror(3) + and writes a message to the journal that consists of the passed + string, suffixed with ": " and a human readable representation of + the current error code stored in + errno(3). + If the message string is passed as NULL or + empty string, only the error string representation will be + written, prefixed with nothing. An additional journal field ERRNO= + is included in the entry containing the numeric error code + formatted as decimal string. The log priority used is + LOG_ERR (3).

Note that sd_journal_send() is a + wrapper around sd_journal_sendv() to make it + easier to use when only text strings shall be submitted. Also, the + following two calls are mostly equivalent:

sd_journal_print(LOG_INFO, "Hello World, this is PID %lu!", (unsigned long) getpid());
 
 sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(),
-                "PRIORITY=%i", LOG_INFO,
-                NULL);

Note that these calls implicitly add fields for - the source file, function name and code line where - invoked. This is implemented with macros. If this is - not desired, it can be turned off by defining - SD_JOURNAL_SUPPRESS_LOCATION before including - sd-journal.h.

syslog(3) - and sd_journal_print() may - largely be used interchangeably - functionality-wise. However, note that log messages - logged via the former take a different path to the - journal server than the later, and hence global - chronological ordering between the two streams cannot - be guaranteed. Using - sd_journal_print() has the - benefit of logging source code line, filenames, and - functions as metadata along all entries, and - guaranteeing chronological ordering with structured - log entries that are generated via - sd_journal_send(). Using - syslog() has the benefit of being - more portable.

Return Value¶

The four calls return 0 on success or a negative - errno-style error code. The - errno(3) - variable itself is not altered.

If - systemd-journald(8) - is not running (the socket is not present), those - functions do nothing, and also return 0.

Async signal safety¶

sd_journal_sendv() is "async signal - safe" in the meaning of signal(7). -

sd_journal_print, - sd_journal_printv, - sd_journal_send, and - sd_journal_perror are - not async signal safe.

Notes¶

The sd_journal_print(), - sd_journal_printv(), - sd_journal_send() and - sd_journal_sendv() interfaces - are available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - file.

+ "PRIORITY=%i", LOG_INFO, + NULL);

Note that these calls implicitly add fields for the source + file, function name and code line where invoked. This is + implemented with macros. If this is not desired, it can be turned + off by defining SD_JOURNAL_SUPPRESS_LOCATION before including + sd-journal.h.

syslog(3) + and sd_journal_print() may + largely be used interchangeably + functionality-wise. However, note that log messages + logged via the former take a different path to the + journal server than the later, and hence global + chronological ordering between the two streams cannot + be guaranteed. Using + sd_journal_print() has the + benefit of logging source code line, filenames, and + functions as metadata along all entries, and + guaranteeing chronological ordering with structured + log entries that are generated via + sd_journal_send(). Using + syslog() has the benefit of being + more portable.

Return Value¶

The four calls return 0 on success or a negative errno-style + error code. The + errno(3) + variable itself is not altered.

If + systemd-journald(8) + is not running (the socket is not present), those functions do + nothing, and also return 0.

Async signal safety¶

sd_journal_sendv() is "async signal + safe" in the meaning of + signal(7). +

sd_journal_print, + sd_journal_printv, + sd_journal_send, and + sd_journal_perror are + not async signal safe.

Notes¶

The sd_journal_print(), + sd_journal_printv(), + sd_journal_send() and + sd_journal_sendv() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/SD_JOURNAL_SYSTEM.html b/man/SD_JOURNAL_SYSTEM.html index f124e223a..1cba05767 100644 --- a/man/SD_JOURNAL_SYSTEM.html +++ b/man/SD_JOURNAL_SYSTEM.html @@ -19,108 +19,94 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens - the log journal for reading. It will find all journal - files automatically and interleave them automatically - when reading. As first argument it takes a pointer to - a sd_journal pointer, which on - success will contain a journal context object. The - second argument is a flags field, which may consist of - the following flags ORed together: - SD_JOURNAL_LOCAL_ONLY makes sure - only journal files generated on the local machine will - be opened. SD_JOURNAL_RUNTIME_ONLY - makes sure only volatile journal files will be opened, - excluding those which are stored on persistent - storage. SD_JOURNAL_SYSTEM - will cause journal files of system services and the - kernel (in opposition to user session processes) to - be opened. SD_JOURNAL_CURRENT_USER - will cause journal files of the current user to be - opened. If neither SD_JOURNAL_SYSTEM - nor SD_JOURNAL_CURRENT_USER are - specified, all journal file types will be opened.

sd_journal_open_directory() - is similar to sd_journal_open() - but takes an absolute directory path as argument. All - journal files in this directory will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call.

sd_journal_open_files() - is similar to sd_journal_open() - but takes a NULL-terminated list - of file paths to open. All files will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call. Please note - that in the case of a live journal, this function is only - useful for debugging, because individual journal files - can be rotated at any moment, and the opening of - specific files is inherently racy.

sd_journal_open_container() - is similar to sd_journal_open() - but opens the journal files of a running - OS container. The specified machine name refers to a - container that is registered with - systemd-machined(8).

sd_journal objects cannot be - used in the child after a fork. Functions which take a - journal object as an argument - (sd_journal_next() and others) - will return -ECHILD after a fork. -

sd_journal_close() will - close the journal context allocated with - sd_journal_open() or - sd_journal_open_directory() and - free its resources.

When opening the journal only journal files - accessible to the calling user will be opened. If - journal files are not accessible to the caller, this - will be silently ignored.

See - sd_journal_next(3) - for an example of how to iterate through the journal - after opening it with - sd_journal_open().

A journal context object returned by - sd_journal_open() references a - specific journal entry as current entry, - similar to a file seek index in a classic file system - file, but without absolute positions. It may be - altered with - sd_journal_next(3) - and - sd_journal_seek_head(3) - and related calls. The current entry position may be - exported in cursor strings, as accessible - via - sd_journal_get_cursor(3). Cursor - strings may be used to globally identify a specific - journal entry in a stable way and then later to seek - to it (or if the specific entry is not available - locally, to its closest entry in time) - sd_journal_seek_cursor(3).

Notification of journal changes is available via - sd_journal_get_fd() and related - calls.

Return Value¶

The sd_journal_open(), - sd_journal_open_directory(), and - sd_journal_open_files() calls - return 0 on success or a negative errno-style error - code. sd_journal_close() returns - nothing.

Notes¶

The sd_journal_open(), - sd_journal_open_directory() and - sd_journal_close() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

History¶

sd_journal_open(), - sd_journal_close(), - SD_JOURNAL_LOCAL_ONLY, - SD_JOURNAL_RUNTIME_ONLY, - SD_JOURNAL_SYSTEM_ONLY were added - in systemd-38.

sd_journal_open_directory() - was added in systemd-187.

SD_JOURNAL_SYSTEM, - SD_JOURNAL_CURRENT_USER, - and sd_journal_open_files() - were added in systemd-205. - SD_JOURNAL_SYSTEM_ONLY - was deprecated.

+ gudev systemd 219

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens the log journal + for reading. It will find all journal files automatically and + interleave them automatically when reading. As first argument it + takes a pointer to a sd_journal pointer, which + on success will contain a journal context object. The second + argument is a flags field, which may consist of the following + flags ORed together: SD_JOURNAL_LOCAL_ONLY + makes sure only journal files generated on the local machine will + be opened. SD_JOURNAL_RUNTIME_ONLY makes sure + only volatile journal files will be opened, excluding those which + are stored on persistent storage. + SD_JOURNAL_SYSTEM will cause journal files of + system services and the kernel (in opposition to user session + processes) to be opened. + SD_JOURNAL_CURRENT_USER will cause journal + files of the current user to be opened. If neither + SD_JOURNAL_SYSTEM nor + SD_JOURNAL_CURRENT_USER are specified, all + journal file types will be opened.

sd_journal_open_directory() is similar + to sd_journal_open() but takes an absolute + directory path as argument. All journal files in this directory + will be opened and interleaved automatically. This call also takes + a flags argument, but it must be passed as 0 as no flags are + currently understood for this call.

sd_journal_open_files() is similar to + sd_journal_open() but takes a + NULL-terminated list of file paths to open. + All files will be opened and interleaved automatically. This call + also takes a flags argument, but it must be passed as 0 as no + flags are currently understood for this call. Please note that in + the case of a live journal, this function is only useful for + debugging, because individual journal files can be rotated at any + moment, and the opening of specific files is inherently + racy.

sd_journal_open_container() is similar + to sd_journal_open() but opens the journal + files of a running OS container. The specified machine name refers + to a container that is registered with + systemd-machined(8).

sd_journal objects cannot be used in the + child after a fork. Functions which take a journal object as an + argument (sd_journal_next() and others) will + return -ECHILD after a fork. +

sd_journal_close() will close the + journal context allocated with + sd_journal_open() or + sd_journal_open_directory() and free its + resources.

When opening the journal only journal files accessible to + the calling user will be opened. If journal files are not + accessible to the caller, this will be silently ignored.

See + sd_journal_next(3) + for an example of how to iterate through the journal after opening + it with sd_journal_open().

A journal context object returned by + sd_journal_open() references a specific + journal entry as current entry, similar to a + file seek index in a classic file system file, but without + absolute positions. It may be altered with + sd_journal_next(3) + and + sd_journal_seek_head(3) + and related calls. The current entry position may be exported in + cursor strings, as accessible via + sd_journal_get_cursor(3). + Cursor strings may be used to globally identify a specific journal + entry in a stable way and then later to seek to it (or if the + specific entry is not available locally, to its closest entry in + time) + sd_journal_seek_cursor(3).

Notification of journal changes is available via + sd_journal_get_fd() and related calls.

Return Value¶

The sd_journal_open(), + sd_journal_open_directory(), and + sd_journal_open_files() calls return 0 on + success or a negative errno-style error code. + sd_journal_close() returns nothing.

Notes¶

The sd_journal_open(), + sd_journal_open_directory() and + sd_journal_close() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

History¶

sd_journal_open(), + sd_journal_close(), + SD_JOURNAL_LOCAL_ONLY, + SD_JOURNAL_RUNTIME_ONLY, + SD_JOURNAL_SYSTEM_ONLY were added in + systemd-38.

sd_journal_open_directory() was added + in systemd-187.

SD_JOURNAL_SYSTEM, + SD_JOURNAL_CURRENT_USER, and + sd_journal_open_files() were added in + systemd-205. SD_JOURNAL_SYSTEM_ONLY was + deprecated.

diff --git a/man/SD_LISTEN_FDS_START.html b/man/SD_LISTEN_FDS_START.html index e2469b415..b72560d74 100644 --- a/man/SD_LISTEN_FDS_START.html +++ b/man/SD_LISTEN_FDS_START.html @@ -19,71 +19,71 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_listen_fds, SD_LISTEN_FDS_START — Check for file descriptors passed by the system manager

Synopsis

#include <systemd/sd-daemon.h>
#define SD_LISTEN_FDS_START 3
int sd_listen_fds(int unset_environment);
 

Description¶

sd_listen_fds() shall be - called by a daemon to check for file descriptors - passed by the init system as part of the socket-based - activation logic.

If the unset_environment - parameter is non-zero, - sd_listen_fds() will unset the - $LISTEN_FDS/$LISTEN_PID - environment variables before returning (regardless of - whether the function call itself succeeded or - not). Further calls to - sd_listen_fds() will then fail, - but the variables are no longer inherited by child - processes.

If a daemon receives more than one file - descriptor, they will be passed in the same order as - configured in the systemd socket definition - file. Nonetheless, it is recommended to verify the - correct socket types before using them. To simplify - this checking, the functions - sd_is_fifo(3), - sd_is_socket(3), - sd_is_socket_inet(3), - sd_is_socket_unix(3) - are provided. In order to maximize flexibility, it is - recommended to make these checks as loose as possible - without allowing incorrect setups. i.e. often, the - actual port number a socket is bound to matters little - for the service to work, hence it should not be - verified. On the other hand, whether a socket is a - datagram or stream socket matters a lot for the most - common program logics and should be checked.

This function call will set the FD_CLOEXEC flag - for all passed file descriptors to avoid further - inheritance to children of the calling process.

Return Value¶

On failure, this call returns a negative - errno-style error code. If - $LISTEN_FDS/$LISTEN_PID - was not set or was not correctly set for this daemon and - hence no file descriptors were received, 0 is - returned. Otherwise, the number of file descriptors - passed is returned. The application may find them - starting with file descriptor SD_LISTEN_FDS_START, - i.e. file descriptor 3.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_listen_fds, SD_LISTEN_FDS_START — Check for file descriptors passed by the system manager

Synopsis

#include <systemd/sd-daemon.h>
#define SD_LISTEN_FDS_START 3
int sd_listen_fds(int unset_environment);
 

Description¶

sd_listen_fds() shall be called by a + daemon to check for file descriptors passed by the init system as + part of the socket-based activation logic.

If the unset_environment parameter is + non-zero, sd_listen_fds() will unset the + $LISTEN_FDS and $LISTEN_PID + environment variables before returning (regardless of whether the + function call itself succeeded or not). Further calls to + sd_listen_fds() will then fail, but the + variables are no longer inherited by child processes.

If a daemon receives more than one file descriptor, they + will be passed in the same order as configured in the systemd + socket unit file (see + systemd.socket(5) + for details). Nonetheless, it is recommended to verify the correct + socket types before using them. To simplify this checking, the + functions + sd_is_fifo(3), + sd_is_socket(3), + sd_is_socket_inet(3), + sd_is_socket_unix(3) + are provided. In order to maximize flexibility, it is recommended + to make these checks as loose as possible without allowing + incorrect setups. i.e. often, the actual port number a socket is + bound to matters little for the service to work, hence it should + not be verified. On the other hand, whether a socket is a datagram + or stream socket matters a lot for the most common program logics + and should be checked.

This function call will set the FD_CLOEXEC flag for all + passed file descriptors to avoid further inheritance to children + of the calling process.

If multiple socket units activate the same service the order + of the file descriptors passed to its main process is undefined. + If additional file descriptors have been passed to the service + manager using + sd_pid_notify_with_fds(3)'s + "FDSTORE=1" messages, these file descriptors are + passed last, in arbitrary order, and with duplicates + removed.

Return Value¶

On failure, this call returns a negative errno-style error + code. If + $LISTEN_FDS/$LISTEN_PID was + not set or was not correctly set for this daemon and hence no file + descriptors were received, 0 is returned. Otherwise, the number of + file descriptors passed is returned. The application may find them + starting with file descriptor SD_LISTEN_FDS_START, i.e. file + descriptor 3.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, this function checks whether the - $LISTEN_PID environment variable - equals the daemon PID. If not, it returns - immediately. Otherwise, it parses the number passed in - the $LISTEN_FDS environment - variable, then sets the FD_CLOEXEC flag for the parsed - number of file descriptors starting from - SD_LISTEN_FDS_START. Finally, it returns the parsed - number.

Environment¶

$LISTEN_PID, $LISTEN_FDS¶

Set by the init system - for supervised processes that use - socket-based activation. This - environment variable specifies the - data - sd_listen_fds() - parses. See above for - details.

+ $LISTEN_PID environment variable equals the + daemon PID. If not, it returns immediately. Otherwise, it parses + the number passed in the $LISTEN_FDS + environment variable, then sets the FD_CLOEXEC flag for the parsed + number of file descriptors starting from SD_LISTEN_FDS_START. + Finally, it returns the parsed number.

Environment¶

$LISTEN_PID, $LISTEN_FDS¶

Set by the init system + for supervised processes that use + socket-based activation. This + environment variable specifies the + data + sd_listen_fds() + parses. See above for + details.

diff --git a/man/SD_NOTICE.html b/man/SD_NOTICE.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_NOTICE.html +++ b/man/SD_NOTICE.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/SD_WARNING.html b/man/SD_WARNING.html index e0aac38a6..4ad8c4176 100644 --- a/man/SD_WARNING.html +++ b/man/SD_WARNING.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/binfmt.d.5 b/man/binfmt.d.5 index 1c6bdd209..1f7bfcb97 100644 --- a/man/binfmt.d.5 +++ b/man/binfmt.d.5 @@ -1,5 +1,5 @@ '\" t -.TH "BINFMT\&.D" "5" "" "systemd 218" "binfmt.d" +.TH "BINFMT\&.D" "5" "" "systemd 219" "binfmt.d" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/binfmt.d.html b/man/binfmt.d.html index 54b905e9c..6a66102b3 100644 --- a/man/binfmt.d.html +++ b/man/binfmt.d.html @@ -19,17 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

binfmt.d — Configure additional binary formats for - executables at boot

Synopsis

/etc/binfmt.d/*.conf

/run/binfmt.d/*.conf

/usr/lib/binfmt.d/*.conf

Description¶

At boot, - systemd-binfmt.service(8) - reads configuration files from the above directories - to register in the kernel additional binary - formats for executables.

Configuration Format¶

Each file contains a list of binfmt_misc kernel - binary format rules. Consult binfmt_misc.txt - for more information on registration of additional - binary formats and how to write rules.

Empty lines and lines beginning with ; and # are - ignored. Note that this means you may not use ; and # - as delimiter in binary format rules.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

binfmt.d — Configure additional binary formats for + executables at boot

Synopsis

/etc/binfmt.d/*.conf

/run/binfmt.d/*.conf

/usr/lib/binfmt.d/*.conf

Description¶

At boot, + systemd-binfmt.service(8) + reads configuration files from the above directories to register + in the kernel additional binary formats for executables.

Configuration Format¶

Each file contains a list of binfmt_misc kernel binary + format rules. Consult binfmt_misc.txt + for more information on registration of additional binary formats + and how to write rules.

Empty lines and lines beginning with ; and # are ignored. + Note that this means you may not use ; and # as delimiter in + binary format rules.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -49,10 +48,10 @@ the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor - configuration file.

Example¶

Example 1. /etc/binfmt.d/wine.conf example:

# Start WINE on Windows executables
-:DOSWin:M::MZ::/usr/bin/wine:

+ configuration file.

Example¶

Example 1. /etc/binfmt.d/wine.conf example:

# Start WINE on Windows executables
+:DOSWin:M::MZ::/usr/bin/wine:

diff --git a/man/binfmt.d.xml b/man/binfmt.d.xml index 55a3df0b7..5b63cfb4c 100644 --- a/man/binfmt.d.xml +++ b/man/binfmt.d.xml @@ -20,83 +20,82 @@ along with systemd; If not, see . --> - - - binfmt.d - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - binfmt.d - 5 - - - - binfmt.d - Configure additional binary formats for - executables at boot - - - - /etc/binfmt.d/*.conf - /run/binfmt.d/*.conf - /usr/lib/binfmt.d/*.conf - - - - Description - - At boot, - systemd-binfmt.service8 - reads configuration files from the above directories - to register in the kernel additional binary - formats for executables. - - - - Configuration Format - - Each file contains a list of binfmt_misc kernel - binary format rules. Consult binfmt_misc.txt - for more information on registration of additional - binary formats and how to write rules. - - Empty lines and lines beginning with ; and # are - ignored. Note that this means you may not use ; and # - as delimiter in binary format rules. - - - - - - Example - - /etc/binfmt.d/wine.conf example: - - # Start WINE on Windows executables + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + binfmt.d + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + binfmt.d + 5 + + + + binfmt.d + Configure additional binary formats for + executables at boot + + + + /etc/binfmt.d/*.conf + /run/binfmt.d/*.conf + /usr/lib/binfmt.d/*.conf + + + + Description + + At boot, + systemd-binfmt.service8 + reads configuration files from the above directories to register + in the kernel additional binary formats for executables. + + + + Configuration Format + + Each file contains a list of binfmt_misc kernel binary + format rules. Consult binfmt_misc.txt + for more information on registration of additional binary formats + and how to write rules. + + Empty lines and lines beginning with ; and # are ignored. + Note that this means you may not use ; and # as delimiter in + binary format rules. + + + + + + Example + + /etc/binfmt.d/wine.conf example: + + # Start WINE on Windows executables :DOSWin:M::MZ::/usr/bin/wine: - - - - - See Also - - systemd1, - systemd-binfmt.service8, - systemd-delta1, - wine8 - - + + + + + See Also + + systemd1, + systemd-binfmt.service8, + systemd-delta1, + wine8 + + diff --git a/man/bootchart.conf.5 b/man/bootchart.conf.5 index 088be0afb..782667efa 100644 --- a/man/bootchart.conf.5 +++ b/man/bootchart.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "BOOTCHART\&.CONF" "5" "" "systemd 218" "bootchart.conf" +.TH "BOOTCHART\&.CONF" "5" "" "systemd 219" "bootchart.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -97,7 +97,7 @@ Configures the output directory for writing the graphs\&. By default, bootchart \fIInit=[path]\fR .RS 4 Configures bootchart to run a non\-standard binary instead of -/sbin/init\&. This option is only relevant if bootchart was invoked from the kernel command line with init=/usr/lib/systemd/systemd\-bootchart\&. +/usr/lib/systemd/systemd\&. This option is only relevant if bootchart was invoked from the kernel command line with init=/usr/lib/systemd/systemd\-bootchart\&. .RE .PP \fIPlotMemoryUsage=no\fR diff --git a/man/bootchart.conf.d.html b/man/bootchart.conf.d.html index 97a138e37..c9958c03b 100644 --- a/man/bootchart.conf.d.html +++ b/man/bootchart.conf.d.html @@ -19,12 +19,11 @@ Directives · Python · libudev · - gudev systemd 218

Name

bootchart.conf, bootchart.conf.d — Boot performance analysis graphing tool configuration files

Synopsis

/etc/systemd/bootchart.conf

/etc/systemd/bootchart.conf.d/*.conf

/run/systemd/bootchart.conf.d/*.conf

/usr/lib/systemd/bootchart.conf.d/*.conf

Description¶

When starting, systemd-bootchart will read the - configuration file - /etc/systemd/bootchart.conf, followed by - the files in the bootchart.conf.d - directories. These configuration files determine logging - parameters and graph output.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

bootchart.conf, bootchart.conf.d — Boot performance analysis graphing tool configuration files

Synopsis

/etc/systemd/bootchart.conf

/etc/systemd/bootchart.conf.d/*.conf

/run/systemd/bootchart.conf.d/*.conf

/usr/lib/systemd/bootchart.conf.d/*.conf

Description¶

When starting, systemd-bootchart will read the configuration + file /etc/systemd/bootchart.conf, followed by + the files in the bootchart.conf.d + directories. These configuration files determine logging + parameters and graph output.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -48,33 +47,35 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

Samples=500¶

Configure the amount of samples to - record in total before bootchart exits. Each sample will - record at intervals defined by Frequency=.

Frequency=25¶

Configure the sample log frequency. - This can be a fractional number, but must be larger than - 0.0. Most systems can cope with values under 25-50 without - impacting boot time severely.

Relative=no¶

Configures whether the left axis of the - output graph equals time=0.0 (CLOCK_MONOTONIC start). This - is useful for using bootchart at post-boot time to profile - an already booted system, otherwise the graph would become - extremely large. If set to yes, the horizontal axis starts - at the first recorded sample instead of time=0.0. -

Filter=no¶

Configures whether the resulting graph - should omit tasks that did not contribute significantly - to the boot. Processes that are too short-lived (only - seen in one sample) or that do not consume any significant - CPU time (less than 0.001sec) will not be displayed in - the output graph.

Output=[path]¶

Configures the output directory for writing - the graphs. By default, bootchart writes the graphs to - /run/log.

Init=[path]¶

Configures bootchart to run a non-standard - binary instead of /sbin/init. This - option is only relevant if bootchart was invoked from the - kernel command line with - init=/usr/lib/systemd/systemd-bootchart.

PlotMemoryUsage=no¶

If set to yes, enables logging and graphing - of processes' PSS memory consumption.

PlotEntropyGraph=no¶

If set to yes, enables logging and graphing - of the kernel random entropy pool size.

ScaleX=100¶

Horizontal scaling factor for all variable - graph components.

ScaleY=20¶

Vertical scaling factor for all variable - graph components.

ControlGroup=no¶

Display process control group.

+ file.

Options¶

Samples=500¶

Configure the amount of samples to record in + total before bootchart exits. Each sample will record at + intervals defined by Frequency=.

Frequency=25¶

Configure the sample log frequency. This can + be a fractional number, but must be larger than 0.0. Most + systems can cope with values under 25-50 without impacting + boot time severely.

Relative=no¶

Configures whether the left axis of the output + graph equals time=0.0 (CLOCK_MONOTONIC + start). This is useful for using bootchart at post-boot time + to profile an already booted system, otherwise the graph would + become extremely large. If set to yes, the horizontal axis + starts at the first recorded sample instead of time=0.0. +

Filter=no¶

Configures whether the resulting graph should + omit tasks that did not contribute significantly to the boot. + Processes that are too short-lived (only seen in one sample) + or that do not consume any significant CPU time (less than + 0.001sec) will not be displayed in the output + graph.

Output=[path]¶

Configures the output directory for writing + the graphs. By default, bootchart writes the graphs to + /run/log.

Init=[path]¶

Configures bootchart to run a non-standard + binary instead of + /usr/lib/systemd/systemd. This option is + only relevant if bootchart was invoked from the kernel command + line with + init=/usr/lib/systemd/systemd-bootchart.

PlotMemoryUsage=no¶

If set to yes, enables logging and graphing of + processes' PSS memory consumption.

PlotEntropyGraph=no¶

If set to yes, enables logging and graphing of + the kernel random entropy pool size.

ScaleX=100¶

Horizontal scaling factor for all variable + graph components.

ScaleY=20¶

Vertical scaling factor for all variable graph + components.

ControlGroup=no¶

Display process control group. +

diff --git a/man/bootchart.conf.html b/man/bootchart.conf.html index 97a138e37..c9958c03b 100644 --- a/man/bootchart.conf.html +++ b/man/bootchart.conf.html @@ -19,12 +19,11 @@ Directives · Python · libudev · - gudev systemd 218

Name

bootchart.conf, bootchart.conf.d — Boot performance analysis graphing tool configuration files

Synopsis

/etc/systemd/bootchart.conf

/etc/systemd/bootchart.conf.d/*.conf

/run/systemd/bootchart.conf.d/*.conf

/usr/lib/systemd/bootchart.conf.d/*.conf

Description¶

When starting, systemd-bootchart will read the - configuration file - /etc/systemd/bootchart.conf, followed by - the files in the bootchart.conf.d - directories. These configuration files determine logging - parameters and graph output.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

bootchart.conf, bootchart.conf.d — Boot performance analysis graphing tool configuration files

Synopsis

/etc/systemd/bootchart.conf

/etc/systemd/bootchart.conf.d/*.conf

/run/systemd/bootchart.conf.d/*.conf

/usr/lib/systemd/bootchart.conf.d/*.conf

Description¶

When starting, systemd-bootchart will read the configuration + file /etc/systemd/bootchart.conf, followed by + the files in the bootchart.conf.d + directories. These configuration files determine logging + parameters and graph output.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -48,33 +47,35 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

Samples=500¶

Configure the amount of samples to - record in total before bootchart exits. Each sample will - record at intervals defined by Frequency=.

Frequency=25¶

Configure the sample log frequency. - This can be a fractional number, but must be larger than - 0.0. Most systems can cope with values under 25-50 without - impacting boot time severely.

Relative=no¶

Configures whether the left axis of the - output graph equals time=0.0 (CLOCK_MONOTONIC start). This - is useful for using bootchart at post-boot time to profile - an already booted system, otherwise the graph would become - extremely large. If set to yes, the horizontal axis starts - at the first recorded sample instead of time=0.0. -

Filter=no¶

Configures whether the resulting graph - should omit tasks that did not contribute significantly - to the boot. Processes that are too short-lived (only - seen in one sample) or that do not consume any significant - CPU time (less than 0.001sec) will not be displayed in - the output graph.

Output=[path]¶

Configures the output directory for writing - the graphs. By default, bootchart writes the graphs to - /run/log.

Init=[path]¶

Configures bootchart to run a non-standard - binary instead of /sbin/init. This - option is only relevant if bootchart was invoked from the - kernel command line with - init=/usr/lib/systemd/systemd-bootchart.

PlotMemoryUsage=no¶

If set to yes, enables logging and graphing - of processes' PSS memory consumption.

PlotEntropyGraph=no¶

If set to yes, enables logging and graphing - of the kernel random entropy pool size.

ScaleX=100¶

Horizontal scaling factor for all variable - graph components.

ScaleY=20¶

Vertical scaling factor for all variable - graph components.

ControlGroup=no¶

Display process control group.

+ file.

Options¶

Samples=500¶

Configure the amount of samples to record in + total before bootchart exits. Each sample will record at + intervals defined by Frequency=.

Frequency=25¶

Configure the sample log frequency. This can + be a fractional number, but must be larger than 0.0. Most + systems can cope with values under 25-50 without impacting + boot time severely.

Relative=no¶

Configures whether the left axis of the output + graph equals time=0.0 (CLOCK_MONOTONIC + start). This is useful for using bootchart at post-boot time + to profile an already booted system, otherwise the graph would + become extremely large. If set to yes, the horizontal axis + starts at the first recorded sample instead of time=0.0. +

Filter=no¶

Configures whether the resulting graph should + omit tasks that did not contribute significantly to the boot. + Processes that are too short-lived (only seen in one sample) + or that do not consume any significant CPU time (less than + 0.001sec) will not be displayed in the output + graph.

Output=[path]¶

Configures the output directory for writing + the graphs. By default, bootchart writes the graphs to + /run/log.

Init=[path]¶

Configures bootchart to run a non-standard + binary instead of + /usr/lib/systemd/systemd. This option is + only relevant if bootchart was invoked from the kernel command + line with + init=/usr/lib/systemd/systemd-bootchart.

PlotMemoryUsage=no¶

If set to yes, enables logging and graphing of + processes' PSS memory consumption.

PlotEntropyGraph=no¶

If set to yes, enables logging and graphing of + the kernel random entropy pool size.

ScaleX=100¶

Horizontal scaling factor for all variable + graph components.

ScaleY=20¶

Vertical scaling factor for all variable graph + components.

ControlGroup=no¶

Display process control group. +

diff --git a/man/bootchart.conf.xml b/man/bootchart.conf.xml index a364826bb..8d9700d30 100644 --- a/man/bootchart.conf.xml +++ b/man/bootchart.conf.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - bootchart.conf - systemd - - - - Developer - Auke - Kok - auke-jan.h.kok@intel.com - - - - - - bootchart.conf - 5 - - - - bootchart.conf - bootchart.conf.d - Boot performance analysis graphing tool configuration files - - - - /etc/systemd/bootchart.conf - /etc/systemd/bootchart.conf.d/*.conf - /run/systemd/bootchart.conf.d/*.conf - /usr/lib/systemd/bootchart.conf.d/*.conf - - - - Description - - When starting, systemd-bootchart will read the - configuration file - /etc/systemd/bootchart.conf, followed by - the files in the bootchart.conf.d - directories. These configuration files determine logging - parameters and graph output. - - - - - - - Options - - - - - Samples=500 - Configure the amount of samples to - record in total before bootchart exits. Each sample will - record at intervals defined by Frequency=. - - - - Frequency=25 - Configure the sample log frequency. - This can be a fractional number, but must be larger than - 0.0. Most systems can cope with values under 25-50 without - impacting boot time severely. - - - - Relative=no - Configures whether the left axis of the - output graph equals time=0.0 (CLOCK_MONOTONIC start). This - is useful for using bootchart at post-boot time to profile - an already booted system, otherwise the graph would become - extremely large. If set to yes, the horizontal axis starts - at the first recorded sample instead of time=0.0. - - - - - Filter=no - Configures whether the resulting graph - should omit tasks that did not contribute significantly - to the boot. Processes that are too short-lived (only - seen in one sample) or that do not consume any significant - CPU time (less than 0.001sec) will not be displayed in - the output graph. - - - - Output=[path] - Configures the output directory for writing - the graphs. By default, bootchart writes the graphs to - /run/log. - - - - Init=[path] - Configures bootchart to run a non-standard - binary instead of /sbin/init. This - option is only relevant if bootchart was invoked from the - kernel command line with - init=/usr/lib/systemd/systemd-bootchart. - - - - PlotMemoryUsage=no - If set to yes, enables logging and graphing - of processes' PSS memory consumption. - - - - PlotEntropyGraph=no - If set to yes, enables logging and graphing - of the kernel random entropy pool size. - - - - ScaleX=100 - Horizontal scaling factor for all variable - graph components. - - - - ScaleY=20 - Vertical scaling factor for all variable - graph components. - - - - ControlGroup=no - Display process control group. - - - - - - - See Also - - systemd-bootchart1, - systemd.directives7 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + bootchart.conf + systemd + + + + Developer + Auke + Kok + auke-jan.h.kok@intel.com + + + + + + bootchart.conf + 5 + + + + bootchart.conf + bootchart.conf.d + Boot performance analysis graphing tool configuration files + + + + /etc/systemd/bootchart.conf + /etc/systemd/bootchart.conf.d/*.conf + /run/systemd/bootchart.conf.d/*.conf + /usr/lib/systemd/bootchart.conf.d/*.conf + + + + Description + + When starting, systemd-bootchart will read the configuration + file /etc/systemd/bootchart.conf, followed by + the files in the bootchart.conf.d + directories. These configuration files determine logging + parameters and graph output. + + + + + + + Options + + + + + Samples=500 + Configure the amount of samples to record in + total before bootchart exits. Each sample will record at + intervals defined by Frequency=. + + + + Frequency=25 + Configure the sample log frequency. This can + be a fractional number, but must be larger than 0.0. Most + systems can cope with values under 25-50 without impacting + boot time severely. + + + + Relative=no + Configures whether the left axis of the output + graph equals time=0.0 (CLOCK_MONOTONIC + start). This is useful for using bootchart at post-boot time + to profile an already booted system, otherwise the graph would + become extremely large. If set to yes, the horizontal axis + starts at the first recorded sample instead of time=0.0. + + + + + Filter=no + Configures whether the resulting graph should + omit tasks that did not contribute significantly to the boot. + Processes that are too short-lived (only seen in one sample) + or that do not consume any significant CPU time (less than + 0.001sec) will not be displayed in the output + graph. + + + + Output=[path] + Configures the output directory for writing + the graphs. By default, bootchart writes the graphs to + /run/log. + + + + Init=[path] + Configures bootchart to run a non-standard + binary instead of + /usr/lib/systemd/systemd. This option is + only relevant if bootchart was invoked from the kernel command + line with + init=/usr/lib/systemd/systemd-bootchart. + + + + PlotMemoryUsage=no + If set to yes, enables logging and graphing of + processes' PSS memory consumption. + + + + PlotEntropyGraph=no + If set to yes, enables logging and graphing of + the kernel random entropy pool size. + + + + ScaleX=100 + Horizontal scaling factor for all variable + graph components. + + + + ScaleY=20 + Vertical scaling factor for all variable graph + components. + + + + ControlGroup=no + Display process control group. + + + + + + + + See Also + + systemd-bootchart1, + systemd.directives7 + + diff --git a/man/bootctl.1 b/man/bootctl.1 index 799942bd6..19776c9bf 100644 --- a/man/bootctl.1 +++ b/man/bootctl.1 @@ -1,5 +1,5 @@ '\" t -.TH "BOOTCTL" "1" "" "systemd 218" "bootctl" +.TH "BOOTCTL" "1" "" "systemd 219" "bootctl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/bootctl.html b/man/bootctl.html index c8cd8adc6..d2fa7d2de 100644 --- a/man/bootctl.html +++ b/man/bootctl.html @@ -19,19 +19,17 @@ Directives · Python · libudev · - gudev systemd 218

Name

bootctl — Control the firmware and boot manager settings

Synopsis

bootctl [OPTIONS...] {COMMAND}

Description¶

bootctl may be used to - query or (in the future) change the firmware and boot - manager settings.

Firmware information is available only on EFI - systems.

Currently, only the gummiboot(8) boot - manager implements the required boot loader interface - to provide complete boot manager information.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

The following commands are understood:

status¶

Show firmware and boot - manager information about the system, - including secure boot mode status and - selected firmware entry (where - available).

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

bootctl — Control the firmware and boot manager settings

Synopsis

bootctl [OPTIONS...] {COMMAND}

Description¶

bootctl may be used to query or (in the + future) change the firmware and boot manager settings.

Firmware information is available only on EFI systems. +

Currently, only the + gummiboot(8) + boot manager implements the required boot loader interface to + provide complete boot manager information.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

The following commands are understood:

status¶

Show firmware and boot manager information + about the system, including secure boot mode status and + selected firmware entry (where available).

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/bootctl.xml b/man/bootctl.xml index 52540221e..00f54c73f 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - bootctl - systemd - - - - Developer - Kay - Sievers - kay@vrfy.org - - - - - - bootctl - 1 - - - - bootctl - Control the firmware and boot manager settings - - - - - bootctl - OPTIONS - COMMAND - - - - - Description - - bootctl may be used to - query or (in the future) change the firmware and boot - manager settings. - - Firmware information is available only on EFI - systems. - - Currently, only the gummiboot8 boot - manager implements the required boot loader interface - to provide complete boot manager information. - - - - Options - - The following options are understood: - - - - - - - The following commands are understood: - - - - status - - Show firmware and boot - manager information about the system, - including secure boot mode status and - selected firmware entry (where - available). - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - Boot loader interface, - Boot loader specification, - gummiboot - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + bootctl + systemd + + + + Developer + Kay + Sievers + kay@vrfy.org + + + + + + bootctl + 1 + + + + bootctl + Control the firmware and boot manager settings + + + + + bootctl + OPTIONS + COMMAND + + + + + Description + + bootctl may be used to query or (in the + future) change the firmware and boot manager settings. + + Firmware information is available only on EFI systems. + + + Currently, only the + gummiboot8 + boot manager implements the required boot loader interface to + provide complete boot manager information. + + + + Options + + The following options are understood: + + + + + + + The following commands are understood: + + + + status + + Show firmware and boot manager information + about the system, including secure boot mode status and + selected firmware entry (where available). + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + Boot loader interface, + Boot loader specification, + gummiboot + + diff --git a/man/bootup.7 b/man/bootup.7 index 57269ca30..cc63c2c4a 100644 --- a/man/bootup.7 +++ b/man/bootup.7 @@ -1,5 +1,5 @@ '\" t -.TH "BOOTUP" "7" "" "systemd 218" "bootup" +.TH "BOOTUP" "7" "" "systemd 219" "bootup" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/bootup.html b/man/bootup.html index 0caf9e7e1..a90cc2bfd 100644 --- a/man/bootup.html +++ b/man/bootup.html @@ -19,62 +19,51 @@ Directives · Python · libudev · - gudev systemd 218

Name

bootup — System bootup process

Description¶

A number of different components are involved in - the system boot. Immediately after power-up, the - system BIOS will do minimal hardware initialization, - and hand control over to a boot loader stored on a - persistent storage device. This boot loader will then - invoke an OS kernel from disk (or the network). In the - Linux case, this kernel (optionally) extracts and - executes an initial RAM disk image (initrd), such as - generated by - dracut(8), - which looks for the root file system (possibly using - systemd(1) - for this). After the root file system is found and - mounted, the initrd hands over control to the host's - system manager (such as - systemd(1)) - stored on the OS image, which is then responsible for - probing all remaining hardware, mounting all necessary - file systems and spawning all configured - services.

On shutdown, the system manager stops all - services, unmounts all file systems (detaching the - storage technologies backing them), and then - (optionally) jumps back into the initrd code which - unmounts/detaches the root file system and the storage - it resides on. As a last step, the system is powered down.

Additional information about the system boot - process may be found in - boot(7).

System Manager Bootup¶

At boot, the system manager on the OS image is - responsible for initializing the required file - systems, services and drivers that are necessary for - operation of the system. On - systemd(1) - systems, this process is split up in various discrete - steps which are exposed as target units. (See - systemd.target(5) - for detailed information about target units.) The - boot-up process is highly parallelized so that the - order in which specific target units are reached is not - deterministic, but still adheres to a limited amount - of ordering structure.

When systemd starts up the system, it will - activate all units that are dependencies of - default.target (as well as - recursively all dependencies of these - dependencies). Usually, - default.target is simply an alias - of graphical.target or - multi-user.target, depending on - whether the system is configured for a graphical UI or - only for a text console. To enforce minimal ordering - between the units pulled in, a number of well-known - target units are available, as listed on - systemd.special(7).

The following chart is a structural overview of - these well-known units and their position in the - boot-up logic. The arrows describe which units are - pulled in and ordered before which other units. Units - near the top are started before units nearer to the - bottom of the chart.

local-fs-pre.target
+  gudev systemd 219

Name

bootup — System bootup process

Description¶

A number of different components are involved in the system + boot. Immediately after power-up, the system BIOS will do minimal + hardware initialization, and hand control over to a boot loader + stored on a persistent storage device. This boot loader will then + invoke an OS kernel from disk (or the network). In the Linux case, + this kernel (optionally) extracts and executes an initial RAM disk + image (initrd), such as generated by + dracut(8), + which looks for the root file system (possibly using + systemd(1) + for this). After the root file system is found and mounted, the + initrd hands over control to the host's system manager (such as + systemd(1)) + stored on the OS image, which is then responsible for probing all + remaining hardware, mounting all necessary file systems and + spawning all configured services.

On shutdown, the system manager stops all services, unmounts + all file systems (detaching the storage technologies backing + them), and then (optionally) jumps back into the initrd code which + unmounts/detaches the root file system and the storage it resides + on. As a last step, the system is powered down.

Additional information about the system boot process may be + found in + boot(7).

System Manager Bootup¶

At boot, the system manager on the OS image is responsible + for initializing the required file systems, services and drivers + that are necessary for operation of the system. On + systemd(1) + systems, this process is split up in various discrete steps which + are exposed as target units. (See + systemd.target(5) + for detailed information about target units.) The boot-up process + is highly parallelized so that the order in which specific target + units are reached is not deterministic, but still adheres to a + limited amount of ordering structure.

When systemd starts up the system, it will activate all + units that are dependencies of default.target + (as well as recursively all dependencies of these dependencies). + Usually, default.target is simply an alias of + graphical.target or + multi-user.target, depending on whether the + system is configured for a graphical UI or only for a text + console. To enforce minimal ordering between the units pulled in, + a number of well-known target units are available, as listed on + systemd.special(7).

The following chart is a structural overview of these + well-known units and their position in the boot-up logic. The + arrows describe which units are pulled in and ordered before which + other units. Units near the top are started before units nearer to + the bottom of the chart.

local-fs-pre.target
          |
          v
 (various mounts and   (various swap   (various cryptsetup
@@ -116,47 +105,39 @@
          \_________________ | _________________/
                            \|/
                             v
-                  graphical.target

Target units that are commonly used as boot - targets are emphasized. These - units are good choices as goal targets, for - example by passing them to the - systemd.unit= kernel command line - option (see - systemd(1)) - or by symlinking default.target - to them.

timers.target is pulled-in - by basic.target asynchronously. - This allows timers units to depend on services which - become only available later in boot.

Bootup in the Initial RAM Disk (initrd)¶

The initial RAM disk implementation (initrd) can - be set up using systemd as well. In this case, boot up - inside the initrd follows the following - structure.

The default target in the initrd is - initrd.target. The bootup process - begins identical to the system manager bootup (see - above) until it reaches - basic.target. From there, systemd - approaches the special target - initrd.target. If the root device - can be mounted at /sysroot, the - sysroot.mount unit becomes active - and initrd-root-fs.target is - reached. The service - initrd-parse-etc.service scans - /sysroot/etc/fstab for a possible - /usr mount point and additional - entries marked with the - x-initrd.mount option. All - entries found are mounted below - /sysroot, and - initrd-fs.target is reached. The - service initrd-cleanup.service - isolates to the - initrd-switch-root.target, where - cleanup services can run. As the very last step, the - initrd-switch-root.service is - activated, which will cause the system to switch its - root to /sysroot. -

                                               : (beginning identical to above)
+                  graphical.target

Target units that are commonly used as boot targets are + emphasized. These units are good choices as + goal targets, for example by passing them to the + systemd.unit= kernel command line option (see + systemd(1)) + or by symlinking default.target to them. +

timers.target is pulled-in by + basic.target asynchronously. This allows + timers units to depend on services which become only available + later in boot.

Bootup in the Initial RAM Disk (initrd)¶

The initial RAM disk implementation (initrd) can be set up + using systemd as well. In this case, boot up inside the initrd + follows the following structure.

The default target in the initrd is + initrd.target. The bootup process begins + identical to the system manager bootup (see above) until it + reaches basic.target. From there, systemd + approaches the special target initrd.target. + If the root device can be mounted at + /sysroot, the + sysroot.mount unit becomes active and + initrd-root-fs.target is reached. The service + initrd-parse-etc.service scans + /sysroot/etc/fstab for a possible + /usr mount point and additional entries + marked with the x-initrd.mount option. All + entries found are mounted below /sysroot, and + initrd-fs.target is reached. The service + initrd-cleanup.service isolates to the + initrd-switch-root.target, where cleanup + services can run. As the very last step, the + initrd-switch-root.service is activated, + which will cause the system to switch its root to + /sysroot. +

                                               : (beginning identical to above)
                                                :
                                                v
                                          basic.target
@@ -205,9 +186,8 @@
                                    initrd-switch-root.service
                                                |
                                                v
-                                     Transition to Host OS

System Manager Shutdown¶

System shutdown with systemd also consists of - various target units with some minimal ordering - structure applied:

                                  (conflicts with  (conflicts with
+                                     Transition to Host OS

System Manager Shutdown¶

System shutdown with systemd also consists of various target + units with some minimal ordering structure applied:

                                  (conflicts with  (conflicts with
                                     all system     all file system
                                      services)     mounts, swaps,
                                          |           cryptsetup
@@ -232,10 +212,11 @@
 systemd-reboot.service   systemd-poweroff.service   systemd-halt.service   systemd-kexec.service
            |                         |                        |                      |
            v                         v                        v                      v
-    reboot.target             poweroff.target            halt.target           kexec.target

Commonly used system shutdown targets are emphasized.

+ reboot.target poweroff.target halt.target kexec.target

Commonly used system shutdown targets are + emphasized.

diff --git a/man/bootup.xml b/man/bootup.xml index 0854b6c31..d97d55023 100644 --- a/man/bootup.xml +++ b/man/bootup.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> . - - - - - Do not print the legend, - i.e. the column headers and the - footer. - - - @@ -251,9 +241,10 @@ along with systemd; If not, see . + + - @@ -313,11 +304,13 @@ along with systemd; If not, see . - introspect SERVICE OBJECT + introspect SERVICE OBJECT INTERFACE Show interfaces, methods, properties and signals of the specified object (identified by its path) on - the specified service. + the specified service. If the interface argument is passed the + output is limited to members of the specified + interface. diff --git a/man/coredump.conf.5 b/man/coredump.conf.5 index 732a6352f..48daf315b 100644 --- a/man/coredump.conf.5 +++ b/man/coredump.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "COREDUMP\&.CONF" "5" "" "systemd 218" "coredump.conf" +.TH "COREDUMP\&.CONF" "5" "" "systemd 219" "coredump.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/coredump.conf.d.html b/man/coredump.conf.d.html index b28a42fb6..9a6821bd9 100644 --- a/man/coredump.conf.d.html +++ b/man/coredump.conf.d.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

coredump.conf, coredump.conf.d — Coredump storage configuration files

Synopsis

/etc/systemd/coredump.conf

/etc/systemd/coredump.conf.d/*.conf

/run/systemd/coredump.conf.d/*.conf

/usr/lib/systemd/coredump.conf.d/*.conf

Description¶

These files configure the behaviour of + gudev systemd 219


Name

coredump.conf, coredump.conf.d — Coredump storage configuration files

Synopsis

/etc/systemd/coredump.conf

/etc/systemd/coredump.conf.d/*.conf

/run/systemd/coredump.conf.d/*.conf

/usr/lib/systemd/coredump.conf.d/*.conf

Description¶

These files configure the behaviour of systemd-coredump(8), a handler for core dumps invoked by the kernel.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and @@ -45,7 +45,7 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the + file.

Options¶

All options are configured in the "[Coredump]" section:

Storage=¶

Controls where to store cores. One of "none", "external", "journal", and "both". When @@ -75,7 +75,7 @@ by coredumps might temporarily exceed these limits while coredumps are processed. Note that old coredumps are also removed based on time via - systemd-tmpfiles(8).

See Also¶

systemd-journald.service(8), coredumpctl(1), systemd-tmpfiles(8) diff --git a/man/coredump.conf.html b/man/coredump.conf.html index b28a42fb6..9a6821bd9 100644 --- a/man/coredump.conf.html +++ b/man/coredump.conf.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

coredump.conf, coredump.conf.d — Coredump storage configuration files

Synopsis

/etc/systemd/coredump.conf

/etc/systemd/coredump.conf.d/*.conf

/run/systemd/coredump.conf.d/*.conf

/usr/lib/systemd/coredump.conf.d/*.conf

Description¶

These files configure the behaviour of + gudev systemd 219


Name

coredump.conf, coredump.conf.d — Coredump storage configuration files

Synopsis

/etc/systemd/coredump.conf

/etc/systemd/coredump.conf.d/*.conf

/run/systemd/coredump.conf.d/*.conf

/usr/lib/systemd/coredump.conf.d/*.conf

Description¶

These files configure the behaviour of systemd-coredump(8), a handler for core dumps invoked by the kernel.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and @@ -45,7 +45,7 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the + file.

Options¶

All options are configured in the "[Coredump]" section:

Storage=¶

Controls where to store cores. One of "none", "external", "journal", and "both". When @@ -75,7 +75,7 @@ by coredumps might temporarily exceed these limits while coredumps are processed. Note that old coredumps are also removed based on time via - systemd-tmpfiles(8).

See Also¶

systemd-journald.service(8), coredumpctl(1), systemd-tmpfiles(8) diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml index 704646096..3d325e6ad 100644 --- a/man/coredump.conf.xml +++ b/man/coredump.conf.xml @@ -1,5 +1,4 @@ - diff --git a/man/coredumpctl.1 b/man/coredumpctl.1 index d6b67fca2..8a82e7fd2 100644 --- a/man/coredumpctl.1 +++ b/man/coredumpctl.1 @@ -1,5 +1,5 @@ '\" t -.TH "COREDUMPCTL" "1" "" "systemd 218" "coredumpctl" +.TH "COREDUMPCTL" "1" "" "systemd 219" "coredumpctl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,7 +35,7 @@ The following options are understood: .PP \fB\-\-no\-legend\fR .RS 4 -Do not print the column headers\&. +Do not print column headers\&. .RE .PP \fB\-1\fR @@ -158,7 +158,7 @@ On success, 0 is returned; otherwise, a non\-zero failure code is returned\&. No .RE .\} .PP -\fBExample\ \&4.\ \&Extract the last coredump of /usr/bin/bar to a file named bar.coredump\fR +\fBExample\ \&4.\ \&Extract the last coredump of /usr/bin/bar to a file named bar\&.coredump\fR .sp .if n \{\ .RS 4 diff --git a/man/coredumpctl.html b/man/coredumpctl.html index 1e66b03eb..3c24ef732 100644 --- a/man/coredumpctl.html +++ b/man/coredumpctl.html @@ -19,48 +19,37 @@ Directives · Python · libudev · - gudev systemd 218


Name

coredumpctl — Retrieve coredumps from the journal

Synopsis

coredumpctl [OPTIONS...] {COMMAND} [PID|COMM|EXE|MATCH...]

Description¶

coredumpctl may be used to - retrieve coredumps from - systemd-journald(8).

Options¶

The following options are understood:

--no-legend¶

Do not print the column headers. -

-1¶

Show information of a - single coredump only, instead of - listing all known coredumps. -

-F, --field=¶

Print all possible - data values the specified field - takes in matching coredump entries of the - journal.

-o, --output=FILE¶

Write the core to - FILE.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

list¶

List coredumps - captured in the journal matching - specified characteristics. If no - command is specified, this is the - implied default.

info¶

Show detailed - information about coredumps captured - in the journal.

dump¶

Extract the last coredump - matching specified characteristics. - The coredump will be written on standard output, - unless an output file is specified with - -o/--output. -

gdb¶

Invoke the GNU - debugger on the last coredump matching - specified characteristics. -

Matching¶

A match can be:

PID¶

Process ID of the - process that dumped - core. An integer.

COMM¶

Name of the executable - (matches COREDUMP_COMM=). - Must not contain slashes. -

EXE¶

Path to the executable - (matches COREDUMP_EXE=). - Must contain at least one slash. -

MATCH¶

General journalctl predicates - (see journalctl(1)). - Must contain an equal sign. -

Exit status¶

On success, 0 is returned; otherwise, a non-zero failure - code is returned. Not finding any matching coredumps is treated - as failure. -

Examples¶

Example 1. List all the coredumps of a program named foo

# coredumpctl list foo

Example 2. Invoke gdb on the last coredump

# coredumpctl gdb

Example 3. Show information about a process that dumped core, matching by its PID 6654

# coredumpctl info 6654

Example 4. Extract the last coredump of /usr/bin/bar to a file named bar.coredump

# coredumpctl -o bar.coredump dump /usr/bin/bar

+ gudev systemd 219

Name

coredumpctl — Retrieve coredumps from the journal

Synopsis

coredumpctl [OPTIONS...] {COMMAND} [PID|COMM|EXE|MATCH...]

Description¶

coredumpctl may be used to + retrieve coredumps from + systemd-journald(8).

Options¶

The following options are understood:

--no-legend¶

Do not print column headers. +

-1¶

Show information of a single coredump only, + instead of listing all known coredumps.

-F, --field=¶

Print all possible data values the specified + field takes in matching coredump entries of the + journal.

-o, --output=FILE¶

Write the core to FILE. +

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

list¶

List coredumps captured in the journal + matching specified characteristics. If no command is + specified, this is the implied default.

info¶

Show detailed information about coredumps + captured in the journal.

dump¶

Extract the last coredump matching specified + characteristics. The coredump will be written on standard + output, unless an output file is specified with + -o/--output.

gdb¶

Invoke the GNU debugger on the last coredump + matching specified characteristics.

Matching¶

A match can be:

PID¶

Process ID of the + process that dumped + core. An integer.

COMM¶

Name of the executable (matches + COREDUMP_COMM=). Must not contain slashes. +

EXE¶

Path to the executable (matches + COREDUMP_EXE=). Must contain at least one + slash.

MATCH¶

General journalctl predicates (see + journalctl(1)). + Must contain an equal sign.

Exit status¶

On success, 0 is returned; otherwise, a non-zero failure + code is returned. Not finding any matching coredumps is treated as + failure. +

Examples¶

Example 1. List all the coredumps of a program named foo

# coredumpctl list foo

Example 2. Invoke gdb on the last coredump

# coredumpctl gdb

Example 3. Show information about a process that dumped core, + matching by its PID 6654

# coredumpctl info 6654

Example 4. Extract the last coredump of /usr/bin/bar to a file named + bar.coredump

# coredumpctl -o bar.coredump dump /usr/bin/bar

diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml index ed84621d3..efbc655a7 100644 --- a/man/coredumpctl.xml +++ b/man/coredumpctl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - coredumpctl - systemd - - - - Developer - Zbigniew - Jędrzejewski-Szmek - zbyszek@in.waw.pl - - - - - - coredumpctl - 1 - - - - coredumpctl - Retrieve coredumps from the journal - - - - - coredumpctl - OPTIONS - COMMAND - PID|COMM|EXE|MATCH - - - - - Description - - coredumpctl may be used to - retrieve coredumps from - systemd-journald8. - - - - Options - - The following options are understood: - - - - - - Do not print the column headers. - - - - - - - Show information of a - single coredump only, instead of - listing all known coredumps. - - - - - - - - Print all possible - data values the specified field - takes in matching coredump entries of the - journal. - - - - - - - Write the core to - . - - - - - - - - - The following commands are understood: - - - - list - - List coredumps - captured in the journal matching - specified characteristics. If no - command is specified, this is the - implied default. - - - - info - - Show detailed - information about coredumps captured - in the journal. - - - - dump - - Extract the last coredump - matching specified characteristics. - The coredump will be written on standard output, - unless an output file is specified with - . - - - - - gdb - - Invoke the GNU - debugger on the last coredump matching - specified characteristics. - - - - - - - - - Matching - - A match can be: - - - - PID - - Process ID of the - process that dumped - core. An integer. - - - - COMM - - Name of the executable - (matches ). - Must not contain slashes. - - - - - EXE - - Path to the executable - (matches ). - Must contain at least one slash. - - - - - MATCH - - General journalctl predicates - (see journalctl1). - Must contain an equal sign. - - - - - - - Exit status - On success, 0 is returned; otherwise, a non-zero failure - code is returned. Not finding any matching coredumps is treated - as failure. - - - - - Examples - - - List all the coredumps of a program named foo - - # coredumpctl list foo - - - - Invoke gdb on the last coredump - - # coredumpctl gdb - - - - Show information about a process that dumped core, matching by its PID 6654 - - # coredumpctl info 6654 - - - - Extract the last coredump of /usr/bin/bar to a file named bar.coredump - - # coredumpctl -o bar.coredump dump /usr/bin/bar - - - - - See Also - - systemd-coredump8, - coredump.conf5, - systemd-journald.service8, - gdb1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + coredumpctl + systemd + + + + Developer + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + coredumpctl + 1 + + + + coredumpctl + Retrieve coredumps from the journal + + + + + coredumpctl + OPTIONS + COMMAND + PID|COMM|EXE|MATCH + + + + + Description + + coredumpctl may be used to + retrieve coredumps from + systemd-journald8. + + + + Options + + The following options are understood: + + + + + + Do not print column headers. + + + + + + + Show information of a single coredump only, + instead of listing all known coredumps. + + + + + + + Print all possible data values the specified + field takes in matching coredump entries of the + journal. + + + + + + + Write the core to . + + + + + + + + + + The following commands are understood: + + + + list + + List coredumps captured in the journal + matching specified characteristics. If no command is + specified, this is the implied default. + + + + info + + Show detailed information about coredumps + captured in the journal. + + + + dump + + Extract the last coredump matching specified + characteristics. The coredump will be written on standard + output, unless an output file is specified with + . + + + + gdb + + Invoke the GNU debugger on the last coredump + matching specified characteristics. + + + + + + + + Matching + + A match can be: + + + + PID + + Process ID of the + process that dumped + core. An integer. + + + + COMM + + Name of the executable (matches + ). Must not contain slashes. + + + + + EXE + + Path to the executable (matches + ). Must contain at least one + slash. + + + + MATCH + + General journalctl predicates (see + journalctl1). + Must contain an equal sign. + + + + + + Exit status + On success, 0 is returned; otherwise, a non-zero failure + code is returned. Not finding any matching coredumps is treated as + failure. + + + + + Examples + + + List all the coredumps of a program named foo + + # coredumpctl list foo + + + + Invoke gdb on the last coredump + + # coredumpctl gdb + + + + Show information about a process that dumped core, + matching by its PID 6654 + + # coredumpctl info 6654 + + + + Extract the last coredump of /usr/bin/bar to a file named + <filename noindex="true">bar.coredump</filename> + + # coredumpctl -o bar.coredump dump /usr/bin/bar + + + + + See Also + + systemd-coredump8, + coredump.conf5, + systemd-journald.service8, + gdb1 + + diff --git a/man/crypttab.5 b/man/crypttab.5 index 4d94a2bf1..657c37bb6 100644 --- a/man/crypttab.5 +++ b/man/crypttab.5 @@ -1,5 +1,5 @@ '\" t -.TH "CRYPTTAB" "5" "" "systemd 218" "crypttab" +.TH "CRYPTTAB" "5" "" "systemd 219" "crypttab" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -78,6 +78,13 @@ Specifies the hash to use for password hashing\&. See for possible values and the default value of this option\&. .RE .PP +\fBheader=\fR +.RS 4 +Use a detached (separated) metadata device or file where the LUKS header is stored\&. This option is only relevant for LUKS devices\&. See +\fBcryptsetup\fR(8) +for possible values and the default value of this option\&. +.RE +.PP \fBkeyfile\-offset=\fR .RS 4 Specifies the number of bytes to skip at the start of the key file\&. See @@ -198,7 +205,7 @@ Specifies the timeout for querying for a password\&. If no unit is specified, se .PP \fBx\-systemd\&.device\-timeout=\fR .RS 4 -Specifies how long systemd should wait for a device to show up before giving up on the entry\&. The argument is a time in seconds or explicitly specifified units of +Specifies how long systemd should wait for a device to show up before giving up on the entry\&. The argument is a time in seconds or explicitly specified units of "s", "min", "h", @@ -240,9 +247,9 @@ Set up four encrypted block devices\&. One using LUKS for normal storage, anothe .\} .nf luks UUID=2505567a\-9e27\-4efe\-a4d5\-15ad146c258b -swap /dev/sda7 /dev/urandom swap +swap /dev/sda7 /dev/urandom swap truecrypt /dev/sda2 /etc/container_password tcrypt -hidden /mnt/tc_hidden /dev/null tcrypt\-hidden,tcrypt\-keyfile=/etc/keyfile +hidden /mnt/tc_hidden /dev/null tcrypt\-hidden,tcrypt\-keyfile=/etc/keyfile .fi .if n \{\ .RE diff --git a/man/crypttab.html b/man/crypttab.html index 29a7584bb..472236b1c 100644 --- a/man/crypttab.html +++ b/man/crypttab.html @@ -19,160 +19,143 @@ Directives · Python · libudev · - gudev systemd 218

Name

crypttab — Configuration for encrypted block devices

Synopsis

/etc/crypttab

Description¶

The /etc/crypttab file - describes encrypted block devices that are set up - during system boot.

Empty lines and lines starting with the "#" - character are ignored. Each of the remaining lines - describes one encrypted block device, fields on the - line are delimited by white space. The first two - fields are mandatory, the remaining two are - optional.

Setting up encrypted block devices using this file - supports three encryption modes: LUKS, TrueCrypt and plain. - See cryptsetup(8) - for more information about each mode. When no mode is specified - in the options field and the block device contains a LUKS - signature, it is opened as a LUKS device; otherwise, it is - assumed to be in raw dm-crypt (plain mode) format.

The first field contains the name of the - resulting encrypted block device; the device is set up - within /dev/mapper/.

The second field contains a path to the - underlying block device or file, or a specification of a block - device via "UUID=" followed by the - UUID.

The third field specifies the encryption - password. If the field is not present or the password - is set to "none" or "-", - the password has to be manually entered during system boot. - Otherwise, the field is interpreted as a absolute path to - a file containing the encryption password. For swap encryption, - /dev/urandom or the hardware - device /dev/hw_random can be used - as the password file; using - /dev/random may prevent boot - completion if the system does not have enough entropy - to generate a truly random encryption key.

The fourth field, if present, is a - comma-delimited list of options. The following - options are recognized:

discard¶

Allow discard requests to be - passed through the encrypted block device. This - improves performance on SSD storage but has - security implications.

cipher=¶

Specifies the cipher to use. See - cryptsetup(8) - for possible values and the default value of - this option. A cipher with unpredictable IV - values, such as "aes-cbc-essiv:sha256", - is recommended.

hash=¶

Specifies the hash to use for - password hashing. See - cryptsetup(8) - for possible values and the default value of - this option.

keyfile-offset=¶

Specifies the number of bytes to - skip at the start of the key file. See - cryptsetup(8) - for possible values and the default value of - this option.

keyfile-size=¶

Specifies the maximum number - of bytes to read from the key file. See - cryptsetup(8) - for possible values and the default value of - this option. This option is ignored in plain - encryption mode, as the key file size is then - given by the key size.

key-slot=¶

Specifies the key slot to - compare the passphrase or key against. - If the key slot does not match the given - passphrase or key, but another would, the - setup of the device will fail regardless. - This option implies luks. See - cryptsetup(8) - for possible values. The default is to try - all key slots in sequential order.

luks¶

Force LUKS mode. When this mode - is used, the following options are ignored since - they are provided by the LUKS header on the - device: cipher=, - hash=, - size=.

noauto¶

This device will not be - automatically unlocked on boot.

nofail¶

The system will not wait for the - device to show up and be unlocked at boot, and - not fail the boot if it does not show up.

plain¶

Force plain encryption mode.

read-only, readonly¶

Set up the encrypted block - device in read-only mode.

size=¶

Specifies the key size - in bits. See - cryptsetup(8) - for possible values and the default value of - this option.

swap¶

The encrypted block device will - be used as a swap device, and will be formatted - accordingly after setting up the encrypted - block device, with - mkswap(8). - This option implies plain.

WARNING: Using the swap - option will destroy the contents of the named - partition during every boot, so make sure the - underlying block device is specified correctly.

tcrypt¶

Use TrueCrypt encryption mode. - When this mode is used, the following options are - ignored since they are provided by the TrueCrypt - header on the device or do not apply: - cipher=, - hash=, - keyfile-offset=, - keyfile-size=, - size=.

When this mode is used, the passphrase is - read from the key file given in the third field. - Only the first line of this file is read, - excluding the new line character.

Note that the TrueCrypt format uses both - passphrase and key files to derive a password - for the volume. Therefore, the passphrase and - all key files need to be provided. Use - tcrypt-keyfile= to provide - the absolute path to all key files. When using - an empty passphrase in combination with one or - more key files, use "/dev/null" - as the password file in the third field.

tcrypt-hidden¶

Use the hidden TrueCrypt volume. - This option implies tcrypt.

This will map the hidden volume that is - inside of the volume provided in the second - field. Please note that there is no protection - for the hidden volume if the outer volume is - mounted instead. See - cryptsetup(8) - for more information on this limitation.

tcrypt-keyfile=¶

Specifies the absolute path to a - key file to use for a TrueCrypt volume. This - implies tcrypt and can be - used more than once to provide several key - files.

See the entry for tcrypt - on the behavior of the passphrase and key files - when using TrueCrypt encryption mode.

tcrypt-system¶

Use TrueCrypt in system - encryption mode. This option implies - tcrypt.

timeout=¶

Specifies the timeout for - querying for a password. If no unit is - specified, seconds is used. Supported units are - s, ms, us, min, h, d. A timeout of 0 waits - indefinitely (which is the default).

x-systemd.device-timeout=¶

Specifies how long - systemd should wait for a device to - show up before giving up on the - entry. The argument is a time in - seconds or explicitly specifified - units of "s", - "min", - "h", - "ms". -

tmp¶

The encrypted block device will - be prepared for using it as /tmp; - it will be formatted using - mke2fs(8). - This option implies plain.

WARNING: Using the tmp - option will destroy the contents of the named - partition during every boot, so make sure the - underlying block device is specified correctly.

tries=¶

Specifies the maximum number of - times the user is queried for a password. - The default is 3. If set to 0, the user is - queried for a password indefinitely.

verify¶

If the encryption password is - read from console, it has to be entered twice to - prevent typos.

At early boot and when the system manager - configuration is reloaded, this file is translated into - native systemd units - by systemd-cryptsetup-generator(8).

Example¶

Example 1. /etc/crypttab example

Set up four encrypted block devices. One using - LUKS for normal storage, another one for usage as a swap - device and two TrueCrypt volumes.

luks       UUID=2505567a-9e27-4efe-a4d5-15ad146c258b
-swap       /dev/sda7       /dev/urandom             swap
+  gudev systemd 219

Name

crypttab — Configuration for encrypted block devices

Synopsis

/etc/crypttab

Description¶

The /etc/crypttab file describes + encrypted block devices that are set up during system boot.

Empty lines and lines starting with the "#" + character are ignored. Each of the remaining lines describes one + encrypted block device, fields on the line are delimited by white + space. The first two fields are mandatory, the remaining two are + optional.

Setting up encrypted block devices using this file supports + three encryption modes: LUKS, TrueCrypt and plain. See + cryptsetup(8) + for more information about each mode. When no mode is specified in + the options field and the block device contains a LUKS signature, + it is opened as a LUKS device; otherwise, it is assumed to be in + raw dm-crypt (plain mode) format.

The first field contains the name of the resulting encrypted + block device; the device is set up within + /dev/mapper/.

The second field contains a path to the underlying block + device or file, or a specification of a block device via + "UUID=" followed by the UUID.

The third field specifies the encryption password. If the + field is not present or the password is set to + "none" or "-", the password has + to be manually entered during system boot. Otherwise, the field is + interpreted as a absolute path to a file containing the encryption + password. For swap encryption, /dev/urandom + or the hardware device /dev/hw_random can be + used as the password file; using /dev/random + may prevent boot completion if the system does not have enough + entropy to generate a truly random encryption key.

The fourth field, if present, is a comma-delimited list of + options. The following options are recognized:

discard¶

Allow discard requests to be passed through + the encrypted block device. This improves performance on SSD + storage but has security implications.

cipher=¶

Specifies the cipher to use. See + cryptsetup(8) + for possible values and the default value of this option. A + cipher with unpredictable IV values, such as + "aes-cbc-essiv:sha256", is + recommended.

hash=¶

Specifies the hash to use for password + hashing. See + cryptsetup(8) + for possible values and the default value of this + option.

header=¶

Use a detached (separated) metadata device or + file where the LUKS header is stored. This option is only + relevant for LUKS devices. See + cryptsetup(8) + for possible values and the default value of this + option.

keyfile-offset=¶

Specifies the number of bytes to skip at the + start of the key file. See + cryptsetup(8) + for possible values and the default value of this + option.

keyfile-size=¶

Specifies the maximum number of bytes to read + from the key file. See + cryptsetup(8) + for possible values and the default value of this option. This + option is ignored in plain encryption mode, as the key file + size is then given by the key size.

key-slot=¶

Specifies the key slot to compare the + passphrase or key against. If the key slot does not match the + given passphrase or key, but another would, the setup of the + device will fail regardless. This option implies + luks. See + cryptsetup(8) + for possible values. The default is to try all key slots in + sequential order.

luks¶

Force LUKS mode. When this mode is used, the + following options are ignored since they are provided by the + LUKS header on the device: cipher=, + hash=, + size=.

noauto¶

This device will not be automatically unlocked + on boot.

nofail¶

The system will not wait for the device to + show up and be unlocked at boot, and not fail the boot if it + does not show up.

plain¶

Force plain encryption mode.

read-only, readonly¶

Set up the encrypted block device in read-only + mode.

size=¶

Specifies the key size in bits. See + cryptsetup(8) + for possible values and the default value of this + option.

swap¶

The encrypted block device will be used as a + swap device, and will be formatted accordingly after setting + up the encrypted block device, with + mkswap(8). + This option implies plain.

WARNING: Using the swap option will + destroy the contents of the named partition during every boot, + so make sure the underlying block device is specified + correctly.

tcrypt¶

Use TrueCrypt encryption mode. When this mode + is used, the following options are ignored since they are + provided by the TrueCrypt header on the device or do not + apply: + cipher=, + hash=, + keyfile-offset=, + keyfile-size=, + size=.

When this mode is used, the passphrase is read from the + key file given in the third field. Only the first line of this + file is read, excluding the new line character.

Note that the TrueCrypt format uses both passphrase and + key files to derive a password for the volume. Therefore, the + passphrase and all key files need to be provided. Use + tcrypt-keyfile= to provide the absolute path + to all key files. When using an empty passphrase in + combination with one or more key files, use + "/dev/null" as the password file in the third + field.

tcrypt-hidden¶

Use the hidden TrueCrypt volume. This option + implies tcrypt.

This will map the hidden volume that is inside of the + volume provided in the second field. Please note that there is + no protection for the hidden volume if the outer volume is + mounted instead. See + cryptsetup(8) + for more information on this limitation.

tcrypt-keyfile=¶

Specifies the absolute path to a key file to + use for a TrueCrypt volume. This implies + tcrypt and can be used more than once to + provide several key files.

See the entry for tcrypt on the + behavior of the passphrase and key files when using TrueCrypt + encryption mode.

tcrypt-system¶

Use TrueCrypt in system encryption mode. This + option implies tcrypt.

timeout=¶

Specifies the timeout for querying for a + password. If no unit is specified, seconds is used. Supported + units are s, ms, us, min, h, d. A timeout of 0 waits + indefinitely (which is the default).

x-systemd.device-timeout=¶

Specifies how long systemd should wait for a + device to show up before giving up on the entry. The argument + is a time in seconds or explicitly specified units of + "s", + "min", + "h", + "ms". +

tmp¶

The encrypted block device will be prepared + for using it as /tmp; it will be + formatted using + mke2fs(8). + This option implies plain.

WARNING: Using the tmp option will + destroy the contents of the named partition during every boot, + so make sure the underlying block device is specified + correctly.

tries=¶

Specifies the maximum number of times the user + is queried for a password. The default is 3. If set to 0, the + user is queried for a password indefinitely.

verify¶

If the encryption password is read from + console, it has to be entered twice to prevent + typos.

At early boot and when the system manager configuration is + reloaded, this file is translated into native systemd units by + systemd-cryptsetup-generator(8).

Example¶

Example 1. /etc/crypttab example

Set up four encrypted block devices. One using LUKS for + normal storage, another one for usage as a swap device and two + TrueCrypt volumes.

luks       UUID=2505567a-9e27-4efe-a4d5-15ad146c258b
+swap       /dev/sda7       /dev/urandom       swap
 truecrypt  /dev/sda2       /etc/container_password  tcrypt
-hidden     /mnt/tc_hidden  /dev/null                tcrypt-hidden,tcrypt-keyfile=/etc/keyfile

+hidden /mnt/tc_hidden /dev/null tcrypt-hidden,tcrypt-keyfile=/etc/keyfile

diff --git a/man/crypttab.xml b/man/crypttab.xml index 42caf3430..aeacc5797 100644 --- a/man/crypttab.xml +++ b/man/crypttab.xml @@ -27,377 +27,366 @@ --> - - crypttab - systemd - - - - Documentation - Miloslav - Trmac - mitr@redhat.com - - - Documentation - Lennart - Poettering - lennart@poettering.net - - - - - - crypttab - 5 - - - - crypttab - Configuration for encrypted block devices - - - - /etc/crypttab - - - - Description - - The /etc/crypttab file - describes encrypted block devices that are set up - during system boot. - - Empty lines and lines starting with the # - character are ignored. Each of the remaining lines - describes one encrypted block device, fields on the - line are delimited by white space. The first two - fields are mandatory, the remaining two are - optional. - - Setting up encrypted block devices using this file - supports three encryption modes: LUKS, TrueCrypt and plain. - See cryptsetup8 - for more information about each mode. When no mode is specified - in the options field and the block device contains a LUKS - signature, it is opened as a LUKS device; otherwise, it is - assumed to be in raw dm-crypt (plain mode) format. - - The first field contains the name of the - resulting encrypted block device; the device is set up - within /dev/mapper/. - - The second field contains a path to the - underlying block device or file, or a specification of a block - device via UUID= followed by the - UUID. - - The third field specifies the encryption - password. If the field is not present or the password - is set to none or -, - the password has to be manually entered during system boot. - Otherwise, the field is interpreted as a absolute path to - a file containing the encryption password. For swap encryption, - /dev/urandom or the hardware - device /dev/hw_random can be used - as the password file; using - /dev/random may prevent boot - completion if the system does not have enough entropy - to generate a truly random encryption key. - - The fourth field, if present, is a - comma-delimited list of options. The following - options are recognized: - - - - - - - Allow discard requests to be - passed through the encrypted block device. This - improves performance on SSD storage but has - security implications. - - - - - - Specifies the cipher to use. See - cryptsetup8 - for possible values and the default value of - this option. A cipher with unpredictable IV - values, such as aes-cbc-essiv:sha256, - is recommended. - - - - - - Specifies the hash to use for - password hashing. See - cryptsetup8 - for possible values and the default value of - this option. - - - - - - Specifies the number of bytes to - skip at the start of the key file. See - cryptsetup8 - for possible values and the default value of - this option. - - - - - - Specifies the maximum number - of bytes to read from the key file. See - cryptsetup8 - for possible values and the default value of - this option. This option is ignored in plain - encryption mode, as the key file size is then - given by the key size. - - - - - - Specifies the key slot to - compare the passphrase or key against. - If the key slot does not match the given - passphrase or key, but another would, the - setup of the device will fail regardless. - This option implies . See - cryptsetup8 - for possible values. The default is to try - all key slots in sequential order. - - - - - - Force LUKS mode. When this mode - is used, the following options are ignored since - they are provided by the LUKS header on the - device: , - , - . - - - - - - This device will not be - automatically unlocked on boot. - - - - - - The system will not wait for the - device to show up and be unlocked at boot, and - not fail the boot if it does not show up. - - - - - - Force plain encryption mode. - - - - - - Set up the encrypted block - device in read-only mode. - - - - - - Specifies the key size - in bits. See - cryptsetup8 - for possible values and the default value of - this option. - - - - - - The encrypted block device will - be used as a swap device, and will be formatted - accordingly after setting up the encrypted - block device, with - mkswap8. - This option implies . - - WARNING: Using the - option will destroy the contents of the named - partition during every boot, so make sure the - underlying block device is specified correctly. - - - - - - Use TrueCrypt encryption mode. - When this mode is used, the following options are - ignored since they are provided by the TrueCrypt - header on the device or do not apply: - , - , - , - , - . - - When this mode is used, the passphrase is - read from the key file given in the third field. - Only the first line of this file is read, - excluding the new line character. - - Note that the TrueCrypt format uses both - passphrase and key files to derive a password - for the volume. Therefore, the passphrase and - all key files need to be provided. Use - to provide - the absolute path to all key files. When using - an empty passphrase in combination with one or - more key files, use /dev/null - as the password file in the third field. - - - - - - Use the hidden TrueCrypt volume. - This option implies . - - This will map the hidden volume that is - inside of the volume provided in the second - field. Please note that there is no protection - for the hidden volume if the outer volume is - mounted instead. See - cryptsetup8 - for more information on this limitation. - - - - - - Specifies the absolute path to a - key file to use for a TrueCrypt volume. This - implies and can be - used more than once to provide several key - files. - - See the entry for - on the behavior of the passphrase and key files - when using TrueCrypt encryption mode. - - - - - - Use TrueCrypt in system - encryption mode. This option implies - . - - - - - - Specifies the timeout for - querying for a password. If no unit is - specified, seconds is used. Supported units are - s, ms, us, min, h, d. A timeout of 0 waits - indefinitely (which is the default). - - - - - - Specifies how long - systemd should wait for a device to - show up before giving up on the - entry. The argument is a time in - seconds or explicitly specifified - units of s, - min, - h, - ms. - - - - - - - The encrypted block device will - be prepared for using it as /tmp; - it will be formatted using - mke2fs8. - This option implies . - - WARNING: Using the - option will destroy the contents of the named - partition during every boot, so make sure the - underlying block device is specified correctly. - - - - - - Specifies the maximum number of - times the user is queried for a password. - The default is 3. If set to 0, the user is - queried for a password indefinitely. - - - - - - If the encryption password is - read from console, it has to be entered twice to - prevent typos. - - - - - At early boot and when the system manager - configuration is reloaded, this file is translated into - native systemd units - by systemd-cryptsetup-generator8. - - - - Example - - /etc/crypttab example - Set up four encrypted block devices. One using - LUKS for normal storage, another one for usage as a swap - device and two TrueCrypt volumes. - - luks UUID=2505567a-9e27-4efe-a4d5-15ad146c258b -swap /dev/sda7 /dev/urandom swap + + crypttab + systemd + + + + Documentation + Miloslav + Trmac + mitr@redhat.com + + + Documentation + Lennart + Poettering + lennart@poettering.net + + + + + + crypttab + 5 + + + + crypttab + Configuration for encrypted block devices + + + + /etc/crypttab + + + + Description + + The /etc/crypttab file describes + encrypted block devices that are set up during system boot. + + Empty lines and lines starting with the # + character are ignored. Each of the remaining lines describes one + encrypted block device, fields on the line are delimited by white + space. The first two fields are mandatory, the remaining two are + optional. + + Setting up encrypted block devices using this file supports + three encryption modes: LUKS, TrueCrypt and plain. See + cryptsetup8 + for more information about each mode. When no mode is specified in + the options field and the block device contains a LUKS signature, + it is opened as a LUKS device; otherwise, it is assumed to be in + raw dm-crypt (plain mode) format. + + The first field contains the name of the resulting encrypted + block device; the device is set up within + /dev/mapper/. + + The second field contains a path to the underlying block + device or file, or a specification of a block device via + UUID= followed by the UUID. + + The third field specifies the encryption password. If the + field is not present or the password is set to + none or -, the password has + to be manually entered during system boot. Otherwise, the field is + interpreted as a absolute path to a file containing the encryption + password. For swap encryption, /dev/urandom + or the hardware device /dev/hw_random can be + used as the password file; using /dev/random + may prevent boot completion if the system does not have enough + entropy to generate a truly random encryption key. + + The fourth field, if present, is a comma-delimited list of + options. The following options are recognized: + + + + + + + Allow discard requests to be passed through + the encrypted block device. This improves performance on SSD + storage but has security implications. + + + + + + Specifies the cipher to use. See + cryptsetup8 + for possible values and the default value of this option. A + cipher with unpredictable IV values, such as + aes-cbc-essiv:sha256, is + recommended. + + + + + + Specifies the hash to use for password + hashing. See + cryptsetup8 + for possible values and the default value of this + option. + + + + + + Use a detached (separated) metadata device or + file where the LUKS header is stored. This option is only + relevant for LUKS devices. See + cryptsetup8 + for possible values and the default value of this + option. + + + + + + Specifies the number of bytes to skip at the + start of the key file. See + cryptsetup8 + for possible values and the default value of this + option. + + + + + + Specifies the maximum number of bytes to read + from the key file. See + cryptsetup8 + for possible values and the default value of this option. This + option is ignored in plain encryption mode, as the key file + size is then given by the key size. + + + + + + Specifies the key slot to compare the + passphrase or key against. If the key slot does not match the + given passphrase or key, but another would, the setup of the + device will fail regardless. This option implies + . See + cryptsetup8 + for possible values. The default is to try all key slots in + sequential order. + + + + + + Force LUKS mode. When this mode is used, the + following options are ignored since they are provided by the + LUKS header on the device: , + , + . + + + + + + This device will not be automatically unlocked + on boot. + + + + + + The system will not wait for the device to + show up and be unlocked at boot, and not fail the boot if it + does not show up. + + + + + + Force plain encryption mode. + + + + + + Set up the encrypted block device in read-only + mode. + + + + + + Specifies the key size in bits. See + cryptsetup8 + for possible values and the default value of this + option. + + + + + + The encrypted block device will be used as a + swap device, and will be formatted accordingly after setting + up the encrypted block device, with + mkswap8. + This option implies . + + WARNING: Using the option will + destroy the contents of the named partition during every boot, + so make sure the underlying block device is specified + correctly. + + + + + + Use TrueCrypt encryption mode. When this mode + is used, the following options are ignored since they are + provided by the TrueCrypt header on the device or do not + apply: + , + , + , + , + . + + When this mode is used, the passphrase is read from the + key file given in the third field. Only the first line of this + file is read, excluding the new line character. + + Note that the TrueCrypt format uses both passphrase and + key files to derive a password for the volume. Therefore, the + passphrase and all key files need to be provided. Use + to provide the absolute path + to all key files. When using an empty passphrase in + combination with one or more key files, use + /dev/null as the password file in the third + field. + + + + + + Use the hidden TrueCrypt volume. This option + implies . + + This will map the hidden volume that is inside of the + volume provided in the second field. Please note that there is + no protection for the hidden volume if the outer volume is + mounted instead. See + cryptsetup8 + for more information on this limitation. + + + + + + Specifies the absolute path to a key file to + use for a TrueCrypt volume. This implies + and can be used more than once to + provide several key files. + + See the entry for on the + behavior of the passphrase and key files when using TrueCrypt + encryption mode. + + + + + + Use TrueCrypt in system encryption mode. This + option implies . + + + + + + Specifies the timeout for querying for a + password. If no unit is specified, seconds is used. Supported + units are s, ms, us, min, h, d. A timeout of 0 waits + indefinitely (which is the default). + + + + + + Specifies how long systemd should wait for a + device to show up before giving up on the entry. The argument + is a time in seconds or explicitly specified units of + s, + min, + h, + ms. + + + + + + + The encrypted block device will be prepared + for using it as /tmp; it will be + formatted using + mke2fs8. + This option implies . + + WARNING: Using the option will + destroy the contents of the named partition during every boot, + so make sure the underlying block device is specified + correctly. + + + + + + Specifies the maximum number of times the user + is queried for a password. The default is 3. If set to 0, the + user is queried for a password indefinitely. + + + + + + If the encryption password is read from + console, it has to be entered twice to prevent + typos. + + + + + At early boot and when the system manager configuration is + reloaded, this file is translated into native systemd units by + systemd-cryptsetup-generator8. + + + + Example + + /etc/crypttab example + Set up four encrypted block devices. One using LUKS for + normal storage, another one for usage as a swap device and two + TrueCrypt volumes. + + luks UUID=2505567a-9e27-4efe-a4d5-15ad146c258b +swap /dev/sda7 /dev/urandom swap truecrypt /dev/sda2 /etc/container_password tcrypt -hidden /mnt/tc_hidden /dev/null tcrypt-hidden,tcrypt-keyfile=/etc/keyfile - - - - - See Also - - systemd1, - systemd-cryptsetup@.service8, - systemd-cryptsetup-generator8, - cryptsetup8, - mkswap8, - mke2fs8 - - +hidden /mnt/tc_hidden /dev/null tcrypt-hidden,tcrypt-keyfile=/etc/keyfile + + + + + See Also + + systemd1, + systemd-cryptsetup@.service8, + systemd-cryptsetup-generator8, + cryptsetup8, + mkswap8, + mke2fs8 + + diff --git a/man/custom-html.xsl b/man/custom-html.xsl index 8bcc5f92d..32299db71 100644 --- a/man/custom-html.xsl +++ b/man/custom-html.xsl @@ -60,6 +60,18 @@ + + + + https://www.mankier.com/ + + / + + + + + + diff --git a/man/daemon.7 b/man/daemon.7 index 9a1063068..12ef2a369 100644 --- a/man/daemon.7 +++ b/man/daemon.7 @@ -1,5 +1,5 @@ '\" t -.TH "DAEMON" "7" "" "systemd 218" "daemon" +.TH "DAEMON" "7" "" "systemd 219" "daemon" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -603,10 +603,10 @@ AS_IF([test "x$with_systemdsystemunitdir" = "xyes" \-o "x$with_systemdsystemunit def_systemdsystemunitdir=$($PKG_CONFIG \-\-variable=systemdsystemunitdir systemd) AS_IF([test "x$def_systemdsystemunitdir" = "x"], - [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], - [AC_MSG_ERROR([systemd support requested but pkg\-config unable to query systemd package])]) - with_systemdsystemunitdir=no], - [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) + [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], + [AC_MSG_ERROR([systemd support requested but pkg\-config unable to query systemd package])]) + with_systemdsystemunitdir=no], + [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) @@ -629,7 +629,7 @@ file in .\} .nf DISTCHECK_CONFIGURE_FLAGS = \e - \-\-with\-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) + \-\-with\-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) .fi .if n \{\ .RE @@ -643,8 +643,8 @@ Finally, unit files should be installed in the system with an automake excerpt l .nf if HAVE_SYSTEMD systemdsystemunit_DATA = \e - foobar\&.socket \e - foobar\&.service + foobar\&.socket \e + foobar\&.service endif .fi .if n \{\ @@ -720,7 +720,7 @@ To facilitate upgrades from a package version that shipped only SysV init script .nf %triggerun \-\- foobar < 0\&.47\&.11\-1 if /sbin/chkconfig \-\-level 5 foobar ; then - /bin/systemctl \-\-no\-reload enable foobar\&.service foobar\&.socket >/dev/null 2>&1 || : + /bin/systemctl \-\-no\-reload enable foobar\&.service foobar\&.socket >/dev/null 2>&1 || : fi .fi .if n \{\ diff --git a/man/daemon.html b/man/daemon.html index 952344f48..05f523575 100644 --- a/man/daemon.html +++ b/man/daemon.html @@ -19,541 +19,373 @@ Directives · Python · libudev · - gudev systemd 218

Name

daemon — Writing and packaging system daemons

Description¶

A daemon is a service process that runs in the - background and supervises the system or provides - functionality to other processes. Traditionally, - daemons are implemented following a scheme originating - in SysV Unix. Modern daemons should follow a simpler - yet more powerful scheme (here called "new-style" - daemons), as implemented by - systemd(1). This - manual page covers both schemes, and in - particular includes recommendations for daemons that - shall be included in the systemd init system.

SysV Daemons¶

When a traditional SysV daemon - starts, it should execute the following steps - as part of the initialization. Note that these - steps are unnecessary for new-style daemons (see below), - and should only be implemented if compatibility - with SysV is essential.

  1. Close all open file - descriptors except standard input, output, - and error (i.e. the first three file - descriptors 0, 1, 2). This ensures - that no accidentally passed file - descriptor stays around in the daemon - process. On Linux, this is best - implemented by iterating through - /proc/self/fd, - with a fallback of iterating from file - descriptor 3 to the value returned by - getrlimit() for - RLIMIT_NOFILE. -

  2. Reset all signal - handlers to their default. This is - best done by iterating through the - available signals up to the limit of - _NSIG and resetting them to - SIG_DFL.

  3. Reset the signal mask - using - sigprocmask().

  4. Sanitize the - environment block, removing or - resetting environment variables that - might negatively impact daemon - runtime.

  5. Call fork(), - to create a background - process.

  6. In the child, call - setsid() to - detach from any terminal and create an - independent session.

  7. In the child, call - fork() again, to - ensure that the daemon can never re-acquire - a terminal again.

  8. Call exit() in the - first child, so that only the second - child (the actual daemon process) - stays around. This ensures that the - daemon process is re-parented to - init/PID 1, as all daemons should - be.

  9. In the daemon process, - connect /dev/null - to standard input, output, and error. -

  10. In the daemon process, - reset the umask to 0, so that the file - modes passed to open(), mkdir() and - suchlike directly control the access - mode of the created files and - directories.

  11. In the daemon process, - change the current directory to the - root directory (/), in order to avoid - that the daemon involuntarily - blocks mount points from being - unmounted.

  12. In the daemon process, - write the daemon PID (as returned by - getpid()) to a - PID file, for example - /run/foobar.pid - (for a hypothetical daemon "foobar") - to ensure that the daemon cannot be - started more than once. This must be - implemented in race-free fashion so - that the PID file is only updated when - it is verified at the same time that - the PID previously stored in the PID - file no longer exists or belongs to a - foreign process.

  13. In the daemon process, - drop privileges, if possible and - applicable.

  14. From the daemon - process, notify the original process - started that initialization is - complete. This can be implemented via - an unnamed pipe or similar - communication channel that is created - before the first - fork() and hence - available in both the original and the - daemon process.

  15. Call - exit() in the - original process. The process that - invoked the daemon must be able to - rely on that this - exit() happens - after initialization is complete and - all external communication channels - are established and - accessible.

The BSD daemon() function should not be - used, as it implements only a subset of these steps.

A daemon that needs to provide - compatibility with SysV systems should - implement the scheme pointed out - above. However, it is recommended to make this - behavior optional and configurable via a - command line argument to ease debugging as - well as to simplify integration into systems - using systemd.

New-Style Daemons¶

Modern services for Linux should be - implemented as new-style daemons. This makes it - easier to supervise and control them at - runtime and simplifies their - implementation.

For developing a new-style daemon, none - of the initialization steps recommended for - SysV daemons need to be implemented. New-style - init systems such as systemd make all of them - redundant. Moreover, since some of these steps - interfere with process monitoring, file - descriptor passing and other functionality of - the init system, it is recommended not to - execute them when run as new-style - service.

Note that new-style init systems - guarantee execution of daemon processes in a - clean process context: it is guaranteed that - the environment block is sanitized, that the - signal handlers and mask is reset and that no - left-over file descriptors are passed. Daemons - will be executed in their own session, with - standard input/output/error connected to - /dev/null unless - otherwise configured. The umask is reset. -

It is recommended for new-style daemons - to implement the following:

  1. If SIGTERM is - received, shut down the daemon and - exit cleanly.

  2. If SIGHUP is received, - reload the configuration files, if - this applies.

  3. Provide a correct exit - code from the main daemon process, as - this is used by the init system to - detect service errors and problems. It - is recommended to follow the exit code - scheme as defined in the LSB - recommendations for SysV init - scripts.

  4. If possible and - applicable, expose the daemon's control - interface via the D-Bus IPC system and - grab a bus name as last step of - initialization.

  5. For integration in - systemd, provide a - .service unit - file that carries information about - starting, stopping and otherwise - maintaining the daemon. See - systemd.service(5) - for details.

  6. As much as possible, - rely on the init system's - functionality to limit the access of - the daemon to files, services and - other resources, i.e. in the case of - systemd, rely on systemd's resource - limit control instead of implementing - your own, rely on systemd's privilege - dropping code instead of implementing - it in the daemon, and similar. See - systemd.exec(5) - for the available - controls.

  7. If D-Bus is used, make - your daemon bus-activatable by - supplying a D-Bus service activation - configuration file. This has multiple - advantages: your daemon may be started - lazily on-demand; it may be started in - parallel to other daemons requiring it - -- which maximizes parallelization and - boot-up speed; your daemon can be - restarted on failure without losing - any bus requests, as the bus queues - requests for activatable services. See - below for details.

  8. If your daemon - provides services to other local - processes or remote clients via a - socket, it should be made - socket-activatable following the - scheme pointed out below. Like D-Bus - activation, this enables on-demand - starting of services as well as it - allows improved parallelization of - service start-up. Also, for state-less - protocols (such as syslog, DNS), a - daemon implementing socket-based - activation can be restarted without - losing a single request. See below for - details.

  9. If applicable, a daemon - should notify the init system about - startup completion or status updates - via the - sd_notify(3) - interface.

  10. Instead of using the - syslog() call to - log directly to the system syslog - service, a new-style daemon may choose - to simply log to standard error via - fprintf(), which - is then forwarded to syslog by the - init system. If log levels are - necessary, these can be encoded by - prefixing individual log lines with - strings like "<4>" (for log - level 4 "WARNING" in the syslog - priority scheme), following a similar - style as the Linux kernel's - printk() level - system. For details, see - sd-daemon(3) - and - systemd.exec(5).

These recommendations are similar but - not identical to the Apple - MacOS X Daemon Requirements.

Activation¶

New-style init systems provide multiple - additional mechanisms to activate services, as - detailed below. It is common that services are - configured to be activated via more than one mechanism - at the same time. An example for systemd: - bluetoothd.service might get - activated either when Bluetooth hardware is plugged - in, or when an application accesses its programming - interfaces via D-Bus. Or, a print server daemon might - get activated when traffic arrives at an IPP port, or - when a printer is plugged in, or when a file is queued - in the printer spool directory. Even for services that - are intended to be started on system bootup - unconditionally, it is a good idea to implement some of - the various activation schemes outlined below, in - order to maximize parallelization. If a daemon - implements a D-Bus service or listening socket, - implementing the full bus and socket activation scheme - allows starting of the daemon with its clients in - parallel (which speeds up boot-up), since all its - communication channels are established already, and no - request is lost because client requests will be queued - by the bus system (in case of D-Bus) or the kernel (in - case of sockets) until the activation is - completed.

Activation on Boot¶

Old-style daemons are usually activated - exclusively on boot (and manually by the - administrator) via SysV init scripts, as - detailed in the LSB - Linux Standard Base Core - Specification. This method of - activation is supported ubiquitously on Linux - init systems, both old-style and new-style - systems. Among other issues, SysV init scripts - have the disadvantage of involving shell - scripts in the boot process. New-style init - systems generally employ updated versions of - activation, both during boot-up and during - runtime and using more minimal service - description files.

In systemd, if the developer or - administrator wants to make sure that a service or - other unit is activated automatically on boot, - it is recommended to place a symlink to the - unit file in the .wants/ - directory of either - multi-user.target or - graphical.target, which - are normally used as boot targets at system - startup. See - systemd.unit(5) - for details about the - .wants/ directories, and - systemd.special(7) - for details about the two boot targets.

Socket-Based Activation¶

In order to maximize the possible - parallelization and robustness and simplify - configuration and development, it is - recommended for all new-style daemons that - communicate via listening sockets to employ - socket-based activation. In a socket-based - activation scheme, the creation and binding of - the listening socket as primary communication - channel of daemons to local (and sometimes - remote) clients is moved out of the daemon - code and into the init system. Based on - per-daemon configuration, the init system - installs the sockets and then hands them off - to the spawned process as soon as the - respective daemon is to be started. - Optionally, activation of the service can be - delayed until the first inbound traffic - arrives at the socket to implement on-demand - activation of daemons. However, the primary - advantage of this scheme is that all providers - and all consumers of the sockets can be - started in parallel as soon as all sockets - are established. In addition to that, daemons - can be restarted with losing only a minimal - number of client transactions, or even any - client request at all (the latter is - particularly true for state-less protocols, - such as DNS or syslog), because the socket - stays bound and accessible during the restart, - and all requests are queued while the daemon - cannot process them.

New-style daemons which support socket - activation must be able to receive their - sockets from the init system instead of - creating and binding them themselves. For - details about the programming interfaces for - this scheme provided by systemd, see - sd_listen_fds(3) - and - sd-daemon(3). For - details about porting existing daemons to - socket-based activation, see below. With - minimal effort, it is possible to implement - socket-based activation in addition to - traditional internal socket creation in the - same codebase in order to support both - new-style and old-style init systems from the - same daemon binary.

systemd implements socket-based - activation via .socket - units, which are described in - systemd.socket(5). When - configuring socket units for socket-based - activation, it is essential that all listening - sockets are pulled in by the special target - unit sockets.target. It - is recommended to place a - WantedBy=sockets.target - directive in the "[Install]" - section to automatically add such a - dependency on installation of a socket - unit. Unless - DefaultDependencies=no is - set, the necessary ordering dependencies are - implicitly created for all socket units. For - more information about - sockets.target, see - systemd.special(7). It - is not necessary or recommended to place any - additional dependencies on socket units (for - example from - multi-user.target or - suchlike) when one is installed in - sockets.target.

Bus-Based Activation¶

When the D-Bus IPC system is used for - communication with clients, new-style daemons - should employ bus activation so that they are - automatically activated when a client - application accesses their IPC - interfaces. This is configured in D-Bus - service files (not to be confused with systemd - service unit files!). To ensure that D-Bus - uses systemd to start-up and maintain the - daemon, use the - SystemdService= directive - in these service files to configure the - matching systemd service for a D-Bus - service. e.g.: For a D-Bus service whose D-Bus - activation file is named - org.freedesktop.RealtimeKit.service, - make sure to set - SystemdService=rtkit-daemon.service - in that file to bind it to the systemd - service - rtkit-daemon.service. This - is needed to make sure that the daemon is - started in a race-free fashion when activated - via multiple mechanisms simultaneously.

Device-Based Activation¶

Often, daemons that manage a particular - type of hardware should be activated only when - the hardware of the respective kind is plugged - in or otherwise becomes available. In a - new-style init system, it is possible to bind - activation to hardware plug/unplug events. In - systemd, kernel devices appearing in the - sysfs/udev device tree can be exposed as units - if they are tagged with the string - "systemd". Like any other - kind of unit, they may then pull in other units - when activated (i.e. plugged in) and thus - implement device-based activation. systemd - dependencies may be encoded in the udev - database via the - SYSTEMD_WANTS= - property. See - systemd.device(5) - for details. Often, it is nicer to pull in - services from devices only indirectly via - dedicated targets. Example: Instead of pulling - in bluetoothd.service - from all the various bluetooth dongles and - other hardware available, pull in - bluetooth.target from them and - bluetoothd.service from - that target. This provides for nicer - abstraction and gives administrators the - option to enable - bluetoothd.service via - controlling a - bluetooth.target.wants/ - symlink uniformly with a command like - enable of - systemctl(1) - instead of manipulating the udev - ruleset.

Path-Based Activation¶

Often, runtime of daemons processing - spool files or directories (such as a printing - system) can be delayed until these file system - objects change state, or become - non-empty. New-style init systems provide a - way to bind service activation to file system - changes. systemd implements this scheme via - path-based activation configured in - .path units, as outlined - in - systemd.path(5).

Timer-Based Activation¶

Some daemons that implement clean-up - jobs that are intended to be executed in - regular intervals benefit from timer-based - activation. In systemd, this is implemented - via .timer units, as - described in - systemd.timer(5).

Other Forms of Activation¶

Other forms of activation have been - suggested and implemented in some - systems. However, there are often simpler or - better alternatives, or they can be put - together of combinations of the schemes - above. Example: Sometimes, it appears useful to - start daemons or .socket - units when a specific IP address is configured - on a network interface, because network - sockets shall be bound to the - address. However, an alternative to implement - this is by utilizing the Linux IP_FREEBIND - socket option, as accessible via - FreeBind=yes in systemd - socket files (see - systemd.socket(5) - for details). This option, when enabled, - allows sockets to be bound to a non-local, not - configured IP address, and hence allows - bindings to a particular IP address before it - actually becomes available, making such an - explicit dependency to the configured address - redundant. Another often suggested trigger for - service activation is low system - load. However, here too, a more convincing - approach might be to make proper use of - features of the operating system, in - particular, the CPU or IO scheduler of - Linux. Instead of scheduling jobs from - userspace based on monitoring the OS - scheduler, it is advisable to leave the - scheduling of processes to the OS scheduler - itself. systemd provides fine-grained access - to the CPU and IO schedulers. If a process - executed by the init system shall not - negatively impact the amount of CPU or IO - bandwidth available to other processes, it - should be configured with - CPUSchedulingPolicy=idle - and/or - IOSchedulingClass=idle. Optionally, - this may be combined with timer-based - activation to schedule background jobs during - runtime and with minimal impact on the system, - and remove it from the boot phase - itself.

Integration with Systemd¶

Writing Systemd Unit Files¶

When writing systemd unit files, it is - recommended to consider the following - suggestions:

  1. If possible, do not use - the Type=forking - setting in service files. But if you - do, make sure to set the PID file path - using PIDFile=. See - systemd.service(5) - for details.

  2. If your daemon - registers a D-Bus name on the bus, - make sure to use - Type=dbus in the - service file if - possible.

  3. Make sure to set a - good human-readable description string - with - Description=.

  4. Do not disable - DefaultDependencies=, - unless you really know what you do and - your unit is involved in early boot or - late system shutdown.

  5. Normally, little if - any dependencies should need to - be defined explicitly. However, if you - do configure explicit dependencies, only refer to - unit names listed on - systemd.special(7) - or names introduced by your own - package to keep the unit file - operating - system-independent.

  6. Make sure to include - an "[Install]" - section including installation - information for the unit file. See - systemd.unit(5) - for details. To activate your service - on boot, make sure to add a - WantedBy=multi-user.target - or - WantedBy=graphical.target - directive. To activate your socket on - boot, make sure to add - WantedBy=sockets.target. Usually, - you also want to make sure that when - your service is installed, your socket - is installed too, hence add - Also=foo.socket in - your service file - foo.service, for - a hypothetical program - foo.

Installing Systemd Service Files¶

At the build installation time - (e.g. make install during - package build), packages are recommended to - install their systemd unit files in the - directory returned by pkg-config - systemd - --variable=systemdsystemunitdir (for - system services) or pkg-config - systemd - --variable=systemduserunitdir - (for user services). This will make the - services available in the system on explicit - request but not activate them automatically - during boot. Optionally, during package - installation (e.g. rpm -i - by the administrator), symlinks should be - created in the systemd configuration - directories via the enable - command of the - systemctl(1) - tool to activate them automatically on - boot.

Packages using - autoconf(1) - are recommended to use a configure script - excerpt like the following to determine the - unit installation path during source - configuration:

PKG_PROG_PKG_CONFIG
+  gudev systemd 219

Name

daemon — Writing and packaging system daemons

Description¶

A daemon is a service process that runs in the background + and supervises the system or provides functionality to other + processes. Traditionally, daemons are implemented following a + scheme originating in SysV Unix. Modern daemons should follow a + simpler yet more powerful scheme (here called "new-style" + daemons), as implemented by + systemd(1). + This manual page covers both schemes, and in particular includes + recommendations for daemons that shall be included in the systemd + init system.

SysV Daemons¶

When a traditional SysV daemon starts, it should execute + the following steps as part of the initialization. Note that + these steps are unnecessary for new-style daemons (see below), + and should only be implemented if compatibility with SysV is + essential.

  1. Close all open file descriptors except + standard input, output, and error (i.e. the first three file + descriptors 0, 1, 2). This ensures that no accidentally passed + file descriptor stays around in the daemon process. On Linux, + this is best implemented by iterating through + /proc/self/fd, with a fallback of + iterating from file descriptor 3 to the value returned by + getrlimit() for + RLIMIT_NOFILE.

  2. Reset all signal handlers to their default. + This is best done by iterating through the available signals + up to the limit of _NSIG and resetting + them to SIG_DFL.

  3. Reset the signal mask + using + sigprocmask().

  4. Sanitize the environment block, removing or + resetting environment variables that might negatively impact + daemon runtime.

  5. Call fork(), to create a + background process.

  6. In the child, call + setsid() to detach from any terminal and + create an independent session.

  7. In the child, call fork() + again, to ensure that the daemon can never re-acquire a + terminal again.

  8. Call exit() in the first + child, so that only the second child (the actual daemon + process) stays around. This ensures that the daemon process is + re-parented to init/PID 1, as all daemons should + be.

  9. In the daemon process, connect + /dev/null to standard input, output, and + error.

  10. In the daemon process, reset the umask to 0, + so that the file modes passed to open(), + mkdir() and suchlike directly control the + access mode of the created files and + directories.

  11. In the daemon process, change the current + directory to the root directory (/), in order to avoid that + the daemon involuntarily blocks mount points from being + unmounted.

  12. In the daemon process, write the daemon PID + (as returned by getpid()) to a PID file, + for example /run/foobar.pid (for a + hypothetical daemon "foobar") to ensure that the daemon cannot + be started more than once. This must be implemented in + race-free fashion so that the PID file is only updated when it + is verified at the same time that the PID previously stored in + the PID file no longer exists or belongs to a foreign + process.

  13. In the daemon process, drop privileges, if + possible and applicable.

  14. From the daemon process, notify the original + process started that initialization is complete. This can be + implemented via an unnamed pipe or similar communication + channel that is created before the first + fork() and hence available in both the + original and the daemon process.

  15. Call exit() in the + original process. The process that invoked the daemon must be + able to rely on that this exit() happens + after initialization is complete and all external + communication channels are established and + accessible.

The BSD daemon() function should not + be used, as it implements only a subset of these steps.

A daemon that needs to provide compatibility with SysV + systems should implement the scheme pointed out above. However, + it is recommended to make this behavior optional and + configurable via a command line argument to ease debugging as + well as to simplify integration into systems using + systemd.

New-Style Daemons¶

Modern services for Linux should be implemented as + new-style daemons. This makes it easier to supervise and control + them at runtime and simplifies their implementation.

For developing a new-style daemon, none of the + initialization steps recommended for SysV daemons need to be + implemented. New-style init systems such as systemd make all of + them redundant. Moreover, since some of these steps interfere + with process monitoring, file descriptor passing and other + functionality of the init system, it is recommended not to + execute them when run as new-style service.

Note that new-style init systems guarantee execution of + daemon processes in a clean process context: it is guaranteed + that the environment block is sanitized, that the signal + handlers and mask is reset and that no left-over file + descriptors are passed. Daemons will be executed in their own + session, with standard input/output/error connected to + /dev/null unless otherwise configured. The + umask is reset. +

It is recommended for new-style daemons to implement the + following:

  1. If SIGTERM is received, + shut down the daemon and exit cleanly.

  2. If SIGHUP is received, + reload the configuration files, if this + applies.

  3. Provide a correct exit code from the main + daemon process, as this is used by the init system to detect + service errors and problems. It is recommended to follow the + exit code scheme as defined in the LSB + recommendations for SysV init + scripts.

  4. If possible and applicable, expose the + daemon's control interface via the D-Bus IPC system and grab a + bus name as last step of initialization.

  5. For integration in systemd, provide a + .service unit file that carries + information about starting, stopping and otherwise maintaining + the daemon. See + systemd.service(5) + for details.

  6. As much as possible, rely on the init system's + functionality to limit the access of the daemon to files, + services and other resources, i.e. in the case of systemd, + rely on systemd's resource limit control instead of + implementing your own, rely on systemd's privilege dropping + code instead of implementing it in the daemon, and similar. + See + systemd.exec(5) + for the available controls.

  7. If D-Bus is used, make your daemon + bus-activatable by supplying a D-Bus service activation + configuration file. This has multiple advantages: your daemon + may be started lazily on-demand; it may be started in parallel + to other daemons requiring it -- which maximizes + parallelization and boot-up speed; your daemon can be + restarted on failure without losing any bus requests, as the + bus queues requests for activatable services. See below for + details.

  8. If your daemon provides services to other + local processes or remote clients via a socket, it should be + made socket-activatable following the scheme pointed out + below. Like D-Bus activation, this enables on-demand starting + of services as well as it allows improved parallelization of + service start-up. Also, for state-less protocols (such as + syslog, DNS), a daemon implementing socket-based activation + can be restarted without losing a single request. See below + for details.

  9. If applicable, a daemon should notify the init + system about startup completion or status updates via the + sd_notify(3) + interface.

  10. Instead of using the + syslog() call to log directly to the + system syslog service, a new-style daemon may choose to simply + log to standard error via fprintf(), + which is then forwarded to syslog by the init system. If log + levels are necessary, these can be encoded by prefixing + individual log lines with strings like + "<4>" (for log level 4 "WARNING" in the + syslog priority scheme), following a similar style as the + Linux kernel's printk() level system. For + details, see + sd-daemon(3) + and + systemd.exec(5).

These recommendations are similar but not identical to the + Apple + MacOS X Daemon Requirements.

Activation¶

New-style init systems provide multiple additional + mechanisms to activate services, as detailed below. It is common + that services are configured to be activated via more than one + mechanism at the same time. An example for systemd: + bluetoothd.service might get activated either + when Bluetooth hardware is plugged in, or when an application + accesses its programming interfaces via D-Bus. Or, a print server + daemon might get activated when traffic arrives at an IPP port, or + when a printer is plugged in, or when a file is queued in the + printer spool directory. Even for services that are intended to be + started on system bootup unconditionally, it is a good idea to + implement some of the various activation schemes outlined below, + in order to maximize parallelization. If a daemon implements a + D-Bus service or listening socket, implementing the full bus and + socket activation scheme allows starting of the daemon with its + clients in parallel (which speeds up boot-up), since all its + communication channels are established already, and no request is + lost because client requests will be queued by the bus system (in + case of D-Bus) or the kernel (in case of sockets) until the + activation is completed.

Activation on Boot¶

Old-style daemons are usually activated exclusively on + boot (and manually by the administrator) via SysV init scripts, + as detailed in the LSB + Linux Standard Base Core Specification. This method of + activation is supported ubiquitously on Linux init systems, both + old-style and new-style systems. Among other issues, SysV init + scripts have the disadvantage of involving shell scripts in the + boot process. New-style init systems generally employ updated + versions of activation, both during boot-up and during runtime + and using more minimal service description files.

In systemd, if the developer or administrator wants to + make sure that a service or other unit is activated + automatically on boot, it is recommended to place a symlink to + the unit file in the .wants/ directory of + either multi-user.target or + graphical.target, which are normally used + as boot targets at system startup. See + systemd.unit(5) + for details about the .wants/ directories, + and + systemd.special(7) + for details about the two boot targets.

Socket-Based Activation¶

In order to maximize the possible parallelization and + robustness and simplify configuration and development, it is + recommended for all new-style daemons that communicate via + listening sockets to employ socket-based activation. In a + socket-based activation scheme, the creation and binding of the + listening socket as primary communication channel of daemons to + local (and sometimes remote) clients is moved out of the daemon + code and into the init system. Based on per-daemon + configuration, the init system installs the sockets and then + hands them off to the spawned process as soon as the respective + daemon is to be started. Optionally, activation of the service + can be delayed until the first inbound traffic arrives at the + socket to implement on-demand activation of daemons. However, + the primary advantage of this scheme is that all providers and + all consumers of the sockets can be started in parallel as soon + as all sockets are established. In addition to that, daemons can + be restarted with losing only a minimal number of client + transactions, or even any client request at all (the latter is + particularly true for state-less protocols, such as DNS or + syslog), because the socket stays bound and accessible during + the restart, and all requests are queued while the daemon cannot + process them.

New-style daemons which support socket activation must be + able to receive their sockets from the init system instead of + creating and binding them themselves. For details about the + programming interfaces for this scheme provided by systemd, see + sd_listen_fds(3) + and + sd-daemon(3). + For details about porting existing daemons to socket-based + activation, see below. With minimal effort, it is possible to + implement socket-based activation in addition to traditional + internal socket creation in the same codebase in order to + support both new-style and old-style init systems from the same + daemon binary.

systemd implements socket-based activation via + .socket units, which are described in + systemd.socket(5). + When configuring socket units for socket-based activation, it is + essential that all listening sockets are pulled in by the + special target unit sockets.target. It is + recommended to place a + WantedBy=sockets.target directive in the + "[Install]" section to automatically add such a + dependency on installation of a socket unit. Unless + DefaultDependencies=no is set, the necessary + ordering dependencies are implicitly created for all socket + units. For more information about + sockets.target, see + systemd.special(7). + It is not necessary or recommended to place any additional + dependencies on socket units (for example from + multi-user.target or suchlike) when one is + installed in sockets.target.

Bus-Based Activation¶

When the D-Bus IPC system is used for communication with + clients, new-style daemons should employ bus activation so that + they are automatically activated when a client application + accesses their IPC interfaces. This is configured in D-Bus + service files (not to be confused with systemd service unit + files!). To ensure that D-Bus uses systemd to start-up and + maintain the daemon, use the SystemdService= + directive in these service files to configure the matching + systemd service for a D-Bus service. e.g.: For a D-Bus service + whose D-Bus activation file is named + org.freedesktop.RealtimeKit.service, make + sure to set + SystemdService=rtkit-daemon.service in that + file to bind it to the systemd service + rtkit-daemon.service. This is needed to + make sure that the daemon is started in a race-free fashion when + activated via multiple mechanisms simultaneously.

Device-Based Activation¶

Often, daemons that manage a particular type of hardware + should be activated only when the hardware of the respective + kind is plugged in or otherwise becomes available. In a + new-style init system, it is possible to bind activation to + hardware plug/unplug events. In systemd, kernel devices + appearing in the sysfs/udev device tree can be exposed as units + if they are tagged with the string "systemd". + Like any other kind of unit, they may then pull in other units + when activated (i.e. plugged in) and thus implement device-based + activation. systemd dependencies may be encoded in the udev + database via the SYSTEMD_WANTS= property. See + systemd.device(5) + for details. Often, it is nicer to pull in services from devices + only indirectly via dedicated targets. Example: Instead of + pulling in bluetoothd.service from all the + various bluetooth dongles and other hardware available, pull in + bluetooth.target from them and + bluetoothd.service from that target. This + provides for nicer abstraction and gives administrators the + option to enable bluetoothd.service via + controlling a bluetooth.target.wants/ + symlink uniformly with a command like enable + of + systemctl(1) + instead of manipulating the udev ruleset.

Path-Based Activation¶

Often, runtime of daemons processing spool files or + directories (such as a printing system) can be delayed until + these file system objects change state, or become non-empty. + New-style init systems provide a way to bind service activation + to file system changes. systemd implements this scheme via + path-based activation configured in .path + units, as outlined in + systemd.path(5).

Timer-Based Activation¶

Some daemons that implement clean-up jobs that are + intended to be executed in regular intervals benefit from + timer-based activation. In systemd, this is implemented via + .timer units, as described in + systemd.timer(5).

Other Forms of Activation¶

Other forms of activation have been suggested and + implemented in some systems. However, there are often simpler or + better alternatives, or they can be put together of combinations + of the schemes above. Example: Sometimes, it appears useful to + start daemons or .socket units when a + specific IP address is configured on a network interface, + because network sockets shall be bound to the address. However, + an alternative to implement this is by utilizing the Linux + IP_FREEBIND socket option, as accessible + via FreeBind=yes in systemd socket files (see + systemd.socket(5) + for details). This option, when enabled, allows sockets to be + bound to a non-local, not configured IP address, and hence + allows bindings to a particular IP address before it actually + becomes available, making such an explicit dependency to the + configured address redundant. Another often suggested trigger + for service activation is low system load. However, here too, a + more convincing approach might be to make proper use of features + of the operating system, in particular, the CPU or IO scheduler + of Linux. Instead of scheduling jobs from userspace based on + monitoring the OS scheduler, it is advisable to leave the + scheduling of processes to the OS scheduler itself. systemd + provides fine-grained access to the CPU and IO schedulers. If a + process executed by the init system shall not negatively impact + the amount of CPU or IO bandwidth available to other processes, + it should be configured with + CPUSchedulingPolicy=idle and/or + IOSchedulingClass=idle. Optionally, this may + be combined with timer-based activation to schedule background + jobs during runtime and with minimal impact on the system, and + remove it from the boot phase itself.

Integration with Systemd¶

Writing Systemd Unit Files¶

When writing systemd unit files, it is recommended to + consider the following suggestions:

  1. If possible, do not use the + Type=forking setting in service files. But + if you do, make sure to set the PID file path using + PIDFile=. See + systemd.service(5) + for details.

  2. If your daemon registers a D-Bus name on the + bus, make sure to use Type=dbus in the + service file if possible.

  3. Make sure to set a good human-readable + description string with + Description=.

  4. Do not disable + DefaultDependencies=, unless you really + know what you do and your unit is involved in early boot or + late system shutdown.

  5. Normally, little if any dependencies should + need to be defined explicitly. However, if you do configure + explicit dependencies, only refer to unit names listed on + systemd.special(7) + or names introduced by your own package to keep the unit file + operating system-independent.

  6. Make sure to include an + "[Install]" section including installation + information for the unit file. See + systemd.unit(5) + for details. To activate your service on boot, make sure to + add a WantedBy=multi-user.target or + WantedBy=graphical.target directive. To + activate your socket on boot, make sure to add + WantedBy=sockets.target. Usually, you also + want to make sure that when your service is installed, your + socket is installed too, hence add + Also=foo.socket in your service file + foo.service, for a hypothetical program + foo.

Installing Systemd Service Files¶

At the build installation time (e.g. make + install during package build), packages are + recommended to install their systemd unit files in the directory + returned by pkg-config systemd + --variable=systemdsystemunitdir (for system services) + or pkg-config systemd + --variable=systemduserunitdir (for user services). + This will make the services available in the system on explicit + request but not activate them automatically during boot. + Optionally, during package installation (e.g. rpm + -i by the administrator), symlinks should be created + in the systemd configuration directories via the + enable command of the + systemctl(1) + tool to activate them automatically on boot.

Packages using + autoconf(1) + are recommended to use a configure script + excerpt like the following to determine the + unit installation path during source + configuration:

PKG_PROG_PKG_CONFIG
 AC_ARG_WITH([systemdsystemunitdir],
      [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
      [with_systemdsystemunitdir=auto])
@@ -561,39 +393,37 @@ AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitd
      def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
 
      AS_IF([test "x$def_systemdsystemunitdir" = "x"],
-         [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
-                [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
-          with_systemdsystemunitdir=no],
-         [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+   [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+    [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
+    with_systemdsystemunitdir=no],
+   [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
       [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
 AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])

This snippet allows automatic - installation of the unit files on systemd - machines, and optionally allows their - installation even on machines lacking - systemd. (Modification of this snippet for the - user unit directory is left as an exercise for the - reader.)

Additionally, to ensure that - make distcheck continues to - work, it is recommended to add the following - to the top-level Makefile.am - file in - automake(1)-based - projects:

DISTCHECK_CONFIGURE_FLAGS = \
-        --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)

Finally, unit files should be installed in the system with an automake excerpt like the following:

if HAVE_SYSTEMD
+      installation of the unit files on systemd
+      machines, and optionally allows their
+      installation even on machines lacking
+      systemd. (Modification of this snippet for the
+      user unit directory is left as an exercise for the
+      reader.)

Additionally, to ensure that + make distcheck continues to + work, it is recommended to add the following + to the top-level Makefile.am + file in + automake(1)-based + projects:

DISTCHECK_CONFIGURE_FLAGS = \
+  --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)

Finally, unit files should be installed in the system with an automake excerpt like the following:

if HAVE_SYSTEMD
 systemdsystemunit_DATA = \
-        foobar.socket \
-        foobar.service
+  foobar.socket \
+  foobar.service
 endif

In the - rpm(8) - .spec file, use snippets - like the following to enable/disable the - service during - installation/deinstallation. This makes use of - the RPM macros shipped along systemd. Consult - the packaging guidelines of your distribution - for details and the equivalent for other - package managers.

At the top of the file:

BuildRequires: systemd
+      rpm(8)
+      .spec file, use snippets like the following
+      to enable/disable the service during
+      installation/deinstallation. This makes use of the RPM macros
+      shipped along systemd. Consult the packaging guidelines of your
+      distribution for details and the equivalent for other package
+      managers.

At the top of the file:

BuildRequires: systemd
 %{?systemd_requires}

And as scriptlets, further down:

%post
 %systemd_post foobar.service foobar.socket
 
@@ -601,90 +431,68 @@ endif

In the %systemd_preun foobar.service foobar.socket %postun -%systemd_postun

If the service shall be restarted during - upgrades, replace the - "%postun" scriptlet above - with the following:

%postun
-%systemd_postun_with_restart foobar.service

Note that - "%systemd_post" and - "%systemd_preun" expect the - names of all units that are installed/removed - as arguments, separated by - spaces. "%systemd_postun" - expects no - arguments. "%systemd_postun_with_restart" - expects the units to restart as - arguments.

To facilitate upgrades from a package - version that shipped only SysV init scripts to - a package version that ships both a SysV init - script and a native systemd service file, use - a fragment like the following:

%triggerun -- foobar < 0.47.11-1
+%systemd_postun

If the service shall be restarted during upgrades, replace + the "%postun" scriptlet above with the + following:

%postun
+%systemd_postun_with_restart foobar.service

Note that "%systemd_post" and + "%systemd_preun" expect the names of all units + that are installed/removed as arguments, separated by spaces. + "%systemd_postun" expects no arguments. + "%systemd_postun_with_restart" expects the + units to restart as arguments.

To facilitate upgrades from a package version that shipped + only SysV init scripts to a package version that ships both a + SysV init script and a native systemd service file, use a + fragment like the following:

%triggerun -- foobar < 0.47.11-1
 if /sbin/chkconfig --level 5 foobar ; then
-        /bin/systemctl --no-reload enable foobar.service foobar.socket >/dev/null 2>&1 || :
-fi

Where 0.47.11-1 is the first package - version that includes the native unit - file. This fragment will ensure that the first - time the unit file is installed, it will be - enabled if and only if the SysV init script is - enabled, thus making sure that the enable - status is not changed. Note that - chkconfig is a command - specific to Fedora which can be used to check - whether a SysV init script is enabled. Other - operating systems will have to use different - commands here.

Porting Existing Daemons¶

Since new-style init systems such as systemd are - compatible with traditional SysV init systems, it is - not strictly necessary to port existing daemons to the - new style. However, doing so offers additional - functionality to the daemons as well as simplifying - integration into new-style init systems.

To port an existing SysV compatible daemon, the - following steps are recommended:

  1. If not already implemented, - add an optional command line switch to the - daemon to disable daemonization. This is - useful not only for using the daemon in - new-style init systems, but also to ease - debugging.

  2. If the daemon offers - interfaces to other software running on the - local system via local AF_UNIX sockets, - consider implementing socket-based activation - (see above). Usually, a minimal patch is - sufficient to implement this: Extend the - socket creation in the daemon code so that - sd_listen_fds(3) - is checked for already passed sockets - first. If sockets are passed (i.e. when - sd_listen_fds() returns a - positive value), skip the socket creation step - and use the passed sockets. Secondly, ensure - that the file system socket nodes for local - AF_UNIX sockets used in the socket-based - activation are not removed when the daemon - shuts down, if sockets have been - passed. Third, if the daemon normally closes - all remaining open file descriptors as part of - its initialization, the sockets passed from - the init system must be spared. Since - new-style init systems guarantee that no - left-over file descriptors are passed to - executed processes, it might be a good choice - to simply skip the closing of all remaining - open file descriptors if sockets are - passed.

  3. Write and install a systemd - unit file for the service (and the sockets if - socket-based activation is used, as well as a - path unit file, if the daemon processes a - spool directory), see above for - details.

  4. If the daemon exposes - interfaces via D-Bus, write and install a - D-Bus activation file for the service, see - above for details.

Placing Daemon Data¶

It is recommended to follow the general - guidelines for placing package files, as discussed in - file-hierarchy(7).

+ /bin/systemctl --no-reload enable foobar.service foobar.socket >/dev/null 2>&1 || : +fi

Where 0.47.11-1 is the first package version that includes + the native unit file. This fragment will ensure that the first + time the unit file is installed, it will be enabled if and only + if the SysV init script is enabled, thus making sure that the + enable status is not changed. Note that + chkconfig is a command specific to Fedora + which can be used to check whether a SysV init script is + enabled. Other operating systems will have to use different + commands here.

Porting Existing Daemons¶

Since new-style init systems such as systemd are compatible + with traditional SysV init systems, it is not strictly necessary + to port existing daemons to the new style. However, doing so + offers additional functionality to the daemons as well as + simplifying integration into new-style init systems.

To port an existing SysV compatible daemon, the following + steps are recommended:

  1. If not already implemented, add an optional + command line switch to the daemon to disable daemonization. This + is useful not only for using the daemon in new-style init + systems, but also to ease debugging.

  2. If the daemon offers interfaces to other + software running on the local system via local + AF_UNIX sockets, consider implementing + socket-based activation (see above). Usually, a minimal patch is + sufficient to implement this: Extend the socket creation in the + daemon code so that + sd_listen_fds(3) + is checked for already passed sockets first. If sockets are + passed (i.e. when sd_listen_fds() returns a + positive value), skip the socket creation step and use the + passed sockets. Secondly, ensure that the file system socket + nodes for local AF_UNIX sockets used in the + socket-based activation are not removed when the daemon shuts + down, if sockets have been passed. Third, if the daemon normally + closes all remaining open file descriptors as part of its + initialization, the sockets passed from the init system must be + spared. Since new-style init systems guarantee that no left-over + file descriptors are passed to executed processes, it might be a + good choice to simply skip the closing of all remaining open + file descriptors if sockets are passed.

  3. Write and install a systemd unit file for the + service (and the sockets if socket-based activation is used, as + well as a path unit file, if the daemon processes a spool + directory), see above for details.

  4. If the daemon exposes interfaces via D-Bus, + write and install a D-Bus activation file for the service, see + above for details.

Placing Daemon Data¶

It is recommended to follow the general guidelines for + placing package files, as discussed in + file-hierarchy(7).

diff --git a/man/daemon.xml b/man/daemon.xml index 5d3a9903d..a8bbfc055 100644 --- a/man/daemon.xml +++ b/man/daemon.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - halt - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - halt - 8 - - - - halt - poweroff - reboot - Halt, power-off or reboot the machine - - - - - halt OPTIONS - - - poweroff OPTIONS - - - reboot OPTIONS - - - - - Description - - halt, - poweroff, reboot - may be used to halt, power-off or reboot the - machine. - - - - - Options - - The following options are understood: - - - - - - - - - - - - Halt the machine, - regardless of which one of the three - commands is invoked. - - - - - - - Power-off the machine, - regardless of which one of the three - commands is invoked. - - - - - - Reboot the machine, - regardless of which one of the three - commands is invoked. - - - - - - - Force immediate halt, - power-off, reboot. Do not contact the - init system. - - - - - - - Only write wtmp - shutdown entry, do not actually halt, - power-off, reboot. - - - - - - - Do not write wtmp - shutdown entry. - - - - - - Do not send wall - message before - halt, power-off, reboot. - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - Notes - - These are legacy commands available for - compatibility only. - - - - See Also - - systemd1, - systemctl1, - shutdown8, - wall1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + halt + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + halt + 8 + + + + halt + poweroff + reboot + Halt, power-off or reboot the machine + + + + + halt + OPTIONS + + + poweroff + OPTIONS + + + reboot + OPTIONS + + + + + Description + + halt, poweroff, + reboot may be used to halt, power-off or reboot + the machine. + + + + + Options + + The following options are understood: + + + + + + + + + + + + Halt the machine, regardless of which one of + the three commands is invoked. + + + + + + + Power-off the machine, regardless of which one + of the three commands is invoked. + + + + + + Reboot the machine, regardless of which one of + the three commands is invoked. + + + + + + + Force immediate halt, power-off, reboot. Do + not contact the init system. + + + + + + + Only write wtmp shutdown entry, do not + actually halt, power-off, reboot. + + + + + + + Do not write wtmp shutdown + entry. + + + + + + Do not send wall message before halt, + power-off, reboot. + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + Notes + + These are legacy commands available for compatibility + only. + + + + See Also + + systemd1, + systemctl1, + shutdown8, + wall1 + + diff --git a/man/hostname.5 b/man/hostname.5 index e290999a3..f19e267c9 100644 --- a/man/hostname.5 +++ b/man/hostname.5 @@ -1,5 +1,5 @@ '\" t -.TH "HOSTNAME" "5" "" "systemd 218" "hostname" +.TH "HOSTNAME" "5" "" "systemd 219" "hostname" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/hostname.html b/man/hostname.html index 1328a5100..71b1c4f0a 100644 --- a/man/hostname.html +++ b/man/hostname.html @@ -19,35 +19,31 @@ Directives · Python · libudev · - gudev systemd 218

Name

hostname — Local hostname configuration file

Synopsis

/etc/hostname

Description¶

The /etc/hostname file - configures the name of the local system that is set - during boot using the - sethostname(2) - system call. It should contain a single - newline-terminated hostname string. The - hostname may be a free-form string up to 64 characters - in length; however, it is recommended that it consists - only of 7-bit ASCII lower-case characters and no spaces or dots, - and limits itself to the format allowed for DNS domain - name labels, even though this is not a - strict requirement.

Depending on the operating system, other - configuration files might be checked for configuration - of the hostname as well, however only as fallback.

You may use - hostnamectl(1) - to change the value of this file during runtime from - the command line. Use - systemd-firstboot(1) - to initialize it on mounted (but not booted) system - images.

History¶

The simple configuration file format of - /etc/hostname originates from - Debian GNU/Linux.

+ gudev systemd 219

Name

hostname — Local hostname configuration file

Synopsis

/etc/hostname

Description¶

The /etc/hostname file configures the + name of the local system that is set during boot using the + sethostname(2) + system call. It should contain a single newline-terminated + hostname string. The hostname may be a free-form string up to 64 + characters in length; however, it is recommended that it consists + only of 7-bit ASCII lower-case characters and no spaces or dots, + and limits itself to the format allowed for DNS domain name + labels, even though this is not a strict requirement.

Depending on the operating system, other configuration files + might be checked for configuration of the hostname as well, + however only as fallback.

You may use + hostnamectl(1) + to change the value of this file during runtime from the command + line. Use + systemd-firstboot(1) + to initialize it on mounted (but not booted) system images.

History¶

The simple configuration file format of + /etc/hostname originates from Debian + GNU/Linux.

diff --git a/man/hostname.xml b/man/hostname.xml index 2f949dedd..5d3d46d8c 100644 --- a/man/hostname.xml +++ b/man/hostname.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - hostname - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - hostname - 5 - - - - hostname - Local hostname configuration file - - - - /etc/hostname - - - - Description - - The /etc/hostname file - configures the name of the local system that is set - during boot using the - sethostname2 - system call. It should contain a single - newline-terminated hostname string. The - hostname may be a free-form string up to 64 characters - in length; however, it is recommended that it consists - only of 7-bit ASCII lower-case characters and no spaces or dots, - and limits itself to the format allowed for DNS domain - name labels, even though this is not a - strict requirement. - - Depending on the operating system, other - configuration files might be checked for configuration - of the hostname as well, however only as fallback. - - You may use - hostnamectl1 - to change the value of this file during runtime from - the command line. Use - systemd-firstboot1 - to initialize it on mounted (but not booted) system - images. - - - - History - - The simple configuration file format of - /etc/hostname originates from - Debian GNU/Linux. - - - - See Also - - systemd1, - sethostname2, - hostname1, - hostname7, - machine-id5, - machine-info5, - hostnamectl1, - systemd-hostnamed.service8, - systemd-firstboot1 - - + + hostname + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + hostname + 5 + + + + hostname + Local hostname configuration file + + + + /etc/hostname + + + + Description + + The /etc/hostname file configures the + name of the local system that is set during boot using the + sethostname2 + system call. It should contain a single newline-terminated + hostname string. The hostname may be a free-form string up to 64 + characters in length; however, it is recommended that it consists + only of 7-bit ASCII lower-case characters and no spaces or dots, + and limits itself to the format allowed for DNS domain name + labels, even though this is not a strict requirement. + + Depending on the operating system, other configuration files + might be checked for configuration of the hostname as well, + however only as fallback. + + You may use + hostnamectl1 + to change the value of this file during runtime from the command + line. Use + systemd-firstboot1 + to initialize it on mounted (but not booted) system images. + + + + History + + The simple configuration file format of + /etc/hostname originates from Debian + GNU/Linux. + + + + See Also + + systemd1, + sethostname2, + hostname1, + hostname7, + machine-id5, + machine-info5, + hostnamectl1, + systemd-hostnamed.service8, + systemd-firstboot1 + + diff --git a/man/hostnamectl.1 b/man/hostnamectl.1 index 08bf2b8de..79263f7f6 100644 --- a/man/hostnamectl.1 +++ b/man/hostnamectl.1 @@ -1,5 +1,5 @@ '\" t -.TH "HOSTNAMECTL" "1" "" "systemd 218" "hostnamectl" +.TH "HOSTNAMECTL" "1" "" "systemd 219" "hostnamectl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -130,8 +130,7 @@ Set the chassis type to "tablet", "handset", "watch", -"embedded" -as well as the special chassis types +"embedded", as well as the special chassis types "vm" and "container" diff --git a/man/hostnamectl.html b/man/hostnamectl.html index f3fe92e91..010568bef 100644 --- a/man/hostnamectl.html +++ b/man/hostnamectl.html @@ -19,43 +19,33 @@ Directives · Python · libudev · - gudev systemd 218

Name

hostnamectl — Control the system hostname

Synopsis

hostnamectl [OPTIONS...] {COMMAND}

Description¶

hostnamectl may be used to - query and change the system hostname and related - settings.

This tool distinguishes three different - hostnames: the high-level "pretty" hostname which - might include all kinds of special characters - (e.g. "Lennart's Laptop"), the static hostname which - is used to initialize the kernel hostname at boot - (e.g. "lennarts-laptop"), and the transient hostname - which is a default received from network configuration. - If a static hostname is set, and is valid (something other - than localhost), then the transient hostname is not used.

Note that the pretty hostname has little - restrictions on the characters used, while the static - and transient hostnames are limited to the usually - accepted characters of Internet domain names.

The static hostname is stored in - /etc/hostname, see - hostname(5) - for more information. The pretty hostname, chassis - type, and icon name are stored in - /etc/machine-info, see - machine-info(5).

Use - systemd-firstboot(1) - to initialize the system host name for mounted (but - not booted) system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user - for authentication for privileged - operations.

--static, --transient, --pretty¶

If - status is used (or - no explicit command is given) and one - of those fields is given, - hostnamectl will - print out just this selected - hostname.

If used with - set-hostname, only - the selected hostname(s) will be - updated. When more than one of those - options is used, all the specified - hostnames will be updated. -

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

hostnamectl — Control the system hostname

Synopsis

hostnamectl [OPTIONS...] {COMMAND}

Description¶

hostnamectl may be used to query and + change the system hostname and related settings.

This tool distinguishes three different hostnames: the + high-level "pretty" hostname which might include all kinds of + special characters (e.g. "Lennart's Laptop"), the static hostname + which is used to initialize the kernel hostname at boot (e.g. + "lennarts-laptop"), and the transient hostname which is a default + received from network configuration. If a static hostname is set, + and is valid (something other than localhost), then the transient + hostname is not used.

Note that the pretty hostname has little restrictions on the + characters used, while the static and transient hostnames are + limited to the usually accepted characters of Internet domain + names.

The static hostname is stored in + /etc/hostname, see + hostname(5) + for more information. The pretty hostname, chassis type, and icon + name are stored in /etc/machine-info, see + machine-info(5).

Use + systemd-firstboot(1) + to initialize the system host name for mounted (but not booted) + system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user for authentication for + privileged operations.

--static, --transient, --pretty¶

If status is used (or no + explicit command is given) and one of those fields is given, + hostnamectl will print out just this + selected hostname.

If used with set-hostname, only the + selected hostname(s) will be updated. When more than one of + those options is used, all the specified hostnames will be + updated.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -66,96 +56,69 @@ HOST.

-M, --machine=¶

Execute operation on a local container. Specify a container name to connect to.

-h, --help¶

Print a short help text and exit.

--version¶

Print a short version string and exit.

The following commands are understood:

status¶

Show current system - hostname and related - information.

set-hostname NAME¶

Set the system - hostname to - NAME. By - default, this will alter the pretty, - the static, and the transient hostname - alike; however, if one or more of - --static, - --transient, - --pretty are used, - only the selected hostnames are - changed. If the pretty hostname is - being set, and static or transient are - being set as well, the specified - hostname will be simplified in regards - to the character set used before the - latter are updated. This is done by - replacing spaces with - "-" and removing - special characters. This ensures that - the pretty and the static hostname are - always closely related while still - following the validity rules of the - specific name. This simplification of - the hostname string is not done if - only the transient and/or static host - names are set, and the pretty host - name is left untouched.

Pass the empty string - "" as the hostname to - reset the selected hostnames to their - default (usually - "localhost").

set-icon-name NAME¶

Set the system icon - name to - NAME. The - icon name is used by some graphical - applications to visualize this host. - The icon name should follow the Icon - Naming Specification.

Pass an empty string to reset - the icon name to the default value, - which is determined from chassis type - (see below) and possibly other - parameters.

set-chassis TYPE¶

Set the chassis type - to TYPE. - The chassis type is used by some - graphical applications to visualize - the host or alter user interaction. - Currently, the following chassis types - are defined: - "desktop", - "laptop", - "server", - "tablet", - "handset", - "watch", - "embedded" as well as - the special chassis types - "vm" and - "container" for - virtualized systems that lack an - immediate physical chassis.

Pass an empty string to reset - the chassis type to the default value - which is determined from the firmware - and possibly other parameters.

set-deployment ENVIRONMENT¶

Set the deployment - environment - description. ENVIRONMENT - must be a single word without any - control characters. One of the - following is suggested: - "development", - "integration", - "staging", - "production". -

Pass an empty string to reset to - the default empty value.

set-location LOCATION¶

Set the location - string for the system, if it is - known. LOCATION - should be a human-friendly, free-form - string describing the physical - location of the system, if it is known - and applicable. This may be as generic - as "Berlin, Germany" - or as specific as "Left Rack, - 2nd Shelf".

Pass an empty string to reset to - the default empty value.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ hostname and related + information.

set-hostname NAME¶

Set the system hostname to + NAME. By default, this will alter + the pretty, the static, and the transient hostname alike; + however, if one or more of --static, + --transient, --pretty are + used, only the selected hostnames are changed. If the pretty + hostname is being set, and static or transient are being set + as well, the specified hostname will be simplified in regards + to the character set used before the latter are updated. This + is done by replacing spaces with "-" and + removing special characters. This ensures that the pretty and + the static hostname are always closely related while still + following the validity rules of the specific name. This + simplification of the hostname string is not done if only the + transient and/or static host names are set, and the pretty + host name is left untouched.

Pass the empty string "" as the + hostname to reset the selected hostnames to their default + (usually "localhost").

set-icon-name NAME¶

Set the system icon name to + NAME. The icon name is used by some + graphical applications to visualize this host. The icon name + should follow the Icon + Naming Specification.

Pass an empty string to reset the icon name to the + default value, which is determined from chassis type (see + below) and possibly other parameters.

set-chassis TYPE¶

Set the chassis type to + TYPE. The chassis type is used by + some graphical applications to visualize the host or alter + user interaction. Currently, the following chassis types are + defined: + "desktop", + "laptop", + "server", + "tablet", + "handset", + "watch", + "embedded", + as well as the special chassis types + "vm" and + "container" for virtualized systems that lack + an immediate physical chassis.

Pass an empty string to reset the chassis type to the + default value which is determined from the firmware and + possibly other parameters.

set-deployment ENVIRONMENT¶

Set the deployment environment description. + ENVIRONMENT must be a single word + without any control characters. One of the following is + suggested: + "development", + "integration", + "staging", + "production". +

Pass an empty string to reset to the default empty + value.

set-location LOCATION¶

Set the location string for the system, if it + is known. LOCATION should be a + human-friendly, free-form string describing the physical + location of the system, if it is known and applicable. This + may be as generic as "Berlin, Germany" or as + specific as "Left Rack, 2nd Shelf".

Pass an empty string to reset to the default empty + value.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml index de154020d..b1f038156 100644 --- a/man/hostnamectl.xml +++ b/man/hostnamectl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - hostnamectl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - hostnamectl - 1 - - - - hostnamectl - Control the system hostname - - - - - hostnamectl - OPTIONS - COMMAND - - - - - Description - - hostnamectl may be used to - query and change the system hostname and related - settings. - - This tool distinguishes three different - hostnames: the high-level "pretty" hostname which - might include all kinds of special characters - (e.g. "Lennart's Laptop"), the static hostname which - is used to initialize the kernel hostname at boot - (e.g. "lennarts-laptop"), and the transient hostname - which is a default received from network configuration. - If a static hostname is set, and is valid (something other - than localhost), then the transient hostname is not used. - - Note that the pretty hostname has little - restrictions on the characters used, while the static - and transient hostnames are limited to the usually - accepted characters of Internet domain names. - - The static hostname is stored in - /etc/hostname, see - hostname5 - for more information. The pretty hostname, chassis - type, and icon name are stored in - /etc/machine-info, see - machine-info5. - - Use - systemd-firstboot1 - to initialize the system host name for mounted (but - not booted) system images. - - - - Options - - The following options are understood: - - - - - - Do not query the user - for authentication for privileged - operations. - - - - - - - - If - status is used (or - no explicit command is given) and one - of those fields is given, - hostnamectl will - print out just this selected - hostname. - - If used with - set-hostname, only - the selected hostname(s) will be - updated. When more than one of those - options is used, all the specified - hostnames will be updated. - - - - - - - - - - - The following commands are understood: - - - - status - - Show current system - hostname and related - information. - - - - set-hostname NAME - - Set the system - hostname to - NAME. By - default, this will alter the pretty, - the static, and the transient hostname - alike; however, if one or more of - , - , - are used, - only the selected hostnames are - changed. If the pretty hostname is - being set, and static or transient are - being set as well, the specified - hostname will be simplified in regards - to the character set used before the - latter are updated. This is done by - replacing spaces with - - and removing - special characters. This ensures that - the pretty and the static hostname are - always closely related while still - following the validity rules of the - specific name. This simplification of - the hostname string is not done if - only the transient and/or static host - names are set, and the pretty host - name is left untouched. - - Pass the empty string - as the hostname to - reset the selected hostnames to their - default (usually - localhost). - - - - set-icon-name NAME - - Set the system icon - name to - NAME. The - icon name is used by some graphical - applications to visualize this host. - The icon name should follow the Icon - Naming Specification. - - Pass an empty string to reset - the icon name to the default value, - which is determined from chassis type - (see below) and possibly other - parameters. - - - - set-chassis TYPE - - Set the chassis type - to TYPE. - The chassis type is used by some - graphical applications to visualize - the host or alter user interaction. - Currently, the following chassis types - are defined: - desktop, - laptop, - server, - tablet, - handset, - watch, - embedded as well as - the special chassis types - vm and - container for - virtualized systems that lack an - immediate physical chassis. - - Pass an empty string to reset - the chassis type to the default value - which is determined from the firmware - and possibly other parameters. - - - - - set-deployment ENVIRONMENT - - Set the deployment - environment - description. ENVIRONMENT - must be a single word without any - control characters. One of the - following is suggested: - development, - integration, - staging, - production. - - - Pass an empty string to reset to - the default empty value. - - - - - set-location LOCATION - - Set the location - string for the system, if it is - known. LOCATION - should be a human-friendly, free-form - string describing the physical - location of the system, if it is known - and applicable. This may be as generic - as Berlin, Germany - or as specific as Left Rack, - 2nd Shelf. - - Pass an empty string to reset to - the default empty value. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - hostname1, - hostname5, - machine-info5, - systemctl1, - systemd-hostnamed.service8, - systemd-firstboot1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + hostnamectl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + hostnamectl + 1 + + + + hostnamectl + Control the system hostname + + + + + hostnamectl + OPTIONS + COMMAND + + + + + Description + + hostnamectl may be used to query and + change the system hostname and related settings. + + This tool distinguishes three different hostnames: the + high-level "pretty" hostname which might include all kinds of + special characters (e.g. "Lennart's Laptop"), the static hostname + which is used to initialize the kernel hostname at boot (e.g. + "lennarts-laptop"), and the transient hostname which is a default + received from network configuration. If a static hostname is set, + and is valid (something other than localhost), then the transient + hostname is not used. + + Note that the pretty hostname has little restrictions on the + characters used, while the static and transient hostnames are + limited to the usually accepted characters of Internet domain + names. + + The static hostname is stored in + /etc/hostname, see + hostname5 + for more information. The pretty hostname, chassis type, and icon + name are stored in /etc/machine-info, see + machine-info5. + + Use + systemd-firstboot1 + to initialize the system host name for mounted (but not booted) + system images. + + + + Options + + The following options are understood: + + + + + + Do not query the user for authentication for + privileged operations. + + + + + + + + If status is used (or no + explicit command is given) and one of those fields is given, + hostnamectl will print out just this + selected hostname. + + If used with set-hostname, only the + selected hostname(s) will be updated. When more than one of + those options is used, all the specified hostnames will be + updated. + + + + + + + + + + The following commands are understood: + + + + status + + Show current system + hostname and related + information. + + + + set-hostname NAME + + Set the system hostname to + NAME. By default, this will alter + the pretty, the static, and the transient hostname alike; + however, if one or more of , + , are + used, only the selected hostnames are changed. If the pretty + hostname is being set, and static or transient are being set + as well, the specified hostname will be simplified in regards + to the character set used before the latter are updated. This + is done by replacing spaces with - and + removing special characters. This ensures that the pretty and + the static hostname are always closely related while still + following the validity rules of the specific name. This + simplification of the hostname string is not done if only the + transient and/or static host names are set, and the pretty + host name is left untouched. + + Pass the empty string as the + hostname to reset the selected hostnames to their default + (usually localhost). + + + + set-icon-name NAME + + Set the system icon name to + NAME. The icon name is used by some + graphical applications to visualize this host. The icon name + should follow the Icon + Naming Specification. + + Pass an empty string to reset the icon name to the + default value, which is determined from chassis type (see + below) and possibly other parameters. + + + + set-chassis TYPE + + Set the chassis type to + TYPE. The chassis type is used by + some graphical applications to visualize the host or alter + user interaction. Currently, the following chassis types are + defined: + desktop, + laptop, + server, + tablet, + handset, + watch, + embedded, + as well as the special chassis types + vm and + container for virtualized systems that lack + an immediate physical chassis. + + Pass an empty string to reset the chassis type to the + default value which is determined from the firmware and + possibly other parameters. + + + + + set-deployment ENVIRONMENT + + Set the deployment environment description. + ENVIRONMENT must be a single word + without any control characters. One of the following is + suggested: + development, + integration, + staging, + production. + + + Pass an empty string to reset to the default empty + value. + + + + + set-location LOCATION + + Set the location string for the system, if it + is known. LOCATION should be a + human-friendly, free-form string describing the physical + location of the system, if it is known and applicable. This + may be as generic as Berlin, Germany or as + specific as Left Rack, 2nd Shelf. + + Pass an empty string to reset to the default empty + value. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + hostname1, + hostname5, + machine-info5, + systemctl1, + systemd-hostnamed.service8, + systemd-firstboot1 + + diff --git a/man/hwdb.7 b/man/hwdb.7 new file mode 100644 index 000000000..a0fba2b4c --- /dev/null +++ b/man/hwdb.7 @@ -0,0 +1,60 @@ +'\" t +.TH "HWDB" "7" "" "systemd 219" "hwdb" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +hwdb \- Hardware Database +.SH "DESCRIPTION" +.PP +The hardware database is a key\-value store for associating modalias\-like keys to udev\-properties\-like values\&. It is used primarily by udev to add the relevant properties to matching devices, but it can also be queried directly\&. +.SH "HARDWARE DATABASE FILES" +.PP +The hwdb files are read from the files located in the system hwdb directory +/usr/lib/udev/hwdb\&.d, the volatile runtime directory +/run/udev/hwdb\&.d +and the local administration directory +/etc/udev/hwdb\&.d\&. All hwdb files are collectively sorted and processed in lexical order, regardless of the directories in which they live\&. However, files with identical filenames replace each other\&. Files in +/etc +have the highest priority, files in +/run +take precedence over files with the same name in +/usr/lib\&. This can be used to override a system\-supplied hwdb file with a local file if needed; a symlink in +/etc +with the same name as a hwdb file in +/usr/lib, pointing to +/dev/null, disables the hwdb file entirely\&. hwdb files must have the extension +\&.hwdb; other extensions are ignored\&. +.PP +The hwdb file contains data records consisting of matches and associated key\-value pairs\&. Every record in the hwdb starts with one or more match string, specifying a shell glob to compare the database lookup string against\&. Multiple match lines are specified in additional consecutive lines\&. Every match line is compared indivdually, they are combined by OR\&. Every match line must start at the first character of the line\&. +.PP +The match lines are followed by one or more key\-value pair lines, which are recognized by a leading space character\&. The key name and value are separated by +"="\&. An empty line signifies the end of a record\&. Lines beginning with +"#" +are ignored\&. +.PP +The content of all hwdb files is read by +\fBsystemd-hwdb\fR(8) +and compiled to a binary database located at +/etc/udev/hwdb\&.bin, or alternatively +/usr/lib/udev/hwdb\&.bin +if you want ship the compiled database in an immutable image\&. During runtime only the binary database is used\&. +.SH "SEE ALSO" +.PP +\fBsystemd-hwdb\fR(8) diff --git a/man/hwdb.html b/man/hwdb.html new file mode 100644 index 000000000..908a42b8e --- /dev/null +++ b/man/hwdb.html @@ -0,0 +1,53 @@ +hwdbIndex · + Directives · + Python · + libudev · + gudev systemd 219

Name

hwdb — Hardware Database

Description¶

The hardware database is a key-value store for associating modalias-like keys to + udev-properties-like values. It is used primarily by udev to add the relevant properties + to matching devices, but it can also be queried directly.

Hardware Database Files¶

The hwdb files are read from the files located in the + system hwdb directory /usr/lib/udev/hwdb.d, + the volatile runtime directory /run/udev/hwdb.d + and the local administration directory /etc/udev/hwdb.d. + All hwdb files are collectively sorted and processed in lexical order, + regardless of the directories in which they live. However, files with + identical filenames replace each other. Files in /etc + have the highest priority, files in /run take precedence + over files with the same name in /usr/lib. This can be + used to override a system-supplied hwdb file with a local file if needed; + a symlink in /etc with the same name as a hwdb file in + /usr/lib, pointing to /dev/null, + disables the hwdb file entirely. hwdb files must have the extension + .hwdb; other extensions are ignored.

The hwdb file contains data records consisting of matches and + associated key-value pairs. Every record in the hwdb starts with one or + more match string, specifying a shell glob to compare the database + lookup string against. Multiple match lines are specified in additional + consecutive lines. Every match line is compared indivdually, they are + combined by OR. Every match line must start at the first character of + the line.

The match lines are followed by one or more key-value pair lines, which + are recognized by a leading space character. The key name and value are separated + by "=". An empty line signifies the end + of a record. Lines beginning with "#" are ignored.

The content of all hwdb files is read by + systemd-hwdb(8) + and compiled to a binary database located at /etc/udev/hwdb.bin, + or alternatively /usr/lib/udev/hwdb.bin if you want ship the compiled + database in an immutable image. + During runtime only the binary database is used.

See Also¶

+ systemd-hwdb(8) +

diff --git a/man/hwdb.xml b/man/hwdb.xml new file mode 100644 index 000000000..b4460c1ae --- /dev/null +++ b/man/hwdb.xml @@ -0,0 +1,86 @@ + + + + + + hwdb + systemd + + + Developer + Kay + Sievers + kay@vrfy.org + + + Developer + Tom + Gundersen + teg@jklm.no + + + + + + hwdb + 7 + + + + hwdb + Hardware Database + + + Description + The hardware database is a key-value store for associating modalias-like keys to + udev-properties-like values. It is used primarily by udev to add the relevant properties + to matching devices, but it can also be queried directly. + + + Hardware Database Files + The hwdb files are read from the files located in the + system hwdb directory /usr/lib/udev/hwdb.d, + the volatile runtime directory /run/udev/hwdb.d + and the local administration directory /etc/udev/hwdb.d. + All hwdb files are collectively sorted and processed in lexical order, + regardless of the directories in which they live. However, files with + identical filenames replace each other. Files in /etc + have the highest priority, files in /run take precedence + over files with the same name in /usr/lib. This can be + used to override a system-supplied hwdb file with a local file if needed; + a symlink in /etc with the same name as a hwdb file in + /usr/lib, pointing to /dev/null, + disables the hwdb file entirely. hwdb files must have the extension + .hwdb; other extensions are ignored. + + The hwdb file contains data records consisting of matches and + associated key-value pairs. Every record in the hwdb starts with one or + more match string, specifying a shell glob to compare the database + lookup string against. Multiple match lines are specified in additional + consecutive lines. Every match line is compared indivdually, they are + combined by OR. Every match line must start at the first character of + the line. + + The match lines are followed by one or more key-value pair lines, which + are recognized by a leading space character. The key name and value are separated + by =. An empty line signifies the end + of a record. Lines beginning with # are ignored. + + The content of all hwdb files is read by + systemd-hwdb8 + and compiled to a binary database located at /etc/udev/hwdb.bin, + or alternatively /usr/lib/udev/hwdb.bin if you want ship the compiled + database in an immutable image. + During runtime only the binary database is used. + + + + See Also + + + systemd-hwdb8 + + + + diff --git a/man/index.html b/man/index.html index aba159e58..6df3538a7 100644 --- a/man/index.html +++ b/man/index.html @@ -19,6 +19,6 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.index — List all manpages from the systemd project

B¶

binfmt.d(5) -- Configure additional binary formats for executables at boot
bootchart.conf(5) -- Boot performance analysis graphing tool configuration files
bootchart.conf.d(5) -- Boot performance analysis graphing tool configuration files
bootctl(1) -- Control the firmware and boot manager settings
bootup(7) -- System bootup process
busctl(1) -- Introspect the bus

C¶

coredump.conf(5) -- Coredump storage configuration files
coredump.conf.d(5) -- Coredump storage configuration files
coredumpctl(1) -- Retrieve coredumps from the journal
crypttab(5) -- Configuration for encrypted block devices

D¶

daemon(7) -- Writing and packaging system daemons

F¶

file-hierarchy(7) -- File system hierarchy overview

H¶

halt(8) -- Halt, power-off or reboot the machine
hostname(5) -- Local hostname configuration file
hostnamectl(1) -- Control the system hostname

I¶

init(1) -- systemd system and service manager

J¶

journalctl(1) -- Query the systemd journal
journald.conf(5) -- Journal service configuration files
journald.conf.d(5) -- Journal service configuration files

K¶

kernel-command-line(7) -- Kernel command line parameters
kernel-install(8) -- Add and remove kernel and initramfs images to and from /boot

L¶

locale.conf(5) -- Configuration file for locale settings
localectl(1) -- Control the system locale and keyboard layout settings
localtime(5) -- Local timezone configuration file
loginctl(1) -- Control the systemd login manager
logind.conf(5) -- Login manager configuration files
logind.conf.d(5) -- Login manager configuration files

M¶

machine-id(5) -- Local machine ID configuration file
machine-info(5) -- Local machine information file
machinectl(1) -- Control the systemd machine manager
modules-load.d(5) -- Configure kernel modules to load at boot

N¶

nss-myhostname(8) -- Provide hostname resolution for the locally configured system hostname.

O¶

os-release(5) -- Operating system identification

P¶

pam_systemd(8) -- Register user sessions in the systemd login manager
poweroff(8) -- Halt, power-off or reboot the machine

R¶

reboot(8) -- Halt, power-off or reboot the machine
resolved.conf(5) -- Network Name Resolution configuration files
resolved.conf.d(5) -- Network Name Resolution configuration files
runlevel(8) -- Print previous and current SysV runlevel

S¶

sd-daemon(3) -- APIs for new-style daemons
sd-id128(3) -- APIs for processing 128-bit IDs
sd-journal(3) -- APIs for submitting and querying log entries to and from the journal
sd-login(3) -- APIs for tracking logins
SD_ALERT(3) -- APIs for new-style daemons
sd_booted(3) -- Test whether the system is running the systemd init system
sd_bus_creds_get_audit_login_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_audit_session_id(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cgroup(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cmdline(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_connection_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_exe(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_gid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_mask(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_get_owner_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_pid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_selinux_context(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_session(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_slice(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unique_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_user_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_well_known_names(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_bounding_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_effective_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_inheritable_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_permitted_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_new_from_pid(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_ref(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_unref(3) -- Retrieve credentials object for the specified PID
sd_bus_default_system(3) -- Open a connection to the system or user bus
sd_bus_default_user(3) -- Open a connection to the system or user bus
sd_bus_error(3) -- sd-bus error handling
sd_bus_error_copy(3) -- sd-bus error handling
sd_bus_error_free(3) -- sd-bus error handling
sd_bus_error_get_errno(3) -- sd-bus error handling
sd_bus_error_has_name(3) -- sd-bus error handling
sd_bus_error_is_set(3) -- sd-bus error handling
sd_bus_error_set(3) -- sd-bus error handling
sd_bus_error_set_const(3) -- sd-bus error handling
sd_bus_error_set_errno(3) -- sd-bus error handling
sd_bus_error_set_errnof(3) -- sd-bus error handling
sd_bus_message_append(3) -- Attach parts of message based on a format string
sd_bus_message_append_array(3) -- Attach an array of items to a message
sd_bus_message_append_array_iovec(3) -- Attach an array of items to a message
sd_bus_message_append_array_memfd(3) -- Attach an array of items to a message
sd_bus_message_append_array_space(3) -- Attach an array of items to a message
sd_bus_message_append_basic(3) -- Attach a single part to a message
sd_bus_message_append_string_iovec(3) -- Attach a string to a message
sd_bus_message_append_string_memfd(3) -- Attach a string to a message
sd_bus_message_append_string_space(3) -- Attach a string to a message
sd_bus_message_append_strv(3) -- Attach an array of strings to a message
sd_bus_message_get_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_monotonic_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_realtime_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_reply_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_seqnum(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_negotiate_creds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_fds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_timestamps(3) -- Control feature negotiation on bus connections
sd_bus_new(3) -- Create a new bus object and create or destroy references to it
sd_bus_open_system(3) -- Open a connection to the system or user bus
sd_bus_open_system_container(3) -- Open a connection to the system or user bus
sd_bus_open_system_remote(3) -- Open a connection to the system or user bus
sd_bus_open_user(3) -- Open a connection to the system or user bus
sd_bus_path_decode(3) -- Convert an external identifier into an object path and back
sd_bus_path_encode(3) -- Convert an external identifier into an object path and back
sd_bus_ref(3) -- Create a new bus object and create or destroy references to it
sd_bus_release_name(3) -- Request or release a well-known name on a bus
sd_bus_request_name(3) -- Request or release a well-known name on a bus
sd_bus_unref(3) -- Create a new bus object and create or destroy references to it
SD_CRIT(3) -- APIs for new-style daemons
SD_DEBUG(3) -- APIs for new-style daemons
SD_EMERG(3) -- APIs for new-style daemons
SD_ERR(3) -- APIs for new-style daemons
sd_event_add_child(3) -- Add a child state change event source to an event loop
sd_event_add_defer(3) -- Add static event sources to an event loop
sd_event_add_exit(3) -- Add static event sources to an event loop
sd_event_add_post(3) -- Add static event sources to an event loop
sd_event_add_signal(3) -- Add a signal event source to an event loop
sd_event_add_time(3) -- Add a timer event source to an event loop
sd_event_default(3) -- Acquire and release an event loop object
sd_event_get_fd(3) -- Obtain a file descriptor to poll for event loop events
sd_event_get_name(3) -- Set human-readable names for event sources
sd_event_new(3) -- Acquire and release an event loop object
sd_event_ref(3) -- Acquire and release an event loop object
sd_event_set_name(3) -- Set human-readable names for event sources
sd_event_source_get_child_pid(3) -- Add a child state change event source to an event loop
sd_event_source_get_signal(3) -- Add a signal event source to an event loop
sd_event_source_get_time(3) -- Add a timer event source to an event loop
sd_event_source_get_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_source_get_time_clock(3) -- Add a timer event source to an event loop
sd_event_source_set_time(3) -- Add a timer event source to an event loop
sd_event_source_set_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_unref(3) -- Acquire and release an event loop object
sd_get_machine_names(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_seats(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_sessions(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_uids(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
SD_ID128_CONST_STR(3) -- APIs for processing 128-bit IDs
sd_id128_equal(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_STR(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_VAL(3) -- APIs for processing 128-bit IDs
sd_id128_from_string(3) -- Format or parse 128-bit IDs as strings
sd_id128_get_boot(3) -- Retrieve 128-bit IDs
sd_id128_get_machine(3) -- Retrieve 128-bit IDs
SD_ID128_MAKE(3) -- APIs for processing 128-bit IDs
sd_id128_randomize(3) -- Generate 128-bit IDs
sd_id128_t(3) -- APIs for processing 128-bit IDs
sd_id128_to_string(3) -- Format or parse 128-bit IDs as strings
SD_INFO(3) -- APIs for new-style daemons
sd_is_fifo(3) -- Check the type of a file descriptor
sd_is_mq(3) -- Check the type of a file descriptor
sd_is_socket(3) -- Check the type of a file descriptor
sd_is_socket_inet(3) -- Check the type of a file descriptor
sd_is_socket_unix(3) -- Check the type of a file descriptor
sd_is_special(3) -- Check the type of a file descriptor
sd_journal(3) -- Open the system journal for reading
sd_journal_add_conjunction(3) -- Add or remove entry matches
sd_journal_add_disjunction(3) -- Add or remove entry matches
sd_journal_add_match(3) -- Add or remove entry matches
SD_JOURNAL_APPEND(3) -- Journal change notification interface
sd_journal_close(3) -- Open the system journal for reading
SD_JOURNAL_CURRENT_USER(3) -- Open the system journal for reading
sd_journal_enumerate_data(3) -- Read data fields from the current journal entry
sd_journal_enumerate_unique(3) -- Read unique data fields from the journal
sd_journal_flush_matches(3) -- Add or remove entry matches
SD_JOURNAL_FOREACH(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_BACKWARDS(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_DATA(3) -- Read data fields from the current journal entry
SD_JOURNAL_FOREACH_UNIQUE(3) -- Read unique data fields from the journal
sd_journal_get_catalog(3) -- Retrieve message catalog entry
sd_journal_get_catalog_for_message_id(3) -- Retrieve message catalog entry
sd_journal_get_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_get_cutoff_monotonic_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_cutoff_realtime_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_data(3) -- Read data fields from the current journal entry
sd_journal_get_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_get_events(3) -- Journal change notification interface
sd_journal_get_fd(3) -- Journal change notification interface
sd_journal_get_monotonic_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_realtime_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_timeout(3) -- Journal change notification interface
sd_journal_get_usage(3) -- Journal disk usage
SD_JOURNAL_INVALIDATE(3) -- Journal change notification interface
SD_JOURNAL_LOCAL_ONLY(3) -- Open the system journal for reading
sd_journal_next(3) -- Advance or set back the read pointer in the journal
sd_journal_next_skip(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_NOP(3) -- Journal change notification interface
sd_journal_open(3) -- Open the system journal for reading
sd_journal_open_container(3) -- Open the system journal for reading
sd_journal_open_directory(3) -- Open the system journal for reading
sd_journal_open_files(3) -- Open the system journal for reading
sd_journal_perror(3) -- Submit log entries to the journal
sd_journal_previous(3) -- Advance or set back the read pointer in the journal
sd_journal_previous_skip(3) -- Advance or set back the read pointer in the journal
sd_journal_print(3) -- Submit log entries to the journal
sd_journal_printv(3) -- Submit log entries to the journal
sd_journal_process(3) -- Journal change notification interface
sd_journal_query_unique(3) -- Read unique data fields from the journal
sd_journal_reliable_fd(3) -- Journal change notification interface
sd_journal_restart_data(3) -- Read data fields from the current journal entry
sd_journal_restart_unique(3) -- Read unique data fields from the journal
SD_JOURNAL_RUNTIME_ONLY(3) -- Open the system journal for reading
sd_journal_seek_cursor(3) -- Seek to a position in the journal
sd_journal_seek_head(3) -- Seek to a position in the journal
sd_journal_seek_monotonic_usec(3) -- Seek to a position in the journal
sd_journal_seek_realtime_usec(3) -- Seek to a position in the journal
sd_journal_seek_tail(3) -- Seek to a position in the journal
sd_journal_send(3) -- Submit log entries to the journal
sd_journal_sendv(3) -- Submit log entries to the journal
sd_journal_set_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_stream_fd(3) -- Create log stream file descriptor to the journal
SD_JOURNAL_SUPPRESS_LOCATION(3) -- Submit log entries to the journal
SD_JOURNAL_SYSTEM(3) -- Open the system journal for reading
sd_journal_test_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_wait(3) -- Journal change notification interface
sd_listen_fds(3) -- Check for file descriptors passed by the system manager
SD_LISTEN_FDS_START(3) -- Check for file descriptors passed by the system manager
sd_login_monitor(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_flush(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_events(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_fd(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_timeout(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_new(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_unref(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_machine_get_class(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
sd_machine_get_ifindices(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
SD_NOTICE(3) -- APIs for new-style daemons
sd_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_peer_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_seat_can_graphical(3) -- Determine state of a specific seat
sd_seat_can_multi_session(3) -- Determine state of a specific seat
sd_seat_can_tty(3) -- Determine state of a specific seat
sd_seat_get_active(3) -- Determine state of a specific seat
sd_seat_get_sessions(3) -- Determine state of a specific seat
sd_session_get_class(3) -- Determine state of a specific session
sd_session_get_desktop(3) -- Determine state of a specific session
sd_session_get_display(3) -- Determine state of a specific session
sd_session_get_remote_host(3) -- Determine state of a specific session
sd_session_get_remote_user(3) -- Determine state of a specific session
sd_session_get_seat(3) -- Determine state of a specific session
sd_session_get_service(3) -- Determine state of a specific session
sd_session_get_state(3) -- Determine state of a specific session
sd_session_get_tty(3) -- Determine state of a specific session
sd_session_get_type(3) -- Determine state of a specific session
sd_session_get_uid(3) -- Determine state of a specific session
sd_session_get_vt(3) -- Determine state of a specific session
sd_session_is_active(3) -- Determine state of a specific session
sd_session_is_remote(3) -- Determine state of a specific session
sd_uid_get_display(3) -- Determine login state of a specific Unix user ID
sd_uid_get_seats(3) -- Determine login state of a specific Unix user ID
sd_uid_get_sessions(3) -- Determine login state of a specific Unix user ID
sd_uid_get_state(3) -- Determine login state of a specific Unix user ID
sd_uid_is_on_seat(3) -- Determine login state of a specific Unix user ID
SD_WARNING(3) -- APIs for new-style daemons
sd_watchdog_enabled(3) -- Check whether the service manager expects watchdog keep-alive notifications from a service
shutdown(8) -- Halt, power-off or reboot the machine
sleep.conf.d(5) -- Suspend and hibernation configuration file
sysctl.d(5) -- Configure kernel parameters at boot
system.conf.d(5) -- System and session service manager configuration files
systemctl(1) -- Control the systemd system and service manager
systemd(1) -- systemd system and service manager
systemd-activate(8) -- Test socket activation of daemons
systemd-analyze(1) -- Analyze system boot-up performance
systemd-ask-password(1) -- Query the user for a system password
systemd-ask-password-console.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-console.service(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.service(8) -- Query the user for system passwords on the console and via wall
systemd-backlight(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-backlight@.service(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-binfmt(8) -- Configure additional binary formats for executables at boot
systemd-binfmt.service(8) -- Configure additional binary formats for executables at boot
systemd-bootchart(1) -- Boot performance graphing tool
systemd-bus-proxyd(8) -- Connect STDIO or a socket to a given bus address
systemd-bus-proxyd.socket(8) -- Proxy classic D-Bus clients to kdbus
systemd-bus-proxyd@.service(8) -- Proxy classic D-Bus clients to kdbus
systemd-cat(1) -- Connect a pipeline or program's output with the journal
systemd-cgls(1) -- Recursively show control group contents
systemd-cgtop(1) -- Show top control groups by their resource usage
systemd-coredump(8) -- Log and store core dumps
systemd-cryptsetup(8) -- Full disk decryption logic
systemd-cryptsetup-generator(8) -- Unit generator for
systemd-cryptsetup@.service(8) -- Full disk decryption logic
systemd-debug-generator(8) -- Generator for enabling a runtime debug shell and masking specific units at boot
systemd-delta(1) -- Find overridden configuration files
systemd-detect-virt(1) -- Detect execution in a virtualized environment
systemd-efi-boot-generator(8) -- Generator for automatically mounting the EFI System Partition used by the current boot to
systemd-escape(1) -- Escape strings for usage in system unit names
systemd-firstboot(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-firstboot.service(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-fsck(8) -- File system checker logic
systemd-fsck-root.service(8) -- File system checker logic
systemd-fsck@.service(8) -- File system checker logic
systemd-fstab-generator(8) -- Unit generator for /etc/fstab
systemd-getty-generator(8) -- Generator for enabling getty instances on the console
systemd-gpt-auto-generator(8) -- Generator for automatically discovering and mounting root,
systemd-halt.service(8) -- System shutdown logic
systemd-hibernate-resume(8) -- Resume from hibernation
systemd-hibernate-resume-generator(8) -- Unit generator for resume= kernel parameter
systemd-hibernate-resume@.service(8) -- Resume from hibernation
systemd-hibernate.service(8) -- System sleep state logic
systemd-hostnamed(8) -- Host name bus mechanism
systemd-hostnamed.service(8) -- Host name bus mechanism
systemd-hybrid-sleep.service(8) -- System sleep state logic
systemd-inhibit(1) -- Execute a program with an inhibition lock taken
systemd-initctl(8) -- /dev/initctl compatibility
systemd-initctl.service(8) -- /dev/initctl compatibility
systemd-initctl.socket(8) -- /dev/initctl compatibility
systemd-journal-gatewayd(8) -- HTTP server for journal events
systemd-journal-gatewayd.service(8) -- HTTP server for journal events
systemd-journal-gatewayd.socket(8) -- HTTP server for journal events
systemd-journal-remote(8) -- Receive journal messages over the network
systemd-journal-upload(8) -- Send journal messages over the network
systemd-journald(8) -- Journal service
systemd-journald-dev-log.socket(8) -- Journal service
systemd-journald.service(8) -- Journal service
systemd-journald.socket(8) -- Journal service
systemd-kexec.service(8) -- System shutdown logic
systemd-localed(8) -- Locale bus mechanism
systemd-localed.service(8) -- Locale bus mechanism
systemd-logind(8) -- Login manager
systemd-logind.service(8) -- Login manager
systemd-machine-id-commit(1) -- Commit transient machine ID to /etc/machine-id
systemd-machine-id-commit.service(8) -- Commit transient machine-id to disk
systemd-machine-id-setup(1) -- Initialize the machine ID in /etc/machine-id
systemd-machined(8) -- Virtual machine and container registration manager
systemd-machined.service(8) -- Virtual machine and container registration manager
systemd-modules-load(8) -- Load kernel modules at boot
systemd-modules-load.service(8) -- Load kernel modules at boot
systemd-networkd(8) -- Network manager
systemd-networkd-wait-online(8) -- Wait for network to come online
systemd-networkd-wait-online.service(8) -- Wait for network to come online
systemd-networkd.service(8) -- Network manager
systemd-notify(1) -- Notify service manager about start-up completion and other daemon status changes
systemd-nspawn(1) -- Spawn a namespace container for debugging, testing and building
systemd-path(1) -- List and query system and user paths
systemd-poweroff.service(8) -- System shutdown logic
systemd-quotacheck(8) -- File system quota checker logic
systemd-quotacheck.service(8) -- File system quota checker logic
systemd-random-seed(8) -- Load and save the system random seed at boot and shutdown
systemd-random-seed.service(8) -- Load and save the system random seed at boot and shutdown
systemd-reboot.service(8) -- System shutdown logic
systemd-remount-fs(8) -- Remount root and kernel file systems
systemd-remount-fs.service(8) -- Remount root and kernel file systems
systemd-resolved(8) -- Network Name Resolution manager
systemd-resolved.service(8) -- Network Name Resolution manager
systemd-rfkill(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-rfkill@.service(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-run(1) -- Run programs in transient scope or service or timer units
systemd-shutdown(8) -- System shutdown logic
systemd-shutdownd(8) -- Scheduled shutdown service
systemd-shutdownd.service(8) -- Scheduled shutdown service
systemd-shutdownd.socket(8) -- Scheduled shutdown service
systemd-sleep(8) -- System sleep state logic
systemd-sleep.conf(5) -- Suspend and hibernation configuration file
systemd-socket-proxyd(8) -- Bidirectionally proxy local sockets to another (possibly remote) socket.
systemd-suspend.service(8) -- System sleep state logic
systemd-sysctl(8) -- Configure kernel parameters at boot
systemd-sysctl.service(8) -- Configure kernel parameters at boot
systemd-system-update-generator(8) -- Generator for redirecting boot to offline update mode
systemd-system.conf(5) -- System and session service manager configuration files
systemd-sysusers(8) -- Allocate system users and groups
systemd-sysusers.service(8) -- Allocate system users and groups
systemd-sysv-generator(8) -- Unit generator for SysV init scripts
systemd-timedated(8) -- Time and date bus mechanism
systemd-timedated.service(8) -- Time and date bus mechanism
systemd-timesyncd(8) -- Network Time Synchronization
systemd-timesyncd.service(8) -- Network Time Synchronization
systemd-tmpfiles(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.timer(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup-dev.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tty-ask-password-agent(1) -- List or process pending systemd password requests
systemd-udevd(8) -- Device event managing daemon
systemd-udevd-control.socket(8) -- Device event managing daemon
systemd-udevd-kernel.socket(8) -- Device event managing daemon
systemd-udevd.service(8) -- Device event managing daemon
systemd-update-done(8) -- Mark
systemd-update-done.service(8) -- Mark
systemd-update-utmp(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp-runlevel.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-user-sessions(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user-sessions.service(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user.conf(5) -- System and session service manager configuration files
systemd-vconsole-setup(8) -- Configure the virtual console at boot
systemd-vconsole-setup.service(8) -- Configure the virtual console at boot
systemd.automount(5) -- Automount unit configuration
systemd.device(5) -- Device unit configuration
systemd.directives(7) -- Index of configuration directives
systemd.exec(5) -- Execution environment configuration
systemd.journal-fields(7) -- Special journal fields
systemd.kill(5) -- Process killing procedure configuration
systemd.link(5) -- Network device configuration
systemd.mount(5) -- Mount unit configuration
systemd.netdev(5) -- Virtual Network Device configuration
systemd.network(5) -- Network configuration
systemd.path(5) -- Path unit configuration
systemd.preset(5) -- Service enablement presets
systemd.resource-control(5) -- Resource control unit settings
systemd.scope(5) -- Scope unit configuration
systemd.service(5) -- Service unit configuration
systemd.slice(5) -- Slice unit configuration
systemd.snapshot(5) -- Snapshot unit configuration
systemd.socket(5) -- Socket unit configuration
systemd.special(7) -- Special systemd units
systemd.swap(5) -- Swap unit configuration
systemd.target(5) -- Target unit configuration
systemd.time(7) -- Time and date specifications
systemd.timer(5) -- Timer unit configuration
systemd.unit(5) -- Unit configuration
sysusers.d(5) -- Declarative allocation of system users and groups

T¶

telinit(8) -- Change SysV runlevel
timedatectl(1) -- Control the system time and date
timesyncd.conf(5) -- Network Time Synchronization configuration files
timesyncd.conf.d(5) -- Network Time Synchronization configuration files
tmpfiles.d(5) -- Configuration for creation, deletion and cleaning of volatile and temporary files

U¶

udev(7) -- Dynamic device management
udev.conf(5) -- Configuration for device event managing daemon
udevadm(8) -- udev management tool
user.conf.d(5) -- System and session service manager configuration files

V¶

vconsole.conf(5) -- Configuration file for the virtual console

See Also¶

+ gudev systemd 219


Name

systemd.index — List all manpages from the systemd project

B¶

binfmt.d(5) -- Configure additional binary formats for executables at boot
bootchart.conf(5) -- Boot performance analysis graphing tool configuration files
bootchart.conf.d(5) -- Boot performance analysis graphing tool configuration files
bootctl(1) -- Control the firmware and boot manager settings
bootup(7) -- System bootup process
busctl(1) -- Introspect the bus

C¶

coredump.conf(5) -- Coredump storage configuration files
coredump.conf.d(5) -- Coredump storage configuration files
coredumpctl(1) -- Retrieve coredumps from the journal
crypttab(5) -- Configuration for encrypted block devices

D¶

daemon(7) -- Writing and packaging system daemons

F¶

file-hierarchy(7) -- File system hierarchy overview

H¶

halt(8) -- Halt, power-off or reboot the machine
hostname(5) -- Local hostname configuration file
hostnamectl(1) -- Control the system hostname
hwdb(7) -- Hardware Database

I¶

init(1) -- systemd system and service manager

J¶

journalctl(1) -- Query the systemd journal
journald.conf(5) -- Journal service configuration files
journald.conf.d(5) -- Journal service configuration files

K¶

kernel-command-line(7) -- Kernel command line parameters
kernel-install(8) -- Add and remove kernel and initramfs images to and from /boot

L¶

libnss_myhostname.so.2(8) -- Provide hostname resolution for the locally configured system hostname.
libnss_mymachines.so.2(8) -- Provide hostname resolution for local container instances.
locale.conf(5) -- Configuration file for locale settings
localectl(1) -- Control the system locale and keyboard layout settings
localtime(5) -- Local timezone configuration file
loginctl(1) -- Control the systemd login manager
logind.conf(5) -- Login manager configuration files
logind.conf.d(5) -- Login manager configuration files

M¶

machine-id(5) -- Local machine ID configuration file
machine-info(5) -- Local machine information file
machinectl(1) -- Control the systemd machine manager
modules-load.d(5) -- Configure kernel modules to load at boot

N¶

networkctl(1) -- Query the status of network links
nss-myhostname(8) -- Provide hostname resolution for the locally configured system hostname.
nss-mymachines(8) -- Provide hostname resolution for local container instances.

O¶

os-release(5) -- Operating system identification

P¶

pam_systemd(8) -- Register user sessions in the systemd login manager
poweroff(8) -- Halt, power-off or reboot the machine

R¶

reboot(8) -- Halt, power-off or reboot the machine
resolved.conf(5) -- Network Name Resolution configuration files
resolved.conf.d(5) -- Network Name Resolution configuration files
runlevel(8) -- Print previous and current SysV runlevel

S¶

sd-daemon(3) -- APIs for new-style daemons
sd-id128(3) -- APIs for processing 128-bit IDs
sd-journal(3) -- APIs for submitting and querying log entries to and from the journal
sd-login(3) -- APIs for tracking logins
SD_ALERT(3) -- APIs for new-style daemons
sd_booted(3) -- Test whether the system is running the systemd init system
sd_bus_creds_get_audit_login_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_audit_session_id(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cgroup(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cmdline(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_connection_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_exe(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_gid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_mask(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_get_owner_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_pid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_selinux_context(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_session(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_slice(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unique_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_user_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_well_known_names(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_bounding_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_effective_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_inheritable_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_permitted_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_new_from_pid(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_ref(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_unref(3) -- Retrieve credentials object for the specified PID
sd_bus_default_system(3) -- Open a connection to the system or user bus
sd_bus_default_user(3) -- Open a connection to the system or user bus
sd_bus_error(3) -- sd-bus error handling
sd_bus_error_copy(3) -- sd-bus error handling
sd_bus_error_free(3) -- sd-bus error handling
sd_bus_error_get_errno(3) -- sd-bus error handling
sd_bus_error_has_name(3) -- sd-bus error handling
sd_bus_error_is_set(3) -- sd-bus error handling
sd_bus_error_set(3) -- sd-bus error handling
sd_bus_error_set_const(3) -- sd-bus error handling
sd_bus_error_set_errno(3) -- sd-bus error handling
sd_bus_error_set_errnof(3) -- sd-bus error handling
sd_bus_message_append(3) -- Attach parts of message based on a format string
sd_bus_message_append_array(3) -- Attach an array of items to a message
sd_bus_message_append_array_iovec(3) -- Attach an array of items to a message
sd_bus_message_append_array_memfd(3) -- Attach an array of items to a message
sd_bus_message_append_array_space(3) -- Attach an array of items to a message
sd_bus_message_append_basic(3) -- Attach a single part to a message
sd_bus_message_append_string_iovec(3) -- Attach a string to a message
sd_bus_message_append_string_memfd(3) -- Attach a string to a message
sd_bus_message_append_string_space(3) -- Attach a string to a message
sd_bus_message_append_strv(3) -- Attach an array of strings to a message
sd_bus_message_get_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_monotonic_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_realtime_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_reply_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_seqnum(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_negotiate_creds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_fds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_timestamps(3) -- Control feature negotiation on bus connections
sd_bus_new(3) -- Create a new bus object and create or destroy references to it
sd_bus_open_system(3) -- Open a connection to the system or user bus
sd_bus_open_system_container(3) -- Open a connection to the system or user bus
sd_bus_open_system_remote(3) -- Open a connection to the system or user bus
sd_bus_open_user(3) -- Open a connection to the system or user bus
sd_bus_path_decode(3) -- Convert an external identifier into an object path and back
sd_bus_path_encode(3) -- Convert an external identifier into an object path and back
sd_bus_ref(3) -- Create a new bus object and create or destroy references to it
sd_bus_release_name(3) -- Request or release a well-known name on a bus
sd_bus_request_name(3) -- Request or release a well-known name on a bus
sd_bus_unref(3) -- Create a new bus object and create or destroy references to it
SD_CRIT(3) -- APIs for new-style daemons
SD_DEBUG(3) -- APIs for new-style daemons
SD_EMERG(3) -- APIs for new-style daemons
SD_ERR(3) -- APIs for new-style daemons
sd_event_add_child(3) -- Add a child state change event source to an event loop
sd_event_add_defer(3) -- Add static event sources to an event loop
sd_event_add_exit(3) -- Add static event sources to an event loop
sd_event_add_post(3) -- Add static event sources to an event loop
sd_event_add_signal(3) -- Add a signal event source to an event loop
sd_event_add_time(3) -- Add a timer event source to an event loop
sd_event_default(3) -- Acquire and release an event loop object
sd_event_get_fd(3) -- Obtain a file descriptor to poll for event loop events
sd_event_get_name(3) -- Set human-readable names for event sources
sd_event_new(3) -- Acquire and release an event loop object
sd_event_ref(3) -- Acquire and release an event loop object
sd_event_set_name(3) -- Set human-readable names for event sources
sd_event_source_get_child_pid(3) -- Add a child state change event source to an event loop
sd_event_source_get_signal(3) -- Add a signal event source to an event loop
sd_event_source_get_time(3) -- Add a timer event source to an event loop
sd_event_source_get_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_source_get_time_clock(3) -- Add a timer event source to an event loop
sd_event_source_set_time(3) -- Add a timer event source to an event loop
sd_event_source_set_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_unref(3) -- Acquire and release an event loop object
sd_get_machine_names(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_seats(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_sessions(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_uids(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
SD_ID128_CONST_STR(3) -- APIs for processing 128-bit IDs
sd_id128_equal(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_STR(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_VAL(3) -- APIs for processing 128-bit IDs
sd_id128_from_string(3) -- Format or parse 128-bit IDs as strings
sd_id128_get_boot(3) -- Retrieve 128-bit IDs
sd_id128_get_machine(3) -- Retrieve 128-bit IDs
SD_ID128_MAKE(3) -- APIs for processing 128-bit IDs
sd_id128_randomize(3) -- Generate 128-bit IDs
sd_id128_t(3) -- APIs for processing 128-bit IDs
sd_id128_to_string(3) -- Format or parse 128-bit IDs as strings
SD_INFO(3) -- APIs for new-style daemons
sd_is_fifo(3) -- Check the type of a file descriptor
sd_is_mq(3) -- Check the type of a file descriptor
sd_is_socket(3) -- Check the type of a file descriptor
sd_is_socket_inet(3) -- Check the type of a file descriptor
sd_is_socket_unix(3) -- Check the type of a file descriptor
sd_is_special(3) -- Check the type of a file descriptor
sd_journal(3) -- Open the system journal for reading
sd_journal_add_conjunction(3) -- Add or remove entry matches
sd_journal_add_disjunction(3) -- Add or remove entry matches
sd_journal_add_match(3) -- Add or remove entry matches
SD_JOURNAL_APPEND(3) -- Journal change notification interface
sd_journal_close(3) -- Open the system journal for reading
SD_JOURNAL_CURRENT_USER(3) -- Open the system journal for reading
sd_journal_enumerate_data(3) -- Read data fields from the current journal entry
sd_journal_enumerate_unique(3) -- Read unique data fields from the journal
sd_journal_flush_matches(3) -- Add or remove entry matches
SD_JOURNAL_FOREACH(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_BACKWARDS(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_DATA(3) -- Read data fields from the current journal entry
SD_JOURNAL_FOREACH_UNIQUE(3) -- Read unique data fields from the journal
sd_journal_get_catalog(3) -- Retrieve message catalog entry
sd_journal_get_catalog_for_message_id(3) -- Retrieve message catalog entry
sd_journal_get_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_get_cutoff_monotonic_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_cutoff_realtime_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_data(3) -- Read data fields from the current journal entry
sd_journal_get_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_get_events(3) -- Journal change notification interface
sd_journal_get_fd(3) -- Journal change notification interface
sd_journal_get_monotonic_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_realtime_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_timeout(3) -- Journal change notification interface
sd_journal_get_usage(3) -- Journal disk usage
SD_JOURNAL_INVALIDATE(3) -- Journal change notification interface
SD_JOURNAL_LOCAL_ONLY(3) -- Open the system journal for reading
sd_journal_next(3) -- Advance or set back the read pointer in the journal
sd_journal_next_skip(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_NOP(3) -- Journal change notification interface
sd_journal_open(3) -- Open the system journal for reading
sd_journal_open_container(3) -- Open the system journal for reading
sd_journal_open_directory(3) -- Open the system journal for reading
sd_journal_open_files(3) -- Open the system journal for reading
sd_journal_perror(3) -- Submit log entries to the journal
sd_journal_previous(3) -- Advance or set back the read pointer in the journal
sd_journal_previous_skip(3) -- Advance or set back the read pointer in the journal
sd_journal_print(3) -- Submit log entries to the journal
sd_journal_printv(3) -- Submit log entries to the journal
sd_journal_process(3) -- Journal change notification interface
sd_journal_query_unique(3) -- Read unique data fields from the journal
sd_journal_reliable_fd(3) -- Journal change notification interface
sd_journal_restart_data(3) -- Read data fields from the current journal entry
sd_journal_restart_unique(3) -- Read unique data fields from the journal
SD_JOURNAL_RUNTIME_ONLY(3) -- Open the system journal for reading
sd_journal_seek_cursor(3) -- Seek to a position in the journal
sd_journal_seek_head(3) -- Seek to a position in the journal
sd_journal_seek_monotonic_usec(3) -- Seek to a position in the journal
sd_journal_seek_realtime_usec(3) -- Seek to a position in the journal
sd_journal_seek_tail(3) -- Seek to a position in the journal
sd_journal_send(3) -- Submit log entries to the journal
sd_journal_sendv(3) -- Submit log entries to the journal
sd_journal_set_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_stream_fd(3) -- Create log stream file descriptor to the journal
SD_JOURNAL_SUPPRESS_LOCATION(3) -- Submit log entries to the journal
SD_JOURNAL_SYSTEM(3) -- Open the system journal for reading
sd_journal_test_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_wait(3) -- Journal change notification interface
sd_listen_fds(3) -- Check for file descriptors passed by the system manager
SD_LISTEN_FDS_START(3) -- Check for file descriptors passed by the system manager
sd_login_monitor(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_flush(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_events(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_fd(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_timeout(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_new(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_unref(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_machine_get_class(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
sd_machine_get_ifindices(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
SD_NOTICE(3) -- APIs for new-style daemons
sd_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_peer_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_pid_notify_with_fds(3) -- Notify service manager about start-up completion and other service status changes
sd_pid_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_seat_can_graphical(3) -- Determine state of a specific seat
sd_seat_can_multi_session(3) -- Determine state of a specific seat
sd_seat_can_tty(3) -- Determine state of a specific seat
sd_seat_get_active(3) -- Determine state of a specific seat
sd_seat_get_sessions(3) -- Determine state of a specific seat
sd_session_get_class(3) -- Determine state of a specific session
sd_session_get_desktop(3) -- Determine state of a specific session
sd_session_get_display(3) -- Determine state of a specific session
sd_session_get_remote_host(3) -- Determine state of a specific session
sd_session_get_remote_user(3) -- Determine state of a specific session
sd_session_get_seat(3) -- Determine state of a specific session
sd_session_get_service(3) -- Determine state of a specific session
sd_session_get_state(3) -- Determine state of a specific session
sd_session_get_tty(3) -- Determine state of a specific session
sd_session_get_type(3) -- Determine state of a specific session
sd_session_get_uid(3) -- Determine state of a specific session
sd_session_get_vt(3) -- Determine state of a specific session
sd_session_is_active(3) -- Determine state of a specific session
sd_session_is_remote(3) -- Determine state of a specific session
sd_uid_get_display(3) -- Determine login state of a specific Unix user ID
sd_uid_get_seats(3) -- Determine login state of a specific Unix user ID
sd_uid_get_sessions(3) -- Determine login state of a specific Unix user ID
sd_uid_get_state(3) -- Determine login state of a specific Unix user ID
sd_uid_is_on_seat(3) -- Determine login state of a specific Unix user ID
SD_WARNING(3) -- APIs for new-style daemons
sd_watchdog_enabled(3) -- Check whether the service manager expects watchdog keep-alive notifications from a service
shutdown(8) -- Halt, power-off or reboot the machine
sleep.conf.d(5) -- Suspend and hibernation configuration file
sysctl.d(5) -- Configure kernel parameters at boot
system.conf.d(5) -- System and session service manager configuration files
systemctl(1) -- Control the systemd system and service manager
systemd(1) -- systemd system and service manager
systemd-activate(8) -- Test socket activation of daemons
systemd-analyze(1) -- Analyze system boot-up performance
systemd-ask-password(1) -- Query the user for a system password
systemd-ask-password-console.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-console.service(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.service(8) -- Query the user for system passwords on the console and via wall
systemd-backlight(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-backlight@.service(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-binfmt(8) -- Configure additional binary formats for executables at boot
systemd-binfmt.service(8) -- Configure additional binary formats for executables at boot
systemd-bootchart(1) -- Boot performance graphing tool
systemd-bus-proxyd(8) -- Connect STDIO or a socket to a given bus address
systemd-bus-proxyd.socket(8) -- Proxy classic D-Bus clients to kdbus
systemd-bus-proxyd@.service(8) -- Proxy classic D-Bus clients to kdbus
systemd-cat(1) -- Connect a pipeline or program's output with the journal
systemd-cgls(1) -- Recursively show control group contents
systemd-cgtop(1) -- Show top control groups by their resource usage
systemd-coredump(8) -- Log and store core dumps
systemd-cryptsetup(8) -- Full disk decryption logic
systemd-cryptsetup-generator(8) -- Unit generator for
systemd-cryptsetup@.service(8) -- Full disk decryption logic
systemd-debug-generator(8) -- Generator for enabling a runtime debug shell and masking specific units at boot
systemd-delta(1) -- Find overridden configuration files
systemd-detect-virt(1) -- Detect execution in a virtualized environment
systemd-efi-boot-generator(8) -- Generator for automatically mounting the EFI System Partition used by the current boot to
systemd-escape(1) -- Escape strings for usage in system unit names
systemd-firstboot(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-firstboot.service(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-fsck(8) -- File system checker logic
systemd-fsck-root.service(8) -- File system checker logic
systemd-fsck@.service(8) -- File system checker logic
systemd-fstab-generator(8) -- Unit generator for /etc/fstab
systemd-getty-generator(8) -- Generator for enabling getty instances on the console
systemd-gpt-auto-generator(8) -- Generator for automatically discovering and mounting root,
systemd-halt.service(8) -- System shutdown logic
systemd-hibernate-resume(8) -- Resume from hibernation
systemd-hibernate-resume-generator(8) -- Unit generator for resume= kernel parameter
systemd-hibernate-resume@.service(8) -- Resume from hibernation
systemd-hibernate.service(8) -- System sleep state logic
systemd-hostnamed(8) -- Host name bus mechanism
systemd-hostnamed.service(8) -- Host name bus mechanism
systemd-hwdb(8) -- hardware database management tool
systemd-hybrid-sleep.service(8) -- System sleep state logic
systemd-inhibit(1) -- Execute a program with an inhibition lock taken
systemd-initctl(8) -- /dev/initctl compatibility
systemd-initctl.service(8) -- /dev/initctl compatibility
systemd-initctl.socket(8) -- /dev/initctl compatibility
systemd-journal-gatewayd(8) -- HTTP server for journal events
systemd-journal-gatewayd.service(8) -- HTTP server for journal events
systemd-journal-gatewayd.socket(8) -- HTTP server for journal events
systemd-journal-remote(8) -- Receive journal messages over the network
systemd-journal-upload(8) -- Send journal messages over the network
systemd-journald(8) -- Journal service
systemd-journald-dev-log.socket(8) -- Journal service
systemd-journald.service(8) -- Journal service
systemd-journald.socket(8) -- Journal service
systemd-kexec.service(8) -- System shutdown logic
systemd-localed(8) -- Locale bus mechanism
systemd-localed.service(8) -- Locale bus mechanism
systemd-logind(8) -- Login manager
systemd-logind.service(8) -- Login manager
systemd-machine-id-commit(1) -- Commit transient machine ID to /etc/machine-id
systemd-machine-id-commit.service(8) -- Commit transient machine-id to disk
systemd-machine-id-setup(1) -- Initialize the machine ID in /etc/machine-id
systemd-machined(8) -- Virtual machine and container registration manager
systemd-machined.service(8) -- Virtual machine and container registration manager
systemd-modules-load(8) -- Load kernel modules at boot
systemd-modules-load.service(8) -- Load kernel modules at boot
systemd-networkd(8) -- Network manager
systemd-networkd-wait-online(8) -- Wait for network to come online
systemd-networkd-wait-online.service(8) -- Wait for network to come online
systemd-networkd.service(8) -- Network manager
systemd-notify(1) -- Notify service manager about start-up completion and other daemon status changes
systemd-nspawn(1) -- Spawn a namespace container for debugging, testing and building
systemd-path(1) -- List and query system and user paths
systemd-poweroff.service(8) -- System shutdown logic
systemd-quotacheck(8) -- File system quota checker logic
systemd-quotacheck.service(8) -- File system quota checker logic
systemd-random-seed(8) -- Load and save the system random seed at boot and shutdown
systemd-random-seed.service(8) -- Load and save the system random seed at boot and shutdown
systemd-reboot.service(8) -- System shutdown logic
systemd-remount-fs(8) -- Remount root and kernel file systems
systemd-remount-fs.service(8) -- Remount root and kernel file systems
systemd-resolved(8) -- Network Name Resolution manager
systemd-resolved.service(8) -- Network Name Resolution manager
systemd-rfkill(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-rfkill@.service(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-run(1) -- Run programs in transient scope or service or timer units
systemd-shutdown(8) -- System shutdown logic
systemd-shutdownd(8) -- Scheduled shutdown service
systemd-shutdownd.service(8) -- Scheduled shutdown service
systemd-shutdownd.socket(8) -- Scheduled shutdown service
systemd-sleep(8) -- System sleep state logic
systemd-sleep.conf(5) -- Suspend and hibernation configuration file
systemd-socket-proxyd(8) -- Bidirectionally proxy local sockets to another (possibly remote) socket.
systemd-suspend.service(8) -- System sleep state logic
systemd-sysctl(8) -- Configure kernel parameters at boot
systemd-sysctl.service(8) -- Configure kernel parameters at boot
systemd-system-update-generator(8) -- Generator for redirecting boot to offline update mode
systemd-system.conf(5) -- System and session service manager configuration files
systemd-sysusers(8) -- Allocate system users and groups
systemd-sysusers.service(8) -- Allocate system users and groups
systemd-sysv-generator(8) -- Unit generator for SysV init scripts
systemd-timedated(8) -- Time and date bus mechanism
systemd-timedated.service(8) -- Time and date bus mechanism
systemd-timesyncd(8) -- Network Time Synchronization
systemd-timesyncd.service(8) -- Network Time Synchronization
systemd-tmpfiles(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.timer(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup-dev.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tty-ask-password-agent(1) -- List or process pending systemd password requests
systemd-udevd(8) -- Device event managing daemon
systemd-udevd-control.socket(8) -- Device event managing daemon
systemd-udevd-kernel.socket(8) -- Device event managing daemon
systemd-udevd.service(8) -- Device event managing daemon
systemd-update-done(8) -- Mark
systemd-update-done.service(8) -- Mark
systemd-update-utmp(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp-runlevel.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-user-sessions(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user-sessions.service(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user.conf(5) -- System and session service manager configuration files
systemd-vconsole-setup(8) -- Configure the virtual console at boot
systemd-vconsole-setup.service(8) -- Configure the virtual console at boot
systemd.automount(5) -- Automount unit configuration
systemd.device(5) -- Device unit configuration
systemd.directives(7) -- Index of configuration directives
systemd.exec(5) -- Execution environment configuration
systemd.generator(7) -- Systemd unit generators
systemd.journal-fields(7) -- Special journal fields
systemd.kill(5) -- Process killing procedure configuration
systemd.link(5) -- Network device configuration
systemd.mount(5) -- Mount unit configuration
systemd.netdev(5) -- Virtual Network Device configuration
systemd.network(5) -- Network configuration
systemd.path(5) -- Path unit configuration
systemd.preset(5) -- Service enablement presets
systemd.resource-control(5) -- Resource control unit settings
systemd.scope(5) -- Scope unit configuration
systemd.service(5) -- Service unit configuration
systemd.slice(5) -- Slice unit configuration
systemd.snapshot(5) -- Snapshot unit configuration
systemd.socket(5) -- Socket unit configuration
systemd.special(7) -- Special systemd units
systemd.swap(5) -- Swap unit configuration
systemd.target(5) -- Target unit configuration
systemd.time(7) -- Time and date specifications
systemd.timer(5) -- Timer unit configuration
systemd.unit(5) -- Unit configuration
sysusers.d(5) -- Declarative allocation of system users and groups

T¶

telinit(8) -- Change SysV runlevel
timedatectl(1) -- Control the system time and date
timesyncd.conf(5) -- Network Time Synchronization configuration files
timesyncd.conf.d(5) -- Network Time Synchronization configuration files
tmpfiles.d(5) -- Configuration for creation, deletion and cleaning of volatile and temporary files

U¶

udev(7) -- Dynamic device management
udev.conf(5) -- Configuration for device event managing daemon
udevadm(8) -- udev management tool
user.conf.d(5) -- System and session service manager configuration files

V¶

vconsole.conf(5) -- Configuration file for the virtual console

See Also¶

systemd.directives(7) -

This index contains 440 entries, referring to 194 individual manual pages.

+

This index contains 450 entries, referring to 199 individual manual pages.

diff --git a/man/init.html b/man/init.html index e96e7faa1..55e643c1d 100644 --- a/man/init.html +++ b/man/init.html @@ -19,653 +19,474 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd, init — systemd system and service manager

Synopsis

systemd [OPTIONS...]

init [OPTIONS...] {COMMAND}

Description¶

systemd is a system and service manager for - Linux operating systems. When run as first process on - boot (as PID 1), it acts as init system that brings - up and maintains userspace services.

For compatibility with SysV, if systemd is called - as init and a PID that is not - 1, it will execute telinit and pass - all command line arguments unmodified. That means - init and telinit - are mostly equivalent when invoked from normal login sessions. See - telinit(8) - for more information.

When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. See - systemd-system.conf(5) - for more information.

Options¶

The following options are understood:

--test¶

Determine startup - sequence, dump it and exit. This is an - option useful for debugging - only.

--dump-configuration-items¶

Dump understood unit - configuration items. This outputs a - terse but complete list of - configuration items understood in unit - definition files.

--unit=¶

Set default unit to - activate on startup. If not specified, - defaults to - default.target.

--system, --user¶

For --system, - tell systemd to run a - system instance, even if the process ID is - not 1, i.e. systemd is not run as init process. - --user does the opposite, - running a user instance even if the process - ID is 1. - Normally it should not be necessary to - pass these options, as systemd - automatically detects the mode it is - started in. These options are hence of - little use except for debugging. Note - that it is not supported booting and - maintaining a full system with systemd - running in --system - mode, but PID not 1. In practice, - passing --system explicitly is - only useful in conjunction with - --test.

--dump-core¶

Dump core on - crash. This switch has no effect when - run as user - instance.

--crash-shell¶

Run shell on - crash. This switch has no effect when - run as user - instance.

--confirm-spawn¶

Ask for confirmation - when spawning processes. This switch - has no effect when run as user - instance.

--show-status=¶

Show terse service - status information while booting. This - switch has no effect when run as user - instance. Takes a boolean argument - which may be omitted which is - interpreted as - true.

--log-target=¶

Set log - target. Argument must be one of - console, - journal, - kmsg, - journal-or-kmsg, - null.

--log-level=¶

Set log level. As - argument this accepts a numerical log - level or the well-known syslog(3) - symbolic names (lowercase): - emerg, - alert, - crit, - err, - warning, - notice, - info, - debug.

--log-color=¶

Highlight important - log messages. Argument is a boolean - value. If the argument is omitted, it - defaults to - true.

--log-location=¶

Include code location - in log messages. This is mostly - relevant for debugging - purposes. Argument is a boolean - value. If the argument is omitted - it defaults to - true.

--default-standard-output=, --default-standard-error=¶

Sets the default - output or error output for all - services and sockets, respectively. That is, controls - the default for - StandardOutput= - and StandardError= - (see - systemd.exec(5) - for details). Takes one of - inherit, - null, - tty, - journal, - journal+console, - syslog, - syslog+console, - kmsg, - kmsg+console. If the - argument is omitted - --default-standard-output= - defaults to journal - and - --default-standard-error= - to - inherit.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Concepts¶

systemd provides a dependency system between - various entities called "units" of 12 different - types. Units encapsulate various objects that are - relevant for system boot-up and maintenance. The - majority of units are configured in unit configuration - files, whose syntax and basic set of options is - described in - systemd.unit(5), - however some are created automatically from other - configuration, dynamically from system state or - programmatically at runtime. Units may be "active" - (meaning started, bound, plugged in, ..., depending on - the unit type, see below), or "inactive" (meaning - stopped, unbound, unplugged, ...), as well as in the - process of being activated or deactivated, - i.e. between the two states (these states are called - "activating", "deactivating"). A special "failed" - state is available as well, which is very similar to - "inactive" and is entered when the service failed in - some way (process returned error code on exit, or - crashed, or an operation timed out). If this state is - entered, the cause will be logged, for later - reference. Note that the various unit types may have a - number of additional substates, which are mapped to - the five generalized unit states described - here.

The following unit types are available:

  1. Service units, which start and control - daemons and the processes they consist of. For - details see - systemd.service(5).

  2. Socket units, which - encapsulate local IPC or network sockets in - the system, useful for socket-based - activation. For details about socket units see - systemd.socket(5), - for details on socket-based activation and - other forms of activation, see - daemon(7).

  3. Target units are useful to - group units, or provide well-known - synchronization points during boot-up, see - systemd.target(5).

  4. Device units expose kernel - devices in systemd and may be used to - implement device-based activation. For details - see - systemd.device(5).

  5. Mount units control mount - points in the file system, for details see - systemd.mount(5).

  6. Automount units provide - automount capabilities, for on-demand mounting - of file systems as well as parallelized - boot-up. See - systemd.automount(5).

  7. Snapshot units can be used to - temporarily save the state of the set of - systemd units, which later may be restored by - activating the saved snapshot unit. For more - information see - systemd.snapshot(5).

  8. Timer units are useful for - triggering activation of other units based on - timers. You may find details in - systemd.timer(5).

  9. Swap units are very similar to - mount units and encapsulate memory swap - partitions or files of the operating - system. They are described in systemd.swap(5).

  10. Path units may be used - to activate other services when file system - objects change or are modified. See - systemd.path(5).

  11. Slice units may be used to - group units which manage system processes - (such as service and scope units) in a - hierarchical tree for resource management - purposes. See - systemd.slice(5).

  12. Scope units are similar to - service units, but manage foreign processes - instead of starting them as well. See - systemd.scope(5).

Units are named as their configuration - files. Some units have special semantics. A detailed - list is available in - systemd.special(7).

systemd knows various kinds of dependencies, - including positive and negative requirement - dependencies (i.e. Requires= and - Conflicts=) as well as ordering - dependencies (After= and - Before=). NB: ordering and - requirement dependencies are orthogonal. If only a - requirement dependency exists between two units - (e.g. foo.service requires - bar.service), but no ordering - dependency (e.g. foo.service - after bar.service) and both are - requested to start, they will be started in - parallel. It is a common pattern that both requirement - and ordering dependencies are placed between two - units. Also note that the majority of dependencies are - implicitly created and maintained by systemd. In most - cases, it should be unnecessary to declare additional - dependencies manually, however it is possible to do - this.

Application programs and units (via - dependencies) may request state changes of units. In - systemd, these requests are encapsulated as 'jobs' and - maintained in a job queue. Jobs may succeed or can - fail, their execution is ordered based on the ordering - dependencies of the units they have been scheduled - for.

On boot systemd activates the target unit - default.target whose job is to - activate on-boot services and other on-boot units by - pulling them in via dependencies. Usually the unit - name is just an alias (symlink) for either - graphical.target (for - fully-featured boots into the UI) or - multi-user.target (for limited - console-only boots for use in embedded or server - environments, or similar; a subset of - graphical.target). However, it is at the discretion of - the administrator to configure it as an alias to any - other target unit. See - systemd.special(7) - for details about these target units.

Processes systemd spawns are placed in - individual Linux control groups named after the unit - which they belong to in the private systemd - hierarchy. (see cgroups.txt - for more information about control groups, or short - "cgroups"). systemd uses this to effectively keep - track of processes. Control group information is - maintained in the kernel, and is accessible via the - file system hierarchy (beneath - /sys/fs/cgroup/systemd/), or in tools - such as - ps(1) - (ps xawf -eo pid,user,cgroup,args - is particularly useful to list all processes and the - systemd units they belong to.).

systemd is compatible with the SysV init system - to a large degree: SysV init scripts are supported and - simply read as an alternative (though limited) - configuration file format. The SysV - /dev/initctl interface is - provided, and compatibility implementations of the - various SysV client tools are available. In addition to - that, various established Unix functionality such as - /etc/fstab or the - utmp database are - supported.

systemd has a minimal transaction system: if a - unit is requested to start up or shut down it will add - it and all its dependencies to a temporary - transaction. Then, it will verify if the transaction - is consistent (i.e. whether the ordering of all units - is cycle-free). If it is not, systemd will try to fix - it up, and removes non-essential jobs from the - transaction that might remove the loop. Also, systemd - tries to suppress non-essential jobs in the - transaction that would stop a running service. Finally - it is checked whether the jobs of the transaction - contradict jobs that have already been queued, and - optionally the transaction is aborted then. If all - worked out and the transaction is consistent and - minimized in its impact it is merged with all already - outstanding jobs and added to the run - queue. Effectively this means that before executing a - requested operation, systemd will verify that it makes - sense, fixing it if possible, and only failing if it - really cannot work.

Systemd contains native implementations of - various tasks that need to be executed as part of the - boot process. For example, it sets the hostname or - configures the loopback network device. It also sets - up and mounts various API file systems, such as - /sys or - /proc.

For more information about the concepts and - ideas behind systemd, please refer to the Original - Design Document.

Note that some but not all interfaces provided - by systemd are covered by the Interface - Stability Promise.

Units may be generated dynamically at boot and - system manager reload time, for example based on other - configuration files or parameters passed on the kernel - command line. For details see the Generators - Specification.

Systems which invoke systemd in a container - or initrd environment should implement the - Container - Interface or initrd - Interface specifications, respectively.

Directories¶

System unit directories¶

The systemd system - manager reads unit configuration from - various directories. Packages that - want to install unit files shall place - them in the directory returned by - pkg-config systemd - --variable=systemdsystemunitdir. Other - directories checked are - /usr/local/lib/systemd/system - and - /usr/lib/systemd/system. User - configuration always takes - precedence. pkg-config - systemd - --variable=systemdsystemconfdir - returns the path of the system - configuration directory. Packages - should alter the content of these - directories only with the - enable and - disable commands of - the - systemctl(1) - tool. Full list of directories is provided in - systemd.unit(5). -

User unit directories¶

Similar rules apply - for the user unit - directories. However, here the XDG - Base Directory specification - is followed to find - units. Applications should place their - unit files in the directory returned - by pkg-config systemd - --variable=systemduserunitdir. Global - configuration is done in the directory - reported by pkg-config - systemd - --variable=systemduserconfdir. The - enable and - disable commands of - the - systemctl(1) - tool can handle both global (i.e. for - all users) and private (for one user) - enabling/disabling of - units. Full list of directories is provided in - systemd.unit(5). -

SysV init scripts directory¶

The location of the - SysV init script directory varies - between distributions. If systemd - cannot find a native unit file for a - requested service, it will look for a - SysV init script of the same name - (with the - .service suffix - removed).

The location of the - SysV runlevel link farm directory - varies between distributions. systemd - will take the link farm into account - when figuring out whether a service - shall be enabled. Note that a service - unit with a native unit configuration - file cannot be started by activating it - in the SysV runlevel link - farm.

Signals¶

SIGTERM¶

Upon receiving this - signal the systemd system manager - serializes its state, reexecutes - itself and deserializes the saved - state again. This is mostly equivalent - to systemctl - daemon-reexec.

systemd user managers will - start the - exit.target unit - when this signal is received. This is - mostly equivalent to - systemctl --user start - exit.target.

SIGINT¶

Upon receiving this - signal the systemd system manager will - start the - ctrl-alt-del.target unit. This - is mostly equivalent to - systemctl start - ctl-alt-del.target.

systemd user managers - treat this signal the same way as - SIGTERM.

SIGWINCH¶

When this signal is - received the systemd system manager - will start the - kbrequest.target - unit. This is mostly equivalent to - systemctl start - kbrequest.target.

This signal is ignored by - systemd user - managers.

SIGPWR¶

When this signal is - received the systemd manager - will start the - sigpwr.target - unit. This is mostly equivalent to - systemctl start - sigpwr.target.

SIGUSR1¶

When this signal is - received the systemd manager will try - to reconnect to the D-Bus - bus.

SIGUSR2¶

When this signal is - received the systemd manager will log - its complete state in human readable - form. The data logged is the same as - printed by systemd-analyze - dump.

SIGHUP¶

Reloads the complete - daemon configuration. This is mostly - equivalent to systemctl - daemon-reload.

SIGRTMIN+0¶

Enters default mode, starts the - default.target - unit. This is mostly equivalent to - systemctl start - default.target.

SIGRTMIN+1¶

Enters rescue mode, - starts the - rescue.target - unit. This is mostly equivalent to - systemctl isolate - rescue.target.

SIGRTMIN+2¶

Enters emergency mode, - starts the - emergency.service - unit. This is mostly equivalent to - systemctl isolate - emergency.service.

SIGRTMIN+3¶

Halts the machine, - starts the - halt.target - unit. This is mostly equivalent to - systemctl start - halt.target.

SIGRTMIN+4¶

Powers off the machine, - starts the - poweroff.target - unit. This is mostly equivalent to - systemctl start - poweroff.target.

SIGRTMIN+5¶

Reboots the machine, - starts the - reboot.target - unit. This is mostly equivalent to - systemctl start - reboot.target.

SIGRTMIN+6¶

Reboots the machine via kexec, - starts the - kexec.target - unit. This is mostly equivalent to - systemctl start - kexec.target.

SIGRTMIN+13¶

Immediately halts the machine.

SIGRTMIN+14¶

Immediately powers off the machine.

SIGRTMIN+15¶

Immediately reboots the machine.

SIGRTMIN+16¶

Immediately reboots the machine with kexec.

SIGRTMIN+20¶

Enables display of - status messages on the console, as - controlled via - systemd.show_status=1 - on the kernel command - line.

SIGRTMIN+21¶

Disables display of - status messages on the console, as - controlled via - systemd.show_status=0 - on the kernel command - line.

SIGRTMIN+22, SIGRTMIN+23¶

Sets the log level to - "debug" - (or "info" on - SIGRTMIN+23), as - controlled via - systemd.log_level=debug - (or systemd.log_level=info - on SIGRTMIN+23) on - the kernel command - line.

SIGRTMIN+24¶

Immediately exits the - manager (only available for --user - instances).

SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28¶

Sets the log level to - "journal-or-kmsg" (or - "console" on - SIGRTMIN+27, - "kmsg" on - SIGRTMIN+28), as - controlled via - systemd.log_target=journal-or-kmsg - (or - systemd.log_target=console - on SIGRTMIN+27 or - systemd.log_target=kmsg - on SIGRTMIN+28) - on the kernel command - line.

Environment¶

$SYSTEMD_LOG_LEVEL¶

systemd reads the - log level from this environment - variable. This can be overridden with - --log-level=.

$SYSTEMD_LOG_TARGET¶

systemd reads the - log target from this environment - variable. This can be overridden with - --log-target=.

$SYSTEMD_LOG_COLOR¶

Controls whether - systemd highlights important log - messages. This can be overridden with - --log-color=.

$SYSTEMD_LOG_LOCATION¶

Controls whether - systemd prints the code location along - with log messages. This can be - overridden with - --log-location=.

$XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS¶

The systemd user - manager uses these variables in - accordance to the XDG - Base Directory specification - to find its configuration.

$SYSTEMD_UNIT_PATH¶

Controls where systemd - looks for unit - files.

$SYSTEMD_SYSVINIT_PATH¶

Controls where systemd - looks for SysV init scripts.

$SYSTEMD_SYSVRCND_PATH¶

Controls where systemd - looks for SysV init script runlevel link - farms.

$LISTEN_PID, $LISTEN_FDS¶

Set by systemd for - supervised processes during - socket-based activation. See - sd_listen_fds(3) - for more information. -

$NOTIFY_SOCKET¶

Set by systemd for - supervised processes for status and - start-up completion notification. See - sd_notify(3) - for more information. -

Kernel Command Line¶

When run as system instance systemd parses a - number of kernel command line - arguments[1]:

systemd.unit=, rd.systemd.unit=¶

Overrides the unit to - activate on boot. Defaults to - default.target. This - may be used to temporarily boot into a - different boot unit, for example - rescue.target or - emergency.service. See - systemd.special(7) - for details about these units. The - option prefixed with - "rd." is honored - only in the initial RAM disk (initrd), - while the one that is not prefixed only - in the main system.

systemd.dump_core=¶

Takes a boolean - argument. If true, - systemd dumps core when it - crashes. Otherwise, no core dump is - created. Defaults to - true.

systemd.crash_shell=¶

Takes a boolean - argument. If true, - systemd spawns a shell when it - crashes. Otherwise, no shell is - spawned. Defaults to - false, for security - reasons, as the shell is not protected - by any password - authentication.

systemd.crash_chvt=¶

Takes an integer - argument. If positive systemd - activates the specified virtual - terminal when it crashes. Defaults to - -1.

systemd.confirm_spawn=¶

Takes a boolean - argument. If true, - asks for confirmation when spawning - processes. Defaults to - false.

systemd.show_status=¶

Takes a boolean - argument or the constant - auto. If - true, shows terse - service status updates on the console - during bootup. - auto behaves like - false until a service - fails or there is a significant delay - in boot. Defaults to - true, unless - quiet is passed as - kernel command line option in which - case it defaults to - auto.

systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=¶

Controls log output, - with the same effect as the - $SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION - environment variables described above.

systemd.default_standard_output=, systemd.default_standard_error=¶

Controls default - standard output and error output for - services, with the same effect as the - --default-standard-output= - and --default-standard-error= - command line arguments described - above, respectively.

systemd.setenv=¶

Takes a string - argument in the form VARIABLE=VALUE. - May be used to set default environment - variables to add to forked child processes. - May be used more than once to set multiple - variables.

quiet¶

Turn off - status output at boot, much like - systemd.show_status=false - would. Note that this option is also - read by the kernel itself and disables - kernel log output. Passing this option - hence turns off the usual output from - both the system manager and the kernel. -

debug¶

Turn on debugging - output. This is equivalent to - systemd.log_level=debug. - Note that this option is also read by - the kernel itself and enables kernel - debug output. Passing this option - hence turns on the debug output from - both the system manager and the - kernel.

emergency, -b¶

Boot into emergency - mode. This is equivalent to - systemd.unit=emergency.target - and provided for compatibility reasons - and to be easier to - type.

rescue, single, s, S, 1¶

Boot into rescue - mode. This is equivalent to - systemd.unit=rescue.target - and provided for compatibility reasons - and to be easier to - type.

2, 3, 4, 5¶

Boot into the - specified legacy SysV runlevel. These - are equivalent to - systemd.unit=runlevel2.target, - systemd.unit=runlevel3.target, - systemd.unit=runlevel4.target, - and systemd.unit=runlevel5.target, respectively, - and provided for compatibility reasons - and to be easier to - type.

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Set the system locale - to use. This overrides the settings in - /etc/locale.conf. For - more information see - locale.conf(5) - and - locale(7). -

For other kernel command line parameters - understood by components of the core OS, please refer - to - kernel-command-line(7).

Sockets and FIFOs¶

/run/systemd/notify¶

Daemon status - notification socket. This is an - AF_UNIX datagram socket and is used to - implement the daemon notification - logic as implemented by - sd_notify(3).

/run/systemd/shutdownd¶

Used internally by the - shutdown(8) - tool to implement delayed - shutdowns. This is an AF_UNIX datagram - socket.

/run/systemd/private¶

Used internally as - communication channel between - systemctl(1) - and the systemd process. This is an - AF_UNIX stream socket. This interface - is private to systemd and should not - be used in external - projects.

/dev/initctl¶

Limited compatibility - support for the SysV client interface, - as implemented by the - systemd-initctl.service - unit. This is a named pipe in the file - system. This interface is obsolete and - should not be used in new - applications.



[1] If run inside a Linux - container these arguments may be passed as command - line arguments to systemd itself, next to any of the - command line options listed in the Options section - above. If run outside of Linux containers, these - arguments are parsed from - /proc/cmdline - instead.

+ gudev systemd 219

Name

systemd, init — systemd system and service manager

Synopsis

systemd [OPTIONS...]

init [OPTIONS...] {COMMAND}

Description¶

systemd is a system and service manager for Linux operating + systems. When run as first process on boot (as PID 1), it acts as + init system that brings up and maintains userspace + services.

For compatibility with SysV, if systemd is called as + init and a PID that is not 1, it will execute + telinit and pass all command line arguments + unmodified. That means init and + telinit are mostly equivalent when invoked from + normal login sessions. See + telinit(8) + for more information.

When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. See + systemd-system.conf(5) + for more information.

Options¶

The following options are understood:

--test¶

Determine startup sequence, dump it and exit. + This is an option useful for debugging only.

--dump-configuration-items¶

Dump understood unit configuration items. This + outputs a terse but complete list of configuration items + understood in unit definition files.

--unit=¶

Set default unit to activate on startup. If + not specified, defaults to + default.target.

--system, --user¶

For --system, tell systemd to + run a system instance, even if the process ID is not 1, i.e. + systemd is not run as init process. --user + does the opposite, running a user instance even if the process + ID is 1. Normally it should not be necessary to pass these + options, as systemd automatically detects the mode it is + started in. These options are hence of little use except for + debugging. Note that it is not supported booting and + maintaining a full system with systemd running in + --system mode, but PID not 1. In practice, + passing --system explicitly is only useful in + conjunction with --test.

--dump-core¶

Dump core on crash. This switch has no effect + when run as user instance.

--crash-shell¶

Run shell on + crash. This switch has no effect when + run as user + instance.

--confirm-spawn¶

Ask for confirmation when spawning processes. + This switch has no effect when run as user + instance.

--show-status=¶

Show terse service status information while + booting. This switch has no effect when run as user instance. + Takes a boolean argument which may be omitted which is + interpreted as true.

--log-target=¶

Set log target. Argument must be one of + console, + journal, + kmsg, + journal-or-kmsg, + null.

--log-level=¶

Set log level. As + argument this accepts a numerical log + level or the well-known syslog(3) + symbolic names (lowercase): + emerg, + alert, + crit, + err, + warning, + notice, + info, + debug.

--log-color=¶

Highlight important log messages. Argument is + a boolean value. If the argument is omitted, it defaults to + true.

--log-location=¶

Include code location in log messages. This is + mostly relevant for debugging purposes. Argument is a boolean + value. If the argument is omitted it defaults to + true.

--default-standard-output=, --default-standard-error=¶

Sets the default output or error output for + all services and sockets, respectively. That is, controls the + default for StandardOutput= and + StandardError= (see + systemd.exec(5) + for details). Takes one of + inherit, + null, + tty, + journal, + journal+console, + syslog, + syslog+console, + kmsg, + kmsg+console. If the + argument is omitted + --default-standard-output= defaults to + journal and + --default-standard-error= to + inherit.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Concepts¶

systemd provides a dependency system between various + entities called "units" of 12 different types. Units encapsulate + various objects that are relevant for system boot-up and + maintenance. The majority of units are configured in unit + configuration files, whose syntax and basic set of options is + described in + systemd.unit(5), + however some are created automatically from other configuration, + dynamically from system state or programmatically at runtime. + Units may be "active" (meaning started, bound, plugged in, ..., + depending on the unit type, see below), or "inactive" (meaning + stopped, unbound, unplugged, ...), as well as in the process of + being activated or deactivated, i.e. between the two states (these + states are called "activating", "deactivating"). A special + "failed" state is available as well, which is very similar to + "inactive" and is entered when the service failed in some way + (process returned error code on exit, or crashed, or an operation + timed out). If this state is entered, the cause will be logged, + for later reference. Note that the various unit types may have a + number of additional substates, which are mapped to the five + generalized unit states described here.

The following unit types are available:

  1. Service units, which start and control daemons + and the processes they consist of. For details see + systemd.service(5).

  2. Socket units, which encapsulate local IPC or + network sockets in the system, useful for socket-based + activation. For details about socket units see + systemd.socket(5), + for details on socket-based activation and other forms of + activation, see + daemon(7).

  3. Target units are useful to group units, or + provide well-known synchronization points during boot-up, see + systemd.target(5).

  4. Device units expose kernel devices in systemd + and may be used to implement device-based activation. For + details see + systemd.device(5).

  5. Mount units control mount points in the file + system, for details see + systemd.mount(5).

  6. Automount units provide automount capabilities, + for on-demand mounting of file systems as well as parallelized + boot-up. See + systemd.automount(5).

  7. Snapshot units can be used to temporarily save + the state of the set of systemd units, which later may be + restored by activating the saved snapshot unit. For more + information see + systemd.snapshot(5).

  8. Timer units are useful for triggering activation + of other units based on timers. You may find details in + systemd.timer(5).

  9. Swap units are very similar to mount units and + encapsulate memory swap partitions or files of the operating + system. They are described in + systemd.swap(5).

  10. Path units may be used to activate other + services when file system objects change or are modified. See + systemd.path(5).

  11. Slice units may be used to group units which + manage system processes (such as service and scope units) in a + hierarchical tree for resource management purposes. See + systemd.slice(5).

  12. Scope units are similar to service units, but + manage foreign processes instead of starting them as well. See + systemd.scope(5).

Units are named as their configuration files. Some units + have special semantics. A detailed list is available in + systemd.special(7).

systemd knows various kinds of dependencies, including + positive and negative requirement dependencies (i.e. + Requires= and Conflicts=) as + well as ordering dependencies (After= and + Before=). NB: ordering and requirement + dependencies are orthogonal. If only a requirement dependency + exists between two units (e.g. foo.service + requires bar.service), but no ordering + dependency (e.g. foo.service after + bar.service) and both are requested to start, + they will be started in parallel. It is a common pattern that both + requirement and ordering dependencies are placed between two + units. Also note that the majority of dependencies are implicitly + created and maintained by systemd. In most cases, it should be + unnecessary to declare additional dependencies manually, however + it is possible to do this.

Application programs and units (via dependencies) may + request state changes of units. In systemd, these requests are + encapsulated as 'jobs' and maintained in a job queue. Jobs may + succeed or can fail, their execution is ordered based on the + ordering dependencies of the units they have been scheduled + for.

On boot systemd activates the target unit + default.target whose job is to activate + on-boot services and other on-boot units by pulling them in via + dependencies. Usually the unit name is just an alias (symlink) for + either graphical.target (for fully-featured + boots into the UI) or multi-user.target (for + limited console-only boots for use in embedded or server + environments, or similar; a subset of graphical.target). However, + it is at the discretion of the administrator to configure it as an + alias to any other target unit. See + systemd.special(7) + for details about these target units.

Processes systemd spawns are placed in individual Linux + control groups named after the unit which they belong to in the + private systemd hierarchy. (see cgroups.txt + for more information about control groups, or short "cgroups"). + systemd uses this to effectively keep track of processes. Control + group information is maintained in the kernel, and is accessible + via the file system hierarchy (beneath + /sys/fs/cgroup/systemd/), or in tools such as + ps(1) + (ps xawf -eo pid,user,cgroup,args is + particularly useful to list all processes and the systemd units + they belong to.).

systemd is compatible with the SysV init system to a large + degree: SysV init scripts are supported and simply read as an + alternative (though limited) configuration file format. The SysV + /dev/initctl interface is provided, and + compatibility implementations of the various SysV client tools are + available. In addition to that, various established Unix + functionality such as /etc/fstab or the + utmp database are supported.

systemd has a minimal transaction system: if a unit is + requested to start up or shut down it will add it and all its + dependencies to a temporary transaction. Then, it will verify if + the transaction is consistent (i.e. whether the ordering of all + units is cycle-free). If it is not, systemd will try to fix it up, + and removes non-essential jobs from the transaction that might + remove the loop. Also, systemd tries to suppress non-essential + jobs in the transaction that would stop a running service. Finally + it is checked whether the jobs of the transaction contradict jobs + that have already been queued, and optionally the transaction is + aborted then. If all worked out and the transaction is consistent + and minimized in its impact it is merged with all already + outstanding jobs and added to the run queue. Effectively this + means that before executing a requested operation, systemd will + verify that it makes sense, fixing it if possible, and only + failing if it really cannot work.

Systemd contains native implementations of various tasks + that need to be executed as part of the boot process. For example, + it sets the hostname or configures the loopback network device. It + also sets up and mounts various API file systems, such as + /sys or /proc.

For more information about the concepts and + ideas behind systemd, please refer to the + Original Design Document.

Note that some but not all interfaces provided + by systemd are covered by the + Interface + Stability Promise.

Units may be generated dynamically at boot and system + manager reload time, for example based on other configuration + files or parameters passed on the kernel command line. For details + see the + Generators Specification.

Systems which invoke systemd in a container or initrd + environment should implement the + Container Interface or + initrd Interface + specifications, respectively.

Directories¶

System unit directories¶

The systemd system manager reads unit + configuration from various directories. Packages that want to + install unit files shall place them in the directory returned + by pkg-config systemd + --variable=systemdsystemunitdir. Other directories + checked are /usr/local/lib/systemd/system + and /usr/lib/systemd/system. User + configuration always takes precedence. pkg-config + systemd --variable=systemdsystemconfdir returns the + path of the system configuration directory. Packages should + alter the content of these directories only with the + enable and disable + commands of the + systemctl(1) + tool. Full list of directories is provided in + systemd.unit(5). +

User unit directories¶

Similar rules apply for the user unit + directories. However, here the + XDG + Base Directory specification is followed to find + units. Applications should place their unit files in the + directory returned by pkg-config systemd + --variable=systemduserunitdir. Global configuration + is done in the directory reported by pkg-config + systemd --variable=systemduserconfdir. The + enable and disable + commands of the + systemctl(1) + tool can handle both global (i.e. for all users) and private + (for one user) enabling/disabling of units. Full list of + directories is provided in + systemd.unit(5). +

SysV init scripts directory¶

The location of the SysV init script directory + varies between distributions. If systemd cannot find a native + unit file for a requested service, it will look for a SysV + init script of the same name (with the + .service suffix + removed).

The location of the SysV runlevel link farm + directory varies between distributions. systemd will take the + link farm into account when figuring out whether a service + shall be enabled. Note that a service unit with a native unit + configuration file cannot be started by activating it in the + SysV runlevel link farm.

Signals¶

SIGTERM¶

Upon receiving this signal the systemd system + manager serializes its state, reexecutes itself and + deserializes the saved state again. This is mostly equivalent + to systemctl daemon-reexec.

systemd user managers will start the + exit.target unit when this signal is + received. This is mostly equivalent to systemctl + --user start exit.target.

SIGINT¶

Upon receiving this signal the systemd system + manager will start the + ctrl-alt-del.target unit. This is mostly + equivalent to systemctl start + ctl-alt-del.target. If this signal is received more + often than 7 times per 2s an immediate reboot is triggered. + Note that pressing Ctrl-Alt-Del on the console will trigger + this signal. Hence, if a reboot is hanging pressing + Ctrl-Alt-Del more than 7 times in 2s is a relatively safe way + to trigger an immediate reboot.

systemd user managers treat this signal the same way as + SIGTERM.

SIGWINCH¶

When this signal is received the systemd + system manager will start the + kbrequest.target unit. This is mostly + equivalent to systemctl start + kbrequest.target.

This signal is ignored by systemd user + managers.

SIGPWR¶

When this signal is received the systemd + manager will start the sigpwr.target + unit. This is mostly equivalent to systemctl start + sigpwr.target.

SIGUSR1¶

When this signal is received the systemd + manager will try to reconnect to the D-Bus + bus.

SIGUSR2¶

When this signal is received the systemd + manager will log its complete state in human readable form. + The data logged is the same as printed by + systemd-analyze dump.

SIGHUP¶

Reloads the complete daemon configuration. + This is mostly equivalent to systemctl + daemon-reload.

SIGRTMIN+0¶

Enters default mode, starts the + default.target unit. This is mostly + equivalent to systemctl start + default.target.

SIGRTMIN+1¶

Enters rescue mode, starts the + rescue.target unit. This is mostly + equivalent to systemctl isolate + rescue.target.

SIGRTMIN+2¶

Enters emergency mode, starts the + emergency.service unit. This is mostly + equivalent to systemctl isolate + emergency.service.

SIGRTMIN+3¶

Halts the machine, starts the + halt.target unit. This is mostly + equivalent to systemctl start + halt.target.

SIGRTMIN+4¶

Powers off the machine, starts the + poweroff.target unit. This is mostly + equivalent to systemctl start + poweroff.target.

SIGRTMIN+5¶

Reboots the machine, starts the + reboot.target unit. This is mostly + equivalent to systemctl start + reboot.target.

SIGRTMIN+6¶

Reboots the machine via kexec, starts the + kexec.target unit. This is mostly + equivalent to systemctl start + kexec.target.

SIGRTMIN+13¶

Immediately halts the machine.

SIGRTMIN+14¶

Immediately powers off the machine.

SIGRTMIN+15¶

Immediately reboots the machine.

SIGRTMIN+16¶

Immediately reboots the machine with kexec.

SIGRTMIN+20¶

Enables display of status messages on the + console, as controlled via + systemd.show_status=1 on the kernel command + line.

SIGRTMIN+21¶

Disables display of + status messages on the console, as + controlled via + systemd.show_status=0 + on the kernel command + line.

SIGRTMIN+22, SIGRTMIN+23¶

Sets the log level to "debug" + (or "info" on + SIGRTMIN+23), as controlled via + systemd.log_level=debug (or + systemd.log_level=info on + SIGRTMIN+23) on the kernel command + line.

SIGRTMIN+24¶

Immediately exits the manager (only available + for --user instances).

SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28¶

Sets the log level to + "journal-or-kmsg" (or + "console" on + SIGRTMIN+27, "kmsg" on + SIGRTMIN+28), as controlled via + systemd.log_target=journal-or-kmsg (or + systemd.log_target=console on + SIGRTMIN+27 or + systemd.log_target=kmsg on + SIGRTMIN+28) on the kernel command + line.

Environment¶

$SYSTEMD_LOG_LEVEL¶

systemd reads the log level from this + environment variable. This can be overridden with + --log-level=.

$SYSTEMD_LOG_TARGET¶

systemd reads the log target from this + environment variable. This can be overridden with + --log-target=.

$SYSTEMD_LOG_COLOR¶

Controls whether systemd highlights important + log messages. This can be overridden with + --log-color=.

$SYSTEMD_LOG_LOCATION¶

Controls whether systemd prints the code + location along with log messages. This can be overridden with + --log-location=.

$XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS¶

The systemd user manager uses these variables + in accordance to the XDG + Base Directory specification to find its + configuration.

$SYSTEMD_UNIT_PATH¶

Controls where systemd looks for unit + files.

$SYSTEMD_SYSVINIT_PATH¶

Controls where systemd looks for SysV init + scripts.

$SYSTEMD_SYSVRCND_PATH¶

Controls where systemd looks for SysV init + script runlevel link farms.

$LISTEN_PID, $LISTEN_FDS¶

Set by systemd for supervised processes during + socket-based activation. See + sd_listen_fds(3) + for more information.

$NOTIFY_SOCKET¶

Set by systemd for supervised processes for + status and start-up completion notification. See + sd_notify(3) + for more information.

Kernel Command Line¶

When run as system instance systemd parses a number of + kernel command line arguments[1]:

systemd.unit=, rd.systemd.unit=¶

Overrides the unit to activate on boot. + Defaults to default.target. This may be + used to temporarily boot into a different boot unit, for + example rescue.target or + emergency.service. See + systemd.special(7) + for details about these units. The option prefixed with + "rd." is honored only in the initial RAM disk + (initrd), while the one that is not prefixed only in the main + system.

systemd.dump_core=¶

Takes a boolean argument. If + true, systemd dumps core when it crashes. + Otherwise, no core dump is created. Defaults to + true.

systemd.crash_shell=¶

Takes a boolean argument. If + true, systemd spawns a shell when it crashes. + Otherwise, no shell is spawned. Defaults to + false, for security reasons, as the shell is + not protected by any password + authentication.

systemd.crash_chvt=¶

Takes an integer argument. If positive systemd + activates the specified virtual terminal when it crashes. + Defaults to -1.

systemd.confirm_spawn=¶

Takes a boolean argument. If + true, asks for confirmation when spawning + processes. Defaults to + false.

systemd.show_status=¶

Takes a boolean argument or the constant + auto. If true, shows + terse service status updates on the console during bootup. + auto behaves like false + until a service fails or there is a significant delay in boot. + Defaults to true, unless + quiet is passed as kernel command line option + in which case it defaults to + auto.

systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=¶

Controls log output, with the same effect as + the $SYSTEMD_LOG_TARGET, + $SYSTEMD_LOG_LEVEL, + $SYSTEMD_LOG_COLOR, + $SYSTEMD_LOG_LOCATION environment variables + described above.

systemd.default_standard_output=, systemd.default_standard_error=¶

Controls default standard output and error + output for services, with the same effect as the + --default-standard-output= and + --default-standard-error= command line + arguments described above, respectively.

systemd.setenv=¶

Takes a string argument in the form + VARIABLE=VALUE. May be used to set default environment + variables to add to forked child processes. May be used more + than once to set multiple variables.

quiet¶

Turn off status output at boot, much like + systemd.show_status=false would. Note that + this option is also read by the kernel itself and disables + kernel log output. Passing this option hence turns off the + usual output from both the system manager and the kernel. +

debug¶

Turn on debugging output. This is equivalent + to systemd.log_level=debug. Note that this + option is also read by the kernel itself and enables kernel + debug output. Passing this option hence turns on the debug + output from both the system manager and the + kernel.

emergency, -b¶

Boot into emergency mode. This is equivalent + to systemd.unit=emergency.target and + provided for compatibility reasons and to be easier to + type.

rescue, single, s, S, 1¶

Boot into rescue mode. This is equivalent to + systemd.unit=rescue.target and provided for + compatibility reasons and to be easier to + type.

2, 3, 4, 5¶

Boot into the specified legacy SysV runlevel. + These are equivalent to + systemd.unit=runlevel2.target, + systemd.unit=runlevel3.target, + systemd.unit=runlevel4.target, and + systemd.unit=runlevel5.target, + respectively, and provided for compatibility reasons and to be + easier to type.

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Set the system locale to use. This overrides + the settings in /etc/locale.conf. For + more information see + locale.conf(5) + and + locale(7). +

For other kernel command line parameters understood by + components of the core OS, please refer to + kernel-command-line(7).

Sockets and FIFOs¶

/run/systemd/notify¶

Daemon status notification socket. This is an + AF_UNIX datagram socket and is used to + implement the daemon notification logic as implemented by + sd_notify(3).

/run/systemd/shutdownd¶

Used internally by the + shutdown(8) + tool to implement delayed shutdowns. This is an + AF_UNIX datagram + socket.

/run/systemd/private¶

Used internally as communication channel + between + systemctl(1) + and the systemd process. This is an + AF_UNIX stream socket. This interface is + private to systemd and should not be used in external + projects.

/dev/initctl¶

Limited compatibility support for the SysV + client interface, as implemented by the + systemd-initctl.service unit. This is a + named pipe in the file system. This interface is obsolete and + should not be used in new applications.



[1] If run inside a Linux + container these arguments may be passed as command line arguments + to systemd itself, next to any of the command line options listed + in the Options section above. If run outside of Linux containers, + these arguments are parsed from /proc/cmdline + instead.

diff --git a/man/journalctl.1 b/man/journalctl.1 index c027418d8..41864837b 100644 --- a/man/journalctl.1 +++ b/man/journalctl.1 @@ -1,5 +1,5 @@ '\" t -.TH "JOURNALCTL" "1" "" "systemd 218" "journalctl" +.TH "JOURNALCTL" "1" "" "systemd 219" "journalctl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -61,9 +61,13 @@ The set of journal files which will be used can be modified using the \fB\-\-file\fR options, see below\&. .PP -All users are granted access to their private per\-user journals\&. However, by default, only root and users who are members of the -"systemd\-journal" -group get access to the system journal and the journals of other users\&. +All users are granted access to their private per\-user journals\&. However, by default, only root and users who are members of a few special groups are granted access to the system journal and the journals of other users\&. Members of the the +"systemd\-journal", +"adm", and +"wheel" +groups can read all journal files\&. Note that the two latter groups traditionally have additional privileges specified by the distribution\&. Members of the +"wheel" +group can often perform administrative tasks\&. .PP The output is paged through \fBless\fR @@ -303,22 +307,14 @@ This parameter can be specified multiple times\&. Filter output by message priorities or priority ranges\&. Takes either a single numeric or textual log level (i\&.e\&. between 0/"emerg" and 7/"debug"), or a range of numeric/text log levels in the form FROM\&.\&.TO\&. The log levels are the usual syslog log levels as documented in \fBsyslog\fR(3), i\&.e\&. -"emerg" -(0), -"alert" -(1), -"crit" -(2), -"err" -(3), -"warning" -(4), -"notice" -(5), -"info" -(6), -"debug" -(7)\&. If a single log level is specified, all messages with this log level or a lower (hence more important) log level are shown\&. If a range is specified, all messages within the range are shown, including both the start and the end value of the range\&. This will add +"emerg"\ \&(0), +"alert"\ \&(1), +"crit"\ \&(2), +"err"\ \&(3), +"warning"\ \&(4), +"notice"\ \&(5), +"info"\ \&(6), +"debug"\ \&(7)\&. If a single log level is specified, all messages with this log level or a lower (hence more important) log level are shown\&. If a range is specified, all messages within the range are shown, including both the start and the end value of the range\&. This will add "PRIORITY=" matches for the specified priorities\&. .RE @@ -429,7 +425,20 @@ Shows the current disk usage of all journal files\&. This shows the sum of the d .PP \fB\-\-vacuum\-size=\fR, \fB\-\-vacuum\-time=\fR .RS 4 -Removes archived journal files until the disk space they use falls below the specified size (specified with the usual K, M, G, T suffixes), or all journal files contain no data older than the specified timespan (specified with the usual s, min, h, days, months, weeks, years suffixes)\&. Note that running +Removes archived journal files until the disk space they use falls below the specified size (specified with the usual +"K", +"M", +"G", +"T" +suffixes), or all journal files contain no data older than the specified timespan (specified with the usual +"s", +"min", +"h", +"days", +"months", +"weeks", +"years" +suffixes)\&. Note that running \fB\-\-vacuum\-size=\fR has only indirect effect on the output shown by \fB\-\-disk\-usage\fR diff --git a/man/journalctl.html b/man/journalctl.html index 1a375cb4d..aac8ba844 100644 --- a/man/journalctl.html +++ b/man/journalctl.html @@ -19,491 +19,335 @@ Directives · Python · libudev · - gudev systemd 218

Name

journalctl — Query the systemd journal

Synopsis

journalctl [OPTIONS...] [MATCHES...]

Description¶

journalctl may be used to - query the contents of the - systemd(1) - journal as written by - systemd-journald.service(8).

If called without parameters, it will show the full - contents of the journal, starting with the oldest - entry collected.

If one or more match arguments are passed, the - output is filtered accordingly. A match is in the - format "FIELD=VALUE", - e.g. "_SYSTEMD_UNIT=httpd.service", - referring to the components of a structured journal - entry. See - systemd.journal-fields(7) - for a list of well-known fields. If multiple matches - are specified matching different fields, the log - entries are filtered by both, i.e. the resulting output - will show only entries matching all the specified - matches of this kind. If two matches apply to the same - field, then they are automatically matched as - alternatives, i.e. the resulting output will show - entries matching any of the specified matches for the - same field. Finally, the character - "+" may appears as a separate word - between other terms on the command line. This causes - all matches before and after to be combined in a - disjunction (i.e. logical OR).

As shortcuts for a few types of field/value - matches, file paths may be specified. If a file path - refers to an executable file, this is equivalent to an - "_EXE=" match for the canonicalized - binary path. Similarly, if a path refers to a device - node, this is equivalent to a - "_KERNEL_DEVICE=" match for the - device.

Additional constraints may be added using options - --boot, --unit=, - etc, to further limit what entries will be shown - (logical AND).

Output is interleaved from all accessible - journal files, whether they are rotated or currently - being written, and regardless of whether they belong to the - system itself or are accessible user journals.

The set of journal files which will be used - can be modified using the --user, - --system, --directory, - and --file options, see below.

All users are granted access to their private - per-user journals. However, by default, only root and - users who are members of the "systemd-journal" - group get access to the system journal and the - journals of other users.

The output is paged through - less by default, and long lines are - "truncated" to screen width. The hidden part can be - viewed by using the left-arrow and right-arrow - keys. Paging can be disabled; see the - --no-pager option and the "Environment" - section below.

When outputting to a tty, lines are colored - according to priority: lines of level ERROR and higher - are colored red; lines of level NOTICE and higher are - highlighted; other lines are displayed normally. -

Options¶

The following options are understood:

--no-full, --full, -l¶

Ellipsize fields when - they do not fit in available columns. - The default is to show full fields, - allowing them to wrap or be truncated - by the pager, if one is used.

The old options - -l/--full - are not useful anymore, except to undo - --no-full.

-a, --all¶

Show all fields in - full, even if they include unprintable - characters or are very - long.

-f, --follow¶

Show only the most recent - journal entries, and continuously print - new entries as they are appended to - the journal.

-e, --pager-end¶

Immediately jump to - the end of the journal inside the - implied pager tool. This implies - -n1000 to guarantee - that the pager will not buffer logs of - unbounded size. This may be overridden - with an explicit -n - with some other numeric value while - -nall will disable this cap. - Note that this option is only supported for the - less(1) - pager.

-n, --lines=¶

Show the most recent - journal events and limit the number of - events shown. If - --follow is used, - this option is implied. The argument is - a positive integer or "all" - to disable line limiting. The default value is - 10 if no argument is given.

--no-tail¶

Show all stored output - lines, even in follow mode. Undoes the - effect of - --lines=.

-r, --reverse¶

Reverse output so that the newest - entries are displayed first.

-o, --output=¶

Controls the - formatting of the journal entries that - are shown. Takes one of the following options: -

- short - ¶

is the default - and generates an output - that is mostly identical - to the formatting of - classic syslog files, - showing one line per - journal entry.

- short-iso - ¶

is very similar, - but shows ISO 8601 - wallclock timestamps. -

- short-precise - ¶

is very similar, - but shows timestamps - with full microsecond - precision. -

- short-monotonic - ¶

is very similar, - but shows monotonic - timestamps instead of - wallclock timestamps. -

- verbose - ¶

shows the - full-structured entry - items with all fields. -

- export - ¶

serializes the - journal into a binary - (but mostly text-based) - stream suitable for - backups and network - transfer (see Journal - Export Format - for more - information).

- json - ¶

formats entries - as JSON data structures, - one per line (see Journal - JSON Format for - more information).

- json-pretty - ¶

formats entries as - JSON data structures, - but formats them in - multiple lines in order - to make them more - readable by humans.

- json-sse - ¶

formats entries as - JSON data structures, - but wraps them in a - format suitable for Server-Sent - Events.

- cat - ¶

generates a very - terse output, only - showing the actual - message of each journal - entry with no metadata, - not even a timestamp. -

--utc¶

Express time in Coordinated Universal - Time (UTC).

-x, --catalog¶

Augment log lines with - explanation texts from the message - catalog. This will add explanatory - help texts to log messages in the - output where this is available. These - short help texts will explain the - context of an error or log event, - possible solutions, as well as - pointers to support forums, developer - documentation, and any other relevant - manuals. Note that help texts are not - available for all messages, but only - for selected ones. For more - information on the message catalog, - please refer to the Message - Catalog Developer - Documentation.

Note: when attaching - journalctl output - to bug reports, please do - not use - -x.

-q, --quiet¶

Suppresses any warning - messages regarding inaccessible system - journals when run as a normal - user.

-m, --merge¶

Show entries - interleaved from all available - journals, including remote - ones.

-b [ID][±offset], --boot=[ID][±offset]¶

Show messages from a specific - boot. This will add a match for - "_BOOT_ID=".

The argument may be empty, in which case - logs for the current boot will be shown.

If the boot ID is omitted, a positive - offset will look up - the boots starting from the beginning of the - journal, and a equal-or-less-than zero - offset will look up - boots starting from the end of the - journal. Thus, 1 means the - first boot found in the journal in - chronological order, 2 the - second and so on; while -0 - is the last boot, -1 the - boot before last, and so on. An empty - offset is equivalent - to specifying -0, except - when the current boot is not the last boot - (e.g. because --directory was - specified to look at logs from a different - machine).

If the 32-character - ID is specified, it - may optionally be followed by - offset which - identifies the boot relative to the one given by - boot ID. Negative - values mean earlier boots and a positive values - mean later boots. If - offset is not - specified, a value of zero is assumed, and the - logs for the boot given by - ID are shown. -

--list-boots¶

Show a tabular list of - boot numbers (relative to the current - boot), their IDs, and the timestamps - of the first and last message - pertaining to the boot. -

-k, --dmesg¶

Show only kernel messages. This - implies -b and adds the match - "_TRANSPORT=kernel". -

-t, --identifier=SYSLOG_IDENTIFIER|PATTERN¶

Show messages for the - specified syslog identifier - SYSLOG_IDENTIFIER, or - for any of the messages with a "SYSLOG_IDENTIFIER" - matched by PATTERN.

This parameter can be specified - multiple times.

-u, --unit=UNIT|PATTERN¶

Show messages for the - specified systemd unit - UNIT (such - as a service unit), or for any of the - units matched by - PATTERN. - If a pattern is specified, a list of - unit names found in the journal is - compared with the specified pattern - and all that match are used. For each - unit name, a match is added for - messages from the unit - ("_SYSTEMD_UNIT=UNIT"), - along with additional matches for - messages from systemd and messages - about coredumps for the specified - unit.

This parameter can be specified - multiple times.

--user-unit=¶

Show messages for the - specified user session unit. This will - add a match for messages from the unit - ("_SYSTEMD_USER_UNIT=" - and "_UID=") and - additional matches for messages from - session systemd and messages about - coredumps for the specified unit.

This parameter can be specified multiple times. -

-p, --priority=¶

Filter output by - message priorities or priority - ranges. Takes either a single numeric - or textual log level (i.e. between - 0/"emerg" and - 7/"debug"), or a - range of numeric/text log levels in - the form FROM..TO. The log levels are - the usual syslog log levels as - documented in - syslog(3), - i.e. "emerg" (0), - "alert" (1), - "crit" (2), - "err" (3), - "warning" (4), - "notice" (5), - "info" (6), - "debug" (7). If a - single log level is specified, all - messages with this log level or a - lower (hence more important) log level - are shown. If a range is specified, all - messages within the range are shown, - including both the start and the end - value of the range. This will add - "PRIORITY=" matches - for the specified - priorities.

-c, --cursor=¶

Start showing entries - from the location in the journal - specified by the passed - cursor.

--after-cursor=¶

Start showing entries - from the location in the journal - after the - location specified by the this cursor. - The cursor is shown when the - --show-cursor option - is used.

--show-cursor¶

The cursor is shown after the last - entry after two dashes:

-- cursor: s=0639...

The format of the cursor is private - and subject to change.

--since=, --until=¶

Start showing entries - on or newer than the specified date, - or on or older than the specified - date, respectively. Date specifications - should be of the format - "2012-10-30 18:17:16". - If the time part is omitted, - "00:00:00" is assumed. - If only the seconds component is omitted, - ":00" is assumed. If the - date component is omitted, the current - day is assumed. Alternatively the strings - "yesterday", - "today", - "tomorrow" are - understood, which refer to 00:00:00 of - the day before the current day, the - current day, or the day after the - current day, respectively. "now" - refers to the current time. Finally, - relative times may be specified, - prefixed with "-" or - "+", referring to - times before or after the current - time, respectively.

-F, --field=¶

Print all possible - data values the specified field can - take in all entries of the - journal.

--system, --user¶

Show messages from - system services and the kernel (with - --system). Show - messages from service of current user - (with --user). - If neither is specified, show all - messages that the user can see. -

-M, --machine=¶

Show messages from a - running, local container. Specify a - container name to connect - to.

-D DIR, --directory=DIR¶

Takes a directory path - as argument. If specified, journalctl - will operate on the specified journal - directory - DIR instead - of the default runtime and system - journal paths.

--file=GLOB¶

Takes a file glob as an - argument. If specified, journalctl will - operate on the specified journal files - matching GLOB - instead of the default runtime and - system journal paths. May be specified - multiple times, in which case files will - be suitably interleaved.

--root=ROOT¶

Takes a directory path - as an argument. If specified, journalctl - will operate on catalog file hierarchy - underneath the specified directory - instead of the root directory - (e.g. --update-catalog - will create - ROOT/var/lib/systemd/catalog/database). -

--new-id128¶

Instead of showing - journal contents, generate a new 128-bit - ID suitable for identifying - messages. This is intended for usage - by developers who need a new - identifier for a new message they - introduce and want to make - recognizable. This will print the new ID in - three different formats which can be - copied into source code or - similar.

--header¶

Instead of showing - journal contents, show internal header - information of the journal fields - accessed.

--disk-usage¶

Shows the current disk - usage of all journal files. This shows - the sum of the disk usage of all - archived and active journal - files.

--vacuum-size=, --vacuum-time=¶

Removes archived - journal files until the disk space - they use falls below the specified - size (specified with the usual K, M, - G, T suffixes), or all journal files - contain no data older than the - specified timespan (specified with the - usual s, min, h, days, months, weeks, - years suffixes). Note that running - --vacuum-size= has - only indirect effect on the output - shown by --disk-usage - as the latter includes active journal - files, while the former only operates - on archived journal - files. --vacuum-size= - and --vacuum-time= - may be combined in a single invocation - to enforce both a size and time limit - on the archived journal - files.

--list-catalog - [128-bit-ID...] - ¶

List the contents of - the message catalog as a table of - message IDs, plus their short - description strings.

If any - 128-bit-IDs are - specified, only those entries are shown. -

--dump-catalog - [128-bit-ID...] - ¶

Show the contents of - the message catalog, with entries - separated by a line consisting of two - dashes and the ID (the format is the - same as .catalog - files).

If any - 128-bit-IDs are - specified, only those entries are shown. -

--update-catalog¶

Update the message - catalog index. This command needs to - be executed each time new catalog - files are installed, removed, or - updated to rebuild the binary catalog - index.

--setup-keys¶

Instead of showing - journal contents, generate a new key - pair for Forward Secure Sealing - (FSS). This will generate a sealing - key and a verification key. The - sealing key is stored in the journal - data directory and shall remain on the - host. The verification key should be - stored externally. Refer to the - Seal= option in - journald.conf(5) - for information on Forward Secure - Sealing and for a link to a refereed - scholarly paper detailing the - cryptographic theory it is based on. -

--force¶

When - --setup-keys is passed and - Forward Secure Sealing (FSS) has already been - configured, recreate FSS keys.

--interval=¶

Specifies the change - interval for the sealing key when - generating an FSS key pair with - --setup-keys. Shorter - intervals increase CPU consumption but - shorten the time range of - undetectable journal - alterations. Defaults to - 15min.

--verify¶

Check the journal file - for internal consistency. If the - file has been generated with FSS - enabled and the FSS verification key - has been specified with - --verify-key=, - authenticity of the journal file is - verified.

--verify-key=¶

Specifies the FSS - verification key to use for the - --verify - operation.

--flush¶

Asks the Journal - daemon to flush any log data stored in - /run/log/journal - into - /var/log/journal, - if persistent storage is enabled. This - call does not return until the - operation is - complete.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned; otherwise, a non-zero - failure code is returned.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when + gudev systemd 219


Name

journalctl — Query the systemd journal

Synopsis

journalctl [OPTIONS...] [MATCHES...]

Description¶

journalctl may be used to query the + contents of the + systemd(1) + journal as written by + systemd-journald.service(8).

If called without parameters, it will show the full + contents of the journal, starting with the oldest entry + collected.

If one or more match arguments are passed, the output is + filtered accordingly. A match is in the format + "FIELD=VALUE", + e.g. "_SYSTEMD_UNIT=httpd.service", referring + to the components of a structured journal entry. See + systemd.journal-fields(7) + for a list of well-known fields. If multiple matches are + specified matching different fields, the log entries are + filtered by both, i.e. the resulting output will show only + entries matching all the specified matches of this kind. If two + matches apply to the same field, then they are automatically + matched as alternatives, i.e. the resulting output will show + entries matching any of the specified matches for the same + field. Finally, the character "+" may appears + as a separate word between other terms on the command line. This + causes all matches before and after to be combined in a + disjunction (i.e. logical OR).

As shortcuts for a few types of field/value matches, file + paths may be specified. If a file path refers to an executable + file, this is equivalent to an "_EXE=" match + for the canonicalized binary path. Similarly, if a path refers + to a device node, this is equivalent to a + "_KERNEL_DEVICE=" match for the device.

Additional constraints may be added using options + --boot, --unit=, etc, to + further limit what entries will be shown (logical AND).

Output is interleaved from all accessible journal files, + whether they are rotated or currently being written, and + regardless of whether they belong to the system itself or are + accessible user journals.

The set of journal files which will be used can be + modified using the --user, + --system, --directory, and + --file options, see below.

All users are granted access to their private per-user + journals. However, by default, only root and users who are + members of a few special groups are granted access to the system + journal and the journals of other users. Members of the the + "systemd-journal", "adm", and + "wheel" groups can read all journal files. Note + that the two latter groups traditionally have additional + privileges specified by the distribution. Members of the + "wheel" group can often perform administrative + tasks.

The output is paged through less by + default, and long lines are "truncated" to screen width. The + hidden part can be viewed by using the left-arrow and + right-arrow keys. Paging can be disabled; see the + --no-pager option and the "Environment" section + below.

When outputting to a tty, lines are colored according to + priority: lines of level ERROR and higher are colored red; lines + of level NOTICE and higher are highlighted; other lines are + displayed normally.

Options¶

The following options are understood:

--no-full, --full, -l¶

Ellipsize fields when they do not fit in + available columns. The default is to show full fields, + allowing them to wrap or be truncated by the pager, if one + is used.

The old options + -l/--full are not useful + anymore, except to undo --no-full.

-a, --all¶

Show all fields in full, even if they + include unprintable characters or are very + long.

-f, --follow¶

Show only the most recent journal entries, + and continuously print new entries as they are appended to + the journal.

-e, --pager-end¶

Immediately jump to the end of the journal + inside the implied pager tool. This implies + -n1000 to guarantee that the pager will not + buffer logs of unbounded size. This may be overridden with + an explicit -n with some other numeric + value while -nall will disable this cap. + Note that this option is only supported for the + less(1) + pager.

-n, --lines=¶

Show the most recent journal events and + limit the number of events shown. If + --follow is used, this option is + implied. The argument is a positive integer or + "all" to disable line limiting. The default + value is 10 if no argument is given.

--no-tail¶

Show all stored output lines, even in follow + mode. Undoes the effect of --lines=. +

-r, --reverse¶

Reverse output so that the newest entries + are displayed first.

-o, --output=¶

Controls the formatting of the journal + entries that are shown. Takes one of the following + options:

+ short + ¶

is the default and generates an output that is + mostly identical to the formatting of classic syslog + files, showing one line per journal entry.

+ short-iso + ¶

is very similar, but shows ISO 8601 wallclock + timestamps.

+ short-precise + ¶

is very similar, but shows timestamps with full + microsecond precision.

+ short-monotonic + ¶

is very similar, but shows monotonic timestamps + instead of wallclock timestamps.

+ verbose + ¶

shows the full-structured entry items with all + fields.

+ export + ¶

serializes the journal into a binary (but mostly + text-based) stream suitable for backups and network + transfer (see + Journal Export Format + for more information).

+ json + ¶

formats entries as JSON data structures, one per + line (see + Journal JSON Format + for more information).

+ json-pretty + ¶

formats entries as JSON data structures, but + formats them in multiple lines in order to make them + more readable by humans.

+ json-sse + ¶

formats entries as JSON data structures, but wraps + them in a format suitable for + Server-Sent Events. +

+ cat + ¶

generates a very terse output, only showing the + actual message of each journal entry with no metadata, + not even a timestamp.

--utc¶

Express time in Coordinated Universal Time + (UTC).

-x, --catalog¶

Augment log lines with explanation texts from + the message catalog. This will add explanatory help texts to + log messages in the output where this is available. These + short help texts will explain the context of an error or log + event, possible solutions, as well as pointers to support + forums, developer documentation, and any other relevant + manuals. Note that help texts are not available for all + messages, but only for selected ones. For more information on + the message catalog, please refer to the + Message Catalog Developer Documentation.

Note: when attaching journalctl + output to bug reports, please do not use + -x.

-q, --quiet¶

Suppresses any warning messages regarding + inaccessible system journals when run as a normal + user.

-m, --merge¶

Show entries interleaved from all available + journals, including remote ones.

-b [ID][±offset], --boot=[ID][±offset]¶

Show messages from a specific boot. This will + add a match for "_BOOT_ID=".

The argument may be empty, in which case logs for the + current boot will be shown.

If the boot ID is omitted, a positive + offset will look up the boots + starting from the beginning of the journal, and a + equal-or-less-than zero offset will + look up boots starting from the end of the journal. Thus, + 1 means the first boot found in the + journal in chronological order, 2 the + second and so on; while -0 is the last + boot, -1 the boot before last, and so + on. An empty offset is equivalent + to specifying -0, except when the current + boot is not the last boot (e.g. because + --directory was specified to look at logs + from a different machine).

If the 32-character ID is + specified, it may optionally be followed by + offset which identifies the boot + relative to the one given by boot + ID. Negative values mean earlier + boots and a positive values mean later boots. If + offset is not specified, a value of + zero is assumed, and the logs for the boot given by + ID are shown.

--list-boots¶

Show a tabular list of boot numbers (relative to + the current boot), their IDs, and the timestamps of the first + and last message pertaining to the boot.

-k, --dmesg¶

Show only kernel messages. This implies + -b and adds the match + "_TRANSPORT=kernel".

-t, --identifier=SYSLOG_IDENTIFIER|PATTERN¶

Show messages for the specified syslog + identifier SYSLOG_IDENTIFIER, or + for any of the messages with a + "SYSLOG_IDENTIFIER" matched by + PATTERN.

This parameter can be specified multiple + times.

-u, --unit=UNIT|PATTERN¶

Show messages for the specified systemd unit + UNIT (such as a service unit), or + for any of the units matched by + PATTERN. If a pattern is + specified, a list of unit names found in the journal is + compared with the specified pattern and all that match are + used. For each unit name, a match is added for messages from + the unit + ("_SYSTEMD_UNIT=UNIT"), + along with additional matches for messages from systemd and + messages about coredumps for the specified unit.

This parameter can be specified multiple times.

--user-unit=¶

Show messages for the specified user session + unit. This will add a match for messages from the unit + ("_SYSTEMD_USER_UNIT=" and + "_UID=") and additional matches for messages + from session systemd and messages about coredumps for the + specified unit.

This parameter can be specified multiple times.

-p, --priority=¶

Filter output by message priorities or + priority ranges. Takes either a single numeric or textual log + level (i.e. between 0/"emerg" and + 7/"debug"), or a range of numeric/text log + levels in the form FROM..TO. The log levels are the usual + syslog log levels as documented in + syslog(3), + i.e. "emerg" (0), + "alert" (1), "crit" (2), + "err" (3), "warning" (4), + "notice" (5), "info" (6), + "debug" (7). If a single log level is + specified, all messages with this log level or a lower (hence + more important) log level are shown. If a range is specified, + all messages within the range are shown, including both the + start and the end value of the range. This will add + "PRIORITY=" matches for the specified + priorities.

-c, --cursor=¶

Start showing entries from the location in the + journal specified by the passed cursor.

--after-cursor=¶

Start showing entries from the location in the + journal after the location specified by + the this cursor. The cursor is shown when the + --show-cursor option is used.

--show-cursor¶

The cursor is shown after the last entry after + two dashes:

-- cursor: s=0639...

The format of the cursor is private + and subject to change.

--since=, --until=¶

Start showing entries on or newer than the + specified date, or on or older than the specified date, + respectively. Date specifications should be of the format + "2012-10-30 18:17:16". If the time part is + omitted, "00:00:00" is assumed. If only the + seconds component is omitted, ":00" is + assumed. If the date component is omitted, the current day is + assumed. Alternatively the strings + "yesterday", "today", + "tomorrow" are understood, which refer to + 00:00:00 of the day before the current day, the current day, + or the day after the current day, + respectively. "now" refers to the current + time. Finally, relative times may be specified, prefixed with + "-" or "+", referring to + times before or after the current time, respectively.

-F, --field=¶

Print all possible data values the specified + field can take in all entries of the journal.

--system, --user¶

Show messages from system services and the + kernel (with --system). Show messages from + service of current user (with --user). If + neither is specified, show all messages that the user can see. +

-M, --machine=¶

Show messages from a running, local + container. Specify a container name to connect to.

-D DIR, --directory=DIR¶

Takes a directory path as argument. If + specified, journalctl will operate on the specified journal + directory DIR instead of the + default runtime and system journal paths.

--file=GLOB¶

Takes a file glob as an argument. If + specified, journalctl will operate on the specified journal + files matching GLOB instead of the + default runtime and system journal paths. May be specified + multiple times, in which case files will be suitably + interleaved.

--root=ROOT¶

Takes a directory path as an argument. If + specified, journalctl will operate on catalog file hierarchy + underneath the specified directory instead of the root + directory (e.g. --update-catalog will create + ROOT/var/lib/systemd/catalog/database). +

--new-id128¶

Instead of showing journal contents, generate + a new 128-bit ID suitable for identifying messages. This is + intended for usage by developers who need a new identifier for + a new message they introduce and want to make + recognizable. This will print the new ID in three different + formats which can be copied into source code or similar. +

--header¶

Instead of showing journal contents, show + internal header information of the journal fields + accessed.

--disk-usage¶

Shows the current disk usage of all journal + files. This shows the sum of the disk usage of all archived + and active journal files.

--vacuum-size=, --vacuum-time=¶

Removes archived journal files until the disk + space they use falls below the specified size (specified with + the usual "K", "M", + "G", "T" suffixes), or all + journal files contain no data older than the specified + timespan (specified with the usual "s", + "min", "h", + "days", "months", + "weeks", "years" + suffixes). Note that running --vacuum-size= + has only indirect effect on the output shown by + --disk-usage as the latter includes active + journal files, while the former only operates on archived + journal files. --vacuum-size= and + --vacuum-time= may be combined in a single + invocation to enforce both a size and time limit on the + archived journal files.

--list-catalog + [128-bit-ID...] + ¶

List the contents of the message catalog as a + table of message IDs, plus their short description strings. +

If any 128-bit-IDs are + specified, only those entries are shown.

--dump-catalog + [128-bit-ID...] + ¶

Show the contents of the message catalog, with + entries separated by a line consisting of two dashes and the + ID (the format is the same as .catalog + files).

If any 128-bit-IDs are + specified, only those entries are shown.

--update-catalog¶

Update the message catalog index. This command + needs to be executed each time new catalog files are + installed, removed, or updated to rebuild the binary catalog + index.

--setup-keys¶

Instead of showing journal contents, generate + a new key pair for Forward Secure Sealing (FSS). This will + generate a sealing key and a verification key. The sealing key + is stored in the journal data directory and shall remain on + the host. The verification key should be stored + externally. Refer to the Seal= option in + journald.conf(5) + for information on Forward Secure Sealing and for a link to a + refereed scholarly paper detailing the cryptographic theory it + is based on.

--force¶

When --setup-keys is passed + and Forward Secure Sealing (FSS) has already been configured, + recreate FSS keys.

--interval=¶

Specifies the change interval for the sealing + key when generating an FSS key pair with + --setup-keys. Shorter intervals increase CPU + consumption but shorten the time range of undetectable journal + alterations. Defaults to 15min.

--verify¶

Check the journal file for internal + consistency. If the file has been generated with FSS enabled and + the FSS verification key has been specified with + --verify-key=, authenticity of the journal file + is verified.

--verify-key=¶

Specifies the FSS verification key to use for + the --verify operation.

--flush¶

Asks the Journal daemon to flush any log data + stored in /run/log/journal into + /var/log/journal, if persistent storage is + enabled. This call does not return until the operation is + complete.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned; otherwise, a non-zero failure + code is returned.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -511,17 +355,21 @@ --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

Examples¶

Without arguments, all collected logs are shown - unfiltered:

journalctl

With one match specified, all entries with a field matching the expression are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service

If two different fields are matched, only entries matching both expressions at the same time are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097

If two matches refer to the same field, all entries matching either expression are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service

If the separator "+" is used, - two expressions may be combined in a logical OR. The - following will show all messages from the Avahi - service process with the PID 28097 plus all messages - from the D-Bus service (from any of its - processes):

journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service

Show all logs generated by the D-Bus executable:

journalctl /usr/bin/dbus-daemon

Show all logs of the kernel device node /dev/sda:

journalctl /dev/sda

Show all kernel logs from previous boot:

journalctl -k -b -1

Show a live log display from a system service apache.service:

journalctl -f -u apache
+ ("FRSXMK").

Examples¶

Without arguments, all collected logs are shown + unfiltered:

journalctl

With one match specified, all entries with a field matching + the expression are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service

If two different fields are matched, only entries matching + both expressions at the same time are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097

If two matches refer to the same field, all entries matching + either expression are shown:

journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service

If the separator "+" is used, two + expressions may be combined in a logical OR. The following will + show all messages from the Avahi service process with the PID + 28097 plus all messages from the D-Bus service (from any of its + processes):

journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service

Show all logs generated by the D-Bus executable:

journalctl /usr/bin/dbus-daemon

Show all logs of the kernel device node + /dev/sda:

journalctl /dev/sda

Show all kernel logs from previous boot:

journalctl -k -b -1

Show a live log display from a system service + apache.service:

journalctl -f -u apache
diff --git a/man/journalctl.xml b/man/journalctl.xml index 0703bf9fb..770cf9bb2 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -21,978 +21,827 @@ along with systemd; If not, see . --> - - - - journalctl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - journalctl - 1 - - - - journalctl - Query the systemd journal - - - - - journalctl - OPTIONS - MATCHES - - - - - Description - - journalctl may be used to - query the contents of the - systemd1 - journal as written by - systemd-journald.service8. - - If called without parameters, it will show the full - contents of the journal, starting with the oldest - entry collected. - - If one or more match arguments are passed, the - output is filtered accordingly. A match is in the - format FIELD=VALUE, - e.g. _SYSTEMD_UNIT=httpd.service, - referring to the components of a structured journal - entry. See - systemd.journal-fields7 - for a list of well-known fields. If multiple matches - are specified matching different fields, the log - entries are filtered by both, i.e. the resulting output - will show only entries matching all the specified - matches of this kind. If two matches apply to the same - field, then they are automatically matched as - alternatives, i.e. the resulting output will show - entries matching any of the specified matches for the - same field. Finally, the character - + may appears as a separate word - between other terms on the command line. This causes - all matches before and after to be combined in a - disjunction (i.e. logical OR). - - As shortcuts for a few types of field/value - matches, file paths may be specified. If a file path - refers to an executable file, this is equivalent to an - _EXE= match for the canonicalized - binary path. Similarly, if a path refers to a device - node, this is equivalent to a - _KERNEL_DEVICE= match for the - device. - - Additional constraints may be added using options - , , - etc, to further limit what entries will be shown - (logical AND). - - Output is interleaved from all accessible - journal files, whether they are rotated or currently - being written, and regardless of whether they belong to the - system itself or are accessible user journals. - - The set of journal files which will be used - can be modified using the , - , , - and options, see below. - - All users are granted access to their private - per-user journals. However, by default, only root and - users who are members of the systemd-journal - group get access to the system journal and the - journals of other users. - - The output is paged through - less by default, and long lines are - "truncated" to screen width. The hidden part can be - viewed by using the left-arrow and right-arrow - keys. Paging can be disabled; see the - option and the "Environment" - section below. - - When outputting to a tty, lines are colored - according to priority: lines of level ERROR and higher - are colored red; lines of level NOTICE and higher are - highlighted; other lines are displayed normally. + + + + journalctl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + journalctl + 1 + + + + journalctl + Query the systemd journal + + + + + journalctl + OPTIONS + MATCHES + + + + + Description + + journalctl may be used to query the + contents of the + systemd1 + journal as written by + systemd-journald.service8. + + If called without parameters, it will show the full + contents of the journal, starting with the oldest entry + collected. + + If one or more match arguments are passed, the output is + filtered accordingly. A match is in the format + FIELD=VALUE, + e.g. _SYSTEMD_UNIT=httpd.service, referring + to the components of a structured journal entry. See + systemd.journal-fields7 + for a list of well-known fields. If multiple matches are + specified matching different fields, the log entries are + filtered by both, i.e. the resulting output will show only + entries matching all the specified matches of this kind. If two + matches apply to the same field, then they are automatically + matched as alternatives, i.e. the resulting output will show + entries matching any of the specified matches for the same + field. Finally, the character + may appears + as a separate word between other terms on the command line. This + causes all matches before and after to be combined in a + disjunction (i.e. logical OR). + + As shortcuts for a few types of field/value matches, file + paths may be specified. If a file path refers to an executable + file, this is equivalent to an _EXE= match + for the canonicalized binary path. Similarly, if a path refers + to a device node, this is equivalent to a + _KERNEL_DEVICE= match for the device. + + Additional constraints may be added using options + , , etc, to + further limit what entries will be shown (logical AND). + + Output is interleaved from all accessible journal files, + whether they are rotated or currently being written, and + regardless of whether they belong to the system itself or are + accessible user journals. + + The set of journal files which will be used can be + modified using the , + , , and + options, see below. + + All users are granted access to their private per-user + journals. However, by default, only root and users who are + members of a few special groups are granted access to the system + journal and the journals of other users. Members of the the + systemd-journal, adm, and + wheel groups can read all journal files. Note + that the two latter groups traditionally have additional + privileges specified by the distribution. Members of the + wheel group can often perform administrative + tasks. + + The output is paged through less by + default, and long lines are "truncated" to screen width. The + hidden part can be viewed by using the left-arrow and + right-arrow keys. Paging can be disabled; see the + option and the "Environment" section + below. + + When outputting to a tty, lines are colored according to + priority: lines of level ERROR and higher are colored red; lines + of level NOTICE and higher are highlighted; other lines are + displayed normally. + + + + Options + + The following options are understood: + + + + + + + + Ellipsize fields when they do not fit in + available columns. The default is to show full fields, + allowing them to wrap or be truncated by the pager, if one + is used. + + The old options + / are not useful + anymore, except to undo . + + + + + + + + Show all fields in full, even if they + include unprintable characters or are very + long. + + + + + + + Show only the most recent journal entries, + and continuously print new entries as they are appended to + the journal. + + + + + + + Immediately jump to the end of the journal + inside the implied pager tool. This implies + to guarantee that the pager will not + buffer logs of unbounded size. This may be overridden with + an explicit with some other numeric + value while will disable this cap. + Note that this option is only supported for the + less1 + pager. + + + + + + + Show the most recent journal events and + limit the number of events shown. If + is used, this option is + implied. The argument is a positive integer or + all to disable line limiting. The default + value is 10 if no argument is given. + + + + + + Show all stored output lines, even in follow + mode. Undoes the effect of . + + + + + + + + Reverse output so that the newest entries + are displayed first. + + + + + + + Controls the formatting of the journal + entries that are shown. Takes one of the following + options: + + + + + + + is the default and generates an output that is + mostly identical to the formatting of classic syslog + files, showing one line per journal entry. + + + + + + + + + is very similar, but shows ISO 8601 wallclock + timestamps. + + + + + + + + + is very similar, but shows timestamps with full + microsecond precision. + + + + + + + + + is very similar, but shows monotonic timestamps + instead of wallclock timestamps. + + + + + + + + + shows the full-structured entry items with all + fields. + + + + + + + + + serializes the journal into a binary (but mostly + text-based) stream suitable for backups and network + transfer (see + Journal Export Format + for more information). + + + + + + + + + formats entries as JSON data structures, one per + line (see + Journal JSON Format + for more information). + + + + + + + + + formats entries as JSON data structures, but + formats them in multiple lines in order to make them + more readable by humans. + + + + + + + + + formats entries as JSON data structures, but wraps + them in a format suitable for + Server-Sent Events. - - - - Options - - The following options are understood: - - - - - - - - Ellipsize fields when - they do not fit in available columns. - The default is to show full fields, - allowing them to wrap or be truncated - by the pager, if one is used. - - The old options - / - are not useful anymore, except to undo - . - - - - - - - Show all fields in - full, even if they include unprintable - characters or are very - long. - - - - - - - Show only the most recent - journal entries, and continuously print - new entries as they are appended to - the journal. - - - - - - - Immediately jump to - the end of the journal inside the - implied pager tool. This implies - to guarantee - that the pager will not buffer logs of - unbounded size. This may be overridden - with an explicit - with some other numeric value while - will disable this cap. - Note that this option is only supported for the - less1 - pager. - - - - - - - Show the most recent - journal events and limit the number of - events shown. If - is used, - this option is implied. The argument is - a positive integer or all - to disable line limiting. The default value is - 10 if no argument is given. - - - - - - Show all stored output - lines, even in follow mode. Undoes the - effect of - . - - - - - - - Reverse output so that the newest - entries are displayed first. - - - - - - - Controls the - formatting of the journal entries that - are shown. Takes one of the following options: - - - - - - - - is the default - and generates an output - that is mostly identical - to the formatting of - classic syslog files, - showing one line per - journal entry. - - - - - - - - - is very similar, - but shows ISO 8601 - wallclock timestamps. - - - - - - - - - - is very similar, - but shows timestamps - with full microsecond - precision. - - - - - - - - - - is very similar, - but shows monotonic - timestamps instead of - wallclock timestamps. - - - - - - - - - - shows the - full-structured entry - items with all fields. - - - - - - - - - - serializes the - journal into a binary - (but mostly text-based) - stream suitable for - backups and network - transfer (see Journal - Export Format - for more - information). - - - - - - - - - formats entries - as JSON data structures, - one per line (see Journal - JSON Format for - more information). - - - - - - - - - formats entries as - JSON data structures, - but formats them in - multiple lines in order - to make them more - readable by humans. - - - - - - - - - formats entries as - JSON data structures, - but wraps them in a - format suitable for Server-Sent - Events. - - - - - - - - - generates a very - terse output, only - showing the actual - message of each journal - entry with no metadata, - not even a timestamp. - - - - - - - - - - - Express time in Coordinated Universal - Time (UTC). - - - - - - - Augment log lines with - explanation texts from the message - catalog. This will add explanatory - help texts to log messages in the - output where this is available. These - short help texts will explain the - context of an error or log event, - possible solutions, as well as - pointers to support forums, developer - documentation, and any other relevant - manuals. Note that help texts are not - available for all messages, but only - for selected ones. For more - information on the message catalog, - please refer to the Message - Catalog Developer - Documentation. - - Note: when attaching - journalctl output - to bug reports, please do - not use - . - - - - - - - - Suppresses any warning - messages regarding inaccessible system - journals when run as a normal - user. - - - - - - - Show entries - interleaved from all available - journals, including remote - ones. - - - - - - - Show messages from a specific - boot. This will add a match for - _BOOT_ID=. - - The argument may be empty, in which case - logs for the current boot will be shown. - - If the boot ID is omitted, a positive - offset will look up - the boots starting from the beginning of the - journal, and a equal-or-less-than zero - offset will look up - boots starting from the end of the - journal. Thus, 1 means the - first boot found in the journal in - chronological order, 2 the - second and so on; while -0 - is the last boot, -1 the - boot before last, and so on. An empty - offset is equivalent - to specifying -0, except - when the current boot is not the last boot - (e.g. because was - specified to look at logs from a different - machine). - - If the 32-character - ID is specified, it - may optionally be followed by - offset which - identifies the boot relative to the one given by - boot ID. Negative - values mean earlier boots and a positive values - mean later boots. If - offset is not - specified, a value of zero is assumed, and the - logs for the boot given by - ID are shown. - - - - - - - - - Show a tabular list of - boot numbers (relative to the current - boot), their IDs, and the timestamps - of the first and last message - pertaining to the boot. - - - - - - - - Show only kernel messages. This - implies and adds the match - _TRANSPORT=kernel. - - - - - - - - Show messages for the - specified syslog identifier - SYSLOG_IDENTIFIER, or - for any of the messages with a SYSLOG_IDENTIFIER - matched by PATTERN. - - This parameter can be specified - multiple times. - - - - - - - Show messages for the - specified systemd unit - UNIT (such - as a service unit), or for any of the - units matched by - PATTERN. - If a pattern is specified, a list of - unit names found in the journal is - compared with the specified pattern - and all that match are used. For each - unit name, a match is added for - messages from the unit - (_SYSTEMD_UNIT=UNIT), - along with additional matches for - messages from systemd and messages - about coredumps for the specified - unit. - - This parameter can be specified - multiple times. - - - - - - Show messages for the - specified user session unit. This will - add a match for messages from the unit - (_SYSTEMD_USER_UNIT= - and _UID=) and - additional matches for messages from - session systemd and messages about - coredumps for the specified unit. - This parameter can be specified multiple times. - - - - - - - - Filter output by - message priorities or priority - ranges. Takes either a single numeric - or textual log level (i.e. between - 0/emerg and - 7/debug), or a - range of numeric/text log levels in - the form FROM..TO. The log levels are - the usual syslog log levels as - documented in - syslog3, - i.e. emerg (0), - alert (1), - crit (2), - err (3), - warning (4), - notice (5), - info (6), - debug (7). If a - single log level is specified, all - messages with this log level or a - lower (hence more important) log level - are shown. If a range is specified, all - messages within the range are shown, - including both the start and the end - value of the range. This will add - PRIORITY= matches - for the specified - priorities. - - - - - - - Start showing entries - from the location in the journal - specified by the passed - cursor. - - - - - - Start showing entries - from the location in the journal - after the - location specified by the this cursor. - The cursor is shown when the - option - is used. - - - - - - The cursor is shown after the last - entry after two dashes: - -- cursor: s=0639... - The format of the cursor is private - and subject to change. - - - - - - - Start showing entries - on or newer than the specified date, - or on or older than the specified - date, respectively. Date specifications - should be of the format - 2012-10-30 18:17:16. - If the time part is omitted, - 00:00:00 is assumed. - If only the seconds component is omitted, - :00 is assumed. If the - date component is omitted, the current - day is assumed. Alternatively the strings - yesterday, - today, - tomorrow are - understood, which refer to 00:00:00 of - the day before the current day, the - current day, or the day after the - current day, respectively. now - refers to the current time. Finally, - relative times may be specified, - prefixed with - or - +, referring to - times before or after the current - time, respectively. - - - - - - - Print all possible - data values the specified field can - take in all entries of the - journal. - - - - - - - Show messages from - system services and the kernel (with - ). Show - messages from service of current user - (with ). - If neither is specified, show all - messages that the user can see. - - - - - - - - Show messages from a - running, local container. Specify a - container name to connect - to. - - - - - - - Takes a directory path - as argument. If specified, journalctl - will operate on the specified journal - directory - DIR instead - of the default runtime and system - journal paths. - - - - - - Takes a file glob as an - argument. If specified, journalctl will - operate on the specified journal files - matching GLOB - instead of the default runtime and - system journal paths. May be specified - multiple times, in which case files will - be suitably interleaved. - - - - - - Takes a directory path - as an argument. If specified, journalctl - will operate on catalog file hierarchy - underneath the specified directory - instead of the root directory - (e.g. - will create - ROOT/var/lib/systemd/catalog/database). - - - - - - - Instead of showing - journal contents, generate a new 128-bit - ID suitable for identifying - messages. This is intended for usage - by developers who need a new - identifier for a new message they - introduce and want to make - recognizable. This will print the new ID in - three different formats which can be - copied into source code or - similar. - - - - - - Instead of showing - journal contents, show internal header - information of the journal fields - accessed. - - - - - - Shows the current disk - usage of all journal files. This shows - the sum of the disk usage of all - archived and active journal - files. - - - - - - - Removes archived - journal files until the disk space - they use falls below the specified - size (specified with the usual K, M, - G, T suffixes), or all journal files - contain no data older than the - specified timespan (specified with the - usual s, min, h, days, months, weeks, - years suffixes). Note that running - has - only indirect effect on the output - shown by - as the latter includes active journal - files, while the former only operates - on archived journal - files. - and - may be combined in a single invocation - to enforce both a size and time limit - on the archived journal - files. - - - - - - List the contents of - the message catalog as a table of - message IDs, plus their short - description strings. - - If any - 128-bit-IDs are - specified, only those entries are shown. - - - - - - - - Show the contents of - the message catalog, with entries - separated by a line consisting of two - dashes and the ID (the format is the - same as .catalog - files). - - If any - 128-bit-IDs are - specified, only those entries are shown. - - - - - - - - Update the message - catalog index. This command needs to - be executed each time new catalog - files are installed, removed, or - updated to rebuild the binary catalog - index. - - - - - - Instead of showing - journal contents, generate a new key - pair for Forward Secure Sealing - (FSS). This will generate a sealing - key and a verification key. The - sealing key is stored in the journal - data directory and shall remain on the - host. The verification key should be - stored externally. Refer to the - option in - journald.conf5 - for information on Forward Secure - Sealing and for a link to a refereed - scholarly paper detailing the - cryptographic theory it is based on. - - - - - - - When - is passed and - Forward Secure Sealing (FSS) has already been - configured, recreate FSS keys. - - - - - - Specifies the change - interval for the sealing key when - generating an FSS key pair with - . Shorter - intervals increase CPU consumption but - shorten the time range of - undetectable journal - alterations. Defaults to - 15min. - - - - - - Check the journal file - for internal consistency. If the - file has been generated with FSS - enabled and the FSS verification key - has been specified with - , - authenticity of the journal file is - verified. - - - - - - Specifies the FSS - verification key to use for the - - operation. - - - - - - Asks the Journal - daemon to flush any log data stored in - /run/log/journal - into - /var/log/journal, - if persistent storage is enabled. This - call does not return until the - operation is - complete. - - - - - - - - - - Exit status - - On success, 0 is returned; otherwise, a non-zero - failure code is returned. - - - - - - Examples - - Without arguments, all collected logs are shown - unfiltered: - - journalctl - - With one match specified, all entries with a field matching the expression are shown: - - journalctl _SYSTEMD_UNIT=avahi-daemon.service - - If two different fields are matched, only entries matching both expressions at the same time are shown: + + + + + + + + + generates a very terse output, only showing the + actual message of each journal entry with no metadata, + not even a timestamp. + + + + + + + + + + Express time in Coordinated Universal Time + (UTC). + + + + + + + Augment log lines with explanation texts from + the message catalog. This will add explanatory help texts to + log messages in the output where this is available. These + short help texts will explain the context of an error or log + event, possible solutions, as well as pointers to support + forums, developer documentation, and any other relevant + manuals. Note that help texts are not available for all + messages, but only for selected ones. For more information on + the message catalog, please refer to the + Message Catalog Developer Documentation. + + Note: when attaching journalctl + output to bug reports, please do not use + . + + + + + + + + Suppresses any warning messages regarding + inaccessible system journals when run as a normal + user. + + + + + + + Show entries interleaved from all available + journals, including remote ones. + + + + + + + Show messages from a specific boot. This will + add a match for _BOOT_ID=. + + The argument may be empty, in which case logs for the + current boot will be shown. + + If the boot ID is omitted, a positive + offset will look up the boots + starting from the beginning of the journal, and a + equal-or-less-than zero offset will + look up boots starting from the end of the journal. Thus, + 1 means the first boot found in the + journal in chronological order, 2 the + second and so on; while -0 is the last + boot, -1 the boot before last, and so + on. An empty offset is equivalent + to specifying -0, except when the current + boot is not the last boot (e.g. because + was specified to look at logs + from a different machine). + + If the 32-character ID is + specified, it may optionally be followed by + offset which identifies the boot + relative to the one given by boot + ID. Negative values mean earlier + boots and a positive values mean later boots. If + offset is not specified, a value of + zero is assumed, and the logs for the boot given by + ID are shown. + + + + + + + Show a tabular list of boot numbers (relative to + the current boot), their IDs, and the timestamps of the first + and last message pertaining to the boot. + + + + + + + Show only kernel messages. This implies + and adds the match + _TRANSPORT=kernel. + + + + + + + Show messages for the specified syslog + identifier SYSLOG_IDENTIFIER, or + for any of the messages with a + SYSLOG_IDENTIFIER matched by + PATTERN. + + This parameter can be specified multiple + times. + + + + + + + Show messages for the specified systemd unit + UNIT (such as a service unit), or + for any of the units matched by + PATTERN. If a pattern is + specified, a list of unit names found in the journal is + compared with the specified pattern and all that match are + used. For each unit name, a match is added for messages from + the unit + (_SYSTEMD_UNIT=UNIT), + along with additional matches for messages from systemd and + messages about coredumps for the specified unit. + + This parameter can be specified multiple times. + + + + + + + Show messages for the specified user session + unit. This will add a match for messages from the unit + (_SYSTEMD_USER_UNIT= and + _UID=) and additional matches for messages + from session systemd and messages about coredumps for the + specified unit. + + This parameter can be specified multiple times. + + + + + + + + Filter output by message priorities or + priority ranges. Takes either a single numeric or textual log + level (i.e. between 0/emerg and + 7/debug), or a range of numeric/text log + levels in the form FROM..TO. The log levels are the usual + syslog log levels as documented in + syslog3, + i.e. emerg (0), + alert (1), crit (2), + err (3), warning (4), + notice (5), info (6), + debug (7). If a single log level is + specified, all messages with this log level or a lower (hence + more important) log level are shown. If a range is specified, + all messages within the range are shown, including both the + start and the end value of the range. This will add + PRIORITY= matches for the specified + priorities. + + + + + + + Start showing entries from the location in the + journal specified by the passed cursor. + + + + + + Start showing entries from the location in the + journal after the location specified by + the this cursor. The cursor is shown when the + option is used. + + + + + + + The cursor is shown after the last entry after + two dashes: + -- cursor: s=0639... + The format of the cursor is private + and subject to change. + + + + + + + Start showing entries on or newer than the + specified date, or on or older than the specified date, + respectively. Date specifications should be of the format + 2012-10-30 18:17:16. If the time part is + omitted, 00:00:00 is assumed. If only the + seconds component is omitted, :00 is + assumed. If the date component is omitted, the current day is + assumed. Alternatively the strings + yesterday, today, + tomorrow are understood, which refer to + 00:00:00 of the day before the current day, the current day, + or the day after the current day, + respectively. now refers to the current + time. Finally, relative times may be specified, prefixed with + - or +, referring to + times before or after the current time, respectively. + + + + + + + + Print all possible data values the specified + field can take in all entries of the journal. + + + + + + + Show messages from system services and the + kernel (with ). Show messages from + service of current user (with ). If + neither is specified, show all messages that the user can see. + + + + + + + + Show messages from a running, local + container. Specify a container name to connect to. + + + + + + + + Takes a directory path as argument. If + specified, journalctl will operate on the specified journal + directory DIR instead of the + default runtime and system journal paths. + + + + + + Takes a file glob as an argument. If + specified, journalctl will operate on the specified journal + files matching GLOB instead of the + default runtime and system journal paths. May be specified + multiple times, in which case files will be suitably + interleaved. + + + + + + Takes a directory path as an argument. If + specified, journalctl will operate on catalog file hierarchy + underneath the specified directory instead of the root + directory (e.g. will create + ROOT/var/lib/systemd/catalog/database). + + + + + + + Instead of showing journal contents, generate + a new 128-bit ID suitable for identifying messages. This is + intended for usage by developers who need a new identifier for + a new message they introduce and want to make + recognizable. This will print the new ID in three different + formats which can be copied into source code or similar. + + + + + + + Instead of showing journal contents, show + internal header information of the journal fields + accessed. + + + + + + Shows the current disk usage of all journal + files. This shows the sum of the disk usage of all archived + and active journal files. + + + + + + + Removes archived journal files until the disk + space they use falls below the specified size (specified with + the usual K, M, + G, T suffixes), or all + journal files contain no data older than the specified + timespan (specified with the usual s, + min, h, + days, months, + weeks, years + suffixes). Note that running + has only indirect effect on the output shown by + as the latter includes active + journal files, while the former only operates on archived + journal files. and + may be combined in a single + invocation to enforce both a size and time limit on the + archived journal files. + + + + + + List the contents of the message catalog as a + table of message IDs, plus their short description strings. + + + If any 128-bit-IDs are + specified, only those entries are shown. + + + + + + + Show the contents of the message catalog, with + entries separated by a line consisting of two dashes and the + ID (the format is the same as .catalog + files). + + If any 128-bit-IDs are + specified, only those entries are shown. + + + + + + + Update the message catalog index. This command + needs to be executed each time new catalog files are + installed, removed, or updated to rebuild the binary catalog + index. + + + + + + Instead of showing journal contents, generate + a new key pair for Forward Secure Sealing (FSS). This will + generate a sealing key and a verification key. The sealing key + is stored in the journal data directory and shall remain on + the host. The verification key should be stored + externally. Refer to the option in + journald.conf5 + for information on Forward Secure Sealing and for a link to a + refereed scholarly paper detailing the cryptographic theory it + is based on. + + + + + + When is passed + and Forward Secure Sealing (FSS) has already been configured, + recreate FSS keys. + + + + - journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + Specifies the change interval for the sealing + key when generating an FSS key pair with + . Shorter intervals increase CPU + consumption but shorten the time range of undetectable journal + alterations. Defaults to 15min. + + + + + + Check the journal file for internal + consistency. If the file has been generated with FSS enabled and + the FSS verification key has been specified with + , authenticity of the journal file + is verified. + + + + + + Specifies the FSS verification key to use for + the operation. + + + + + + Asks the Journal daemon to flush any log data + stored in /run/log/journal into + /var/log/journal, if persistent storage is + enabled. This call does not return until the operation is + complete. + - If two matches refer to the same field, all entries matching either expression are shown: + + + + + - journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service + + Exit status - If the separator + is used, - two expressions may be combined in a logical OR. The - following will show all messages from the Avahi - service process with the PID 28097 plus all messages - from the D-Bus service (from any of its - processes): + On success, 0 is returned; otherwise, a non-zero failure + code is returned. + - journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service + - Show all logs generated by the D-Bus executable: + + Examples - journalctl /usr/bin/dbus-daemon + Without arguments, all collected logs are shown + unfiltered: - Show all logs of the kernel device node /dev/sda: + journalctl - journalctl /dev/sda + With one match specified, all entries with a field matching + the expression are shown: - Show all kernel logs from previous boot: + journalctl _SYSTEMD_UNIT=avahi-daemon.service - journalctl -k -b -1 + If two different fields are matched, only entries matching + both expressions at the same time are shown: - Show a live log display from a system service apache.service: + journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 - journalctl -f -u apache + If two matches refer to the same field, all entries matching + either expression are shown: - + journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service - - See Also - - systemd1, - systemd-journald.service8, - systemctl1, - coredumpctl1, - systemd.journal-fields7, - journald.conf5 - - + If the separator + is used, two + expressions may be combined in a logical OR. The following will + show all messages from the Avahi service process with the PID + 28097 plus all messages from the D-Bus service (from any of its + processes): + + journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service + + Show all logs generated by the D-Bus executable: + + journalctl /usr/bin/dbus-daemon + + Show all logs of the kernel device node + /dev/sda: + + journalctl /dev/sda + + Show all kernel logs from previous boot: + + journalctl -k -b -1 + + Show a live log display from a system service + apache.service: + + journalctl -f -u apache + + + + See Also + + systemd1, + systemd-journald.service8, + systemctl1, + coredumpctl1, + systemd.journal-fields7, + journald.conf5 + + diff --git a/man/journald.conf.5 b/man/journald.conf.5 index c416ed42e..d666cdd86 100644 --- a/man/journald.conf.5 +++ b/man/journald.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "JOURNALD\&.CONF" "5" "" "systemd 218" "journald.conf" +.TH "JOURNALD\&.CONF" "5" "" "systemd 219" "journald.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -242,8 +242,7 @@ Controls the maximum log level of messages that are stored on disk, forwarded to "warning", "notice", "info", -"debug" -or integer values in the range of 0\&.\&.7 (corresponding to the same levels)\&. Messages equal or below the log level specified are stored/forwarded, messages above are dropped\&. Defaults to +"debug", or integer values in the range of 0\&.\&.7 (corresponding to the same levels)\&. Messages equal or below the log level specified are stored/forwarded, messages above are dropped\&. Defaults to "debug" for \fIMaxLevelStore=\fR @@ -254,8 +253,7 @@ for \fIMaxLevelKMsg=\fR, "info" for -\fIMaxLevelConsole=\fR -and +\fIMaxLevelConsole=\fR, and "emerg" for \fIMaxLevelWall=\fR\&. diff --git a/man/journald.conf.d.html b/man/journald.conf.d.html index 4430d18d4..f6ca0dff4 100644 --- a/man/journald.conf.d.html +++ b/man/journald.conf.d.html @@ -19,9 +19,9 @@ Directives · Python · libudev · - gudev systemd 218

Name

journald.conf, journald.conf.d — Journal service configuration files

Synopsis

/etc/systemd/journald.conf

/etc/systemd/journald.conf.d/*.conf

/run/systemd/journald.conf.d/*.conf

/usr/lib/systemd/journald.conf.d/*.conf

Description¶

These files configure various parameters of the - systemd journal service, - systemd-journald.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

journald.conf, journald.conf.d — Journal service configuration files

Synopsis

/etc/systemd/journald.conf

/etc/systemd/journald.conf.d/*.conf

/run/systemd/journald.conf.d/*.conf

/usr/lib/systemd/journald.conf.d/*.conf

Description¶

These files configure various parameters of the systemd + journal service, + systemd-journald.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -45,309 +45,205 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Journal]" section:

Storage=¶

Controls where to - store journal data. One of - "volatile", - "persistent", - "auto" and - "none". If - "volatile", journal - log data will be stored only in - memory, i.e. below the - /run/log/journal - hierarchy (which is created if - needed). If - "persistent", data will - be stored preferably on disk, - i.e. below the - /var/log/journal - hierarchy (which is created if - needed), with a fallback to - /run/log/journal - (which is created if needed), during - early boot and if the disk is not - writable. "auto" is - similar to - "persistent" but the - directory - /var/log/journal - is not created if needed, so that its - existence controls where log data - goes. "none" turns - off all storage, all log data received - will be dropped. Forwarding to other - targets, such as the console, the - kernel log buffer or a syslog daemon - will still work however. Defaults to - "auto".

Compress=¶

Takes a boolean - value. If enabled (the default), data - objects that shall be stored in the - journal and are larger than a certain - threshold are compressed before they - are written to the file - system.

Seal=¶

Takes a boolean - value. If enabled (the default), and a - sealing key is available (as created - by - journalctl(1)'s - --setup-keys - command), Forward Secure Sealing (FSS) - for all persistent journal files is - enabled. FSS is based on Seekable - Sequential Key Generators by - G. A. Marson and B. Poettering - (doi:10.1007/978-3-642-40203-6_7) - and may be used to protect journal files - from unnoticed alteration.

SplitMode=¶

Controls whether to - split up journal files per user. One - of "uid", - "login" and - "none". If - "uid", all users will - get each their own journal files - regardless of whether they possess a - login session or not, however system - users will log into the system - journal. If "login", - actually logged-in users will get each - their own journal files, but users - without login session and system users - will log into the system journal. If - "none", journal files - are not split up by user and all - messages are instead stored in the - single system journal. Note that - splitting up journal files by user is - only available for journals stored - persistently. If journals are stored - on volatile storage (see above), only - a single journal file for all user IDs - is kept. Defaults to - "uid".

RateLimitInterval=, RateLimitBurst=¶

Configures the rate - limiting that is applied to all - messages generated on the system. If, - in the time interval defined by - RateLimitInterval=, - more messages than specified in - RateLimitBurst= are - logged by a service, all further - messages within the interval are - dropped until the interval is over. A - message about the number of dropped - messages is generated. This rate - limiting is applied per-service, so - that two services which log do not - interfere with each other's - limits. Defaults to 1000 messages in - 30s. The time specification for - RateLimitInterval= - may be specified in the following - units: "s", - "min", - "h", - "ms", - "us". To turn off any - kind of rate limiting, set either - value to 0.

SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=¶

Enforce size limits on - the journal files stored. The options - prefixed with - "System" apply to the - journal files when stored on a - persistent file system, more - specifically - /var/log/journal. The - options prefixed with - "Runtime" apply to - the journal files when stored on a - volatile in-memory file system, more - specifically - /run/log/journal. The - former is used only when - /var is mounted, - writable, and the directory - /var/log/journal - exists. Otherwise, only the latter - applies. Note that this means that - during early boot and if the - administrator disabled persistent - logging, only the latter options apply, - while the former apply if persistent - logging is enabled and the system is - fully booted - up. journalctl and - systemd-journald - ignore all files with names not ending - with ".journal" or - ".journal~", so only - such files, located in the appropriate - directories, are taken into account - when calculating current disk usage. -

SystemMaxUse= - and RuntimeMaxUse= - control how much disk space the - journal may use up at maximum. - SystemKeepFree= and - RuntimeKeepFree= - control how much disk space - systemd-journald shall leave free for - other uses. - systemd-journald - will respect both limits and use the - smaller of the two values.

The first pair defaults to 10% - and the second to 15% of the size of - the respective file system. If the - file system is nearly full and either - SystemKeepFree= or - RuntimeKeepFree= is - violated when systemd-journald is - started, the value will be raised to - percentage that is actually free. This - means that if there was enough - free space before and journal files were - created, and subsequently something - else causes the file system to fill - up, journald will stop using more - space, but it will not be removing - existing files to go reduce footprint - either.

SystemMaxFileSize= - and - RuntimeMaxFileSize= - control how large individual journal - files may grow at maximum. This - influences the granularity in which - disk space is made available through - rotation, i.e. deletion of historic - data. Defaults to one eighth of the - values configured with - SystemMaxUse= and - RuntimeMaxUse=, so - that usually seven rotated journal - files are kept as history. Specify - values in bytes or use K, M, G, T, P, - E as units for the specified sizes - (equal to 1024, 1024²,... bytes). - Note that size limits are enforced - synchronously when journal files are - extended, and no explicit rotation - step triggered by time is - needed.

MaxFileSec=¶

The maximum time to - store entries in a single journal - file before rotating to the next - one. Normally, time-based rotation - should not be required as size-based - rotation with options such as - SystemMaxFileSize= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to ensure that not - too much data is lost at once when old - journal files are deleted, it might - make sense to change this value from - the default of one month. Set to 0 to - turn off this feature. This setting - takes time values which may be - suffixed with the units - "year", - "month", - "week", "day", - "h" or "m" - to override the default time unit of - seconds.

MaxRetentionSec=¶

The maximum time to - store journal entries. This - controls whether journal files - containing entries older then the - specified time span are - deleted. Normally, time-based deletion - of old journal files should not be - required as size-based deletion with - options such as - SystemMaxUse= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to enforce data - retention policies, it might make sense - to change this value from the - default of 0 (which turns off this - feature). This setting also takes - time values which may be suffixed with - the units "year", - "month", - "week", "day", - "h" or " m" - to override the default time unit of - seconds.

SyncIntervalSec=¶

The timeout before - synchronizing journal files to - disk. After syncing, journal files are - placed in the OFFLINE state. Note that - syncing is unconditionally done - immediately after a log message of - priority CRIT, ALERT or EMERG has been - logged. This setting hence applies - only to messages of the levels ERR, - WARNING, NOTICE, INFO, DEBUG. The - default timeout is 5 minutes. -

ForwardToSyslog=, ForwardToKMsg=, ForwardToConsole=, ForwardToWall=¶

Control whether log - messages received by the journal - daemon shall be forwarded to a - traditional syslog daemon, to the - kernel log buffer (kmsg), to the - system console, or sent as wall - messages to all logged-in users. These - options take boolean arguments. If - forwarding to syslog is enabled but no - syslog daemon is running, the - respective option has no effect. By - default, only forwarding wall is - enabled. These settings may be - overridden at boot time with the - kernel command line options - "systemd.journald.forward_to_syslog=", - "systemd.journald.forward_to_kmsg=", - "systemd.journald.forward_to_console=" - and - "systemd.journald.forward_to_wall=". - When forwarding to the console, the - TTY to log to can be changed with - TTYPath=, described - below.

MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=¶

Controls the maximum - log level of messages that are stored - on disk, forwarded to syslog, kmsg, - the console or wall (if that is - enabled, see above). As argument, - takes one of - "emerg", - "alert", - "crit", - "err", - "warning", - "notice", - "info", - "debug" or integer - values in the range of 0..7 (corresponding - to the same levels). Messages equal or below - the log level specified are - stored/forwarded, messages above are - dropped. Defaults to - "debug" for - MaxLevelStore= and - MaxLevelSyslog=, to - ensure that the all messages are - written to disk and forwarded to - syslog. Defaults to - "notice" for - MaxLevelKMsg=, - "info" for - MaxLevelConsole= and - "emerg" for - MaxLevelWall=.

TTYPath=¶

Change the console TTY - to use if - ForwardToConsole=yes - is used. Defaults to - /dev/console.

+ file.

Options¶

All options are configured in the + "[Journal]" section:

Storage=¶

Controls where to store journal data. One of + "volatile", + "persistent", + "auto" and + "none". If + "volatile", journal + log data will be stored only in memory, i.e. below the + /run/log/journal hierarchy (which is + created if needed). If "persistent", data + will be stored preferably on disk, i.e. below the + /var/log/journal hierarchy (which is + created if needed), with a fallback to + /run/log/journal (which is created if + needed), during early boot and if the disk is not writable. + "auto" is similar to + "persistent" but the directory + /var/log/journal is not created if + needed, so that its existence controls where log data goes. + "none" turns off all storage, all log data + received will be dropped. Forwarding to other targets, such as + the console, the kernel log buffer or a syslog daemon will + still work however. Defaults to + "auto".

Compress=¶

Takes a boolean value. If enabled (the + default), data objects that shall be stored in the journal and + are larger than a certain threshold are compressed before they + are written to the file system.

Seal=¶

Takes a boolean value. If enabled (the + default), and a sealing key is available (as created by + journalctl(1)'s + --setup-keys command), Forward Secure Sealing + (FSS) for all persistent journal files is enabled. FSS is + based on Seekable Sequential Key + Generators by G. A. Marson and B. Poettering + (doi:10.1007/978-3-642-40203-6_7) and may be used to protect + journal files from unnoticed alteration.

SplitMode=¶

Controls whether to split up journal files per + user. One of "uid", "login" + and "none". If "uid", all + users will get each their own journal files regardless of + whether they possess a login session or not, however system + users will log into the system journal. If + "login", actually logged-in users will get + each their own journal files, but users without login session + and system users will log into the system journal. If + "none", journal files are not split up by + user and all messages are instead stored in the single system + journal. Note that splitting up journal files by user is only + available for journals stored persistently. If journals are + stored on volatile storage (see above), only a single journal + file for all user IDs is kept. Defaults to + "uid".

RateLimitInterval=, RateLimitBurst=¶

Configures the rate limiting that is applied + to all messages generated on the system. If, in the time + interval defined by RateLimitInterval=, + more messages than specified in + RateLimitBurst= are logged by a service, + all further messages within the interval are dropped until the + interval is over. A message about the number of dropped + messages is generated. This rate limiting is applied + per-service, so that two services which log do not interfere + with each other's limits. Defaults to 1000 messages in 30s. + The time specification for + RateLimitInterval= may be specified in the + following units: "s", "min", + "h", "ms", + "us". To turn off any kind of rate limiting, + set either value to 0.

SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=¶

Enforce size limits on the journal files + stored. The options prefixed with "System" + apply to the journal files when stored on a persistent file + system, more specifically + /var/log/journal. The options prefixed + with "Runtime" apply to the journal files + when stored on a volatile in-memory file system, more + specifically /run/log/journal. The former + is used only when /var is mounted, + writable, and the directory + /var/log/journal exists. Otherwise, only + the latter applies. Note that this means that during early + boot and if the administrator disabled persistent logging, + only the latter options apply, while the former apply if + persistent logging is enabled and the system is fully booted + up. journalctl and + systemd-journald ignore all files with + names not ending with ".journal" or + ".journal~", so only such files, located in + the appropriate directories, are taken into account when + calculating current disk usage. +

SystemMaxUse= and + RuntimeMaxUse= control how much disk space + the journal may use up at maximum. + SystemKeepFree= and + RuntimeKeepFree= control how much disk + space systemd-journald shall leave free for other uses. + systemd-journald will respect both limits + and use the smaller of the two values.

The first pair defaults to 10% and the second to 15% of + the size of the respective file system. If the file system is + nearly full and either SystemKeepFree= or + RuntimeKeepFree= is violated when + systemd-journald is started, the value will be raised to + percentage that is actually free. This means that if there was + enough free space before and journal files were created, and + subsequently something else causes the file system to fill up, + journald will stop using more space, but it will not be + removing existing files to go reduce footprint either.

SystemMaxFileSize= + and + RuntimeMaxFileSize= + control how large individual journal + files may grow at maximum. This + influences the granularity in which + disk space is made available through + rotation, i.e. deletion of historic + data. Defaults to one eighth of the + values configured with + SystemMaxUse= and + RuntimeMaxUse=, so + that usually seven rotated journal + files are kept as history. Specify + values in bytes or use K, M, G, T, P, + E as units for the specified sizes + (equal to 1024, 1024²,... bytes). + Note that size limits are enforced + synchronously when journal files are + extended, and no explicit rotation + step triggered by time is + needed.

MaxFileSec=¶

The maximum time to store entries in a single + journal file before rotating to the next one. Normally, + time-based rotation should not be required as size-based + rotation with options such as + SystemMaxFileSize= should be sufficient to + ensure that journal files do not grow without bounds. However, + to ensure that not too much data is lost at once when old + journal files are deleted, it might make sense to change this + value from the default of one month. Set to 0 to turn off this + feature. This setting takes time values which may be suffixed + with the units "year", + "month", "week", + "day", "h" or + "m" to override the default time unit of + seconds.

MaxRetentionSec=¶

The maximum time to store journal entries. + This controls whether journal files containing entries older + then the specified time span are deleted. Normally, time-based + deletion of old journal files should not be required as + size-based deletion with options such as + SystemMaxUse= should be sufficient to + ensure that journal files do not grow without bounds. However, + to enforce data retention policies, it might make sense to + change this value from the default of 0 (which turns off this + feature). This setting also takes time values which may be + suffixed with the units "year", + "month", "week", + "day", "h" or " + m" to override the default time unit of + seconds.

SyncIntervalSec=¶

The timeout before synchronizing journal files + to disk. After syncing, journal files are placed in the + OFFLINE state. Note that syncing is unconditionally done + immediately after a log message of priority CRIT, ALERT or + EMERG has been logged. This setting hence applies only to + messages of the levels ERR, WARNING, NOTICE, INFO, DEBUG. The + default timeout is 5 minutes.

ForwardToSyslog=, ForwardToKMsg=, ForwardToConsole=, ForwardToWall=¶

Control whether log messages received by the + journal daemon shall be forwarded to a traditional syslog + daemon, to the kernel log buffer (kmsg), to the system + console, or sent as wall messages to all logged-in users. + These options take boolean arguments. If forwarding to syslog + is enabled but no syslog daemon is running, the respective + option has no effect. By default, only forwarding wall is + enabled. These settings may be overridden at boot time with + the kernel command line options + "systemd.journald.forward_to_syslog=", + "systemd.journald.forward_to_kmsg=", + "systemd.journald.forward_to_console=" and + "systemd.journald.forward_to_wall=". When + forwarding to the console, the TTY to log to can be changed + with TTYPath=, described + below.

MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=¶

Controls the maximum log level of messages + that are stored on disk, forwarded to syslog, kmsg, the + console or wall (if that is enabled, see above). As argument, + takes one of + "emerg", + "alert", + "crit", + "err", + "warning", + "notice", + "info", + "debug", + or integer values in the range of 0..7 (corresponding to the + same levels). Messages equal or below the log level specified + are stored/forwarded, messages above are dropped. Defaults to + "debug" for MaxLevelStore= + and MaxLevelSyslog=, to ensure that the all + messages are written to disk and forwarded to syslog. Defaults + to + "notice" for MaxLevelKMsg=, + "info" for MaxLevelConsole=, + and "emerg" for + MaxLevelWall=.

TTYPath=¶

Change the console TTY to use if + ForwardToConsole=yes is used. Defaults to + /dev/console.

diff --git a/man/journald.conf.html b/man/journald.conf.html index 4430d18d4..f6ca0dff4 100644 --- a/man/journald.conf.html +++ b/man/journald.conf.html @@ -19,9 +19,9 @@ Directives · Python · libudev · - gudev systemd 218

Name

journald.conf, journald.conf.d — Journal service configuration files

Synopsis

/etc/systemd/journald.conf

/etc/systemd/journald.conf.d/*.conf

/run/systemd/journald.conf.d/*.conf

/usr/lib/systemd/journald.conf.d/*.conf

Description¶

These files configure various parameters of the - systemd journal service, - systemd-journald.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

journald.conf, journald.conf.d — Journal service configuration files

Synopsis

/etc/systemd/journald.conf

/etc/systemd/journald.conf.d/*.conf

/run/systemd/journald.conf.d/*.conf

/usr/lib/systemd/journald.conf.d/*.conf

Description¶

These files configure various parameters of the systemd + journal service, + systemd-journald.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -45,309 +45,205 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Journal]" section:

Storage=¶

Controls where to - store journal data. One of - "volatile", - "persistent", - "auto" and - "none". If - "volatile", journal - log data will be stored only in - memory, i.e. below the - /run/log/journal - hierarchy (which is created if - needed). If - "persistent", data will - be stored preferably on disk, - i.e. below the - /var/log/journal - hierarchy (which is created if - needed), with a fallback to - /run/log/journal - (which is created if needed), during - early boot and if the disk is not - writable. "auto" is - similar to - "persistent" but the - directory - /var/log/journal - is not created if needed, so that its - existence controls where log data - goes. "none" turns - off all storage, all log data received - will be dropped. Forwarding to other - targets, such as the console, the - kernel log buffer or a syslog daemon - will still work however. Defaults to - "auto".

Compress=¶

Takes a boolean - value. If enabled (the default), data - objects that shall be stored in the - journal and are larger than a certain - threshold are compressed before they - are written to the file - system.

Seal=¶

Takes a boolean - value. If enabled (the default), and a - sealing key is available (as created - by - journalctl(1)'s - --setup-keys - command), Forward Secure Sealing (FSS) - for all persistent journal files is - enabled. FSS is based on Seekable - Sequential Key Generators by - G. A. Marson and B. Poettering - (doi:10.1007/978-3-642-40203-6_7) - and may be used to protect journal files - from unnoticed alteration.

SplitMode=¶

Controls whether to - split up journal files per user. One - of "uid", - "login" and - "none". If - "uid", all users will - get each their own journal files - regardless of whether they possess a - login session or not, however system - users will log into the system - journal. If "login", - actually logged-in users will get each - their own journal files, but users - without login session and system users - will log into the system journal. If - "none", journal files - are not split up by user and all - messages are instead stored in the - single system journal. Note that - splitting up journal files by user is - only available for journals stored - persistently. If journals are stored - on volatile storage (see above), only - a single journal file for all user IDs - is kept. Defaults to - "uid".

RateLimitInterval=, RateLimitBurst=¶

Configures the rate - limiting that is applied to all - messages generated on the system. If, - in the time interval defined by - RateLimitInterval=, - more messages than specified in - RateLimitBurst= are - logged by a service, all further - messages within the interval are - dropped until the interval is over. A - message about the number of dropped - messages is generated. This rate - limiting is applied per-service, so - that two services which log do not - interfere with each other's - limits. Defaults to 1000 messages in - 30s. The time specification for - RateLimitInterval= - may be specified in the following - units: "s", - "min", - "h", - "ms", - "us". To turn off any - kind of rate limiting, set either - value to 0.

SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=¶

Enforce size limits on - the journal files stored. The options - prefixed with - "System" apply to the - journal files when stored on a - persistent file system, more - specifically - /var/log/journal. The - options prefixed with - "Runtime" apply to - the journal files when stored on a - volatile in-memory file system, more - specifically - /run/log/journal. The - former is used only when - /var is mounted, - writable, and the directory - /var/log/journal - exists. Otherwise, only the latter - applies. Note that this means that - during early boot and if the - administrator disabled persistent - logging, only the latter options apply, - while the former apply if persistent - logging is enabled and the system is - fully booted - up. journalctl and - systemd-journald - ignore all files with names not ending - with ".journal" or - ".journal~", so only - such files, located in the appropriate - directories, are taken into account - when calculating current disk usage. -

SystemMaxUse= - and RuntimeMaxUse= - control how much disk space the - journal may use up at maximum. - SystemKeepFree= and - RuntimeKeepFree= - control how much disk space - systemd-journald shall leave free for - other uses. - systemd-journald - will respect both limits and use the - smaller of the two values.

The first pair defaults to 10% - and the second to 15% of the size of - the respective file system. If the - file system is nearly full and either - SystemKeepFree= or - RuntimeKeepFree= is - violated when systemd-journald is - started, the value will be raised to - percentage that is actually free. This - means that if there was enough - free space before and journal files were - created, and subsequently something - else causes the file system to fill - up, journald will stop using more - space, but it will not be removing - existing files to go reduce footprint - either.

SystemMaxFileSize= - and - RuntimeMaxFileSize= - control how large individual journal - files may grow at maximum. This - influences the granularity in which - disk space is made available through - rotation, i.e. deletion of historic - data. Defaults to one eighth of the - values configured with - SystemMaxUse= and - RuntimeMaxUse=, so - that usually seven rotated journal - files are kept as history. Specify - values in bytes or use K, M, G, T, P, - E as units for the specified sizes - (equal to 1024, 1024²,... bytes). - Note that size limits are enforced - synchronously when journal files are - extended, and no explicit rotation - step triggered by time is - needed.

MaxFileSec=¶

The maximum time to - store entries in a single journal - file before rotating to the next - one. Normally, time-based rotation - should not be required as size-based - rotation with options such as - SystemMaxFileSize= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to ensure that not - too much data is lost at once when old - journal files are deleted, it might - make sense to change this value from - the default of one month. Set to 0 to - turn off this feature. This setting - takes time values which may be - suffixed with the units - "year", - "month", - "week", "day", - "h" or "m" - to override the default time unit of - seconds.

MaxRetentionSec=¶

The maximum time to - store journal entries. This - controls whether journal files - containing entries older then the - specified time span are - deleted. Normally, time-based deletion - of old journal files should not be - required as size-based deletion with - options such as - SystemMaxUse= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to enforce data - retention policies, it might make sense - to change this value from the - default of 0 (which turns off this - feature). This setting also takes - time values which may be suffixed with - the units "year", - "month", - "week", "day", - "h" or " m" - to override the default time unit of - seconds.

SyncIntervalSec=¶

The timeout before - synchronizing journal files to - disk. After syncing, journal files are - placed in the OFFLINE state. Note that - syncing is unconditionally done - immediately after a log message of - priority CRIT, ALERT or EMERG has been - logged. This setting hence applies - only to messages of the levels ERR, - WARNING, NOTICE, INFO, DEBUG. The - default timeout is 5 minutes. -

ForwardToSyslog=, ForwardToKMsg=, ForwardToConsole=, ForwardToWall=¶

Control whether log - messages received by the journal - daemon shall be forwarded to a - traditional syslog daemon, to the - kernel log buffer (kmsg), to the - system console, or sent as wall - messages to all logged-in users. These - options take boolean arguments. If - forwarding to syslog is enabled but no - syslog daemon is running, the - respective option has no effect. By - default, only forwarding wall is - enabled. These settings may be - overridden at boot time with the - kernel command line options - "systemd.journald.forward_to_syslog=", - "systemd.journald.forward_to_kmsg=", - "systemd.journald.forward_to_console=" - and - "systemd.journald.forward_to_wall=". - When forwarding to the console, the - TTY to log to can be changed with - TTYPath=, described - below.

MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=¶

Controls the maximum - log level of messages that are stored - on disk, forwarded to syslog, kmsg, - the console or wall (if that is - enabled, see above). As argument, - takes one of - "emerg", - "alert", - "crit", - "err", - "warning", - "notice", - "info", - "debug" or integer - values in the range of 0..7 (corresponding - to the same levels). Messages equal or below - the log level specified are - stored/forwarded, messages above are - dropped. Defaults to - "debug" for - MaxLevelStore= and - MaxLevelSyslog=, to - ensure that the all messages are - written to disk and forwarded to - syslog. Defaults to - "notice" for - MaxLevelKMsg=, - "info" for - MaxLevelConsole= and - "emerg" for - MaxLevelWall=.

TTYPath=¶

Change the console TTY - to use if - ForwardToConsole=yes - is used. Defaults to - /dev/console.

+ file.

Options¶

All options are configured in the + "[Journal]" section:

Storage=¶

Controls where to store journal data. One of + "volatile", + "persistent", + "auto" and + "none". If + "volatile", journal + log data will be stored only in memory, i.e. below the + /run/log/journal hierarchy (which is + created if needed). If "persistent", data + will be stored preferably on disk, i.e. below the + /var/log/journal hierarchy (which is + created if needed), with a fallback to + /run/log/journal (which is created if + needed), during early boot and if the disk is not writable. + "auto" is similar to + "persistent" but the directory + /var/log/journal is not created if + needed, so that its existence controls where log data goes. + "none" turns off all storage, all log data + received will be dropped. Forwarding to other targets, such as + the console, the kernel log buffer or a syslog daemon will + still work however. Defaults to + "auto".

Compress=¶

Takes a boolean value. If enabled (the + default), data objects that shall be stored in the journal and + are larger than a certain threshold are compressed before they + are written to the file system.

Seal=¶

Takes a boolean value. If enabled (the + default), and a sealing key is available (as created by + journalctl(1)'s + --setup-keys command), Forward Secure Sealing + (FSS) for all persistent journal files is enabled. FSS is + based on Seekable Sequential Key + Generators by G. A. Marson and B. Poettering + (doi:10.1007/978-3-642-40203-6_7) and may be used to protect + journal files from unnoticed alteration.

SplitMode=¶

Controls whether to split up journal files per + user. One of "uid", "login" + and "none". If "uid", all + users will get each their own journal files regardless of + whether they possess a login session or not, however system + users will log into the system journal. If + "login", actually logged-in users will get + each their own journal files, but users without login session + and system users will log into the system journal. If + "none", journal files are not split up by + user and all messages are instead stored in the single system + journal. Note that splitting up journal files by user is only + available for journals stored persistently. If journals are + stored on volatile storage (see above), only a single journal + file for all user IDs is kept. Defaults to + "uid".

RateLimitInterval=, RateLimitBurst=¶

Configures the rate limiting that is applied + to all messages generated on the system. If, in the time + interval defined by RateLimitInterval=, + more messages than specified in + RateLimitBurst= are logged by a service, + all further messages within the interval are dropped until the + interval is over. A message about the number of dropped + messages is generated. This rate limiting is applied + per-service, so that two services which log do not interfere + with each other's limits. Defaults to 1000 messages in 30s. + The time specification for + RateLimitInterval= may be specified in the + following units: "s", "min", + "h", "ms", + "us". To turn off any kind of rate limiting, + set either value to 0.

SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=¶

Enforce size limits on the journal files + stored. The options prefixed with "System" + apply to the journal files when stored on a persistent file + system, more specifically + /var/log/journal. The options prefixed + with "Runtime" apply to the journal files + when stored on a volatile in-memory file system, more + specifically /run/log/journal. The former + is used only when /var is mounted, + writable, and the directory + /var/log/journal exists. Otherwise, only + the latter applies. Note that this means that during early + boot and if the administrator disabled persistent logging, + only the latter options apply, while the former apply if + persistent logging is enabled and the system is fully booted + up. journalctl and + systemd-journald ignore all files with + names not ending with ".journal" or + ".journal~", so only such files, located in + the appropriate directories, are taken into account when + calculating current disk usage. +

SystemMaxUse= and + RuntimeMaxUse= control how much disk space + the journal may use up at maximum. + SystemKeepFree= and + RuntimeKeepFree= control how much disk + space systemd-journald shall leave free for other uses. + systemd-journald will respect both limits + and use the smaller of the two values.

The first pair defaults to 10% and the second to 15% of + the size of the respective file system. If the file system is + nearly full and either SystemKeepFree= or + RuntimeKeepFree= is violated when + systemd-journald is started, the value will be raised to + percentage that is actually free. This means that if there was + enough free space before and journal files were created, and + subsequently something else causes the file system to fill up, + journald will stop using more space, but it will not be + removing existing files to go reduce footprint either.

SystemMaxFileSize= + and + RuntimeMaxFileSize= + control how large individual journal + files may grow at maximum. This + influences the granularity in which + disk space is made available through + rotation, i.e. deletion of historic + data. Defaults to one eighth of the + values configured with + SystemMaxUse= and + RuntimeMaxUse=, so + that usually seven rotated journal + files are kept as history. Specify + values in bytes or use K, M, G, T, P, + E as units for the specified sizes + (equal to 1024, 1024²,... bytes). + Note that size limits are enforced + synchronously when journal files are + extended, and no explicit rotation + step triggered by time is + needed.

MaxFileSec=¶

The maximum time to store entries in a single + journal file before rotating to the next one. Normally, + time-based rotation should not be required as size-based + rotation with options such as + SystemMaxFileSize= should be sufficient to + ensure that journal files do not grow without bounds. However, + to ensure that not too much data is lost at once when old + journal files are deleted, it might make sense to change this + value from the default of one month. Set to 0 to turn off this + feature. This setting takes time values which may be suffixed + with the units "year", + "month", "week", + "day", "h" or + "m" to override the default time unit of + seconds.

MaxRetentionSec=¶

The maximum time to store journal entries. + This controls whether journal files containing entries older + then the specified time span are deleted. Normally, time-based + deletion of old journal files should not be required as + size-based deletion with options such as + SystemMaxUse= should be sufficient to + ensure that journal files do not grow without bounds. However, + to enforce data retention policies, it might make sense to + change this value from the default of 0 (which turns off this + feature). This setting also takes time values which may be + suffixed with the units "year", + "month", "week", + "day", "h" or " + m" to override the default time unit of + seconds.

SyncIntervalSec=¶

The timeout before synchronizing journal files + to disk. After syncing, journal files are placed in the + OFFLINE state. Note that syncing is unconditionally done + immediately after a log message of priority CRIT, ALERT or + EMERG has been logged. This setting hence applies only to + messages of the levels ERR, WARNING, NOTICE, INFO, DEBUG. The + default timeout is 5 minutes.

ForwardToSyslog=, ForwardToKMsg=, ForwardToConsole=, ForwardToWall=¶

Control whether log messages received by the + journal daemon shall be forwarded to a traditional syslog + daemon, to the kernel log buffer (kmsg), to the system + console, or sent as wall messages to all logged-in users. + These options take boolean arguments. If forwarding to syslog + is enabled but no syslog daemon is running, the respective + option has no effect. By default, only forwarding wall is + enabled. These settings may be overridden at boot time with + the kernel command line options + "systemd.journald.forward_to_syslog=", + "systemd.journald.forward_to_kmsg=", + "systemd.journald.forward_to_console=" and + "systemd.journald.forward_to_wall=". When + forwarding to the console, the TTY to log to can be changed + with TTYPath=, described + below.

MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=¶

Controls the maximum log level of messages + that are stored on disk, forwarded to syslog, kmsg, the + console or wall (if that is enabled, see above). As argument, + takes one of + "emerg", + "alert", + "crit", + "err", + "warning", + "notice", + "info", + "debug", + or integer values in the range of 0..7 (corresponding to the + same levels). Messages equal or below the log level specified + are stored/forwarded, messages above are dropped. Defaults to + "debug" for MaxLevelStore= + and MaxLevelSyslog=, to ensure that the all + messages are written to disk and forwarded to syslog. Defaults + to + "notice" for MaxLevelKMsg=, + "info" for MaxLevelConsole=, + and "emerg" for + MaxLevelWall=.

TTYPath=¶

Change the console TTY to use if + ForwardToConsole=yes is used. Defaults to + /dev/console.

diff --git a/man/journald.conf.xml b/man/journald.conf.xml index 4edcc003c..364b58f07 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - journald.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - journald.conf - 5 - - - - journald.conf - journald.conf.d - Journal service configuration files - - - - /etc/systemd/journald.conf - /etc/systemd/journald.conf.d/*.conf - /run/systemd/journald.conf.d/*.conf - /usr/lib/systemd/journald.conf.d/*.conf - - - - Description - - These files configure various parameters of the - systemd journal service, - systemd-journald.service8. - - - - - - - - Options - - All options are configured in the - [Journal] section: - - - - - Storage= - - Controls where to - store journal data. One of - volatile, - persistent, - auto and - none. If - volatile, journal - log data will be stored only in - memory, i.e. below the - /run/log/journal - hierarchy (which is created if - needed). If - persistent, data will - be stored preferably on disk, - i.e. below the - /var/log/journal - hierarchy (which is created if - needed), with a fallback to - /run/log/journal - (which is created if needed), during - early boot and if the disk is not - writable. auto is - similar to - persistent but the - directory - /var/log/journal - is not created if needed, so that its - existence controls where log data - goes. none turns - off all storage, all log data received - will be dropped. Forwarding to other - targets, such as the console, the - kernel log buffer or a syslog daemon - will still work however. Defaults to - auto. - - - - Compress= - - Takes a boolean - value. If enabled (the default), data - objects that shall be stored in the - journal and are larger than a certain - threshold are compressed before they - are written to the file - system. - - - - Seal= - - Takes a boolean - value. If enabled (the default), and a - sealing key is available (as created - by - journalctl1's - - command), Forward Secure Sealing (FSS) - for all persistent journal files is - enabled. FSS is based on Seekable - Sequential Key Generators by - G. A. Marson and B. Poettering - (doi:10.1007/978-3-642-40203-6_7) - and may be used to protect journal files - from unnoticed alteration. - - - - SplitMode= - - Controls whether to - split up journal files per user. One - of uid, - login and - none. If - uid, all users will - get each their own journal files - regardless of whether they possess a - login session or not, however system - users will log into the system - journal. If login, - actually logged-in users will get each - their own journal files, but users - without login session and system users - will log into the system journal. If - none, journal files - are not split up by user and all - messages are instead stored in the - single system journal. Note that - splitting up journal files by user is - only available for journals stored - persistently. If journals are stored - on volatile storage (see above), only - a single journal file for all user IDs - is kept. Defaults to - uid. - - - - RateLimitInterval= - RateLimitBurst= - - Configures the rate - limiting that is applied to all - messages generated on the system. If, - in the time interval defined by - RateLimitInterval=, - more messages than specified in - RateLimitBurst= are - logged by a service, all further - messages within the interval are - dropped until the interval is over. A - message about the number of dropped - messages is generated. This rate - limiting is applied per-service, so - that two services which log do not - interfere with each other's - limits. Defaults to 1000 messages in - 30s. The time specification for - RateLimitInterval= - may be specified in the following - units: s, - min, - h, - ms, - us. To turn off any - kind of rate limiting, set either - value to 0. - - - - SystemMaxUse= - SystemKeepFree= - SystemMaxFileSize= - RuntimeMaxUse= - RuntimeKeepFree= - RuntimeMaxFileSize= - - Enforce size limits on - the journal files stored. The options - prefixed with - System apply to the - journal files when stored on a - persistent file system, more - specifically - /var/log/journal. The - options prefixed with - Runtime apply to - the journal files when stored on a - volatile in-memory file system, more - specifically - /run/log/journal. The - former is used only when - /var is mounted, - writable, and the directory - /var/log/journal - exists. Otherwise, only the latter - applies. Note that this means that - during early boot and if the - administrator disabled persistent - logging, only the latter options apply, - while the former apply if persistent - logging is enabled and the system is - fully booted - up. journalctl and - systemd-journald - ignore all files with names not ending - with .journal or - .journal~, so only - such files, located in the appropriate - directories, are taken into account - when calculating current disk usage. - - - SystemMaxUse= - and RuntimeMaxUse= - control how much disk space the - journal may use up at maximum. - SystemKeepFree= and - RuntimeKeepFree= - control how much disk space - systemd-journald shall leave free for - other uses. - systemd-journald - will respect both limits and use the - smaller of the two values. - - The first pair defaults to 10% - and the second to 15% of the size of - the respective file system. If the - file system is nearly full and either - SystemKeepFree= or - RuntimeKeepFree= is - violated when systemd-journald is - started, the value will be raised to - percentage that is actually free. This - means that if there was enough - free space before and journal files were - created, and subsequently something - else causes the file system to fill - up, journald will stop using more - space, but it will not be removing - existing files to go reduce footprint - either. - - SystemMaxFileSize= - and - RuntimeMaxFileSize= - control how large individual journal - files may grow at maximum. This - influences the granularity in which - disk space is made available through - rotation, i.e. deletion of historic - data. Defaults to one eighth of the - values configured with - SystemMaxUse= and - RuntimeMaxUse=, so - that usually seven rotated journal - files are kept as history. Specify - values in bytes or use K, M, G, T, P, - E as units for the specified sizes - (equal to 1024, 1024²,... bytes). - Note that size limits are enforced - synchronously when journal files are - extended, and no explicit rotation - step triggered by time is - needed. - - - - MaxFileSec= - - The maximum time to - store entries in a single journal - file before rotating to the next - one. Normally, time-based rotation - should not be required as size-based - rotation with options such as - SystemMaxFileSize= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to ensure that not - too much data is lost at once when old - journal files are deleted, it might - make sense to change this value from - the default of one month. Set to 0 to - turn off this feature. This setting - takes time values which may be - suffixed with the units - year, - month, - week, day, - h or m - to override the default time unit of - seconds. - - - - MaxRetentionSec= - - The maximum time to - store journal entries. This - controls whether journal files - containing entries older then the - specified time span are - deleted. Normally, time-based deletion - of old journal files should not be - required as size-based deletion with - options such as - SystemMaxUse= - should be sufficient to ensure that - journal files do not grow without - bounds. However, to enforce data - retention policies, it might make sense - to change this value from the - default of 0 (which turns off this - feature). This setting also takes - time values which may be suffixed with - the units year, - month, - week, day, - h or m - to override the default time unit of - seconds. - - - - - SyncIntervalSec= - - The timeout before - synchronizing journal files to - disk. After syncing, journal files are - placed in the OFFLINE state. Note that - syncing is unconditionally done - immediately after a log message of - priority CRIT, ALERT or EMERG has been - logged. This setting hence applies - only to messages of the levels ERR, - WARNING, NOTICE, INFO, DEBUG. The - default timeout is 5 minutes. - - - - - ForwardToSyslog= - ForwardToKMsg= - ForwardToConsole= - ForwardToWall= - - Control whether log - messages received by the journal - daemon shall be forwarded to a - traditional syslog daemon, to the - kernel log buffer (kmsg), to the - system console, or sent as wall - messages to all logged-in users. These - options take boolean arguments. If - forwarding to syslog is enabled but no - syslog daemon is running, the - respective option has no effect. By - default, only forwarding wall is - enabled. These settings may be - overridden at boot time with the - kernel command line options - systemd.journald.forward_to_syslog=, - systemd.journald.forward_to_kmsg=, - systemd.journald.forward_to_console= - and - systemd.journald.forward_to_wall=. - When forwarding to the console, the - TTY to log to can be changed with - TTYPath=, described - below. - - - - MaxLevelStore= - MaxLevelSyslog= - MaxLevelKMsg= - MaxLevelConsole= - MaxLevelWall= - - Controls the maximum - log level of messages that are stored - on disk, forwarded to syslog, kmsg, - the console or wall (if that is - enabled, see above). As argument, - takes one of - emerg, - alert, - crit, - err, - warning, - notice, - info, - debug or integer - values in the range of 0..7 (corresponding - to the same levels). Messages equal or below - the log level specified are - stored/forwarded, messages above are - dropped. Defaults to - debug for - MaxLevelStore= and - MaxLevelSyslog=, to - ensure that the all messages are - written to disk and forwarded to - syslog. Defaults to - notice for - MaxLevelKMsg=, - info for - MaxLevelConsole= and - emerg for - MaxLevelWall=. - - - - TTYPath= - - Change the console TTY - to use if - ForwardToConsole=yes - is used. Defaults to - /dev/console. - - - - - - - - See Also - - systemd1, - systemd-journald.service8, - journalctl1, - systemd.journal-fields7, - systemd-system.conf5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + journald.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + journald.conf + 5 + + + + journald.conf + journald.conf.d + Journal service configuration files + + + + /etc/systemd/journald.conf + /etc/systemd/journald.conf.d/*.conf + /run/systemd/journald.conf.d/*.conf + /usr/lib/systemd/journald.conf.d/*.conf + + + + Description + + These files configure various parameters of the systemd + journal service, + systemd-journald.service8. + + + + + + + + Options + + All options are configured in the + [Journal] section: + + + + + Storage= + + Controls where to store journal data. One of + volatile, + persistent, + auto and + none. If + volatile, journal + log data will be stored only in memory, i.e. below the + /run/log/journal hierarchy (which is + created if needed). If persistent, data + will be stored preferably on disk, i.e. below the + /var/log/journal hierarchy (which is + created if needed), with a fallback to + /run/log/journal (which is created if + needed), during early boot and if the disk is not writable. + auto is similar to + persistent but the directory + /var/log/journal is not created if + needed, so that its existence controls where log data goes. + none turns off all storage, all log data + received will be dropped. Forwarding to other targets, such as + the console, the kernel log buffer or a syslog daemon will + still work however. Defaults to + auto. + + + + Compress= + + Takes a boolean value. If enabled (the + default), data objects that shall be stored in the journal and + are larger than a certain threshold are compressed before they + are written to the file system. + + + + Seal= + + Takes a boolean value. If enabled (the + default), and a sealing key is available (as created by + journalctl1's + command), Forward Secure Sealing + (FSS) for all persistent journal files is enabled. FSS is + based on Seekable Sequential Key + Generators by G. A. Marson and B. Poettering + (doi:10.1007/978-3-642-40203-6_7) and may be used to protect + journal files from unnoticed alteration. + + + + SplitMode= + + Controls whether to split up journal files per + user. One of uid, login + and none. If uid, all + users will get each their own journal files regardless of + whether they possess a login session or not, however system + users will log into the system journal. If + login, actually logged-in users will get + each their own journal files, but users without login session + and system users will log into the system journal. If + none, journal files are not split up by + user and all messages are instead stored in the single system + journal. Note that splitting up journal files by user is only + available for journals stored persistently. If journals are + stored on volatile storage (see above), only a single journal + file for all user IDs is kept. Defaults to + uid. + + + + RateLimitInterval= + RateLimitBurst= + + Configures the rate limiting that is applied + to all messages generated on the system. If, in the time + interval defined by RateLimitInterval=, + more messages than specified in + RateLimitBurst= are logged by a service, + all further messages within the interval are dropped until the + interval is over. A message about the number of dropped + messages is generated. This rate limiting is applied + per-service, so that two services which log do not interfere + with each other's limits. Defaults to 1000 messages in 30s. + The time specification for + RateLimitInterval= may be specified in the + following units: s, min, + h, ms, + us. To turn off any kind of rate limiting, + set either value to 0. + + + + SystemMaxUse= + SystemKeepFree= + SystemMaxFileSize= + RuntimeMaxUse= + RuntimeKeepFree= + RuntimeMaxFileSize= + + Enforce size limits on the journal files + stored. The options prefixed with System + apply to the journal files when stored on a persistent file + system, more specifically + /var/log/journal. The options prefixed + with Runtime apply to the journal files + when stored on a volatile in-memory file system, more + specifically /run/log/journal. The former + is used only when /var is mounted, + writable, and the directory + /var/log/journal exists. Otherwise, only + the latter applies. Note that this means that during early + boot and if the administrator disabled persistent logging, + only the latter options apply, while the former apply if + persistent logging is enabled and the system is fully booted + up. journalctl and + systemd-journald ignore all files with + names not ending with .journal or + .journal~, so only such files, located in + the appropriate directories, are taken into account when + calculating current disk usage. + + + SystemMaxUse= and + RuntimeMaxUse= control how much disk space + the journal may use up at maximum. + SystemKeepFree= and + RuntimeKeepFree= control how much disk + space systemd-journald shall leave free for other uses. + systemd-journald will respect both limits + and use the smaller of the two values. + + The first pair defaults to 10% and the second to 15% of + the size of the respective file system. If the file system is + nearly full and either SystemKeepFree= or + RuntimeKeepFree= is violated when + systemd-journald is started, the value will be raised to + percentage that is actually free. This means that if there was + enough free space before and journal files were created, and + subsequently something else causes the file system to fill up, + journald will stop using more space, but it will not be + removing existing files to go reduce footprint either. + + SystemMaxFileSize= + and + RuntimeMaxFileSize= + control how large individual journal + files may grow at maximum. This + influences the granularity in which + disk space is made available through + rotation, i.e. deletion of historic + data. Defaults to one eighth of the + values configured with + SystemMaxUse= and + RuntimeMaxUse=, so + that usually seven rotated journal + files are kept as history. Specify + values in bytes or use K, M, G, T, P, + E as units for the specified sizes + (equal to 1024, 1024²,... bytes). + Note that size limits are enforced + synchronously when journal files are + extended, and no explicit rotation + step triggered by time is + needed. + + + + MaxFileSec= + + The maximum time to store entries in a single + journal file before rotating to the next one. Normally, + time-based rotation should not be required as size-based + rotation with options such as + SystemMaxFileSize= should be sufficient to + ensure that journal files do not grow without bounds. However, + to ensure that not too much data is lost at once when old + journal files are deleted, it might make sense to change this + value from the default of one month. Set to 0 to turn off this + feature. This setting takes time values which may be suffixed + with the units year, + month, week, + day, h or + m to override the default time unit of + seconds. + + + + MaxRetentionSec= + + The maximum time to store journal entries. + This controls whether journal files containing entries older + then the specified time span are deleted. Normally, time-based + deletion of old journal files should not be required as + size-based deletion with options such as + SystemMaxUse= should be sufficient to + ensure that journal files do not grow without bounds. However, + to enforce data retention policies, it might make sense to + change this value from the default of 0 (which turns off this + feature). This setting also takes time values which may be + suffixed with the units year, + month, week, + day, h or + m to override the default time unit of + seconds. + + + + + SyncIntervalSec= + + The timeout before synchronizing journal files + to disk. After syncing, journal files are placed in the + OFFLINE state. Note that syncing is unconditionally done + immediately after a log message of priority CRIT, ALERT or + EMERG has been logged. This setting hence applies only to + messages of the levels ERR, WARNING, NOTICE, INFO, DEBUG. The + default timeout is 5 minutes. + + + + ForwardToSyslog= + ForwardToKMsg= + ForwardToConsole= + ForwardToWall= + + Control whether log messages received by the + journal daemon shall be forwarded to a traditional syslog + daemon, to the kernel log buffer (kmsg), to the system + console, or sent as wall messages to all logged-in users. + These options take boolean arguments. If forwarding to syslog + is enabled but no syslog daemon is running, the respective + option has no effect. By default, only forwarding wall is + enabled. These settings may be overridden at boot time with + the kernel command line options + systemd.journald.forward_to_syslog=, + systemd.journald.forward_to_kmsg=, + systemd.journald.forward_to_console= and + systemd.journald.forward_to_wall=. When + forwarding to the console, the TTY to log to can be changed + with TTYPath=, described + below. + + + + MaxLevelStore= + MaxLevelSyslog= + MaxLevelKMsg= + MaxLevelConsole= + MaxLevelWall= + + Controls the maximum log level of messages + that are stored on disk, forwarded to syslog, kmsg, the + console or wall (if that is enabled, see above). As argument, + takes one of + emerg, + alert, + crit, + err, + warning, + notice, + info, + debug, + or integer values in the range of 0..7 (corresponding to the + same levels). Messages equal or below the log level specified + are stored/forwarded, messages above are dropped. Defaults to + debug for MaxLevelStore= + and MaxLevelSyslog=, to ensure that the all + messages are written to disk and forwarded to syslog. Defaults + to + notice for MaxLevelKMsg=, + info for MaxLevelConsole=, + and emerg for + MaxLevelWall=. + + + + TTYPath= + + Change the console TTY to use if + ForwardToConsole=yes is used. Defaults to + /dev/console. + + + + + + + + See Also + + systemd1, + systemd-journald.service8, + journalctl1, + systemd.journal-fields7, + systemd-system.conf5 + + diff --git a/man/kernel-command-line.7 b/man/kernel-command-line.7 index 98a35d339..23c978b1c 100644 --- a/man/kernel-command-line.7 +++ b/man/kernel-command-line.7 @@ -1,5 +1,5 @@ '\" t -.TH "KERNEL\-COMMAND\-LINE" "7" "" "systemd 218" "kernel-command-line" +.TH "KERNEL\-COMMAND\-LINE" "7" "" "systemd 219" "kernel-command-line" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/kernel-command-line.html b/man/kernel-command-line.html index 3488b2984..dc1b2fc55 100644 --- a/man/kernel-command-line.html +++ b/man/kernel-command-line.html @@ -19,107 +19,81 @@ Directives · Python · libudev · - gudev systemd 218

Name

kernel-command-line — Kernel command line parameters

Synopsis

/proc/cmdline

Description¶

The kernel, the initial RAM disk (initrd) and - basic userspace functionality may be configured at boot via - kernel command line arguments.

For command line parameters understood by the - kernel, please see kernel-parameters.txt - and - bootparam(7).

For command line parameters understood by the - initial RAM disk, please see - dracut.cmdline(7), - or the documentation of the specific initrd - implementation of your installation.

Core OS Command Line Arguments¶

systemd.unit=, rd.systemd.unit=, systemd.dump_core=, systemd.crash_shell=, systemd.crash_chvt=, systemd.confirm_spawn=, systemd.show_status=, systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=, systemd.default_standard_output=, systemd.default_standard_error=, systemd.setenv=¶

Parameters understood by - the system and service manager - to control system behavior. For details, see - systemd(1).

systemd.mask=, systemd.wants=, systemd.debug-shell¶

Additional parameters - understood by - systemd-debug-generator(8), - to mask or start specific - units at boot, or invoke a - debug shell on tty9.

systemd.restore_state=¶

This parameter is understood by - several system tools to control - whether or not they should restore - system state from the previous boot. - For details, see - systemd-backlight@.service(8) - and - systemd-rfkill@.service(8). -

quiet¶

Parameter understood by - both the kernel and the system - and service manager to control - console log verbosity. For - details, see - systemd(1).

debug¶

Parameter understood by - both the kernel and the system - and service manager to control - console log verbosity. For - details, see - systemd(1).

-b, emergency, rescue, single, s, S, 1, 2, 3, 4, 5¶

Parameters understood by - the system and service - manager, as compatibility - options. For details, see - systemd(1).

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Parameters understood by - the system and service manager - to control locale and language - settings. For details, see - systemd(1).

fsck.mode=, fsck.repair=¶

Parameters understood by - the file system checker - services. For details, see - systemd-fsck@.service(8).

quotacheck.mode=¶

Parameter understood by - the file quota checker - service. For details, see - systemd-quotacheck.service(8).

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Parameters understood by - the journal service. For - details, see - systemd-journald.service(8).

vconsole.keymap=, vconsole.keymap.toggle=, vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Parameters understood by - the virtual console setup logic. For - details, see - systemd-vconsole-setup.service(8).

udev.log-priority=, rd.udev.log-priority=, udev.children-max=, rd.udev.children-max=, udev.exec-delay=, rd.udev.exec-delay=, udev.event-timeout=, rd.udev.event-timeout=, net.ifnames=¶

Parameters understood by - the device event managing daemon. For - details, see - systemd-udevd.service(8).

plymouth.enable=¶

May be used to disable - the Plymouth boot splash. For - details, see - plymouth(8).

luks=, rd.luks=, luks.crypttab=, rd.luks.crypttab=, luks.name=, rd.luks.name=, luks.uuid=, rd.luks.uuid=, luks.options=, rd.luks.options=, luks.key=, rd.luks.key=¶

Configures the LUKS - full-disk encryption logic at - boot. For details, see - systemd-cryptsetup-generator(8).

fstab=, rd.fstab=¶

Configures the - /etc/fstab - logic at boot. For details, see - systemd-fstab-generator(8).

root=, rootfstype=, rootfsflags=, ro, rw¶

Configures the root file - system and its file system - type and mount options, as - well as whether it shall be - mounted read-only or - read-writable initially. For - details, see - systemd-fstab-generator(8).

systemd.gpt_auto=, rd.systemd.gpt_auto=¶

Configures whether GPT - based partition auto-discovery - shall be attempted. For - details, see - systemd-gpt-auto-generator(8).

modules-load=, rd.modules-load=¶

Load a specific kernel - module early at boot. For - details, see - systemd-modules-load.service(8).

resume=¶

Enables resume from hibernation - using the specified device. - All fstab(5)-like - paths are supported. For details, see - systemd-hibernate-resume-generator(8).

+ gudev systemd 219

Name

kernel-command-line — Kernel command line parameters

Synopsis

/proc/cmdline

Description¶

The kernel, the initial RAM disk (initrd) and + basic userspace functionality may be configured at boot via + kernel command line arguments.

For command line parameters understood by the kernel, please + see kernel-parameters.txt + and + bootparam(7).

For command line parameters understood by the initial RAM + disk, please see + dracut.cmdline(7), + or the documentation of the specific initrd implementation of your + installation.

Core OS Command Line Arguments¶

systemd.unit=, rd.systemd.unit=, systemd.dump_core=, systemd.crash_shell=, systemd.crash_chvt=, systemd.confirm_spawn=, systemd.show_status=, systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=, systemd.default_standard_output=, systemd.default_standard_error=, systemd.setenv=¶

Parameters understood by the system and service + manager to control system behavior. For details, see + systemd(1).

systemd.mask=, systemd.wants=, systemd.debug-shell¶

Additional parameters understood by + systemd-debug-generator(8), + to mask or start specific units at boot, or invoke a debug + shell on tty9.

systemd.restore_state=¶

This parameter is understood by several system tools + to control whether or not they should restore system state + from the previous boot. For details, see + systemd-backlight@.service(8) + and + systemd-rfkill@.service(8). +

quiet¶

Parameter understood by both the kernel and the system + and service manager to control console log verbosity. For + details, see + systemd(1).

debug¶

Parameter understood by both the kernel and the system + and service manager to control console log verbosity. For + details, see + systemd(1).

-b, emergency, rescue, single, s, S, 1, 2, 3, 4, 5¶

Parameters understood by the system and service + manager, as compatibility options. For details, see + systemd(1).

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Parameters understood by the system and service + manager to control locale and language settings. For + details, see + systemd(1).

fsck.mode=, fsck.repair=¶

Parameters understood by the file system checker + services. For details, see + systemd-fsck@.service(8).

quotacheck.mode=¶

Parameter understood by the file quota checker + service. For details, see + systemd-quotacheck.service(8).

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Parameters understood by the journal service. For + details, see + systemd-journald.service(8).

vconsole.keymap=, vconsole.keymap.toggle=, vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Parameters understood by the virtual console setup + logic. For details, see + systemd-vconsole-setup.service(8).

udev.log-priority=, rd.udev.log-priority=, udev.children-max=, rd.udev.children-max=, udev.exec-delay=, rd.udev.exec-delay=, udev.event-timeout=, rd.udev.event-timeout=, net.ifnames=¶

Parameters understood by the device event managing + daemon. For details, see + systemd-udevd.service(8).

plymouth.enable=¶

May be used to disable the Plymouth boot splash. For + details, see + plymouth(8).

luks=, rd.luks=, luks.crypttab=, rd.luks.crypttab=, luks.name=, rd.luks.name=, luks.uuid=, rd.luks.uuid=, luks.options=, rd.luks.options=, luks.key=, rd.luks.key=¶

Configures the LUKS full-disk encryption logic at + boot. For details, see + systemd-cryptsetup-generator(8).

fstab=, rd.fstab=¶

Configures the /etc/fstab logic + at boot. For details, see + systemd-fstab-generator(8).

root=, rootfstype=, rootfsflags=, ro, rw¶

Configures the root file system and its file system + type and mount options, as well as whether it shall be + mounted read-only or read-writable initially. For details, + see + systemd-fstab-generator(8).

systemd.gpt_auto=, rd.systemd.gpt_auto=¶

Configures whether GPT based partition auto-discovery + shall be attempted. For details, see + systemd-gpt-auto-generator(8).

modules-load=, rd.modules-load=¶

Load a specific kernel module early at boot. For + details, see + systemd-modules-load.service(8).

resume=¶

Enables resume from hibernation using the specified + device. All + fstab(5)-like + paths are supported. For details, see + systemd-hibernate-resume-generator(8).

diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml index e32ed1972..3741cf9cc 100644 --- a/man/kernel-command-line.xml +++ b/man/kernel-command-line.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - locale.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - locale.conf - 5 - - - - locale.conf - Configuration file for locale settings - - - - /etc/locale.conf - - - - Description - - The /etc/locale.conf file - configures system-wide locale settings. It is read at - early-boot by - systemd1. - - The basic file format of - locale.conf is a - newline-separated list of environment-like - shell-compatible variable assignments. It is possible - to source the configuration from shell scripts, - however, beyond mere variable assignments, no shell - features are supported, allowing applications to read - the file without implementing a shell compatible - execution engine. - - Note that the kernel command line options - locale.LANG=, - locale.LANGUAGE=, - locale.LC_CTYPE=, - locale.LC_NUMERIC=, - locale.LC_TIME=, - locale.LC_COLLATE=, - locale.LC_MONETARY=, - locale.LC_MESSAGES=, - locale.LC_PAPER=, - locale.LC_NAME=, - locale.LC_ADDRESS=, - locale.LC_TELEPHONE=, - locale.LC_MEASUREMENT=, - locale.LC_IDENTIFICATION= may be - used to override the locale settings at boot. - - The locale settings configured in - /etc/locale.conf are system-wide - and are inherited by every service or user, unless - overridden or unset by individual programs or - individual users. - - Depending on the operating system, other - configuration files might be checked for locale - configuration as well, however only as - fallback. - - localectl1 - may be used to alter the settings in this file during - runtime from the command line. Use - systemd-firstboot1 - to initialize them on mounted (but not booted) system - images. - - - - Options - - The following locale settings may be set using - /etc/locale.conf: - LANG=, - LANGUAGE=, - LC_CTYPE=, - LC_NUMERIC=, - LC_TIME=, - LC_COLLATE=, - LC_MONETARY=, - LC_MESSAGES=, - LC_PAPER=, - LC_NAME=, - LC_ADDRESS=, - LC_TELEPHONE=, - LC_MEASUREMENT=, - LC_IDENTIFICATION=. Note that - LC_ALL may not be configured in - this file. For details about the meaning and semantics - of these settings, refer to - locale7. - - - - Example - - - German locale with English messages - - /etc/locale.conf: - - LANG=de_DE.UTF-8 + + locale.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + locale.conf + 5 + + + + locale.conf + Configuration file for locale settings + + + + /etc/locale.conf + + + + Description + + The /etc/locale.conf file configures + system-wide locale settings. It is read at early-boot by + systemd1. + + The basic file format of locale.conf is + a newline-separated list of environment-like shell-compatible + variable assignments. It is possible to source the configuration + from shell scripts, however, beyond mere variable assignments, no + shell features are supported, allowing applications to read the + file without implementing a shell compatible execution + engine. + + Note that the kernel command line options + locale.LANG=, + locale.LANGUAGE=, + locale.LC_CTYPE=, + locale.LC_NUMERIC=, + locale.LC_TIME=, + locale.LC_COLLATE=, + locale.LC_MONETARY=, + locale.LC_MESSAGES=, + locale.LC_PAPER=, + locale.LC_NAME=, + locale.LC_ADDRESS=, + locale.LC_TELEPHONE=, + locale.LC_MEASUREMENT=, + locale.LC_IDENTIFICATION= may be + used to override the locale settings at boot. + + The locale settings configured in + /etc/locale.conf are system-wide and are + inherited by every service or user, unless overridden or unset by + individual programs or individual users. + + Depending on the operating system, other configuration files + might be checked for locale configuration as well, however only as + fallback. + + localectl1 + may be used to alter the settings in this file during runtime from + the command line. Use + systemd-firstboot1 + to initialize them on mounted (but not booted) system + images. + + + + Options + + The following locale settings may be set using + /etc/locale.conf: + LANG=, + LANGUAGE=, + LC_CTYPE=, + LC_NUMERIC=, + LC_TIME=, + LC_COLLATE=, + LC_MONETARY=, + LC_MESSAGES=, + LC_PAPER=, + LC_NAME=, + LC_ADDRESS=, + LC_TELEPHONE=, + LC_MEASUREMENT=, + LC_IDENTIFICATION=. + Note that LC_ALL may not be configured in this + file. For details about the meaning and semantics of these + settings, refer to + locale7. + + + + Example + + + German locale with English messages + + /etc/locale.conf: + + LANG=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8 - - - - - - See Also - - systemd1, - locale7, - localectl1, - systemd-localed.service8, - systemd-firstboot1 - - + + + + + + See Also + + systemd1, + locale7, + localectl1, + systemd-localed.service8, + systemd-firstboot1 + + diff --git a/man/localectl.1 b/man/localectl.1 index f28a28603..cad705e20 100644 --- a/man/localectl.1 +++ b/man/localectl.1 @@ -1,5 +1,5 @@ '\" t -.TH "LOCALECTL" "1" "" "systemd 218" "localectl" +.TH "LOCALECTL" "1" "" "systemd 219" "localectl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -101,9 +101,9 @@ List available locales useful for configuration with .PP \fBset\-keymap MAP [TOGGLEMAP]\fR .RS 4 -Set the system keyboard mapping for the console\&. This takes a keyboard mapping name (such as "de" or "us"), and possibly a second one to define a toggle keyboard mapping\&. Unless +Set the system keyboard mapping for the console and X11\&. This takes a mapping name (such as "de" or "us"), and possibly a second one to define a toggle keyboard mapping\&. Unless \fB\-\-no\-convert\fR -is passed, the selected setting is also applied to the default keyboard mapping of X11, after converting it to the closest matching X11 keyboard mapping\&. Use +is passed, the selected setting is also applied as the default system keyboard mapping of X11, after converting it to the closest matching X11 keyboard mapping\&. Use \fBlist\-keymaps\fR for a list of available keyboard mappings (see below)\&. .RE @@ -116,11 +116,14 @@ List available keyboard mappings for the console, useful for configuration with .PP \fBset\-x11\-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]\fR .RS 4 -Set the system default keyboard mapping for X11\&. This takes a keyboard mapping name (such as "de" or "us"), and possibly a model, variant and options, see +Set the system default keyboard mapping for X11 and the virtual console\&. This takes a keyboard mapping name (such as +"de" +or +"us"), and possibly a model, variant, and options, see \fBkbd\fR(4) for details\&. Unless \fB\-\-no\-convert\fR -is passed, the selected setting is also applied to the system console keyboard mapping, after converting it to the closest matching console keyboard mapping\&. +is passed, the selected setting is also applied as the system console keyboard mapping, after converting it to the closest matching console keyboard mapping\&. .RE .PP \fBlist\-x11\-keymap\-models\fR, \fBlist\-x11\-keymap\-layouts\fR, \fBlist\-x11\-keymap\-variants [LAYOUT]\fR, \fBlist\-x11\-keymap\-options\fR diff --git a/man/localectl.html b/man/localectl.html index 494313e42..24b1b1858 100644 --- a/man/localectl.html +++ b/man/localectl.html @@ -19,27 +19,22 @@ Directives · Python · libudev · - gudev systemd 218

Name

localectl — Control the system locale and keyboard layout settings

Synopsis

localectl [OPTIONS...] {COMMAND}

Description¶

localectl may be used to - query and change the system locale and keyboard layout - settings.

The system locale controls the language settings - of system services and of the UI before the user logs - in, such as the display manager, as well as the - default for users after login.

The keyboard settings control the keyboard - layout used on the text console and of the graphical - UI before the user logs in, such as the display - manager, as well as the default for users after - login.

Use - systemd-firstboot(1) - to initialize the system locale for mounted (but not - booted) system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user - for authentication for privileged - operations.

--no-convert¶

If - set-keymap or - set-x11-keymap is - invoked and this option is passed, then - the keymap will not be converted from - the console to X11, or X11 to console, - respectively.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

localectl — Control the system locale and keyboard layout settings

Synopsis

localectl [OPTIONS...] {COMMAND}

Description¶

localectl may be used to query and change + the system locale and keyboard layout settings.

The system locale controls the language settings of system + services and of the UI before the user logs in, such as the + display manager, as well as the default for users after + login.

The keyboard settings control the keyboard layout used on + the text console and of the graphical UI before the user logs in, + such as the display manager, as well as the default for users + after login.

Use + systemd-firstboot(1) + to initialize the system locale for mounted (but not booted) + system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user for authentication for + privileged operations.

--no-convert¶

If set-keymap or + set-x11-keymap is invoked and this option + is passed, then the keymap will not be converted from the + console to X11, or X11 to console, + respectively.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -48,60 +43,40 @@ instance. Container names may be enumerated with machinectl -H HOST.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

status¶

Show current settings - of the system locale and keyboard - mapping.

set-locale LOCALE...¶

Set the system - locale. This takes one or more - assignments such as "LANG=de_DE.utf8", - "LC_MESSAGES=en_GB.utf8", and so - on. See - locale(7) - for details on the available settings - and their meanings. Use - list-locales for a - list of available locales (see below). -

list-locales¶

List available locales - useful for configuration with - set-locale.

set-keymap MAP [TOGGLEMAP]¶

Set the system - keyboard mapping for the console. This - takes a keyboard mapping name (such as - "de" or "us"), and possibly a second - one to define a toggle keyboard - mapping. Unless - --no-convert is - passed, the selected setting is also - applied to the default keyboard - mapping of X11, after converting it to - the closest matching X11 keyboard - mapping. Use - list-keymaps for a - list of available keyboard mappings - (see below).

list-keymaps¶

List available - keyboard mappings for the console, - useful for configuration with - set-keymap.

set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]¶

Set the system default - keyboard mapping for X11. This takes a - keyboard mapping name (such as "de" or - "us"), and possibly a model, variant - and options, see - kbd(4) - for details. Unless - --no-convert is - passed, the selected setting is also - applied to the system console keyboard - mapping, after converting it to the - closest matching console keyboard - mapping.

list-x11-keymap-models, list-x11-keymap-layouts, list-x11-keymap-variants [LAYOUT], list-x11-keymap-options¶

List available X11 - keymap models, layouts, variants and - options, useful for configuration with - set-keymap. The - command - list-x11-keymap-variants - optionally takes a layout parameter to - limit the output to the variants - suitable for the specific - layout.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

status¶

Show current settings of the system locale and + keyboard mapping.

set-locale LOCALE...¶

Set the system locale. This takes one or more + assignments such as "LANG=de_DE.utf8", + "LC_MESSAGES=en_GB.utf8", and so on. See + locale(7) + for details on the available settings and their meanings. Use + list-locales for a list of available + locales (see below).

list-locales¶

List available locales useful for + configuration with + set-locale.

set-keymap MAP [TOGGLEMAP]¶

Set the system keyboard mapping for the + console and X11. This takes a mapping name (such as "de" or + "us"), and possibly a second one to define a toggle keyboard + mapping. Unless --no-convert is passed, the + selected setting is also applied as the default system + keyboard mapping of X11, after converting it to the closest + matching X11 keyboard mapping. Use + list-keymaps for a list of available + keyboard mappings (see below).

list-keymaps¶

List available keyboard mappings for the + console, useful for configuration with + set-keymap.

set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]¶

Set the system default keyboard mapping for + X11 and the virtual console. This takes a keyboard mapping + name (such as "de" or "us"), + and possibly a model, variant, and options, see + kbd(4) + for details. Unless --no-convert is passed, + the selected setting is also applied as the system console + keyboard mapping, after converting it to the closest matching + console keyboard mapping.

list-x11-keymap-models, list-x11-keymap-layouts, list-x11-keymap-variants [LAYOUT], list-x11-keymap-options¶

List available X11 keymap models, layouts, + variants and options, useful for configuration with + set-keymap. The command + list-x11-keymap-variants optionally takes a + layout parameter to limit the output to the variants suitable + for the specific layout.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -109,17 +84,17 @@ --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

+ ("FRSXMK").

diff --git a/man/localectl.xml b/man/localectl.xml index c332027d8..aae6e0629 100644 --- a/man/localectl.xml +++ b/man/localectl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - localectl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - localectl - 1 - - - - localectl - Control the system locale and keyboard layout settings - - - - - localectl - OPTIONS - COMMAND - - - - - Description - - localectl may be used to - query and change the system locale and keyboard layout - settings. - - The system locale controls the language settings - of system services and of the UI before the user logs - in, such as the display manager, as well as the - default for users after login. - - The keyboard settings control the keyboard - layout used on the text console and of the graphical - UI before the user logs in, such as the display - manager, as well as the default for users after - login. - - Use - systemd-firstboot1 - to initialize the system locale for mounted (but not - booted) system images. - - - - Options - - The following options are understood: - - - - - - Do not query the user - for authentication for privileged - operations. - - - - - - If - set-keymap or - set-x11-keymap is - invoked and this option is passed, then - the keymap will not be converted from - the console to X11, or X11 to console, - respectively. - - - - - - - - - - The following commands are understood: - - - - status - - Show current settings - of the system locale and keyboard - mapping. - - - - set-locale LOCALE... - - Set the system - locale. This takes one or more - assignments such as "LANG=de_DE.utf8", - "LC_MESSAGES=en_GB.utf8", and so - on. See - locale7 - for details on the available settings - and their meanings. Use - list-locales for a - list of available locales (see below). - - - - - list-locales - - List available locales - useful for configuration with - set-locale. - - - - set-keymap MAP [TOGGLEMAP] - - Set the system - keyboard mapping for the console. This - takes a keyboard mapping name (such as - "de" or "us"), and possibly a second - one to define a toggle keyboard - mapping. Unless - is - passed, the selected setting is also - applied to the default keyboard - mapping of X11, after converting it to - the closest matching X11 keyboard - mapping. Use - list-keymaps for a - list of available keyboard mappings - (see below). - - - - list-keymaps - - List available - keyboard mappings for the console, - useful for configuration with - set-keymap. - - - - set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]] - - Set the system default - keyboard mapping for X11. This takes a - keyboard mapping name (such as "de" or - "us"), and possibly a model, variant - and options, see - kbd4 - for details. Unless - is - passed, the selected setting is also - applied to the system console keyboard - mapping, after converting it to the - closest matching console keyboard - mapping. - - - - list-x11-keymap-models - list-x11-keymap-layouts - list-x11-keymap-variants [LAYOUT] - list-x11-keymap-options - - List available X11 - keymap models, layouts, variants and - options, useful for configuration with - set-keymap. The - command - list-x11-keymap-variants - optionally takes a layout parameter to - limit the output to the variants - suitable for the specific - layout. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - - - See Also - - systemd1, - locale7, - locale.conf5, - vconsole.conf5, - loadkeys1, - kbd4, - - The XKB Configuration Guide - , - systemctl1, - systemd-localed.service8, - systemd-firstboot1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + localectl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + localectl + 1 + + + + localectl + Control the system locale and keyboard layout settings + + + + + localectl + OPTIONS + COMMAND + + + + + Description + + localectl may be used to query and change + the system locale and keyboard layout settings. + + The system locale controls the language settings of system + services and of the UI before the user logs in, such as the + display manager, as well as the default for users after + login. + + The keyboard settings control the keyboard layout used on + the text console and of the graphical UI before the user logs in, + such as the display manager, as well as the default for users + after login. + + Use + systemd-firstboot1 + to initialize the system locale for mounted (but not booted) + system images. + + + + Options + + The following options are understood: + + + + + + Do not query the user for authentication for + privileged operations. + + + + + + If set-keymap or + set-x11-keymap is invoked and this option + is passed, then the keymap will not be converted from the + console to X11, or X11 to console, + respectively. + + + + + + + + + + The following commands are understood: + + + + status + + Show current settings of the system locale and + keyboard mapping. + + + + set-locale LOCALE... + + Set the system locale. This takes one or more + assignments such as "LANG=de_DE.utf8", + "LC_MESSAGES=en_GB.utf8", and so on. See + locale7 + for details on the available settings and their meanings. Use + list-locales for a list of available + locales (see below). + + + + list-locales + + List available locales useful for + configuration with + set-locale. + + + + set-keymap MAP [TOGGLEMAP] + + Set the system keyboard mapping for the + console and X11. This takes a mapping name (such as "de" or + "us"), and possibly a second one to define a toggle keyboard + mapping. Unless is passed, the + selected setting is also applied as the default system + keyboard mapping of X11, after converting it to the closest + matching X11 keyboard mapping. Use + list-keymaps for a list of available + keyboard mappings (see below). + + + + list-keymaps + + List available keyboard mappings for the + console, useful for configuration with + set-keymap. + + + + set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]] + + Set the system default keyboard mapping for + X11 and the virtual console. This takes a keyboard mapping + name (such as de or us), + and possibly a model, variant, and options, see + kbd4 + for details. Unless is passed, + the selected setting is also applied as the system console + keyboard mapping, after converting it to the closest matching + console keyboard mapping. + + + + list-x11-keymap-models + list-x11-keymap-layouts + list-x11-keymap-variants [LAYOUT] + list-x11-keymap-options + + List available X11 keymap models, layouts, + variants and options, useful for configuration with + set-keymap. The command + list-x11-keymap-variants optionally takes a + layout parameter to limit the output to the variants suitable + for the specific layout. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + + + See Also + + systemd1, + locale7, + locale.conf5, + vconsole.conf5, + loadkeys1, + kbd4, + + The XKB Configuration Guide + , + systemctl1, + systemd-localed.service8, + systemd-firstboot1 + + diff --git a/man/localtime.5 b/man/localtime.5 index c1926beac..db04d6095 100644 --- a/man/localtime.5 +++ b/man/localtime.5 @@ -1,5 +1,5 @@ '\" t -.TH "LOCALTIME" "5" "" "systemd 218" "localtime" +.TH "LOCALTIME" "5" "" "systemd 219" "localtime" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,9 @@ timezone data for the configured timezone\&. Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink\&. .PP -The timezone may be overridden for individual programs by using the TZ environment variable\&. See +The timezone may be overridden for individual programs by using the +\fI$TZ\fR +environment variable\&. See \fBenviron\fR(7)\&. .PP You may use diff --git a/man/localtime.html b/man/localtime.html index 7fac43d1b..685eb1d67 100644 --- a/man/localtime.html +++ b/man/localtime.html @@ -19,33 +19,30 @@ Directives · Python · libudev · - gudev systemd 218

Name

localtime — Local timezone configuration file

Synopsis

/etc/localtime -> ../usr/share/zoneinfo/…

Description¶

The /etc/localtime file - configures the system-wide timezone of the local - system that is used by applications for presentation - to the user. It should be an absolute or relative - symbolic link pointing to - /usr/share/zoneinfo/, followed by - a timezone identifier such as - "Europe/Berlin" or - "Etc/UTC". The resulting link should - lead to the corresponding binary - tzfile(5) - timezone data for the configured timezone.

Because the timezone identifier is extracted from - the symlink target name of - /etc/localtime, this file may not - be a normal file or hardlink.

The timezone may be overridden for individual - programs by using the TZ environment variable. See - environ(7).

You may use - timedatectl(1) - to change the settings of this file from the command - line during runtime. Use - systemd-firstboot(1) - to initialize the time zone on mounted (but not - booted) system images.

+ gudev systemd 219

Name

localtime — Local timezone configuration file

Synopsis

/etc/localtime -> ../usr/share/zoneinfo/…

Description¶

The /etc/localtime file configures the + system-wide timezone of the local system that is used by + applications for presentation to the user. It should be an + absolute or relative symbolic link pointing to + /usr/share/zoneinfo/, followed by a timezone + identifier such as "Europe/Berlin" or + "Etc/UTC". The resulting link should lead to the + corresponding binary + tzfile(5) + timezone data for the configured timezone.

Because the timezone identifier is extracted from the + symlink target name of /etc/localtime, this + file may not be a normal file or hardlink.

The timezone may be overridden for individual programs by + using the $TZ environment variable. See + environ(7).

You may use + timedatectl(1) + to change the settings of this file from the command line during + runtime. Use + systemd-firstboot(1) + to initialize the time zone on mounted (but not booted) system + images.

diff --git a/man/localtime.xml b/man/localtime.xml index 1cbdf6827..2827da6e9 100644 --- a/man/localtime.xml +++ b/man/localtime.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - localtime - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - Developer - Shawn - Landden - shawnlandden@gmail.com - - - - - - localtime - 5 - - - - localtime - Local timezone configuration file - - - - /etc/localtime -> ../usr/share/zoneinfo/… - - - - Description - - The /etc/localtime file - configures the system-wide timezone of the local - system that is used by applications for presentation - to the user. It should be an absolute or relative - symbolic link pointing to - /usr/share/zoneinfo/, followed by - a timezone identifier such as - Europe/Berlin or - Etc/UTC. The resulting link should - lead to the corresponding binary - tzfile5 - timezone data for the configured timezone. - - Because the timezone identifier is extracted from - the symlink target name of - /etc/localtime, this file may not - be a normal file or hardlink. - - The timezone may be overridden for individual - programs by using the TZ environment variable. See - environ7. - - You may use - timedatectl1 - to change the settings of this file from the command - line during runtime. Use - systemd-firstboot1 - to initialize the time zone on mounted (but not - booted) system images. - - - - See Also - - systemd1, - tzset3, - localtime3, - timedatectl1, - systemd-timedated.service8, - systemd-firstboot1 - - + + localtime + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + Developer + Shawn + Landden + shawnlandden@gmail.com + + + + + + localtime + 5 + + + + localtime + Local timezone configuration file + + + + /etc/localtime -> ../usr/share/zoneinfo/… + + + + Description + + The /etc/localtime file configures the + system-wide timezone of the local system that is used by + applications for presentation to the user. It should be an + absolute or relative symbolic link pointing to + /usr/share/zoneinfo/, followed by a timezone + identifier such as Europe/Berlin or + Etc/UTC. The resulting link should lead to the + corresponding binary + tzfile5 + timezone data for the configured timezone. + + Because the timezone identifier is extracted from the + symlink target name of /etc/localtime, this + file may not be a normal file or hardlink. + + The timezone may be overridden for individual programs by + using the $TZ environment variable. See + environ7. + + You may use + timedatectl1 + to change the settings of this file from the command line during + runtime. Use + systemd-firstboot1 + to initialize the time zone on mounted (but not booted) system + images. + + + + See Also + + systemd1, + tzset3, + localtime3, + timedatectl1, + systemd-timedated.service8, + systemd-firstboot1 + + diff --git a/man/loginctl.1 b/man/loginctl.1 index 96910b345..419b08235 100644 --- a/man/loginctl.1 +++ b/man/loginctl.1 @@ -1,5 +1,5 @@ '\" t -.TH "LOGINCTL" "1" "" "systemd 218" "loginctl" +.TH "LOGINCTL" "1" "" "systemd 219" "loginctl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,11 +35,6 @@ login manager .PP The following options are understood: .PP -\fB\-\-no\-legend\fR -.RS 4 -Do not print the legend, i\&.e\&. the column headers and the footer\&. -.RE -.PP \fB\-\-no\-ask\-password\fR .RS 4 Do not query the user for authentication for privileged operations\&. @@ -84,6 +79,24 @@ or \fBSIGTERM\fR\&. .RE .PP +\fB\-n\fR, \fB\-\-lines=\fR +.RS 4 +When used with +\fBuser\-status\fR +and +\fBsession\-status\fR, controls the number of journal lines to show, counting from the most recent ones\&. Takes a positive integer argument\&. Defaults to 10\&. +.RE +.PP +\fB\-o\fR, \fB\-\-output=\fR +.RS 4 +When used with +\fBuser\-status\fR +and +\fBsession\-status\fR, controls the formatting of the journal entries that are shown\&. For the available choices, see +\fBjournalctl\fR(1)\&. Defaults to +"short"\&. +.RE +.PP \fB\-H\fR, \fB\-\-host=\fR .RS 4 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by @@ -97,6 +110,16 @@ Execute the operation remotely\&. Specify a hostname, or a username and hostname Execute operation on a local container\&. Specify a container name to connect to\&. .RE .PP +\fB\-\-no\-pager\fR +.RS 4 +Do not pipe output into a pager\&. +.RE +.PP +\fB\-\-no\-legend\fR +.RS 4 +Do not print the legend, i\&.e\&. column headers and the footer with hints\&. +.RE +.PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help text and exit\&. @@ -106,22 +129,19 @@ Print a short help text and exit\&. .RS 4 Print a short version string and exit\&. .RE -.PP -\fB\-\-no\-pager\fR -.RS 4 -Do not pipe output into a pager\&. -.RE +.SH "COMMANDS" .PP The following commands are understood: +.SS "Session Commands" .PP \fBlist\-sessions\fR .RS 4 List current sessions\&. .RE .PP -\fBsession\-status\fR \fIID\fR\&.\&.\&. +\fBsession\-status\fR [\fIID\fR\&.\&.\&.] .RS 4 -Show terse runtime status information about one or more sessions\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use +Show terse runtime status information about one or more sessions, followed by the most recent log data from the journal\&. Takes one or more session identifiers as parameters\&. If no session identifiers are passed the status of the caller\*(Aqs session is shown\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use \fBshow\-session\fR instead\&. .RE @@ -136,14 +156,14 @@ to show those too\&. To select specific properties to show, use if you are looking for formatted human\-readable output\&. .RE .PP -\fBactivate\fR \fIID\fR\&.\&.\&. +\fBactivate\fR [\fIID\fR] .RS 4 -Activate one or more sessions\&. This brings one or more sessions into the foreground, if another session is currently in the foreground on the respective seat\&. +Activate a session\&. This brings a session into the foreground, if another session is currently in the foreground on the respective seat\&. Takes a session identifier as argument\&. If no argument is specified the session of the caller is put into foreground\&. .RE .PP -\fBlock\-session\fR \fIID\fR\&.\&.\&., \fBunlock\-session\fR \fIID\fR\&.\&.\&. +\fBlock\-session\fR [\fIID\fR\&.\&.\&.], \fBunlock\-session\fR [\fIID\fR\&.\&.\&.] .RS 4 -Activates/deactivates the screen lock on one or more sessions, if the session supports it\&. +Activates/deactivates the screen lock on one or more sessions, if the session supports it\&. Takes one or more session identifiers as arguments\&. If no argument is specified the session of the caller is locked/unlocked\&. .RE .PP \fBlock\-sessions\fR, \fBunlock\-sessions\fR @@ -164,15 +184,16 @@ to select which process to kill\&. Use \fB\-\-signal=\fR to select the signal to send\&. .RE +.SS "User Commands" .PP \fBlist\-users\fR .RS 4 List currently logged in users\&. .RE .PP -\fBuser\-status\fR \fIUSER\fR\&.\&.\&. +\fBuser\-status\fR [\fIUSER\fR\&.\&.\&.] .RS 4 -Show terse runtime status information about one or more logged in users\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use +Show terse runtime status information about one or more logged in users, followed by the most recent log data from the journal\&. Takes one or more user names or numeric user IDs as parameters\&. If no parameters are passed the status of the caller\*(Aqs user is shown\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use \fBshow\-user\fR instead\&. Users may be specified by their usernames or numeric user IDs\&. .RE @@ -187,9 +208,9 @@ to show those too\&. To select specific properties to show, use if you are looking for formatted human\-readable output\&. .RE .PP -\fBenable\-linger\fR \fIUSER\fR\&.\&.\&., \fBdisable\-linger\fR \fIUSER\fR\&.\&.\&. +\fBenable\-linger\fR [\fIUSER\fR\&.\&.\&.], \fBdisable\-linger\fR [\fIUSER\fR\&.\&.\&.] .RS 4 -Enable/disable user lingering for one or more users\&. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts\&. This allows users who are not logged in to run long\-running services\&. +Enable/disable user lingering for one or more users\&. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts\&. This allows users who are not logged in to run long\-running services\&. Takes one or more user names or numeric UIDs as argument\&. If no argument is specified enables/disables lingering for the user of the session of the caller\&. .RE .PP \fBterminate\-user\fR \fIUSER\fR\&.\&.\&. @@ -203,20 +224,21 @@ Send a signal to all processes of a user\&. Use \fB\-\-signal=\fR to select the signal to send\&. .RE +.SS "Seat Commands" .PP \fBlist\-seats\fR .RS 4 List currently available seats on the local system\&. .RE .PP -\fBseat\-status\fR \fINAME\fR\&.\&.\&. +\fBseat\-status\fR [\fINAME\fR\&.\&.\&.] .RS 4 -Show terse runtime status information about one or more seats\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use +Show terse runtime status information about one or more seats\&. Takes one or more seat names as parameters\&. If no seat names are passed the status of the caller\*(Aqs session\*(Aqs seat is shown\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use \fBshow\-seat\fR instead\&. .RE .PP -\fBshow\-seat\fR \fINAME\fR\&.\&.\&. +\fBshow\-seat\fR [\fINAME\fR\&.\&.\&.] .RS 4 Show properties of one or more seats or the manager itself\&. If no argument is specified, properties of the manager will be shown\&. If a seat is specified, properties of the seat are shown\&. By default, empty properties are suppressed\&. Use \fB\-\-all\fR diff --git a/man/loginctl.html b/man/loginctl.html index 8c68bd3f8..7e0e38b54 100644 --- a/man/loginctl.html +++ b/man/loginctl.html @@ -19,46 +19,39 @@ Directives · Python · libudev · - gudev systemd 218

Name

loginctl — Control the systemd login manager

Synopsis

loginctl [OPTIONS...] {COMMAND} [NAME...]

Description¶

loginctl may be used to - introspect and control the state of the - systemd(1) - login manager systemd-logind.service(8).

Options¶

The following options are understood:

--no-legend¶

Do not print the legend, - i.e. the column headers and - the footer.

--no-ask-password¶

Do not query the user - for authentication for privileged - operations.

-p, --property=¶

When showing - session/user/seat properties, limit - display to certain properties as - specified as argument. If not - specified, all set properties are - shown. The argument should be a - property name, such as - "Sessions". If - specified more than once, all - properties with the specified names - are shown.

-a, --all¶

When showing - session/user/seat properties, show all - properties regardless of whether they are - set or not.

-l, --full¶

Do not ellipsize - process tree entries.

--kill-who=¶

When used with - kill-session, - choose which processes to kill. Must - be one of leader, or - all to select whether - to kill only the leader process of the - session or all processes of the - session. If omitted, defaults to - all.

-s, --signal=¶

When used with - kill-session or - kill-user, choose - which signal to send to selected - processes. Must be one of the well - known signal specifiers, such as - SIGTERM, - SIGINT or - SIGSTOP. If - omitted, defaults to - SIGTERM.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

loginctl — Control the systemd login manager

Synopsis

loginctl [OPTIONS...] {COMMAND} [NAME...]

Description¶

loginctl may be used to introspect and + control the state of the + systemd(1) + login manager + systemd-logind.service(8).

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user for authentication for + privileged operations.

-p, --property=¶

When showing session/user/seat properties, + limit display to certain properties as specified as argument. + If not specified, all set properties are shown. The argument + should be a property name, such as + "Sessions". If specified more than once, all + properties with the specified names are + shown.

-a, --all¶

When showing session/user/seat properties, + show all properties regardless of whether they are set or + not.

-l, --full¶

Do not ellipsize process tree entries.

--kill-who=¶

When used with + kill-session, choose which processes to + kill. Must be one of leader, or + all to select whether to kill only the leader + process of the session or all processes of the session. If + omitted, defaults to all.

-s, --signal=¶

When used with kill-session + or kill-user, choose which signal to send + to selected processes. Must be one of the well known signal + specifiers, such as SIGTERM, + SIGINT or SIGSTOP. + If omitted, defaults to + SIGTERM.

-n, --lines=¶

When used with user-status + and session-status, controls the number of + journal lines to show, counting from the most recent ones. + Takes a positive integer argument. Defaults to 10.

-o, --output=¶

When used with user-status + and session-status, controls the formatting + of the journal entries that are shown. For the available + choices, see + journalctl(1). + Defaults to "short".

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -67,146 +60,99 @@ instance. Container names may be enumerated with machinectl -H HOST.

-M, --machine=¶

Execute operation on a local container. Specify a - container name to connect to.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

list-sessions¶

List current sessions.

session-status ID...¶

Show terse runtime - status information about one or more - sessions. This function is intended to - generate human-readable output. If you - are looking for computer-parsable - output, use - show-session - instead.

show-session [ID...]¶

Show properties of one - or more sessions or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a session ID is specified, - properties of the session are shown. By - default, empty properties are - suppressed. Use --all - to show those too. To select specific - properties to show, use - --property=. This - command is intended to be used - whenever computer-parsable output is - required. Use - session-status if - you are looking for formatted - human-readable - output.

activate ID...¶

Activate one or more - sessions. This brings one or more - sessions into the foreground, if - another session is currently in the - foreground on the respective - seat.

lock-session ID..., unlock-session ID...¶

Activates/deactivates - the screen lock on one or more - sessions, if the session supports it. -

lock-sessions, unlock-sessions¶

Activates/deactivates - the screen lock on all current - sessions supporting it. -

terminate-session ID...¶

Terminates a session. - This kills all processes of the - session and deallocates all resources - attached to the session. -

kill-session ID...¶

Send a signal to one - or more processes of the session. Use - --kill-who= to select - which process to kill. Use - --signal= to select - the signal to send.

list-users¶

List currently logged - in users.

user-status USER...¶

Show terse runtime - status information about one or more - logged in users. This function is - intended to generate human-readable - output. If you are looking for - computer-parsable output, use - show-user instead. - Users may be specified by their - usernames or numeric user IDs. -

show-user [USER...]¶

Show properties of one - or more users or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a user is specified, - properties of the user are shown. By - default, empty properties are - suppressed. Use --all - to show those too. To select specific - properties to show, use - --property=. This - command is intended to be used - whenever computer-parsable output is - required. Use - user-status if - you are looking for formatted - human-readable - output.

enable-linger USER..., disable-linger USER...¶

Enable/disable user - lingering for one or more users. If - enabled for a specific user, a user - manager is spawned for the user at - boot and kept around after - logouts. This allows users who are not - logged in to run long-running - services.

terminate-user USER...¶

Terminates all - sessions of a user. This kills all - processes of all sessions of the user - and deallocates all runtime resources - attached to the user. -

kill-user USER...¶

Send a signal to all - processes of a user. Use - --signal= to select - the signal to send.

list-seats¶

List currently - available seats on the local - system.

seat-status NAME...¶

Show terse runtime - status information about one or more - seats. This function is - intended to generate human-readable - output. If you are looking for - computer-parsable output, use - show-seat - instead.

show-seat NAME...¶

Show properties of one - or more seats or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a seat is specified, - properties of the seat are shown. By - default, empty properties are - suppressed. Use --all - to show those too. To select specific - properties to show, use - --property=. This - command is intended to be used - whenever computer-parsable output is - required. Use - seat-status if you - are looking for formatted - human-readable - output.

attach NAME DEVICE...¶

Persistently attach - one or more devices to a seat. The - devices should be specified via device - paths in the /sys - file system. To create a new seat, - attach at least one graphics card to a - previously unused seat name. Seat - names may consist only of a-z, A-Z, - 0-9, "-" and - "_" and must be - prefixed with "seat". - To drop assignment of a device to a - specific seat, just reassign it to a - different seat, or use - flush-devices. -

flush-devices¶

Removes all device - assignments previously created with - attach. After this - call, only automatically generated - seats will remain, and all seat - hardware is assigned to - them.

terminate-seat NAME...¶

Terminates all - sessions on a seat. This kills all - processes of all sessions on the seat - and deallocates all runtime resources - attached to them.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when + container name to connect to.

--no-pager¶

Do not pipe output into a pager.

--no-legend¶

Do not print the legend, i.e. column headers and the + footer with hints.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Commands¶

The following commands are understood:

Session Commands¶

list-sessions¶

List current sessions.

session-status [ID...]¶

Show terse runtime status information about + one or more sessions, followed by the most recent log data + from the journal. Takes one or more session identifiers as + parameters. If no session identifiers are passed the status of + the caller's session is shown. This function is intended to + generate human-readable output. If you are looking for + computer-parsable output, use show-session + instead.

show-session [ID...]¶

Show properties of one or more sessions or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a session ID is specified, + properties of the session are shown. By default, empty + properties are suppressed. Use --all to show + those too. To select specific properties to show, use + --property=. This command is intended to be + used whenever computer-parsable output is required. Use + session-status if you are looking for + formatted human-readable output.

activate [ID]¶

Activate a session. This brings a session into + the foreground, if another session is currently in the + foreground on the respective seat. Takes a session identifier + as argument. If no argument is specified the session of the + caller is put into foreground.

lock-session [ID...], unlock-session [ID...]¶

Activates/deactivates the screen lock on one + or more sessions, if the session supports it. Takes one or + more session identifiers as arguments. If no argument is + specified the session of the caller is locked/unlocked. +

lock-sessions, unlock-sessions¶

Activates/deactivates the screen lock on all + current sessions supporting it.

terminate-session ID...¶

Terminates a session. This kills all processes + of the session and deallocates all resources attached to the + session.

kill-session ID...¶

Send a signal to one or more processes of the + session. Use --kill-who= to select which + process to kill. Use --signal= to select the + signal to send.

User Commands¶

list-users¶

List currently logged in users. +

user-status [USER...]¶

Show terse runtime status information about + one or more logged in users, followed by the most recent log + data from the journal. Takes one or more user names or numeric + user IDs as parameters. If no parameters are passed the status + of the caller's user is shown. This function is intended to + generate human-readable output. If you are looking for + computer-parsable output, use show-user + instead. Users may be specified by their usernames or numeric + user IDs.

show-user [USER...]¶

Show properties of one or more users or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a user is specified, properties of + the user are shown. By default, empty properties are + suppressed. Use --all to show those too. To + select specific properties to show, use + --property=. This command is intended to be + used whenever computer-parsable output is required. Use + user-status if you are looking for + formatted human-readable output.

enable-linger [USER...], disable-linger [USER...]¶

Enable/disable user lingering for one or more + users. If enabled for a specific user, a user manager is + spawned for the user at boot and kept around after logouts. + This allows users who are not logged in to run long-running + services. Takes one or more user names or numeric UIDs as + argument. If no argument is specified enables/disables + lingering for the user of the session of the caller. +

terminate-user USER...¶

Terminates all sessions of a user. This kills + all processes of all sessions of the user and deallocates all + runtime resources attached to the user.

kill-user USER...¶

Send a signal to all processes of a user. Use + --signal= to select the signal to send. +

Seat Commands¶

list-seats¶

List currently available seats on the local + system.

seat-status [NAME...]¶

Show terse runtime status information about + one or more seats. Takes one or more seat names as parameters. + If no seat names are passed the status of the caller's + session's seat is shown. This function is intended to generate + human-readable output. If you are looking for + computer-parsable output, use show-seat + instead.

show-seat [NAME...]¶

Show properties of one or more seats or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a seat is specified, properties of + the seat are shown. By default, empty properties are + suppressed. Use --all to show those too. To + select specific properties to show, use + --property=. This command is intended to be + used whenever computer-parsable output is required. Use + seat-status if you are looking for + formatted human-readable output.

attach NAME DEVICE...¶

Persistently attach one or more devices to a + seat. The devices should be specified via device paths in the + /sys file system. To create a new seat, + attach at least one graphics card to a previously unused seat + name. Seat names may consist only of a-z, A-Z, 0-9, + "-" and "_" and must be + prefixed with "seat". To drop assignment of a + device to a specific seat, just reassign it to a different + seat, or use flush-devices. +

flush-devices¶

Removes all device assignments previously + created with attach. After this call, only + automatically generated seats will remain, and all seat + hardware is assigned to them.

terminate-seat NAME...¶

Terminates all sessions on a seat. This kills + all processes of all sessions on the seat and deallocates all + runtime resources attached to them.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -214,9 +160,9 @@ --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

+ ("FRSXMK").

diff --git a/man/loginctl.xml b/man/loginctl.xml index 749db92ed..9dda14d45 100644 --- a/man/loginctl.xml +++ b/man/loginctl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - loginctl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - loginctl - 1 - - - - loginctl - Control the systemd login manager - - - - - loginctl - OPTIONS - COMMAND - NAME - - - - - Description - - loginctl may be used to - introspect and control the state of the - systemd1 - login manager systemd-logind.service8. - - - - Options - - The following options are understood: - - - - - - - Do not print the legend, - i.e. the column headers and - the footer. - - - - - - - Do not query the user - for authentication for privileged - operations. - - - - - - - When showing - session/user/seat properties, limit - display to certain properties as - specified as argument. If not - specified, all set properties are - shown. The argument should be a - property name, such as - Sessions. If - specified more than once, all - properties with the specified names - are shown. - - - - - - - When showing - session/user/seat properties, show all - properties regardless of whether they are - set or not. - - - - - - - Do not ellipsize - process tree entries. - - - - - - - When used with - kill-session, - choose which processes to kill. Must - be one of , or - to select whether - to kill only the leader process of the - session or all processes of the - session. If omitted, defaults to - . - - - - - - - When used with - kill-session or - kill-user, choose - which signal to send to selected - processes. Must be one of the well - known signal specifiers, such as - SIGTERM, - SIGINT or - SIGSTOP. If - omitted, defaults to - SIGTERM. - - - - - - - - - - - The following commands are understood: - - - - list-sessions - - List current sessions. - - - - session-status ID... - - Show terse runtime - status information about one or more - sessions. This function is intended to - generate human-readable output. If you - are looking for computer-parsable - output, use - show-session - instead. - - - - show-session ID... - - Show properties of one - or more sessions or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a session ID is specified, - properties of the session are shown. By - default, empty properties are - suppressed. Use - to show those too. To select specific - properties to show, use - . This - command is intended to be used - whenever computer-parsable output is - required. Use - session-status if - you are looking for formatted - human-readable - output. - - - - activate ID... - - Activate one or more - sessions. This brings one or more - sessions into the foreground, if - another session is currently in the - foreground on the respective - seat. - - - - lock-session ID... - unlock-session ID... - - Activates/deactivates - the screen lock on one or more - sessions, if the session supports it. - - - - - lock-sessions - unlock-sessions - - Activates/deactivates - the screen lock on all current - sessions supporting it. - - - - - terminate-session ID... - - Terminates a session. - This kills all processes of the - session and deallocates all resources - attached to the session. - - - - - kill-session ID... - - Send a signal to one - or more processes of the session. Use - to select - which process to kill. Use - to select - the signal to send. - - - - list-users - - List currently logged - in users. - - - - user-status USER... - - Show terse runtime - status information about one or more - logged in users. This function is - intended to generate human-readable - output. If you are looking for - computer-parsable output, use - show-user instead. - Users may be specified by their - usernames or numeric user IDs. - - - - - show-user USER... - - Show properties of one - or more users or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a user is specified, - properties of the user are shown. By - default, empty properties are - suppressed. Use - to show those too. To select specific - properties to show, use - . This - command is intended to be used - whenever computer-parsable output is - required. Use - user-status if - you are looking for formatted - human-readable - output. - - - - enable-linger USER... - disable-linger USER... - - Enable/disable user - lingering for one or more users. If - enabled for a specific user, a user - manager is spawned for the user at - boot and kept around after - logouts. This allows users who are not - logged in to run long-running - services. - - - - terminate-user USER... - - Terminates all - sessions of a user. This kills all - processes of all sessions of the user - and deallocates all runtime resources - attached to the user. - - - - - kill-user USER... - - Send a signal to all - processes of a user. Use - to select - the signal to send. - - - - list-seats - - List currently - available seats on the local - system. - - - - seat-status NAME... - - Show terse runtime - status information about one or more - seats. This function is - intended to generate human-readable - output. If you are looking for - computer-parsable output, use - show-seat - instead. - - - - show-seat NAME... - - Show properties of one - or more seats or the manager - itself. If no argument is specified, - properties of the manager will be - shown. If a seat is specified, - properties of the seat are shown. By - default, empty properties are - suppressed. Use - to show those too. To select specific - properties to show, use - . This - command is intended to be used - whenever computer-parsable output is - required. Use - seat-status if you - are looking for formatted - human-readable - output. - - - - attach NAME DEVICE... - - Persistently attach - one or more devices to a seat. The - devices should be specified via device - paths in the /sys - file system. To create a new seat, - attach at least one graphics card to a - previously unused seat name. Seat - names may consist only of a-z, A-Z, - 0-9, - and - _ and must be - prefixed with seat. - To drop assignment of a device to a - specific seat, just reassign it to a - different seat, or use - flush-devices. - - - - - flush-devices - - Removes all device - assignments previously created with - attach. After this - call, only automatically generated - seats will remain, and all seat - hardware is assigned to - them. - - - - terminate-seat NAME... - - Terminates all - sessions on a seat. This kills all - processes of all sessions on the seat - and deallocates all runtime resources - attached to them. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - - - See Also - - systemd1, - systemctl1, - systemd-logind.service8, - logind.conf5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + loginctl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + loginctl + 1 + + + + loginctl + Control the systemd login manager + + + + + loginctl + OPTIONS + COMMAND + NAME + + + + + Description + + loginctl may be used to introspect and + control the state of the + systemd1 + login manager + systemd-logind.service8. + + + + Options + + The following options are understood: + + + + + + Do not query the user for authentication for + privileged operations. + + + + + + + When showing session/user/seat properties, + limit display to certain properties as specified as argument. + If not specified, all set properties are shown. The argument + should be a property name, such as + Sessions. If specified more than once, all + properties with the specified names are + shown. + + + + + + + When showing session/user/seat properties, + show all properties regardless of whether they are set or + not. + + + + + + + Do not ellipsize process tree entries. + + + + + + + When used with + kill-session, choose which processes to + kill. Must be one of , or + to select whether to kill only the leader + process of the session or all processes of the session. If + omitted, defaults to . + + + + + + + When used with kill-session + or kill-user, choose which signal to send + to selected processes. Must be one of the well known signal + specifiers, such as SIGTERM, + SIGINT or SIGSTOP. + If omitted, defaults to + SIGTERM. + + + + + + + When used with user-status + and session-status, controls the number of + journal lines to show, counting from the most recent ones. + Takes a positive integer argument. Defaults to 10. + + + + + + + + When used with user-status + and session-status, controls the formatting + of the journal entries that are shown. For the available + choices, see + journalctl1. + Defaults to short. + + + + + + + + + + + + + + Commands + + The following commands are understood: + + Session Commands + + + list-sessions + + List current sessions. + + + + session-status ID... + + Show terse runtime status information about + one or more sessions, followed by the most recent log data + from the journal. Takes one or more session identifiers as + parameters. If no session identifiers are passed the status of + the caller's session is shown. This function is intended to + generate human-readable output. If you are looking for + computer-parsable output, use show-session + instead. + + + + show-session ID... + + Show properties of one or more sessions or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a session ID is specified, + properties of the session are shown. By default, empty + properties are suppressed. Use to show + those too. To select specific properties to show, use + . This command is intended to be + used whenever computer-parsable output is required. Use + session-status if you are looking for + formatted human-readable output. + + + + activate ID + + Activate a session. This brings a session into + the foreground, if another session is currently in the + foreground on the respective seat. Takes a session identifier + as argument. If no argument is specified the session of the + caller is put into foreground. + + + + lock-session ID... + unlock-session ID... + + Activates/deactivates the screen lock on one + or more sessions, if the session supports it. Takes one or + more session identifiers as arguments. If no argument is + specified the session of the caller is locked/unlocked. + + + + + lock-sessions + unlock-sessions + + Activates/deactivates the screen lock on all + current sessions supporting it. + + + + terminate-session ID... + + Terminates a session. This kills all processes + of the session and deallocates all resources attached to the + session. + + + + kill-session ID... + + Send a signal to one or more processes of the + session. Use to select which + process to kill. Use to select the + signal to send. + + + + User Commands + + list-users + + List currently logged in users. + + + + + user-status USER... + + Show terse runtime status information about + one or more logged in users, followed by the most recent log + data from the journal. Takes one or more user names or numeric + user IDs as parameters. If no parameters are passed the status + of the caller's user is shown. This function is intended to + generate human-readable output. If you are looking for + computer-parsable output, use show-user + instead. Users may be specified by their usernames or numeric + user IDs. + + + + show-user USER... + + Show properties of one or more users or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a user is specified, properties of + the user are shown. By default, empty properties are + suppressed. Use to show those too. To + select specific properties to show, use + . This command is intended to be + used whenever computer-parsable output is required. Use + user-status if you are looking for + formatted human-readable output. + + + + enable-linger USER... + disable-linger USER... + + Enable/disable user lingering for one or more + users. If enabled for a specific user, a user manager is + spawned for the user at boot and kept around after logouts. + This allows users who are not logged in to run long-running + services. Takes one or more user names or numeric UIDs as + argument. If no argument is specified enables/disables + lingering for the user of the session of the caller. + + + + + terminate-user USER... + + Terminates all sessions of a user. This kills + all processes of all sessions of the user and deallocates all + runtime resources attached to the user. + + + + kill-user USER... + + Send a signal to all processes of a user. Use + to select the signal to send. + + + + + Seat Commands + + list-seats + + List currently available seats on the local + system. + + + + seat-status NAME... + + Show terse runtime status information about + one or more seats. Takes one or more seat names as parameters. + If no seat names are passed the status of the caller's + session's seat is shown. This function is intended to generate + human-readable output. If you are looking for + computer-parsable output, use show-seat + instead. + + + + show-seat NAME... + + Show properties of one or more seats or the + manager itself. If no argument is specified, properties of the + manager will be shown. If a seat is specified, properties of + the seat are shown. By default, empty properties are + suppressed. Use to show those too. To + select specific properties to show, use + . This command is intended to be + used whenever computer-parsable output is required. Use + seat-status if you are looking for + formatted human-readable output. + + + + attach NAME DEVICE... + + Persistently attach one or more devices to a + seat. The devices should be specified via device paths in the + /sys file system. To create a new seat, + attach at least one graphics card to a previously unused seat + name. Seat names may consist only of a-z, A-Z, 0-9, + - and _ and must be + prefixed with seat. To drop assignment of a + device to a specific seat, just reassign it to a different + seat, or use flush-devices. + + + + + flush-devices + + Removes all device assignments previously + created with attach. After this call, only + automatically generated seats will remain, and all seat + hardware is assigned to them. + + + + terminate-seat NAME... + + Terminates all sessions on a seat. This kills + all processes of all sessions on the seat and deallocates all + runtime resources attached to them. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + + + See Also + + systemd1, + systemctl1, + systemd-logind.service8, + logind.conf5 + + diff --git a/man/logind.conf.5 b/man/logind.conf.5 index b841f903a..3b8d0da27 100644 --- a/man/logind.conf.5 +++ b/man/logind.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "LOGIND\&.CONF" "5" "" "systemd 218" "logind.conf" +.TH "LOGIND\&.CONF" "5" "" "systemd 219" "logind.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/logind.conf.d.html b/man/logind.conf.d.html index 198210a98..03a8fa8ea 100644 --- a/man/logind.conf.d.html +++ b/man/logind.conf.d.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

logind.conf, logind.conf.d — Login manager configuration files

Synopsis

/etc/systemd/logind.conf

/etc/systemd/logind.conf.d/*.conf

/run/systemd/logind.conf.d/*.conf

/usr/lib/systemd/logind.conf.d/*.conf

Description¶

These files configure various parameters of the systemd login manager, systemd-logind.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

logind.conf, logind.conf.d — Login manager configuration files

Synopsis

/etc/systemd/logind.conf

/etc/systemd/logind.conf.d/*.conf

/run/systemd/logind.conf.d/*.conf

/usr/lib/systemd/logind.conf.d/*.conf

Description¶

These files configure various parameters of the systemd login manager, systemd-logind.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -43,208 +43,136 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Login]" section:

NAutoVTs=¶

Takes a positive - integer. Configures how many virtual - terminals (VTs) to allocate by default - that, when switched to and are - previously unused, - "autovt" services are - automatically spawned on. These - services are instantiated from the - template unit - autovt@.service - for the respective VT TTY name, - for example, autovt@tty4.service. By - default, - autovt@.service - is linked to - getty@.service. - In other words, login prompts are started - dynamically as the user switches to - unused virtual terminals. Hence, this - parameter controls how many login - "gettys" are - available on the VTs. If a VT is - already used by some other subsystem - (for example, a graphical login), this - kind of activation will not be - attempted. Note that the VT configured - in ReserveVT= is - always subject to this kind of - activation, even if it is not one of - the VTs configured with the - NAutoVTs= - directive. Defaults to 6. When set to - 0, automatic spawning of - "autovt" services is - disabled.

ReserveVT=¶

Takes a positive - integer. Identifies one - virtual terminal that shall - unconditionally be reserved for - autovt@.service - activation (see above). The VT - selected with this option will be - marked busy unconditionally, so that no - other subsystem will allocate it. This - functionality is useful to ensure that, - regardless of how many VTs are allocated - by other subsystems, one login - "getty" is always - available. Defaults to 6 (in other - words, there will always be a - "getty" available on - Alt-F6.). When set to 0, VT - reservation is - disabled.

KillUserProcesses=¶

Takes a boolean - argument. Configures whether the - processes of a user should be killed - when the user completely logs out (i.e. after - the user's last session ended). Defaults to - "no".

Note that setting - KillUserProcesses=1 - will break tools like - screen(1).

KillOnlyUsers=, KillExcludeUsers=¶

These settings take - space-separated lists of usernames - that influence the effect of - KillUserProcesses=. If - not empty, only processes of users - listed in - KillOnlyUsers= will - be killed when they log out - entirely. Processes of users listed in - KillExcludeUsers= - are excluded from being - killed. KillExcludeUsers= - defaults to "root" - and takes precedence over - KillOnlyUsers=, - which defaults to the empty list.

IdleAction=¶

Configures the action - to take when the system is idle. Takes - one of "ignore", - "poweroff", - "reboot", - "halt", - "kexec", - "suspend", - "hibernate", - "hybrid-sleep", and - "lock". Defaults to - "ignore".

Note that this requires that - user sessions correctly report the - idle status to the system. The system - will execute the action after all - sessions report that they are idle, - no idle inhibitor lock is active, - and subsequently, the time configured - with IdleActionSec= - (see below) has expired.

IdleActionSec=¶

Configures the delay - after which the action configured in - IdleAction= (see - above) is taken after the system is - idle.

InhibitDelayMaxSec=¶

Specifies the maximum - time a system shutdown or sleep - request is delayed due to an inhibitor - lock of type "delay" - being active before the inhibitor is - ignored and the operation executes - anyway. Defaults to - 5.

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=¶

Controls whether - logind shall handle the system power - and sleep keys and the lid switch to - trigger actions such as system - power-off or suspend. Can be one of - "ignore", - "poweroff", - "reboot", - "halt", - "kexec", - "suspend", - "hibernate", - "hybrid-sleep", and - "lock". If - "ignore", logind will - never handle these keys. If - "lock", all running - sessions will be screen-locked; - otherwise, the specified action will - be taken in the respective event. Only - input devices with the - "power-switch" udev - tag will be watched for key/lid switch - events. HandlePowerKey= - defaults to - "poweroff". - HandleSuspendKey= - and - HandleLidSwitch= - default to "suspend". - HandleLidSwitchDocked= - defaults to "ignore". - HandleHibernateKey= - defaults to - "hibernate". If the - system is inserted in a docking station, - or if more than one display is connected, - the action specified by - HandleLidSwitchDocked= - occurs; otherwise the - HandleLidSwitch= - action occurs.

PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=¶

Controls whether - actions triggered by the power and - sleep keys and the lid switch are - subject to inhibitor locks. These - settings take boolean arguments. If - "no", the inhibitor - locks taken by applications in order - to block the requested operation are - respected. If "yes", - the requested operation is executed in - any - case. PowerKeyIgnoreInhibited=, - SuspendKeyIgnoreInhibited= - and - HibernateKeyIgnoreInhibited= - default to "no". - LidSwitchIgnoreInhibited= - defaults to - "yes". This means - that the lid switch does not respect - suspend blockers by default, but the - power and sleep keys do. -

RuntimeDirectorySize=¶

Sets the size limit on - the - $XDG_RUNTIME_DIR - runtime directory for each user who - logs in. Takes a size in bytes, - optionally suffixed with the usual K, G, - M, and T suffixes, to the base 1024 - (IEC). Alternatively, a numerical - percentage suffixed by "%" - may be specified, which sets the size - limit relative to the amount of - physical RAM. Defaults to 10%. Note - that this size is a safety limit - only. As each runtime directory is a - tmpfs file system, it will only consume - as much memory as is needed. -

RemoveIPC=¶

Controls whether - System V and POSIX IPC objects - belonging to the user shall be removed - when the user fully logs out. Takes a - boolean argument. If enabled, the user - may not consume IPC resources after - the last of the user's sessions - terminated. This covers System V - semaphores, shared memory and message - queues, as well as POSIX shared memory - and message queues. Note that IPC - objects of the root user are excluded - from the effect of this - setting. Defaults to - "yes".

+ file.

Options¶

All options are configured in the + "[Login]" section:

NAutoVTs=¶

Takes a positive integer. Configures how many + virtual terminals (VTs) to allocate by default that, when + switched to and are previously unused, + "autovt" services are automatically spawned + on. These services are instantiated from the template unit + autovt@.service for the respective VT TTY + name, for example, autovt@tty4.service. + By default, autovt@.service is linked to + getty@.service. In other words, login + prompts are started dynamically as the user switches to unused + virtual terminals. Hence, this parameter controls how many + login "gettys" are available on the VTs. If a + VT is already used by some other subsystem (for example, a + graphical login), this kind of activation will not be + attempted. Note that the VT configured in + ReserveVT= is always subject to this kind + of activation, even if it is not one of the VTs configured + with the NAutoVTs= directive. Defaults to + 6. When set to 0, automatic spawning of + "autovt" services is + disabled.

ReserveVT=¶

Takes a positive integer. Identifies one + virtual terminal that shall unconditionally be reserved for + autovt@.service activation (see above). + The VT selected with this option will be marked busy + unconditionally, so that no other subsystem will allocate it. + This functionality is useful to ensure that, regardless of how + many VTs are allocated by other subsystems, one login + "getty" is always available. Defaults to 6 + (in other words, there will always be a + "getty" available on Alt-F6.). When set to 0, + VT reservation is disabled.

KillUserProcesses=¶

Takes a boolean argument. Configures whether + the processes of a user should be killed when the user + completely logs out (i.e. after the user's last session + ended). Defaults to "no".

Note that setting KillUserProcesses=1 + will break tools like + screen(1).

KillOnlyUsers=, KillExcludeUsers=¶

These settings take space-separated lists of + usernames that influence the effect of + KillUserProcesses=. If not empty, only + processes of users listed in KillOnlyUsers= + will be killed when they log out entirely. Processes of users + listed in KillExcludeUsers= are excluded + from being killed. KillExcludeUsers= + defaults to "root" and takes precedence over + KillOnlyUsers=, which defaults to the empty + list.

IdleAction=¶

Configures the action to take when the system + is idle. Takes one of + "ignore", + "poweroff", + "reboot", + "halt", + "kexec", + "suspend", + "hibernate", + "hybrid-sleep", and + "lock". + Defaults to "ignore".

Note that this requires that user sessions correctly + report the idle status to the system. The system will execute + the action after all sessions report that they are idle, no + idle inhibitor lock is active, and subsequently, the time + configured with IdleActionSec= (see below) + has expired.

IdleActionSec=¶

Configures the delay after which the action + configured in IdleAction= (see above) is + taken after the system is idle.

InhibitDelayMaxSec=¶

Specifies the maximum time a system shutdown + or sleep request is delayed due to an inhibitor lock of type + "delay" being active before the inhibitor is + ignored and the operation executes anyway. Defaults to + 5.

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=¶

Controls whether logind shall handle the + system power and sleep keys and the lid switch to trigger + actions such as system power-off or suspend. Can be one of + "ignore", + "poweroff", + "reboot", + "halt", + "kexec", + "suspend", + "hibernate", + "hybrid-sleep", and + "lock". + If "ignore", logind will never handle these + keys. If "lock", all running sessions will be + screen-locked; otherwise, the specified action will be taken + in the respective event. Only input devices with the + "power-switch" udev tag will be watched for + key/lid switch events. HandlePowerKey= + defaults to "poweroff". + HandleSuspendKey= and + HandleLidSwitch= default to + "suspend". + HandleLidSwitchDocked= defaults to + "ignore". + HandleHibernateKey= defaults to + "hibernate". If the system is inserted in a + docking station, or if more than one display is connected, the + action specified by HandleLidSwitchDocked= + occurs; otherwise the HandleLidSwitch= + action occurs.

PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=¶

Controls whether actions triggered by the + power and sleep keys and the lid switch are subject to + inhibitor locks. These settings take boolean arguments. If + "no", the inhibitor locks taken by + applications in order to block the requested operation are + respected. If "yes", the requested operation + is executed in any case. + PowerKeyIgnoreInhibited=, + SuspendKeyIgnoreInhibited= and + HibernateKeyIgnoreInhibited= default to + "no". + LidSwitchIgnoreInhibited= defaults to + "yes". This means that the lid switch does + not respect suspend blockers by default, but the power and + sleep keys do.

RuntimeDirectorySize=¶

Sets the size limit on the + $XDG_RUNTIME_DIR runtime directory for each + user who logs in. Takes a size in bytes, optionally suffixed + with the usual K, G, M, and T suffixes, to the base 1024 + (IEC). Alternatively, a numerical percentage suffixed by + "%" may be specified, which sets the size + limit relative to the amount of physical RAM. Defaults to 10%. + Note that this size is a safety limit only. As each runtime + directory is a tmpfs file system, it will only consume as much + memory as is needed.

RemoveIPC=¶

Controls whether System V and POSIX IPC + objects belonging to the user shall be removed when the user + fully logs out. Takes a boolean argument. If enabled, the user + may not consume IPC resources after the last of the user's + sessions terminated. This covers System V semaphores, shared + memory and message queues, as well as POSIX shared memory and + message queues. Note that IPC objects of the root user are + excluded from the effect of this setting. Defaults to + "yes".

diff --git a/man/logind.conf.html b/man/logind.conf.html index 198210a98..03a8fa8ea 100644 --- a/man/logind.conf.html +++ b/man/logind.conf.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

logind.conf, logind.conf.d — Login manager configuration files

Synopsis

/etc/systemd/logind.conf

/etc/systemd/logind.conf.d/*.conf

/run/systemd/logind.conf.d/*.conf

/usr/lib/systemd/logind.conf.d/*.conf

Description¶

These files configure various parameters of the systemd login manager, systemd-logind.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

logind.conf, logind.conf.d — Login manager configuration files

Synopsis

/etc/systemd/logind.conf

/etc/systemd/logind.conf.d/*.conf

/run/systemd/logind.conf.d/*.conf

/usr/lib/systemd/logind.conf.d/*.conf

Description¶

These files configure various parameters of the systemd login manager, systemd-logind.service(8).

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -43,208 +43,136 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Login]" section:

NAutoVTs=¶

Takes a positive - integer. Configures how many virtual - terminals (VTs) to allocate by default - that, when switched to and are - previously unused, - "autovt" services are - automatically spawned on. These - services are instantiated from the - template unit - autovt@.service - for the respective VT TTY name, - for example, autovt@tty4.service. By - default, - autovt@.service - is linked to - getty@.service. - In other words, login prompts are started - dynamically as the user switches to - unused virtual terminals. Hence, this - parameter controls how many login - "gettys" are - available on the VTs. If a VT is - already used by some other subsystem - (for example, a graphical login), this - kind of activation will not be - attempted. Note that the VT configured - in ReserveVT= is - always subject to this kind of - activation, even if it is not one of - the VTs configured with the - NAutoVTs= - directive. Defaults to 6. When set to - 0, automatic spawning of - "autovt" services is - disabled.

ReserveVT=¶

Takes a positive - integer. Identifies one - virtual terminal that shall - unconditionally be reserved for - autovt@.service - activation (see above). The VT - selected with this option will be - marked busy unconditionally, so that no - other subsystem will allocate it. This - functionality is useful to ensure that, - regardless of how many VTs are allocated - by other subsystems, one login - "getty" is always - available. Defaults to 6 (in other - words, there will always be a - "getty" available on - Alt-F6.). When set to 0, VT - reservation is - disabled.

KillUserProcesses=¶

Takes a boolean - argument. Configures whether the - processes of a user should be killed - when the user completely logs out (i.e. after - the user's last session ended). Defaults to - "no".

Note that setting - KillUserProcesses=1 - will break tools like - screen(1).

KillOnlyUsers=, KillExcludeUsers=¶

These settings take - space-separated lists of usernames - that influence the effect of - KillUserProcesses=. If - not empty, only processes of users - listed in - KillOnlyUsers= will - be killed when they log out - entirely. Processes of users listed in - KillExcludeUsers= - are excluded from being - killed. KillExcludeUsers= - defaults to "root" - and takes precedence over - KillOnlyUsers=, - which defaults to the empty list.

IdleAction=¶

Configures the action - to take when the system is idle. Takes - one of "ignore", - "poweroff", - "reboot", - "halt", - "kexec", - "suspend", - "hibernate", - "hybrid-sleep", and - "lock". Defaults to - "ignore".

Note that this requires that - user sessions correctly report the - idle status to the system. The system - will execute the action after all - sessions report that they are idle, - no idle inhibitor lock is active, - and subsequently, the time configured - with IdleActionSec= - (see below) has expired.

IdleActionSec=¶

Configures the delay - after which the action configured in - IdleAction= (see - above) is taken after the system is - idle.

InhibitDelayMaxSec=¶

Specifies the maximum - time a system shutdown or sleep - request is delayed due to an inhibitor - lock of type "delay" - being active before the inhibitor is - ignored and the operation executes - anyway. Defaults to - 5.

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=¶

Controls whether - logind shall handle the system power - and sleep keys and the lid switch to - trigger actions such as system - power-off or suspend. Can be one of - "ignore", - "poweroff", - "reboot", - "halt", - "kexec", - "suspend", - "hibernate", - "hybrid-sleep", and - "lock". If - "ignore", logind will - never handle these keys. If - "lock", all running - sessions will be screen-locked; - otherwise, the specified action will - be taken in the respective event. Only - input devices with the - "power-switch" udev - tag will be watched for key/lid switch - events. HandlePowerKey= - defaults to - "poweroff". - HandleSuspendKey= - and - HandleLidSwitch= - default to "suspend". - HandleLidSwitchDocked= - defaults to "ignore". - HandleHibernateKey= - defaults to - "hibernate". If the - system is inserted in a docking station, - or if more than one display is connected, - the action specified by - HandleLidSwitchDocked= - occurs; otherwise the - HandleLidSwitch= - action occurs.

PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=¶

Controls whether - actions triggered by the power and - sleep keys and the lid switch are - subject to inhibitor locks. These - settings take boolean arguments. If - "no", the inhibitor - locks taken by applications in order - to block the requested operation are - respected. If "yes", - the requested operation is executed in - any - case. PowerKeyIgnoreInhibited=, - SuspendKeyIgnoreInhibited= - and - HibernateKeyIgnoreInhibited= - default to "no". - LidSwitchIgnoreInhibited= - defaults to - "yes". This means - that the lid switch does not respect - suspend blockers by default, but the - power and sleep keys do. -

RuntimeDirectorySize=¶

Sets the size limit on - the - $XDG_RUNTIME_DIR - runtime directory for each user who - logs in. Takes a size in bytes, - optionally suffixed with the usual K, G, - M, and T suffixes, to the base 1024 - (IEC). Alternatively, a numerical - percentage suffixed by "%" - may be specified, which sets the size - limit relative to the amount of - physical RAM. Defaults to 10%. Note - that this size is a safety limit - only. As each runtime directory is a - tmpfs file system, it will only consume - as much memory as is needed. -

RemoveIPC=¶

Controls whether - System V and POSIX IPC objects - belonging to the user shall be removed - when the user fully logs out. Takes a - boolean argument. If enabled, the user - may not consume IPC resources after - the last of the user's sessions - terminated. This covers System V - semaphores, shared memory and message - queues, as well as POSIX shared memory - and message queues. Note that IPC - objects of the root user are excluded - from the effect of this - setting. Defaults to - "yes".

+ file.

Options¶

All options are configured in the + "[Login]" section:

NAutoVTs=¶

Takes a positive integer. Configures how many + virtual terminals (VTs) to allocate by default that, when + switched to and are previously unused, + "autovt" services are automatically spawned + on. These services are instantiated from the template unit + autovt@.service for the respective VT TTY + name, for example, autovt@tty4.service. + By default, autovt@.service is linked to + getty@.service. In other words, login + prompts are started dynamically as the user switches to unused + virtual terminals. Hence, this parameter controls how many + login "gettys" are available on the VTs. If a + VT is already used by some other subsystem (for example, a + graphical login), this kind of activation will not be + attempted. Note that the VT configured in + ReserveVT= is always subject to this kind + of activation, even if it is not one of the VTs configured + with the NAutoVTs= directive. Defaults to + 6. When set to 0, automatic spawning of + "autovt" services is + disabled.

ReserveVT=¶

Takes a positive integer. Identifies one + virtual terminal that shall unconditionally be reserved for + autovt@.service activation (see above). + The VT selected with this option will be marked busy + unconditionally, so that no other subsystem will allocate it. + This functionality is useful to ensure that, regardless of how + many VTs are allocated by other subsystems, one login + "getty" is always available. Defaults to 6 + (in other words, there will always be a + "getty" available on Alt-F6.). When set to 0, + VT reservation is disabled.

KillUserProcesses=¶

Takes a boolean argument. Configures whether + the processes of a user should be killed when the user + completely logs out (i.e. after the user's last session + ended). Defaults to "no".

Note that setting KillUserProcesses=1 + will break tools like + screen(1).

KillOnlyUsers=, KillExcludeUsers=¶

These settings take space-separated lists of + usernames that influence the effect of + KillUserProcesses=. If not empty, only + processes of users listed in KillOnlyUsers= + will be killed when they log out entirely. Processes of users + listed in KillExcludeUsers= are excluded + from being killed. KillExcludeUsers= + defaults to "root" and takes precedence over + KillOnlyUsers=, which defaults to the empty + list.

IdleAction=¶

Configures the action to take when the system + is idle. Takes one of + "ignore", + "poweroff", + "reboot", + "halt", + "kexec", + "suspend", + "hibernate", + "hybrid-sleep", and + "lock". + Defaults to "ignore".

Note that this requires that user sessions correctly + report the idle status to the system. The system will execute + the action after all sessions report that they are idle, no + idle inhibitor lock is active, and subsequently, the time + configured with IdleActionSec= (see below) + has expired.

IdleActionSec=¶

Configures the delay after which the action + configured in IdleAction= (see above) is + taken after the system is idle.

InhibitDelayMaxSec=¶

Specifies the maximum time a system shutdown + or sleep request is delayed due to an inhibitor lock of type + "delay" being active before the inhibitor is + ignored and the operation executes anyway. Defaults to + 5.

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=¶

Controls whether logind shall handle the + system power and sleep keys and the lid switch to trigger + actions such as system power-off or suspend. Can be one of + "ignore", + "poweroff", + "reboot", + "halt", + "kexec", + "suspend", + "hibernate", + "hybrid-sleep", and + "lock". + If "ignore", logind will never handle these + keys. If "lock", all running sessions will be + screen-locked; otherwise, the specified action will be taken + in the respective event. Only input devices with the + "power-switch" udev tag will be watched for + key/lid switch events. HandlePowerKey= + defaults to "poweroff". + HandleSuspendKey= and + HandleLidSwitch= default to + "suspend". + HandleLidSwitchDocked= defaults to + "ignore". + HandleHibernateKey= defaults to + "hibernate". If the system is inserted in a + docking station, or if more than one display is connected, the + action specified by HandleLidSwitchDocked= + occurs; otherwise the HandleLidSwitch= + action occurs.

PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=¶

Controls whether actions triggered by the + power and sleep keys and the lid switch are subject to + inhibitor locks. These settings take boolean arguments. If + "no", the inhibitor locks taken by + applications in order to block the requested operation are + respected. If "yes", the requested operation + is executed in any case. + PowerKeyIgnoreInhibited=, + SuspendKeyIgnoreInhibited= and + HibernateKeyIgnoreInhibited= default to + "no". + LidSwitchIgnoreInhibited= defaults to + "yes". This means that the lid switch does + not respect suspend blockers by default, but the power and + sleep keys do.

RuntimeDirectorySize=¶

Sets the size limit on the + $XDG_RUNTIME_DIR runtime directory for each + user who logs in. Takes a size in bytes, optionally suffixed + with the usual K, G, M, and T suffixes, to the base 1024 + (IEC). Alternatively, a numerical percentage suffixed by + "%" may be specified, which sets the size + limit relative to the amount of physical RAM. Defaults to 10%. + Note that this size is a safety limit only. As each runtime + directory is a tmpfs file system, it will only consume as much + memory as is needed.

RemoveIPC=¶

Controls whether System V and POSIX IPC + objects belonging to the user shall be removed when the user + fully logs out. Takes a boolean argument. If enabled, the user + may not consume IPC resources after the last of the user's + sessions terminated. This covers System V semaphores, shared + memory and message queues, as well as POSIX shared memory and + message queues. Note that IPC objects of the root user are + excluded from the effect of this setting. Defaults to + "yes".

diff --git a/man/logind.conf.xml b/man/logind.conf.xml index e927cf445..ffaec5035 100644 --- a/man/logind.conf.xml +++ b/man/logind.conf.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - logind.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - logind.conf - 5 - - - - logind.conf - logind.conf.d - Login manager configuration files - - - - /etc/systemd/logind.conf - /etc/systemd/logind.conf.d/*.conf - /run/systemd/logind.conf.d/*.conf - /usr/lib/systemd/logind.conf.d/*.conf - - - - Description - - These files configure various parameters of the systemd login manager, systemd-logind.service8. - - - - - - - Options - - All options are configured in the - [Login] section: - - - - - NAutoVTs= - - Takes a positive - integer. Configures how many virtual - terminals (VTs) to allocate by default - that, when switched to and are - previously unused, - autovt services are - automatically spawned on. These - services are instantiated from the - template unit - autovt@.service - for the respective VT TTY name, - for example, autovt@tty4.service. By - default, - autovt@.service - is linked to - getty@.service. - In other words, login prompts are started - dynamically as the user switches to - unused virtual terminals. Hence, this - parameter controls how many login - gettys are - available on the VTs. If a VT is - already used by some other subsystem - (for example, a graphical login), this - kind of activation will not be - attempted. Note that the VT configured - in ReserveVT= is - always subject to this kind of - activation, even if it is not one of - the VTs configured with the - NAutoVTs= - directive. Defaults to 6. When set to - 0, automatic spawning of - autovt services is - disabled. - - - - ReserveVT= - - Takes a positive - integer. Identifies one - virtual terminal that shall - unconditionally be reserved for - autovt@.service - activation (see above). The VT - selected with this option will be - marked busy unconditionally, so that no - other subsystem will allocate it. This - functionality is useful to ensure that, - regardless of how many VTs are allocated - by other subsystems, one login - getty is always - available. Defaults to 6 (in other - words, there will always be a - getty available on - Alt-F6.). When set to 0, VT - reservation is - disabled. - - - - KillUserProcesses= - - Takes a boolean - argument. Configures whether the - processes of a user should be killed - when the user completely logs out (i.e. after - the user's last session ended). Defaults to - no. - - Note that setting - KillUserProcesses=1 - will break tools like - screen1. - - - - KillOnlyUsers= - KillExcludeUsers= - - These settings take - space-separated lists of usernames - that influence the effect of - KillUserProcesses=. If - not empty, only processes of users - listed in - KillOnlyUsers= will - be killed when they log out - entirely. Processes of users listed in - KillExcludeUsers= - are excluded from being - killed. KillExcludeUsers= - defaults to root - and takes precedence over - KillOnlyUsers=, - which defaults to the empty list. - - - - IdleAction= - - Configures the action - to take when the system is idle. Takes - one of ignore, - poweroff, - reboot, - halt, - kexec, - suspend, - hibernate, - hybrid-sleep, and - lock. Defaults to - ignore. - - Note that this requires that - user sessions correctly report the - idle status to the system. The system - will execute the action after all - sessions report that they are idle, - no idle inhibitor lock is active, - and subsequently, the time configured - with IdleActionSec= - (see below) has expired. - - - - - IdleActionSec= - - Configures the delay - after which the action configured in - IdleAction= (see - above) is taken after the system is - idle. - - - - InhibitDelayMaxSec= - - Specifies the maximum - time a system shutdown or sleep - request is delayed due to an inhibitor - lock of type delay - being active before the inhibitor is - ignored and the operation executes - anyway. Defaults to - 5. - - - - HandlePowerKey= - HandleSuspendKey= - HandleHibernateKey= - HandleLidSwitch= - HandleLidSwitchDocked= - - Controls whether - logind shall handle the system power - and sleep keys and the lid switch to - trigger actions such as system - power-off or suspend. Can be one of - ignore, - poweroff, - reboot, - halt, - kexec, - suspend, - hibernate, - hybrid-sleep, and - lock. If - ignore, logind will - never handle these keys. If - lock, all running - sessions will be screen-locked; - otherwise, the specified action will - be taken in the respective event. Only - input devices with the - power-switch udev - tag will be watched for key/lid switch - events. HandlePowerKey= - defaults to - poweroff. - HandleSuspendKey= - and - HandleLidSwitch= - default to suspend. - HandleLidSwitchDocked= - defaults to ignore. - HandleHibernateKey= - defaults to - hibernate. If the - system is inserted in a docking station, - or if more than one display is connected, - the action specified by - HandleLidSwitchDocked= - occurs; otherwise the - HandleLidSwitch= - action occurs. - - - - PowerKeyIgnoreInhibited= - SuspendKeyIgnoreInhibited= - HibernateKeyIgnoreInhibited= - LidSwitchIgnoreInhibited= - - Controls whether - actions triggered by the power and - sleep keys and the lid switch are - subject to inhibitor locks. These - settings take boolean arguments. If - no, the inhibitor - locks taken by applications in order - to block the requested operation are - respected. If yes, - the requested operation is executed in - any - case. PowerKeyIgnoreInhibited=, - SuspendKeyIgnoreInhibited= - and - HibernateKeyIgnoreInhibited= - default to no. - LidSwitchIgnoreInhibited= - defaults to - yes. This means - that the lid switch does not respect - suspend blockers by default, but the - power and sleep keys do. - - - - - RuntimeDirectorySize= - - Sets the size limit on - the - $XDG_RUNTIME_DIR - runtime directory for each user who - logs in. Takes a size in bytes, - optionally suffixed with the usual K, G, - M, and T suffixes, to the base 1024 - (IEC). Alternatively, a numerical - percentage suffixed by % - may be specified, which sets the size - limit relative to the amount of - physical RAM. Defaults to 10%. Note - that this size is a safety limit - only. As each runtime directory is a - tmpfs file system, it will only consume - as much memory as is needed. - - - - - RemoveIPC= - - Controls whether - System V and POSIX IPC objects - belonging to the user shall be removed - when the user fully logs out. Takes a - boolean argument. If enabled, the user - may not consume IPC resources after - the last of the user's sessions - terminated. This covers System V - semaphores, shared memory and message - queues, as well as POSIX shared memory - and message queues. Note that IPC - objects of the root user are excluded - from the effect of this - setting. Defaults to - yes. - - - - - - - See Also - - systemd1, - systemd-logind.service8, - loginctl1, - systemd-system.conf5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + logind.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + logind.conf + 5 + + + + logind.conf + logind.conf.d + Login manager configuration files + + + + /etc/systemd/logind.conf + /etc/systemd/logind.conf.d/*.conf + /run/systemd/logind.conf.d/*.conf + /usr/lib/systemd/logind.conf.d/*.conf + + + + Description + + These files configure various parameters of the systemd login manager, systemd-logind.service8. + + + + + + + Options + + All options are configured in the + [Login] section: + + + + + NAutoVTs= + + Takes a positive integer. Configures how many + virtual terminals (VTs) to allocate by default that, when + switched to and are previously unused, + autovt services are automatically spawned + on. These services are instantiated from the template unit + autovt@.service for the respective VT TTY + name, for example, autovt@tty4.service. + By default, autovt@.service is linked to + getty@.service. In other words, login + prompts are started dynamically as the user switches to unused + virtual terminals. Hence, this parameter controls how many + login gettys are available on the VTs. If a + VT is already used by some other subsystem (for example, a + graphical login), this kind of activation will not be + attempted. Note that the VT configured in + ReserveVT= is always subject to this kind + of activation, even if it is not one of the VTs configured + with the NAutoVTs= directive. Defaults to + 6. When set to 0, automatic spawning of + autovt services is + disabled. + + + + ReserveVT= + + Takes a positive integer. Identifies one + virtual terminal that shall unconditionally be reserved for + autovt@.service activation (see above). + The VT selected with this option will be marked busy + unconditionally, so that no other subsystem will allocate it. + This functionality is useful to ensure that, regardless of how + many VTs are allocated by other subsystems, one login + getty is always available. Defaults to 6 + (in other words, there will always be a + getty available on Alt-F6.). When set to 0, + VT reservation is disabled. + + + + KillUserProcesses= + + Takes a boolean argument. Configures whether + the processes of a user should be killed when the user + completely logs out (i.e. after the user's last session + ended). Defaults to no. + + Note that setting KillUserProcesses=1 + will break tools like + screen1. + + + + KillOnlyUsers= + KillExcludeUsers= + + These settings take space-separated lists of + usernames that influence the effect of + KillUserProcesses=. If not empty, only + processes of users listed in KillOnlyUsers= + will be killed when they log out entirely. Processes of users + listed in KillExcludeUsers= are excluded + from being killed. KillExcludeUsers= + defaults to root and takes precedence over + KillOnlyUsers=, which defaults to the empty + list. + + + + IdleAction= + + Configures the action to take when the system + is idle. Takes one of + ignore, + poweroff, + reboot, + halt, + kexec, + suspend, + hibernate, + hybrid-sleep, and + lock. + Defaults to ignore. + + Note that this requires that user sessions correctly + report the idle status to the system. The system will execute + the action after all sessions report that they are idle, no + idle inhibitor lock is active, and subsequently, the time + configured with IdleActionSec= (see below) + has expired. + + + + + IdleActionSec= + + Configures the delay after which the action + configured in IdleAction= (see above) is + taken after the system is idle. + + + + InhibitDelayMaxSec= + + Specifies the maximum time a system shutdown + or sleep request is delayed due to an inhibitor lock of type + delay being active before the inhibitor is + ignored and the operation executes anyway. Defaults to + 5. + + + + HandlePowerKey= + HandleSuspendKey= + HandleHibernateKey= + HandleLidSwitch= + HandleLidSwitchDocked= + + Controls whether logind shall handle the + system power and sleep keys and the lid switch to trigger + actions such as system power-off or suspend. Can be one of + ignore, + poweroff, + reboot, + halt, + kexec, + suspend, + hibernate, + hybrid-sleep, and + lock. + If ignore, logind will never handle these + keys. If lock, all running sessions will be + screen-locked; otherwise, the specified action will be taken + in the respective event. Only input devices with the + power-switch udev tag will be watched for + key/lid switch events. HandlePowerKey= + defaults to poweroff. + HandleSuspendKey= and + HandleLidSwitch= default to + suspend. + HandleLidSwitchDocked= defaults to + ignore. + HandleHibernateKey= defaults to + hibernate. If the system is inserted in a + docking station, or if more than one display is connected, the + action specified by HandleLidSwitchDocked= + occurs; otherwise the HandleLidSwitch= + action occurs. + + + + PowerKeyIgnoreInhibited= + SuspendKeyIgnoreInhibited= + HibernateKeyIgnoreInhibited= + LidSwitchIgnoreInhibited= + + Controls whether actions triggered by the + power and sleep keys and the lid switch are subject to + inhibitor locks. These settings take boolean arguments. If + no, the inhibitor locks taken by + applications in order to block the requested operation are + respected. If yes, the requested operation + is executed in any case. + PowerKeyIgnoreInhibited=, + SuspendKeyIgnoreInhibited= and + HibernateKeyIgnoreInhibited= default to + no. + LidSwitchIgnoreInhibited= defaults to + yes. This means that the lid switch does + not respect suspend blockers by default, but the power and + sleep keys do. + + + + RuntimeDirectorySize= + + Sets the size limit on the + $XDG_RUNTIME_DIR runtime directory for each + user who logs in. Takes a size in bytes, optionally suffixed + with the usual K, G, M, and T suffixes, to the base 1024 + (IEC). Alternatively, a numerical percentage suffixed by + % may be specified, which sets the size + limit relative to the amount of physical RAM. Defaults to 10%. + Note that this size is a safety limit only. As each runtime + directory is a tmpfs file system, it will only consume as much + memory as is needed. + + + + RemoveIPC= + + Controls whether System V and POSIX IPC + objects belonging to the user shall be removed when the user + fully logs out. Takes a boolean argument. If enabled, the user + may not consume IPC resources after the last of the user's + sessions terminated. This covers System V semaphores, shared + memory and message queues, as well as POSIX shared memory and + message queues. Note that IPC objects of the root user are + excluded from the effect of this setting. Defaults to + yes. + + + + + + + See Also + + systemd1, + systemd-logind.service8, + loginctl1, + systemd-system.conf5 + + diff --git a/man/machine-id.5 b/man/machine-id.5 index bb3653dfd..5ab693e47 100644 --- a/man/machine-id.5 +++ b/man/machine-id.5 @@ -1,5 +1,5 @@ '\" t -.TH "MACHINE\-ID" "5" "" "systemd 218" "machine-id" +.TH "MACHINE\-ID" "5" "" "systemd 219" "machine-id" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/machine-id.html b/man/machine-id.html index fcb5946e1..90d771f43 100644 --- a/man/machine-id.html +++ b/man/machine-id.html @@ -19,58 +19,51 @@ Directives · Python · libudev · - gudev systemd 218

Name

machine-id — Local machine ID configuration file

Synopsis

/etc/machine-id

Description¶

The /etc/machine-id file - contains the unique machine ID of the local system - that is set during installation. The machine ID is a - single newline-terminated, hexadecimal, 32-character, - lowercase machine ID string. When decoded from - hexadecimal, this corresponds with a 16-byte/128-bit - string.

The machine ID is usually generated from a - random source during system installation and stays - constant for all subsequent boots. Optionally, for - stateless systems, it is generated during runtime at - boot if it is found to be empty.

The machine ID does not change based on user - configuration or when hardware is replaced.

This machine ID adheres to the same format and - logic as the D-Bus machine ID.

Programs may use this ID to identify the host - with a globally unique ID in the network, which does - not change even if the local network configuration - changes. Due to this and its greater length, it is - a more useful replacement for the - gethostid(3) - call that POSIX specifies.

The - systemd-machine-id-setup(1) - tool may be used by installer tools to initialize the - machine ID at install time. Use - systemd-firstboot(1) - to initialize it on mounted (but not booted) system - images.

Relation to OSF UUIDs¶

Note that the machine ID historically is not an - OSF UUID as defined by RFC - 4122, nor a Microsoft GUID; however, starting with - systemd v30, newly generated machine IDs do - qualify as v4 UUIDs.

In order to maintain compatibility with existing - installations, an application requiring a UUID should - decode the machine ID, and then apply the following - operations to turn it into a valid OSF v4 UUID. With - "id" being an unsigned character - array:

/* Set UUID version to 4 --- truly random generation */
+  gudev systemd 219

Name

machine-id — Local machine ID configuration file

Synopsis

/etc/machine-id

Description¶

The /etc/machine-id file contains the + unique machine ID of the local system that is set during + installation. The machine ID is a single newline-terminated, + hexadecimal, 32-character, lowercase machine ID string. When + decoded from hexadecimal, this corresponds with a 16-byte/128-bit + string.

The machine ID is usually generated from a random source + during system installation and stays constant for all subsequent + boots. Optionally, for stateless systems, it is generated during + runtime at boot if it is found to be empty.

The machine ID does not change based on user configuration + or when hardware is replaced.

This machine ID adheres to the same format and logic as the + D-Bus machine ID.

Programs may use this ID to identify the host with a + globally unique ID in the network, which does not change even if + the local network configuration changes. Due to this and its + greater length, it is a more useful replacement for the + gethostid(3) + call that POSIX specifies.

The + systemd-machine-id-setup(1) + tool may be used by installer tools to initialize the machine ID + at install time. Use + systemd-firstboot(1) + to initialize it on mounted (but not booted) system images.

Relation to OSF UUIDs¶

Note that the machine ID historically is not an OSF UUID as + defined by RFC + 4122, nor a Microsoft GUID; however, starting with systemd + v30, newly generated machine IDs do qualify as v4 UUIDs.

In order to maintain compatibility with existing + installations, an application requiring a UUID should decode the + machine ID, and then apply the following operations to turn it + into a valid OSF v4 UUID. With "id" being an + unsigned character array:

/* Set UUID version to 4 --- truly random generation */
 id[6] = (id[6] & 0x0F) | 0x40;
 /* Set the UUID variant to DCE */
 id[8] = (id[8] & 0x3F) | 0x80;

(This code is inspired by - "generate_random_uuid()" of - drivers/char/random.c from the - Linux kernel sources.)

History¶

The simple configuration file format of - /etc/machine-id originates in the - /var/lib/dbus/machine-id file - introduced by D-Bus. In fact, this latter file might be a - symlink to - /etc/machine-id.

+ "generate_random_uuid()" of + drivers/char/random.c from the Linux kernel + sources.)

History¶

The simple configuration file format of + /etc/machine-id originates in the + /var/lib/dbus/machine-id file introduced by + D-Bus. In fact, this latter file might be a symlink to + /etc/machine-id.

diff --git a/man/machine-id.xml b/man/machine-id.xml index 725370d32..83e0b26ce 100644 --- a/man/machine-id.xml +++ b/man/machine-id.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - machine-id - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - machine-id - 5 - - - - machine-id - Local machine ID configuration file - - - - /etc/machine-id - - - - Description - - The /etc/machine-id file - contains the unique machine ID of the local system - that is set during installation. The machine ID is a - single newline-terminated, hexadecimal, 32-character, - lowercase machine ID string. When decoded from - hexadecimal, this corresponds with a 16-byte/128-bit - string. - - The machine ID is usually generated from a - random source during system installation and stays - constant for all subsequent boots. Optionally, for - stateless systems, it is generated during runtime at - boot if it is found to be empty. - - The machine ID does not change based on user - configuration or when hardware is replaced. - - This machine ID adheres to the same format and - logic as the D-Bus machine ID. - - Programs may use this ID to identify the host - with a globally unique ID in the network, which does - not change even if the local network configuration - changes. Due to this and its greater length, it is - a more useful replacement for the - gethostid3 - call that POSIX specifies. - - The - systemd-machine-id-setup1 - tool may be used by installer tools to initialize the - machine ID at install time. Use - systemd-firstboot1 - to initialize it on mounted (but not booted) system - images. - - - - Relation to OSF UUIDs - - Note that the machine ID historically is not an - OSF UUID as defined by RFC - 4122, nor a Microsoft GUID; however, starting with - systemd v30, newly generated machine IDs do - qualify as v4 UUIDs. - - In order to maintain compatibility with existing - installations, an application requiring a UUID should - decode the machine ID, and then apply the following - operations to turn it into a valid OSF v4 UUID. With - id being an unsigned character - array: - - /* Set UUID version to 4 --- truly random generation */ + + machine-id + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + machine-id + 5 + + + + machine-id + Local machine ID configuration file + + + + /etc/machine-id + + + + Description + + The /etc/machine-id file contains the + unique machine ID of the local system that is set during + installation. The machine ID is a single newline-terminated, + hexadecimal, 32-character, lowercase machine ID string. When + decoded from hexadecimal, this corresponds with a 16-byte/128-bit + string. + + The machine ID is usually generated from a random source + during system installation and stays constant for all subsequent + boots. Optionally, for stateless systems, it is generated during + runtime at boot if it is found to be empty. + + The machine ID does not change based on user configuration + or when hardware is replaced. + + This machine ID adheres to the same format and logic as the + D-Bus machine ID. + + Programs may use this ID to identify the host with a + globally unique ID in the network, which does not change even if + the local network configuration changes. Due to this and its + greater length, it is a more useful replacement for the + gethostid3 + call that POSIX specifies. + + The + systemd-machine-id-setup1 + tool may be used by installer tools to initialize the machine ID + at install time. Use + systemd-firstboot1 + to initialize it on mounted (but not booted) system images. + + + + Relation to OSF UUIDs + + Note that the machine ID historically is not an OSF UUID as + defined by RFC + 4122, nor a Microsoft GUID; however, starting with systemd + v30, newly generated machine IDs do qualify as v4 UUIDs. + + In order to maintain compatibility with existing + installations, an application requiring a UUID should decode the + machine ID, and then apply the following operations to turn it + into a valid OSF v4 UUID. With id being an + unsigned character array: + + /* Set UUID version to 4 --- truly random generation */ id[6] = (id[6] & 0x0F) | 0x40; /* Set the UUID variant to DCE */ id[8] = (id[8] & 0x3F) | 0x80; - (This code is inspired by - generate_random_uuid() of - drivers/char/random.c from the - Linux kernel sources.) - - - - - History - - The simple configuration file format of - /etc/machine-id originates in the - /var/lib/dbus/machine-id file - introduced by D-Bus. In fact, this latter file might be a - symlink to - /etc/machine-id. - - - - See Also - - systemd1, - systemd-machine-id-setup1, - gethostid3, - hostname5, - machine-info5, - os-release5, - sd-id1283, - sd_id128_get_machine3, - systemd-firstboot1 - - + (This code is inspired by + generate_random_uuid() of + drivers/char/random.c from the Linux kernel + sources.) + + + + + History + + The simple configuration file format of + /etc/machine-id originates in the + /var/lib/dbus/machine-id file introduced by + D-Bus. In fact, this latter file might be a symlink to + /etc/machine-id. + + + + See Also + + systemd1, + systemd-machine-id-setup1, + gethostid3, + hostname5, + machine-info5, + os-release5, + sd-id1283, + sd_id128_get_machine3, + systemd-firstboot1 + + diff --git a/man/machine-info.5 b/man/machine-info.5 index 51320cd15..e65346c27 100644 --- a/man/machine-info.5 +++ b/man/machine-info.5 @@ -1,5 +1,5 @@ '\" t -.TH "MACHINE\-INFO" "5" "" "systemd 218" "machine-info" +.TH "MACHINE\-INFO" "5" "" "systemd 219" "machine-info" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -76,7 +76,9 @@ The chassis type\&. Currently, the following chassis types are defined: "server", "tablet", "handset", -"watch", as well as the special chassis types +"watch", and +"embedded" +as well as the special chassis types "vm" and "container" diff --git a/man/machine-info.html b/man/machine-info.html index 37d046a95..cc8196e1a 100644 --- a/man/machine-info.html +++ b/man/machine-info.html @@ -19,94 +19,71 @@ Directives · Python · libudev · - gudev systemd 218

Name

machine-info — Local machine information file

Synopsis

/etc/machine-info

Description¶

The /etc/machine-info file - contains machine metadata.

The basic file format of - machine-info is a - newline-separated list of environment-like - shell-compatible variable assignments. It is possible - to source the configuration from shell scripts, - however, beyond mere variable assignments no shell - features are supported, allowing applications to read - the file without implementing a shell compatible - execution engine.

/etc/machine-info contains - metadata about the machine that is set by the user or - administrator.

Depending on the operating system other - configuration files might be checked for machine - information as well, however only as fallback.

You may use - hostnamectl(1) - to change the settings of this file from the command - line.

Options¶

The following machine metadata parameters may - be set using - /etc/machine-info:

PRETTY_HOSTNAME=¶

A pretty - human-readable UTF-8 machine identifier - string. This should contain a name - like "Lennart's - Laptop" which is useful to - present to the user and does not - suffer by the syntax limitations of - internet domain names. If possible, the - internet hostname as configured in - /etc/hostname - should be kept similar to this - one. Example: if this value is - "Lennart's Computer" - an Internet hostname of - "lennarts-computer" - might be a good choice. If this - parameter is not set, an application - should fall back to the Internet host - name for presentation - purposes.

ICON_NAME=¶

An icon identifying - this machine according to the XDG - Icon Naming Specification. If - this parameter is not set, an - application should fall back to - "computer" or a - similar icon name.

CHASSIS=¶

The chassis - type. Currently, the following chassis - types are defined: - "desktop", - "laptop", - "server", - "tablet", - "handset", - "watch", as well as - the special chassis types - "vm" and - "container" for - virtualized systems that lack an - immediate physical chassis. Note that - many systems allow detection of the - chassis type automatically (based on - firmware information or - suchlike). This setting (if set) shall - take precedence over automatically - detected information and is useful to - override misdetected configuration or - to manually configure the chassis type - where automatic detection is not - available.

DEPLOYMENT=¶

Describes the system - deployment environment. One of the - following is suggested: - "development", - "integration", - "staging", - "production". -

LOCATION=¶

Describes the system - location if applicable and - known. Takes a human-friendly, - free-form string. This may be as - generic as "Berlin, - Germany" or as specific as - "Left Rack, 2nd - Shelf".

Example¶

PRETTY_HOSTNAME="Lennart's Tablet"
+  gudev systemd 219

Name

machine-info — Local machine information file

Synopsis

/etc/machine-info

Description¶

The /etc/machine-info file contains + machine metadata.

The basic file format of machine-info + is a newline-separated list of environment-like shell-compatible + variable assignments. It is possible to source the configuration + from shell scripts, however, beyond mere variable assignments no + shell features are supported, allowing applications to read the + file without implementing a shell compatible execution + engine.

/etc/machine-info contains metadata + about the machine that is set by the user or administrator.

Depending on the operating system other configuration files + might be checked for machine information as well, however only as + fallback.

You may use + hostnamectl(1) + to change the settings of this file from the command line.

Options¶

The following machine metadata parameters may be set using + /etc/machine-info:

PRETTY_HOSTNAME=¶

A pretty human-readable UTF-8 machine + identifier string. This should contain a name like + "Lennart's Laptop" which is useful to present + to the user and does not suffer by the syntax limitations of + internet domain names. If possible, the internet hostname as + configured in /etc/hostname should be + kept similar to this one. Example: if this value is + "Lennart's Computer" an Internet hostname of + "lennarts-computer" might be a good choice. + If this parameter is not set, an application should fall back + to the Internet host name for presentation + purposes.

ICON_NAME=¶

An icon identifying this machine according to + the XDG + Icon Naming Specification. If this parameter is not + set, an application should fall back to + "computer" or a similar icon + name.

CHASSIS=¶

The chassis type. Currently, the following + chassis types are defined: + "desktop", + "laptop", + "server", + "tablet", + "handset", + "watch", and + "embedded" + as well as the special chassis types + "vm" and + "container" for + virtualized systems that lack an immediate physical chassis. + Note that many systems allow detection of the chassis type + automatically (based on firmware information or suchlike). + This setting (if set) shall take precedence over automatically + detected information and is useful to override misdetected + configuration or to manually configure the chassis type where + automatic detection is not available.

DEPLOYMENT=¶

Describes the system deployment environment. + One of the following is suggested: + "development", + "integration", + "staging", + "production". +

LOCATION=¶

Describes the system location if applicable + and known. Takes a human-friendly, free-form string. This may + be as generic as "Berlin, Germany" or as + specific as "Left Rack, 2nd Shelf". +

Example¶

PRETTY_HOSTNAME="Lennart's Tablet"
 ICON_NAME=computer-tablet
 CHASSIS=tablet
-DEPLOYMENT=production
+DEPLOYMENT=production
diff --git a/man/machine-info.xml b/man/machine-info.xml index c654daa85..916f1dab6 100644 --- a/man/machine-info.xml +++ b/man/machine-info.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - machine-info - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - machine-info - 5 - - - - machine-info - Local machine information file - - - - /etc/machine-info - - - - Description - - The /etc/machine-info file - contains machine metadata. - - The basic file format of - machine-info is a - newline-separated list of environment-like - shell-compatible variable assignments. It is possible - to source the configuration from shell scripts, - however, beyond mere variable assignments no shell - features are supported, allowing applications to read - the file without implementing a shell compatible - execution engine. - - /etc/machine-info contains - metadata about the machine that is set by the user or - administrator. - - Depending on the operating system other - configuration files might be checked for machine - information as well, however only as fallback. - - You may use - hostnamectl1 - to change the settings of this file from the command - line. - - - - Options - - The following machine metadata parameters may - be set using - /etc/machine-info: - - - - - PRETTY_HOSTNAME= - - A pretty - human-readable UTF-8 machine identifier - string. This should contain a name - like Lennart's - Laptop which is useful to - present to the user and does not - suffer by the syntax limitations of - internet domain names. If possible, the - internet hostname as configured in - /etc/hostname - should be kept similar to this - one. Example: if this value is - Lennart's Computer - an Internet hostname of - lennarts-computer - might be a good choice. If this - parameter is not set, an application - should fall back to the Internet host - name for presentation - purposes. - - - - ICON_NAME= - - An icon identifying - this machine according to the XDG - Icon Naming Specification. If - this parameter is not set, an - application should fall back to - computer or a - similar icon name. - - - - CHASSIS= - - The chassis - type. Currently, the following chassis - types are defined: - desktop, - laptop, - server, - tablet, - handset, - watch, as well as - the special chassis types - vm and - container for - virtualized systems that lack an - immediate physical chassis. Note that - many systems allow detection of the - chassis type automatically (based on - firmware information or - suchlike). This setting (if set) shall - take precedence over automatically - detected information and is useful to - override misdetected configuration or - to manually configure the chassis type - where automatic detection is not - available. - - - - DEPLOYMENT= - - Describes the system - deployment environment. One of the - following is suggested: - development, - integration, - staging, - production. - - - - - LOCATION= - - Describes the system - location if applicable and - known. Takes a human-friendly, - free-form string. This may be as - generic as Berlin, - Germany or as specific as - Left Rack, 2nd - Shelf. - - - - - - Example - - PRETTY_HOSTNAME="Lennart's Tablet" + + machine-info + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + machine-info + 5 + + + + machine-info + Local machine information file + + + + /etc/machine-info + + + + Description + + The /etc/machine-info file contains + machine metadata. + + The basic file format of machine-info + is a newline-separated list of environment-like shell-compatible + variable assignments. It is possible to source the configuration + from shell scripts, however, beyond mere variable assignments no + shell features are supported, allowing applications to read the + file without implementing a shell compatible execution + engine. + + /etc/machine-info contains metadata + about the machine that is set by the user or administrator. + + Depending on the operating system other configuration files + might be checked for machine information as well, however only as + fallback. + + You may use + hostnamectl1 + to change the settings of this file from the command line. + + + + Options + + The following machine metadata parameters may be set using + /etc/machine-info: + + + + + PRETTY_HOSTNAME= + + A pretty human-readable UTF-8 machine + identifier string. This should contain a name like + Lennart's Laptop which is useful to present + to the user and does not suffer by the syntax limitations of + internet domain names. If possible, the internet hostname as + configured in /etc/hostname should be + kept similar to this one. Example: if this value is + Lennart's Computer an Internet hostname of + lennarts-computer might be a good choice. + If this parameter is not set, an application should fall back + to the Internet host name for presentation + purposes. + + + + ICON_NAME= + + An icon identifying this machine according to + the XDG + Icon Naming Specification. If this parameter is not + set, an application should fall back to + computer or a similar icon + name. + + + + CHASSIS= + + The chassis type. Currently, the following + chassis types are defined: + desktop, + laptop, + server, + tablet, + handset, + watch, and + embedded + as well as the special chassis types + vm and + container for + virtualized systems that lack an immediate physical chassis. + Note that many systems allow detection of the chassis type + automatically (based on firmware information or suchlike). + This setting (if set) shall take precedence over automatically + detected information and is useful to override misdetected + configuration or to manually configure the chassis type where + automatic detection is not available. + + + + DEPLOYMENT= + + Describes the system deployment environment. + One of the following is suggested: + development, + integration, + staging, + production. + + + + + LOCATION= + + Describes the system location if applicable + and known. Takes a human-friendly, free-form string. This may + be as generic as Berlin, Germany or as + specific as Left Rack, 2nd Shelf. + + + + + + + Example + + PRETTY_HOSTNAME="Lennart's Tablet" ICON_NAME=computer-tablet CHASSIS=tablet DEPLOYMENT=production - - - - See Also - - systemd1, - os-release5, - hostname5, - machine-id5, - hostnamectl1, - systemd-hostnamed.service8 - - + + + + See Also + + systemd1, + os-release5, + hostname5, + machine-id5, + hostnamectl1, + systemd-hostnamed.service8 + + diff --git a/man/machinectl.1 b/man/machinectl.1 index a13a2d50c..d93fc19a9 100644 --- a/man/machinectl.1 +++ b/man/machinectl.1 @@ -1,5 +1,5 @@ '\" t -.TH "MACHINECTL" "1" "" "systemd 218" "machinectl" +.TH "MACHINECTL" "1" "" "systemd 219" "machinectl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,13 +37,15 @@ The following options are understood: .PP \fB\-p\fR, \fB\-\-property=\fR .RS 4 -When showing machine properties, limit the output to certain properties as specified by the argument\&. If not specified, all set properties are shown\&. The argument should be a property name, such as +When showing machine or image properties, limit the output to certain properties as specified by the argument\&. If not specified, all set properties are shown\&. The argument should be a property name, such as "Name"\&. If specified more than once, all properties with the specified names are shown\&. .RE .PP \fB\-a\fR, \fB\-\-all\fR .RS 4 -When showing machine properties, show all properties regardless of whether they are set or not\&. +When showing machine or image properties, show all properties regardless of whether they are set or not\&. +.sp +When listing VM or container images, do not suppress images beginning in a dot character ("\&.")\&. .RE .PP \fB\-l\fR, \fB\-\-full\fR @@ -51,6 +53,11 @@ When showing machine properties, show all properties regardless of whether they Do not ellipsize process tree entries\&. .RE .PP +\fB\-\-no\-ask\-password\fR +.RS 4 +Do not query the user for authentication for privileged operations\&. +.RE +.PP \fB\-\-kill\-who=\fR .RS 4 When used with @@ -72,9 +79,66 @@ or \fBSIGTERM\fR\&. .RE .PP -\fB\-\-no\-legend\fR +\fB\-\-mkdir\fR +.RS 4 +When used with +\fBbind\fR +creates the destination directory before applying the bind mount\&. +.RE +.PP +\fB\-\-read\-only\fR +.RS 4 +When used with +\fBbind\fR +applies a read\-only bind mount\&. +.RE +.PP +\fB\-n\fR, \fB\-\-lines=\fR +.RS 4 +When used with +\fBstatus\fR, controls the number of journal lines to show, counting from the most recent ones\&. Takes a positive integer argument\&. Defaults to 10\&. +.RE +.PP +\fB\-o\fR, \fB\-\-output=\fR .RS 4 -Do not print the legend, i\&.e\&. the column headers and the footer\&. +When used with +\fBstatus\fR, controls the formatting of the journal entries that are shown\&. For the available choices, see +\fBjournalctl\fR(1)\&. Defaults to +"short"\&. +.RE +.PP +\fB\-\-verify=\fR +.RS 4 +When downloading a container or VM image, specify whether the image shall be verified before it is made available\&. Takes one of +"no", +"checksum" +and +"signature"\&. If +"no" +no verification is done\&. If +"checksum" +is specified the download is checked for integrity after transfer is complete, but no signatures are verified\&. If +"signature" +is specified, the checksum is verified and the images\*(Aqs signature is checked against a local keyring of trustable vendors\&. It is strongly recommended to set this option to +"signature" +if the server and protocol support this\&. Defaults to +"signature"\&. +.RE +.PP +\fB\-\-force\fR +.RS 4 +When downloading a container or VM image, and a local copy by the specified local machine name already exists, delete it first and replace it by the newly downloaded image\&. +.RE +.PP +\fB\-\-dkr\-index\-url\fR +.RS 4 +Specifies the index server to use for downloading +"dkr" +images with the +\fBpull\-dkr\fR\&. Takes a +"http://", +"https://" +URL\&. .RE .PP \fB\-H\fR, \fB\-\-host=\fR @@ -90,6 +154,16 @@ Execute the operation remotely\&. Specify a hostname, or a username and hostname Execute operation on a local container\&. Specify a container name to connect to\&. .RE .PP +\fB\-\-no\-pager\fR +.RS 4 +Do not pipe output into a pager\&. +.RE +.PP +\fB\-\-no\-legend\fR +.RS 4 +Do not print the legend, i\&.e\&. column headers and the footer with hints\&. +.RE +.PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help text and exit\&. @@ -99,29 +173,28 @@ Print a short help text and exit\&. .RS 4 Print a short version string and exit\&. .RE -.PP -\fB\-\-no\-pager\fR -.RS 4 -Do not pipe output into a pager\&. -.RE +.SH "COMMANDS" .PP The following commands are understood: +.SS "Machine Commands" .PP \fBlist\fR .RS 4 -List currently running virtual machines and containers\&. +List currently running (online) virtual machines and containers\&. To enumerate container images that can be started, use +\fBlist\-images\fR +(see below)\&. .RE .PP -\fBstatus\fR \fIID\fR\&.\&.\&. +\fBstatus\fR \fINAME\fR\&.\&.\&. .RS 4 -Show terse runtime status information about one or more virtual machines and containers\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use +Show terse runtime status information about one or more virtual machines and containers, followed by the most recent log data from the journal\&. This function is intended to generate human\-readable output\&. If you are looking for computer\-parsable output, use \fBshow\fR -instead\&. +instead\&. Note that the log data shown is reported by the virtual machine or container manager, and frequently contains console output of the machine, but not necessarily journal contents of the machine itself\&. .RE .PP -\fBshow\fR \fIID\fR\&.\&.\&. +\fBshow\fR \fINAME\fR\&.\&.\&. .RS 4 -Show properties of one or more registered virtual machines or containers or the manager itself\&. If no argument is specified, properties of the manager will be shown\&. If an ID is specified, properties of this virtual machine or container are shown\&. By default, empty properties are suppressed\&. Use +Show properties of one or more registered virtual machines or containers or the manager itself\&. If no argument is specified, properties of the manager will be shown\&. If an NAME is specified, properties of this virtual machine or container are shown\&. By default, empty properties are suppressed\&. Use \fB\-\-all\fR to show those too\&. To select specific properties to show, use \fB\-\-property=\fR\&. This command is intended to be used whenever computer\-parsable output is required\&. Use @@ -129,25 +202,80 @@ to show those too\&. To select specific properties to show, use if you are looking for formatted human\-readable output\&. .RE .PP -\fBlogin\fR \fIID\fR +\fBstart\fR \fINAME\fR\&.\&.\&. .RS 4 -Open a terminal login session to a container\&. This will create a TTY connection to a specific container and asks for the execution of a getty on it\&. Note that this is only supported for containers running +Start a container as a system service, using +\fBsystemd-nspawn\fR(1)\&. This starts +systemd\-nspawn@\&.service, instantiated for the specified machine name, similar to the effect of +\fBsystemctl start\fR +on the service name\&. +\fBsystemd\-nspawn\fR +looks for a container image by the specified name in +/var/lib/machines/ +(and other search paths, see below) and runs it\&. Use +\fBlist\-images\fR +(see below), for listing available container images to start\&. +.sp +Note that +\fBsystemd-machined.service\fR(8) +also interfaces with a variety of other container and VM managers, +\fBsystemd\-nspawn\fR +is just one implementation of it\&. Most of the commands available in +\fBmachinectl\fR +may be used on containers or VMs controlled by other managers, not just +\fBsystemd\-nspawn\fR\&. Starting VMs and container images on those managers requires manager\-specific tools\&. +.sp +To interactively start a container on the command line with full access to the container\*(Aqs console, please invoke +\fBsystemd\-nspawn\fR +directly\&. To stop a running container use +\fBmachinectl poweroff\fR, see below\&. +.RE +.PP +\fBlogin\fR \fINAME\fR +.RS 4 +Open an interactive terminal login session to a container\&. This will create a TTY connection to a specific container and asks for the execution of a getty on it\&. Note that this is only supported for containers running \fBsystemd\fR(1) as init system\&. +.sp +This command will open a full login prompt on the container, which then asks for username and password\&. Use +\fBsystemd-run\fR(1) +with the +\fB\-\-machine=\fR +switch to invoke a single command, either interactively or in the background within a local container\&. .RE .PP -\fBreboot\fR \fIID\fR\&.\&.\&. +\fBenable\fR \fINAME\fR\&.\&.\&., \fBdisable\fR \fINAME\fR\&.\&.\&. .RS 4 -Reboot one or more containers\&. This will trigger a reboot by sending SIGINT to the container\*(Aqs init process, which is roughly equivalent to pressing Ctrl+Alt+Del on a non\-containerized system, and is compatible with containers running any init system\&. +Enable or disable a container as a system service to start at system boot, using +\fBsystemd-nspawn\fR(1)\&. This enables or disables +systemd\-nspawn@\&.service, instantiated for the specified machine name, similar to the effect of +\fBsystemctl enable\fR +or +\fBsystemctl disable\fR +on the service name\&. .RE .PP -\fBpoweroff\fR \fIID\fR\&.\&.\&. +\fBpoweroff\fR \fINAME\fR\&.\&.\&. .RS 4 Power off one or more containers\&. This will trigger a reboot by sending SIGRTMIN+4 to the container\*(Aqs init process, which causes systemd\-compatible init systems to shut down cleanly\&. This operation does not work on containers that do not run a -\fBsystemd\fR(1)\-compatible init system, such as sysvinit\&. +\fBsystemd\fR(1)\-compatible init system, such as sysvinit\&. Use +\fBterminate\fR +(see below) to immediately terminate a container or VM, without cleanly shutting it down\&. +.RE +.PP +\fBreboot\fR \fINAME\fR\&.\&.\&. +.RS 4 +Reboot one or more containers\&. This will trigger a reboot by sending SIGINT to the container\*(Aqs init process, which is roughly equivalent to pressing Ctrl+Alt+Del on a non\-containerized system, and is compatible with containers running any system manager\&. .RE .PP -\fBkill\fR \fIID\fR\&.\&.\&. +\fBterminate\fR \fINAME\fR\&.\&.\&. +.RS 4 +Immediately terminates a virtual machine or container, without cleanly shutting it down\&. This kills all processes of the virtual machine or container and deallocates all resources attached to that instance\&. Use +\fBpoweroff\fR +to issue a clean shutdown request\&. +.RE +.PP +\fBkill\fR \fINAME\fR\&.\&.\&. .RS 4 Send a signal to one or more processes of the virtual machine or container\&. This means processes as seen by the host, not the processes inside the virtual machine or container\&. Use \fB\-\-kill\-who=\fR @@ -156,10 +284,329 @@ to select which process to kill\&. Use to select the signal to send\&. .RE .PP -\fBterminate\fR \fIID\fR\&.\&.\&. +\fBbind\fR \fINAME\fR \fIPATH\fR [\fIPATH\fR] +.RS 4 +Bind mounts a directory from the host into the specified container\&. The first directory argument is the source directory on the host, the second directory argument the source directory on the host\&. When the latter is omitted the destination path in the container is the same as the source path on the host\&. When combined with the +\fB\-\-read\-only\fR +switch a ready\-only bind mount is created\&. When combined with the +\fB\-\-mkdir\fR +switch the destination path is first created before the mount is applied\&. Note that this option is currently only supported for +\fBsystemd-nspawn\fR(1) +containers\&. +.RE +.PP +\fBcopy\-to\fR \fINAME\fR \fIPATH\fR [\fIPATH\fR] +.RS 4 +Copies files or directories from the host system into a running container\&. Takes a container name, followed by the source path on the host and the destination path in the container\&. If the destination path is omitted the same as the source path is used\&. +.RE +.PP +\fBcopy\-from\fR \fINAME\fR \fIPATH\fR [\fIPATH\fR] +.RS 4 +Copies files or directories from a container into the host system\&. Takes a container name, followed by the source path in the container the destination path on the host\&. If the destination path is omitted the same as the source path is used\&. +.RE +.SS "Image Commands" +.PP +\fBlist\-images\fR +.RS 4 +Show a list of locally installed container and VM images\&. This enumerates all raw disk images and container directories and subvolumes in +/var/lib/machines/ +(and other search paths, see below)\&. Use +\fBstart\fR +(see above) to run a container off one of the listed images\&. Note that by default containers whose name begins with a dot ("\&.") are not shown\&. To show these too, specify +\fB\-\-all\fR\&. Note that a special image +"\&.host" +always implicitly exists and refers to the image the host itself is booted from\&. +.RE +.PP +\fBimage\-status\fR \fINAME\fR\&.\&.\&. .RS 4 -Terminates a virtual machine or container\&. This kills all processes of the virtual machine or container and deallocates all resources attached to that instance\&. +Show terse status information about one or more container or VM images\&. This function is intended to generate human\-readable output\&. Use +\fBshow\-image\fR +(see below) to generate computer\-parsable output instead\&. .RE +.PP +\fBshow\-image\fR \fINAME\fR\&.\&.\&. +.RS 4 +Show properties of one or more registered virtual machine or container images, or the manager itself\&. If no argument is specified, properties of the manager will be shown\&. If an NAME is specified, properties of this virtual machine or container image are shown\&. By default, empty properties are suppressed\&. Use +\fB\-\-all\fR +to show those too\&. To select specific properties to show, use +\fB\-\-property=\fR\&. This command is intended to be used whenever computer\-parsable output is required\&. Use +\fBimage\-status\fR +if you are looking for formatted human\-readable output\&. +.RE +.PP +\fBclone\fR \fINAME\fR \fINAME\fR +.RS 4 +Clones a container or disk image\&. The arguments specify the name of the image to clone and the name of the newly cloned image\&. Note that plain directory container images are cloned into subvolume images with this command\&. Note that cloning a container or VM image is optimized for btrfs file systems, and might not be efficient on others, due to file system limitations\&. +.RE +.PP +\fBrename\fR \fINAME\fR \fINAME\fR +.RS 4 +Renames a container or disk image\&. The arguments specify the name of the image to rename and the new name of the image\&. +.RE +.PP +\fBread\-only\fR \fINAME\fR [\fIBOOL\fR] +.RS 4 +Marks or (unmarks) a container or disk image read\-only\&. Takes a VM or container image name, followed by a boolean as arguments\&. If the boolean is omitted, positive is implied, i\&.e\&. the image is marked read\-only\&. +.RE +.PP +\fBremove\fR \fINAME\fR\&.\&.\&. +.RS 4 +Removes one or more container or disk images\&. The special image +"\&.host", which refers to the host\*(Aqs own directory tree may not be removed\&. +.RE +.SS "Image Transfer Commands" +.PP +\fBpull\-tar\fR \fIURL\fR [\fINAME\fR] +.RS 4 +Downloads a +\&.tar +container image from the specified URL, and makes it available under the specified local machine name\&. The URL must be of type +"http://" +or +"https://", and must refer to a +\&.tar, +\&.tar\&.gz, +\&.tar\&.xz +or +\&.tar\&.bz2 +archive file\&. If the local machine name is omitted the name it is automatically derived from the last component of the URL, with its suffix removed\&. +.sp +The image is verified before it is made available, unless +\fB\-\-verify=no\fR +is specified\&. Verification is done via SHA256SUMS and SHA256SUMS\&.gpg files, that need to be made available on the same web server, under the same URL as the +\&.tar +file, but with the last component (the filename) of the URL replaced\&. With +\fB\-\-verify=checksum\fR +only the SHA256 checksum for the file is verified, based on the +SHA256SUMS +file\&. With +\fB\-\-verify=signature\fR +the SHA256SUMS file is first verified with detached GPG signature file +SHA256SUMS\&.gpg\&. The public key for this verification step needs to be available in +/usr/lib/systemd/import\-pubring\&.gpg +or +/etc/systemd/import\-pubring\&.gpg\&. +.sp +The container image will be downloaded and stored in a read\-only subvolume in +/var/lib/machines/, that is named after the specified URL and its HTTP etag\&. A writable snapshot is then taken from this subvolume, and named after the specified local name\&. This behaviour ensures that creating multiple container instances of the same URL is efficient, as multiple downloads are not necessary\&. In order to create only the read\-only image, and avoid creating its writable snapshot, specify +"\-" +as local machine name\&. +.sp +Note that the read\-only subvolume is prefixed with +\&.tar\-, and is thus now shown by +\fBlist\-images\fR, unless +\fB\-\-all\fR +is passed\&. +.sp +Note that pressing C\-c during execution of this command will not abort the download\&. Use +\fBcancel\-transfer\fR, described below\&. +.RE +.PP +\fBpull\-raw\fR \fIURL\fR [\fINAME\fR] +.RS 4 +Downloads a +\&.raw +container or VM disk image from the specified URL, and makes it available under the specified local machine name\&. The URL must be of type +"http://" +or +"https://"\&. The container image must either be a +\&.qcow2 +or raw disk image, optionally compressed as +\&.gz, +\&.xz, or +\&.bz2\&. If the local machine name is omitted the name it is automatically derived from the last component of the URL, with its suffix removed\&. +.sp +Image verification is identical for raw and tar images (see above)\&. +.sp +If the the downloaded image is in +\&.qcow2 +format it es converted into a raw image file before it is made available\&. +.sp +Downloaded images of this type will be placed as read\-only +\&.raw +file in +/var/lib/machines/\&. A local, writable (reflinked) copy is then made under the specified local machine name\&. To omit creation of the local, writable copy pass +"\-" +as local machine name\&. +.sp +Similar to the behaviour of +\fBpull\-tar\fR, the read\-only image is prefixed with +\&.raw\-, and thus now shown by +\fBlist\-images\fR, unless +\fB\-\-all\fR +is passed\&. +.sp +Note that pressing C\-c during execution of this command will not abort the download\&. Use +\fBcancel\-transfer\fR, described below\&. +.RE +.PP +\fBpull\-dkr\fR \fIREMOTE\fR [\fINAME\fR] +.RS 4 +Downloads a +"dkr" +container image and makes it available locally\&. The remote name refers to a +"dkr" +container name\&. If omitted, the local machine name is derived from the +"dkr" +container name\&. +.sp +Image verification is not available for +"dkr" +containers, and thus +\fB\-\-verify=no\fR +must always be specified with this command\&. +.sp +This command downloads all (missing) layers for the specified container and places them in read\-only subvolumes in +/var/lib/machines/\&. A writable snapshot of the newest layer is then created under the specified local machine name\&. To omit creation of this writable snapshot, pass +"\-" +as local machine name\&. +.sp +The read\-only layer subvolumes are prefixed with +\&.dkr\-, and thus now shown by +\fBlist\-images\fR, unless +\fB\-\-all\fR +is passed\&. +.sp +To specify the +"dkr" +index server to use for looking up the specified container, use +\fB\-\-dkr\-index\-url=\fR\&. +.sp +Note that pressing C\-c during execution of this command will not abort the download\&. Use +\fBcancel\-transfer\fR, described below\&. +.RE +.PP +\fBlist\-transfers\fR +.RS 4 +Shows a list of container or VM image downloads that are currently in progress\&. +.RE +.PP +\fBcancel\-transfers\fR \fIID\fR\&.\&.\&. +.RS 4 +Aborts download of the container or VM image with the specified ID\&. To list ongoing transfers and their IDs, use +\fBlist\-transfers\fR\&. +.RE +.SH "FILES AND DIRECTORIES" +.PP +Machine images are preferably stored in +/var/lib/machines/, but are also searched for in +/usr/local/lib/machines/ +and +/usr/lib/machines/\&. For compatibility reasons the directory +/var/lib/container/ +is searched, too\&. Note that images stored below +/usr +are always considered read\-only\&. It is possible to symlink machines images from other directories into +/var/lib/machines/ +to make them available for control with +\fBmachinectl\fR\&. +.PP +Disk images are understood by +\fBsystemd-nspawn\fR(1) +and +\fBmachinectl\fR +in three formats: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A simple directory tree, containing the files and directories of the container to boot\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A subvolume (on btrfs file systems), which are similar to the simple directories, described above\&. However, they have additional benefits, such as efficient cloning and quota reporting\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +"Raw" disk images, i\&.e\&. binary images of disks with a GPT or MBR partition table\&. Images of this type are regular files with the suffix +"\&.raw"\&. +.RE +.PP +See +\fBsystemd-nspawn\fR(1) +for more information on image formats, in particular it\*(Aqs +\fB\-\-directory=\fR +and +\fB\-\-image=\fR +options\&. +.SH "EXAMPLES" +.PP +\fBExample\ \&1.\ \&Download an Ubuntu image and open a shell in it\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +# machinectl pull\-tar https://cloud\-images\&.ubuntu\&.com/trusty/current/trusty\-server\-cloudimg\-amd64\-root\&.tar\&.gz +# systemd\-nspawn \-M trusty\-server\-cloudimg\-amd64\-root +.fi +.if n \{\ +.RE +.\} +.PP +This downloads and verifies the specified +\&.tar +image, and then uses +\fBsystemd-nspawn\fR(1) +to open a shell in it\&. +.PP +\fBExample\ \&2.\ \&Download a Fedora image, set a root password in it, start it as service\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +# machinectl pull\-raw \-\-verify=no + http://ftp\&.halifax\&.rwth\-aachen\&.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora\-Cloud\-Base\-20141203\-21\&.x86_64\&.raw\&.xz + # systemd\-nspawn \-M Fedora\-Cloud\-Base\-20141203\-21 # passwd # + exit # machinectl start Fedora\-Cloud\-Base\-20141203\-21 # + machinectl login Fedora\-Cloud\-Base\-20141203\-21 +.fi +.if n \{\ +.RE +.\} +.PP +This downloads the specified +\&.raw +image with verification disabled\&. Then a shell is opened in it and a root password is set\&. Afterwards the shell is left, and the machine started as system service\&. With the last command a login prompt into the container is requested\&. +.PP +\fBExample\ \&3.\ \&Download a Fedora "dkr" image\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +# machinectl pull\-dkr \-\-verify=no mattdm/fedora +# systemd\-nspawn \-M fedora +.fi +.if n \{\ +.RE +.\} +.PP +Downloads a +"dkr" +image and opens a shell in it\&. Note that the specified download command might require an index server to be specified with the +"\-\-dkr\-index\-url="\&. .SH "EXIT STATUS" .PP On success, 0 is returned, a non\-zero failure code otherwise\&. diff --git a/man/machinectl.html b/man/machinectl.html index 6f4be6261..441eb7f66 100644 --- a/man/machinectl.html +++ b/man/machinectl.html @@ -19,43 +19,62 @@ Directives · Python · libudev · - gudev systemd 218

Name

machinectl — Control the systemd machine manager

Synopsis

machinectl [OPTIONS...] {COMMAND} [NAME...]

Description¶

machinectl may be used to - introspect and control the state of the - systemd(1) - virtual machine and container registration manager systemd-machined.service(8).

Options¶

The following options are understood:

-p, --property=¶

When showing - machine properties, limit the - output to certain properties as - specified by the argument. If not - specified, all set properties are - shown. The argument should be a - property name, such as - "Name". If - specified more than once, all - properties with the specified names - are shown.

-a, --all¶

When showing - machine properties, show all - properties regardless of whether they are - set or not.

-l, --full¶

Do not ellipsize - process tree entries.

--kill-who=¶

When used with - kill, - choose which processes to kill. Must - be one of leader, or - all to select whether - to kill only the leader process of the - machine or all processes of the - machine. If omitted, defaults to - all.

-s, --signal=¶

When used with - kill, choose - which signal to send to selected - processes. Must be one of the - well-known signal specifiers, such as - SIGTERM, - SIGINT or - SIGSTOP. If - omitted, defaults to - SIGTERM.

--no-legend¶

Do not print the legend, - i.e. the column headers and the - footer.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

machinectl — Control the systemd machine manager

Synopsis

machinectl [OPTIONS...] {COMMAND} [NAME...]

Description¶

machinectl may be used to introspect and + control the state of the + systemd(1) + virtual machine and container registration manager + systemd-machined.service(8).

Options¶

The following options are understood:

-p, --property=¶

When showing machine or image properties, + limit the output to certain properties as specified by the + argument. If not specified, all set properties are shown. The + argument should be a property name, such as + "Name". If specified more than once, all + properties with the specified names are + shown.

-a, --all¶

When showing machine or image properties, show + all properties regardless of whether they are set or + not.

When listing VM or container images, do not suppress + images beginning in a dot character + (".").

-l, --full¶

Do not ellipsize process tree entries.

--no-ask-password¶

Do not query the user for authentication for + privileged operations.

--kill-who=¶

When used with kill, choose + which processes to kill. Must be one of + leader, or all to select + whether to kill only the leader process of the machine or all + processes of the machine. If omitted, defaults to + all.

-s, --signal=¶

When used with kill, choose + which signal to send to selected processes. Must be one of the + well-known signal specifiers, such as + SIGTERM, SIGINT or + SIGSTOP. If omitted, defaults to + SIGTERM.

--mkdir¶

When used with bind creates + the destination directory before applying the bind + mount.

--read-only¶

When used with bind applies + a read-only bind mount.

-n, --lines=¶

When used with status, + controls the number of journal lines to show, counting from + the most recent ones. Takes a positive integer argument. + Defaults to 10.

-o, --output=¶

When used with status, + controls the formatting of the journal entries that are shown. + For the available choices, see + journalctl(1). + Defaults to "short".

--verify=¶

When downloading a container or VM image, + specify whether the image shall be verified before it is made + available. Takes one of "no", + "checksum" and "signature". + If "no" no verification is done. If + "checksum" is specified the download is + checked for integrity after transfer is complete, but no + signatures are verified. If "signature" is + specified, the checksum is verified and the images's signature + is checked against a local keyring of trustable vendors. It is + strongly recommended to set this option to + "signature" if the server and protocol + support this. Defaults to + "signature".

--force¶

When downloading a container or VM image, and + a local copy by the specified local machine name already + exists, delete it first and replace it by the newly downloaded + image.

--dkr-index-url¶

Specifies the index server to use for + downloading "dkr" images with the + pull-dkr. Takes a + "http://", "https://" + URL.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -64,74 +83,277 @@ instance. Container names may be enumerated with machinectl -H HOST.

-M, --machine=¶

Execute operation on a local container. Specify a - container name to connect to.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

list¶

List currently running - virtual machines and containers. -

status ID...¶

Show terse runtime - status information about one or more - virtual machines and containers. This - function is intended to generate - human-readable output. If you are - looking for computer-parsable output, - use show instead. -

show ID...¶

Show properties of one - or more registered virtual machines or - containers or the manager itself. If - no argument is specified, properties - of the manager will be shown. If an - ID is specified, properties of this - virtual machine or container are - shown. By default, empty properties - are suppressed. Use - --all to show those - too. To select specific properties to - show, use - --property=. This - command is intended to be used - whenever computer-parsable output is - required. Use - status if you are - looking for formatted human-readable - output.

login ID¶

Open a terminal login - session to a container. This will - create a TTY connection to a specific - container and asks for the execution of a - getty on it. Note that this is only - supported for containers running - systemd(1) - as init system.

reboot ID...¶

Reboot one or more - containers. This will trigger a reboot - by sending SIGINT to the container's - init process, which is roughly - equivalent to pressing Ctrl+Alt+Del on - a non-containerized system, and is - compatible with containers running any - init system.

poweroff ID...¶

Power off one or more - containers. This will trigger a reboot - by sending SIGRTMIN+4 to the - container's init process, which causes - systemd-compatible init systems to - shut down cleanly. This operation does - not work on containers that do not run - a - systemd(1)-compatible - init system, such as - sysvinit.

kill ID...¶

Send a signal to one - or more processes of the virtual - machine or container. This means - processes as seen by the host, not the - processes inside the virtual machine - or container. - Use --kill-who= to - select which process to kill. Use - --signal= to select - the signal to send.

terminate ID...¶

Terminates a virtual - machine or container. This kills all - processes of the virtual machine or - container and deallocates all - resources attached to that - instance.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when + container name to connect to.

--no-pager¶

Do not pipe output into a pager.

--no-legend¶

Do not print the legend, i.e. column headers and the + footer with hints.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Commands¶

The following commands are understood:

Machine Commands¶

list¶

List currently running (online) virtual + machines and containers. To enumerate container images that + can be started, use list-images (see + below).

status NAME...¶

Show terse runtime status information about + one or more virtual machines and containers, followed by the + most recent log data from the journal. This function is + intended to generate human-readable output. If you are looking + for computer-parsable output, use show + instead. Note that the log data shown is reported by the + virtual machine or container manager, and frequently contains + console output of the machine, but not necessarily journal + contents of the machine itself.

show NAME...¶

Show properties of one or more registered + virtual machines or containers or the manager itself. If no + argument is specified, properties of the manager will be + shown. If an NAME is specified, properties of this virtual + machine or container are shown. By default, empty properties + are suppressed. Use --all to show those too. + To select specific properties to show, use + --property=. This command is intended to be + used whenever computer-parsable output is required. Use + status if you are looking for formatted + human-readable output.

start NAME...¶

Start a container as a system service, using + systemd-nspawn(1). + This starts systemd-nspawn@.service, + instantiated for the specified machine name, similar to the + effect of systemctl start on the service + name. systemd-nspawn looks for a container + image by the specified name in + /var/lib/machines/ (and other search + paths, see below) and runs it. Use + list-images (see below), for listing + available container images to start.

Note that + systemd-machined.service(8) + also interfaces with a variety of other container and VM + managers, systemd-nspawn is just one + implementation of it. Most of the commands available in + machinectl may be used on containers or VMs + controlled by other managers, not just + systemd-nspawn. Starting VMs and container + images on those managers requires manager-specific + tools.

To interactively start a container on the command line + with full access to the container's console, please invoke + systemd-nspawn directly. To stop a running + container use machinectl poweroff, see + below.

login NAME¶

Open an interactive terminal login session to + a container. This will create a TTY connection to a specific + container and asks for the execution of a getty on it. Note + that this is only supported for containers running + systemd(1) + as init system.

This command will open a full login prompt on the + container, which then asks for username and password. Use + systemd-run(1) + with the --machine= switch to invoke a single + command, either interactively or in the background within a + local container.

enable NAME..., disable NAME...¶

Enable or disable a container as a system + service to start at system boot, using + systemd-nspawn(1). + This enables or disables + systemd-nspawn@.service, instantiated for + the specified machine name, similar to the effect of + systemctl enable or systemctl + disable on the service name.

poweroff NAME...¶

Power off one or more containers. This will + trigger a reboot by sending SIGRTMIN+4 to the container's init + process, which causes systemd-compatible init systems to shut + down cleanly. This operation does not work on containers that + do not run a + systemd(1)-compatible + init system, such as sysvinit. Use + terminate (see below) to immediately + terminate a container or VM, without cleanly shutting it + down.

reboot NAME...¶

Reboot one or more containers. This will + trigger a reboot by sending SIGINT to the container's init + process, which is roughly equivalent to pressing Ctrl+Alt+Del + on a non-containerized system, and is compatible with + containers running any system manager.

terminate NAME...¶

Immediately terminates a virtual machine or + container, without cleanly shutting it down. This kills all + processes of the virtual machine or container and deallocates + all resources attached to that instance. Use + poweroff to issue a clean shutdown + request.

kill NAME...¶

Send a signal to one or more processes of the + virtual machine or container. This means processes as seen by + the host, not the processes inside the virtual machine or + container. Use --kill-who= to select which + process to kill. Use --signal= to select the + signal to send.

bind NAME PATH [PATH]¶

Bind mounts a directory from the host into the + specified container. The first directory argument is the + source directory on the host, the second directory argument + the source directory on the host. When the latter is omitted + the destination path in the container is the same as the + source path on the host. When combined with the + --read-only switch a ready-only bind mount is + created. When combined with the --mkdir + switch the destination path is first created before the mount + is applied. Note that this option is currently only supported + for + systemd-nspawn(1) + containers.

copy-to NAME PATH [PATH]¶

Copies files or directories from the host + system into a running container. Takes a container name, + followed by the source path on the host and the destination + path in the container. If the destination path is omitted the + same as the source path is used.

copy-from NAME PATH [PATH]¶

Copies files or directories from a container + into the host system. Takes a container name, followed by the + source path in the container the destination path on the host. + If the destination path is omitted the same as the source path + is used.

Image Commands¶

list-images¶

Show a list of locally installed container and + VM images. This enumerates all raw disk images and container + directories and subvolumes in + /var/lib/machines/ (and other search + paths, see below). Use start (see above) to + run a container off one of the listed images. Note that by + default containers whose name begins with a dot + (".") are not shown. To show these too, + specify --all. Note that a special image + ".host" always implicitly exists and refers + to the image the host itself is booted from.

image-status NAME...¶

Show terse status information about one or + more container or VM images. This function is intended to + generate human-readable output. Use + show-image (see below) to generate + computer-parsable output instead.

show-image NAME...¶

Show properties of one or more registered + virtual machine or container images, or the manager itself. If + no argument is specified, properties of the manager will be + shown. If an NAME is specified, properties of this virtual + machine or container image are shown. By default, empty + properties are suppressed. Use --all to show + those too. To select specific properties to show, use + --property=. This command is intended to be + used whenever computer-parsable output is required. Use + image-status if you are looking for + formatted human-readable output.

clone NAME NAME¶

Clones a container or disk image. The + arguments specify the name of the image to clone and the name + of the newly cloned image. Note that plain directory container + images are cloned into subvolume images with this command. + Note that cloning a container or VM image is optimized for + btrfs file systems, and might not be efficient on others, due + to file system limitations.

rename NAME NAME¶

Renames a container or disk image. The + arguments specify the name of the image to rename and the new + name of the image.

read-only NAME [BOOL]¶

Marks or (unmarks) a container or disk image + read-only. Takes a VM or container image name, followed by a + boolean as arguments. If the boolean is omitted, positive is + implied, i.e. the image is marked read-only.

remove NAME...¶

Removes one or more container or disk images. + The special image ".host", which refers to + the host's own directory tree may not be + removed.

Image Transfer Commands¶

pull-tar URL [NAME]¶

Downloads a .tar + container image from the specified URL, and makes it available + under the specified local machine name. The URL must be of + type "http://" or + "https://", and must refer to a + .tar, .tar.gz, + .tar.xz or .tar.bz2 + archive file. If the local machine name is omitted the name it + is automatically derived from the last component of the URL, + with its suffix removed.

The image is verified before it is made available, + unless --verify=no is specified. Verification + is done via SHA256SUMS and SHA256SUMS.gpg files, that need to + be made available on the same web server, under the same URL + as the .tar file, but with the last + component (the filename) of the URL replaced. With + --verify=checksum only the SHA256 checksum + for the file is verified, based on the + SHA256SUMS file. With + --verify=signature the SHA256SUMS file is + first verified with detached GPG signature file + SHA256SUMS.gpg. The public key for this + verification step needs to be available in + /usr/lib/systemd/import-pubring.gpg or + /etc/systemd/import-pubring.gpg.

The container image will be downloaded and stored in a + read-only subvolume in + /var/lib/machines/, that is named after + the specified URL and its HTTP etag. A writable snapshot is + then taken from this subvolume, and named after the specified + local name. This behaviour ensures that creating multiple + container instances of the same URL is efficient, as multiple + downloads are not necessary. In order to create only the + read-only image, and avoid creating its writable snapshot, + specify "-" as local machine name.

Note that the read-only subvolume is prefixed with + .tar-, and is thus now shown by + list-images, unless --all + is passed.

Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below.

pull-raw URL [NAME]¶

Downloads a .raw + container or VM disk image from the specified URL, and makes + it available under the specified local machine name. The URL + must be of type "http://" or + "https://". The container image must either + be a .qcow2 or raw disk image, optionally + compressed as .gz, + .xz, or .bz2. If the + local machine name is omitted the name it is automatically + derived from the last component of the URL, with its suffix + removed.

Image verification is identical for raw and tar images + (see above).

If the the downloaded image is in + .qcow2 format it es converted into a raw + image file before it is made available.

Downloaded images of this type will be placed as + read-only .raw file in + /var/lib/machines/. A local, writable + (reflinked) copy is then made under the specified local + machine name. To omit creation of the local, writable copy + pass "-" as local machine name.

Similar to the behaviour of pull-tar, + the read-only image is prefixed with + .raw-, and thus now shown by + list-images, unless --all + is passed.

Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below.

pull-dkr REMOTE [NAME]¶

Downloads a "dkr" container + image and makes it available locally. The remote name refers + to a "dkr" container name. If omitted, the + local machine name is derived from the "dkr" + container name.

Image verification is not available for + "dkr" containers, and thus + --verify=no must always be specified with + this command.

This command downloads all (missing) layers for the + specified container and places them in read-only subvolumes in + /var/lib/machines/. A writable snapshot + of the newest layer is then created under the specified local + machine name. To omit creation of this writable snapshot, pass + "-" as local machine name.

The read-only layer subvolumes are prefixed with + .dkr-, and thus now shown by + list-images, unless --all + is passed.

To specify the "dkr" index server to + use for looking up the specified container, use + --dkr-index-url=.

Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below.

list-transfers¶

Shows a list of container or VM image + downloads that are currently in progress.

cancel-transfers ID...¶

Aborts download of the container or VM image + with the specified ID. To list ongoing transfers and their + IDs, use list-transfers.

Files and Directories¶

Machine images are preferably stored in + /var/lib/machines/, but are also searched for + in /usr/local/lib/machines/ and + /usr/lib/machines/. For compatibility reasons + the directory /var/lib/container/ is + searched, too. Note that images stored below + /usr are always considered read-only. It is + possible to symlink machines images from other directories into + /var/lib/machines/ to make them available for + control with machinectl.

Disk images are understood by + systemd-nspawn(1) + and machinectl in three formats:

  • A simple directory tree, containing the files + and directories of the container to boot.

  • A subvolume (on btrfs file systems), which are + similar to the simple directories, described above. However, + they have additional benefits, such as efficient cloning and + quota reporting.

  • "Raw" disk images, i.e. binary images of disks + with a GPT or MBR partition table. Images of this type are + regular files with the suffix + ".raw".

See + systemd-nspawn(1) + for more information on image formats, in particular it's + --directory= and --image= + options.

Examples¶

Example 1. Download an Ubuntu image and open a shell in it

# machinectl pull-tar https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-root.tar.gz
+# systemd-nspawn -M trusty-server-cloudimg-amd64-root

This downloads and verifies the specified + .tar image, and then uses + systemd-nspawn(1) + to open a shell in it.


Example 2. Download a Fedora image, set a root password in it, start + it as service

# machinectl pull-raw --verify=no
+      http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
+      # systemd-nspawn -M Fedora-Cloud-Base-20141203-21 # passwd #
+      exit # machinectl start Fedora-Cloud-Base-20141203-21 #
+      machinectl login Fedora-Cloud-Base-20141203-21

This downloads the specified .raw + image with verification disabled. Then a shell is opened in it + and a root password is set. Afterwards the shell is left, and + the machine started as system service. With the last command a + login prompt into the container is requested.


Example 3. Download a Fedora "dkr" image

# machinectl pull-dkr --verify=no mattdm/fedora
+# systemd-nspawn -M fedora

Downloads a "dkr" image and opens a shell + in it. Note that the specified download command might require an + index server to be specified with the + "--dkr-index-url=".


Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -139,8 +361,8 @@ --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

+ ("FRSXMK").

diff --git a/man/machinectl.xml b/man/machinectl.xml index 2f2e2571f..9b07af422 100644 --- a/man/machinectl.xml +++ b/man/machinectl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - machinectl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - machinectl - 1 - - - - machinectl - Control the systemd machine manager - - - - - machinectl - OPTIONS - COMMAND - NAME - - - - - Description - - machinectl may be used to - introspect and control the state of the - systemd1 - virtual machine and container registration manager systemd-machined.service8. - - - - Options - - The following options are understood: - - - - - - - When showing - machine properties, limit the - output to certain properties as - specified by the argument. If not - specified, all set properties are - shown. The argument should be a - property name, such as - Name. If - specified more than once, all - properties with the specified names - are shown. - - - - - - - When showing - machine properties, show all - properties regardless of whether they are - set or not. - - - - - - - Do not ellipsize - process tree entries. - - - - - - - When used with - kill, - choose which processes to kill. Must - be one of , or - to select whether - to kill only the leader process of the - machine or all processes of the - machine. If omitted, defaults to - . - - - - - - - When used with - kill, choose - which signal to send to selected - processes. Must be one of the - well-known signal specifiers, such as - SIGTERM, - SIGINT or - SIGSTOP. If - omitted, defaults to - SIGTERM. - - - - - - Do not print the legend, - i.e. the column headers and the - footer. - - - - - - - - - - - The following commands are understood: - - - - list - - List currently running - virtual machines and containers. - - - - - status ID... - - Show terse runtime - status information about one or more - virtual machines and containers. This - function is intended to generate - human-readable output. If you are - looking for computer-parsable output, - use show instead. - - - - - show ID... - - Show properties of one - or more registered virtual machines or - containers or the manager itself. If - no argument is specified, properties - of the manager will be shown. If an - ID is specified, properties of this - virtual machine or container are - shown. By default, empty properties - are suppressed. Use - to show those - too. To select specific properties to - show, use - . This - command is intended to be used - whenever computer-parsable output is - required. Use - status if you are - looking for formatted human-readable - output. - - - - login ID - - Open a terminal login - session to a container. This will - create a TTY connection to a specific - container and asks for the execution of a - getty on it. Note that this is only - supported for containers running - systemd1 - as init system. - - - - reboot ID... - - Reboot one or more - containers. This will trigger a reboot - by sending SIGINT to the container's - init process, which is roughly - equivalent to pressing Ctrl+Alt+Del on - a non-containerized system, and is - compatible with containers running any - init system. - - - - poweroff ID... - - Power off one or more - containers. This will trigger a reboot - by sending SIGRTMIN+4 to the - container's init process, which causes - systemd-compatible init systems to - shut down cleanly. This operation does - not work on containers that do not run - a - systemd1-compatible - init system, such as - sysvinit. - - - - kill ID... - - Send a signal to one - or more processes of the virtual - machine or container. This means - processes as seen by the host, not the - processes inside the virtual machine - or container. - Use to - select which process to kill. Use - to select - the signal to send. - - - - terminate ID... - - Terminates a virtual - machine or container. This kills all - processes of the virtual machine or - container and deallocates all - resources attached to that - instance. - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - - - See Also - - systemd-machined.service8, - systemd-nspawn1, - systemd.special7 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + machinectl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + machinectl + 1 + + + + machinectl + Control the systemd machine manager + + + + + machinectl + OPTIONS + COMMAND + NAME + + + + + Description + + machinectl may be used to introspect and + control the state of the + systemd1 + virtual machine and container registration manager + systemd-machined.service8. + + + + Options + + The following options are understood: + + + + + + + When showing machine or image properties, + limit the output to certain properties as specified by the + argument. If not specified, all set properties are shown. The + argument should be a property name, such as + Name. If specified more than once, all + properties with the specified names are + shown. + + + + + + + When showing machine or image properties, show + all properties regardless of whether they are set or + not. + + When listing VM or container images, do not suppress + images beginning in a dot character + (.). + + + + + + + Do not ellipsize process tree entries. + + + + + + + Do not query the user for authentication for + privileged operations. + + + + + + When used with kill, choose + which processes to kill. Must be one of + , or to select + whether to kill only the leader process of the machine or all + processes of the machine. If omitted, defaults to + . + + + + + + + When used with kill, choose + which signal to send to selected processes. Must be one of the + well-known signal specifiers, such as + SIGTERM, SIGINT or + SIGSTOP. If omitted, defaults to + SIGTERM. + + + + + + When used with bind creates + the destination directory before applying the bind + mount. + + + + + + + When used with bind applies + a read-only bind mount. + + + + + + + + When used with status, + controls the number of journal lines to show, counting from + the most recent ones. Takes a positive integer argument. + Defaults to 10. + + + + + + + + When used with status, + controls the formatting of the journal entries that are shown. + For the available choices, see + journalctl1. + Defaults to short. + + + + + + When downloading a container or VM image, + specify whether the image shall be verified before it is made + available. Takes one of no, + checksum and signature. + If no no verification is done. If + checksum is specified the download is + checked for integrity after transfer is complete, but no + signatures are verified. If signature is + specified, the checksum is verified and the images's signature + is checked against a local keyring of trustable vendors. It is + strongly recommended to set this option to + signature if the server and protocol + support this. Defaults to + signature. + + + + + + When downloading a container or VM image, and + a local copy by the specified local machine name already + exists, delete it first and replace it by the newly downloaded + image. + + + + + + Specifies the index server to use for + downloading dkr images with the + pull-dkr. Takes a + http://, https:// + URL. + + + + + + + + + + + + + + Commands + + The following commands are understood: + + Machine Commands + + + list + + List currently running (online) virtual + machines and containers. To enumerate container images that + can be started, use list-images (see + below). + + + + status NAME... + + Show terse runtime status information about + one or more virtual machines and containers, followed by the + most recent log data from the journal. This function is + intended to generate human-readable output. If you are looking + for computer-parsable output, use show + instead. Note that the log data shown is reported by the + virtual machine or container manager, and frequently contains + console output of the machine, but not necessarily journal + contents of the machine itself. + + + + show NAME... + + Show properties of one or more registered + virtual machines or containers or the manager itself. If no + argument is specified, properties of the manager will be + shown. If an NAME is specified, properties of this virtual + machine or container are shown. By default, empty properties + are suppressed. Use to show those too. + To select specific properties to show, use + . This command is intended to be + used whenever computer-parsable output is required. Use + status if you are looking for formatted + human-readable output. + + + + start NAME... + + Start a container as a system service, using + systemd-nspawn1. + This starts systemd-nspawn@.service, + instantiated for the specified machine name, similar to the + effect of systemctl start on the service + name. systemd-nspawn looks for a container + image by the specified name in + /var/lib/machines/ (and other search + paths, see below) and runs it. Use + list-images (see below), for listing + available container images to start. + + Note that + systemd-machined.service8 + also interfaces with a variety of other container and VM + managers, systemd-nspawn is just one + implementation of it. Most of the commands available in + machinectl may be used on containers or VMs + controlled by other managers, not just + systemd-nspawn. Starting VMs and container + images on those managers requires manager-specific + tools. + + To interactively start a container on the command line + with full access to the container's console, please invoke + systemd-nspawn directly. To stop a running + container use machinectl poweroff, see + below. + + + + login NAME + + Open an interactive terminal login session to + a container. This will create a TTY connection to a specific + container and asks for the execution of a getty on it. Note + that this is only supported for containers running + systemd1 + as init system. + + This command will open a full login prompt on the + container, which then asks for username and password. Use + systemd-run1 + with the switch to invoke a single + command, either interactively or in the background within a + local container. + + + + enable NAME... + disable NAME... + + Enable or disable a container as a system + service to start at system boot, using + systemd-nspawn1. + This enables or disables + systemd-nspawn@.service, instantiated for + the specified machine name, similar to the effect of + systemctl enable or systemctl + disable on the service name. + + + + poweroff NAME... + + Power off one or more containers. This will + trigger a reboot by sending SIGRTMIN+4 to the container's init + process, which causes systemd-compatible init systems to shut + down cleanly. This operation does not work on containers that + do not run a + systemd1-compatible + init system, such as sysvinit. Use + terminate (see below) to immediately + terminate a container or VM, without cleanly shutting it + down. + + + + reboot NAME... + + Reboot one or more containers. This will + trigger a reboot by sending SIGINT to the container's init + process, which is roughly equivalent to pressing Ctrl+Alt+Del + on a non-containerized system, and is compatible with + containers running any system manager. + + + + terminate NAME... + + Immediately terminates a virtual machine or + container, without cleanly shutting it down. This kills all + processes of the virtual machine or container and deallocates + all resources attached to that instance. Use + poweroff to issue a clean shutdown + request. + + + + kill NAME... + + Send a signal to one or more processes of the + virtual machine or container. This means processes as seen by + the host, not the processes inside the virtual machine or + container. Use to select which + process to kill. Use to select the + signal to send. + + + + bind NAME PATH [PATH] + + Bind mounts a directory from the host into the + specified container. The first directory argument is the + source directory on the host, the second directory argument + the source directory on the host. When the latter is omitted + the destination path in the container is the same as the + source path on the host. When combined with the + switch a ready-only bind mount is + created. When combined with the + switch the destination path is first created before the mount + is applied. Note that this option is currently only supported + for + systemd-nspawn1 + containers. + + + + copy-to NAME PATH [PATH] + + Copies files or directories from the host + system into a running container. Takes a container name, + followed by the source path on the host and the destination + path in the container. If the destination path is omitted the + same as the source path is used. + + + + + copy-from NAME PATH [PATH] + + Copies files or directories from a container + into the host system. Takes a container name, followed by the + source path in the container the destination path on the host. + If the destination path is omitted the same as the source path + is used. + + + + Image Commands + + + list-images + + Show a list of locally installed container and + VM images. This enumerates all raw disk images and container + directories and subvolumes in + /var/lib/machines/ (and other search + paths, see below). Use start (see above) to + run a container off one of the listed images. Note that by + default containers whose name begins with a dot + (.) are not shown. To show these too, + specify . Note that a special image + .host always implicitly exists and refers + to the image the host itself is booted from. + + + + image-status NAME... + + Show terse status information about one or + more container or VM images. This function is intended to + generate human-readable output. Use + show-image (see below) to generate + computer-parsable output instead. + + + + show-image NAME... + + Show properties of one or more registered + virtual machine or container images, or the manager itself. If + no argument is specified, properties of the manager will be + shown. If an NAME is specified, properties of this virtual + machine or container image are shown. By default, empty + properties are suppressed. Use to show + those too. To select specific properties to show, use + . This command is intended to be + used whenever computer-parsable output is required. Use + image-status if you are looking for + formatted human-readable output. + + + + clone NAME NAME + + Clones a container or disk image. The + arguments specify the name of the image to clone and the name + of the newly cloned image. Note that plain directory container + images are cloned into subvolume images with this command. + Note that cloning a container or VM image is optimized for + btrfs file systems, and might not be efficient on others, due + to file system limitations. + + + + rename NAME NAME + + Renames a container or disk image. The + arguments specify the name of the image to rename and the new + name of the image. + + + + read-only NAME [BOOL] + + Marks or (unmarks) a container or disk image + read-only. Takes a VM or container image name, followed by a + boolean as arguments. If the boolean is omitted, positive is + implied, i.e. the image is marked read-only. + + + + + remove NAME... + + Removes one or more container or disk images. + The special image .host, which refers to + the host's own directory tree may not be + removed. + + + + + Image Transfer Commands + + + pull-tar URL [NAME] + + Downloads a .tar + container image from the specified URL, and makes it available + under the specified local machine name. The URL must be of + type http:// or + https://, and must refer to a + .tar, .tar.gz, + .tar.xz or .tar.bz2 + archive file. If the local machine name is omitted the name it + is automatically derived from the last component of the URL, + with its suffix removed. + + The image is verified before it is made available, + unless is specified. Verification + is done via SHA256SUMS and SHA256SUMS.gpg files, that need to + be made available on the same web server, under the same URL + as the .tar file, but with the last + component (the filename) of the URL replaced. With + only the SHA256 checksum + for the file is verified, based on the + SHA256SUMS file. With + the SHA256SUMS file is + first verified with detached GPG signature file + SHA256SUMS.gpg. The public key for this + verification step needs to be available in + /usr/lib/systemd/import-pubring.gpg or + /etc/systemd/import-pubring.gpg. + + The container image will be downloaded and stored in a + read-only subvolume in + /var/lib/machines/, that is named after + the specified URL and its HTTP etag. A writable snapshot is + then taken from this subvolume, and named after the specified + local name. This behaviour ensures that creating multiple + container instances of the same URL is efficient, as multiple + downloads are not necessary. In order to create only the + read-only image, and avoid creating its writable snapshot, + specify - as local machine name. + + Note that the read-only subvolume is prefixed with + .tar-, and is thus now shown by + list-images, unless + is passed. + + Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below. + + + + pull-raw URL [NAME] + + Downloads a .raw + container or VM disk image from the specified URL, and makes + it available under the specified local machine name. The URL + must be of type http:// or + https://. The container image must either + be a .qcow2 or raw disk image, optionally + compressed as .gz, + .xz, or .bz2. If the + local machine name is omitted the name it is automatically + derived from the last component of the URL, with its suffix + removed. + + Image verification is identical for raw and tar images + (see above). + + If the the downloaded image is in + .qcow2 format it es converted into a raw + image file before it is made available. + + Downloaded images of this type will be placed as + read-only .raw file in + /var/lib/machines/. A local, writable + (reflinked) copy is then made under the specified local + machine name. To omit creation of the local, writable copy + pass - as local machine name. + + Similar to the behaviour of pull-tar, + the read-only image is prefixed with + .raw-, and thus now shown by + list-images, unless + is passed. + + Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below. + + + + pull-dkr REMOTE [NAME] + + Downloads a dkr container + image and makes it available locally. The remote name refers + to a dkr container name. If omitted, the + local machine name is derived from the dkr + container name. + + Image verification is not available for + dkr containers, and thus + must always be specified with + this command. + + This command downloads all (missing) layers for the + specified container and places them in read-only subvolumes in + /var/lib/machines/. A writable snapshot + of the newest layer is then created under the specified local + machine name. To omit creation of this writable snapshot, pass + - as local machine name. + + The read-only layer subvolumes are prefixed with + .dkr-, and thus now shown by + list-images, unless + is passed. + + To specify the dkr index server to + use for looking up the specified container, use + . + + Note that pressing C-c during execution of this command + will not abort the download. Use + cancel-transfer, described + below. + + + + list-transfers + + Shows a list of container or VM image + downloads that are currently in progress. + + + + cancel-transfers ID... + + Aborts download of the container or VM image + with the specified ID. To list ongoing transfers and their + IDs, use list-transfers. + + + + + + + + Files and Directories + + Machine images are preferably stored in + /var/lib/machines/, but are also searched for + in /usr/local/lib/machines/ and + /usr/lib/machines/. For compatibility reasons + the directory /var/lib/container/ is + searched, too. Note that images stored below + /usr are always considered read-only. It is + possible to symlink machines images from other directories into + /var/lib/machines/ to make them available for + control with machinectl. + + Disk images are understood by + systemd-nspawn1 + and machinectl in three formats: + + + A simple directory tree, containing the files + and directories of the container to boot. + + A subvolume (on btrfs file systems), which are + similar to the simple directories, described above. However, + they have additional benefits, such as efficient cloning and + quota reporting. + + "Raw" disk images, i.e. binary images of disks + with a GPT or MBR partition table. Images of this type are + regular files with the suffix + .raw. + + + See + systemd-nspawn1 + for more information on image formats, in particular it's + and + options. + + + + Examples + + Download an Ubuntu image and open a shell in it + + # machinectl pull-tar https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-root.tar.gz +# systemd-nspawn -M trusty-server-cloudimg-amd64-root + + This downloads and verifies the specified + .tar image, and then uses + systemd-nspawn1 + to open a shell in it. + + + + Download a Fedora image, set a root password in it, start + it as service + + # machinectl pull-raw --verify=no + http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz + # systemd-nspawn -M Fedora-Cloud-Base-20141203-21 # passwd # + exit # machinectl start Fedora-Cloud-Base-20141203-21 # + machinectl login Fedora-Cloud-Base-20141203-21 + + This downloads the specified .raw + image with verification disabled. Then a shell is opened in it + and a root password is set. Afterwards the shell is left, and + the machine started as system service. With the last command a + login prompt into the container is requested. + + + + Download a Fedora <literal>dkr</literal> image + + # machinectl pull-dkr --verify=no mattdm/fedora +# systemd-nspawn -M fedora + + Downloads a dkr image and opens a shell + in it. Note that the specified download command might require an + index server to be specified with the + --dkr-index-url=. + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + + + See Also + + systemd-machined.service8, + systemd-nspawn1, + systemd.special7 + + diff --git a/man/modules-load.d.5 b/man/modules-load.d.5 index 22a0068cb..a4084c633 100644 --- a/man/modules-load.d.5 +++ b/man/modules-load.d.5 @@ -1,5 +1,5 @@ '\" t -.TH "MODULES\-LOAD\&.D" "5" "" "systemd 218" "modules-load.d" +.TH "MODULES\-LOAD\&.D" "5" "" "systemd 219" "modules-load.d" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/modules-load.d.html b/man/modules-load.d.html index d03d188a5..bfcf1c723 100644 --- a/man/modules-load.d.html +++ b/man/modules-load.d.html @@ -19,20 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

modules-load.d — Configure kernel modules to load at boot

Synopsis

/etc/modules-load.d/*.conf

/run/modules-load.d/*.conf

/usr/lib/modules-load.d/*.conf

Description¶

systemd-modules-load.service(8) - reads files from the above directories which contain - kernel modules to load during boot in a static list. - Each configuration file is named in the style of - /etc/modules-load.d/program.conf. Note - that it is usually a better idea to rely on the - automatic module loading by PCI IDs, USB IDs, DMI IDs - or similar triggers encoded in the kernel modules - themselves instead of static configuration like - this. In fact, most modern kernel modules are prepared - for automatic loading already.

Configuration Format¶

The configuration files should simply contain a - list of kernel module names to load, separated by - newlines. Empty lines and lines whose first - non-whitespace character is # or ; are ignored.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

modules-load.d — Configure kernel modules to load at boot

Synopsis

/etc/modules-load.d/*.conf

/run/modules-load.d/*.conf

/usr/lib/modules-load.d/*.conf

Description¶

systemd-modules-load.service(8) + reads files from the above directories which contain kernel + modules to load during boot in a static list. Each configuration + file is named in the style of + /etc/modules-load.d/program.conf. + Note that it is usually a better idea to rely on the automatic + module loading by PCI IDs, USB IDs, DMI IDs or similar triggers + encoded in the kernel modules themselves instead of static + configuration like this. In fact, most modern kernel modules are + prepared for automatic loading already.

Configuration Format¶

The configuration files should simply contain a list of + kernel module names to load, separated by newlines. Empty lines + and lines whose first non-whitespace character is # or ; are + ignored.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -52,10 +51,10 @@ the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor - configuration file.

Example¶

Example 1. /etc/modules-load.d/virtio-net.conf example:

# Load virtio-net.ko at boot
-virtio-net

+ configuration file.

Example¶

Example 1. /etc/modules-load.d/virtio-net.conf example:

# Load virtio-net.ko at boot
+virtio-net

diff --git a/man/modules-load.d.xml b/man/modules-load.d.xml index 4b578d714..34a937db6 100644 --- a/man/modules-load.d.xml +++ b/man/modules-load.d.xml @@ -20,83 +20,82 @@ along with systemd; If not, see . --> - - - modules-load.d - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - modules-load.d - 5 - - - - modules-load.d - Configure kernel modules to load at boot - - - - /etc/modules-load.d/*.conf - /run/modules-load.d/*.conf - /usr/lib/modules-load.d/*.conf - - - - Description - - systemd-modules-load.service8 - reads files from the above directories which contain - kernel modules to load during boot in a static list. - Each configuration file is named in the style of - /etc/modules-load.d/program.conf. Note - that it is usually a better idea to rely on the - automatic module loading by PCI IDs, USB IDs, DMI IDs - or similar triggers encoded in the kernel modules - themselves instead of static configuration like - this. In fact, most modern kernel modules are prepared - for automatic loading already. - - - - Configuration Format - - The configuration files should simply contain a - list of kernel module names to load, separated by - newlines. Empty lines and lines whose first - non-whitespace character is # or ; are ignored. - - - - - - Example - - /etc/modules-load.d/virtio-net.conf example: - - # Load virtio-net.ko at boot + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + modules-load.d + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + modules-load.d + 5 + + + + modules-load.d + Configure kernel modules to load at boot + + + + /etc/modules-load.d/*.conf + /run/modules-load.d/*.conf + /usr/lib/modules-load.d/*.conf + + + + Description + + systemd-modules-load.service8 + reads files from the above directories which contain kernel + modules to load during boot in a static list. Each configuration + file is named in the style of + /etc/modules-load.d/program.conf. + Note that it is usually a better idea to rely on the automatic + module loading by PCI IDs, USB IDs, DMI IDs or similar triggers + encoded in the kernel modules themselves instead of static + configuration like this. In fact, most modern kernel modules are + prepared for automatic loading already. + + + + Configuration Format + + The configuration files should simply contain a list of + kernel module names to load, separated by newlines. Empty lines + and lines whose first non-whitespace character is # or ; are + ignored. + + + + + + Example + + /etc/modules-load.d/virtio-net.conf example: + + # Load virtio-net.ko at boot virtio-net - - - - - See Also - - systemd1, - systemd-modules-load.service8, - systemd-delta1, - modprobe8 - - + + + + + See Also + + systemd1, + systemd-modules-load.service8, + systemd-delta1, + modprobe8 + + diff --git a/man/networkctl.1 b/man/networkctl.1 new file mode 100644 index 000000000..0624e2e03 --- /dev/null +++ b/man/networkctl.1 @@ -0,0 +1,121 @@ +'\" t +.TH "NETWORKCTL" "1" "" "systemd 219" "networkctl" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +networkctl \- Query the status of network links +.SH "SYNOPSIS" +.HP \w'\fBnetworkctl\fR\ 'u +\fBnetworkctl\fR [OPTIONS...] COMMAND [LINK...] +.SH "DESCRIPTION" +.PP +\fBnetworkctl\fR +may be used to introspect the state of the network links as seen by +\fBsystemd\-networkd\fR\&. Please refer to +\fBsystemd-networkd.service\fR(8) +for an introduction to the the basic concepts, functionality, and configuration syntax\&. +.SH "OPTIONS" +.PP +The following options are understood: +.PP +\fB\-a\fR \fB\-\-all\fR +.RS 4 +Show all links with +\fBstatus\fR\&. +.RE +.PP +\fB\-h\fR, \fB\-\-help\fR +.RS 4 +Print a short help text and exit\&. +.RE +.PP +\fB\-\-version\fR +.RS 4 +Print a short version string and exit\&. +.RE +.PP +\fB\-\-no\-pager\fR +.RS 4 +Do not pipe output into a pager\&. +.RE +.SH "COMMANDS" +.PP +The following commands are understood: +.PP +\fBlist\fR +.RS 4 +Show a list of existing links and their status\&. Produces output similar to +.sp +.if n \{\ +.RS 4 +.\} +.nf +IDX LINK TYPE OPERATIONAL SETUP + 1 lo loopback carrier unmanaged + 2 eth0 ether routable configured + 3 virbr0 ether no\-carrier unmanaged + 4 virbr0\-nic ether off unmanaged + +4 links listed\&. +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBstatus\fR [\fILINK\&.\&.\&.\fR] +.RS 4 +Show information about the specified links: type, state, kernel module driver, hardware and IP address, configured DNS servers, etc\&. +.sp +When no links are specified, routable links are shown\&. See also option +\fB\-\-all\fR\&. +.sp +Produces output similar to +.sp +.if n \{\ +.RS 4 +.\} +.nf +● State: routable + Address: 10\&.193\&.76\&.5 on eth0 + 192\&.168\&.122\&.1 on virbr0 + 169\&.254\&.190\&.105 on eth0 + fe80::5054:aa:bbbb:cccc on eth0 + Gateway: 10\&.193\&.11\&.1 (CISCO SYSTEMS, INC\&.) on eth0 + DNS: 8\&.8\&.8\&.8 + 8\&.8\&.4\&.4 +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBlldp\fR +.RS 4 +Show LLDP (Link Layer Discovery Protocol) status\&. +.RE +.SH "EXIT STATUS" +.PP +On success, 0 is returned, a non\-zero failure code otherwise\&. +.SH "SEE ALSO" +.PP +\fBsystemd-networkd.service\fR(8), +\fBsystemd.network\fR(5), +\fBsystemd.netdev\fR(5) diff --git a/man/networkctl.html b/man/networkctl.html new file mode 100644 index 000000000..91721539a --- /dev/null +++ b/man/networkctl.html @@ -0,0 +1,74 @@ +networkctlIndex · + Directives · + Python · + libudev · + gudev systemd 219

Name

networkctl — Query the status of network links

Synopsis

networkctl [OPTIONS...] COMMAND [LINK...]

Description¶

networkctl may be used to introspect the + state of the network links as seen by + systemd-networkd. Please refer to + systemd-networkd.service(8) + for an introduction to the the basic concepts, functionality, and + configuration syntax.

Options¶

The following options are understood:

+ -a + --all + ¶

Show all links with status.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Commands¶

The following commands are understood:

+ list + ¶

Show a list of existing links and their + status. Produces output similar to

+IDX LINK         TYPE     OPERATIONAL SETUP
+  1 lo           loopback carrier     unmanaged
+  2 eth0         ether    routable    configured
+  3 virbr0       ether    no-carrier  unmanaged
+  4 virbr0-nic   ether    off         unmanaged
+
+4 links listed.
+ status + [LINK...] + ¶

Show information about the specified links: type, + state, kernel module driver, hardware and IP address, + configured DNS servers, etc.

When no links are specified, routable links are + shown. See also option --all.

Produces output similar to +

+●      State: routable
+     Address: 10.193.76.5 on eth0
+              192.168.122.1 on virbr0
+              169.254.190.105 on eth0
+              fe80::5054:aa:bbbb:cccc on eth0
+     Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
+         DNS: 8.8.8.8
+              8.8.4.4
+ lldp + ¶

Show LLDP (Link Layer Discovery Protocol) + status.

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

diff --git a/man/networkctl.xml b/man/networkctl.xml new file mode 100644 index 000000000..d11d60f2a --- /dev/null +++ b/man/networkctl.xml @@ -0,0 +1,175 @@ + + + + + + + + + networkctl + systemd + + + + Documentation + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + networkctl + 1 + + + + networkctl + Query the status of network links + + + + + networkctl + OPTIONS + COMMAND + LINK + + + + + Description + + networkctl may be used to introspect the + state of the network links as seen by + systemd-networkd. Please refer to + systemd-networkd.service8 + for an introduction to the the basic concepts, functionality, and + configuration syntax. + + + + Options + + The following options are understood: + + + + + + + + + + Show all links with status. + + + + + + + + + + + + Commands + + The following commands are understood: + + + + + list + + + + Show a list of existing links and their + status. Produces output similar to +IDX LINK TYPE OPERATIONAL SETUP + 1 lo loopback carrier unmanaged + 2 eth0 ether routable configured + 3 virbr0 ether no-carrier unmanaged + 4 virbr0-nic ether off unmanaged + +4 links listed. + + + + + + status + LINK... + + + + Show information about the specified links: type, + state, kernel module driver, hardware and IP address, + configured DNS servers, etc. + + When no links are specified, routable links are + shown. See also option . + + Produces output similar to + +● State: routable + Address: 10.193.76.5 on eth0 + 192.168.122.1 on virbr0 + 169.254.190.105 on eth0 + fe80::5054:aa:bbbb:cccc on eth0 + Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0 + DNS: 8.8.8.8 + 8.8.4.4 + + + + + + + lldp + + + + Show LLDP (Link Layer Discovery Protocol) + status. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure + code otherwise. + + + + See Also + + systemd-networkd.service8, + systemd.network5, + systemd.netdev5 + + + diff --git a/man/nss-myhostname.8 b/man/nss-myhostname.8 index 3c4b461a7..8d7e1a943 100644 --- a/man/nss-myhostname.8 +++ b/man/nss-myhostname.8 @@ -1,5 +1,5 @@ '\" t -.TH "NSS\-MYHOSTNAME" "8" "" "systemd 218" "nss-myhostname" +.TH "NSS\-MYHOSTNAME" "8" "" "systemd 219" "nss-myhostname" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -20,55 +20,100 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -nss-myhostname \- Provide hostname resolution for the locally configured system hostname\&. +nss-myhostname, libnss_myhostname.so.2 \- Provide hostname resolution for the locally configured system hostname\&. .SH "SYNOPSIS" .PP -nss\-myhostname\&.la +libnss_myhostname\&.so\&.2 .SH "DESCRIPTION" .PP \fBnss\-myhostname\fR -is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (\fBglibc\fR) providing hostname resolution for the locally configured system hostname as returned by -\fBgethostname\fR(2)\&. Various software relies on an always\-resolvable local hostname\&. When using dynamic hostnames, this is usually achieved by patching +is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (\fBglibc\fR) primarily providing hostname resolution for the locally configured system hostname as returned by +\fBgethostname\fR(2)\&. The precise hostnames resolved by this module are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The local, configured hostname is resolved to all locally configured IP addresses ordered by their scope, or \(em if none are configured \(em the IPv4 address 127\&.0\&.0\&.2 (which is on the local loopback) and the IPv6 address ::1 (which is the local host)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The hostname +"localhost" +is resolved to the IP addresses 127\&.0\&.0\&.1 and ::1\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The hostname +"gateway" +is resolved to all current default routing gateway addresses, ordered by their metric\&. This assigns a stable hostname to the current gateway, useful for referencing it independently of the current network configuration state\&. +.RE +.PP +Various software relies on an always\-resolvable local hostname\&. When using dynamic hostnames, this is traditionally achieved by patching /etc/hosts -at the same time as changing the host name\&. This however is not ideal since it requires a writable +at the same time as changing the hostname\&. This is problematic since it requires a writable /etc -file system and is fragile because the file might be edited by the administrator at the same time\&. +file system and is fragile because the file might be edited by the administrator at the same time\&. With \fBnss\-myhostname\fR -simply returns all locally configured public IP addresses, or, if none are configured, the IPv4 address 127\&.0\&.0\&.2 (which is on the local loopback) and the IPv6 address ::1 (which is the local host) for whatever system hostname is configured locally\&. Patching +enabled changing /etc/hosts -is thus no longer necessary\&. +is unncessary, and on many systems the file becomes entirely optional\&. .PP To activate the NSS modules, -\fBmyhostname\fR -has to be added to the line starting with "\fIhosts:\fR" in -/etc/nsswitch\&.conf +"myhostname" +has to be added to the line starting with +"hosts:" +in +/etc/nsswitch\&.conf\&. .PP -It is recommended to put -\fBmyhostname\fR +It is recommended to place +"myhostname" last in the nsswitch\&.conf line to make sure that this mapping is only used as fallback, and any DNS or /etc/hosts based mapping takes precedence\&. .SH "EXAMPLE" +.PP +Here\*(Aqs an example +/etc/nsswitch\&.conf +file, that enables +\fBmyhostname\fR +correctly: .sp .if n \{\ .RS 4 .\} .nf -# /etc/nsswitch\&.conf - -passwd: compat -group: compat -shadow: compat +passwd: compat +group: compat +shadow: compat -hosts: files dns \fImyhostname\fR +hosts: files dns mymachines \fBmyhostname\fR networks: files protocols: db files services: db files -ethers: db files -rpc: db files +ethers: db files +rpc: db files netgroup: nis .fi @@ -86,9 +131,9 @@ tool: .\} .nf $ getent ahosts `hostname` -::1 STREAM omega -::1 DGRAM -::1 RAW +::1 STREAM omega +::1 DGRAM +::1 RAW 127\&.0\&.0\&.2 STREAM 127\&.0\&.0\&.2 DGRAM 127\&.0\&.0\&.2 RAW @@ -102,10 +147,6 @@ In this case the local hostname is .SH "SEE ALSO" .PP \fBsystemd\fR(1), -\fBsystemd-logind.service\fR(8), -\fBlogind.conf\fR(5), -\fBloginctl\fR(1), -\fBpam.conf\fR(5), -\fBpam.d\fR(5), -\fBpam\fR(8), -\fBpam_loginuid\fR(8) +\fBnss-mymachines\fR(8), +\fBnsswitch.conf\fR(5), +\fBgetent\fR(1) diff --git a/man/nss-myhostname.html b/man/nss-myhostname.html index 5193cce65..19d719561 100644 --- a/man/nss-myhostname.html +++ b/man/nss-myhostname.html @@ -19,54 +19,59 @@ Directives · Python · libudev · - gudev systemd 218

Name

nss-myhostname — Provide hostname resolution for the locally - configured system hostname.

Synopsis

nss-myhostname.la

Description¶

nss-myhostname is a plugin for the GNU Name Service Switch - (NSS) functionality of the GNU C Library (glibc) - providing hostname resolution for the locally configured system - hostname as returned by - gethostname(2). - Various software relies on an always-resolvable local hostname. When - using dynamic hostnames, this is usually achieved by patching - /etc/hosts at the same time as changing the host - name. This however is not ideal since it requires a writable - /etc file system and is fragile because the file - might be edited by the administrator at the same time. nss-myhostname - simply returns all locally configured public IP addresses, or, if none - are configured, the IPv4 address 127.0.0.2 (which is on the local - loopback) and the IPv6 address ::1 (which is the local host) for - whatever system hostname is configured locally. Patching - /etc/hosts is thus no longer necessary.

To activate the NSS modules, myhostname - has to be added to the line starting with "hosts:" in - /etc/nsswitch.conf

It is recommended to put myhostname - last in the nsswitch.conf line to make - sure that this mapping is only used as fallback, and any DNS - or /etc/hosts based mapping takes precedence.

Example¶

# /etc/nsswitch.conf
+  gudev systemd 219

Name

nss-myhostname, libnss_myhostname.so.2 — Provide hostname resolution for the locally + configured system hostname.

Synopsis

libnss_myhostname.so.2

Description¶

nss-myhostname is a plugin for the GNU + Name Service Switch (NSS) functionality of the GNU C Library + (glibc) primarily providing hostname resolution + for the locally configured system hostname as returned by + gethostname(2). + The precise hostnames resolved by this module are:

  • The local, configured hostname is resolved to + all locally configured IP addresses ordered by their scope, or + — if none are configured — the IPv4 address 127.0.0.2 (which + is on the local loopback) and the IPv6 address ::1 (which is the + local host).

  • The hostname "localhost" is + resolved to the IP addresses 127.0.0.1 and + ::1.

  • The hostname "gateway" is + resolved to all current default routing gateway addresses, + ordered by their metric. This assigns a stable hostname to the + current gateway, useful for referencing it independently of the + current network configuration state.

Various software relies on an always-resolvable local + hostname. When using dynamic hostnames, this is traditionally + achieved by patching /etc/hosts at the same + time as changing the hostname. This is problematic since it + requires a writable /etc file system and is + fragile because the file might be edited by the administrator at + the same time. With nss-myhostname enabled + changing /etc/hosts is unncessary, and on + many systems the file becomes entirely optional.

To activate the NSS modules, "myhostname" + has to be added to the line starting with + "hosts:" in + /etc/nsswitch.conf.

It is recommended to place "myhostname" + last in the nsswitch.conf line to make sure + that this mapping is only used as fallback, and any DNS or + /etc/hosts based mapping takes + precedence.

Example¶

Here's an example /etc/nsswitch.conf + file, that enables myhostname correctly:

passwd:   compat
+group:    compat
+shadow:   compat
 
-passwd:         compat
-group:          compat
-shadow:         compat
-
-hosts:          files dns myhostname
+hosts:    files dns mymachines myhostname
 networks:       files
 
 protocols:      db files
 services:       db files
-ethers:         db files
-rpc:            db files
+ethers:   db files
+rpc:      db files
 
 netgroup:       nis

To test, use glibc's getent tool:

$ getent ahosts `hostname`
-::1             STREAM omega
-::1             DGRAM
-::1             RAW
+::1       STREAM omega
+::1       DGRAM
+::1       RAW
 127.0.0.2       STREAM
 127.0.0.2       DGRAM
-127.0.0.2       RAW

In this case the local hostname is omega.

+127.0.0.2 RAW

In this case the local hostname is omega.

diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml index ba9297ec7..cf2b0200f 100644 --- a/man/nss-myhostname.xml +++ b/man/nss-myhostname.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + + + + + + + + nss-mymachines + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + nss-mymachines + 8 + + + + nss-mymachines + libnss_mymachines.so.2 + Provide hostname resolution for local + container instances. + + + + libnss_mymachines.so.2 + + + + Description + + nss-mymachines is a plugin for the GNU + Name Service Switch (NSS) functionality of the GNU C Library + (glibc) providing hostname resolution for + containers running locally, that are registered with + systemd-machined.service8. + The container names are resolved to IP addresses of the specific + container, ordered by their scope. + + To activate the NSS modules, mymachines + has to be added to the line starting with + hosts: in + /etc/nsswitch.conf. + + It is recommended to place mymachines + near the end of the nsswitch.conf line to + make sure that this mapping is only used as fallback, and any DNS + or /etc/hosts based mapping takes + precedence. + + + + Example + + Here's an example /etc/nsswitch.conf + file, that enables mymachines correctly: + +passwd: compat +group: compat +shadow: compat + +hosts: files dns mymachines myhostname +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: nis + + + + + See Also + + systemd1, + systemd-machined.service8, + nss-myhostname8, + nsswitch.conf5, + getent1 + + + + diff --git a/man/os-release.5 b/man/os-release.5 index 4d6949755..56f78a354 100644 --- a/man/os-release.5 +++ b/man/os-release.5 @@ -1,5 +1,5 @@ '\" t -.TH "OS\-RELEASE" "5" "" "systemd 218" "os-release" +.TH "OS\-RELEASE" "5" "" "systemd 219" "os-release" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,7 +36,7 @@ files contain operating system identification data\&. .PP The basic file format of os\-release -is a newline\-separated list of environment\-like shell\-compatible variable assignments\&. It is possible to source the configuration from shell scripts, however, beyond mere variable assignments, no shell features are supported (this means variable expansion is explicitly not supported), allowing applications to read the file without implementing a shell compatible execution engine\&. Variable assignment values should be enclosed in double or single quotes if they include spaces, semicolons or other special characters outside of A\-Z, a\-z, 0\-9\&. All strings should be in UTF\-8 format, and non\-printable characters should not be used\&. If double or single quotes or backslashes are to be used within variable assignments, they should be escaped with backslashes, following shell style\&. It is not supported to concatenate multiple individually quoted strings\&. Lines beginning with "#" shall be ignored as comments\&. +is a newline\-separated list of environment\-like shell\-compatible variable assignments\&. It is possible to source the configuration from shell scripts, however, beyond mere variable assignments, no shell features are supported (this means variable expansion is explicitly not supported), allowing applications to read the file without implementing a shell compatible execution engine\&. Variable assignment values must be enclosed in double or single quotes if they include spaces, semicolons or other special characters outside of A\-Z, a\-z, 0\-9\&. Shell special characters ("$", quotes, backslash, backtick) must be escaped with backslashes, following shell style\&. All strings should be in UTF\-8 format, and non\-printable characters should not be used\&. It is not supported to concatenate multiple individually quoted strings\&. Lines beginning with "#" shall be ignored as comments\&. .PP The file /etc/os\-release @@ -144,7 +144,7 @@ as proposed by the MITRE Corporation\&. This field is optional\&. Example: "CPE_NAME="cpe:/o:fedoraproject:fedora:17"" .RE .PP -\fIHOME_URL=\fR, \fISUPPORT_URL=\fR, \fIBUG_REPORT_URL=\fR +\fIHOME_URL=\fR, \fISUPPORT_URL=\fR, \fIBUG_REPORT_URL=\fR, \fIPRIVACY_POLICY_URL=\fR .RS 4 Links to resources on the Internet related the operating system\&. \fIHOME_URL=\fR @@ -152,7 +152,9 @@ should refer to the homepage of the operating system, or alternatively some home \fISUPPORT_URL=\fR should refer to the main support page for the operating system, if there is any\&. This is primarily intended for operating systems which vendors provide support for\&. \fIBUG_REPORT_URL=\fR -should refer to the main bug reporting page for the operating system, if there is any\&. This is primarily intended for operating systems that rely on community QA\&. These settings are optional, and providing only some of these settings is common\&. These URLs are intended to be exposed in "About this system" UIs behind links with captions such as "About this Operating System", "Obtain Support", and "Report a Bug"\&. The values should be in +should refer to the main bug reporting page for the operating system, if there is any\&. This is primarily intended for operating systems that rely on community QA\&. +\fIPRIVACY_POLICY_URL=\fR +should refer to the main privacy policy page for the operation system, if there is any\&. These settings are optional, and providing only some of these settings is common\&. These URLs are intended to be exposed in "About this system" UIs behind links with captions such as "About this Operating System", "Obtain Support", "Report a Bug", or "Privacy Policy"\&. The values should be in \m[blue]\fBRFC3986 format\fR\m[]\&\s-2\u[3]\d\s+2, and should be "http:" or @@ -174,9 +176,22 @@ or "BUILD_ID=201303203"\&. .RE .PP -If you are reading this file from C code or a shell script to determine the OS or a specific version of it, use the ID and VERSION_ID fields, possibly with ID_LIKE as fallback for ID\&. When looking for an OS identification string for presentation to the user use the PRETTY_NAME field\&. -.PP -Note that operating system vendors may choose not to provide version information, for example to accommodate for rolling releases\&. In this case, VERSION and VERSION_ID may be unset\&. Applications should not rely on these fields to be set\&. +If you are reading this file from C code or a shell script to determine the OS or a specific version of it, use the +\fIID\fR +and +\fIVERSION_ID\fR +fields, possibly with +\fIID_LIKE\fR +as fallback for +\fIID\fR\&. When looking for an OS identification string for presentation to the user use the +\fIPRETTY_NAME\fR +field\&. +.PP +Note that operating system vendors may choose not to provide version information, for example to accommodate for rolling releases\&. In this case, +\fIVERSION\fR +and +\fIVERSION_ID\fR +may be unset\&. Applications should not rely on these fields to be set\&. .PP Operating system vendors may extend the file format and introduce new fields\&. It is highly recommended to prefix new fields with an OS specific name in order to avoid name clashes\&. Applications reading this file must ignore unknown fields\&. Example: "DEBIAN_BTS="debbugs://bugs\&.debian\&.org/"" @@ -208,7 +223,8 @@ BUG_REPORT_URL="https://bugzilla\&.redhat\&.com/" \fBmachine-info\fR(5) .SH "NOTES" .IP " 1." 4 -Announcement of /etc/os-release +Announcement of + /etc/os-release .RS 4 \%http://0pointer.de/blog/projects/os-release .RE diff --git a/man/os-release.html b/man/os-release.html index 31ac6b138..6ccdbe2ca 100644 --- a/man/os-release.html +++ b/man/os-release.html @@ -19,224 +19,156 @@ Directives · Python · libudev · - gudev systemd 218

Name

os-release — Operating system identification

Synopsis

/etc/os-release

/usr/lib/os-release

Description¶

The /etc/os-release and - /usr/lib/os-release files contain - operating system identification data.

The basic file format of - os-release is a newline-separated - list of environment-like shell-compatible variable - assignments. It is possible to source the - configuration from shell scripts, however, beyond mere - variable assignments, no shell features are supported - (this means variable expansion is explicitly not - supported), allowing applications to read the file - without implementing a shell compatible execution - engine. Variable assignment values should be enclosed - in double or single quotes if they include spaces, - semicolons or other special characters outside of A-Z, - a-z, 0-9. All strings should be in UTF-8 format, and - non-printable characters should not be used. If double - or single quotes or backslashes are to be used within - variable assignments, they should be escaped with - backslashes, following shell style. It is not - supported to concatenate multiple individually quoted - strings. Lines beginning with "#" shall be ignored as - comments.

The file /etc/os-release - takes precedence over - /usr/lib/os-release. Applications - should check for the former, and exclusively use its - data if it exists, and only fall back to - /usr/lib/os-release if it is - missing. Applications should not read data from both - files at the same - time. /usr/lib/os-release is the - recommended place to store OS release information as - part of vendor trees. - /etc/os-release should be a - relative symlink to - /usr/lib/os-release, - to provide compatibility with applications only - looking at /etc. A relative - symlink instead of an absolute symlink is - necessary to avoid breaking the link in a chroot or - initrd environment such as dracut.

os-release contains data - that is defined by the operating system vendor and - should generally not be changed by the - administrator.

As this file only encodes names and identifiers - it should not be localized.

The /etc/os-release and - /usr/lib/os-release files might - be symlinks to other files, but it is important that - the file is available from earliest boot on, and hence - must be located on the root file system.

For a longer rationale for - os-release please refer to - the Announcement of /etc/os-release.

Options¶

The following OS identifications parameters may be set using - os-release:

NAME=¶

A string identifying - the operating system, without a - version component, and suitable for - presentation to the user. If not set, - defaults to - "NAME=Linux". Example: - "NAME=Fedora" or - "NAME="Debian - GNU/Linux"".

VERSION=¶

A string identifying - the operating system version, - excluding any OS name information, - possibly including a release code - name, and suitable for presentation to - the user. This field is - optional. Example: - "VERSION=17" or - "VERSION="17 (Beefy - Miracle)"".

ID=¶

A lower-case string - (no spaces or other characters outside - of 0-9, a-z, ".", "_" and "-") - identifying the operating system, - excluding any version information and - suitable for processing by scripts or - usage in generated filenames. If not - set, defaults to - "ID=linux". Example: - "ID=fedora" or - "ID=debian".

ID_LIKE=¶

A space-separated list - of operating system identifiers in the - same syntax as the - ID= setting. It should - list identifiers of operating systems - that are closely related to the local - operating system in regards to - packaging and programming interfaces, - for example listing one or more - OS identifiers the local - OS is a derivative from. An - OS should generally only list other OS - identifiers it itself is a derivative - of, and not any OSes that - are derived from it, though symmetric - relationships are possible. Build - scripts and similar should check this - variable if they need to identify the - local operating system and the value - of ID= is not - recognized. Operating systems should - be listed in order of how closely the - local operating system relates to the - listed ones, starting with the - closest. This field is - optional. Example: for an operating - system with - "ID=centos", an - assignment of "ID_LIKE="rhel - fedora"" would be - appropriate. For an operating system - with "ID=ubuntu", an - assignment of - "ID_LIKE=debian" is - appropriate.

VERSION_ID=¶

A lower-case string - (mostly numeric, no spaces or other - characters outside of 0-9, a-z, ".", - "_" and "-") identifying the operating - system version, excluding any OS name - information or release code name, and - suitable for processing by scripts or - usage in generated filenames. This - field is optional. Example: - "VERSION_ID=17" or - "VERSION_ID=11.04".

PRETTY_NAME=¶

A pretty operating - system name in a format suitable for - presentation to the user. May or may - not contain a release code name or OS - version of some kind, as suitable. If - not set, defaults to - "PRETTY_NAME="Linux"". Example: - "PRETTY_NAME="Fedora 17 (Beefy - Miracle)"".

ANSI_COLOR=¶

A suggested - presentation color when showing the - OS name on the console. This - should be specified as string suitable - for inclusion in the ESC [ m - ANSI/ECMA-48 escape code for setting - graphical rendition. This field is - optional. Example: - "ANSI_COLOR="0;31"" - for red, or - "ANSI_COLOR="1;34"" - for light blue.

CPE_NAME=¶

A CPE name for the - operating system, following the Common - Platform Enumeration - Specification as proposed by - the MITRE Corporation. This field - is optional. Example: - "CPE_NAME="cpe:/o:fedoraproject:fedora:17"" -

HOME_URL=, SUPPORT_URL=, BUG_REPORT_URL=¶

Links to resources on - the Internet related the operating - system. HOME_URL= - should refer to the homepage of the - operating system, or alternatively - some homepage of the specific version - of the operating - system. SUPPORT_URL= - should refer to the main support page - for the operating system, if there is - any. This is primarily intended for - operating systems which vendors - provide support - for. BUG_REPORT_URL= - should refer to the main bug reporting - page for the operating system, if - there is any. This is primarily - intended for operating systems that - rely on community QA. These settings - are optional, and providing only some - of these settings is common. These - URLs are intended to be exposed in - "About this system" UIs behind links - with captions such as "About this - Operating System", "Obtain Support", - and "Report a Bug". The values should - be in RFC3986 - format, and should be - "http:" or - "https:" URLs, and - possibly "mailto:" or - "tel:". Only one URL - shall be listed in each setting. If - multiple resources need to be - referenced, it is recommended to - provide an online landing page linking - all available resources. Examples: - "HOME_URL="https://fedoraproject.org/"" - and - "BUG_REPORT_URL="https://bugzilla.redhat.com/""

BUILD_ID=¶

A string uniquely - identifying the system image used as - the origin for a distribution (it is - not updated with system updates). The - field can be identical between - different VERSION_IDs as BUILD_ID is - an only a unique identifier to a - specific version. Distributions that - release each update as a new version - would only need to use VERSION_ID as - each build is already distinct based - on the VERSION_ID. This field is - optional. Example: - "BUILD_ID="2013-03-20.3"" - or - "BUILD_ID=201303203". + gudev systemd 219


Name

os-release — Operating system identification

Synopsis

/etc/os-release

/usr/lib/os-release

Description¶

The /etc/os-release and + /usr/lib/os-release files contain operating + system identification data.

The basic file format of os-release is + a newline-separated list of environment-like shell-compatible + variable assignments. It is possible to source the configuration + from shell scripts, however, beyond mere variable assignments, no + shell features are supported (this means variable expansion is + explicitly not supported), allowing applications to read the file + without implementing a shell compatible execution engine. Variable + assignment values must be enclosed in double or single quotes if + they include spaces, semicolons or other special characters + outside of A-Z, a-z, 0-9. Shell special characters ("$", quotes, + backslash, backtick) must be escaped with backslashes, following + shell style. All strings should be in UTF-8 format, and + non-printable characters should not be used. It is not supported + to concatenate multiple individually quoted strings. Lines + beginning with "#" shall be ignored as comments.

The file /etc/os-release takes + precedence over /usr/lib/os-release. + Applications should check for the former, and exclusively use its + data if it exists, and only fall back to + /usr/lib/os-release if it is missing. + Applications should not read data from both files at the same + time. /usr/lib/os-release is the recommended + place to store OS release information as part of vendor trees. + /etc/os-release should be a relative symlink + to /usr/lib/os-release, to provide + compatibility with applications only looking at + /etc. A relative symlink instead of an + absolute symlink is necessary to avoid breaking the link in a + chroot or initrd environment such as dracut.

os-release contains data that is + defined by the operating system vendor and should generally not be + changed by the administrator.

As this file only encodes names and identifiers it should + not be localized.

The /etc/os-release and + /usr/lib/os-release files might be symlinks + to other files, but it is important that the file is available + from earliest boot on, and hence must be located on the root file + system.

For a longer rationale for os-release + please refer to the Announcement of + /etc/os-release.

Options¶

The following OS identifications parameters may be set using + os-release:

NAME=¶

A string identifying the operating system, + without a version component, and suitable for presentation to + the user. If not set, defaults to + "NAME=Linux". Example: + "NAME=Fedora" or "NAME="Debian + GNU/Linux"".

VERSION=¶

A string identifying the operating system + version, excluding any OS name information, possibly including + a release code name, and suitable for presentation to the + user. This field is optional. Example: + "VERSION=17" or "VERSION="17 (Beefy + Miracle)"".

ID=¶

A lower-case string (no spaces or other + characters outside of 0-9, a-z, ".", "_" and "-") identifying + the operating system, excluding any version information and + suitable for processing by scripts or usage in generated + filenames. If not set, defaults to + "ID=linux". Example: + "ID=fedora" or + "ID=debian".

ID_LIKE=¶

A space-separated list of operating system + identifiers in the same syntax as the ID= + setting. It should list identifiers of operating systems that + are closely related to the local operating system in regards + to packaging and programming interfaces, for example listing + one or more OS identifiers the local OS is a derivative from. + An OS should generally only list other OS identifiers it + itself is a derivative of, and not any OSes that are derived + from it, though symmetric relationships are possible. Build + scripts and similar should check this variable if they need to + identify the local operating system and the value of + ID= is not recognized. Operating systems + should be listed in order of how closely the local operating + system relates to the listed ones, starting with the closest. + This field is optional. Example: for an operating system with + "ID=centos", an assignment of + "ID_LIKE="rhel fedora"" would be appropriate. + For an operating system with "ID=ubuntu", an + assignment of "ID_LIKE=debian" is + appropriate.

VERSION_ID=¶

A lower-case string (mostly numeric, no spaces + or other characters outside of 0-9, a-z, ".", "_" and "-") + identifying the operating system version, excluding any OS + name information or release code name, and suitable for + processing by scripts or usage in generated filenames. This + field is optional. Example: "VERSION_ID=17" + or "VERSION_ID=11.04".

PRETTY_NAME=¶

A pretty operating system name in a format + suitable for presentation to the user. May or may not contain + a release code name or OS version of some kind, as suitable. + If not set, defaults to + "PRETTY_NAME="Linux"". Example: + "PRETTY_NAME="Fedora 17 (Beefy + Miracle)"".

ANSI_COLOR=¶

A suggested presentation color when showing + the OS name on the console. This should be specified as string + suitable for inclusion in the ESC [ m ANSI/ECMA-48 escape code + for setting graphical rendition. This field is optional. + Example: "ANSI_COLOR="0;31"" for red, or + "ANSI_COLOR="1;34"" for light + blue.

CPE_NAME=¶

A CPE name for the operating system, following + the Common + Platform Enumeration Specification as proposed by the + MITRE Corporation. This field is optional. Example: + "CPE_NAME="cpe:/o:fedoraproject:fedora:17"" +

HOME_URL=, SUPPORT_URL=, BUG_REPORT_URL=, PRIVACY_POLICY_URL=¶

Links to resources on the Internet related the + operating system. HOME_URL= should refer to + the homepage of the operating system, or alternatively some + homepage of the specific version of the operating system. + SUPPORT_URL= should refer to the main + support page for the operating system, if there is any. This + is primarily intended for operating systems which vendors + provide support for. BUG_REPORT_URL= should + refer to the main bug reporting page for the operating system, + if there is any. This is primarily intended for operating + systems that rely on community QA. + PRIVACY_POLICY_URL= should refer to the + main privacy policy page for the operation system, if there is + any. These settings are optional, and providing only some of + these settings is common. These URLs are intended to be + exposed in "About this system" UIs behind links with captions + such as "About this Operating System", "Obtain Support", + "Report a Bug", or "Privacy Policy". The values should be in + RFC3986 + format, and should be "http:" or + "https:" URLs, and possibly + "mailto:" or "tel:". Only + one URL shall be listed in each setting. If multiple resources + need to be referenced, it is recommended to provide an online + landing page linking all available resources. Examples: + "HOME_URL="https://fedoraproject.org/"" and + "BUG_REPORT_URL="https://bugzilla.redhat.com/""

BUILD_ID=¶

A string uniquely identifying the system image + used as the origin for a distribution (it is not updated with + system updates). The field can be identical between different + VERSION_IDs as BUILD_ID is an only a unique identifier to a + specific version. Distributions that release each update as a + new version would only need to use VERSION_ID as each build is + already distinct based on the VERSION_ID. This field is + optional. Example: "BUILD_ID="2013-03-20.3"" + or "BUILD_ID=201303203". -

If you are reading this file from C code or a - shell script to determine the OS or a specific version - of it, use the ID and VERSION_ID fields, possibly with - ID_LIKE as fallback for ID. When looking for an OS - identification string for presentation to the user use - the PRETTY_NAME field.

Note that operating system vendors may choose - not to provide version information, for example to - accommodate for rolling releases. In this case, VERSION - and VERSION_ID may be unset. Applications should not - rely on these fields to be set.

Operating system vendors may extend the file - format and introduce new fields. It is highly - recommended to prefix new fields with an OS specific - name in order to avoid name clashes. Applications - reading this file must ignore unknown fields. Example: - "DEBIAN_BTS="debbugs://bugs.debian.org/""

Example¶

NAME=Fedora
+        

If you are reading this file from C code or a shell script + to determine the OS or a specific version of it, use the + ID and VERSION_ID fields, + possibly with ID_LIKE as fallback for + ID. When looking for an OS identification + string for presentation to the user use the + PRETTY_NAME field.

Note that operating system vendors may choose not to provide + version information, for example to accommodate for rolling + releases. In this case, VERSION and + VERSION_ID may be unset. Applications should + not rely on these fields to be set.

Operating system vendors may extend the file + format and introduce new fields. It is highly + recommended to prefix new fields with an OS specific + name in order to avoid name clashes. Applications + reading this file must ignore unknown fields. Example: + "DEBIAN_BTS="debbugs://bugs.debian.org/""

Example¶

NAME=Fedora
 VERSION="17 (Beefy Miracle)"
 ID=fedora
 VERSION_ID=17
@@ -244,10 +176,10 @@ PRETTY_NAME="Fedora 17 (Beefy Miracle)"
 ANSI_COLOR="0;34"
 CPE_NAME="cpe:/o:fedoraproject:fedora:17"
 HOME_URL="https://fedoraproject.org/"
-BUG_REPORT_URL="https://bugzilla.redhat.com/"
+BUG_REPORT_URL="https://bugzilla.redhat.com/"
diff --git a/man/os-release.xml b/man/os-release.xml index b29830494..1b71a49d0 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - os-release - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - os-release - 5 - - - - os-release - Operating system identification - - - - /etc/os-release - /usr/lib/os-release - - - - Description - - The /etc/os-release and - /usr/lib/os-release files contain - operating system identification data. - - The basic file format of - os-release is a newline-separated - list of environment-like shell-compatible variable - assignments. It is possible to source the - configuration from shell scripts, however, beyond mere - variable assignments, no shell features are supported - (this means variable expansion is explicitly not - supported), allowing applications to read the file - without implementing a shell compatible execution - engine. Variable assignment values should be enclosed - in double or single quotes if they include spaces, - semicolons or other special characters outside of A-Z, - a-z, 0-9. All strings should be in UTF-8 format, and - non-printable characters should not be used. If double - or single quotes or backslashes are to be used within - variable assignments, they should be escaped with - backslashes, following shell style. It is not - supported to concatenate multiple individually quoted - strings. Lines beginning with "#" shall be ignored as - comments. - - The file /etc/os-release - takes precedence over - /usr/lib/os-release. Applications - should check for the former, and exclusively use its - data if it exists, and only fall back to - /usr/lib/os-release if it is - missing. Applications should not read data from both - files at the same - time. /usr/lib/os-release is the - recommended place to store OS release information as - part of vendor trees. - /etc/os-release should be a - relative symlink to - /usr/lib/os-release, - to provide compatibility with applications only - looking at /etc. A relative - symlink instead of an absolute symlink is - necessary to avoid breaking the link in a chroot or - initrd environment such as dracut. - - os-release contains data - that is defined by the operating system vendor and - should generally not be changed by the - administrator. - - As this file only encodes names and identifiers - it should not be localized. - - The /etc/os-release and - /usr/lib/os-release files might - be symlinks to other files, but it is important that - the file is available from earliest boot on, and hence - must be located on the root file system. - - For a longer rationale for - os-release please refer to - the Announcement of /etc/os-release. - - - - Options - - The following OS identifications parameters may be set using - os-release: - - - - - NAME= - - A string identifying - the operating system, without a - version component, and suitable for - presentation to the user. If not set, - defaults to - NAME=Linux. Example: - NAME=Fedora or - NAME="Debian - GNU/Linux". - - - - VERSION= - - A string identifying - the operating system version, - excluding any OS name information, - possibly including a release code - name, and suitable for presentation to - the user. This field is - optional. Example: - VERSION=17 or - VERSION="17 (Beefy - Miracle)". - - - - ID= - - A lower-case string - (no spaces or other characters outside - of 0-9, a-z, ".", "_" and "-") - identifying the operating system, - excluding any version information and - suitable for processing by scripts or - usage in generated filenames. If not - set, defaults to - ID=linux. Example: - ID=fedora or - ID=debian. - - - - ID_LIKE= - - A space-separated list - of operating system identifiers in the - same syntax as the - ID= setting. It should - list identifiers of operating systems - that are closely related to the local - operating system in regards to - packaging and programming interfaces, - for example listing one or more - OS identifiers the local - OS is a derivative from. An - OS should generally only list other OS - identifiers it itself is a derivative - of, and not any OSes that - are derived from it, though symmetric - relationships are possible. Build - scripts and similar should check this - variable if they need to identify the - local operating system and the value - of ID= is not - recognized. Operating systems should - be listed in order of how closely the - local operating system relates to the - listed ones, starting with the - closest. This field is - optional. Example: for an operating - system with - ID=centos, an - assignment of ID_LIKE="rhel - fedora" would be - appropriate. For an operating system - with ID=ubuntu, an - assignment of - ID_LIKE=debian is - appropriate. - - - - VERSION_ID= - - A lower-case string - (mostly numeric, no spaces or other - characters outside of 0-9, a-z, ".", - "_" and "-") identifying the operating - system version, excluding any OS name - information or release code name, and - suitable for processing by scripts or - usage in generated filenames. This - field is optional. Example: - VERSION_ID=17 or - VERSION_ID=11.04. - - - - PRETTY_NAME= - - A pretty operating - system name in a format suitable for - presentation to the user. May or may - not contain a release code name or OS - version of some kind, as suitable. If - not set, defaults to - PRETTY_NAME="Linux". Example: - PRETTY_NAME="Fedora 17 (Beefy - Miracle)". - - - - ANSI_COLOR= - - A suggested - presentation color when showing the - OS name on the console. This - should be specified as string suitable - for inclusion in the ESC [ m - ANSI/ECMA-48 escape code for setting - graphical rendition. This field is - optional. Example: - ANSI_COLOR="0;31" - for red, or - ANSI_COLOR="1;34" - for light blue. - - - - CPE_NAME= - - A CPE name for the - operating system, following the Common - Platform Enumeration - Specification as proposed by - the MITRE Corporation. This field - is optional. Example: - CPE_NAME="cpe:/o:fedoraproject:fedora:17" - - - - - HOME_URL= - SUPPORT_URL= - BUG_REPORT_URL= - - Links to resources on - the Internet related the operating - system. HOME_URL= - should refer to the homepage of the - operating system, or alternatively - some homepage of the specific version - of the operating - system. SUPPORT_URL= - should refer to the main support page - for the operating system, if there is - any. This is primarily intended for - operating systems which vendors - provide support - for. BUG_REPORT_URL= - should refer to the main bug reporting - page for the operating system, if - there is any. This is primarily - intended for operating systems that - rely on community QA. These settings - are optional, and providing only some - of these settings is common. These - URLs are intended to be exposed in - "About this system" UIs behind links - with captions such as "About this - Operating System", "Obtain Support", - and "Report a Bug". The values should - be in RFC3986 - format, and should be - http: or - https: URLs, and - possibly mailto: or - tel:. Only one URL - shall be listed in each setting. If - multiple resources need to be - referenced, it is recommended to - provide an online landing page linking - all available resources. Examples: - HOME_URL="https://fedoraproject.org/" - and - BUG_REPORT_URL="https://bugzilla.redhat.com/" - - - - BUILD_ID= - - A string uniquely - identifying the system image used as - the origin for a distribution (it is - not updated with system updates). The - field can be identical between - different VERSION_IDs as BUILD_ID is - an only a unique identifier to a - specific version. Distributions that - release each update as a new version - would only need to use VERSION_ID as - each build is already distinct based - on the VERSION_ID. This field is - optional. Example: - BUILD_ID="2013-03-20.3" - or - BUILD_ID=201303203. - - - - - - - If you are reading this file from C code or a - shell script to determine the OS or a specific version - of it, use the ID and VERSION_ID fields, possibly with - ID_LIKE as fallback for ID. When looking for an OS - identification string for presentation to the user use - the PRETTY_NAME field. - - Note that operating system vendors may choose - not to provide version information, for example to - accommodate for rolling releases. In this case, VERSION - and VERSION_ID may be unset. Applications should not - rely on these fields to be set. - - Operating system vendors may extend the file - format and introduce new fields. It is highly - recommended to prefix new fields with an OS specific - name in order to avoid name clashes. Applications - reading this file must ignore unknown fields. Example: - DEBIAN_BTS="debbugs://bugs.debian.org/" - - - - Example - - NAME=Fedora + + os-release + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + os-release + 5 + + + + os-release + Operating system identification + + + + /etc/os-release + /usr/lib/os-release + + + + Description + + The /etc/os-release and + /usr/lib/os-release files contain operating + system identification data. + + The basic file format of os-release is + a newline-separated list of environment-like shell-compatible + variable assignments. It is possible to source the configuration + from shell scripts, however, beyond mere variable assignments, no + shell features are supported (this means variable expansion is + explicitly not supported), allowing applications to read the file + without implementing a shell compatible execution engine. Variable + assignment values must be enclosed in double or single quotes if + they include spaces, semicolons or other special characters + outside of A-Z, a-z, 0-9. Shell special characters ("$", quotes, + backslash, backtick) must be escaped with backslashes, following + shell style. All strings should be in UTF-8 format, and + non-printable characters should not be used. It is not supported + to concatenate multiple individually quoted strings. Lines + beginning with "#" shall be ignored as comments. + + The file /etc/os-release takes + precedence over /usr/lib/os-release. + Applications should check for the former, and exclusively use its + data if it exists, and only fall back to + /usr/lib/os-release if it is missing. + Applications should not read data from both files at the same + time. /usr/lib/os-release is the recommended + place to store OS release information as part of vendor trees. + /etc/os-release should be a relative symlink + to /usr/lib/os-release, to provide + compatibility with applications only looking at + /etc. A relative symlink instead of an + absolute symlink is necessary to avoid breaking the link in a + chroot or initrd environment such as dracut. + + os-release contains data that is + defined by the operating system vendor and should generally not be + changed by the administrator. + + As this file only encodes names and identifiers it should + not be localized. + + The /etc/os-release and + /usr/lib/os-release files might be symlinks + to other files, but it is important that the file is available + from earliest boot on, and hence must be located on the root file + system. + + For a longer rationale for os-release + please refer to the Announcement of + /etc/os-release. + + + + Options + + The following OS identifications parameters may be set using + os-release: + + + + + NAME= + + A string identifying the operating system, + without a version component, and suitable for presentation to + the user. If not set, defaults to + NAME=Linux. Example: + NAME=Fedora or NAME="Debian + GNU/Linux". + + + + VERSION= + + A string identifying the operating system + version, excluding any OS name information, possibly including + a release code name, and suitable for presentation to the + user. This field is optional. Example: + VERSION=17 or VERSION="17 (Beefy + Miracle)". + + + + ID= + + A lower-case string (no spaces or other + characters outside of 0-9, a-z, ".", "_" and "-") identifying + the operating system, excluding any version information and + suitable for processing by scripts or usage in generated + filenames. If not set, defaults to + ID=linux. Example: + ID=fedora or + ID=debian. + + + + ID_LIKE= + + A space-separated list of operating system + identifiers in the same syntax as the ID= + setting. It should list identifiers of operating systems that + are closely related to the local operating system in regards + to packaging and programming interfaces, for example listing + one or more OS identifiers the local OS is a derivative from. + An OS should generally only list other OS identifiers it + itself is a derivative of, and not any OSes that are derived + from it, though symmetric relationships are possible. Build + scripts and similar should check this variable if they need to + identify the local operating system and the value of + ID= is not recognized. Operating systems + should be listed in order of how closely the local operating + system relates to the listed ones, starting with the closest. + This field is optional. Example: for an operating system with + ID=centos, an assignment of + ID_LIKE="rhel fedora" would be appropriate. + For an operating system with ID=ubuntu, an + assignment of ID_LIKE=debian is + appropriate. + + + + VERSION_ID= + + A lower-case string (mostly numeric, no spaces + or other characters outside of 0-9, a-z, ".", "_" and "-") + identifying the operating system version, excluding any OS + name information or release code name, and suitable for + processing by scripts or usage in generated filenames. This + field is optional. Example: VERSION_ID=17 + or VERSION_ID=11.04. + + + + PRETTY_NAME= + + A pretty operating system name in a format + suitable for presentation to the user. May or may not contain + a release code name or OS version of some kind, as suitable. + If not set, defaults to + PRETTY_NAME="Linux". Example: + PRETTY_NAME="Fedora 17 (Beefy + Miracle)". + + + + ANSI_COLOR= + + A suggested presentation color when showing + the OS name on the console. This should be specified as string + suitable for inclusion in the ESC [ m ANSI/ECMA-48 escape code + for setting graphical rendition. This field is optional. + Example: ANSI_COLOR="0;31" for red, or + ANSI_COLOR="1;34" for light + blue. + + + + CPE_NAME= + + A CPE name for the operating system, following + the Common + Platform Enumeration Specification as proposed by the + MITRE Corporation. This field is optional. Example: + CPE_NAME="cpe:/o:fedoraproject:fedora:17" + + + + + HOME_URL= + SUPPORT_URL= + BUG_REPORT_URL= + PRIVACY_POLICY_URL= + + Links to resources on the Internet related the + operating system. HOME_URL= should refer to + the homepage of the operating system, or alternatively some + homepage of the specific version of the operating system. + SUPPORT_URL= should refer to the main + support page for the operating system, if there is any. This + is primarily intended for operating systems which vendors + provide support for. BUG_REPORT_URL= should + refer to the main bug reporting page for the operating system, + if there is any. This is primarily intended for operating + systems that rely on community QA. + PRIVACY_POLICY_URL= should refer to the + main privacy policy page for the operation system, if there is + any. These settings are optional, and providing only some of + these settings is common. These URLs are intended to be + exposed in "About this system" UIs behind links with captions + such as "About this Operating System", "Obtain Support", + "Report a Bug", or "Privacy Policy". The values should be in + RFC3986 + format, and should be http: or + https: URLs, and possibly + mailto: or tel:. Only + one URL shall be listed in each setting. If multiple resources + need to be referenced, it is recommended to provide an online + landing page linking all available resources. Examples: + HOME_URL="https://fedoraproject.org/" and + BUG_REPORT_URL="https://bugzilla.redhat.com/" + + + + BUILD_ID= + + A string uniquely identifying the system image + used as the origin for a distribution (it is not updated with + system updates). The field can be identical between different + VERSION_IDs as BUILD_ID is an only a unique identifier to a + specific version. Distributions that release each update as a + new version would only need to use VERSION_ID as each build is + already distinct based on the VERSION_ID. This field is + optional. Example: BUILD_ID="2013-03-20.3" + or BUILD_ID=201303203. + + + + + + + If you are reading this file from C code or a shell script + to determine the OS or a specific version of it, use the + ID and VERSION_ID fields, + possibly with ID_LIKE as fallback for + ID. When looking for an OS identification + string for presentation to the user use the + PRETTY_NAME field. + + Note that operating system vendors may choose not to provide + version information, for example to accommodate for rolling + releases. In this case, VERSION and + VERSION_ID may be unset. Applications should + not rely on these fields to be set. + + Operating system vendors may extend the file + format and introduce new fields. It is highly + recommended to prefix new fields with an OS specific + name in order to avoid name clashes. Applications + reading this file must ignore unknown fields. Example: + DEBIAN_BTS="debbugs://bugs.debian.org/" + + + + Example + + NAME=Fedora VERSION="17 (Beefy Miracle)" ID=fedora VERSION_ID=17 @@ -380,17 +310,17 @@ ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:17" HOME_URL="https://fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" - - - - See Also - - systemd1, - lsb_release1, - hostname5, - machine-id5, - machine-info5 - - + + + + See Also + + systemd1, + lsb_release1, + hostname5, + machine-id5, + machine-info5 + + diff --git a/man/pam_systemd.8 b/man/pam_systemd.8 index 5f367e62d..63bfc6c70 100644 --- a/man/pam_systemd.8 +++ b/man/pam_systemd.8 @@ -1,5 +1,5 @@ '\" t -.TH "PAM_SYSTEMD" "8" "" "systemd 218" "pam_systemd" +.TH "PAM_SYSTEMD" "8" "" "systemd 219" "pam_systemd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -101,7 +101,8 @@ If the last concurrent session of a user ends, the directory and all its contents are removed, too\&. .RE .PP -If the system was not booted up with systemd as init system, this module does nothing and immediately returns PAM_SUCCESS\&. +If the system was not booted up with systemd as init system, this module does nothing and immediately returns +\fBPAM_SUCCESS\fR\&. .SH "OPTIONS" .PP The following options are understood: diff --git a/man/pam_systemd.html b/man/pam_systemd.html index b37cf61ae..ed3bb4e7a 100644 --- a/man/pam_systemd.html +++ b/man/pam_systemd.html @@ -19,158 +19,116 @@ Directives · Python · libudev · - gudev systemd 218

Name

pam_systemd — Register user sessions in the systemd login manager

Synopsis

pam_systemd.so

Description¶

pam_systemd registers user - sessions with the systemd login manager - systemd-logind.service(8), - and hence the systemd control group hierarchy.

On login, this module ensures the following:

  1. If it does not exist yet, the - user runtime directory - /run/user/$USER is - created and its ownership changed to the user - that is logging in.

  2. The - $XDG_SESSION_ID environment - variable is initialized. If auditing is - available and - pam_loginuid.so was run before - this module (which is highly recommended), the - variable is initialized from the auditing - session id - (/proc/self/sessionid). Otherwise, - an independent session counter is - used.

  3. A new systemd scope unit is - created for the session. If this is the first - concurrent session of the user, an implicit - slice below user.slice is - automatically created and the scope placed into - it. An instance of the system service - user@.service, which runs - the systemd user manager instance, is started. -

On logout, this module ensures the following:

  1. If enabled in - logind.conf(5), all - processes of the session are terminated. If - the last concurrent session of a user ends, - the user's systemd instance will be - terminated too, and so will the user's slice - unit.

  2. If the last concurrent session - of a user ends, the - $XDG_RUNTIME_DIR directory - and all its contents are removed, - too.

If the system was not booted up with systemd as - init system, this module does nothing and immediately - returns PAM_SUCCESS.

Options¶

The following options are understood:

class=¶

Takes a string - argument which sets the session class. - The XDG_SESSION_CLASS environmental variable - takes precedence. One of - "user", - "greeter", - "lock-screen" or - "background". See - sd_session_get_class(3) - for details about the session class.

type=¶

Takes a string - argument which sets the session type. - The XDG_SESSION_TYPE environmental - variable takes precedence. One of - "unspecified", - "tty", - "x11", - "wayland" or - "mir". See - sd_session_get_type(3) - for details about the session type.

debug[=]¶

Takes an optional - boolean argument. If yes or without - the argument, the module will log - debugging information as it - operates.

Module Types Provided¶

Only session is provided.

Environment¶

The following environment variables are set for the processes of the user's session:

$XDG_SESSION_ID¶

A session identifier, - suitable to be used in filenames. The - string itself should be considered - opaque, although often it is just the - audit session ID as reported by - /proc/self/sessionid. Each - ID will be assigned only once during - machine uptime. It may hence be used - to uniquely label files or other - resources of this - session.

$XDG_RUNTIME_DIR¶

Path to a user-private - user-writable directory that is bound - to the user login time on the - machine. It is automatically created - the first time a user logs in and - removed on the user's final logout. If - a user logs in twice at the same time, - both sessions will see the same - $XDG_RUNTIME_DIR - and the same contents. If a user logs - in once, then logs out again, and logs - in again, the directory contents will - have been lost in between, but - applications should not rely on this - behavior and must be able to deal with - stale files. To store session-private - data in this directory, the user - should include the value of - $XDG_SESSION_ID in - the filename. This directory shall be - used for runtime file system objects - such as AF_UNIX - sockets, FIFOs, PID files and - similar. It is guaranteed that this - directory is local and offers the - greatest possible file system feature - set the operating system provides. For - further details see the XDG - Base Directory - Specification.

The following environment variables are read by - the module and may be used by the PAM service to pass - metadata to the module:

$XDG_SESSION_TYPE¶

The session type. This - may be used instead of - session= on the - module parameter line, and is usually - preferred.

$XDG_SESSION_CLASS¶

The session class. This - may be used instead of - class= on the - module parameter line, and is usually - preferred.

$XDG_SESSION_DESKTOP¶

A single, short - identifier string for the desktop - environment. This may be used to - indicate the session desktop used, - where this applies and if this - information is available. For example: - "GNOME", or - "KDE". It is - recommended to use the same - identifiers and capitalization as for - $XDG_CURRENT_DESKTOP, - as defined by the Desktop - Entry Specification. (However, - note that - $XDG_SESSION_DESKTOP - only takes a single item, and not a - colon-separated list like - $XDG_CURRENT_DESKTOP.) - See - sd_session_get_desktop(3) - for more details.

$XDG_SEAT¶

The seat name the session - shall be registered for, if - any.

$XDG_VTNR¶

The VT number the - session shall be registered for, if - any. (Only applies to seats with a VT - available, such as - "seat0")

Example¶

#%PAM-1.0
+  gudev systemd 219

Name

pam_systemd — Register user sessions in the systemd login manager

Synopsis

pam_systemd.so

Description¶

pam_systemd registers user sessions with + the systemd login manager + systemd-logind.service(8), + and hence the systemd control group hierarchy.

On login, this module ensures the following:

  1. If it does not exist yet, the user runtime + directory /run/user/$USER is created and + its ownership changed to the user that is logging + in.

  2. The $XDG_SESSION_ID + environment variable is initialized. If auditing is available + and pam_loginuid.so was run before this + module (which is highly recommended), the variable is + initialized from the auditing session id + (/proc/self/sessionid). Otherwise, an + independent session counter is used.

  3. A new systemd scope unit is created for the + session. If this is the first concurrent session of the user, an + implicit slice below user.slice is + automatically created and the scope placed into it. An instance + of the system service user@.service, which + runs the systemd user manager instance, is started. +

On logout, this module ensures the following:

  1. If enabled in + logind.conf(5), all processes of the + session are terminated. If the last concurrent session of a user + ends, the user's systemd instance will be terminated too, and so + will the user's slice unit.

  2. If the last concurrent session of a user ends, + the $XDG_RUNTIME_DIR directory and all its + contents are removed, too.

If the system was not booted up with systemd as init system, + this module does nothing and immediately returns + PAM_SUCCESS.

Options¶

The following options are understood:

class=¶

Takes a string argument which sets the session + class. The XDG_SESSION_CLASS environmental variable takes + precedence. One of + "user", + "greeter", + "lock-screen" or + "background". See + sd_session_get_class(3) + for details about the session class.

type=¶

Takes a string argument which sets the session + type. The XDG_SESSION_TYPE environmental variable takes + precedence. One of + "unspecified", + "tty", + "x11", + "wayland" or + "mir". See + sd_session_get_type(3) + for details about the session type.

debug[=]¶

Takes an optional + boolean argument. If yes or without + the argument, the module will log + debugging information as it + operates.

Module Types Provided¶

Only session is provided.

Environment¶

The following environment variables are set for the + processes of the user's session:

$XDG_SESSION_ID¶

A session identifier, suitable to be used in + filenames. The string itself should be considered opaque, + although often it is just the audit session ID as reported by + /proc/self/sessionid. Each ID will be + assigned only once during machine uptime. It may hence be used + to uniquely label files or other resources of this + session.

$XDG_RUNTIME_DIR¶

Path to a user-private user-writable directory + that is bound to the user login time on the machine. It is + automatically created the first time a user logs in and + removed on the user's final logout. If a user logs in twice at + the same time, both sessions will see the same + $XDG_RUNTIME_DIR and the same contents. If + a user logs in once, then logs out again, and logs in again, + the directory contents will have been lost in between, but + applications should not rely on this behavior and must be able + to deal with stale files. To store session-private data in + this directory, the user should include the value of + $XDG_SESSION_ID in the filename. This + directory shall be used for runtime file system objects such + as AF_UNIX sockets, FIFOs, PID files and + similar. It is guaranteed that this directory is local and + offers the greatest possible file system feature set the + operating system provides. For further details see the XDG + Base Directory Specification.

The following environment variables are read by the module + and may be used by the PAM service to pass metadata to the + module:

$XDG_SESSION_TYPE¶

The session type. This may be used instead of + session= on the module parameter line, and is + usually preferred.

$XDG_SESSION_CLASS¶

The session class. This may be used instead of + class= on the module parameter line, and is + usually preferred.

$XDG_SESSION_DESKTOP¶

A single, short identifier string for the + desktop environment. This may be used to indicate the session + desktop used, where this applies and if this information is + available. For example: "GNOME", or + "KDE". It is recommended to use the same + identifiers and capitalization as for + $XDG_CURRENT_DESKTOP, as defined by the + Desktop + Entry Specification. (However, note that + $XDG_SESSION_DESKTOP only takes a single + item, and not a colon-separated list like + $XDG_CURRENT_DESKTOP.) See + sd_session_get_desktop(3) + for more details.

$XDG_SEAT¶

The seat name the session shall be registered + for, if any.

$XDG_VTNR¶

The VT number the session shall be registered + for, if any. (Only applies to seats with a VT available, such + as "seat0")

Example¶

#%PAM-1.0
 auth       required     pam_unix.so
 auth       required     pam_nologin.so
 account    required     pam_unix.so
 password   required     pam_unix.so
 session    required     pam_unix.so
 session    required     pam_loginuid.so
-session    required     pam_systemd.so
+session required pam_systemd.so
diff --git a/man/pam_systemd.xml b/man/pam_systemd.xml index 3e106ea69..b4a3f502b 100644 --- a/man/pam_systemd.xml +++ b/man/pam_systemd.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - resolved.conf - systemd - - - - Developer - Tom - Gundersen - teg@jklm.no - - - - - - resolved.conf - 5 - - - - resolved.conf - resolved.conf.d - Network Name Resolution configuration files - - - - /etc/systemd/resolved.conf - /etc/systemd/resolved.conf.d/*.conf - /run/systemd/resolved.conf.d/*.conf - /usr/lib/systemd/resolved.conf.d/*.conf - - - - Description - - These configuration files control local DNS and LLMNR - name resolving. - - - - - - - - Options - - - - - DNS= - A space separated list - of IPv4 and IPv6 addresses to be used - as system DNS servers. DNS requests - are sent to one of the listed DNS - servers in parallel to any - per-interface DNS servers acquired - from - systemd-networkd.service8. For - compatibility reasons, if set to the - empty list the DNS servers listed in - /etc/resolv.conf - are used, if any are - configured there. This setting - defaults to the empty - list. - - - - FallbackDNS= - A space separated list - of IPv4 and IPv6 addresses to be used - as the fallback DNS servers. Any - per-interface DNS servers obtained - from - systemd-networkd.service8 - take precedence over this setting, as - do any servers set via - DNS= above or - /etc/resolv.conf. This - setting is hence only used if no other - DNS server information is known. If - this option is not given, a - compiled-in list of DNS servers is - used instead. - - - - LLMNR= - Takes a boolean - argument or - resolve. Controls - Link-Local Multicast Name Resolution support (RFC - 4794) on the local host. If - true enables full LLMNR responder and - resolver support. If false disable - both. If set to - resolve only - resolving support is enabled, but - responding is disabled. Note that - systemd-networkd.service8 - also maintains per-interface LLMNR - settings. LLMNR will be enabled on an - interface only if the per-interface - and the global setting is - on. - - - - - - - See Also - - systemd1, - systemd-resolved.service8, - systemd-networkd.service8, - resolv.conf4 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + resolved.conf + systemd + + + + Developer + Tom + Gundersen + teg@jklm.no + + + + + + resolved.conf + 5 + + + + resolved.conf + resolved.conf.d + Network Name Resolution configuration files + + + + /etc/systemd/resolved.conf + /etc/systemd/resolved.conf.d/*.conf + /run/systemd/resolved.conf.d/*.conf + /usr/lib/systemd/resolved.conf.d/*.conf + + + + Description + + These configuration files control local DNS and LLMNR + name resolving. + + + + + + + + Options + + + + + DNS= + A space separated list of IPv4 and IPv6 + addresses to be used as system DNS servers. DNS requests are + sent to one of the listed DNS servers in parallel to any + per-interface DNS servers acquired from + systemd-networkd.service8. + For compatibility reasons, if set to the empty list the DNS + servers listed in /etc/resolv.conf are + used, if any are configured there. This setting defaults to + the empty list. + + + + FallbackDNS= + A space separated list of IPv4 and IPv6 + addresses to be used as the fallback DNS servers. Any + per-interface DNS servers obtained from + systemd-networkd.service8 + take precedence over this setting, as do any servers set via + DNS= above or + /etc/resolv.conf. This setting is hence + only used if no other DNS server information is known. If this + option is not given, a compiled-in list of DNS servers is used + instead. + + + + LLMNR= + Takes a boolean argument or + resolve. Controls Link-Local Multicast Name + Resolution support (RFC 4794) on + the local host. If true enables full LLMNR responder and + resolver support. If false disable both. If set to + resolve only resolving support is enabled, + but responding is disabled. Note that + systemd-networkd.service8 + also maintains per-interface LLMNR settings. LLMNR will be + enabled on an interface only if the per-interface and the + global setting is on. + + + + + + + See Also + + systemd1, + systemd-resolved.service8, + systemd-networkd.service8, + resolv.conf4 + + diff --git a/man/runlevel.8 b/man/runlevel.8 index 66822696f..30aa4d3b3 100644 --- a/man/runlevel.8 +++ b/man/runlevel.8 @@ -1,5 +1,5 @@ '\" t -.TH "RUNLEVEL" "8" "" "systemd 218" "runlevel" +.TH "RUNLEVEL" "8" "" "systemd 219" "runlevel" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/runlevel.html b/man/runlevel.html index 9be906d13..952fca41c 100644 --- a/man/runlevel.html +++ b/man/runlevel.html @@ -19,28 +19,22 @@ Directives · Python · libudev · - gudev systemd 218

Name

runlevel — Print previous and current SysV runlevel

Synopsis

runlevel [options...]

Description¶

runlevel prints the previous - and current SysV runlevel if they are known.

The two runlevel characters are separated by a - single space character. If a runlevel cannot be - determined, N is printed instead. If neither can be - determined, the word "unknown" is printed.

Unless overridden in the environment, this will - check the utmp database for recent runlevel - changes.

Options¶

The following option is understood:

--help¶

Print a short help text and exit. -

Exit status¶

If one or both runlevels could be determined, 0 - is returned, a non-zero failure code otherwise.

Environment¶

$RUNLEVEL¶

If - $RUNLEVEL is set, - runlevel will print - this value as current runlevel and - ignore utmp.

$PREVLEVEL¶

If - $PREVLEVEL is set, - runlevel will print - this value as previous runlevel and - ignore utmp.

Files¶

/var/run/utmp¶

The utmp database - runlevel reads the - previous and current runlevel - from.

Notes¶

This is a legacy command available for compatibility - only. It should not be used anymore, as the concept of - runlevels is obsolete.

See Also¶

- systemd(1), - systemctl(1) -

+ gudev systemd 219

Name

runlevel — Print previous and current SysV runlevel

Synopsis

runlevel [options...]

Description¶

runlevel prints the previous and current + SysV runlevel if they are known.

The two runlevel characters are separated by a single space + character. If a runlevel cannot be determined, N is printed + instead. If neither can be determined, the word "unknown" is + printed.

Unless overridden in the environment, this will check the + utmp database for recent runlevel changes.

Options¶

The following option is understood:

--help¶

Print a short help text and exit. +

Exit status¶

If one or both runlevels could be determined, 0 is returned, + a non-zero failure code otherwise.

Environment¶

$RUNLEVEL¶

If $RUNLEVEL is set, + runlevel will print this value as current + runlevel and ignore utmp.

$PREVLEVEL¶

If $PREVLEVEL is set, + runlevel will print this value as previous + runlevel and ignore utmp.

Files¶

/var/run/utmp¶

The utmp database runlevel + reads the previous and current runlevel + from.

Notes¶

This is a legacy command available for compatibility only. + It should not be used anymore, as the concept of runlevels is + obsolete.

See Also¶

+ systemd(1), + systemctl(1) +

diff --git a/man/runlevel.xml b/man/runlevel.xml index db9a43672..fc1f52385 100644 --- a/man/runlevel.xml +++ b/man/runlevel.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - runlevel - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - runlevel - 8 - - - - runlevel - Print previous and current SysV runlevel - - - - - runlevel options - - - - - Description - - runlevel prints the previous - and current SysV runlevel if they are known. - - The two runlevel characters are separated by a - single space character. If a runlevel cannot be - determined, N is printed instead. If neither can be - determined, the word "unknown" is printed. - - Unless overridden in the environment, this will - check the utmp database for recent runlevel - changes. - - - - Options - - The following option is understood: - - - - - - - - - - - - - Exit status - - If one or both runlevels could be determined, 0 - is returned, a non-zero failure code otherwise. - - - - - Environment - - - - $RUNLEVEL - - If - $RUNLEVEL is set, - runlevel will print - this value as current runlevel and - ignore utmp. - - - - $PREVLEVEL - - If - $PREVLEVEL is set, - runlevel will print - this value as previous runlevel and - ignore utmp. - - - - - - Files - - - - /var/run/utmp - - The utmp database - runlevel reads the - previous and current runlevel - from. - - - - - - - Notes - - This is a legacy command available for compatibility - only. It should not be used anymore, as the concept of - runlevels is obsolete. - - - - See Also - - systemd1, - systemctl1 - - + xmlns:xi="http://www.w3.org/2001/XInclude" + conditional="HAVE_UTMP"> + + + runlevel + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + runlevel + 8 + + + + runlevel + Print previous and current SysV runlevel + + + + + runlevel options + + + + + Description + + runlevel prints the previous and current + SysV runlevel if they are known. + + The two runlevel characters are separated by a single space + character. If a runlevel cannot be determined, N is printed + instead. If neither can be determined, the word "unknown" is + printed. + + Unless overridden in the environment, this will check the + utmp database for recent runlevel changes. + + + + Options + + The following option is understood: + + + + + + + + + + + + + Exit status + + If one or both runlevels could be determined, 0 is returned, + a non-zero failure code otherwise. + + + + + Environment + + + + $RUNLEVEL + + If $RUNLEVEL is set, + runlevel will print this value as current + runlevel and ignore utmp. + + + + $PREVLEVEL + + If $PREVLEVEL is set, + runlevel will print this value as previous + runlevel and ignore utmp. + + + + + + Files + + + + /var/run/utmp + + The utmp database runlevel + reads the previous and current runlevel + from. + + + + + + Notes + + This is a legacy command available for compatibility only. + It should not be used anymore, as the concept of runlevels is + obsolete. + + + + See Also + + systemd1, + systemctl1 + + diff --git a/man/sd-daemon.3 b/man/sd-daemon.3 index c8f402e82..1ccc6b5d3 100644 --- a/man/sd-daemon.3 +++ b/man/sd-daemon.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD\-DAEMON" "3" "" "systemd 218" "sd-daemon" +.TH "SD\-DAEMON" "3" "" "systemd 219" "sd-daemon" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd-daemon.html b/man/sd-daemon.html index e0aac38a6..4ad8c4176 100644 --- a/man/sd-daemon.html +++ b/man/sd-daemon.html @@ -19,55 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for - new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd(1) - init system.

See - sd_listen_fds(3), - sd_notify(3), - sd_booted(3), - sd_is_fifo(3), - sd_watchdog_enabled(3) - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros:

#define SD_EMERG   "<0>"  /* system is unusable */
+  gudev systemd 219

Name

sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG — APIs for + new-style daemons

Synopsis

#include <systemd/sd-daemon.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd(1) + init system.

See + sd_listen_fds(3), + sd_notify(3), + sd_booted(3), + sd_is_fifo(3), + sd_watchdog_enabled(3) + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros:

#define SD_EMERG   "<0>"  /* system is unusable */
 #define SD_ALERT   "<1>"  /* action must be taken immediately */
 #define SD_CRIT    "<2>"  /* critical conditions */
 #define SD_ERR     "<3>"  /* error conditions */
 #define SD_WARNING "<4>"  /* warning conditions */
 #define SD_NOTICE  "<5>"  /* normal but significant condition */
 #define SD_INFO    "<6>"  /* informational */
-#define SD_DEBUG   "<7>"  /* debug-level messages */

These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl(2) - for more information.

The log levels are identical to - syslog(3)'s - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO.

Example 1. Hello World

A daemon may log with the log level - NOTICE by issuing this call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared +#define SD_DEBUG "<7>" /* debug-level messages */

These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl(2) + for more information.

The log levels are identical to + syslog(3)'s + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO.

Example 1. Hello World

A daemon may log with the log level NOTICE by issuing this + call:

fprintf(stderr, SD_NOTICE "Hello World!\n");

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/sd-daemon.xml b/man/sd-daemon.xml index 5f331e740..b7ba36365 100644 --- a/man/sd-daemon.xml +++ b/man/sd-daemon.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd-daemon - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd-daemon - 3 - - - - sd-daemon - SD_EMERG - SD_ALERT - SD_CRIT - SD_ERR - SD_WARNING - SD_NOTICE - SD_INFO - SD_DEBUG - APIs for - new-style daemons - - - - - #include <systemd/sd-daemon.h> - - - - pkg-config --cflags --libs libsystemd - - - - - - Description - - sd-daemon.h provide APIs - for new-style daemons, as implemented by the - systemd1 - init system. - - See - sd_listen_fds3, - sd_notify3, - sd_booted3, - sd_is_fifo3, - sd_watchdog_enabled3 - for more information about the functions - implemented. In addition to these functions, a couple - of logging prefixes are defined as macros: - - #define SD_EMERG "<0>" /* system is unusable */ + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd-daemon + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd-daemon + 3 + + + + sd-daemon + SD_EMERG + SD_ALERT + SD_CRIT + SD_ERR + SD_WARNING + SD_NOTICE + SD_INFO + SD_DEBUG + APIs for + new-style daemons + + + + + #include <systemd/sd-daemon.h> + + + + pkg-config --cflags --libs libsystemd + + + + + + Description + + sd-daemon.h provide APIs for new-style + daemons, as implemented by the + systemd1 + init system. + + See + sd_listen_fds3, + sd_notify3, + sd_booted3, + sd_is_fifo3, + sd_watchdog_enabled3 + for more information about the functions implemented. In addition + to these functions, a couple of logging prefixes are defined as + macros: + + #define SD_EMERG "<0>" /* system is unusable */ #define SD_ALERT "<1>" /* action must be taken immediately */ #define SD_CRIT "<2>" /* critical conditions */ #define SD_ERR "<3>" /* error conditions */ @@ -95,53 +95,50 @@ #define SD_INFO "<6>" /* informational */ #define SD_DEBUG "<7>" /* debug-level messages */ - These prefixes are intended to be used in - conjunction with stderr-based logging as implemented - by systemd. If a systemd service definition file is - configured with - StandardError=journal, - StandardError=syslog or - StandardError=kmsg, these prefixes - can be used to encode a log level in lines - printed. This is similar to the kernel - printk()-style logging. See - klogctl2 - for more information. - - The log levels are identical to - syslog3's - log level system. To use these prefixes simply prefix - every line with one of these strings. A line that is - not prefixed will be logged at the default log level - SD_INFO. - - - Hello World - - A daemon may log with the log level - NOTICE by issuing this call: - - fprintf(stderr, SD_NOTICE "Hello World!\n"); - - - - - - - See Also - - systemd1, - sd_listen_fds3, - sd_notify3, - sd_booted3, - sd_is_fifo3, - sd_watchdog_enabled3, - daemon7, - systemd.service5, - systemd.socket5, - fprintf3, - pkg-config1 - - + These prefixes are intended to be used in conjunction with + stderr-based logging as implemented by systemd. If a systemd + service definition file is configured with + StandardError=journal, + StandardError=syslog or + StandardError=kmsg, these prefixes can be used + to encode a log level in lines printed. This is similar to the + kernel printk()-style logging. See + klogctl2 + for more information. + + The log levels are identical to + syslog3's + log level system. To use these prefixes simply prefix every line + with one of these strings. A line that is not prefixed will be + logged at the default log level SD_INFO. + + + Hello World + + A daemon may log with the log level NOTICE by issuing this + call: + + fprintf(stderr, SD_NOTICE "Hello World!\n"); + + + + + + + See Also + + systemd1, + sd_listen_fds3, + sd_notify3, + sd_booted3, + sd_is_fifo3, + sd_watchdog_enabled3, + daemon7, + systemd.service5, + systemd.socket5, + fprintf3, + pkg-config1 + + diff --git a/man/sd-id128.3 b/man/sd-id128.3 index eb760367a..079f1c8a9 100644 --- a/man/sd-id128.3 +++ b/man/sd-id128.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD\-ID128" "3" "" "systemd 218" "sd-id128" +.TH "SD\-ID128" "3" "" "systemd 219" "sd-id128" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,8 +51,8 @@ A 128\-bit ID is implemented as the following union type: .\} .nf typedef union sd_id128 { - uint8_t bytes[16]; - uint64_t qwords[2]; + uint8_t bytes[16]; + uint64_t qwords[2]; } sd_id128_t; .fi .if n \{\ @@ -84,7 +84,7 @@ may be used to convert constant 128\-bit IDs into constant strings for output\&. .\} .nf int main(int argc, char *argv[]) { - puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP)); + puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP)); } .fi .if n \{\ @@ -103,10 +103,10 @@ format string, as shown in the following example: .\} .nf int main(int argc, char *argv[]) { - sd_id128_t id; - id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); - printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR "\&.\en", SD_ID128_FORMAT_VAL(id)); - return 0; + sd_id128_t id; + id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR "\&.\en", SD_ID128_FORMAT_VAL(id)); + return 0; } .fi .if n \{\ @@ -122,13 +122,13 @@ to compare two 128\-bit IDs: .\} .nf int main(int argc, char *argv[]) { - sd_id128_t a, b, c; - a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); - b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); - c = a; - assert(sd_id128_equal(a, c)); - assert(!sd_id128_equal(a, b)); - return 0; + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; } .fi .if n \{\ diff --git a/man/sd-id128.html b/man/sd-id128.html index f0ece03fc..618b484f5 100644 --- a/man/sd-id128.html +++ b/man/sd-id128.html @@ -19,71 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. -

See - sd_id128_to_string(3), - sd_id128_randomize(3) and - sd_id128_get_machine(3) - for more information about the implemented - functions.

A 128-bit ID is implemented as the following - union type:

typedef union sd_id128 {
-        uint8_t bytes[16];
-        uint64_t qwords[2];
-} sd_id128_t;

This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients.

A couple of macros are defined to denote and - decode 128-bit IDs:

SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
-        puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
+  gudev systemd 219

Name

sd-id128, sd_id128_t, SD_ID128_MAKE, SD_ID128_CONST_STR, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL, sd_id128_equal — APIs for processing 128-bit IDs

Synopsis

#include <systemd/sd-id128.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. +

See + sd_id128_to_string(3), + sd_id128_randomize(3) + and + sd_id128_get_machine(3) + for more information about the implemented functions.

A 128-bit ID is implemented as the following + union type:

typedef union sd_id128 {
+  uint8_t bytes[16];
+  uint64_t qwords[2];
+} sd_id128_t;

This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients.

A couple of macros are defined to denote and decode 128-bit + IDs:

SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro:

#define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1)

SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1":

int main(int argc, char *argv[]) {
+  puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP));
 }

SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf(3) - format string, as shown in the following - example:

int main(int argc, char *argv[]) {
-        sd_id128_t id;
-        id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
-        return 0;
+    SD_ID128_FORMAT_VAL() may be used to format a
+    128-bit ID in a
+    printf(3)
+    format string, as shown in the following example:

int main(int argc, char *argv[]) {
+  sd_id128_t id;
+  id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
+  printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id));
+  return 0;
 }

Use sd_id128_equal() to compare two 128-bit IDs:

int main(int argc, char *argv[]) {
-        sd_id128_t a, b, c;
-        a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07);
-        b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e);
-        c = a;
-        assert(sd_id128_equal(a, c));
-        assert(!sd_id128_equal(a, b));
-        return 0;
-}

Note that new, randomized IDs may be generated - with - journalctl(1)'s - --new-id option.

Notes¶

These APIs are implemented as a shared + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; +}

Note that new, randomized IDs may be generated with + journalctl(1)'s + --new-id option.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/sd-id128.xml b/man/sd-id128.xml index d9ebb9c68..ea7972055 100644 --- a/man/sd-id128.xml +++ b/man/sd-id128.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd-id128 - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd-id128 - 3 - - - - sd-id128 - sd_id128_t - SD_ID128_MAKE - SD_ID128_CONST_STR - SD_ID128_FORMAT_STR - SD_ID128_FORMAT_VAL - sd_id128_equal - APIs for processing 128-bit IDs - - - - - #include <systemd/sd-id128.h> - - - - pkg-config --cflags --libs libsystemd - - - - - - Description - - sd-id128.h provides APIs to - process and generate 128-bit ID values. The 128-bit ID - values processed and generated by these APIs are a - generalization of OSF UUIDs as defined by RFC - 4122 but use a simpler string - format. These functions impose no structure on the - used IDs, much unlike OSF UUIDs or Microsoft GUIDs, - but are fully compatible with those types of IDs. - - - See - sd_id128_to_string3, - sd_id128_randomize3 and - sd_id128_get_machine3 - for more information about the implemented - functions. - - A 128-bit ID is implemented as the following - union type: - - typedef union sd_id128 { - uint8_t bytes[16]; - uint64_t qwords[2]; + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd-id128 + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd-id128 + 3 + + + + sd-id128 + sd_id128_t + SD_ID128_MAKE + SD_ID128_CONST_STR + SD_ID128_FORMAT_STR + SD_ID128_FORMAT_VAL + sd_id128_equal + APIs for processing 128-bit IDs + + + + + #include <systemd/sd-id128.h> + + + + pkg-config --cflags --libs libsystemd + + + + + + Description + + sd-id128.h provides APIs to process and + generate 128-bit ID values. The 128-bit ID values processed and + generated by these APIs are a generalization of OSF UUIDs as + defined by RFC + 4122 but use a simpler string format. These functions + impose no structure on the used IDs, much unlike OSF UUIDs or + Microsoft GUIDs, but are fully compatible with those types of IDs. + + + See + sd_id128_to_string3, + sd_id128_randomize3 + and + sd_id128_get_machine3 + for more information about the implemented functions. + + A 128-bit ID is implemented as the following + union type: + + typedef union sd_id128 { + uint8_t bytes[16]; + uint64_t qwords[2]; } sd_id128_t; - This union type allows accessing the 128-bit ID - as 16 separate bytes or two 64-bit words. It is generally - safer to access the ID components by their 8-bit array - to avoid endianness issues. This union is intended to - be passed call-by-value (as opposed to - call-by-reference) and may be directly manipulated by - clients. - - A couple of macros are defined to denote and - decode 128-bit IDs: - - SD_ID128_MAKE() may be used - to denote a constant 128-bit ID in source code. A - commonly used idiom is to assign a name to a 128-bit - ID using this macro: - - #define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1) - - SD_ID128_CONST_STR() may be - used to convert constant 128-bit IDs into constant - strings for output. The following example code will - output the string - "fc2e22bc6ee647b6b90729ab34a250b1": - int main(int argc, char *argv[]) { - puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP)); + This union type allows accessing the 128-bit ID as 16 + separate bytes or two 64-bit words. It is generally safer to + access the ID components by their 8-bit array to avoid endianness + issues. This union is intended to be passed call-by-value (as + opposed to call-by-reference) and may be directly manipulated by + clients. + + A couple of macros are defined to denote and decode 128-bit + IDs: + + SD_ID128_MAKE() may be used to denote a + constant 128-bit ID in source code. A commonly used idiom is to + assign a name to a 128-bit ID using this macro: + + #define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b9,07,29,ab,34,a2,50,b1) + + SD_ID128_CONST_STR() may be used to + convert constant 128-bit IDs into constant strings for output. The + following example code will output the string + "fc2e22bc6ee647b6b90729ab34a250b1": + int main(int argc, char *argv[]) { + puts(SD_ID128_CONST_STR(SD_MESSAGE_COREDUMP)); } - SD_ID128_FORMAT_STR and - SD_ID128_FORMAT_VAL() may be used - to format a 128-bit ID in a - printf3 - format string, as shown in the following - example: - - int main(int argc, char *argv[]) { - sd_id128_t id; - id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); - printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id)); - return 0; + SD_ID128_FORMAT_STR and + SD_ID128_FORMAT_VAL() may be used to format a + 128-bit ID in a + printf3 + format string, as shown in the following example: + + int main(int argc, char *argv[]) { + sd_id128_t id; + id = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + printf("The ID encoded in this C file is " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(id)); + return 0; } - Use sd_id128_equal() to compare two 128-bit IDs: + Use sd_id128_equal() to compare two 128-bit IDs: - int main(int argc, char *argv[]) { - sd_id128_t a, b, c; - a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); - b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); - c = a; - assert(sd_id128_equal(a, c)); - assert(!sd_id128_equal(a, b)); - return 0; + int main(int argc, char *argv[]) { + sd_id128_t a, b, c; + a = SD_ID128_MAKE(ee,89,be,71,bd,6e,43,d6,91,e6,c5,5d,eb,03,02,07); + b = SD_ID128_MAKE(f2,28,88,9c,5f,09,44,15,9d,d7,04,77,58,cb,e7,3e); + c = a; + assert(sd_id128_equal(a, c)); + assert(!sd_id128_equal(a, b)); + return 0; } - Note that new, randomized IDs may be generated - with - journalctl1's - option. - - - - - - See Also - - systemd1, - sd_id128_to_string3, - sd_id128_randomize3, - sd_id128_get_machine3, - printf3, - journalctl1, - sd-journal7, - pkg-config1, - machine-id5 - - + Note that new, randomized IDs may be generated with + journalctl1's + option. + + + + + + See Also + + systemd1, + sd_id128_to_string3, + sd_id128_randomize3, + sd_id128_get_machine3, + printf3, + journalctl1, + sd-journal7, + pkg-config1, + machine-id5 + + diff --git a/man/sd-journal.3 b/man/sd-journal.3 index e36d61da2..172b89bd9 100644 --- a/man/sd-journal.3 +++ b/man/sd-journal.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD\-JOURNAL" "3" "" "systemd 218" "sd-journal" +.TH "SD\-JOURNAL" "3" "" "systemd 219" "sd-journal" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd-journal.html b/man/sd-journal.html index 1e9c1e77c..15f9f52b7 100644 --- a/man/sd-journal.html +++ b/man/sd-journal.html @@ -19,55 +19,53 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-journal — APIs for submitting and querying log entries to and from the journal

Synopsis

#include <systemd/sd-journal.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-journal.h provides APIs - to submit and query log entries. The APIs exposed act - both as client for the - systemd-journald.service(8) - journal service and as parser for the journal files - on disk. -

See - sd_journal_print(3), - sd_journal_stream_fd(3), - sd_journal_open(3), - sd_journal_next(3), - sd_journal_get_realtime_usec(3), - sd_journal_add_match(3), - sd_journal_seek_head(3), - sd_journal_get_cursor(3), - sd_journal_get_cutoff_realtime_usec(3), - sd_journal_get_cutoff_monotonic_usec(3), - sd_journal_get_usage(3), - sd_journal_get_catalog(3) - and - sd_journal_get_fd(3) - for more information about the functions - implemented.

Command line access for submitting entries to - the journal is available with the - systemd-cat(1) - tool. Command line access for querying entries from - the journal is available with the - journalctl(1) - tool.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd-journal — APIs for submitting and querying log entries to and + from the journal

Synopsis

#include <systemd/sd-journal.h>

pkg-config --cflags --libs libsystemd

Description¶

sd-journal.h provides APIs to submit + and query log entries. The APIs exposed act both as client for the + systemd-journald.service(8) + journal service and as parser for the journal files on disk. +

See + sd_journal_print(3), + sd_journal_stream_fd(3), + sd_journal_open(3), + sd_journal_next(3), + sd_journal_get_realtime_usec(3), + sd_journal_add_match(3), + sd_journal_seek_head(3), + sd_journal_get_cursor(3), + sd_journal_get_cutoff_realtime_usec(3), + sd_journal_get_cutoff_monotonic_usec(3), + sd_journal_get_usage(3), + sd_journal_get_catalog(3) + and + sd_journal_get_fd(3) + for more information about the functions implemented.

Command line access for submitting entries to the journal is + available with the + systemd-cat(1) + tool. Command line access for querying entries from the journal is + available with the + journalctl(1) + tool.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/sd-journal.xml b/man/sd-journal.xml index edf7c32d6..9b1a52207 100644 --- a/man/sd-journal.xml +++ b/man/sd-journal.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd-journal - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd-journal - 3 - - - - sd-journal - APIs for submitting and querying log entries to and from the journal - - - - - #include <systemd/sd-journal.h> - - - - pkg-config --cflags --libs libsystemd - - - - - - Description - - sd-journal.h provides APIs - to submit and query log entries. The APIs exposed act - both as client for the - systemd-journald.service8 - journal service and as parser for the journal files - on disk. - - - See - sd_journal_print3, - sd_journal_stream_fd3, - sd_journal_open3, - sd_journal_next3, - sd_journal_get_realtime_usec3, - sd_journal_add_match3, - sd_journal_seek_head3, - sd_journal_get_cursor3, - sd_journal_get_cutoff_realtime_usec3, - sd_journal_get_cutoff_monotonic_usec3, - sd_journal_get_usage3, - sd_journal_get_catalog3 - and - sd_journal_get_fd3 - for more information about the functions - implemented. - - Command line access for submitting entries to - the journal is available with the - systemd-cat1 - tool. Command line access for querying entries from - the journal is available with the - journalctl1 - tool. - - - - - - See Also - - systemd1, - sd_journal_print3, - sd_journal_stream_fd3, - sd_journal_open3, - sd_journal_next3, - sd_journal_get_data3, - sd_journal_get_realtime_usec3, - sd_journal_add_match3, - sd_journal_seek_head3, - sd_journal_get_cursor3, - sd_journal_get_cutoff_realtime_usec3, - sd_journal_get_cutoff_monotonic_usec3, - sd_journal_get_usage3, - sd_journal_get_fd3, - sd_journal_query_unique3, - sd_journal_get_catalog3, - journalctl1, - sd-id1283, - pkg-config1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd-journal + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd-journal + 3 + + + + sd-journal + APIs for submitting and querying log entries to and + from the journal + + + + + #include <systemd/sd-journal.h> + + + + pkg-config --cflags --libs libsystemd + + + + + + Description + + sd-journal.h provides APIs to submit + and query log entries. The APIs exposed act both as client for the + systemd-journald.service8 + journal service and as parser for the journal files on disk. + + + See + sd_journal_print3, + sd_journal_stream_fd3, + sd_journal_open3, + sd_journal_next3, + sd_journal_get_realtime_usec3, + sd_journal_add_match3, + sd_journal_seek_head3, + sd_journal_get_cursor3, + sd_journal_get_cutoff_realtime_usec3, + sd_journal_get_cutoff_monotonic_usec3, + sd_journal_get_usage3, + sd_journal_get_catalog3 + and + sd_journal_get_fd3 + for more information about the functions implemented. + + Command line access for submitting entries to the journal is + available with the + systemd-cat1 + tool. Command line access for querying entries from the journal is + available with the + journalctl1 + tool. + + + + + + See Also + + systemd1, + sd_journal_print3, + sd_journal_stream_fd3, + sd_journal_open3, + sd_journal_next3, + sd_journal_get_data3, + sd_journal_get_realtime_usec3, + sd_journal_add_match3, + sd_journal_seek_head3, + sd_journal_get_cursor3, + sd_journal_get_cutoff_realtime_usec3, + sd_journal_get_cutoff_monotonic_usec3, + sd_journal_get_usage3, + sd_journal_get_fd3, + sd_journal_query_unique3, + sd_journal_get_catalog3, + journalctl1, + sd-id1283, + pkg-config1 + + diff --git a/man/sd-login.3 b/man/sd-login.3 index 019d1c296..be009f4de 100644 --- a/man/sd-login.3 +++ b/man/sd-login.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD\-LOGIN" "3" "" "systemd 218" "sd-login" +.TH "SD\-LOGIN" "3" "" "systemd 219" "sd-login" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd-login.html b/man/sd-login.html index db6c9fabb..9e00e8723 100644 --- a/man/sd-login.html +++ b/man/sd-login.html @@ -19,56 +19,53 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd-login — APIs for - tracking logins

Synopsis

#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.

See Multi-Seat - on Linux for an introduction into multi-seat - support on Linux, the background for this set of APIs.

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 - free(3) - 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_session(3), - sd_uid_get_state(3), - sd_session_is_active(3), - sd_seat_get_active(3), - sd_get_seats(3), - sd_login_monitor_new(3) - for more information about the functions - implemented.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd-login — APIs for + tracking logins

Synopsis

#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.

See Multi-Seat + on Linux for an introduction into multi-seat support on + Linux, the background for this set of APIs.

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 + free(3) + 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_session(3), + sd_uid_get_state(3), + sd_session_is_active(3), + sd_seat_get_active(3), + sd_get_seats(3), + sd_login_monitor_new(3) + for more information about the functions + implemented.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

+ file.

diff --git a/man/sd-login.xml b/man/sd-login.xml index f21170db1..328f71164 100644 --- a/man/sd-login.xml +++ b/man/sd-login.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - 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. - - See Multi-Seat - on Linux for an introduction into multi-seat - support on Linux, the background for this set of APIs. - - 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. - - - - - - 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 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + 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. + + See Multi-Seat + on Linux for an introduction into multi-seat support on + Linux, the background for this set of APIs. + + 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. + + + + + + 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 + + diff --git a/man/sd_booted.3 b/man/sd_booted.3 index cf89dbf80..90f0d1b85 100644 --- a/man/sd_booted.3 +++ b/man/sd_booted.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BOOTED" "3" "" "systemd 218" "sd_booted" +.TH "SD_BOOTED" "3" "" "systemd 219" "sd_booted" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_booted.html b/man/sd_booted.html index 394ad6322..76613790e 100644 --- a/man/sd_booted.html +++ b/man/sd_booted.html @@ -19,18 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_booted — Test whether the system is running the systemd init system

Synopsis

#include <systemd/sd-daemon.h>
int sd_booted(void);
 

Description¶

sd_booted() checks whether - the system was booted up using the systemd init system.

Return Value¶

On failure, this call returns a negative - errno-style error code. If the system was booted up - with systemd as init system, this call returns a - positive return value, zero otherwise.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_booted — Test whether the system is running the systemd init system

Synopsis

#include <systemd/sd-daemon.h>
int sd_booted(void);
 

Description¶

sd_booted() checks whether the system + was booted up using the systemd init system.

Return Value¶

On failure, this call returns a negative errno-style error + code. If the system was booted up with systemd as init system, + this call returns a positive return value, zero otherwise.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

Internally, this function checks whether the - directory /run/systemd/system/ - exists. A simple check like this can also be - implemented trivially in shell or any other - language.

See Also¶

- systemd(1), - sd-daemon(3) -

+ file.

Internally, this function checks whether the directory + /run/systemd/system/ exists. A simple check + like this can also be implemented trivially in shell or any other + language.

See Also¶

+ systemd(1), + sd-daemon(3) +

diff --git a/man/sd_booted.xml b/man/sd_booted.xml index 28c153a32..4dd674b8e 100644 --- a/man/sd_booted.xml +++ b/man/sd_booted.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd_booted - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_booted - 3 - - - - sd_booted - Test whether the system is running the systemd init system - - - - - #include <systemd/sd-daemon.h> - - - int sd_booted - void - - - - - - Description - sd_booted() checks whether - the system was booted up using the systemd init system. - - - - Return Value - - On failure, this call returns a negative - errno-style error code. If the system was booted up - with systemd as init system, this call returns a - positive return value, zero otherwise. - - - - Notes - - - - Internally, this function checks whether the - directory /run/systemd/system/ - exists. A simple check like this can also be - implemented trivially in shell or any other - language. - - - - See Also - - systemd1, - sd-daemon3 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd_booted + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_booted + 3 + + + + sd_booted + Test whether the system is running the systemd init system + + + + + #include <systemd/sd-daemon.h> + + + int sd_booted + void + + + + + + Description + sd_booted() checks whether the system + was booted up using the systemd init system. + + + + Return Value + + On failure, this call returns a negative errno-style error + code. If the system was booted up with systemd as init system, + this call returns a positive return value, zero otherwise. + + + + Notes + + + + Internally, this function checks whether the directory + /run/systemd/system/ exists. A simple check + like this can also be implemented trivially in shell or any other + language. + + + + See Also + + systemd1, + sd-daemon3 + + diff --git a/man/sd_bus_creds_get_audit_login_uid.html b/man/sd_bus_creds_get_audit_login_uid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_audit_login_uid.html +++ b/man/sd_bus_creds_get_audit_login_uid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_audit_session_id.html b/man/sd_bus_creds_get_audit_session_id.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_audit_session_id.html +++ b/man/sd_bus_creds_get_audit_session_id.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_cgroup.html b/man/sd_bus_creds_get_cgroup.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_cgroup.html +++ b/man/sd_bus_creds_get_cgroup.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_cmdline.html b/man/sd_bus_creds_get_cmdline.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_cmdline.html +++ b/man/sd_bus_creds_get_cmdline.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_comm.html b/man/sd_bus_creds_get_comm.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_comm.html +++ b/man/sd_bus_creds_get_comm.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_connection_name.html b/man/sd_bus_creds_get_connection_name.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_connection_name.html +++ b/man/sd_bus_creds_get_connection_name.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_exe.html b/man/sd_bus_creds_get_exe.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_exe.html +++ b/man/sd_bus_creds_get_exe.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_gid.html b/man/sd_bus_creds_get_gid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_gid.html +++ b/man/sd_bus_creds_get_gid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_mask.html b/man/sd_bus_creds_get_mask.html index 86c95aaca..d2d81a4ad 100644 --- a/man/sd_bus_creds_get_mask.html +++ b/man/sd_bus_creds_get_mask.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

+ gudev systemd 219


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

SD_BUS_CREDS_PID, SD_BUS_CREDS_TID, SD_BUS_CREDS_UID, @@ -44,7 +44,7 @@ SD_BUS_CREDS_UNIQUE_NAME, SD_BUS_CREDS_WELL_KNOWN_NAMES, _SD_BUS_CREDS_ALL -

Description¶

sd_bus_creds_new_from_pid() creates a new +

Description¶

sd_bus_creds_new_from_pid() creates a new credentials object and fills it with information about the process pid. This pointer to this object will be stored in ret pointer.

The information that will be stored is determined by @@ -90,23 +90,23 @@ c cannot be used anymore, so further calls to sd_bus_creds_ref(c) or sd_bus_creds_unref(c) are illegal.

sd_bus_creds_unref destroys a reference - to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() + to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

sd_bus_creds_get_mask() returns the mask of successfully acquired fields.

sd_bus_creds_ref always returns the argument.

sd_bus_creds_unref always returns - NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() + NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() creates a new object and the caller owns the sole reference. When not needed anymore, this reference should be destroyed with sd_bus_creds_unref(3). -

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not +

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not be found.

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_creds_ref(3), diff --git a/man/sd_bus_creds_get_owner_uid.html b/man/sd_bus_creds_get_owner_uid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_owner_uid.html +++ b/man/sd_bus_creds_get_owner_uid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_pid.3 b/man/sd_bus_creds_get_pid.3 index 22637869b..b635d8c65 100644 --- a/man/sd_bus_creds_get_pid.3 +++ b/man/sd_bus_creds_get_pid.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_CREDS_GET_PID" "3" "" "systemd 218" "sd_bus_creds_get_pid" +.TH "SD_BUS_CREDS_GET_PID" "3" "" "systemd 219" "sd_bus_creds_get_pid" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_creds_get_pid.html b/man/sd_bus_creds_get_pid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_pid.html +++ b/man/sd_bus_creds_get_pid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_selinux_context.html b/man/sd_bus_creds_get_selinux_context.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_selinux_context.html +++ b/man/sd_bus_creds_get_selinux_context.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_session.html b/man/sd_bus_creds_get_session.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_session.html +++ b/man/sd_bus_creds_get_session.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_slice.html b/man/sd_bus_creds_get_slice.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_slice.html +++ b/man/sd_bus_creds_get_slice.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_tid.html b/man/sd_bus_creds_get_tid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_tid.html +++ b/man/sd_bus_creds_get_tid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_tid_comm.html b/man/sd_bus_creds_get_tid_comm.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_tid_comm.html +++ b/man/sd_bus_creds_get_tid_comm.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_uid.html b/man/sd_bus_creds_get_uid.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_uid.html +++ b/man/sd_bus_creds_get_uid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_unique_name.html b/man/sd_bus_creds_get_unique_name.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_unique_name.html +++ b/man/sd_bus_creds_get_unique_name.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_unit.html b/man/sd_bus_creds_get_unit.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_unit.html +++ b/man/sd_bus_creds_get_unit.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_user_unit.html b/man/sd_bus_creds_get_user_unit.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_user_unit.html +++ b/man/sd_bus_creds_get_user_unit.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_get_well_known_names.html b/man/sd_bus_creds_get_well_known_names.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_get_well_known_names.html +++ b/man/sd_bus_creds_get_well_known_names.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_has_bounding_cap.html b/man/sd_bus_creds_has_bounding_cap.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_has_bounding_cap.html +++ b/man/sd_bus_creds_has_bounding_cap.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_has_effective_cap.html b/man/sd_bus_creds_has_effective_cap.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_has_effective_cap.html +++ b/man/sd_bus_creds_has_effective_cap.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_has_inheritable_cap.html b/man/sd_bus_creds_has_inheritable_cap.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_has_inheritable_cap.html +++ b/man/sd_bus_creds_has_inheritable_cap.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_has_permitted_cap.html b/man/sd_bus_creds_has_permitted_cap.html index ed9c58cd6..99ec168f0 100644 --- a/man/sd_bus_creds_has_permitted_cap.html +++ b/man/sd_bus_creds_has_permitted_cap.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an + gudev systemd 219


Name

sd_bus_creds_get_pid, sd_bus_creds_get_tid, sd_bus_creds_get_uid, sd_bus_creds_get_gid, sd_bus_creds_get_comm, sd_bus_creds_get_tid_comm, sd_bus_creds_get_exe, sd_bus_creds_get_cmdline, sd_bus_creds_get_cgroup, sd_bus_creds_get_unit, sd_bus_creds_get_user_unit, sd_bus_creds_get_slice, sd_bus_creds_get_session, sd_bus_creds_get_owner_uid, sd_bus_creds_has_effective_cap, sd_bus_creds_has_permitted_cap, sd_bus_creds_has_inheritable_cap, sd_bus_creds_has_bounding_cap, sd_bus_creds_get_selinux_context, sd_bus_creds_get_audit_session_id, sd_bus_creds_get_audit_login_uid, sd_bus_creds_get_unique_name, sd_bus_creds_get_well_known_names, sd_bus_creds_get_connection_name — Retrieve fields from a credentials object

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_get_pid(sd_bus_creds *c,
 pid_t *pid);
 
int sd_bus_creds_get_tid(sd_bus_creds *c,
 pid_t *tid);
 
int sd_bus_creds_get_pid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_get_gid(sd_bus_creds *c,
 gid_t *gid);
 
int sd_bus_creds_get_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_tid_comm(sd_bus_creds *c,
 const char **comm);
 
int sd_bus_creds_get_exe(sd_bus_creds *c,
 const char **exe);
 
int sd_bus_creds_get_cmdline(sd_bus_creds *c,
 char ***cmdline);
 
int sd_bus_creds_get_cgroup(sd_bus_creds *c,
 const char **cgroup);
 
int sd_bus_creds_get_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_user_unit(sd_bus_creds *c,
 const char **unit);
 
int sd_bus_creds_get_slice(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_session(sd_bus_creds *c,
 const char **slice);
 
int sd_bus_creds_get_owner_uid(sd_bus_creds *c,
 uid_t *uid);
 
int sd_bus_creds_has_effective_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c,
 int capability);
 
int sd_bus_creds_get_selinux_context(sd_bus_creds *c,
 const char **context);
 
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c,
 uint32_t *sessionid);
 
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c,
 uid_t *loginuid);
 
int sd_bus_creds_get_unique_name(sd_bus_creds *c,
 const char **name);
 
int sd_bus_creds_get_well_known_names(sd_bus_creds *c,
 char ***name);
 
int sd_bus_creds_get_connection_name(sd_bus_creds *c,
 const char **name);
 

Description¶

These functions return information from an sd_bus_creds object. It may be created with sd_bus_creds_new_from_pid(3), in which case it will describe the specified process, or it may be @@ -104,9 +104,9 @@ of strings. Each invidividual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or - modified by the caller.

Return Value¶

On success, these calls return 0 or a positive integer. On + modified by the caller.

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:

-ENODATA¶

Given field is not available in +

Errors¶

Returned errors may indicate the following problems:

-ENODATA¶

Given field is not available in c.

-ENOENT¶

Given field is not specified for the sender. This will be returned by sd_bus_get_unit(), sd_bus_get_user_unit(), @@ -117,11 +117,11 @@ slice, logind session, or a systemd user session.

-ENXIO¶

An error occurred in parsing cgroup paths. libsystemd might be out of sync with the running systemd version.

-EINVAL¶

Specified pointer parameter is NULL. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), fork(2), diff --git a/man/sd_bus_creds_new_from_pid.3 b/man/sd_bus_creds_new_from_pid.3 index b49b10ce3..2a4a81332 100644 --- a/man/sd_bus_creds_new_from_pid.3 +++ b/man/sd_bus_creds_new_from_pid.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_CREDS_NEW_FROM_PID" "3" "" "systemd 218" "sd_bus_creds_new_from_pid" +.TH "SD_BUS_CREDS_NEW_FROM_PID" "3" "" "systemd 219" "sd_bus_creds_new_from_pid" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_creds_new_from_pid.html b/man/sd_bus_creds_new_from_pid.html index 86c95aaca..d2d81a4ad 100644 --- a/man/sd_bus_creds_new_from_pid.html +++ b/man/sd_bus_creds_new_from_pid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

+ gudev systemd 219


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

SD_BUS_CREDS_PID, SD_BUS_CREDS_TID, SD_BUS_CREDS_UID, @@ -44,7 +44,7 @@ SD_BUS_CREDS_UNIQUE_NAME, SD_BUS_CREDS_WELL_KNOWN_NAMES, _SD_BUS_CREDS_ALL -

Description¶

sd_bus_creds_new_from_pid() creates a new +

Description¶

sd_bus_creds_new_from_pid() creates a new credentials object and fills it with information about the process pid. This pointer to this object will be stored in ret pointer.

The information that will be stored is determined by @@ -90,23 +90,23 @@ c cannot be used anymore, so further calls to sd_bus_creds_ref(c) or sd_bus_creds_unref(c) are illegal.

sd_bus_creds_unref destroys a reference - to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() + to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

sd_bus_creds_get_mask() returns the mask of successfully acquired fields.

sd_bus_creds_ref always returns the argument.

sd_bus_creds_unref always returns - NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() + NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() creates a new object and the caller owns the sole reference. When not needed anymore, this reference should be destroyed with sd_bus_creds_unref(3). -

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not +

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not be found.

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_creds_ref(3), diff --git a/man/sd_bus_creds_new_from_pid.xml b/man/sd_bus_creds_new_from_pid.xml index b012d151f..518a95abd 100644 --- a/man/sd_bus_creds_new_from_pid.xml +++ b/man/sd_bus_creds_new_from_pid.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_bus_creds_ref.html b/man/sd_bus_creds_ref.html index 86c95aaca..d2d81a4ad 100644 --- a/man/sd_bus_creds_ref.html +++ b/man/sd_bus_creds_ref.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

+ gudev systemd 219


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

SD_BUS_CREDS_PID, SD_BUS_CREDS_TID, SD_BUS_CREDS_UID, @@ -44,7 +44,7 @@ SD_BUS_CREDS_UNIQUE_NAME, SD_BUS_CREDS_WELL_KNOWN_NAMES, _SD_BUS_CREDS_ALL -

Description¶

sd_bus_creds_new_from_pid() creates a new +

Description¶

sd_bus_creds_new_from_pid() creates a new credentials object and fills it with information about the process pid. This pointer to this object will be stored in ret pointer.

The information that will be stored is determined by @@ -90,23 +90,23 @@ c cannot be used anymore, so further calls to sd_bus_creds_ref(c) or sd_bus_creds_unref(c) are illegal.

sd_bus_creds_unref destroys a reference - to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() + to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

sd_bus_creds_get_mask() returns the mask of successfully acquired fields.

sd_bus_creds_ref always returns the argument.

sd_bus_creds_unref always returns - NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() + NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() creates a new object and the caller owns the sole reference. When not needed anymore, this reference should be destroyed with sd_bus_creds_unref(3). -

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not +

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not be found.

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_creds_ref(3), diff --git a/man/sd_bus_creds_unref.html b/man/sd_bus_creds_unref.html index 86c95aaca..d2d81a4ad 100644 --- a/man/sd_bus_creds_unref.html +++ b/man/sd_bus_creds_unref.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

+ gudev systemd 219


Name

sd_bus_creds_new_from_pid, sd_bus_creds_get_mask, sd_bus_creds_ref, sd_bus_creds_unref — Retrieve credentials object for the specified PID

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_creds_new_from_pid(pid_t pid,
 uint64_t creds_mask,
 sd_bus_creds **ret);
 
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c);
 
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c);
 

SD_BUS_CREDS_PID, SD_BUS_CREDS_TID, SD_BUS_CREDS_UID, @@ -44,7 +44,7 @@ SD_BUS_CREDS_UNIQUE_NAME, SD_BUS_CREDS_WELL_KNOWN_NAMES, _SD_BUS_CREDS_ALL -

Description¶

sd_bus_creds_new_from_pid() creates a new +

Description¶

sd_bus_creds_new_from_pid() creates a new credentials object and fills it with information about the process pid. This pointer to this object will be stored in ret pointer.

The information that will be stored is determined by @@ -90,23 +90,23 @@ c cannot be used anymore, so further calls to sd_bus_creds_ref(c) or sd_bus_creds_unref(c) are illegal.

sd_bus_creds_unref destroys a reference - to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() + to c.

Return Value¶

On success, sd_bus_creds_new_from_pid() returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

sd_bus_creds_get_mask() returns the mask of successfully acquired fields.

sd_bus_creds_ref always returns the argument.

sd_bus_creds_unref always returns - NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() + NULL.

Reference ownership¶

Function sd_bus_creds_new_from_pid() creates a new object and the caller owns the sole reference. When not needed anymore, this reference should be destroyed with sd_bus_creds_unref(3). -

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not +

Errors¶

Returned errors may indicate the following problems:

-ESRCH¶

Specified pid could not be found.

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_creds_new_from_pid() is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_creds_ref(3), diff --git a/man/sd_bus_default_system.html b/man/sd_bus_default_system.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_default_system.html +++ b/man/sd_bus_default_system.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_default_user.html b/man/sd_bus_default_user.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_default_user.html +++ b/man/sd_bus_default_user.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_error.3 b/man/sd_bus_error.3 index a4a4086d6..a4a081a93 100644 --- a/man/sd_bus_error.3 +++ b/man/sd_bus_error.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_ERROR" "3" "" "systemd 218" "sd_bus_error" +.TH "SD_BUS_ERROR" "3" "" "systemd 219" "sd_bus_error" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_error.html b/man/sd_bus_error.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error.html +++ b/man/sd_bus_error.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_copy.html b/man/sd_bus_error_copy.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_copy.html +++ b/man/sd_bus_error_copy.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_free.html b/man/sd_bus_error_free.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_free.html +++ b/man/sd_bus_error_free.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_get_errno.html b/man/sd_bus_error_get_errno.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_get_errno.html +++ b/man/sd_bus_error_get_errno.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_has_name.html b/man/sd_bus_error_has_name.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_has_name.html +++ b/man/sd_bus_error_has_name.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_is_set.html b/man/sd_bus_error_is_set.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_is_set.html +++ b/man/sd_bus_error_is_set.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_set.html b/man/sd_bus_error_set.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_set.html +++ b/man/sd_bus_error_set.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_set_const.html b/man/sd_bus_error_set_const.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_set_const.html +++ b/man/sd_bus_error_set_const.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_set_errno.html b/man/sd_bus_error_set_errno.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_set_errno.html +++ b/man/sd_bus_error_set_errno.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_error_set_errnof.html b/man/sd_bus_error_set_errnof.html index 54d97a3da..3797f4e61 100644 --- a/man/sd_bus_error_set_errnof.html +++ b/man/sd_bus_error_set_errnof.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
+  gudev systemd 219

Name

sd_bus_error, sd_bus_error_free, sd_bus_error_set, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, sd_bus_error_has_name — sd-bus error handling

Synopsis

#include <systemd/sd-bus.h>
typedef struct {
         const char *name;
         const char *message;
         ...
@@ -85,7 +85,7 @@
       SD_BUS_ERROR_MATCH_RULE_NOT_FOUND
     

SD_BUS_ERROR_MATCH_RULE_INVALID -

Description¶

The sd_bus_error structure carries +

Description¶

The sd_bus_error structure carries information for a sd-bus error. The functions described below can be used to set and query fields in this structure. The name field contains a @@ -154,7 +154,7 @@ held by e. The parameter itself will not be deallocated, and must be free(3)d - by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, + by the caller if necessary.

Return Value¶

Functions sd_bus_error_set, sd_bus_error_setf, sd_bus_error_set_const, when successful, return the negative errno value corresponding to the @@ -175,15 +175,15 @@ true when e is non-NULL and e->name is equal to name, - false otherwise.

Reference ownership¶

sd_bus_error is not reference + false otherwise.

Reference ownership¶

sd_bus_error is not reference counted. Users should destroy resources held by it by calling - sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in + sd_bus_error_free.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Error was already set in sd_bus_error structure when one the - error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions + error-setting functions was called.

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_set_error() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), errno(3), diff --git a/man/sd_bus_message_append.3 b/man/sd_bus_message_append.3 index e31a0b6cf..674b2c65f 100644 --- a/man/sd_bus_message_append.3 +++ b/man/sd_bus_message_append.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_MESSAGE_APPEND" "3" "" "systemd 218" "sd_bus_message_append" +.TH "SD_BUS_MESSAGE_APPEND" "3" "" "systemd 219" "sd_bus_message_append" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_message_append.html b/man/sd_bus_message_append.html index 1802f9a1c..5b7d49bb5 100644 --- a/man/sd_bus_message_append.html +++ b/man/sd_bus_message_append.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append — Attach parts of message based on a format string

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append(sd_bus_message *m,
 const char *types,
 ...);
 

Description¶

The sd_bus_message_append function appends + gudev systemd 219


Name

sd_bus_message_append — Attach parts of message based on a format string

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append(sd_bus_message *m,
 const char *types,
 ...);
 

Description¶

The sd_bus_message_append function appends a sequence of items to message m. The format string types describes the types of arguments that follow.

The format string is composed of the elements shown in the @@ -45,7 +45,7 @@ types must be a basic type. Corresponding arguments must include the size of the dictionary, and then repeated this number of times, arguments corresponding to each of the two nested - types.

Table 1. Item format specifiers

SpecifierConstantDescriptionSize
"y"SD_BUS_TYPE_BYTEunsigned integer1 byte
"b"SD_BUS_TYPE_BOOLEANboolean4 bytes
"n"SD_BUS_TYPE_INT16signed integer2 bytes
"q"SD_BUS_TYPE_UINT16unsigned integer2 bytes
"i"SD_BUS_TYPE_INT32signed integer4 bytes
"u"SD_BUS_TYPE_UINT32unsigned integer4 bytes
"x"SD_BUS_TYPE_INT64signed integer8 bytes
"t"SD_BUS_TYPE_UINT64unsigned integer8 bytes
"d"SD_BUS_TYPE_DOUBLEfloating-point8 bytes
"s"SD_BUS_TYPE_STRINGUnicode stringvariable
"o"SD_BUS_TYPE_OBJECT_PATHobject pathvariable
"g"SD_BUS_TYPE_SIGNATUREsignaturevariable
"h"SD_BUS_TYPE_UNIX_FDUNIX file descriptor4 bytes
"a"SD_BUS_TYPE_ARRAYarraydetermined by array type and size
"v"SD_BUS_TYPE_VARIANTvariantdetermined by the type argument
"("SD_BUS_TYPE_STRUCT_BEGINarray startdetermined by the nested types
")"SD_BUS_TYPE_STRUCT_ENDarray end
"{"SD_BUS_TYPE_DICT_ENTRY_BEGINdictionary entry startdetermined by the nested types
"}"SD_BUS_TYPE_DICT_ENTRY_ENDdictionary entry end

Types string grammar¶

types ::= complete_type*
+    types.

Table 1. Item format specifiers

SpecifierConstantDescriptionSize
"y"SD_BUS_TYPE_BYTEunsigned integer1 byte
"b"SD_BUS_TYPE_BOOLEANboolean4 bytes
"n"SD_BUS_TYPE_INT16signed integer2 bytes
"q"SD_BUS_TYPE_UINT16unsigned integer2 bytes
"i"SD_BUS_TYPE_INT32signed integer4 bytes
"u"SD_BUS_TYPE_UINT32unsigned integer4 bytes
"x"SD_BUS_TYPE_INT64signed integer8 bytes
"t"SD_BUS_TYPE_UINT64unsigned integer8 bytes
"d"SD_BUS_TYPE_DOUBLEfloating-point8 bytes
"s"SD_BUS_TYPE_STRINGUnicode stringvariable
"o"SD_BUS_TYPE_OBJECT_PATHobject pathvariable
"g"SD_BUS_TYPE_SIGNATUREsignaturevariable
"h"SD_BUS_TYPE_UNIX_FDUNIX file descriptor4 bytes
"a"SD_BUS_TYPE_ARRAYarraydetermined by array type and size
"v"SD_BUS_TYPE_VARIANTvariantdetermined by the type argument
"("SD_BUS_TYPE_STRUCT_BEGINarray startdetermined by the nested types
")"SD_BUS_TYPE_STRUCT_ENDarray end
"{"SD_BUS_TYPE_DICT_ENTRY_BEGINdictionary entry startdetermined by the nested types
"}"SD_BUS_TYPE_DICT_ENTRY_ENDdictionary entry end

Types string grammar¶

types ::= complete_type*
 complete_type ::= basic_type | variant | structure | array | dictionary
 basic_type ::= "y" | "n" | "q" | "u" | "i" | "x" | "t" | "d" |
                "b" | "h" |
@@ -54,7 +54,7 @@ variant ::= "v"
 structure ::= "(" complete_type+ ")"
 array ::= "a" complete_type
 dictionary ::= "a" "{" basic_type complete_type "}"
-

Examples¶

Append a single basic type (the string "a string"): +

Examples¶

Append a single basic type (the string "a string"):

sd_bus_message *m;
 ...
 sd_bus_message_append(m, "s", "a string");

Append all types of integers:

uint8_t y = 1;
@@ -70,17 +70,17 @@ sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d);

Append a s

Append a variant, with the real type "g" (signature), and value "sdbusisgood":

sd_bus_message_append(m, "v", "g", "sdbusisgood");

Append a dictionary containing the mapping {1=>"a", 2=>"b", 3=>""}:

sd_bus_message_append(m, "a{is}", 3, 1, "a", 2, "b", 3, NULL);
-     

Return Value¶

On success, this call returns 0 or a positive +

Return Value¶

On success, this call returns 0 or a positive integer. On failure, this call returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd-bus pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_message_append.xml b/man/sd_bus_message_append.xml index e3de69873..0c49a0c7c 100644 --- a/man/sd_bus_message_append.xml +++ b/man/sd_bus_message_append.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc + gudev systemd 219


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc appends items to message m as the single array. A container will be opened, items appended, and the container closed. Parameter type determines @@ -69,16 +69,16 @@ sd_bus_message_append_array, but instead of copying items to the message, it returns a pointer to the destination area to the caller in pointer p. -

Return Value¶

On success, these calls return 0 or a positive integer. On +

Return Value¶

On success, these calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_array_iovec.html b/man/sd_bus_message_append_array_iovec.html index c20117d0e..9480355f9 100644 --- a/man/sd_bus_message_append_array_iovec.html +++ b/man/sd_bus_message_append_array_iovec.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc + gudev systemd 219


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc appends items to message m as the single array. A container will be opened, items appended, and the container closed. Parameter type determines @@ -69,16 +69,16 @@ sd_bus_message_append_array, but instead of copying items to the message, it returns a pointer to the destination area to the caller in pointer p. -

Return Value¶

On success, these calls return 0 or a positive integer. On +

Return Value¶

On success, these calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_array_memfd.html b/man/sd_bus_message_append_array_memfd.html index c20117d0e..9480355f9 100644 --- a/man/sd_bus_message_append_array_memfd.html +++ b/man/sd_bus_message_append_array_memfd.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc + gudev systemd 219


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc appends items to message m as the single array. A container will be opened, items appended, and the container closed. Parameter type determines @@ -69,16 +69,16 @@ sd_bus_message_append_array, but instead of copying items to the message, it returns a pointer to the destination area to the caller in pointer p. -

Return Value¶

On success, these calls return 0 or a positive integer. On +

Return Value¶

On success, these calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_array_space.html b/man/sd_bus_message_append_array_space.html index c20117d0e..9480355f9 100644 --- a/man/sd_bus_message_append_array_space.html +++ b/man/sd_bus_message_append_array_space.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc + gudev systemd 219


Name

sd_bus_message_append_array, sd_bus_message_append_array_memfd, sd_bus_message_append_array_iovec, sd_bus_message_append_array_space — Attach an array of items to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_array(sd_bus_message *m,
 char type,
 char void *ptr,
 size_t size);
 
int sd_bus_message_append_array_memfd(sd_bus_message *m,
 char type,
 int memfd);
 
int sd_bus_message_append_array_iovec(sd_bus_message *m,
 char type,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_array_space(char type,
 size_t size,
 char void **ptr);
 

Description¶

The sd_bus_message_append_array functionc appends items to message m as the single array. A container will be opened, items appended, and the container closed. Parameter type determines @@ -69,16 +69,16 @@ sd_bus_message_append_array, but instead of copying items to the message, it returns a pointer to the destination area to the caller in pointer p. -

Return Value¶

On success, these calls return 0 or a positive integer. On +

Return Value¶

On success, these calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other +

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_append_array() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_basic.3 b/man/sd_bus_message_append_basic.3 index 59fa080fc..62ed8af11 100644 --- a/man/sd_bus_message_append_basic.3 +++ b/man/sd_bus_message_append_basic.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_MESSAGE_APPEND_BASIC" "3" "" "systemd 218" "sd_bus_message_append_basic" +.TH "SD_BUS_MESSAGE_APPEND_BASIC" "3" "" "systemd 219" "sd_bus_message_append_basic" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_message_append_basic.html b/man/sd_bus_message_append_basic.html index a776165c1..318ea3649 100644 --- a/man/sd_bus_message_append_basic.html +++ b/man/sd_bus_message_append_basic.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_basic — Attach a single part to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_basic(sd_bus_message *m,
 char type,
 char void *p);
 

Description¶

sd_bus_message_append_basic appends a + gudev systemd 219


Name

sd_bus_message_append_basic — Attach a single part to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_basic(sd_bus_message *m,
 char type,
 char void *p);
 

Description¶

sd_bus_message_append_basic appends a single item to the message m. Parameter type determines how pointer p is interpreted. @@ -41,16 +41,16 @@ types, the additional requirements for a D-Bus object path or type signature should be satisfied. Those requirements should be verified by the recipient of the message. -

Return Value¶

On success, this call returns 0 or a positive integer. On +

Return Value¶

On success, this call returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

The sd_bus_append_basic() function +

-ENOMEM¶

Memory allocation failed.

Notes¶

The sd_bus_append_basic() function described here is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_basic.xml b/man/sd_bus_message_append_basic.xml index bd25a4a99..344b7791f 100644 --- a/man/sd_bus_message_append_basic.xml +++ b/man/sd_bus_message_append_basic.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_bus_message_append_string_iovec.html b/man/sd_bus_message_append_string_iovec.html index 0c49d7d2a..6a22d4636 100644 --- a/man/sd_bus_message_append_string_iovec.html +++ b/man/sd_bus_message_append_string_iovec.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions + gudev systemd 219


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions sd_bus_message_append_string_memfd and sd_bus_message_append_string_iovec can be used to append a single string (item of type "s") @@ -49,15 +49,15 @@ the message, it returns a pointer to the destination area to the caller in pointer p. Space for the string of length size plus the terminating - NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On + NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, +

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append_basic(3), diff --git a/man/sd_bus_message_append_string_memfd.3 b/man/sd_bus_message_append_string_memfd.3 index 5eeefa093..e98214cb7 100644 --- a/man/sd_bus_message_append_string_memfd.3 +++ b/man/sd_bus_message_append_string_memfd.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_MESSAGE_APPEND_STRING_MEMFD" "3" "" "systemd 218" "sd_bus_message_append_string_memfd" +.TH "SD_BUS_MESSAGE_APPEND_STRING_MEMFD" "3" "" "systemd 219" "sd_bus_message_append_string_memfd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_message_append_string_memfd.html b/man/sd_bus_message_append_string_memfd.html index 0c49d7d2a..6a22d4636 100644 --- a/man/sd_bus_message_append_string_memfd.html +++ b/man/sd_bus_message_append_string_memfd.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions + gudev systemd 219


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions sd_bus_message_append_string_memfd and sd_bus_message_append_string_iovec can be used to append a single string (item of type "s") @@ -49,15 +49,15 @@ the message, it returns a pointer to the destination area to the caller in pointer p. Space for the string of length size plus the terminating - NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On + NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, +

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append_basic(3), diff --git a/man/sd_bus_message_append_string_space.html b/man/sd_bus_message_append_string_space.html index 0c49d7d2a..6a22d4636 100644 --- a/man/sd_bus_message_append_string_space.html +++ b/man/sd_bus_message_append_string_space.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions + gudev systemd 219


Name

sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space — Attach a string to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_string_memfd(sd_bus_message *m,
 int memfd);
 
int sd_bus_message_append_string_iovec(sd_bus_message *m,
 const struct iovec *iov,
 unsigned n);
 
int sd_bus_message_append_string_space(sd_bus_message *m,
 size_t size,
 char **s);
 

Description¶

The functions sd_bus_message_append_string_memfd and sd_bus_message_append_string_iovec can be used to append a single string (item of type "s") @@ -49,15 +49,15 @@ the message, it returns a pointer to the destination area to the caller in pointer p. Space for the string of length size plus the terminating - NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On + NUL is allocated.

Return Value¶

On success, those calls return 0 or a positive integer. On failure, they returns a negative errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, +

-ENOMEM¶

Memory allocation failed.

Notes¶

The functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append_basic(3), diff --git a/man/sd_bus_message_append_strv.3 b/man/sd_bus_message_append_strv.3 index 9a76b8e7b..45a002276 100644 --- a/man/sd_bus_message_append_strv.3 +++ b/man/sd_bus_message_append_strv.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_MESSAGE_APPEND_STRV" "3" "" "systemd 218" "sd_bus_message_append_strv" +.TH "SD_BUS_MESSAGE_APPEND_STRV" "3" "" "systemd 219" "sd_bus_message_append_strv" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_message_append_strv.html b/man/sd_bus_message_append_strv.html index 7e20e1026..971d71575 100644 --- a/man/sd_bus_message_append_strv.html +++ b/man/sd_bus_message_append_strv.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_append_strv — Attach an array of strings to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_strv(sd_bus_message *m,
 char **l);
 

Description¶

The sd_bus_message_append function can be + gudev systemd 219


Name

sd_bus_message_append_strv — Attach an array of strings to a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_append_strv(sd_bus_message *m,
 char **l);
 

Description¶

The sd_bus_message_append function can be used to append an array of strings to message m. The parameter l shall point to a NULL-terminated array of pointers @@ -32,16 +32,16 @@ containing the message and may be changed after this call. Note that the signature of l parameter is to be treated as const char *const *, and the contents - will not be modified.

Return Value¶

On success, this call returns 0 or a positive integer. On + will not be modified.

Return Value¶

On success, this call returns 0 or a positive integer. On failure, a negative errno-style error code is returned.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

Specified parameter is invalid.

-EPERM¶

Message has been sealed.

-ESTALE¶

Message is in invalid state.

-ENXIO¶

Message cannot be appended to. -

-ENOMEM¶

Memory allocation failed.

Notes¶

The sd_bus_append_append_strv() function +

-ENOMEM¶

Memory allocation failed.

Notes¶

The sd_bus_append_append_strv() function described here is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_message_append(3), diff --git a/man/sd_bus_message_append_strv.xml b/man/sd_bus_message_append_strv.xml index 1767f73f7..b91406f27 100644 --- a/man/sd_bus_message_append_strv.xml +++ b/man/sd_bus_message_append_strv.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_message_get_cookie, sd_bus_message_get_reply_cookie — Returns the transaction cookie of a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_get_cookie(sd_bus_message *message,
 uint64_t *cookie);
 
int sd_bus_message_get_reply_cookie(sd_bus_message *message,
 uint64_t *cookie);
 

Description¶

sd_bus_message_get_cookie() returns - the transaction cookie of a message. The cookie - uniquely identifies a message within each bus peer, - but is not globally unique. It is assigned when a - message is sent.

sd_bus_message_get_reply_cookie() - returns the transaction cookie of the message the - specified message is a response to. When a reply - message is generated for a method call message, its - cookie is copied over into this field. Note that while - every message that is transferred is identified by a - cookie, only response messages carry a reply cookie - field.

Both functions take a message object as first - parameter and a place to store the 64-bit cookie - in.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

On success, the cookie/reply cookie is returned - in the specified 64-bit unsigned integer variable.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

A specified parameter - is invalid.

-ENODATA¶

No cookie has been - assigned to this message. This either - indicates that the message has not - been sent yet and hence has no cookie - assigned, or that the message is not a - method response message and hence - carries a reply cookie - field.

Notes¶

The sd_bus_message_get_cookie() - and sd_bus_message_get_reply_cookie() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ gudev systemd 219

Name

sd_bus_message_get_cookie, sd_bus_message_get_reply_cookie — Returns the transaction cookie of a message

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_message_get_cookie(sd_bus_message *message,
 uint64_t *cookie);
 
int sd_bus_message_get_reply_cookie(sd_bus_message *message,
 uint64_t *cookie);
 

Description¶

sd_bus_message_get_cookie() returns the + transaction cookie of a message. The cookie uniquely identifies a + message within each bus peer, but is not globally unique. It is + assigned when a message is sent.

sd_bus_message_get_reply_cookie() + returns the transaction cookie of the message the specified + message is a response to. When a reply message is generated for a + method call message, its cookie is copied over into this field. + Note that while every message that is transferred is identified by + a cookie, only response messages carry a reply cookie + field.

Both functions take a message object as first parameter and + a place to store the 64-bit cookie in.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

On success, the cookie/reply cookie is returned in the + specified 64-bit unsigned integer variable.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

A specified parameter + is invalid.

-ENODATA¶

No cookie has been assigned to this message. + This either indicates that the message has not been sent yet + and hence has no cookie assigned, or that the message is not a + method response message and hence carries a reply cookie + field.

Notes¶

The sd_bus_message_get_cookie() and + sd_bus_message_get_reply_cookie() interfaces + are available as a shared library, which can be compiled and + linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_bus_message_get_cookie.xml b/man/sd_bus_message_get_cookie.xml index 3e3f9bd7b..02374d750 100644 --- a/man/sd_bus_message_get_cookie.xml +++ b/man/sd_bus_message_get_cookie.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_bus_open_system.html b/man/sd_bus_open_system.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_open_system.html +++ b/man/sd_bus_open_system.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_open_system_container.html b/man/sd_bus_open_system_container.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_open_system_container.html +++ b/man/sd_bus_open_system_container.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_open_system_remote.html b/man/sd_bus_open_system_remote.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_open_system_remote.html +++ b/man/sd_bus_open_system_remote.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_open_user.3 b/man/sd_bus_open_user.3 index f9e7a05b9..f88c30e03 100644 --- a/man/sd_bus_open_user.3 +++ b/man/sd_bus_open_user.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_OPEN_USER" "3" "" "systemd 218" "sd_bus_open_user" +.TH "SD_BUS_OPEN_USER" "3" "" "systemd 219" "sd_bus_open_user" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_open_user.html b/man/sd_bus_open_user.html index 071a63d8f..bd7d39d8f 100644 --- a/man/sd_bus_open_user.html +++ b/man/sd_bus_open_user.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus + gudev systemd 219


Name

sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_open_user(sd_bus **bus);
 
int sd_bus_open_system(sd_bus **bus);
 
int sd_bus_open_system_remote(const char *host,
 sd_bus **bus);
 
int sd_bus_open_system_container(const char *machine,
 sd_bus **bus);
 
int sd_bus_default_user(sd_bus **bus);
 
int sd_bus_default_system(sd_bus **bus);
 

Description¶

sd_bus_open_user() creates a new bus object and opens a connection to the user bus. sd_bus_open_system() does the same, but connects to the system bus.

If the $DBUS_SESSION_BUS_ADDRESS environment @@ -48,9 +48,9 @@ sd_bus_default_user(), and subsequent invocations returns a reference to the same object.

sd_bus_default_system() is similar to sd_bus_default_user(), but connects to the - system bus.

Return Value¶

On success, these calls return 0 or a positive + system bus.

Return Value¶

On success, these calls return 0 or a positive integer. On failure, these calls return a negative - errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), + errno-style error code.

Reference ownership¶

Functions sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new @@ -59,14 +59,14 @@ sd_bus_unref(3).

The functions sd_bus_default_user() and sd_bus_default_system() do not create a new - reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be + reference.

Errors¶

Returned errors may indicate the following problems:

In addition, any further connection-related errors may be by returned. See sd_bus_send(3).

-EINVAL¶

Specified parameter is invalid (NULL in case of output - parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions + parameters).

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_open_user() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_new(3), diff --git a/man/sd_bus_path_decode.html b/man/sd_bus_path_decode.html index 1ea238ce2..a76938cff 100644 --- a/man/sd_bus_path_decode.html +++ b/man/sd_bus_path_decode.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_path_encode, sd_bus_path_decode — Convert an external identifier into an object path and back

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_path_encode(const char *prefix,
 const char *external_id,
 char **ret_path);
 
int sd_bus_path_decode(const char *prefix,
 const char *path,
 char **ret_external_id);
 

Description¶

sd_bus_path_encode() and + gudev systemd 219


Name

sd_bus_path_encode, sd_bus_path_decode — Convert an external identifier into an object path and back

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_path_encode(const char *prefix,
 const char *external_id,
 char **ret_path);
 
int sd_bus_path_decode(const char *path,
 const char *prefix,
 char **ret_external_id);
 

Description¶

sd_bus_path_encode() and sd_bus_path_decode() convert external identifier strings into object paths and back. These functions are useful to map application-specific string identifiers of any kind @@ -49,7 +49,7 @@ external identifier string.

The escaping used will replace all characters which are invalid in a bus object path by "_", followed by a hexadecimal value. As a special case, the empty string will be - replaced by a lone "_".

Return Value¶

On success, sd_bus_path_encode() + replaced by a lone "_".

Return Value¶

On success, sd_bus_path_encode() returns positive or 0, and a valid bus path in the return argument. On success, sd_bus_path_decode() returns a positive value if the prefixed matched, or 0 if it @@ -59,11 +59,11 @@ number is returned by either function. The returned strings must be free(3)'d - by the caller.

Notes¶

sd_bus_path_encode() and + by the caller.

Notes¶

sd_bus_path_encode() and sd_bus_path_decode() are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), free(3) diff --git a/man/sd_bus_path_encode.3 b/man/sd_bus_path_encode.3 index c64e59d39..23b4724a6 100644 --- a/man/sd_bus_path_encode.3 +++ b/man/sd_bus_path_encode.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_PATH_ENCODE" "3" "" "systemd 218" "sd_bus_path_encode" +.TH "SD_BUS_PATH_ENCODE" "3" "" "systemd 219" "sd_bus_path_encode" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ sd_bus_path_encode, sd_bus_path_decode \- Convert an external identifier into an .HP \w'int\ sd_bus_path_encode('u .BI "int sd_bus_path_encode(const\ char\ *" "prefix" ", const\ char\ *" "external_id" ", char\ **" "ret_path" ");" .HP \w'int\ sd_bus_path_decode('u -.BI "int sd_bus_path_decode(const\ char\ *" "prefix" ", const\ char\ *" "path" ", char\ **" "ret_external_id" ");" +.BI "int sd_bus_path_decode(const\ char\ *" "path" ", const\ char\ *" "prefix" ", char\ **" "ret_external_id" ");" .SH "DESCRIPTION" .PP \fBsd_bus_path_encode()\fR diff --git a/man/sd_bus_path_encode.html b/man/sd_bus_path_encode.html index 1ea238ce2..a76938cff 100644 --- a/man/sd_bus_path_encode.html +++ b/man/sd_bus_path_encode.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_path_encode, sd_bus_path_decode — Convert an external identifier into an object path and back

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_path_encode(const char *prefix,
 const char *external_id,
 char **ret_path);
 
int sd_bus_path_decode(const char *prefix,
 const char *path,
 char **ret_external_id);
 

Description¶

sd_bus_path_encode() and + gudev systemd 219


Name

sd_bus_path_encode, sd_bus_path_decode — Convert an external identifier into an object path and back

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_path_encode(const char *prefix,
 const char *external_id,
 char **ret_path);
 
int sd_bus_path_decode(const char *path,
 const char *prefix,
 char **ret_external_id);
 

Description¶

sd_bus_path_encode() and sd_bus_path_decode() convert external identifier strings into object paths and back. These functions are useful to map application-specific string identifiers of any kind @@ -49,7 +49,7 @@ external identifier string.

The escaping used will replace all characters which are invalid in a bus object path by "_", followed by a hexadecimal value. As a special case, the empty string will be - replaced by a lone "_".

Return Value¶

On success, sd_bus_path_encode() + replaced by a lone "_".

Return Value¶

On success, sd_bus_path_encode() returns positive or 0, and a valid bus path in the return argument. On success, sd_bus_path_decode() returns a positive value if the prefixed matched, or 0 if it @@ -59,11 +59,11 @@ number is returned by either function. The returned strings must be free(3)'d - by the caller.

Notes¶

sd_bus_path_encode() and + by the caller.

Notes¶

sd_bus_path_encode() and sd_bus_path_decode() are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), free(3) diff --git a/man/sd_bus_path_encode.xml b/man/sd_bus_path_encode.xml index 55a6fd005..69cda53bf 100644 --- a/man/sd_bus_path_encode.xml +++ b/man/sd_bus_path_encode.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> @@ -62,8 +62,8 @@ along with systemd; If not, see . int sd_bus_path_decode - const char *prefix const char *path + const char *prefix char **ret_external_id diff --git a/man/sd_bus_ref.html b/man/sd_bus_ref.html index f971853e1..fe9f250bf 100644 --- a/man/sd_bus_ref.html +++ b/man/sd_bus_ref.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_new, sd_bus_ref, sd_bus_unref — Create a new bus object and create or destroy references to it

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_new(sd_bus **bus);
 
sd_bus *sd_bus_ref(sd_bus *bus);
 
sd_bus *sd_bus_unref(sd_bus *bus);
 

Description¶

sd_bus_new() creates a new bus + gudev systemd 219


Name

sd_bus_new, sd_bus_ref, sd_bus_unref — Create a new bus object and create or destroy references to it

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_new(sd_bus **bus);
 
sd_bus *sd_bus_ref(sd_bus *bus);
 
sd_bus *sd_bus_unref(sd_bus *bus);
 

Description¶

sd_bus_new() creates a new bus object. This object is reference-counted, and will be destroyed when all references are gone. Initially, the caller of this function owns the sole reference.

sd_bus_ref() creates a new reference to @@ -29,15 +29,15 @@ zero, bus cannot be used anymore, so further calls to sd_bus_ref() or sd_bus_unref() are illegal.

sd_bus_unref() destroys a reference to - bus.

Return Value¶

On success, sd_bus_new() returns 0 or a + bus.

Return Value¶

On success, sd_bus_new() returns 0 or a positive integer. On failure, it returns a negative errno-style error code.

sd_bus_ref always returns the argument.

sd_bus_unref always returns - NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_new() and other functions + NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Memory allocation failed.

Notes¶

sd_bus_new() and other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-bus(3), sd_bus_open_user(3), diff --git a/man/sd_bus_release_name.html b/man/sd_bus_release_name.html index 5bb93b8a4..04685b480 100644 --- a/man/sd_bus_release_name.html +++ b/man/sd_bus_release_name.html @@ -19,64 +19,46 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_bus_request_name, sd_bus_release_name — Request or release a well-known name on a bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_request_name(sd_bus *bus,
 const char *name,
 uint64_t flags);
 
int sd_bus_release_name(sd_bus *bus,
 const char *name);
 

Description¶

sd_bus_request_name() requests - a well-known name on a bus. It takes a bus connection, - a valid bus name and a flags parameter. The flags - parameter is a combination of the following - flags:

SD_BUS_NAME_ALLOW_REPLACEMENT¶

After acquiring the - name successfully, permit other peers - to take over the name when they try to - acquire it with the - SD_BUS_NAME_REPLACE_EXISTING - flag set. If - SD_BUS_NAME_ALLOW_REPLACEMENT - is not set on the original request, - such a request by other peers will be - denied.

SD_BUS_NAME_REPLACE_EXISTING¶

Take over the name - if it is already acquired by another - peer, and that other peer has permitted - takeover by setting - SD_BUS_NAME_ALLOW_REPLACEMENT - while acquiring it.

SD_BUS_NAME_QUEUE¶

Queue the acquisition - of the name when the name is already - taken.

sd_bus_release_name() releases - an acquired well-known name. It takes a bus connection - and a valid bus name as parameters.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

If SD_BUS_NAME_QUEUE is - specified, sd_bus_request_name() - will return 0 when the name is already taken by - another peer and the client has been added to the - queue for the name. In that case, the caller can - subscribe to "NameOwnerChanged" - signals to be notified when the name is successfully - acquired. sd_bus_request_name() - returns > 0 when the name has immediately been - acquired successfully.

Errors¶

Returned errors may indicate the following problems:

-EALREADY¶

The caller already is - the owner of the specified - name.

-EEXIST¶

The name has already - been acquired by a different peer, and - SD_BUS_NAME_REPLACE_EXISTING was not - specified or the other peer did not - specify SD_BUS_NAME_ALLOW_REPLACEMENT - while acquiring the - name.

-ESRCH¶

It was attempted to - release a name that is currently not - registered on the - bus.

-EADDRINUSE¶

It was attempted to - release a name that is owned by a - different peer on the - bus.

-EINVAL¶

A specified parameter - is invalid.

-ENOTCONN¶

The bus connection has - been disconnected.

-ECHILD¶

The bus connection has - been created in a different process - than the current one.

Notes¶

The sd_bus_acquire_name() - and sd_bus_release_name() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ gudev systemd 219

Name

sd_bus_request_name, sd_bus_release_name — Request or release a well-known name on a bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_request_name(sd_bus *bus,
 const char *name,
 uint64_t flags);
 
int sd_bus_release_name(sd_bus *bus,
 const char *name);
 

Description¶

sd_bus_request_name() requests a + well-known name on a bus. It takes a bus connection, a valid bus + name and a flags parameter. The flags parameter is a combination + of the following flags:

SD_BUS_NAME_ALLOW_REPLACEMENT¶

After acquiring the name successfully, permit + other peers to take over the name when they try to acquire it + with the SD_BUS_NAME_REPLACE_EXISTING flag + set. If SD_BUS_NAME_ALLOW_REPLACEMENT is + not set on the original request, such a request by other peers + will be denied.

SD_BUS_NAME_REPLACE_EXISTING¶

Take over the name if it is already acquired + by another peer, and that other peer has permitted takeover by + setting SD_BUS_NAME_ALLOW_REPLACEMENT while + acquiring it.

SD_BUS_NAME_QUEUE¶

Queue the acquisition of the name when the + name is already taken.

sd_bus_release_name() releases an + acquired well-known name. It takes a bus connection and a valid + bus name as parameters.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

If SD_BUS_NAME_QUEUE is specified, + sd_bus_request_name() will return 0 when the + name is already taken by another peer and the client has been + added to the queue for the name. In that case, the caller can + subscribe to "NameOwnerChanged" signals to be + notified when the name is successfully acquired. + sd_bus_request_name() returns > 0 when the + name has immediately been acquired successfully.

Errors¶

Returned errors may indicate the following problems:

-EALREADY¶

The caller already is the owner of the + specified name.

-EEXIST¶

The name has already been acquired by a + different peer, and SD_BUS_NAME_REPLACE_EXISTING was not + specified or the other peer did not specify + SD_BUS_NAME_ALLOW_REPLACEMENT while acquiring the + name.

-ESRCH¶

It was attempted to release a name that is + currently not registered on the bus.

-EADDRINUSE¶

It was attempted to release a name that is + owned by a different peer on the bus.

-EINVAL¶

A specified parameter is + invalid.

-ENOTCONN¶

The bus connection has been + disconnected.

-ECHILD¶

The bus connection has been created in a + different process than the current one.

Notes¶

The sd_bus_acquire_name() and + sd_bus_release_name() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_bus_request_name.3 b/man/sd_bus_request_name.3 index 05ef63a76..1097fe158 100644 --- a/man/sd_bus_request_name.3 +++ b/man/sd_bus_request_name.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_BUS_REQUEST_NAME" "3" "" "systemd 218" "sd_bus_request_name" +.TH "SD_BUS_REQUEST_NAME" "3" "" "systemd 219" "sd_bus_request_name" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_bus_request_name.html b/man/sd_bus_request_name.html index 5bb93b8a4..04685b480 100644 --- a/man/sd_bus_request_name.html +++ b/man/sd_bus_request_name.html @@ -19,64 +19,46 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_bus_request_name, sd_bus_release_name — Request or release a well-known name on a bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_request_name(sd_bus *bus,
 const char *name,
 uint64_t flags);
 
int sd_bus_release_name(sd_bus *bus,
 const char *name);
 

Description¶

sd_bus_request_name() requests - a well-known name on a bus. It takes a bus connection, - a valid bus name and a flags parameter. The flags - parameter is a combination of the following - flags:

SD_BUS_NAME_ALLOW_REPLACEMENT¶

After acquiring the - name successfully, permit other peers - to take over the name when they try to - acquire it with the - SD_BUS_NAME_REPLACE_EXISTING - flag set. If - SD_BUS_NAME_ALLOW_REPLACEMENT - is not set on the original request, - such a request by other peers will be - denied.

SD_BUS_NAME_REPLACE_EXISTING¶

Take over the name - if it is already acquired by another - peer, and that other peer has permitted - takeover by setting - SD_BUS_NAME_ALLOW_REPLACEMENT - while acquiring it.

SD_BUS_NAME_QUEUE¶

Queue the acquisition - of the name when the name is already - taken.

sd_bus_release_name() releases - an acquired well-known name. It takes a bus connection - and a valid bus name as parameters.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

If SD_BUS_NAME_QUEUE is - specified, sd_bus_request_name() - will return 0 when the name is already taken by - another peer and the client has been added to the - queue for the name. In that case, the caller can - subscribe to "NameOwnerChanged" - signals to be notified when the name is successfully - acquired. sd_bus_request_name() - returns > 0 when the name has immediately been - acquired successfully.

Errors¶

Returned errors may indicate the following problems:

-EALREADY¶

The caller already is - the owner of the specified - name.

-EEXIST¶

The name has already - been acquired by a different peer, and - SD_BUS_NAME_REPLACE_EXISTING was not - specified or the other peer did not - specify SD_BUS_NAME_ALLOW_REPLACEMENT - while acquiring the - name.

-ESRCH¶

It was attempted to - release a name that is currently not - registered on the - bus.

-EADDRINUSE¶

It was attempted to - release a name that is owned by a - different peer on the - bus.

-EINVAL¶

A specified parameter - is invalid.

-ENOTCONN¶

The bus connection has - been disconnected.

-ECHILD¶

The bus connection has - been created in a different process - than the current one.

Notes¶

The sd_bus_acquire_name() - and sd_bus_release_name() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ gudev systemd 219

Name

sd_bus_request_name, sd_bus_release_name — Request or release a well-known name on a bus

Synopsis

#include <systemd/sd-bus.h>
int sd_bus_request_name(sd_bus *bus,
 const char *name,
 uint64_t flags);
 
int sd_bus_release_name(sd_bus *bus,
 const char *name);
 

Description¶

sd_bus_request_name() requests a + well-known name on a bus. It takes a bus connection, a valid bus + name and a flags parameter. The flags parameter is a combination + of the following flags:

SD_BUS_NAME_ALLOW_REPLACEMENT¶

After acquiring the name successfully, permit + other peers to take over the name when they try to acquire it + with the SD_BUS_NAME_REPLACE_EXISTING flag + set. If SD_BUS_NAME_ALLOW_REPLACEMENT is + not set on the original request, such a request by other peers + will be denied.

SD_BUS_NAME_REPLACE_EXISTING¶

Take over the name if it is already acquired + by another peer, and that other peer has permitted takeover by + setting SD_BUS_NAME_ALLOW_REPLACEMENT while + acquiring it.

SD_BUS_NAME_QUEUE¶

Queue the acquisition of the name when the + name is already taken.

sd_bus_release_name() releases an + acquired well-known name. It takes a bus connection and a valid + bus name as parameters.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

If SD_BUS_NAME_QUEUE is specified, + sd_bus_request_name() will return 0 when the + name is already taken by another peer and the client has been + added to the queue for the name. In that case, the caller can + subscribe to "NameOwnerChanged" signals to be + notified when the name is successfully acquired. + sd_bus_request_name() returns > 0 when the + name has immediately been acquired successfully.

Errors¶

Returned errors may indicate the following problems:

-EALREADY¶

The caller already is the owner of the + specified name.

-EEXIST¶

The name has already been acquired by a + different peer, and SD_BUS_NAME_REPLACE_EXISTING was not + specified or the other peer did not specify + SD_BUS_NAME_ALLOW_REPLACEMENT while acquiring the + name.

-ESRCH¶

It was attempted to release a name that is + currently not registered on the bus.

-EADDRINUSE¶

It was attempted to release a name that is + owned by a different peer on the bus.

-EINVAL¶

A specified parameter is + invalid.

-ENOTCONN¶

The bus connection has been + disconnected.

-ECHILD¶

The bus connection has been created in a + different process than the current one.

Notes¶

The sd_bus_acquire_name() and + sd_bus_release_name() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_bus_request_name.xml b/man/sd_bus_request_name.xml index ca082183c..6aa132bb2 100644 --- a/man/sd_bus_request_name.xml +++ b/man/sd_bus_request_name.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_event_add_exit.html b/man/sd_event_add_exit.html index 10d69707a..19e845c9d 100644 --- a/man/sd_event_add_exit.html +++ b/man/sd_event_add_exit.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_event_add_defer, sd_event_add_post, sd_event_add_exit — Add static event sources to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_defer(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_post(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_exit(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_handler_t)(sd_event_source *s,
 void *userdata);
 

Description¶

Those three functions add new event sources to an event loop + gudev systemd 219


Name

sd_event_add_defer, sd_event_add_post, sd_event_add_exit — Add static event sources to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_defer(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_post(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_exit(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_handler_t)(sd_event_source *s,
 void *userdata);
 

Description¶

Those three functions add new event sources to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The event sources are @@ -41,12 +41,12 @@ (SD_EVENT_ONESHOT). If the handler function returns a negative error code, it will be disabled after the invocation, even if SD_EVENT_ON mode is - set.

Return Value¶

On success, this functions return 0 or a positive + set.

Return Value¶

On success, this functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

Functions described here are available as a shared library, + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

Functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_add_post.html b/man/sd_event_add_post.html index 10d69707a..19e845c9d 100644 --- a/man/sd_event_add_post.html +++ b/man/sd_event_add_post.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_defer, sd_event_add_post, sd_event_add_exit — Add static event sources to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_defer(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_post(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_exit(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_handler_t)(sd_event_source *s,
 void *userdata);
 

Description¶

Those three functions add new event sources to an event loop + gudev systemd 219


Name

sd_event_add_defer, sd_event_add_post, sd_event_add_exit — Add static event sources to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_defer(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_post(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
int sd_event_add_exit(sd_event *event,
 sd_event_source **source,
 sd_event_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_handler_t)(sd_event_source *s,
 void *userdata);
 

Description¶

Those three functions add new event sources to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The event sources are @@ -41,12 +41,12 @@ (SD_EVENT_ONESHOT). If the handler function returns a negative error code, it will be disabled after the invocation, even if SD_EVENT_ON mode is - set.

Return Value¶

On success, this functions return 0 or a positive + set.

Return Value¶

On success, this functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

Functions described here are available as a shared library, + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

Functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_add_signal.3 b/man/sd_event_add_signal.3 index e8e110f8d..a081fc693 100644 --- a/man/sd_event_add_signal.3 +++ b/man/sd_event_add_signal.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_EVENT_ADD_SIGNAL" "3" "" "systemd 218" "sd_event_add_signal" +.TH "SD_EVENT_ADD_SIGNAL" "3" "" "systemd 219" "sd_event_add_signal" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -52,7 +52,7 @@ pointer, which may be chosen freely by the caller\&. The handler also receives a const struct signalfd_siginfo containing the information about the received signal\&. See \fBsignalfd\fR(2) -for futher information\&. +for further information\&. .PP Only a single handler may be installed for a specific signal\&. The signal will be unblocked, and must be blocked when the function is called\&. If the handler is not specified (\fIhandler\fR is diff --git a/man/sd_event_add_signal.html b/man/sd_event_add_signal.html index 208ee8883..1cdac1724 100644 --- a/man/sd_event_add_signal.html +++ b/man/sd_event_add_signal.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_signal, sd_event_source_get_signal — Add a signal event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_signal(sd_event *event,
 sd_event_source **source,
 int signal,
 sd_event_signal_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_signal_handler_t)(sd_event_source *s,
 const struct signalfd_siginfo *si,
 void *userdata);
 
int sd_event_source_get_signal(sd_event_source *source);
 

Description¶

sd_event_add_signal() adds a new signal + gudev systemd 219


Name

sd_event_add_signal, sd_event_source_get_signal — Add a signal event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_signal(sd_event *event,
 sd_event_source **source,
 int signal,
 sd_event_signal_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_signal_handler_t)(sd_event_source *s,
 const struct signalfd_siginfo *si,
 void *userdata);
 
int sd_event_source_get_signal(sd_event_source *source);
 

Description¶

sd_event_add_signal() adds a new signal event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -34,7 +34,7 @@ const struct signalfd_siginfo containing the information about the received signal. See signalfd(2) - for futher information.

Only a single handler may be installed for a specific + for further information.

Only a single handler may be installed for a specific signal. The signal will be unblocked, and must be blocked when the function is called. If the handler is not specified (handler is @@ -50,14 +50,14 @@ the configured signal number of a signal event source created previously with sd_event_add_signal(). It takes the event source object as the source - parameter.

Return Value¶

On success, these functions return 0 or a positive + parameter.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-EBUSY¶

An handler is already installed for this - signal or the signal was not blocked previously.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_signal() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-EBUSY¶

An handler is already installed for this + signal or the signal was not blocked previously.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_signal() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml index f39751d68..0299aa5a5 100644 --- a/man/sd_event_add_signal.xml +++ b/man/sd_event_add_signal.xml @@ -95,7 +95,7 @@ along with systemd; If not, see . const struct signalfd_siginfo containing the information about the received signal. See signalfd2 - for futher information. + for further information. Only a single handler may be installed for a specific signal. The signal will be unblocked, and must be diff --git a/man/sd_event_add_time.3 b/man/sd_event_add_time.3 index 75a918d97..79ab7226b 100644 --- a/man/sd_event_add_time.3 +++ b/man/sd_event_add_time.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_EVENT_ADD_TIME" "3" "" "systemd 218" "sd_event_add_time" +.TH "SD_EVENT_ADD_TIME" "3" "" "systemd 219" "sd_event_add_time" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_event_add_time.html b/man/sd_event_add_time.html index ca30782da..05d943831 100644 --- a/man/sd_event_add_time.html +++ b/man/sd_event_add_time.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml index 31d101355..c975f07de 100644 --- a/man/sd_event_add_time.xml +++ b/man/sd_event_add_time.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_event_default.html b/man/sd_event_default.html index 55cd0457f..fe8974095 100644 --- a/man/sd_event_default.html +++ b/man/sd_event_default.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event + gudev systemd 219


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event loop object. The event loop object is returned in the event parameter. After use, drop the returned reference with @@ -48,17 +48,17 @@ sd_event_default() will result in two distinct objects. Note that in order to free an event loop object, all remaining event sources of the event loop also need to be - freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and + freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and sd_event_default() return 0 or a positive integer. On failure, they return a negative errno-style error code. sd_event_ref() always returns a pointer to the event loop object passed in. sd_event_unref() always returns - NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions + NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_add_io(3), diff --git a/man/sd_event_get_fd.3 b/man/sd_event_get_fd.3 index 40b61656d..058db51b9 100644 --- a/man/sd_event_get_fd.3 +++ b/man/sd_event_get_fd.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_EVENT_GET_FD" "3" "" "systemd 218" "sd_event_get_fd" +.TH "SD_EVENT_GET_FD" "3" "" "systemd 219" "sd_event_get_fd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_event_get_fd.html b/man/sd_event_get_fd.html index 77c2c5604..fd59518d8 100644 --- a/man/sd_event_get_fd.html +++ b/man/sd_event_get_fd.html @@ -19,17 +19,17 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_get_fd — Obtain a file descriptor to poll for event loop events

Synopsis

#include <systemd/sd-bus.h>
int sd_event_get_fd(sd_bus *event);
 

Description¶

sd_event_get_fd() returns the file + gudev systemd 219


Name

sd_event_get_fd — Obtain a file descriptor to poll for event loop events

Synopsis

#include <systemd/sd-bus.h>
int sd_event_get_fd(sd_bus *event);
 

Description¶

sd_event_get_fd() returns the file descriptor that the event loop object returned by the sd_event_new(3) function uses to wait for events. This file descriptor can be polled for events. This makes it possible to embed the sd-event(3) - event loop inside of another event loop.

Return Value¶

On success, sd_event_get_fd() returns a + event loop inside of another event loop.

Return Value¶

On success, sd_event_get_fd() returns a non-negative integer. On failure, it returns a negative - errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

event is not a valid + errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

event is not a valid pointer to an sd_event structure. -

-ECHILD¶

The event loop has been created in a different process.

Examples¶

Example 1. Integration in glib event loop

/***
+        

-ECHILD¶

The event loop has been created in a different process.

Examples¶

Example 1. Integration in glib event loop

/***
   Copyright 2014 Tom Gundersen
 
   Permission is hereby granted, free of charge, to any person
@@ -97,10 +97,10 @@ GSource *g_sd_event_create_source(sd_event *event) {
 
         return (GSource *)source;
 }
-

Notes¶

sd_event_get_fd() is available as a +


Notes¶

sd_event_get_fd() is available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

sd-event(3), sd_event_new(3), sd_event_ref(3) diff --git a/man/sd_event_get_name.html b/man/sd_event_get_name.html index ee557ccda..82f7dd3dc 100644 --- a/man/sd_event_get_name.html +++ b/man/sd_event_get_name.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_set_name, sd_event_get_name — Set human-readable names for event sources

Synopsis

#include <systemd/sd-bus.h>
int sd_event_set_name(sd_event_source *source,
 const char *name);
 
int sd_event_get_name(sd_event_source *source,
 const char **name);
 

Description¶

sd_event_set_name() can be used to set + gudev systemd 219


Name

sd_event_set_name, sd_event_get_name — Set human-readable names for event sources

Synopsis

#include <systemd/sd-bus.h>
int sd_event_set_name(sd_event_source *source,
 const char *name);
 
int sd_event_get_name(sd_event_source *source,
 const char **name);
 

Description¶

sd_event_set_name() can be used to set an arbitrary name for the event source source. This name will be used in error messages generated by @@ -33,18 +33,18 @@ query the current name assigned to source source. It returns a pointer to the current name (possibly NULL) in - name.

Return Value¶

On success, sd_event_set_name() and + name.

Return Value¶

On success, sd_event_set_name() and sd_event_get_name() return a non-negative integer. On failure, they return a negative - errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

source is not a valid + errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

source is not a valid pointer to an sd_event_source structure or the name argument for sd_event_get_name() is NULL.

-ENOMEM¶

Not enough memory to copy the - name.

Notes¶

Functions described here are available as a + name.

Notes¶

Functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

sd-event(3), sd_event_add_time(3), sd_event_add_child(3), diff --git a/man/sd_event_new.3 b/man/sd_event_new.3 index 756bb4679..f60a89866 100644 --- a/man/sd_event_new.3 +++ b/man/sd_event_new.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_EVENT_NEW" "3" "" "systemd 218" "sd_event_new" +.TH "SD_EVENT_NEW" "3" "" "systemd 219" "sd_event_new" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_event_new.html b/man/sd_event_new.html index 55cd0457f..fe8974095 100644 --- a/man/sd_event_new.html +++ b/man/sd_event_new.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event + gudev systemd 219


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event loop object. The event loop object is returned in the event parameter. After use, drop the returned reference with @@ -48,17 +48,17 @@ sd_event_default() will result in two distinct objects. Note that in order to free an event loop object, all remaining event sources of the event loop also need to be - freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and + freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and sd_event_default() return 0 or a positive integer. On failure, they return a negative errno-style error code. sd_event_ref() always returns a pointer to the event loop object passed in. sd_event_unref() always returns - NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions + NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_add_io(3), diff --git a/man/sd_event_new.xml b/man/sd_event_new.xml index f2ad78271..854a887bc 100644 --- a/man/sd_event_new.xml +++ b/man/sd_event_new.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/sd_event_ref.html b/man/sd_event_ref.html index 55cd0457f..fe8974095 100644 --- a/man/sd_event_ref.html +++ b/man/sd_event_ref.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event + gudev systemd 219


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event loop object. The event loop object is returned in the event parameter. After use, drop the returned reference with @@ -48,17 +48,17 @@ sd_event_default() will result in two distinct objects. Note that in order to free an event loop object, all remaining event sources of the event loop also need to be - freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and + freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and sd_event_default() return 0 or a positive integer. On failure, they return a negative errno-style error code. sd_event_ref() always returns a pointer to the event loop object passed in. sd_event_unref() always returns - NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions + NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_add_io(3), diff --git a/man/sd_event_set_name.3 b/man/sd_event_set_name.3 index f36e55224..756c9fcb9 100644 --- a/man/sd_event_set_name.3 +++ b/man/sd_event_set_name.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_EVENT_SET_NAME" "3" "" "systemd 218" "sd_event_set_name" +.TH "SD_EVENT_SET_NAME" "3" "" "systemd 219" "sd_event_set_name" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_event_set_name.html b/man/sd_event_set_name.html index ee557ccda..82f7dd3dc 100644 --- a/man/sd_event_set_name.html +++ b/man/sd_event_set_name.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_set_name, sd_event_get_name — Set human-readable names for event sources

Synopsis

#include <systemd/sd-bus.h>
int sd_event_set_name(sd_event_source *source,
 const char *name);
 
int sd_event_get_name(sd_event_source *source,
 const char **name);
 

Description¶

sd_event_set_name() can be used to set + gudev systemd 219


Name

sd_event_set_name, sd_event_get_name — Set human-readable names for event sources

Synopsis

#include <systemd/sd-bus.h>
int sd_event_set_name(sd_event_source *source,
 const char *name);
 
int sd_event_get_name(sd_event_source *source,
 const char **name);
 

Description¶

sd_event_set_name() can be used to set an arbitrary name for the event source source. This name will be used in error messages generated by @@ -33,18 +33,18 @@ query the current name assigned to source source. It returns a pointer to the current name (possibly NULL) in - name.

Return Value¶

On success, sd_event_set_name() and + name.

Return Value¶

On success, sd_event_set_name() and sd_event_get_name() return a non-negative integer. On failure, they return a negative - errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

source is not a valid + errno-style error code.

Errors¶

Returned errors may indicate the following problems:

-EINVAL¶

source is not a valid pointer to an sd_event_source structure or the name argument for sd_event_get_name() is NULL.

-ENOMEM¶

Not enough memory to copy the - name.

Notes¶

Functions described here are available as a + name.

Notes¶

Functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

sd-event(3), sd_event_add_time(3), sd_event_add_child(3), diff --git a/man/sd_event_source_get_child_pid.html b/man/sd_event_source_get_child_pid.html index f03deb175..5ef9417c5 100644 --- a/man/sd_event_source_get_child_pid.html +++ b/man/sd_event_source_get_child_pid.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_child, sd_event_source_get_child_pid — Add a child state change event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_child(sd_event *event,
 sd_event_source **source,
 pid_t pid,
 int options,
 sd_event_child_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_child_handler_t)(sd_event_source *s,
 const siginfo_t *si,
 void *userdata);
 
int sd_event_source_get_child_pid(sd_event_source *source,
 pid_t *pid);
 

Description¶

sd_event_add_child() adds a new child + gudev systemd 219


Name

sd_event_add_child, sd_event_source_get_child_pid — Add a child state change event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_child(sd_event *event,
 sd_event_source **source,
 pid_t pid,
 int options,
 sd_event_child_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_child_handler_t)(sd_event_source *s,
 const siginfo_t *si,
 void *userdata);
 
int sd_event_source_get_child_pid(sd_event_source *source,
 pid_t *pid);
 

Description¶

sd_event_add_child() adds a new child state change event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -37,7 +37,7 @@ being stopped by a signal), and WCONTINUED (watch for the child being resumed by a signal). See waitid(2) - for futher information.

Only a single handler may be installed for a specific + for further information.

Only a single handler may be installed for a specific child. The handler is enabled for a single event (SD_EVENT_ONESHOT), but this may be @@ -52,19 +52,19 @@ sd_event_add_child(). It takes the event source object as the source parameter and a pointer to pid_t to return the result in. -

Return Value¶

On success, these functions return 0 or a positive +

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed. This includes - specyfing an empty mask in options or a mask - which constains values different than a combination of + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed. This includes + specifying an empty mask in options or a mask + which contains values different than a combination of WEXITED, WSTOPPED, and WCONTINUED.

-EBUSY¶

An handler is already installed for this - child.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_child() and the other functions + child.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_child() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_get_signal.html b/man/sd_event_source_get_signal.html index 208ee8883..1cdac1724 100644 --- a/man/sd_event_source_get_signal.html +++ b/man/sd_event_source_get_signal.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_signal, sd_event_source_get_signal — Add a signal event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_signal(sd_event *event,
 sd_event_source **source,
 int signal,
 sd_event_signal_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_signal_handler_t)(sd_event_source *s,
 const struct signalfd_siginfo *si,
 void *userdata);
 
int sd_event_source_get_signal(sd_event_source *source);
 

Description¶

sd_event_add_signal() adds a new signal + gudev systemd 219


Name

sd_event_add_signal, sd_event_source_get_signal — Add a signal event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_signal(sd_event *event,
 sd_event_source **source,
 int signal,
 sd_event_signal_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_signal_handler_t)(sd_event_source *s,
 const struct signalfd_siginfo *si,
 void *userdata);
 
int sd_event_source_get_signal(sd_event_source *source);
 

Description¶

sd_event_add_signal() adds a new signal event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -34,7 +34,7 @@ const struct signalfd_siginfo containing the information about the received signal. See signalfd(2) - for futher information.

Only a single handler may be installed for a specific + for further information.

Only a single handler may be installed for a specific signal. The signal will be unblocked, and must be blocked when the function is called. If the handler is not specified (handler is @@ -50,14 +50,14 @@ the configured signal number of a signal event source created previously with sd_event_add_signal(). It takes the event source object as the source - parameter.

Return Value¶

On success, these functions return 0 or a positive + parameter.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-EBUSY¶

An handler is already installed for this - signal or the signal was not blocked previously.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_signal() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-EBUSY¶

An handler is already installed for this + signal or the signal was not blocked previously.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

Notes¶

sd_event_add_signal() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_get_time.html b/man/sd_event_source_get_time.html index ca30782da..05d943831 100644 --- a/man/sd_event_source_get_time.html +++ b/man/sd_event_source_get_time.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_get_time_accuracy.html b/man/sd_event_source_get_time_accuracy.html index ca30782da..05d943831 100644 --- a/man/sd_event_source_get_time_accuracy.html +++ b/man/sd_event_source_get_time_accuracy.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_get_time_clock.html b/man/sd_event_source_get_time_clock.html index ca30782da..05d943831 100644 --- a/man/sd_event_source_get_time_clock.html +++ b/man/sd_event_source_get_time_clock.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_set_time.html b/man/sd_event_source_set_time.html index ca30782da..05d943831 100644 --- a/man/sd_event_source_set_time.html +++ b/man/sd_event_source_set_time.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_source_set_time_accuracy.html b/man/sd_event_source_set_time_accuracy.html index ca30782da..05d943831 100644 --- a/man/sd_event_source_set_time_accuracy.html +++ b/man/sd_event_source_set_time_accuracy.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer + gudev systemd 219


Name

sd_event_add_time, sd_event_source_get_time, sd_event_source_set_time, sd_event_source_get_time_accuracy, sd_event_source_set_time_accuracy, sd_event_source_get_time_clock — Add a timer event source to an event loop

Synopsis

#include <systemd/sd-bus.h>
int sd_event_add_time(sd_event *event,
 sd_event_source **source,
 clockid_t clock,
 uint64_t usec,
 uint64_t accuracy,
 sd_event_time_handler_t handler,
 void *userdata);
 
typedef int (*sd_event_time_handler_t)(sd_event_source *s,
 uint64_t usec,
 void *userdata);
 
int sd_event_source_get_time(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_accuracy(sd_event_source *source,
 usec_t *usec);
 
int sd_event_source_set_time_accuracy(sd_event_source *source,
 usec_t usec);
 
int sd_event_source_get_time_clock(sd_event_source *source,
 clockid_t *clock);
 

Description¶

sd_event_add_time() adds a new timer event source to an event loop object. The event loop is specified in event, the event source is returned in the source parameter. The @@ -73,13 +73,13 @@ retrieves the configured clock of a timer event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the - clock identifier in.

Return Value¶

On success, these functions return 0 or a positive + clock identifier in.

Return Value¶

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error - code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions + code.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate an object.

-EINVAL¶

An invalid argument has been passed.

-ESTALE¶

The event loop is already terminated.

-ECHILD¶

The event loop has been created in a different process.

-ENOTSUP¶

The selected clock is not supported by the event loop implementation.

Notes¶

sd_event_add_time() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_new(3), diff --git a/man/sd_event_unref.html b/man/sd_event_unref.html index 55cd0457f..fe8974095 100644 --- a/man/sd_event_unref.html +++ b/man/sd_event_unref.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event + gudev systemd 219


Name

sd_event_new, sd_event_default, sd_event_ref, sd_event_unref — Acquire and release an event loop object

Synopsis

#include <systemd/sd-bus.h>
int sd_event_new(sd_bus **event);
 
int sd_event_default(sd_bus **event);
 
sd_bus *sd_event_ref(sd_bus *event);
 
sd_bus *sd_event_unref(sd_bus *event);
 

Description¶

sd_event_new() allocates a new event loop object. The event loop object is returned in the event parameter. After use, drop the returned reference with @@ -48,17 +48,17 @@ sd_event_default() will result in two distinct objects. Note that in order to free an event loop object, all remaining event sources of the event loop also need to be - freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and + freed as each keeps a reference to it.

Return Value¶

On success, sd_event_new() and sd_event_default() return 0 or a positive integer. On failure, they return a negative errno-style error code. sd_event_ref() always returns a pointer to the event loop object passed in. sd_event_unref() always returns - NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions + NULL.

Errors¶

Returned errors may indicate the following problems:

-ENOMEM¶

Not enough memory to allocate the object.

-EMFILE¶

The maximum number of event loops has been allocated.

Notes¶

sd_event_new() and the other functions described here are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

See Also¶

+ file.

See Also¶

systemd(1), sd-event(3), sd_event_add_io(3), diff --git a/man/sd_get_machine_names.html b/man/sd_get_machine_names.html index 7dd7c3a1f..ef0cc6582 100644 --- a/man/sd_get_machine_names.html +++ b/man/sd_get_machine_names.html @@ -19,33 +19,33 @@ Directives · Python · libudev · - gudev systemd 218


Name

sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names — Determine available seats, sessions, logged in users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_get_seats(char ***seats);
 
int sd_get_sessions(char ***sessions);
 
int sd_get_uids(uid_t **users);
 
int sd_get_machine_names(char ***machines);
 

Description¶

sd_get_seats() may be used - to determine all currently available local - seats. Returns a NULL terminated array of seat - identifiers. The returned array and all strings it - references need to be freed with the libc - free(3) - call after use. Note that instead of an empty array - NULL may be returned and should be considered - equivalent to an empty array.

Similarly, sd_get_sessions() may - be used to determine all current login sessions.

Similarly, sd_get_uids() may - be used to determine all Unix users who currently have login sessions.

Similarly, - sd_get_machine_names() may be - used to determine all current virtual machines and - containers on the system.

Note that the returned lists are not sorted and in an undefined order.

Return Value¶

On success, sd_get_seats(), - sd_get_sessions(), - sd_get_uids() and - sd_get_machine_names() return the - number of entries in the arrays. On failure, these - calls return a negative errno-style error code.

Notes¶

The sd_get_seats(), - sd_get_sessions(), - sd_get_uids() and - sd_get_machine_names() interfaces - are available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - file.

+ gudev systemd 219

Name

sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names — Determine available seats, sessions, logged in users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_get_seats(char ***seats);
 
int sd_get_sessions(char ***sessions);
 
int sd_get_uids(uid_t **users);
 
int sd_get_machine_names(char ***machines);
 

Description¶

sd_get_seats() may be used to determine + all currently available local seats. Returns a + NULL terminated array of seat identifiers. + The returned array and all strings it references need to be freed + with the libc + free(3) + call after use. Note that instead of an empty array + NULL may be returned and should be considered + equivalent to an empty array.

Similarly, sd_get_sessions() may be + used to determine all current login sessions.

Similarly, sd_get_uids() may be used to + determine all Unix users who currently have login sessions.

Similarly, sd_get_machine_names() may + be used to determine all current virtual machines and containers + on the system.

Note that the returned lists are not sorted and in an + undefined order.

Return Value¶

On success, sd_get_seats(), + sd_get_sessions(), + sd_get_uids() and + sd_get_machine_names() return the number of + entries in the arrays. On failure, these calls return a negative + errno-style error code.

Notes¶

The sd_get_seats(), + sd_get_sessions(), + sd_get_uids() and + sd_get_machine_names() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_get_seats.3 b/man/sd_get_seats.3 index fd8722286..3be8f4e9b 100644 --- a/man/sd_get_seats.3 +++ b/man/sd_get_seats.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_GET_SEATS" "3" "" "systemd 218" "sd_get_seats" +.TH "SD_GET_SEATS" "3" "" "systemd 219" "sd_get_seats" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_get_seats.html b/man/sd_get_seats.html index 7dd7c3a1f..ef0cc6582 100644 --- a/man/sd_get_seats.html +++ b/man/sd_get_seats.html @@ -19,33 +19,33 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names — Determine available seats, sessions, logged in users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_get_seats(char ***seats);
 
int sd_get_sessions(char ***sessions);
 
int sd_get_uids(uid_t **users);
 
int sd_get_machine_names(char ***machines);
 

Description¶

sd_get_seats() may be used - to determine all currently available local - seats. Returns a NULL terminated array of seat - identifiers. The returned array and all strings it - references need to be freed with the libc - free(3) - call after use. Note that instead of an empty array - NULL may be returned and should be considered - equivalent to an empty array.

Similarly, sd_get_sessions() may - be used to determine all current login sessions.

Similarly, sd_get_uids() may - be used to determine all Unix users who currently have login sessions.

Similarly, - sd_get_machine_names() may be - used to determine all current virtual machines and - containers on the system.

Note that the returned lists are not sorted and in an undefined order.

Return Value¶

On success, sd_get_seats(), - sd_get_sessions(), - sd_get_uids() and - sd_get_machine_names() return the - number of entries in the arrays. On failure, these - calls return a negative errno-style error code.

Notes¶

The sd_get_seats(), - sd_get_sessions(), - sd_get_uids() and - sd_get_machine_names() interfaces - are available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - file.

+ gudev systemd 219

Name

sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names — Determine available seats, sessions, logged in users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_get_seats(char ***seats);
 
int sd_get_sessions(char ***sessions);
 
int sd_get_uids(uid_t **users);
 
int sd_get_machine_names(char ***machines);
 

Description¶

sd_get_seats() may be used to determine + all currently available local seats. Returns a + NULL terminated array of seat identifiers. + The returned array and all strings it references need to be freed + with the libc + free(3) + call after use. Note that instead of an empty array + NULL may be returned and should be considered + equivalent to an empty array.

Similarly, sd_get_sessions() may be + used to determine all current login sessions.

Similarly, sd_get_uids() may be used to + determine all Unix users who currently have login sessions.

Similarly, sd_get_machine_names() may + be used to determine all current virtual machines and containers + on the system.

Note that the returned lists are not sorted and in an + undefined order.

Return Value¶

On success, sd_get_seats(), + sd_get_sessions(), + sd_get_uids() and + sd_get_machine_names() return the number of + entries in the arrays. On failure, these calls return a negative + errno-style error code.

Notes¶

The sd_get_seats(), + sd_get_sessions(), + sd_get_uids() and + sd_get_machine_names() interfaces are + available as a shared library, which can be compiled and linked to + with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_get_seats.xml b/man/sd_get_seats.xml index 76527c3f6..4390d36eb 100644 --- a/man/sd_get_seats.xml +++ b/man/sd_get_seats.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd_is_fifo - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_is_fifo - 3 - - - - sd_is_fifo - sd_is_socket - sd_is_socket_inet - sd_is_socket_unix - sd_is_mq - sd_is_special - Check the type of a file descriptor - - - - - #include <systemd/sd-daemon.h> - - - int sd_is_fifo - int fd - const char *path - - - - int sd_is_socket - int fd - int family - int type - int listening - - - - int sd_is_socket_inet - int fd - int family - int type - int listening - uint16_t port - - - - int sd_is_socket_unix - int fd - int type - int listening - const char *path - size_t length - - - - int sd_is_mq - int fd - const char *path - - - - int sd_is_special - int fd - const char *path - - - - - - - Description - - sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path. - - sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise. - - sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6. - - sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address. - - sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name. - - sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys. - - - - Return Value - - On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero. - - - - Notes - - - - Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to. - - - - See Also - - systemd1, - sd-daemon3, - sd_listen_fds3, - systemd.service5, - systemd.socket5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd_is_fifo + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_is_fifo + 3 + + + + sd_is_fifo + sd_is_socket + sd_is_socket_inet + sd_is_socket_unix + sd_is_mq + sd_is_special + Check the type of a file descriptor + + + + + #include <systemd/sd-daemon.h> + + + int sd_is_fifo + int fd + const char *path + + + + int sd_is_socket + int fd + int family + int type + int listening + + + + int sd_is_socket_inet + int fd + int family + int type + int listening + uint16_t port + + + + int sd_is_socket_unix + int fd + int type + int listening + const char *path + size_t length + + + + int sd_is_mq + int fd + const char *path + + + + int sd_is_special + int fd + const char *path + + + + + + + Description + + sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path. + + sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise. + + sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6. + + sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address. + + sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name. + + sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys. + + + + Return Value + + On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero. + + + + Notes + + + + Internally, these function use a combination of + fstat() and + getsockname() to check the file descriptor + type and where it is bound to. + + + + See Also + + systemd1, + sd-daemon3, + sd_listen_fds3, + systemd.service5, + systemd.socket5 + + diff --git a/man/sd_is_mq.html b/man/sd_is_mq.html index 33bd833c8..1d7c818c8 100644 --- a/man/sd_is_mq.html +++ b/man/sd_is_mq.html @@ -19,73 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path.

sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise.

sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6.

sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address.

sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name.

sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys.

Return Value¶

On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path.

sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise.

sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6.

sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address.

sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name.

sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys.

Return Value¶

On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to.

+ fstat() and + getsockname() to check the file descriptor + type and where it is bound to.

diff --git a/man/sd_is_socket.html b/man/sd_is_socket.html index 33bd833c8..1d7c818c8 100644 --- a/man/sd_is_socket.html +++ b/man/sd_is_socket.html @@ -19,73 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path.

sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise.

sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6.

sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address.

sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name.

sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys.

Return Value¶

On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path.

sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise.

sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6.

sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address.

sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name.

sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys.

Return Value¶

On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to.

+ fstat() and + getsockname() to check the file descriptor + type and where it is bound to.

diff --git a/man/sd_is_socket_inet.html b/man/sd_is_socket_inet.html index 33bd833c8..1d7c818c8 100644 --- a/man/sd_is_socket_inet.html +++ b/man/sd_is_socket_inet.html @@ -19,73 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path.

sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise.

sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6.

sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address.

sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name.

sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys.

Return Value¶

On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path.

sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise.

sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6.

sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address.

sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name.

sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys.

Return Value¶

On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to.

+ fstat() and + getsockname() to check the file descriptor + type and where it is bound to.

diff --git a/man/sd_is_socket_unix.html b/man/sd_is_socket_unix.html index 33bd833c8..1d7c818c8 100644 --- a/man/sd_is_socket_unix.html +++ b/man/sd_is_socket_unix.html @@ -19,73 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path.

sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise.

sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6.

sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address.

sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name.

sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys.

Return Value¶

On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path.

sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise.

sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6.

sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address.

sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name.

sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys.

Return Value¶

On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to.

+ fstat() and + getsockname() to check the file descriptor + type and where it is bound to.

diff --git a/man/sd_is_special.html b/man/sd_is_special.html index 33bd833c8..1d7c818c8 100644 --- a/man/sd_is_special.html +++ b/man/sd_is_special.html @@ -19,73 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called - to check whether the specified file descriptor refers - to a FIFO or pipe. If the path - parameter is not NULL, it is - checked whether the FIFO is bound to the specified - file system path.

sd_is_socket() may be - called to check whether the specified file descriptor - refers to a socket. If the - family parameter is not - AF_UNSPEC, it is checked whether - the socket is of the specified family (AF_UNIX, - AF_INET, ...). If the - type parameter is not 0, it is - checked whether the socket is of the specified type - (SOCK_STREAM, - SOCK_DGRAM, ...). If the - listening parameter is positive, - it is checked whether the socket is in accepting mode, - i.e. listen() has been called for - it. If listening is 0, it is - checked whether the socket is not in this mode. If the - parameter is negative, no such check is made. The - listening parameter should only - be used for stream sockets and should be set to a - negative value otherwise.

sd_is_socket_inet() is - similar to sd_is_socket(), but - optionally checks the IPv4 or IPv6 port number the - socket is bound to, unless port - is zero. For this call family - must be passed as either AF_UNSPEC, AF_INET, or - AF_INET6.

sd_is_socket_unix() is - similar to sd_is_socket() but - optionally checks the AF_UNIX path the socket is bound - to, unless the path parameter - is NULL. For normal file system AF_UNIX sockets, - set the length parameter to 0. For - Linux abstract namespace sockets, set the - length to the size of the - address, including the initial 0 byte, and set the - path to the initial 0 byte of - the socket address.

sd_is_mq() may be called to - check whether the specified file descriptor refers to - a POSIX message queue. If the - path parameter is not - NULL, it is checked whether the - message queue is bound to the specified name.

sd_is_special() may be - called to check whether the specified file descriptor - refers to a special file. If the - path parameter is not - NULL, it is checked whether the file - descriptor is bound to the specified file - name. Special files in this context are character - device nodes and files in /proc - or /sys.

Return Value¶

On failure, these calls return a negative - errno-style error code. If the file descriptor is of - the specified type and bound to the specified address, - a positive return value is returned, otherwise - zero.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_is_fifo, sd_is_socket, sd_is_socket_inet, sd_is_socket_unix, sd_is_mq, sd_is_special — Check the type of a file descriptor

Synopsis

#include <systemd/sd-daemon.h>
int sd_is_fifo(int fd,
 const char *path);
 
int sd_is_socket(int fd,
 int family,
 int type,
 int listening);
 
int sd_is_socket_inet(int fd,
 int family,
 int type,
 int listening,
 uint16_t port);
 
int sd_is_socket_unix(int fd,
 int type,
 int listening,
 const char *path,
 size_t length);
 
int sd_is_mq(int fd,
 const char *path);
 
int sd_is_special(int fd,
 const char *path);
 

Description¶

sd_is_fifo() may be called to check + whether the specified file descriptor refers to a FIFO or pipe. If + the path parameter is not + NULL, it is checked whether the FIFO is bound + to the specified file system path.

sd_is_socket() may be called to check + whether the specified file descriptor refers to a socket. If the + family parameter is not + AF_UNSPEC, it is checked whether the socket + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the + listening parameter is positive, it is + checked whether the socket is in accepting mode, i.e. + listen() has been called for it. If + listening is 0, it is checked whether the + socket is not in this mode. If the parameter is negative, no such + check is made. The listening parameter + should only be used for stream sockets and should be set to a + negative value otherwise.

sd_is_socket_inet() is similar to + sd_is_socket(), but optionally checks the + IPv4 or IPv6 port number the socket is bound to, unless + port is zero. For this call + family must be passed as either + AF_UNSPEC, AF_INET, or + AF_INET6.

sd_is_socket_unix() is similar to + sd_is_socket() but optionally checks the + AF_UNIX path the socket is bound to, unless + the path parameter is + NULL. For normal file system + AF_UNIX sockets, set the + length parameter to 0. For Linux abstract + namespace sockets, set the length to the + size of the address, including the initial 0 byte, and set the + path to the initial 0 byte of the socket + address.

sd_is_mq() may be called to check + whether the specified file descriptor refers to a POSIX message + queue. If the path parameter is not + NULL, it is checked whether the message queue + is bound to the specified name.

sd_is_special() may be called to check + whether the specified file descriptor refers to a special file. If + the path parameter is not + NULL, it is checked whether the file + descriptor is bound to the specified file name. Special files in + this context are character device nodes and files in + /proc or /sys.

Return Value¶

On failure, these calls return a negative errno-style error + code. If the file descriptor is of the specified type and bound to + the specified address, a positive return value is returned, + otherwise zero.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.

Internally, these function use a combination of - fstat() and - getsockname() to check the file - descriptor type and where it is bound to.

+ fstat() and + getsockname() to check the file descriptor + type and where it is bound to.

diff --git a/man/sd_journal.html b/man/sd_journal.html index f124e223a..1cba05767 100644 --- a/man/sd_journal.html +++ b/man/sd_journal.html @@ -19,108 +19,94 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens - the log journal for reading. It will find all journal - files automatically and interleave them automatically - when reading. As first argument it takes a pointer to - a sd_journal pointer, which on - success will contain a journal context object. The - second argument is a flags field, which may consist of - the following flags ORed together: - SD_JOURNAL_LOCAL_ONLY makes sure - only journal files generated on the local machine will - be opened. SD_JOURNAL_RUNTIME_ONLY - makes sure only volatile journal files will be opened, - excluding those which are stored on persistent - storage. SD_JOURNAL_SYSTEM - will cause journal files of system services and the - kernel (in opposition to user session processes) to - be opened. SD_JOURNAL_CURRENT_USER - will cause journal files of the current user to be - opened. If neither SD_JOURNAL_SYSTEM - nor SD_JOURNAL_CURRENT_USER are - specified, all journal file types will be opened.

sd_journal_open_directory() - is similar to sd_journal_open() - but takes an absolute directory path as argument. All - journal files in this directory will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call.

sd_journal_open_files() - is similar to sd_journal_open() - but takes a NULL-terminated list - of file paths to open. All files will be opened and - interleaved automatically. This call also takes a - flags argument, but it must be passed as 0 as no flags - are currently understood for this call. Please note - that in the case of a live journal, this function is only - useful for debugging, because individual journal files - can be rotated at any moment, and the opening of - specific files is inherently racy.

sd_journal_open_container() - is similar to sd_journal_open() - but opens the journal files of a running - OS container. The specified machine name refers to a - container that is registered with - systemd-machined(8).

sd_journal objects cannot be - used in the child after a fork. Functions which take a - journal object as an argument - (sd_journal_next() and others) - will return -ECHILD after a fork. -

sd_journal_close() will - close the journal context allocated with - sd_journal_open() or - sd_journal_open_directory() and - free its resources.

When opening the journal only journal files - accessible to the calling user will be opened. If - journal files are not accessible to the caller, this - will be silently ignored.

See - sd_journal_next(3) - for an example of how to iterate through the journal - after opening it with - sd_journal_open().

A journal context object returned by - sd_journal_open() references a - specific journal entry as current entry, - similar to a file seek index in a classic file system - file, but without absolute positions. It may be - altered with - sd_journal_next(3) - and - sd_journal_seek_head(3) - and related calls. The current entry position may be - exported in cursor strings, as accessible - via - sd_journal_get_cursor(3). Cursor - strings may be used to globally identify a specific - journal entry in a stable way and then later to seek - to it (or if the specific entry is not available - locally, to its closest entry in time) - sd_journal_seek_cursor(3).

Notification of journal changes is available via - sd_journal_get_fd() and related - calls.

Return Value¶

The sd_journal_open(), - sd_journal_open_directory(), and - sd_journal_open_files() calls - return 0 on success or a negative errno-style error - code. sd_journal_close() returns - nothing.

Notes¶

The sd_journal_open(), - sd_journal_open_directory() and - sd_journal_close() interfaces are - available as a shared library, which can be compiled and - linked to with the - libsystemd pkg-config(1) - file.

History¶

sd_journal_open(), - sd_journal_close(), - SD_JOURNAL_LOCAL_ONLY, - SD_JOURNAL_RUNTIME_ONLY, - SD_JOURNAL_SYSTEM_ONLY were added - in systemd-38.

sd_journal_open_directory() - was added in systemd-187.

SD_JOURNAL_SYSTEM, - SD_JOURNAL_CURRENT_USER, - and sd_journal_open_files() - were added in systemd-205. - SD_JOURNAL_SYSTEM_ONLY - was deprecated.

+ gudev systemd 219

Name

sd_journal_open, sd_journal_open_directory, sd_journal_open_files, sd_journal_open_container, sd_journal_close, sd_journal, SD_JOURNAL_LOCAL_ONLY, SD_JOURNAL_RUNTIME_ONLY, SD_JOURNAL_SYSTEM, SD_JOURNAL_CURRENT_USER — Open the system journal for reading

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_open(sd_journal **ret,
 int flags);
 
int sd_journal_open_directory(sd_journal **ret,
 const char *path,
 int flags);
 
int sd_journal_open_files(sd_journal **ret,
 const char **paths,
 int flags);
 
int sd_journal_open_container(sd_journal **ret,
 const char *machine,
 int flags);
 
void sd_journal_close(sd_journal *j);
 

Description¶

sd_journal_open() opens the log journal + for reading. It will find all journal files automatically and + interleave them automatically when reading. As first argument it + takes a pointer to a sd_journal pointer, which + on success will contain a journal context object. The second + argument is a flags field, which may consist of the following + flags ORed together: SD_JOURNAL_LOCAL_ONLY + makes sure only journal files generated on the local machine will + be opened. SD_JOURNAL_RUNTIME_ONLY makes sure + only volatile journal files will be opened, excluding those which + are stored on persistent storage. + SD_JOURNAL_SYSTEM will cause journal files of + system services and the kernel (in opposition to user session + processes) to be opened. + SD_JOURNAL_CURRENT_USER will cause journal + files of the current user to be opened. If neither + SD_JOURNAL_SYSTEM nor + SD_JOURNAL_CURRENT_USER are specified, all + journal file types will be opened.

sd_journal_open_directory() is similar + to sd_journal_open() but takes an absolute + directory path as argument. All journal files in this directory + will be opened and interleaved automatically. This call also takes + a flags argument, but it must be passed as 0 as no flags are + currently understood for this call.

sd_journal_open_files() is similar to + sd_journal_open() but takes a + NULL-terminated list of file paths to open. + All files will be opened and interleaved automatically. This call + also takes a flags argument, but it must be passed as 0 as no + flags are currently understood for this call. Please note that in + the case of a live journal, this function is only useful for + debugging, because individual journal files can be rotated at any + moment, and the opening of specific files is inherently + racy.

sd_journal_open_container() is similar + to sd_journal_open() but opens the journal + files of a running OS container. The specified machine name refers + to a container that is registered with + systemd-machined(8).

sd_journal objects cannot be used in the + child after a fork. Functions which take a journal object as an + argument (sd_journal_next() and others) will + return -ECHILD after a fork. +

sd_journal_close() will close the + journal context allocated with + sd_journal_open() or + sd_journal_open_directory() and free its + resources.

When opening the journal only journal files accessible to + the calling user will be opened. If journal files are not + accessible to the caller, this will be silently ignored.

See + sd_journal_next(3) + for an example of how to iterate through the journal after opening + it with sd_journal_open().

A journal context object returned by + sd_journal_open() references a specific + journal entry as current entry, similar to a + file seek index in a classic file system file, but without + absolute positions. It may be altered with + sd_journal_next(3) + and + sd_journal_seek_head(3) + and related calls. The current entry position may be exported in + cursor strings, as accessible via + sd_journal_get_cursor(3). + Cursor strings may be used to globally identify a specific journal + entry in a stable way and then later to seek to it (or if the + specific entry is not available locally, to its closest entry in + time) + sd_journal_seek_cursor(3).

Notification of journal changes is available via + sd_journal_get_fd() and related calls.

Return Value¶

The sd_journal_open(), + sd_journal_open_directory(), and + sd_journal_open_files() calls return 0 on + success or a negative errno-style error code. + sd_journal_close() returns nothing.

Notes¶

The sd_journal_open(), + sd_journal_open_directory() and + sd_journal_close() interfaces are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config(1) + file.

History¶

sd_journal_open(), + sd_journal_close(), + SD_JOURNAL_LOCAL_ONLY, + SD_JOURNAL_RUNTIME_ONLY, + SD_JOURNAL_SYSTEM_ONLY were added in + systemd-38.

sd_journal_open_directory() was added + in systemd-187.

SD_JOURNAL_SYSTEM, + SD_JOURNAL_CURRENT_USER, and + sd_journal_open_files() were added in + systemd-205. SD_JOURNAL_SYSTEM_ONLY was + deprecated.

diff --git a/man/sd_journal_add_conjunction.html b/man/sd_journal_add_conjunction.html index 223b124a5..16f9abe73 100644 --- a/man/sd_journal_add_conjunction.html +++ b/man/sd_journal_add_conjunction.html @@ -19,102 +19,90 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds - a match by which to filter the entries of the journal - file. Matches applied with this call will filter what - can be iterated through and read from the journal file - via calls like - sd_journal_next(3) - and - sd_journal_get_data(3). Matches - are of the form "FIELD=value", where - the field part is a short uppercase string consisting - only of 0-9, A-Z and the underscore. It may not begin - with two underscores or be the empty string. The value - part may be any value, including binary. If a match is - applied, only entries with this field set will be - iterated. Multiple matches may be active at the same - time: If they apply to different fields, only entries - with both fields set like this will be iterated. If - they apply to the same fields, only entries where the - field takes one of the specified values will be - iterated. Well known fields are documented in - systemd.journal-fields(7). Whenever - a new match is added the current entry position is - reset, and - sd_journal_next(3) (or a similar call) - needs to be called before entries can be read - again.

sd_journal_add_disjunction() - may be used to insert a disjunction (i.e. logical OR) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_disjunction() or - sd_journal_add_conjunction() are - combined in an OR with all matches added afterwards, - until - sd_journal_add_disjunction() or - sd_journal_add_conjunction() is - invoked again to begin the next OR or AND - term.

sd_journal_add_conjunction() - may be used to insert a conjunction (i.e. logical AND) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_conjunction() are - combined in an AND with all matches added afterwards, - until - sd_journal_add_conjunction() is - invoked again to begin the next AND term. The - combination of - sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() may - be used to build complex search terms, even though - full logical expressions are not available. Note that - sd_journal_add_conjunction() - operates one level 'higher' than - sd_journal_add_disjunction(). It - is hence possible to build an expression of AND terms, - consisting of OR terms, consisting of AND terms, - consisting of OR terms of matches (the latter OR - expression is implicitly created for matches with the - same field name, see above).

sd_journal_flush_matches() - may be used to flush all matches, disjunction and - conjunction terms again. After this call all filtering - is removed and all entries in the journal will be - iterated again.

Note that filtering via matches only applies to - the way the journal is read, it has no effect on storage - on disk.

Return Value¶

sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() - return 0 on success or a negative errno-style error - code. sd_journal_flush_matches() - returns nothing.

Notes¶

The sd_journal_add_match(), - sd_journal_add_disjunction(), - sd_journal_add_conjunction() and - sd_journal_flush_matches() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

Examples¶

The following example adds matches to a journal - context object to iterate only through messages - generated by the Avahi service at the four error log - levels, plus all messages of the message ID - 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any - service (this example lacks the necessary error - checking):

...
+  gudev systemd 219

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds a match by + which to filter the entries of the journal file. Matches applied + with this call will filter what can be iterated through and read + from the journal file via calls like + sd_journal_next(3) + and + sd_journal_get_data(3). + Matches are of the form "FIELD=value", where the + field part is a short uppercase string consisting only of 0-9, A-Z + and the underscore. It may not begin with two underscores or be + the empty string. The value part may be any value, including + binary. If a match is applied, only entries with this field set + will be iterated. Multiple matches may be active at the same time: + If they apply to different fields, only entries with both fields + set like this will be iterated. If they apply to the same fields, + only entries where the field takes one of the specified values + will be iterated. Well known fields are documented in + systemd.journal-fields(7). + Whenever a new match is added the current entry position is reset, + and + sd_journal_next(3) + (or a similar call) needs to be called before entries can be read + again.

sd_journal_add_disjunction() may be + used to insert a disjunction (i.e. logical OR) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_disjunction() or + sd_journal_add_conjunction() are combined in + an OR with all matches added afterwards, until + sd_journal_add_disjunction() or + sd_journal_add_conjunction() is invoked again + to begin the next OR or AND term.

sd_journal_add_conjunction() may be + used to insert a conjunction (i.e. logical AND) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_conjunction() are combined in + an AND with all matches added afterwards, until + sd_journal_add_conjunction() is invoked again + to begin the next AND term. The combination of + sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() may be used to + build complex search terms, even though full logical expressions + are not available. Note that + sd_journal_add_conjunction() operates one + level 'higher' than + sd_journal_add_disjunction(). It is hence + possible to build an expression of AND terms, consisting of OR + terms, consisting of AND terms, consisting of OR terms of matches + (the latter OR expression is implicitly created for matches with + the same field name, see above).

sd_journal_flush_matches() may be used + to flush all matches, disjunction and conjunction terms again. + After this call all filtering is removed and all entries in the + journal will be iterated again.

Note that filtering via matches only applies to the way the + journal is read, it has no effect on storage on disk.

Return Value¶

sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() + return 0 on success or a negative errno-style error + code. sd_journal_flush_matches() + returns nothing.

Notes¶

The sd_journal_add_match(), + sd_journal_add_disjunction(), + sd_journal_add_conjunction() and + sd_journal_flush_matches() + interfaces are available as a shared library, which can + be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

The following example adds matches to a journal context + object to iterate only through messages generated by the Avahi + service at the four error log levels, plus all messages of the + message ID 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any + service (this example lacks the necessary error checking):

...
 int add_matches(sd_journal *j) {
-        sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0);
-        sd_journal_add_match(j, "PRIORITY=0", 0);
-        sd_journal_add_match(j, "PRIORITY=1", 0);
-        sd_journal_add_match(j, "PRIORITY=2", 0);
-        sd_journal_add_match(j, "PRIORITY=3", 0);
-        sd_journal_add_disjunction(j);
-        sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0);
-}
+ sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0); + sd_journal_add_match(j, "PRIORITY=0", 0); + sd_journal_add_match(j, "PRIORITY=1", 0); + sd_journal_add_match(j, "PRIORITY=2", 0); + sd_journal_add_match(j, "PRIORITY=3", 0); + sd_journal_add_disjunction(j); + sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); +}
diff --git a/man/sd_journal_add_disjunction.html b/man/sd_journal_add_disjunction.html index 223b124a5..16f9abe73 100644 --- a/man/sd_journal_add_disjunction.html +++ b/man/sd_journal_add_disjunction.html @@ -19,102 +19,90 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds - a match by which to filter the entries of the journal - file. Matches applied with this call will filter what - can be iterated through and read from the journal file - via calls like - sd_journal_next(3) - and - sd_journal_get_data(3). Matches - are of the form "FIELD=value", where - the field part is a short uppercase string consisting - only of 0-9, A-Z and the underscore. It may not begin - with two underscores or be the empty string. The value - part may be any value, including binary. If a match is - applied, only entries with this field set will be - iterated. Multiple matches may be active at the same - time: If they apply to different fields, only entries - with both fields set like this will be iterated. If - they apply to the same fields, only entries where the - field takes one of the specified values will be - iterated. Well known fields are documented in - systemd.journal-fields(7). Whenever - a new match is added the current entry position is - reset, and - sd_journal_next(3) (or a similar call) - needs to be called before entries can be read - again.

sd_journal_add_disjunction() - may be used to insert a disjunction (i.e. logical OR) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_disjunction() or - sd_journal_add_conjunction() are - combined in an OR with all matches added afterwards, - until - sd_journal_add_disjunction() or - sd_journal_add_conjunction() is - invoked again to begin the next OR or AND - term.

sd_journal_add_conjunction() - may be used to insert a conjunction (i.e. logical AND) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_conjunction() are - combined in an AND with all matches added afterwards, - until - sd_journal_add_conjunction() is - invoked again to begin the next AND term. The - combination of - sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() may - be used to build complex search terms, even though - full logical expressions are not available. Note that - sd_journal_add_conjunction() - operates one level 'higher' than - sd_journal_add_disjunction(). It - is hence possible to build an expression of AND terms, - consisting of OR terms, consisting of AND terms, - consisting of OR terms of matches (the latter OR - expression is implicitly created for matches with the - same field name, see above).

sd_journal_flush_matches() - may be used to flush all matches, disjunction and - conjunction terms again. After this call all filtering - is removed and all entries in the journal will be - iterated again.

Note that filtering via matches only applies to - the way the journal is read, it has no effect on storage - on disk.

Return Value¶

sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() - return 0 on success or a negative errno-style error - code. sd_journal_flush_matches() - returns nothing.

Notes¶

The sd_journal_add_match(), - sd_journal_add_disjunction(), - sd_journal_add_conjunction() and - sd_journal_flush_matches() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

Examples¶

The following example adds matches to a journal - context object to iterate only through messages - generated by the Avahi service at the four error log - levels, plus all messages of the message ID - 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any - service (this example lacks the necessary error - checking):

...
+  gudev systemd 219

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds a match by + which to filter the entries of the journal file. Matches applied + with this call will filter what can be iterated through and read + from the journal file via calls like + sd_journal_next(3) + and + sd_journal_get_data(3). + Matches are of the form "FIELD=value", where the + field part is a short uppercase string consisting only of 0-9, A-Z + and the underscore. It may not begin with two underscores or be + the empty string. The value part may be any value, including + binary. If a match is applied, only entries with this field set + will be iterated. Multiple matches may be active at the same time: + If they apply to different fields, only entries with both fields + set like this will be iterated. If they apply to the same fields, + only entries where the field takes one of the specified values + will be iterated. Well known fields are documented in + systemd.journal-fields(7). + Whenever a new match is added the current entry position is reset, + and + sd_journal_next(3) + (or a similar call) needs to be called before entries can be read + again.

sd_journal_add_disjunction() may be + used to insert a disjunction (i.e. logical OR) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_disjunction() or + sd_journal_add_conjunction() are combined in + an OR with all matches added afterwards, until + sd_journal_add_disjunction() or + sd_journal_add_conjunction() is invoked again + to begin the next OR or AND term.

sd_journal_add_conjunction() may be + used to insert a conjunction (i.e. logical AND) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_conjunction() are combined in + an AND with all matches added afterwards, until + sd_journal_add_conjunction() is invoked again + to begin the next AND term. The combination of + sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() may be used to + build complex search terms, even though full logical expressions + are not available. Note that + sd_journal_add_conjunction() operates one + level 'higher' than + sd_journal_add_disjunction(). It is hence + possible to build an expression of AND terms, consisting of OR + terms, consisting of AND terms, consisting of OR terms of matches + (the latter OR expression is implicitly created for matches with + the same field name, see above).

sd_journal_flush_matches() may be used + to flush all matches, disjunction and conjunction terms again. + After this call all filtering is removed and all entries in the + journal will be iterated again.

Note that filtering via matches only applies to the way the + journal is read, it has no effect on storage on disk.

Return Value¶

sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() + return 0 on success or a negative errno-style error + code. sd_journal_flush_matches() + returns nothing.

Notes¶

The sd_journal_add_match(), + sd_journal_add_disjunction(), + sd_journal_add_conjunction() and + sd_journal_flush_matches() + interfaces are available as a shared library, which can + be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

The following example adds matches to a journal context + object to iterate only through messages generated by the Avahi + service at the four error log levels, plus all messages of the + message ID 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any + service (this example lacks the necessary error checking):

...
 int add_matches(sd_journal *j) {
-        sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0);
-        sd_journal_add_match(j, "PRIORITY=0", 0);
-        sd_journal_add_match(j, "PRIORITY=1", 0);
-        sd_journal_add_match(j, "PRIORITY=2", 0);
-        sd_journal_add_match(j, "PRIORITY=3", 0);
-        sd_journal_add_disjunction(j);
-        sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0);
-}
+ sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0); + sd_journal_add_match(j, "PRIORITY=0", 0); + sd_journal_add_match(j, "PRIORITY=1", 0); + sd_journal_add_match(j, "PRIORITY=2", 0); + sd_journal_add_match(j, "PRIORITY=3", 0); + sd_journal_add_disjunction(j); + sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); +}
diff --git a/man/sd_journal_add_match.3 b/man/sd_journal_add_match.3 index 4c20025f8..08262d698 100644 --- a/man/sd_journal_add_match.3 +++ b/man/sd_journal_add_match.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_JOURNAL_ADD_MATCH" "3" "" "systemd 218" "sd_journal_add_match" +.TH "SD_JOURNAL_ADD_MATCH" "3" "" "systemd 219" "sd_journal_add_match" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -108,13 +108,13 @@ The following example adds matches to a journal context object to iterate only t .nf \&.\&.\&. int add_matches(sd_journal *j) { - sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi\-daemon\&.service", 0); - sd_journal_add_match(j, "PRIORITY=0", 0); - sd_journal_add_match(j, "PRIORITY=1", 0); - sd_journal_add_match(j, "PRIORITY=2", 0); - sd_journal_add_match(j, "PRIORITY=3", 0); - sd_journal_add_disjunction(j); - sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); + sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi\-daemon\&.service", 0); + sd_journal_add_match(j, "PRIORITY=0", 0); + sd_journal_add_match(j, "PRIORITY=1", 0); + sd_journal_add_match(j, "PRIORITY=2", 0); + sd_journal_add_match(j, "PRIORITY=3", 0); + sd_journal_add_disjunction(j); + sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); } .fi .if n \{\ diff --git a/man/sd_journal_add_match.html b/man/sd_journal_add_match.html index 223b124a5..16f9abe73 100644 --- a/man/sd_journal_add_match.html +++ b/man/sd_journal_add_match.html @@ -19,102 +19,90 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds - a match by which to filter the entries of the journal - file. Matches applied with this call will filter what - can be iterated through and read from the journal file - via calls like - sd_journal_next(3) - and - sd_journal_get_data(3). Matches - are of the form "FIELD=value", where - the field part is a short uppercase string consisting - only of 0-9, A-Z and the underscore. It may not begin - with two underscores or be the empty string. The value - part may be any value, including binary. If a match is - applied, only entries with this field set will be - iterated. Multiple matches may be active at the same - time: If they apply to different fields, only entries - with both fields set like this will be iterated. If - they apply to the same fields, only entries where the - field takes one of the specified values will be - iterated. Well known fields are documented in - systemd.journal-fields(7). Whenever - a new match is added the current entry position is - reset, and - sd_journal_next(3) (or a similar call) - needs to be called before entries can be read - again.

sd_journal_add_disjunction() - may be used to insert a disjunction (i.e. logical OR) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_disjunction() or - sd_journal_add_conjunction() are - combined in an OR with all matches added afterwards, - until - sd_journal_add_disjunction() or - sd_journal_add_conjunction() is - invoked again to begin the next OR or AND - term.

sd_journal_add_conjunction() - may be used to insert a conjunction (i.e. logical AND) - in the match list. If this call is invoked, all - previously added matches since the last invocation of - sd_journal_add_conjunction() are - combined in an AND with all matches added afterwards, - until - sd_journal_add_conjunction() is - invoked again to begin the next AND term. The - combination of - sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() may - be used to build complex search terms, even though - full logical expressions are not available. Note that - sd_journal_add_conjunction() - operates one level 'higher' than - sd_journal_add_disjunction(). It - is hence possible to build an expression of AND terms, - consisting of OR terms, consisting of AND terms, - consisting of OR terms of matches (the latter OR - expression is implicitly created for matches with the - same field name, see above).

sd_journal_flush_matches() - may be used to flush all matches, disjunction and - conjunction terms again. After this call all filtering - is removed and all entries in the journal will be - iterated again.

Note that filtering via matches only applies to - the way the journal is read, it has no effect on storage - on disk.

Return Value¶

sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_add_conjunction() - return 0 on success or a negative errno-style error - code. sd_journal_flush_matches() - returns nothing.

Notes¶

The sd_journal_add_match(), - sd_journal_add_disjunction(), - sd_journal_add_conjunction() and - sd_journal_flush_matches() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

Examples¶

The following example adds matches to a journal - context object to iterate only through messages - generated by the Avahi service at the four error log - levels, plus all messages of the message ID - 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any - service (this example lacks the necessary error - checking):

...
+  gudev systemd 219

Name

sd_journal_add_match, sd_journal_add_disjunction, sd_journal_add_conjunction, sd_journal_flush_matches — Add or remove entry matches

Synopsis

#include <systemd/sd-journal.h>
int sd_journal_add_match(sd_journal *j,
 const void *data,
 size_t size);
 
int sd_journal_add_disjunction(sd_journal *j);
 
int sd_journal_add_conjunction(sd_journal *j);
 
void sd_journal_flush_matches(sd_journal *j);
 

Description¶

sd_journal_add_match() adds a match by + which to filter the entries of the journal file. Matches applied + with this call will filter what can be iterated through and read + from the journal file via calls like + sd_journal_next(3) + and + sd_journal_get_data(3). + Matches are of the form "FIELD=value", where the + field part is a short uppercase string consisting only of 0-9, A-Z + and the underscore. It may not begin with two underscores or be + the empty string. The value part may be any value, including + binary. If a match is applied, only entries with this field set + will be iterated. Multiple matches may be active at the same time: + If they apply to different fields, only entries with both fields + set like this will be iterated. If they apply to the same fields, + only entries where the field takes one of the specified values + will be iterated. Well known fields are documented in + systemd.journal-fields(7). + Whenever a new match is added the current entry position is reset, + and + sd_journal_next(3) + (or a similar call) needs to be called before entries can be read + again.

sd_journal_add_disjunction() may be + used to insert a disjunction (i.e. logical OR) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_disjunction() or + sd_journal_add_conjunction() are combined in + an OR with all matches added afterwards, until + sd_journal_add_disjunction() or + sd_journal_add_conjunction() is invoked again + to begin the next OR or AND term.

sd_journal_add_conjunction() may be + used to insert a conjunction (i.e. logical AND) in the match list. + If this call is invoked, all previously added matches since the + last invocation of + sd_journal_add_conjunction() are combined in + an AND with all matches added afterwards, until + sd_journal_add_conjunction() is invoked again + to begin the next AND term. The combination of + sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() may be used to + build complex search terms, even though full logical expressions + are not available. Note that + sd_journal_add_conjunction() operates one + level 'higher' than + sd_journal_add_disjunction(). It is hence + possible to build an expression of AND terms, consisting of OR + terms, consisting of AND terms, consisting of OR terms of matches + (the latter OR expression is implicitly created for matches with + the same field name, see above).

sd_journal_flush_matches() may be used + to flush all matches, disjunction and conjunction terms again. + After this call all filtering is removed and all entries in the + journal will be iterated again.

Note that filtering via matches only applies to the way the + journal is read, it has no effect on storage on disk.

Return Value¶

sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() + return 0 on success or a negative errno-style error + code. sd_journal_flush_matches() + returns nothing.

Notes¶

The sd_journal_add_match(), + sd_journal_add_disjunction(), + sd_journal_add_conjunction() and + sd_journal_flush_matches() + interfaces are available as a shared library, which can + be compiled and linked to with the + libsystemd pkg-config(1) + file.

Examples¶

The following example adds matches to a journal context + object to iterate only through messages generated by the Avahi + service at the four error log levels, plus all messages of the + message ID 03bb1dab98ab4ecfbf6fff2738bdd964 coming from any + service (this example lacks the necessary error checking):

...
 int add_matches(sd_journal *j) {
-        sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0);
-        sd_journal_add_match(j, "PRIORITY=0", 0);
-        sd_journal_add_match(j, "PRIORITY=1", 0);
-        sd_journal_add_match(j, "PRIORITY=2", 0);
-        sd_journal_add_match(j, "PRIORITY=3", 0);
-        sd_journal_add_disjunction(j);
-        sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0);
-}
+ sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0); + sd_journal_add_match(j, "PRIORITY=0", 0); + sd_journal_add_match(j, "PRIORITY=1", 0); + sd_journal_add_match(j, "PRIORITY=2", 0); + sd_journal_add_match(j, "PRIORITY=3", 0); + sd_journal_add_disjunction(j); + sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); +}
diff --git a/man/sd_journal_add_match.xml b/man/sd_journal_add_match.xml index 21a5ab134..420f56356 100644 --- a/man/sd_journal_add_match.xml +++ b/man/sd_journal_add_match.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd_listen_fds - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_listen_fds - 3 - - - - sd_listen_fds - SD_LISTEN_FDS_START - Check for file descriptors passed by the system manager - - - - - #include <systemd/sd-daemon.h> - - #define SD_LISTEN_FDS_START 3 - - - int sd_listen_fds - int unset_environment - - - - - - Description - - sd_listen_fds() shall be - called by a daemon to check for file descriptors - passed by the init system as part of the socket-based - activation logic. - - If the unset_environment - parameter is non-zero, - sd_listen_fds() will unset the - $LISTEN_FDS/$LISTEN_PID - environment variables before returning (regardless of - whether the function call itself succeeded or - not). Further calls to - sd_listen_fds() will then fail, - but the variables are no longer inherited by child - processes. - - If a daemon receives more than one file - descriptor, they will be passed in the same order as - configured in the systemd socket definition - file. Nonetheless, it is recommended to verify the - correct socket types before using them. To simplify - this checking, the functions - sd_is_fifo3, - sd_is_socket3, - sd_is_socket_inet3, - sd_is_socket_unix3 - are provided. In order to maximize flexibility, it is - recommended to make these checks as loose as possible - without allowing incorrect setups. i.e. often, the - actual port number a socket is bound to matters little - for the service to work, hence it should not be - verified. On the other hand, whether a socket is a - datagram or stream socket matters a lot for the most - common program logics and should be checked. - - This function call will set the FD_CLOEXEC flag - for all passed file descriptors to avoid further - inheritance to children of the calling process. - - - - Return Value - - On failure, this call returns a negative - errno-style error code. If - $LISTEN_FDS/$LISTEN_PID - was not set or was not correctly set for this daemon and - hence no file descriptors were received, 0 is - returned. Otherwise, the number of file descriptors - passed is returned. The application may find them - starting with file descriptor SD_LISTEN_FDS_START, - i.e. file descriptor 3. - - - - Notes - - - - Internally, this function checks whether the - $LISTEN_PID environment variable - equals the daemon PID. If not, it returns - immediately. Otherwise, it parses the number passed in - the $LISTEN_FDS environment - variable, then sets the FD_CLOEXEC flag for the parsed - number of file descriptors starting from - SD_LISTEN_FDS_START. Finally, it returns the parsed - number. - - - - Environment - - - - $LISTEN_PID - $LISTEN_FDS - - Set by the init system - for supervised processes that use - socket-based activation. This - environment variable specifies the - data - sd_listen_fds() - parses. See above for - details. - - - - - - See Also - - - systemd1, - sd-daemon3, - sd_is_fifo3, - sd_is_socket3, - sd_is_socket_inet3, - sd_is_socket_unix3, - daemon7, - systemd.service5, - systemd.socket5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd_listen_fds + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_listen_fds + 3 + + + + sd_listen_fds + SD_LISTEN_FDS_START + Check for file descriptors passed by the system manager + + + + + #include <systemd/sd-daemon.h> + + #define SD_LISTEN_FDS_START 3 + + + int sd_listen_fds + int unset_environment + + + + + + Description + + sd_listen_fds() shall be called by a + daemon to check for file descriptors passed by the init system as + part of the socket-based activation logic. + + If the unset_environment parameter is + non-zero, sd_listen_fds() will unset the + $LISTEN_FDS and $LISTEN_PID + environment variables before returning (regardless of whether the + function call itself succeeded or not). Further calls to + sd_listen_fds() will then fail, but the + variables are no longer inherited by child processes. + + If a daemon receives more than one file descriptor, they + will be passed in the same order as configured in the systemd + socket unit file (see + systemd.socket5 + for details). Nonetheless, it is recommended to verify the correct + socket types before using them. To simplify this checking, the + functions + sd_is_fifo3, + sd_is_socket3, + sd_is_socket_inet3, + sd_is_socket_unix3 + are provided. In order to maximize flexibility, it is recommended + to make these checks as loose as possible without allowing + incorrect setups. i.e. often, the actual port number a socket is + bound to matters little for the service to work, hence it should + not be verified. On the other hand, whether a socket is a datagram + or stream socket matters a lot for the most common program logics + and should be checked. + + This function call will set the FD_CLOEXEC flag for all + passed file descriptors to avoid further inheritance to children + of the calling process. + + If multiple socket units activate the same service the order + of the file descriptors passed to its main process is undefined. + If additional file descriptors have been passed to the service + manager using + sd_pid_notify_with_fds3's + FDSTORE=1 messages, these file descriptors are + passed last, in arbitrary order, and with duplicates + removed. + + + + Return Value + + On failure, this call returns a negative errno-style error + code. If + $LISTEN_FDS/$LISTEN_PID was + not set or was not correctly set for this daemon and hence no file + descriptors were received, 0 is returned. Otherwise, the number of + file descriptors passed is returned. The application may find them + starting with file descriptor SD_LISTEN_FDS_START, i.e. file + descriptor 3. + + + + Notes + + + + Internally, this function checks whether the + $LISTEN_PID environment variable equals the + daemon PID. If not, it returns immediately. Otherwise, it parses + the number passed in the $LISTEN_FDS + environment variable, then sets the FD_CLOEXEC flag for the parsed + number of file descriptors starting from SD_LISTEN_FDS_START. + Finally, it returns the parsed number. + + + + Environment + + + + $LISTEN_PID + $LISTEN_FDS + + Set by the init system + for supervised processes that use + socket-based activation. This + environment variable specifies the + data + sd_listen_fds() + parses. See above for + details. + + + + + + See Also + + + systemd1, + sd-daemon3, + sd_is_fifo3, + sd_is_socket3, + sd_is_socket_inet3, + sd_is_socket_unix3, + daemon7, + systemd.service5, + systemd.socket5 + + diff --git a/man/sd_login_monitor.html b/man/sd_login_monitor.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor.html +++ b/man/sd_login_monitor.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_flush.html b/man/sd_login_monitor_flush.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor_flush.html +++ b/man/sd_login_monitor_flush.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_get_events.html b/man/sd_login_monitor_get_events.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor_get_events.html +++ b/man/sd_login_monitor_get_events.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_get_fd.html b/man/sd_login_monitor_get_fd.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor_get_fd.html +++ b/man/sd_login_monitor_get_fd.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_get_timeout.html b/man/sd_login_monitor_get_timeout.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor_get_timeout.html +++ b/man/sd_login_monitor_get_timeout.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_new.3 b/man/sd_login_monitor_new.3 index 5678b7ded..5dda9dc74 100644 --- a/man/sd_login_monitor_new.3 +++ b/man/sd_login_monitor_new.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_LOGIN_MONITOR_NEW" "3" "" "systemd 218" "sd_login_monitor_new" +.TH "SD_LOGIN_MONITOR_NEW" "3" "" "systemd 219" "sd_login_monitor_new" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -109,13 +109,13 @@ uint64_t t; int msec; sd_login_monitor_get_timeout(m, &t); if (t == (uint64_t) \-1) - msec = \-1; + msec = \-1; else { - struct timespec ts; - uint64_t n; - clock_getttime(CLOCK_MONOTONIC, &ts); - n = (uint64_t) ts\&.tv_sec * 1000000 + ts\&.tv_nsec / 1000; - msec = t > n ? (int) ((t \- n + 999) / 1000) : 0; + struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts\&.tv_sec * 1000000 + ts\&.tv_nsec / 1000; + msec = t > n ? (int) ((t \- n + 999) / 1000) : 0; } .fi .if n \{\ diff --git a/man/sd_login_monitor_new.html b/man/sd_login_monitor_new.html index 2c8c0e260..f6351c121 100644 --- a/man/sd_login_monitor_new.html +++ b/man/sd_login_monitor_new.html @@ -19,114 +19,102 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may - be used to monitor login sessions, users, seats, and - virtual machines/containers. Via a monitor object a - file descriptor can be integrated into an application - defined event loop which is woken up each time a user - logs in, logs out or a seat is added or removed, or a - session, user, seat or virtual machine/container - changes state otherwise. The first parameter takes a - string which can be "seat" (to get - only notifications about seats being added, removed or - changed), "session" (to get only - notifications about sessions being created or removed - or changed), "uid" (to get only - notifications when a user changes state in respect to - logins) or "machine" (to get only - notifications when a virtual machine or container is - started or stopped). If notifications shall be - generated in all these conditions, NULL may be - passed. Note that in the future additional categories - may be defined. The second parameter returns a monitor - object and needs to be freed with the - sd_login_monitor_unref() call - after use.

sd_login_monitor_unref() - may be used to destroy a monitor object. Note that - this will invalidate any file descriptor returned by - sd_login_monitor_get_fd().

sd_login_monitor_flush() - may be used to reset the wakeup state of the monitor - object. Whenever an event causes the monitor to wake - up the event loop via the file descriptor this - function needs to be called to reset the wake-up - state. If this call is not invoked, the file descriptor - will immediately wake up the event loop again.

sd_login_monitor_get_fd() - may be used to retrieve the file descriptor of the - monitor object that may be integrated in an - application defined event loop, based around - poll(2) - or a similar interface. The application should include - the returned file descriptor as wake-up source for the - events mask returned by - sd_login_monitor_get_events(). It - should pass a timeout value as returned by - sd_login_monitor_get_timeout(). Whenever - a wake-up is triggered the file descriptor needs to be - reset via - sd_login_monitor_flush(). An - application needs to reread the login state with a - function like - sd_get_seats(3) - or similar to determine what changed.

sd_login_monitor_get_events() - will return the poll() mask to - wait for. This function will return a combination of - POLLIN, POLLOUT - and similar to fill into the - ".events" field of struct - pollfd.

sd_login_monitor_get_timeout() - will return a timeout value for usage in - poll(). This returns a value in - microseconds since the epoch of CLOCK_MONOTONIC - for timing out poll() in - timeout_usec. See - clock_gettime(2) - for details about - CLOCK_MONOTONIC. If there is no - timeout to wait for this will fill in - (uint64_t) -1 instead. Note that - poll() takes a relative timeout - in milliseconds rather than an absolute timeout in - microseconds. To convert the absolute 'us' timeout into - relative 'ms', use code like the following:

uint64_t t;
+  gudev systemd 219

Name

sd_login_monitor_new, sd_login_monitor_unref, sd_login_monitor_flush, sd_login_monitor_get_fd, sd_login_monitor_get_events, sd_login_monitor_get_timeout, sd_login_monitor — Monitor login sessions, seats, users and virtual machines/containers

Synopsis

#include <systemd/sd-login.h>
int sd_login_monitor_new(const char *category,
 sd_login_monitor **ret);
 
sd_login_monitor *sd_login_monitor_unref(sd_login_monitor *m);
 
int sd_login_monitor_flush(sd_login_monitor *m);
 
int sd_login_monitor_get_fd(sd_login_monitor *m);
 
int sd_login_monitor_get_events(sd_login_monitor *m);
 
int sd_login_monitor_get_timeout(sd_login_monitor *m,
 uint64_t *timeout_usec);
 

Description¶

sd_login_monitor_new() may be used to + monitor login sessions, users, seats, and virtual + machines/containers. Via a monitor object a file descriptor can be + integrated into an application defined event loop which is woken + up each time a user logs in, logs out or a seat is added or + removed, or a session, user, seat or virtual machine/container + changes state otherwise. The first parameter takes a string which + can be "seat" (to get only notifications about + seats being added, removed or changed), "session" + (to get only notifications about sessions being created or removed + or changed), "uid" (to get only notifications + when a user changes state in respect to logins) or + "machine" (to get only notifications when a + virtual machine or container is started or stopped). If + notifications shall be generated in all these conditions, + NULL may be passed. Note that in the future + additional categories may be defined. The second parameter returns + a monitor object and needs to be freed with the + sd_login_monitor_unref() call after + use.

sd_login_monitor_unref() may be used to + destroy a monitor object. Note that this will invalidate any file + descriptor returned by + sd_login_monitor_get_fd().

sd_login_monitor_flush() may be used to + reset the wakeup state of the monitor object. Whenever an event + causes the monitor to wake up the event loop via the file + descriptor this function needs to be called to reset the wake-up + state. If this call is not invoked, the file descriptor will + immediately wake up the event loop again.

sd_login_monitor_get_fd() may be used + to retrieve the file descriptor of the monitor object that may be + integrated in an application defined event loop, based around + poll(2) + or a similar interface. The application should include the + returned file descriptor as wake-up source for the events mask + returned by sd_login_monitor_get_events(). It + should pass a timeout value as returned by + sd_login_monitor_get_timeout(). Whenever a + wake-up is triggered the file descriptor needs to be reset via + sd_login_monitor_flush(). An application + needs to reread the login state with a function like + sd_get_seats(3) + or similar to determine what changed.

sd_login_monitor_get_events() will + return the poll() mask to wait for. This + function will return a combination of POLLIN, + POLLOUT and similar to fill into the + ".events" field of struct + pollfd.

sd_login_monitor_get_timeout() will + return a timeout value for usage in poll(). + This returns a value in microseconds since the epoch of + CLOCK_MONOTONIC for timing out + poll() in timeout_usec. + See + clock_gettime(2) + for details about CLOCK_MONOTONIC. If there + is no timeout to wait for this will fill in (uint64_t) + -1 instead. Note that poll() takes + a relative timeout in milliseconds rather than an absolute timeout + in microseconds. To convert the absolute 'us' timeout into + relative 'ms', use code like the following:

uint64_t t;
 int msec;
 sd_login_monitor_get_timeout(m, &t);
 if (t == (uint64_t) -1)
-        msec = -1;
+  msec = -1;
 else {
-        struct timespec ts;
-        uint64_t n;
-        clock_getttime(CLOCK_MONOTONIC, &ts);
-        n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
-        msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-}

The code above does not do any error checking - for brevity's sake. The calculated msec - integer can be passed directly as - poll()'s timeout - parameter.

Return Value¶

On success, - sd_login_monitor_new(), - sd_login_monitor_flush() and - sd_login_monitor_get_timeout() - return 0 or a positive integer. On success, - sd_login_monitor_get_fd() returns - a Unix file descriptor. On success, - sd_login_monitor_get_events() - returns a combination of POLLIN, - POLLOUT and suchlike. On failure, - these calls return a negative errno-style error - code.

sd_login_monitor_unref() - always returns NULL.

Notes¶

The sd_login_monitor_new(), - sd_login_monitor_unref(), - sd_login_monitor_flush(), - sd_login_monitor_get_fd(), - sd_login_monitor_get_events() and - sd_login_monitor_get_timeout() - interfaces are available as a shared library, which can - be compiled and linked to with the - libsystemd pkg-config(1) - file.

+ struct timespec ts; + uint64_t n; + clock_getttime(CLOCK_MONOTONIC, &ts); + n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + msec = t > n ? (int) ((t - n + 999) / 1000) : 0; +}

The code above does not do any error checking for brevity's + sake. The calculated msec integer can be passed + directly as poll()'s timeout + parameter.

Return Value¶

On success, + sd_login_monitor_new(), + sd_login_monitor_flush() and + sd_login_monitor_get_timeout() + return 0 or a positive integer. On success, + sd_login_monitor_get_fd() returns + a Unix file descriptor. On success, + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code.

sd_login_monitor_unref() + always returns NULL.

Notes¶

The sd_login_monitor_new(), + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd(), + sd_login_monitor_get_events() and + sd_login_monitor_get_timeout() + interfaces are available as a shared library, which can be + compiled and linked to with the + libsystemd pkg-config(1) + file.

diff --git a/man/sd_login_monitor_new.xml b/man/sd_login_monitor_new.xml index ba6623826..a7b47a320 100644 --- a/man/sd_login_monitor_new.xml +++ b/man/sd_login_monitor_new.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd_notify - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_notify - 3 - - - - sd_notify - sd_notifyf - Notify service manager about start-up completion and other service status changes - - - - - #include <systemd/sd-daemon.h> - - - int sd_notify - int unset_environment - const char *state - - - - int sd_notifyf - int unset_environment - const char *format - ... - - - - - - Description - sd_notify() may be called - by a service to notify the service manager about - state changes. It can be used to send arbitrary - information, encoded in an environment-block-like - string. Most importantly it can be used for start-up - completion notification. - - If the unset_environment - parameter is non-zero, sd_notify() - will unset the $NOTIFY_SOCKET - environment variable before returning (regardless of - whether the function call itself succeeded or - not). Further calls to - sd_notify() will then fail, but - the variable is no longer inherited by child - processes. - - The state parameter - should contain a newline-separated list of variable - assignments, similar in style to an environment - block. A trailing newline is implied if none is - specified. The string may contain any kind of variable - assignments, but the following shall be considered - well-known: - - - - READY=1 - - Tells the service - manager that service startup is - finished. This is only used by systemd - if the service definition file has - Type=notify set. Since there is little - value in signaling non-readiness, the - only value services should send is - READY=1 - (i.e. READY=0 is - not defined). - - - - RELOADING=1 - - Tells the service manager - that the service is reloading its - configuration. This is useful to allow - the service manager to track the service's - internal state, and present it to the - user. Note that a service that sends - this notification must also send a - READY=1 - notification when it completed - reloading its - configuration. - - - - STOPPING=1 - - Tells the service manager - that the service is beginning its - shutdown. This is useful to allow the - service manager to track the service's - internal state, and present it to the - user. - - - - STATUS=... - - Passes a single-line - UTF-8 status string back to the service manager - that describes the service state. This - is free-form and can be used for - various purposes: general state - feedback, fsck-like programs could - pass completion percentages and - failing programs could pass a human - readable error message. Example: - STATUS=Completed 66% of file - system - check... - - - - ERRNO=... - - If a service fails, the - errno-style error code, formatted as - string. Example: ERRNO=2 for - ENOENT. - - - - BUSERROR=... - - If a service fails, the - D-Bus error-style error code. Example: - BUSERROR=org.freedesktop.DBus.Error.TimedOut - - - - MAINPID=... - - The main pid of the - service, in case the service manager did - not fork off the process - itself. Example: - MAINPID=4711 - - - - WATCHDOG=1 - - Tells systemd to - update the watchdog timestamp. This is - the keep-alive ping that services need - to issue in regular intervals if - WatchdogSec= is - enabled for it. See - systemd.service5 - for information how to enable this - functionality and - sd_watchdog_enabled3 - for the details of how the service can - check if the the watchdog is enabled. - - - - - It is recommended to prefix variable names that - are not shown in the list above with - X_ to avoid namespace - clashes. - - Note that systemd will accept status data sent - from a service only if the - NotifyAccess= option is correctly - set in the service definition file. See - systemd.service5 - for details. - - sd_notifyf() is similar to - sd_notify() but takes a - printf()-like format string plus - arguments. - - - - Return Value - - On failure, these calls return a negative - errno-style error code. If - $NOTIFY_SOCKET was not set and - hence no status data could be sent, 0 is returned. If - the status was sent, these functions return with a - positive return value. In order to support both, init - systems that implement this scheme and those which - do not, it is generally recommended to ignore the return - value of this call. - - - - Notes - - - - Internally, these functions send a single - datagram with the state string as payload to the - AF_UNIX socket referenced in the - $NOTIFY_SOCKET environment - variable. If the first character of - $NOTIFY_SOCKET is @, the string is - understood as Linux abstract namespace socket. The - datagram is accompanied by the process credentials of - the sending service, using SCM_CREDENTIALS. - - - - Environment - - - - $NOTIFY_SOCKET - - Set by the service manager - for supervised processes for status - and start-up completion - notification. This environment variable - specifies the socket - sd_notify() talks - to. See above for details. - - - - - - Examples - - - Start-up Notification - - When a service finished starting up, it - might issue the following call to notify - the service manager: - - sd_notify(0, "READY=1"); - - - - Extended Start-up Notification - - A service could send the following after - completing initialization: - - sd_notifyf(0, "READY=1\n" - "STATUS=Processing requests...\n" - "MAINPID=%lu", - (unsigned long) getpid()); - - - - Error Cause Notification - - A service could send the following shortly before exiting, on failure - - sd_notifyf(0, "STATUS=Failed to start up: %s\n" - "ERRNO=%i", - strerror(errno), - errno); - - - - - See Also - - systemd1, - sd-daemon3, - daemon7, - systemd.service5, - sd_watchdog_enabled3 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd_notify + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_notify + 3 + + + + sd_notify + sd_notifyf + sd_pid_notify + sd_pid_notifyf + sd_pid_notify_with_fds + Notify service manager about start-up completion and other service status changes + + + + + #include <systemd/sd-daemon.h> + + + int sd_notify + int unset_environment + const char *state + + + + int sd_notifyf + int unset_environment + const char *format + ... + + + + int sd_pid_notify + pid_t pid + int unset_environment + const char *state + + + + int sd_pid_notifyf + pid_t pid + int unset_environment + const char *format + ... + + + + int sd_pid_notify_with_fds + pid_t pid + int unset_environment + const char *state + const int *fds + unsigned n_fds + + + + + + Description + sd_notify() may be called by a service + to notify the service manager about state changes. It can be used + to send arbitrary information, encoded in an + environment-block-like string. Most importantly it can be used for + start-up completion notification. + + If the unset_environment parameter is + non-zero, sd_notify() will unset the + $NOTIFY_SOCKET environment variable before + returning (regardless of whether the function call itself + succeeded or not). Further calls to + sd_notify() will then fail, but the variable + is no longer inherited by child processes. + + The state parameter should contain a + newline-separated list of variable assignments, similar in style + to an environment block. A trailing newline is implied if none is + specified. The string may contain any kind of variable + assignments, but the following shall be considered + well-known: + + + + READY=1 + + Tells the service manager that service startup + is finished. This is only used by systemd if the service + definition file has Type=notify set. Since there is little + value in signaling non-readiness, the only value services + should send is READY=1 (i.e. + READY=0 is not defined). + + + + RELOADING=1 + + Tells the service manager that the service is + reloading its configuration. This is useful to allow the + service manager to track the service's internal state, and + present it to the user. Note that a service that sends this + notification must also send a READY=1 + notification when it completed reloading its + configuration. + + + + STOPPING=1 + + Tells the service manager that the service is + beginning its shutdown. This is useful to allow the service + manager to track the service's internal state, and present it + to the user. + + + + STATUS=... + + Passes a single-line UTF-8 status string back + to the service manager that describes the service state. This + is free-form and can be used for various purposes: general + state feedback, fsck-like programs could pass completion + percentages and failing programs could pass a human readable + error message. Example: STATUS=Completed 66% of file + system check... + + + + ERRNO=... + + If a service fails, the errno-style error + code, formatted as string. Example: ERRNO=2 + for ENOENT. + + + + BUSERROR=... + + If a service fails, the D-Bus error-style + error code. Example: + BUSERROR=org.freedesktop.DBus.Error.TimedOut + + + + MAINPID=... + + The main process ID (PID) of the service, in + case the service manager did not fork off the process itself. + Example: MAINPID=4711 + + + + WATCHDOG=1 + + Tells the service manager to update the + watchdog timestamp. This is the keep-alive ping that services + need to issue in regular intervals if + WatchdogSec= is enabled for it. See + systemd.service5 + for information how to enable this functionality and + sd_watchdog_enabled3 + for the details of how the service can check if the the + watchdog is enabled. + + + + + FDSTORE=1 + + Stores additional file descriptors in the + service manager. File descriptors sent this way will be + maintained per-service by the service manager and be passed + again using the usual file descriptor passing logic on the + next invocation of the service (see + sd_listen_fds3). + This is useful for implementing service restart schemes where + services serialize their state to /run, + push their file descriptors to the system manager, and are + then restarted, retrieving their state again via socket + passing and /run. Note that the service + manager will accept messages for a service only if + FileDescriptorStoreMax= is set to non-zero + for it (defaults to zero). See + systemd.service5 + for details. Multiple arrays of file descriptors may be sent + in separate messages, in which case the arrays are combined. + Note that the service manager removes duplicate file + descriptors before passing them to the service. Use + sd_pid_notify_with_fds() to send messages + with FDSTORE=1, see + below. + + + + + It is recommended to prefix variable names that are not + listed above with X_ to avoid namespace + clashes. + + Note that systemd will accept status data sent from a + service only if the NotifyAccess= option is + correctly set in the service definition file. See + systemd.service5 + for details. + + sd_notifyf() is similar to + sd_notify() but takes a + printf()-like format string plus + arguments. + + sd_pid_notify() and + sd_pid_notifyf() are similar to + sd_notify() and + sd_notifyf() but take a process ID (PID) to + use as originating PID for the message as first argument. This is + useful to send notification messages on behalf of other processes, + provided the appropriate privileges are available. If the PID + argument is specified as 0 the process ID of the calling process + is used, in which case the calls are fully equivalent to + sd_notify() and + sd_notifyf(). + + sd_pid_notify_with_fds() is similar to + sd_pid_notify() but takes an additional array + of file descriptors. These file descriptors are sent along the + notification message to the service manager. This is particularly + useful for sending FDSTORE=1 messages, as + described above. The additional arguments are a pointer to the + file descriptor array plus the number of file descriptors in the + array. If the number of file descriptors is passed as 0, the call + is fully equivalent to sd_pid_notify(), i.e. + no file descriptors are passed. Note that sending file descriptors + to the service manager on messages that do not expect them (i.e. + without FDSTORE=1) they are immediately closed + on reception. + + + + Return Value + + On failure, these calls return a negative errno-style error + code. If $NOTIFY_SOCKET was not set and hence + no status data could be sent, 0 is returned. If the status was + sent, these functions return with a positive return value. In + order to support both, init systems that implement this scheme and + those which do not, it is generally recommended to ignore the + return value of this call. + + + + Notes + + + + Internally, these functions send a single datagram with the + state string as payload to the AF_UNIX socket + referenced in the $NOTIFY_SOCKET environment + variable. If the first character of + $NOTIFY_SOCKET is @, the + string is understood as Linux abstract namespace socket. The + datagram is accompanied by the process credentials of the sending + service, using SCM_CREDENTIALS. + + + + Environment + + + + $NOTIFY_SOCKET + + Set by the service manager for supervised + processes for status and start-up completion notification. + This environment variable specifies the socket + sd_notify() talks to. See above for + details. + + + + + + Examples + + + Start-up Notification + + When a service finished starting up, it might issue the + following call to notify the service manager: + + sd_notify(0, "READY=1"); + + + + Extended Start-up Notification + + A service could send the following after completing + initialization: + + sd_notifyf(0, "READY=1\n" + "STATUS=Processing requests...\n" + "MAINPID=%lu", + (unsigned long) getpid()); + + + + Error Cause Notification + + A service could send the following shortly before exiting, on failure: + + sd_notifyf(0, "STATUS=Failed to start up: %s\n" + "ERRNO=%i", + strerror(errno), + errno); + + + + Store a File Descriptor in the Service Manager + + To store an open file descriptor in the service manager, + in order to continue operation after a service restart without + losing state use FDSTORE=1: + + sd_pid_notify_with_fds(0, 0, "FDSTORE=1", &fd, 1); + + + + + See Also + + systemd1, + sd-daemon3, + daemon7, + systemd.service5, + sd_watchdog_enabled3 + + diff --git a/man/sd_notifyf.html b/man/sd_notifyf.html index a95890c14..65594d96d 100644 --- a/man/sd_notifyf.html +++ b/man/sd_notifyf.html @@ -19,130 +19,141 @@ Directives · Python · libudev · - gudev systemd 218

Name

sd_notify, sd_notifyf — Notify service manager about start-up completion and other service status changes

Synopsis

#include <systemd/sd-daemon.h>
int sd_notify(int unset_environment,
 const char *state);
 
int sd_notifyf(int unset_environment,
 const char *format,
 ...);
 

Description¶

sd_notify() may be called - by a service to notify the service manager about - state changes. It can be used to send arbitrary - information, encoded in an environment-block-like - string. Most importantly it can be used for start-up - completion notification.

If the unset_environment - parameter is non-zero, sd_notify() - will unset the $NOTIFY_SOCKET - environment variable before returning (regardless of - whether the function call itself succeeded or - not). Further calls to - sd_notify() will then fail, but - the variable is no longer inherited by child - processes.

The state parameter - should contain a newline-separated list of variable - assignments, similar in style to an environment - block. A trailing newline is implied if none is - specified. The string may contain any kind of variable - assignments, but the following shall be considered - well-known:

READY=1¶

Tells the service - manager that service startup is - finished. This is only used by systemd - if the service definition file has - Type=notify set. Since there is little - value in signaling non-readiness, the - only value services should send is - "READY=1" - (i.e. "READY=0" is - not defined).

RELOADING=1¶

Tells the service manager - that the service is reloading its - configuration. This is useful to allow - the service manager to track the service's - internal state, and present it to the - user. Note that a service that sends - this notification must also send a - "READY=1" - notification when it completed - reloading its - configuration.

STOPPING=1¶

Tells the service manager - that the service is beginning its - shutdown. This is useful to allow the - service manager to track the service's - internal state, and present it to the - user.

STATUS=...¶

Passes a single-line - UTF-8 status string back to the service manager - that describes the service state. This - is free-form and can be used for - various purposes: general state - feedback, fsck-like programs could - pass completion percentages and - failing programs could pass a human - readable error message. Example: - "STATUS=Completed 66% of file - system - check..."

ERRNO=...¶

If a service fails, the - errno-style error code, formatted as - string. Example: "ERRNO=2" for - ENOENT.

BUSERROR=...¶

If a service fails, the - D-Bus error-style error code. Example: - "BUSERROR=org.freedesktop.DBus.Error.TimedOut"

MAINPID=...¶

The main pid of the - service, in case the service manager did - not fork off the process - itself. Example: - "MAINPID=4711"

WATCHDOG=1¶

Tells systemd to - update the watchdog timestamp. This is - the keep-alive ping that services need - to issue in regular intervals if - WatchdogSec= is - enabled for it. See - systemd.service(5) - for information how to enable this - functionality and - sd_watchdog_enabled(3) - for the details of how the service can - check if the the watchdog is enabled. -

It is recommended to prefix variable names that - are not shown in the list above with - X_ to avoid namespace - clashes.

Note that systemd will accept status data sent - from a service only if the - NotifyAccess= option is correctly - set in the service definition file. See - systemd.service(5) - for details.

sd_notifyf() is similar to - sd_notify() but takes a - printf()-like format string plus - arguments.

Return Value¶

On failure, these calls return a negative - errno-style error code. If - $NOTIFY_SOCKET was not set and - hence no status data could be sent, 0 is returned. If - the status was sent, these functions return with a - positive return value. In order to support both, init - systems that implement this scheme and those which - do not, it is generally recommended to ignore the return - value of this call.

Notes¶

These APIs are implemented as a shared + gudev systemd 219


Name

sd_notify, sd_notifyf, sd_pid_notify, sd_pid_notifyf, sd_pid_notify_with_fds — Notify service manager about start-up completion and other service status changes

Synopsis

#include <systemd/sd-daemon.h>
int sd_notify(int unset_environment,
 const char *state);
 
int sd_notifyf(int unset_environment,
 const char *format,
 ...);
 
int sd_pid_notify(pid_t pid,
 int unset_environment,
 const char *state);
 
int sd_pid_notifyf(pid_t pid,
 int unset_environment,
 const char *format,
 ...);
 
int sd_pid_notify_with_fds(pid_t pid,
 int unset_environment,
 const char *state,
 const int *fds,
 unsigned n_fds);
 

Description¶

sd_notify() may be called by a service + to notify the service manager about state changes. It can be used + to send arbitrary information, encoded in an + environment-block-like string. Most importantly it can be used for + start-up completion notification.

If the unset_environment parameter is + non-zero, sd_notify() will unset the + $NOTIFY_SOCKET environment variable before + returning (regardless of whether the function call itself + succeeded or not). Further calls to + sd_notify() will then fail, but the variable + is no longer inherited by child processes.

The state parameter should contain a + newline-separated list of variable assignments, similar in style + to an environment block. A trailing newline is implied if none is + specified. The string may contain any kind of variable + assignments, but the following shall be considered + well-known:

READY=1¶

Tells the service manager that service startup + is finished. This is only used by systemd if the service + definition file has Type=notify set. Since there is little + value in signaling non-readiness, the only value services + should send is "READY=1" (i.e. + "READY=0" is not defined).

RELOADING=1¶

Tells the service manager that the service is + reloading its configuration. This is useful to allow the + service manager to track the service's internal state, and + present it to the user. Note that a service that sends this + notification must also send a "READY=1" + notification when it completed reloading its + configuration.

STOPPING=1¶

Tells the service manager that the service is + beginning its shutdown. This is useful to allow the service + manager to track the service's internal state, and present it + to the user.

STATUS=...¶

Passes a single-line UTF-8 status string back + to the service manager that describes the service state. This + is free-form and can be used for various purposes: general + state feedback, fsck-like programs could pass completion + percentages and failing programs could pass a human readable + error message. Example: "STATUS=Completed 66% of file + system check..."

ERRNO=...¶

If a service fails, the errno-style error + code, formatted as string. Example: "ERRNO=2" + for ENOENT.

BUSERROR=...¶

If a service fails, the D-Bus error-style + error code. Example: + "BUSERROR=org.freedesktop.DBus.Error.TimedOut"

MAINPID=...¶

The main process ID (PID) of the service, in + case the service manager did not fork off the process itself. + Example: "MAINPID=4711"

WATCHDOG=1¶

Tells the service manager to update the + watchdog timestamp. This is the keep-alive ping that services + need to issue in regular intervals if + WatchdogSec= is enabled for it. See + systemd.service(5) + for information how to enable this functionality and + sd_watchdog_enabled(3) + for the details of how the service can check if the the + watchdog is enabled.

FDSTORE=1¶

Stores additional file descriptors in the + service manager. File descriptors sent this way will be + maintained per-service by the service manager and be passed + again using the usual file descriptor passing logic on the + next invocation of the service (see + sd_listen_fds(3)). + This is useful for implementing service restart schemes where + services serialize their state to /run, + push their file descriptors to the system manager, and are + then restarted, retrieving their state again via socket + passing and /run. Note that the service + manager will accept messages for a service only if + FileDescriptorStoreMax= is set to non-zero + for it (defaults to zero). See + systemd.service(5) + for details. Multiple arrays of file descriptors may be sent + in separate messages, in which case the arrays are combined. + Note that the service manager removes duplicate file + descriptors before passing them to the service. Use + sd_pid_notify_with_fds() to send messages + with "FDSTORE=1", see + below.

It is recommended to prefix variable names that are not + listed above with X_ to avoid namespace + clashes.

Note that systemd will accept status data sent from a + service only if the NotifyAccess= option is + correctly set in the service definition file. See + systemd.service(5) + for details.

sd_notifyf() is similar to + sd_notify() but takes a + printf()-like format string plus + arguments.

sd_pid_notify() and + sd_pid_notifyf() are similar to + sd_notify() and + sd_notifyf() but take a process ID (PID) to + use as originating PID for the message as first argument. This is + useful to send notification messages on behalf of other processes, + provided the appropriate privileges are available. If the PID + argument is specified as 0 the process ID of the calling process + is used, in which case the calls are fully equivalent to + sd_notify() and + sd_notifyf().

sd_pid_notify_with_fds() is similar to + sd_pid_notify() but takes an additional array + of file descriptors. These file descriptors are sent along the + notification message to the service manager. This is particularly + useful for sending "FDSTORE=1" messages, as + described above. The additional arguments are a pointer to the + file descriptor array plus the number of file descriptors in the + array. If the number of file descriptors is passed as 0, the call + is fully equivalent to sd_pid_notify(), i.e. + no file descriptors are passed. Note that sending file descriptors + to the service manager on messages that do not expect them (i.e. + without "FDSTORE=1") they are immediately closed + on reception.

Return Value¶

On failure, these calls return a negative errno-style error + code. If $NOTIFY_SOCKET was not set and hence + no status data could be sent, 0 is returned. If the status was + sent, these functions return with a positive return value. In + order to support both, init systems that implement this scheme and + those which do not, it is generally recommended to ignore the + return value of this call.

Notes¶

These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) - file.

Internally, these functions send a single - datagram with the state string as payload to the - AF_UNIX socket referenced in the - $NOTIFY_SOCKET environment - variable. If the first character of - $NOTIFY_SOCKET is "@", the string is - understood as Linux abstract namespace socket. The - datagram is accompanied by the process credentials of - the sending service, using SCM_CREDENTIALS.

Environment¶

$NOTIFY_SOCKET¶

Set by the service manager - for supervised processes for status - and start-up completion - notification. This environment variable - specifies the socket - sd_notify() talks - to. See above for details.

Examples¶

Example 1. Start-up Notification

When a service finished starting up, it - might issue the following call to notify - the service manager:

sd_notify(0, "READY=1");

Example 2. Extended Start-up Notification

A service could send the following after - completing initialization:

sd_notifyf(0, "READY=1\n"
-              "STATUS=Processing requests...\n"
-              "MAINPID=%lu",
-              (unsigned long) getpid());

Example 3. Error Cause Notification

A service could send the following shortly before exiting, on failure

sd_notifyf(0, "STATUS=Failed to start up: %s\n"
-              "ERRNO=%i",
-              strerror(errno),
-              errno);

+ file.

Internally, these functions send a single datagram with the + state string as payload to the AF_UNIX socket + referenced in the $NOTIFY_SOCKET environment + variable. If the first character of + $NOTIFY_SOCKET is "@", the + string is understood as Linux abstract namespace socket. The + datagram is accompanied by the process credentials of the sending + service, using SCM_CREDENTIALS.

Environment¶

$NOTIFY_SOCKET¶

Set by the service manager for supervised + processes for status and start-up completion notification. + This environment variable specifies the socket + sd_notify() talks to. See above for + details.

Examples¶

Example 1. Start-up Notification

When a service finished starting up, it might issue the + following call to notify the service manager:

sd_notify(0, "READY=1");

Example 2. Extended Start-up Notification

A service could send the following after completing + initialization:

sd_notifyf(0, "READY=1\n"
+        "STATUS=Processing requests...\n"
+        "MAINPID=%lu",
+        (unsigned long) getpid());

Example 3. Error Cause Notification

A service could send the following shortly before exiting, on failure:

sd_notifyf(0, "STATUS=Failed to start up: %s\n"
+        "ERRNO=%i",
+        strerror(errno),
+        errno);

Example 4. Store a File Descriptor in the Service Manager

To store an open file descriptor in the service manager, + in order to continue operation after a service restart without + losing state use "FDSTORE=1":

sd_pid_notify_with_fds(0, 0, "FDSTORE=1", &fd, 1);

diff --git a/man/sd_peer_get_machine_name.html b/man/sd_peer_get_machine_name.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_machine_name.html +++ b/man/sd_peer_get_machine_name.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_peer_get_owner_uid.html b/man/sd_peer_get_owner_uid.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_owner_uid.html +++ b/man/sd_peer_get_owner_uid.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_peer_get_session.html b/man/sd_peer_get_session.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_session.html +++ b/man/sd_peer_get_session.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_peer_get_slice.html b/man/sd_peer_get_slice.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_slice.html +++ b/man/sd_peer_get_slice.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_peer_get_unit.html b/man/sd_peer_get_unit.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_unit.html +++ b/man/sd_peer_get_unit.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_peer_get_user_unit.html b/man/sd_peer_get_user_unit.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_peer_get_user_unit.html +++ b/man/sd_peer_get_user_unit.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_pid_get_machine_name.html b/man/sd_pid_get_machine_name.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_pid_get_machine_name.html +++ b/man/sd_pid_get_machine_name.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_pid_get_owner_uid.html b/man/sd_pid_get_owner_uid.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_pid_get_owner_uid.html +++ b/man/sd_pid_get_owner_uid.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_pid_get_session.3 b/man/sd_pid_get_session.3 index 51d001c85..6205d099e 100644 --- a/man/sd_pid_get_session.3 +++ b/man/sd_pid_get_session.3 @@ -1,5 +1,5 @@ '\" t -.TH "SD_PID_GET_SESSION" "3" "" "systemd 218" "sd_pid_get_session" +.TH "SD_PID_GET_SESSION" "3" "" "systemd 219" "sd_pid_get_session" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sd_pid_get_session.html b/man/sd_pid_get_session.html index 8b80db40f..4d2c9a7f6 100644 --- a/man/sd_pid_get_session.html +++ b/man/sd_pid_get_session.html @@ -19,97 +19,86 @@ Directives · Python · libudev · - gudev systemd 218

Name

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_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 — Determine session, service, owner of a - session, container/VM or slice of a specific - PID or socket peer

Synopsis

#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_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);
 

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. The returned string - needs to be freed with the libc - free(3) - call after use.

sd_pid_get_unit() may be - used to determine the systemd system unit (i.e. system - service) 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. (More specifically: this call will - not work for processes that are part of user units, - use sd_pid_get_user_unit() for - that.) The returned string needs to be freed with the - libc - free(3) - call after use.

sd_pid_get_user_unit() may - be used to determine the systemd user unit (i.e. user - service) 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 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, where - 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.

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 - free(3) - call after use.

sd_pid_get_slice() may be - used to determine the slice unit the process is a - member of. See - systemd.slice(5) - for details about slices. The returned string needs to - be freed with the libc - free(3) - call after use.

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() and - sd_peer_get_slice() calls operate - similar to their PID counterparts, but operate on a - connected AF_UNIX socket and retrieve information - about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive - integer. On failure, these calls return a negative - errno-style error code.

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_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), - sd_peer_get_owner_uid(), - sd_peer_get_machine_name() and - sd_peer_get_slice() interfaces are - available as a shared library, which can be compiled - and linked to with the - libsystemd pkg-config(1) - 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 - getsid(2).

+ gudev systemd 219

Name

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_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 — Determine session, service, owner of a + session, container/VM or slice of a specific + PID or socket peer

Synopsis

#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_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);
 

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. The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_unit() may be used to + determine the systemd system unit (i.e. system service) 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. (More specifically: + this call will not work for processes that are part of user units, + use sd_pid_get_user_unit() for that.) The + returned string needs to be freed with the libc + free(3) + call after use.

sd_pid_get_user_unit() may be used to + determine the systemd user unit (i.e. user service) 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 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, where + 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.

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 + free(3) + call after use.

sd_pid_get_slice() may be used to + determine the slice unit the process is a member of. See + systemd.slice(5) + for details about slices. The returned string needs to be freed + with the libc + free(3) + call after use.

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() and + sd_peer_get_slice() calls operate similar to + their PID counterparts, but operate on a connected AF_UNIX socket + and retrieve information about the connected peer process.

Return Value¶

On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code.

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_peer_get_session(), + sd_peer_get_unit(), + sd_peer_get_user_unit(), + sd_peer_get_owner_uid(), + sd_peer_get_machine_name() and + sd_peer_get_slice() interfaces are + available as a shared library, which can be compiled + and linked to with the + libsystemd pkg-config(1) + 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 + getsid(2).

diff --git a/man/sd_pid_get_session.xml b/man/sd_pid_get_session.xml index 050f701da..f708d0d5e 100644 --- a/man/sd_pid_get_session.xml +++ b/man/sd_pid_get_session.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - sd_watchdog_enabled - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sd_watchdog_enabled - 3 - - - - sd_watchdog_enabled - Check whether the service manager expects watchdog keep-alive notifications from a service - - - - - #include <systemd/sd-daemon.h> - - - int sd_watchdog_enabled - int unset_environment - uint64_t *usec - - - - - - Description - sd_watchdog_enabled() may - be called by a service to detect whether the service - manager expects regular keep-alive watchdog - notification events from it, and the timeout after - which the manager will act on the service if it did - not get such a notification. - - If the $WATCHDOG_USEC - environment variable is set, and the - $WATCHDOG_PID variable is unset or - set to the PID of the current process, the service - manager expects notifications from this process. The - manager will usually terminate a service when it does - not get a notification message within the specified - time after startup and after each previous message. It - is recommended that a daemon sends a keep-alive - notification message to the service manager every half - of the time returned here. Notification messages may - be sent with - sd_notify3 - with a message string of - WATCHDOG=1. - - If the unset_environment - parameter is non-zero, - sd_watchdog_enabled() will unset - the $WATCHDOG_USEC and - $WATCHDOG_PID environment variables - before returning (regardless of whether the function - call itself succeeded or not). Those variables are no - longer inherited by child processes. Further calls to - sd_watchdog_enabled() will also - return with zero. - - If the usec parameter is - non-NULL, sd_watchdog_enabled() - will write the timeout in µs for the watchdog - logic to it. - - To enable service supervision with the watchdog - logic, use WatchdogSec= in service - files. See - systemd.service5 - for details. - - - - Return Value - - On failure, this call returns a negative - errno-style error code. If the service manager expects - watchdog keep-alive notification messages to be sent, - > 0 is returned, otherwise 0 is returned. Only if - the return value is > 0, the - usec parameter is valid after - the call. - - - - Notes - - - - Internally, this functions parses the - $WATCHDOG_PID and - $WATCHDOG_USEC environment - variable. The call will ignore these variables if - $WATCHDOG_PID does containe the PID - of the current process, under the assumption that in - that case, the variables were set for a different - process further up the process tree. - - - - Environment - - - - $WATCHDOG_PID - - Set by the system - manager for supervised process for - which watchdog support is enabled, and - contains the PID of that process. See - above for details. - - - - $WATCHDOG_USEC - - Set by the system - manager for supervised process for - which watchdog support is enabled, and - contains the watchdog timeout in µs - See above for - details. - - - - - - History - - The watchdog functionality and the - $WATCHDOG_USEC variable were - added in systemd-41. - - sd_watchdog_enabled() - function was added in systemd-209. Since that version - the $WATCHDOG_PID variable is also - set. - - - - See Also - - systemd1, - sd-daemon3, - daemon7, - systemd.service5, - sd_notify3 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sd_watchdog_enabled + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_watchdog_enabled + 3 + + + + sd_watchdog_enabled + Check whether the service manager expects watchdog keep-alive notifications from a service + + + + + #include <systemd/sd-daemon.h> + + + int sd_watchdog_enabled + int unset_environment + uint64_t *usec + + + + + + Description + sd_watchdog_enabled() may be called by + a service to detect whether the service manager expects regular + keep-alive watchdog notification events from it, and the timeout + after which the manager will act on the service if it did not get + such a notification. + + If the $WATCHDOG_USEC environment + variable is set, and the $WATCHDOG_PID variable + is unset or set to the PID of the current process, the service + manager expects notifications from this process. The manager will + usually terminate a service when it does not get a notification + message within the specified time after startup and after each + previous message. It is recommended that a daemon sends a + keep-alive notification message to the service manager every half + of the time returned here. Notification messages may be sent with + sd_notify3 + with a message string of WATCHDOG=1. + + If the unset_environment parameter is + non-zero, sd_watchdog_enabled() will unset + the $WATCHDOG_USEC and + $WATCHDOG_PID environment variables before + returning (regardless of whether the function call itself + succeeded or not). Those variables are no longer inherited by + child processes. Further calls to + sd_watchdog_enabled() will also return with + zero. + + If the usec parameter is non-NULL, + sd_watchdog_enabled() will write the timeout + in µs for the watchdog logic to it. + + To enable service supervision with the watchdog logic, use + WatchdogSec= in service files. See + systemd.service5 + for details. + + + + Return Value + + On failure, this call returns a negative errno-style error + code. If the service manager expects watchdog keep-alive + notification messages to be sent, > 0 is returned, otherwise 0 + is returned. Only if the return value is > 0, the + usec parameter is valid after the + call. + + + + Notes + + + + Internally, this functions parses the + $WATCHDOG_PID and + $WATCHDOG_USEC environment variable. The call + will ignore these variables if $WATCHDOG_PID + does not contain the PID of the current process, under the + assumption that in that case, the variables were set for a + different process further up the process tree. + + + + Environment + + + + $WATCHDOG_PID + + Set by the system manager for supervised + process for which watchdog support is enabled, and contains + the PID of that process. See above for + details. + + + + $WATCHDOG_USEC + + Set by the system manager for supervised + process for which watchdog support is enabled, and contains + the watchdog timeout in µs See above for + details. + + + + + + History + + The watchdog functionality and the + $WATCHDOG_USEC variable were added in + systemd-41. + + sd_watchdog_enabled() function was + added in systemd-209. Since that version the + $WATCHDOG_PID variable is also set. + + + + See Also + + systemd1, + sd-daemon3, + daemon7, + systemd.service5, + sd_notify3 + + diff --git a/man/shutdown.8 b/man/shutdown.8 index 1397b2ec4..42928eca1 100644 --- a/man/shutdown.8 +++ b/man/shutdown.8 @@ -1,5 +1,5 @@ '\" t -.TH "SHUTDOWN" "8" "" "systemd 218" "shutdown" +.TH "SHUTDOWN" "8" "" "systemd 219" "shutdown" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -22,8 +22,8 @@ .SH "NAME" shutdown \- Halt, power\-off or reboot the machine .SH "SYNOPSIS" -.HP \w'\fBshutdown\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB[TIME]\fR\fB\ \fR\fB[WALL...]\fR\ 'u -\fBshutdown \fR\fB[OPTIONS...]\fR\fB \fR\fB[TIME]\fR\fB \fR\fB[WALL...]\fR +.HP \w'\fBshutdown\fR\ 'u +\fBshutdown\fR [OPTIONS...] [TIME] [WALL...] .SH "DESCRIPTION" .PP \fBshutdown\fR diff --git a/man/shutdown.html b/man/shutdown.html index 034db036c..1e5b06f7e 100644 --- a/man/shutdown.html +++ b/man/shutdown.html @@ -19,44 +19,35 @@ Directives · Python · libudev · - gudev systemd 218

Name

shutdown — Halt, power-off or reboot the machine

Synopsis

shutdown [OPTIONS...] [TIME] [WALL...]

Description¶

shutdown may be used to halt, - power-off or reboot the machine.

The first argument may be a time string (which - is usually "now"). Optionally, this - may be followed by a wall message to be sent to all - logged-in users before going down.

The time string may either be in the format - "hh:mm" for hour/minutes specifying - the time to execute the shutdown at, specified in 24h - clock format. Alternatively it may be in the syntax - "+m" referring to the specified - number of minutes m from now. "now" - is an alias for "+0", i.e. for - triggering an immediate shutdown. If no time argument - is specified, "+1" is - implied.

Note that to specify a wall message you must - specify a time argument, too.

If the time argument is used, 5 minutes - before the system goes down the - /run/nologin file is created to - ensure that further logins shall not be - allowed.

Options¶

The following options are understood:

--help¶

Print a short help text and exit. -

-H, --halt¶

Halt the machine.

-P, --poweroff¶

Power-off the - machine (the default).

-r, --reboot¶

Reboot the - machine.

-h¶

Equivalent to - --poweroff, unless - --halt is - specified.

-k¶

Do not halt, power-off, - reboot, just write wall - message.

--no-wall¶

Do not send wall - message before - halt, power-off, reboot.

-c¶

Cancel a pending - shutdown. This may be used cancel the - effect of an invocation of - shutdown with a - time argument that is not - "+0" or - "now".

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

shutdown — Halt, power-off or reboot the machine

Synopsis

shutdown [OPTIONS...] [TIME] [WALL...]

Description¶

shutdown may be used to halt, power-off + or reboot the machine.

The first argument may be a time string (which is usually + "now"). Optionally, this may be followed by a + wall message to be sent to all logged-in users before going + down.

The time string may either be in the format + "hh:mm" for hour/minutes specifying the time to + execute the shutdown at, specified in 24h clock format. + Alternatively it may be in the syntax "+m" + referring to the specified number of minutes m from now. + "now" is an alias for "+0", i.e. + for triggering an immediate shutdown. If no time argument is + specified, "+1" is implied.

Note that to specify a wall message you must specify a time + argument, too.

If the time argument is used, 5 minutes before the system + goes down the /run/nologin file is created to + ensure that further logins shall not be allowed.

Options¶

The following options are understood:

--help¶

Print a short help text and exit. +

-H, --halt¶

Halt the machine.

-P, --poweroff¶

Power-off the machine (the + default).

-r, --reboot¶

Reboot the + machine.

-h¶

Equivalent to --poweroff, + unless --halt is specified.

-k¶

Do not halt, power-off, reboot, just write + wall message.

--no-wall¶

Do not send wall + message before + halt, power-off, reboot.

-c¶

Cancel a pending shutdown. This may be used + cancel the effect of an invocation of + shutdown with a time argument that is not + "+0" or + "now".

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/shutdown.xml b/man/shutdown.xml index 6a4c1844a..a8af387c6 100644 --- a/man/shutdown.xml +++ b/man/shutdown.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - shutdown - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - shutdown - 8 - - - - shutdown - Halt, power-off or reboot the machine - - - - - shutdown OPTIONS TIME WALL - - - - - Description - - shutdown may be used to halt, - power-off or reboot the machine. - - The first argument may be a time string (which - is usually now). Optionally, this - may be followed by a wall message to be sent to all - logged-in users before going down. - - The time string may either be in the format - hh:mm for hour/minutes specifying - the time to execute the shutdown at, specified in 24h - clock format. Alternatively it may be in the syntax - +m referring to the specified - number of minutes m from now. now - is an alias for +0, i.e. for - triggering an immediate shutdown. If no time argument - is specified, +1 is - implied. - - Note that to specify a wall message you must - specify a time argument, too. - - If the time argument is used, 5 minutes - before the system goes down the - /run/nologin file is created to - ensure that further logins shall not be - allowed. - - - - Options - - The following options are understood: - - - - - - - - - - - - - Halt the machine. - - - - - - - Power-off the - machine (the default). - - - - - - - Reboot the - machine. - - - - - - Equivalent to - , unless - is - specified. - - - - - - Do not halt, power-off, - reboot, just write wall - message. - - - - - - Do not send wall - message before - halt, power-off, reboot. - - - - - - Cancel a pending - shutdown. This may be used cancel the - effect of an invocation of - shutdown with a - time argument that is not - +0 or - now. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - halt8, - wall1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + shutdown + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + shutdown + 8 + + + + shutdown + Halt, power-off or reboot the machine + + + + + shutdown + OPTIONS + TIME + WALL + + + + + Description + + shutdown may be used to halt, power-off + or reboot the machine. + + The first argument may be a time string (which is usually + now). Optionally, this may be followed by a + wall message to be sent to all logged-in users before going + down. + + The time string may either be in the format + hh:mm for hour/minutes specifying the time to + execute the shutdown at, specified in 24h clock format. + Alternatively it may be in the syntax +m + referring to the specified number of minutes m from now. + now is an alias for +0, i.e. + for triggering an immediate shutdown. If no time argument is + specified, +1 is implied. + + Note that to specify a wall message you must specify a time + argument, too. + + If the time argument is used, 5 minutes before the system + goes down the /run/nologin file is created to + ensure that further logins shall not be allowed. + + + + Options + + The following options are understood: + + + + + + + + + + + + + Halt the machine. + + + + + + + Power-off the machine (the + default). + + + + + + + Reboot the + machine. + + + + + + Equivalent to , + unless is specified. + + + + + + Do not halt, power-off, reboot, just write + wall message. + + + + + + Do not send wall + message before + halt, power-off, reboot. + + + + + + Cancel a pending shutdown. This may be used + cancel the effect of an invocation of + shutdown with a time argument that is not + +0 or + now. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemctl1, + halt8, + wall1 + + diff --git a/man/sleep.conf.d.html b/man/sleep.conf.d.html index 5174ed598..9c74f2293 100644 --- a/man/sleep.conf.d.html +++ b/man/sleep.conf.d.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sleep.conf, sleep.conf.d — Suspend and hibernation configuration file

Synopsis

/etc/systemd/sleep.conf

/etc/systemd/sleep.conf.d/*.conf

/run/systemd/sleep.conf.d/*.conf

/usr/lib/systemd/sleep.conf.d/*.conf

Description¶

systemd supports three general + gudev systemd 219


Name

systemd-sleep.conf, sleep.conf.d — Suspend and hibernation configuration file

Synopsis

/etc/systemd/sleep.conf

/etc/systemd/sleep.conf.d/*.conf

/run/systemd/sleep.conf.d/*.conf

/usr/lib/systemd/sleep.conf.d/*.conf

Description¶

systemd supports three general power-saving modes:

suspend¶

a low-power state where execution of the OS is paused, and complete power loss might result @@ -72,7 +72,7 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

The following options can be configured in the + file.

Options¶

The following options can be configured in the "[Sleep]" section of /etc/systemd/sleep.conf or a sleep.conf.d file:

SuspendMode=, HibernateMode=, HybridSleepMode=¶

The string to be written to @@ -95,11 +95,11 @@ multiple values with whitespace. They will be tried in turn, until one is written without error. If neither succeeds, the operation will be aborted. -

Example: freeze¶

Example: to exploit the “freeze” mode added +

Example: freeze¶

Example: to exploit the “freeze” mode added in Linux 3.9, one can use systemctl suspend with

[Sleep]
-SuspendState=freeze

See Also¶

+SuspendState=freeze

See Also¶

systemd-sleep(8), systemd-suspend.service(8), systemd-hibernate.service(8), diff --git a/man/standard-options.xml b/man/standard-options.xml index ec9146d8b..f21446339 100644 --- a/man/standard-options.xml +++ b/man/standard-options.xml @@ -27,4 +27,13 @@ Do not pipe output into a pager. + + + + + + Do not print the legend, i.e. column headers and the + footer with hints. + + diff --git a/man/sysctl.d.5 b/man/sysctl.d.5 index 8336a45fc..d54dd9e3e 100644 --- a/man/sysctl.d.5 +++ b/man/sysctl.d.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSCTL\&.D" "5" "" "systemd 218" "sysctl.d" +.TH "SYSCTL\&.D" "5" "" "systemd 219" "sysctl.d" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sysctl.d.html b/man/sysctl.d.html index 23bc79287..db96478e0 100644 --- a/man/sysctl.d.html +++ b/man/sysctl.d.html @@ -19,53 +19,48 @@ Directives · Python · libudev · - gudev systemd 218


Name

sysctl.d — Configure kernel parameters at boot

Synopsis

/etc/sysctl.d/*.conf

/run/sysctl.d/*.conf

/usr/lib/sysctl.d/*.conf

Description¶

At boot, - systemd-sysctl.service(8) - reads configuration files from the above directories - to configure - sysctl(8) - kernel parameters.

Configuration Format¶

The configuration files contain a list of - variable assignments, separated by newlines. Empty - lines and lines whose first non-whitespace character - is "#" or ";" are - ignored.

Note that either "/" or - "." may be used as separators within - sysctl variable names. If the first separator is a - slash, remaining slashes and dots are left intact. If - the first separator is a dot, dots and slashes are - interchanged. "kernel.domainname=foo" - and "kernel/domainname=foo" are - equivalent and will cause "foo" to - be written to - /proc/sys/kernel/domainname. - Either - "net.ipv4.conf.enp3s0/200.forwarding" - or - "net/ipv4/conf/enp3s0.200/forwarding" - may be used to refer to - /proc/sys/net/ipv4/conf/enp3s0.200/forwarding. -

The settings configured with - sysctl.d files will be applied - early on boot. The network interface-specific options - will also be applied individually for each network - interface as it shows up in the system. (More - specifically, - net.ipv4.conf.*, - net.ipv6.conf.*, - net.ipv4.neigh.* and net.ipv6.neigh.*).

Many sysctl parameters only become available - when certain kernel modules are loaded. Modules are - usually loaded on demand, e.g. when certain hardware - is plugged in or network brought up. This means that - systemd-sysctl.service(8) which runs - during early boot will not configure such parameters - if they become available after it has run. To - set such parameters, it is recommended to add - an udev(7) rule to set those parameters when they become - available. Alternatively, a slightly simpler and - less efficient option is to add the module to - modules-load.d(5), causing it to be loaded statically - before sysctl settings are applied (see - example below).

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

sysctl.d — Configure kernel parameters at boot

Synopsis

/etc/sysctl.d/*.conf

/run/sysctl.d/*.conf

/usr/lib/sysctl.d/*.conf

Description¶

At boot, + systemd-sysctl.service(8) + reads configuration files from the above directories to configure + sysctl(8) + kernel parameters.

Configuration Format¶

The configuration files contain a list of variable + assignments, separated by newlines. Empty lines and lines whose + first non-whitespace character is "#" or + ";" are ignored.

Note that either "/" or + "." may be used as separators within sysctl + variable names. If the first separator is a slash, remaining + slashes and dots are left intact. If the first separator is a dot, + dots and slashes are interchanged. + "kernel.domainname=foo" and + "kernel/domainname=foo" are equivalent and will + cause "foo" to be written to + /proc/sys/kernel/domainname. Either + "net.ipv4.conf.enp3s0/200.forwarding" or + "net/ipv4/conf/enp3s0.200/forwarding" may be used + to refer to + /proc/sys/net/ipv4/conf/enp3s0.200/forwarding. +

The settings configured with sysctl.d + files will be applied early on boot. The network + interface-specific options will also be applied individually for + each network interface as it shows up in the system. (More + specifically, net.ipv4.conf.*, + net.ipv6.conf.*, + net.ipv4.neigh.* and + net.ipv6.neigh.*).

Many sysctl parameters only become available when certain + kernel modules are loaded. Modules are usually loaded on demand, + e.g. when certain hardware is plugged in or network brought up. + This means that + systemd-sysctl.service(8) + which runs during early boot will not configure such parameters if + they become available after it has run. To set such parameters, it + is recommended to add an + udev(7) + rule to set those parameters when they become available. + Alternatively, a slightly simpler and less efficient option is to + add the module to + modules-load.d(5), + causing it to be loaded statically before sysctl settings are + applied (see example below).

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -85,23 +80,23 @@ the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor - configuration file.

Examples¶

Example 1. Set kernel YP domain name

/etc/sysctl.d/domain-name.conf: -

kernel.domainname=example.com

Example 2. Disable packet filter on bridged packets (method one)

/etc/udev/rules.d/99-bridge.rules: -

ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge"
+    configuration file.

Examples¶

Example 1. Set kernel YP domain name

/etc/sysctl.d/domain-name.conf: +

kernel.domainname=example.com

Example 2. Disable packet filter on bridged packets (method one)

/etc/udev/rules.d/99-bridge.rules: +

ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge"
 

/etc/sysctl.d/bridge.conf: -

net.bridge.bridge-nf-call-ip6tables = 0
+      

net.bridge.bridge-nf-call-ip6tables = 0
 net.bridge.bridge-nf-call-iptables = 0
 net.bridge.bridge-nf-call-arptables = 0
-

Example 3. Disable packet filter on bridged packets (method two)

/etc/modules-load.d/bridge.conf: -

bridge

/etc/sysctl.d/bridge.conf: -

net.bridge.bridge-nf-call-ip6tables = 0
+

Example 3. Disable packet filter on bridged packets (method two)

/etc/modules-load.d/bridge.conf: +

bridge

/etc/sysctl.d/bridge.conf: +

net.bridge.bridge-nf-call-ip6tables = 0
 net.bridge.bridge-nf-call-iptables = 0
 net.bridge.bridge-nf-call-arptables = 0
-

+

diff --git a/man/sysctl.d.xml b/man/sysctl.d.xml index c67a199fb..5a35cfe2c 100644 --- a/man/sysctl.d.xml +++ b/man/sysctl.d.xml @@ -19,158 +19,153 @@ along with systemd; If not, see . --> - - - sysctl.d - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sysctl.d - 5 - - - - sysctl.d - Configure kernel parameters at boot - - - - /etc/sysctl.d/*.conf - /run/sysctl.d/*.conf - /usr/lib/sysctl.d/*.conf - - - - Description - - At boot, - systemd-sysctl.service8 - reads configuration files from the above directories - to configure - sysctl8 - kernel parameters. - - - - Configuration Format - - The configuration files contain a list of - variable assignments, separated by newlines. Empty - lines and lines whose first non-whitespace character - is # or ; are - ignored. - - Note that either / or - . may be used as separators within - sysctl variable names. If the first separator is a - slash, remaining slashes and dots are left intact. If - the first separator is a dot, dots and slashes are - interchanged. kernel.domainname=foo - and kernel/domainname=foo are - equivalent and will cause foo to - be written to - /proc/sys/kernel/domainname. - Either - net.ipv4.conf.enp3s0/200.forwarding - or - net/ipv4/conf/enp3s0.200/forwarding - may be used to refer to - /proc/sys/net/ipv4/conf/enp3s0.200/forwarding. - - - The settings configured with - sysctl.d files will be applied - early on boot. The network interface-specific options - will also be applied individually for each network - interface as it shows up in the system. (More - specifically, - net.ipv4.conf.*, - net.ipv6.conf.*, - net.ipv4.neigh.* and net.ipv6.neigh.*). - - Many sysctl parameters only become available - when certain kernel modules are loaded. Modules are - usually loaded on demand, e.g. when certain hardware - is plugged in or network brought up. This means that - systemd-sysctl.service8 which runs - during early boot will not configure such parameters - if they become available after it has run. To - set such parameters, it is recommended to add - an udev7 rule to set those parameters when they become - available. Alternatively, a slightly simpler and - less efficient option is to add the module to - modules-load.d5, causing it to be loaded statically - before sysctl settings are applied (see - example below). - - - - - - Examples - - Set kernel YP domain name - /etc/sysctl.d/domain-name.conf: - - - kernel.domainname=example.com - - - - Disable packet filter on bridged packets (method one) - /etc/udev/rules.d/99-bridge.rules: - - - ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge" + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sysctl.d + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sysctl.d + 5 + + + + sysctl.d + Configure kernel parameters at boot + + + + /etc/sysctl.d/*.conf + /run/sysctl.d/*.conf + /usr/lib/sysctl.d/*.conf + + + + Description + + At boot, + systemd-sysctl.service8 + reads configuration files from the above directories to configure + sysctl8 + kernel parameters. + + + + Configuration Format + + The configuration files contain a list of variable + assignments, separated by newlines. Empty lines and lines whose + first non-whitespace character is # or + ; are ignored. + + Note that either / or + . may be used as separators within sysctl + variable names. If the first separator is a slash, remaining + slashes and dots are left intact. If the first separator is a dot, + dots and slashes are interchanged. + kernel.domainname=foo and + kernel/domainname=foo are equivalent and will + cause foo to be written to + /proc/sys/kernel/domainname. Either + net.ipv4.conf.enp3s0/200.forwarding or + net/ipv4/conf/enp3s0.200/forwarding may be used + to refer to + /proc/sys/net/ipv4/conf/enp3s0.200/forwarding. + + + The settings configured with sysctl.d + files will be applied early on boot. The network + interface-specific options will also be applied individually for + each network interface as it shows up in the system. (More + specifically, net.ipv4.conf.*, + net.ipv6.conf.*, + net.ipv4.neigh.* and + net.ipv6.neigh.*). + + Many sysctl parameters only become available when certain + kernel modules are loaded. Modules are usually loaded on demand, + e.g. when certain hardware is plugged in or network brought up. + This means that + systemd-sysctl.service8 + which runs during early boot will not configure such parameters if + they become available after it has run. To set such parameters, it + is recommended to add an + udev7 + rule to set those parameters when they become available. + Alternatively, a slightly simpler and less efficient option is to + add the module to + modules-load.d5, + causing it to be loaded statically before sysctl settings are + applied (see example below). + + + + + + Examples + + Set kernel YP domain name + /etc/sysctl.d/domain-name.conf: + + + kernel.domainname=example.com + + + + Disable packet filter on bridged packets (method one) + /etc/udev/rules.d/99-bridge.rules: + + + ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge" - /etc/sysctl.d/bridge.conf: - + /etc/sysctl.d/bridge.conf: + - net.bridge.bridge-nf-call-ip6tables = 0 + net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 - + - - Disable packet filter on bridged packets (method two) - /etc/modules-load.d/bridge.conf: - + + Disable packet filter on bridged packets (method two) + /etc/modules-load.d/bridge.conf: + - bridge + bridge - /etc/sysctl.d/bridge.conf: - + /etc/sysctl.d/bridge.conf: + - net.bridge.bridge-nf-call-ip6tables = 0 + net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 - - - - - See Also - - systemd1, - systemd-sysctl.service8, - systemd-delta1, - sysctl8, - sysctl.conf5, - modprobe8 - - + + + + + See Also + + systemd1, + systemd-sysctl.service8, + systemd-delta1, + sysctl8, + sysctl.conf5, + modprobe8 + + diff --git a/man/system.conf.d.html b/man/system.conf.d.html index ef0fc2a36..45b790689 100644 --- a/man/system.conf.d.html +++ b/man/system.conf.d.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. These - configuration files contain a few settings controlling - basic manager operations.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. These configuration + files contain a few settings controlling basic manager + operations.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -50,240 +50,153 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various - parameters of basic manager - operation. These options may be - overridden by the respective command - line arguments. See - systemd(1) - for details about these command line - arguments.

CPUAffinity=¶

Configures the initial - CPU affinity for the init - process. Takes a space-separated list - of CPU indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers - that shall be mounted in a single - hierarchy. By default, systemd will - mount all controllers which are - enabled in the kernel in individual - hierarchies, with the exception of - those listed in this setting. Takes a - space-separated list of comma-separated - controller names, in order - to allow multiple joined - hierarchies. Defaults to - 'cpu,cpuacct'. Pass an empty string to - ensure that systemd mounts all - controllers in separate - hierarchies.

Note that this option is only - applied once, at very early boot. If - you use an initial RAM disk (initrd) - that uses systemd, it might hence be - necessary to rebuild the initrd if - this option is changed, and make sure - the new configuration file is included - in it. Otherwise, the initrd might - mount the controller hierarchies in a - different configuration than intended, - and the main system cannot remount - them anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware - watchdog at runtime and at - reboot. Takes a timeout value in - seconds (or in other time units if - suffixed with "ms", - "min", - "h", - "d", - "w"). If - RuntimeWatchdogSec= - is set to a non-zero value, the - watchdog hardware - (/dev/watchdog) - will be programmed to automatically - reboot the system if it is not - contacted within the specified timeout - interval. The system manager will - ensure to contact it at least once in - half the specified timeout - interval. This feature requires a - hardware watchdog device to be - present, as it is commonly the case in - embedded and server systems. Not all - hardware watchdogs allow configuration - of the reboot timeout, in which case - the closest available timeout is - picked. ShutdownWatchdogSec= - may be used to configure the hardware - watchdog when the system is asked to - reboot. It works as a safety net to - ensure that the reboot takes place - even if a clean reboot attempt times - out. By default - RuntimeWatchdogSec= - defaults to 0 (off), and - ShutdownWatchdogSec= - to 10min. These settings have no - effect if a hardware watchdog is not - available.

CapabilityBoundingSet=¶

Controls which - capabilities to include in the - capability bounding set for PID 1 and - its children. See - capabilities(7) - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name(3). - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, all but the listed - capabilities will be included, the - effect of the assignment - inverted. Note that this option also - affects the respective capabilities in - the effective, permitted and - inheritable capability sets. The - capability bounding set may also be - individually configured for units - using the - CapabilityBoundingSet= - directive for units, but note that - capabilities dropped for PID 1 cannot - be regained in individual units, they - are lost for good.

SystemCallArchitectures=¶

Takes a - space-separated list of architecture - identifiers. Selects from which - architectures system calls may be - invoked on this system. This may be - used as an effective way to disable - invocation of non-native binaries - system-wide, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. This option - operates system-wide, and acts - similar to the - SystemCallArchitectures= - setting of unit files, see - systemd.exec(5) - for details. This setting defaults to - the empty list, in which case no - filtering of system calls based on - architecture is applied. Known - architecture identifiers are - "x86", - "x86-64", - "x32", - "arm" and the special - identifier - "native". The latter - implicitly maps to the native - architecture of the system (or more - specifically, the architecture the - system manager was compiled for). Set - this setting to - "native" to prohibit - execution of any non-native - binaries. When a binary executes a - system call of an architecture that is - not listed in this setting, it will be - immediately terminated with the SIGSYS - signal.

TimerSlackNSec=¶

Sets the timer slack - in nanoseconds for PID 1, which is - inherited by all executed processes, - unless overridden individually, for - example with the - TimerSlackNSec= - setting in service units (for details - see - systemd.exec(5)). The - timer slack controls the accuracy of - wake-ups triggered by system - timers. See - prctl(2) - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too.

DefaultTimerAccuracySec=¶

Sets the default - accuracy of timer units. This controls - the global default for the - AccuracySec= - setting of timer units, see - systemd.timer(5) - for - details. AccuracySec= - set in individual units override the - global default for the specific - unit. Defaults to 1min. Note that the - accuracy of timer units is also - affected by the configured timer slack - for PID 1, see - TimerSlackNSec= - above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default - timeouts for starting and stopping of - units, as well as the default time to - sleep between automatic restarts of - units, as configured per-unit in - TimeoutStartSec=, - TimeoutStopSec= and - RestartSec= (for - services, see - systemd.service(5) - for details on the per-unit - settings). For non-service units, - DefaultTimeoutStartSec= - sets the default - TimeoutSec= value. -

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default - unit start rate limiting, as - configured per-service by - StartLimitInterval= - and - StartLimitBurst=. See - systemd.service(5) - for details on the per-service - settings.

DefaultEnvironment=¶

Sets manager - environment variables passed to all - executed processes. Takes a - space-separated list of variable - assignments. See - environ(7) - for details about environment - variables.

Example: + file.

Options¶

All options are configured in the + "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various parameters of basic manager + operation. These options may be overridden by the respective + command line arguments. See + systemd(1) + for details about these command line + arguments.

CPUAffinity=¶

Configures the initial CPU affinity for the + init process. Takes a space-separated list of CPU + indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers that shall be mounted + in a single hierarchy. By default, systemd will mount all + controllers which are enabled in the kernel in individual + hierarchies, with the exception of those listed in this + setting. Takes a space-separated list of comma-separated + controller names, in order to allow multiple joined + hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string + to ensure that systemd mounts all controllers in separate + hierarchies.

Note that this option is only applied once, at very + early boot. If you use an initial RAM disk (initrd) that uses + systemd, it might hence be necessary to rebuild the initrd if + this option is changed, and make sure the new configuration + file is included in it. Otherwise, the initrd might mount the + controller hierarchies in a different configuration than + intended, and the main system cannot remount them + anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware watchdog at runtime and + at reboot. Takes a timeout value in seconds (or in other time + units if suffixed with "ms", + "min", "h", + "d", "w"). If + RuntimeWatchdogSec= is set to a non-zero + value, the watchdog hardware + (/dev/watchdog) will be programmed to + automatically reboot the system if it is not contacted within + the specified timeout interval. The system manager will ensure + to contact it at least once in half the specified timeout + interval. This feature requires a hardware watchdog device to + be present, as it is commonly the case in embedded and server + systems. Not all hardware watchdogs allow configuration of the + reboot timeout, in which case the closest available timeout is + picked. ShutdownWatchdogSec= may be used to + configure the hardware watchdog when the system is asked to + reboot. It works as a safety net to ensure that the reboot + takes place even if a clean reboot attempt times out. By + default RuntimeWatchdogSec= defaults to 0 + (off), and ShutdownWatchdogSec= to 10min. + These settings have no effect if a hardware watchdog is not + available.

CapabilityBoundingSet=¶

Controls which capabilities to include in the + capability bounding set for PID 1 and its children. See + capabilities(7) + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name(3). + Capabilities listed will be included in the bounding set, all + others are removed. If the list of capabilities is prefixed + with ~, all but the listed capabilities will be included, the + effect of the assignment inverted. Note that this option also + affects the respective capabilities in the effective, + permitted and inheritable capability sets. The capability + bounding set may also be individually configured for units + using the CapabilityBoundingSet= directive + for units, but note that capabilities dropped for PID 1 cannot + be regained in individual units, they are lost for + good.

SystemCallArchitectures=¶

Takes a space-separated list of architecture + identifiers. Selects from which architectures system calls may + be invoked on this system. This may be used as an effective + way to disable invocation of non-native binaries system-wide, + for example to prohibit execution of 32-bit x86 binaries on + 64-bit x86-64 systems. This option operates system-wide, and + acts similar to the + SystemCallArchitectures= setting of unit + files, see + systemd.exec(5) + for details. This setting defaults to the empty list, in which + case no filtering of system calls based on architecture is + applied. Known architecture identifiers are + "x86", "x86-64", + "x32", "arm" and the special + identifier "native". The latter implicitly + maps to the native architecture of the system (or more + specifically, the architecture the system manager was compiled + for). Set this setting to "native" to + prohibit execution of any non-native binaries. When a binary + executes a system call of an architecture that is not listed + in this setting, it will be immediately terminated with the + SIGSYS signal.

TimerSlackNSec=¶

Sets the timer slack in nanoseconds for PID 1, + which is inherited by all executed processes, unless + overridden individually, for example with the + TimerSlackNSec= setting in service units + (for details see + systemd.exec(5)). + The timer slack controls the accuracy of wake-ups triggered by + system timers. See + prctl(2) + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too.

DefaultTimerAccuracySec=¶

Sets the default accuracy of timer units. This + controls the global default for the + AccuracySec= setting of timer units, see + systemd.timer(5) + for details. AccuracySec= set in individual + units override the global default for the specific unit. + Defaults to 1min. Note that the accuracy of timer units is + also affected by the configured timer slack for PID 1, see + TimerSlackNSec= above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default timeouts for starting + and stopping of units, as well as the default time to sleep + between automatic restarts of units, as configured per-unit in + TimeoutStartSec=, + TimeoutStopSec= and + RestartSec= (for services, see + systemd.service(5) + for details on the per-unit settings). For non-service units, + DefaultTimeoutStartSec= sets the default + TimeoutSec= value.

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default unit start rate + limiting, as configured per-service by + StartLimitInterval= and + StartLimitBurst=. See + systemd.service(5) + for details on the per-service settings.

DefaultEnvironment=¶

Sets manager environment variables passed to + all executed processes. Takes a space-separated list of + variable assignments. See + environ(7) + for details about environment variables.

Example: -

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

+

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

- Sets three variables - "VAR1", - "VAR2", - "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default - resource accounting settings, as - configured per-unit by - CPUAccounting=, - BlockIOAccounting= - and - MemoryAccounting=. See - systemd.resource-control(5) - for details on the per-unit - settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control - various default resource limits for - units. See - setrlimit(2) - for details. Use the string - infinity to - configure no limit on a specific - resource. These settings may be - overridden in individual units - using the corresponding LimitXXX= - directives. Note that these resource - limits are only defaults for units, - they are not applied to PID 1 - itself.

+ Sets three variables + "VAR1", + "VAR2", + "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default resource accounting + settings, as configured per-unit by + CPUAccounting=, + BlockIOAccounting= and + MemoryAccounting=. See + systemd.resource-control(5) + for details on the per-unit settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control various default + resource limits for units. See + setrlimit(2) + for details. Use the string infinity to + configure no limit on a specific resource. These settings may + be overridden in individual units using the corresponding + LimitXXX= directives. Note that these resource limits are only + defaults for units, they are not applied to PID 1 + itself.

diff --git a/man/systemctl.1 b/man/systemctl.1 index b961db00a..95a5fdb96 100644 --- a/man/systemctl.1 +++ b/man/systemctl.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMCTL" "1" "" "systemd 218" "systemctl" +.TH "SYSTEMCTL" "1" "" "systemd 219" "systemctl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -102,7 +102,7 @@ Note that any \fIAfter=\fR dependency is automatically mirrored to create a \fIBefore=\fR -dependency\&. Temporal dependencies may be specified explictly, but are also created implicitly for units which are +dependency\&. Temporal dependencies may be specified explicitly, but are also created implicitly for units which are \fIWantedBy=\fR targets (see \fBsystemd.target\fR(5)), and as a result of other directives (for example @@ -208,11 +208,6 @@ Do not synchronously wait for the requested operation to finish\&. If this is no will wait until it is completed\&. By passing this argument, it is only verified and enqueued\&. .RE .PP -\fB\-\-no\-legend\fR -.RS 4 -Do not print the legend, i\&.e\&. the column headers and the footer with hints\&. -.RE -.PP \fB\-\-user\fR .RS 4 Talk to the service manager of the calling user, rather than the service manager of the system\&. @@ -373,6 +368,16 @@ Execute the operation remotely\&. Specify a hostname, or a username and hostname Execute operation on a local container\&. Specify a container name to connect to\&. .RE .PP +\fB\-\-no\-pager\fR +.RS 4 +Do not pipe output into a pager\&. +.RE +.PP +\fB\-\-no\-legend\fR +.RS 4 +Do not print the legend, i\&.e\&. column headers and the footer with hints\&. +.RE +.PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help text and exit\&. @@ -382,11 +387,6 @@ Print a short help text and exit\&. .RS 4 Print a short version string and exit\&. .RE -.PP -\fB\-\-no\-pager\fR -.RS 4 -Do not pipe output into a pager\&. -.RE .SH "COMMANDS" .PP The following commands are understood: @@ -684,6 +684,43 @@ in a similar way as \fBenable\fR\&. .RE .PP +\fBreenable \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR +.RS 4 +Reenable one or more unit files, as specified on the command line\&. This is a combination of +\fBdisable\fR +and +\fBenable\fR +and is useful to reset the symlinks a unit is enabled with to the defaults configured in the +"[Install]" +section of the unit file\&. +.RE +.PP +\fBpreset \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR +.RS 4 +Reset one or more unit files, as specified on the command line, to the defaults configured in the preset policy files\&. This has the same effect as +\fBdisable\fR +or +\fBenable\fR, depending how the unit is listed in the preset files\&. +.sp +Use +\fB\-\-preset\-mode=\fR +to control whether units shall be enabled and disabled, or only enabled, or only disabled\&. +.sp +For more information on the preset policy format, see +\fBsystemd.preset\fR(5)\&. For more information on the concept of presets, please consult the +\m[blue]\fBPreset\fR\m[]\&\s-2\u[1]\d\s+2 +document\&. +.RE +.PP +\fBpreset\-all\fR +.RS 4 +Resets all installed unit files to the defaults configured in the preset policy file (see above)\&. +.sp +Use +\fB\-\-preset\-mode=\fR +to control whether units shall be enabled and disabled, or only enabled, or only disabled\&. +.RE +.PP \fBis\-enabled \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR .RS 4 Checks whether any of the specified unit files are enabled (as with @@ -770,43 +807,6 @@ T} .sp 1 .RE .PP -\fBreenable \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR -.RS 4 -Reenable one or more unit files, as specified on the command line\&. This is a combination of -\fBdisable\fR -and -\fBenable\fR -and is useful to reset the symlinks a unit is enabled with to the defaults configured in the -"[Install]" -section of the unit file\&. -.RE -.PP -\fBpreset \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR -.RS 4 -Reset one or more unit files, as specified on the command line, to the defaults configured in the preset policy files\&. This has the same effect as -\fBdisable\fR -or -\fBenable\fR, depending how the unit is listed in the preset files\&. -.sp -Use -\fB\-\-preset\-mode=\fR -to control whether units shall be enabled and disabled, or only enabled, or only disabled\&. -.sp -For more information on the preset policy format, see -\fBsystemd.preset\fR(5)\&. For more information on the concept of presets, please consult the -\m[blue]\fBPreset\fR\m[]\&\s-2\u[1]\d\s+2 -document\&. -.RE -.PP -\fBpreset\-all\fR -.RS 4 -Resets all installed unit files to the defaults configured in the preset policy file (see above)\&. -.sp -Use -\fB\-\-preset\-mode=\fR -to control whether units shall be enabled and disabled, or only enabled, or only disabled\&. -.RE -.PP \fBmask \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR .RS 4 Mask one or more unit files, as specified on the command line\&. This will link these units to @@ -822,6 +822,14 @@ Unmask one or more unit files, as specified on the command line\&. This will und \fBmask\fR\&. .RE .PP +\fBlink \fR\fB\fIFILENAME\fR\fR\fB\&.\&.\&.\fR +.RS 4 +Link a unit file that is not in the unit file search paths into the unit file search path\&. This requires an absolute path to a unit file\&. The effect of this can be undone with +\fBdisable\fR\&. The effect of this command is that a unit file is available for +\fBstart\fR +and other commands although it is not installed directly in the unit search path\&. +.RE +.PP \fBadd\-wants \fR\fB\fITARGET\fR\fR\fB \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR, \fBadd\-requires \fR\fB\fITARGET\fR\fR\fB \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR .RS 4 Adds @@ -842,28 +850,6 @@ in a similar way as \fBenable\fR\&. .RE .PP -\fBlink \fR\fB\fIFILENAME\fR\fR\fB\&.\&.\&.\fR -.RS 4 -Link a unit file that is not in the unit file search paths into the unit file search path\&. This requires an absolute path to a unit file\&. The effect of this can be undone with -\fBdisable\fR\&. The effect of this command is that a unit file is available for -\fBstart\fR -and other commands although it is not installed directly in the unit search path\&. -.RE -.PP -\fBget\-default\fR -.RS 4 -Get the default target specified via -default\&.target -link\&. -.RE -.PP -\fBset\-default \fR\fB\fINAME\fR\fR -.RS 4 -Set the default target to boot into\&. Command links -default\&.target -to the given unit\&. -.RE -.PP \fBedit \fR\fB\fINAME\fR\fR\fB\&.\&.\&.\fR .RS 4 Edit a drop\-in snippet or a whole replacement file if @@ -897,6 +883,20 @@ Note that this command cannot be used to remotely edit units and that you cannot since they take precedence over /run\&. .RE +.PP +\fBget\-default\fR +.RS 4 +Return the default target to boot into\&. This returns the target unit name +default\&.target +is aliased (symlinked) to\&. +.RE +.PP +\fBset\-default \fR\fB\fINAME\fR\fR +.RS 4 +Set the default target to boot into\&. This sets (symlinks) the +default\&.target +alias to the given target unit\&. +.RE .SS "Machine Commands" .PP \fBlist\-machines \fR\fB[\fIPATTERN\fR\&.\&.\&.]\fR @@ -953,7 +953,7 @@ Set one or more systemd manager environment variables, as specified on the comma Unset one or more systemd manager environment variables\&. If only a variable name is specified, it will be removed regardless of its value\&. If a variable and a value are specified, the variable is only removed if it has the specified value\&. .RE .PP -\fBimport\-environment \fR\fB\fIVARIABLE\fR\fR\fB\&.\&.\&.\fR +\fBimport\-environment\fR [\fIVARIABLE\&.\&.\&.\fR] .RS 4 Import all, one or more environment variables set on the client into the systemd manager environment block\&. If no arguments are passed, the entire environment block is imported\&. Otherwise, a list of one or more environment variable names should be passed, whose client\-side values are then imported into the manager\*(Aqs environment block\&. .RE @@ -961,7 +961,8 @@ Import all, one or more environment variables set on the client into the systemd .PP \fBdaemon\-reload\fR .RS 4 -Reload systemd manager configuration\&. This will reload all unit files and recreate the entire dependency tree\&. While the daemon is being reloaded, all sockets systemd listens on behalf of user configuration will stay accessible\&. +Reload systemd manager configuration\&. This will rerun all generators (see +\fBsystemd.generator\fR(7)), reload all unit files, and recreate the entire dependency tree\&. While the daemon is being reloaded, all sockets systemd listens on behalf of user configuration will stay accessible\&. .sp This command should not be confused with the \fBreload\fR @@ -1110,6 +1111,11 @@ Ask the systemd manager to quit\&. This is only supported for user service manag option) and will fail otherwise\&. .RE .PP +\fBswitch\-root \fR\fB\fIROOT\fR\fR\fB \fR\fB[\fIINIT\fR]\fR +.RS 4 +Switches to a different root directory and executes a new system manager process below it\&. This is intended for usage in initial RAM disks ("initrd"), and will transition from the initrd\*(Aqs system manager process (a\&.k\&.a "init" process) to the main system manager process\&. This call takes two arguments: the directory that is to become the new root directory, and the path to the new system manager binary below it to execute as PID 1\&. If the latter is omitted or the empty string, a systemd binary will automatically be searched for and used as init\&. If the system manager path is omitted or equal to the empty string, the state of the initrd\*(Aqs system manager process is passed to the main system manager, which allows later introspection of the state of the services involved in the initrd boot\&. +.RE +.PP \fBsuspend\fR .RS 4 Suspend the system\&. This will trigger activation of the special @@ -1130,11 +1136,6 @@ Hibernate and suspend the system\&. This will trigger activation of the special hybrid\-sleep\&.target target\&. .RE -.PP -\fBswitch\-root \fR\fB\fIROOT\fR\fR\fB \fR\fB[\fIINIT\fR]\fR -.RS 4 -Switches to a different root directory and executes a new system manager process below it\&. This is intended for usage in initial RAM disks ("initrd"), and will transition from the initrd\*(Aqs system manager process (a\&.k\&.a "init" process) to the main system manager process\&. This call takes two arguments: the directory that is to become the new root directory, and the path to the new system manager binary below it to execute as PID 1\&. If the latter is omitted or the empty string, a systemd binary will automatically be searched for and used as init\&. If the system manager path is omitted or equal to the empty string, the state of the initrd\*(Aqs system manager process is passed to the main system manager, which allows later introspection of the state of the services involved in the initrd boot\&. -.RE .SS "Parameter Syntax" .PP Unit commands listed above take either a single unit name (designated as @@ -1308,14 +1309,15 @@ Override the default options passed to .SH "SEE ALSO" .PP \fBsystemd\fR(1), -\fBsystemadm\fR(1), \fBjournalctl\fR(1), \fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemd.unit\fR(5), \fBsystemd.resource-management\fR(5), \fBsystemd.special\fR(7), \fBwall\fR(1), \fBsystemd.preset\fR(5), +\fBsystemd.generator\fR(7), \fBglob\fR(7) .SH "NOTES" .IP " 1." 4 diff --git a/man/systemctl.html b/man/systemctl.html index b1aee4667..a529d7348 100644 --- a/man/systemctl.html +++ b/man/systemctl.html @@ -19,12 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemctl — Control the systemd system and service manager

Synopsis

systemctl [OPTIONS...] COMMAND [NAME...]

Description¶

systemctl may be used to introspect and + gudev systemd 219


Name

systemctl — Control the systemd system and service manager

Synopsis

systemctl [OPTIONS...] COMMAND [NAME...]

Description¶

systemctl may be used to introspect and control the state of the "systemd" system and service manager. Please refer to systemd(1) for an introduction into the basic concepts and functionality this - tool manages.

Options¶

The following options are understood:

-t, --type=¶

The argument should be a comma-separated list of unit + tool manages.

Options¶

The following options are understood:

-t, --type=¶

The argument should be a comma-separated list of unit types such as service and socket.

If one of the arguments is a unit type, when listing @@ -60,7 +60,7 @@ After= dependency.

Note that any After= dependency is automatically mirrored to create a Before= dependency. Temporal dependencies - may be specified explictly, but are also created implicitly + may be specified explicitly, but are also created implicitly for units which are WantedBy= targets (see systemd.target(5)), @@ -130,8 +130,7 @@ to finish. If this is not specified, the job will be verified, enqueued and systemctl will wait until it is completed. By passing this argument, it is - only verified and enqueued.

--no-legend¶

Do not print the legend, i.e. the column headers and - the footer with hints.

--user¶

Talk to the service manager of the calling user, + only verified and enqueued.

--user¶

Talk to the service manager of the calling user, rather than the service manager of the system.

--system¶

Talk to the service manager of the system. This is the implied default.

--no-wall¶

Do not send wall message before halt, power-off, reboot.

--global¶

When used with enable and @@ -234,8 +233,9 @@ instance. Container names may be enumerated with machinectl -H HOST.

-M, --machine=¶

Execute operation on a local container. Specify a - container name to connect to.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Commands¶

The following commands are understood:

Unit Commands¶

list-units [PATTERN...]¶

List known units (subject to limitations specified + container name to connect to.

--no-pager¶

Do not pipe output into a pager.

--no-legend¶

Do not print the legend, i.e. column headers and the + footer with hints.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Commands¶

The following commands are understood:

Unit Commands¶

list-units [PATTERN...]¶

List known units (subject to limitations specified with -t). If one or more PATTERNs are specified, only units matching one of them are shown.

This is the default command.

list-sockets [PATTERN...]¶

List socket units ordered by listening address. @@ -384,7 +384,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service units are recursively expanded as well.

Options --reverse, --after, --before may be used to change what types of dependencies - are shown.

Unit File Commands¶

list-unit-files [PATTERN...]¶

List installed unit files. If one or more + are shown.

Unit File Commands¶

list-unit-files [PATTERN...]¶

List installed unit files. If one or more PATTERNs are specified, only units whose filename (just the last component of the path) matches one of them are shown.

enable NAME...¶

Enable one or more unit files or unit file instances, @@ -444,16 +444,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service

This command honors --system, --user, --runtime and --global in a similar way as - enable.

is-enabled NAME...¶

Checks whether any of the specified unit files are - enabled (as with enable). Returns an - exit code of 0 if at least one is enabled, non-zero - otherwise. Prints the current enable status (see table). - To suppress this output, use --quiet. -

Table 1.  - is-enabled output -

Printed stringMeaningReturn value
"enabled"Enabled through a symlink in .wants directory (permanently or just in /run).0
"enabled-runtime"
"linked"Made available through a symlink to the unit file (permanently or just in /run).1
"linked-runtime"
"masked"Disabled entirely (permanently or just in /run).1
"masked-runtime"
"static"Unit file is not enabled, and has no provisions for enabling in the "[Install]" section.0
"indirect"Unit file itself is not enabled, but it has a non-empty Also= setting in the "[Install]" section, listing other unit files that might be enabled.0
"disabled"Unit file is not enabled.1

reenable NAME...¶

Reenable one or more unit files, as specified on the + enable.

reenable NAME...¶

Reenable one or more unit files, as specified on the command line. This is a combination of disable and enable and is useful to reset the symlinks a unit is enabled with to @@ -472,7 +463,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service document.

preset-all¶

Resets all installed unit files to the defaults configured in the preset policy file (see above).

Use --preset-mode= to control whether units shall be enabled and disabled, or only - enabled, or only disabled.

mask NAME...¶

Mask one or more unit files, as specified on the + enabled, or only disabled.

is-enabled NAME...¶

Checks whether any of the specified unit files are + enabled (as with enable). Returns an + exit code of 0 if at least one is enabled, non-zero + otherwise. Prints the current enable status (see table). + To suppress this output, use --quiet. +

Table 1.  + is-enabled output +

Printed stringMeaningReturn value
"enabled"Enabled through a symlink in .wants directory (permanently or just in /run).0
"enabled-runtime"
"linked"Made available through a symlink to the unit file (permanently or just in /run).1
"linked-runtime"
"masked"Disabled entirely (permanently or just in /run).1
"masked-runtime"
"static"Unit file is not enabled, and has no provisions for enabling in the "[Install]" section.0
"indirect"Unit file itself is not enabled, but it has a non-empty Also= setting in the "[Install]" section, listing other unit files that might be enabled.0
"disabled"Unit file is not enabled.1

mask NAME...¶

Mask one or more unit files, as specified on the command line. This will link these units to /dev/null, making it impossible to start them. This is a stronger version of @@ -482,7 +482,13 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service --runtime option to only mask temporarily until the next reboot of the system.

unmask NAME...¶

Unmask one or more unit files, as specified on the command line. This will undo the effect of - mask.

mask.

Link a unit file that is not in the unit file search + paths into the unit file search path. This requires an + absolute path to a unit file. The effect of this can be + undone with disable. The effect of this + command is that a unit file is available for + start and other commands although it + is not installed directly in the unit search path.

add-wants TARGET NAME..., add-requires TARGET NAME...¶

Adds "Wants=" resp. "Requires=" @@ -490,15 +496,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service one or more units.

This command honors --system, --user, --runtime and --global in a similar way as - enable.

Link a unit file that is not in the unit file search - paths into the unit file search path. This requires an - absolute path to a unit file. The effect of this can be - undone with disable. The effect of this - command is that a unit file is available for - start and other commands although it - is not installed directly in the unit search path.

get-default¶

Get the default target specified - via default.target link.

set-default NAME¶

Set the default target to boot into. Command links - default.target to the given unit.

edit NAME...¶

Edit a drop-in snippet or a whole replacement file if + enable.

edit NAME...¶

Edit a drop-in snippet or a whole replacement file if --full is specified, to extend or override the specified unit.

Depending on whether --system (the default), --user, or --global is specified, @@ -515,15 +513,19 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service

Note that this command cannot be used to remotely edit units and that you cannot temporarily edit units which are in /etc since they take precedence over - /run.

Machine Commands¶

list-machines [PATTERN...]¶

List the host and all running local containers with + /run.

get-default¶

Return the default target to boot into. This returns + the target unit name default.target + is aliased (symlinked) to.

set-default NAME¶

Set the default target to boot into. This sets + (symlinks) the default.target alias + to the given target unit.

Machine Commands¶

list-machines [PATTERN...]¶

List the host and all running local containers with their state. If one or more PATTERNs are specified, only containers matching one of them are shown. -

Job Commands¶

list-jobs [PATTERN...]¶

List jobs that are in progress. If one or more +

Job Commands¶

list-jobs [PATTERN...]¶

List jobs that are in progress. If one or more PATTERNs are specified, only jobs for units matching one of them are shown.

cancel JOB...¶

Cancel one or more jobs specified on the command line by their numeric job IDs. If no job ID is specified, cancel - all pending jobs.

Snapshot Commands¶

snapshot [NAME]¶

Create a snapshot. If a snapshot name is specified, + all pending jobs.

Snapshot Commands¶

snapshot [NAME]¶

Create a snapshot. If a snapshot name is specified, the new snapshot will be named after it. If none is specified, an automatic snapshot name is generated. In either case, the snapshot name used is printed to standard @@ -538,7 +540,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service which units are running or are stopped, they do not save/restore any other state. Snapshots are dynamic and lost on reboot.

delete PATTERN...¶

Remove a snapshot previously created with - snapshot.

Environment Commands¶

show-environment¶

Dump the systemd manager environment block. The + snapshot.

Environment Commands¶

show-environment¶

Dump the systemd manager environment block. The environment block will be dumped in straight-forward form suitable for sourcing into a shell script. This environment block will be passed to all processes the manager @@ -547,31 +549,39 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service variables. If only a variable name is specified, it will be removed regardless of its value. If a variable and a value are specified, the variable is only removed if it has the - specified value.

import-environment VARIABLE...¶

Import all, one or more environment variables set on + specified value.

+ import-environment + [VARIABLE...] + ¶

Import all, one or more environment variables set on the client into the systemd manager environment block. If no arguments are passed, the entire environment block is imported. Otherwise, a list of one or more environment variable names should be passed, whose client-side values are then imported into the manager's environment - block.

Manager Lifecycle Commands¶

daemon-reload¶

Reload systemd manager configuration. This will reload - all unit files and recreate the entire dependency - tree. While the daemon is being reloaded, all sockets systemd - listens on behalf of user configuration will stay - accessible.

This command should not be confused - with the reload command.

daemon-reexec¶

Reexecute the systemd manager. This will serialize the + block.

Manager Lifecycle Commands¶

daemon-reload¶

Reload systemd manager configuration. This will + rerun all generators (see + systemd.generator(7)), + reload all unit files, and recreate the entire dependency + tree. While the daemon is being reloaded, all sockets + systemd listens on behalf of user configuration will stay + accessible.

This command should not be confused with the + reload command.

daemon-reexec¶

Reexecute the systemd manager. This will serialize the manager state, reexecute the process and deserialize the state again. This command is of little use except for debugging and package upgrades. Sometimes, it might be helpful as a heavy-weight daemon-reload. While the daemon is being reexecuted, all sockets systemd listening on behalf of user configuration will stay accessible. -

System Commands¶

is-system-running¶

Checks whether the system is operational. This +

System Commands¶

is-system-running¶

Checks whether the system is operational. This returns success when the system is fully up and running, meaning not in startup, shutdown or maintenance mode. Failure is returned otherwise. In addition, the current state is printed in a short string to standard output, see table below. Use --quiet to - suppress this output.

Table 2. Manager Operational States

NameDescription
initializing

Early bootup, before + suppress this output.

Table 2. Manager Operational States

NameDescription
initializing

Early bootup, before basic.target is reached or the maintenance state entered.

starting

Late bootup, before the job queue @@ -629,13 +639,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service immediately followed by the reboot.

exit¶

Ask the systemd manager to quit. This is only supported for user service managers (i.e. in conjunction with the --user option) and will fail - otherwise.

suspend¶

Suspend the system. This will trigger activation of - the special suspend.target target. -

hibernate¶

Hibernate the system. This will trigger activation of - the special hibernate.target target. -

hybrid-sleep¶

Hibernate and suspend the system. This will trigger - activation of the special - hybrid-sleep.target target.

switch-root ROOT [INIT]¶

Switches to a different root directory and executes a + otherwise.

switch-root ROOT [INIT]¶

Switches to a different root directory and executes a new system manager process below it. This is intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager process (a.k.a "init" @@ -648,7 +652,13 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service equal to the empty string, the state of the initrd's system manager process is passed to the main system manager, which allows later introspection of the state of the services - involved in the initrd boot.

Parameter Syntax¶

Unit commands listed above take either a single unit name + involved in the initrd boot.

suspend¶

Suspend the system. This will trigger activation of + the special suspend.target target. +

hibernate¶

Hibernate the system. This will trigger activation of + the special hibernate.target target. +

hybrid-sleep¶

Hibernate and suspend the system. This will trigger + activation of the special + hybrid-sleep.target target.

Parameter Syntax¶

Unit commands listed above take either a single unit name (designated as NAME), or multiple unit specifications (designated as PATTERN...). In the first case, the @@ -676,11 +686,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service a suffix, will be treated as in the first case. This means that literal unit names always refer to exactly one unit, but globs may match zero units and this is not considered an error.

Glob patterns use - fnmatch(3), + fnmatch(3), so normal shell-style globbing rules are used, and "*", "?", "[]" may be used. See - glob(7) + glob(7) for more details. The patterns are matched against the names of currently loaded units, and patterns which do not match anything are silently skipped. For example: @@ -692,8 +702,8 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service

# systemctl enable foo.service

or

# systemctl link /path/to/foo.service

-

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Environment¶

$SYSTEMD_EDITOR¶

Editor to use when editing units; overrides +

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

Environment¶

$SYSTEMD_EDITOR¶

Editor to use when editing units; overrides $EDITOR and $VISUAL. If neither $SYSTEMD_EDITOR nor $EDITOR nor $VISUAL are present or if it is set to an empty @@ -710,15 +720,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

See Also¶

+ ("FRSXMK").

diff --git a/man/systemctl.xml b/man/systemctl.xml index d1991e0f9..338c1d328 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> . Note that any After= dependency is automatically mirrored to create a Before= dependency. Temporal dependencies - may be specified explictly, but are also created implicitly + may be specified explicitly, but are also created implicitly for units which are WantedBy= targets (see systemd.target5), @@ -321,15 +321,6 @@ along with systemd; If not, see . - - - - - Do not print the legend, i.e. the column headers and - the footer with hints. - - - @@ -386,7 +377,6 @@ along with systemd; If not, see . querying the user for authentication for privileged operations. - @@ -548,9 +538,10 @@ along with systemd; If not, see . + + - @@ -992,6 +983,56 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service + + reenable NAME... + + + Reenable one or more unit files, as specified on the + command line. This is a combination of + disable and enable and + is useful to reset the symlinks a unit is enabled with to + the defaults configured in the [Install] + section of the unit file. + + + + + preset NAME... + + + Reset one or more unit files, as specified on the + command line, to the defaults configured in the preset + policy files. This has the same effect as + disable or enable, + depending how the unit is listed in the preset files. + + Use to control + whether units shall be enabled and disabled, or only + enabled, or only disabled. + + For more information on the preset policy format, + see + systemd.preset5. + For more information on the concept of presets, please + consult the Preset + document. + + + + + preset-all + + + Resets all installed unit files to the defaults + configured in the preset policy file (see above). + + Use to control + whether units shall be enabled and disabled, or only + enabled, or only disabled. + + + is-enabled NAME... @@ -1063,56 +1104,6 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service - - reenable NAME... - - - Reenable one or more unit files, as specified on the - command line. This is a combination of - disable and enable and - is useful to reset the symlinks a unit is enabled with to - the defaults configured in the [Install] - section of the unit file. - - - - - preset NAME... - - - Reset one or more unit files, as specified on the - command line, to the defaults configured in the preset - policy files. This has the same effect as - disable or enable, - depending how the unit is listed in the preset files. - - Use to control - whether units shall be enabled and disabled, or only - enabled, or only disabled. - - For more information on the preset policy format, - see - systemd.preset5. - For more information on the concept of presets, please - consult the Preset - document. - - - - - preset-all - - - Resets all installed unit files to the defaults - configured in the preset policy file (see above). - - Use to control - whether units shall be enabled and disabled, or only - enabled, or only disabled. - - - mask NAME... @@ -1139,25 +1130,6 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service - - add-wants TARGET - NAME... - add-requires TARGET - NAME... - - - Adds Wants= resp. Requires= - dependency to the specified TARGET for - one or more units. - - This command honors , - , and - in a similar way as - enable. - - - - link FILENAME... @@ -1173,20 +1145,21 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service - get-default + add-wants TARGET + NAME... + add-requires TARGET + NAME... - Get the default target specified - via default.target link. - - + Adds Wants= resp. Requires= + dependency to the specified TARGET for + one or more units. - - set-default NAME + This command honors , + , and + in a similar way as + enable. - - Set the default target to boot into. Command links - default.target to the given unit. @@ -1226,6 +1199,27 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service /run. + + + get-default + + + Return the default target to boot into. This returns + the target unit name default.target + is aliased (symlinked) to. + + + + + set-default NAME + + + Set the default target to boot into. This sets + (symlinks) the default.target alias + to the given target unit. + + + @@ -1347,7 +1341,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service - import-environment VARIABLE... + + import-environment + VARIABLE... + Import all, one or more environment variables set on @@ -1370,12 +1367,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service daemon-reload - Reload systemd manager configuration. This will reload - all unit files and recreate the entire dependency - tree. While the daemon is being reloaded, all sockets systemd - listens on behalf of user configuration will stay - accessible. This command should not be confused - with the reload command. + Reload systemd manager configuration. This will + rerun all generators (see + systemd.generator7), + reload all unit files, and recreate the entire dependency + tree. While the daemon is being reloaded, all sockets + systemd listens on behalf of user configuration will stay + accessible. + + This command should not be confused with the + reload command. @@ -1547,6 +1548,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service firmware over the air update. + kexec @@ -1560,6 +1562,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service immediately followed by the reboot. + exit @@ -1569,8 +1572,29 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service with the option) and will fail otherwise. + + + + switch-root ROOT INIT + + Switches to a different root directory and executes a + new system manager process below it. This is intended for + usage in initial RAM disks ("initrd"), and will transition + from the initrd's system manager process (a.k.a "init" + process) to the main system manager process. This call takes two + arguments: the directory that is to become the new root directory, and + the path to the new system manager binary below it to + execute as PID 1. If the latter is omitted or the empty + string, a systemd binary will automatically be searched for + and used as init. If the system manager path is omitted or + equal to the empty string, the state of the initrd's system + manager process is passed to the main system manager, which + allows later introspection of the state of the services + involved in the initrd boot. + + suspend @@ -1580,6 +1604,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service + hibernate @@ -1589,6 +1614,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service + hybrid-sleep @@ -1598,26 +1624,6 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service hybrid-sleep.target target. - - switch-root ROOT INIT - - - Switches to a different root directory and executes a - new system manager process below it. This is intended for - usage in initial RAM disks ("initrd"), and will transition - from the initrd's system manager process (a.k.a "init" - process) to the main system manager process. This call takes two - arguments: the directory that is to become the new root directory, and - the path to the new system manager binary below it to - execute as PID 1. If the latter is omitted or the empty - string, a systemd binary will automatically be searched for - and used as init. If the system manager path is omitted or - equal to the empty string, the state of the initrd's system - manager process is passed to the main system manager, which - allows later introspection of the state of the services - involved in the initrd boot. - - @@ -1654,11 +1660,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service may match zero units and this is not considered an error. Glob patterns use - fnmatch3, + fnmatch3, so normal shell-style globbing rules are used, and *, ?, [] may be used. See - glob7 + glob7 for more details. The patterns are matched against the names of currently loaded units, and patterns which do not match anything are silently skipped. For example: @@ -1711,15 +1717,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service See Also systemd1, - systemadm1, journalctl1, loginctl1, + machinectl1, systemd.unit5, systemd.resource-management5, systemd.special7, wall1, systemd.preset5, - glob7 + systemd.generator7, + glob7 diff --git a/man/systemd-activate.8 b/man/systemd-activate.8 index 4f2fdea6e..ee311bae0 100644 --- a/man/systemd-activate.8 +++ b/man/systemd-activate.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-ACTIVATE" "8" "" "systemd 218" "systemd-activate" +.TH "SYSTEMD\-ACTIVATE" "8" "" "systemd 219" "systemd-activate" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-activate.html b/man/systemd-activate.html index 7607dd867..75745cf3b 100644 --- a/man/systemd-activate.html +++ b/man/systemd-activate.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-activate — Test socket activation of daemons

Synopsis

/usr/lib/systemd/systemd-activate [OPTIONS...] daemon [OPTIONS...]

Description¶

systemd-activate can be used to + gudev systemd 219


Name

systemd-activate — Test socket activation of daemons

Synopsis

/usr/lib/systemd/systemd-activate [OPTIONS...] daemon [OPTIONS...]

Description¶

systemd-activate can be used to launch a socket activated daemon from the command line for testing purposes. It can also be used to launch single instances of the daemon per connection (inetd-style). @@ -33,7 +33,7 @@ to systemd-activate will be passed through to the dameon, in the original positions. Other sockets specified with --listen will use consecutive descriptors. -

Options¶

-l address, --listen=address¶

Listen on this address. +

Options¶

-l address, --listen=address¶

Listen on this address. Takes a string like "2000" or "127.0.0.1:2001".

-a, --accept¶

Launch a separate instance of daemon per connection and pass the connection socket as standard input @@ -43,9 +43,9 @@ variable–value pair. Otherwise, obtain the value from the environment of systemd-activate itself.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Environment variables¶

$LISTEN_FDS, $LISTEN_PID¶

See +

--version¶

Print a short version string and exit.

Environment variables¶

$LISTEN_FDS, $LISTEN_PID¶

See sd_listen_fds(3).

$SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION¶

Same as in - systemd(1).

Examples¶

Example 1. Run an echo server on port 2000

$ /usr/lib/systemd/systemd-activate -l 2000 -a cat

Example 2. Run a socket activated instance of systemd-journal-gatewayd(8)

$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd

See Also¶

+ systemd(1).

Examples¶

Example 1. Run an echo server on port 2000

$ /usr/lib/systemd/systemd-activate -l 2000 -a cat

Example 2. Run a socket activated instance of systemd-journal-gatewayd(8)

$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd

See Also¶

systemd(1), systemd.socket(5), systemd.service(5), diff --git a/man/systemd-activate.xml b/man/systemd-activate.xml index 3793331aa..e64894a28 100644 --- a/man/systemd-activate.xml +++ b/man/systemd-activate.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> avahi\&.svg - $ eog avahi\&.svg + $ eog avahi\&.svg .fi .if n \{\ .RE @@ -274,15 +276,15 @@ Requires=different\&.service [Service] Desription=x -$ systemd\-verify \&./user\&.slice +$ systemd\-analyze verify \&./user\&.slice [\&./user\&.slice:9] Unknown lvalue \*(AqWhatIsThis\*(Aq in section \*(AqUnit\*(Aq [\&./user\&.slice:13] Unknown section \*(AqService\*(Aq\&. Ignoring\&. Error: org\&.freedesktop\&.systemd1\&.LoadFailed: - Unit different\&.service failed to load: - No such file or directory\&. + Unit different\&.service failed to load: + No such file or directory\&. Failed to create user\&.slice/start: Invalid argument user\&.slice: man nosuchfile(1) command failed with code 16 - + .fi .if n \{\ .RE @@ -304,10 +306,10 @@ ListenStream=100 ListenStream=100 Accept=yes -$ systemd\-verify \&./a\&.socket \&./b\&.socket +$ systemd\-analyze verify \&./a\&.socket \&./b\&.socket Service a\&.service not loaded, a\&.socket cannot be started\&. Service b@0\&.service not loaded, b\&.socket cannot be started\&. - + .fi .if n \{\ .RE diff --git a/man/systemd-analyze.html b/man/systemd-analyze.html index 03efe444b..0cee0c681 100644 --- a/man/systemd-analyze.html +++ b/man/systemd-analyze.html @@ -19,117 +19,98 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-analyze — Analyze system boot-up performance

Synopsis

systemd-analyze [OPTIONS...] [time]

systemd-analyze [OPTIONS...] blame

systemd-analyze [OPTIONS...] critical-chain [UNIT...]

systemd-analyze [OPTIONS...] plot [> file.svg]

systemd-analyze [OPTIONS...] dot [PATTERN...] [> file.dot]

systemd-analyze [OPTIONS...] dump

systemd-analyze [OPTIONS...] set-log-level [LEVEL]

systemd-analyze [OPTIONS...] verify [FILES...]

Description¶

systemd-analyze may be used - to determine system boot-up performance statistics and - retrieve other state and tracing information from the - system and service manager, and to verify the - correctness of unit files.

systemd-analyze time - prints the time spent in the kernel before - userspace has been reached, the time spent in the - initial RAM disk (initrd) before normal system - userspace has been reached, and the time normal system - userspace took to initialize. Note that these - measurements simply measure the time passed up to the - point where all system services have been spawned, but - not necessarily until they fully finished - initialization or the disk is idle.

systemd-analyze blame prints - a list of all running units, ordered by the time they - took to initialize. This information may be used to - optimize boot-up times. Note that the output might be - misleading as the initialization of one service might - be slow simply because it waits for the initialization - of another service to complete.

systemd-analyze critical-chain [UNIT...] - prints a tree of the time-critical chain of units - (for each of the specified UNITs - or for the default target otherwise). - The time after the unit is active or started is printed - after the "@" character. The time the unit takes to - start is printed after the "+" character. - Note that the output might be misleading as the - initialization of one service might depend on socket - activation and because of the parallel execution - of units.

systemd-analyze plot prints - an SVG graphic detailing which system services have - been started at what time, highlighting the time they - spent on initialization.

systemd-analyze dot generates - textual dependency graph description in dot format for - further processing with the GraphViz - dot(1) - tool. Use a command line like systemd-analyze - dot | dot -Tsvg > systemd.svg to generate a - graphical dependency tree. Unless - --order or --require - is passed, the generated graph will show both ordering - and requirement dependencies. Optional pattern - globbing style specifications - (e.g. *.target) may be given at - the end. A unit dependency is included in the graph if - any of these patterns match either the origin or - destination node.

systemd-analyze dump outputs - a (usually very long) human-readable serialization of - the complete server state. Its format is subject to - change without notice and should not be parsed by - applications.

systemd-analyze set-log-level - LEVEL changes the - current log level of the systemd - daemon to LEVEL (accepts - the same values as --log-level= - described in - systemd(1)).

systemd-analyze verify will - load unit files and print warnings if any errors are - detected. Files specified on the command line will be - loaded, but also any other units referenced by - them. This command works by prepending the directories - for all command line arguments at the beginning of the - unit load path, which means that all units files found - in those directories will be used in preference to the - unit files found in the standard locations, even if - not listed explicitly.

If no command is passed, systemd-analyze - time is implied.

Options¶

The following options are understood:

--user¶

Operates on the user - systemd instance.

--system¶

Operates on the system - systemd instance. This is the implied - default.

--order, --require¶

When used in - conjunction with the - dot command (see - above), selects which dependencies are - shown in the dependency graph. If - --order is passed, - only dependencies of type - After= or - Before= are - shown. If --require - is passed, only dependencies of type - Requires=, - RequiresOverridable=, - Requisite=, - RequisiteOverridable=, - Wants= and - Conflicts= are - shown. If neither is passed, this shows - dependencies of all these - types.

--from-pattern=, --to-pattern=¶

When used in - conjunction with the - dot command (see - above), this selects which relationships - are shown in the dependency graph. - They both require - glob(7) - patterns as arguments, which are - matched against left-hand and - right-hand, respectively, nodes of a - relationship. Each of these can be - used more than once, which means a - unit name must match one of the given - values.

--fuzz=timespan¶

When used in conjunction - with the critical-chain - command (see above), also show units, which - finished timespan earlier, than the - latest unit in the same level. The unit of - timespan is seconds - unless specified with a different unit, - e.g. "50ms".

--no-man¶

Do not invoke man to verify the existence - of man pages listen in Documentation=. -

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

systemd-analyze — Analyze system boot-up performance

Synopsis

systemd-analyze [OPTIONS...] [time]

systemd-analyze [OPTIONS...] blame

systemd-analyze [OPTIONS...] critical-chain [UNIT...]

systemd-analyze [OPTIONS...] plot [> file.svg]

systemd-analyze [OPTIONS...] dot [PATTERN...] [> file.dot]

systemd-analyze [OPTIONS...] dump

systemd-analyze [OPTIONS...] set-log-level [LEVEL]

systemd-analyze [OPTIONS...] verify [FILES...]

Description¶

systemd-analyze may be used to determine + system boot-up performance statistics and retrieve other state and + tracing information from the system and service manager, and to + verify the correctness of unit files.

systemd-analyze time prints the time + spent in the kernel before userspace has been reached, the time + spent in the initial RAM disk (initrd) before normal system + userspace has been reached, and the time normal system userspace + took to initialize. Note that these measurements simply measure + the time passed up to the point where all system services have + been spawned, but not necessarily until they fully finished + initialization or the disk is idle.

systemd-analyze blame prints a list of + all running units, ordered by the time they took to initialize. + This information may be used to optimize boot-up times. Note that + the output might be misleading as the initialization of one + service might be slow simply because it waits for the + initialization of another service to complete.

systemd-analyze critical-chain + [UNIT...] prints a tree of + the time-critical chain of units (for each of the specified + UNITs or for the default target + otherwise). The time after the unit is active or started is + printed after the "@" character. The time the unit takes to start + is printed after the "+" character. Note that the output might be + misleading as the initialization of one service might depend on + socket activation and because of the parallel execution of + units.

systemd-analyze plot prints an SVG + graphic detailing which system services have been started at what + time, highlighting the time they spent on initialization.

systemd-analyze dot generates textual + dependency graph description in dot format for further processing + with the GraphViz + dot(1) + tool. Use a command line like systemd-analyze dot | dot + -Tsvg > systemd.svg to generate a graphical dependency + tree. Unless --order or + --require is passed, the generated graph will + show both ordering and requirement dependencies. Optional pattern + globbing style specifications (e.g. *.target) + may be given at the end. A unit dependency is included in the + graph if any of these patterns match either the origin or + destination node.

systemd-analyze dump outputs a (usually + very long) human-readable serialization of the complete server + state. Its format is subject to change without notice and should + not be parsed by applications.

systemd-analyze set-log-level + LEVEL changes the current log + level of the systemd daemon to + LEVEL (accepts the same values as + --log-level= described in + systemd(1)).

systemd-analyze verify will load unit + files and print warnings if any errors are detected. Files + specified on the command line will be loaded, but also any other + units referenced by them. This command works by prepending the + directories for all command line arguments at the beginning of the + unit load path, which means that all units files found in those + directories will be used in preference to the unit files found in + the standard locations, even if not listed explicitly.

If no command is passed, systemd-analyze + time is implied.

Options¶

The following options are understood:

--user¶

Operates on the user systemd + instance.

--system¶

Operates on the system systemd instance. This + is the implied default.

--order, --require¶

When used in conjunction with the + dot command (see above), selects which + dependencies are shown in the dependency graph. If + --order is passed, only dependencies of type + After= or Before= are + shown. If --require is passed, only + dependencies of type Requires=, + RequiresOverridable=, + Requisite=, + RequisiteOverridable=, + Wants= and Conflicts= + are shown. If neither is passed, this shows dependencies of + all these types.

--from-pattern=, --to-pattern=¶

When used in conjunction with the + dot command (see above), this selects which + relationships are shown in the dependency graph. Both options + require a + glob(7) + pattern as an argument, which will be matched against the + left-hand and the right-hand, respectively, nodes of a + relationship.

Each of these can be used more than once, in which case + the unit name must match one of the values. When tests for + both sides of the relation are present, a relation must pass + both tests to be shown. When patterns are also specified as + positional arguments, they must match at least one side of the + relation. In other words, patterns specified with those two + options will trim the list of edges matched by the positional + arguments, if any are given, and fully determine the list of + edges shown otherwise.

--fuzz=timespan¶

When used in conjunction with the + critical-chain command (see above), also + show units, which finished timespan + earlier, than the latest unit in the same level. The unit of + timespan is seconds unless + specified with a different unit, e.g. + "50ms".

--no-man¶

Do not invoke man to verify the existence of + man pages listed in Documentation=. +

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -139,19 +120,17 @@ machinectl -H HOST.

-M, --machine=¶

Execute operation on a local container. Specify a container name to connect to.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Examples for dot¶

Example 1. Plots all dependencies of any unit whose - name starts with "avahi-daemon"

$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
-                        $ eog avahi.svg

Example 2. Plots the dependencies between all known target units

systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
-$ eog targets.svg

Examples for verify¶

The following errors are currently detected:

  • unknown sections and - directives,

  • missing dependencies which are - required to start the given unit, -

  • man pages listed in - Documentation= which are - not found in the system,

  • commands listed in - ExecStart= and similar - which are not found in the system or not - executable.

Example 3. Misspelt directives

$ cat ./user.slice
+    

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

Examples for dot¶

Example 1. Plots all dependencies of any unit whose name starts with + "avahi-daemon"

$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
+      $ eog avahi.svg

Example 2. Plots the dependencies between all known target units

systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
+$ eog targets.svg

Examples for verify¶

The following errors are currently detected:

  • unknown sections and directives, +

  • missing dependencies which are required to start + the given unit,

  • man pages listed in + Documentation= which are not found in the + system,

  • commands listed in ExecStart= + and similar which are not found in the system or not + executable.

Example 3. Misspelt directives

$ cat ./user.slice
 [Unit]
 WhatIsThis=11
 Documentation=man:nosuchfile(1)
@@ -160,15 +139,15 @@ Requires=different.service
 [Service]
 Desription=x
 
-$ systemd-verify ./user.slice
+$ systemd-analyze verify ./user.slice
 [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'
 [./user.slice:13] Unknown section 'Service'. Ignoring.
 Error: org.freedesktop.systemd1.LoadFailed:
-         Unit different.service failed to load:
-         No such file or directory.
+   Unit different.service failed to load:
+   No such file or directory.
 Failed to create user.slice/start: Invalid argument
 user.slice: man nosuchfile(1) command failed with code 16
-                        

Example 4. Missing service units

$ tail ./a.socket ./b.socket
+      

Example 4. Missing service units

$ tail ./a.socket ./b.socket
 ==> ./a.socket <==
 [Socket]
 ListenStream=100
@@ -178,10 +157,10 @@ ListenStream=100
 ListenStream=100
 Accept=yes
 
-$ systemd-verify ./a.socket ./b.socket
+$ systemd-analyze verify ./a.socket ./b.socket
 Service a.service not loaded, a.socket cannot be started.
 Service b@0.service not loaded, b.socket cannot be started.
-                        

Environment¶

$SYSTEMD_PAGER¶

Pager to use when +


Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -189,7 +168,7 @@ Service b@0.service not loaded, b.socket cannot be started. --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

See Also¶

- systemd(1), - systemctl(1) -

+ ("FRSXMK").

See Also¶

+ systemd(1), + systemctl(1) +

diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml index 073e807b4..1ff81d3d5 100644 --- a/man/systemd-analyze.xml +++ b/man/systemd-analyze.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-analyze - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - Developer - Harald - Hoyer - harald@redhat.com - - - - - - systemd-analyze - 1 - - - - systemd-analyze - Analyze system boot-up performance - - - - - systemd-analyze - OPTIONS - time - - - systemd-analyze - OPTIONS - blame - - - systemd-analyze - OPTIONS - critical-chain - UNIT - - - systemd-analyze - OPTIONS - plot - > file.svg - - - systemd-analyze - OPTIONS - dot - PATTERN - > file.dot - - - systemd-analyze - OPTIONS - dump - - - systemd-analyze - OPTIONS - set-log-level - LEVEL - - - systemd-analyze - OPTIONS - verify - FILES - - - - - Description - - systemd-analyze may be used - to determine system boot-up performance statistics and - retrieve other state and tracing information from the - system and service manager, and to verify the - correctness of unit files. - - systemd-analyze time - prints the time spent in the kernel before - userspace has been reached, the time spent in the - initial RAM disk (initrd) before normal system - userspace has been reached, and the time normal system - userspace took to initialize. Note that these - measurements simply measure the time passed up to the - point where all system services have been spawned, but - not necessarily until they fully finished - initialization or the disk is idle. - - systemd-analyze blame prints - a list of all running units, ordered by the time they - took to initialize. This information may be used to - optimize boot-up times. Note that the output might be - misleading as the initialization of one service might - be slow simply because it waits for the initialization - of another service to complete. - - systemd-analyze critical-chain [UNIT...] - prints a tree of the time-critical chain of units - (for each of the specified UNITs - or for the default target otherwise). - The time after the unit is active or started is printed - after the "@" character. The time the unit takes to - start is printed after the "+" character. - Note that the output might be misleading as the - initialization of one service might depend on socket - activation and because of the parallel execution - of units. - - systemd-analyze plot prints - an SVG graphic detailing which system services have - been started at what time, highlighting the time they - spent on initialization. - - systemd-analyze dot generates - textual dependency graph description in dot format for - further processing with the GraphViz - dot1 - tool. Use a command line like systemd-analyze - dot | dot -Tsvg > systemd.svg to generate a - graphical dependency tree. Unless - or - is passed, the generated graph will show both ordering - and requirement dependencies. Optional pattern - globbing style specifications - (e.g. *.target) may be given at - the end. A unit dependency is included in the graph if - any of these patterns match either the origin or - destination node. - - systemd-analyze dump outputs - a (usually very long) human-readable serialization of - the complete server state. Its format is subject to - change without notice and should not be parsed by - applications. - - systemd-analyze set-log-level - LEVEL changes the - current log level of the systemd - daemon to LEVEL (accepts - the same values as - described in - systemd1). - - systemd-analyze verify will - load unit files and print warnings if any errors are - detected. Files specified on the command line will be - loaded, but also any other units referenced by - them. This command works by prepending the directories - for all command line arguments at the beginning of the - unit load path, which means that all units files found - in those directories will be used in preference to the - unit files found in the standard locations, even if - not listed explicitly. - - If no command is passed, systemd-analyze - time is implied. - - - - - Options - - The following options are understood: - - - - - - Operates on the user - systemd instance. - - - - - - Operates on the system - systemd instance. This is the implied - default. - - - - - - - When used in - conjunction with the - dot command (see - above), selects which dependencies are - shown in the dependency graph. If - is passed, - only dependencies of type - After= or - Before= are - shown. If - is passed, only dependencies of type - Requires=, - RequiresOverridable=, - Requisite=, - RequisiteOverridable=, - Wants= and - Conflicts= are - shown. If neither is passed, this shows - dependencies of all these - types. - - - - - - - When used in - conjunction with the - dot command (see - above), this selects which relationships - are shown in the dependency graph. - They both require - glob7 - patterns as arguments, which are - matched against left-hand and - right-hand, respectively, nodes of a - relationship. Each of these can be - used more than once, which means a - unit name must match one of the given - values. - - - - timespan - - When used in conjunction - with the critical-chain - command (see above), also show units, which - finished timespan earlier, than the - latest unit in the same level. The unit of - timespan is seconds - unless specified with a different unit, - e.g. "50ms". - - - - - - Do not invoke man to verify the existence - of man pages listen in Documentation=. - - - - - - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - Examples for <command>dot</command> - - - Plots all dependencies of any unit whose - name starts with <literal>avahi-daemon</literal> - - $ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg - $ eog avahi.svg - - - - Plots the dependencies between all known target units - - systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-analyze + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + Developer + Harald + Hoyer + harald@redhat.com + + + + + + systemd-analyze + 1 + + + + systemd-analyze + Analyze system boot-up performance + + + + + systemd-analyze + OPTIONS + time + + + systemd-analyze + OPTIONS + blame + + + systemd-analyze + OPTIONS + critical-chain + UNIT + + + systemd-analyze + OPTIONS + plot + > file.svg + + + systemd-analyze + OPTIONS + dot + PATTERN + > file.dot + + + systemd-analyze + OPTIONS + dump + + + systemd-analyze + OPTIONS + set-log-level + LEVEL + + + systemd-analyze + OPTIONS + verify + FILES + + + + + Description + + systemd-analyze may be used to determine + system boot-up performance statistics and retrieve other state and + tracing information from the system and service manager, and to + verify the correctness of unit files. + + systemd-analyze time prints the time + spent in the kernel before userspace has been reached, the time + spent in the initial RAM disk (initrd) before normal system + userspace has been reached, and the time normal system userspace + took to initialize. Note that these measurements simply measure + the time passed up to the point where all system services have + been spawned, but not necessarily until they fully finished + initialization or the disk is idle. + + systemd-analyze blame prints a list of + all running units, ordered by the time they took to initialize. + This information may be used to optimize boot-up times. Note that + the output might be misleading as the initialization of one + service might be slow simply because it waits for the + initialization of another service to complete. + + systemd-analyze critical-chain + [UNIT...] prints a tree of + the time-critical chain of units (for each of the specified + UNITs or for the default target + otherwise). The time after the unit is active or started is + printed after the "@" character. The time the unit takes to start + is printed after the "+" character. Note that the output might be + misleading as the initialization of one service might depend on + socket activation and because of the parallel execution of + units. + + systemd-analyze plot prints an SVG + graphic detailing which system services have been started at what + time, highlighting the time they spent on initialization. + + systemd-analyze dot generates textual + dependency graph description in dot format for further processing + with the GraphViz + dot1 + tool. Use a command line like systemd-analyze dot | dot + -Tsvg > systemd.svg to generate a graphical dependency + tree. Unless or + is passed, the generated graph will + show both ordering and requirement dependencies. Optional pattern + globbing style specifications (e.g. *.target) + may be given at the end. A unit dependency is included in the + graph if any of these patterns match either the origin or + destination node. + + systemd-analyze dump outputs a (usually + very long) human-readable serialization of the complete server + state. Its format is subject to change without notice and should + not be parsed by applications. + + systemd-analyze set-log-level + LEVEL changes the current log + level of the systemd daemon to + LEVEL (accepts the same values as + described in + systemd1). + + systemd-analyze verify will load unit + files and print warnings if any errors are detected. Files + specified on the command line will be loaded, but also any other + units referenced by them. This command works by prepending the + directories for all command line arguments at the beginning of the + unit load path, which means that all units files found in those + directories will be used in preference to the unit files found in + the standard locations, even if not listed explicitly. + + If no command is passed, systemd-analyze + time is implied. + + + + + Options + + The following options are understood: + + + + + + Operates on the user systemd + instance. + + + + + + Operates on the system systemd instance. This + is the implied default. + + + + + + + When used in conjunction with the + dot command (see above), selects which + dependencies are shown in the dependency graph. If + is passed, only dependencies of type + After= or Before= are + shown. If is passed, only + dependencies of type Requires=, + RequiresOverridable=, + Requisite=, + RequisiteOverridable=, + Wants= and Conflicts= + are shown. If neither is passed, this shows dependencies of + all these types. + + + + + + + When used in conjunction with the + dot command (see above), this selects which + relationships are shown in the dependency graph. Both options + require a + glob7 + pattern as an argument, which will be matched against the + left-hand and the right-hand, respectively, nodes of a + relationship. + + Each of these can be used more than once, in which case + the unit name must match one of the values. When tests for + both sides of the relation are present, a relation must pass + both tests to be shown. When patterns are also specified as + positional arguments, they must match at least one side of the + relation. In other words, patterns specified with those two + options will trim the list of edges matched by the positional + arguments, if any are given, and fully determine the list of + edges shown otherwise. + + + + timespan + + When used in conjunction with the + critical-chain command (see above), also + show units, which finished timespan + earlier, than the latest unit in the same level. The unit of + timespan is seconds unless + specified with a different unit, e.g. + "50ms". + + + + + + Do not invoke man to verify the existence of + man pages listed in Documentation=. + + + + + + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + Examples for <command>dot</command> + + + Plots all dependencies of any unit whose name starts with + <literal>avahi-daemon</literal> + + $ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg + $ eog avahi.svg + + + + Plots the dependencies between all known target units + + systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg $ eog targets.svg - - + + - - Examples for <command>verify</command> + + Examples for <command>verify</command> - The following errors are currently detected: - - unknown sections and - directives, + The following errors are currently detected: + + unknown sections and directives, + - missing dependencies which are - required to start the given unit, - + missing dependencies which are required to start + the given unit, - man pages listed in - Documentation= which are - not found in the system, + man pages listed in + Documentation= which are not found in the + system, - commands listed in - ExecStart= and similar - which are not found in the system or not - executable. - + commands listed in ExecStart= + and similar which are not found in the system or not + executable. + - - Misspelt directives + + Misspelt directives - $ cat ./user.slice + $ cat ./user.slice [Unit] WhatIsThis=11 Documentation=man:nosuchfile(1) @@ -352,21 +333,21 @@ Requires=different.service [Service] Desription=x -$ systemd-verify ./user.slice +$ systemd-analyze verify ./user.slice [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit' [./user.slice:13] Unknown section 'Service'. Ignoring. Error: org.freedesktop.systemd1.LoadFailed: - Unit different.service failed to load: - No such file or directory. + Unit different.service failed to load: + No such file or directory. Failed to create user.slice/start: Invalid argument user.slice: man nosuchfile(1) command failed with code 16 - - + + - - Missing service units + + Missing service units - $ tail ./a.socket ./b.socket + $ tail ./a.socket ./b.socket ==> ./a.socket <== [Socket] ListenStream=100 @@ -376,21 +357,21 @@ ListenStream=100 ListenStream=100 Accept=yes -$ systemd-verify ./a.socket ./b.socket +$ systemd-analyze verify ./a.socket ./b.socket Service a.service not loaded, a.socket cannot be started. Service b@0.service not loaded, b.socket cannot be started. - - - - - - - - See Also - - systemd1, - systemctl1 - - + + + + + + + + See Also + + systemd1, + systemctl1 + + diff --git a/man/systemd-ask-password-console.path.html b/man/systemd-ask-password-console.path.html index a0f661da1..57a1f0989 100644 --- a/man/systemd-ask-password-console.path.html +++ b/man/systemd-ask-password-console.path.html @@ -19,26 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the - console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service - is a system service that queries the user for system - passwords (such as hard disk encryption keys and SSL - certificate passphrases) on the console. It is - intended to be used during boot to ensure proper - handling of passwords necessary for - boot. systemd-ask-password-wall.service - is a system service that informs all logged in users - for system passwords via - wall(1). It - is intended to be used after boot to ensure that users - are properly notified.

See the - developer documentation for more information - about the system password logic.

Note that these services invoke - systemd-tty-ask-password-agent(1) - with either the --watch --console - or --watch --wall command line - parameters.

+ gudev systemd 219

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the + console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service is + a system service that queries the user for system passwords (such + as hard disk encryption keys and SSL certificate passphrases) on + the console. It is intended to be used during boot to ensure + proper handling of passwords necessary for boot. + systemd-ask-password-wall.service is a system + service that informs all logged in users for system passwords via + wall(1). + It is intended to be used after boot to ensure that users are + properly notified.

See the + developer documentation for more information about the + system password logic.

Note that these services invoke + systemd-tty-ask-password-agent(1) + with either the --watch --console or + --watch --wall command line parameters.

diff --git a/man/systemd-ask-password-console.service.8 b/man/systemd-ask-password-console.service.8 index 8bc27fcc3..0017bb431 100644 --- a/man/systemd-ask-password-console.service.8 +++ b/man/systemd-ask-password-console.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-ASK\-PASSWORD\-CONSOLE\&.SERVICE" "8" "" "systemd 218" "systemd-ask-password-console.service" +.TH "SYSTEMD\-ASK\-PASSWORD\-CONSOLE\&.SERVICE" "8" "" "systemd 219" "systemd-ask-password-console.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-ask-password-console.service.html b/man/systemd-ask-password-console.service.html index a0f661da1..57a1f0989 100644 --- a/man/systemd-ask-password-console.service.html +++ b/man/systemd-ask-password-console.service.html @@ -19,26 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the - console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service - is a system service that queries the user for system - passwords (such as hard disk encryption keys and SSL - certificate passphrases) on the console. It is - intended to be used during boot to ensure proper - handling of passwords necessary for - boot. systemd-ask-password-wall.service - is a system service that informs all logged in users - for system passwords via - wall(1). It - is intended to be used after boot to ensure that users - are properly notified.

See the - developer documentation for more information - about the system password logic.

Note that these services invoke - systemd-tty-ask-password-agent(1) - with either the --watch --console - or --watch --wall command line - parameters.

+ gudev systemd 219

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the + console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service is + a system service that queries the user for system passwords (such + as hard disk encryption keys and SSL certificate passphrases) on + the console. It is intended to be used during boot to ensure + proper handling of passwords necessary for boot. + systemd-ask-password-wall.service is a system + service that informs all logged in users for system passwords via + wall(1). + It is intended to be used after boot to ensure that users are + properly notified.

See the + developer documentation for more information about the + system password logic.

Note that these services invoke + systemd-tty-ask-password-agent(1) + with either the --watch --console or + --watch --wall command line parameters.

diff --git a/man/systemd-ask-password-console.service.xml b/man/systemd-ask-password-console.service.xml index 536dad9c6..479e5f2e5 100644 --- a/man/systemd-ask-password-console.service.xml +++ b/man/systemd-ask-password-console.service.xml @@ -21,76 +21,73 @@ --> - - systemd-ask-password-console.service - systemd + + systemd-ask-password-console.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-ask-password-console.service - 8 - + + systemd-ask-password-console.service + 8 + - - systemd-ask-password-console.service - systemd-ask-password-console.path - systemd-ask-password-wall.service - systemd-ask-password-wall.path - Query the user for system passwords on the - console and via wall - + + systemd-ask-password-console.service + systemd-ask-password-console.path + systemd-ask-password-wall.service + systemd-ask-password-wall.path + Query the user for system passwords on the + console and via wall + - - systemd-ask-password-console.service - systemd-ask-password-console.path - systemd-ask-password-wall.service - systemd-ask-password-wall.path - + + systemd-ask-password-console.service + systemd-ask-password-console.path + systemd-ask-password-wall.service + systemd-ask-password-wall.path + - - Description + + Description - systemd-ask-password-console.service - is a system service that queries the user for system - passwords (such as hard disk encryption keys and SSL - certificate passphrases) on the console. It is - intended to be used during boot to ensure proper - handling of passwords necessary for - boot. systemd-ask-password-wall.service - is a system service that informs all logged in users - for system passwords via - wall1. It - is intended to be used after boot to ensure that users - are properly notified. + systemd-ask-password-console.service is + a system service that queries the user for system passwords (such + as hard disk encryption keys and SSL certificate passphrases) on + the console. It is intended to be used during boot to ensure + proper handling of passwords necessary for boot. + systemd-ask-password-wall.service is a system + service that informs all logged in users for system passwords via + wall1. + It is intended to be used after boot to ensure that users are + properly notified. - See the - developer documentation for more information - about the system password logic. + See the + developer documentation for more information about the + system password logic. - Note that these services invoke - systemd-tty-ask-password-agent1 - with either the --watch --console - or --watch --wall command line - parameters. - + Note that these services invoke + systemd-tty-ask-password-agent1 + with either the --watch --console or + --watch --wall command line parameters. + - - See Also - - systemd1, - systemd-tty-ask-password-agent1, - wall1 - - + + See Also + + systemd1, + systemd-tty-ask-password-agent1, + wall1 + + diff --git a/man/systemd-ask-password-wall.path.html b/man/systemd-ask-password-wall.path.html index a0f661da1..57a1f0989 100644 --- a/man/systemd-ask-password-wall.path.html +++ b/man/systemd-ask-password-wall.path.html @@ -19,26 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the - console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service - is a system service that queries the user for system - passwords (such as hard disk encryption keys and SSL - certificate passphrases) on the console. It is - intended to be used during boot to ensure proper - handling of passwords necessary for - boot. systemd-ask-password-wall.service - is a system service that informs all logged in users - for system passwords via - wall(1). It - is intended to be used after boot to ensure that users - are properly notified.

See the - developer documentation for more information - about the system password logic.

Note that these services invoke - systemd-tty-ask-password-agent(1) - with either the --watch --console - or --watch --wall command line - parameters.

+ gudev systemd 219

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the + console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service is + a system service that queries the user for system passwords (such + as hard disk encryption keys and SSL certificate passphrases) on + the console. It is intended to be used during boot to ensure + proper handling of passwords necessary for boot. + systemd-ask-password-wall.service is a system + service that informs all logged in users for system passwords via + wall(1). + It is intended to be used after boot to ensure that users are + properly notified.

See the + developer documentation for more information about the + system password logic.

Note that these services invoke + systemd-tty-ask-password-agent(1) + with either the --watch --console or + --watch --wall command line parameters.

diff --git a/man/systemd-ask-password-wall.service.html b/man/systemd-ask-password-wall.service.html index a0f661da1..57a1f0989 100644 --- a/man/systemd-ask-password-wall.service.html +++ b/man/systemd-ask-password-wall.service.html @@ -19,26 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the - console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service - is a system service that queries the user for system - passwords (such as hard disk encryption keys and SSL - certificate passphrases) on the console. It is - intended to be used during boot to ensure proper - handling of passwords necessary for - boot. systemd-ask-password-wall.service - is a system service that informs all logged in users - for system passwords via - wall(1). It - is intended to be used after boot to ensure that users - are properly notified.

See the - developer documentation for more information - about the system password logic.

Note that these services invoke - systemd-tty-ask-password-agent(1) - with either the --watch --console - or --watch --wall command line - parameters.

+ gudev systemd 219

Name

systemd-ask-password-console.service, systemd-ask-password-console.path, systemd-ask-password-wall.service, systemd-ask-password-wall.path — Query the user for system passwords on the + console and via wall

Synopsis

systemd-ask-password-console.service

systemd-ask-password-console.path

systemd-ask-password-wall.service

systemd-ask-password-wall.path

Description¶

systemd-ask-password-console.service is + a system service that queries the user for system passwords (such + as hard disk encryption keys and SSL certificate passphrases) on + the console. It is intended to be used during boot to ensure + proper handling of passwords necessary for boot. + systemd-ask-password-wall.service is a system + service that informs all logged in users for system passwords via + wall(1). + It is intended to be used after boot to ensure that users are + properly notified.

See the + developer documentation for more information about the + system password logic.

Note that these services invoke + systemd-tty-ask-password-agent(1) + with either the --watch --console or + --watch --wall command line parameters.

diff --git a/man/systemd-ask-password.1 b/man/systemd-ask-password.1 index 8a2d306dd..dcda32940 100644 --- a/man/systemd-ask-password.1 +++ b/man/systemd-ask-password.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-ASK\-PASSWORD" "1" "" "systemd 218" "systemd-ask-password" +.TH "SYSTEMD\-ASK\-PASSWORD" "1" "" "systemd 219" "systemd-ask-password" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-ask-password.html b/man/systemd-ask-password.html index 68813b382..8353248fd 100644 --- a/man/systemd-ask-password.html +++ b/man/systemd-ask-password.html @@ -19,63 +19,47 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-ask-password — Query the user for a system password

Synopsis

systemd-ask-password [OPTIONS...] [MESSAGE]

Description¶

systemd-ask-password may be - used to query a system password or passphrase from the - user, using a question message specified on the - command line. When run from a TTY it will query a - password on the TTY and print it to standard output. When run - with no TTY or with --no-tty it will - query the password system-wide and allow active users - to respond via several agents. The latter is - only available to privileged processes.

The purpose of this tool is to query system-wide - passwords -- that is passwords not attached to a - specific user account. Examples include: unlocking - encrypted hard disks when they are plugged in or at - boot, entering an SSL certificate passphrase for web - and VPN servers.

Existing agents are: a boot-time password agent - asking the user for passwords using Plymouth; a - boot-time password agent querying the user directly on - the console; an agent requesting password input via a - wall(1) - message; an agent suitable for running in a GNOME - session; a command line agent which can be started - temporarily to process queued password requests; a TTY - agent that is temporarily spawned during - systemctl(1) - invocations.

Additional password agents may be implemented - according to the systemd - Password Agent Specification.

If a password is queried on a TTY, the user may - press TAB to hide the asterisks normally shown for - each character typed. Pressing Backspace as first key - achieves the same effect.

Options¶

The following options are understood:

--icon=¶

Specify an icon name - alongside the password query, which may - be used in all agents supporting - graphical display. The icon name - should follow the XDG - Icon Naming - Specification.

--timeout=¶

Specify the query - timeout in seconds. Defaults to - 90s. A timeout of 0 waits indefinitely. -

--echo¶

Echo the user input - instead of masking it. This is useful - when using - systemd-ask-password - to query for usernames. -

--no-tty¶

Never ask for password - on current TTY even if one is - available. Always use agent - system.

--accept-cached¶

If passed, accept - cached passwords, i.e. passwords - previously typed in.

--multiple¶

When used in - conjunction with - --accept-cached - accept multiple passwords. This will - output one password per - line.

-h, --help¶

Print a short help text and exit. -

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-ask-password — Query the user for a system password

Synopsis

systemd-ask-password [OPTIONS...] [MESSAGE]

Description¶

systemd-ask-password may be used to query + a system password or passphrase from the user, using a question + message specified on the command line. When run from a TTY it will + query a password on the TTY and print it to standard output. When + run with no TTY or with --no-tty it will query + the password system-wide and allow active users to respond via + several agents. The latter is only available to privileged + processes.

The purpose of this tool is to query system-wide passwords + -- that is passwords not attached to a specific user account. + Examples include: unlocking encrypted hard disks when they are + plugged in or at boot, entering an SSL certificate passphrase for + web and VPN servers.

Existing agents are: a boot-time password agent asking the + user for passwords using Plymouth; a boot-time password agent + querying the user directly on the console; an agent requesting + password input via a + wall(1) + message; an agent suitable for running in a GNOME session; a + command line agent which can be started temporarily to process + queued password requests; a TTY agent that is temporarily spawned + during + systemctl(1) + invocations.

Additional password agents may be implemented according to + the systemd + Password Agent Specification.

If a password is queried on a TTY, the user may press TAB to + hide the asterisks normally shown for each character typed. + Pressing Backspace as first key achieves the same effect.

Options¶

The following options are understood:

--icon=¶

Specify an icon name alongside the password + query, which may be used in all agents supporting graphical + display. The icon name should follow the XDG + Icon Naming Specification.

--timeout=¶

Specify the query timeout in seconds. Defaults + to 90s. A timeout of 0 waits indefinitely.

--echo¶

Echo the user input instead of masking it. + This is useful when using + systemd-ask-password to query for + usernames.

--no-tty¶

Never ask for password on current TTY even if + one is available. Always use agent system.

--accept-cached¶

If passed, accept cached passwords, i.e. + passwords previously typed in.

--multiple¶

When used in conjunction with + --accept-cached accept multiple passwords. + This will output one password per line.

-h, --help¶

Print a short help text and exit. +

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-ask-password.xml b/man/systemd-ask-password.xml index 448df6210..877c71af5 100644 --- a/man/systemd-ask-password.xml +++ b/man/systemd-ask-password.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-ask-password - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-ask-password - 1 - - - - systemd-ask-password - Query the user for a system password - - - - - systemd-ask-password OPTIONS MESSAGE - - - - - Description - - systemd-ask-password may be - used to query a system password or passphrase from the - user, using a question message specified on the - command line. When run from a TTY it will query a - password on the TTY and print it to standard output. When run - with no TTY or with it will - query the password system-wide and allow active users - to respond via several agents. The latter is - only available to privileged processes. - - The purpose of this tool is to query system-wide - passwords -- that is passwords not attached to a - specific user account. Examples include: unlocking - encrypted hard disks when they are plugged in or at - boot, entering an SSL certificate passphrase for web - and VPN servers. - - Existing agents are: a boot-time password agent - asking the user for passwords using Plymouth; a - boot-time password agent querying the user directly on - the console; an agent requesting password input via a - wall1 - message; an agent suitable for running in a GNOME - session; a command line agent which can be started - temporarily to process queued password requests; a TTY - agent that is temporarily spawned during - systemctl1 - invocations. - - Additional password agents may be implemented - according to the systemd - Password Agent Specification. - - If a password is queried on a TTY, the user may - press TAB to hide the asterisks normally shown for - each character typed. Pressing Backspace as first key - achieves the same effect. - - - - - Options - - The following options are understood: - - - - - - Specify an icon name - alongside the password query, which may - be used in all agents supporting - graphical display. The icon name - should follow the XDG - Icon Naming - Specification. - - - - - - Specify the query - timeout in seconds. Defaults to - 90s. A timeout of 0 waits indefinitely. - - - - - - - Echo the user input - instead of masking it. This is useful - when using - systemd-ask-password - to query for usernames. - - - - - - - Never ask for password - on current TTY even if one is - available. Always use agent - system. - - - - - - If passed, accept - cached passwords, i.e. passwords - previously typed in. - - - - - - When used in - conjunction with - - accept multiple passwords. This will - output one password per - line. - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - plymouth8, - wall1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-ask-password + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-ask-password + 1 + + + + systemd-ask-password + Query the user for a system password + + + + + systemd-ask-password OPTIONS MESSAGE + + + + + Description + + systemd-ask-password may be used to query + a system password or passphrase from the user, using a question + message specified on the command line. When run from a TTY it will + query a password on the TTY and print it to standard output. When + run with no TTY or with it will query + the password system-wide and allow active users to respond via + several agents. The latter is only available to privileged + processes. + + The purpose of this tool is to query system-wide passwords + -- that is passwords not attached to a specific user account. + Examples include: unlocking encrypted hard disks when they are + plugged in or at boot, entering an SSL certificate passphrase for + web and VPN servers. + + Existing agents are: a boot-time password agent asking the + user for passwords using Plymouth; a boot-time password agent + querying the user directly on the console; an agent requesting + password input via a + wall1 + message; an agent suitable for running in a GNOME session; a + command line agent which can be started temporarily to process + queued password requests; a TTY agent that is temporarily spawned + during + systemctl1 + invocations. + + Additional password agents may be implemented according to + the systemd + Password Agent Specification. + + If a password is queried on a TTY, the user may press TAB to + hide the asterisks normally shown for each character typed. + Pressing Backspace as first key achieves the same effect. + + + + + Options + + The following options are understood: + + + + + + Specify an icon name alongside the password + query, which may be used in all agents supporting graphical + display. The icon name should follow the XDG + Icon Naming Specification. + + + + + + Specify the query timeout in seconds. Defaults + to 90s. A timeout of 0 waits indefinitely. + + + + + + Echo the user input instead of masking it. + This is useful when using + systemd-ask-password to query for + usernames. + + + + + + Never ask for password on current TTY even if + one is available. Always use agent system. + + + + + + If passed, accept cached passwords, i.e. + passwords previously typed in. + + + + + + When used in conjunction with + accept multiple passwords. + This will output one password per line. + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemctl1, + plymouth8, + wall1 + + diff --git a/man/systemd-backlight.html b/man/systemd-backlight.html index ca4e0ed54..ce66c5c26 100644 --- a/man/systemd-backlight.html +++ b/man/systemd-backlight.html @@ -19,17 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-backlight@.service, systemd-backlight — Load and save the display backlight brightness at boot and shutdown

Synopsis

systemd-backlight@.service

/usr/lib/systemd/systemd-backlight

Description¶

systemd-backlight@.service - is a service that restores the display backlight - brightness at early boot and saves it at shutdown. On - disk, the backlight brightness is stored in - /var/lib/systemd/backlight/.

Kernel Command Line¶

systemd-backlight understands - the following kernel command line parameter:

systemd.restore_state=¶

Takes a boolean - argument. Defaults to - "1". If - "0", does not restore - the backlight settings on boot. However, - settings will still be stored on shutdown. -

See Also¶

- systemd(1) -

+ gudev systemd 219

Name

systemd-backlight@.service, systemd-backlight — Load and save the display backlight brightness at boot and shutdown

Synopsis

systemd-backlight@.service

/usr/lib/systemd/systemd-backlight

Description¶

systemd-backlight@.service is a service + that restores the display backlight brightness at early boot and + saves it at shutdown. On disk, the backlight brightness is stored + in /var/lib/systemd/backlight/. During + loading, if udev property ID_BACKLIGHT_CLAMP is + not set to false value, the brightness is clamped to a value of at + least 1 or 5% of maximum brightness, whichever is greater. This + restriction will be removed when the kernel allows user space to + reliably set a brightness value which does not turn off the + display.

Kernel Command Line¶

systemd-backlight understands the + following kernel command line parameter:

systemd.restore_state=¶

Takes a boolean argument. Defaults to + "1". If "0", does not + restore the backlight settings on boot. However, settings will + still be stored on shutdown.

See Also¶

+ systemd(1) +

diff --git a/man/systemd-backlight@.service.8 b/man/systemd-backlight@.service.8 index 5e94ee71c..9464b6a8c 100644 --- a/man/systemd-backlight@.service.8 +++ b/man/systemd-backlight@.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-BACKLIGHT@\&.SERVICE" "8" "" "systemd 218" "systemd-backlight@.service" +.TH "SYSTEMD\-BACKLIGHT@\&.SERVICE" "8" "" "systemd 219" "systemd-backlight@.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -30,7 +30,9 @@ systemd\-backlight@\&.service .PP systemd\-backlight@\&.service is a service that restores the display backlight brightness at early boot and saves it at shutdown\&. On disk, the backlight brightness is stored in -/var/lib/systemd/backlight/\&. +/var/lib/systemd/backlight/\&. During loading, if udev property +\fBID_BACKLIGHT_CLAMP\fR +is not set to false value, the brightness is clamped to a value of at least 1 or 5% of maximum brightness, whichever is greater\&. This restriction will be removed when the kernel allows user space to reliably set a brightness value which does not turn off the display\&. .SH "KERNEL COMMAND LINE" .PP systemd\-backlight diff --git a/man/systemd-backlight@.service.html b/man/systemd-backlight@.service.html index ca4e0ed54..ce66c5c26 100644 --- a/man/systemd-backlight@.service.html +++ b/man/systemd-backlight@.service.html @@ -19,17 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-backlight@.service, systemd-backlight — Load and save the display backlight brightness at boot and shutdown

Synopsis

systemd-backlight@.service

/usr/lib/systemd/systemd-backlight

Description¶

systemd-backlight@.service - is a service that restores the display backlight - brightness at early boot and saves it at shutdown. On - disk, the backlight brightness is stored in - /var/lib/systemd/backlight/.

Kernel Command Line¶

systemd-backlight understands - the following kernel command line parameter:

systemd.restore_state=¶

Takes a boolean - argument. Defaults to - "1". If - "0", does not restore - the backlight settings on boot. However, - settings will still be stored on shutdown. -

See Also¶

- systemd(1) -

+ gudev systemd 219

Name

systemd-backlight@.service, systemd-backlight — Load and save the display backlight brightness at boot and shutdown

Synopsis

systemd-backlight@.service

/usr/lib/systemd/systemd-backlight

Description¶

systemd-backlight@.service is a service + that restores the display backlight brightness at early boot and + saves it at shutdown. On disk, the backlight brightness is stored + in /var/lib/systemd/backlight/. During + loading, if udev property ID_BACKLIGHT_CLAMP is + not set to false value, the brightness is clamped to a value of at + least 1 or 5% of maximum brightness, whichever is greater. This + restriction will be removed when the kernel allows user space to + reliably set a brightness value which does not turn off the + display.

Kernel Command Line¶

systemd-backlight understands the + following kernel command line parameter:

systemd.restore_state=¶

Takes a boolean argument. Defaults to + "1". If "0", does not + restore the backlight settings on boot. However, settings will + still be stored on shutdown.

See Also¶

+ systemd(1) +

diff --git a/man/systemd-backlight@.service.xml b/man/systemd-backlight@.service.xml index 453afbf1b..a259f5d58 100644 --- a/man/systemd-backlight@.service.xml +++ b/man/systemd-backlight@.service.xml @@ -21,72 +21,74 @@ --> - - systemd-backlight@.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-backlight@.service - 8 - - - - systemd-backlight@.service - systemd-backlight - Load and save the display backlight brightness at boot and shutdown - - - - systemd-backlight@.service - /usr/lib/systemd/systemd-backlight - - - - Description - - systemd-backlight@.service - is a service that restores the display backlight - brightness at early boot and saves it at shutdown. On - disk, the backlight brightness is stored in - /var/lib/systemd/backlight/. - - - - Kernel Command Line - - systemd-backlight understands - the following kernel command line parameter: - - - - systemd.restore_state= - - Takes a boolean - argument. Defaults to - 1. If - 0, does not restore - the backlight settings on boot. However, - settings will still be stored on shutdown. - - - - - - - See Also - - systemd1 - - + + systemd-backlight@.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-backlight@.service + 8 + + + + systemd-backlight@.service + systemd-backlight + Load and save the display backlight brightness at boot and shutdown + + + + systemd-backlight@.service + /usr/lib/systemd/systemd-backlight + + + + Description + + systemd-backlight@.service is a service + that restores the display backlight brightness at early boot and + saves it at shutdown. On disk, the backlight brightness is stored + in /var/lib/systemd/backlight/. During + loading, if udev property is + not set to false value, the brightness is clamped to a value of at + least 1 or 5% of maximum brightness, whichever is greater. This + restriction will be removed when the kernel allows user space to + reliably set a brightness value which does not turn off the + display. + + + + Kernel Command Line + + systemd-backlight understands the + following kernel command line parameter: + + + + systemd.restore_state= + + Takes a boolean argument. Defaults to + 1. If 0, does not + restore the backlight settings on boot. However, settings will + still be stored on shutdown. + + + + + + See Also + + systemd1 + + diff --git a/man/systemd-binfmt.html b/man/systemd-binfmt.html index f770c25f3..ea84f1b65 100644 --- a/man/systemd-binfmt.html +++ b/man/systemd-binfmt.html @@ -19,13 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-binfmt.service, systemd-binfmt — Configure additional binary formats for executables at boot

Synopsis

systemd-binfmt.service

/usr/lib/systemd/systemd-binfmt

Description¶

systemd-binfmt.service is - an early-boot service that registers additional binary - formats for executables in the kernel.

See - binfmt.d(5) - for information about the configuration of this - service.

See Also¶

- systemd(1), - binfmt.d(5), - wine(8) -

+ gudev systemd 219

Name

systemd-binfmt.service, systemd-binfmt — Configure additional binary formats for executables at boot

Synopsis

systemd-binfmt.service

/usr/lib/systemd/systemd-binfmt

Description¶

systemd-binfmt.service is an early-boot + service that registers additional binary formats for executables + in the kernel.

See + binfmt.d(5) + for information about the configuration of this service.

See Also¶

+ systemd(1), + binfmt.d(5), + wine(8) +

diff --git a/man/systemd-binfmt.service.8 b/man/systemd-binfmt.service.8 index 84eaac73e..787d9cae3 100644 --- a/man/systemd-binfmt.service.8 +++ b/man/systemd-binfmt.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-BINFMT\&.SERVICE" "8" "" "systemd 218" "systemd-binfmt.service" +.TH "SYSTEMD\-BINFMT\&.SERVICE" "8" "" "systemd 219" "systemd-binfmt.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-binfmt.service.html b/man/systemd-binfmt.service.html index f770c25f3..ea84f1b65 100644 --- a/man/systemd-binfmt.service.html +++ b/man/systemd-binfmt.service.html @@ -19,13 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-binfmt.service, systemd-binfmt — Configure additional binary formats for executables at boot

Synopsis

systemd-binfmt.service

/usr/lib/systemd/systemd-binfmt

Description¶

systemd-binfmt.service is - an early-boot service that registers additional binary - formats for executables in the kernel.

See - binfmt.d(5) - for information about the configuration of this - service.

See Also¶

- systemd(1), - binfmt.d(5), - wine(8) -

+ gudev systemd 219

Name

systemd-binfmt.service, systemd-binfmt — Configure additional binary formats for executables at boot

Synopsis

systemd-binfmt.service

/usr/lib/systemd/systemd-binfmt

Description¶

systemd-binfmt.service is an early-boot + service that registers additional binary formats for executables + in the kernel.

See + binfmt.d(5) + for information about the configuration of this service.

See Also¶

+ systemd(1), + binfmt.d(5), + wine(8) +

diff --git a/man/systemd-binfmt.service.xml b/man/systemd-binfmt.service.xml index cb9604836..66d264389 100644 --- a/man/systemd-binfmt.service.xml +++ b/man/systemd-binfmt.service.xml @@ -21,56 +21,55 @@ --> - - systemd-binfmt.service - systemd + + systemd-binfmt.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-binfmt.service - 8 - + + systemd-binfmt.service + 8 + - - systemd-binfmt.service - systemd-binfmt - Configure additional binary formats for executables at boot - + + systemd-binfmt.service + systemd-binfmt + Configure additional binary formats for executables at boot + - - systemd-binfmt.service - /usr/lib/systemd/systemd-binfmt - + + systemd-binfmt.service + /usr/lib/systemd/systemd-binfmt + - - Description + + Description - systemd-binfmt.service is - an early-boot service that registers additional binary - formats for executables in the kernel. + systemd-binfmt.service is an early-boot + service that registers additional binary formats for executables + in the kernel. - See - binfmt.d5 - for information about the configuration of this - service. - + See + binfmt.d5 + for information about the configuration of this service. + - - See Also - - systemd1, - binfmt.d5, - wine8 - - + + See Also + + systemd1, + binfmt.d5, + wine8 + + diff --git a/man/systemd-bootchart.1 b/man/systemd-bootchart.1 index 656ad05c2..59cda254d 100644 --- a/man/systemd-bootchart.1 +++ b/man/systemd-bootchart.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-BOOTCHART" "1" "" "systemd 218" "systemd-bootchart" +.TH "SYSTEMD\-BOOTCHART" "1" "" "systemd 219" "systemd-bootchart" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,7 @@ The kernel can invoke instead of the init process\&. In turn, \fBsystemd\-bootchart\fR will invoke -\fB/sbin/init\fR\&. +\fB/usr/lib/systemd/systemd\fR\&. .RE .PP \fIStarted as a standalone program\fR @@ -121,7 +121,7 @@ Specify the output directory for the graphs\&. By default, bootchart writes the \fB\-i\fR, \fB\-\-init \fR\fB\fIpath\fR\fR .RS 4 Use this init binary\&. Defaults to -\fB/sbin/init\fR\&. +\fB/usr/lib/systemd/systemd\fR\&. .RE .PP \fB\-p\fR, \fB\-\-pss\fR diff --git a/man/systemd-bootchart.html b/man/systemd-bootchart.html index d93886a2f..454812496 100644 --- a/man/systemd-bootchart.html +++ b/man/systemd-bootchart.html @@ -19,121 +19,106 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-bootchart — Boot performance graphing tool

Description¶

- systemd-bootchart is a - tool, usually run at system startup, that - collects the CPU load, disk load, memory - usage, as well as per-process information from - a running system. Collected results are output - as an SVG graph. Normally, systemd-bootchart - is invoked by the kernel by passing - init=/usr/lib/systemd/systemd-bootchart - on the kernel command line. systemd-bootchart will then - fork the real init off to resume normal system - startup, while monitoring and logging startup - information in the background. -

- After collecting a certain amount of data - (usually 15-30 seconds, default 20 s) the - logging stops and a graph is generated from - the logged information. This graph contains - vital clues as to which resources are being used, - in which order, and where possible problems - exist in the startup sequence of the system. - It is essentially a more detailed version of - the systemd-analyze plot - function. -

- Of course, bootchart can also be used at any - moment in time to collect and graph some data - for an amount of time. It is - recommended to use the --rel - switch in this case. -

- Bootchart does not require root privileges, - and will happily run as a normal user. -

- Bootchart graphs are by default written - time-stamped in /run/log - and saved to the journal with - MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518. - Journal field BOOTCHART= contains - the bootchart in SVG format. -

Invocation¶

systemd-bootchart can be invoked in several different ways:

Kernel invocation¶

The kernel can invoke - systemd-bootchart - instead of the init process. In turn, - systemd-bootchart - will invoke /sbin/init. -

Started as a standalone program¶

One can execute - systemd-bootchart - as normal application from the - command line. In this mode it is highly - recommended to pass the - -r flag in order to - not graph the time elapsed since boot - and before systemd-bootchart was - started, as it may result in extremely - large graphs. The time elapsed since boot - might also include any time that the system - was suspended.

Options¶

These options can also be set in the - /etc/systemd/bootchart.conf - file. See - bootchart.conf(5). -

-h, --help¶

Print a short help text and exit. -

-n, --sample N¶

Specify the number of - samples, N, - to record. Samples will be recorded at - intervals defined with --freq. -

-f, --freq f¶

Specify the sample log - frequency, a positive real f, in Hz. - Most systems can cope with values up to 25-50 without - creating too much overhead.

-r, --rel¶

Use relative times instead of absolute - times. This is useful for using bootchart at post-boot - time to profile an already booted system. Without this - option the graph would become extremely large. If set, the - horizontal axis starts at the first recorded sample - instead of time 0.0.

-F, --no-filter¶

Disable filtering of tasks that - did not contribute significantly to the boot. Processes - that are too short-lived (only seen in one sample) or - that do not consume any significant CPU time (less than - 0.001 s) will not be displayed in the output graph. -

-C, --cmdline¶

Display the full command line with arguments of processes, - instead of only the process name. -

-g, --control-group¶

Display process control group -

-o, --output path¶

Specify the output directory for the - graphs. By default, bootchart writes the graphs to - /run/log.

-i, --init path¶

Use this init binary. Defaults to - /sbin/init. -

-p, --pss¶

Enable logging and graphing - of processes' PSS (Proportional Set Size) - memory consumption. See filesystems/proc.txt - in the kernel documentation for an - explanation of this field. -

-e, --entropy¶

Enable logging and graphing - of the kernel random entropy pool size.

-x, --scale-x N¶

Horizontal scaling factor for all variable - graph components.

-y, --scale-y N¶

Vertical scaling factor for all variable - graph components.

Output¶

systemd-bootchart generates SVG graphs. In order to render those - on a graphical display any SVG capable viewer can be used. It should be - noted that the SVG render engines in most browsers (including Chrome - and Firefox) are many times faster than dedicated graphical applications - like Gimp and Inkscape. Just point your browser at file:///run/log/! -

History¶

This version of bootchart was implemented from - scratch, but is inspired by former bootchart - incantations:

Original bash¶

The original bash/shell code implemented - bootchart. This version created a compressed tarball for - processing with external applications. This version did - not graph anything, only generated data.

Ubuntu C Implementation¶

This version replaced the shell version with - a fast and efficient data logger, but also did not graph - the data.

Java bootchart¶

This was the original graphing application - for charting the data, written in java.

pybootchartgui.py¶

pybootchart created a graph from the data - collected by either the bash or C version.

The version of bootchart you are using now combines both the data - collection and the charting into a single application, making it more - efficient and simpler. There are no longer any timing issues with the data - collector and the grapher, as the graphing cannot be run until the data - has been collected. Also, the data kept in memory is reduced to the absolute - minimum needed.

See Also¶

- bootchart.conf(5) -

Bugs¶

systemd-bootchart does not get the model information for the hard drive - unless the root device is specified with root=/dev/sdxY. Using - UUIDs or PARTUUIDs will boot fine, but the hard drive model will not be - added to the chart.

For bugs, please contact the author and current maintainer:

Auke Kok
+ gudev systemd 219

Name

systemd-bootchart — Boot performance graphing tool

Description¶

+ systemd-bootchart is a tool, usually run at + system startup, that collects the CPU load, disk load, memory + usage, as well as per-process information from a running system. + Collected results are output as an SVG graph. Normally, + systemd-bootchart is invoked by the kernel by passing + init=/usr/lib/systemd/systemd-bootchart + on the kernel command line. systemd-bootchart will then fork the + real init off to resume normal system startup, while monitoring + and logging startup information in the background. +

+ After collecting a certain amount of data (usually 15-30 + seconds, default 20 s) the logging stops and a graph is + generated from the logged information. This graph contains vital + clues as to which resources are being used, in which order, and + where possible problems exist in the startup sequence of the + system. It is essentially a more detailed version of the + systemd-analyze plot function. +

+ Of course, bootchart can also be used at any moment in time to + collect and graph some data for an amount of time. It is + recommended to use the --rel switch in this + case. +

+ Bootchart does not require root privileges, and will happily run + as a normal user. +

+ Bootchart graphs are by default written time-stamped in + /run/log and saved to the journal with + MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518. + Journal field BOOTCHART= contains the + bootchart in SVG format. +

Invocation¶

systemd-bootchart can be invoked in several different ways:

Kernel invocation¶

The kernel can invoke + systemd-bootchart instead of the init + process. In turn, systemd-bootchart will + invoke /usr/lib/systemd/systemd. +

Started as a standalone program¶

One can execute + systemd-bootchart as normal application + from the command line. In this mode it is highly recommended + to pass the -r flag in order to not graph the + time elapsed since boot and before systemd-bootchart was + started, as it may result in extremely large graphs. The time + elapsed since boot might also include any time that the system + was suspended.

Options¶

These options can also be set in the + /etc/systemd/bootchart.conf file. See + bootchart.conf(5). +

-h, --help¶

Print a short help text and exit. +

-n, --sample N¶

Specify the number of samples, + N, to record. Samples will be + recorded at intervals defined with --freq. +

-f, --freq f¶

Specify the sample log frequency, a positive + real f, in Hz. Most systems can + cope with values up to 25-50 without creating too much + overhead.

-r, --rel¶

Use relative times instead of absolute times. + This is useful for using bootchart at post-boot time to + profile an already booted system. Without this option the + graph would become extremely large. If set, the horizontal + axis starts at the first recorded sample instead of time + 0.0.

-F, --no-filter¶

Disable filtering of tasks that did not + contribute significantly to the boot. Processes that are too + short-lived (only seen in one sample) or that do not consume + any significant CPU time (less than 0.001 s) will not be + displayed in the output graph.

-C, --cmdline¶

Display the full command line with arguments + of processes, instead of only the process name. +

-g, --control-group¶

Display process control group +

-o, --output path¶

Specify the output directory for the graphs. + By default, bootchart writes the graphs to + /run/log.

-i, --init path¶

Use this init binary. Defaults to + /usr/lib/systemd/systemd. +

-p, --pss¶

Enable logging and graphing of processes' PSS + (Proportional Set Size) memory consumption. See + filesystems/proc.txt in the kernel + documentation for an explanation of this field. +

-e, --entropy¶

Enable logging and graphing of the kernel + random entropy pool size.

-x, --scale-x N¶

Horizontal scaling factor for all variable + graph components.

-y, --scale-y N¶

Vertical scaling factor for all variable graph + components.

Output¶

systemd-bootchart generates SVG graphs. + In order to render those on a graphical display any SVG capable + viewer can be used. It should be noted that the SVG render engines + in most browsers (including Chrome and Firefox) are many times + faster than dedicated graphical applications like Gimp and + Inkscape. Just point your browser at + file:///run/log/! +

History¶

This version of bootchart was implemented from scratch, but + is inspired by former bootchart incantations:

Original bash¶

The original bash/shell code implemented + bootchart. This version created a compressed tarball for + processing with external applications. This version did not + graph anything, only generated data.

Ubuntu C Implementation¶

This version replaced the shell version with a + fast and efficient data logger, but also did not graph the + data.

Java bootchart¶

This was the original graphing application for + charting the data, written in java.

pybootchartgui.py¶

pybootchart created a graph from the data + collected by either the bash or C version.

The version of bootchart you are using now combines both the + data collection and the charting into a single application, making + it more efficient and simpler. There are no longer any timing + issues with the data collector and the grapher, as the graphing + cannot be run until the data has been collected. Also, the data + kept in memory is reduced to the absolute minimum needed.

See Also¶

+ bootchart.conf(5) +

Bugs¶

systemd-bootchart does not get the model information for the + hard drive unless the root device is specified with + root=/dev/sdxY. Using UUIDs or PARTUUIDs will boot + fine, but the hard drive model will not be added to the + chart.

For bugs, please contact the author and current maintainer:

Auke Kok
diff --git a/man/systemd-bootchart.xml b/man/systemd-bootchart.xml index 0068e928a..538666760 100644 --- a/man/systemd-bootchart.xml +++ b/man/systemd-bootchart.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-bootchart - systemd - - - - Developer - Auke - Kok - auke-jan.h.kok@intel.com - - - - - - systemd-bootchart - 1 - - - - systemd-bootchart - Boot performance graphing tool - - - - Description - - systemd-bootchart is a - tool, usually run at system startup, that - collects the CPU load, disk load, memory - usage, as well as per-process information from - a running system. Collected results are output - as an SVG graph. Normally, systemd-bootchart - is invoked by the kernel by passing - - on the kernel command line. systemd-bootchart will then - fork the real init off to resume normal system - startup, while monitoring and logging startup - information in the background. - - - After collecting a certain amount of data - (usually 15-30 seconds, default 20 s) the - logging stops and a graph is generated from - the logged information. This graph contains - vital clues as to which resources are being used, - in which order, and where possible problems - exist in the startup sequence of the system. - It is essentially a more detailed version of - the systemd-analyze plot - function. - - - Of course, bootchart can also be used at any - moment in time to collect and graph some data - for an amount of time. It is - recommended to use the - switch in this case. - - - Bootchart does not require root privileges, - and will happily run as a normal user. - - - Bootchart graphs are by default written - time-stamped in /run/log - and saved to the journal with - MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518. - Journal field BOOTCHART= contains - the bootchart in SVG format. - - - - - - Invocation - - systemd-bootchart can be invoked in several different ways: - - - - - Kernel invocation - The kernel can invoke - systemd-bootchart - instead of the init process. In turn, - systemd-bootchart - will invoke /sbin/init. - - - - - Started as a standalone program - One can execute - systemd-bootchart - as normal application from the - command line. In this mode it is highly - recommended to pass the - flag in order to - not graph the time elapsed since boot - and before systemd-bootchart was - started, as it may result in extremely - large graphs. The time elapsed since boot - might also include any time that the system - was suspended. - - - - - - Options - - These options can also be set in the - /etc/systemd/bootchart.conf - file. See - bootchart.conf5. - - - - - - - - - Specify the number of - samples, N, - to record. Samples will be recorded at - intervals defined with . - - - - - - - Specify the sample log - frequency, a positive real f, in Hz. - Most systems can cope with values up to 25-50 without - creating too much overhead. - - - - - - Use relative times instead of absolute - times. This is useful for using bootchart at post-boot - time to profile an already booted system. Without this - option the graph would become extremely large. If set, the - horizontal axis starts at the first recorded sample - instead of time 0.0. - - - - - - Disable filtering of tasks that - did not contribute significantly to the boot. Processes - that are too short-lived (only seen in one sample) or - that do not consume any significant CPU time (less than - 0.001 s) will not be displayed in the output graph. - - - - - - - Display the full command line with arguments of processes, - instead of only the process name. - - - - - - - Display process control group - - - - - - - Specify the output directory for the - graphs. By default, bootchart writes the graphs to - /run/log. - - - - - - Use this init binary. Defaults to - /sbin/init. - - - - - - - Enable logging and graphing - of processes' PSS (Proportional Set Size) - memory consumption. See filesystems/proc.txt - in the kernel documentation for an - explanation of this field. - - - - - - - Enable logging and graphing - of the kernel random entropy pool size. - - - - - - Horizontal scaling factor for all variable - graph components. - - - - - - Vertical scaling factor for all variable - graph components. - - - - - - - - - Output - - systemd-bootchart generates SVG graphs. In order to render those - on a graphical display any SVG capable viewer can be used. It should be - noted that the SVG render engines in most browsers (including Chrome - and Firefox) are many times faster than dedicated graphical applications - like Gimp and Inkscape. Just point your browser at ! - - - - - History - - This version of bootchart was implemented from - scratch, but is inspired by former bootchart - incantations: - - - - Original bash - The original bash/shell code implemented - bootchart. This version created a compressed tarball for - processing with external applications. This version did - not graph anything, only generated data. - - - - Ubuntu C Implementation - This version replaced the shell version with - a fast and efficient data logger, but also did not graph - the data. - - - - Java bootchart - This was the original graphing application - for charting the data, written in java. - - - - pybootchartgui.py - pybootchart created a graph from the data - collected by either the bash or C version. - - - - The version of bootchart you are using now combines both the data - collection and the charting into a single application, making it more - efficient and simpler. There are no longer any timing issues with the data - collector and the grapher, as the graphing cannot be run until the data - has been collected. Also, the data kept in memory is reduced to the absolute - minimum needed. - - - - - See Also - - bootchart.conf5 - - - - - Bugs - systemd-bootchart does not get the model information for the hard drive - unless the root device is specified with root=/dev/sdxY. Using - UUIDs or PARTUUIDs will boot fine, but the hard drive model will not be - added to the chart. - For bugs, please contact the author and current maintainer: - - Auke Kok auke-jan.h.kok@intel.com - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-bootchart + systemd + + + + Developer + Auke + Kok + auke-jan.h.kok@intel.com + + + + + + systemd-bootchart + 1 + + + + systemd-bootchart + Boot performance graphing tool + + + + Description + + systemd-bootchart is a tool, usually run at + system startup, that collects the CPU load, disk load, memory + usage, as well as per-process information from a running system. + Collected results are output as an SVG graph. Normally, + systemd-bootchart is invoked by the kernel by passing + + on the kernel command line. systemd-bootchart will then fork the + real init off to resume normal system startup, while monitoring + and logging startup information in the background. + + + After collecting a certain amount of data (usually 15-30 + seconds, default 20 s) the logging stops and a graph is + generated from the logged information. This graph contains vital + clues as to which resources are being used, in which order, and + where possible problems exist in the startup sequence of the + system. It is essentially a more detailed version of the + systemd-analyze plot function. + + + Of course, bootchart can also be used at any moment in time to + collect and graph some data for an amount of time. It is + recommended to use the switch in this + case. + + + Bootchart does not require root privileges, and will happily run + as a normal user. + + + Bootchart graphs are by default written time-stamped in + /run/log and saved to the journal with + MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518. + Journal field BOOTCHART= contains the + bootchart in SVG format. + + + + + + Invocation + + systemd-bootchart can be invoked in several different ways: + + + + + Kernel invocation + The kernel can invoke + systemd-bootchart instead of the init + process. In turn, systemd-bootchart will + invoke /usr/lib/systemd/systemd. + + + + + Started as a standalone program + One can execute + systemd-bootchart as normal application + from the command line. In this mode it is highly recommended + to pass the flag in order to not graph the + time elapsed since boot and before systemd-bootchart was + started, as it may result in extremely large graphs. The time + elapsed since boot might also include any time that the system + was suspended. + + + + + + Options + + These options can also be set in the + /etc/systemd/bootchart.conf file. See + bootchart.conf5. + + + + + + + + + Specify the number of samples, + N, to record. Samples will be + recorded at intervals defined with . + + + + + + + Specify the sample log frequency, a positive + real f, in Hz. Most systems can + cope with values up to 25-50 without creating too much + overhead. + + + + + + Use relative times instead of absolute times. + This is useful for using bootchart at post-boot time to + profile an already booted system. Without this option the + graph would become extremely large. If set, the horizontal + axis starts at the first recorded sample instead of time + 0.0. + + + + + + Disable filtering of tasks that did not + contribute significantly to the boot. Processes that are too + short-lived (only seen in one sample) or that do not consume + any significant CPU time (less than 0.001 s) will not be + displayed in the output graph. + + + + + + Display the full command line with arguments + of processes, instead of only the process name. + + + + + + + Display process control group + + + + + + + Specify the output directory for the graphs. + By default, bootchart writes the graphs to + /run/log. + + + + + + Use this init binary. Defaults to + /usr/lib/systemd/systemd. + + + + + + + Enable logging and graphing of processes' PSS + (Proportional Set Size) memory consumption. See + filesystems/proc.txt in the kernel + documentation for an explanation of this field. + + + + + + + Enable logging and graphing of the kernel + random entropy pool size. + + + + + + Horizontal scaling factor for all variable + graph components. + + + + + + Vertical scaling factor for all variable graph + components. + + + + + + + + + Output + + systemd-bootchart generates SVG graphs. + In order to render those on a graphical display any SVG capable + viewer can be used. It should be noted that the SVG render engines + in most browsers (including Chrome and Firefox) are many times + faster than dedicated graphical applications like Gimp and + Inkscape. Just point your browser at + ! + + + + + History + + This version of bootchart was implemented from scratch, but + is inspired by former bootchart incantations: + + + + Original bash + The original bash/shell code implemented + bootchart. This version created a compressed tarball for + processing with external applications. This version did not + graph anything, only generated data. + + + + Ubuntu C Implementation + This version replaced the shell version with a + fast and efficient data logger, but also did not graph the + data. + + + + Java bootchart + This was the original graphing application for + charting the data, written in java. + + + + pybootchartgui.py + pybootchart created a graph from the data + collected by either the bash or C version. + + + + The version of bootchart you are using now combines both the + data collection and the charting into a single application, making + it more efficient and simpler. There are no longer any timing + issues with the data collector and the grapher, as the graphing + cannot be run until the data has been collected. Also, the data + kept in memory is reduced to the absolute minimum needed. + + + + + See Also + + + bootchart.conf5 + + + + + Bugs + + systemd-bootchart does not get the model information for the + hard drive unless the root device is specified with + root=/dev/sdxY. Using UUIDs or PARTUUIDs will boot + fine, but the hard drive model will not be added to the + chart. + For bugs, please contact the author and current maintainer: + + Auke Kok auke-jan.h.kok@intel.com + + diff --git a/man/systemd-bus-proxyd.8 b/man/systemd-bus-proxyd.8 index c7b6a391e..523952d43 100644 --- a/man/systemd-bus-proxyd.8 +++ b/man/systemd-bus-proxyd.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-BUS\-PROXYD" "8" "" "systemd 218" "systemd-bus-proxyd" +.TH "SYSTEMD\-BUS\-PROXYD" "8" "" "systemd 219" "systemd-bus-proxyd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-bus-proxyd.html b/man/systemd-bus-proxyd.html index 02b2d6e6b..8c17340c5 100644 --- a/man/systemd-bus-proxyd.html +++ b/man/systemd-bus-proxyd.html @@ -19,12 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-bus-proxyd — Connect STDIO or a socket to a given bus address

Synopsis

/usr/lib/systemd/systemd-bus-proxyd [OPTIONS...] [PLACEHOLDER]

Description¶

systemd-bus-proxyd will proxy D-Bus + gudev systemd 219


Name

systemd-bus-proxyd — Connect STDIO or a socket to a given bus address

Synopsis

/usr/lib/systemd/systemd-bus-proxyd [OPTIONS...] [PLACEHOLDER]

Description¶

systemd-bus-proxyd will proxy D-Bus messages to and from a bus. The will be either the system bus or the bus specified with --address when that option is given. Messages will be proxied to/from standard input and output, or the socket received through socket activation.

This program can be used to connect a program using classic - D-Bus to kdbus.

Options and Arguments¶

The following options are understood:

--address=ADDRESS[:ADDRESS...]¶

Connect to the bus specified by + D-Bus to kdbus.

Options and Arguments¶

The following options are understood:

--address=ADDRESS[:ADDRESS...]¶

Connect to the bus specified by ADDRESS. Multiple colon-separated addresses can be specified, in which case systemd-bus-proxyd will attempt to @@ -32,7 +32,7 @@

--version¶

Print a short version string and exit.

PLACEHOLDER, if given, must be a string of "x" and will be used to display information about the process that systemd-bus-proxyd is forwarding - messages for.

See Also¶

+ messages for.

See Also¶

dbus-daemon(1), D-Bus, kdbus diff --git a/man/systemd-bus-proxyd.socket.html b/man/systemd-bus-proxyd.socket.html index b795d63b5..8f19d9387 100644 --- a/man/systemd-bus-proxyd.socket.html +++ b/man/systemd-bus-proxyd.socket.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-bus-proxyd@.service, systemd-bus-proxyd.socket — Proxy classic D-Bus clients to kdbus

Synopsis

systemd-bus-proxyd@.service

systemd-bus-proxyd.socket

Description¶

systemd-bus-proxyd.socket will launch + gudev systemd 219


Name

systemd-bus-proxyd@.service, systemd-bus-proxyd.socket — Proxy classic D-Bus clients to kdbus

Synopsis

systemd-bus-proxyd@.service

systemd-bus-proxyd.socket

Description¶

systemd-bus-proxyd.socket will launch systemd-bus-proxyd@.service for connections to the classic D-Bus socket in /var/run/dbus/system_bus_socket.

systemd-bus-proxyd@.service is launched for an existing D-Bus connection and will use systemd-bus-proxyd to proxy messages from this connection to the system bus (either kdbus or classic D-Bus). -

See Also¶

+

See Also¶

systemd-bus-proxyd(8), dbus-daemon(1), D-Bus, diff --git a/man/systemd-bus-proxyd@.service.8 b/man/systemd-bus-proxyd@.service.8 index b081675c9..39cd665d2 100644 --- a/man/systemd-bus-proxyd@.service.8 +++ b/man/systemd-bus-proxyd@.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-BUS\-PROXYD@\&.SERVICE" "8" "" "systemd 218" "systemd-bus-proxyd@.service" +.TH "SYSTEMD\-BUS\-PROXYD@\&.SERVICE" "8" "" "systemd 219" "systemd-bus-proxyd@.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-bus-proxyd@.service.html b/man/systemd-bus-proxyd@.service.html index b795d63b5..8f19d9387 100644 --- a/man/systemd-bus-proxyd@.service.html +++ b/man/systemd-bus-proxyd@.service.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-bus-proxyd@.service, systemd-bus-proxyd.socket — Proxy classic D-Bus clients to kdbus

Synopsis

systemd-bus-proxyd@.service

systemd-bus-proxyd.socket

Description¶

systemd-bus-proxyd.socket will launch + gudev systemd 219


Name

systemd-bus-proxyd@.service, systemd-bus-proxyd.socket — Proxy classic D-Bus clients to kdbus

Synopsis

systemd-bus-proxyd@.service

systemd-bus-proxyd.socket

Description¶

systemd-bus-proxyd.socket will launch systemd-bus-proxyd@.service for connections to the classic D-Bus socket in /var/run/dbus/system_bus_socket.

systemd-bus-proxyd@.service is launched for an existing D-Bus connection and will use systemd-bus-proxyd to proxy messages from this connection to the system bus (either kdbus or classic D-Bus). -

See Also¶

+

See Also¶

systemd-bus-proxyd(8), dbus-daemon(1), D-Bus, diff --git a/man/systemd-bus-proxyd@.service.xml b/man/systemd-bus-proxyd@.service.xml index aab6691db..141b43f6d 100644 --- a/man/systemd-bus-proxyd@.service.xml +++ b/man/systemd-bus-proxyd@.service.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> diff --git a/man/systemd-cat.1 b/man/systemd-cat.1 index 6cb0469a5..caf611b98 100644 --- a/man/systemd-cat.1 +++ b/man/systemd-cat.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-CAT" "1" "" "systemd 218" "systemd-cat" +.TH "SYSTEMD\-CAT" "1" "" "systemd 219" "systemd-cat" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-cat.html b/man/systemd-cat.html index 51f6db08b..4874e3998 100644 --- a/man/systemd-cat.html +++ b/man/systemd-cat.html @@ -19,63 +19,47 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-cat — Connect a pipeline or program's output with the journal

Synopsis

systemd-cat [OPTIONS...] [COMMAND] [ARGUMENTS...]

systemd-cat [OPTIONS...]

Description¶

systemd-cat may be used to - connect the standard input and output of a process to the - journal, or as a filter tool in a shell pipeline to - pass the output the previous pipeline element - generates to the journal.

If no parameter is passed, - systemd-cat will write - everything it reads from standard input (stdin) to the journal.

If parameters are passed, they are executed as - command line with standard output (stdout) and standard - error output (stderr) connected to the journal, so - that all it writes is stored in the journal.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

-t, --identifier=¶

Specify a short string - that is used to identify the logging - tool. If not specified, no identification - string is written to the journal.

-p, --priority=¶

Specify the default - priority level for the logged - messages. Pass one of - "emerg", - "alert", - "crit", - "err", - "warning", - "notice", - "info", - "debug", or a - value between 0 and 7 (corresponding - to the same named levels). These - priority values are the same as - defined by - syslog(3). Defaults - to "info". Note that - this simply controls the default, - individual lines may be logged with - different levels if they are prefixed - accordingly. For details see - --level-prefix= - below.

--level-prefix=¶

Controls whether lines - read are parsed for syslog priority - level prefixes. If enabled (the - default), a line prefixed with a - priority prefix such as - "<5>" is logged - at priority 5 - ("notice"), and - similar for the other priority - levels. Takes a boolean - argument.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Examples¶

Example 1. Invoke a program

This calls /bin/ls - with standard output and error connected to the - journal:

# systemd-cat ls

Example 2. Usage in a shell pipeline

This builds a shell pipeline also - invoking /bin/ls and - writes the output it generates to the - journal:

# ls | systemd-cat

Even though the two examples have very similar - effects the first is preferable since only one process - is running at a time, and both stdout and stderr are - captured while in the second example, only stdout is - captured.

+ gudev systemd 219

Name

systemd-cat — Connect a pipeline or program's output with the journal

Synopsis

systemd-cat [OPTIONS...] [COMMAND] [ARGUMENTS...]

systemd-cat [OPTIONS...]

Description¶

systemd-cat may be used to connect the + standard input and output of a process to the journal, or as a + filter tool in a shell pipeline to pass the output the previous + pipeline element generates to the journal.

If no parameter is passed, systemd-cat + will write everything it reads from standard input (stdin) to the + journal.

If parameters are passed, they are executed as command line + with standard output (stdout) and standard error output (stderr) + connected to the journal, so that all it writes is stored in the + journal.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

-t, --identifier=¶

Specify a short string that is used to + identify the logging tool. If not specified, no identification + string is written to the journal.

-p, --priority=¶

Specify the default priority level for the + logged messages. Pass one of + "emerg", + "alert", + "crit", + "err", + "warning", + "notice", + "info", + "debug", or a + value between 0 and 7 (corresponding to the same named + levels). These priority values are the same as defined by + syslog(3). + Defaults to "info". Note that this simply + controls the default, individual lines may be logged with + different levels if they are prefixed accordingly. For details + see --level-prefix= below.

--level-prefix=¶

Controls whether lines read are parsed for + syslog priority level prefixes. If enabled (the default), a + line prefixed with a priority prefix such as + "<5>" is logged at priority 5 + ("notice"), and similar for the other + priority levels. Takes a boolean argument.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

Examples¶

Example 1. Invoke a program

This calls /bin/ls + with standard output and error connected to the journal:

# systemd-cat ls

Example 2. Usage in a shell pipeline

This builds a shell pipeline also invoking + /bin/ls and writes the output it generates + to the journal:

# ls | systemd-cat

Even though the two examples have very similar effects the + first is preferable since only one process is running at a time, + and both stdout and stderr are captured while in the second + example, only stdout is captured.

diff --git a/man/systemd-cat.xml b/man/systemd-cat.xml index e5a867be2..38ddf66d2 100644 --- a/man/systemd-cat.xml +++ b/man/systemd-cat.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-cat - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-cat - 1 - - - - systemd-cat - Connect a pipeline or program's output with the journal - - - - - systemd-cat OPTIONS COMMAND ARGUMENTS - - - systemd-cat OPTIONS - - - - - Description - - systemd-cat may be used to - connect the standard input and output of a process to the - journal, or as a filter tool in a shell pipeline to - pass the output the previous pipeline element - generates to the journal. - - If no parameter is passed, - systemd-cat will write - everything it reads from standard input (stdin) to the journal. - - If parameters are passed, they are executed as - command line with standard output (stdout) and standard - error output (stderr) connected to the journal, so - that all it writes is stored in the journal. - - - - Options - - The following options are understood: - - - - - - - - - - Specify a short string - that is used to identify the logging - tool. If not specified, no identification - string is written to the journal. - - - - - - - Specify the default - priority level for the logged - messages. Pass one of - emerg, - alert, - crit, - err, - warning, - notice, - info, - debug, or a - value between 0 and 7 (corresponding - to the same named levels). These - priority values are the same as - defined by - syslog3. Defaults - to info. Note that - this simply controls the default, - individual lines may be logged with - different levels if they are prefixed - accordingly. For details see - - below. - - - - - - Controls whether lines - read are parsed for syslog priority - level prefixes. If enabled (the - default), a line prefixed with a - priority prefix such as - <5> is logged - at priority 5 - (notice), and - similar for the other priority - levels. Takes a boolean - argument. - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - Examples - - - Invoke a program - - This calls /bin/ls - with standard output and error connected to the - journal: - - # systemd-cat ls - - - - Usage in a shell pipeline - - This builds a shell pipeline also - invoking /bin/ls and - writes the output it generates to the - journal: - - # ls | systemd-cat - - - Even though the two examples have very similar - effects the first is preferable since only one process - is running at a time, and both stdout and stderr are - captured while in the second example, only stdout is - captured. - - - - See Also - - systemd1, - systemctl1, - logger1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-cat + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-cat + 1 + + + + systemd-cat + Connect a pipeline or program's output with the journal + + + + + systemd-cat OPTIONS COMMAND ARGUMENTS + + + systemd-cat OPTIONS + + + + + Description + + systemd-cat may be used to connect the + standard input and output of a process to the journal, or as a + filter tool in a shell pipeline to pass the output the previous + pipeline element generates to the journal. + + If no parameter is passed, systemd-cat + will write everything it reads from standard input (stdin) to the + journal. + + If parameters are passed, they are executed as command line + with standard output (stdout) and standard error output (stderr) + connected to the journal, so that all it writes is stored in the + journal. + + + + Options + + The following options are understood: + + + + + + + + + + Specify a short string that is used to + identify the logging tool. If not specified, no identification + string is written to the journal. + + + + + + + Specify the default priority level for the + logged messages. Pass one of + emerg, + alert, + crit, + err, + warning, + notice, + info, + debug, or a + value between 0 and 7 (corresponding to the same named + levels). These priority values are the same as defined by + syslog3. + Defaults to info. Note that this simply + controls the default, individual lines may be logged with + different levels if they are prefixed accordingly. For details + see below. + + + + + + Controls whether lines read are parsed for + syslog priority level prefixes. If enabled (the default), a + line prefixed with a priority prefix such as + <5> is logged at priority 5 + (notice), and similar for the other + priority levels. Takes a boolean argument. + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + Examples + + + Invoke a program + + This calls /bin/ls + with standard output and error connected to the journal: + + # systemd-cat ls + + + + Usage in a shell pipeline + + This builds a shell pipeline also invoking + /bin/ls and writes the output it generates + to the journal: + + # ls | systemd-cat + + + Even though the two examples have very similar effects the + first is preferable since only one process is running at a time, + and both stdout and stderr are captured while in the second + example, only stdout is captured. + + + + See Also + + systemd1, + systemctl1, + logger1 + + diff --git a/man/systemd-cgls.1 b/man/systemd-cgls.1 index 60dbbffa9..adaedc85a 100644 --- a/man/systemd-cgls.1 +++ b/man/systemd-cgls.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-CGLS" "1" "" "systemd 218" "systemd-cgls" +.TH "SYSTEMD\-CGLS" "1" "" "systemd 219" "systemd-cgls" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-cgls.html b/man/systemd-cgls.html index 5588927b5..ea77376e0 100644 --- a/man/systemd-cgls.html +++ b/man/systemd-cgls.html @@ -19,32 +19,26 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-cgls — Recursively show control group contents

Synopsis

systemd-cgls [OPTIONS...] [CGROUP...]

Description¶

systemd-cgls recursively - shows the contents of the selected Linux control group - hierarchy in a tree. If arguments are specified, shows - all member processes of the specified control groups - plus all their subgroups and their members. The - control groups may either be specified by their full - file paths or are assumed in the systemd control group - hierarchy. If no argument is specified and the current - working directory is beneath the control group mount - point /sys/fs/cgroup, shows the contents - of the control group the working directory refers - to. Otherwise, the full systemd control group hierarchy - is shown.

By default, empty control groups are not - shown.

Options¶

The following options are understood:

--all¶

Do not hide empty - control groups in the - output.

-l, --full¶

Do not ellipsize - process tree members.

-k¶

Include kernel - threads in output.

-M MACHINE, --machine=MACHINE¶

Limit control groups shown to - the part corresponding to the - container MACHINE. -

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-cgls — Recursively show control group contents

Synopsis

systemd-cgls [OPTIONS...] [CGROUP...]

Description¶

systemd-cgls recursively shows the + contents of the selected Linux control group hierarchy in a tree. + If arguments are specified, shows all member processes of the + specified control groups plus all their subgroups and their + members. The control groups may either be specified by their full + file paths or are assumed in the systemd control group hierarchy. + If no argument is specified and the current working directory is + beneath the control group mount point + /sys/fs/cgroup, shows the contents of the + control group the working directory refers to. Otherwise, the full + systemd control group hierarchy is shown.

By default, empty control groups are not shown.

Options¶

The following options are understood:

--all¶

Do not hide empty control groups in the + output.

-l, --full¶

Do not ellipsize process tree members.

-k¶

Include kernel threads in output. +

-M MACHINE, --machine=MACHINE¶

Limit control groups shown to the part + corresponding to the container + MACHINE.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-cgls.xml b/man/systemd-cgls.xml index d8dbe6862..e8f0368f4 100644 --- a/man/systemd-cgls.xml +++ b/man/systemd-cgls.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-cgls - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-cgls - 1 - - - - systemd-cgls - Recursively show control group contents - - - - - systemd-cgls - OPTIONS - CGROUP - - - - - Description - - systemd-cgls recursively - shows the contents of the selected Linux control group - hierarchy in a tree. If arguments are specified, shows - all member processes of the specified control groups - plus all their subgroups and their members. The - control groups may either be specified by their full - file paths or are assumed in the systemd control group - hierarchy. If no argument is specified and the current - working directory is beneath the control group mount - point /sys/fs/cgroup, shows the contents - of the control group the working directory refers - to. Otherwise, the full systemd control group hierarchy - is shown. - - By default, empty control groups are not - shown. - - - - Options - - The following options are understood: - - - - - - Do not hide empty - control groups in the - output. - - - - - - - Do not ellipsize - process tree members. - - - - - - - Include kernel - threads in output. - - - - - - - Limit control groups shown to - the part corresponding to the - container MACHINE. - - - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - systemd-cgtop1, - systemd-nspawn1, - ps1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-cgls + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-cgls + 1 + + + + systemd-cgls + Recursively show control group contents + + + + + systemd-cgls + OPTIONS + CGROUP + + + + + Description + + systemd-cgls recursively shows the + contents of the selected Linux control group hierarchy in a tree. + If arguments are specified, shows all member processes of the + specified control groups plus all their subgroups and their + members. The control groups may either be specified by their full + file paths or are assumed in the systemd control group hierarchy. + If no argument is specified and the current working directory is + beneath the control group mount point + /sys/fs/cgroup, shows the contents of the + control group the working directory refers to. Otherwise, the full + systemd control group hierarchy is shown. + + By default, empty control groups are not shown. + + + + Options + + The following options are understood: + + + + + + Do not hide empty control groups in the + output. + + + + + + + Do not ellipsize process tree members. + + + + + + + Include kernel threads in output. + + + + + + + + Limit control groups shown to the part + corresponding to the container + MACHINE. + + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemctl1, + systemd-cgtop1, + systemd-nspawn1, + ps1 + + diff --git a/man/systemd-cgtop.1 b/man/systemd-cgtop.1 index 467d56ee6..a24d5a858 100644 --- a/man/systemd-cgtop.1 +++ b/man/systemd-cgtop.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-CGTOP" "1" "" "systemd 218" "systemd-cgtop" +.TH "SYSTEMD\-CGTOP" "1" "" "systemd 219" "systemd-cgtop" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-cgtop.html b/man/systemd-cgtop.html index a5d0cff17..75a734610 100644 --- a/man/systemd-cgtop.html +++ b/man/systemd-cgtop.html @@ -19,75 +19,58 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-cgtop — Show top control groups by their resource usage

Synopsis

systemd-cgtop [OPTIONS...]

Description¶

systemd-cgtop shows the top - control groups of the local Linux control group - hierarchy, ordered by their CPU, memory, or disk I/O load. The - display is refreshed in regular intervals (by default - every 1s), similar in style to - top(1). - If systemd-cgtop is not connected - to a tty, only one iteration is performed and no - columns headers are printed. This mode is suitable for - scripting.

Resource usage is only accounted for control - groups in the relevant hierarchy, i.e. CPU usage is - only accounted for control groups in the - "cpuacct" hierarchy, memory usage - only for those in "memory" and disk - I/O usage for those in "blkio". If - resource monitoring for these resources is required, - it is recommended to add the - CPUAccounting=1, - MemoryAccounting=1 and - BlockIOAccounting=1 settings in the - unit files in question. See - systemd.resource-control(5) - for details.

To emphasize this: unless - "CPUAccounting=1", - "MemoryAccounting=1" and - "BlockIOAccounting=1" are enabled for - the services in question, no resource accounting will - be available for system services and the data shown by - systemd-cgtop will be - incomplete.

Options¶

The following options are understood:

-p¶

Order by control group - path name.

-t¶

Order by number of - tasks in control - group (i.e. threads and processes).

-c¶

Order by CPU load.

-m¶

Order by memory usage.

-i¶

Order by disk I/O load.

-b, --batch¶

Run in "batch" mode: - do not accept input and run until the - iteration limit set with - --iterations is - exhausted or until killed. This mode - could be useful for sending output - from systemd-cgtop - to other programs or to a - file.

-n, --iterations=¶

Perform only this many - iterations.

-d, --delay=¶

Specify refresh delay - in seconds (or if one of - "ms", - "us", - "min" is specified as - unit in this time - unit).

--depth=¶

Maximum control group - tree traversal depth. Specifies how - deep systemd-cgtop - shall traverse the control group - hierarchies. If 0 is specified, only - the root group is monitored. For 1, - only the first level of control groups - is monitored, and so on. Defaults to - 3.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Keys¶

systemd-cgtop is an - interactive tool and may be controlled via user input - using the following keys:

h¶

Shows a short help text.

SPACE¶

Immediately refresh output.

q¶

Terminate the program.

p, t, c, m, i¶

Sort the control groups - by path, number of tasks, CPU load, - memory usage, or IO - load, respectively.

%¶

Toggle between showing CPU time as - time or percentage.

+, -¶

Increase - or decrease refresh - delay, respectively.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-cgtop — Show top control groups by their resource usage

Synopsis

systemd-cgtop [OPTIONS...]

Description¶

systemd-cgtop shows the top control + groups of the local Linux control group hierarchy, ordered by + their CPU, memory, or disk I/O load. The display is refreshed in + regular intervals (by default every 1s), similar in style to + top(1). + If systemd-cgtop is not connected to a tty, + only one iteration is performed and no columns headers are + printed. This mode is suitable for scripting.

Resource usage is only accounted for control groups in the + relevant hierarchy, i.e. CPU usage is only accounted for control + groups in the "cpuacct" hierarchy, memory usage + only for those in "memory" and disk I/O usage for + those in "blkio". If resource monitoring for + these resources is required, it is recommended to add the + CPUAccounting=1, + MemoryAccounting=1 and + BlockIOAccounting=1 settings in the unit files + in question. See + systemd.resource-control(5) + for details.

To emphasize this: unless + "CPUAccounting=1", + "MemoryAccounting=1" and + "BlockIOAccounting=1" are enabled for the + services in question, no resource accounting will be available for + system services and the data shown by + systemd-cgtop will be incomplete.

Options¶

The following options are understood:

-p¶

Order by control group + path name.

-t¶

Order by number of tasks in control group + (i.e. threads and processes).

-c¶

Order by CPU load.

-m¶

Order by memory usage.

-i¶

Order by disk I/O load.

-b, --batch¶

Run in "batch" mode: do not accept input and + run until the iteration limit set with + --iterations is exhausted or until killed. + This mode could be useful for sending output from + systemd-cgtop to other programs or to a + file.

-n, --iterations=¶

Perform only this many iterations. +

-d, --delay=¶

Specify refresh delay in seconds (or if one of + "ms", + "us", + "min" is specified as unit in this time + unit).

--depth=¶

Maximum control group tree traversal depth. + Specifies how deep systemd-cgtop shall + traverse the control group hierarchies. If 0 is specified, + only the root group is monitored. For 1, only the first level + of control groups is monitored, and so on. Defaults to + 3.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Keys¶

systemd-cgtop is an interactive tool and + may be controlled via user input using the following keys:

h¶

Shows a short help text.

SPACE¶

Immediately refresh output.

q¶

Terminate the program.

p, t, c, m, i¶

Sort the control groups by path, number of + tasks, CPU load, memory usage, or IO load, respectively. +

%¶

Toggle between showing CPU time as time or + percentage.

+, -¶

Increase or decrease refresh delay, + respectively.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-cgtop.xml b/man/systemd-cgtop.xml index 8ee552a01..f1ff218c3 100644 --- a/man/systemd-cgtop.xml +++ b/man/systemd-cgtop.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-cgtop - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-cgtop - 1 - - - - systemd-cgtop - Show top control groups by their resource usage - - - - - systemd-cgtop - OPTIONS - - - - - Description - - systemd-cgtop shows the top - control groups of the local Linux control group - hierarchy, ordered by their CPU, memory, or disk I/O load. The - display is refreshed in regular intervals (by default - every 1s), similar in style to - top1. - If systemd-cgtop is not connected - to a tty, only one iteration is performed and no - columns headers are printed. This mode is suitable for - scripting. - - Resource usage is only accounted for control - groups in the relevant hierarchy, i.e. CPU usage is - only accounted for control groups in the - cpuacct hierarchy, memory usage - only for those in memory and disk - I/O usage for those in blkio. If - resource monitoring for these resources is required, - it is recommended to add the - CPUAccounting=1, - MemoryAccounting=1 and - BlockIOAccounting=1 settings in the - unit files in question. See - systemd.resource-control5 - for details. - - To emphasize this: unless - CPUAccounting=1, - MemoryAccounting=1 and - BlockIOAccounting=1 are enabled for - the services in question, no resource accounting will - be available for system services and the data shown by - systemd-cgtop will be - incomplete. - - - - Options - - The following options are understood: - - - - - - Order by control group - path name. - - - - - - Order by number of - tasks in control - group (i.e. threads and processes). - - - - - - Order by CPU load. - - - - - - Order by memory usage. - - - - - - Order by disk I/O load. - - - - - - - Run in "batch" mode: - do not accept input and run until the - iteration limit set with - is - exhausted or until killed. This mode - could be useful for sending output - from systemd-cgtop - to other programs or to a - file. - - - - - - - Perform only this many - iterations. - - - - - - - Specify refresh delay - in seconds (or if one of - ms, - us, - min is specified as - unit in this time - unit). - - - - - - Maximum control group - tree traversal depth. Specifies how - deep systemd-cgtop - shall traverse the control group - hierarchies. If 0 is specified, only - the root group is monitored. For 1, - only the first level of control groups - is monitored, and so on. Defaults to - 3. - - - - - - - - - - - Keys - - systemd-cgtop is an - interactive tool and may be controlled via user input - using the following keys: - - - - h - - Shows a short help text. - - - - SPACE - - Immediately refresh output. - - - - q - - Terminate the program. - - - - - p - t - c - m - i - - Sort the control groups - by path, number of tasks, CPU load, - memory usage, or IO - load, respectively. - - - - % - - Toggle between showing CPU time as - time or percentage. - - - - + - - - - Increase - or decrease refresh - delay, respectively. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - systemd-cgls1, - systemd.resource-control5, - top1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-cgtop + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-cgtop + 1 + + + + systemd-cgtop + Show top control groups by their resource usage + + + + + systemd-cgtop + OPTIONS + + + + + Description + + systemd-cgtop shows the top control + groups of the local Linux control group hierarchy, ordered by + their CPU, memory, or disk I/O load. The display is refreshed in + regular intervals (by default every 1s), similar in style to + top1. + If systemd-cgtop is not connected to a tty, + only one iteration is performed and no columns headers are + printed. This mode is suitable for scripting. + + Resource usage is only accounted for control groups in the + relevant hierarchy, i.e. CPU usage is only accounted for control + groups in the cpuacct hierarchy, memory usage + only for those in memory and disk I/O usage for + those in blkio. If resource monitoring for + these resources is required, it is recommended to add the + CPUAccounting=1, + MemoryAccounting=1 and + BlockIOAccounting=1 settings in the unit files + in question. See + systemd.resource-control5 + for details. + + To emphasize this: unless + CPUAccounting=1, + MemoryAccounting=1 and + BlockIOAccounting=1 are enabled for the + services in question, no resource accounting will be available for + system services and the data shown by + systemd-cgtop will be incomplete. + + + + Options + + The following options are understood: + + + + + + Order by control group + path name. + + + + + + Order by number of tasks in control group + (i.e. threads and processes). + + + + + + Order by CPU load. + + + + + + Order by memory usage. + + + + + + Order by disk I/O load. + + + + + + + Run in "batch" mode: do not accept input and + run until the iteration limit set with + is exhausted or until killed. + This mode could be useful for sending output from + systemd-cgtop to other programs or to a + file. + + + + + + + Perform only this many iterations. + + + + + + + + Specify refresh delay in seconds (or if one of + ms, + us, + min is specified as unit in this time + unit). + + + + + + Maximum control group tree traversal depth. + Specifies how deep systemd-cgtop shall + traverse the control group hierarchies. If 0 is specified, + only the root group is monitored. For 1, only the first level + of control groups is monitored, and so on. Defaults to + 3. + + + + + + + + + + + Keys + + systemd-cgtop is an interactive tool and + may be controlled via user input using the following keys: + + + + h + + Shows a short help text. + + + + SPACE + + Immediately refresh output. + + + + q + + Terminate the program. + + + + + p + t + c + m + i + + Sort the control groups by path, number of + tasks, CPU load, memory usage, or IO load, respectively. + + + + + % + + Toggle between showing CPU time as time or + percentage. + + + + + + - + + Increase or decrease refresh delay, + respectively. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemctl1, + systemd-cgls1, + systemd.resource-control5, + top1 + + diff --git a/man/systemd-coredump.8 b/man/systemd-coredump.8 index ab770867b..f8fc408d0 100644 --- a/man/systemd-coredump.8 +++ b/man/systemd-coredump.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-COREDUMP" "8" "" "systemd 218" "systemd-coredump" +.TH "SYSTEMD\-COREDUMP" "8" "" "systemd 219" "systemd-coredump" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-coredump.html b/man/systemd-coredump.html index 70afc244e..d4161c02e 100644 --- a/man/systemd-coredump.html +++ b/man/systemd-coredump.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-coredump — Log and store core dumps

Synopsis

/usr/lib/systemd/systemd-coredump

Description¶

systemd-coredump can be used as a helper + gudev systemd 219


Name

systemd-coredump — Log and store core dumps

Synopsis

/usr/lib/systemd/systemd-coredump

Description¶

systemd-coredump can be used as a helper binary by the kernel when a user space program receives a fatal signal and dumps core. For it to be used in this capacity, it must be specified by the @@ -46,7 +46,7 @@ journalctl(1) log viewer, coredumpctl(1) - may be used to list and extract coredumps.

See Also¶

+ may be used to list and extract coredumps.

See Also¶

coredump.conf(5), coredumpctl(1), systemd-journald.service(8), diff --git a/man/systemd-cryptsetup-generator.8 b/man/systemd-cryptsetup-generator.8 index ea45b799f..7e3c8cb4e 100644 --- a/man/systemd-cryptsetup-generator.8 +++ b/man/systemd-cryptsetup-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-CRYPTSETUP\-GENERATOR" "8" "" "systemd 218" "systemd-cryptsetup-generator" +.TH "SYSTEMD\-CRYPTSETUP\-GENERATOR" "8" "" "systemd 219" "systemd-cryptsetup-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -83,7 +83,9 @@ If /etc/crypttab exists, only those UUIDs specified on the kernel command line w .PP \fIluks\&.name=\fR, \fIrd\&.luks\&.name=\fR .RS 4 -Takes a LUKS super block UUID followed by an \*(Aq=\*(Aq and a name\&. This implies +Takes a LUKS super block UUID followed by an +"=" +and a name\&. This implies \fIrd\&.luks\&.uuid=\fR or \fIluks\&.uuid=\fR @@ -97,9 +99,12 @@ is honored by both the main system and the initrd\&. .PP \fIluks\&.options=\fR, \fIrd\&.luks\&.options=\fR .RS 4 -Takes a LUKS super block UUID followed by an \*(Aq=\*(Aq and a string of options separated by commas as argument\&. This will override the options for the given UUID\&. +Takes a LUKS super block UUID followed by an +"=" +and a string of options separated by commas as argument\&. This will override the options for the given UUID\&. .sp -If only a list of options, without an UUID, is specified, they apply to any UUIDs not specified elsewhere, and without an entry in /etc/crypttab\&. +If only a list of options, without an UUID, is specified, they apply to any UUIDs not specified elsewhere, and without an entry in +/etc/crypttab\&. .sp \fIrd\&.luks\&.options=\fR is honored only by initial RAM disk (initrd) while @@ -109,7 +114,9 @@ is honored by both the main system and the initrd\&. .PP \fIluks\&.key=\fR, \fIrd\&.luks\&.key=\fR .RS 4 -Takes a password file name as argument or a LUKS super block UUID followed by a \*(Aq=\*(Aq and a password file name\&. +Takes a password file name as argument or a LUKS super block UUID followed by a +"=" +and a password file name\&. .sp For those entries specified with \fIrd\&.luks\&.uuid=\fR diff --git a/man/systemd-cryptsetup-generator.html b/man/systemd-cryptsetup-generator.html index 4307ca6b1..5a3af23c0 100644 --- a/man/systemd-cryptsetup-generator.html +++ b/man/systemd-cryptsetup-generator.html @@ -19,95 +19,71 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-cryptsetup-generator — Unit generator for /etc/crypttab

Synopsis

/usr/lib/systemd/system-generators/systemd-cryptsetup-generator

Description¶

systemd-cryptsetup-generator - is a generator that translates - /etc/crypttab into native systemd - units early at boot and when configuration of the - system manager is reloaded. This will create - systemd-cryptsetup@.service(8) - units as necessary.

systemd-cryptsetup-generator - implements the generator - specification.

Kernel Command Line¶

systemd-cryptsetup-generator understands - the following kernel command line parameters:

luks=, rd.luks=¶

Takes a boolean - argument. Defaults to - "yes". If - "no", disables the - generator - entirely. rd.luks= - is honored only by initial RAM disk - (initrd) while - luks= is honored - by both the main system and the - initrd.

luks.crypttab=, rd.luks.crypttab=¶

Takes a boolean - argument. Defaults to - "yes". If - "no", causes the - generator to ignore any devices - configured in - /etc/crypttab - (luks.uuid= will - still work - however). rd.luks.crypttab= - is honored only by initial RAM disk - (initrd) while - luks.crypttab= is - honored by both the main system and - the initrd.

luks.uuid=, rd.luks.uuid=¶

Takes a LUKS superblock - UUID as argument. This will - activate the specified device as part - of the boot process as if it was - listed in - /etc/crypttab. This - option may be specified more than once - in order to set up multiple - devices. rd.luks.uuid= - is honored only by initial RAM disk - (initrd) while - luks.uuid= is - honored by both the main system and - the initrd.

If /etc/crypttab contains entries with - the same UUID, then the name, keyfile and options - specified there will be used. Otherwise the device - will have the name "luks-UUID".

If /etc/crypttab exists, only those UUIDs - specified on the kernel command line - will be activated in the initrd or the real root.

luks.name=, rd.luks.name=¶

Takes a LUKS super - block UUID followed by an '=' and a name. This implies - rd.luks.uuid= or luks.uuid= - and will additionally make the LUKS device given by - the UUID appear under the provided name.

rd.luks.name= - is honored only by initial RAM disk - (initrd) while - luks.name= is - honored by both the main system and - the initrd.

luks.options=, rd.luks.options=¶

Takes a LUKS super - block UUID followed by an '=' and a string - of options separated by commas as argument. - This will override the options for the given - UUID.

If only a list of options, without an - UUID, is specified, they apply to any UUIDs not - specified elsewhere, and without an entry in - /etc/crypttab.

- rd.luks.options= - is honored only by initial RAM disk - (initrd) while - luks.options= is - honored by both the main system and - the initrd.

luks.key=, rd.luks.key=¶

Takes a password file name as argument or - a LUKS super block UUID followed by a '=' and a password - file name.

For those entries specified with - rd.luks.uuid= or luks.uuid=, - the password file will be set to the one specified by - rd.luks.key= or luks.key= - of the corresponding UUID, or the password file that was specified - without a UUID.

rd.luks.key= - is honored only by initial RAM disk - (initrd) while - luks.key= is - honored by both the main system and - the initrd.

+ gudev systemd 219

Name

systemd-cryptsetup-generator — Unit generator for /etc/crypttab

Synopsis

/usr/lib/systemd/system-generators/systemd-cryptsetup-generator

Description¶

systemd-cryptsetup-generator is a + generator that translates /etc/crypttab into + native systemd units early at boot and when configuration of the + system manager is reloaded. This will create + systemd-cryptsetup@.service(8) + units as necessary.

systemd-cryptsetup-generator + implements the generator + specification.

Kernel Command Line¶

systemd-cryptsetup-generator + understands the following kernel command line parameters:

luks=, rd.luks=¶

Takes a boolean argument. Defaults to + "yes". If "no", disables the + generator entirely. rd.luks= is honored + only by initial RAM disk (initrd) while + luks= is honored by both the main system + and the initrd.

luks.crypttab=, rd.luks.crypttab=¶

Takes a boolean argument. Defaults to + "yes". If "no", causes the + generator to ignore any devices configured in + /etc/crypttab + (luks.uuid= will still work however). + rd.luks.crypttab= is honored only by + initial RAM disk (initrd) while + luks.crypttab= is honored by both the main + system and the initrd.

luks.uuid=, rd.luks.uuid=¶

Takes a LUKS superblock UUID as argument. This + will activate the specified device as part of the boot process + as if it was listed in /etc/crypttab. + This option may be specified more than once in order to set up + multiple devices. rd.luks.uuid= is honored + only by initial RAM disk (initrd) while + luks.uuid= is honored by both the main + system and the initrd.

If /etc/crypttab contains entries with the same UUID, + then the name, keyfile and options specified there will be + used. Otherwise the device will have the name + "luks-UUID".

If /etc/crypttab exists, only those UUIDs + specified on the kernel command line + will be activated in the initrd or the real root.

luks.name=, rd.luks.name=¶

Takes a LUKS super block UUID followed by an + "=" and a name. This implies + rd.luks.uuid= or + luks.uuid= and will additionally make the + LUKS device given by the UUID appear under the provided + name.

rd.luks.name= is honored only by + initial RAM disk (initrd) while luks.name= + is honored by both the main system and the initrd.

luks.options=, rd.luks.options=¶

Takes a LUKS super block UUID followed by an + "=" and a string of options separated by + commas as argument. This will override the options for the + given UUID.

If only a list of options, without an UUID, is + specified, they apply to any UUIDs not specified elsewhere, + and without an entry in + /etc/crypttab.

+ rd.luks.options= is honored only by initial + RAM disk (initrd) while luks.options= is + honored by both the main system and the initrd.

luks.key=, rd.luks.key=¶

Takes a password file name as argument or a + LUKS super block UUID followed by a "=" and a + password file name.

For those entries specified with + rd.luks.uuid= or + luks.uuid=, the password file will be set + to the one specified by rd.luks.key= or + luks.key= of the corresponding UUID, or the + password file that was specified without a UUID.

rd.luks.key= + is honored only by initial RAM disk + (initrd) while + luks.key= is + honored by both the main system and + the initrd.

diff --git a/man/systemd-cryptsetup-generator.xml b/man/systemd-cryptsetup-generator.xml index c8753cef3..0e48e7934 100644 --- a/man/systemd-cryptsetup-generator.xml +++ b/man/systemd-cryptsetup-generator.xml @@ -21,199 +21,175 @@ --> - - systemd-cryptsetup-generator - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-cryptsetup-generator - 8 - - - - systemd-cryptsetup-generator - Unit generator for /etc/crypttab - - - - /usr/lib/systemd/system-generators/systemd-cryptsetup-generator - - - - Description - - systemd-cryptsetup-generator - is a generator that translates - /etc/crypttab into native systemd - units early at boot and when configuration of the - system manager is reloaded. This will create - systemd-cryptsetup@.service8 - units as necessary. - - systemd-cryptsetup-generator - implements the generator - specification. - - - - Kernel Command Line - - systemd-cryptsetup-generator understands - the following kernel command line parameters: - - - - luks= - rd.luks= - - Takes a boolean - argument. Defaults to - yes. If - no, disables the - generator - entirely. rd.luks= - is honored only by initial RAM disk - (initrd) while - luks= is honored - by both the main system and the - initrd. - - - - luks.crypttab= - rd.luks.crypttab= - - Takes a boolean - argument. Defaults to - yes. If - no, causes the - generator to ignore any devices - configured in - /etc/crypttab - (luks.uuid= will - still work - however). rd.luks.crypttab= - is honored only by initial RAM disk - (initrd) while - luks.crypttab= is - honored by both the main system and - the initrd. - - - - luks.uuid= - rd.luks.uuid= - - Takes a LUKS superblock - UUID as argument. This will - activate the specified device as part - of the boot process as if it was - listed in - /etc/crypttab. This - option may be specified more than once - in order to set up multiple - devices. rd.luks.uuid= - is honored only by initial RAM disk - (initrd) while - luks.uuid= is - honored by both the main system and - the initrd. - If /etc/crypttab contains entries with - the same UUID, then the name, keyfile and options - specified there will be used. Otherwise the device - will have the name luks-UUID. - If /etc/crypttab exists, only those UUIDs - specified on the kernel command line - will be activated in the initrd or the real root. - - - - - luks.name= - rd.luks.name= - - Takes a LUKS super - block UUID followed by an '=' and a name. This implies - rd.luks.uuid= or luks.uuid= - and will additionally make the LUKS device given by - the UUID appear under the provided name. - - rd.luks.name= - is honored only by initial RAM disk - (initrd) while - luks.name= is - honored by both the main system and - the initrd. - - - - - luks.options= - rd.luks.options= - - Takes a LUKS super - block UUID followed by an '=' and a string - of options separated by commas as argument. - This will override the options for the given - UUID. - If only a list of options, without an - UUID, is specified, they apply to any UUIDs not - specified elsewhere, and without an entry in - /etc/crypttab. - rd.luks.options= - is honored only by initial RAM disk - (initrd) while - luks.options= is - honored by both the main system and - the initrd. - - - - - luks.key= - rd.luks.key= - - Takes a password file name as argument or - a LUKS super block UUID followed by a '=' and a password - file name. - - For those entries specified with - rd.luks.uuid= or luks.uuid=, - the password file will be set to the one specified by - rd.luks.key= or luks.key= - of the corresponding UUID, or the password file that was specified - without a UUID. - rd.luks.key= - is honored only by initial RAM disk - (initrd) while - luks.key= is - honored by both the main system and - the initrd. - - - - - - - See Also - - systemd1, - crypttab5, - systemd-cryptsetup@.service8, - cryptsetup8, - systemd-fstab-generator8 - - + + systemd-cryptsetup-generator + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-cryptsetup-generator + 8 + + + + systemd-cryptsetup-generator + Unit generator for /etc/crypttab + + + + /usr/lib/systemd/system-generators/systemd-cryptsetup-generator + + + + Description + + systemd-cryptsetup-generator is a + generator that translates /etc/crypttab into + native systemd units early at boot and when configuration of the + system manager is reloaded. This will create + systemd-cryptsetup@.service8 + units as necessary. + + systemd-cryptsetup-generator + implements the generator + specification. + + + + Kernel Command Line + + systemd-cryptsetup-generator + understands the following kernel command line parameters: + + + + luks= + rd.luks= + + Takes a boolean argument. Defaults to + yes. If no, disables the + generator entirely. rd.luks= is honored + only by initial RAM disk (initrd) while + luks= is honored by both the main system + and the initrd. + + + + luks.crypttab= + rd.luks.crypttab= + + Takes a boolean argument. Defaults to + yes. If no, causes the + generator to ignore any devices configured in + /etc/crypttab + (luks.uuid= will still work however). + rd.luks.crypttab= is honored only by + initial RAM disk (initrd) while + luks.crypttab= is honored by both the main + system and the initrd. + + + + luks.uuid= + rd.luks.uuid= + + Takes a LUKS superblock UUID as argument. This + will activate the specified device as part of the boot process + as if it was listed in /etc/crypttab. + This option may be specified more than once in order to set up + multiple devices. rd.luks.uuid= is honored + only by initial RAM disk (initrd) while + luks.uuid= is honored by both the main + system and the initrd. + If /etc/crypttab contains entries with the same UUID, + then the name, keyfile and options specified there will be + used. Otherwise the device will have the name + luks-UUID. + If /etc/crypttab exists, only those UUIDs + specified on the kernel command line + will be activated in the initrd or the real root. + + + + + luks.name= + rd.luks.name= + + Takes a LUKS super block UUID followed by an + = and a name. This implies + rd.luks.uuid= or + luks.uuid= and will additionally make the + LUKS device given by the UUID appear under the provided + name. + + rd.luks.name= is honored only by + initial RAM disk (initrd) while luks.name= + is honored by both the main system and the initrd. + + + + + luks.options= + rd.luks.options= + + Takes a LUKS super block UUID followed by an + = and a string of options separated by + commas as argument. This will override the options for the + given UUID. + If only a list of options, without an UUID, is + specified, they apply to any UUIDs not specified elsewhere, + and without an entry in + /etc/crypttab. + rd.luks.options= is honored only by initial + RAM disk (initrd) while luks.options= is + honored by both the main system and the initrd. + + + + + luks.key= + rd.luks.key= + + Takes a password file name as argument or a + LUKS super block UUID followed by a = and a + password file name. + + For those entries specified with + rd.luks.uuid= or + luks.uuid=, the password file will be set + to the one specified by rd.luks.key= or + luks.key= of the corresponding UUID, or the + password file that was specified without a UUID. + rd.luks.key= + is honored only by initial RAM disk + (initrd) while + luks.key= is + honored by both the main system and + the initrd. + + + + + + + See Also + + systemd1, + crypttab5, + systemd-cryptsetup@.service8, + cryptsetup8, + systemd-fstab-generator8 + + diff --git a/man/systemd-cryptsetup.html b/man/systemd-cryptsetup.html index 86af65a96..911bc2123 100644 --- a/man/systemd-cryptsetup.html +++ b/man/systemd-cryptsetup.html @@ -19,21 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-cryptsetup@.service, systemd-cryptsetup — Full disk decryption logic

Synopsis

systemd-cryptsetup@.service

/usr/lib/systemd/systemd-cryptsetup

Description¶

systemd-cryptsetup@.service - is a service responsible for setting up encrypted - block devices. It is instantiated for each device that - requires decryption for access.

systemd-cryptsetup@.service - will ask for hard disk passwords via the - password agent logic, in order to query the - user for the password using the right mechanism at - boot and during runtime.

At early boot and when the system manager - configuration is reloaded this - /etc/crypttab is translated into - systemd-cryptsetup@.service units - by - systemd-cryptsetup-generator(8).

+ gudev systemd 219

Name

systemd-cryptsetup@.service, systemd-cryptsetup — Full disk decryption logic

Synopsis

systemd-cryptsetup@.service

/usr/lib/systemd/systemd-cryptsetup

Description¶

systemd-cryptsetup@.service is a + service responsible for setting up encrypted block devices. It is + instantiated for each device that requires decryption for + access.

systemd-cryptsetup@.service will ask + for hard disk passwords via the + password agent logic, in order to query the user for the + password using the right mechanism at boot and during + runtime.

At early boot and when the system manager configuration is + reloaded this /etc/crypttab is translated + into systemd-cryptsetup@.service units by + systemd-cryptsetup-generator(8).

diff --git a/man/systemd-cryptsetup@.service.8 b/man/systemd-cryptsetup@.service.8 index 162b0b3e2..30c8fcd23 100644 --- a/man/systemd-cryptsetup@.service.8 +++ b/man/systemd-cryptsetup@.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-CRYPTSETUP@\&.SERVICE" "8" "" "systemd 218" "systemd-cryptsetup@.service" +.TH "SYSTEMD\-CRYPTSETUP@\&.SERVICE" "8" "" "systemd 219" "systemd-cryptsetup@.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-cryptsetup@.service.html b/man/systemd-cryptsetup@.service.html index 86af65a96..911bc2123 100644 --- a/man/systemd-cryptsetup@.service.html +++ b/man/systemd-cryptsetup@.service.html @@ -19,21 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-cryptsetup@.service, systemd-cryptsetup — Full disk decryption logic

Synopsis

systemd-cryptsetup@.service

/usr/lib/systemd/systemd-cryptsetup

Description¶

systemd-cryptsetup@.service - is a service responsible for setting up encrypted - block devices. It is instantiated for each device that - requires decryption for access.

systemd-cryptsetup@.service - will ask for hard disk passwords via the - password agent logic, in order to query the - user for the password using the right mechanism at - boot and during runtime.

At early boot and when the system manager - configuration is reloaded this - /etc/crypttab is translated into - systemd-cryptsetup@.service units - by - systemd-cryptsetup-generator(8).

+ gudev systemd 219

Name

systemd-cryptsetup@.service, systemd-cryptsetup — Full disk decryption logic

Synopsis

systemd-cryptsetup@.service

/usr/lib/systemd/systemd-cryptsetup

Description¶

systemd-cryptsetup@.service is a + service responsible for setting up encrypted block devices. It is + instantiated for each device that requires decryption for + access.

systemd-cryptsetup@.service will ask + for hard disk passwords via the + password agent logic, in order to query the user for the + password using the right mechanism at boot and during + runtime.

At early boot and when the system manager configuration is + reloaded this /etc/crypttab is translated + into systemd-cryptsetup@.service units by + systemd-cryptsetup-generator(8).

diff --git a/man/systemd-cryptsetup@.service.xml b/man/systemd-cryptsetup@.service.xml index 6fa2e0cdd..bd03637de 100644 --- a/man/systemd-cryptsetup@.service.xml +++ b/man/systemd-cryptsetup@.service.xml @@ -21,67 +21,65 @@ --> - - systemd-cryptsetup@.service - systemd + + systemd-cryptsetup@.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-cryptsetup@.service - 8 - + + systemd-cryptsetup@.service + 8 + - - systemd-cryptsetup@.service - systemd-cryptsetup - Full disk decryption logic - + + systemd-cryptsetup@.service + systemd-cryptsetup + Full disk decryption logic + - - systemd-cryptsetup@.service - /usr/lib/systemd/systemd-cryptsetup - + + systemd-cryptsetup@.service + /usr/lib/systemd/systemd-cryptsetup + - - Description + + Description - systemd-cryptsetup@.service - is a service responsible for setting up encrypted - block devices. It is instantiated for each device that - requires decryption for access. + systemd-cryptsetup@.service is a + service responsible for setting up encrypted block devices. It is + instantiated for each device that requires decryption for + access. - systemd-cryptsetup@.service - will ask for hard disk passwords via the - password agent logic, in order to query the - user for the password using the right mechanism at - boot and during runtime. + systemd-cryptsetup@.service will ask + for hard disk passwords via the + password agent logic, in order to query the user for the + password using the right mechanism at boot and during + runtime. - At early boot and when the system manager - configuration is reloaded this - /etc/crypttab is translated into - systemd-cryptsetup@.service units - by - systemd-cryptsetup-generator8. - + At early boot and when the system manager configuration is + reloaded this /etc/crypttab is translated + into systemd-cryptsetup@.service units by + systemd-cryptsetup-generator8. + - - See Also - - systemd1, - systemd-cryptsetup-generator8, - crypttab5, - cryptsetup8 - - + + See Also + + systemd1, + systemd-cryptsetup-generator8, + crypttab5, + cryptsetup8 + + diff --git a/man/systemd-debug-generator.8 b/man/systemd-debug-generator.8 index ee5ea6da6..452168edb 100644 --- a/man/systemd-debug-generator.8 +++ b/man/systemd-debug-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-DEBUG\-GENERATOR" "8" "" "systemd 218" "systemd-debug-generator" +.TH "SYSTEMD\-DEBUG\-GENERATOR" "8" "" "systemd 219" "systemd-debug-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-debug-generator.html b/man/systemd-debug-generator.html index d6d0b831c..72d8de52c 100644 --- a/man/systemd-debug-generator.html +++ b/man/systemd-debug-generator.html @@ -19,30 +19,29 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-debug-generator — Generator for enabling a runtime debug shell and masking specific units at boot

Synopsis

/usr/lib/systemd/system-generators/systemd-debug-generator

Description¶

systemd-debug-generator is - a generator that reads the kernel command line and - understands three options:

If the systemd.mask= option is - specified and followed by a unit name, this unit is - masked for the runtime, similar to the effect of - systemctl(1)'s - mask command. This is useful to - boot with certain units removed from the initial boot - transaction for debugging system startup. May be - specified more than once.

If the systemd.wants= option is - specified and followed by a unit name, a start job for - this unit is added to the initial transaction. This is - useful to start one or more additional units at - boot. May be specified more than once.

If the systemd.debug-shell - option is specified, the debug shell service - "debug-shell.service" is pulled into - the boot transaction. It will spawn a debug shell on - tty9 during early system startup. Note that the shell - may also be turned on persistently by enabling it with - systemctl(1)'s - enable command.

systemd-debug-generator - implements the generator - specification.

+ gudev systemd 219

Name

systemd-debug-generator — Generator for enabling a runtime debug shell and + masking specific units at boot

Synopsis

/usr/lib/systemd/system-generators/systemd-debug-generator

Description¶

systemd-debug-generator is a generator + that reads the kernel command line and understands three + options:

If the systemd.mask= option is specified + and followed by a unit name, this unit is masked for the runtime, + similar to the effect of + systemctl(1)'s + mask command. This is useful to boot with + certain units removed from the initial boot transaction for + debugging system startup. May be specified more than once.

If the systemd.wants= option is specified + and followed by a unit name, a start job for this unit is added to + the initial transaction. This is useful to start one or more + additional units at boot. May be specified more than once.

If the systemd.debug-shell option is + specified, the debug shell service + "debug-shell.service" is pulled into the boot + transaction. It will spawn a debug shell on tty9 during early + system startup. Note that the shell may also be turned on + persistently by enabling it with + systemctl(1)'s + enable command.

systemd-debug-generator implements the + generator + specification.

diff --git a/man/systemd-debug-generator.xml b/man/systemd-debug-generator.xml index a2bef5fe2..74c3b2620 100644 --- a/man/systemd-debug-generator.xml +++ b/man/systemd-debug-generator.xml @@ -21,78 +21,77 @@ --> - - systemd-debug-generator - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-debug-generator - 8 - - - - systemd-debug-generator - Generator for enabling a runtime debug shell and masking specific units at boot - - - - /usr/lib/systemd/system-generators/systemd-debug-generator - - - - Description - - systemd-debug-generator is - a generator that reads the kernel command line and - understands three options: - - If the option is - specified and followed by a unit name, this unit is - masked for the runtime, similar to the effect of - systemctl1's - mask command. This is useful to - boot with certain units removed from the initial boot - transaction for debugging system startup. May be - specified more than once. - - If the option is - specified and followed by a unit name, a start job for - this unit is added to the initial transaction. This is - useful to start one or more additional units at - boot. May be specified more than once. - - If the - option is specified, the debug shell service - debug-shell.service is pulled into - the boot transaction. It will spawn a debug shell on - tty9 during early system startup. Note that the shell - may also be turned on persistently by enabling it with - systemctl1's - enable command. - - systemd-debug-generator - implements the generator - specification. - - - - See Also - - systemd1, - systemctl1, - kernel-command-line7 - - + + systemd-debug-generator + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-debug-generator + 8 + + + + systemd-debug-generator + Generator for enabling a runtime debug shell and + masking specific units at boot + + + + /usr/lib/systemd/system-generators/systemd-debug-generator + + + + Description + + systemd-debug-generator is a generator + that reads the kernel command line and understands three + options: + + If the option is specified + and followed by a unit name, this unit is masked for the runtime, + similar to the effect of + systemctl1's + mask command. This is useful to boot with + certain units removed from the initial boot transaction for + debugging system startup. May be specified more than once. + + If the option is specified + and followed by a unit name, a start job for this unit is added to + the initial transaction. This is useful to start one or more + additional units at boot. May be specified more than once. + + If the option is + specified, the debug shell service + debug-shell.service is pulled into the boot + transaction. It will spawn a debug shell on tty9 during early + system startup. Note that the shell may also be turned on + persistently by enabling it with + systemctl1's + enable command. + + systemd-debug-generator implements the + generator + specification. + + + + See Also + + systemd1, + systemctl1, + kernel-command-line7 + + diff --git a/man/systemd-delta.1 b/man/systemd-delta.1 index 8607e8e82..7b1307914 100644 --- a/man/systemd-delta.1 +++ b/man/systemd-delta.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-DELTA" "1" "" "systemd 218" "systemd-delta" +.TH "SYSTEMD\-DELTA" "1" "" "systemd 219" "systemd-delta" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -77,7 +77,9 @@ Show overridden, and changed files\&. .PP \fIextended\fR .RS 4 -Show *\&.conf files in drop\-in directories for units\&. +Show +*\&.conf +files in drop\-in directories for units\&. .RE .PP \fIunchanged\fR diff --git a/man/systemd-delta.html b/man/systemd-delta.html index 3b706a0a9..2c69d3bd2 100644 --- a/man/systemd-delta.html +++ b/man/systemd-delta.html @@ -19,64 +19,53 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-delta — Find overridden configuration files

Synopsis

systemd-delta [OPTIONS...] [PREFIX[/SUFFIX]|SUFFIX...]

Description¶

systemd-delta may be used to - identify and compare configuration files that override - other configuration files. Files in - /etc have highest priority, files - in /run have the second highest - priority, ..., files in /lib have - lowest priority. Files in a directory with higher - priority override files with the same name in - directories of lower priority. In addition, certain - configuration files can have ".d" - directories which contain "drop-in" files with - configuration snippets which augment the main - configuration file. "Drop-in" files can be overriden - in the same way by placing files with the same name in - a directory of higher priority (except that in case of - "drop-in" files, both the "drop-in" file name and the - name of the containing directory, which corresponds to - the name of the main configuration file, must match). - For a fuller explanation, see - systemd.unit(5). -

The command line argument will be split into a - prefix and a suffix. Either is optional. The prefix - must be one of the directories containing - configuration files (/etc, - /run, - /usr/lib, ...). If it is given, - only overriding files contained in this directory will - be shown. Otherwise, all overriding files will be - shown. The suffix must be a name of a subdirectory - containing configuration files like - tmpfiles.d, - sysctl.d or - systemd/system. If it is given, - only configuration files in this subdirectory (across - all configuration paths) will be analyzed. Otherwise, - all configuration files will be analyzed. If the - command line argument is not given at all, all - configuration files will be analyzed. See below for - some examples.

Options¶

The following options are understood:

-t, --type=¶

When listing the - differences, only list those that are - asked for. The list itself is a - comma-separated list of desired - difference types.

Recognized types are: + gudev systemd 219


Name

systemd-delta — Find overridden configuration files

Synopsis

systemd-delta [OPTIONS...] [PREFIX[/SUFFIX]|SUFFIX...]

Description¶

systemd-delta may be used to identify and + compare configuration files that override other configuration + files. Files in /etc have highest priority, + files in /run have the second highest + priority, ..., files in /lib have lowest + priority. Files in a directory with higher priority override files + with the same name in directories of lower priority. In addition, + certain configuration files can have ".d" + directories which contain "drop-in" files with configuration + snippets which augment the main configuration file. "Drop-in" + files can be overriden in the same way by placing files with the + same name in a directory of higher priority (except that in case + of "drop-in" files, both the "drop-in" file name and the name of + the containing directory, which corresponds to the name of the + main configuration file, must match). For a fuller explanation, + see + systemd.unit(5). +

The command line argument will be split into a prefix and a + suffix. Either is optional. The prefix must be one of the + directories containing configuration files + (/etc, /run, + /usr/lib, ...). If it is given, only + overriding files contained in this directory will be shown. + Otherwise, all overriding files will be shown. The suffix must be + a name of a subdirectory containing configuration files like + tmpfiles.d, sysctl.d or + systemd/system. If it is given, only + configuration files in this subdirectory (across all configuration + paths) will be analyzed. Otherwise, all configuration files will + be analyzed. If the command line argument is not given at all, all + configuration files will be analyzed. See below for some + examples.

Options¶

The following options are understood:

-t, --type=¶

When listing the differences, only list those + that are asked for. The list itself is a comma-separated list + of desired difference types.

Recognized types are: -

masked¶

Show masked files

equivalent¶

Show overridden - files that while overridden, do - not differ in content.

redirected¶

Show files that - are redirected to another.

overridden¶

Show overridden, - and changed files.

extended¶

Show *.conf files in drop-in - directories for units.

unchanged¶

Show unmodified - files too.

-

--diff=¶

When showing modified - files, when a file is overridden show a - diff as well. This option takes a - boolean argument. If omitted, it defaults - to true.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Examples¶

To see all local configuration:

systemd-delta

To see all runtime configuration:

systemd-delta /run

To see all system unit configuration changes:

systemd-delta systemd/system

To see all runtime "drop-in" changes for system units:

systemd-delta --type=extended /run/systemd/system

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+

masked¶

Show masked files

equivalent¶

Show overridden files that while + overridden, do not differ in content.

redirected¶

Show files that are redirected to + another.

overridden¶

Show overridden, and changed + files.

extended¶

Show *.conf files + in drop-in directories for units.

unchanged¶

Show unmodified files + too.

+

--diff=¶

When showing modified files, when a file is + overridden show a diff as well. This option takes a boolean + argument. If omitted, it defaults to + true.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

Examples¶

To see all local configuration:

systemd-delta

To see all runtime configuration:

systemd-delta /run

To see all system unit configuration changes:

systemd-delta systemd/system

To see all runtime "drop-in" changes for system units:

systemd-delta --type=extended /run/systemd/system

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-delta.xml b/man/systemd-delta.xml index 2175f9655..fd81b2c90 100644 --- a/man/systemd-delta.xml +++ b/man/systemd-delta.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-delta - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-delta - 1 - - - - systemd-delta - Find overridden configuration files - - - - - systemd-delta - OPTIONS - PREFIX/SUFFIX|SUFFIX - - - - - Description - - systemd-delta may be used to - identify and compare configuration files that override - other configuration files. Files in - /etc have highest priority, files - in /run have the second highest - priority, ..., files in /lib have - lowest priority. Files in a directory with higher - priority override files with the same name in - directories of lower priority. In addition, certain - configuration files can have .d - directories which contain "drop-in" files with - configuration snippets which augment the main - configuration file. "Drop-in" files can be overriden - in the same way by placing files with the same name in - a directory of higher priority (except that in case of - "drop-in" files, both the "drop-in" file name and the - name of the containing directory, which corresponds to - the name of the main configuration file, must match). - For a fuller explanation, see - systemd.unit5. - - - The command line argument will be split into a - prefix and a suffix. Either is optional. The prefix - must be one of the directories containing - configuration files (/etc, - /run, - /usr/lib, ...). If it is given, - only overriding files contained in this directory will - be shown. Otherwise, all overriding files will be - shown. The suffix must be a name of a subdirectory - containing configuration files like - tmpfiles.d, - sysctl.d or - systemd/system. If it is given, - only configuration files in this subdirectory (across - all configuration paths) will be analyzed. Otherwise, - all configuration files will be analyzed. If the - command line argument is not given at all, all - configuration files will be analyzed. See below for - some examples. - - - - Options - - The following options are understood: - - - - - - - When listing the - differences, only list those that are - asked for. The list itself is a - comma-separated list of desired - difference types. - - Recognized types are: - - - - masked - - Show masked files - - - - equivalent - - Show overridden - files that while overridden, do - not differ in content. - - - - redirected - - Show files that - are redirected to another. - - - - overridden - - Show overridden, - and changed files. - - - - extended - - Show *.conf files in drop-in - directories for units. - - - - unchanged - - Show unmodified - files too. - - - - - - - - - When showing modified - files, when a file is overridden show a - diff as well. This option takes a - boolean argument. If omitted, it defaults - to . - - - - - - - - - - Examples - - To see all local configuration: - systemd-delta - - To see all runtime configuration: - systemd-delta /run - - To see all system unit configuration changes: - systemd-delta systemd/system - - To see all runtime "drop-in" changes for system units: - systemd-delta --type=extended /run/systemd/system - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-delta + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-delta + 1 + + + + systemd-delta + Find overridden configuration files + + + + + systemd-delta + OPTIONS + PREFIX/SUFFIX|SUFFIX + + + + + Description + + systemd-delta may be used to identify and + compare configuration files that override other configuration + files. Files in /etc have highest priority, + files in /run have the second highest + priority, ..., files in /lib have lowest + priority. Files in a directory with higher priority override files + with the same name in directories of lower priority. In addition, + certain configuration files can have .d + directories which contain "drop-in" files with configuration + snippets which augment the main configuration file. "Drop-in" + files can be overriden in the same way by placing files with the + same name in a directory of higher priority (except that in case + of "drop-in" files, both the "drop-in" file name and the name of + the containing directory, which corresponds to the name of the + main configuration file, must match). For a fuller explanation, + see + systemd.unit5. + + + The command line argument will be split into a prefix and a + suffix. Either is optional. The prefix must be one of the + directories containing configuration files + (/etc, /run, + /usr/lib, ...). If it is given, only + overriding files contained in this directory will be shown. + Otherwise, all overriding files will be shown. The suffix must be + a name of a subdirectory containing configuration files like + tmpfiles.d, sysctl.d or + systemd/system. If it is given, only + configuration files in this subdirectory (across all configuration + paths) will be analyzed. Otherwise, all configuration files will + be analyzed. If the command line argument is not given at all, all + configuration files will be analyzed. See below for some + examples. + + + + Options + + The following options are understood: + + + + + + + When listing the differences, only list those + that are asked for. The list itself is a comma-separated list + of desired difference types. + + Recognized types are: + + + + masked + + Show masked files + + + + equivalent + + Show overridden files that while + overridden, do not differ in content. + + + + redirected + + Show files that are redirected to + another. + + + + overridden + + Show overridden, and changed + files. + + + + extended + + Show *.conf files + in drop-in directories for units. + + + + unchanged + + Show unmodified files + too. + + + + + + + + + When showing modified files, when a file is + overridden show a diff as well. This option takes a boolean + argument. If omitted, it defaults to + . + + + + + + + + + + Examples + + To see all local configuration: + systemd-delta + + To see all runtime configuration: + systemd-delta /run + + To see all system unit configuration changes: + systemd-delta systemd/system + + To see all runtime "drop-in" changes for system units: + systemd-delta --type=extended /run/systemd/system + - - Exit status + + Exit status - On success, 0 is returned, a non-zero failure - code otherwise. - + On success, 0 is returned, a non-zero failure code + otherwise. + - - See Also - - systemd1, - systemd.unit5 - - + + See Also + + systemd1, + systemd.unit5 + + diff --git a/man/systemd-detect-virt.1 b/man/systemd-detect-virt.1 index 79923789f..ee6fd39f6 100644 --- a/man/systemd-detect-virt.1 +++ b/man/systemd-detect-virt.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-DETECT\-VIRT" "1" "" "systemd 218" "systemd-detect-virt" +.TH "SYSTEMD\-DETECT\-VIRT" "1" "" "systemd 219" "systemd-detect-virt" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-detect-virt.html b/man/systemd-detect-virt.html index 209799db1..b0078ef8d 100644 --- a/man/systemd-detect-virt.html +++ b/man/systemd-detect-virt.html @@ -19,38 +19,30 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-detect-virt — Detect execution in a virtualized environment

Synopsis

systemd-detect-virt [OPTIONS...]

Description¶

systemd-detect-virt detects - execution in a virtualized environment. It identifies - the virtualization technology and can distinguish full - VM virtualization from container - virtualization. systemd-detect-virt - exits with a return value of 0 (success) if a - virtualization technology is detected, and non-zero - (error) otherwise. By default any type of - virtualization is detected, and the options - --container and --vm - can be used to limit what types of virtualization are - detected.

When executed without --quiet - will print a short identifier for the detected - virtualization technology. The following technologies - are currently identified:

Table 1. Known virtualization technologies (both - VM, i.e. full hardware virtualization, - and container, i.e. shared kernel virtualization)

TypeIDProduct
VMqemuQEMU software virtualization
kvmLinux KVM kernel virtual machine
zvms390 z/VM
vmwareVMware Workstation or Server, and related products
microsoftHyper-V, also known as Viridian or Windows Server Virtualization
oracleOracle VM VirtualBox (historically marketed by innotek and Sun Microsystems)
xenXen hypervisor (only domU, not dom0)
bochsBochs Emulator
umlUser-mode Linux
containeropenvzOpenVZ/Virtuozzo
lxcLinux container implementation by LXC
lxc-libvirtLinux container implementation by libvirt
systemd-nspawnsystemd's minimal container implementation, see systemd-nspawn(1)
dockerDocker container manager

If multiple virtualization solutions are used, - only the "innermost" is detected and identified. That - means if both VM virtualization and container - virtualization are used in conjunction, only the latter - will be identified (unless --vm is - passed).

Options¶

The following options are understood:

-c, --container¶

Only detects container - virtualization (i.e. shared kernel - virtualization).

-v, --vm¶

Only detects VM - virtualization (i.e. full hardware - virtualization).

-q, --quiet¶

Suppress output of the - virtualization technology - identifier.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

If a virtualization technology is detected, 0 is - returned, a non-zero code otherwise.

+ gudev systemd 219

Name

systemd-detect-virt — Detect execution in a virtualized environment

Synopsis

systemd-detect-virt [OPTIONS...]

Description¶

systemd-detect-virt detects execution in + a virtualized environment. It identifies the virtualization + technology and can distinguish full VM virtualization from + container virtualization. systemd-detect-virt + exits with a return value of 0 (success) if a virtualization + technology is detected, and non-zero (error) otherwise. By default + any type of virtualization is detected, and the options + --container and --vm can be used + to limit what types of virtualization are detected.

When executed without --quiet will print a + short identifier for the detected virtualization technology. The + following technologies are currently identified:

Table 1. Known virtualization technologies (both + VM, i.e. full hardware virtualization, + and container, i.e. shared kernel virtualization)

TypeIDProduct
VMqemuQEMU software virtualization
kvmLinux KVM kernel virtual machine
zvms390 z/VM
vmwareVMware Workstation or Server, and related products
microsoftHyper-V, also known as Viridian or Windows Server Virtualization
oracleOracle VM VirtualBox (historically marketed by innotek and Sun Microsystems)
xenXen hypervisor (only domU, not dom0)
bochsBochs Emulator
umlUser-mode Linux
containeropenvzOpenVZ/Virtuozzo
lxcLinux container implementation by LXC
lxc-libvirtLinux container implementation by libvirt
systemd-nspawnsystemd's minimal container implementation, see systemd-nspawn(1)
dockerDocker container manager

If multiple virtualization solutions are used, only the + "innermost" is detected and identified. That means if both VM + virtualization and container virtualization are used in + conjunction, only the latter will be identified (unless + --vm is passed).

Options¶

The following options are understood:

-c, --container¶

Only detects container virtualization (i.e. + shared kernel virtualization).

-v, --vm¶

Only detects VM virtualization (i.e. full + hardware virtualization).

-q, --quiet¶

Suppress output of the virtualization + technology identifier.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

If a virtualization technology is detected, 0 is returned, a + non-zero code otherwise.

diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml index d8e881cf2..40755a24d 100644 --- a/man/systemd-detect-virt.xml +++ b/man/systemd-detect-virt.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-detect-virt - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-detect-virt - 1 - - - - systemd-detect-virt - Detect execution in a virtualized environment - - - - - systemd-detect-virt OPTIONS - - - - - Description - - systemd-detect-virt detects - execution in a virtualized environment. It identifies - the virtualization technology and can distinguish full - VM virtualization from container - virtualization. systemd-detect-virt - exits with a return value of 0 (success) if a - virtualization technology is detected, and non-zero - (error) otherwise. By default any type of - virtualization is detected, and the options - and - can be used to limit what types of virtualization are - detected. - - When executed without - will print a short identifier for the detected - virtualization technology. The following technologies - are currently identified: - - - Known virtualization technologies (both - VM, i.e. full hardware virtualization, - and container, i.e. shared kernel virtualization) - - - - - - - Type - ID - Product - - - - - VM - qemu - QEMU software virtualization - - - - kvm - Linux KVM kernel virtual machine - - - - zvm - s390 z/VM - - - - vmware - VMware Workstation or Server, and related products - - - - microsoft - Hyper-V, also known as Viridian or Windows Server Virtualization - - - - oracle - Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems) - - - - xen - Xen hypervisor (only domU, not dom0) - - - - bochs - Bochs Emulator - - - - uml - User-mode Linux - - - - container - openvz - OpenVZ/Virtuozzo - - - - lxc - Linux container implementation by LXC - - - - lxc-libvirt - Linux container implementation by libvirt - - - - systemd-nspawn - systemd's minimal container implementation, see systemd-nspawn1 - - - - docker - Docker container manager - - - -
- - If multiple virtualization solutions are used, - only the "innermost" is detected and identified. That - means if both VM virtualization and container - virtualization are used in conjunction, only the latter - will be identified (unless is - passed). -
- - - Options - - The following options are understood: - - - - - - - Only detects container - virtualization (i.e. shared kernel - virtualization). - - - - - - - Only detects VM - virtualization (i.e. full hardware - virtualization). - - - - - - - Suppress output of the - virtualization technology - identifier. - - - - - - - - - - Exit status - - If a virtualization technology is detected, 0 is - returned, a non-zero code otherwise. - - - - See Also - - systemd1, - systemd-nspawn1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-detect-virt + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-detect-virt + 1 + + + + systemd-detect-virt + Detect execution in a virtualized environment + + + + + systemd-detect-virt OPTIONS + + + + + Description + + systemd-detect-virt detects execution in + a virtualized environment. It identifies the virtualization + technology and can distinguish full VM virtualization from + container virtualization. systemd-detect-virt + exits with a return value of 0 (success) if a virtualization + technology is detected, and non-zero (error) otherwise. By default + any type of virtualization is detected, and the options + and can be used + to limit what types of virtualization are detected. + + When executed without will print a + short identifier for the detected virtualization technology. The + following technologies are currently identified: + + + Known virtualization technologies (both + VM, i.e. full hardware virtualization, + and container, i.e. shared kernel virtualization) + + + + + + + Type + ID + Product + + + + + VM + qemu + QEMU software virtualization + + + + kvm + Linux KVM kernel virtual machine + + + + zvm + s390 z/VM + + + + vmware + VMware Workstation or Server, and related products + + + + microsoft + Hyper-V, also known as Viridian or Windows Server Virtualization + + + + oracle + Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems) + + + + xen + Xen hypervisor (only domU, not dom0) + + + + bochs + Bochs Emulator + + + + uml + User-mode Linux + + + + container + openvz + OpenVZ/Virtuozzo + + + + lxc + Linux container implementation by LXC + + + + lxc-libvirt + Linux container implementation by libvirt + + + + systemd-nspawn + systemd's minimal container implementation, see systemd-nspawn1 + + + + docker + Docker container manager + + + +
+ + If multiple virtualization solutions are used, only the + "innermost" is detected and identified. That means if both VM + virtualization and container virtualization are used in + conjunction, only the latter will be identified (unless + is passed). +
+ + + Options + + The following options are understood: + + + + + + + Only detects container virtualization (i.e. + shared kernel virtualization). + + + + + + + Only detects VM virtualization (i.e. full + hardware virtualization). + + + + + + + Suppress output of the virtualization + technology identifier. + + + + + + + + + + Exit status + + If a virtualization technology is detected, 0 is returned, a + non-zero code otherwise. + + + + See Also + + systemd1, + systemd-nspawn1 + +
diff --git a/man/systemd-efi-boot-generator.8 b/man/systemd-efi-boot-generator.8 index 6a3b6b692..521e67fd4 100644 --- a/man/systemd-efi-boot-generator.8 +++ b/man/systemd-efi-boot-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-EFI\-BOOT\-GENERATOR" "8" "" "systemd 218" "systemd-efi-boot-generator" +.TH "SYSTEMD\-EFI\-BOOT\-GENERATOR" "8" "" "systemd 219" "systemd-efi-boot-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-efi-boot-generator.html b/man/systemd-efi-boot-generator.html index 22b6deba1..083ac5844 100644 --- a/man/systemd-efi-boot-generator.html +++ b/man/systemd-efi-boot-generator.html @@ -19,26 +19,26 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-efi-boot-generator — Generator for automatically mounting the - EFI System Partition used by the current boot to - /boot

Synopsis

/usr/lib/systemd/system-generators/systemd-efi-boot-generator

Description¶

systemd-efi-boot-generator - is a generator that automatically creates mount and - automount units for the EFI System Partition (ESP), - mounting it to /boot. Note that - this generator will execute no operation on non-EFI - systems, on systems where the boot loader does not - communicate the used ESP to the OS, on systems where - /boot is an explicitly configured - mount (for example, listed in fstab(5)) or where the /boot mount - point is non-empty. Since this generator creates an - automount unit, the mount will only be activated - on-demand, when accessed.

systemd-efi-boot-generator - implements the generator - specification.

+ gudev systemd 219

Name

systemd-efi-boot-generator — Generator for automatically mounting the + EFI System Partition used by the current boot to + /boot

Synopsis

/usr/lib/systemd/system-generators/systemd-efi-boot-generator

Description¶

systemd-efi-boot-generator is a + generator that automatically creates mount and automount units for + the EFI System Partition (ESP), mounting it to + /boot. Note that this generator will execute + no operation on non-EFI systems, on systems where the boot loader + does not communicate the used ESP to the OS, on systems where + /boot is an explicitly configured mount (for + example, listed in + fstab(5)) + or where the /boot mount point is non-empty. + Since this generator creates an automount unit, the mount will + only be activated on-demand, when accessed.

systemd-efi-boot-generator implements + the generator + specification.

diff --git a/man/systemd-efi-boot-generator.xml b/man/systemd-efi-boot-generator.xml index 3a79dfb8d..b2d8d65e3 100644 --- a/man/systemd-efi-boot-generator.xml +++ b/man/systemd-efi-boot-generator.xml @@ -21,68 +21,68 @@ --> - - systemd-efi-boot-generator - systemd + + systemd-efi-boot-generator + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-efi-boot-generator - 8 - + + systemd-efi-boot-generator + 8 + - - systemd-efi-boot-generator - Generator for automatically mounting the - EFI System Partition used by the current boot to - /boot - + + systemd-efi-boot-generator + Generator for automatically mounting the + EFI System Partition used by the current boot to + /boot + - - /usr/lib/systemd/system-generators/systemd-efi-boot-generator - + + /usr/lib/systemd/system-generators/systemd-efi-boot-generator + - - Description + + Description - systemd-efi-boot-generator - is a generator that automatically creates mount and - automount units for the EFI System Partition (ESP), - mounting it to /boot. Note that - this generator will execute no operation on non-EFI - systems, on systems where the boot loader does not - communicate the used ESP to the OS, on systems where - /boot is an explicitly configured - mount (for example, listed in fstab5) or where the /boot mount - point is non-empty. Since this generator creates an - automount unit, the mount will only be activated - on-demand, when accessed. + systemd-efi-boot-generator is a + generator that automatically creates mount and automount units for + the EFI System Partition (ESP), mounting it to + /boot. Note that this generator will execute + no operation on non-EFI systems, on systems where the boot loader + does not communicate the used ESP to the OS, on systems where + /boot is an explicitly configured mount (for + example, listed in + fstab5) + or where the /boot mount point is non-empty. + Since this generator creates an automount unit, the mount will + only be activated on-demand, when accessed. - systemd-efi-boot-generator - implements the generator - specification. - + systemd-efi-boot-generator implements + the generator + specification. + - - See Also - - systemd1, - systemd.mount5, - systemd.automount5, - systemd-gpt-auto-generator8, - gummiboot8, - fstab5 - - + + See Also + + systemd1, + systemd.mount5, + systemd.automount5, + systemd-gpt-auto-generator8, + gummiboot8, + fstab5 + + diff --git a/man/systemd-escape.1 b/man/systemd-escape.1 index 99174dd87..5958cdc4d 100644 --- a/man/systemd-escape.1 +++ b/man/systemd-escape.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-ESCAPE" "1" "" "systemd 218" "systemd-escape" +.TH "SYSTEMD\-ESCAPE" "1" "" "systemd 219" "systemd-escape" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -22,8 +22,8 @@ .SH "NAME" systemd-escape \- Escape strings for usage in system unit names .SH "SYNOPSIS" -.HP \w'\fBsystemd\-escape\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB[STRING...]\fR\ 'u -\fBsystemd\-escape \fR\fB[OPTIONS...]\fR\fB \fR\fB[STRING...]\fR +.HP \w'\fBsystemd\-escape\fR\ 'u +\fBsystemd\-escape\fR [OPTIONS...] [STRING...] .SH "DESCRIPTION" .PP \fBsystemd\-escape\fR diff --git a/man/systemd-escape.html b/man/systemd-escape.html index b46b88acd..77a939125 100644 --- a/man/systemd-escape.html +++ b/man/systemd-escape.html @@ -19,61 +19,44 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-escape — Escape strings for usage in system unit names

Synopsis

systemd-escape [OPTIONS...] [STRING...]

Description¶

systemd-escape may be used to - escape strings for inclusion in systemd unit - names. The command may be used to escape and to undo - escaping of strings.

The command takes any number of strings on the - command line, and will process them individually, one - after the other. It will output them separated by - spaces to stdout.

By default this command will escape the strings - passed, unless --unescape is passed - which results in the inverse operation being - applied. If --mangle a special mode - of escaping is applied instead, which assumes a string - to be already escaped but will escape everything that - appears obviously non-escaped.

Options¶

The following options are understood:

--suffix=¶

Appends the specified - unit type suffix to the escaped - string. Takes one of the unit types - supported by systemd, such as - ".service" or - ".mount". May not be - used in conjunction with - --template=, - --unescape or - --mangle.

--template=¶

Inserts the escaped - strings in a unit name template. Takes - a unit name template such as - foobar@.service - May not be used in conjunction with - --suffix=, - --unescape or - --mangle.

--path, -p¶

When escaping or - unescaping a string, assume it refers - to a file system path. This enables - special processing of the initial - "/" of the - path.

--unescape¶

Instead of escaping - the specified strings, undo the - escaping, reversing the operation. May - not be used in conjunction with - --suffix=, - --template= or - --mangle.

--mangle¶

Like - --escape, but only - escape characters that are obviously - not escaped yet, and possibly - automatically append an appropriate - unit type suffix to the string. May - not be used in conjunction with - --suffix=, - --template= or - --unescape.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Examples¶

Escape a single string:

$ systemd-escape 'Hallöchen, Meister'
+  gudev systemd 219

Name

systemd-escape — Escape strings for usage in system unit names

Synopsis

systemd-escape [OPTIONS...] [STRING...]

Description¶

systemd-escape may be used to escape + strings for inclusion in systemd unit names. The command may be + used to escape and to undo escaping of strings.

The command takes any number of strings on the command line, + and will process them individually, one after the other. It will + output them separated by spaces to stdout.

By default this command will escape the strings passed, + unless --unescape is passed which results in the + inverse operation being applied. If --mangle a + special mode of escaping is applied instead, which assumes a + string to be already escaped but will escape everything that + appears obviously non-escaped.

Options¶

The following options are understood:

--suffix=¶

Appends the specified unit type suffix to the + escaped string. Takes one of the unit types supported by + systemd, such as ".service" or + ".mount". May not be used in conjunction with + --template=, --unescape or + --mangle.

--template=¶

Inserts the escaped strings in a unit name + template. Takes a unit name template such as + foobar@.service May not be used in + conjunction with --suffix=, + --unescape or + --mangle.

--path, -p¶

When escaping or unescaping a string, assume + it refers to a file system path. This enables special + processing of the initial "/" of the + path.

--unescape¶

Instead of escaping the specified strings, + undo the escaping, reversing the operation. May not be used in + conjunction with --suffix=, + --template= or + --mangle.

--mangle¶

Like --escape, but only + escape characters that are obviously not escaped yet, and + possibly automatically append an appropriate unit type suffix + to the string. May not be used in conjunction with + --suffix=, --template= or + --unescape.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Examples¶

Escape a single string:

$ systemd-escape 'Hallöchen, Meister'
 Hall\xc3\xb6chen\x2c\x20Meister

To undo escaping on a single string:

$ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister'
 Hallöchen, Meister

To generate the mount unit for a path:

$ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/"
 tmp-waldi-foobar.mount

To generate instance names of three strings

$ systemd-escape --template=systemd-nspawn@.service 'My Container 1' 'containerb' 'container/III'
-systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service systemd-nspawn@container-III.service

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

See Also¶

- systemd(1), - systemctl(1) -

+systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service systemd-nspawn@container-III.service

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

See Also¶

+ systemd(1), + systemctl(1) +

diff --git a/man/systemd-escape.xml b/man/systemd-escape.xml index b2a4a9ce8..0c3b23052 100644 --- a/man/systemd-escape.xml +++ b/man/systemd-escape.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-escape - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-escape - 1 - - - - systemd-escape - Escape strings for usage in system unit names - - - - - systemd-escape OPTIONS STRING - - - - - Description - - systemd-escape may be used to - escape strings for inclusion in systemd unit - names. The command may be used to escape and to undo - escaping of strings. - - The command takes any number of strings on the - command line, and will process them individually, one - after the other. It will output them separated by - spaces to stdout. - - By default this command will escape the strings - passed, unless is passed - which results in the inverse operation being - applied. If a special mode - of escaping is applied instead, which assumes a string - to be already escaped but will escape everything that - appears obviously non-escaped. - - - - Options - - The following options are understood: - - - - - - Appends the specified - unit type suffix to the escaped - string. Takes one of the unit types - supported by systemd, such as - .service or - .mount. May not be - used in conjunction with - , - or - . - - - - - - Inserts the escaped - strings in a unit name template. Takes - a unit name template such as - foobar@.service - May not be used in conjunction with - , - or - . - - - - - - - When escaping or - unescaping a string, assume it refers - to a file system path. This enables - special processing of the initial - / of the - path. - - - - - - Instead of escaping - the specified strings, undo the - escaping, reversing the operation. May - not be used in conjunction with - , - or - . - - - - - - Like - , but only - escape characters that are obviously - not escaped yet, and possibly - automatically append an appropriate - unit type suffix to the string. May - not be used in conjunction with - , - or - . - - - - - - - - - - Examples - - Escape a single string: - $ systemd-escape 'Hallöchen, Meister' + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-escape + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-escape + 1 + + + + systemd-escape + Escape strings for usage in system unit names + + + + + systemd-escape + OPTIONS + STRING + + + + + Description + + systemd-escape may be used to escape + strings for inclusion in systemd unit names. The command may be + used to escape and to undo escaping of strings. + + The command takes any number of strings on the command line, + and will process them individually, one after the other. It will + output them separated by spaces to stdout. + + By default this command will escape the strings passed, + unless is passed which results in the + inverse operation being applied. If a + special mode of escaping is applied instead, which assumes a + string to be already escaped but will escape everything that + appears obviously non-escaped. + + + + Options + + The following options are understood: + + + + + + Appends the specified unit type suffix to the + escaped string. Takes one of the unit types supported by + systemd, such as .service or + .mount. May not be used in conjunction with + , or + . + + + + + + Inserts the escaped strings in a unit name + template. Takes a unit name template such as + foobar@.service May not be used in + conjunction with , + or + . + + + + + + + When escaping or unescaping a string, assume + it refers to a file system path. This enables special + processing of the initial / of the + path. + + + + + + Instead of escaping the specified strings, + undo the escaping, reversing the operation. May not be used in + conjunction with , + or + . + + + + + + Like , but only + escape characters that are obviously not escaped yet, and + possibly automatically append an appropriate unit type suffix + to the string. May not be used in conjunction with + , or + . + + + + + + + + + + Examples + + Escape a single string: + $ systemd-escape 'Hallöchen, Meister' Hall\xc3\xb6chen\x2c\x20Meister - To undo escaping on a single string: - $ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister' + To undo escaping on a single string: + $ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister' Hallöchen, Meister - To generate the mount unit for a path: - $ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/" + To generate the mount unit for a path: + $ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/" tmp-waldi-foobar.mount - To generate instance names of three strings - $ systemd-escape --template=systemd-nspawn@.service 'My Container 1' 'containerb' 'container/III' + To generate instance names of three strings + $ systemd-escape --template=systemd-nspawn@.service 'My Container 1' 'containerb' 'container/III' systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service systemd-nspawn@container-III.service - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1 - - + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemctl1 + + diff --git a/man/systemd-firstboot.1 b/man/systemd-firstboot.1 index 49899ee5f..537a3d765 100644 --- a/man/systemd-firstboot.1 +++ b/man/systemd-firstboot.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-FIRSTBOOT" "1" "" "systemd 218" "systemd-firstboot" +.TH "SYSTEMD\-FIRSTBOOT" "1" "" "systemd 219" "systemd-firstboot" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -161,13 +161,11 @@ reads it from a file\&. Note that it is not recommended specifying passwords on .PP \fB\-\-prompt\-locale\fR, \fB\-\-prompt\-timezone\fR, \fB\-\-prompt\-hostname\fR, \fB\-\-prompt\-root\-password\fR .RS 4 -.PP Prompt the user interactively for a specific basic setting\&. Note that any explicit configuration settings specified on the command line take precedence, and the user is not prompted for it\&. .RE .PP \fB\-\-prompt\fR .RS 4 -.PP Query the user for locale, timezone, hostname and root password\&. This is equivalent to specifying \fB\-\-prompt\-locale\fR, \fB\-\-prompt\-timezone\fR, @@ -178,7 +176,6 @@ in combination\&. .PP \fB\-\-copy\-locale\fR, \fB\-\-copy\-timezone\fR, \fB\-\-copy\-root\-password\fR .RS 4 -.PP Copy a specific basic setting from the host\&. This only works in combination with \fB\-\-root=\fR (see above)\&. @@ -186,7 +183,6 @@ Copy a specific basic setting from the host\&. This only works in combination wi .PP \fB\-\-copy\fR .RS 4 -.PP Copy locale, time zone and root password from the host\&. This is equivalent to specifying \fB\-\-copy\-locale\fR, \fB\-\-copy\-timezone\fR, @@ -196,7 +192,6 @@ in combination\&. .PP \fB\-\-setup\-machine\-id\fR .RS 4 -.PP Initialize the system\*(Aqs machine ID to a random ID\&. This only works in combination with \fB\-\-root=\fR\&. .RE diff --git a/man/systemd-firstboot.html b/man/systemd-firstboot.html index 046c90789..7df7129f3 100644 --- a/man/systemd-firstboot.html +++ b/man/systemd-firstboot.html @@ -19,85 +19,82 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-firstboot, systemd-firstboot.service — Initialize basic system settings on or before the first boot-up of a system

Synopsis

systemd-firstboot [OPTIONS...]

systemd-firstboot.service

Description¶

systemd-firstboot initializes - the most basic system settings interactively on the - first boot, or optionally non-interactively when a - system image is created. The following settings may be - set up:

  • The system locale, more - specifically the two locale variables - LANG= and - LC_MESSAGES

  • The system time zone

  • The system host name

  • The machine ID of the system

  • The root user's password

Each of the fields may either be queried - interactively from the users, set non-interactively on - the tool's command line, or be copied from a host - system that is used to set up the system image.

If a setting is already initialized it will not - be overwritten and the user will not be prompted for - the setting.

Note that this tool operates directly on the - file system and does not involve any running system - services, unlike - localectl(1), - timedatectl(1) - or - hostnamectl(1). This - allows systemd-firstboot to operate - on mounted but not booted disk images and in early - boot. It is not recommended to use - systemd-firstboot on the running - system while it is up.

Options¶

The following options are understood:

--root=root¶

Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. This is - useful to operate on a system image - mounted to the specified directory - instead of the host system itself. -

--locale=LOCALE, --locale-messages=LOCALE¶

Sets the system - locale, more specifically the - LANG= and - LC_MESSAGES - settings. The argument should be a - valid locale identifier, such as - "de_DE.UTF-8". This - controls the - locale.conf(5) - configuration file.

--timezone=TIMEZONE¶

Sets the system time - zone. The argument should be a valid - time zone identifier, such as - "Europe/Berlin". This - controls the - localtime(5) - symlink.

--hostname=HOSTNAME¶

Sets the system - hostname. The argument should be a - host name, compatible with DNS. This - controls the - hostname(5) - configuration file.

--machine-id=ID¶

Sets the system's machine ID. This - controls the - machine-id(5) - file.

--root-password=PASSWORD, --root-password-file=PATH¶

Sets the password of - the system's root user. This creates a - shadow(5) - file. This setting exists in two - forms: - --root-password= - accepts the password to set directly - on the command line, - --root-password-file= - reads it from a file. Note that - it is not recommended specifying - passwords on the command line as other - users might be able to see them - simply by invoking - ps(1).

--prompt-locale, --prompt-timezone, --prompt-hostname, --prompt-root-password¶
--prompt¶
--copy-locale, --copy-timezone, --copy-root-password¶
--copy¶
--setup-machine-id¶
-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-firstboot, systemd-firstboot.service — Initialize basic system settings on or before the first boot-up of a system

Synopsis

systemd-firstboot [OPTIONS...]

systemd-firstboot.service

Description¶

systemd-firstboot initializes the most + basic system settings interactively on the first boot, or + optionally non-interactively when a system image is created. The + following settings may be set up:

  • The system locale, more specifically the two + locale variables LANG= and + LC_MESSAGES

  • The system time zone

  • The system host name

  • The machine ID of the system

  • The root user's password

Each of the fields may either be queried interactively from + the users, set non-interactively on the tool's command line, or be + copied from a host system that is used to set up the system + image.

If a setting is already initialized it will not be + overwritten and the user will not be prompted for the + setting.

Note that this tool operates directly on the file system and + does not involve any running system services, unlike + localectl(1), + timedatectl(1) + or + hostnamectl(1). + This allows systemd-firstboot to operate on + mounted but not booted disk images and in early boot. It is not + recommended to use systemd-firstboot on the + running system while it is up.

Options¶

The following options are understood:

--root=root¶

Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. This is useful to operate on a system image mounted to + the specified directory instead of the host system itself. +

--locale=LOCALE, --locale-messages=LOCALE¶

Sets the system locale, more specifically the + LANG= and LC_MESSAGES + settings. The argument should be a valid locale identifier, + such as "de_DE.UTF-8". This controls the + locale.conf(5) + configuration file.

--timezone=TIMEZONE¶

Sets the system time zone. The argument should + be a valid time zone identifier, such as + "Europe/Berlin". This controls the + localtime(5) + symlink.

--hostname=HOSTNAME¶

Sets the system hostname. The argument should + be a host name, compatible with DNS. This controls the + hostname(5) + configuration file.

--machine-id=ID¶

Sets the system's machine ID. This controls + the + machine-id(5) + file.

--root-password=PASSWORD, --root-password-file=PATH¶

Sets the password of the system's root user. + This creates a + shadow(5) + file. This setting exists in two forms: + --root-password= accepts the password to set + directly on the command line, + --root-password-file= reads it from a file. + Note that it is not recommended specifying passwords on the + command line as other users might be able to see them simply + by invoking + ps(1).

--prompt-locale, --prompt-timezone, --prompt-hostname, --prompt-root-password¶

Prompt the user interactively for a specific + basic setting. Note that any explicit configuration settings + specified on the command line take precedence, and the user is + not prompted for it.

--prompt¶

Query the user for locale, timezone, hostname + and root password. This is equivalent to specifying + --prompt-locale, + --prompt-timezone, + --prompt-hostname, + --prompt-root-password in combination.

--copy-locale, --copy-timezone, --copy-root-password¶

Copy a specific basic setting from the host. + This only works in combination with --root= + (see above).

--copy¶

Copy locale, time zone and root password from + the host. This is equivalent to specifying + --copy-locale, + --copy-timezone, + --copy-root-password in combination.

--setup-machine-id¶

Initialize the system's machine ID to a random + ID. This only works in combination with + --root=.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-firstboot.service.html b/man/systemd-firstboot.service.html index 046c90789..7df7129f3 100644 --- a/man/systemd-firstboot.service.html +++ b/man/systemd-firstboot.service.html @@ -19,85 +19,82 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-firstboot, systemd-firstboot.service — Initialize basic system settings on or before the first boot-up of a system

Synopsis

systemd-firstboot [OPTIONS...]

systemd-firstboot.service

Description¶

systemd-firstboot initializes - the most basic system settings interactively on the - first boot, or optionally non-interactively when a - system image is created. The following settings may be - set up:

  • The system locale, more - specifically the two locale variables - LANG= and - LC_MESSAGES

  • The system time zone

  • The system host name

  • The machine ID of the system

  • The root user's password

Each of the fields may either be queried - interactively from the users, set non-interactively on - the tool's command line, or be copied from a host - system that is used to set up the system image.

If a setting is already initialized it will not - be overwritten and the user will not be prompted for - the setting.

Note that this tool operates directly on the - file system and does not involve any running system - services, unlike - localectl(1), - timedatectl(1) - or - hostnamectl(1). This - allows systemd-firstboot to operate - on mounted but not booted disk images and in early - boot. It is not recommended to use - systemd-firstboot on the running - system while it is up.

Options¶

The following options are understood:

--root=root¶

Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. This is - useful to operate on a system image - mounted to the specified directory - instead of the host system itself. -

--locale=LOCALE, --locale-messages=LOCALE¶

Sets the system - locale, more specifically the - LANG= and - LC_MESSAGES - settings. The argument should be a - valid locale identifier, such as - "de_DE.UTF-8". This - controls the - locale.conf(5) - configuration file.

--timezone=TIMEZONE¶

Sets the system time - zone. The argument should be a valid - time zone identifier, such as - "Europe/Berlin". This - controls the - localtime(5) - symlink.

--hostname=HOSTNAME¶

Sets the system - hostname. The argument should be a - host name, compatible with DNS. This - controls the - hostname(5) - configuration file.

--machine-id=ID¶

Sets the system's machine ID. This - controls the - machine-id(5) - file.

--root-password=PASSWORD, --root-password-file=PATH¶

Sets the password of - the system's root user. This creates a - shadow(5) - file. This setting exists in two - forms: - --root-password= - accepts the password to set directly - on the command line, - --root-password-file= - reads it from a file. Note that - it is not recommended specifying - passwords on the command line as other - users might be able to see them - simply by invoking - ps(1).

--prompt-locale, --prompt-timezone, --prompt-hostname, --prompt-root-password¶
--prompt¶
--copy-locale, --copy-timezone, --copy-root-password¶
--copy¶
--setup-machine-id¶
-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-firstboot, systemd-firstboot.service — Initialize basic system settings on or before the first boot-up of a system

Synopsis

systemd-firstboot [OPTIONS...]

systemd-firstboot.service

Description¶

systemd-firstboot initializes the most + basic system settings interactively on the first boot, or + optionally non-interactively when a system image is created. The + following settings may be set up:

  • The system locale, more specifically the two + locale variables LANG= and + LC_MESSAGES

  • The system time zone

  • The system host name

  • The machine ID of the system

  • The root user's password

Each of the fields may either be queried interactively from + the users, set non-interactively on the tool's command line, or be + copied from a host system that is used to set up the system + image.

If a setting is already initialized it will not be + overwritten and the user will not be prompted for the + setting.

Note that this tool operates directly on the file system and + does not involve any running system services, unlike + localectl(1), + timedatectl(1) + or + hostnamectl(1). + This allows systemd-firstboot to operate on + mounted but not booted disk images and in early boot. It is not + recommended to use systemd-firstboot on the + running system while it is up.

Options¶

The following options are understood:

--root=root¶

Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. This is useful to operate on a system image mounted to + the specified directory instead of the host system itself. +

--locale=LOCALE, --locale-messages=LOCALE¶

Sets the system locale, more specifically the + LANG= and LC_MESSAGES + settings. The argument should be a valid locale identifier, + such as "de_DE.UTF-8". This controls the + locale.conf(5) + configuration file.

--timezone=TIMEZONE¶

Sets the system time zone. The argument should + be a valid time zone identifier, such as + "Europe/Berlin". This controls the + localtime(5) + symlink.

--hostname=HOSTNAME¶

Sets the system hostname. The argument should + be a host name, compatible with DNS. This controls the + hostname(5) + configuration file.

--machine-id=ID¶

Sets the system's machine ID. This controls + the + machine-id(5) + file.

--root-password=PASSWORD, --root-password-file=PATH¶

Sets the password of the system's root user. + This creates a + shadow(5) + file. This setting exists in two forms: + --root-password= accepts the password to set + directly on the command line, + --root-password-file= reads it from a file. + Note that it is not recommended specifying passwords on the + command line as other users might be able to see them simply + by invoking + ps(1).

--prompt-locale, --prompt-timezone, --prompt-hostname, --prompt-root-password¶

Prompt the user interactively for a specific + basic setting. Note that any explicit configuration settings + specified on the command line take precedence, and the user is + not prompted for it.

--prompt¶

Query the user for locale, timezone, hostname + and root password. This is equivalent to specifying + --prompt-locale, + --prompt-timezone, + --prompt-hostname, + --prompt-root-password in combination.

--copy-locale, --copy-timezone, --copy-root-password¶

Copy a specific basic setting from the host. + This only works in combination with --root= + (see above).

--copy¶

Copy locale, time zone and root password from + the host. This is equivalent to specifying + --copy-locale, + --copy-timezone, + --copy-root-password in combination.

--setup-machine-id¶

Initialize the system's machine ID to a random + ID. This only works in combination with + --root=.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-firstboot.xml b/man/systemd-firstboot.xml index 8d9730224..67d38ba31 100644 --- a/man/systemd-firstboot.xml +++ b/man/systemd-firstboot.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - - systemd-firstboot - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-firstboot - 1 - - - - systemd-firstboot - systemd-firstboot.service - Initialize basic system settings on or before the first boot-up of a system - - - - - systemd-firstboot - OPTIONS - - - systemd-firstboot.service - - - - Description - - systemd-firstboot initializes - the most basic system settings interactively on the - first boot, or optionally non-interactively when a - system image is created. The following settings may be - set up: - - - The system locale, more - specifically the two locale variables - LANG= and - LC_MESSAGES - - The system time zone - - The system host name - - The machine ID of the system - - The root user's password - - - Each of the fields may either be queried - interactively from the users, set non-interactively on - the tool's command line, or be copied from a host - system that is used to set up the system image. - - If a setting is already initialized it will not - be overwritten and the user will not be prompted for - the setting. - - Note that this tool operates directly on the - file system and does not involve any running system - services, unlike - localectl1, - timedatectl1 - or - hostnamectl1. This - allows systemd-firstboot to operate - on mounted but not booted disk images and in early - boot. It is not recommended to use - systemd-firstboot on the running - system while it is up. - - - - Options - - The following options are understood: - - - - - Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. This is - useful to operate on a system image - mounted to the specified directory - instead of the host system itself. - - - - - - - - Sets the system - locale, more specifically the - LANG= and - LC_MESSAGES - settings. The argument should be a - valid locale identifier, such as - de_DE.UTF-8. This - controls the - locale.conf5 - configuration file. - - - - - - Sets the system time - zone. The argument should be a valid - time zone identifier, such as - Europe/Berlin. This - controls the - localtime5 - symlink. - - - - - - Sets the system - hostname. The argument should be a - host name, compatible with DNS. This - controls the - hostname5 - configuration file. - - - - - - Sets the system's machine ID. This - controls the - machine-id5 - file. - - - - - - - Sets the password of - the system's root user. This creates a - shadow5 - file. This setting exists in two - forms: - - accepts the password to set directly - on the command line, - - reads it from a file. Note that - it is not recommended specifying - passwords on the command line as other - users might be able to see them - simply by invoking - ps1. - - - - - - - - - Prompt the user interactively - for a specific basic setting. Note - that any explicit configuration - settings specified on the command line - take precedence, and the user is not - prompted for it. - - - - - - Query the user for locale, - timezone, hostname and root - password. This is equivalent to - specifying - , - , - , - - in combination. - - - - - - - - Copy a specific basic setting - from the host. This only works in - combination with - (see - above). - - - - - - Copy locale, time zone and root - password from the host. This is - equivalent to specifying - , - , - - in combination. - - - - - - Initialize the system's machine - ID to a random ID. This only works in - combination with - . - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - locale.conf5, - localtime5, - hostname5, - machine-id5, - shadow5, - systemd-machine-id-setup1, - localectl1, - timedatectl1, - hostnamectl1 - - + + + + systemd-firstboot + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-firstboot + 1 + + + + systemd-firstboot + systemd-firstboot.service + Initialize basic system settings on or before the first boot-up of a system + + + + + systemd-firstboot + OPTIONS + + + systemd-firstboot.service + + + + Description + + systemd-firstboot initializes the most + basic system settings interactively on the first boot, or + optionally non-interactively when a system image is created. The + following settings may be set up: + + + The system locale, more specifically the two + locale variables LANG= and + LC_MESSAGES + + The system time zone + + The system host name + + The machine ID of the system + + The root user's password + + + Each of the fields may either be queried interactively from + the users, set non-interactively on the tool's command line, or be + copied from a host system that is used to set up the system + image. + + If a setting is already initialized it will not be + overwritten and the user will not be prompted for the + setting. + + Note that this tool operates directly on the file system and + does not involve any running system services, unlike + localectl1, + timedatectl1 + or + hostnamectl1. + This allows systemd-firstboot to operate on + mounted but not booted disk images and in early boot. It is not + recommended to use systemd-firstboot on the + running system while it is up. + + + + Options + + The following options are understood: + + + + + Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. This is useful to operate on a system image mounted to + the specified directory instead of the host system itself. + + + + + + + + Sets the system locale, more specifically the + LANG= and LC_MESSAGES + settings. The argument should be a valid locale identifier, + such as de_DE.UTF-8. This controls the + locale.conf5 + configuration file. + + + + + + Sets the system time zone. The argument should + be a valid time zone identifier, such as + Europe/Berlin. This controls the + localtime5 + symlink. + + + + + + Sets the system hostname. The argument should + be a host name, compatible with DNS. This controls the + hostname5 + configuration file. + + + + + + Sets the system's machine ID. This controls + the + machine-id5 + file. + + + + + + + Sets the password of the system's root user. + This creates a + shadow5 + file. This setting exists in two forms: + accepts the password to set + directly on the command line, + reads it from a file. + Note that it is not recommended specifying passwords on the + command line as other users might be able to see them simply + by invoking + ps1. + + + + + + + + + Prompt the user interactively for a specific + basic setting. Note that any explicit configuration settings + specified on the command line take precedence, and the user is + not prompted for it. + + + + + + Query the user for locale, timezone, hostname + and root password. This is equivalent to specifying + , + , + , + in combination. + + + + + + + + + Copy a specific basic setting from the host. + This only works in combination with + (see above). + + + + + + Copy locale, time zone and root password from + the host. This is equivalent to specifying + , + , + in combination. + + + + + + + Initialize the system's machine ID to a random + ID. This only works in combination with + . + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + locale.conf5, + localtime5, + hostname5, + machine-id5, + shadow5, + systemd-machine-id-setup1, + localectl1, + timedatectl1, + hostnamectl1 + + diff --git a/man/systemd-fsck-root.service.html b/man/systemd-fsck-root.service.html index 36d7ed721..8e9c096a2 100644 --- a/man/systemd-fsck-root.service.html +++ b/man/systemd-fsck-root.service.html @@ -19,68 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and - systemd-fsck-root.service are - services responsible for file system checks. They are - instantiated for each device that is configured for - file system checking. - systemd-fsck-root.service is - responsible for file system checks on the root file - system, but in only if the root filesystem wasn't - checked in the initramfs. - systemd-fsck@.service is used for - all other file systems and for the root file system in - the initramfs.

Those services are started at boot if - passno in - /etc/fstab for the file system is - set to a value greater than zero. The file system - check for root is performed before the other file - systems. Other file systems may be checked in - parallel, except when they are one the same rotating - disk.

systemd-fsck does not know - any details about specific filesystems, and simply - executes file system checkers specific to each - filesystem type (/sbin/fsck.*). - This helper will decide if the filesystem should - actually be checked based on the time since last - check, number of mounts, unclean unmount, etc.

systemd-fsck will forward - file system checking progress to the console. If a - file system check fails for a service without - nofail, emergency mode is activated, - by isolating to - emergency.target.

Kernel Command Line¶

systemd-fsck understands - one kernel command line parameter:

fsck.mode=¶

One of - "auto", - "force", - "skip". Controls the - mode of operation. The default is - "auto", and ensures - that file system checks are done when - the file system checker deems them - necessary. "force" - unconditionally results in full file - system checks. "skip" - skips any file system - checks.

fsck.repair=¶

One of - "preen", - "yes", - "no". Controls the - mode of operation. The default is " - preen", and will automatically repair - problems that can be safely fixed. "yes - " will answer yes to all questions by - fsck and "no" will answer no to - all questions. -

+ gudev systemd 219

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and + systemd-fsck-root.service are services + responsible for file system checks. They are instantiated for each + device that is configured for file system checking. + systemd-fsck-root.service is responsible for + file system checks on the root file system, but in only if the + root filesystem wasn't checked in the initramfs. + systemd-fsck@.service is used for all other + file systems and for the root file system in the initramfs.

Those services are started at boot if + passno in /etc/fstab for the + file system is set to a value greater than zero. The file system + check for root is performed before the other file systems. Other + file systems may be checked in parallel, except when they are one + the same rotating disk.

systemd-fsck does not know any details + about specific filesystems, and simply executes file system + checkers specific to each filesystem type + (/sbin/fsck.*). This helper will decide if + the filesystem should actually be checked based on the time since + last check, number of mounts, unclean unmount, etc.

systemd-fsck will forward file system + checking progress to the console. If a file system check fails for + a service without nofail, emergency mode is + activated, by isolating to + emergency.target.

Kernel Command Line¶

systemd-fsck understands one kernel + command line parameter:

fsck.mode=¶

One of "auto", + "force", "skip". Controls + the mode of operation. The default is "auto", + and ensures that file system checks are done when the file + system checker deems them necessary. "force" + unconditionally results in full file system checks. + "skip" skips any file system + checks.

fsck.repair=¶

One of "preen", + "yes", "no". Controls the + mode of operation. The default is " preen", + and will automatically repair problems that can be safely + fixed. "yes " will answer yes to all + questions by fsck and "no" will answer no to + all questions.

diff --git a/man/systemd-fsck.html b/man/systemd-fsck.html index 36d7ed721..8e9c096a2 100644 --- a/man/systemd-fsck.html +++ b/man/systemd-fsck.html @@ -19,68 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and - systemd-fsck-root.service are - services responsible for file system checks. They are - instantiated for each device that is configured for - file system checking. - systemd-fsck-root.service is - responsible for file system checks on the root file - system, but in only if the root filesystem wasn't - checked in the initramfs. - systemd-fsck@.service is used for - all other file systems and for the root file system in - the initramfs.

Those services are started at boot if - passno in - /etc/fstab for the file system is - set to a value greater than zero. The file system - check for root is performed before the other file - systems. Other file systems may be checked in - parallel, except when they are one the same rotating - disk.

systemd-fsck does not know - any details about specific filesystems, and simply - executes file system checkers specific to each - filesystem type (/sbin/fsck.*). - This helper will decide if the filesystem should - actually be checked based on the time since last - check, number of mounts, unclean unmount, etc.

systemd-fsck will forward - file system checking progress to the console. If a - file system check fails for a service without - nofail, emergency mode is activated, - by isolating to - emergency.target.

Kernel Command Line¶

systemd-fsck understands - one kernel command line parameter:

fsck.mode=¶

One of - "auto", - "force", - "skip". Controls the - mode of operation. The default is - "auto", and ensures - that file system checks are done when - the file system checker deems them - necessary. "force" - unconditionally results in full file - system checks. "skip" - skips any file system - checks.

fsck.repair=¶

One of - "preen", - "yes", - "no". Controls the - mode of operation. The default is " - preen", and will automatically repair - problems that can be safely fixed. "yes - " will answer yes to all questions by - fsck and "no" will answer no to - all questions. -

+ gudev systemd 219

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and + systemd-fsck-root.service are services + responsible for file system checks. They are instantiated for each + device that is configured for file system checking. + systemd-fsck-root.service is responsible for + file system checks on the root file system, but in only if the + root filesystem wasn't checked in the initramfs. + systemd-fsck@.service is used for all other + file systems and for the root file system in the initramfs.

Those services are started at boot if + passno in /etc/fstab for the + file system is set to a value greater than zero. The file system + check for root is performed before the other file systems. Other + file systems may be checked in parallel, except when they are one + the same rotating disk.

systemd-fsck does not know any details + about specific filesystems, and simply executes file system + checkers specific to each filesystem type + (/sbin/fsck.*). This helper will decide if + the filesystem should actually be checked based on the time since + last check, number of mounts, unclean unmount, etc.

systemd-fsck will forward file system + checking progress to the console. If a file system check fails for + a service without nofail, emergency mode is + activated, by isolating to + emergency.target.

Kernel Command Line¶

systemd-fsck understands one kernel + command line parameter:

fsck.mode=¶

One of "auto", + "force", "skip". Controls + the mode of operation. The default is "auto", + and ensures that file system checks are done when the file + system checker deems them necessary. "force" + unconditionally results in full file system checks. + "skip" skips any file system + checks.

fsck.repair=¶

One of "preen", + "yes", "no". Controls the + mode of operation. The default is " preen", + and will automatically repair problems that can be safely + fixed. "yes " will answer yes to all + questions by fsck and "no" will answer no to + all questions.

diff --git a/man/systemd-fsck@.service.8 b/man/systemd-fsck@.service.8 index f969428d3..dcdff329d 100644 --- a/man/systemd-fsck@.service.8 +++ b/man/systemd-fsck@.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-FSCK@\&.SERVICE" "8" "" "systemd 218" "systemd-fsck@.service" +.TH "SYSTEMD\-FSCK@\&.SERVICE" "8" "" "systemd 219" "systemd-fsck@.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-fsck@.service.html b/man/systemd-fsck@.service.html index 36d7ed721..8e9c096a2 100644 --- a/man/systemd-fsck@.service.html +++ b/man/systemd-fsck@.service.html @@ -19,68 +19,52 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and - systemd-fsck-root.service are - services responsible for file system checks. They are - instantiated for each device that is configured for - file system checking. - systemd-fsck-root.service is - responsible for file system checks on the root file - system, but in only if the root filesystem wasn't - checked in the initramfs. - systemd-fsck@.service is used for - all other file systems and for the root file system in - the initramfs.

Those services are started at boot if - passno in - /etc/fstab for the file system is - set to a value greater than zero. The file system - check for root is performed before the other file - systems. Other file systems may be checked in - parallel, except when they are one the same rotating - disk.

systemd-fsck does not know - any details about specific filesystems, and simply - executes file system checkers specific to each - filesystem type (/sbin/fsck.*). - This helper will decide if the filesystem should - actually be checked based on the time since last - check, number of mounts, unclean unmount, etc.

systemd-fsck will forward - file system checking progress to the console. If a - file system check fails for a service without - nofail, emergency mode is activated, - by isolating to - emergency.target.

Kernel Command Line¶

systemd-fsck understands - one kernel command line parameter:

fsck.mode=¶

One of - "auto", - "force", - "skip". Controls the - mode of operation. The default is - "auto", and ensures - that file system checks are done when - the file system checker deems them - necessary. "force" - unconditionally results in full file - system checks. "skip" - skips any file system - checks.

fsck.repair=¶

One of - "preen", - "yes", - "no". Controls the - mode of operation. The default is " - preen", and will automatically repair - problems that can be safely fixed. "yes - " will answer yes to all questions by - fsck and "no" will answer no to - all questions. -

+ gudev systemd 219

Name

systemd-fsck@.service, systemd-fsck-root.service, systemd-fsck — File system checker logic

Synopsis

systemd-fsck@.service

systemd-fsck-root.service

/usr/lib/systemd/systemd-fsck

Description¶

systemd-fsck@.service and + systemd-fsck-root.service are services + responsible for file system checks. They are instantiated for each + device that is configured for file system checking. + systemd-fsck-root.service is responsible for + file system checks on the root file system, but in only if the + root filesystem wasn't checked in the initramfs. + systemd-fsck@.service is used for all other + file systems and for the root file system in the initramfs.

Those services are started at boot if + passno in /etc/fstab for the + file system is set to a value greater than zero. The file system + check for root is performed before the other file systems. Other + file systems may be checked in parallel, except when they are one + the same rotating disk.

systemd-fsck does not know any details + about specific filesystems, and simply executes file system + checkers specific to each filesystem type + (/sbin/fsck.*). This helper will decide if + the filesystem should actually be checked based on the time since + last check, number of mounts, unclean unmount, etc.

systemd-fsck will forward file system + checking progress to the console. If a file system check fails for + a service without nofail, emergency mode is + activated, by isolating to + emergency.target.

Kernel Command Line¶

systemd-fsck understands one kernel + command line parameter:

fsck.mode=¶

One of "auto", + "force", "skip". Controls + the mode of operation. The default is "auto", + and ensures that file system checks are done when the file + system checker deems them necessary. "force" + unconditionally results in full file system checks. + "skip" skips any file system + checks.

fsck.repair=¶

One of "preen", + "yes", "no". Controls the + mode of operation. The default is " preen", + and will automatically repair problems that can be safely + fixed. "yes " will answer yes to all + questions by fsck and "no" will answer no to + all questions.

diff --git a/man/systemd-fsck@.service.xml b/man/systemd-fsck@.service.xml index ee66f3712..88e11e89d 100644 --- a/man/systemd-fsck@.service.xml +++ b/man/systemd-fsck@.service.xml @@ -21,137 +21,121 @@ --> - - systemd-fsck@.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-fsck@.service - 8 - - - - systemd-fsck@.service - systemd-fsck-root.service - systemd-fsck - File system checker logic - - - - systemd-fsck@.service - systemd-fsck-root.service - /usr/lib/systemd/systemd-fsck - - - - Description - - systemd-fsck@.service and - systemd-fsck-root.service are - services responsible for file system checks. They are - instantiated for each device that is configured for - file system checking. - systemd-fsck-root.service is - responsible for file system checks on the root file - system, but in only if the root filesystem wasn't - checked in the initramfs. - systemd-fsck@.service is used for - all other file systems and for the root file system in - the initramfs. - - Those services are started at boot if - in - /etc/fstab for the file system is - set to a value greater than zero. The file system - check for root is performed before the other file - systems. Other file systems may be checked in - parallel, except when they are one the same rotating - disk. - - systemd-fsck does not know - any details about specific filesystems, and simply - executes file system checkers specific to each - filesystem type (/sbin/fsck.*). - This helper will decide if the filesystem should - actually be checked based on the time since last - check, number of mounts, unclean unmount, etc. - - systemd-fsck will forward - file system checking progress to the console. If a - file system check fails for a service without - , emergency mode is activated, - by isolating to - emergency.target. - - - - Kernel Command Line - - systemd-fsck understands - one kernel command line parameter: - - - - fsck.mode= - - One of - auto, - force, - skip. Controls the - mode of operation. The default is - auto, and ensures - that file system checks are done when - the file system checker deems them - necessary. force - unconditionally results in full file - system checks. skip - skips any file system - checks. - - - - fsck.repair= - - One of - preen, - yes, - no. Controls the - mode of operation. The default is - preen, and will automatically repair - problems that can be safely fixed. yes - will answer yes to all questions by - fsck and no will answer no to - all questions. - - - - - - - See Also - - systemd1, - fsck8, - systemd-quotacheck.service8, - fsck.btrfs8, - fsck.cramfs8, - fsck.ext48, - fsck.fat8, - fsck.hfsplus8, - fsck.minix8, - fsck.ntfs8, - fsck.xfs8 - - + + systemd-fsck@.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-fsck@.service + 8 + + + + systemd-fsck@.service + systemd-fsck-root.service + systemd-fsck + File system checker logic + + + + systemd-fsck@.service + systemd-fsck-root.service + /usr/lib/systemd/systemd-fsck + + + + Description + + systemd-fsck@.service and + systemd-fsck-root.service are services + responsible for file system checks. They are instantiated for each + device that is configured for file system checking. + systemd-fsck-root.service is responsible for + file system checks on the root file system, but in only if the + root filesystem wasn't checked in the initramfs. + systemd-fsck@.service is used for all other + file systems and for the root file system in the initramfs. + + Those services are started at boot if + in /etc/fstab for the + file system is set to a value greater than zero. The file system + check for root is performed before the other file systems. Other + file systems may be checked in parallel, except when they are one + the same rotating disk. + + systemd-fsck does not know any details + about specific filesystems, and simply executes file system + checkers specific to each filesystem type + (/sbin/fsck.*). This helper will decide if + the filesystem should actually be checked based on the time since + last check, number of mounts, unclean unmount, etc. + + systemd-fsck will forward file system + checking progress to the console. If a file system check fails for + a service without , emergency mode is + activated, by isolating to + emergency.target. + + + + Kernel Command Line + + systemd-fsck understands one kernel + command line parameter: + + + + fsck.mode= + + One of auto, + force, skip. Controls + the mode of operation. The default is auto, + and ensures that file system checks are done when the file + system checker deems them necessary. force + unconditionally results in full file system checks. + skip skips any file system + checks. + + + + fsck.repair= + + One of preen, + yes, no. Controls the + mode of operation. The default is preen, + and will automatically repair problems that can be safely + fixed. yes will answer yes to all + questions by fsck and no will answer no to + all questions. + + + + + + See Also + + systemd1, + fsck8, + systemd-quotacheck.service8, + fsck.btrfs8, + fsck.cramfs8, + fsck.ext48, + fsck.fat8, + fsck.hfsplus8, + fsck.minix8, + fsck.ntfs8, + fsck.xfs8 + + diff --git a/man/systemd-fstab-generator.8 b/man/systemd-fstab-generator.8 index b72acf444..bc4f3e71a 100644 --- a/man/systemd-fstab-generator.8 +++ b/man/systemd-fstab-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-FSTAB\-GENERATOR" "8" "" "systemd 218" "systemd-fstab-generator" +.TH "SYSTEMD\-FSTAB\-GENERATOR" "8" "" "systemd 219" "systemd-fstab-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-fstab-generator.html b/man/systemd-fstab-generator.html index 3d231eeec..39a0b7fb4 100644 --- a/man/systemd-fstab-generator.html +++ b/man/systemd-fstab-generator.html @@ -19,74 +19,61 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-fstab-generator — Unit generator for /etc/fstab

Synopsis

/usr/lib/systemd/system-generators/systemd-fstab-generator

Description¶

systemd-fstab-generator is - a generator that translates - /etc/fstab (see - fstab(5) - for details) into native systemd units early at boot - and when configuration of the system manager is - reloaded. This will instantiate mount and swap units - as necessary.

The passno field is treated - like a simple boolean, and the ordering information is - discarded. However, if the root file system is - checked, it is checked before all the other - file systems.

See - systemd.mount(5) - and - systemd.swap(5) - for more information about special - /etc/fstab mount options this - generator understands.

systemd-fstab-generator - implements the generator - specification.

Kernel Command Line¶

systemd-fstab-generator understands - the following kernel command line parameters:

fstab=, rd.fstab=¶

Takes a boolean - argument. Defaults to - "yes". If - "no", causes the - generator to ignore any mounts or swaps - configured in - /etc/fstab. rd.fstab= - is honored only by initial RAM disk - (initrd) while - fstab= is - honored by both the main system and - the initrd.

root=¶

Takes the root filesystem to mount - in the initrd. - root= is - honored by the initrd.

rootfstype=¶

Takes the root filesystem type that - will be passed to the mount command. - rootfstype= is - honored by the initrd.

rootflags=¶

Takes the root filesystem mount options - to use. rootflags= is - honored by the initrd.

mount.usr=¶

Takes the /usr - filesystem to be mounted by the initrd. If - mount.usrfstype= or - mount.usrflags= is set, then - mount.usr= will default to the value set in - root=.

Otherwise this parameter defaults to the - /usr entry - found in /etc/fstab on the root - filesystem.

mount.usr= is honored by the initrd. -

mount.usrfstype=¶

Takes the /usr - filesystem type that will be passed to the mount - command. If mount.usr= or - mount.usrflags= is set, then - mount.usrfstype= will default to the value set in - rootfstype=.

Otherwise this value will be read from the - /usr entry in - /etc/fstab on the root filesystem.

mount.usrfstype= is - honored by the initrd.

mount.usrflags=¶

Takes the /usr - filesystem mount options to use. If - mount.usr= or - mount.usrfstype= is set, then - mount.usrflages= will default to the value set in - rootflags=.

Otherwise this value will be read from the - /usr entry in - /etc/fstab on the root filesystem.

mount.usrflags= is - honored by the initrd.

+ gudev systemd 219

Name

systemd-fstab-generator — Unit generator for /etc/fstab

Synopsis

/usr/lib/systemd/system-generators/systemd-fstab-generator

Description¶

systemd-fstab-generator is a generator + that translates /etc/fstab (see + fstab(5) + for details) into native systemd units early at boot and when + configuration of the system manager is reloaded. This will + instantiate mount and swap units as necessary.

The passno field is treated like a simple + boolean, and the ordering information is discarded. However, if + the root file system is checked, it is checked before all the + other file systems.

See + systemd.mount(5) + and + systemd.swap(5) + for more information about special /etc/fstab + mount options this generator understands.

systemd-fstab-generator implements the + generator + specification.

Kernel Command Line¶

systemd-fstab-generator understands the + following kernel command line parameters:

fstab=, rd.fstab=¶

Takes a boolean argument. Defaults to + "yes". If "no", causes the + generator to ignore any mounts or swaps configured in + /etc/fstab. rd.fstab= + is honored only by initial RAM disk (initrd) while + fstab= is honored by both the main system + and the initrd.

root=¶

Takes the root filesystem to mount in the + initrd. root= is honored by the + initrd.

rootfstype=¶

Takes the root filesystem type that will be + passed to the mount command. rootfstype= is + honored by the initrd.

rootflags=¶

Takes the root filesystem mount options to + use. rootflags= is honored by the + initrd.

mount.usr=¶

Takes the /usr filesystem + to be mounted by the initrd. If + mount.usrfstype= or + mount.usrflags= is set, then + mount.usr= will default to the value set in + root=.

Otherwise this parameter defaults to the + /usr entry found in + /etc/fstab on the root filesystem.

mount.usr= is honored by the initrd. +

mount.usrfstype=¶

Takes the /usr filesystem + type that will be passed to the mount command. If + mount.usr= or + mount.usrflags= is set, then + mount.usrfstype= will default to the value + set in rootfstype=.

Otherwise this value will be read from the + /usr entry in + /etc/fstab on the root filesystem.

mount.usrfstype= is honored by the + initrd.

mount.usrflags=¶

Takes the /usr filesystem + mount options to use. If mount.usr= or + mount.usrfstype= is set, then + mount.usrflages= will default to the value + set in rootflags=.

Otherwise this value will be read from the + /usr entry in + /etc/fstab on the root filesystem.

mount.usrflags= is honored by the + initrd.

diff --git a/man/systemd-fstab-generator.xml b/man/systemd-fstab-generator.xml index 65b48eea0..8f82e3330 100644 --- a/man/systemd-fstab-generator.xml +++ b/man/systemd-fstab-generator.xml @@ -21,178 +21,165 @@ --> - - systemd-fstab-generator - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-fstab-generator - 8 - - - - systemd-fstab-generator - Unit generator for /etc/fstab - - - - /usr/lib/systemd/system-generators/systemd-fstab-generator - - - - Description - - systemd-fstab-generator is - a generator that translates - /etc/fstab (see - fstab5 - for details) into native systemd units early at boot - and when configuration of the system manager is - reloaded. This will instantiate mount and swap units - as necessary. - - The passno field is treated - like a simple boolean, and the ordering information is - discarded. However, if the root file system is - checked, it is checked before all the other - file systems. - - See - systemd.mount5 - and - systemd.swap5 - for more information about special - /etc/fstab mount options this - generator understands. - - systemd-fstab-generator - implements the generator - specification. - - - - Kernel Command Line - - systemd-fstab-generator understands - the following kernel command line parameters: - - - - - fstab= - rd.fstab= - - Takes a boolean - argument. Defaults to - yes. If - no, causes the - generator to ignore any mounts or swaps - configured in - /etc/fstab. rd.fstab= - is honored only by initial RAM disk - (initrd) while - fstab= is - honored by both the main system and - the initrd. - - - root= - - Takes the root filesystem to mount - in the initrd. - root= is - honored by the initrd. - - - rootfstype= - - Takes the root filesystem type that - will be passed to the mount command. - rootfstype= is - honored by the initrd. - - - rootflags= - - Takes the root filesystem mount options - to use. rootflags= is - honored by the initrd. - - - mount.usr= - - Takes the /usr - filesystem to be mounted by the initrd. If - mount.usrfstype= or - mount.usrflags= is set, then - mount.usr= will default to the value set in - root=. - - Otherwise this parameter defaults to the - /usr entry - found in /etc/fstab on the root - filesystem. - - mount.usr= is honored by the initrd. - - - - mount.usrfstype= - - Takes the /usr - filesystem type that will be passed to the mount - command. If mount.usr= or - mount.usrflags= is set, then - mount.usrfstype= will default to the value set in - rootfstype=. - - Otherwise this value will be read from the - /usr entry in - /etc/fstab on the root filesystem. - - mount.usrfstype= is - honored by the initrd. - - - mount.usrflags= - - Takes the /usr - filesystem mount options to use. If - mount.usr= or - mount.usrfstype= is set, then - mount.usrflages= will default to the value set in - rootflags=. - - Otherwise this value will be read from the - /usr entry in - /etc/fstab on the root filesystem. - - mount.usrflags= is - honored by the initrd. - - - - - - See Also - - systemd1, - fstab5, - systemd.mount5, - systemd.swap5, - systemd-cryptsetup-generator8 - - + + systemd-fstab-generator + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-fstab-generator + 8 + + + + systemd-fstab-generator + Unit generator for /etc/fstab + + + + /usr/lib/systemd/system-generators/systemd-fstab-generator + + + + Description + + systemd-fstab-generator is a generator + that translates /etc/fstab (see + fstab5 + for details) into native systemd units early at boot and when + configuration of the system manager is reloaded. This will + instantiate mount and swap units as necessary. + + The passno field is treated like a simple + boolean, and the ordering information is discarded. However, if + the root file system is checked, it is checked before all the + other file systems. + + See + systemd.mount5 + and + systemd.swap5 + for more information about special /etc/fstab + mount options this generator understands. + + systemd-fstab-generator implements the + generator + specification. + + + + Kernel Command Line + + systemd-fstab-generator understands the + following kernel command line parameters: + + + + + fstab= + rd.fstab= + + Takes a boolean argument. Defaults to + yes. If no, causes the + generator to ignore any mounts or swaps configured in + /etc/fstab. rd.fstab= + is honored only by initial RAM disk (initrd) while + fstab= is honored by both the main system + and the initrd. + + + root= + + Takes the root filesystem to mount in the + initrd. root= is honored by the + initrd. + + + rootfstype= + + Takes the root filesystem type that will be + passed to the mount command. rootfstype= is + honored by the initrd. + + + rootflags= + + Takes the root filesystem mount options to + use. rootflags= is honored by the + initrd. + + + mount.usr= + + Takes the /usr filesystem + to be mounted by the initrd. If + mount.usrfstype= or + mount.usrflags= is set, then + mount.usr= will default to the value set in + root=. + + Otherwise this parameter defaults to the + /usr entry found in + /etc/fstab on the root filesystem. + + mount.usr= is honored by the initrd. + + + + mount.usrfstype= + + Takes the /usr filesystem + type that will be passed to the mount command. If + mount.usr= or + mount.usrflags= is set, then + mount.usrfstype= will default to the value + set in rootfstype=. + + Otherwise this value will be read from the + /usr entry in + /etc/fstab on the root filesystem. + + mount.usrfstype= is honored by the + initrd. + + + mount.usrflags= + + Takes the /usr filesystem + mount options to use. If mount.usr= or + mount.usrfstype= is set, then + mount.usrflages= will default to the value + set in rootflags=. + + Otherwise this value will be read from the + /usr entry in + /etc/fstab on the root filesystem. + + mount.usrflags= is honored by the + initrd. + + + + + + See Also + + systemd1, + fstab5, + systemd.mount5, + systemd.swap5, + systemd-cryptsetup-generator8 + + diff --git a/man/systemd-getty-generator.8 b/man/systemd-getty-generator.8 index 8cc956534..b7ec95a57 100644 --- a/man/systemd-getty-generator.8 +++ b/man/systemd-getty-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-GETTY\-GENERATOR" "8" "" "systemd 218" "systemd-getty-generator" +.TH "SYSTEMD\-GETTY\-GENERATOR" "8" "" "systemd 219" "systemd-getty-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,8 @@ Further information about configuration of gettys you may find in \fBagetty\fR(8) .SH "NOTES" .IP " 1." 4 -Container Interface +Container + Interface .RS 4 \%http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ .RE diff --git a/man/systemd-getty-generator.html b/man/systemd-getty-generator.html index 111e367ab..5ddc75049 100644 --- a/man/systemd-getty-generator.html +++ b/man/systemd-getty-generator.html @@ -19,34 +19,32 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-getty-generator — Generator for enabling getty instances on - the console

Synopsis

/usr/lib/systemd/system-generators/systemd-getty-generator

Description¶

systemd-getty-generator is - a generator that automatically instantiates - serial-getty@.service on the - kernel console /dev/console if - that is not directed to the virtual console - subsystem. It will also instantiate - serial-getty@.service instances - for virtualizer consoles, if execution in a - virtualized environment is detected. Finally, it will - instantiate - container-getty@.service - instances for additional container pseudo TTYs as - requested by the container manager (see Container Interface). This - should ensure that the user is shown a login prompt at - the right place, regardless of which environment the - system is started in. For example, it is sufficient to - redirect the kernel console with a kernel command line - argument such as console= to get - both kernel messages and a getty prompt on a serial - TTY. See kernel-parameters.txt - for more information on the - console= kernel parameter.

systemd-getty-generator - implements the generator - specification.

Further information about configuration of - gettys you may find in systemd - for Administrators, Part XVI: Gettys on Serial - Consoles (and Elsewhere).

See Also¶

- systemd(1), - agetty(8) -

+ gudev systemd 219

Name

systemd-getty-generator — Generator for enabling getty instances on the + console

Synopsis

/usr/lib/systemd/system-generators/systemd-getty-generator

Description¶

systemd-getty-generator is a generator + that automatically instantiates + serial-getty@.service on the kernel console + /dev/console if that is not directed to the + virtual console subsystem. It will also instantiate + serial-getty@.service instances for + virtualizer consoles, if execution in a virtualized environment is + detected. Finally, it will instantiate + container-getty@.service instances for + additional container pseudo TTYs as requested by the container + manager (see Container + Interface). This should ensure that the user is + shown a login prompt at the right place, regardless of which + environment the system is started in. For example, it is + sufficient to redirect the kernel console with a kernel command + line argument such as console= to get both + kernel messages and a getty prompt on a serial TTY. See kernel-parameters.txt + for more information on the console= kernel + parameter.

systemd-getty-generator implements the + generator + specification.

Further information about configuration of gettys you may + find in + systemd + for Administrators, Part XVI: Gettys on Serial Consoles (and + Elsewhere).

See Also¶

+ systemd(1), + agetty(8) +

diff --git a/man/systemd-getty-generator.xml b/man/systemd-getty-generator.xml index f6a66896d..0b5b2f2a7 100644 --- a/man/systemd-getty-generator.xml +++ b/man/systemd-getty-generator.xml @@ -21,81 +21,77 @@ --> - - systemd-getty-generator - systemd + + systemd-getty-generator + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-getty-generator - 8 - + + systemd-getty-generator + 8 + - - systemd-getty-generator - Generator for enabling getty instances on - the console - + + systemd-getty-generator + Generator for enabling getty instances on the + console + - - /usr/lib/systemd/system-generators/systemd-getty-generator - + + /usr/lib/systemd/system-generators/systemd-getty-generator + - - Description + + Description - systemd-getty-generator is - a generator that automatically instantiates - serial-getty@.service on the - kernel console /dev/console if - that is not directed to the virtual console - subsystem. It will also instantiate - serial-getty@.service instances - for virtualizer consoles, if execution in a - virtualized environment is detected. Finally, it will - instantiate - container-getty@.service - instances for additional container pseudo TTYs as - requested by the container manager (see Container Interface). This - should ensure that the user is shown a login prompt at - the right place, regardless of which environment the - system is started in. For example, it is sufficient to - redirect the kernel console with a kernel command line - argument such as console= to get - both kernel messages and a getty prompt on a serial - TTY. See kernel-parameters.txt - for more information on the - console= kernel parameter. + systemd-getty-generator is a generator + that automatically instantiates + serial-getty@.service on the kernel console + /dev/console if that is not directed to the + virtual console subsystem. It will also instantiate + serial-getty@.service instances for + virtualizer consoles, if execution in a virtualized environment is + detected. Finally, it will instantiate + container-getty@.service instances for + additional container pseudo TTYs as requested by the container + manager (see Container + Interface). This should ensure that the user is + shown a login prompt at the right place, regardless of which + environment the system is started in. For example, it is + sufficient to redirect the kernel console with a kernel command + line argument such as console= to get both + kernel messages and a getty prompt on a serial TTY. See kernel-parameters.txt + for more information on the console= kernel + parameter. - systemd-getty-generator - implements the generator - specification. + systemd-getty-generator implements the + generator + specification. - Further information about configuration of - gettys you may find in systemd - for Administrators, Part XVI: Gettys on Serial - Consoles (and Elsewhere). - + Further information about configuration of gettys you may + find in + systemd + for Administrators, Part XVI: Gettys on Serial Consoles (and + Elsewhere). + - - See Also - - systemd1, - agetty8 - - + + See Also + + systemd1, + agetty8 + + diff --git a/man/systemd-gpt-auto-generator.8 b/man/systemd-gpt-auto-generator.8 index efb773479..9b0f69135 100644 --- a/man/systemd-gpt-auto-generator.8 +++ b/man/systemd-gpt-auto-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-GPT\-AUTO\-GENERATOR" "8" "" "systemd 218" "systemd-gpt-auto-generator" +.TH "SYSTEMD\-GPT\-AUTO\-GENERATOR" "8" "" "systemd 219" "systemd-gpt-auto-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-gpt-auto-generator.html b/man/systemd-gpt-auto-generator.html index 3d131c293..58c64281d 100644 --- a/man/systemd-gpt-auto-generator.html +++ b/man/systemd-gpt-auto-generator.html @@ -19,58 +19,54 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-gpt-auto-generator — Generator for automatically discovering - and mounting root, /home and - /srv partitions, as well as - discovering and enabling swap partitions, based on GPT - partition type GUIDs.

Synopsis

/usr/lib/systemd/system-generators/systemd-gpt-auto-generator

Description¶

systemd-gpt-auto-generator - is a unit generator that automatically discovers root, - /home, /srv - and swap partitions and creates mount and swap units - for them, based on the partition type GUIDs of - GUID partition tables (GPT). It implements the Discoverable - Partitions Specification. Note that this - generator has no effect on non-GPT systems, on systems - where the units are explicitly configured (for - example, listed in - fstab(5)), - or where the mount points are non-empty.

This generator will only look for root - partitions on the same physical disk the EFI System - Partition (ESP) is located on. It will only look for - the other partitions on the same physical disk the - root file system is located on. These partitions will - not be searched on systems where the root file system is - distributed on multiple disks, for example via btrfs - RAID.

systemd-gpt-auto-generator - is useful for centralizing file system configuration - in the partition table and making manual configuration - in /etc/fstab or suchlike - unnecessary.

This generator looks for the partitions based on - their partition type GUID. The following partition - type GUIDs are identified:

Table 1. Partition Type GUIDs

Partition Type GUIDNameExplanation
44479540-f297-41b2-9af7-d131d5f0458aRoot Partition (x86)On 32-bit x86 systems, the first x86 root partition on the disk the EFI ESP is located on is mounted to the root directory /.
4f68bce3-e8cd-4db1-96e7-fbcaf984b709Root Partition (x86-64)On 64-bit x86 systems, the first x86-64 root partition on the disk the EFI ESP is located on is mounted to the root directory /.
69dad710-2ce4-4e3c-b16c-21a1d49abed3Root Partition (32-bit ARM)On 32-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /.
b921b045-1df0-41c3-af44-4c6f280d3faeRoot Partition (64-bit ARM)On 64-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /.
933ac7e1-2eb4-4f13-b844-0e14e2aef915Home PartitionThe first home partition on the disk the root partition is located on is mounted to /home.
3b8f8425-20e0-4f3b-907f-1a25a76f98e8Server Data PartitionThe first server data partition on the disk the root partition is located on is mounted to /srv.
0657fd6d-a4ab-43c4-84e5-0933c84b4f4fSwapAll swap partitions located on the disk the root partition is located on are enabled.

The /home and - /srv partitions may be encrypted - in LUKS format. In this case a device mapper device is - set up under the names - /dev/mapper/home and - /dev/mapper/srv. Note that this - might create conflicts if the same partition is listed - in /etc/crypttab with a different - device mapper device name.

Also note that - systemd-efi-boot-generator(8) - will mount the EFI System Partition (ESP) to - /boot if not otherwise mounted.

When using this generator in conjunction with - btrfs file systems, make sure to set the correct - default subvolumes on them, using btrfs - subvolume set-default.

systemd-gpt-auto-generator - implements the Generator - Specification.

+ gudev systemd 219

Name

systemd-gpt-auto-generator — Generator for automatically discovering + and mounting root, /home and + /srv partitions, as well as + discovering and enabling swap partitions, based on GPT + partition type GUIDs.

Synopsis

/usr/lib/systemd/system-generators/systemd-gpt-auto-generator

Description¶

systemd-gpt-auto-generator is a unit + generator that automatically discovers root, + /home, /srv and swap + partitions and creates mount and swap units for them, based on the + partition type GUIDs of GUID partition tables (GPT). It implements + the + Discoverable + Partitions Specification. Note that this generator has no + effect on non-GPT systems, on systems where the units are + explicitly configured (for example, listed in + fstab(5)), + or where the mount points are non-empty.

This generator will only look for root partitions on the + same physical disk the EFI System Partition (ESP) is located on. + It will only look for the other partitions on the same physical + disk the root file system is located on. These partitions will not + be searched on systems where the root file system is distributed + on multiple disks, for example via btrfs RAID.

systemd-gpt-auto-generator is useful + for centralizing file system configuration in the partition table + and making manual configuration in /etc/fstab + or suchlike unnecessary.

This generator looks for the partitions based on their + partition type GUID. The following partition type GUIDs are + identified:

Table 1. Partition Type GUIDs

Partition Type GUIDNameExplanation
44479540-f297-41b2-9af7-d131d5f0458aRoot Partition (x86)On 32-bit x86 systems, the first x86 root partition on the disk the EFI ESP is located on is mounted to the root directory /.
4f68bce3-e8cd-4db1-96e7-fbcaf984b709Root Partition (x86-64)On 64-bit x86 systems, the first x86-64 root partition on the disk the EFI ESP is located on is mounted to the root directory /.
69dad710-2ce4-4e3c-b16c-21a1d49abed3Root Partition (32-bit ARM)On 32-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /.
b921b045-1df0-41c3-af44-4c6f280d3faeRoot Partition (64-bit ARM)On 64-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /.
933ac7e1-2eb4-4f13-b844-0e14e2aef915Home PartitionThe first home partition on the disk the root partition is located on is mounted to /home.
3b8f8425-20e0-4f3b-907f-1a25a76f98e8Server Data PartitionThe first server data partition on the disk the root partition is located on is mounted to /srv.
0657fd6d-a4ab-43c4-84e5-0933c84b4f4fSwapAll swap partitions located on the disk the root partition is located on are enabled.

The /home and /srv + partitions may be encrypted in LUKS format. In this case a device + mapper device is set up under the names + /dev/mapper/home and + /dev/mapper/srv. Note that this might create + conflicts if the same partition is listed in + /etc/crypttab with a different device mapper + device name.

Also note that + systemd-efi-boot-generator(8) + will mount the EFI System Partition (ESP) to + /boot if not otherwise mounted.

When using this generator in conjunction with btrfs file + systems, make sure to set the correct default subvolumes on them, + using btrfs subvolume set-default.

systemd-gpt-auto-generator implements + the + Generator + Specification.

diff --git a/man/systemd-gpt-auto-generator.xml b/man/systemd-gpt-auto-generator.xml index 68fe2705f..9c706df24 100644 --- a/man/systemd-gpt-auto-generator.xml +++ b/man/systemd-gpt-auto-generator.xml @@ -21,166 +21,160 @@ --> - - systemd-gpt-auto-generator - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-gpt-auto-generator - 8 - - - - systemd-gpt-auto-generator - Generator for automatically discovering - and mounting root, /home and - /srv partitions, as well as - discovering and enabling swap partitions, based on GPT - partition type GUIDs. - - - - /usr/lib/systemd/system-generators/systemd-gpt-auto-generator - - - - Description - - systemd-gpt-auto-generator - is a unit generator that automatically discovers root, - /home, /srv - and swap partitions and creates mount and swap units - for them, based on the partition type GUIDs of - GUID partition tables (GPT). It implements the Discoverable - Partitions Specification. Note that this - generator has no effect on non-GPT systems, on systems - where the units are explicitly configured (for - example, listed in - fstab5), - or where the mount points are non-empty. - - This generator will only look for root - partitions on the same physical disk the EFI System - Partition (ESP) is located on. It will only look for - the other partitions on the same physical disk the - root file system is located on. These partitions will - not be searched on systems where the root file system is - distributed on multiple disks, for example via btrfs - RAID. - - systemd-gpt-auto-generator - is useful for centralizing file system configuration - in the partition table and making manual configuration - in /etc/fstab or suchlike - unnecessary. - - This generator looks for the partitions based on - their partition type GUID. The following partition - type GUIDs are identified: - - - Partition Type GUIDs - - - - - - - Partition Type GUID - Name - Explanation - - - - - 44479540-f297-41b2-9af7-d131d5f0458a - Root Partition (x86) - On 32-bit x86 systems, the first x86 root partition on the disk the EFI ESP is located on is mounted to the root directory /. - - - 4f68bce3-e8cd-4db1-96e7-fbcaf984b709 - Root Partition (x86-64) - On 64-bit x86 systems, the first x86-64 root partition on the disk the EFI ESP is located on is mounted to the root directory /. - - - 69dad710-2ce4-4e3c-b16c-21a1d49abed3 - Root Partition (32-bit ARM) - On 32-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /. - - - b921b045-1df0-41c3-af44-4c6f280d3fae - Root Partition (64-bit ARM) - On 64-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /. - - - 933ac7e1-2eb4-4f13-b844-0e14e2aef915 - Home Partition - The first home partition on the disk the root partition is located on is mounted to /home. - - - 3b8f8425-20e0-4f3b-907f-1a25a76f98e8 - Server Data Partition - The first server data partition on the disk the root partition is located on is mounted to /srv. - - - 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f - Swap - All swap partitions located on the disk the root partition is located on are enabled. - - - -
- - The /home and - /srv partitions may be encrypted - in LUKS format. In this case a device mapper device is - set up under the names - /dev/mapper/home and - /dev/mapper/srv. Note that this - might create conflicts if the same partition is listed - in /etc/crypttab with a different - device mapper device name. - - Also note that - systemd-efi-boot-generator8 - will mount the EFI System Partition (ESP) to - /boot if not otherwise mounted. - - When using this generator in conjunction with - btrfs file systems, make sure to set the correct - default subvolumes on them, using btrfs - subvolume set-default. - - systemd-gpt-auto-generator - implements the Generator - Specification. -
- - - See Also - - systemd1, - systemd.mount5, - systemd.swap5, - systemd-fstab-generator8, - systemd-efi-boot-generator8, - systemd-cryptsetup@.service8, - cryptsetup8, - fstab5, - btrfs8 - - + + systemd-gpt-auto-generator + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-gpt-auto-generator + 8 + + + + systemd-gpt-auto-generator + Generator for automatically discovering + and mounting root, /home and + /srv partitions, as well as + discovering and enabling swap partitions, based on GPT + partition type GUIDs. + + + + /usr/lib/systemd/system-generators/systemd-gpt-auto-generator + + + + Description + + systemd-gpt-auto-generator is a unit + generator that automatically discovers root, + /home, /srv and swap + partitions and creates mount and swap units for them, based on the + partition type GUIDs of GUID partition tables (GPT). It implements + the + Discoverable + Partitions Specification. Note that this generator has no + effect on non-GPT systems, on systems where the units are + explicitly configured (for example, listed in + fstab5), + or where the mount points are non-empty. + + This generator will only look for root partitions on the + same physical disk the EFI System Partition (ESP) is located on. + It will only look for the other partitions on the same physical + disk the root file system is located on. These partitions will not + be searched on systems where the root file system is distributed + on multiple disks, for example via btrfs RAID. + + systemd-gpt-auto-generator is useful + for centralizing file system configuration in the partition table + and making manual configuration in /etc/fstab + or suchlike unnecessary. + + This generator looks for the partitions based on their + partition type GUID. The following partition type GUIDs are + identified: + + + Partition Type GUIDs + + + + + + + Partition Type GUID + Name + Explanation + + + + + 44479540-f297-41b2-9af7-d131d5f0458a + Root Partition (x86) + On 32-bit x86 systems, the first x86 root partition on the disk the EFI ESP is located on is mounted to the root directory /. + + + 4f68bce3-e8cd-4db1-96e7-fbcaf984b709 + Root Partition (x86-64) + On 64-bit x86 systems, the first x86-64 root partition on the disk the EFI ESP is located on is mounted to the root directory /. + + + 69dad710-2ce4-4e3c-b16c-21a1d49abed3 + Root Partition (32-bit ARM) + On 32-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /. + + + b921b045-1df0-41c3-af44-4c6f280d3fae + Root Partition (64-bit ARM) + On 64-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory /. + + + 933ac7e1-2eb4-4f13-b844-0e14e2aef915 + Home Partition + The first home partition on the disk the root partition is located on is mounted to /home. + + + 3b8f8425-20e0-4f3b-907f-1a25a76f98e8 + Server Data Partition + The first server data partition on the disk the root partition is located on is mounted to /srv. + + + 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f + Swap + All swap partitions located on the disk the root partition is located on are enabled. + + + +
+ + The /home and /srv + partitions may be encrypted in LUKS format. In this case a device + mapper device is set up under the names + /dev/mapper/home and + /dev/mapper/srv. Note that this might create + conflicts if the same partition is listed in + /etc/crypttab with a different device mapper + device name. + + Also note that + systemd-efi-boot-generator8 + will mount the EFI System Partition (ESP) to + /boot if not otherwise mounted. + + When using this generator in conjunction with btrfs file + systems, make sure to set the correct default subvolumes on them, + using btrfs subvolume set-default. + + systemd-gpt-auto-generator implements + the + Generator + Specification. +
+ + + See Also + + systemd1, + systemd.mount5, + systemd.swap5, + systemd-fstab-generator8, + systemd-efi-boot-generator8, + systemd-cryptsetup@.service8, + cryptsetup8, + fstab5, + btrfs8 + +
diff --git a/man/systemd-halt.service.8 b/man/systemd-halt.service.8 index 3453fa7cc..54243369f 100644 --- a/man/systemd-halt.service.8 +++ b/man/systemd-halt.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-HALT\&.SERVICE" "8" "" "systemd 218" "systemd-halt.service" +.TH "SYSTEMD\-HALT\&.SERVICE" "8" "" "systemd 219" "systemd-halt.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-halt.service.html b/man/systemd-halt.service.html index 3e6d6c8f1..cf9877ff1 100644 --- a/man/systemd-halt.service.html +++ b/man/systemd-halt.service.html @@ -19,48 +19,41 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a - system service that is pulled in by - halt.target and is responsible - for the actual system halt. Similarly, - systemd-poweroff.service is - pulled in by poweroff.target, - systemd-reboot.service by - reboot.target and - systemd-kexec.service by - kexec.target to execute the - respective actions.

When these services are run, they ensure that PID - 1 is replaced by the - /usr/lib/systemd/systemd-shutdown - tool which is then responsible for the actual - shutdown. Before shutting down, this binary will try to - unmount all remaining file systems, disable all - remaining swap devices, detach all remaining storage - devices and kill all remaining processes.

It is necessary to have this code in a separate binary - because otherwise rebooting after an upgrade might be broken — - the running PID 1 could still depend on libraries which are not - available any more, thus keeping the file system busy, which - then cannot be re-mounted read-only.

Immediately before executing the actual system - halt/poweroff/reboot/kexec - systemd-shutdown will run all - executables in - /usr/lib/systemd/system-shutdown/ - and pass one arguments to them: either - "halt", - "poweroff", - "reboot" or - "kexec", depending on the chosen - action. All executables in this directory are executed - in parallel, and execution of the action is not - continued before all executables finished.

Note that - systemd-halt.service (and the - related units) should never be executed - directly. Instead, trigger system shutdown with a - command such as "systemctl halt" or - suchlike.

+ gudev systemd 219

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a system + service that is pulled in by halt.target and + is responsible for the actual system halt. Similarly, + systemd-poweroff.service is pulled in by + poweroff.target, + systemd-reboot.service by + reboot.target and + systemd-kexec.service by + kexec.target to execute the respective + actions.

When these services are run, they ensure that PID 1 is + replaced by the + /usr/lib/systemd/systemd-shutdown tool which + is then responsible for the actual shutdown. Before shutting down, + this binary will try to unmount all remaining file systems, + disable all remaining swap devices, detach all remaining storage + devices and kill all remaining processes.

It is necessary to have this code in a separate binary + because otherwise rebooting after an upgrade might be broken — the + running PID 1 could still depend on libraries which are not + available any more, thus keeping the file system busy, which then + cannot be re-mounted read-only.

Immediately before executing the actual system + halt/poweroff/reboot/kexec systemd-shutdown + will run all executables in + /usr/lib/systemd/system-shutdown/ and pass + one arguments to them: either "halt", + "poweroff", "reboot" or + "kexec", depending on the chosen action. All + executables in this directory are executed in parallel, and + execution of the action is not continued before all executables + finished.

Note that systemd-halt.service (and the + related units) should never be executed directly. Instead, trigger + system shutdown with a command such as "systemctl + halt" or suchlike.

diff --git a/man/systemd-halt.service.xml b/man/systemd-halt.service.xml index 552dbdf68..c94e2a182 100644 --- a/man/systemd-halt.service.xml +++ b/man/systemd-halt.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd-hibernate-resume-generator - systemd - - - - Developer - Ivan - Shapovalov - intelfx100@gmail.com - - - - - - systemd-hibernate-resume-generator - 8 - - - - systemd-hibernate-resume-generator - Unit generator for resume= kernel parameter - - - - /usr/lib/systemd/system-generators/systemd-hibernate-resume-generator - - - - Description - - systemd-hibernate-resume-generator is - a generator that instantiates - systemd-hibernate-resume@.service8 - unit according to the value of - parameter specified on the kernel command line. - - - - Kernel Command Line - - systemd-hibernate-resume-generator understands - the following kernel command line parameters: - - - - - resume= - - Takes a path to the resume - device. Both persistent block device paths like - /dev/disk/by-foo/bar and - fstab5-style - specifiers like FOO=bar - are supported. - - - - - - - See Also - - systemd1, - systemd-hibernate-resume@.service8, - kernel-command-line7 - - + + systemd-hibernate-resume-generator + systemd + + + + Developer + Ivan + Shapovalov + intelfx100@gmail.com + + + + + + systemd-hibernate-resume-generator + 8 + + + + systemd-hibernate-resume-generator + Unit generator for resume= kernel parameter + + + + /usr/lib/systemd/system-generators/systemd-hibernate-resume-generator + + + + Description + + systemd-hibernate-resume-generator is a + generator that instantiates + systemd-hibernate-resume@.service8 + unit according to the value of parameter + specified on the kernel command line. + + + + Kernel Command Line + + systemd-hibernate-resume-generator + understands the following kernel command line parameters: + + + + + resume= + + Takes a path to the resume device. Both + persistent block device paths like + /dev/disk/by-foo/bar and + fstab5-style + specifiers like FOO=bar are + supported. + + + + + + + See Also + + systemd1, + systemd-hibernate-resume@.service8, + kernel-command-line7 + + diff --git a/man/systemd-hibernate-resume.html b/man/systemd-hibernate-resume.html index 476bef0cb..6d8d1a81e 100644 --- a/man/systemd-hibernate-resume.html +++ b/man/systemd-hibernate-resume.html @@ -19,17 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-hibernate-resume@.service, systemd-hibernate-resume — Resume from hibernation

Synopsis

systemd-hibernate-resume@.service

/usr/lib/systemd/systemd-hibernate-resume

Description¶

systemd-hibernate-resume@.service - initiates the resume from hibernation. It is - instantiated with the device to resume from as the - template argument.

systemd-hibernate-resume only supports - the in-kernel hibernation implementation, known as - swsusp. - Internally, it works by writing the major:minor of specified - device node to /sys/power/resume.

Failing to initiate a resume is not an error condition. - It may mean that there was no resume image (e. g. if the - system has been simply powered off and not hibernated). In - such case, the boot is ordinarily continued.

+ gudev systemd 219

Name

systemd-hibernate-resume@.service, systemd-hibernate-resume — Resume from hibernation

Synopsis

systemd-hibernate-resume@.service

/usr/lib/systemd/systemd-hibernate-resume

Description¶

systemd-hibernate-resume@.service + initiates the resume from hibernation. It is instantiated with the + device to resume from as the template argument.

systemd-hibernate-resume only supports + the in-kernel hibernation implementation, known as + swsusp. + Internally, it works by writing the major:minor of specified + device node to /sys/power/resume.

Failing to initiate a resume is not an error condition. It + may mean that there was no resume image (e. g. if the system has + been simply powered off and not hibernated). In such case, the + boot is ordinarily continued.

diff --git a/man/systemd-hibernate-resume@.service.8 b/man/systemd-hibernate-resume@.service.8 index 14845d1ab..cb67a8ef0 100644 --- a/man/systemd-hibernate-resume@.service.8 +++ b/man/systemd-hibernate-resume@.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-HIBERNATE\-RESUME@\&.SERVICE" "8" "" "systemd 218" "systemd-hibernate-resume@.service" +.TH "SYSTEMD\-HIBERNATE\-RESUME@\&.SERVICE" "8" "" "systemd 219" "systemd-hibernate-resume@.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-hibernate-resume@.service.html b/man/systemd-hibernate-resume@.service.html index 476bef0cb..6d8d1a81e 100644 --- a/man/systemd-hibernate-resume@.service.html +++ b/man/systemd-hibernate-resume@.service.html @@ -19,17 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-hibernate-resume@.service, systemd-hibernate-resume — Resume from hibernation

Synopsis

systemd-hibernate-resume@.service

/usr/lib/systemd/systemd-hibernate-resume

Description¶

systemd-hibernate-resume@.service - initiates the resume from hibernation. It is - instantiated with the device to resume from as the - template argument.

systemd-hibernate-resume only supports - the in-kernel hibernation implementation, known as - swsusp. - Internally, it works by writing the major:minor of specified - device node to /sys/power/resume.

Failing to initiate a resume is not an error condition. - It may mean that there was no resume image (e. g. if the - system has been simply powered off and not hibernated). In - such case, the boot is ordinarily continued.

+ gudev systemd 219

Name

systemd-hibernate-resume@.service, systemd-hibernate-resume — Resume from hibernation

Synopsis

systemd-hibernate-resume@.service

/usr/lib/systemd/systemd-hibernate-resume

Description¶

systemd-hibernate-resume@.service + initiates the resume from hibernation. It is instantiated with the + device to resume from as the template argument.

systemd-hibernate-resume only supports + the in-kernel hibernation implementation, known as + swsusp. + Internally, it works by writing the major:minor of specified + device node to /sys/power/resume.

Failing to initiate a resume is not an error condition. It + may mean that there was no resume image (e. g. if the system has + been simply powered off and not hibernated). In such case, the + boot is ordinarily continued.

diff --git a/man/systemd-hibernate-resume@.service.xml b/man/systemd-hibernate-resume@.service.xml index 30bfd8810..7d0082744 100644 --- a/man/systemd-hibernate-resume@.service.xml +++ b/man/systemd-hibernate-resume@.service.xml @@ -21,62 +21,61 @@ --> - - systemd-hibernate-resume@.service - systemd + + systemd-hibernate-resume@.service + systemd - - - Developer - Ivan - Shapovalov - intelfx100@gmail.com - - - + + + Developer + Ivan + Shapovalov + intelfx100@gmail.com + + + - - systemd-hibernate-resume@.service - 8 - + + systemd-hibernate-resume@.service + 8 + - - systemd-hibernate-resume@.service - systemd-hibernate-resume - Resume from hibernation - + + systemd-hibernate-resume@.service + systemd-hibernate-resume + Resume from hibernation + - - systemd-hibernate-resume@.service - /usr/lib/systemd/systemd-hibernate-resume - + + systemd-hibernate-resume@.service + /usr/lib/systemd/systemd-hibernate-resume + - - Description + + Description - systemd-hibernate-resume@.service - initiates the resume from hibernation. It is - instantiated with the device to resume from as the - template argument. + systemd-hibernate-resume@.service + initiates the resume from hibernation. It is instantiated with the + device to resume from as the template argument. - systemd-hibernate-resume only supports - the in-kernel hibernation implementation, known as - swsusp. - Internally, it works by writing the major:minor of specified - device node to /sys/power/resume. + systemd-hibernate-resume only supports + the in-kernel hibernation implementation, known as + swsusp. + Internally, it works by writing the major:minor of specified + device node to /sys/power/resume. - Failing to initiate a resume is not an error condition. - It may mean that there was no resume image (e. g. if the - system has been simply powered off and not hibernated). In - such case, the boot is ordinarily continued. - + Failing to initiate a resume is not an error condition. It + may mean that there was no resume image (e. g. if the system has + been simply powered off and not hibernated). In such case, the + boot is ordinarily continued. + - - See Also - - systemd1, - systemd-hibernate-resume-generator8 - - + + See Also + + systemd1, + systemd-hibernate-resume-generator8 + + diff --git a/man/systemd-hibernate.service.html b/man/systemd-hibernate.service.html index 75b73a810..64759b9ae 100644 --- a/man/systemd-hibernate.service.html +++ b/man/systemd-hibernate.service.html @@ -19,60 +19,50 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is - a system service that is pulled in by - suspend.target and is responsible - for the actual system suspend. Similarly, - systemd-hibernate.service is - pulled in by hibernate.target to - execute the actual hibernation. Finally, - systemd-hybrid-sleep.service is - pulled in by hybrid-sleep.target - to execute hybrid hibernation with system - suspend.

Immediately before entering system suspend - and/or hibernation - systemd-suspend.service (and the - other mentioned units, respectively) will run all - executables in - /usr/lib/systemd/system-sleep/ - and pass two arguments to them. The first argument - will be "pre", the second either - "suspend", - "hibernate", or - "hybrid-sleep" depending on the - chosen action. Immediately after leaving system - suspend and/or hibernation the same executables are run, - but the first argument is now - "post". All executables in this - directory are executed in parallel, and execution of - the action is not continued until all executables - have finished.

Note that scripts or binaries dropped in - /usr/lib/systemd/system-sleep/ - are intended for local use only and should be - considered hacks. If applications want to be notified - of system suspend/hibernation and resume, there are - much nicer interfaces available.

Note that - systemd-suspend.service, - systemd-hibernate.service, and - systemd-hybrid-sleep.service - should never be executed directly. Instead, trigger - system sleep states with a command such as - "systemctl suspend" or - similar.

Internally, this service will echo a string like - "mem" into - /sys/power/state, to trigger the - actual system suspend. What exactly is written - where can be configured in the "[Sleep]" - section of /etc/systemd/sleep.conf or a - sleep.conf.d file. - See systemd-sleep.conf(5). -

Options¶

systemd-sleep understands the - following commands:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or - put the system to hybrid sleep.

+ gudev systemd 219

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is a system + service that is pulled in by suspend.target + and is responsible for the actual system suspend. Similarly, + systemd-hibernate.service is pulled in by + hibernate.target to execute the actual + hibernation. Finally, + systemd-hybrid-sleep.service is pulled in by + hybrid-sleep.target to execute hybrid + hibernation with system suspend.

Immediately before entering system suspend and/or + hibernation systemd-suspend.service (and the + other mentioned units, respectively) will run all executables in + /usr/lib/systemd/system-sleep/ and pass two + arguments to them. The first argument will be + "pre", the second either + "suspend", "hibernate", or + "hybrid-sleep" depending on the chosen action. + Immediately after leaving system suspend and/or hibernation the + same executables are run, but the first argument is now + "post". All executables in this directory are + executed in parallel, and execution of the action is not continued + until all executables have finished.

Note that scripts or binaries dropped in + /usr/lib/systemd/system-sleep/ are intended + for local use only and should be considered hacks. If applications + want to be notified of system suspend/hibernation and resume, + there are much nicer interfaces available.

Note that + systemd-suspend.service, + systemd-hibernate.service, and + systemd-hybrid-sleep.service + should never be executed directly. Instead, trigger system sleep + states with a command such as "systemctl suspend" + or similar.

Internally, this service will echo a string like + "mem" into /sys/power/state, + to trigger the actual system suspend. What exactly is written + where can be configured in the "[Sleep]" section + of /etc/systemd/sleep.conf or a + sleep.conf.d file. See + systemd-sleep.conf(5). +

Options¶

systemd-sleep understands the + following commands:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or put the system to + hybrid sleep.

diff --git a/man/systemd-hostnamed.html b/man/systemd-hostnamed.html index ee9badc2c..6279b6da0 100644 --- a/man/systemd-hostnamed.html +++ b/man/systemd-hostnamed.html @@ -19,19 +19,17 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-hostnamed.service, systemd-hostnamed — Host name bus mechanism

Synopsis

systemd-hostnamed.service

/usr/lib/systemd/systemd-hostnamed

Description¶

systemd-hostnamed is a system - service that may be used as a mechanism to change the - system's hostname. systemd-hostnamed is - automatically activated on request and terminates - itself when it is unused.

The tool - hostnamectl(1) - is a command line client to this service.

See the - developer documentation for information about - the APIs systemd-hostnamed - provides.

+ gudev systemd 219

Name

systemd-hostnamed.service, systemd-hostnamed — Host name bus mechanism

Synopsis

systemd-hostnamed.service

/usr/lib/systemd/systemd-hostnamed

Description¶

systemd-hostnamed is a system service + that may be used as a mechanism to change the system's hostname. + systemd-hostnamed is automatically activated + on request and terminates itself when it is unused.

The tool + hostnamectl(1) + is a command line client to this service.

See the + developer documentation for information about the APIs + systemd-hostnamed provides.

diff --git a/man/systemd-hostnamed.service.8 b/man/systemd-hostnamed.service.8 index a2a859deb..09b6969bd 100644 --- a/man/systemd-hostnamed.service.8 +++ b/man/systemd-hostnamed.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-HOSTNAMED\&.SERVICE" "8" "" "systemd 218" "systemd-hostnamed.service" +.TH "SYSTEMD\-HOSTNAMED\&.SERVICE" "8" "" "systemd 219" "systemd-hostnamed.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-hostnamed.service.html b/man/systemd-hostnamed.service.html index ee9badc2c..6279b6da0 100644 --- a/man/systemd-hostnamed.service.html +++ b/man/systemd-hostnamed.service.html @@ -19,19 +19,17 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-hostnamed.service, systemd-hostnamed — Host name bus mechanism

Synopsis

systemd-hostnamed.service

/usr/lib/systemd/systemd-hostnamed

Description¶

systemd-hostnamed is a system - service that may be used as a mechanism to change the - system's hostname. systemd-hostnamed is - automatically activated on request and terminates - itself when it is unused.

The tool - hostnamectl(1) - is a command line client to this service.

See the - developer documentation for information about - the APIs systemd-hostnamed - provides.

+ gudev systemd 219

Name

systemd-hostnamed.service, systemd-hostnamed — Host name bus mechanism

Synopsis

systemd-hostnamed.service

/usr/lib/systemd/systemd-hostnamed

Description¶

systemd-hostnamed is a system service + that may be used as a mechanism to change the system's hostname. + systemd-hostnamed is automatically activated + on request and terminates itself when it is unused.

The tool + hostnamectl(1) + is a command line client to this service.

See the + developer documentation for information about the APIs + systemd-hostnamed provides.

diff --git a/man/systemd-hostnamed.service.xml b/man/systemd-hostnamed.service.xml index 7952d8a6c..6990d41b0 100644 --- a/man/systemd-hostnamed.service.xml +++ b/man/systemd-hostnamed.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + + + + + systemd-hwdb + systemd + + + Developer + Kay + Sievers + kay@vrfy.org + + + Developer + Tom + Gundersen + teg@jklm.no + + + + + + systemd-hwdb + 8 + + + + systemd-hwdbhardware database management tool + + + + + systemd-hwdb options update + + + systemd-hwdb options query modalias + + + + Description + systemd-hwdb expects a command and command + specific arguments. It manages the binary hardware database. + + + Options + + + + + + Print help text. + + + + + + Generate in /usr/lib/udev instead of /etc/udev. + + + + + + + Alternative root path in the filesystem. + + + + + systemd-hwdb + <arg choice="opt"><replaceable>options</replaceable></arg> + update + Update the binary database. + + + systemd-hwdb + <arg choice="opt"><replaceable>options</replaceable></arg> + query + <arg><replaceable>MODALIAS</replaceable></arg> + + Query database and print result. + + + + + See Also + + hwdb7 + + + diff --git a/man/systemd-hybrid-sleep.service.html b/man/systemd-hybrid-sleep.service.html index 75b73a810..64759b9ae 100644 --- a/man/systemd-hybrid-sleep.service.html +++ b/man/systemd-hybrid-sleep.service.html @@ -19,60 +19,50 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is - a system service that is pulled in by - suspend.target and is responsible - for the actual system suspend. Similarly, - systemd-hibernate.service is - pulled in by hibernate.target to - execute the actual hibernation. Finally, - systemd-hybrid-sleep.service is - pulled in by hybrid-sleep.target - to execute hybrid hibernation with system - suspend.

Immediately before entering system suspend - and/or hibernation - systemd-suspend.service (and the - other mentioned units, respectively) will run all - executables in - /usr/lib/systemd/system-sleep/ - and pass two arguments to them. The first argument - will be "pre", the second either - "suspend", - "hibernate", or - "hybrid-sleep" depending on the - chosen action. Immediately after leaving system - suspend and/or hibernation the same executables are run, - but the first argument is now - "post". All executables in this - directory are executed in parallel, and execution of - the action is not continued until all executables - have finished.

Note that scripts or binaries dropped in - /usr/lib/systemd/system-sleep/ - are intended for local use only and should be - considered hacks. If applications want to be notified - of system suspend/hibernation and resume, there are - much nicer interfaces available.

Note that - systemd-suspend.service, - systemd-hibernate.service, and - systemd-hybrid-sleep.service - should never be executed directly. Instead, trigger - system sleep states with a command such as - "systemctl suspend" or - similar.

Internally, this service will echo a string like - "mem" into - /sys/power/state, to trigger the - actual system suspend. What exactly is written - where can be configured in the "[Sleep]" - section of /etc/systemd/sleep.conf or a - sleep.conf.d file. - See systemd-sleep.conf(5). -

Options¶

systemd-sleep understands the - following commands:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or - put the system to hybrid sleep.

+ gudev systemd 219

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is a system + service that is pulled in by suspend.target + and is responsible for the actual system suspend. Similarly, + systemd-hibernate.service is pulled in by + hibernate.target to execute the actual + hibernation. Finally, + systemd-hybrid-sleep.service is pulled in by + hybrid-sleep.target to execute hybrid + hibernation with system suspend.

Immediately before entering system suspend and/or + hibernation systemd-suspend.service (and the + other mentioned units, respectively) will run all executables in + /usr/lib/systemd/system-sleep/ and pass two + arguments to them. The first argument will be + "pre", the second either + "suspend", "hibernate", or + "hybrid-sleep" depending on the chosen action. + Immediately after leaving system suspend and/or hibernation the + same executables are run, but the first argument is now + "post". All executables in this directory are + executed in parallel, and execution of the action is not continued + until all executables have finished.

Note that scripts or binaries dropped in + /usr/lib/systemd/system-sleep/ are intended + for local use only and should be considered hacks. If applications + want to be notified of system suspend/hibernation and resume, + there are much nicer interfaces available.

Note that + systemd-suspend.service, + systemd-hibernate.service, and + systemd-hybrid-sleep.service + should never be executed directly. Instead, trigger system sleep + states with a command such as "systemctl suspend" + or similar.

Internally, this service will echo a string like + "mem" into /sys/power/state, + to trigger the actual system suspend. What exactly is written + where can be configured in the "[Sleep]" section + of /etc/systemd/sleep.conf or a + sleep.conf.d file. See + systemd-sleep.conf(5). +

Options¶

systemd-sleep understands the + following commands:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or put the system to + hybrid sleep.

diff --git a/man/systemd-inhibit.1 b/man/systemd-inhibit.1 index 66b0e39a0..ba3ceabd2 100644 --- a/man/systemd-inhibit.1 +++ b/man/systemd-inhibit.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-INHIBIT" "1" "" "systemd 218" "systemd-inhibit" +.TH "SYSTEMD\-INHIBIT" "1" "" "systemd 219" "systemd-inhibit" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-inhibit.html b/man/systemd-inhibit.html index 8fda98f53..9a36675ba 100644 --- a/man/systemd-inhibit.html +++ b/man/systemd-inhibit.html @@ -19,67 +19,50 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-inhibit — Execute a program with an inhibition lock taken

Synopsis

systemd-inhibit [OPTIONS...] [COMMAND] [ARGUMENTS...]

systemd-inhibit [OPTIONS...] --list

Description¶

systemd-inhibit may be used - to execute a program with a shutdown, sleep or idle - inhibitor lock taken. The lock will be acquired before - the specified command line is executed and released - afterwards.

Inhibitor locks may be used to block or delay - system sleep and shutdown requests from the user, as well - as automatic idle handling of the OS. This is useful - to avoid system suspends while an optical disc is - being recorded, or similar operations that should not - be interrupted.

For more information see the Inhibitor - Lock Developer Documentation.

Options¶

The following options are understood:

--what=¶

Takes a colon-separated - list of one or more - operations to inhibit: - "shutdown", - "sleep", - "idle", - "handle-power-key", - "handle-suspend-key", - "handle-hibernate-key", - "handle-lid-switch", - for inhibiting - reboot/power-off/halt/kexec, - suspending/hibernating, the automatic - idle detection, or the low-level - handling of the power/sleep key and - the lid switch, respectively. If omitted, - defaults to - "idle:sleep:shutdown".

--who=¶

Takes a short, - human-readable descriptive string for the - program taking the lock. If not passed, - defaults to the command line - string.

--why=¶

Takes a short, - human-readable descriptive string for the - reason for taking the lock. Defaults - to "Unknown reason".

--mode=¶

Takes either - "block" or - "delay" and describes - how the lock is applied. If - "block" is used (the - default), the lock prohibits any of - the requested operations without time - limit, and only privileged users may - override it. If - "delay" is used, the - lock can only delay the requested - operations for a limited time. If the - time elapses, the lock is ignored and - the operation executed. The time limit - may be specified in - logind.conf(5). Note - that "delay" is only - available for "sleep" - and - "shutdown".

--list¶

Lists all active - inhibition locks instead of acquiring - one.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

Returns the exit status of the executed program.

Example¶

# systemd-inhibit wodim foobar.iso

This burns the ISO image - foobar.iso on a CD using - wodim(1), - and inhibits system sleeping, shutdown and idle while - doing so.

+ gudev systemd 219

Name

systemd-inhibit — Execute a program with an inhibition lock taken

Synopsis

systemd-inhibit [OPTIONS...] [COMMAND] [ARGUMENTS...]

systemd-inhibit [OPTIONS...] --list

Description¶

systemd-inhibit may be used to execute a + program with a shutdown, sleep or idle inhibitor lock taken. The + lock will be acquired before the specified command line is + executed and released afterwards.

Inhibitor locks may be used to block or delay system sleep + and shutdown requests from the user, as well as automatic idle + handling of the OS. This is useful to avoid system suspends while + an optical disc is being recorded, or similar operations that + should not be interrupted.

For more information see the Inhibitor + Lock Developer Documentation.

Options¶

The following options are understood:

--what=¶

Takes a colon-separated list of one or more + operations to inhibit: + "shutdown", + "sleep", + "idle", + "handle-power-key", + "handle-suspend-key", + "handle-hibernate-key", + "handle-lid-switch", + for inhibiting reboot/power-off/halt/kexec, + suspending/hibernating, the automatic idle detection, or the + low-level handling of the power/sleep key and the lid switch, + respectively. If omitted, defaults to + "idle:sleep:shutdown".

--who=¶

Takes a short, human-readable descriptive + string for the program taking the lock. If not passed, + defaults to the command line string.

--why=¶

Takes a short, human-readable descriptive + string for the reason for taking the lock. Defaults to + "Unknown reason".

--mode=¶

Takes either "block" or + "delay" and describes how the lock is + applied. If "block" is used (the default), + the lock prohibits any of the requested operations without + time limit, and only privileged users may override it. If + "delay" is used, the lock can only delay the + requested operations for a limited time. If the time elapses, + the lock is ignored and the operation executed. The time limit + may be specified in + logind.conf(5). + Note that "delay" is only available for + "sleep" and + "shutdown".

--list¶

Lists all active inhibition locks instead of + acquiring one.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

Returns the exit status of the executed program.

Example¶

# systemd-inhibit wodim foobar.iso

This burns the ISO image + foobar.iso on a CD using + wodim(1), + and inhibits system sleeping, shutdown and idle while + doing so.

diff --git a/man/systemd-inhibit.xml b/man/systemd-inhibit.xml index c694744fb..9d85908f9 100644 --- a/man/systemd-inhibit.xml +++ b/man/systemd-inhibit.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-inhibit - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-inhibit - 1 - - - - systemd-inhibit - Execute a program with an inhibition lock taken - - - - - systemd-inhibit OPTIONS COMMAND ARGUMENTS - - - systemd-inhibit OPTIONS --list - - - - - Description - - systemd-inhibit may be used - to execute a program with a shutdown, sleep or idle - inhibitor lock taken. The lock will be acquired before - the specified command line is executed and released - afterwards. - - Inhibitor locks may be used to block or delay - system sleep and shutdown requests from the user, as well - as automatic idle handling of the OS. This is useful - to avoid system suspends while an optical disc is - being recorded, or similar operations that should not - be interrupted. - - For more information see the Inhibitor - Lock Developer Documentation. - - - - Options - - The following options are understood: - - - - - - Takes a colon-separated - list of one or more - operations to inhibit: - shutdown, - sleep, - idle, - handle-power-key, - handle-suspend-key, - handle-hibernate-key, - handle-lid-switch, - for inhibiting - reboot/power-off/halt/kexec, - suspending/hibernating, the automatic - idle detection, or the low-level - handling of the power/sleep key and - the lid switch, respectively. If omitted, - defaults to - idle:sleep:shutdown. - - - - - - Takes a short, - human-readable descriptive string for the - program taking the lock. If not passed, - defaults to the command line - string. - - - - - - Takes a short, - human-readable descriptive string for the - reason for taking the lock. Defaults - to "Unknown reason". - - - - - - Takes either - block or - delay and describes - how the lock is applied. If - block is used (the - default), the lock prohibits any of - the requested operations without time - limit, and only privileged users may - override it. If - delay is used, the - lock can only delay the requested - operations for a limited time. If the - time elapses, the lock is ignored and - the operation executed. The time limit - may be specified in - logind.conf5. Note - that delay is only - available for sleep - and - shutdown. - - - - - - Lists all active - inhibition locks instead of acquiring - one. - - - - - - - - - - Exit status - - Returns the exit status of the executed program. - - - - Example - - # systemd-inhibit wodim foobar.iso - - This burns the ISO image - foobar.iso on a CD using - wodim1, - and inhibits system sleeping, shutdown and idle while - doing so. - - - - See Also - - systemd1, - logind.conf5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-inhibit + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-inhibit + 1 + + + + systemd-inhibit + Execute a program with an inhibition lock taken + + + + + systemd-inhibit OPTIONS COMMAND ARGUMENTS + + + systemd-inhibit OPTIONS --list + + + + + Description + + systemd-inhibit may be used to execute a + program with a shutdown, sleep or idle inhibitor lock taken. The + lock will be acquired before the specified command line is + executed and released afterwards. + + Inhibitor locks may be used to block or delay system sleep + and shutdown requests from the user, as well as automatic idle + handling of the OS. This is useful to avoid system suspends while + an optical disc is being recorded, or similar operations that + should not be interrupted. + + For more information see the Inhibitor + Lock Developer Documentation. + + + + Options + + The following options are understood: + + + + + + Takes a colon-separated list of one or more + operations to inhibit: + shutdown, + sleep, + idle, + handle-power-key, + handle-suspend-key, + handle-hibernate-key, + handle-lid-switch, + for inhibiting reboot/power-off/halt/kexec, + suspending/hibernating, the automatic idle detection, or the + low-level handling of the power/sleep key and the lid switch, + respectively. If omitted, defaults to + idle:sleep:shutdown. + + + + + + Takes a short, human-readable descriptive + string for the program taking the lock. If not passed, + defaults to the command line string. + + + + + + Takes a short, human-readable descriptive + string for the reason for taking the lock. Defaults to + "Unknown reason". + + + + + + Takes either block or + delay and describes how the lock is + applied. If block is used (the default), + the lock prohibits any of the requested operations without + time limit, and only privileged users may override it. If + delay is used, the lock can only delay the + requested operations for a limited time. If the time elapses, + the lock is ignored and the operation executed. The time limit + may be specified in + logind.conf5. + Note that delay is only available for + sleep and + shutdown. + + + + + + Lists all active inhibition locks instead of + acquiring one. + + + + + + + + + + Exit status + + Returns the exit status of the executed program. + + + + Example + + # systemd-inhibit wodim foobar.iso + + This burns the ISO image + foobar.iso on a CD using + wodim1, + and inhibits system sleeping, shutdown and idle while + doing so. + + + + See Also + + systemd1, + logind.conf5 + + diff --git a/man/systemd-initctl.html b/man/systemd-initctl.html index 0249c948d..0732ba734 100644 --- a/man/systemd-initctl.html +++ b/man/systemd-initctl.html @@ -19,11 +19,11 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-initctl.service, systemd-initctl.socket, systemd-initctl — /dev/initctl compatibility

Synopsis

systemd-initctl.service

systemd-initctl.socket

/usr/lib/systemd/systemd-initctl

Description¶

systemd-initctl is a system - service that implements compatibility with the - /dev/initctl FIFO file system - object, as implemented by the SysV init system. systemd-initctl is - automatically activated on request and terminates - itself when it is unused.

See Also¶

- systemd(1) -

+ gudev systemd 219

Name

systemd-initctl.service, systemd-initctl.socket, systemd-initctl — /dev/initctl compatibility

Synopsis

systemd-initctl.service

systemd-initctl.socket

/usr/lib/systemd/systemd-initctl

Description¶

systemd-initctl is a system service + that implements compatibility with the + /dev/initctl FIFO file system object, as + implemented by the SysV init system. + systemd-initctl is automatically activated on + request and terminates itself when it is unused.

See Also¶

+ systemd(1) +

diff --git a/man/systemd-initctl.service.8 b/man/systemd-initctl.service.8 index 57fe8108d..a96dce95d 100644 --- a/man/systemd-initctl.service.8 +++ b/man/systemd-initctl.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-INITCTL\&.SERVICE" "8" "" "systemd 218" "systemd-initctl.service" +.TH "SYSTEMD\-INITCTL\&.SERVICE" "8" "" "systemd 219" "systemd-initctl.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-initctl.service.html b/man/systemd-initctl.service.html index 0249c948d..0732ba734 100644 --- a/man/systemd-initctl.service.html +++ b/man/systemd-initctl.service.html @@ -19,11 +19,11 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-initctl.service, systemd-initctl.socket, systemd-initctl — /dev/initctl compatibility

Synopsis

systemd-initctl.service

systemd-initctl.socket

/usr/lib/systemd/systemd-initctl

Description¶

systemd-initctl is a system - service that implements compatibility with the - /dev/initctl FIFO file system - object, as implemented by the SysV init system. systemd-initctl is - automatically activated on request and terminates - itself when it is unused.

See Also¶

- systemd(1) -

+ gudev systemd 219

Name

systemd-initctl.service, systemd-initctl.socket, systemd-initctl — /dev/initctl compatibility

Synopsis

systemd-initctl.service

systemd-initctl.socket

/usr/lib/systemd/systemd-initctl

Description¶

systemd-initctl is a system service + that implements compatibility with the + /dev/initctl FIFO file system object, as + implemented by the SysV init system. + systemd-initctl is automatically activated on + request and terminates itself when it is unused.

See Also¶

+ systemd(1) +

diff --git a/man/systemd-initctl.service.xml b/man/systemd-initctl.service.xml index eda6459b5..5c7f9a4a1 100644 --- a/man/systemd-initctl.service.xml +++ b/man/systemd-initctl.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> Directives · Python · libudev · - gudev systemd 218

Name

systemd-journal-upload — Send journal messages over the network

Synopsis

systemd-journal-upload [OPTIONS...] [-u/--url=URL] [SOURCES...]

Description¶

+ gudev systemd 219


Name

systemd-journal-upload — Send journal messages over the network

Synopsis

systemd-journal-upload [OPTIONS...] [-u/--url=URL] [SOURCES...]

Description¶

systemd-journal-upload will upload journal entries to the URL specified with --url. Unless limited by one of the options specified below, all journal entries accessible to the user the program is running as will be uploaded, and then the program will wait and send new entries as they become available. -

Options¶

-u, --url=[https://]URL, --url=[http://]URL¶

Upload to the specified +

Options¶

-u, --url=[https://]URL, --url=[http://]URL¶

Upload to the specified address. URL may specify either just the hostname or both the protocol and hostname. https is the default. @@ -68,8 +68,8 @@ After an entry is successfully uploaded, update this file with the cursor of that entry.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned; otherwise, a non-zero - failure code is returned.

Examples¶

Example 1. Setting up certificates for authentication

Certificates signed by a trusted authority are used to +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned; otherwise, a non-zero + failure code is returned.

Examples¶

Example 1. Setting up certificates for authentication

Certificates signed by a trusted authority are used to verify that the server to which messages are uploaded is legitimate, and vice versa, that the client is trusted.

A suitable set of certificates can be generated with openssl:

openssl req -newkey rsa:2048 -days 3650 -x509 -nodes \
@@ -124,7 +124,7 @@ openssl ca -batch -config ca.conf -notext -in $CLIENT.csr -out $CLIENT.pem
       /etc/systemd/journal-upload.conf
       respectively. The default locations can be queried by using
       systemd-journal-remote --help and
-      systemd-journal-upload --help.


See Also¶

+ systemd-journal-upload --help.


See Also¶

systemd-journal-remote(8), journalctl(1), systemd-journald.service(8), diff --git a/man/systemd-journald-dev-log.socket.html b/man/systemd-journald-dev-log.socket.html index f517d6686..266a615de 100644 --- a/man/systemd-journald-dev-log.socket.html +++ b/man/systemd-journald-dev-log.socket.html @@ -19,111 +19,87 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a - system service that collects and stores logging data. - It creates and maintains structured, indexed journals - based on logging information that is received from a - variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the - libc syslog(3) - call

  • Structured system log messages via the - native Journal API, see - sd_journal_print(4)

  • Standard output and - standard error of system - services

  • Audit records, via the audit subsystem

The daemon will implicitly collect numerous - metadata fields for each log messages in a secure and - unfakeable way. See - systemd.journal-fields(7) - for more information about the collected metadata. -

Log data collected by the journal is primarily - text-based but can also include binary data where - necessary. All objects stored in the journal can be up - to 2^64-1 bytes in size.

By default, the journal stores log data in - /run/log/journal/. Since - /run/ is volatile, log data is - lost at reboot. To make the data persistent, it - is sufficient to create - /var/log/journal/ where - systemd-journald will then store - the data.

systemd-journald will - forward all received log messages to the AF_UNIX/SOCK_DGRAM socket - /run/systemd/journal/syslog, if it exists, which - may be used by Unix syslog daemons to process the data - further.

See - journald.conf(5) - for information about the configuration of this - service.

Signals¶

SIGUSR1¶

Request that journal - data from /run/ - is flushed to - /var/ in order to - make it persistent (if this is - enabled). This must be used after - /var/ is mounted, - as otherwise log data from - /run is never - flushed to /var - regardless of the - configuration.

SIGUSR2¶

Request immediate - rotation of the journal - files.

Kernel Command Line¶

A few configuration parameters from - journald.conf may be overridden on - the kernel command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables - forwarding of collected log messages - to syslog, the kernel log buffer, the - system console or wall. -

See - journald.conf(5) - for information about these settings.

Access Control¶

Journal files are, by default, owned and readable - by the "systemd-journal" system group - but are not writable. Adding a user to this group thus - enables her/him to read the journal files.

By default, each logged in user will get her/his - own set of journal files in - /var/log/journal/. These files - will not be owned by the user, however, in order to - avoid that the user can write to them - directly. Instead, file system ACLs are used to ensure - the user gets read access only.

Additional users and groups may be granted - access to journal files via file system access control - lists (ACL). Distributions and administrators may - choose to grant read access to all members of the - "wheel" and "adm" - system groups with a command such as the - following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both - for existing journal files and for future journal - files created in the - /var/log/journal/ - directory.

Files¶

/etc/systemd/journald.conf¶

Configure - systemd-journald - behaviour. See - journald.conf(5). -

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald - writes entries to files in - /run/log/journal/machine-id/ - or - /var/log/journal/machine-id/ - with the ".journal" - suffix. If the daemon is stopped - uncleanly, or if the files are found - to be corrupted, they are renamed - using the ".journal~" - suffix, and - systemd-journald - starts writing to a new - file. /run is - used when - /var/log/journal - is not available, or when - Storage=volatile is - set in the - journald.conf(5) - configuration file. -

+ gudev systemd 219

Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a system service + that collects and stores logging data. It creates and maintains + structured, indexed journals based on logging information that is + received from a variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the libc + syslog(3) + call

  • Structured system log messages via the native + Journal API, see + sd_journal_print(4)

  • Standard output and standard error of system + services

  • Audit records, via the audit + subsystem

The daemon will implicitly collect numerous metadata fields + for each log messages in a secure and unfakeable way. See + systemd.journal-fields(7) + for more information about the collected metadata. +

Log data collected by the journal is primarily text-based + but can also include binary data where necessary. All objects + stored in the journal can be up to 2^64-1 bytes in size.

By default, the journal stores log data in + /run/log/journal/. Since + /run/ is volatile, log data is lost at + reboot. To make the data persistent, it is sufficient to create + /var/log/journal/ where + systemd-journald will then store the + data.

systemd-journald will forward all + received log messages to the + AF_UNIX/SOCK_DGRAM + socket /run/systemd/journal/syslog, if it + exists, which may be used by Unix syslog daemons to process the + data further.

See + journald.conf(5) + for information about the configuration of this service.

Signals¶

SIGUSR1¶

Request that journal data from + /run/ is flushed to + /var/ in order to make it persistent (if + this is enabled). This must be used after + /var/ is mounted, as otherwise log data + from /run is never flushed to + /var regardless of the + configuration.

SIGUSR2¶

Request immediate rotation of the journal + files.

Kernel Command Line¶

A few configuration parameters from + journald.conf may be overridden on the kernel + command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables forwarding of collected log + messages to syslog, the kernel log buffer, the system console + or wall. +

See + journald.conf(5) + for information about these settings.

Access Control¶

Journal files are, by default, owned and readable by the + "systemd-journal" system group but are not + writable. Adding a user to this group thus enables her/him to read + the journal files.

By default, each logged in user will get her/his own set of + journal files in /var/log/journal/. These + files will not be owned by the user, however, in order to avoid + that the user can write to them directly. Instead, file system + ACLs are used to ensure the user gets read access only.

Additional users and groups may be granted access to journal + files via file system access control lists (ACL). Distributions + and administrators may choose to grant read access to all members + of the "wheel" and "adm" system + groups with a command such as the following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both for + existing journal files and for future journal files created in the + /var/log/journal/ directory.

Files¶

/etc/systemd/journald.conf¶

Configure + systemd-journald + behaviour. See + journald.conf(5). +

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald writes + entries to files in + /run/log/journal/machine-id/ + or + /var/log/journal/machine-id/ + with the ".journal" suffix. If the daemon is + stopped uncleanly, or if the files are found to be corrupted, + they are renamed using the ".journal~" + suffix, and systemd-journald starts writing + to a new file. /run is used when + /var/log/journal is not available, or + when Storage=volatile is set in the + journald.conf(5) + configuration file.

diff --git a/man/systemd-journald.html b/man/systemd-journald.html index f517d6686..266a615de 100644 --- a/man/systemd-journald.html +++ b/man/systemd-journald.html @@ -19,111 +19,87 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a - system service that collects and stores logging data. - It creates and maintains structured, indexed journals - based on logging information that is received from a - variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the - libc syslog(3) - call

  • Structured system log messages via the - native Journal API, see - sd_journal_print(4)

  • Standard output and - standard error of system - services

  • Audit records, via the audit subsystem

The daemon will implicitly collect numerous - metadata fields for each log messages in a secure and - unfakeable way. See - systemd.journal-fields(7) - for more information about the collected metadata. -

Log data collected by the journal is primarily - text-based but can also include binary data where - necessary. All objects stored in the journal can be up - to 2^64-1 bytes in size.

By default, the journal stores log data in - /run/log/journal/. Since - /run/ is volatile, log data is - lost at reboot. To make the data persistent, it - is sufficient to create - /var/log/journal/ where - systemd-journald will then store - the data.

systemd-journald will - forward all received log messages to the AF_UNIX/SOCK_DGRAM socket - /run/systemd/journal/syslog, if it exists, which - may be used by Unix syslog daemons to process the data - further.

See - journald.conf(5) - for information about the configuration of this - service.

Signals¶

SIGUSR1¶

Request that journal - data from /run/ - is flushed to - /var/ in order to - make it persistent (if this is - enabled). This must be used after - /var/ is mounted, - as otherwise log data from - /run is never - flushed to /var - regardless of the - configuration.

SIGUSR2¶

Request immediate - rotation of the journal - files.

Kernel Command Line¶

A few configuration parameters from - journald.conf may be overridden on - the kernel command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables - forwarding of collected log messages - to syslog, the kernel log buffer, the - system console or wall. -

See - journald.conf(5) - for information about these settings.

Access Control¶

Journal files are, by default, owned and readable - by the "systemd-journal" system group - but are not writable. Adding a user to this group thus - enables her/him to read the journal files.

By default, each logged in user will get her/his - own set of journal files in - /var/log/journal/. These files - will not be owned by the user, however, in order to - avoid that the user can write to them - directly. Instead, file system ACLs are used to ensure - the user gets read access only.

Additional users and groups may be granted - access to journal files via file system access control - lists (ACL). Distributions and administrators may - choose to grant read access to all members of the - "wheel" and "adm" - system groups with a command such as the - following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both - for existing journal files and for future journal - files created in the - /var/log/journal/ - directory.

Files¶

/etc/systemd/journald.conf¶

Configure - systemd-journald - behaviour. See - journald.conf(5). -

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald - writes entries to files in - /run/log/journal/machine-id/ - or - /var/log/journal/machine-id/ - with the ".journal" - suffix. If the daemon is stopped - uncleanly, or if the files are found - to be corrupted, they are renamed - using the ".journal~" - suffix, and - systemd-journald - starts writing to a new - file. /run is - used when - /var/log/journal - is not available, or when - Storage=volatile is - set in the - journald.conf(5) - configuration file. -

+ gudev systemd 219

Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a system service + that collects and stores logging data. It creates and maintains + structured, indexed journals based on logging information that is + received from a variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the libc + syslog(3) + call

  • Structured system log messages via the native + Journal API, see + sd_journal_print(4)

  • Standard output and standard error of system + services

  • Audit records, via the audit + subsystem

The daemon will implicitly collect numerous metadata fields + for each log messages in a secure and unfakeable way. See + systemd.journal-fields(7) + for more information about the collected metadata. +

Log data collected by the journal is primarily text-based + but can also include binary data where necessary. All objects + stored in the journal can be up to 2^64-1 bytes in size.

By default, the journal stores log data in + /run/log/journal/. Since + /run/ is volatile, log data is lost at + reboot. To make the data persistent, it is sufficient to create + /var/log/journal/ where + systemd-journald will then store the + data.

systemd-journald will forward all + received log messages to the + AF_UNIX/SOCK_DGRAM + socket /run/systemd/journal/syslog, if it + exists, which may be used by Unix syslog daemons to process the + data further.

See + journald.conf(5) + for information about the configuration of this service.

Signals¶

SIGUSR1¶

Request that journal data from + /run/ is flushed to + /var/ in order to make it persistent (if + this is enabled). This must be used after + /var/ is mounted, as otherwise log data + from /run is never flushed to + /var regardless of the + configuration.

SIGUSR2¶

Request immediate rotation of the journal + files.

Kernel Command Line¶

A few configuration parameters from + journald.conf may be overridden on the kernel + command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables forwarding of collected log + messages to syslog, the kernel log buffer, the system console + or wall. +

See + journald.conf(5) + for information about these settings.

Access Control¶

Journal files are, by default, owned and readable by the + "systemd-journal" system group but are not + writable. Adding a user to this group thus enables her/him to read + the journal files.

By default, each logged in user will get her/his own set of + journal files in /var/log/journal/. These + files will not be owned by the user, however, in order to avoid + that the user can write to them directly. Instead, file system + ACLs are used to ensure the user gets read access only.

Additional users and groups may be granted access to journal + files via file system access control lists (ACL). Distributions + and administrators may choose to grant read access to all members + of the "wheel" and "adm" system + groups with a command such as the following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both for + existing journal files and for future journal files created in the + /var/log/journal/ directory.

Files¶

/etc/systemd/journald.conf¶

Configure + systemd-journald + behaviour. See + journald.conf(5). +

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald writes + entries to files in + /run/log/journal/machine-id/ + or + /var/log/journal/machine-id/ + with the ".journal" suffix. If the daemon is + stopped uncleanly, or if the files are found to be corrupted, + they are renamed using the ".journal~" + suffix, and systemd-journald starts writing + to a new file. /run is used when + /var/log/journal is not available, or + when Storage=volatile is set in the + journald.conf(5) + configuration file.

diff --git a/man/systemd-journald.service.8 b/man/systemd-journald.service.8 index 461539d45..25ec2c7e6 100644 --- a/man/systemd-journald.service.8 +++ b/man/systemd-journald.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-JOURNALD\&.SERVICE" "8" "" "systemd 218" "systemd-journald.service" +.TH "SYSTEMD\-JOURNALD\&.SERVICE" "8" "" "systemd 219" "systemd-journald.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-journald.service.html b/man/systemd-journald.service.html index f517d6686..266a615de 100644 --- a/man/systemd-journald.service.html +++ b/man/systemd-journald.service.html @@ -19,111 +19,87 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a - system service that collects and stores logging data. - It creates and maintains structured, indexed journals - based on logging information that is received from a - variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the - libc syslog(3) - call

  • Structured system log messages via the - native Journal API, see - sd_journal_print(4)

  • Standard output and - standard error of system - services

  • Audit records, via the audit subsystem

The daemon will implicitly collect numerous - metadata fields for each log messages in a secure and - unfakeable way. See - systemd.journal-fields(7) - for more information about the collected metadata. -

Log data collected by the journal is primarily - text-based but can also include binary data where - necessary. All objects stored in the journal can be up - to 2^64-1 bytes in size.

By default, the journal stores log data in - /run/log/journal/. Since - /run/ is volatile, log data is - lost at reboot. To make the data persistent, it - is sufficient to create - /var/log/journal/ where - systemd-journald will then store - the data.

systemd-journald will - forward all received log messages to the AF_UNIX/SOCK_DGRAM socket - /run/systemd/journal/syslog, if it exists, which - may be used by Unix syslog daemons to process the data - further.

See - journald.conf(5) - for information about the configuration of this - service.

Signals¶

SIGUSR1¶

Request that journal - data from /run/ - is flushed to - /var/ in order to - make it persistent (if this is - enabled). This must be used after - /var/ is mounted, - as otherwise log data from - /run is never - flushed to /var - regardless of the - configuration.

SIGUSR2¶

Request immediate - rotation of the journal - files.

Kernel Command Line¶

A few configuration parameters from - journald.conf may be overridden on - the kernel command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables - forwarding of collected log messages - to syslog, the kernel log buffer, the - system console or wall. -

See - journald.conf(5) - for information about these settings.

Access Control¶

Journal files are, by default, owned and readable - by the "systemd-journal" system group - but are not writable. Adding a user to this group thus - enables her/him to read the journal files.

By default, each logged in user will get her/his - own set of journal files in - /var/log/journal/. These files - will not be owned by the user, however, in order to - avoid that the user can write to them - directly. Instead, file system ACLs are used to ensure - the user gets read access only.

Additional users and groups may be granted - access to journal files via file system access control - lists (ACL). Distributions and administrators may - choose to grant read access to all members of the - "wheel" and "adm" - system groups with a command such as the - following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both - for existing journal files and for future journal - files created in the - /var/log/journal/ - directory.

Files¶

/etc/systemd/journald.conf¶

Configure - systemd-journald - behaviour. See - journald.conf(5). -

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald - writes entries to files in - /run/log/journal/machine-id/ - or - /var/log/journal/machine-id/ - with the ".journal" - suffix. If the daemon is stopped - uncleanly, or if the files are found - to be corrupted, they are renamed - using the ".journal~" - suffix, and - systemd-journald - starts writing to a new - file. /run is - used when - /var/log/journal - is not available, or when - Storage=volatile is - set in the - journald.conf(5) - configuration file. -

+ gudev systemd 219

Name

systemd-journald.service, systemd-journald.socket, systemd-journald-dev-log.socket, systemd-journald — Journal service

Synopsis

systemd-journald.service

systemd-journald.socket

systemd-journald-dev-log.socket

/usr/lib/systemd/systemd-journald

Description¶

systemd-journald is a system service + that collects and stores logging data. It creates and maintains + structured, indexed journals based on logging information that is + received from a variety of sources:

  • Kernel log messages, via kmsg

  • Simple system log messages, via the libc + syslog(3) + call

  • Structured system log messages via the native + Journal API, see + sd_journal_print(4)

  • Standard output and standard error of system + services

  • Audit records, via the audit + subsystem

The daemon will implicitly collect numerous metadata fields + for each log messages in a secure and unfakeable way. See + systemd.journal-fields(7) + for more information about the collected metadata. +

Log data collected by the journal is primarily text-based + but can also include binary data where necessary. All objects + stored in the journal can be up to 2^64-1 bytes in size.

By default, the journal stores log data in + /run/log/journal/. Since + /run/ is volatile, log data is lost at + reboot. To make the data persistent, it is sufficient to create + /var/log/journal/ where + systemd-journald will then store the + data.

systemd-journald will forward all + received log messages to the + AF_UNIX/SOCK_DGRAM + socket /run/systemd/journal/syslog, if it + exists, which may be used by Unix syslog daemons to process the + data further.

See + journald.conf(5) + for information about the configuration of this service.

Signals¶

SIGUSR1¶

Request that journal data from + /run/ is flushed to + /var/ in order to make it persistent (if + this is enabled). This must be used after + /var/ is mounted, as otherwise log data + from /run is never flushed to + /var regardless of the + configuration.

SIGUSR2¶

Request immediate rotation of the journal + files.

Kernel Command Line¶

A few configuration parameters from + journald.conf may be overridden on the kernel + command line:

systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=, systemd.journald.forward_to_wall=¶

Enables/disables forwarding of collected log + messages to syslog, the kernel log buffer, the system console + or wall. +

See + journald.conf(5) + for information about these settings.

Access Control¶

Journal files are, by default, owned and readable by the + "systemd-journal" system group but are not + writable. Adding a user to this group thus enables her/him to read + the journal files.

By default, each logged in user will get her/his own set of + journal files in /var/log/journal/. These + files will not be owned by the user, however, in order to avoid + that the user can write to them directly. Instead, file system + ACLs are used to ensure the user gets read access only.

Additional users and groups may be granted access to journal + files via file system access control lists (ACL). Distributions + and administrators may choose to grant read access to all members + of the "wheel" and "adm" system + groups with a command such as the following:

# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/

Note that this command will update the ACLs both for + existing journal files and for future journal files created in the + /var/log/journal/ directory.

Files¶

/etc/systemd/journald.conf¶

Configure + systemd-journald + behaviour. See + journald.conf(5). +

/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal, /var/log/journal/machine-id/*.journal~¶

systemd-journald writes + entries to files in + /run/log/journal/machine-id/ + or + /var/log/journal/machine-id/ + with the ".journal" suffix. If the daemon is + stopped uncleanly, or if the files are found to be corrupted, + they are renamed using the ".journal~" + suffix, and systemd-journald starts writing + to a new file. /run is used when + /var/log/journal is not available, or + when Storage=volatile is set in the + journald.conf(5) + configuration file.

diff --git a/man/systemd-journald.service.xml b/man/systemd-journald.service.xml index fa6e97edf..6b250b65e 100644 --- a/man/systemd-journald.service.xml +++ b/man/systemd-journald.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd-machine-id-commit.service - systemd - - - - Developer - Didier - Roche - didrocks@ubuntu.com - - - - - - systemd-machine-id-commit.service - 8 - - - - systemd-machine-id-commit.service - Commit transient machine-id to disk - - - - systemd-machine-id-commit.service - /usr/lib/systemd/systemd-machine-id-commit - - - - Description - - systemd-machine-id-commit.service is - a service responsible for commiting any transient - /etc/machine-id file to a writable file - system. See - machine-id5 - for more information about this file. - - This service is started shortly after - local-fs.target if - /etc/machine-id is an independent mount - point (probably a tmpfs one) and /etc is writable. - systemd-machine-id-commit will then - write current machine ID to disk and unmount the transient - /etc/machine-id file in a race-free - manner to ensure that file is always valid for other - processes. - - Note that the traditional way to initialize the machine - ID in /etc/machine-id is to use - systemd-machine-id-setup by system - installer tools. You can also use - systemd-firstboot1 - to initialize the machine ID on mounted (but not - booted) system images. The main use case for that service is - /etc/machine-id being an empty file at - boot and initrd chaining to systemd giving it a read only file - system that will be turned read-write later during the boot - process. - - There is no consequence if that service fails other than - a newer machine-id will be generated during next system boot. - - - - - See Also - - systemd1, - systemd-machine-id-commit1, - systemd-machine-id-setup1, - machine-id5, - systemd-firstboot1 - - + + systemd-machine-id-commit.service + systemd + + + + Developer + Didier + Roche + didrocks@ubuntu.com + + + + + + systemd-machine-id-commit.service + 8 + + + + systemd-machine-id-commit.service + Commit transient machine-id to disk + + + + systemd-machine-id-commit.service + /usr/lib/systemd/systemd-machine-id-commit + + + + Description + + systemd-machine-id-commit.service is a + service responsible for committing any transient + /etc/machine-id file to a writable file + system. See + machine-id5 + for more information about this file. + + This service is started shortly after + local-fs.target if + /etc/machine-id is an independent mount point + (probably a tmpfs one) and /etc is writable. + systemd-machine-id-commit will then write + current machine ID to disk and unmount the transient + /etc/machine-id file in a race-free manner to + ensure that file is always valid for other processes. + + Note that the traditional way to initialize the machine ID + in /etc/machine-id is to use + systemd-machine-id-setup by system installer + tools. You can also use + systemd-firstboot1 + to initialize the machine ID on mounted (but not booted) system + images. The main use case for that service is + /etc/machine-id being an empty file at boot + and initrd chaining to systemd giving it a read only file system + that will be turned read-write later during the boot + process. + + There is no consequence if that service fails other than a + newer machine-id will be generated during next system boot. + + + + + See Also + + systemd1, + systemd-machine-id-commit1, + systemd-machine-id-setup1, + machine-id5, + systemd-firstboot1 + + diff --git a/man/systemd-machine-id-commit.xml b/man/systemd-machine-id-commit.xml index ed2a6d0bd..cfb172206 100644 --- a/man/systemd-machine-id-commit.xml +++ b/man/systemd-machine-id-commit.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-machine-id-commit - systemd - - - - Developer - Didier - Roche - didrocks@ubuntu.com - - - - - - systemd-machine-id-commit - 1 - - - - systemd-machine-id-commit - Commit transient machine ID to /etc/machine-id - - - - - systemd-machine-id-commit - - - - - Description - - systemd-machine-id-commit may - be used to write on disk any transient machine ID - mounted as a temporary file system in - /etc/machine-id at boot time. See - machine-id5 - for more information about this file. - - This tool will execute no operation if - /etc/machine-id doesn't contain any - valid machine ID, isn't mounted as an independent temporary - file system, of /etc is read-only. If - those conditions are met, it will then write current machine ID - to disk and unmount the transient - /etc/machine-id file in a race-free - manner to ensure that this file is always valid for other - processes. - - Note that the traditional way to initialize the machine - ID in /etc/machine-id is to use - systemd-machine-id-setup by system - installer tools. You can also use - systemd-firstboot1 - to initialize the machine ID on mounted (but not - booted) system images. - - - - Options - - The following options are understood: - - - - - Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemd-machine-id-commit.service8, - systemd-machine-id-setup1, - machine-id5, - systemd-firstboot1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-machine-id-commit + systemd + + + + Developer + Didier + Roche + didrocks@ubuntu.com + + + + + + systemd-machine-id-commit + 1 + + + + systemd-machine-id-commit + Commit transient machine ID to /etc/machine-id + + + + + systemd-machine-id-commit + + + + + Description + + systemd-machine-id-commit may be used to + write on disk any transient machine ID mounted as a temporary file + system in /etc/machine-id at boot time. See + machine-id5 + for more information about this file. + + This tool will execute no operation if + /etc/machine-id doesn't contain any valid + machine ID, isn't mounted as an independent temporary file system, + of /etc is read-only. If those conditions are + met, it will then write current machine ID to disk and unmount the + transient /etc/machine-id file in a race-free + manner to ensure that this file is always valid for other + processes. + + Note that the traditional way to initialize the machine ID + in /etc/machine-id is to use + systemd-machine-id-setup by system installer + tools. You can also use + systemd-firstboot1 + to initialize the machine ID on mounted (but not booted) system + images. + + + + Options + + The following options are understood: + + + + + Takes a directory path + as an argument. All paths will be + prefixed with the given alternate + root path, + including config search paths. + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + systemd-machine-id-commit.service8, + systemd-machine-id-setup1, + machine-id5, + systemd-firstboot1 + + diff --git a/man/systemd-machine-id-setup.1 b/man/systemd-machine-id-setup.1 index 7ec9ae926..d2c29bc17 100644 --- a/man/systemd-machine-id-setup.1 +++ b/man/systemd-machine-id-setup.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-MACHINE\-ID\-SETUP" "1" "" "systemd 218" "systemd-machine-id-setup" +.TH "SYSTEMD\-MACHINE\-ID\-SETUP" "1" "" "systemd 219" "systemd-machine-id-setup" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-machine-id-setup.html b/man/systemd-machine-id-setup.html index 9d88f7745..a763096ed 100644 --- a/man/systemd-machine-id-setup.html +++ b/man/systemd-machine-id-setup.html @@ -19,39 +19,33 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-machine-id-setup — Initialize the machine ID in /etc/machine-id

Synopsis

systemd-machine-id-setup

Description¶

systemd-machine-id-setup may - be used by system installer tools to initialize the - machine ID stored in - /etc/machine-id at install time - with a randomly generated ID. See - machine-id(5) - for more information about this file.

This tool will execute no operation if - /etc/machine-id is already - initialized.

If a valid D-Bus machine ID is already - configured for the system, the D-Bus machine ID is - copied and used to initialize the machine ID in - /etc/machine-id.

If run inside a KVM virtual machine and a UUID - is passed via the -uuid option, this - UUID is used to initialize the machine ID instead of a - randomly generated one. The caller must ensure that the - UUID passed is sufficiently unique and is different - for every booted instanced of the VM.

Similar, if run inside a Linux container - environment and a UUID is set for the container this - is used to initialize the machine ID. For details see - the documentation of the Container - Interface.

Use - systemd-firstboot(1) - to initialize the machine ID on mounted (but not - booted) system images.

Options¶

The following options are understood:

--root=root¶

Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. -

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-machine-id-setup — Initialize the machine ID in /etc/machine-id

Synopsis

systemd-machine-id-setup

Description¶

systemd-machine-id-setup may be used by + system installer tools to initialize the machine ID stored in + /etc/machine-id at install time with a + randomly generated ID. See + machine-id(5) + for more information about this file.

This tool will execute no operation if + /etc/machine-id is already + initialized.

If a valid D-Bus machine ID is already configured for the + system, the D-Bus machine ID is copied and used to initialize the + machine ID in /etc/machine-id.

If run inside a KVM virtual machine and a UUID is passed via + the -uuid option, this UUID is used to initialize + the machine ID instead of a randomly generated one. The caller + must ensure that the UUID passed is sufficiently unique and is + different for every booted instanced of the VM.

Similar, if run inside a Linux container environment and a + UUID is set for the container this is used to initialize the + machine ID. For details see the documentation of the Container + Interface.

Use + systemd-firstboot(1) + to initialize the machine ID on mounted (but not booted) system + images.

Options¶

The following options are understood:

--root=root¶

Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-machine-id-setup.xml b/man/systemd-machine-id-setup.xml index 28352e357..22bad3e5f 100644 --- a/man/systemd-machine-id-setup.xml +++ b/man/systemd-machine-id-setup.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-machine-id-setup - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-machine-id-setup - 1 - - - - systemd-machine-id-setup - Initialize the machine ID in /etc/machine-id - - - - - systemd-machine-id-setup - - - - - Description - - systemd-machine-id-setup may - be used by system installer tools to initialize the - machine ID stored in - /etc/machine-id at install time - with a randomly generated ID. See - machine-id5 - for more information about this file. - - This tool will execute no operation if - /etc/machine-id is already - initialized. - - If a valid D-Bus machine ID is already - configured for the system, the D-Bus machine ID is - copied and used to initialize the machine ID in - /etc/machine-id. - - If run inside a KVM virtual machine and a UUID - is passed via the option, this - UUID is used to initialize the machine ID instead of a - randomly generated one. The caller must ensure that the - UUID passed is sufficiently unique and is different - for every booted instanced of the VM. - - Similar, if run inside a Linux container - environment and a UUID is set for the container this - is used to initialize the machine ID. For details see - the documentation of the Container - Interface. - - Use - systemd-firstboot1 - to initialize the machine ID on mounted (but not - booted) system images. - - - - - Options - - The following options are understood: - - - - - Takes a directory path - as an argument. All paths will be - prefixed with the given alternate - root path, - including config search paths. - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - machine-id5, - dbus-uuidgen1, - systemd-firstboot1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-machine-id-setup + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-machine-id-setup + 1 + + + + systemd-machine-id-setup + Initialize the machine ID in /etc/machine-id + + + + + systemd-machine-id-setup + + + + + Description + + systemd-machine-id-setup may be used by + system installer tools to initialize the machine ID stored in + /etc/machine-id at install time with a + randomly generated ID. See + machine-id5 + for more information about this file. + + This tool will execute no operation if + /etc/machine-id is already + initialized. + + If a valid D-Bus machine ID is already configured for the + system, the D-Bus machine ID is copied and used to initialize the + machine ID in /etc/machine-id. + + If run inside a KVM virtual machine and a UUID is passed via + the option, this UUID is used to initialize + the machine ID instead of a randomly generated one. The caller + must ensure that the UUID passed is sufficiently unique and is + different for every booted instanced of the VM. + + Similar, if run inside a Linux container environment and a + UUID is set for the container this is used to initialize the + machine ID. For details see the documentation of the Container + Interface. + + Use + systemd-firstboot1 + to initialize the machine ID on mounted (but not booted) system + images. + + + + + Options + + The following options are understood: + + + + + Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + machine-id5, + dbus-uuidgen1, + systemd-firstboot1 + + diff --git a/man/systemd-machined.html b/man/systemd-machined.html index da85eb656..953e05f8e 100644 --- a/man/systemd-machined.html +++ b/man/systemd-machined.html @@ -19,17 +19,21 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-machined.service, systemd-machined — Virtual machine and container registration manager

Synopsis

systemd-machined.service

/usr/lib/systemd/systemd-machined

Description¶

systemd-machined is a - system service that keeps track of virtual machines - and containers, and processes belonging to - them.

See - systemd-nspawn(1) - for some examples on how to start a container the systemd - way.

See the - machined D-Bus API Documentation for information about - the APIs systemd-machined - provides.

+ gudev systemd 219

Name

systemd-machined.service, systemd-machined — Virtual machine and container registration manager

Synopsis

systemd-machined.service

/usr/lib/systemd/systemd-machined

Description¶

systemd-machined is a system service that + keeps track of virtual machines and containers, and processes + belonging to them.

See + systemd-nspawn(1) + for some examples on how to run containers with OS tools.

Use + nss-mymachines(8) + to make the names of local containers known to + systemd-machined locally resolvable as host + names.

See the + + machined D-Bus API Documentation for information about the + APIs systemd-machined provides.

diff --git a/man/systemd-machined.service.8 b/man/systemd-machined.service.8 index 6dfa0cad0..b6e8d8492 100644 --- a/man/systemd-machined.service.8 +++ b/man/systemd-machined.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-MACHINED\&.SERVICE" "8" "" "systemd 218" "systemd-machined.service" +.TH "SYSTEMD\-MACHINED\&.SERVICE" "8" "" "systemd 219" "systemd-machined.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,7 +33,13 @@ is a system service that keeps track of virtual machines and containers, and pro .PP See \fBsystemd-nspawn\fR(1) -for some examples on how to start a container the systemd way\&. +for some examples on how to run containers with OS tools\&. +.PP +Use +\fBnss-mymachines\fR(8) +to make the names of local containers known to +\fBsystemd\-machined\fR +locally resolvable as host names\&. .PP See the \m[blue]\fBmachined D\-Bus API Documentation\fR\m[]\&\s-2\u[1]\d\s+2 @@ -44,7 +50,9 @@ provides\&. .PP \fBsystemd\fR(1), \fBmachinectl\fR(1), -\fBsystemd.special\fR(7)\&. +\fBsystemd-nspawn\fR(1), +\fBnss-mymachines\fR(8), +\fBsystemd.special\fR(7) .SH "NOTES" .IP " 1." 4 machined D-Bus API Documentation diff --git a/man/systemd-machined.service.html b/man/systemd-machined.service.html index da85eb656..953e05f8e 100644 --- a/man/systemd-machined.service.html +++ b/man/systemd-machined.service.html @@ -19,17 +19,21 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-machined.service, systemd-machined — Virtual machine and container registration manager

Synopsis

systemd-machined.service

/usr/lib/systemd/systemd-machined

Description¶

systemd-machined is a - system service that keeps track of virtual machines - and containers, and processes belonging to - them.

See - systemd-nspawn(1) - for some examples on how to start a container the systemd - way.

See the - machined D-Bus API Documentation for information about - the APIs systemd-machined - provides.

+ gudev systemd 219

Name

systemd-machined.service, systemd-machined — Virtual machine and container registration manager

Synopsis

systemd-machined.service

/usr/lib/systemd/systemd-machined

Description¶

systemd-machined is a system service that + keeps track of virtual machines and containers, and processes + belonging to them.

See + systemd-nspawn(1) + for some examples on how to run containers with OS tools.

Use + nss-mymachines(8) + to make the names of local containers known to + systemd-machined locally resolvable as host + names.

See the + + machined D-Bus API Documentation for information about the + APIs systemd-machined provides.

diff --git a/man/systemd-machined.service.xml b/man/systemd-machined.service.xml index 352b4a025..999aeee1c 100644 --- a/man/systemd-machined.service.xml +++ b/man/systemd-machined.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd-modules-load.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-modules-load.service - 8 - - - - systemd-modules-load.service - systemd-modules-load - Load kernel modules at boot - - - - systemd-modules-load.service - /usr/lib/systemd/systemd-modules-load - - - - Description - - systemd-modules-load.service - is an early-boot service that loads kernel modules - based on static configuration. - - See - modules-load.d5 - for information about the configuration of this - service. - - - - - Kernel Command Line - - systemd-modules-load.service understands - the following kernel command line parameters: - - - - - modules-load= - rd.modules-load= - - Takes a comma-separated - list of kernel modules to - statically load during early boot. The - option prefixed with - rd. is read by the - initial RAM disk - only. - - - - - - - See Also - - systemd1, - modules-load.d5, - - + + systemd-modules-load.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-modules-load.service + 8 + + + + systemd-modules-load.service + systemd-modules-load + Load kernel modules at boot + + + + systemd-modules-load.service + /usr/lib/systemd/systemd-modules-load + + + + Description + + systemd-modules-load.service is an + early-boot service that loads kernel modules based on static + configuration. + + See + modules-load.d5 + for information about the configuration of this service. + + + + + Kernel Command Line + + systemd-modules-load.service + understands the following kernel command line parameters: + + + + + modules-load= + rd.modules-load= + + Takes a comma-separated list of kernel modules + to statically load during early boot. The option prefixed with + rd. is read by the initial RAM disk + only. + + + + + + + See Also + + systemd1, + modules-load.d5, + + diff --git a/man/systemd-networkd-wait-online.html b/man/systemd-networkd-wait-online.html index 134fab8db..055ab004a 100644 --- a/man/systemd-networkd-wait-online.html +++ b/man/systemd-networkd-wait-online.html @@ -19,18 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-networkd-wait-online.service, systemd-networkd-wait-online — Wait for network to come online

Synopsis

systemd-networkd-wait-online.service

/usr/lib/systemd/systemd-networkd-wait-online

Description¶

systemd-networkd-wait-online is a - one-shot system service that waits for the network to be configured. - By default, it will wait for all links it is aware of and which are managed by - systemd-networkd.service(8) - to be fully configured or failed, and for at least one link to gain a - carrier.

Options¶

The following options are understood:

-i, --interface=¶

Network interface to wait for - before deciding if the system is online. This is - useful when a system has several interfaces which - will be configured, but a particular one is necessary - to access some network resources. This option may be - used more than once to wait for multiple network - interfaces.

+ gudev systemd 219

Name

systemd-networkd-wait-online.service, systemd-networkd-wait-online — Wait for network to come online

Synopsis

systemd-networkd-wait-online.service

/usr/lib/systemd/systemd-networkd-wait-online

Description¶

systemd-networkd-wait-online is a + one-shot system service that waits for the network to be + configured. By default, it will wait for all links it is aware of + and which are managed by + systemd-networkd.service(8) + to be fully configured or failed, and for at least one link to + gain a carrier.

Options¶

The following options are understood:

-i, --interface=¶

Network interface to wait for before deciding + if the system is online. This is useful when a system has + several interfaces which will be configured, but a particular + one is necessary to access some network resources. This option + may be used more than once to wait for multiple network + interfaces.

--ignore=¶

Network interfaces to be ignored when deciding + if the system is online. By default only the loopback + interface is ignored. This option may be used more than once + to ignore multiple network interfaces.

--timeout=¶

Fail the service if the network is not online + by the time the timeout elapses. A timeout of 0 disables the + timeout. Defaults to 120 seconds.

diff --git a/man/systemd-networkd-wait-online.service.8 b/man/systemd-networkd-wait-online.service.8 index 150c7df8b..9484125a5 100644 --- a/man/systemd-networkd-wait-online.service.8 +++ b/man/systemd-networkd-wait-online.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-NETWORKD\-WAIT\-ONLINE\&.SERVICE" "8" "" "systemd 218" "systemd-networkd.service" +.TH "SYSTEMD\-NETWORKD\-WAIT\-ONLINE\&.SERVICE" "8" "" "systemd 219" "systemd-networkd.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,6 +40,16 @@ The following options are understood: .RS 4 Network interface to wait for before deciding if the system is online\&. This is useful when a system has several interfaces which will be configured, but a particular one is necessary to access some network resources\&. This option may be used more than once to wait for multiple network interfaces\&. .RE +.PP +\fB\-\-ignore=\fR +.RS 4 +Network interfaces to be ignored when deciding if the system is online\&. By default only the loopback interface is ignored\&. This option may be used more than once to ignore multiple network interfaces\&. +.RE +.PP +\fB\-\-timeout=\fR +.RS 4 +Fail the service if the network is not online by the time the timeout elapses\&. A timeout of 0 disables the timeout\&. Defaults to 120 seconds\&. +.RE .SH "SEE ALSO" .PP \fBsystemd\fR(1), diff --git a/man/systemd-networkd-wait-online.service.html b/man/systemd-networkd-wait-online.service.html index 134fab8db..055ab004a 100644 --- a/man/systemd-networkd-wait-online.service.html +++ b/man/systemd-networkd-wait-online.service.html @@ -19,18 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-networkd-wait-online.service, systemd-networkd-wait-online — Wait for network to come online

Synopsis

systemd-networkd-wait-online.service

/usr/lib/systemd/systemd-networkd-wait-online

Description¶

systemd-networkd-wait-online is a - one-shot system service that waits for the network to be configured. - By default, it will wait for all links it is aware of and which are managed by - systemd-networkd.service(8) - to be fully configured or failed, and for at least one link to gain a - carrier.

Options¶

The following options are understood:

-i, --interface=¶

Network interface to wait for - before deciding if the system is online. This is - useful when a system has several interfaces which - will be configured, but a particular one is necessary - to access some network resources. This option may be - used more than once to wait for multiple network - interfaces.

+ gudev systemd 219

Name

systemd-networkd-wait-online.service, systemd-networkd-wait-online — Wait for network to come online

Synopsis

systemd-networkd-wait-online.service

/usr/lib/systemd/systemd-networkd-wait-online

Description¶

systemd-networkd-wait-online is a + one-shot system service that waits for the network to be + configured. By default, it will wait for all links it is aware of + and which are managed by + systemd-networkd.service(8) + to be fully configured or failed, and for at least one link to + gain a carrier.

Options¶

The following options are understood:

-i, --interface=¶

Network interface to wait for before deciding + if the system is online. This is useful when a system has + several interfaces which will be configured, but a particular + one is necessary to access some network resources. This option + may be used more than once to wait for multiple network + interfaces.

--ignore=¶

Network interfaces to be ignored when deciding + if the system is online. By default only the loopback + interface is ignored. This option may be used more than once + to ignore multiple network interfaces.

--timeout=¶

Fail the service if the network is not online + by the time the timeout elapses. A timeout of 0 disables the + timeout. Defaults to 120 seconds.

diff --git a/man/systemd-networkd-wait-online.service.xml b/man/systemd-networkd-wait-online.service.xml index 3083588a3..f53b337da 100644 --- a/man/systemd-networkd-wait-online.service.xml +++ b/man/systemd-networkd-wait-online.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-notify - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-notify - 1 - - - - systemd-notify - Notify service manager about start-up completion and other daemon status changes - - - - - systemd-notify OPTIONS VARIABLE=VALUE - - - - - Description - - systemd-notify may be - called by daemon scripts to notify the init system - about status changes. It can be used to send arbitrary - information, encoded in an environment-block-like list - of strings. Most importantly it can be used for - start-up completion notification. - - This is mostly just a wrapper around - sd_notify() and makes this - functionality available to shell scripts. For details - see - sd_notify3. - - The command line may carry a list of - environment variables to send as part of the status - update. - - Note that systemd will refuse reception of - status updates from this command unless - NotifyAccess=all is set for the - service unit this command is called from. - - - - - Options - - The following options are understood: - - - - - - Inform the init system - about service start-up - completion. This is equivalent to - systemd-notify - READY=1. For details about - the semantics of this option see - sd_notify3. - - - - - - Inform the init system - about the main PID of the - daemon. Takes a PID as argument. If - the argument is omitted, the PID of the - process that invoked - systemd-notify is - used. This is equivalent to - systemd-notify - MAINPID=$PID. For details - about the semantics of this option see - sd_notify3. - - - - - - Send a free-form - status string for the daemon to the - init systemd. This option takes the - status string as argument. This is - equivalent to systemd-notify - STATUS=.... For details - about the semantics of this option see - sd_notify3. - - - - - - Returns 0 if the - system was booted up with systemd, - non-zero otherwise. If this option is - passed, no message is sent. This option - is hence unrelated to the other - options. For details about the - semantics of this option, see - sd_booted3. - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - Example - - - Start-up Notification and Status Updates - - A simple shell daemon that sends - start-up notifications after having set up its - communication channel. During runtime it sends - further status updates to the init - system: - - #!/bin/bash + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-notify + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-notify + 1 + + + + systemd-notify + Notify service manager about start-up completion and other daemon status changes + + + + + systemd-notify OPTIONS VARIABLE=VALUE + + + + + Description + + systemd-notify may be called by daemon + scripts to notify the init system about status changes. It can be + used to send arbitrary information, encoded in an + environment-block-like list of strings. Most importantly it can be + used for start-up completion notification. + + This is mostly just a wrapper around + sd_notify() and makes this functionality + available to shell scripts. For details see + sd_notify3. + + + The command line may carry a list of environment variables + to send as part of the status update. + + Note that systemd will refuse reception of status updates + from this command unless NotifyAccess=all is + set for the service unit this command is called from. + + + + + Options + + The following options are understood: + + + + + + Inform the init system about service start-up + completion. This is equivalent to systemd-notify + READY=1. For details about the semantics of this + option see + sd_notify3. + + + + + + Inform the init system about the main PID of + the daemon. Takes a PID as argument. If the argument is + omitted, the PID of the process that invoked + systemd-notify is used. This is equivalent + to systemd-notify MAINPID=$PID. For details + about the semantics of this option see + sd_notify3. + + + + + + Send a free-form status string for the daemon + to the init systemd. This option takes the status string as + argument. This is equivalent to systemd-notify + STATUS=.... For details about the semantics of this + option see + sd_notify3. + + + + + + Returns 0 if the system was booted up with + systemd, non-zero otherwise. If this option is passed, no + message is sent. This option is hence unrelated to the other + options. For details about the semantics of this option, see + sd_booted3. + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + Example + + + Start-up Notification and Status Updates + + A simple shell daemon that sends start-up notifications + after having set up its communication channel. During runtime it + sends further status updates to the init system: + + #!/bin/bash mkfifo /tmp/waldo systemd-notify --ready --status="Waiting for data..." while : ; do - read a < /tmp/waldo - systemd-notify --status="Processing $a" + read a < /tmp/waldo + systemd-notify --status="Processing $a" - # Do something with $a ... + # Do something with $a ... - systemd-notify --status="Waiting for data..." + systemd-notify --status="Waiting for data..." done - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - sd_notify3, - sd_booted3 - - + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + sd_notify3, + sd_booted3 + + diff --git a/man/systemd-nspawn.1 b/man/systemd-nspawn.1 index efe16339f..c014e6d9b 100644 --- a/man/systemd-nspawn.1 +++ b/man/systemd-nspawn.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-NSPAWN" "1" "" "systemd 218" "systemd-nspawn" +.TH "SYSTEMD\-NSPAWN" "1" "" "systemd 219" "systemd-nspawn" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -48,6 +48,7 @@ In contrast to may be used to boot full Linux\-based operating systems in a container\&. .PP Use a tool like +\fBdnf\fR(8), \fByum\fR(8), \fBdebootstrap\fR(8), or \fBpacman\fR(8) @@ -96,19 +97,100 @@ The following options are understood: .PP \fB\-D\fR, \fB\-\-directory=\fR .RS 4 -Directory to use as file system root for the container\&. If neither -\fB\-\-directory=\fR -nor +Directory to use as file system root for the container\&. +.sp +If neither +\fB\-\-directory=\fR, nor \fB\-\-image=\fR +is specified the directory is determined as +/var/lib/machines/ +suffixed by the machine name as specified with +\fB\-\-machine=\fR\&. If neither +\fB\-\-directory=\fR, +\fB\-\-image=\fR, nor +\fB\-\-machine=\fR are specified, the current directory will be used\&. May not be specified together with \fB\-\-image=\fR\&. .RE .PP +\fB\-\-template=\fR +.RS 4 +Directory or +"btrfs" +subvolume to use as template for the container\*(Aqs root directory\&. If this is specified and the container\*(Aqs root directory (as configured by +\fB\-\-directory=\fR) does not yet exist it is created as +"btrfs" +subvolume and populated from this template tree\&. Ideally, the specified template path refers to the root of a +"btrfs" +subvolume, in which case a simple copy\-on\-write snapshot is taken, and populating the root directory is instant\&. If the specified template path does not refer to the root of a +"btrfs" +subvolume (or not even to a +"btrfs" +file system at all), the tree is copied, which can be substantially more time\-consuming\&. Note that if this option is used the container\*(Aqs root directory (in contrast to the template directory!) must be located on a +"btrfs" +file system, so that the +"btrfs" +subvolume may be created\&. May not be specified together with +\fB\-\-image=\fR +or +\fB\-\-ephemeral\fR\&. +.RE +.PP +\fB\-x\fR, \fB\-\-ephemeral\fR +.RS 4 +If specified, the container is run with a temporary +"btrfs" +snapshot of its root directory (as configured with +\fB\-\-directory=\fR), that is removed immediately when the container terminates\&. This option is only supported if the root file system is +"btrfs"\&. May not be specified together with +\fB\-\-image=\fR +or +\fB\-\-template=\fR\&. +.RE +.PP \fB\-i\fR, \fB\-\-image=\fR .RS 4 -Disk image to mount the root directory for the container from\&. Takes a path to a regular file or to a block device node\&. The file or block device must contain a GUID Partition Table with a root partition which is mounted as the root directory of the container\&. Optionally, it may contain a home and/or a server data partition which are mounted to the appropriate places in the container\&. All these partitions must be identified by the partition types defined by the -\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2\&. Any other partitions, such as foreign partitions, swap partitions or EFI system partitions are not mounted\&. May not be specified together with -\fB\-\-directory=\fR\&. +Disk image to mount the root directory for the container from\&. Takes a path to a regular file or to a block device node\&. The file or block device must contain either: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +An MBR partition table with a single partition of type 0x83 that is marked bootable\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A GUID partition table (GPT) with a single partition of type 0fc63daf\-8483\-4772\-8e79\-3d69d8477de4\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A GUID partition table (GPT) with a marked root partition which is mounted as the root directory of the container\&. Optionally, GPT images may contain a home and/or a server data partition which are mounted to the appropriate places in the container\&. All these partitions must be identified by the partition types defined by the +\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2\&. +.RE +.sp +Any other partitions, such as foreign partitions, swap partitions or EFI system partitions are not mounted\&. May not be specified together with +\fB\-\-directory=\fR, +\fB\-\-template=\fR +or +\fB\-\-ephemeral\fR\&. .RE .PP \fB\-b\fR, \fB\-\-boot\fR @@ -124,7 +206,11 @@ After transitioning into the container, change to the specified user\-defined in .PP \fB\-M\fR, \fB\-\-machine=\fR .RS 4 -Sets the machine name for this container\&. This name may be used to identify this container on the host, and is used to initialize the container\*(Aqs hostname (which the container can choose to override, however)\&. If not specified, the last component of the root directory of the container is used\&. +Sets the machine name for this container\&. This name may be used to identify this container during its runtime (for example in tools like +\fBmachinectl\fR(1) +and similar), and is used to initialize the container\*(Aqs hostname (which the container can choose to override, however)\&. If not specified, the last component of the root directory path of the container is used, possibly suffixed with a random identifier in case +\fB\-\-ephemeral\fR +mode is selected\&. If the root directory selected is the host\*(Aqs root directory the host\*(Aqs hostname is used as default instead\&. .RE .PP \fB\-\-uuid=\fR @@ -170,7 +256,22 @@ implies \fB\-\-private\-network\fR\&. This option may be used more than once to add multiple network interfaces to the container\&. .RE .PP -\fB\-\-network\-veth\fR +\fB\-\-network\-ipvlan=\fR +.RS 4 +Create an +"ipvlan" +interface of the specified Ethernet network interface and add it to the container\&. An +"ipvlan" +interface is a virtual interface, similar to a +"macvlan" +interface, which uses the same MAC address as the underlying interface\&. The interface in the container will be named after the interface on the host, prefixed with +"iv\-"\&. Note that +\fB\-\-network\-ipvlan=\fR +implies +\fB\-\-private\-network\fR\&. This option may be used more than once to add multiple network interfaces to the container\&. +.RE +.PP +\fB\-n\fR, \fB\-\-network\-veth\fR .RS 4 Create a virtual Ethernet link ("veth") between host and container\&. The host side of the Ethernet link will be available as a network interface named after the container\*(Aqs name (as specified with \fB\-\-machine=\fR), prefixed with @@ -194,6 +295,19 @@ prefix instead of "ve\-"\&. .RE .PP +\fB\-p\fR, \fB\-\-port=\fR +.RS 4 +If private networking is enabled, maps an IP port on the host onto an IP port on the container\&. Takes a protocol specifier (either +"tcp" +or +"udp"), separated by a colon from a host port number in the range 1 to 65535, separated by a colon from a container port number in the range from 1 to 65535\&. The protocol specifier and its separating colon may be omitted, in which case +"tcp" +is assumed\&. The container port number and its colon may be ommitted, in which case the same port as the host port is implied\&. This option is only supported if private networking is used, such as +\fB\-\-network\-veth\fR +or +\fB\-\-network\-bridge=\fR\&. +.RE +.PP \fB\-Z\fR, \fB\-\-selinux\-context=\fR .RS 4 Sets the SELinux security context to be used to label processes in the container\&. @@ -237,7 +351,7 @@ Control whether the container\*(Aqs journal shall be made visible to the host sy "try\-host" and "try\-guest" -do the same but do not fail if the host does not have persistant journalling enabled\&. If +do the same but do not fail if the host does not have persistent journalling enabled\&. If "auto" (the default), and the right subdirectory of /var/log/journal @@ -335,7 +449,7 @@ Turns off any status output by the tool itself\&. When this switch is used, the .PP \fB\-\-volatile\fR\fI=MODE\fR .RS 4 -Boots the container in volatile (ephemeral) mode\&. When no mode parameter is passed or when mode is specified as +Boots the container in volatile mode\&. When no mode parameter is passed or when mode is specified as "yes" full volatile mode is enabled\&. This means the root directory is mounted as mostly unpopulated "tmpfs" @@ -373,13 +487,30 @@ Print a short version string and exit\&. .RE .SH "EXAMPLES" .PP -\fBExample\ \&1.\ \&Boot a minimal Fedora distribution in a container\fR +\fBExample\ \&1.\ \&Download a Fedora image and start a shell in it\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +# machinectl pull\-raw \-\-verify=no http://ftp\&.halifax\&.rwth\-aachen\&.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora\-Cloud\-Base\-20141203\-21\&.x86_64\&.raw\&.xz +# systemd\-nspawn \-M Fedora\-Cloud\-Base\-20141203\-21 +.fi +.if n \{\ +.RE +.\} +.PP +This downloads an image using +\fBmachinectl\fR(1) +and opens a shell in it\&. +.PP +\fBExample\ \&2.\ \&Build and boot a minimal Fedora distribution in a container\fR .sp .if n \{\ .RS 4 .\} .nf -# yum \-y \-\-releasever=19 \-\-nogpg \-\-installroot=/srv/mycontainer \-\-disablerepo=\*(Aq*\*(Aq \-\-enablerepo=fedora install systemd passwd yum fedora\-release vim\-minimal +# dnf \-y \-\-releasever=21 \-\-nogpg \-\-installroot=/srv/mycontainer \-\-disablerepo=\*(Aq*\*(Aq \-\-enablerepo=fedora install systemd passwd dnf fedora\-release vim\-minimal # systemd\-nspawn \-bD /srv/mycontainer .fi .if n \{\ @@ -390,7 +521,7 @@ This installs a minimal Fedora distribution into the directory /srv/mycontainer/ and then boots an OS in a namespace container in it\&. .PP -\fBExample\ \&2.\ \&Spawn a shell in a container of a minimal Debian unstable distribution\fR +\fBExample\ \&3.\ \&Spawn a shell in a container of a minimal Debian unstable distribution\fR .sp .if n \{\ .RS 4 @@ -407,7 +538,7 @@ This installs a minimal Debian unstable distribution into the directory ~/debian\-tree/ and then spawns a shell in a namespace container in it\&. .PP -\fBExample\ \&3.\ \&Boot a minimal Arch Linux distribution in a container\fR +\fBExample\ \&4.\ \&Boot a minimal Arch Linux distribution in a container\fR .sp .if n \{\ .RS 4 @@ -424,38 +555,21 @@ This installs a mimimal Arch Linux distribution into the directory ~/arch\-tree/ and then boots an OS in a namespace container in it\&. .PP -\fBExample\ \&4.\ \&Enable Arch Linux container on boot\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -# mv ~/arch\-tree /var/lib/container/arch -# systemctl enable systemd\-nspawn@arch\&.service -# systemctl start systemd\-nspawn@arch\&.service -.fi -.if n \{\ -.RE -.\} -.PP -This makes the Arch Linux container part of the -multi\-user\&.target -on the host\&. -.PP -\fBExample\ \&5.\ \&Boot into a btrfs snapshot of the host system\fR +\fBExample\ \&5.\ \&Boot into an ephemeral "btrfs" snapshot of the host system\fR .sp .if n \{\ .RS 4 .\} .nf -# btrfs subvolume snapshot / /\&.tmp -# systemd\-nspawn \-\-private\-network \-D /\&.tmp \-b +# systemd\-nspawn \-D / \-xb .fi .if n \{\ .RE .\} .PP -This runs a copy of the host system in a btrfs snapshot\&. +This runs a copy of the host system in a +"btrfs" +snapshot which is removed immediately when the container exits\&. All file system changes made during runtime will be lost on shutdown, hence\&. .PP \fBExample\ \&6.\ \&Run a container with SELinux sandbox security contexts\fR .sp @@ -476,11 +590,13 @@ The exit code of the program executed in the container is returned\&. .PP \fBsystemd\fR(1), \fBchroot\fR(1), +\fBdnf\fR(8), \fByum\fR(8), \fBdebootstrap\fR(8), \fBpacman\fR(8), \fBsystemd.slice\fR(5), -\fBmachinectl\fR(1) +\fBmachinectl\fR(1), +\fBbtrfs\fR(8) .SH "NOTES" .IP " 1." 4 Container Interface diff --git a/man/systemd-nspawn.html b/man/systemd-nspawn.html index 69286fc1b..c0f69ffe4 100644 --- a/man/systemd-nspawn.html +++ b/man/systemd-nspawn.html @@ -19,448 +19,362 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-nspawn — Spawn a namespace container for debugging, testing and building

Synopsis

systemd-nspawn [OPTIONS...] [COMMAND - [ARGS...] - ]

systemd-nspawn -b [OPTIONS...] [ARGS...]

Description¶

systemd-nspawn may be used to - run a command or OS in a light-weight namespace - container. In many ways it is similar to - chroot(1), - but more powerful since it fully virtualizes the file - system hierarchy, as well as the process tree, the - various IPC subsystems and the host and domain - name.

systemd-nspawn limits access - to various kernel interfaces in the container to - read-only, such as /sys, - /proc/sys or - /sys/fs/selinux. Network - interfaces and the system clock may not be changed - from within the container. Device nodes may not be - created. The host system cannot be rebooted and kernel - modules may not be loaded from within the - container.

Note that even though these security precautions - are taken systemd-nspawn is not - suitable for secure container setups. Many of the - security features may be circumvented and are hence - primarily useful to avoid accidental changes to the - host system from the container. The intended use of - this program is debugging and testing as well as - building of packages, distributions and software - involved with boot and systems management.

In contrast to - chroot(1) systemd-nspawn - may be used to boot full Linux-based operating systems - in a container.

Use a tool like - yum(8), - debootstrap(8), - or - pacman(8) - to set up an OS directory tree suitable as file system - hierarchy for systemd-nspawn - containers.

Note that systemd-nspawn will - mount file systems private to the container to - /dev, - /run and similar. These will - not be visible outside of the container, and their - contents will be lost when the container exits.

Note that running two - systemd-nspawn containers from the - same directory tree will not make processes in them - see each other. The PID namespace separation of the - two containers is complete and the containers will - share very few runtime objects except for the - underlying file system. Use - machinectl(1)'s - login command to request an - additional login prompt in a running container.

systemd-nspawn implements the - Container - Interface specification.

As a safety check - systemd-nspawn will verify the - existence of /usr/lib/os-release - or /etc/os-release in the - container tree before starting the container (see - os-release(5)). It - might be necessary to add this file to the container - tree manually if the OS of the container is too old to - contain this file out-of-the-box.

Options¶

If option -b is specified, the - arguments are used as arguments for the init - binary. Otherwise, COMMAND - specifies the program to launch in the container, and - the remaining arguments are used as arguments for this - program. If -b is not used and no - arguments are specifed, a shell is launched in the - container.

The following options are understood:

-D, --directory=¶

Directory to use as - file system root for the container. If - neither --directory= - nor --image= are - specified, the current directory will - be used. May not be specified together with - --image=.

-i, --image=¶

Disk image to mount - the root directory for the container - from. Takes a path to a regular file - or to a block device node. The file or - block device must contain a GUID - Partition Table with a root partition - which is mounted as the root directory - of the container. Optionally, it may - contain a home and/or a server data - partition which are mounted to the - appropriate places in the - container. All these partitions must - be identified by the partition types - defined by the Discoverable - Partitions Specification. Any - other partitions, such as foreign - partitions, swap partitions or EFI - system partitions are not mounted. May - not be specified together with - --directory=.

-b, --boot¶

Automatically search - for an init binary and invoke it - instead of a shell or a user supplied - program. If this option is used, - arguments specified on the command - line are used as arguments for the - init binary. This option may not be - combined with - --share-system. -

-u, --user=¶

After transitioning - into the container, change to the - specified user-defined in the - container's user database. Like all - other systemd-nspawn features, this is - not a security feature and provides - protection against accidental - destructive operations - only.

-M, --machine=¶

Sets the machine name - for this container. This name may be - used to identify this container on the - host, and is used to initialize the - container's hostname (which the - container can choose to override, - however). If not specified, the last - component of the root directory of the - container is used.

--uuid=¶

Set the specified UUID - for the container. The init system - will initialize - /etc/machine-id - from this if this file is not set yet. -

--slice=¶

Make the container - part of the specified slice, instead - of the default - machine.slice.

--private-network¶

Disconnect networking - of the container from the host. This - makes all network interfaces - unavailable in the container, with the - exception of the loopback device and - those specified with - --network-interface= - and configured with - --network-veth. If - this option is specified, the - CAP_NET_ADMIN capability will be added - to the set of capabilities the - container retains. The latter may be - disabled by using - --drop-capability=.

--network-interface=¶

Assign the specified - network interface to the - container. This will remove the - specified interface from the calling - namespace and place it in the - container. When the container - terminates, it is moved back to the - host namespace. Note that - --network-interface= - implies - --private-network. This - option may be used more than once to - add multiple network interfaces to the - container.

--network-macvlan=¶

Create a - "macvlan" interface - of the specified Ethernet network - interface and add it to the - container. A - "macvlan" interface - is a virtual interface that adds a - second MAC address to an existing - physical Ethernet link. The interface - in the container will be named after - the interface on the host, prefixed - with "mv-". Note that - --network-macvlan= - implies - --private-network. This - option may be used more than once to - add multiple network interfaces to the - container.

--network-veth¶

Create a virtual - Ethernet link - ("veth") between host - and container. The host side of the - Ethernet link will be available as a - network interface named after the - container's name (as specified with - --machine=), prefixed - with "ve-". The - container side of the Ethernet - link will be named - "host0". Note that - --network-veth - implies - --private-network.

--network-bridge=¶

Adds the host side of - the Ethernet link created with - --network-veth to the - specified bridge. Note that - --network-bridge= - implies - --network-veth. If - this option is used, the host side of - the Ethernet link will use the - "vb-" prefix instead - of "ve-".

-Z, --selinux-context=¶

Sets the SELinux - security context to be used to label - processes in the container.

-L, --selinux-apifs-context=¶

Sets the SELinux security - context to be used to label files in - the virtual API file systems in the - container.

--capability=¶

List one or more - additional capabilities to grant the - container. Takes a comma-separated - list of capability names, see - capabilities(7) - for more information. Note that the - following capabilities will be granted - in any way: CAP_CHOWN, - CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH, - CAP_FOWNER, CAP_FSETID, CAP_IPC_OWNER, - CAP_KILL, CAP_LEASE, - CAP_LINUX_IMMUTABLE, - CAP_NET_BIND_SERVICE, - CAP_NET_BROADCAST, CAP_NET_RAW, - CAP_SETGID, CAP_SETFCAP, CAP_SETPCAP, - CAP_SETUID, CAP_SYS_ADMIN, - CAP_SYS_CHROOT, CAP_SYS_NICE, - CAP_SYS_PTRACE, CAP_SYS_TTY_CONFIG, - CAP_SYS_RESOURCE, CAP_SYS_BOOT, - CAP_AUDIT_WRITE, - CAP_AUDIT_CONTROL. Also CAP_NET_ADMIN - is retained if - --private-network is - specified. If the special value - "all" is passed, all - capabilities are - retained.

--drop-capability=¶

Specify one or more - additional capabilities to drop for - the container. This allows running the - container with fewer capabilities than - the default (see above).

Control whether the - container's journal shall be made - visible to the host system. If enabled, - allows viewing the container's journal - files from the host (but not vice - versa). Takes one of - "no", - "host", - "try-host", - "guest", - "try-guest", - "auto". If - "no", the journal is - not linked. If "host", - the journal files are stored on the - host file system (beneath - /var/log/journal/machine-id) - and the subdirectory is bind-mounted - into the container at the same - location. If "guest", - the journal files are stored on the - guest file system (beneath - /var/log/journal/machine-id) - and the subdirectory is symlinked into the host - at the same location. "try-host" - and "try-guest" do the same - but do not fail if the host does not have - persistant journalling enabled. - If "auto" (the default), - and the right subdirectory of - /var/log/journal - exists, it will be bind mounted - into the container. If the - subdirectory does not exist, no - linking is performed. Effectively, - booting a container once with - "guest" or - "host" will link the - journal persistently if further on - the default of "auto" - is used.

-j¶

Equivalent to - --link-journal=try-guest.

--read-only¶

Mount the root file - system read-only for the - container.

--bind=, --bind-ro=¶

Bind mount a file or - directory from the host into the - container. Either takes a path - argument -- in which case the - specified path will be mounted from - the host to the same path in the - container --, or a colon-separated - pair of paths -- in which case the - first specified path is the source in - the host, and the second path is the - destination in the container. The - --bind-ro= option - creates read-only bind - mounts.

--tmpfs=¶

Mount a tmpfs file - system into the container. Takes a - single absolute path argument that - specifies where to mount the tmpfs - instance to (in which case the - directory access mode will be chosen - as 0755, owned by root/root), or - optionally a colon-separated pair of - path and mount option string, that is - used for mounting (in which case the - kernel default for access mode and - owner will be chosen, unless otherwise - specified). This option is - particularly useful for mounting - directories such as - /var as tmpfs, to - allow state-less systems, in - particular when combined with - --read-only.

--setenv=¶

Specifies an - environment variable assignment to - pass to the init process in the - container, in the format - "NAME=VALUE". This - may be used to override the default - variables or to set additional - variables. This parameter may be used - more than once.

--share-system¶

Allows the container - to share certain system facilities - with the host. More specifically, this - turns off PID namespacing, UTS - namespacing and IPC namespacing, and - thus allows the guest to see and - interact more easily with processes - outside of the container. Note that - using this option makes it impossible - to start up a full Operating System in - the container, as an init system - cannot operate in this mode. It is - only useful to run specific programs - or applications this way, without - involving an init system in the - container. This option implies - --register=no. This - option may not be combined with - --boot.

--register=¶

Controls whether the - container is registered with - systemd-machined(8). Takes - a boolean argument, defaults to - "yes". This option - should be enabled when the container - runs a full Operating System (more - specifically: an init system), and is - useful to ensure that the container is - accessible via - machinectl(1) - and shown by tools such as - ps(1). If - the container does not run an init - system, it is recommended to set this - option to "no". Note - that --share-system - implies - --register=no. -

--keep-unit¶

Instead of creating a - transient scope unit to run the - container in, simply register the - service or scope unit - systemd-nspawn has - been invoked in with - systemd-machined(8). This - has no effect if - --register=no is - used. This switch should be used if - systemd-nspawn is - invoked from within a service unit, - and the service unit's sole purpose - is to run a single - systemd-nspawn - container. This option is not - available if run from a user - session.

--personality=¶

Control the - architecture ("personality") reported - by - uname(2) - in the container. Currently, only - "x86" and - "x86-64" are - supported. This is useful when running - a 32-bit container on a 64-bit - host. If this setting is not used, - the personality reported in the - container is the same as the one - reported on the - host.

-q, --quiet¶

Turns off any status - output by the tool itself. When this - switch is used, the only output - from nspawn will be the console output - of the container OS itself.

--volatile=MODE¶

Boots the container in - volatile (ephemeral) mode. When no - mode parameter is passed or when mode - is specified as "yes" - full volatile mode is enabled. This - means the root directory is mounted as - mostly unpopulated - "tmpfs" instance, and - /usr from the OS - tree is mounted into it, read-only - (the system thus starts up with - read-only OS resources, but pristine - state and configuration, any changes - to the either are lost on - shutdown). When the mode parameter is - specified as "state" - the OS tree is mounted read-only, but - /var is mounted - as "tmpfs" instance - into it (the system thus starts up - with read-only OS resources and - configuration, but pristine state, any - changes to the latter are lost on - shutdown). When the mode parameter is - specified as "no" - (the default) the whole OS tree is made - available writable.

Note that setting this to - "yes" or - "state" will only - work correctly with operating systems - in the container that can boot up with - only /usr - mounted, and are able to populate - /var - automatically, as - needed.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Examples¶

Example 1. Boot a minimal Fedora distribution in a container

# yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal
-# systemd-nspawn -bD /srv/mycontainer

This installs a minimal Fedora distribution into - the directory /srv/mycontainer/ and - then boots an OS in a namespace container in - it.


Example 2. Spawn a shell in a container of a minimal Debian unstable distribution

# debootstrap --arch=amd64 unstable ~/debian-tree/
-# systemd-nspawn -D ~/debian-tree/

This installs a minimal Debian unstable - distribution into the directory - ~/debian-tree/ and then spawns a - shell in a namespace container in it.


Example 3. Boot a minimal Arch Linux distribution in a container

# pacstrap -c -d ~/arch-tree/ base
-# systemd-nspawn -bD ~/arch-tree/

This installs a mimimal Arch Linux distribution into - the directory ~/arch-tree/ and then - boots an OS in a namespace container in it.


Example 4. Enable Arch Linux container on boot

# mv ~/arch-tree /var/lib/container/arch
-# systemctl enable systemd-nspawn@arch.service
-# systemctl start systemd-nspawn@arch.service

This makes the Arch Linux container part of the - multi-user.target on the host. -


Example 5. Boot into a btrfs snapshot of the host system

# btrfs subvolume snapshot / /.tmp
-# systemd-nspawn --private-network -D /.tmp -b

This runs a copy of the host system in a - btrfs snapshot.


Example 6. Run a container with SELinux sandbox security contexts

# chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container
-# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh

Exit status¶

The exit code of the program executed in the - container is returned.

+ gudev systemd 219

Name

systemd-nspawn — Spawn a namespace container for debugging, testing and building

Synopsis

systemd-nspawn [OPTIONS...] [COMMAND + [ARGS...] + ]

systemd-nspawn -b [OPTIONS...] [ARGS...]

Description¶

systemd-nspawn may be used to run a + command or OS in a light-weight namespace container. In many ways + it is similar to + chroot(1), + but more powerful since it fully virtualizes the file system + hierarchy, as well as the process tree, the various IPC subsystems + and the host and domain name.

systemd-nspawn limits access to various + kernel interfaces in the container to read-only, such as + /sys, /proc/sys or + /sys/fs/selinux. Network interfaces and the + system clock may not be changed from within the container. Device + nodes may not be created. The host system cannot be rebooted and + kernel modules may not be loaded from within the container.

Note that even though these security precautions are taken + systemd-nspawn is not suitable for secure + container setups. Many of the security features may be + circumvented and are hence primarily useful to avoid accidental + changes to the host system from the container. The intended use of + this program is debugging and testing as well as building of + packages, distributions and software involved with boot and + systems management.

In contrast to + chroot(1) systemd-nspawn + may be used to boot full Linux-based operating systems in a + container.

Use a tool like + dnf(8), + yum(8), + debootstrap(8), + or + pacman(8) + to set up an OS directory tree suitable as file system hierarchy + for systemd-nspawn containers.

Note that systemd-nspawn will mount file + systems private to the container to /dev, + /run and similar. These will not be visible + outside of the container, and their contents will be lost when the + container exits.

Note that running two systemd-nspawn + containers from the same directory tree will not make processes in + them see each other. The PID namespace separation of the two + containers is complete and the containers will share very few + runtime objects except for the underlying file system. Use + machinectl(1)'s + login command to request an additional login + prompt in a running container.

systemd-nspawn implements the + Container + Interface specification.

As a safety check systemd-nspawn will + verify the existence of /usr/lib/os-release + or /etc/os-release in the container tree + before starting the container (see + os-release(5)). + It might be necessary to add this file to the container tree + manually if the OS of the container is too old to contain this + file out-of-the-box.

Options¶

If option -b is specified, the arguments + are used as arguments for the init binary. Otherwise, + COMMAND specifies the program to launch + in the container, and the remaining arguments are used as + arguments for this program. If -b is not used and + no arguments are specifed, a shell is launched in the + container.

The following options are understood:

-D, --directory=¶

Directory to use as file system root for the + container.

If neither --directory=, nor + --image= is specified the directory is + determined as /var/lib/machines/ suffixed + by the machine name as specified with + --machine=. If neither + --directory=, --image=, nor + --machine= are specified, the current + directory will be used. May not be specified together with + --image=.

--template=¶

Directory or "btrfs" + subvolume to use as template for the container's root + directory. If this is specified and the container's root + directory (as configured by --directory=) + does not yet exist it is created as "btrfs" + subvolume and populated from this template tree. Ideally, the + specified template path refers to the root of a + "btrfs" subvolume, in which case a simple + copy-on-write snapshot is taken, and populating the root + directory is instant. If the specified template path does not + refer to the root of a "btrfs" subvolume (or + not even to a "btrfs" file system at all), + the tree is copied, which can be substantially more + time-consuming. Note that if this option is used the + container's root directory (in contrast to the template + directory!) must be located on a "btrfs" file + system, so that the "btrfs" subvolume may be + created. May not be specified together with + --image= or + --ephemeral.

-x, --ephemeral¶

If specified, the container is run with a + temporary "btrfs" snapshot of its root + directory (as configured with --directory=), + that is removed immediately when the container terminates. + This option is only supported if the root file system is + "btrfs". May not be specified together with + --image= or + --template=.

-i, --image=¶

Disk image to mount the root directory for the + container from. Takes a path to a regular file or to a block + device node. The file or block device must contain + either:

  • An MBR partition table with a single + partition of type 0x83 that is marked + bootable.

  • A GUID partition table (GPT) with a single + partition of type + 0fc63daf-8483-4772-8e79-3d69d8477de4.

  • A GUID partition table (GPT) with a marked + root partition which is mounted as the root directory of the + container. Optionally, GPT images may contain a home and/or + a server data partition which are mounted to the appropriate + places in the container. All these partitions must be + identified by the partition types defined by the Discoverable + Partitions Specification.

Any other partitions, such as foreign partitions, swap + partitions or EFI system partitions are not mounted. May not + be specified together with --directory=, + --template= or + --ephemeral.

-b, --boot¶

Automatically search for an init binary and + invoke it instead of a shell or a user supplied program. If + this option is used, arguments specified on the command line + are used as arguments for the init binary. This option may not + be combined with --share-system. +

-u, --user=¶

After transitioning into the container, change + to the specified user-defined in the container's user + database. Like all other systemd-nspawn features, this is not + a security feature and provides protection against accidental + destructive operations only.

-M, --machine=¶

Sets the machine name for this container. This + name may be used to identify this container during its runtime + (for example in tools like + machinectl(1) + and similar), and is used to initialize the container's + hostname (which the container can choose to override, + however). If not specified, the last component of the root + directory path of the container is used, possibly suffixed + with a random identifier in case --ephemeral + mode is selected. If the root directory selected is the host's + root directory the host's hostname is used as default + instead.

--uuid=¶

Set the specified UUID for the container. The + init system will initialize + /etc/machine-id from this if this file is + not set yet.

--slice=¶

Make the container part of the specified + slice, instead of the default + machine.slice.

--private-network¶

Disconnect networking of the container from + the host. This makes all network interfaces unavailable in the + container, with the exception of the loopback device and those + specified with --network-interface= and + configured with --network-veth. If this + option is specified, the CAP_NET_ADMIN capability will be + added to the set of capabilities the container retains. The + latter may be disabled by using + --drop-capability=.

--network-interface=¶

Assign the specified network interface to the + container. This will remove the specified interface from the + calling namespace and place it in the container. When the + container terminates, it is moved back to the host namespace. + Note that --network-interface= implies + --private-network. This option may be used + more than once to add multiple network interfaces to the + container.

--network-macvlan=¶

Create a "macvlan" interface + of the specified Ethernet network interface and add it to the + container. A "macvlan" interface is a virtual + interface that adds a second MAC address to an existing + physical Ethernet link. The interface in the container will be + named after the interface on the host, prefixed with + "mv-". Note that + --network-macvlan= implies + --private-network. This option may be used + more than once to add multiple network interfaces to the + container.

--network-ipvlan=¶

Create an "ipvlan" interface + of the specified Ethernet network interface and add it to the + container. An "ipvlan" interface is a virtual + interface, similar to a "macvlan" interface, + which uses the same MAC address as the underlying interface. + The interface in the container will be named after the + interface on the host, prefixed with "iv-". + Note that --network-ipvlan= implies + --private-network. This option may be used + more than once to add multiple network interfaces to the + container.

-n, --network-veth¶

Create a virtual Ethernet link + ("veth") between host and container. The host + side of the Ethernet link will be available as a network + interface named after the container's name (as specified with + --machine=), prefixed with + "ve-". The container side of the Ethernet + link will be named "host0". Note that + --network-veth implies + --private-network.

--network-bridge=¶

Adds the host side of the Ethernet link + created with --network-veth to the specified + bridge. Note that --network-bridge= implies + --network-veth. If this option is used, the + host side of the Ethernet link will use the + "vb-" prefix instead of + "ve-".

-p, --port=¶

If private networking is enabled, maps an IP + port on the host onto an IP port on the container. Takes a + protocol specifier (either "tcp" or + "udp"), separated by a colon from a host port + number in the range 1 to 65535, separated by a colon from a + container port number in the range from 1 to 65535. The + protocol specifier and its separating colon may be omitted, in + which case "tcp" is assumed. The container + port number and its colon may be ommitted, in which case the + same port as the host port is implied. This option is only + supported if private networking is used, such as + --network-veth or + --network-bridge=.

-Z, --selinux-context=¶

Sets the SELinux security context to be used + to label processes in the container.

-L, --selinux-apifs-context=¶

Sets the SELinux security context to be used + to label files in the virtual API file systems in the + container.

--capability=¶

List one or more additional capabilities to + grant the container. Takes a comma-separated list of + capability names, see + capabilities(7) + for more information. Note that the following capabilities + will be granted in any way: CAP_CHOWN, CAP_DAC_OVERRIDE, + CAP_DAC_READ_SEARCH, CAP_FOWNER, CAP_FSETID, CAP_IPC_OWNER, + CAP_KILL, CAP_LEASE, CAP_LINUX_IMMUTABLE, + CAP_NET_BIND_SERVICE, CAP_NET_BROADCAST, CAP_NET_RAW, + CAP_SETGID, CAP_SETFCAP, CAP_SETPCAP, CAP_SETUID, + CAP_SYS_ADMIN, CAP_SYS_CHROOT, CAP_SYS_NICE, CAP_SYS_PTRACE, + CAP_SYS_TTY_CONFIG, CAP_SYS_RESOURCE, CAP_SYS_BOOT, + CAP_AUDIT_WRITE, CAP_AUDIT_CONTROL. Also CAP_NET_ADMIN is + retained if --private-network is specified. + If the special value "all" is passed, all + capabilities are retained.

--drop-capability=¶

Specify one or more additional capabilities to + drop for the container. This allows running the container with + fewer capabilities than the default (see + above).

Control whether the container's journal shall + be made visible to the host system. If enabled, allows viewing + the container's journal files from the host (but not vice + versa). Takes one of "no", + "host", "try-host", + "guest", "try-guest", + "auto". If "no", the journal + is not linked. If "host", the journal files + are stored on the host file system (beneath + /var/log/journal/machine-id) + and the subdirectory is bind-mounted into the container at the + same location. If "guest", the journal files + are stored on the guest file system (beneath + /var/log/journal/machine-id) + and the subdirectory is symlinked into the host at the same + location. "try-host" and + "try-guest" do the same but do not fail if + the host does not have persistent journalling enabled. If + "auto" (the default), and the right + subdirectory of /var/log/journal exists, + it will be bind mounted into the container. If the + subdirectory does not exist, no linking is performed. + Effectively, booting a container once with + "guest" or "host" will link + the journal persistently if further on the default of + "auto" is used.

-j¶

Equivalent to + --link-journal=try-guest.

--read-only¶

Mount the root file system read-only for the + container.

--bind=, --bind-ro=¶

Bind mount a file or directory from the host + into the container. Either takes a path argument -- in which + case the specified path will be mounted from the host to the + same path in the container --, or a colon-separated pair of + paths -- in which case the first specified path is the source + in the host, and the second path is the destination in the + container. The --bind-ro= option creates + read-only bind mounts.

--tmpfs=¶

Mount a tmpfs file system into the container. + Takes a single absolute path argument that specifies where to + mount the tmpfs instance to (in which case the directory + access mode will be chosen as 0755, owned by root/root), or + optionally a colon-separated pair of path and mount option + string, that is used for mounting (in which case the kernel + default for access mode and owner will be chosen, unless + otherwise specified). This option is particularly useful for + mounting directories such as /var as + tmpfs, to allow state-less systems, in particular when + combined with --read-only.

--setenv=¶

Specifies an environment variable assignment + to pass to the init process in the container, in the format + "NAME=VALUE". This may be used to override + the default variables or to set additional variables. This + parameter may be used more than once.

--share-system¶

Allows the container to share certain system + facilities with the host. More specifically, this turns off + PID namespacing, UTS namespacing and IPC namespacing, and thus + allows the guest to see and interact more easily with + processes outside of the container. Note that using this + option makes it impossible to start up a full Operating System + in the container, as an init system cannot operate in this + mode. It is only useful to run specific programs or + applications this way, without involving an init system in the + container. This option implies --register=no. + This option may not be combined with + --boot.

--register=¶

Controls whether the container is registered + with + systemd-machined(8). + Takes a boolean argument, defaults to "yes". + This option should be enabled when the container runs a full + Operating System (more specifically: an init system), and is + useful to ensure that the container is accessible via + machinectl(1) + and shown by tools such as + ps(1). + If the container does not run an init system, it is + recommended to set this option to "no". Note + that --share-system implies + --register=no.

--keep-unit¶

Instead of creating a transient scope unit to + run the container in, simply register the service or scope + unit systemd-nspawn has been invoked in + with + systemd-machined(8). + This has no effect if --register=no is used. + This switch should be used if + systemd-nspawn is invoked from within a + service unit, and the service unit's sole purpose is to run a + single systemd-nspawn container. This + option is not available if run from a user + session.

--personality=¶

Control the architecture ("personality") + reported by + uname(2) + in the container. Currently, only "x86" and + "x86-64" are supported. This is useful when + running a 32-bit container on a 64-bit host. If this setting + is not used, the personality reported in the container is the + same as the one reported on the host.

-q, --quiet¶

Turns off any status output by the tool + itself. When this switch is used, the only output from nspawn + will be the console output of the container OS + itself.

--volatile=MODE¶

Boots the container in volatile mode. When no + mode parameter is passed or when mode is specified as + "yes" full volatile mode is enabled. This + means the root directory is mounted as mostly unpopulated + "tmpfs" instance, and + /usr from the OS tree is mounted into it, + read-only (the system thus starts up with read-only OS + resources, but pristine state and configuration, any changes + to the either are lost on shutdown). When the mode parameter + is specified as "state" the OS tree is + mounted read-only, but /var is mounted as + "tmpfs" instance into it (the system thus + starts up with read-only OS resources and configuration, but + pristine state, any changes to the latter are lost on + shutdown). When the mode parameter is specified as + "no" (the default) the whole OS tree is made + available writable.

Note that setting this to "yes" or + "state" will only work correctly with + operating systems in the container that can boot up with only + /usr mounted, and are able to populate + /var automatically, as + needed.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Examples¶

Example 1. Download a Fedora image and start a shell in it

# machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
+# systemd-nspawn -M Fedora-Cloud-Base-20141203-21

This downloads an image using + machinectl(1) + and opens a shell in it.


Example 2. Build and boot a minimal Fedora distribution in a container

# dnf -y --releasever=21 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd dnf fedora-release vim-minimal
+# systemd-nspawn -bD /srv/mycontainer

This installs a minimal Fedora distribution into the + directory /srv/mycontainer/ + and then boots an OS in a namespace container in it.


Example 3. Spawn a shell in a container of a minimal Debian unstable distribution

# debootstrap --arch=amd64 unstable ~/debian-tree/
+# systemd-nspawn -D ~/debian-tree/

This installs a minimal Debian unstable distribution into + the directory ~/debian-tree/ and then + spawns a shell in a namespace container in it.


Example 4. Boot a minimal Arch Linux distribution in a container

# pacstrap -c -d ~/arch-tree/ base
+# systemd-nspawn -bD ~/arch-tree/

This installs a mimimal Arch Linux distribution into the + directory ~/arch-tree/ and then boots an OS + in a namespace container in it.


Example 5. Boot into an ephemeral "btrfs" snapshot of the host system

# systemd-nspawn -D / -xb

This runs a copy of the host system in a + "btrfs" snapshot which is removed immediately + when the container exits. All file system changes made during + runtime will be lost on shutdown, hence.


Example 6. Run a container with SELinux sandbox security contexts

# chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container
+# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh

Exit status¶

The exit code of the program executed in the container is + returned.

diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 75db65eac..4a936d326 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-nspawn - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-nspawn - 1 - - - - systemd-nspawn - Spawn a namespace container for debugging, testing and building - - - - - systemd-nspawn - OPTIONS - COMMAND - ARGS - - - - systemd-nspawn - -b - OPTIONS - ARGS - - - - - Description - - systemd-nspawn may be used to - run a command or OS in a light-weight namespace - container. In many ways it is similar to - chroot1, - but more powerful since it fully virtualizes the file - system hierarchy, as well as the process tree, the - various IPC subsystems and the host and domain - name. - - systemd-nspawn limits access - to various kernel interfaces in the container to - read-only, such as /sys, - /proc/sys or - /sys/fs/selinux. Network - interfaces and the system clock may not be changed - from within the container. Device nodes may not be - created. The host system cannot be rebooted and kernel - modules may not be loaded from within the - container. - - Note that even though these security precautions - are taken systemd-nspawn is not - suitable for secure container setups. Many of the - security features may be circumvented and are hence - primarily useful to avoid accidental changes to the - host system from the container. The intended use of - this program is debugging and testing as well as - building of packages, distributions and software - involved with boot and systems management. - - In contrast to - chroot1 systemd-nspawn - may be used to boot full Linux-based operating systems - in a container. - - Use a tool like - yum8, - debootstrap8, - or - pacman8 - to set up an OS directory tree suitable as file system - hierarchy for systemd-nspawn - containers. - - Note that systemd-nspawn will - mount file systems private to the container to - /dev, - /run and similar. These will - not be visible outside of the container, and their - contents will be lost when the container exits. - - Note that running two - systemd-nspawn containers from the - same directory tree will not make processes in them - see each other. The PID namespace separation of the - two containers is complete and the containers will - share very few runtime objects except for the - underlying file system. Use - machinectl1's - login command to request an - additional login prompt in a running container. - - systemd-nspawn implements the - Container - Interface specification. - - As a safety check - systemd-nspawn will verify the - existence of /usr/lib/os-release - or /etc/os-release in the - container tree before starting the container (see - os-release5). It - might be necessary to add this file to the container - tree manually if the OS of the container is too old to - contain this file out-of-the-box. - - - - Options - - If option is specified, the - arguments are used as arguments for the init - binary. Otherwise, COMMAND - specifies the program to launch in the container, and - the remaining arguments are used as arguments for this - program. If is not used and no - arguments are specifed, a shell is launched in the - container. - - The following options are understood: - - - - - - - Directory to use as - file system root for the container. If - neither - nor are - specified, the current directory will - be used. May not be specified together with - . - - - - - - - Disk image to mount - the root directory for the container - from. Takes a path to a regular file - or to a block device node. The file or - block device must contain a GUID - Partition Table with a root partition - which is mounted as the root directory - of the container. Optionally, it may - contain a home and/or a server data - partition which are mounted to the - appropriate places in the - container. All these partitions must - be identified by the partition types - defined by the Discoverable - Partitions Specification. Any - other partitions, such as foreign - partitions, swap partitions or EFI - system partitions are not mounted. May - not be specified together with - . - - - - - - - Automatically search - for an init binary and invoke it - instead of a shell or a user supplied - program. If this option is used, - arguments specified on the command - line are used as arguments for the - init binary. This option may not be - combined with - . - - - - - - - - After transitioning - into the container, change to the - specified user-defined in the - container's user database. Like all - other systemd-nspawn features, this is - not a security feature and provides - protection against accidental - destructive operations - only. - - - - - - - Sets the machine name - for this container. This name may be - used to identify this container on the - host, and is used to initialize the - container's hostname (which the - container can choose to override, - however). If not specified, the last - component of the root directory of the - container is used. - - - - - - Set the specified UUID - for the container. The init system - will initialize - /etc/machine-id - from this if this file is not set yet. - - - - - - - Make the container - part of the specified slice, instead - of the default - machine.slice. - - - - - - - Disconnect networking - of the container from the host. This - makes all network interfaces - unavailable in the container, with the - exception of the loopback device and - those specified with - - and configured with - . If - this option is specified, the - CAP_NET_ADMIN capability will be added - to the set of capabilities the - container retains. The latter may be - disabled by using - . - - - - - - Assign the specified - network interface to the - container. This will remove the - specified interface from the calling - namespace and place it in the - container. When the container - terminates, it is moved back to the - host namespace. Note that - - implies - . This - option may be used more than once to - add multiple network interfaces to the - container. - - - - - - Create a - macvlan interface - of the specified Ethernet network - interface and add it to the - container. A - macvlan interface - is a virtual interface that adds a - second MAC address to an existing - physical Ethernet link. The interface - in the container will be named after - the interface on the host, prefixed - with mv-. Note that - - implies - . This - option may be used more than once to - add multiple network interfaces to the - container. - - - - - - Create a virtual - Ethernet link - (veth) between host - and container. The host side of the - Ethernet link will be available as a - network interface named after the - container's name (as specified with - ), prefixed - with ve-. The - container side of the Ethernet - link will be named - host0. Note that - - implies - . - - - - - - Adds the host side of - the Ethernet link created with - to the - specified bridge. Note that - - implies - . If - this option is used, the host side of - the Ethernet link will use the - vb- prefix instead - of ve-. - - - - - - - Sets the SELinux - security context to be used to label - processes in the container. - - - - - - - - Sets the SELinux security - context to be used to label files in - the virtual API file systems in the - container. - - - - - - - List one or more - additional capabilities to grant the - container. Takes a comma-separated - list of capability names, see - capabilities7 - for more information. Note that the - following capabilities will be granted - in any way: CAP_CHOWN, - CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH, - CAP_FOWNER, CAP_FSETID, CAP_IPC_OWNER, - CAP_KILL, CAP_LEASE, - CAP_LINUX_IMMUTABLE, - CAP_NET_BIND_SERVICE, - CAP_NET_BROADCAST, CAP_NET_RAW, - CAP_SETGID, CAP_SETFCAP, CAP_SETPCAP, - CAP_SETUID, CAP_SYS_ADMIN, - CAP_SYS_CHROOT, CAP_SYS_NICE, - CAP_SYS_PTRACE, CAP_SYS_TTY_CONFIG, - CAP_SYS_RESOURCE, CAP_SYS_BOOT, - CAP_AUDIT_WRITE, - CAP_AUDIT_CONTROL. Also CAP_NET_ADMIN - is retained if - is - specified. If the special value - all is passed, all - capabilities are - retained. - - - - - - Specify one or more - additional capabilities to drop for - the container. This allows running the - container with fewer capabilities than - the default (see above). - - - - - - Control whether the - container's journal shall be made - visible to the host system. If enabled, - allows viewing the container's journal - files from the host (but not vice - versa). Takes one of - no, - host, - try-host, - guest, - try-guest, - auto. If - no, the journal is - not linked. If host, - the journal files are stored on the - host file system (beneath - /var/log/journal/machine-id) - and the subdirectory is bind-mounted - into the container at the same - location. If guest, - the journal files are stored on the - guest file system (beneath - /var/log/journal/machine-id) - and the subdirectory is symlinked into the host - at the same location. try-host - and try-guest do the same - but do not fail if the host does not have - persistant journalling enabled. - If auto (the default), - and the right subdirectory of - /var/log/journal - exists, it will be bind mounted - into the container. If the - subdirectory does not exist, no - linking is performed. Effectively, - booting a container once with - guest or - host will link the - journal persistently if further on - the default of auto - is used. - - - - - - Equivalent to - . - - - - - - Mount the root file - system read-only for the - container. - - - - - - - Bind mount a file or - directory from the host into the - container. Either takes a path - argument -- in which case the - specified path will be mounted from - the host to the same path in the - container --, or a colon-separated - pair of paths -- in which case the - first specified path is the source in - the host, and the second path is the - destination in the container. The - option - creates read-only bind - mounts. - - - - - - Mount a tmpfs file - system into the container. Takes a - single absolute path argument that - specifies where to mount the tmpfs - instance to (in which case the - directory access mode will be chosen - as 0755, owned by root/root), or - optionally a colon-separated pair of - path and mount option string, that is - used for mounting (in which case the - kernel default for access mode and - owner will be chosen, unless otherwise - specified). This option is - particularly useful for mounting - directories such as - /var as tmpfs, to - allow state-less systems, in - particular when combined with - . - - - - - - Specifies an - environment variable assignment to - pass to the init process in the - container, in the format - NAME=VALUE. This - may be used to override the default - variables or to set additional - variables. This parameter may be used - more than once. - - - - - - Allows the container - to share certain system facilities - with the host. More specifically, this - turns off PID namespacing, UTS - namespacing and IPC namespacing, and - thus allows the guest to see and - interact more easily with processes - outside of the container. Note that - using this option makes it impossible - to start up a full Operating System in - the container, as an init system - cannot operate in this mode. It is - only useful to run specific programs - or applications this way, without - involving an init system in the - container. This option implies - . This - option may not be combined with - . - - - - - - Controls whether the - container is registered with - systemd-machined8. Takes - a boolean argument, defaults to - yes. This option - should be enabled when the container - runs a full Operating System (more - specifically: an init system), and is - useful to ensure that the container is - accessible via - machinectl1 - and shown by tools such as - ps1. If - the container does not run an init - system, it is recommended to set this - option to no. Note - that - implies - . - - - - - - - Instead of creating a - transient scope unit to run the - container in, simply register the - service or scope unit - systemd-nspawn has - been invoked in with - systemd-machined8. This - has no effect if - is - used. This switch should be used if - systemd-nspawn is - invoked from within a service unit, - and the service unit's sole purpose - is to run a single - systemd-nspawn - container. This option is not - available if run from a user - session. - - - - - - Control the - architecture ("personality") reported - by - uname2 - in the container. Currently, only - x86 and - x86-64 are - supported. This is useful when running - a 32-bit container on a 64-bit - host. If this setting is not used, - the personality reported in the - container is the same as the one - reported on the - host. - - - - - - - Turns off any status - output by the tool itself. When this - switch is used, the only output - from nspawn will be the console output - of the container OS itself. - - - - =MODE - - Boots the container in - volatile (ephemeral) mode. When no - mode parameter is passed or when mode - is specified as yes - full volatile mode is enabled. This - means the root directory is mounted as - mostly unpopulated - tmpfs instance, and - /usr from the OS - tree is mounted into it, read-only - (the system thus starts up with - read-only OS resources, but pristine - state and configuration, any changes - to the either are lost on - shutdown). When the mode parameter is - specified as state - the OS tree is mounted read-only, but - /var is mounted - as tmpfs instance - into it (the system thus starts up - with read-only OS resources and - configuration, but pristine state, any - changes to the latter are lost on - shutdown). When the mode parameter is - specified as no - (the default) the whole OS tree is made - available writable. - - Note that setting this to - yes or - state will only - work correctly with operating systems - in the container that can boot up with - only /usr - mounted, and are able to populate - /var - automatically, as - needed. - - - - - - - - - - Examples - - Boot a minimal Fedora distribution in a container - - # yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-nspawn + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-nspawn + 1 + + + + systemd-nspawn + Spawn a namespace container for debugging, testing and building + + + + + systemd-nspawn + OPTIONS + COMMAND + ARGS + + + + systemd-nspawn + -b + OPTIONS + ARGS + + + + + Description + + systemd-nspawn may be used to run a + command or OS in a light-weight namespace container. In many ways + it is similar to + chroot1, + but more powerful since it fully virtualizes the file system + hierarchy, as well as the process tree, the various IPC subsystems + and the host and domain name. + + systemd-nspawn limits access to various + kernel interfaces in the container to read-only, such as + /sys, /proc/sys or + /sys/fs/selinux. Network interfaces and the + system clock may not be changed from within the container. Device + nodes may not be created. The host system cannot be rebooted and + kernel modules may not be loaded from within the container. + + Note that even though these security precautions are taken + systemd-nspawn is not suitable for secure + container setups. Many of the security features may be + circumvented and are hence primarily useful to avoid accidental + changes to the host system from the container. The intended use of + this program is debugging and testing as well as building of + packages, distributions and software involved with boot and + systems management. + + In contrast to + chroot1 systemd-nspawn + may be used to boot full Linux-based operating systems in a + container. + + Use a tool like + dnf8, + yum8, + debootstrap8, + or + pacman8 + to set up an OS directory tree suitable as file system hierarchy + for systemd-nspawn containers. + + Note that systemd-nspawn will mount file + systems private to the container to /dev, + /run and similar. These will not be visible + outside of the container, and their contents will be lost when the + container exits. + + Note that running two systemd-nspawn + containers from the same directory tree will not make processes in + them see each other. The PID namespace separation of the two + containers is complete and the containers will share very few + runtime objects except for the underlying file system. Use + machinectl1's + login command to request an additional login + prompt in a running container. + + systemd-nspawn implements the + Container + Interface specification. + + As a safety check systemd-nspawn will + verify the existence of /usr/lib/os-release + or /etc/os-release in the container tree + before starting the container (see + os-release5). + It might be necessary to add this file to the container tree + manually if the OS of the container is too old to contain this + file out-of-the-box. + + + + Options + + If option is specified, the arguments + are used as arguments for the init binary. Otherwise, + COMMAND specifies the program to launch + in the container, and the remaining arguments are used as + arguments for this program. If is not used and + no arguments are specifed, a shell is launched in the + container. + + The following options are understood: + + + + + + + Directory to use as file system root for the + container. + + If neither , nor + is specified the directory is + determined as /var/lib/machines/ suffixed + by the machine name as specified with + . If neither + , , nor + are specified, the current + directory will be used. May not be specified together with + . + + + + + + Directory or btrfs + subvolume to use as template for the container's root + directory. If this is specified and the container's root + directory (as configured by ) + does not yet exist it is created as btrfs + subvolume and populated from this template tree. Ideally, the + specified template path refers to the root of a + btrfs subvolume, in which case a simple + copy-on-write snapshot is taken, and populating the root + directory is instant. If the specified template path does not + refer to the root of a btrfs subvolume (or + not even to a btrfs file system at all), + the tree is copied, which can be substantially more + time-consuming. Note that if this option is used the + container's root directory (in contrast to the template + directory!) must be located on a btrfs file + system, so that the btrfs subvolume may be + created. May not be specified together with + or + . + + + + + + + If specified, the container is run with a + temporary btrfs snapshot of its root + directory (as configured with ), + that is removed immediately when the container terminates. + This option is only supported if the root file system is + btrfs. May not be specified together with + or + . + + + + + + + Disk image to mount the root directory for the + container from. Takes a path to a regular file or to a block + device node. The file or block device must contain + either: + + + An MBR partition table with a single + partition of type 0x83 that is marked + bootable. + + A GUID partition table (GPT) with a single + partition of type + 0fc63daf-8483-4772-8e79-3d69d8477de4. + + A GUID partition table (GPT) with a marked + root partition which is mounted as the root directory of the + container. Optionally, GPT images may contain a home and/or + a server data partition which are mounted to the appropriate + places in the container. All these partitions must be + identified by the partition types defined by the Discoverable + Partitions Specification. + + + Any other partitions, such as foreign partitions, swap + partitions or EFI system partitions are not mounted. May not + be specified together with , + or + . + + + + + + + Automatically search for an init binary and + invoke it instead of a shell or a user supplied program. If + this option is used, arguments specified on the command line + are used as arguments for the init binary. This option may not + be combined with . + + + + + + + + After transitioning into the container, change + to the specified user-defined in the container's user + database. Like all other systemd-nspawn features, this is not + a security feature and provides protection against accidental + destructive operations only. + + + + + + + Sets the machine name for this container. This + name may be used to identify this container during its runtime + (for example in tools like + machinectl1 + and similar), and is used to initialize the container's + hostname (which the container can choose to override, + however). If not specified, the last component of the root + directory path of the container is used, possibly suffixed + with a random identifier in case + mode is selected. If the root directory selected is the host's + root directory the host's hostname is used as default + instead. + + + + + + Set the specified UUID for the container. The + init system will initialize + /etc/machine-id from this if this file is + not set yet. + + + + + + Make the container part of the specified + slice, instead of the default + machine.slice. + + + + + + + Disconnect networking of the container from + the host. This makes all network interfaces unavailable in the + container, with the exception of the loopback device and those + specified with and + configured with . If this + option is specified, the CAP_NET_ADMIN capability will be + added to the set of capabilities the container retains. The + latter may be disabled by using + . + + + + + + Assign the specified network interface to the + container. This will remove the specified interface from the + calling namespace and place it in the container. When the + container terminates, it is moved back to the host namespace. + Note that implies + . This option may be used + more than once to add multiple network interfaces to the + container. + + + + + + Create a macvlan interface + of the specified Ethernet network interface and add it to the + container. A macvlan interface is a virtual + interface that adds a second MAC address to an existing + physical Ethernet link. The interface in the container will be + named after the interface on the host, prefixed with + mv-. Note that + implies + . This option may be used + more than once to add multiple network interfaces to the + container. + + + + + + Create an ipvlan interface + of the specified Ethernet network interface and add it to the + container. An ipvlan interface is a virtual + interface, similar to a macvlan interface, + which uses the same MAC address as the underlying interface. + The interface in the container will be named after the + interface on the host, prefixed with iv-. + Note that implies + . This option may be used + more than once to add multiple network interfaces to the + container. + + + + + + + Create a virtual Ethernet link + (veth) between host and container. The host + side of the Ethernet link will be available as a network + interface named after the container's name (as specified with + ), prefixed with + ve-. The container side of the Ethernet + link will be named host0. Note that + implies + . + + + + + + Adds the host side of the Ethernet link + created with to the specified + bridge. Note that implies + . If this option is used, the + host side of the Ethernet link will use the + vb- prefix instead of + ve-. + + + + + + + If private networking is enabled, maps an IP + port on the host onto an IP port on the container. Takes a + protocol specifier (either tcp or + udp), separated by a colon from a host port + number in the range 1 to 65535, separated by a colon from a + container port number in the range from 1 to 65535. The + protocol specifier and its separating colon may be omitted, in + which case tcp is assumed. The container + port number and its colon may be ommitted, in which case the + same port as the host port is implied. This option is only + supported if private networking is used, such as + or + . + + + + + + + Sets the SELinux security context to be used + to label processes in the container. + + + + + + + + Sets the SELinux security context to be used + to label files in the virtual API file systems in the + container. + + + + + + + List one or more additional capabilities to + grant the container. Takes a comma-separated list of + capability names, see + capabilities7 + for more information. Note that the following capabilities + will be granted in any way: CAP_CHOWN, CAP_DAC_OVERRIDE, + CAP_DAC_READ_SEARCH, CAP_FOWNER, CAP_FSETID, CAP_IPC_OWNER, + CAP_KILL, CAP_LEASE, CAP_LINUX_IMMUTABLE, + CAP_NET_BIND_SERVICE, CAP_NET_BROADCAST, CAP_NET_RAW, + CAP_SETGID, CAP_SETFCAP, CAP_SETPCAP, CAP_SETUID, + CAP_SYS_ADMIN, CAP_SYS_CHROOT, CAP_SYS_NICE, CAP_SYS_PTRACE, + CAP_SYS_TTY_CONFIG, CAP_SYS_RESOURCE, CAP_SYS_BOOT, + CAP_AUDIT_WRITE, CAP_AUDIT_CONTROL. Also CAP_NET_ADMIN is + retained if is specified. + If the special value all is passed, all + capabilities are retained. + + + + + + Specify one or more additional capabilities to + drop for the container. This allows running the container with + fewer capabilities than the default (see + above). + + + + + + Control whether the container's journal shall + be made visible to the host system. If enabled, allows viewing + the container's journal files from the host (but not vice + versa). Takes one of no, + host, try-host, + guest, try-guest, + auto. If no, the journal + is not linked. If host, the journal files + are stored on the host file system (beneath + /var/log/journal/machine-id) + and the subdirectory is bind-mounted into the container at the + same location. If guest, the journal files + are stored on the guest file system (beneath + /var/log/journal/machine-id) + and the subdirectory is symlinked into the host at the same + location. try-host and + try-guest do the same but do not fail if + the host does not have persistent journalling enabled. If + auto (the default), and the right + subdirectory of /var/log/journal exists, + it will be bind mounted into the container. If the + subdirectory does not exist, no linking is performed. + Effectively, booting a container once with + guest or host will link + the journal persistently if further on the default of + auto is used. + + + + + + Equivalent to + . + + + + + + Mount the root file system read-only for the + container. + + + + + + + Bind mount a file or directory from the host + into the container. Either takes a path argument -- in which + case the specified path will be mounted from the host to the + same path in the container --, or a colon-separated pair of + paths -- in which case the first specified path is the source + in the host, and the second path is the destination in the + container. The option creates + read-only bind mounts. + + + + + + Mount a tmpfs file system into the container. + Takes a single absolute path argument that specifies where to + mount the tmpfs instance to (in which case the directory + access mode will be chosen as 0755, owned by root/root), or + optionally a colon-separated pair of path and mount option + string, that is used for mounting (in which case the kernel + default for access mode and owner will be chosen, unless + otherwise specified). This option is particularly useful for + mounting directories such as /var as + tmpfs, to allow state-less systems, in particular when + combined with . + + + + + + Specifies an environment variable assignment + to pass to the init process in the container, in the format + NAME=VALUE. This may be used to override + the default variables or to set additional variables. This + parameter may be used more than once. + + + + + + Allows the container to share certain system + facilities with the host. More specifically, this turns off + PID namespacing, UTS namespacing and IPC namespacing, and thus + allows the guest to see and interact more easily with + processes outside of the container. Note that using this + option makes it impossible to start up a full Operating System + in the container, as an init system cannot operate in this + mode. It is only useful to run specific programs or + applications this way, without involving an init system in the + container. This option implies . + This option may not be combined with + . + + + + + + Controls whether the container is registered + with + systemd-machined8. + Takes a boolean argument, defaults to yes. + This option should be enabled when the container runs a full + Operating System (more specifically: an init system), and is + useful to ensure that the container is accessible via + machinectl1 + and shown by tools such as + ps1. + If the container does not run an init system, it is + recommended to set this option to no. Note + that implies + . + + + + + + Instead of creating a transient scope unit to + run the container in, simply register the service or scope + unit systemd-nspawn has been invoked in + with + systemd-machined8. + This has no effect if is used. + This switch should be used if + systemd-nspawn is invoked from within a + service unit, and the service unit's sole purpose is to run a + single systemd-nspawn container. This + option is not available if run from a user + session. + + + + + + Control the architecture ("personality") + reported by + uname2 + in the container. Currently, only x86 and + x86-64 are supported. This is useful when + running a 32-bit container on a 64-bit host. If this setting + is not used, the personality reported in the container is the + same as the one reported on the host. + + + + + + + Turns off any status output by the tool + itself. When this switch is used, the only output from nspawn + will be the console output of the container OS + itself. + + + + =MODE + + Boots the container in volatile mode. When no + mode parameter is passed or when mode is specified as + yes full volatile mode is enabled. This + means the root directory is mounted as mostly unpopulated + tmpfs instance, and + /usr from the OS tree is mounted into it, + read-only (the system thus starts up with read-only OS + resources, but pristine state and configuration, any changes + to the either are lost on shutdown). When the mode parameter + is specified as state the OS tree is + mounted read-only, but /var is mounted as + tmpfs instance into it (the system thus + starts up with read-only OS resources and configuration, but + pristine state, any changes to the latter are lost on + shutdown). When the mode parameter is specified as + no (the default) the whole OS tree is made + available writable. + + Note that setting this to yes or + state will only work correctly with + operating systems in the container that can boot up with only + /usr mounted, and are able to populate + /var automatically, as + needed. + + + + + + + + + + Examples + + + Download a Fedora image and start a shell in it + + # machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz +# systemd-nspawn -M Fedora-Cloud-Base-20141203-21 + + This downloads an image using + machinectl1 + and opens a shell in it. + + + + Build and boot a minimal Fedora distribution in a container + + # dnf -y --releasever=21 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd dnf fedora-release vim-minimal # systemd-nspawn -bD /srv/mycontainer - This installs a minimal Fedora distribution into - the directory /srv/mycontainer/ and - then boots an OS in a namespace container in - it. - + This installs a minimal Fedora distribution into the + directory /srv/mycontainer/ + and then boots an OS in a namespace container in it. + - - Spawn a shell in a container of a minimal Debian unstable distribution + + Spawn a shell in a container of a minimal Debian unstable distribution - # debootstrap --arch=amd64 unstable ~/debian-tree/ + # debootstrap --arch=amd64 unstable ~/debian-tree/ # systemd-nspawn -D ~/debian-tree/ - This installs a minimal Debian unstable - distribution into the directory - ~/debian-tree/ and then spawns a - shell in a namespace container in it. - + This installs a minimal Debian unstable distribution into + the directory ~/debian-tree/ and then + spawns a shell in a namespace container in it. + - - Boot a minimal Arch Linux distribution in a container + + Boot a minimal Arch Linux distribution in a container - # pacstrap -c -d ~/arch-tree/ base + # pacstrap -c -d ~/arch-tree/ base # systemd-nspawn -bD ~/arch-tree/ - This installs a mimimal Arch Linux distribution into - the directory ~/arch-tree/ and then - boots an OS in a namespace container in it. - + This installs a mimimal Arch Linux distribution into the + directory ~/arch-tree/ and then boots an OS + in a namespace container in it. + - - Enable Arch Linux container on boot + + Boot into an ephemeral <literal>btrfs</literal> snapshot of the host system - # mv ~/arch-tree /var/lib/container/arch -# systemctl enable systemd-nspawn@arch.service -# systemctl start systemd-nspawn@arch.service + # systemd-nspawn -D / -xb - This makes the Arch Linux container part of the - multi-user.target on the host. - - + This runs a copy of the host system in a + btrfs snapshot which is removed immediately + when the container exits. All file system changes made during + runtime will be lost on shutdown, hence. + - - Boot into a btrfs snapshot of the host system + + Run a container with SELinux sandbox security contexts - # btrfs subvolume snapshot / /.tmp -# systemd-nspawn --private-network -D /.tmp -b - - This runs a copy of the host system in a - btrfs snapshot. - - - - Run a container with SELinux sandbox security contexts - - # chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container + # chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container # systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh - - - - - Exit status - - The exit code of the program executed in the - container is returned. - - - - See Also - - systemd1, - chroot1, - yum8, - debootstrap8, - pacman8, - systemd.slice5, - machinectl1 - - + + + + + Exit status + + The exit code of the program executed in the container is + returned. + + + + See Also + + systemd1, + chroot1, + dnf8, + yum8, + debootstrap8, + pacman8, + systemd.slice5, + machinectl1, + btrfs8 + + diff --git a/man/systemd-path.1 b/man/systemd-path.1 index 57879e19c..2c8c5dfa2 100644 --- a/man/systemd-path.1 +++ b/man/systemd-path.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-PATH" "1" "" "systemd 218" "systemd-path" +.TH "SYSTEMD\-PATH" "1" "" "systemd 219" "systemd-path" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-path.html b/man/systemd-path.html index b2711872e..4722a9d1b 100644 --- a/man/systemd-path.html +++ b/man/systemd-path.html @@ -19,22 +19,18 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-path — List and query system and user paths

Synopsis

systemd-path [OPTIONS...] [NAME...]

Description¶

systemd-path may be used to - query system and user paths. The tool makes many of - the paths described in - file-hierarchy(7) - queriable.

When invoked without arguments a list of known - paths and their current values is shown. When at least - one argument is passed the path with this is name is - queried and its value shown. The variables whose name - begins with "search-" don't refer to - individual paths, but instead a to a list of - colon-separated search paths, in their order of - precedence.

Options¶

The following options are understood:

--suffix=¶

The printed paths are - suffixed by the specified - string.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-path — List and query system and user paths

Synopsis

systemd-path [OPTIONS...] [NAME...]

Description¶

systemd-path may be used to query system + and user paths. The tool makes many of the paths described in + file-hierarchy(7) + queriable.

When invoked without arguments a list of known paths and + their current values is shown. When at least one argument is + passed the path with this is name is queried and its value shown. + The variables whose name begins with "search-" + don't refer to individual paths, but instead a to a list of + colon-separated search paths, in their order of precedence.

Options¶

The following options are understood:

--suffix=¶

The printed paths are suffixed by the + specified string.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

diff --git a/man/systemd-path.xml b/man/systemd-path.xml index fc01d5edd..dfc75ee0f 100644 --- a/man/systemd-path.xml +++ b/man/systemd-path.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-path - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-path - 1 - - - - systemd-path - List and query system and user paths - - - - - systemd-path OPTIONS NAME - - - - - Description - - systemd-path may be used to - query system and user paths. The tool makes many of - the paths described in - file-hierarchy7 - queriable. - - When invoked without arguments a list of known - paths and their current values is shown. When at least - one argument is passed the path with this is name is - queried and its value shown. The variables whose name - begins with search- don't refer to - individual paths, but instead a to a list of - colon-separated search paths, in their order of - precedence. - - - - Options - - The following options are understood: - - - - - - The printed paths are - suffixed by the specified - string. - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - file-hierarchy7 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-path + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-path + 1 + + + + systemd-path + List and query system and user paths + + + + + systemd-path OPTIONS NAME + + + + + Description + + systemd-path may be used to query system + and user paths. The tool makes many of the paths described in + file-hierarchy7 + queriable. + + When invoked without arguments a list of known paths and + their current values is shown. When at least one argument is + passed the path with this is name is queried and its value shown. + The variables whose name begins with search- + don't refer to individual paths, but instead a to a list of + colon-separated search paths, in their order of precedence. + + + + Options + + The following options are understood: + + + + + + The printed paths are suffixed by the + specified string. + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + file-hierarchy7 + + diff --git a/man/systemd-poweroff.service.html b/man/systemd-poweroff.service.html index 3e6d6c8f1..cf9877ff1 100644 --- a/man/systemd-poweroff.service.html +++ b/man/systemd-poweroff.service.html @@ -19,48 +19,41 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a - system service that is pulled in by - halt.target and is responsible - for the actual system halt. Similarly, - systemd-poweroff.service is - pulled in by poweroff.target, - systemd-reboot.service by - reboot.target and - systemd-kexec.service by - kexec.target to execute the - respective actions.

When these services are run, they ensure that PID - 1 is replaced by the - /usr/lib/systemd/systemd-shutdown - tool which is then responsible for the actual - shutdown. Before shutting down, this binary will try to - unmount all remaining file systems, disable all - remaining swap devices, detach all remaining storage - devices and kill all remaining processes.

It is necessary to have this code in a separate binary - because otherwise rebooting after an upgrade might be broken — - the running PID 1 could still depend on libraries which are not - available any more, thus keeping the file system busy, which - then cannot be re-mounted read-only.

Immediately before executing the actual system - halt/poweroff/reboot/kexec - systemd-shutdown will run all - executables in - /usr/lib/systemd/system-shutdown/ - and pass one arguments to them: either - "halt", - "poweroff", - "reboot" or - "kexec", depending on the chosen - action. All executables in this directory are executed - in parallel, and execution of the action is not - continued before all executables finished.

Note that - systemd-halt.service (and the - related units) should never be executed - directly. Instead, trigger system shutdown with a - command such as "systemctl halt" or - suchlike.

+ gudev systemd 219

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a system + service that is pulled in by halt.target and + is responsible for the actual system halt. Similarly, + systemd-poweroff.service is pulled in by + poweroff.target, + systemd-reboot.service by + reboot.target and + systemd-kexec.service by + kexec.target to execute the respective + actions.

When these services are run, they ensure that PID 1 is + replaced by the + /usr/lib/systemd/systemd-shutdown tool which + is then responsible for the actual shutdown. Before shutting down, + this binary will try to unmount all remaining file systems, + disable all remaining swap devices, detach all remaining storage + devices and kill all remaining processes.

It is necessary to have this code in a separate binary + because otherwise rebooting after an upgrade might be broken — the + running PID 1 could still depend on libraries which are not + available any more, thus keeping the file system busy, which then + cannot be re-mounted read-only.

Immediately before executing the actual system + halt/poweroff/reboot/kexec systemd-shutdown + will run all executables in + /usr/lib/systemd/system-shutdown/ and pass + one arguments to them: either "halt", + "poweroff", "reboot" or + "kexec", depending on the chosen action. All + executables in this directory are executed in parallel, and + execution of the action is not continued before all executables + finished.

Note that systemd-halt.service (and the + related units) should never be executed directly. Instead, trigger + system shutdown with a command such as "systemctl + halt" or suchlike.

diff --git a/man/systemd-quotacheck.html b/man/systemd-quotacheck.html index f9f190a7a..1e072a177 100644 --- a/man/systemd-quotacheck.html +++ b/man/systemd-quotacheck.html @@ -19,27 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-quotacheck.service, systemd-quotacheck — File system quota checker logic

Synopsis

systemd-quotacheck.service

/usr/lib/systemd/systemd-quotacheck

Description¶

systemd-quotacheck.service - is a service responsible for file system quota - checks. It is run once at boot after all necessary - file systems are mounted. It is pulled in only if at - least one file system has quotas enabled.

Kernel Command Line¶

systemd-quotacheck understands - one kernel command line parameter:

quotacheck.mode=¶

One of - "auto", - "force", - "skip". Controls the - mode of operation. The default is - "auto", and ensures - that file system quota checks are done - when the file system quota checker - deems them - necessary. "force" - unconditionally results in full file - system quota - checks. "skip" skips - any file system quota - checks.

+ gudev systemd 219

Name

systemd-quotacheck.service, systemd-quotacheck — File system quota checker logic

Synopsis

systemd-quotacheck.service

/usr/lib/systemd/systemd-quotacheck

Description¶

systemd-quotacheck.service is a service + responsible for file system quota checks. It is run once at boot + after all necessary file systems are mounted. It is pulled in only + if at least one file system has quotas enabled.

Kernel Command Line¶

systemd-quotacheck understands one + kernel command line parameter:

quotacheck.mode=¶

One of "auto", + "force", "skip". Controls + the mode of operation. The default is "auto", + and ensures that file system quota checks are done when the + file system quota checker deems them necessary. + "force" unconditionally results in full file + system quota checks. "skip" skips any file + system quota checks.

diff --git a/man/systemd-quotacheck.service.8 b/man/systemd-quotacheck.service.8 index 5dfdf1016..6d09162c7 100644 --- a/man/systemd-quotacheck.service.8 +++ b/man/systemd-quotacheck.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-QUOTACHECK\&.SERVICE" "8" "" "systemd 218" "systemd-quotacheck.service" +.TH "SYSTEMD\-QUOTACHECK\&.SERVICE" "8" "" "systemd 219" "systemd-quotacheck.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-quotacheck.service.html b/man/systemd-quotacheck.service.html index f9f190a7a..1e072a177 100644 --- a/man/systemd-quotacheck.service.html +++ b/man/systemd-quotacheck.service.html @@ -19,27 +19,19 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-quotacheck.service, systemd-quotacheck — File system quota checker logic

Synopsis

systemd-quotacheck.service

/usr/lib/systemd/systemd-quotacheck

Description¶

systemd-quotacheck.service - is a service responsible for file system quota - checks. It is run once at boot after all necessary - file systems are mounted. It is pulled in only if at - least one file system has quotas enabled.

Kernel Command Line¶

systemd-quotacheck understands - one kernel command line parameter:

quotacheck.mode=¶

One of - "auto", - "force", - "skip". Controls the - mode of operation. The default is - "auto", and ensures - that file system quota checks are done - when the file system quota checker - deems them - necessary. "force" - unconditionally results in full file - system quota - checks. "skip" skips - any file system quota - checks.

+ gudev systemd 219

Name

systemd-quotacheck.service, systemd-quotacheck — File system quota checker logic

Synopsis

systemd-quotacheck.service

/usr/lib/systemd/systemd-quotacheck

Description¶

systemd-quotacheck.service is a service + responsible for file system quota checks. It is run once at boot + after all necessary file systems are mounted. It is pulled in only + if at least one file system has quotas enabled.

Kernel Command Line¶

systemd-quotacheck understands one + kernel command line parameter:

quotacheck.mode=¶

One of "auto", + "force", "skip". Controls + the mode of operation. The default is "auto", + and ensures that file system quota checks are done when the + file system quota checker deems them necessary. + "force" unconditionally results in full file + system quota checks. "skip" skips any file + system quota checks.

diff --git a/man/systemd-quotacheck.service.xml b/man/systemd-quotacheck.service.xml index ff04e582d..2179f11e9 100644 --- a/man/systemd-quotacheck.service.xml +++ b/man/systemd-quotacheck.service.xml @@ -21,82 +21,74 @@ --> - - systemd-quotacheck.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-quotacheck.service - 8 - - - - systemd-quotacheck.service - systemd-quotacheck - File system quota checker logic - - - - systemd-quotacheck.service - /usr/lib/systemd/systemd-quotacheck - - - - Description - - systemd-quotacheck.service - is a service responsible for file system quota - checks. It is run once at boot after all necessary - file systems are mounted. It is pulled in only if at - least one file system has quotas enabled. - - - - Kernel Command Line - - systemd-quotacheck understands - one kernel command line parameter: - - - - quotacheck.mode= - - One of - auto, - force, - skip. Controls the - mode of operation. The default is - auto, and ensures - that file system quota checks are done - when the file system quota checker - deems them - necessary. force - unconditionally results in full file - system quota - checks. skip skips - any file system quota - checks. - - - - - - See Also - - systemd1, - quotacheck8, - systemd-fsck@.service8 - - + + systemd-quotacheck.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-quotacheck.service + 8 + + + + systemd-quotacheck.service + systemd-quotacheck + File system quota checker logic + + + + systemd-quotacheck.service + /usr/lib/systemd/systemd-quotacheck + + + + Description + + systemd-quotacheck.service is a service + responsible for file system quota checks. It is run once at boot + after all necessary file systems are mounted. It is pulled in only + if at least one file system has quotas enabled. + + + + Kernel Command Line + + systemd-quotacheck understands one + kernel command line parameter: + + + + quotacheck.mode= + + One of auto, + force, skip. Controls + the mode of operation. The default is auto, + and ensures that file system quota checks are done when the + file system quota checker deems them necessary. + force unconditionally results in full file + system quota checks. skip skips any file + system quota checks. + + + + + + See Also + + systemd1, + quotacheck8, + systemd-fsck@.service8 + + diff --git a/man/systemd-random-seed.html b/man/systemd-random-seed.html index b7c70e714..e27642215 100644 --- a/man/systemd-random-seed.html +++ b/man/systemd-random-seed.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-random-seed.service, systemd-random-seed — Load and save the system random seed at boot and shutdown

Synopsis

systemd-random-seed.service

/usr/lib/systemd/systemd-random-seed

Description¶

systemd-random-seed.service - is a service that restores the random seed of the - system at early-boot and saves it at shutdown. See - random(4) - for details. Saving/restoring the random seed across - boots increases the amount of available entropy early - at boot. On disk the random seed is stored in - /var/lib/systemd/random-seed.

See Also¶

- systemd(1), - random(4) -

+ gudev systemd 219

Name

systemd-random-seed.service, systemd-random-seed — Load and save the system random seed at boot and shutdown

Synopsis

systemd-random-seed.service

/usr/lib/systemd/systemd-random-seed

Description¶

systemd-random-seed.service is a + service that restores the random seed of the system at early-boot + and saves it at shutdown. See + random(4) + for details. Saving/restoring the random seed across boots + increases the amount of available entropy early at boot. On disk + the random seed is stored in + /var/lib/systemd/random-seed.

See Also¶

+ systemd(1), + random(4) +

diff --git a/man/systemd-random-seed.service.8 b/man/systemd-random-seed.service.8 index aacf47a86..172e9533b 100644 --- a/man/systemd-random-seed.service.8 +++ b/man/systemd-random-seed.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-RANDOM\-SEED\&.SERVICE" "8" "" "systemd 218" "systemd-random-seed.service" +.TH "SYSTEMD\-RANDOM\-SEED\&.SERVICE" "8" "" "systemd 219" "systemd-random-seed.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-random-seed.service.html b/man/systemd-random-seed.service.html index b7c70e714..e27642215 100644 --- a/man/systemd-random-seed.service.html +++ b/man/systemd-random-seed.service.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-random-seed.service, systemd-random-seed — Load and save the system random seed at boot and shutdown

Synopsis

systemd-random-seed.service

/usr/lib/systemd/systemd-random-seed

Description¶

systemd-random-seed.service - is a service that restores the random seed of the - system at early-boot and saves it at shutdown. See - random(4) - for details. Saving/restoring the random seed across - boots increases the amount of available entropy early - at boot. On disk the random seed is stored in - /var/lib/systemd/random-seed.

See Also¶

- systemd(1), - random(4) -

+ gudev systemd 219

Name

systemd-random-seed.service, systemd-random-seed — Load and save the system random seed at boot and shutdown

Synopsis

systemd-random-seed.service

/usr/lib/systemd/systemd-random-seed

Description¶

systemd-random-seed.service is a + service that restores the random seed of the system at early-boot + and saves it at shutdown. See + random(4) + for details. Saving/restoring the random seed across boots + increases the amount of available entropy early at boot. On disk + the random seed is stored in + /var/lib/systemd/random-seed.

See Also¶

+ systemd(1), + random(4) +

diff --git a/man/systemd-random-seed.service.xml b/man/systemd-random-seed.service.xml index e5cd03719..8c836688f 100644 --- a/man/systemd-random-seed.service.xml +++ b/man/systemd-random-seed.service.xml @@ -21,55 +21,55 @@ --> - - systemd-random-seed.service - systemd + + systemd-random-seed.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-random-seed.service - 8 - + + systemd-random-seed.service + 8 + - - systemd-random-seed.service - systemd-random-seed - Load and save the system random seed at boot and shutdown - + + systemd-random-seed.service + systemd-random-seed + Load and save the system random seed at boot and shutdown + - - systemd-random-seed.service - /usr/lib/systemd/systemd-random-seed - + + systemd-random-seed.service + /usr/lib/systemd/systemd-random-seed + - - Description + + Description - systemd-random-seed.service - is a service that restores the random seed of the - system at early-boot and saves it at shutdown. See - random4 - for details. Saving/restoring the random seed across - boots increases the amount of available entropy early - at boot. On disk the random seed is stored in - /var/lib/systemd/random-seed. - + systemd-random-seed.service is a + service that restores the random seed of the system at early-boot + and saves it at shutdown. See + random4 + for details. Saving/restoring the random seed across boots + increases the amount of available entropy early at boot. On disk + the random seed is stored in + /var/lib/systemd/random-seed. + - - See Also - - systemd1, - random4 - - + + See Also + + systemd1, + random4 + + diff --git a/man/systemd-reboot.service.html b/man/systemd-reboot.service.html index 3e6d6c8f1..cf9877ff1 100644 --- a/man/systemd-reboot.service.html +++ b/man/systemd-reboot.service.html @@ -19,48 +19,41 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a - system service that is pulled in by - halt.target and is responsible - for the actual system halt. Similarly, - systemd-poweroff.service is - pulled in by poweroff.target, - systemd-reboot.service by - reboot.target and - systemd-kexec.service by - kexec.target to execute the - respective actions.

When these services are run, they ensure that PID - 1 is replaced by the - /usr/lib/systemd/systemd-shutdown - tool which is then responsible for the actual - shutdown. Before shutting down, this binary will try to - unmount all remaining file systems, disable all - remaining swap devices, detach all remaining storage - devices and kill all remaining processes.

It is necessary to have this code in a separate binary - because otherwise rebooting after an upgrade might be broken — - the running PID 1 could still depend on libraries which are not - available any more, thus keeping the file system busy, which - then cannot be re-mounted read-only.

Immediately before executing the actual system - halt/poweroff/reboot/kexec - systemd-shutdown will run all - executables in - /usr/lib/systemd/system-shutdown/ - and pass one arguments to them: either - "halt", - "poweroff", - "reboot" or - "kexec", depending on the chosen - action. All executables in this directory are executed - in parallel, and execution of the action is not - continued before all executables finished.

Note that - systemd-halt.service (and the - related units) should never be executed - directly. Instead, trigger system shutdown with a - command such as "systemctl halt" or - suchlike.

+ gudev systemd 219

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a system + service that is pulled in by halt.target and + is responsible for the actual system halt. Similarly, + systemd-poweroff.service is pulled in by + poweroff.target, + systemd-reboot.service by + reboot.target and + systemd-kexec.service by + kexec.target to execute the respective + actions.

When these services are run, they ensure that PID 1 is + replaced by the + /usr/lib/systemd/systemd-shutdown tool which + is then responsible for the actual shutdown. Before shutting down, + this binary will try to unmount all remaining file systems, + disable all remaining swap devices, detach all remaining storage + devices and kill all remaining processes.

It is necessary to have this code in a separate binary + because otherwise rebooting after an upgrade might be broken — the + running PID 1 could still depend on libraries which are not + available any more, thus keeping the file system busy, which then + cannot be re-mounted read-only.

Immediately before executing the actual system + halt/poweroff/reboot/kexec systemd-shutdown + will run all executables in + /usr/lib/systemd/system-shutdown/ and pass + one arguments to them: either "halt", + "poweroff", "reboot" or + "kexec", depending on the chosen action. All + executables in this directory are executed in parallel, and + execution of the action is not continued before all executables + finished.

Note that systemd-halt.service (and the + related units) should never be executed directly. Instead, trigger + system shutdown with a command such as "systemctl + halt" or suchlike.

diff --git a/man/systemd-remount-fs.html b/man/systemd-remount-fs.html index 82b2d9aa2..81a23c306 100644 --- a/man/systemd-remount-fs.html +++ b/man/systemd-remount-fs.html @@ -19,29 +19,25 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-remount-fs.service, systemd-remount-fs — Remount root and kernel file systems

Synopsis

systemd-remount-fs.service

/usr/lib/systemd/systemd-remount-fs

Description¶

systemd-remount-fs.service - is an early-boot service that applies mount options - listed in - fstab(5) - to the root file system, the /usr - file system and the kernel API file systems. This is - required so that the mount options of these file - systems -- which are pre-mounted by the kernel, the - initial RAM disk, container environments or system - manager code -- are updated to those listed in - /etc/fstab. This service ignores - normal file systems and only changes the root file - system (i.e. /), - /usr and the virtual kernel API - file systems such as /proc, - /sys or - /dev. This service executes no - operation if /etc/fstab does not - exist or lists no entries for the mentioned file - systems.

For a longer discussion of kernel API file - systems see API - File Systems.

See Also¶

- systemd(1), - fstab(5), - mount(8) -

+ gudev systemd 219

Name

systemd-remount-fs.service, systemd-remount-fs — Remount root and kernel file systems

Synopsis

systemd-remount-fs.service

/usr/lib/systemd/systemd-remount-fs

Description¶

systemd-remount-fs.service is an + early-boot service that applies mount options listed in + fstab(5) + to the root file system, the /usr file system + and the kernel API file systems. This is required so that the + mount options of these file systems -- which are pre-mounted by + the kernel, the initial RAM disk, container environments or system + manager code -- are updated to those listed in + /etc/fstab. This service ignores normal file + systems and only changes the root file system (i.e. + /), /usr and the virtual + kernel API file systems such as /proc, + /sys or /dev. This + service executes no operation if /etc/fstab + does not exist or lists no entries for the mentioned file + systems.

For a longer discussion of kernel API file systems see + API + File Systems.

See Also¶

+ systemd(1), + fstab(5), + mount(8) +

diff --git a/man/systemd-remount-fs.service.8 b/man/systemd-remount-fs.service.8 index a1038c7a2..f7357ac7a 100644 --- a/man/systemd-remount-fs.service.8 +++ b/man/systemd-remount-fs.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-REMOUNT\-FS\&.SERVICE" "8" "" "systemd 218" "systemd-remount-fs.service" +.TH "SYSTEMD\-REMOUNT\-FS\&.SERVICE" "8" "" "systemd 219" "systemd-remount-fs.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-remount-fs.service.html b/man/systemd-remount-fs.service.html index 82b2d9aa2..81a23c306 100644 --- a/man/systemd-remount-fs.service.html +++ b/man/systemd-remount-fs.service.html @@ -19,29 +19,25 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-remount-fs.service, systemd-remount-fs — Remount root and kernel file systems

Synopsis

systemd-remount-fs.service

/usr/lib/systemd/systemd-remount-fs

Description¶

systemd-remount-fs.service - is an early-boot service that applies mount options - listed in - fstab(5) - to the root file system, the /usr - file system and the kernel API file systems. This is - required so that the mount options of these file - systems -- which are pre-mounted by the kernel, the - initial RAM disk, container environments or system - manager code -- are updated to those listed in - /etc/fstab. This service ignores - normal file systems and only changes the root file - system (i.e. /), - /usr and the virtual kernel API - file systems such as /proc, - /sys or - /dev. This service executes no - operation if /etc/fstab does not - exist or lists no entries for the mentioned file - systems.

For a longer discussion of kernel API file - systems see API - File Systems.

See Also¶

- systemd(1), - fstab(5), - mount(8) -

+ gudev systemd 219

Name

systemd-remount-fs.service, systemd-remount-fs — Remount root and kernel file systems

Synopsis

systemd-remount-fs.service

/usr/lib/systemd/systemd-remount-fs

Description¶

systemd-remount-fs.service is an + early-boot service that applies mount options listed in + fstab(5) + to the root file system, the /usr file system + and the kernel API file systems. This is required so that the + mount options of these file systems -- which are pre-mounted by + the kernel, the initial RAM disk, container environments or system + manager code -- are updated to those listed in + /etc/fstab. This service ignores normal file + systems and only changes the root file system (i.e. + /), /usr and the virtual + kernel API file systems such as /proc, + /sys or /dev. This + service executes no operation if /etc/fstab + does not exist or lists no entries for the mentioned file + systems.

For a longer discussion of kernel API file systems see + API + File Systems.

See Also¶

+ systemd(1), + fstab(5), + mount(8) +

diff --git a/man/systemd-remount-fs.service.xml b/man/systemd-remount-fs.service.xml index cf04713a0..7b88ac3f3 100644 --- a/man/systemd-remount-fs.service.xml +++ b/man/systemd-remount-fs.service.xml @@ -21,73 +21,68 @@ --> - - systemd-remount-fs.service - systemd + + systemd-remount-fs.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-remount-fs.service - 8 - + + systemd-remount-fs.service + 8 + - - systemd-remount-fs.service - systemd-remount-fs - Remount root and kernel file systems - + + systemd-remount-fs.service + systemd-remount-fs + Remount root and kernel file systems + - - systemd-remount-fs.service - /usr/lib/systemd/systemd-remount-fs - + + systemd-remount-fs.service + /usr/lib/systemd/systemd-remount-fs + - - Description + + Description - systemd-remount-fs.service - is an early-boot service that applies mount options - listed in - fstab5 - to the root file system, the /usr - file system and the kernel API file systems. This is - required so that the mount options of these file - systems -- which are pre-mounted by the kernel, the - initial RAM disk, container environments or system - manager code -- are updated to those listed in - /etc/fstab. This service ignores - normal file systems and only changes the root file - system (i.e. /), - /usr and the virtual kernel API - file systems such as /proc, - /sys or - /dev. This service executes no - operation if /etc/fstab does not - exist or lists no entries for the mentioned file - systems. + systemd-remount-fs.service is an + early-boot service that applies mount options listed in + fstab5 + to the root file system, the /usr file system + and the kernel API file systems. This is required so that the + mount options of these file systems -- which are pre-mounted by + the kernel, the initial RAM disk, container environments or system + manager code -- are updated to those listed in + /etc/fstab. This service ignores normal file + systems and only changes the root file system (i.e. + /), /usr and the virtual + kernel API file systems such as /proc, + /sys or /dev. This + service executes no operation if /etc/fstab + does not exist or lists no entries for the mentioned file + systems. - For a longer discussion of kernel API file - systems see API - File Systems. - + For a longer discussion of kernel API file systems see + API + File Systems. + - - See Also - - systemd1, - fstab5, - mount8 - - + + See Also + + systemd1, + fstab5, + mount8 + + diff --git a/man/systemd-resolved.html b/man/systemd-resolved.html index c303a7926..8da067d71 100644 --- a/man/systemd-resolved.html +++ b/man/systemd-resolved.html @@ -19,24 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-resolved.service, systemd-resolved — Network Name Resolution manager

Synopsis

systemd-resolved.service

/usr/lib/systemd/systemd-resolved

Description¶

systemd-resolved is a system - service that manages network name resolution. It - implements a caching DNS stub resolver and an LLMNR - resolver and responder. It also generates - /run/systemd/resolve/resolv.conf - for compatibility which may be symlinked from - /etc/resolv.conf.

The DNS servers contacted are determined from - the global settings in - resolved.conf(5), - the per-link static settings in - .network files, and the per-link - dynamic settings received over DHCP. See - systemd.network(5) - for more details.

Note that /run/systemd/resolve/resolv.conf - should not be used directly, but only through a symlink from - /etc/resolv.conf.

+ gudev systemd 219

Name

systemd-resolved.service, systemd-resolved — Network Name Resolution manager

Synopsis

systemd-resolved.service

/usr/lib/systemd/systemd-resolved

Description¶

systemd-resolved is a system service that + manages network name resolution. It implements a caching DNS stub + resolver and an LLMNR resolver and responder. It also generates + /run/systemd/resolve/resolv.conf for + compatibility which may be symlinked from + /etc/resolv.conf.

The DNS servers contacted are determined from the global + settings in + resolved.conf(5), + the per-link static settings in .network + files, and the per-link dynamic settings received over DHCP. See + systemd.network(5) + for more details.

Note that + /run/systemd/resolve/resolv.conf should not + be used directly, but only through a symlink from + /etc/resolv.conf.

diff --git a/man/systemd-resolved.service.8 b/man/systemd-resolved.service.8 index 1369e9b83..fbed141c5 100644 --- a/man/systemd-resolved.service.8 +++ b/man/systemd-resolved.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-RESOLVED\&.SERVICE" "8" "" "systemd 218" "systemd-resolved.service" +.TH "SYSTEMD\-RESOLVED\&.SERVICE" "8" "" "systemd 219" "systemd-resolved.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-resolved.service.html b/man/systemd-resolved.service.html index c303a7926..8da067d71 100644 --- a/man/systemd-resolved.service.html +++ b/man/systemd-resolved.service.html @@ -19,24 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-resolved.service, systemd-resolved — Network Name Resolution manager

Synopsis

systemd-resolved.service

/usr/lib/systemd/systemd-resolved

Description¶

systemd-resolved is a system - service that manages network name resolution. It - implements a caching DNS stub resolver and an LLMNR - resolver and responder. It also generates - /run/systemd/resolve/resolv.conf - for compatibility which may be symlinked from - /etc/resolv.conf.

The DNS servers contacted are determined from - the global settings in - resolved.conf(5), - the per-link static settings in - .network files, and the per-link - dynamic settings received over DHCP. See - systemd.network(5) - for more details.

Note that /run/systemd/resolve/resolv.conf - should not be used directly, but only through a symlink from - /etc/resolv.conf.

+ gudev systemd 219

Name

systemd-resolved.service, systemd-resolved — Network Name Resolution manager

Synopsis

systemd-resolved.service

/usr/lib/systemd/systemd-resolved

Description¶

systemd-resolved is a system service that + manages network name resolution. It implements a caching DNS stub + resolver and an LLMNR resolver and responder. It also generates + /run/systemd/resolve/resolv.conf for + compatibility which may be symlinked from + /etc/resolv.conf.

The DNS servers contacted are determined from the global + settings in + resolved.conf(5), + the per-link static settings in .network + files, and the per-link dynamic settings received over DHCP. See + systemd.network(5) + for more details.

Note that + /run/systemd/resolve/resolv.conf should not + be used directly, but only through a symlink from + /etc/resolv.conf.

diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml index c44b10c47..89ec5f8b1 100644 --- a/man/systemd-resolved.service.xml +++ b/man/systemd-resolved.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd-rfkill@.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-rfkill@.service - 8 - - - - systemd-rfkill@.service - systemd-rfkill - Load and save the RF kill switch state at boot and shutdown - - - - systemd-rfkill@.service - /usr/lib/systemd/systemd-rfkill - - - - Description - - systemd-rfkill@.service is - a service that restores the RF kill switch state at - early boot and saves it at shutdown. On disk, the RF - kill switch state is stored in - /var/lib/systemd/rfkill/. - - - - Kernel Command Line - - systemd-rfkill understands - the following kernel command line parameter: - - - - systemd.restore_state= - - Takes a boolean - argument. Defaults to - 1. If - 0, does not restore - the rfkill settings on boot. However, - settings will still be stored on shutdown. - - - - - - - See Also - - systemd1 - - + + systemd-rfkill@.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-rfkill@.service + 8 + + + + systemd-rfkill@.service + systemd-rfkill + Load and save the RF kill switch state at boot and shutdown + + + + systemd-rfkill@.service + /usr/lib/systemd/systemd-rfkill + + + + Description + + systemd-rfkill@.service is a service + that restores the RF kill switch state at early boot and saves it + at shutdown. On disk, the RF kill switch state is stored in + /var/lib/systemd/rfkill/. + + + + Kernel Command Line + + systemd-rfkill understands the + following kernel command line parameter: + + + + systemd.restore_state= + + Takes a boolean argument. Defaults to + 1. If 0, does not + restore the rfkill settings on boot. However, settings will + still be stored on shutdown. + + + + + + See Also + + systemd1 + + diff --git a/man/systemd-run.1 b/man/systemd-run.1 index d440a1c4c..261625158 100644 --- a/man/systemd-run.1 +++ b/man/systemd-run.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-RUN" "1" "" "systemd 218" "systemd-run" +.TH "SYSTEMD\-RUN" "1" "" "systemd 219" "systemd-run" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -154,27 +154,16 @@ in \fBsystemd.exec\fR(5)\&. .RE .PP -\fB\-\-user\fR +\fB\-\-pty\fR, \fB\-t\fR .RS 4 -Talk to the service manager of the calling user, rather than the service manager of the system\&. +When invoking a command as service connects its standard input and output to the invoking tty via a pseudo TTY device\&. This allows invoking binaries as services that expect interactive user input, such as interactive command shells\&. .RE .PP -\fB\-\-system\fR +\fB\-\-quiet\fR, \fB\-q\fR .RS 4 -Talk to the service manager of the system\&. This is the implied default\&. -.RE -.PP -\fB\-H\fR, \fB\-\-host=\fR -.RS 4 -Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by -"@", to connect to\&. The hostname may optionally be suffixed by a container name, separated by -":", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with -\fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. -.RE -.PP -\fB\-M\fR, \fB\-\-machine=\fR -.RS 4 -Execute operation on a local container\&. Specify a container name to connect to\&. +Suppresses additional informational output while running\&. This is particularly useful in combination with +\fB\-\-pty\fR +when it will suppress the initial message explaining how to terminate the TTY connection\&. .RE .PP \fB\-\-on\-active=\fR, \fB\-\-on\-boot=\fR, \fB\-\-on\-startup=\fR, \fB\-\-on\-unit\-active=\fR, \fB\-\-on\-unit\-inactive=\fR @@ -216,6 +205,29 @@ but only for created timer unit\&. This option only has effect in conjunction wi command\&. .RE .PP +\fB\-\-user\fR +.RS 4 +Talk to the service manager of the calling user, rather than the service manager of the system\&. +.RE +.PP +\fB\-\-system\fR +.RS 4 +Talk to the service manager of the system\&. This is the implied default\&. +.RE +.PP +\fB\-H\fR, \fB\-\-host=\fR +.RS 4 +Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by +"@", to connect to\&. The hostname may optionally be suffixed by a container name, separated by +":", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with +\fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. +.RE +.PP +\fB\-M\fR, \fB\-\-machine=\fR +.RS 4 +Execute operation on a local container\&. Specify a container name to connect to\&. +.RE +.PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help text and exit\&. @@ -291,6 +303,20 @@ Dec 08 20:44:48 container systemd[1]: Started /bin/touch /tmp/foo\&. .if n \{\ .RE .\} +.PP +The following command invokes +/bin/bash +as a service passing its standard input, output and error to the calling TTY\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +# systemd\-run \-t /bin/bash +.fi +.if n \{\ +.RE +.\} .SH "SEE ALSO" .PP \fBsystemd\fR(1), diff --git a/man/systemd-run.html b/man/systemd-run.html index 2fa589186..be41f6e83 100644 --- a/man/systemd-run.html +++ b/man/systemd-run.html @@ -19,9 +19,9 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-run — Run programs in transient scope or service or timer units

Synopsis

systemd-run [OPTIONS...] COMMAND + gudev systemd 219


Name

systemd-run — Run programs in transient scope or service or timer units

Synopsis

systemd-run [OPTIONS...] COMMAND [ARGS...] -

systemd-run [OPTIONS...] [TIMER OPTIONS...] {COMMAND} [ARGS...]

Description¶

systemd-run may be used to create and +

systemd-run [OPTIONS...] [TIMER OPTIONS...] {COMMAND} [ARGS...]

Description¶

systemd-run may be used to create and start a transient .service or a transient .timer or a .scope unit and run the specified COMMAND in @@ -47,7 +47,7 @@ managed by the service manager similar to normal services, and will also show up in the output of systemctl list-units. Execution in this case is synchronous, and - execution will return only when the command finishes.

Options¶

The following options are understood:

--scope¶

Create a transient .scope unit instead of + execution will return only when the command finishes.

Options¶

The following options are understood:

--scope¶

Create a transient .scope unit instead of the default transient .service unit.

--unit=¶

Use this unit name instead of an automatically generated one.

--property=, -p¶

Sets a unit property for the scope or service @@ -85,18 +85,14 @@ systemd.exec(5).

--setenv=¶

Runs the service process with the specified environment variables set. Also see Environment= in - systemd.exec(5).

--user¶

Talk to the service manager of the calling user, - rather than the service manager of the system.

--system¶

Talk to the service manager of the system. This is the - implied default.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a - username and hostname separated by "@", to - connect to. The hostname may optionally be suffixed by a - container name, separated by ":", which - connects directly to a specific container on the specified - host. This will use SSH to talk to the remote machine manager - instance. Container names may be enumerated with - machinectl -H - HOST.

-M, --machine=¶

Execute operation on a local container. Specify a - container name to connect to.

--on-active=, --on-boot=, --on-startup=, --on-unit-active=, --on-unit-inactive=¶

Defines monotonic timers relative to different + systemd.exec(5).

--pty, -t¶

When invoking a command as service connects + its standard input and output to the invoking tty via a + pseudo TTY device. This allows invoking binaries as services + that expect interactive user input, such as interactive + command shells.

--quiet, -q¶

Suppresses additional informational output + while running. This is particularly useful in combination with + --pty when it will suppress the initial + message explaining how to terminate the TTY connection.

--on-active=, --on-boot=, --on-startup=, --on-unit-active=, --on-unit-inactive=¶

Defines monotonic timers relative to different starting points. Also see OnActiveSec=, OnBootSec=, OnStartupSec=, @@ -120,12 +116,23 @@ --on-calendar=. This takes an assignment in the same format as systemctl(1)'s - set-property command.

-h, --help¶

Print a short help text and exit. + set-property command.

--user¶

Talk to the service manager of the calling user, + rather than the service manager of the system.

--system¶

Talk to the service manager of the system. This is the + implied default.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + username and hostname separated by "@", to + connect to. The hostname may optionally be suffixed by a + container name, separated by ":", which + connects directly to a specific container on the specified + host. This will use SSH to talk to the remote machine manager + instance. Container names may be enumerated with + machinectl -H + HOST.

-M, --machine=¶

Execute operation on a local container. Specify a + container name to connect to.

-h, --help¶

Print a short help text and exit.

--version¶

Print a short version string and exit.

All command line arguments after the first non-option argument become part of the command line of the launched process. If a command is run as service unit, its first argument - needs to be an absolute binary path.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Examples¶

The following command will log the environment variables + needs to be an absolute binary path.

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

Examples¶

The following command will log the environment variables provided by systemd to services:

# systemd-run env
 Running as unit run-19945.service.
 # journalctl -u run-19945.service
@@ -149,7 +156,9 @@ Dec 08 20:44:38 container systemd[1]: Started /bin/touch /tmp/foo.
 # journalctl -b -u run-73.service
 -- Logs begin at Fri 2014-12-05 19:09:21 KST, end at Mon 2014-12-08 20:44:54 KST. --
 Dec 08 20:44:48 container systemd[1]: Starting /bin/touch /tmp/foo...
-Dec 08 20:44:48 container systemd[1]: Started /bin/touch /tmp/foo.

See Also¶

+Dec 08 20:44:48 container systemd[1]: Started /bin/touch /tmp/foo.

The following command invokes /bin/bash + as a service passing its standard input, output and error to + the calling TTY.

# systemd-run -t /bin/bash

See Also¶

systemd(1), systemctl(1), systemd.unit(5), diff --git a/man/systemd-run.xml b/man/systemd-run.xml index b9cec91d1..febcdb026 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> . - - - - + + + + + When invoking a command as service connects + its standard input and output to the invoking tty via a + pseudo TTY device. This allows invoking binaries as services + that expect interactive user input, such as interactive + command shells. + + + + + + + Suppresses additional informational output + while running. This is particularly useful in combination with + when it will suppress the initial + message explaining how to terminate the TTY connection. + @@ -278,6 +294,11 @@ along with systemd; If not, see . set-property command. + + + + + @@ -333,6 +354,13 @@ Dec 08 20:44:38 container systemd[1]: Started /bin/touch /tmp/foo. -- Logs begin at Fri 2014-12-05 19:09:21 KST, end at Mon 2014-12-08 20:44:54 KST. -- Dec 08 20:44:48 container systemd[1]: Starting /bin/touch /tmp/foo... Dec 08 20:44:48 container systemd[1]: Started /bin/touch /tmp/foo. + + The following command invokes /bin/bash + as a service passing its standard input, output and error to + the calling TTY. + + # systemd-run -t /bin/bash + diff --git a/man/systemd-shutdown.html b/man/systemd-shutdown.html index 3e6d6c8f1..cf9877ff1 100644 --- a/man/systemd-shutdown.html +++ b/man/systemd-shutdown.html @@ -19,48 +19,41 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a - system service that is pulled in by - halt.target and is responsible - for the actual system halt. Similarly, - systemd-poweroff.service is - pulled in by poweroff.target, - systemd-reboot.service by - reboot.target and - systemd-kexec.service by - kexec.target to execute the - respective actions.

When these services are run, they ensure that PID - 1 is replaced by the - /usr/lib/systemd/systemd-shutdown - tool which is then responsible for the actual - shutdown. Before shutting down, this binary will try to - unmount all remaining file systems, disable all - remaining swap devices, detach all remaining storage - devices and kill all remaining processes.

It is necessary to have this code in a separate binary - because otherwise rebooting after an upgrade might be broken — - the running PID 1 could still depend on libraries which are not - available any more, thus keeping the file system busy, which - then cannot be re-mounted read-only.

Immediately before executing the actual system - halt/poweroff/reboot/kexec - systemd-shutdown will run all - executables in - /usr/lib/systemd/system-shutdown/ - and pass one arguments to them: either - "halt", - "poweroff", - "reboot" or - "kexec", depending on the chosen - action. All executables in this directory are executed - in parallel, and execution of the action is not - continued before all executables finished.

Note that - systemd-halt.service (and the - related units) should never be executed - directly. Instead, trigger system shutdown with a - command such as "systemctl halt" or - suchlike.

+ gudev systemd 219

Name

systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic

Synopsis

systemd-halt.service

systemd-poweroff.service

systemd-reboot.service

systemd-kexec.service

/usr/lib/systemd/systemd-shutdown

Description¶

systemd-halt.service is a system + service that is pulled in by halt.target and + is responsible for the actual system halt. Similarly, + systemd-poweroff.service is pulled in by + poweroff.target, + systemd-reboot.service by + reboot.target and + systemd-kexec.service by + kexec.target to execute the respective + actions.

When these services are run, they ensure that PID 1 is + replaced by the + /usr/lib/systemd/systemd-shutdown tool which + is then responsible for the actual shutdown. Before shutting down, + this binary will try to unmount all remaining file systems, + disable all remaining swap devices, detach all remaining storage + devices and kill all remaining processes.

It is necessary to have this code in a separate binary + because otherwise rebooting after an upgrade might be broken — the + running PID 1 could still depend on libraries which are not + available any more, thus keeping the file system busy, which then + cannot be re-mounted read-only.

Immediately before executing the actual system + halt/poweroff/reboot/kexec systemd-shutdown + will run all executables in + /usr/lib/systemd/system-shutdown/ and pass + one arguments to them: either "halt", + "poweroff", "reboot" or + "kexec", depending on the chosen action. All + executables in this directory are executed in parallel, and + execution of the action is not continued before all executables + finished.

Note that systemd-halt.service (and the + related units) should never be executed directly. Instead, trigger + system shutdown with a command such as "systemctl + halt" or suchlike.

diff --git a/man/systemd-shutdownd.html b/man/systemd-shutdownd.html index f2c3478b4..530c47d2e 100644 --- a/man/systemd-shutdownd.html +++ b/man/systemd-shutdownd.html @@ -19,12 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-shutdownd.service, systemd-shutdownd.socket, systemd-shutdownd — Scheduled shutdown service

Synopsis

systemd-shutdownd.service

systemd-shutdownd.socket

/usr/lib/systemd/systemd-shutdownd

Description¶

systemd-shutdownd.service is a - system service that implements scheduled shutdowns, as - exposed by - shutdown(8). - systemd-shutdownd.service is automatically activated on request and terminates - itself when it is unused.

See Also¶

- systemd(1), - shutdown(8) -

+ gudev systemd 219

Name

systemd-shutdownd.service, systemd-shutdownd.socket, systemd-shutdownd — Scheduled shutdown service

Synopsis

systemd-shutdownd.service

systemd-shutdownd.socket

/usr/lib/systemd/systemd-shutdownd

Description¶

systemd-shutdownd.service is a system + service that implements scheduled shutdowns, as exposed by + shutdown(8). + systemd-shutdownd.service is automatically + activated on request and terminates itself when it is + unused.

See Also¶

+ systemd(1), + shutdown(8) +

diff --git a/man/systemd-shutdownd.service.8 b/man/systemd-shutdownd.service.8 index 3e2e7351b..a859a571f 100644 --- a/man/systemd-shutdownd.service.8 +++ b/man/systemd-shutdownd.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SHUTDOWND\&.SERVICE" "8" "" "systemd 218" "systemd-shutdownd.service" +.TH "SYSTEMD\-SHUTDOWND\&.SERVICE" "8" "" "systemd 219" "systemd-shutdownd.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-shutdownd.service.html b/man/systemd-shutdownd.service.html index f2c3478b4..530c47d2e 100644 --- a/man/systemd-shutdownd.service.html +++ b/man/systemd-shutdownd.service.html @@ -19,12 +19,12 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-shutdownd.service, systemd-shutdownd.socket, systemd-shutdownd — Scheduled shutdown service

Synopsis

systemd-shutdownd.service

systemd-shutdownd.socket

/usr/lib/systemd/systemd-shutdownd

Description¶

systemd-shutdownd.service is a - system service that implements scheduled shutdowns, as - exposed by - shutdown(8). - systemd-shutdownd.service is automatically activated on request and terminates - itself when it is unused.

See Also¶

- systemd(1), - shutdown(8) -

+ gudev systemd 219

Name

systemd-shutdownd.service, systemd-shutdownd.socket, systemd-shutdownd — Scheduled shutdown service

Synopsis

systemd-shutdownd.service

systemd-shutdownd.socket

/usr/lib/systemd/systemd-shutdownd

Description¶

systemd-shutdownd.service is a system + service that implements scheduled shutdowns, as exposed by + shutdown(8). + systemd-shutdownd.service is automatically + activated on request and terminates itself when it is + unused.

See Also¶

+ systemd(1), + shutdown(8) +

diff --git a/man/systemd-shutdownd.service.xml b/man/systemd-shutdownd.service.xml index c1b8ef7a4..756949ce5 100644 --- a/man/systemd-shutdownd.service.xml +++ b/man/systemd-shutdownd.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - diff --git a/man/systemd-sleep.html b/man/systemd-sleep.html index 75b73a810..64759b9ae 100644 --- a/man/systemd-sleep.html +++ b/man/systemd-sleep.html @@ -19,60 +19,50 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is - a system service that is pulled in by - suspend.target and is responsible - for the actual system suspend. Similarly, - systemd-hibernate.service is - pulled in by hibernate.target to - execute the actual hibernation. Finally, - systemd-hybrid-sleep.service is - pulled in by hybrid-sleep.target - to execute hybrid hibernation with system - suspend.

Immediately before entering system suspend - and/or hibernation - systemd-suspend.service (and the - other mentioned units, respectively) will run all - executables in - /usr/lib/systemd/system-sleep/ - and pass two arguments to them. The first argument - will be "pre", the second either - "suspend", - "hibernate", or - "hybrid-sleep" depending on the - chosen action. Immediately after leaving system - suspend and/or hibernation the same executables are run, - but the first argument is now - "post". All executables in this - directory are executed in parallel, and execution of - the action is not continued until all executables - have finished.

Note that scripts or binaries dropped in - /usr/lib/systemd/system-sleep/ - are intended for local use only and should be - considered hacks. If applications want to be notified - of system suspend/hibernation and resume, there are - much nicer interfaces available.

Note that - systemd-suspend.service, - systemd-hibernate.service, and - systemd-hybrid-sleep.service - should never be executed directly. Instead, trigger - system sleep states with a command such as - "systemctl suspend" or - similar.

Internally, this service will echo a string like - "mem" into - /sys/power/state, to trigger the - actual system suspend. What exactly is written - where can be configured in the "[Sleep]" - section of /etc/systemd/sleep.conf or a - sleep.conf.d file. - See systemd-sleep.conf(5). -

Options¶

systemd-sleep understands the - following commands:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or - put the system to hybrid sleep.

+ gudev systemd 219

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is a system + service that is pulled in by suspend.target + and is responsible for the actual system suspend. Similarly, + systemd-hibernate.service is pulled in by + hibernate.target to execute the actual + hibernation. Finally, + systemd-hybrid-sleep.service is pulled in by + hybrid-sleep.target to execute hybrid + hibernation with system suspend.

Immediately before entering system suspend and/or + hibernation systemd-suspend.service (and the + other mentioned units, respectively) will run all executables in + /usr/lib/systemd/system-sleep/ and pass two + arguments to them. The first argument will be + "pre", the second either + "suspend", "hibernate", or + "hybrid-sleep" depending on the chosen action. + Immediately after leaving system suspend and/or hibernation the + same executables are run, but the first argument is now + "post". All executables in this directory are + executed in parallel, and execution of the action is not continued + until all executables have finished.

Note that scripts or binaries dropped in + /usr/lib/systemd/system-sleep/ are intended + for local use only and should be considered hacks. If applications + want to be notified of system suspend/hibernation and resume, + there are much nicer interfaces available.

Note that + systemd-suspend.service, + systemd-hibernate.service, and + systemd-hybrid-sleep.service + should never be executed directly. Instead, trigger system sleep + states with a command such as "systemctl suspend" + or similar.

Internally, this service will echo a string like + "mem" into /sys/power/state, + to trigger the actual system suspend. What exactly is written + where can be configured in the "[Sleep]" section + of /etc/systemd/sleep.conf or a + sleep.conf.d file. See + systemd-sleep.conf(5). +

Options¶

systemd-sleep understands the + following commands:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or put the system to + hybrid sleep.

diff --git a/man/systemd-socket-proxyd.8 b/man/systemd-socket-proxyd.8 index f7ac4880d..8c3856e22 100644 --- a/man/systemd-socket-proxyd.8 +++ b/man/systemd-socket-proxyd.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SOCKET\-PROXYD" "8" "" "systemd 218" "systemd-socket-proxyd" +.TH "SYSTEMD\-SOCKET\-PROXYD" "8" "" "systemd 219" "systemd-socket-proxyd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-socket-proxyd.html b/man/systemd-socket-proxyd.html index 50f99351e..d3f529dc2 100644 --- a/man/systemd-socket-proxyd.html +++ b/man/systemd-socket-proxyd.html @@ -19,57 +19,53 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-socket-proxyd — Bidirectionally proxy local sockets to another (possibly remote) socket.

Synopsis

systemd-socket-proxyd [OPTIONS...] HOST:PORT

systemd-socket-proxyd [OPTIONS...] UNIX-DOMAIN-SOCKET-PATH -

Description¶

- systemd-socket-proxyd is a generic - socket-activated network socket forwarder proxy daemon - for IPv4, IPv6 and UNIX stream sockets. It may be used - to bi-directionally forward traffic from a local listening socket to a - local or remote destination socket.

One use of this tool is to provide - socket activation support for services that do not - natively support socket activation. On behalf of the - service to activate, the proxy inherits the socket - from systemd, accepts each client connection, opens a - connection to a configured server for each client, and - then bidirectionally forwards data between the - two.

This utility's behavior is similar to - socat(1). - The main differences for systemd-socket-proxyd - are support for socket activation with - "Accept=false" and an event-driven - design that scales better with the number of - connections.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Examples¶

Simple Example¶

Use two services with a dependency - and no namespace isolation.

Example 1. proxy-to-nginx.socket

[Socket]
+  gudev systemd 219

Name

systemd-socket-proxyd — Bidirectionally proxy local sockets to another (possibly remote) socket.

Synopsis

systemd-socket-proxyd [OPTIONS...] HOST:PORT

systemd-socket-proxyd [OPTIONS...] UNIX-DOMAIN-SOCKET-PATH +

Description¶

+ systemd-socket-proxyd is a generic + socket-activated network socket forwarder proxy daemon for IPv4, + IPv6 and UNIX stream sockets. It may be used to bi-directionally + forward traffic from a local listening socket to a local or remote + destination socket.

One use of this tool is to provide socket activation support + for services that do not natively support socket activation. On + behalf of the service to activate, the proxy inherits the socket + from systemd, accepts each client connection, opens a connection + to a configured server for each client, and then bidirectionally + forwards data between the two.

This utility's behavior is similar to + socat(1). + The main differences for systemd-socket-proxyd + are support for socket activation with + "Accept=false" and an event-driven + design that scales better with the number of + connections.

Options¶

The following options are understood:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

Examples¶

Simple Example¶

Use two services with a dependency and no namespace + isolation.

Example 1. proxy-to-nginx.socket

[Socket]
 ListenStream=80
 
 [Install]
-WantedBy=sockets.target

Example 2. proxy-to-nginx.service

[Unit]
+WantedBy=sockets.target

Example 2. proxy-to-nginx.service

[Unit]
 Requires=nginx.service
 After=nginx.service
 
 [Service]
 ExecStart=/usr/lib/systemd/systemd-socket-proxyd /tmp/nginx.sock
 PrivateTmp=yes
-PrivateNetwork=yes

Example 3. nginx.conf

+PrivateNetwork=yes

Example 3. nginx.conf

 [...]
 server {
     listen       unix:/tmp/nginx.sock;
     [...]
-

Example 4. Enabling the proxy

# systemctl enable proxy-to-nginx.socket
+

Example 4. Enabling the proxy

# systemctl enable proxy-to-nginx.socket
 # systemctl start proxy-to-nginx.socket
-$ curl http://localhost:80/

Namespace Example¶

Similar as above, but runs the socket - proxy and the main service in the same private - namespace, assuming that - nginx.service has - PrivateTmp= and - PrivateNetwork= set, - too.

Example 5. proxy-to-nginx.socket

[Socket]
+$ curl http://localhost:80/

Namespace Example¶

Similar as above, but runs the socket proxy and the main + service in the same private namespace, assuming that + nginx.service has + PrivateTmp= and + PrivateNetwork= set, too.

Example 5. proxy-to-nginx.socket

[Socket]
 ListenStream=80
 
 [Install]
-WantedBy=sockets.target

Example 6. proxy-to-nginx.service

[Unit]
+WantedBy=sockets.target

Example 6. proxy-to-nginx.service

[Unit]
 Requires=nginx.service
 After=nginx.service
 JoinsNamespaceOf=nginx.service
@@ -77,18 +73,18 @@ JoinsNamespaceOf=nginx.service
 [Service]
 ExecStart=/usr/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080
 PrivateTmp=yes
-PrivateNetwork=yes

Example 7. nginx.conf

[...]
+PrivateNetwork=yes

Example 7. nginx.conf

[...]
 server {
     listen       8080;
     listen       unix:/tmp/nginx.sock;
-    [...]

Example 8. Enabling the proxy

# systemctl enable proxy-to-nginx.socket
+    [...]

Example 8. Enabling the proxy

# systemctl enable proxy-to-nginx.socket
 # systemctl start proxy-to-nginx.socket
-$ curl http://localhost:80/

+$ curl http://localhost:80/

diff --git a/man/systemd-socket-proxyd.xml b/man/systemd-socket-proxyd.xml index ab80a2b4b..1c78b656e 100644 --- a/man/systemd-socket-proxyd.xml +++ b/man/systemd-socket-proxyd.xml @@ -21,96 +21,94 @@ along with systemd; If not, see . --> + xmlns:xi="http://www.w3.org/2001/XInclude"> - - systemd-socket-proxyd - systemd - - - Developer - David - Strauss - david@davidstrauss.net - - - - - systemd-socket-proxyd - 8 - - - systemd-socket-proxyd - Bidirectionally proxy local sockets to another (possibly remote) socket. - - - - systemd-socket-proxyd - OPTIONS - HOST:PORT - - - systemd-socket-proxyd - OPTIONS - UNIX-DOMAIN-SOCKET-PATH - - - - - Description - - systemd-socket-proxyd is a generic - socket-activated network socket forwarder proxy daemon - for IPv4, IPv6 and UNIX stream sockets. It may be used - to bi-directionally forward traffic from a local listening socket to a - local or remote destination socket. + + systemd-socket-proxyd + systemd + + + Developer + David + Strauss + david@davidstrauss.net + + + + + systemd-socket-proxyd + 8 + + + systemd-socket-proxyd + Bidirectionally proxy local sockets to another (possibly remote) socket. + + + + systemd-socket-proxyd + OPTIONS + HOST:PORT + + + systemd-socket-proxyd + OPTIONS + UNIX-DOMAIN-SOCKET-PATH + + + + + Description + + systemd-socket-proxyd is a generic + socket-activated network socket forwarder proxy daemon for IPv4, + IPv6 and UNIX stream sockets. It may be used to bi-directionally + forward traffic from a local listening socket to a local or remote + destination socket. - One use of this tool is to provide - socket activation support for services that do not - natively support socket activation. On behalf of the - service to activate, the proxy inherits the socket - from systemd, accepts each client connection, opens a - connection to a configured server for each client, and - then bidirectionally forwards data between the - two. - This utility's behavior is similar to - socat1. - The main differences for systemd-socket-proxyd - are support for socket activation with - Accept=false and an event-driven - design that scales better with the number of - connections. - - - Options - The following options are understood: - - - - - - - Exit status - On success, 0 is returned, a non-zero failure - code otherwise. - - - Examples - - Simple Example - Use two services with a dependency - and no namespace isolation. - - proxy-to-nginx.socket - One use of this tool is to provide socket activation support + for services that do not natively support socket activation. On + behalf of the service to activate, the proxy inherits the socket + from systemd, accepts each client connection, opens a connection + to a configured server for each client, and then bidirectionally + forwards data between the two. + This utility's behavior is similar to + socat1. + The main differences for systemd-socket-proxyd + are support for socket activation with + Accept=false and an event-driven + design that scales better with the number of + connections. + + + Options + The following options are understood: + + + + + + + Exit status + On success, 0 is returned, a non-zero failure + code otherwise. + + + Examples + + Simple Example + Use two services with a dependency and no namespace + isolation. + + proxy-to-nginx.socket + - - - proxy-to-nginx.service - + + proxy-to-nginx.service + - - - nginx.conf - + + + nginx.conf + - - - Enabling the proxy - + + Enabling the proxy + - - - - Namespace Example - Similar as above, but runs the socket - proxy and the main service in the same private - namespace, assuming that - nginx.service has - PrivateTmp= and - PrivateNetwork= set, - too. - - proxy-to-nginx.socket - + + + Namespace Example + Similar as above, but runs the socket proxy and the main + service in the same private namespace, assuming that + nginx.service has + PrivateTmp= and + PrivateNetwork= set, too. + + proxy-to-nginx.socket + - - - proxy-to-nginx.service - + + proxy-to-nginx.service + - - - nginx.conf - + + nginx.conf + - - - Enabling the proxy - + + Enabling the proxy + - - - - - See Also - - systemd1, - systemd.socket5, - systemd.service5, - systemctl1, - socat1, - nginx1, - curl1 - - + + + + + See Also + + systemd1, + systemd.socket5, + systemd.service5, + systemctl1, + socat1, + nginx1, + curl1 + + diff --git a/man/systemd-suspend.service.8 b/man/systemd-suspend.service.8 index 841b03dc1..97085e81c 100644 --- a/man/systemd-suspend.service.8 +++ b/man/systemd-suspend.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SUSPEND\&.SERVICE" "8" "" "systemd 218" "systemd-suspend.service" +.TH "SYSTEMD\-SUSPEND\&.SERVICE" "8" "" "systemd 219" "systemd-suspend.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-suspend.service.html b/man/systemd-suspend.service.html index 75b73a810..64759b9ae 100644 --- a/man/systemd-suspend.service.html +++ b/man/systemd-suspend.service.html @@ -19,60 +19,50 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is - a system service that is pulled in by - suspend.target and is responsible - for the actual system suspend. Similarly, - systemd-hibernate.service is - pulled in by hibernate.target to - execute the actual hibernation. Finally, - systemd-hybrid-sleep.service is - pulled in by hybrid-sleep.target - to execute hybrid hibernation with system - suspend.

Immediately before entering system suspend - and/or hibernation - systemd-suspend.service (and the - other mentioned units, respectively) will run all - executables in - /usr/lib/systemd/system-sleep/ - and pass two arguments to them. The first argument - will be "pre", the second either - "suspend", - "hibernate", or - "hybrid-sleep" depending on the - chosen action. Immediately after leaving system - suspend and/or hibernation the same executables are run, - but the first argument is now - "post". All executables in this - directory are executed in parallel, and execution of - the action is not continued until all executables - have finished.

Note that scripts or binaries dropped in - /usr/lib/systemd/system-sleep/ - are intended for local use only and should be - considered hacks. If applications want to be notified - of system suspend/hibernation and resume, there are - much nicer interfaces available.

Note that - systemd-suspend.service, - systemd-hibernate.service, and - systemd-hybrid-sleep.service - should never be executed directly. Instead, trigger - system sleep states with a command such as - "systemctl suspend" or - similar.

Internally, this service will echo a string like - "mem" into - /sys/power/state, to trigger the - actual system suspend. What exactly is written - where can be configured in the "[Sleep]" - section of /etc/systemd/sleep.conf or a - sleep.conf.d file. - See systemd-sleep.conf(5). -

Options¶

systemd-sleep understands the - following commands:

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or - put the system to hybrid sleep.

+ gudev systemd 219

Name

systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic

Synopsis

systemd-suspend.service

systemd-hibernate.service

systemd-hybrid-sleep.service

/usr/lib/systemd/system-sleep

Description¶

systemd-suspend.service is a system + service that is pulled in by suspend.target + and is responsible for the actual system suspend. Similarly, + systemd-hibernate.service is pulled in by + hibernate.target to execute the actual + hibernation. Finally, + systemd-hybrid-sleep.service is pulled in by + hybrid-sleep.target to execute hybrid + hibernation with system suspend.

Immediately before entering system suspend and/or + hibernation systemd-suspend.service (and the + other mentioned units, respectively) will run all executables in + /usr/lib/systemd/system-sleep/ and pass two + arguments to them. The first argument will be + "pre", the second either + "suspend", "hibernate", or + "hybrid-sleep" depending on the chosen action. + Immediately after leaving system suspend and/or hibernation the + same executables are run, but the first argument is now + "post". All executables in this directory are + executed in parallel, and execution of the action is not continued + until all executables have finished.

Note that scripts or binaries dropped in + /usr/lib/systemd/system-sleep/ are intended + for local use only and should be considered hacks. If applications + want to be notified of system suspend/hibernation and resume, + there are much nicer interfaces available.

Note that + systemd-suspend.service, + systemd-hibernate.service, and + systemd-hybrid-sleep.service + should never be executed directly. Instead, trigger system sleep + states with a command such as "systemctl suspend" + or similar.

Internally, this service will echo a string like + "mem" into /sys/power/state, + to trigger the actual system suspend. What exactly is written + where can be configured in the "[Sleep]" section + of /etc/systemd/sleep.conf or a + sleep.conf.d file. See + systemd-sleep.conf(5). +

Options¶

systemd-sleep understands the + following commands:

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

suspend, hibernate, hybrid-sleep¶

Suspend, hibernate, or put the system to + hybrid sleep.

diff --git a/man/systemd-suspend.service.xml b/man/systemd-suspend.service.xml index 375c25576..a8beb86f4 100644 --- a/man/systemd-suspend.service.xml +++ b/man/systemd-suspend.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-suspend.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-suspend.service - 8 - - - - systemd-suspend.service - systemd-hibernate.service - systemd-hybrid-sleep.service - systemd-sleep - System sleep state logic - - - - systemd-suspend.service - systemd-hibernate.service - systemd-hybrid-sleep.service - /usr/lib/systemd/system-sleep - - - - Description - - systemd-suspend.service is - a system service that is pulled in by - suspend.target and is responsible - for the actual system suspend. Similarly, - systemd-hibernate.service is - pulled in by hibernate.target to - execute the actual hibernation. Finally, - systemd-hybrid-sleep.service is - pulled in by hybrid-sleep.target - to execute hybrid hibernation with system - suspend. - - Immediately before entering system suspend - and/or hibernation - systemd-suspend.service (and the - other mentioned units, respectively) will run all - executables in - /usr/lib/systemd/system-sleep/ - and pass two arguments to them. The first argument - will be pre, the second either - suspend, - hibernate, or - hybrid-sleep depending on the - chosen action. Immediately after leaving system - suspend and/or hibernation the same executables are run, - but the first argument is now - post. All executables in this - directory are executed in parallel, and execution of - the action is not continued until all executables - have finished. - - Note that scripts or binaries dropped in - /usr/lib/systemd/system-sleep/ - are intended for local use only and should be - considered hacks. If applications want to be notified - of system suspend/hibernation and resume, there are - much nicer interfaces available. - - Note that - systemd-suspend.service, - systemd-hibernate.service, and - systemd-hybrid-sleep.service - should never be executed directly. Instead, trigger - system sleep states with a command such as - systemctl suspend or - similar. - - Internally, this service will echo a string like - mem into - /sys/power/state, to trigger the - actual system suspend. What exactly is written - where can be configured in the [Sleep] - section of /etc/systemd/sleep.conf or a - sleep.conf.d file. - See systemd-sleep.conf5. - - - - - Options - - systemd-sleep understands the - following commands: - - - - - - - - - - - Suspend, hibernate, or - put the system to hybrid sleep. - - - - - - - See Also - - systemd-sleep.conf5, - systemd1, - systemctl1, - systemd.special7, - systemd-halt.service8 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-suspend.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-suspend.service + 8 + + + + systemd-suspend.service + systemd-hibernate.service + systemd-hybrid-sleep.service + systemd-sleep + System sleep state logic + + + + systemd-suspend.service + systemd-hibernate.service + systemd-hybrid-sleep.service + /usr/lib/systemd/system-sleep + + + + Description + + systemd-suspend.service is a system + service that is pulled in by suspend.target + and is responsible for the actual system suspend. Similarly, + systemd-hibernate.service is pulled in by + hibernate.target to execute the actual + hibernation. Finally, + systemd-hybrid-sleep.service is pulled in by + hybrid-sleep.target to execute hybrid + hibernation with system suspend. + + Immediately before entering system suspend and/or + hibernation systemd-suspend.service (and the + other mentioned units, respectively) will run all executables in + /usr/lib/systemd/system-sleep/ and pass two + arguments to them. The first argument will be + pre, the second either + suspend, hibernate, or + hybrid-sleep depending on the chosen action. + Immediately after leaving system suspend and/or hibernation the + same executables are run, but the first argument is now + post. All executables in this directory are + executed in parallel, and execution of the action is not continued + until all executables have finished. + + Note that scripts or binaries dropped in + /usr/lib/systemd/system-sleep/ are intended + for local use only and should be considered hacks. If applications + want to be notified of system suspend/hibernation and resume, + there are much nicer interfaces available. + + Note that + systemd-suspend.service, + systemd-hibernate.service, and + systemd-hybrid-sleep.service + should never be executed directly. Instead, trigger system sleep + states with a command such as systemctl suspend + or similar. + + Internally, this service will echo a string like + mem into /sys/power/state, + to trigger the actual system suspend. What exactly is written + where can be configured in the [Sleep] section + of /etc/systemd/sleep.conf or a + sleep.conf.d file. See + systemd-sleep.conf5. + + + + + Options + + systemd-sleep understands the + following commands: + + + + + + + + + + + Suspend, hibernate, or put the system to + hybrid sleep. + + + + + + + See Also + + systemd-sleep.conf5, + systemd1, + systemctl1, + systemd.special7, + systemd-halt.service8 + + diff --git a/man/systemd-sysctl.html b/man/systemd-sysctl.html index d1701c0db..4e410cbcf 100644 --- a/man/systemd-sysctl.html +++ b/man/systemd-sysctl.html @@ -19,14 +19,13 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sysctl.service, systemd-sysctl — Configure kernel parameters at boot

Synopsis

systemd-sysctl.service

/usr/lib/systemd/systemd-sysctl

Description¶

systemd-sysctl.service is - an early-boot service that configures - sysctl(8) - kernel parameters.

See - sysctl.d(5) - for information about the configuration of this - service.

See Also¶

- systemd(1), - sysctl.d(5), - sysctl(8), -

+ gudev systemd 219

Name

systemd-sysctl.service, systemd-sysctl — Configure kernel parameters at boot

Synopsis

systemd-sysctl.service

/usr/lib/systemd/systemd-sysctl

Description¶

systemd-sysctl.service is an early-boot + service that configures + sysctl(8) + kernel parameters.

See + sysctl.d(5) + for information about the configuration of this service.

See Also¶

+ systemd(1), + sysctl.d(5), + sysctl(8), +

diff --git a/man/systemd-sysctl.service.8 b/man/systemd-sysctl.service.8 index 2b49ce610..022a7a895 100644 --- a/man/systemd-sysctl.service.8 +++ b/man/systemd-sysctl.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SYSCTL\&.SERVICE" "8" "" "systemd 218" "systemd-sysctl.service" +.TH "SYSTEMD\-SYSCTL\&.SERVICE" "8" "" "systemd 219" "systemd-sysctl.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-sysctl.service.html b/man/systemd-sysctl.service.html index d1701c0db..4e410cbcf 100644 --- a/man/systemd-sysctl.service.html +++ b/man/systemd-sysctl.service.html @@ -19,14 +19,13 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sysctl.service, systemd-sysctl — Configure kernel parameters at boot

Synopsis

systemd-sysctl.service

/usr/lib/systemd/systemd-sysctl

Description¶

systemd-sysctl.service is - an early-boot service that configures - sysctl(8) - kernel parameters.

See - sysctl.d(5) - for information about the configuration of this - service.

See Also¶

- systemd(1), - sysctl.d(5), - sysctl(8), -

+ gudev systemd 219

Name

systemd-sysctl.service, systemd-sysctl — Configure kernel parameters at boot

Synopsis

systemd-sysctl.service

/usr/lib/systemd/systemd-sysctl

Description¶

systemd-sysctl.service is an early-boot + service that configures + sysctl(8) + kernel parameters.

See + sysctl.d(5) + for information about the configuration of this service.

See Also¶

+ systemd(1), + sysctl.d(5), + sysctl(8), +

diff --git a/man/systemd-sysctl.service.xml b/man/systemd-sysctl.service.xml index a9a476563..f35a18a4d 100644 --- a/man/systemd-sysctl.service.xml +++ b/man/systemd-sysctl.service.xml @@ -21,57 +21,56 @@ --> - - systemd-sysctl.service - systemd + + systemd-sysctl.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-sysctl.service - 8 - + + systemd-sysctl.service + 8 + - - systemd-sysctl.service - systemd-sysctl - Configure kernel parameters at boot - + + systemd-sysctl.service + systemd-sysctl + Configure kernel parameters at boot + - - systemd-sysctl.service - /usr/lib/systemd/systemd-sysctl - + + systemd-sysctl.service + /usr/lib/systemd/systemd-sysctl + - - Description + + Description - systemd-sysctl.service is - an early-boot service that configures - sysctl8 - kernel parameters. + systemd-sysctl.service is an early-boot + service that configures + sysctl8 + kernel parameters. - See - sysctl.d5 - for information about the configuration of this - service. - + See + sysctl.d5 + for information about the configuration of this service. + - - See Also - - systemd1, - sysctl.d5, - sysctl8, - - + + See Also + + systemd1, + sysctl.d5, + sysctl8, + + diff --git a/man/systemd-system-update-generator.8 b/man/systemd-system-update-generator.8 index 3cabfee3d..43474e62b 100644 --- a/man/systemd-system-update-generator.8 +++ b/man/systemd-system-update-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SYSTEM\-UPDATE\-GENERATOR" "8" "" "systemd 218" "systemd-system-update-generator" +.TH "SYSTEMD\-SYSTEM\-UPDATE\-GENERATOR" "8" "" "systemd 219" "systemd-system-update-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-system-update-generator.html b/man/systemd-system-update-generator.html index da4d8a042..691a13af8 100644 --- a/man/systemd-system-update-generator.html +++ b/man/systemd-system-update-generator.html @@ -19,16 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-system-update-generator — Generator for redirecting boot to offline update mode

Synopsis

/usr/lib/systemd/system-generators/systemd-system-update-generator

Description¶

systemd-system-update-generator - is a generator that automatically redirects the boot - process to system-update.target - if /system-update exists. This is - required to implement the logic explained in the - System - Updates Specification. -

systemd-system-update-generator - implements the generator - specification.

+ gudev systemd 219

Name

systemd-system-update-generator — Generator for redirecting boot to offline update mode

Synopsis

/usr/lib/systemd/system-generators/systemd-system-update-generator

Description¶

systemd-system-update-generator is a + generator that automatically redirects the boot process to + system-update.target if + /system-update exists. This is required to + implement the logic explained in the System + Updates Specification. +

systemd-system-update-generator + implements the + generator + specification.

diff --git a/man/systemd-system-update-generator.xml b/man/systemd-system-update-generator.xml index 18a23ed7f..3eec1d7b9 100644 --- a/man/systemd-system-update-generator.xml +++ b/man/systemd-system-update-generator.xml @@ -21,59 +21,58 @@ --> - - systemd-system-update-generator - systemd + + systemd-system-update-generator + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-system-update-generator - 8 - + + systemd-system-update-generator + 8 + - - systemd-system-update-generator - Generator for redirecting boot to offline update mode - + + systemd-system-update-generator + Generator for redirecting boot to offline update mode + - - /usr/lib/systemd/system-generators/systemd-system-update-generator - + + /usr/lib/systemd/system-generators/systemd-system-update-generator + - - Description + + Description - systemd-system-update-generator - is a generator that automatically redirects the boot - process to system-update.target - if /system-update exists. This is - required to implement the logic explained in the - System - Updates Specification. - + systemd-system-update-generator is a + generator that automatically redirects the boot process to + system-update.target if + /system-update exists. This is required to + implement the logic explained in the System + Updates Specification. + - systemd-system-update-generator - implements the generator - specification. - + systemd-system-update-generator + implements the + generator + specification. + - - See Also - - systemd1, - systemd.special7 - - + + See Also + + systemd1, + systemd.special7 + + diff --git a/man/systemd-system.conf.5 b/man/systemd-system.conf.5 index 68f9d31dc..ec403a23d 100644 --- a/man/systemd-system.conf.5 +++ b/man/systemd-system.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SYSTEM\&.CONF" "5" "" "systemd 218" "systemd-system.conf" +.TH "SYSTEMD\-SYSTEM\&.CONF" "5" "" "systemd 219" "systemd-system.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-system.conf.html b/man/systemd-system.conf.html index ef0fc2a36..45b790689 100644 --- a/man/systemd-system.conf.html +++ b/man/systemd-system.conf.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. These - configuration files contain a few settings controlling - basic manager operations.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. These configuration + files contain a few settings controlling basic manager + operations.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -50,240 +50,153 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various - parameters of basic manager - operation. These options may be - overridden by the respective command - line arguments. See - systemd(1) - for details about these command line - arguments.

CPUAffinity=¶

Configures the initial - CPU affinity for the init - process. Takes a space-separated list - of CPU indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers - that shall be mounted in a single - hierarchy. By default, systemd will - mount all controllers which are - enabled in the kernel in individual - hierarchies, with the exception of - those listed in this setting. Takes a - space-separated list of comma-separated - controller names, in order - to allow multiple joined - hierarchies. Defaults to - 'cpu,cpuacct'. Pass an empty string to - ensure that systemd mounts all - controllers in separate - hierarchies.

Note that this option is only - applied once, at very early boot. If - you use an initial RAM disk (initrd) - that uses systemd, it might hence be - necessary to rebuild the initrd if - this option is changed, and make sure - the new configuration file is included - in it. Otherwise, the initrd might - mount the controller hierarchies in a - different configuration than intended, - and the main system cannot remount - them anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware - watchdog at runtime and at - reboot. Takes a timeout value in - seconds (or in other time units if - suffixed with "ms", - "min", - "h", - "d", - "w"). If - RuntimeWatchdogSec= - is set to a non-zero value, the - watchdog hardware - (/dev/watchdog) - will be programmed to automatically - reboot the system if it is not - contacted within the specified timeout - interval. The system manager will - ensure to contact it at least once in - half the specified timeout - interval. This feature requires a - hardware watchdog device to be - present, as it is commonly the case in - embedded and server systems. Not all - hardware watchdogs allow configuration - of the reboot timeout, in which case - the closest available timeout is - picked. ShutdownWatchdogSec= - may be used to configure the hardware - watchdog when the system is asked to - reboot. It works as a safety net to - ensure that the reboot takes place - even if a clean reboot attempt times - out. By default - RuntimeWatchdogSec= - defaults to 0 (off), and - ShutdownWatchdogSec= - to 10min. These settings have no - effect if a hardware watchdog is not - available.

CapabilityBoundingSet=¶

Controls which - capabilities to include in the - capability bounding set for PID 1 and - its children. See - capabilities(7) - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name(3). - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, all but the listed - capabilities will be included, the - effect of the assignment - inverted. Note that this option also - affects the respective capabilities in - the effective, permitted and - inheritable capability sets. The - capability bounding set may also be - individually configured for units - using the - CapabilityBoundingSet= - directive for units, but note that - capabilities dropped for PID 1 cannot - be regained in individual units, they - are lost for good.

SystemCallArchitectures=¶

Takes a - space-separated list of architecture - identifiers. Selects from which - architectures system calls may be - invoked on this system. This may be - used as an effective way to disable - invocation of non-native binaries - system-wide, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. This option - operates system-wide, and acts - similar to the - SystemCallArchitectures= - setting of unit files, see - systemd.exec(5) - for details. This setting defaults to - the empty list, in which case no - filtering of system calls based on - architecture is applied. Known - architecture identifiers are - "x86", - "x86-64", - "x32", - "arm" and the special - identifier - "native". The latter - implicitly maps to the native - architecture of the system (or more - specifically, the architecture the - system manager was compiled for). Set - this setting to - "native" to prohibit - execution of any non-native - binaries. When a binary executes a - system call of an architecture that is - not listed in this setting, it will be - immediately terminated with the SIGSYS - signal.

TimerSlackNSec=¶

Sets the timer slack - in nanoseconds for PID 1, which is - inherited by all executed processes, - unless overridden individually, for - example with the - TimerSlackNSec= - setting in service units (for details - see - systemd.exec(5)). The - timer slack controls the accuracy of - wake-ups triggered by system - timers. See - prctl(2) - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too.

DefaultTimerAccuracySec=¶

Sets the default - accuracy of timer units. This controls - the global default for the - AccuracySec= - setting of timer units, see - systemd.timer(5) - for - details. AccuracySec= - set in individual units override the - global default for the specific - unit. Defaults to 1min. Note that the - accuracy of timer units is also - affected by the configured timer slack - for PID 1, see - TimerSlackNSec= - above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default - timeouts for starting and stopping of - units, as well as the default time to - sleep between automatic restarts of - units, as configured per-unit in - TimeoutStartSec=, - TimeoutStopSec= and - RestartSec= (for - services, see - systemd.service(5) - for details on the per-unit - settings). For non-service units, - DefaultTimeoutStartSec= - sets the default - TimeoutSec= value. -

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default - unit start rate limiting, as - configured per-service by - StartLimitInterval= - and - StartLimitBurst=. See - systemd.service(5) - for details on the per-service - settings.

DefaultEnvironment=¶

Sets manager - environment variables passed to all - executed processes. Takes a - space-separated list of variable - assignments. See - environ(7) - for details about environment - variables.

Example: + file.

Options¶

All options are configured in the + "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various parameters of basic manager + operation. These options may be overridden by the respective + command line arguments. See + systemd(1) + for details about these command line + arguments.

CPUAffinity=¶

Configures the initial CPU affinity for the + init process. Takes a space-separated list of CPU + indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers that shall be mounted + in a single hierarchy. By default, systemd will mount all + controllers which are enabled in the kernel in individual + hierarchies, with the exception of those listed in this + setting. Takes a space-separated list of comma-separated + controller names, in order to allow multiple joined + hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string + to ensure that systemd mounts all controllers in separate + hierarchies.

Note that this option is only applied once, at very + early boot. If you use an initial RAM disk (initrd) that uses + systemd, it might hence be necessary to rebuild the initrd if + this option is changed, and make sure the new configuration + file is included in it. Otherwise, the initrd might mount the + controller hierarchies in a different configuration than + intended, and the main system cannot remount them + anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware watchdog at runtime and + at reboot. Takes a timeout value in seconds (or in other time + units if suffixed with "ms", + "min", "h", + "d", "w"). If + RuntimeWatchdogSec= is set to a non-zero + value, the watchdog hardware + (/dev/watchdog) will be programmed to + automatically reboot the system if it is not contacted within + the specified timeout interval. The system manager will ensure + to contact it at least once in half the specified timeout + interval. This feature requires a hardware watchdog device to + be present, as it is commonly the case in embedded and server + systems. Not all hardware watchdogs allow configuration of the + reboot timeout, in which case the closest available timeout is + picked. ShutdownWatchdogSec= may be used to + configure the hardware watchdog when the system is asked to + reboot. It works as a safety net to ensure that the reboot + takes place even if a clean reboot attempt times out. By + default RuntimeWatchdogSec= defaults to 0 + (off), and ShutdownWatchdogSec= to 10min. + These settings have no effect if a hardware watchdog is not + available.

CapabilityBoundingSet=¶

Controls which capabilities to include in the + capability bounding set for PID 1 and its children. See + capabilities(7) + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name(3). + Capabilities listed will be included in the bounding set, all + others are removed. If the list of capabilities is prefixed + with ~, all but the listed capabilities will be included, the + effect of the assignment inverted. Note that this option also + affects the respective capabilities in the effective, + permitted and inheritable capability sets. The capability + bounding set may also be individually configured for units + using the CapabilityBoundingSet= directive + for units, but note that capabilities dropped for PID 1 cannot + be regained in individual units, they are lost for + good.

SystemCallArchitectures=¶

Takes a space-separated list of architecture + identifiers. Selects from which architectures system calls may + be invoked on this system. This may be used as an effective + way to disable invocation of non-native binaries system-wide, + for example to prohibit execution of 32-bit x86 binaries on + 64-bit x86-64 systems. This option operates system-wide, and + acts similar to the + SystemCallArchitectures= setting of unit + files, see + systemd.exec(5) + for details. This setting defaults to the empty list, in which + case no filtering of system calls based on architecture is + applied. Known architecture identifiers are + "x86", "x86-64", + "x32", "arm" and the special + identifier "native". The latter implicitly + maps to the native architecture of the system (or more + specifically, the architecture the system manager was compiled + for). Set this setting to "native" to + prohibit execution of any non-native binaries. When a binary + executes a system call of an architecture that is not listed + in this setting, it will be immediately terminated with the + SIGSYS signal.

TimerSlackNSec=¶

Sets the timer slack in nanoseconds for PID 1, + which is inherited by all executed processes, unless + overridden individually, for example with the + TimerSlackNSec= setting in service units + (for details see + systemd.exec(5)). + The timer slack controls the accuracy of wake-ups triggered by + system timers. See + prctl(2) + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too.

DefaultTimerAccuracySec=¶

Sets the default accuracy of timer units. This + controls the global default for the + AccuracySec= setting of timer units, see + systemd.timer(5) + for details. AccuracySec= set in individual + units override the global default for the specific unit. + Defaults to 1min. Note that the accuracy of timer units is + also affected by the configured timer slack for PID 1, see + TimerSlackNSec= above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default timeouts for starting + and stopping of units, as well as the default time to sleep + between automatic restarts of units, as configured per-unit in + TimeoutStartSec=, + TimeoutStopSec= and + RestartSec= (for services, see + systemd.service(5) + for details on the per-unit settings). For non-service units, + DefaultTimeoutStartSec= sets the default + TimeoutSec= value.

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default unit start rate + limiting, as configured per-service by + StartLimitInterval= and + StartLimitBurst=. See + systemd.service(5) + for details on the per-service settings.

DefaultEnvironment=¶

Sets manager environment variables passed to + all executed processes. Takes a space-separated list of + variable assignments. See + environ(7) + for details about environment variables.

Example: -

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

+

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

- Sets three variables - "VAR1", - "VAR2", - "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default - resource accounting settings, as - configured per-unit by - CPUAccounting=, - BlockIOAccounting= - and - MemoryAccounting=. See - systemd.resource-control(5) - for details on the per-unit - settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control - various default resource limits for - units. See - setrlimit(2) - for details. Use the string - infinity to - configure no limit on a specific - resource. These settings may be - overridden in individual units - using the corresponding LimitXXX= - directives. Note that these resource - limits are only defaults for units, - they are not applied to PID 1 - itself.

+ Sets three variables + "VAR1", + "VAR2", + "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default resource accounting + settings, as configured per-unit by + CPUAccounting=, + BlockIOAccounting= and + MemoryAccounting=. See + systemd.resource-control(5) + for details on the per-unit settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control various default + resource limits for units. See + setrlimit(2) + for details. Use the string infinity to + configure no limit on a specific resource. These settings may + be overridden in individual units using the corresponding + LimitXXX= directives. Note that these resource limits are only + defaults for units, they are not applied to PID 1 + itself.

diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index dfb180cc5..7c3f23756 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd-system.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-system.conf - 5 - - - - systemd-system.conf - system.conf.d - systemd-user.conf - user.conf.d - System and session service manager configuration files - - - - /etc/systemd/system.conf - /etc/systemd/system.conf.d/*.conf - /run/systemd/system.conf.d/*.conf - /usr/lib/systemd/system.conf.d/*.conf - /etc/systemd/user.conf - /etc/systemd/user.conf.d/*.conf - /run/systemd/user.conf.d/*.conf - /usr/lib/systemd/user.conf.d/*.conf - - - - Description - - When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. These - configuration files contain a few settings controlling - basic manager operations. - - - - - - - Options - - All options are configured in the - [Manager] section: - - - - - LogLevel= - LogTarget= - LogColor= - LogLocation= - DumpCore=yes - CrashShell=no - ShowStatus=yes - CrashChVT=1 - DefaultStandardOutput=journal - DefaultStandardError=inherit - - Configures various - parameters of basic manager - operation. These options may be - overridden by the respective command - line arguments. See - systemd1 - for details about these command line - arguments. - - - - CPUAffinity= - - Configures the initial - CPU affinity for the init - process. Takes a space-separated list - of CPU indices. - - - - JoinControllers=cpu,cpuacct net_cls,netprio - - Configures controllers - that shall be mounted in a single - hierarchy. By default, systemd will - mount all controllers which are - enabled in the kernel in individual - hierarchies, with the exception of - those listed in this setting. Takes a - space-separated list of comma-separated - controller names, in order - to allow multiple joined - hierarchies. Defaults to - 'cpu,cpuacct'. Pass an empty string to - ensure that systemd mounts all - controllers in separate - hierarchies. - - Note that this option is only - applied once, at very early boot. If - you use an initial RAM disk (initrd) - that uses systemd, it might hence be - necessary to rebuild the initrd if - this option is changed, and make sure - the new configuration file is included - in it. Otherwise, the initrd might - mount the controller hierarchies in a - different configuration than intended, - and the main system cannot remount - them anymore. - - - - RuntimeWatchdogSec= - ShutdownWatchdogSec= - - Configure the hardware - watchdog at runtime and at - reboot. Takes a timeout value in - seconds (or in other time units if - suffixed with ms, - min, - h, - d, - w). If - RuntimeWatchdogSec= - is set to a non-zero value, the - watchdog hardware - (/dev/watchdog) - will be programmed to automatically - reboot the system if it is not - contacted within the specified timeout - interval. The system manager will - ensure to contact it at least once in - half the specified timeout - interval. This feature requires a - hardware watchdog device to be - present, as it is commonly the case in - embedded and server systems. Not all - hardware watchdogs allow configuration - of the reboot timeout, in which case - the closest available timeout is - picked. ShutdownWatchdogSec= - may be used to configure the hardware - watchdog when the system is asked to - reboot. It works as a safety net to - ensure that the reboot takes place - even if a clean reboot attempt times - out. By default - RuntimeWatchdogSec= - defaults to 0 (off), and - ShutdownWatchdogSec= - to 10min. These settings have no - effect if a hardware watchdog is not - available. - - - - CapabilityBoundingSet= - - Controls which - capabilities to include in the - capability bounding set for PID 1 and - its children. See - capabilities7 - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name3. - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, all but the listed - capabilities will be included, the - effect of the assignment - inverted. Note that this option also - affects the respective capabilities in - the effective, permitted and - inheritable capability sets. The - capability bounding set may also be - individually configured for units - using the - CapabilityBoundingSet= - directive for units, but note that - capabilities dropped for PID 1 cannot - be regained in individual units, they - are lost for good. - - - - SystemCallArchitectures= - - Takes a - space-separated list of architecture - identifiers. Selects from which - architectures system calls may be - invoked on this system. This may be - used as an effective way to disable - invocation of non-native binaries - system-wide, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. This option - operates system-wide, and acts - similar to the - SystemCallArchitectures= - setting of unit files, see - systemd.exec5 - for details. This setting defaults to - the empty list, in which case no - filtering of system calls based on - architecture is applied. Known - architecture identifiers are - x86, - x86-64, - x32, - arm and the special - identifier - native. The latter - implicitly maps to the native - architecture of the system (or more - specifically, the architecture the - system manager was compiled for). Set - this setting to - native to prohibit - execution of any non-native - binaries. When a binary executes a - system call of an architecture that is - not listed in this setting, it will be - immediately terminated with the SIGSYS - signal. - - - - TimerSlackNSec= - - Sets the timer slack - in nanoseconds for PID 1, which is - inherited by all executed processes, - unless overridden individually, for - example with the - TimerSlackNSec= - setting in service units (for details - see - systemd.exec5). The - timer slack controls the accuracy of - wake-ups triggered by system - timers. See - prctl2 - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too. - - - - DefaultTimerAccuracySec= - - Sets the default - accuracy of timer units. This controls - the global default for the - AccuracySec= - setting of timer units, see - systemd.timer5 - for - details. AccuracySec= - set in individual units override the - global default for the specific - unit. Defaults to 1min. Note that the - accuracy of timer units is also - affected by the configured timer slack - for PID 1, see - TimerSlackNSec= - above. - - - - DefaultTimeoutStartSec= - DefaultTimeoutStopSec= - DefaultRestartSec= - - Configures the default - timeouts for starting and stopping of - units, as well as the default time to - sleep between automatic restarts of - units, as configured per-unit in - TimeoutStartSec=, - TimeoutStopSec= and - RestartSec= (for - services, see - systemd.service5 - for details on the per-unit - settings). For non-service units, - DefaultTimeoutStartSec= - sets the default - TimeoutSec= value. - - - - - DefaultStartLimitInterval= - DefaultStartLimitBurst= - - Configure the default - unit start rate limiting, as - configured per-service by - StartLimitInterval= - and - StartLimitBurst=. See - systemd.service5 - for details on the per-service - settings. - - - - DefaultEnvironment= - - Sets manager - environment variables passed to all - executed processes. Takes a - space-separated list of variable - assignments. See - environ7 - for details about environment - variables. - - Example: - - DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6" - - Sets three variables - VAR1, - VAR2, - VAR3. - - - - DefaultCPUAccounting= - DefaultBlockIOAccounting= - DefaultMemoryAccounting= - - Configure the default - resource accounting settings, as - configured per-unit by - CPUAccounting=, - BlockIOAccounting= - and - MemoryAccounting=. See - systemd.resource-control5 - for details on the per-unit - settings. - - - - DefaultLimitCPU= - DefaultLimitFSIZE= - DefaultLimitDATA= - DefaultLimitSTACK= - DefaultLimitCORE= - DefaultLimitRSS= - DefaultLimitNOFILE= - DefaultLimitAS= - DefaultLimitNPROC= - DefaultLimitMEMLOCK= - DefaultLimitLOCKS= - DefaultLimitSIGPENDING= - DefaultLimitMSGQUEUE= - DefaultLimitNICE= - DefaultLimitRTPRIO= - DefaultLimitRTTIME= - - These settings control - various default resource limits for - units. See - setrlimit2 - for details. Use the string - infinity to - configure no limit on a specific - resource. These settings may be - overridden in individual units - using the corresponding LimitXXX= - directives. Note that these resource - limits are only defaults for units, - they are not applied to PID 1 - itself. - - - - - - See Also - - systemd1, - systemd.directives7, - systemd.exec5, - systemd.service5, - environ7, - capabilities7 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + systemd-system.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-system.conf + 5 + + + + systemd-system.conf + system.conf.d + systemd-user.conf + user.conf.d + System and session service manager configuration files + + + + /etc/systemd/system.conf + /etc/systemd/system.conf.d/*.conf + /run/systemd/system.conf.d/*.conf + /usr/lib/systemd/system.conf.d/*.conf + /etc/systemd/user.conf + /etc/systemd/user.conf.d/*.conf + /run/systemd/user.conf.d/*.conf + /usr/lib/systemd/user.conf.d/*.conf + + + + Description + + When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. These configuration + files contain a few settings controlling basic manager + operations. + + + + + + + Options + + All options are configured in the + [Manager] section: + + + + + LogLevel= + LogTarget= + LogColor= + LogLocation= + DumpCore=yes + CrashShell=no + ShowStatus=yes + CrashChVT=1 + DefaultStandardOutput=journal + DefaultStandardError=inherit + + Configures various parameters of basic manager + operation. These options may be overridden by the respective + command line arguments. See + systemd1 + for details about these command line + arguments. + + + + CPUAffinity= + + Configures the initial CPU affinity for the + init process. Takes a space-separated list of CPU + indices. + + + + JoinControllers=cpu,cpuacct net_cls,netprio + + Configures controllers that shall be mounted + in a single hierarchy. By default, systemd will mount all + controllers which are enabled in the kernel in individual + hierarchies, with the exception of those listed in this + setting. Takes a space-separated list of comma-separated + controller names, in order to allow multiple joined + hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string + to ensure that systemd mounts all controllers in separate + hierarchies. + + Note that this option is only applied once, at very + early boot. If you use an initial RAM disk (initrd) that uses + systemd, it might hence be necessary to rebuild the initrd if + this option is changed, and make sure the new configuration + file is included in it. Otherwise, the initrd might mount the + controller hierarchies in a different configuration than + intended, and the main system cannot remount them + anymore. + + + + RuntimeWatchdogSec= + ShutdownWatchdogSec= + + Configure the hardware watchdog at runtime and + at reboot. Takes a timeout value in seconds (or in other time + units if suffixed with ms, + min, h, + d, w). If + RuntimeWatchdogSec= is set to a non-zero + value, the watchdog hardware + (/dev/watchdog) will be programmed to + automatically reboot the system if it is not contacted within + the specified timeout interval. The system manager will ensure + to contact it at least once in half the specified timeout + interval. This feature requires a hardware watchdog device to + be present, as it is commonly the case in embedded and server + systems. Not all hardware watchdogs allow configuration of the + reboot timeout, in which case the closest available timeout is + picked. ShutdownWatchdogSec= may be used to + configure the hardware watchdog when the system is asked to + reboot. It works as a safety net to ensure that the reboot + takes place even if a clean reboot attempt times out. By + default RuntimeWatchdogSec= defaults to 0 + (off), and ShutdownWatchdogSec= to 10min. + These settings have no effect if a hardware watchdog is not + available. + + + + CapabilityBoundingSet= + + Controls which capabilities to include in the + capability bounding set for PID 1 and its children. See + capabilities7 + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name3. + Capabilities listed will be included in the bounding set, all + others are removed. If the list of capabilities is prefixed + with ~, all but the listed capabilities will be included, the + effect of the assignment inverted. Note that this option also + affects the respective capabilities in the effective, + permitted and inheritable capability sets. The capability + bounding set may also be individually configured for units + using the CapabilityBoundingSet= directive + for units, but note that capabilities dropped for PID 1 cannot + be regained in individual units, they are lost for + good. + + + + SystemCallArchitectures= + + Takes a space-separated list of architecture + identifiers. Selects from which architectures system calls may + be invoked on this system. This may be used as an effective + way to disable invocation of non-native binaries system-wide, + for example to prohibit execution of 32-bit x86 binaries on + 64-bit x86-64 systems. This option operates system-wide, and + acts similar to the + SystemCallArchitectures= setting of unit + files, see + systemd.exec5 + for details. This setting defaults to the empty list, in which + case no filtering of system calls based on architecture is + applied. Known architecture identifiers are + x86, x86-64, + x32, arm and the special + identifier native. The latter implicitly + maps to the native architecture of the system (or more + specifically, the architecture the system manager was compiled + for). Set this setting to native to + prohibit execution of any non-native binaries. When a binary + executes a system call of an architecture that is not listed + in this setting, it will be immediately terminated with the + SIGSYS signal. + + + + TimerSlackNSec= + + Sets the timer slack in nanoseconds for PID 1, + which is inherited by all executed processes, unless + overridden individually, for example with the + TimerSlackNSec= setting in service units + (for details see + systemd.exec5). + The timer slack controls the accuracy of wake-ups triggered by + system timers. See + prctl2 + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too. + + + + DefaultTimerAccuracySec= + + Sets the default accuracy of timer units. This + controls the global default for the + AccuracySec= setting of timer units, see + systemd.timer5 + for details. AccuracySec= set in individual + units override the global default for the specific unit. + Defaults to 1min. Note that the accuracy of timer units is + also affected by the configured timer slack for PID 1, see + TimerSlackNSec= above. + + + + DefaultTimeoutStartSec= + DefaultTimeoutStopSec= + DefaultRestartSec= + + Configures the default timeouts for starting + and stopping of units, as well as the default time to sleep + between automatic restarts of units, as configured per-unit in + TimeoutStartSec=, + TimeoutStopSec= and + RestartSec= (for services, see + systemd.service5 + for details on the per-unit settings). For non-service units, + DefaultTimeoutStartSec= sets the default + TimeoutSec= value. + + + + DefaultStartLimitInterval= + DefaultStartLimitBurst= + + Configure the default unit start rate + limiting, as configured per-service by + StartLimitInterval= and + StartLimitBurst=. See + systemd.service5 + for details on the per-service settings. + + + + DefaultEnvironment= + + Sets manager environment variables passed to + all executed processes. Takes a space-separated list of + variable assignments. See + environ7 + for details about environment variables. + + Example: + + DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6" + + Sets three variables + VAR1, + VAR2, + VAR3. + + + + DefaultCPUAccounting= + DefaultBlockIOAccounting= + DefaultMemoryAccounting= + + Configure the default resource accounting + settings, as configured per-unit by + CPUAccounting=, + BlockIOAccounting= and + MemoryAccounting=. See + systemd.resource-control5 + for details on the per-unit settings. + + + + DefaultLimitCPU= + DefaultLimitFSIZE= + DefaultLimitDATA= + DefaultLimitSTACK= + DefaultLimitCORE= + DefaultLimitRSS= + DefaultLimitNOFILE= + DefaultLimitAS= + DefaultLimitNPROC= + DefaultLimitMEMLOCK= + DefaultLimitLOCKS= + DefaultLimitSIGPENDING= + DefaultLimitMSGQUEUE= + DefaultLimitNICE= + DefaultLimitRTPRIO= + DefaultLimitRTTIME= + + These settings control various default + resource limits for units. See + setrlimit2 + for details. Use the string infinity to + configure no limit on a specific resource. These settings may + be overridden in individual units using the corresponding + LimitXXX= directives. Note that these resource limits are only + defaults for units, they are not applied to PID 1 + itself. + + + + + + See Also + + systemd1, + systemd.directives7, + systemd.exec5, + systemd.service5, + environ7, + capabilities7 + + diff --git a/man/systemd-sysusers.8 b/man/systemd-sysusers.8 index 4d1932ecd..ac4b0be04 100644 --- a/man/systemd-sysusers.8 +++ b/man/systemd-sysusers.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SYSUSERS" "8" "" "systemd 218" "systemd-sysusers" +.TH "SYSTEMD\-SYSUSERS" "8" "" "systemd 219" "systemd-sysusers" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-sysusers.html b/man/systemd-sysusers.html index 96aaba908..70f26a23f 100644 --- a/man/systemd-sysusers.html +++ b/man/systemd-sysusers.html @@ -19,27 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sysusers, systemd-sysusers.service — Allocate system users and groups

Synopsis

systemd-sysusers [OPTIONS...] [CONFIGFILE...]

systemd-sysusers.service

Description¶

systemd-sysusers creates - system users and groups, based on the file format and - location specified in - sysusers.d(5). -

If invoked with no arguments, it applies all - directives from all files found. If one or more - filenames are passed on the command line, only the - directives in these files are applied. If only the - basename of a file is specified, all directories as - specified in - sysusers.d(5) - are searched for a matching file. If the string - - is specified as filenames - entries from the standard input of the process are - read.

Options¶

The following options are understood:

--root=root¶

Takes a directory path - as an argument. All paths will be - prefixed with the given alternate root - path, including config search paths. -

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

See Also¶

- systemd(1), - sysusers.d(5) -

+ gudev systemd 219

Name

systemd-sysusers, systemd-sysusers.service — Allocate system users and groups

Synopsis

systemd-sysusers [OPTIONS...] [CONFIGFILE...]

systemd-sysusers.service

Description¶

systemd-sysusers creates system users and + groups, based on the file format and location specified in + sysusers.d(5). +

If invoked with no arguments, it applies all directives from + all files found. If one or more filenames are passed on the + command line, only the directives in these files are applied. If + only the basename of a file is specified, all directories as + specified in + sysusers.d(5) + are searched for a matching file. If the string + - is specified as filenames entries from the + standard input of the process are read.

Options¶

The following options are understood:

--root=root¶

Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

See Also¶

+ systemd(1), + sysusers.d(5) +

diff --git a/man/systemd-sysusers.service.html b/man/systemd-sysusers.service.html index 96aaba908..70f26a23f 100644 --- a/man/systemd-sysusers.service.html +++ b/man/systemd-sysusers.service.html @@ -19,27 +19,23 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sysusers, systemd-sysusers.service — Allocate system users and groups

Synopsis

systemd-sysusers [OPTIONS...] [CONFIGFILE...]

systemd-sysusers.service

Description¶

systemd-sysusers creates - system users and groups, based on the file format and - location specified in - sysusers.d(5). -

If invoked with no arguments, it applies all - directives from all files found. If one or more - filenames are passed on the command line, only the - directives in these files are applied. If only the - basename of a file is specified, all directories as - specified in - sysusers.d(5) - are searched for a matching file. If the string - - is specified as filenames - entries from the standard input of the process are - read.

Options¶

The following options are understood:

--root=root¶

Takes a directory path - as an argument. All paths will be - prefixed with the given alternate root - path, including config search paths. -

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

See Also¶

- systemd(1), - sysusers.d(5) -

+ gudev systemd 219

Name

systemd-sysusers, systemd-sysusers.service — Allocate system users and groups

Synopsis

systemd-sysusers [OPTIONS...] [CONFIGFILE...]

systemd-sysusers.service

Description¶

systemd-sysusers creates system users and + groups, based on the file format and location specified in + sysusers.d(5). +

If invoked with no arguments, it applies all directives from + all files found. If one or more filenames are passed on the + command line, only the directives in these files are applied. If + only the basename of a file is specified, all directories as + specified in + sysusers.d(5) + are searched for a matching file. If the string + - is specified as filenames entries from the + standard input of the process are read.

Options¶

The following options are understood:

--root=root¶

Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure code + otherwise.

See Also¶

+ systemd(1), + sysusers.d(5) +

diff --git a/man/systemd-sysusers.xml b/man/systemd-sysusers.xml index 68710603a..a0c0f996a 100644 --- a/man/systemd-sysusers.xml +++ b/man/systemd-sysusers.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-sysusers - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-sysusers - 8 - - - - systemd-sysusers - systemd-sysusers.service - Allocate system users and groups - - - - - systemd-sysusers - OPTIONS - CONFIGFILE - - - systemd-sysusers.service - - - - Description - - systemd-sysusers creates - system users and groups, based on the file format and - location specified in - sysusers.d5. - - - If invoked with no arguments, it applies all - directives from all files found. If one or more - filenames are passed on the command line, only the - directives in these files are applied. If only the - basename of a file is specified, all directories as - specified in - sysusers.d5 - are searched for a matching file. If the string - - is specified as filenames - entries from the standard input of the process are - read. - - - - Options - - The following options are understood: - - - - - Takes a directory path - as an argument. All paths will be - prefixed with the given alternate root - path, including config search paths. - - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - sysusers.d5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-sysusers + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-sysusers + 8 + + + + systemd-sysusers + systemd-sysusers.service + Allocate system users and groups + + + + + systemd-sysusers + OPTIONS + CONFIGFILE + + + systemd-sysusers.service + + + + Description + + systemd-sysusers creates system users and + groups, based on the file format and location specified in + sysusers.d5. + + + If invoked with no arguments, it applies all directives from + all files found. If one or more filenames are passed on the + command line, only the directives in these files are applied. If + only the basename of a file is specified, all directories as + specified in + sysusers.d5 + are searched for a matching file. If the string + - is specified as filenames entries from the + standard input of the process are read. + + + + Options + + The following options are understood: + + + + + Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + sysusers.d5 + + diff --git a/man/systemd-sysv-generator.8 b/man/systemd-sysv-generator.8 index c659b821b..349e6f337 100644 --- a/man/systemd-sysv-generator.8 +++ b/man/systemd-sysv-generator.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-SYSV\-GENERATOR" "8" "" "systemd 218" "systemd-sysv-generator" +.TH "SYSTEMD\-SYSV\-GENERATOR" "8" "" "systemd 219" "systemd-sysv-generator" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-sysv-generator.html b/man/systemd-sysv-generator.html index 8c3df7f2f..4341bde18 100644 --- a/man/systemd-sysv-generator.html +++ b/man/systemd-sysv-generator.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-sysv-generator — Unit generator for SysV init scripts

Synopsis

/usr/lib/systemd/system-generators/systemd-sysv-generator

Description¶

systemd-sysv-generator is a generator + gudev systemd 219


Name

systemd-sysv-generator — Unit generator for SysV init scripts

Synopsis

/usr/lib/systemd/system-generators/systemd-sysv-generator

Description¶

systemd-sysv-generator is a generator that creates wrapper .service units for SysV init scripts in /etc/init.d/* at boot and when @@ -42,7 +42,7 @@ part of early boot, so all wrapper units are ordered after basic.target.

systemd-sysv-generator implements the generator - specification.

See Also¶

+ specification.

See Also¶

systemd(1), systemd.service(5), systemd.target(5) diff --git a/man/systemd-timedated.html b/man/systemd-timedated.html index ed84caa0d..b6e8dfda2 100644 --- a/man/systemd-timedated.html +++ b/man/systemd-timedated.html @@ -19,20 +19,17 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-timedated.service, systemd-timedated — Time and date bus mechanism

Synopsis

systemd-timedated.service

/usr/lib/systemd/systemd-timedated

Description¶

systemd-timedated is a - system service that may be used as a mechanism to change - the system clock and timezone, as well as to - enable/disable NTP time - synchronization. systemd-timedated - is automatically activated on request and terminates - itself when it is unused.

The tool - timedatectl(1) - is a command line client to this service.

See the - developer documentation for information about - the APIs systemd-timedated - provides.

+ gudev systemd 219

Name

systemd-timedated.service, systemd-timedated — Time and date bus mechanism

Synopsis

systemd-timedated.service

/usr/lib/systemd/systemd-timedated

Description¶

systemd-timedated is a system service + that may be used as a mechanism to change the system clock and + timezone, as well as to enable/disable NTP time synchronization. + systemd-timedated is automatically activated + on request and terminates itself when it is unused.

The tool + timedatectl(1) + is a command line client to this service.

See the + developer documentation for information about the APIs + systemd-timedated provides.

diff --git a/man/systemd-timedated.service.8 b/man/systemd-timedated.service.8 index 02730f9f6..edf9c3836 100644 --- a/man/systemd-timedated.service.8 +++ b/man/systemd-timedated.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-TIMEDATED\&.SERVICE" "8" "" "systemd 218" "systemd-timedated.service" +.TH "SYSTEMD\-TIMEDATED\&.SERVICE" "8" "" "systemd 219" "systemd-timedated.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-timedated.service.html b/man/systemd-timedated.service.html index ed84caa0d..b6e8dfda2 100644 --- a/man/systemd-timedated.service.html +++ b/man/systemd-timedated.service.html @@ -19,20 +19,17 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-timedated.service, systemd-timedated — Time and date bus mechanism

Synopsis

systemd-timedated.service

/usr/lib/systemd/systemd-timedated

Description¶

systemd-timedated is a - system service that may be used as a mechanism to change - the system clock and timezone, as well as to - enable/disable NTP time - synchronization. systemd-timedated - is automatically activated on request and terminates - itself when it is unused.

The tool - timedatectl(1) - is a command line client to this service.

See the - developer documentation for information about - the APIs systemd-timedated - provides.

+ gudev systemd 219

Name

systemd-timedated.service, systemd-timedated — Time and date bus mechanism

Synopsis

systemd-timedated.service

/usr/lib/systemd/systemd-timedated

Description¶

systemd-timedated is a system service + that may be used as a mechanism to change the system clock and + timezone, as well as to enable/disable NTP time synchronization. + systemd-timedated is automatically activated + on request and terminates itself when it is unused.

The tool + timedatectl(1) + is a command line client to this service.

See the + developer documentation for information about the APIs + systemd-timedated provides.

diff --git a/man/systemd-timedated.service.xml b/man/systemd-timedated.service.xml index aee37db46..e44163aef 100644 --- a/man/systemd-timedated.service.xml +++ b/man/systemd-timedated.service.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-tmpfiles - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-tmpfiles - 8 - - - - systemd-tmpfiles - systemd-tmpfiles-setup.service - systemd-tmpfiles-setup-dev.service - systemd-tmpfiles-clean.service - systemd-tmpfiles-clean.timer - Creates, deletes and cleans up volatile - and temporary files and directories - - - - - systemd-tmpfiles - OPTIONS - CONFIGFILE - - - systemd-tmpfiles-setup.service - systemd-tmpfiles-setup-dev.service - systemd-tmpfiles-clean.service - systemd-tmpfiles-clean.timer - - - - Description - - systemd-tmpfiles creates, - deletes, and cleans up volatile and temporary files and - directories, based on the configuration file format and - location specified in - tmpfiles.d5. - - - If invoked with no arguments, it applies all - directives from all configuration files. If one or - more filenames are passed on the command line, only - the directives in these files are applied. If only - the basename of a configuration file is specified, - all configuration directories as specified in - tmpfiles.d5 - are searched for a matching file. - - - - Options - - The following options are understood: - - - - - If this option is - passed, all files and directories - marked with f, - F, - w, - d, - D, - p, - L, - c, - b, - m in the - configuration files are created or - written to. Files and directories - marked with z, - Z, - m have their - ownership, access mode and security - labels set. - - - - - If this option is - passed, all files and directories with - an age parameter configured will be - cleaned up. - - - - - If this option is - passed, all files and directories - marked with r, - R in the - configuration files are - removed. - - - - Also execute lines - with an exclamation mark. - - - - - Only apply rules that - apply to paths with the specified - prefix. This option can be specified - multiple times. - - - - Ignore rules that - apply to paths with the specified - prefix. This option can be specified - multiple times. - - - - Takes a directory path - as an argument. All paths will be - prefixed with the given alternate root - path, including config search paths. - - - - - - - - It is possible to combine - , , - and in one invocation. For - example, during boot the following command line is - executed to ensure that all temporary and volatile - directories are removed and created according to the - configuration file: - - systemd-tmpfiles --remove --create - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - tmpfiles.d5 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-tmpfiles + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-tmpfiles + 8 + + + + systemd-tmpfiles + systemd-tmpfiles-setup.service + systemd-tmpfiles-setup-dev.service + systemd-tmpfiles-clean.service + systemd-tmpfiles-clean.timer + Creates, deletes and cleans up volatile + and temporary files and directories + + + + + systemd-tmpfiles + OPTIONS + CONFIGFILE + + + systemd-tmpfiles-setup.service + systemd-tmpfiles-setup-dev.service + systemd-tmpfiles-clean.service + systemd-tmpfiles-clean.timer + + + + Description + + systemd-tmpfiles creates, deletes, and + cleans up volatile and temporary files and directories, based on + the configuration file format and location specified in + tmpfiles.d5. + + + If invoked with no arguments, it applies all directives from + all configuration files. If one or more filenames are passed on + the command line, only the directives in these files are applied. + If only the basename of a configuration file is specified, all + configuration directories as specified in + tmpfiles.d5 + are searched for a matching file. + + + + Options + + The following options are understood: + + + + + If this option is passed, all files and + directories marked with + f, + F, + w, + d, + D, + v, + p, + L, + c, + b, + m + in the configuration files are created or written to. Files + and directories marked with + z, + Z, + t, + T, + a, and + A have their ownership, access mode and + security labels set. + + + + + If this option is passed, all files and + directories with an age parameter configured will be cleaned + up. + + + + + If this option is passed, the contents of + directories marked with D or + R, and files or directories themselves + marked with r or R are + removed. + + + + Also execute lines with an exclamation mark. + + + + + Only apply rules with paths that start with + the specified prefix. This option can be specified multiple + times. + + + + Ignore rules with paths that start with the + specified prefix. This option can be specified multiple + times. + + + + Takes a directory path as an argument. All + paths will be prefixed with the given alternate + root path, including config search + paths. + + + + + + + It is possible to combine , + , and in one + invocation. For example, during boot the following command line is + executed to ensure that all temporary and volatile directories are + removed and created according to the configuration file: + + systemd-tmpfiles --remove --create + + + + + Unprivileged --cleanup operation + + systemd-tmpfiles tries to avoid changing + the access and modification times on the directories it accesses, + which requires CAP_ADMIN privileges. When + running as non-root, directories which are checked for files to + clean up will have their access time bumped, which might prevent + their cleanup. + + + + + Exit status + + On success, 0 is returned, a non-zero failure code + otherwise. + + + + See Also + + systemd1, + tmpfiles.d5 + + diff --git a/man/systemd-tty-ask-password-agent.1 b/man/systemd-tty-ask-password-agent.1 index 623d35da8..2fbd1102e 100644 --- a/man/systemd-tty-ask-password-agent.1 +++ b/man/systemd-tty-ask-password-agent.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-TTY\-ASK\-PASSWORD\-AGENT" "1" "" "systemd 218" "systemd-tty-ask-password-agent" +.TH "SYSTEMD\-TTY\-ASK\-PASSWORD\-AGENT" "1" "" "systemd 219" "systemd-tty-ask-password-agent" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-tty-ask-password-agent.html b/man/systemd-tty-ask-password-agent.html index 5cbff5229..34dd9ed32 100644 --- a/man/systemd-tty-ask-password-agent.html +++ b/man/systemd-tty-ask-password-agent.html @@ -19,33 +19,29 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-tty-ask-password-agent — List or process pending systemd password requests

Synopsis

systemd-tty-ask-password-agent [OPTIONS...] [VARIABLE=VALUE...]

Description¶

systemd-tty-ask-password-agent - is a password agent that handles password - requests of the system, for example for hard disk - encryption passwords or SSL certificate passwords that - need to be queried at boot-time or during - runtime.

systemd-tty-ask-password-agent - implements the Password - Agents Specification.

Options¶

The following options are understood:

--list¶

Lists all currently pending system password requests.

--query¶

Process all currently - pending system password requests by - querying the user on the calling - TTY.

--watch¶

Continuously process - password requests.

--wall¶

Forward password - requests to - wall(1) - instead of querying the user on the - calling TTY.

--plymouth¶

Ask question with - plymouth(8) - instead of querying the user on the - calling TTY.

--console¶

Ask question on - /dev/console - instead of querying the user on the - calling TTY.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

+ gudev systemd 219

Name

systemd-tty-ask-password-agent — List or process pending systemd password requests

Synopsis

systemd-tty-ask-password-agent [OPTIONS...] [VARIABLE=VALUE...]

Description¶

systemd-tty-ask-password-agent is a + password agent that handles password requests of the system, for + example for hard disk encryption passwords or SSL certificate + passwords that need to be queried at boot-time or during + runtime.

systemd-tty-ask-password-agent implements + the Password + Agents Specification.

Options¶

The following options are understood:

--list¶

Lists all currently pending system password requests.

--query¶

Process all currently pending system password + requests by querying the user on the calling + TTY.

--watch¶

Continuously process password + requests.

--wall¶

Forward password requests to + wall(1) + instead of querying the user on the calling + TTY.

--plymouth¶

Ask question with + plymouth(8) + instead of querying the user on the calling + TTY.

--console¶

Ask question on + /dev/console instead of querying the user + on the calling TTY.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

diff --git a/man/systemd-tty-ask-password-agent.xml b/man/systemd-tty-ask-password-agent.xml index 53bd3aa84..2876fab64 100644 --- a/man/systemd-tty-ask-password-agent.xml +++ b/man/systemd-tty-ask-password-agent.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd-tty-ask-password-agent - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-tty-ask-password-agent - 1 - - - - systemd-tty-ask-password-agent - List or process pending systemd password requests - - - - - systemd-tty-ask-password-agent OPTIONS VARIABLE=VALUE - - - - - Description - - systemd-tty-ask-password-agent - is a password agent that handles password - requests of the system, for example for hard disk - encryption passwords or SSL certificate passwords that - need to be queried at boot-time or during - runtime. - - systemd-tty-ask-password-agent - implements the Password - Agents Specification. - - - - - Options - - The following options are understood: - - - - - - Lists all currently pending system password requests. - - - - - - Process all currently - pending system password requests by - querying the user on the calling - TTY. - - - - - - Continuously process - password requests. - - - - - - Forward password - requests to - wall1 - instead of querying the user on the - calling TTY. - - - - - - Ask question with - plymouth8 - instead of querying the user on the - calling TTY. - - - - - - Ask question on - /dev/console - instead of querying the user on the - calling TTY. - - - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - systemd-ask-password-console.service8, - wall1, - plymouth8 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd-tty-ask-password-agent + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-tty-ask-password-agent + 1 + + + + systemd-tty-ask-password-agent + List or process pending systemd password requests + + + + + systemd-tty-ask-password-agent OPTIONS VARIABLE=VALUE + + + + + Description + + systemd-tty-ask-password-agent is a + password agent that handles password requests of the system, for + example for hard disk encryption passwords or SSL certificate + passwords that need to be queried at boot-time or during + runtime. + + systemd-tty-ask-password-agent implements + the Password + Agents Specification. + + + + + Options + + The following options are understood: + + + + + + Lists all currently pending system password requests. + + + + + + Process all currently pending system password + requests by querying the user on the calling + TTY. + + + + + + Continuously process password + requests. + + + + + + Forward password requests to + wall1 + instead of querying the user on the calling + TTY. + + + + + + Ask question with + plymouth8 + instead of querying the user on the calling + TTY. + + + + + + Ask question on + /dev/console instead of querying the user + on the calling TTY. + + + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure + code otherwise. + + + + See Also + + systemd1, + systemctl1, + systemd-ask-password-console.service8, + wall1, + plymouth8 + + diff --git a/man/systemd-udevd-control.socket.html b/man/systemd-udevd-control.socket.html index c406b7995..563e3a3f3 100644 --- a/man/systemd-udevd-control.socket.html +++ b/man/systemd-udevd-control.socket.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. + gudev systemd 219


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. For every event, systemd-udevd executes matching instructions specified in udev rules. See udev(7).

The behavior of the daemon can be configured using udev.conf(5), its command line options, environment variables, and on the kernel command line, or changed dynamically with udevadm control. -

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN +

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel @@ -37,14 +37,14 @@ late, names will be resolved for every event. When set to never, names will never be resolved and all devices will be owned by root.

--help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when +

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when systemd-udevd is used in an initrd.

udev.log-priority=, rd.udev.log-priority=¶

Set the log level.

udev.children-max=, rd.udev.children-max=¶

Limit the number of events executed in parallel.

udev.exec-delay=, rd.udev.exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel modules.

udev.event-timeout=, rd.udev.event-timeout=¶

Wait for events to finish up to the given number of seconds. This option might be useful if events are terminated due to kernel drivers taking too long to initialize.

net.ifnames=¶

Network interfaces are renamed to give them predictable names - when possible. It is enabled by default; specifying 0 disables it.

See Also¶

+ when possible. It is enabled by default; specifying 0 disables it.

See Also¶

udev.conf(5), udev(7), udevadm(8) diff --git a/man/systemd-udevd-kernel.socket.html b/man/systemd-udevd-kernel.socket.html index c406b7995..563e3a3f3 100644 --- a/man/systemd-udevd-kernel.socket.html +++ b/man/systemd-udevd-kernel.socket.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. + gudev systemd 219


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. For every event, systemd-udevd executes matching instructions specified in udev rules. See udev(7).

The behavior of the daemon can be configured using udev.conf(5), its command line options, environment variables, and on the kernel command line, or changed dynamically with udevadm control. -

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN +

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel @@ -37,14 +37,14 @@ late, names will be resolved for every event. When set to never, names will never be resolved and all devices will be owned by root.

--help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when +

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when systemd-udevd is used in an initrd.

udev.log-priority=, rd.udev.log-priority=¶

Set the log level.

udev.children-max=, rd.udev.children-max=¶

Limit the number of events executed in parallel.

udev.exec-delay=, rd.udev.exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel modules.

udev.event-timeout=, rd.udev.event-timeout=¶

Wait for events to finish up to the given number of seconds. This option might be useful if events are terminated due to kernel drivers taking too long to initialize.

net.ifnames=¶

Network interfaces are renamed to give them predictable names - when possible. It is enabled by default; specifying 0 disables it.

See Also¶

+ when possible. It is enabled by default; specifying 0 disables it.

See Also¶

udev.conf(5), udev(7), udevadm(8) diff --git a/man/systemd-udevd.html b/man/systemd-udevd.html index c406b7995..563e3a3f3 100644 --- a/man/systemd-udevd.html +++ b/man/systemd-udevd.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. + gudev systemd 219


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. For every event, systemd-udevd executes matching instructions specified in udev rules. See udev(7).

The behavior of the daemon can be configured using udev.conf(5), its command line options, environment variables, and on the kernel command line, or changed dynamically with udevadm control. -

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN +

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel @@ -37,14 +37,14 @@ late, names will be resolved for every event. When set to never, names will never be resolved and all devices will be owned by root.

--help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when +

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when systemd-udevd is used in an initrd.

udev.log-priority=, rd.udev.log-priority=¶

Set the log level.

udev.children-max=, rd.udev.children-max=¶

Limit the number of events executed in parallel.

udev.exec-delay=, rd.udev.exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel modules.

udev.event-timeout=, rd.udev.event-timeout=¶

Wait for events to finish up to the given number of seconds. This option might be useful if events are terminated due to kernel drivers taking too long to initialize.

net.ifnames=¶

Network interfaces are renamed to give them predictable names - when possible. It is enabled by default; specifying 0 disables it.

See Also¶

+ when possible. It is enabled by default; specifying 0 disables it.

See Also¶

udev.conf(5), udev(7), udevadm(8) diff --git a/man/systemd-udevd.service.8 b/man/systemd-udevd.service.8 index d2feb9ef7..e9af9efb7 100644 --- a/man/systemd-udevd.service.8 +++ b/man/systemd-udevd.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-UDEVD\&.SERVICE" "8" "" "systemd 218" "systemd-udevd.service" +.TH "SYSTEMD\-UDEVD\&.SERVICE" "8" "" "systemd 219" "systemd-udevd.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-udevd.service.html b/man/systemd-udevd.service.html index c406b7995..563e3a3f3 100644 --- a/man/systemd-udevd.service.html +++ b/man/systemd-udevd.service.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. + gudev systemd 219


Name

systemd-udevd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd — Device event managing daemon

Synopsis

systemd-udevd.service

systemd-udevd-control.socket

systemd-udevd-kernel.socket

/usr/lib/systemd/systemd-udevd [--daemon] [--debug] [--children-max=] [--exec-delay=] [--event-timeout=] [--resolve-names=early|late|never] [--version] [--help]

Description¶

systemd-udevd listens to kernel uevents. For every event, systemd-udevd executes matching instructions specified in udev rules. See udev(7).

The behavior of the daemon can be configured using udev.conf(5), its command line options, environment variables, and on the kernel command line, or changed dynamically with udevadm control. -

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN +

Options¶

--daemon¶

Detach and run in the background.

--debug¶

Print debug messages to standard error.

--children-max=¶

Limit the number of events executed in parallel.

--exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel @@ -37,14 +37,14 @@ late, names will be resolved for every event. When set to never, names will never be resolved and all devices will be owned by root.

--help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when +

--version¶

Print a short version string and exit.

Kernel command line¶

Parameters starting with "rd." will be read when systemd-udevd is used in an initrd.

udev.log-priority=, rd.udev.log-priority=¶

Set the log level.

udev.children-max=, rd.udev.children-max=¶

Limit the number of events executed in parallel.

udev.exec-delay=, rd.udev.exec-delay=¶

Delay the execution of RUN instructions by the given number of seconds. This option might be useful when debugging system crashes during coldplug caused by loading non-working kernel modules.

udev.event-timeout=, rd.udev.event-timeout=¶

Wait for events to finish up to the given number of seconds. This option might be useful if events are terminated due to kernel drivers taking too long to initialize.

net.ifnames=¶

Network interfaces are renamed to give them predictable names - when possible. It is enabled by default; specifying 0 disables it.

See Also¶

+ when possible. It is enabled by default; specifying 0 disables it.

See Also¶

udev.conf(5), udev(7), udevadm(8) diff --git a/man/systemd-udevd.service.xml b/man/systemd-udevd.service.xml index f467cd217..b18b22871 100644 --- a/man/systemd-udevd.service.xml +++ b/man/systemd-udevd.service.xml @@ -1,5 +1,4 @@ - diff --git a/man/systemd-update-done.html b/man/systemd-update-done.html index 825e32981..9281b29b5 100644 --- a/man/systemd-update-done.html +++ b/man/systemd-update-done.html @@ -19,35 +19,31 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd-update-done.service, systemd-update-done — Mark /etc and /var fully updated

Synopsis

systemd-update-done.service

/usr/lib/systemd/systemd-update-done

Description¶

systemd-update-done.service - is a service that is invoked as part of the first boot - after the vendor operating system resources in - /usr have been updated. This is - useful to implement offline updates of - /usr which might requires updates - to /etc or - /var on the following boot.

systemd-update-done.service - updates the file modification time (mtime) of the - stamp files /etc/.updated and - /var/.updated to the modification - time of the /usr directory, - unless the stamp files are already newer.

Services that shall run after offline upgrades - of /usr should order themselves - before - systemd-update-done.service, and - use the ConditionNeedsUpdate= (see - systemd.unit(5)) - condition to make sure to run when - /etc or /var - are older than /usr according to - the modification times of the files described - above. This requires that updates to - /usr are always followed by an - update of the modification time of - /usr, for example by invoking - touch(1) - on it.

+ gudev systemd 219

Name

systemd-update-done.service, systemd-update-done — Mark /etc and /var fully updated

Synopsis

systemd-update-done.service

/usr/lib/systemd/systemd-update-done

Description¶

systemd-update-done.service is a + service that is invoked as part of the first boot after the vendor + operating system resources in /usr have been + updated. This is useful to implement offline updates of + /usr which might requires updates to + /etc or /var on the + following boot.

systemd-update-done.service updates the + file modification time (mtime) of the stamp files + /etc/.updated and + /var/.updated to the modification time of the + /usr directory, unless the stamp files are + already newer.

Services that shall run after offline upgrades of + /usr should order themselves before + systemd-update-done.service, and use the + ConditionNeedsUpdate= (see + systemd.unit(5)) + condition to make sure to run when /etc or + /var are older than /usr + according to the modification times of the files described above. + This requires that updates to /usr are always + followed by an update of the modification time of + /usr, for example by invoking + touch(1) + on it.

diff --git a/man/systemd-update-done.service.8 b/man/systemd-update-done.service.8 index a100d164c..61c3b6cf8 100644 --- a/man/systemd-update-done.service.8 +++ b/man/systemd-update-done.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-UPDATE\-DONE\&.SERVICE" "8" "" "systemd 218" "systemd-update-done.service" +.TH "SYSTEMD\-UPDATE\-DONE\&.SERVICE" "8" "" "systemd 219" "systemd-update-done.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-update-done.service.html b/man/systemd-update-done.service.html index 825e32981..9281b29b5 100644 --- a/man/systemd-update-done.service.html +++ b/man/systemd-update-done.service.html @@ -19,35 +19,31 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-update-done.service, systemd-update-done — Mark /etc and /var fully updated

Synopsis

systemd-update-done.service

/usr/lib/systemd/systemd-update-done

Description¶

systemd-update-done.service - is a service that is invoked as part of the first boot - after the vendor operating system resources in - /usr have been updated. This is - useful to implement offline updates of - /usr which might requires updates - to /etc or - /var on the following boot.

systemd-update-done.service - updates the file modification time (mtime) of the - stamp files /etc/.updated and - /var/.updated to the modification - time of the /usr directory, - unless the stamp files are already newer.

Services that shall run after offline upgrades - of /usr should order themselves - before - systemd-update-done.service, and - use the ConditionNeedsUpdate= (see - systemd.unit(5)) - condition to make sure to run when - /etc or /var - are older than /usr according to - the modification times of the files described - above. This requires that updates to - /usr are always followed by an - update of the modification time of - /usr, for example by invoking - touch(1) - on it.

+ gudev systemd 219

Name

systemd-update-done.service, systemd-update-done — Mark /etc and /var fully updated

Synopsis

systemd-update-done.service

/usr/lib/systemd/systemd-update-done

Description¶

systemd-update-done.service is a + service that is invoked as part of the first boot after the vendor + operating system resources in /usr have been + updated. This is useful to implement offline updates of + /usr which might requires updates to + /etc or /var on the + following boot.

systemd-update-done.service updates the + file modification time (mtime) of the stamp files + /etc/.updated and + /var/.updated to the modification time of the + /usr directory, unless the stamp files are + already newer.

Services that shall run after offline upgrades of + /usr should order themselves before + systemd-update-done.service, and use the + ConditionNeedsUpdate= (see + systemd.unit(5)) + condition to make sure to run when /etc or + /var are older than /usr + according to the modification times of the files described above. + This requires that updates to /usr are always + followed by an update of the modification time of + /usr, for example by invoking + touch(1) + on it.

diff --git a/man/systemd-update-done.service.xml b/man/systemd-update-done.service.xml index c3b402b60..d65f17541 100644 --- a/man/systemd-update-done.service.xml +++ b/man/systemd-update-done.service.xml @@ -21,81 +21,77 @@ --> - - systemd-update-done.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-update-done.service - 8 - - - - systemd-update-done.service - systemd-update-done - Mark /etc and /var fully updated - - - - systemd-update-done.service - /usr/lib/systemd/systemd-update-done - - - - Description - - systemd-update-done.service - is a service that is invoked as part of the first boot - after the vendor operating system resources in - /usr have been updated. This is - useful to implement offline updates of - /usr which might requires updates - to /etc or - /var on the following boot. - - systemd-update-done.service - updates the file modification time (mtime) of the - stamp files /etc/.updated and - /var/.updated to the modification - time of the /usr directory, - unless the stamp files are already newer. - - Services that shall run after offline upgrades - of /usr should order themselves - before - systemd-update-done.service, and - use the ConditionNeedsUpdate= (see - systemd.unit5) - condition to make sure to run when - /etc or /var - are older than /usr according to - the modification times of the files described - above. This requires that updates to - /usr are always followed by an - update of the modification time of - /usr, for example by invoking - touch1 - on it. - - - - - See Also - - systemd1, - systemd.unit5, - touch1 - - + + systemd-update-done.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-update-done.service + 8 + + + + systemd-update-done.service + systemd-update-done + Mark /etc and /var fully updated + + + + systemd-update-done.service + /usr/lib/systemd/systemd-update-done + + + + Description + + systemd-update-done.service is a + service that is invoked as part of the first boot after the vendor + operating system resources in /usr have been + updated. This is useful to implement offline updates of + /usr which might requires updates to + /etc or /var on the + following boot. + + systemd-update-done.service updates the + file modification time (mtime) of the stamp files + /etc/.updated and + /var/.updated to the modification time of the + /usr directory, unless the stamp files are + already newer. + + Services that shall run after offline upgrades of + /usr should order themselves before + systemd-update-done.service, and use the + ConditionNeedsUpdate= (see + systemd.unit5) + condition to make sure to run when /etc or + /var are older than /usr + according to the modification times of the files described above. + This requires that updates to /usr are always + followed by an update of the modification time of + /usr, for example by invoking + touch1 + on it. + + + + + See Also + + systemd1, + systemd.unit5, + touch1 + + diff --git a/man/systemd-update-utmp-runlevel.service.html b/man/systemd-update-utmp-runlevel.service.html index c6b7fac45..f14782f12 100644 --- a/man/systemd-update-utmp-runlevel.service.html +++ b/man/systemd-update-utmp-runlevel.service.html @@ -19,13 +19,13 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel - changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service - is a service that writes SysV runlevel changes to utmp - and wtmp, as well as the audit logs, as they - occur. systemd-update-utmp.service - does the same for system reboots and shutdown requests.

See Also¶

- systemd(1), - utmp(5), - auditd(8) -

+ gudev systemd 219

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel + changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service is + a service that writes SysV runlevel changes to utmp and wtmp, as + well as the audit logs, as they occur. + systemd-update-utmp.service does the same for + system reboots and shutdown requests.

See Also¶

+ systemd(1), + utmp(5), + auditd(8) +

diff --git a/man/systemd-update-utmp.html b/man/systemd-update-utmp.html index c6b7fac45..f14782f12 100644 --- a/man/systemd-update-utmp.html +++ b/man/systemd-update-utmp.html @@ -19,13 +19,13 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel - changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service - is a service that writes SysV runlevel changes to utmp - and wtmp, as well as the audit logs, as they - occur. systemd-update-utmp.service - does the same for system reboots and shutdown requests.

See Also¶

- systemd(1), - utmp(5), - auditd(8) -

+ gudev systemd 219

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel + changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service is + a service that writes SysV runlevel changes to utmp and wtmp, as + well as the audit logs, as they occur. + systemd-update-utmp.service does the same for + system reboots and shutdown requests.

See Also¶

+ systemd(1), + utmp(5), + auditd(8) +

diff --git a/man/systemd-update-utmp.service.8 b/man/systemd-update-utmp.service.8 index ae347b394..eeacd0cbd 100644 --- a/man/systemd-update-utmp.service.8 +++ b/man/systemd-update-utmp.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-UPDATE\-UTMP\&.SERVICE" "8" "" "systemd 218" "systemd-update-utmp.service" +.TH "SYSTEMD\-UPDATE\-UTMP\&.SERVICE" "8" "" "systemd 219" "systemd-update-utmp.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-update-utmp.service.html b/man/systemd-update-utmp.service.html index c6b7fac45..f14782f12 100644 --- a/man/systemd-update-utmp.service.html +++ b/man/systemd-update-utmp.service.html @@ -19,13 +19,13 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel - changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service - is a service that writes SysV runlevel changes to utmp - and wtmp, as well as the audit logs, as they - occur. systemd-update-utmp.service - does the same for system reboots and shutdown requests.

See Also¶

- systemd(1), - utmp(5), - auditd(8) -

+ gudev systemd 219

Name

systemd-update-utmp.service, systemd-update-utmp-runlevel.service, systemd-update-utmp — Write audit and utmp updates at bootup, runlevel + changes and shutdown

Synopsis

systemd-update-utmp.service

systemd-update-utmp-runlevel.service

/usr/lib/systemd/systemd-update-utmp

Description¶

systemd-update-utmp-runlevel.service is + a service that writes SysV runlevel changes to utmp and wtmp, as + well as the audit logs, as they occur. + systemd-update-utmp.service does the same for + system reboots and shutdown requests.

See Also¶

+ systemd(1), + utmp(5), + auditd(8) +

diff --git a/man/systemd-update-utmp.service.xml b/man/systemd-update-utmp.service.xml index caa1d8f56..b842d2972 100644 --- a/man/systemd-update-utmp.service.xml +++ b/man/systemd-update-utmp.service.xml @@ -21,56 +21,56 @@ --> - - systemd-update-utmp.service - systemd + + systemd-update-utmp.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-update-utmp.service - 8 - + + systemd-update-utmp.service + 8 + - - systemd-update-utmp.service - systemd-update-utmp-runlevel.service - systemd-update-utmp - Write audit and utmp updates at bootup, runlevel - changes and shutdown - + + systemd-update-utmp.service + systemd-update-utmp-runlevel.service + systemd-update-utmp + Write audit and utmp updates at bootup, runlevel + changes and shutdown + - - systemd-update-utmp.service - systemd-update-utmp-runlevel.service - /usr/lib/systemd/systemd-update-utmp - + + systemd-update-utmp.service + systemd-update-utmp-runlevel.service + /usr/lib/systemd/systemd-update-utmp + - - Description + + Description - systemd-update-utmp-runlevel.service - is a service that writes SysV runlevel changes to utmp - and wtmp, as well as the audit logs, as they - occur. systemd-update-utmp.service - does the same for system reboots and shutdown requests. - + systemd-update-utmp-runlevel.service is + a service that writes SysV runlevel changes to utmp and wtmp, as + well as the audit logs, as they occur. + systemd-update-utmp.service does the same for + system reboots and shutdown requests. + - - See Also - - systemd1, - utmp5, - auditd8 - - + + See Also + + systemd1, + utmp5, + auditd8 + + diff --git a/man/systemd-user-sessions.html b/man/systemd-user-sessions.html index 5ea679078..df94927fd 100644 --- a/man/systemd-user-sessions.html +++ b/man/systemd-user-sessions.html @@ -19,16 +19,15 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-user-sessions.service, systemd-user-sessions — Permit user logins after boot, prohibit user logins at shutdown

Synopsis

systemd-user-sessions.service

/usr/lib/systemd/systemd-user-sessions

Description¶

systemd-user-sessions.service - is a service that controls user logins. After basic - system initialization is complete it removes - /run/nologin, thus permitting - logins. Before system shutdown it creates - /run/nologin, thus prohibiting - further logins. At the same time it also kills all - user processes, so that system shutdown may proceed - without any remaining user processes around.

+ gudev systemd 219

Name

systemd-user-sessions.service, systemd-user-sessions — Permit user logins after boot, prohibit user logins at shutdown

Synopsis

systemd-user-sessions.service

/usr/lib/systemd/systemd-user-sessions

Description¶

systemd-user-sessions.service is a + service that controls user logins. After basic system + initialization is complete it removes + /run/nologin, thus permitting logins. Before + system shutdown it creates /run/nologin, thus + prohibiting further logins. At the same time it also kills all + user processes, so that system shutdown may proceed without any + remaining user processes around.

diff --git a/man/systemd-user-sessions.service.8 b/man/systemd-user-sessions.service.8 index 089514ce1..96ca14271 100644 --- a/man/systemd-user-sessions.service.8 +++ b/man/systemd-user-sessions.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-USER\-SESSIONS\&.SERVICE" "8" "" "systemd 218" "systemd-user-sessions.service" +.TH "SYSTEMD\-USER\-SESSIONS\&.SERVICE" "8" "" "systemd 219" "systemd-user-sessions.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-user-sessions.service.html b/man/systemd-user-sessions.service.html index 5ea679078..df94927fd 100644 --- a/man/systemd-user-sessions.service.html +++ b/man/systemd-user-sessions.service.html @@ -19,16 +19,15 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-user-sessions.service, systemd-user-sessions — Permit user logins after boot, prohibit user logins at shutdown

Synopsis

systemd-user-sessions.service

/usr/lib/systemd/systemd-user-sessions

Description¶

systemd-user-sessions.service - is a service that controls user logins. After basic - system initialization is complete it removes - /run/nologin, thus permitting - logins. Before system shutdown it creates - /run/nologin, thus prohibiting - further logins. At the same time it also kills all - user processes, so that system shutdown may proceed - without any remaining user processes around.

+ gudev systemd 219

Name

systemd-user-sessions.service, systemd-user-sessions — Permit user logins after boot, prohibit user logins at shutdown

Synopsis

systemd-user-sessions.service

/usr/lib/systemd/systemd-user-sessions

Description¶

systemd-user-sessions.service is a + service that controls user logins. After basic system + initialization is complete it removes + /run/nologin, thus permitting logins. Before + system shutdown it creates /run/nologin, thus + prohibiting further logins. At the same time it also kills all + user processes, so that system shutdown may proceed without any + remaining user processes around.

diff --git a/man/systemd-user-sessions.service.xml b/man/systemd-user-sessions.service.xml index 767cbc714..9d796b1ae 100644 --- a/man/systemd-user-sessions.service.xml +++ b/man/systemd-user-sessions.service.xml @@ -21,57 +21,56 @@ --> - - systemd-user-sessions.service - systemd + + systemd-user-sessions.service + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd-user-sessions.service - 8 - + + systemd-user-sessions.service + 8 + - - systemd-user-sessions.service - systemd-user-sessions - Permit user logins after boot, prohibit user logins at shutdown - + + systemd-user-sessions.service + systemd-user-sessions + Permit user logins after boot, prohibit user logins at shutdown + - - systemd-user-sessions.service - /usr/lib/systemd/systemd-user-sessions - + + systemd-user-sessions.service + /usr/lib/systemd/systemd-user-sessions + - - Description + + Description - systemd-user-sessions.service - is a service that controls user logins. After basic - system initialization is complete it removes - /run/nologin, thus permitting - logins. Before system shutdown it creates - /run/nologin, thus prohibiting - further logins. At the same time it also kills all - user processes, so that system shutdown may proceed - without any remaining user processes around. - + systemd-user-sessions.service is a + service that controls user logins. After basic system + initialization is complete it removes + /run/nologin, thus permitting logins. Before + system shutdown it creates /run/nologin, thus + prohibiting further logins. At the same time it also kills all + user processes, so that system shutdown may proceed without any + remaining user processes around. + - - See Also - - systemd1, - systemd-logind.service8, - pam_nologin8 - - + + See Also + + systemd1, + systemd-logind.service8, + pam_nologin8 + + diff --git a/man/systemd-user.conf.html b/man/systemd-user.conf.html index ef0fc2a36..45b790689 100644 --- a/man/systemd-user.conf.html +++ b/man/systemd-user.conf.html @@ -19,14 +19,14 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. These - configuration files contain a few settings controlling - basic manager operations.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files

Synopsis

/etc/systemd/system.conf

/etc/systemd/system.conf.d/*.conf

/run/systemd/system.conf.d/*.conf

/usr/lib/systemd/system.conf.d/*.conf

/etc/systemd/user.conf

/etc/systemd/user.conf.d/*.conf

/run/systemd/user.conf.d/*.conf

/usr/lib/systemd/user.conf.d/*.conf

Description¶

When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. These configuration + files contain a few settings controlling basic manager + operations.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -50,240 +50,153 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

All options are configured in the - "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various - parameters of basic manager - operation. These options may be - overridden by the respective command - line arguments. See - systemd(1) - for details about these command line - arguments.

CPUAffinity=¶

Configures the initial - CPU affinity for the init - process. Takes a space-separated list - of CPU indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers - that shall be mounted in a single - hierarchy. By default, systemd will - mount all controllers which are - enabled in the kernel in individual - hierarchies, with the exception of - those listed in this setting. Takes a - space-separated list of comma-separated - controller names, in order - to allow multiple joined - hierarchies. Defaults to - 'cpu,cpuacct'. Pass an empty string to - ensure that systemd mounts all - controllers in separate - hierarchies.

Note that this option is only - applied once, at very early boot. If - you use an initial RAM disk (initrd) - that uses systemd, it might hence be - necessary to rebuild the initrd if - this option is changed, and make sure - the new configuration file is included - in it. Otherwise, the initrd might - mount the controller hierarchies in a - different configuration than intended, - and the main system cannot remount - them anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware - watchdog at runtime and at - reboot. Takes a timeout value in - seconds (or in other time units if - suffixed with "ms", - "min", - "h", - "d", - "w"). If - RuntimeWatchdogSec= - is set to a non-zero value, the - watchdog hardware - (/dev/watchdog) - will be programmed to automatically - reboot the system if it is not - contacted within the specified timeout - interval. The system manager will - ensure to contact it at least once in - half the specified timeout - interval. This feature requires a - hardware watchdog device to be - present, as it is commonly the case in - embedded and server systems. Not all - hardware watchdogs allow configuration - of the reboot timeout, in which case - the closest available timeout is - picked. ShutdownWatchdogSec= - may be used to configure the hardware - watchdog when the system is asked to - reboot. It works as a safety net to - ensure that the reboot takes place - even if a clean reboot attempt times - out. By default - RuntimeWatchdogSec= - defaults to 0 (off), and - ShutdownWatchdogSec= - to 10min. These settings have no - effect if a hardware watchdog is not - available.

CapabilityBoundingSet=¶

Controls which - capabilities to include in the - capability bounding set for PID 1 and - its children. See - capabilities(7) - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name(3). - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, all but the listed - capabilities will be included, the - effect of the assignment - inverted. Note that this option also - affects the respective capabilities in - the effective, permitted and - inheritable capability sets. The - capability bounding set may also be - individually configured for units - using the - CapabilityBoundingSet= - directive for units, but note that - capabilities dropped for PID 1 cannot - be regained in individual units, they - are lost for good.

SystemCallArchitectures=¶

Takes a - space-separated list of architecture - identifiers. Selects from which - architectures system calls may be - invoked on this system. This may be - used as an effective way to disable - invocation of non-native binaries - system-wide, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. This option - operates system-wide, and acts - similar to the - SystemCallArchitectures= - setting of unit files, see - systemd.exec(5) - for details. This setting defaults to - the empty list, in which case no - filtering of system calls based on - architecture is applied. Known - architecture identifiers are - "x86", - "x86-64", - "x32", - "arm" and the special - identifier - "native". The latter - implicitly maps to the native - architecture of the system (or more - specifically, the architecture the - system manager was compiled for). Set - this setting to - "native" to prohibit - execution of any non-native - binaries. When a binary executes a - system call of an architecture that is - not listed in this setting, it will be - immediately terminated with the SIGSYS - signal.

TimerSlackNSec=¶

Sets the timer slack - in nanoseconds for PID 1, which is - inherited by all executed processes, - unless overridden individually, for - example with the - TimerSlackNSec= - setting in service units (for details - see - systemd.exec(5)). The - timer slack controls the accuracy of - wake-ups triggered by system - timers. See - prctl(2) - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too.

DefaultTimerAccuracySec=¶

Sets the default - accuracy of timer units. This controls - the global default for the - AccuracySec= - setting of timer units, see - systemd.timer(5) - for - details. AccuracySec= - set in individual units override the - global default for the specific - unit. Defaults to 1min. Note that the - accuracy of timer units is also - affected by the configured timer slack - for PID 1, see - TimerSlackNSec= - above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default - timeouts for starting and stopping of - units, as well as the default time to - sleep between automatic restarts of - units, as configured per-unit in - TimeoutStartSec=, - TimeoutStopSec= and - RestartSec= (for - services, see - systemd.service(5) - for details on the per-unit - settings). For non-service units, - DefaultTimeoutStartSec= - sets the default - TimeoutSec= value. -

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default - unit start rate limiting, as - configured per-service by - StartLimitInterval= - and - StartLimitBurst=. See - systemd.service(5) - for details on the per-service - settings.

DefaultEnvironment=¶

Sets manager - environment variables passed to all - executed processes. Takes a - space-separated list of variable - assignments. See - environ(7) - for details about environment - variables.

Example: + file.

Options¶

All options are configured in the + "[Manager]" section:

LogLevel=, LogTarget=, LogColor=, LogLocation=, DumpCore=yes, CrashShell=no, ShowStatus=yes, CrashChVT=1, DefaultStandardOutput=journal, DefaultStandardError=inherit¶

Configures various parameters of basic manager + operation. These options may be overridden by the respective + command line arguments. See + systemd(1) + for details about these command line + arguments.

CPUAffinity=¶

Configures the initial CPU affinity for the + init process. Takes a space-separated list of CPU + indices.

JoinControllers=cpu,cpuacct net_cls,netprio¶

Configures controllers that shall be mounted + in a single hierarchy. By default, systemd will mount all + controllers which are enabled in the kernel in individual + hierarchies, with the exception of those listed in this + setting. Takes a space-separated list of comma-separated + controller names, in order to allow multiple joined + hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string + to ensure that systemd mounts all controllers in separate + hierarchies.

Note that this option is only applied once, at very + early boot. If you use an initial RAM disk (initrd) that uses + systemd, it might hence be necessary to rebuild the initrd if + this option is changed, and make sure the new configuration + file is included in it. Otherwise, the initrd might mount the + controller hierarchies in a different configuration than + intended, and the main system cannot remount them + anymore.

RuntimeWatchdogSec=, ShutdownWatchdogSec=¶

Configure the hardware watchdog at runtime and + at reboot. Takes a timeout value in seconds (or in other time + units if suffixed with "ms", + "min", "h", + "d", "w"). If + RuntimeWatchdogSec= is set to a non-zero + value, the watchdog hardware + (/dev/watchdog) will be programmed to + automatically reboot the system if it is not contacted within + the specified timeout interval. The system manager will ensure + to contact it at least once in half the specified timeout + interval. This feature requires a hardware watchdog device to + be present, as it is commonly the case in embedded and server + systems. Not all hardware watchdogs allow configuration of the + reboot timeout, in which case the closest available timeout is + picked. ShutdownWatchdogSec= may be used to + configure the hardware watchdog when the system is asked to + reboot. It works as a safety net to ensure that the reboot + takes place even if a clean reboot attempt times out. By + default RuntimeWatchdogSec= defaults to 0 + (off), and ShutdownWatchdogSec= to 10min. + These settings have no effect if a hardware watchdog is not + available.

CapabilityBoundingSet=¶

Controls which capabilities to include in the + capability bounding set for PID 1 and its children. See + capabilities(7) + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name(3). + Capabilities listed will be included in the bounding set, all + others are removed. If the list of capabilities is prefixed + with ~, all but the listed capabilities will be included, the + effect of the assignment inverted. Note that this option also + affects the respective capabilities in the effective, + permitted and inheritable capability sets. The capability + bounding set may also be individually configured for units + using the CapabilityBoundingSet= directive + for units, but note that capabilities dropped for PID 1 cannot + be regained in individual units, they are lost for + good.

SystemCallArchitectures=¶

Takes a space-separated list of architecture + identifiers. Selects from which architectures system calls may + be invoked on this system. This may be used as an effective + way to disable invocation of non-native binaries system-wide, + for example to prohibit execution of 32-bit x86 binaries on + 64-bit x86-64 systems. This option operates system-wide, and + acts similar to the + SystemCallArchitectures= setting of unit + files, see + systemd.exec(5) + for details. This setting defaults to the empty list, in which + case no filtering of system calls based on architecture is + applied. Known architecture identifiers are + "x86", "x86-64", + "x32", "arm" and the special + identifier "native". The latter implicitly + maps to the native architecture of the system (or more + specifically, the architecture the system manager was compiled + for). Set this setting to "native" to + prohibit execution of any non-native binaries. When a binary + executes a system call of an architecture that is not listed + in this setting, it will be immediately terminated with the + SIGSYS signal.

TimerSlackNSec=¶

Sets the timer slack in nanoseconds for PID 1, + which is inherited by all executed processes, unless + overridden individually, for example with the + TimerSlackNSec= setting in service units + (for details see + systemd.exec(5)). + The timer slack controls the accuracy of wake-ups triggered by + system timers. See + prctl(2) + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too.

DefaultTimerAccuracySec=¶

Sets the default accuracy of timer units. This + controls the global default for the + AccuracySec= setting of timer units, see + systemd.timer(5) + for details. AccuracySec= set in individual + units override the global default for the specific unit. + Defaults to 1min. Note that the accuracy of timer units is + also affected by the configured timer slack for PID 1, see + TimerSlackNSec= above.

DefaultTimeoutStartSec=, DefaultTimeoutStopSec=, DefaultRestartSec=¶

Configures the default timeouts for starting + and stopping of units, as well as the default time to sleep + between automatic restarts of units, as configured per-unit in + TimeoutStartSec=, + TimeoutStopSec= and + RestartSec= (for services, see + systemd.service(5) + for details on the per-unit settings). For non-service units, + DefaultTimeoutStartSec= sets the default + TimeoutSec= value.

DefaultStartLimitInterval=, DefaultStartLimitBurst=¶

Configure the default unit start rate + limiting, as configured per-service by + StartLimitInterval= and + StartLimitBurst=. See + systemd.service(5) + for details on the per-service settings.

DefaultEnvironment=¶

Sets manager environment variables passed to + all executed processes. Takes a space-separated list of + variable assignments. See + environ(7) + for details about environment variables.

Example: -

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

+

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"

- Sets three variables - "VAR1", - "VAR2", - "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default - resource accounting settings, as - configured per-unit by - CPUAccounting=, - BlockIOAccounting= - and - MemoryAccounting=. See - systemd.resource-control(5) - for details on the per-unit - settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control - various default resource limits for - units. See - setrlimit(2) - for details. Use the string - infinity to - configure no limit on a specific - resource. These settings may be - overridden in individual units - using the corresponding LimitXXX= - directives. Note that these resource - limits are only defaults for units, - they are not applied to PID 1 - itself.

+ Sets three variables + "VAR1", + "VAR2", + "VAR3".

DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=¶

Configure the default resource accounting + settings, as configured per-unit by + CPUAccounting=, + BlockIOAccounting= and + MemoryAccounting=. See + systemd.resource-control(5) + for details on the per-unit settings.

DefaultLimitCPU=, DefaultLimitFSIZE=, DefaultLimitDATA=, DefaultLimitSTACK=, DefaultLimitCORE=, DefaultLimitRSS=, DefaultLimitNOFILE=, DefaultLimitAS=, DefaultLimitNPROC=, DefaultLimitMEMLOCK=, DefaultLimitLOCKS=, DefaultLimitSIGPENDING=, DefaultLimitMSGQUEUE=, DefaultLimitNICE=, DefaultLimitRTPRIO=, DefaultLimitRTTIME=¶

These settings control various default + resource limits for units. See + setrlimit(2) + for details. Use the string infinity to + configure no limit on a specific resource. These settings may + be overridden in individual units using the corresponding + LimitXXX= directives. Note that these resource limits are only + defaults for units, they are not applied to PID 1 + itself.

diff --git a/man/systemd-vconsole-setup.html b/man/systemd-vconsole-setup.html index 7e49d0bd2..6b00351c4 100644 --- a/man/systemd-vconsole-setup.html +++ b/man/systemd-vconsole-setup.html @@ -19,26 +19,24 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-vconsole-setup.service, systemd-vconsole-setup — Configure the virtual console at boot

Synopsis

systemd-vconsole-setup.service

/usr/lib/systemd/systemd-vconsole-setup

Description¶

systemd-vconsole-setup.service - is an early-boot service that configures the virtual - console font and console keymap. Internally it calls - loadkeys(1) - and - setfont(8).

See - vconsole.conf(5) - for information about the configuration files understood by this - service.

Kernel Command Line¶

A few configuration parameters from - vconsole.conf may be overridden on - the kernel command line:

vconsole.keymap=, vconsole.keymap.toggle=¶

Overrides the key - mapping table for the keyboard and the - second toggle keymap.

vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Configures the console - font, the console map, and the unicode - font map.

See - vconsole.conf(5) - for information about these settings.

+ gudev systemd 219

Name

systemd-vconsole-setup.service, systemd-vconsole-setup — Configure the virtual console at boot

Synopsis

systemd-vconsole-setup.service

/usr/lib/systemd/systemd-vconsole-setup

Description¶

systemd-vconsole-setup.service is an + early-boot service that configures the virtual console font and + console keymap. Internally it calls + loadkeys(1) + and + setfont(8).

See + vconsole.conf(5) + for information about the configuration files understood by this + service.

Kernel Command Line¶

A few configuration parameters from + vconsole.conf may be overridden on the kernel + command line:

vconsole.keymap=, vconsole.keymap.toggle=¶

Overrides the key mapping table for the + keyboard and the second toggle keymap.

vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Configures the console font, the console map, + and the unicode font map.

See + vconsole.conf(5) + for information about these settings.

diff --git a/man/systemd-vconsole-setup.service.8 b/man/systemd-vconsole-setup.service.8 index 20f020ba1..9cf34544e 100644 --- a/man/systemd-vconsole-setup.service.8 +++ b/man/systemd-vconsole-setup.service.8 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\-VCONSOLE\-SETUP\&.SERVICE" "8" "" "systemd 218" "systemd-vconsole-setup.service" +.TH "SYSTEMD\-VCONSOLE\-SETUP\&.SERVICE" "8" "" "systemd 219" "systemd-vconsole-setup.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd-vconsole-setup.service.html b/man/systemd-vconsole-setup.service.html index 7e49d0bd2..6b00351c4 100644 --- a/man/systemd-vconsole-setup.service.html +++ b/man/systemd-vconsole-setup.service.html @@ -19,26 +19,24 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd-vconsole-setup.service, systemd-vconsole-setup — Configure the virtual console at boot

Synopsis

systemd-vconsole-setup.service

/usr/lib/systemd/systemd-vconsole-setup

Description¶

systemd-vconsole-setup.service - is an early-boot service that configures the virtual - console font and console keymap. Internally it calls - loadkeys(1) - and - setfont(8).

See - vconsole.conf(5) - for information about the configuration files understood by this - service.

Kernel Command Line¶

A few configuration parameters from - vconsole.conf may be overridden on - the kernel command line:

vconsole.keymap=, vconsole.keymap.toggle=¶

Overrides the key - mapping table for the keyboard and the - second toggle keymap.

vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Configures the console - font, the console map, and the unicode - font map.

See - vconsole.conf(5) - for information about these settings.

+ gudev systemd 219

Name

systemd-vconsole-setup.service, systemd-vconsole-setup — Configure the virtual console at boot

Synopsis

systemd-vconsole-setup.service

/usr/lib/systemd/systemd-vconsole-setup

Description¶

systemd-vconsole-setup.service is an + early-boot service that configures the virtual console font and + console keymap. Internally it calls + loadkeys(1) + and + setfont(8).

See + vconsole.conf(5) + for information about the configuration files understood by this + service.

Kernel Command Line¶

A few configuration parameters from + vconsole.conf may be overridden on the kernel + command line:

vconsole.keymap=, vconsole.keymap.toggle=¶

Overrides the key mapping table for the + keyboard and the second toggle keymap.

vconsole.font=, vconsole.font.map=, vconsole.font.unimap=¶

Configures the console font, the console map, + and the unicode font map.

See + vconsole.conf(5) + for information about these settings.

diff --git a/man/systemd-vconsole-setup.service.xml b/man/systemd-vconsole-setup.service.xml index 3c50799cb..59bb5e4e8 100644 --- a/man/systemd-vconsole-setup.service.xml +++ b/man/systemd-vconsole-setup.service.xml @@ -21,98 +21,94 @@ --> - - systemd-vconsole-setup.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-vconsole-setup.service - 8 - - - - systemd-vconsole-setup.service - systemd-vconsole-setup - Configure the virtual console at boot - - - - systemd-vconsole-setup.service - /usr/lib/systemd/systemd-vconsole-setup - - - - Description - - systemd-vconsole-setup.service - is an early-boot service that configures the virtual - console font and console keymap. Internally it calls - loadkeys1 - and - setfont8. - - See - vconsole.conf5 - for information about the configuration files understood by this - service. - - - - - - Kernel Command Line - - A few configuration parameters from - vconsole.conf may be overridden on - the kernel command line: - - - - vconsole.keymap= - vconsole.keymap.toggle= - - Overrides the key - mapping table for the keyboard and the - second toggle keymap. - - - - vconsole.font= - vconsole.font.map= - vconsole.font.unimap= - - Configures the console - font, the console map, and the unicode - font map. - - - - - - See - vconsole.conf5 - for information about these settings. - - - - See Also - - systemd1, - vconsole.conf5, - loadkeys1, - setfont8, - systemd-localed.service8 - - + + systemd-vconsole-setup.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd-vconsole-setup.service + 8 + + + + systemd-vconsole-setup.service + systemd-vconsole-setup + Configure the virtual console at boot + + + + systemd-vconsole-setup.service + /usr/lib/systemd/systemd-vconsole-setup + + + + Description + + systemd-vconsole-setup.service is an + early-boot service that configures the virtual console font and + console keymap. Internally it calls + loadkeys1 + and + setfont8. + + See + vconsole.conf5 + for information about the configuration files understood by this + service. + + + + + + Kernel Command Line + + A few configuration parameters from + vconsole.conf may be overridden on the kernel + command line: + + + + vconsole.keymap= + vconsole.keymap.toggle= + + Overrides the key mapping table for the + keyboard and the second toggle keymap. + + + + vconsole.font= + vconsole.font.map= + vconsole.font.unimap= + + Configures the console font, the console map, + and the unicode font map. + + + + See + vconsole.conf5 + for information about these settings. + + + + See Also + + systemd1, + vconsole.conf5, + loadkeys1, + setfont8, + systemd-localed.service8 + + diff --git a/man/systemd.1 b/man/systemd.1 index 0c58b9c60..29a6a97df 100644 --- a/man/systemd.1 +++ b/man/systemd.1 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD" "1" "" "systemd 218" "systemd" +.TH "SYSTEMD" "1" "" "systemd 219" "systemd" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -462,7 +462,7 @@ unit when this signal is received\&. This is mostly equivalent to Upon receiving this signal the systemd system manager will start the ctrl\-alt\-del\&.target unit\&. This is mostly equivalent to -\fBsystemctl start ctl\-alt\-del\&.target\fR\&. +\fBsystemctl start ctl\-alt\-del\&.target\fR\&. If this signal is received more often than 7 times per 2s an immediate reboot is triggered\&. Note that pressing Ctrl\-Alt\-Del on the console will trigger this signal\&. Hence, if a reboot is hanging pressing Ctrl\-Alt\-Del more than 7 times in 2s is a relatively safe way to trigger an immediate reboot\&. .sp systemd user managers treat this signal the same way as \fBSIGTERM\fR\&. diff --git a/man/systemd.automount.5 b/man/systemd.automount.5 index d6db0286a..10f1e117d 100644 --- a/man/systemd.automount.5 +++ b/man/systemd.automount.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.AUTOMOUNT" "5" "" "systemd 218" "systemd.automount" +.TH "SYSTEMD\&.AUTOMOUNT" "5" "" "systemd 219" "systemd.automount" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.automount.html b/man/systemd.automount.html index 75cc60297..016a2780f 100644 --- a/man/systemd.automount.html +++ b/man/systemd.automount.html @@ -19,68 +19,55 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.automount — Automount unit configuration

Synopsis

automount.automount

Description¶

A unit configuration file whose name ends in - ".automount" encodes information - about a file system automount point controlled and - supervised by systemd.

This man page lists the configuration options - specific to this unit type. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - automount specific configuration options are configured - in the [Automount] section.

Automount units must be named after the - automount directories they control. Example: the - automount point /home/lennart - must be configured in a unit file - home-lennart.automount. For - details about the escaping logic used to convert a - file system path to a unit name see - systemd.unit(5).

For each automount unit file a matching mount - unit file (see - systemd.mount(5) - for details) must exist which is activated when the - automount path is accessed. Example: if an automount - unit home-lennart.automount is - active and the user accesses - /home/lennart the mount unit - home-lennart.mount will be - activated.

Automount units may be used to implement - on-demand mounting as well as parallelized mounting of - file systems.

If an automount point is beneath another mount - point in the file system hierarchy, a dependency - between both units is created automatically.

fstab¶

Automount units may either be configured via unit - files, or via /etc/fstab (see - fstab(5) - for details).

For details how systemd parses - /etc/fstab see - systemd.mount(5).

If an automount point is configured in both - /etc/fstab and a unit file, the - configuration in the latter takes precedence.

Options¶

Automount files must include an [Automount] - section, which carries information about the file - system automount points it supervises. The options - specific to the [Automount] section of automount units - are the following:

Where=¶

Takes an absolute path - of a directory of the automount - point. If the automount point does not - exist at time that the automount - point is installed, it is created. This - string must be reflected in the unit - filename. (See above.) This option is - mandatory.

DirectoryMode=¶

Directories of - automount points (and any parent - directories) are automatically created - if needed. This option specifies the - file system access mode used when - creating these directories. Takes an - access mode in octal - notation. Defaults to - 0755.

+ gudev systemd 219

Name

systemd.automount — Automount unit configuration

Synopsis

automount.automount

Description¶

A unit configuration file whose name ends in + ".automount" encodes information about a file + system automount point controlled and supervised by + systemd.

This man page lists the configuration options specific to + this unit type. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The automount specific configuration options + are configured in the [Automount] section.

Automount units must be named after the automount + directories they control. Example: the automount point + /home/lennart must be + configured in a unit file + home-lennart.automount. For details about the + escaping logic used to convert a file system path to a unit name + see + systemd.unit(5).

For each automount unit file a matching mount unit file (see + systemd.mount(5) + for details) must exist which is activated when the automount path + is accessed. Example: if an automount unit + home-lennart.automount is active and the user + accesses /home/lennart the mount unit + home-lennart.mount will be activated.

Automount units may be used to implement on-demand mounting + as well as parallelized mounting of file systems.

If an automount point is beneath another mount point in the + file system hierarchy, a dependency between both units is created + automatically.

fstab¶

Automount units may either be configured via unit files, or + via /etc/fstab (see + fstab(5) + for details).

For details how systemd parses + /etc/fstab see + systemd.mount(5).

If an automount point is configured in both + /etc/fstab and a unit file, the configuration + in the latter takes precedence.

Options¶

Automount files must include an [Automount] section, which + carries information about the file system automount points it + supervises. The options specific to the [Automount] section of + automount units are the following:

Where=¶

Takes an absolute path of a directory of the + automount point. If the automount point does not exist at time + that the automount point is installed, it is created. This + string must be reflected in the unit filename. (See above.) + This option is mandatory.

DirectoryMode=¶

Directories of automount points (and any + parent directories) are automatically created if needed. This + option specifies the file system access mode used when + creating these directories. Takes an access mode in octal + notation. Defaults to 0755.

diff --git a/man/systemd.automount.xml b/man/systemd.automount.xml index f04a4a492..3db65d988 100644 --- a/man/systemd.automount.xml +++ b/man/systemd.automount.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.automount - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.automount - 5 - - - - systemd.automount - Automount unit configuration - - - - automount.automount - - - - Description - - A unit configuration file whose name ends in - .automount encodes information - about a file system automount point controlled and - supervised by systemd. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - automount specific configuration options are configured - in the [Automount] section. - - Automount units must be named after the - automount directories they control. Example: the - automount point /home/lennart - must be configured in a unit file - home-lennart.automount. For - details about the escaping logic used to convert a - file system path to a unit name see - systemd.unit5. - - For each automount unit file a matching mount - unit file (see - systemd.mount5 - for details) must exist which is activated when the - automount path is accessed. Example: if an automount - unit home-lennart.automount is - active and the user accesses - /home/lennart the mount unit - home-lennart.mount will be - activated. - - Automount units may be used to implement - on-demand mounting as well as parallelized mounting of - file systems. - - If an automount point is beneath another mount - point in the file system hierarchy, a dependency - between both units is created automatically. - - - - <filename>fstab</filename> - - Automount units may either be configured via unit - files, or via /etc/fstab (see - fstab5 - for details). - - For details how systemd parses - /etc/fstab see - systemd.mount5. - - If an automount point is configured in both - /etc/fstab and a unit file, the - configuration in the latter takes precedence. - - - - Options - - Automount files must include an [Automount] - section, which carries information about the file - system automount points it supervises. The options - specific to the [Automount] section of automount units - are the following: - - - - - Where= - Takes an absolute path - of a directory of the automount - point. If the automount point does not - exist at time that the automount - point is installed, it is created. This - string must be reflected in the unit - filename. (See above.) This option is - mandatory. - - - - DirectoryMode= - Directories of - automount points (and any parent - directories) are automatically created - if needed. This option specifies the - file system access mode used when - creating these directories. Takes an - access mode in octal - notation. Defaults to - 0755. - - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.mount5, - mount8, - automount8, - systemd.directives7 - - + + systemd.automount + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.automount + 5 + + + + systemd.automount + Automount unit configuration + + + + automount.automount + + + + Description + + A unit configuration file whose name ends in + .automount encodes information about a file + system automount point controlled and supervised by + systemd. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The automount specific configuration options + are configured in the [Automount] section. + + Automount units must be named after the automount + directories they control. Example: the automount point + /home/lennart must be + configured in a unit file + home-lennart.automount. For details about the + escaping logic used to convert a file system path to a unit name + see + systemd.unit5. + + For each automount unit file a matching mount unit file (see + systemd.mount5 + for details) must exist which is activated when the automount path + is accessed. Example: if an automount unit + home-lennart.automount is active and the user + accesses /home/lennart the mount unit + home-lennart.mount will be activated. + + Automount units may be used to implement on-demand mounting + as well as parallelized mounting of file systems. + + If an automount point is beneath another mount point in the + file system hierarchy, a dependency between both units is created + automatically. + + + + <filename>fstab</filename> + + Automount units may either be configured via unit files, or + via /etc/fstab (see + fstab5 + for details). + + For details how systemd parses + /etc/fstab see + systemd.mount5. + + If an automount point is configured in both + /etc/fstab and a unit file, the configuration + in the latter takes precedence. + + + + Options + + Automount files must include an [Automount] section, which + carries information about the file system automount points it + supervises. The options specific to the [Automount] section of + automount units are the following: + + + + + Where= + Takes an absolute path of a directory of the + automount point. If the automount point does not exist at time + that the automount point is installed, it is created. This + string must be reflected in the unit filename. (See above.) + This option is mandatory. + + + + DirectoryMode= + Directories of automount points (and any + parent directories) are automatically created if needed. This + option specifies the file system access mode used when + creating these directories. Takes an access mode in octal + notation. Defaults to 0755. + + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.mount5, + mount8, + automount8, + systemd.directives7 + + diff --git a/man/systemd.device.5 b/man/systemd.device.5 index d90695288..0dadfd941 100644 --- a/man/systemd.device.5 +++ b/man/systemd.device.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.DEVICE" "5" "" "systemd 218" "systemd.device" +.TH "SYSTEMD\&.DEVICE" "5" "" "systemd 219" "systemd.device" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.device.html b/man/systemd.device.html index 51ea8a2bf..a960a742a 100644 --- a/man/systemd.device.html +++ b/man/systemd.device.html @@ -19,87 +19,65 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.device — Device unit configuration

Synopsis

device.device

Description¶

A unit configuration file whose name ends in - ".device" encodes information about - a device unit as exposed in the - sysfs/udev(7) - device tree.

This unit type has no specific options. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic "[Unit]" and - "[Install]" sections. A separate - "[Device]" section does not exist, - since no device-specific options may be - configured.

systemd will dynamically create device units for - all kernel devices that are marked with the "systemd" - udev tag (by default all block and network devices, - and a few others). This may be used to define - dependencies between devices and other units. To tag a - udev device, use "TAG+="systemd"" in - the udev rules file, see - udev(7) - for details.

Device units are named after the - /sys and - /dev paths they control. Example: - the device /dev/sda5 is exposed - in systemd as dev-sda5.device. For - details about the escaping logic used to convert a - file system path to a unit name see - systemd.unit(5).

The udev Database¶

The settings of device units may either be - configured via unit files, or directly from the udev - database (which is recommended). The following udev device - properties are understood by systemd:

SYSTEMD_WANTS=, SYSTEMD_USER_WANTS=¶

Adds dependencies of - type Wants from the - device unit to all listed units. The - first form is used by the system - systemd instance, the second by user - systemd instances. Those settings may - be used to activate arbitrary units - when a specific device becomes - available.

Note that this and the - other tags are not taken into account - unless the device is tagged with the - "systemd" string in - the udev database, because otherwise - the device is not exposed as a systemd - unit (see above).

Note that systemd will only act - on Wants - dependencies when a device first - becomes active. It will not act on - them if they are added to devices that - are already active. Use - SYSTEMD_READY= (see - below) to influence on which udev - event to trigger the dependencies. -

SYSTEMD_ALIAS=¶

Adds an additional - alias name to the device unit. This - must be an absolute path that is - automatically transformed into a unit - name. (See above.)

SYSTEMD_READY=¶

If set to 0, systemd - will consider this device unplugged - even if it shows up in the udev - tree. If this property is unset or set - to 1, the device will be considered - plugged if it is visible in the - udev tree. This property has no - influence on the behavior when a - device disappears from the udev - tree.

This option is useful to support - devices that initially show up in an - uninitialized state in the tree, and - for which a "changed" - event is generated the moment they are - fully set up. Note that - SYSTEMD_WANTS= (see - above) is not acted on as long as - SYSTEMD_READY=0 is - set for a device.

ID_MODEL_FROM_DATABASE=, ID_MODEL=¶

If set, this property is - used as description string for the - device unit.

+ gudev systemd 219

Name

systemd.device — Device unit configuration

Synopsis

device.device

Description¶

A unit configuration file whose name ends in + ".device" encodes information about a device unit + as exposed in the + sysfs/udev(7) + device tree.

This unit type has no specific options. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic + "[Unit]" and "[Install]" + sections. A separate "[Device]" section does not + exist, since no device-specific options may be configured.

systemd will dynamically create device units for all kernel + devices that are marked with the "systemd" udev tag (by default + all block and network devices, and a few others). This may be used + to define dependencies between devices and other units. To tag a + udev device, use "TAG+="systemd"" in the udev + rules file, see + udev(7) + for details.

Device units are named after the /sys + and /dev paths they control. Example: the + device /dev/sda5 is exposed in + systemd as dev-sda5.device. For details about + the escaping logic used to convert a file system path to a unit + name see + systemd.unit(5).

The udev Database¶

The settings of device units may either be configured via + unit files, or directly from the udev database (which is + recommended). The following udev device properties are understood + by systemd:

SYSTEMD_WANTS=, SYSTEMD_USER_WANTS=¶

Adds dependencies of type + Wants from the device unit to all listed + units. The first form is used by the system systemd instance, + the second by user systemd instances. Those settings may be + used to activate arbitrary units when a specific device + becomes available.

Note that this and the other tags are not taken into + account unless the device is tagged with the + "systemd" string in the udev database, + because otherwise the device is not exposed as a systemd unit + (see above).

Note that systemd will only act on + Wants dependencies when a device first + becomes active. It will not act on them if they are added to + devices that are already active. Use + SYSTEMD_READY= (see below) to influence on + which udev event to trigger the dependencies. +

SYSTEMD_ALIAS=¶

Adds an additional alias name to the device + unit. This must be an absolute path that is automatically + transformed into a unit name. (See above.)

SYSTEMD_READY=¶

If set to 0, systemd will consider this device + unplugged even if it shows up in the udev tree. If this + property is unset or set to 1, the device will be considered + plugged if it is visible in the udev tree. This property has + no influence on the behavior when a device disappears from the + udev tree.

This option is useful to support devices that initially + show up in an uninitialized state in the tree, and for which a + "changed" event is generated the moment they + are fully set up. Note that SYSTEMD_WANTS= + (see above) is not acted on as long as + SYSTEMD_READY=0 is set for a + device.

ID_MODEL_FROM_DATABASE=, ID_MODEL=¶

If set, this property is used as description + string for the device unit.

diff --git a/man/systemd.device.xml b/man/systemd.device.xml index 557f15f90..ac6deafb1 100644 --- a/man/systemd.device.xml +++ b/man/systemd.device.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.device - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.device - 5 - - - - systemd.device - Device unit configuration - - - - device.device - - - - Description - - A unit configuration file whose name ends in - .device encodes information about - a device unit as exposed in the - sysfs/udev7 - device tree. - - This unit type has no specific options. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and - [Install] sections. A separate - [Device] section does not exist, - since no device-specific options may be - configured. - - systemd will dynamically create device units for - all kernel devices that are marked with the "systemd" - udev tag (by default all block and network devices, - and a few others). This may be used to define - dependencies between devices and other units. To tag a - udev device, use TAG+="systemd" in - the udev rules file, see - udev7 - for details. - - Device units are named after the - /sys and - /dev paths they control. Example: - the device /dev/sda5 is exposed - in systemd as dev-sda5.device. For - details about the escaping logic used to convert a - file system path to a unit name see - systemd.unit5. - - - - - The udev Database - - The settings of device units may either be - configured via unit files, or directly from the udev - database (which is recommended). The following udev device - properties are understood by systemd: - - - - SYSTEMD_WANTS= - SYSTEMD_USER_WANTS= - Adds dependencies of - type Wants from the - device unit to all listed units. The - first form is used by the system - systemd instance, the second by user - systemd instances. Those settings may - be used to activate arbitrary units - when a specific device becomes - available. - - Note that this and the - other tags are not taken into account - unless the device is tagged with the - systemd string in - the udev database, because otherwise - the device is not exposed as a systemd - unit (see above). - - Note that systemd will only act - on Wants - dependencies when a device first - becomes active. It will not act on - them if they are added to devices that - are already active. Use - SYSTEMD_READY= (see - below) to influence on which udev - event to trigger the dependencies. - - - - - SYSTEMD_ALIAS= - Adds an additional - alias name to the device unit. This - must be an absolute path that is - automatically transformed into a unit - name. (See above.) - - - - SYSTEMD_READY= - If set to 0, systemd - will consider this device unplugged - even if it shows up in the udev - tree. If this property is unset or set - to 1, the device will be considered - plugged if it is visible in the - udev tree. This property has no - influence on the behavior when a - device disappears from the udev - tree. - - This option is useful to support - devices that initially show up in an - uninitialized state in the tree, and - for which a changed - event is generated the moment they are - fully set up. Note that - SYSTEMD_WANTS= (see - above) is not acted on as long as - SYSTEMD_READY=0 is - set for a device. - - - - ID_MODEL_FROM_DATABASE= - ID_MODEL= - - If set, this property is - used as description string for the - device unit. - - - - - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - udev7, - systemd.directives7 - - + + systemd.device + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.device + 5 + + + + systemd.device + Device unit configuration + + + + device.device + + + + Description + + A unit configuration file whose name ends in + .device encodes information about a device unit + as exposed in the + sysfs/udev7 + device tree. + + This unit type has no specific options. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic + [Unit] and [Install] + sections. A separate [Device] section does not + exist, since no device-specific options may be configured. + + systemd will dynamically create device units for all kernel + devices that are marked with the "systemd" udev tag (by default + all block and network devices, and a few others). This may be used + to define dependencies between devices and other units. To tag a + udev device, use TAG+="systemd" in the udev + rules file, see + udev7 + for details. + + Device units are named after the /sys + and /dev paths they control. Example: the + device /dev/sda5 is exposed in + systemd as dev-sda5.device. For details about + the escaping logic used to convert a file system path to a unit + name see + systemd.unit5. + + + + + The udev Database + + The settings of device units may either be configured via + unit files, or directly from the udev database (which is + recommended). The following udev device properties are understood + by systemd: + + + + SYSTEMD_WANTS= + SYSTEMD_USER_WANTS= + Adds dependencies of type + Wants from the device unit to all listed + units. The first form is used by the system systemd instance, + the second by user systemd instances. Those settings may be + used to activate arbitrary units when a specific device + becomes available. + + Note that this and the other tags are not taken into + account unless the device is tagged with the + systemd string in the udev database, + because otherwise the device is not exposed as a systemd unit + (see above). + + Note that systemd will only act on + Wants dependencies when a device first + becomes active. It will not act on them if they are added to + devices that are already active. Use + SYSTEMD_READY= (see below) to influence on + which udev event to trigger the dependencies. + + + + + SYSTEMD_ALIAS= + Adds an additional alias name to the device + unit. This must be an absolute path that is automatically + transformed into a unit name. (See above.) + + + + SYSTEMD_READY= + If set to 0, systemd will consider this device + unplugged even if it shows up in the udev tree. If this + property is unset or set to 1, the device will be considered + plugged if it is visible in the udev tree. This property has + no influence on the behavior when a device disappears from the + udev tree. + + This option is useful to support devices that initially + show up in an uninitialized state in the tree, and for which a + changed event is generated the moment they + are fully set up. Note that SYSTEMD_WANTS= + (see above) is not acted on as long as + SYSTEMD_READY=0 is set for a + device. + + + + ID_MODEL_FROM_DATABASE= + ID_MODEL= + + If set, this property is used as description + string for the device unit. + + + + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + udev7, + systemd.directives7 + + diff --git a/man/systemd.directives.7 b/man/systemd.directives.7 index f6fe39d41..0351b7039 100644 --- a/man/systemd.directives.7 +++ b/man/systemd.directives.7 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.DIRECTIVES" "7" "" "systemd 218" "systemd.directives" +.TH "SYSTEMD\&.DIRECTIVES" "7" "" "systemd 219" "systemd.directives" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -461,6 +461,11 @@ Directives for configuring units, used in unit files\&. \fBsystemd.service\fR(5) .RE .PP +\fIFileDescriptorStoreMax=\fR +.RS 4 +\fBsystemd.service\fR(5) +.RE +.PP \fIFreeBind=\fR .RS 4 \fBsystemd.socket\fR(5) @@ -2593,7 +2598,12 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.network\fR(5) .RE .PP -\fIIPv4LL=\fR +\fIIPForward=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP +\fIIPMasquerade=\fR .RS 4 \fBsystemd.network\fR(5) .RE @@ -2603,6 +2613,11 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.network\fR(5) .RE .PP +\fIIPv6Token=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP \fIId=\fR .RS 4 \fBsystemd.netdev\fR(5) @@ -2635,6 +2650,11 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.netdev\fR(5) .RE .PP +\fILLDP=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP \fILLMNR=\fR .RS 4 \fBresolved.conf\fR(5), @@ -2646,6 +2666,11 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.network\fR(5) .RE .PP +\fILinkLocalAddressing=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP \fILocal=\fR .RS 4 \fBsystemd.netdev\fR(5) @@ -2764,6 +2789,11 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.netdev\fR(5) .RE .PP +\fIScope=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP \fISendHostname=\fR .RS 4 \fBsystemd.network\fR(5) @@ -2840,6 +2870,11 @@ Directives for configuring network links through the net\-setup\-link udev built \fBsystemd.network\fR(5) .RE .PP +\fIVLANId=\fR +.RS 4 +\fBsystemd.network\fR(5) +.RE +.PP \fIVXLAN=\fR .RS 4 \fBsystemd.network\fR(5) @@ -3172,12 +3207,12 @@ Options which influence mounted filesystems and encrypted volumes\&. \fBcrypttab\fR(5) .RE .PP -\fBfail\fR +\fBhash=\fR .RS 4 -\fBsystemd.swap\fR(5) +\fBcrypttab\fR(5) .RE .PP -\fBhash=\fR +\fBheader=\fR .RS 4 \fBcrypttab\fR(5) .RE @@ -3658,6 +3693,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBsystemctl\fR(1), \fBsystemd-cgls\fR(1) .RE @@ -3883,6 +3919,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1) .RE .PP +\fB\-\-dkr\-index\-url\fR +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP \fB\-\-dmesg\fR .RS 4 \fBjournalctl\fR(1) @@ -3923,6 +3964,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-bootchart\fR(1) .RE .PP +\fB\-\-ephemeral\fR +.RS 4 +\fBsystemd-nspawn\fR(1) +.RE +.PP \fB\-\-event\-timeout=\fR .RS 4 \fBsystemd-udevd.service\fR(8) @@ -3994,6 +4040,7 @@ Command\-line options accepted by programs in the systemd suite\&. .RS 4 \fBhalt\fR(8), \fBjournalctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1) .RE .PP @@ -4058,6 +4105,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBlocalectl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBrunlevel\fR(8), \fBshutdown\fR(8), \fBsystemctl\fR(1), @@ -4074,6 +4122,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-detect-virt\fR(1), \fBsystemd-escape\fR(1), \fBsystemd-firstboot\fR(1), +\fBsystemd-hwdb\fR(8), \fBsystemd-inhibit\fR(1), \fBsystemd-journal-gatewayd.service\fR(8), \fBsystemd-journal-remote\fR(8), @@ -4129,6 +4178,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemctl\fR(1) .RE .PP +\fB\-\-ignore=\fR +.RS 4 +\fBsystemd-networkd-wait-online.service\fR(8) +.RE +.PP \fB\-\-image=\fR .RS 4 \fBsystemd-nspawn\fR(1) @@ -4189,6 +4243,8 @@ Command\-line options accepted by programs in the systemd suite\&. \fB\-\-lines=\fR .RS 4 \fBjournalctl\fR(1), +\fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1) .RE .PP @@ -4305,6 +4361,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-journal-upload\fR(8) .RE .PP +\fB\-\-mkdir\fR +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP \fB\-\-mode=\fR .RS 4 \fBsystemd-inhibit\fR(1) @@ -4335,6 +4396,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-nspawn\fR(1) .RE .PP +\fB\-\-network\-ipvlan=\fR +.RS 4 +\fBsystemd-nspawn\fR(1) +.RE +.PP \fB\-\-network\-macvlan=\fR .RS 4 \fBsystemd-nspawn\fR(1) @@ -4360,6 +4426,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBhostnamectl\fR(1), \fBlocalectl\fR(1), \fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1), \fBtimedatectl\fR(1) .RE @@ -4411,6 +4478,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBlocalectl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBsystemctl\fR(1), \fBsystemd-analyze\fR(1), \fBsystemd-cgls\fR(1), @@ -4495,6 +4563,8 @@ Command\-line options accepted by programs in the systemd suite\&. .RS 4 \fBcoredumpctl\fR(1), \fBjournalctl\fR(1), +\fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1), \fBsystemd-journal-remote\fR(8) .RE @@ -4539,6 +4609,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-tty-ask-password-agent\fR(1) .RE .PP +\fB\-\-port=\fR +.RS 4 +\fBsystemd-nspawn\fR(1) +.RE +.PP \fB\-\-poweroff\fR .RS 4 \fBhalt\fR(8), @@ -4620,6 +4695,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-bootchart\fR(1) .RE .PP +\fB\-\-pty\fR +.RS 4 +\fBsystemd-run\fR(1) +.RE +.PP \fB\-\-query\fR .RS 4 \fBsystemd-tty-ask-password-agent\fR(1) @@ -4636,11 +4716,13 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1), \fBsystemctl\fR(1), \fBsystemd-detect-virt\fR(1), -\fBsystemd-nspawn\fR(1) +\fBsystemd-nspawn\fR(1), +\fBsystemd-run\fR(1) .RE .PP \fB\-\-read\-only\fR .RS 4 +\fBmachinectl\fR(1), \fBsystemd-nspawn\fR(1) .RE .PP @@ -4722,11 +4804,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1), \fBsystemctl\fR(1), \fBsystemd-firstboot\fR(1), +\fBsystemd-hwdb\fR(8), \fBsystemd-machine-id-commit\fR(1), \fBsystemd-machine-id-setup\fR(1), \fBsystemd-sysusers\fR(8), -\fBsystemd-tmpfiles\fR(8), -\fBudevadm\fR(8) +\fBsystemd-tmpfiles\fR(8) .RE .PP \fB\-\-runtime\fR @@ -4918,7 +5000,8 @@ Command\-line options accepted by programs in the systemd suite\&. .PP \fB\-\-template=\fR .RS 4 -\fBsystemd-escape\fR(1) +\fBsystemd-escape\fR(1), +\fBsystemd-nspawn\fR(1) .RE .PP \fB\-\-test\fR @@ -4926,15 +5009,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd\fR(1) .RE .PP -\fB\-\-test=\fR -.RS 4 -\fBudevadm\fR(8) -.RE -.PP \fB\-\-timeout=\fR .RS 4 \fBbusctl\fR(1), \fBsystemd-ask-password\fR(1), +\fBsystemd-networkd-wait-online.service\fR(8), \fBudevadm\fR(8) .RE .PP @@ -5002,11 +5081,6 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1) .RE .PP -\fB\-\-update\fR -.RS 4 -\fBudevadm\fR(8) -.RE -.PP \fB\-\-update\-catalog\fR .RS 4 \fBjournalctl\fR(1) @@ -5041,7 +5115,7 @@ Command\-line options accepted by programs in the systemd suite\&. .PP \fB\-\-usr\fR .RS 4 -\fBudevadm\fR(8) +\fBsystemd-hwdb\fR(8) .RE .PP \fB\-\-utc\fR @@ -5080,6 +5154,11 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1) .RE .PP +\fB\-\-verify=\fR +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP \fB\-\-version\fR .RS 4 \fBbootctl\fR(1), @@ -5090,6 +5169,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBlocalectl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBsystemctl\fR(1), \fBsystemd\fR(1), \fBsystemd-activate\fR(8), @@ -5262,6 +5342,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBjournalctl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBsystemctl\fR(1), \fBsystemd-activate\fR(8), \fBudevadm\fR(8) @@ -5322,6 +5403,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBlocalectl\fR(1), \fBloginctl\fR(1), \fBmachinectl\fR(1), +\fBnetworkctl\fR(1), \fBshutdown\fR(8), \fBsystemctl\fR(1), \fBsystemd\fR(1), @@ -5337,6 +5419,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-detect-virt\fR(1), \fBsystemd-escape\fR(1), \fBsystemd-firstboot\fR(1), +\fBsystemd-hwdb\fR(8), \fBsystemd-inhibit\fR(1), \fBsystemd-journal-gatewayd.service\fR(8), \fBsystemd-journal-remote\fR(8), @@ -5400,9 +5483,12 @@ Command\-line options accepted by programs in the systemd suite\&. \fB\-n\fR .RS 4 \fBjournalctl\fR(1), +\fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1), \fBsystemd-bootchart\fR(1), \fBsystemd-cgtop\fR(1), +\fBsystemd-nspawn\fR(1), \fBudevadm\fR(8) .RE .PP @@ -5410,6 +5496,8 @@ Command\-line options accepted by programs in the systemd suite\&. .RS 4 \fBcoredumpctl\fR(1), \fBjournalctl\fR(1), +\fBloginctl\fR(1), +\fBmachinectl\fR(1), \fBsystemctl\fR(1), \fBsystemd-bootchart\fR(1) .RE @@ -5425,6 +5513,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-cat\fR(1), \fBsystemd-cgtop\fR(1), \fBsystemd-escape\fR(1), +\fBsystemd-nspawn\fR(1), \fBsystemd-run\fR(1), \fBudevadm\fR(8) .RE @@ -5435,6 +5524,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemctl\fR(1), \fBsystemd-detect-virt\fR(1), \fBsystemd-nspawn\fR(1), +\fBsystemd-run\fR(1), \fBudevadm\fR(8) .RE .PP @@ -5444,6 +5534,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBshutdown\fR(8), \fBsystemctl\fR(1), \fBsystemd-bootchart\fR(1), +\fBsystemd-hwdb\fR(8), \fBudevadm\fR(8) .RE .PP @@ -5462,6 +5553,7 @@ Command\-line options accepted by programs in the systemd suite\&. \fBsystemd-cat\fR(1), \fBsystemd-cgtop\fR(1), \fBsystemd-delta\fR(1), +\fBsystemd-run\fR(1), \fBudevadm\fR(8) .RE .PP @@ -5488,6 +5580,7 @@ Command\-line options accepted by programs in the systemd suite\&. .RS 4 \fBjournalctl\fR(1), \fBsystemd-bootchart\fR(1), +\fBsystemd-nspawn\fR(1), \fBudevadm\fR(8) .RE .PP @@ -5605,6 +5698,12 @@ Command\-line options accepted by programs in the systemd suite\&. .PP Various constant used and/or defined by systemd\&. .PP +\fB \-1\fR +.RS 4 +\fBsd_journal_get_fd\fR(3), +\fBsd_login_monitor_new\fR(3) +.RE +.PP \fB\-0\fR .RS 4 \fBjournalctl\fR(1) @@ -5614,7 +5713,6 @@ Various constant used and/or defined by systemd\&. .RS 4 \fBjournalctl\fR(1), \fBsd_journal_get_fd\fR(3), -\fBsd_login_monitor_new\fR(3), \fBsystemd\fR(1) .RE .PP @@ -5757,7 +5855,8 @@ Various constant used and/or defined by systemd\&. \fBsd_event_add_child\fR(3), \fBsd_event_add_defer\fR(3), \fBsd_event_add_signal\fR(3), -\fBsd_event_add_time\fR(3) +\fBsd_event_add_time\fR(3), +\fBsd_journal_get_realtime_usec\fR(3) .RE .PP \fB0\fR @@ -5809,6 +5908,11 @@ Various constant used and/or defined by systemd\&. \fBsd_is_fifo\fR(3) .RE .PP +\fBCAP_ADMIN\fR +.RS 4 +\fBsystemd-tmpfiles\fR(8) +.RE +.PP \fBCAP_DAC_OVERRIDE\fR .RS 4 \fBsystemd.exec\fR(5) @@ -5837,6 +5941,7 @@ Various constant used and/or defined by systemd\&. \fBCLOCK_MONOTONIC\fR .RS 4 \fBbootchart.conf\fR(5), +\fBsd_bus_message_get_monotonic_usec\fR(3), \fBsd_event_add_time\fR(3), \fBsd_journal_get_cutoff_realtime_usec\fR(3), \fBsd_journal_get_fd\fR(3), @@ -5848,6 +5953,7 @@ Various constant used and/or defined by systemd\&. .PP \fBCLOCK_REALTIME\fR .RS 4 +\fBsd_bus_message_get_monotonic_usec\fR(3), \fBsd_event_add_time\fR(3), \fBsd_journal_get_cutoff_realtime_usec\fR(3), \fBsd_journal_get_realtime_usec\fR(3), @@ -5967,6 +6073,11 @@ Various constant used and/or defined by systemd\&. \fBsystemd.service\fR(5) .RE .PP +\fBPAM_SUCCESS\fR +.RS 4 +\fBpam_systemd\fR(8) +.RE +.PP \fBPOLLIN\fR .RS 4 \fBsd_journal_get_fd\fR(3), @@ -6865,6 +6976,16 @@ Other configuration elements which don\*(Aqt fit in any of the above groups\&. \fBsystemd-journal-remote\fR(8) .RE .PP +\fIA\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP +\fIA+\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP \fIANSI_COLOR=\fR .RS 4 \fBos-release\fR(5) @@ -7136,6 +7257,11 @@ Other configuration elements which don\*(Aqt fit in any of the above groups\&. \fBos-release\fR(5) .RE .PP +\fIPRIVACY_POLICY_URL=\fR +.RS 4 +\fBos-release\fR(5) +.RE +.PP \fIPowerKeyIgnoreInhibited=\fR .RS 4 \fBlogind.conf\fR(5) @@ -7252,6 +7378,11 @@ Other configuration elements which don\*(Aqt fit in any of the above groups\&. \fBjournald.conf\fR(5) .RE .PP +\fIT\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP \fITTYPath=\fR .RS 4 \fBjournald.conf\fR(5) @@ -7277,6 +7408,16 @@ Other configuration elements which don\*(Aqt fit in any of the above groups\&. \fBtmpfiles.d\fR(5) .RE .PP +\fIa\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP +\fIa+\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP \fIb\fR .RS 4 \fBtmpfiles.d\fR(5) @@ -7404,6 +7545,11 @@ Other configuration elements which don\*(Aqt fit in any of the above groups\&. \fBtmpfiles.d\fR(5) .RE .PP +\fIv\fR +.RS 4 +\fBtmpfiles.d\fR(5) +.RE +.PP \fBw\fR .RS 4 \fBtmpfiles.d\fR(5) @@ -7467,6 +7613,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.exec\fR(5) .RE .PP +/bin/bash +.RS 4 +\fBsystemd-run\fR(1) +.RE +.PP /bin/ls .RS 4 \fBsystemd-cat\fR(1) @@ -7477,7 +7628,8 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBfile-hierarchy\fR(7), \fBkernel-install\fR(8), \fBsystemd-efi-boot-generator\fR(8), -\fBsystemd-gpt-auto-generator\fR(8) +\fBsystemd-gpt-auto-generator\fR(8), +\fBsystemd.exec\fR(5) .RE .PP /boot/loader/entries/\fIMACHINE\-ID\fR\-\fIKERNEL\-VERSION\fR\&.conf @@ -7491,6 +7643,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-nspawn\fR(1), \fBsystemd-remount-fs.service\fR(8), \fBsystemd.device\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.journal-fields\fR(7), \fBsystemd.resource-control\fR(5), \fBudev\fR(7), @@ -7526,6 +7679,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-initctl.service\fR(8) .RE .PP +/dev/kmsg +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /dev/mapper/ .RS 4 \fBcrypttab\fR(5) @@ -7552,6 +7710,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBbootchart.conf\fR(5), \fBcoredump.conf\fR(5), \fBdaemon\fR(7), +\fBhwdb\fR(7), \fBjournald.conf\fR(5), \fBlogind.conf\fR(5), \fBmodules-load.d\fR(5), @@ -7561,6 +7720,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-sleep.conf\fR(5), \fBsystemd-system.conf\fR(5), \fBsystemd.exec\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.link\fR(5), \fBsystemd.netdev\fR(5), \fBsystemd.network\fR(5), @@ -7619,6 +7779,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBbootchart.conf\fR(5), \fBcoredump.conf\fR(5), \fBfile-hierarchy\fR(7), +\fBhwdb\fR(7), \fBjournald.conf\fR(5), \fBlogind.conf\fR(5), \fBmodules-load.d\fR(5), @@ -7633,6 +7794,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-system.conf\fR(5), \fBsystemd-update-done.service\fR(8), \fBsystemd.exec\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.link\fR(5), \fBsystemd.mount\fR(5), \fBsystemd.netdev\fR(5), @@ -7641,8 +7803,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5), \fBsysusers.d\fR(5), \fBtimesyncd.conf\fR(5), -\fBudev\fR(7), -\fBudevadm\fR(8) +\fBudev\fR(7) .RE .PP /etc/\&.updated @@ -7677,6 +7838,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-gpt-auto-generator\fR(8), \fBsystemd-remount-fs.service\fR(8), \fBsystemd.automount\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.mount\fR(5), \fBsystemd.special\fR(7), \fBsystemd.swap\fR(5) @@ -7696,7 +7858,8 @@ $XDG_RUNTIME_DIR/systemd/user/ .PP /etc/hosts .RS 4 -\fBnss-myhostname\fR(8) +\fBnss-myhostname\fR(8), +\fBnss-mymachines\fR(8) .RE .PP /etc/init\&.d/ @@ -7764,7 +7927,8 @@ $XDG_RUNTIME_DIR/systemd/user/ .PP /etc/nsswitch\&.conf .RS 4 -\fBnss-myhostname\fR(8) +\fBnss-myhostname\fR(8), +\fBnss-mymachines\fR(8) .RE .PP /etc/os\-release @@ -7821,6 +7985,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBcoredump.conf\fR(5) .RE .PP +/etc/systemd/import\-pubring\&.gpg +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP /etc/systemd/journal\-remote\&.conf .RS 4 \fBsystemd-journal-upload\fR(8) @@ -7886,6 +8055,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/etc/systemd/system\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /etc/systemd/system\-preset/ .RS 4 \fBsystemd.preset\fR(5) @@ -7911,6 +8085,21 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-system.conf\fR(5) .RE .PP +/etc/systemd/system/httpd\&.service +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP +/etc/systemd/system/httpd\&.service\&.d/local\&.conf +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP +/etc/systemd/system/multi\-user\&.target\&.wants/foo\&.service +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP /etc/systemd/timesyncd\&.conf .RS 4 \fBtimesyncd.conf\fR(5) @@ -7926,6 +8115,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/etc/systemd/user\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /etc/systemd/user\-preset/*\&.preset .RS 4 \fBsystemd.preset\fR(5) @@ -7953,14 +8147,12 @@ $XDG_RUNTIME_DIR/systemd/user/ .PP /etc/udev/hwdb\&.bin .RS 4 -\fBudev\fR(7), -\fBudevadm\fR(8) +\fBhwdb\fR(7) .RE .PP /etc/udev/hwdb\&.d .RS 4 -\fBudev\fR(7), -\fBudevadm\fR(8) +\fBhwdb\fR(7) .RE .PP /etc/udev/rules\&.d @@ -8006,6 +8198,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBfile-hierarchy\fR(7) .RE .PP +\fB/path/to/generator\fR +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /proc .RS 4 \fBbusctl\fR(1), @@ -8016,6 +8213,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsd_is_fifo\fR(3), \fBsystemd\fR(1), \fBsystemd-remount-fs.service\fR(8), +\fBsystemd.generator\fR(7), \fBsystemd.socket\fR(5), \fBtmpfiles.d\fR(5) .RE @@ -8089,11 +8287,13 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBbootchart.conf\fR(5), \fBcoredump.conf\fR(5), \fBfile-hierarchy\fR(7), +\fBhwdb\fR(7), \fBjournald.conf\fR(5), \fBlogind.conf\fR(5), \fBmodules-load.d\fR(5), \fBresolved.conf\fR(5), \fBsd-login\fR(3), +\fBsd_notify\fR(3), \fBsysctl.d\fR(5), \fBsystemctl\fR(1), \fBsystemd-delta\fR(1), @@ -8102,10 +8302,12 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-sleep.conf\fR(5), \fBsystemd-system.conf\fR(5), \fBsystemd.exec\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.link\fR(5), \fBsystemd.netdev\fR(5), \fBsystemd.network\fR(5), \fBsystemd.preset\fR(5), +\fBsystemd.service\fR(5), \fBsystemd.unit\fR(5), \fBsysusers.d\fR(5), \fBtimesyncd.conf\fR(5), @@ -8222,6 +8424,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/run/systemd/system\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /run/systemd/system\-preset/*\&.preset .RS 4 \fBsystemd.preset\fR(5) @@ -8242,6 +8449,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/run/systemd/user\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /run/systemd/user\-preset/*\&.preset .RS 4 \fBsystemd.preset\fR(5) @@ -8264,7 +8476,7 @@ $XDG_RUNTIME_DIR/systemd/user/ .PP /run/udev/hwdb\&.d .RS 4 -\fBudev\fR(7) +\fBhwdb\fR(7) .RE .PP /run/udev/rules\&.d @@ -8299,11 +8511,6 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-fsck@.service\fR(8) .RE .PP -/sbin/init -.RS 4 -\fBbootchart.conf\fR(5) -.RE -.PP /sbin/nologin .RS 4 \fBsysusers.d\fR(5) @@ -8315,6 +8522,16 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-gpt-auto-generator\fR(8) .RE .PP +/srv/webserver +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP +/srv/www +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP /sys .RS 4 \fBfile-hierarchy\fR(7), @@ -8324,6 +8541,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-nspawn\fR(1), \fBsystemd-remount-fs.service\fR(8), \fBsystemd.device\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.journal-fields\fR(7), \fBsystemd.socket\fR(5), \fBtmpfiles.d\fR(5), @@ -8402,11 +8620,13 @@ $XDG_RUNTIME_DIR/systemd/user/ .RS 4 \fBbootup\fR(7), \fBfile-hierarchy\fR(7), +\fBmachinectl\fR(1), \fBsystemd-fstab-generator\fR(8), \fBsystemd-nspawn\fR(1), \fBsystemd-remount-fs.service\fR(8), \fBsystemd-update-done.service\fR(8), \fBsystemd.exec\fR(5), +\fBsystemd.generator\fR(7), \fBsystemd.mount\fR(5), \fBsystemd.unit\fR(5) .RE @@ -8438,6 +8658,7 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBbootchart.conf\fR(5), \fBcoredump.conf\fR(5), \fBfile-hierarchy\fR(7), +\fBhwdb\fR(7), \fBjournald.conf\fR(5), \fBlogind.conf\fR(5), \fBmodules-load.d\fR(5), @@ -8470,6 +8691,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBkernel-install\fR(8) .RE .PP +/usr/lib/machines/ +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP /usr/lib/modules\-load\&.d/*\&.conf .RS 4 \fBmodules-load.d\fR(5) @@ -8502,6 +8728,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBcoredump.conf\fR(5) .RE .PP +/usr/lib/systemd/import\-pubring\&.gpg +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP /usr/lib/systemd/journald\&.conf\&.d/*\&.conf .RS 4 \fBjournald.conf\fR(5) @@ -8536,6 +8767,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/usr/lib/systemd/system\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /usr/lib/systemd/system\-generators/systemd\-cryptsetup\-generator .RS 4 \fBsystemd-cryptsetup-generator\fR(8) @@ -8611,6 +8847,16 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd-system.conf\fR(5) .RE .PP +/usr/lib/systemd/system/httpd\&.service +.RS 4 +\fBsystemd.unit\fR(5) +.RE +.PP +/usr/lib/systemd/systemd +.RS 4 +\fBbootchart.conf\fR(5) +.RE +.PP \fB/usr/lib/systemd/systemd\-activate\fR .RS 4 \fBsystemd-activate\fR(8) @@ -8796,6 +9042,11 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.unit\fR(5) .RE .PP +/usr/lib/systemd/user\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /usr/lib/systemd/user\-preset/*\&.preset .RS 4 \fBsystemd.preset\fR(5) @@ -8828,13 +9079,12 @@ $XDG_RUNTIME_DIR/systemd/user/ .PP /usr/lib/udev/hwdb\&.bin .RS 4 -\fBudev\fR(7), -\fBudevadm\fR(8) +\fBhwdb\fR(7) .RE .PP /usr/lib/udev/hwdb\&.d .RS 4 -\fBudev\fR(7) +\fBhwdb\fR(7) .RE .PP /usr/lib/udev/rules\&.d @@ -8852,11 +9102,26 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.exec\fR(5) .RE .PP +/usr/local/lib/machines/ +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP /usr/local/lib/systemd/system .RS 4 \fBsystemd\fR(1) .RE .PP +/usr/local/lib/systemd/system\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP +/usr/local/lib/systemd/user\-generators/ +.RS 4 +\fBsystemd.generator\fR(7) +.RE +.PP /usr/local/sbin .RS 4 \fBsystemd.exec\fR(5) @@ -8868,11 +9133,21 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBsystemd.exec\fR(5) .RE .PP +/usr/sbin/foo\-daemon +.RS 4 +\fBsystemd.service\fR(5) +.RE +.PP /usr/share .RS 4 \fBfile-hierarchy\fR(7) .RE .PP +/usr/share/dbus\-1/system\-services/org\&.example\&.simple\-dbus\-service\&.service +.RS 4 +\fBsystemd.service\fR(5) +.RE +.PP /usr/share/doc .RS 4 \fBfile-hierarchy\fR(7) @@ -8925,16 +9200,32 @@ $XDG_RUNTIME_DIR/systemd/user/ \fBfile-hierarchy\fR(7) .RE .PP +/var/lib/container/ +.RS 4 +\fBmachinectl\fR(1) +.RE +.PP /var/lib/dbus/machine\-id .RS 4 \fBmachine-id\fR(5) .RE .PP +/var/lib/machines/ +.RS 4 +\fBmachinectl\fR(1), +\fBsystemd-nspawn\fR(1) +.RE +.PP /var/lib/systemd/backlight/ .RS 4 \fBsystemd-backlight@.service\fR(8) .RE .PP +/var/lib/systemd/clock +.RS 4 +\fBsystemd-timesyncd.service\fR(8) +.RE +.PP /var/lib/systemd/coredump .RS 4 \fBcoredump.conf\fR(5), @@ -9164,6 +9455,16 @@ kexec\&.target \fBsystemd.special\fR(7) .RE .PP +libnss_myhostname\&.so\&.2 +.RS 4 +\fBnss-myhostname\fR(8) +.RE +.PP +libnss_mymachines\&.so\&.2 +.RS 4 +\fBnss-mymachines\fR(8) +.RE +.PP \fIlink\fR\&.link .RS 4 \fBsystemd.link\fR(5) @@ -9238,14 +9539,14 @@ network\&.target \fBsystemd.special\fR(7) .RE .PP -nss\-lookup\&.target +\fBnetworkctl\fR .RS 4 -\fBsystemd.special\fR(7) +\fBnetworkctl\fR(1) .RE .PP -nss\-myhostname\&.la +nss\-lookup\&.target .RS 4 -\fBnss-myhostname\fR(8) +\fBsystemd.special\fR(7) .RE .PP nss\-user\-lookup\&.target @@ -9595,6 +9896,11 @@ systemd\-hostnamed\&.service \fBsystemd-hostnamed.service\fR(8) .RE .PP +\fBsystemd\-hwdb\fR +.RS 4 +\fBsystemd-hwdb\fR(8) +.RE +.PP systemd\-hybrid\-sleep\&.service .RS 4 \fBsystemd-suspend.service\fR(8) @@ -9918,4 +10224,4 @@ user\&.slice .RE .SH "COLOPHON" .PP -This index contains 1777 entries in 14 sections, referring to 192 individual manual pages\&. +This index contains 1829 entries in 14 sections, referring to 197 individual manual pages\&. diff --git a/man/systemd.directives.html b/man/systemd.directives.html index 9a1be228c..6fff4cd5c 100644 --- a/man/systemd.directives.html +++ b/man/systemd.directives.html @@ -19,20 +19,20 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.directives — Index of configuration directives

Unit directives¶

Directives for configuring units, used in unit - files.

Accept=¶

systemd.socket(5)

AccuracySec=¶

systemd.timer(5)

After=¶

systemd.unit(5)

Alias=¶

systemd.unit(5)

AllowIsolate=¶

systemd.unit(5)

Also=¶

systemd.unit(5)

AppArmorProfile=¶

systemd.exec(5)

AssertACPower=¶

systemd.unit(5)

AssertArchitecture=¶

systemd.unit(5)

AssertCapability=¶

systemd.unit(5)

AssertDirectoryNotEmpty=¶

systemd.unit(5)

AssertFileIsExecutable=¶

systemd.unit(5)

AssertFileNotEmpty=¶

systemd.unit(5)

AssertFirstBoot=¶

systemd.unit(5)

AssertHost=¶

systemd.unit(5)

AssertKernelCommandLine=¶

systemd.unit(5)

AssertNeedsUpdate=¶

systemd.unit(5)

AssertPathExists=¶

systemd.unit(5)

AssertPathExistsGlob=¶

systemd.unit(5)

AssertPathIsDirectory=¶

systemd.unit(5)

AssertPathIsMountPoint=¶

systemd.unit(5)

AssertPathIsReadWrite=¶

systemd.unit(5)

AssertPathIsSymbolicLink=¶

systemd.unit(5)

AssertSecurity=¶

systemd.unit(5)

AssertVirtualization=¶

systemd.unit(5)

Backlog=¶

systemd.socket(5)

Before=¶

systemd.unit(5)

BindIPv6Only=¶

systemd.socket(5)

BindToDevice=¶

systemd.socket(5)

BindsTo=¶

systemd.unit(5)

BlockIOAccounting=¶

systemd.resource-control(5)

BlockIODeviceWeight=¶

systemd.resource-control(5)

BlockIOReadBandwidth=¶

systemd.resource-control(5)

BlockIOWeight=¶

systemd.resource-control(5)

BlockIOWriteBandwidth=¶

systemd.resource-control(5)

Broadcast=¶

systemd.socket(5)

BusName=¶

systemd.service(5)

BusPolicy=¶

systemd.service(5)

CPUAccounting=¶

systemd.resource-control(5)

CPUAffinity=¶

systemd.exec(5)

CPUQuota=¶

systemd.resource-control(5)

CPUSchedulingPolicy=¶

systemd.exec(5)

CPUSchedulingPriority=¶

systemd.exec(5)

CPUSchedulingResetOnFork=¶

systemd.exec(5)

CPUShares=¶

systemd.resource-control(5)

Capabilities=¶

systemd.exec(5)

CapabilityBoundingSet=¶

systemd.exec(5)

ConditionACPower=¶

systemd.unit(5)

ConditionArchitecture=¶

systemd.unit(5)

ConditionCapability=¶

systemd.unit(5)

ConditionDirectoryNotEmpty=¶

systemd.unit(5)

ConditionFileIsExecutable=¶

systemd.unit(5)

ConditionFileNotEmpty=¶

systemd.unit(5)

ConditionFirstBoot=¶

systemd.unit(5)

ConditionHost=¶

systemd.unit(5)

ConditionKernelCommandLine=¶

systemd.unit(5)

ConditionNeedsUpdate=¶

systemd.unit(5)

ConditionPathExists=¶

systemd.unit(5)

ConditionPathExistsGlob=¶

systemd.unit(5)

ConditionPathIsDirectory=¶

systemd.unit(5)

ConditionPathIsMountPoint=¶

systemd.unit(5)

ConditionPathIsReadWrite=¶

systemd.unit(5)

ConditionPathIsSymbolicLink=¶

systemd.unit(5)

ConditionSecurity=¶

systemd.unit(5)

ConditionVirtualization=¶

systemd.unit(5)

Conflicts=¶

systemd.unit(5)

DefaultDependencies=¶

systemd.unit(5)

DefaultInstance=¶

systemd.unit(5)

DeferAcceptSec=¶

systemd.socket(5)

Delegate=¶

systemd.resource-control(5)

Description=¶

systemd.unit(5)

DeviceAllow=¶

systemd.resource-control(5)

DevicePolicy=¶

systemd.resource-control(5)

DirectoryMode=¶

systemd.automount(5), systemd.mount(5), systemd.path(5), systemd.socket(5)

DirectoryNotEmpty=¶

systemd.path(5)

Documentation=¶

systemd.unit(5)

Environment=¶

systemd.exec(5)

EnvironmentFile=¶

systemd.exec(5)

ExecReload=¶

systemd.service(5)

ExecStart=¶

systemd.service(5)

ExecStartPost=¶

systemd.service(5), systemd.socket(5)

ExecStartPre=¶

systemd.service(5), systemd.socket(5)

ExecStop=¶

systemd.service(5)

ExecStopPost=¶

systemd.service(5), systemd.socket(5)

ExecStopPre=¶

systemd.socket(5)

FailureAction=¶

systemd.service(5)

FreeBind=¶

systemd.socket(5)

Group=¶

systemd.exec(5)

GuessMainPID=¶

systemd.service(5)

IOSchedulingClass=¶

systemd.exec(5)

IOSchedulingPriority=¶

systemd.exec(5)

IPTOS=¶

systemd.socket(5)

IPTTL=¶

systemd.socket(5)

IgnoreOnIsolate=¶

systemd.unit(5)

IgnoreOnSnapshot=¶

systemd.unit(5)

IgnoreSIGPIPE=¶

systemd.exec(5)

InaccessibleDirectories=¶

systemd.exec(5)

JobTimeoutAction=¶

systemd.unit(5)

JobTimeoutRebootArgument=¶

systemd.unit(5)

JobTimeoutSec=¶

systemd.unit(5)

JoinsNamespaceOf=¶

systemd.unit(5)

KeepAlive=¶

systemd.socket(5)

KeepAliveIntervalSec=¶

systemd.socket(5)

KeepAliveProbes=¶

systemd.socket(5)

KeepAliveTimeSec=¶

systemd.socket(5)

KillMode=¶

systemd.kill(5)

KillSignal=¶

systemd.kill(5)

LimitAS=¶

systemd.exec(5)

LimitCORE=¶

systemd.exec(5)

LimitCPU=¶

systemd.exec(5)

LimitDATA=¶

systemd.exec(5)

LimitFSIZE=¶

systemd.exec(5)

LimitLOCKS=¶

systemd.exec(5)

LimitMEMLOCK=¶

systemd.exec(5)

LimitMSGQUEUE=¶

systemd.exec(5)

LimitNICE=¶

systemd.exec(5)

LimitNOFILE=¶

systemd.exec(5)

LimitNPROC=¶

systemd.exec(5)

LimitRSS=¶

systemd.exec(5)

LimitRTPRIO=¶

systemd.exec(5)

LimitRTTIME=¶

systemd.exec(5)

LimitSIGPENDING=¶

systemd.exec(5)

LimitSTACK=¶

systemd.exec(5)

ListenDatagram=¶

systemd.socket(5)

ListenFIFO=¶

systemd.socket(5)

ListenMessageQueue=¶

systemd.socket(5)

ListenNetlink=¶

systemd.socket(5)

ListenSequentialPacket=¶

systemd.socket(5)

ListenSpecial=¶

systemd.socket(5)

ListenStream=¶

systemd.socket(5)

MakeDirectory=¶

systemd.path(5)

Mark=¶

systemd.socket(5)

MaxConnections=¶

systemd.socket(5)

MemoryAccounting=¶

systemd.resource-control(5)

MemoryLimit=¶

systemd.resource-control(5)

MessageQueueMaxMessages=¶

systemd.socket(5)

MessageQueueMessageSize=¶

systemd.socket(5)

MountFlags=¶

systemd.exec(5)

Nice=¶

systemd.exec(5)

NoDelay=¶

systemd.socket(5)

NoNewPrivileges=¶

systemd.exec(5)

NonBlocking=¶

systemd.service(5)

NotifyAccess=¶

systemd.service(5)

OOMScoreAdjust=¶

systemd.exec(5)

OnActiveSec=¶

systemd.timer(5)

OnBootSec=¶

systemd.timer(5)

OnCalendar=¶

systemd.timer(5)

OnFailure=¶

systemd.unit(5)

OnFailureJobMode=¶

systemd.unit(5)

OnStartupSec=¶

systemd.timer(5)

OnUnitActiveSec=¶

systemd.timer(5)

OnUnitInactiveSec=¶

systemd.timer(5)

Options=¶

systemd.mount(5), systemd.swap(5)

PAMName=¶

systemd.exec(5)

PIDFile=¶

systemd.service(5)

PartOf=¶

systemd.unit(5)

PassCredentials=¶

systemd.socket(5)

PassSecurity=¶

systemd.socket(5)

PathChanged=¶

systemd.path(5)

PathExists=¶

systemd.path(5)

PathExistsGlob=¶

systemd.path(5)

PathModified=¶

systemd.path(5)

PermissionsStartOnly=¶

systemd.service(5)

Persistent=¶

systemd.timer(5)

Personality=¶

systemd.exec(5)

PipeSize=¶

systemd.socket(5)

Priority=¶

systemd.socket(5), systemd.swap(5)

PrivateDevices=¶

systemd.exec(5)

PrivateNetwork=¶

systemd.exec(5)

PrivateTmp=¶

systemd.exec(5)

PropagatesReloadTo=¶

systemd.unit(5)

ProtectHome=¶

systemd.exec(5)

ProtectSystem=¶

systemd.exec(5)

ReadOnlyDirectories=¶

systemd.exec(5)

ReadWriteDirectories=¶

systemd.exec(5)

RebootArgument=¶

systemd.service(5)

ReceiveBuffer=¶

systemd.socket(5)

RefuseManualStart=¶

systemd.unit(5)

RefuseManualStop=¶

systemd.unit(5)

ReloadPropagatedFrom=¶

systemd.unit(5)

RemainAfterExit=¶

systemd.service(5)

RemoveOnStop=¶

systemd.socket(5)

RequiredBy=¶

systemd.unit(5)

Requires=¶

systemd.unit(5)

RequiresMountsFor=¶

systemd.unit(5)

RequiresOverridable=¶

systemd.unit(5)

Requisite=¶

systemd.unit(5)

RequisiteOverridable=¶

systemd.unit(5)

Restart=¶

systemd.service(5)

RestartForceExitStatus=¶

systemd.service(5)

RestartPreventExitStatus=¶

systemd.service(5)

RestartSec=¶

systemd.service(5)

RestrictAddressFamilies=¶

systemd.exec(5)

ReusePort=¶

systemd.socket(5)

RootDirectory=¶

systemd.exec(5)

RootDirectoryStartOnly=¶

systemd.service(5)

RuntimeDirectory=¶

systemd.exec(5)

RuntimeDirectoryMode=¶

systemd.exec(5)

SELinuxContext=¶

systemd.exec(5)

SELinuxContextFromNet=¶

systemd.socket(5)

SecureBits=¶

systemd.exec(5)

SendBuffer=¶

systemd.socket(5)

SendSIGHUP=¶

systemd.kill(5)

SendSIGKILL=¶

systemd.kill(5)

Service=¶

systemd.socket(5)

Slice=¶

systemd.resource-control(5)

SloppyOptions=¶

systemd.mount(5)

SmackLabel=¶

systemd.socket(5)

SmackLabelIPIn=¶

systemd.socket(5)

SmackLabelIPOut=¶

systemd.socket(5)

SmackProcessLabel=¶

systemd.exec(5)

SocketGroup=¶

systemd.socket(5)

SocketMode=¶

systemd.socket(5)

SocketUser=¶

systemd.socket(5)

Sockets=¶

systemd.service(5)

SourcePath=¶

systemd.unit(5)

StandardError=¶

systemd.exec(5)

StandardInput=¶

systemd.exec(5)

StandardOutput=¶

systemd.exec(5)

StartLimitAction=¶

systemd.service(5)

StartLimitBurst=¶

systemd.service(5)

StartLimitInterval=¶

systemd.service(5)

StartupBlockIOWeight=¶

systemd.resource-control(5)

StartupCPUShares=¶

systemd.resource-control(5)

StopWhenUnneeded=¶

systemd.unit(5)

SuccessExitStatus=¶

systemd.service(5)

SupplementaryGroups=¶

systemd.exec(5)

Symlinks=¶

systemd.socket(5)

SyslogFacility=¶

systemd.exec(5)

SyslogIdentifier=¶

systemd.exec(5)

SyslogLevel=¶

systemd.exec(5)

SyslogLevelPrefix=¶

systemd.exec(5)

SystemCallArchitectures=¶

systemd.exec(5)

SystemCallErrorNumber=¶

systemd.exec(5)

SystemCallFilter=¶

systemd.exec(5)

TCPCongestion=¶

systemd.socket(5)

TTYPath=¶

systemd.exec(5)

TTYReset=¶

systemd.exec(5)

TTYVHangup=¶

systemd.exec(5)

TTYVTDisallocate=¶

systemd.exec(5)

TimeoutSec=¶

systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.swap(5)

TimeoutStartSec=¶

systemd.service(5)

TimeoutStopSec=¶

systemd.service(5)

TimerSlackNSec=¶

systemd.exec(5)

Transparent=¶

systemd.socket(5)

Type=¶

systemd.mount(5), systemd.service(5)

UMask=¶

systemd.exec(5)

Unit=¶

systemd.path(5), systemd.timer(5)

User=¶

systemd.exec(5)

UtmpIdentifier=¶

systemd.exec(5)

WakeSystem=¶

systemd.timer(5)

WantedBy=¶

systemd.unit(5)

Wants=¶

systemd.unit(5)

WatchdogSec=¶

systemd.service(5)

What=¶

systemd.mount(5), systemd.swap(5)

Where=¶

systemd.automount(5), systemd.mount(5)

WorkingDirectory=¶

systemd.exec(5)

Options on the kernel command line¶

Kernel boot options for configuring the behaviour of the - systemd process.

-b¶

kernel-command-line(7), systemd(1)

1¶

kernel-command-line(7), systemd(1)

2¶

kernel-command-line(7), systemd(1)

3¶

kernel-command-line(7), systemd(1)

4¶

kernel-command-line(7), systemd(1)

5¶

kernel-command-line(7), systemd(1)

S¶

kernel-command-line(7), systemd(1)

debug¶

kernel-command-line(7), systemd(1)

emergency¶

kernel-command-line(7), systemd(1)

fsck.mode=¶

kernel-command-line(7), systemd-fsck@.service(8)

fsck.repair=¶

kernel-command-line(7), systemd-fsck@.service(8)

fstab=¶

kernel-command-line(7), systemd-fstab-generator(8)

locale.LANG=¶

kernel-command-line(7), systemd(1)

locale.LANGUAGE=¶

kernel-command-line(7), systemd(1)

locale.LC_ADDRESS=¶

kernel-command-line(7), systemd(1)

locale.LC_COLLATE=¶

kernel-command-line(7), systemd(1)

locale.LC_CTYPE=¶

kernel-command-line(7), systemd(1)

locale.LC_IDENTIFICATION=¶

kernel-command-line(7), systemd(1)

locale.LC_MEASUREMENT=¶

kernel-command-line(7), systemd(1)

locale.LC_MESSAGES=¶

kernel-command-line(7), systemd(1)

locale.LC_MONETARY=¶

kernel-command-line(7), systemd(1)

locale.LC_NAME=¶

kernel-command-line(7), systemd(1)

locale.LC_NUMERIC=¶

kernel-command-line(7), systemd(1)

locale.LC_PAPER=¶

kernel-command-line(7), systemd(1)

locale.LC_TELEPHONE=¶

kernel-command-line(7), systemd(1)

locale.LC_TIME=¶

kernel-command-line(7), systemd(1)

luks.crypttab=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.key=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.name=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.options=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.uuid=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

modules-load=¶

kernel-command-line(7), systemd-modules-load.service(8)

mount.usr=¶

systemd-fstab-generator(8)

mount.usrflags=¶

systemd-fstab-generator(8)

mount.usrfstype=¶

systemd-fstab-generator(8)

net.ifnames=¶

kernel-command-line(7), systemd-udevd.service(8)

plymouth.enable=¶

kernel-command-line(7)

quiet¶

kernel-command-line(7), systemd(1)

quotacheck.mode=¶

kernel-command-line(7), systemd-quotacheck.service(8)

rd.fstab=¶

kernel-command-line(7), systemd-fstab-generator(8)

rd.luks.crypttab=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.key=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.name=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.options=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.uuid=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.modules-load=¶

kernel-command-line(7), systemd-modules-load.service(8)

rd.systemd.gpt_auto=¶

kernel-command-line(7)

rd.systemd.unit=¶

kernel-command-line(7), systemd(1)

rd.udev.children-max=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.event-timeout=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.exec-delay=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.log-priority=¶

kernel-command-line(7), systemd-udevd.service(8)

rescue¶

kernel-command-line(7), systemd(1)

resume=¶

kernel-command-line(7), systemd-hibernate-resume-generator(8)

ro¶

kernel-command-line(7)

root=¶

kernel-command-line(7), systemd-fstab-generator(8)

rootflags=¶

systemd-fstab-generator(8)

rootfsflags=¶

kernel-command-line(7)

rootfstype=¶

kernel-command-line(7), systemd-fstab-generator(8)

rw¶

kernel-command-line(7)

s¶

kernel-command-line(7), systemd(1)

single¶

kernel-command-line(7), systemd(1)

systemd.confirm_spawn=¶

kernel-command-line(7), systemd(1)

systemd.crash_chvt=¶

kernel-command-line(7), systemd(1)

systemd.crash_shell=¶

kernel-command-line(7), systemd(1)

systemd.debug-shell¶

kernel-command-line(7)

systemd.default_standard_error=¶

kernel-command-line(7), systemd(1)

systemd.default_standard_output=¶

kernel-command-line(7), systemd(1)

systemd.dump_core=¶

kernel-command-line(7), systemd(1)

systemd.gpt_auto=¶

kernel-command-line(7)

systemd.journald.forward_to_console=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_kmsg=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_syslog=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_wall=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.log_color=¶

kernel-command-line(7), systemd(1)

systemd.log_level=¶

kernel-command-line(7), systemd(1)

systemd.log_location=¶

kernel-command-line(7), systemd(1)

systemd.log_target=¶

kernel-command-line(7), systemd(1)

systemd.mask=¶

kernel-command-line(7)

systemd.restore_state=¶

kernel-command-line(7), systemd-backlight@.service(8), systemd-rfkill@.service(8)

systemd.setenv=¶

kernel-command-line(7), systemd(1)

systemd.show_status=¶

kernel-command-line(7), systemd(1)

systemd.unit=¶

kernel-command-line(7), systemd(1)

systemd.wants=¶

kernel-command-line(7)

udev.children-max=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.event-timeout=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.exec-delay=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.log-priority=¶

kernel-command-line(7), systemd-udevd.service(8)

vconsole.font.map=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.font.unimap=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.font=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.keymap.toggle=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.keymap=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

Environment variables¶

Environment variables understood by the systemd - manager and other programs.

$HOME¶

systemd.exec(5)

$LANG¶

systemd.exec(5)

$LISTEN_FDS¶

sd_listen_fds(3), systemd(1), systemd-activate(8), systemd.exec(5)

$LISTEN_PID¶

sd_listen_fds(3), systemd(1), systemd-activate(8), systemd.exec(5)

$LOGNAME¶

systemd.exec(5)

$MAINPID¶

systemd.exec(5)

$MANAGERPID¶

systemd.exec(5)

$NOTIFY_SOCKET¶

sd_notify(3), systemd(1)

$PATH¶

systemd.exec(5)

$PREVLEVEL¶

runlevel(8)

$RUNLEVEL¶

runlevel(8)

$SHELL¶

systemd.exec(5)

$SYSTEMD_EDITOR¶

systemctl(1)

$SYSTEMD_LESS¶

journalctl(1), localectl(1), loginctl(1), machinectl(1), systemd-analyze(1), timedatectl(1)

$SYSTEMD_LOG_COLOR¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_LEVEL¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_LOCATION¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_TARGET¶

systemd(1), systemd-activate(8)

$SYSTEMD_PAGER¶

journalctl(1), localectl(1), loginctl(1), machinectl(1), systemd-analyze(1), timedatectl(1)

$SYSTEMD_SYSVINIT_PATH¶

systemd(1)

$SYSTEMD_SYSVRCND_PATH¶

systemd(1)

$SYSTEMD_UNIT_PATH¶

systemd(1)

$TERM¶

systemd.exec(5)

$USER¶

systemd.exec(5)

$WATCHDOG_PID¶

sd_watchdog_enabled(3)

$WATCHDOG_USEC¶

sd_watchdog_enabled(3)

$XDG_CONFIG_DIRS¶

systemd(1)

$XDG_CONFIG_HOME¶

systemd(1)

$XDG_DATA_DIRS¶

systemd(1)

$XDG_DATA_HOME¶

systemd(1)

$XDG_RUNTIME_DIR¶

pam_systemd(8), systemd.exec(5)

$XDG_SEAT¶

pam_systemd(8), systemd.exec(5)

$XDG_SESSION_CLASS¶

pam_systemd(8)

$XDG_SESSION_DESKTOP¶

pam_systemd(8)

$XDG_SESSION_ID¶

pam_systemd(8), systemd.exec(5)

$XDG_SESSION_TYPE¶

pam_systemd(8)

$XDG_VTNR¶

pam_systemd(8), systemd.exec(5)

UDEV directives¶

Directives for configuring systemd units through the - udev database.

Network directives¶

Directives for configuring network links through the + gudev systemd 219


Name

systemd.directives — Index of configuration directives

Unit directives¶

Directives for configuring units, used in unit + files.

Accept=¶

systemd.socket(5)

AccuracySec=¶

systemd.timer(5)

After=¶

systemd.unit(5)

Alias=¶

systemd.unit(5)

AllowIsolate=¶

systemd.unit(5)

Also=¶

systemd.unit(5)

AppArmorProfile=¶

systemd.exec(5)

AssertACPower=¶

systemd.unit(5)

AssertArchitecture=¶

systemd.unit(5)

AssertCapability=¶

systemd.unit(5)

AssertDirectoryNotEmpty=¶

systemd.unit(5)

AssertFileIsExecutable=¶

systemd.unit(5)

AssertFileNotEmpty=¶

systemd.unit(5)

AssertFirstBoot=¶

systemd.unit(5)

AssertHost=¶

systemd.unit(5)

AssertKernelCommandLine=¶

systemd.unit(5)

AssertNeedsUpdate=¶

systemd.unit(5)

AssertPathExists=¶

systemd.unit(5)

AssertPathExistsGlob=¶

systemd.unit(5)

AssertPathIsDirectory=¶

systemd.unit(5)

AssertPathIsMountPoint=¶

systemd.unit(5)

AssertPathIsReadWrite=¶

systemd.unit(5)

AssertPathIsSymbolicLink=¶

systemd.unit(5)

AssertSecurity=¶

systemd.unit(5)

AssertVirtualization=¶

systemd.unit(5)

Backlog=¶

systemd.socket(5)

Before=¶

systemd.unit(5)

BindIPv6Only=¶

systemd.socket(5)

BindToDevice=¶

systemd.socket(5)

BindsTo=¶

systemd.unit(5)

BlockIOAccounting=¶

systemd.resource-control(5)

BlockIODeviceWeight=¶

systemd.resource-control(5)

BlockIOReadBandwidth=¶

systemd.resource-control(5)

BlockIOWeight=¶

systemd.resource-control(5)

BlockIOWriteBandwidth=¶

systemd.resource-control(5)

Broadcast=¶

systemd.socket(5)

BusName=¶

systemd.service(5)

BusPolicy=¶

systemd.service(5)

CPUAccounting=¶

systemd.resource-control(5)

CPUAffinity=¶

systemd.exec(5)

CPUQuota=¶

systemd.resource-control(5)

CPUSchedulingPolicy=¶

systemd.exec(5)

CPUSchedulingPriority=¶

systemd.exec(5)

CPUSchedulingResetOnFork=¶

systemd.exec(5)

CPUShares=¶

systemd.resource-control(5)

Capabilities=¶

systemd.exec(5)

CapabilityBoundingSet=¶

systemd.exec(5)

ConditionACPower=¶

systemd.unit(5)

ConditionArchitecture=¶

systemd.unit(5)

ConditionCapability=¶

systemd.unit(5)

ConditionDirectoryNotEmpty=¶

systemd.unit(5)

ConditionFileIsExecutable=¶

systemd.unit(5)

ConditionFileNotEmpty=¶

systemd.unit(5)

ConditionFirstBoot=¶

systemd.unit(5)

ConditionHost=¶

systemd.unit(5)

ConditionKernelCommandLine=¶

systemd.unit(5)

ConditionNeedsUpdate=¶

systemd.unit(5)

ConditionPathExists=¶

systemd.unit(5)

ConditionPathExistsGlob=¶

systemd.unit(5)

ConditionPathIsDirectory=¶

systemd.unit(5)

ConditionPathIsMountPoint=¶

systemd.unit(5)

ConditionPathIsReadWrite=¶

systemd.unit(5)

ConditionPathIsSymbolicLink=¶

systemd.unit(5)

ConditionSecurity=¶

systemd.unit(5)

ConditionVirtualization=¶

systemd.unit(5)

Conflicts=¶

systemd.unit(5)

DefaultDependencies=¶

systemd.unit(5)

DefaultInstance=¶

systemd.unit(5)

DeferAcceptSec=¶

systemd.socket(5)

Delegate=¶

systemd.resource-control(5)

Description=¶

systemd.unit(5)

DeviceAllow=¶

systemd.resource-control(5)

DevicePolicy=¶

systemd.resource-control(5)

DirectoryMode=¶

systemd.automount(5), systemd.mount(5), systemd.path(5), systemd.socket(5)

DirectoryNotEmpty=¶

systemd.path(5)

Documentation=¶

systemd.unit(5)

Environment=¶

systemd.exec(5)

EnvironmentFile=¶

systemd.exec(5)

ExecReload=¶

systemd.service(5)

ExecStart=¶

systemd.service(5)

ExecStartPost=¶

systemd.service(5), systemd.socket(5)

ExecStartPre=¶

systemd.service(5), systemd.socket(5)

ExecStop=¶

systemd.service(5)

ExecStopPost=¶

systemd.service(5), systemd.socket(5)

ExecStopPre=¶

systemd.socket(5)

FailureAction=¶

systemd.service(5)

FileDescriptorStoreMax=¶

systemd.service(5)

FreeBind=¶

systemd.socket(5)

Group=¶

systemd.exec(5)

GuessMainPID=¶

systemd.service(5)

IOSchedulingClass=¶

systemd.exec(5)

IOSchedulingPriority=¶

systemd.exec(5)

IPTOS=¶

systemd.socket(5)

IPTTL=¶

systemd.socket(5)

IgnoreOnIsolate=¶

systemd.unit(5)

IgnoreOnSnapshot=¶

systemd.unit(5)

IgnoreSIGPIPE=¶

systemd.exec(5)

InaccessibleDirectories=¶

systemd.exec(5)

JobTimeoutAction=¶

systemd.unit(5)

JobTimeoutRebootArgument=¶

systemd.unit(5)

JobTimeoutSec=¶

systemd.unit(5)

JoinsNamespaceOf=¶

systemd.unit(5)

KeepAlive=¶

systemd.socket(5)

KeepAliveIntervalSec=¶

systemd.socket(5)

KeepAliveProbes=¶

systemd.socket(5)

KeepAliveTimeSec=¶

systemd.socket(5)

KillMode=¶

systemd.kill(5)

KillSignal=¶

systemd.kill(5)

LimitAS=¶

systemd.exec(5)

LimitCORE=¶

systemd.exec(5)

LimitCPU=¶

systemd.exec(5)

LimitDATA=¶

systemd.exec(5)

LimitFSIZE=¶

systemd.exec(5)

LimitLOCKS=¶

systemd.exec(5)

LimitMEMLOCK=¶

systemd.exec(5)

LimitMSGQUEUE=¶

systemd.exec(5)

LimitNICE=¶

systemd.exec(5)

LimitNOFILE=¶

systemd.exec(5)

LimitNPROC=¶

systemd.exec(5)

LimitRSS=¶

systemd.exec(5)

LimitRTPRIO=¶

systemd.exec(5)

LimitRTTIME=¶

systemd.exec(5)

LimitSIGPENDING=¶

systemd.exec(5)

LimitSTACK=¶

systemd.exec(5)

ListenDatagram=¶

systemd.socket(5)

ListenFIFO=¶

systemd.socket(5)

ListenMessageQueue=¶

systemd.socket(5)

ListenNetlink=¶

systemd.socket(5)

ListenSequentialPacket=¶

systemd.socket(5)

ListenSpecial=¶

systemd.socket(5)

ListenStream=¶

systemd.socket(5)

MakeDirectory=¶

systemd.path(5)

Mark=¶

systemd.socket(5)

MaxConnections=¶

systemd.socket(5)

MemoryAccounting=¶

systemd.resource-control(5)

MemoryLimit=¶

systemd.resource-control(5)

MessageQueueMaxMessages=¶

systemd.socket(5)

MessageQueueMessageSize=¶

systemd.socket(5)

MountFlags=¶

systemd.exec(5)

Nice=¶

systemd.exec(5)

NoDelay=¶

systemd.socket(5)

NoNewPrivileges=¶

systemd.exec(5)

NonBlocking=¶

systemd.service(5)

NotifyAccess=¶

systemd.service(5)

OOMScoreAdjust=¶

systemd.exec(5)

OnActiveSec=¶

systemd.timer(5)

OnBootSec=¶

systemd.timer(5)

OnCalendar=¶

systemd.timer(5)

OnFailure=¶

systemd.unit(5)

OnFailureJobMode=¶

systemd.unit(5)

OnStartupSec=¶

systemd.timer(5)

OnUnitActiveSec=¶

systemd.timer(5)

OnUnitInactiveSec=¶

systemd.timer(5)

Options=¶

systemd.mount(5), systemd.swap(5)

PAMName=¶

systemd.exec(5)

PIDFile=¶

systemd.service(5)

PartOf=¶

systemd.unit(5)

PassCredentials=¶

systemd.socket(5)

PassSecurity=¶

systemd.socket(5)

PathChanged=¶

systemd.path(5)

PathExists=¶

systemd.path(5)

PathExistsGlob=¶

systemd.path(5)

PathModified=¶

systemd.path(5)

PermissionsStartOnly=¶

systemd.service(5)

Persistent=¶

systemd.timer(5)

Personality=¶

systemd.exec(5)

PipeSize=¶

systemd.socket(5)

Priority=¶

systemd.socket(5), systemd.swap(5)

PrivateDevices=¶

systemd.exec(5)

PrivateNetwork=¶

systemd.exec(5)

PrivateTmp=¶

systemd.exec(5)

PropagatesReloadTo=¶

systemd.unit(5)

ProtectHome=¶

systemd.exec(5)

ProtectSystem=¶

systemd.exec(5)

ReadOnlyDirectories=¶

systemd.exec(5)

ReadWriteDirectories=¶

systemd.exec(5)

RebootArgument=¶

systemd.service(5)

ReceiveBuffer=¶

systemd.socket(5)

RefuseManualStart=¶

systemd.unit(5)

RefuseManualStop=¶

systemd.unit(5)

ReloadPropagatedFrom=¶

systemd.unit(5)

RemainAfterExit=¶

systemd.service(5)

RemoveOnStop=¶

systemd.socket(5)

RequiredBy=¶

systemd.unit(5)

Requires=¶

systemd.unit(5)

RequiresMountsFor=¶

systemd.unit(5)

RequiresOverridable=¶

systemd.unit(5)

Requisite=¶

systemd.unit(5)

RequisiteOverridable=¶

systemd.unit(5)

Restart=¶

systemd.service(5)

RestartForceExitStatus=¶

systemd.service(5)

RestartPreventExitStatus=¶

systemd.service(5)

RestartSec=¶

systemd.service(5)

RestrictAddressFamilies=¶

systemd.exec(5)

ReusePort=¶

systemd.socket(5)

RootDirectory=¶

systemd.exec(5)

RootDirectoryStartOnly=¶

systemd.service(5)

RuntimeDirectory=¶

systemd.exec(5)

RuntimeDirectoryMode=¶

systemd.exec(5)

SELinuxContext=¶

systemd.exec(5)

SELinuxContextFromNet=¶

systemd.socket(5)

SecureBits=¶

systemd.exec(5)

SendBuffer=¶

systemd.socket(5)

SendSIGHUP=¶

systemd.kill(5)

SendSIGKILL=¶

systemd.kill(5)

Service=¶

systemd.socket(5)

Slice=¶

systemd.resource-control(5)

SloppyOptions=¶

systemd.mount(5)

SmackLabel=¶

systemd.socket(5)

SmackLabelIPIn=¶

systemd.socket(5)

SmackLabelIPOut=¶

systemd.socket(5)

SmackProcessLabel=¶

systemd.exec(5)

SocketGroup=¶

systemd.socket(5)

SocketMode=¶

systemd.socket(5)

SocketUser=¶

systemd.socket(5)

Sockets=¶

systemd.service(5)

SourcePath=¶

systemd.unit(5)

StandardError=¶

systemd.exec(5)

StandardInput=¶

systemd.exec(5)

StandardOutput=¶

systemd.exec(5)

StartLimitAction=¶

systemd.service(5)

StartLimitBurst=¶

systemd.service(5)

StartLimitInterval=¶

systemd.service(5)

StartupBlockIOWeight=¶

systemd.resource-control(5)

StartupCPUShares=¶

systemd.resource-control(5)

StopWhenUnneeded=¶

systemd.unit(5)

SuccessExitStatus=¶

systemd.service(5)

SupplementaryGroups=¶

systemd.exec(5)

Symlinks=¶

systemd.socket(5)

SyslogFacility=¶

systemd.exec(5)

SyslogIdentifier=¶

systemd.exec(5)

SyslogLevel=¶

systemd.exec(5)

SyslogLevelPrefix=¶

systemd.exec(5)

SystemCallArchitectures=¶

systemd.exec(5)

SystemCallErrorNumber=¶

systemd.exec(5)

SystemCallFilter=¶

systemd.exec(5)

TCPCongestion=¶

systemd.socket(5)

TTYPath=¶

systemd.exec(5)

TTYReset=¶

systemd.exec(5)

TTYVHangup=¶

systemd.exec(5)

TTYVTDisallocate=¶

systemd.exec(5)

TimeoutSec=¶

systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.swap(5)

TimeoutStartSec=¶

systemd.service(5)

TimeoutStopSec=¶

systemd.service(5)

TimerSlackNSec=¶

systemd.exec(5)

Transparent=¶

systemd.socket(5)

Type=¶

systemd.mount(5), systemd.service(5)

UMask=¶

systemd.exec(5)

Unit=¶

systemd.path(5), systemd.timer(5)

User=¶

systemd.exec(5)

UtmpIdentifier=¶

systemd.exec(5)

WakeSystem=¶

systemd.timer(5)

WantedBy=¶

systemd.unit(5)

Wants=¶

systemd.unit(5)

WatchdogSec=¶

systemd.service(5)

What=¶

systemd.mount(5), systemd.swap(5)

Where=¶

systemd.automount(5), systemd.mount(5)

WorkingDirectory=¶

systemd.exec(5)

Options on the kernel command line¶

Kernel boot options for configuring the behaviour of the + systemd process.

-b¶

kernel-command-line(7), systemd(1)

1¶

kernel-command-line(7), systemd(1)

2¶

kernel-command-line(7), systemd(1)

3¶

kernel-command-line(7), systemd(1)

4¶

kernel-command-line(7), systemd(1)

5¶

kernel-command-line(7), systemd(1)

S¶

kernel-command-line(7), systemd(1)

debug¶

kernel-command-line(7), systemd(1)

emergency¶

kernel-command-line(7), systemd(1)

fsck.mode=¶

kernel-command-line(7), systemd-fsck@.service(8)

fsck.repair=¶

kernel-command-line(7), systemd-fsck@.service(8)

fstab=¶

kernel-command-line(7), systemd-fstab-generator(8)

locale.LANG=¶

kernel-command-line(7), systemd(1)

locale.LANGUAGE=¶

kernel-command-line(7), systemd(1)

locale.LC_ADDRESS=¶

kernel-command-line(7), systemd(1)

locale.LC_COLLATE=¶

kernel-command-line(7), systemd(1)

locale.LC_CTYPE=¶

kernel-command-line(7), systemd(1)

locale.LC_IDENTIFICATION=¶

kernel-command-line(7), systemd(1)

locale.LC_MEASUREMENT=¶

kernel-command-line(7), systemd(1)

locale.LC_MESSAGES=¶

kernel-command-line(7), systemd(1)

locale.LC_MONETARY=¶

kernel-command-line(7), systemd(1)

locale.LC_NAME=¶

kernel-command-line(7), systemd(1)

locale.LC_NUMERIC=¶

kernel-command-line(7), systemd(1)

locale.LC_PAPER=¶

kernel-command-line(7), systemd(1)

locale.LC_TELEPHONE=¶

kernel-command-line(7), systemd(1)

locale.LC_TIME=¶

kernel-command-line(7), systemd(1)

luks.crypttab=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.key=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.name=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.options=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks.uuid=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

luks=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

modules-load=¶

kernel-command-line(7), systemd-modules-load.service(8)

mount.usr=¶

systemd-fstab-generator(8)

mount.usrflags=¶

systemd-fstab-generator(8)

mount.usrfstype=¶

systemd-fstab-generator(8)

net.ifnames=¶

kernel-command-line(7), systemd-udevd.service(8)

plymouth.enable=¶

kernel-command-line(7)

quiet¶

kernel-command-line(7), systemd(1)

quotacheck.mode=¶

kernel-command-line(7), systemd-quotacheck.service(8)

rd.fstab=¶

kernel-command-line(7), systemd-fstab-generator(8)

rd.luks.crypttab=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.key=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.name=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.options=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks.uuid=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.luks=¶

kernel-command-line(7), systemd-cryptsetup-generator(8)

rd.modules-load=¶

kernel-command-line(7), systemd-modules-load.service(8)

rd.systemd.gpt_auto=¶

kernel-command-line(7)

rd.systemd.unit=¶

kernel-command-line(7), systemd(1)

rd.udev.children-max=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.event-timeout=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.exec-delay=¶

kernel-command-line(7), systemd-udevd.service(8)

rd.udev.log-priority=¶

kernel-command-line(7), systemd-udevd.service(8)

rescue¶

kernel-command-line(7), systemd(1)

resume=¶

kernel-command-line(7), systemd-hibernate-resume-generator(8)

ro¶

kernel-command-line(7)

root=¶

kernel-command-line(7), systemd-fstab-generator(8)

rootflags=¶

systemd-fstab-generator(8)

rootfsflags=¶

kernel-command-line(7)

rootfstype=¶

kernel-command-line(7), systemd-fstab-generator(8)

rw¶

kernel-command-line(7)

s¶

kernel-command-line(7), systemd(1)

single¶

kernel-command-line(7), systemd(1)

systemd.confirm_spawn=¶

kernel-command-line(7), systemd(1)

systemd.crash_chvt=¶

kernel-command-line(7), systemd(1)

systemd.crash_shell=¶

kernel-command-line(7), systemd(1)

systemd.debug-shell¶

kernel-command-line(7)

systemd.default_standard_error=¶

kernel-command-line(7), systemd(1)

systemd.default_standard_output=¶

kernel-command-line(7), systemd(1)

systemd.dump_core=¶

kernel-command-line(7), systemd(1)

systemd.gpt_auto=¶

kernel-command-line(7)

systemd.journald.forward_to_console=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_kmsg=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_syslog=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.journald.forward_to_wall=¶

kernel-command-line(7), systemd-journald.service(8)

systemd.log_color=¶

kernel-command-line(7), systemd(1)

systemd.log_level=¶

kernel-command-line(7), systemd(1)

systemd.log_location=¶

kernel-command-line(7), systemd(1)

systemd.log_target=¶

kernel-command-line(7), systemd(1)

systemd.mask=¶

kernel-command-line(7)

systemd.restore_state=¶

kernel-command-line(7), systemd-backlight@.service(8), systemd-rfkill@.service(8)

systemd.setenv=¶

kernel-command-line(7), systemd(1)

systemd.show_status=¶

kernel-command-line(7), systemd(1)

systemd.unit=¶

kernel-command-line(7), systemd(1)

systemd.wants=¶

kernel-command-line(7)

udev.children-max=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.event-timeout=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.exec-delay=¶

kernel-command-line(7), systemd-udevd.service(8)

udev.log-priority=¶

kernel-command-line(7), systemd-udevd.service(8)

vconsole.font.map=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.font.unimap=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.font=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.keymap.toggle=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

vconsole.keymap=¶

kernel-command-line(7), systemd-vconsole-setup.service(8)

Environment variables¶

Environment variables understood by the systemd + manager and other programs.

$HOME¶

systemd.exec(5)

$LANG¶

systemd.exec(5)

$LISTEN_FDS¶

sd_listen_fds(3), systemd(1), systemd-activate(8), systemd.exec(5)

$LISTEN_PID¶

sd_listen_fds(3), systemd(1), systemd-activate(8), systemd.exec(5)

$LOGNAME¶

systemd.exec(5)

$MAINPID¶

systemd.exec(5)

$MANAGERPID¶

systemd.exec(5)

$NOTIFY_SOCKET¶

sd_notify(3), systemd(1)

$PATH¶

systemd.exec(5)

$PREVLEVEL¶

runlevel(8)

$RUNLEVEL¶

runlevel(8)

$SHELL¶

systemd.exec(5)

$SYSTEMD_EDITOR¶

systemctl(1)

$SYSTEMD_LESS¶

journalctl(1), localectl(1), loginctl(1), machinectl(1), systemd-analyze(1), timedatectl(1)

$SYSTEMD_LOG_COLOR¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_LEVEL¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_LOCATION¶

systemd(1), systemd-activate(8)

$SYSTEMD_LOG_TARGET¶

systemd(1), systemd-activate(8)

$SYSTEMD_PAGER¶

journalctl(1), localectl(1), loginctl(1), machinectl(1), systemd-analyze(1), timedatectl(1)

$SYSTEMD_SYSVINIT_PATH¶

systemd(1)

$SYSTEMD_SYSVRCND_PATH¶

systemd(1)

$SYSTEMD_UNIT_PATH¶

systemd(1)

$TERM¶

systemd.exec(5)

$USER¶

systemd.exec(5)

$WATCHDOG_PID¶

sd_watchdog_enabled(3)

$WATCHDOG_USEC¶

sd_watchdog_enabled(3)

$XDG_CONFIG_DIRS¶

systemd(1)

$XDG_CONFIG_HOME¶

systemd(1)

$XDG_DATA_DIRS¶

systemd(1)

$XDG_DATA_HOME¶

systemd(1)

$XDG_RUNTIME_DIR¶

pam_systemd(8), systemd.exec(5)

$XDG_SEAT¶

pam_systemd(8), systemd.exec(5)

$XDG_SESSION_CLASS¶

pam_systemd(8)

$XDG_SESSION_DESKTOP¶

pam_systemd(8)

$XDG_SESSION_ID¶

pam_systemd(8), systemd.exec(5)

$XDG_SESSION_TYPE¶

pam_systemd(8)

$XDG_VTNR¶

pam_systemd(8), systemd.exec(5)

UDEV directives¶

Directives for configuring systemd units through the + udev database.

Network directives¶

Directives for configuring network links through the net-setup-link udev builtin and networks through - systemd-networkd.

ARPProxy=¶

systemd.netdev(5)

Address=¶

systemd.network(5)

Alias=¶

systemd.link(5)

Architecture=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

BitsPerSecond=¶

systemd.link(5)

Bond=¶

systemd.network(5)

Bridge=¶

systemd.network(5)

Broadcast=¶

systemd.network(5)

Cost=¶

systemd.network(5)

CriticalConnection=¶

systemd.network(5)

DHCP=¶

systemd.network(5)

DHCPServer=¶

systemd.network(5)

DNS=¶

resolved.conf(5), systemd.network(5)

Description=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

Destination=¶

systemd.network(5)

DiscoverPathMTU=¶

systemd.netdev(5)

Domains=¶

systemd.network(5)

DownDelaySec=¶

systemd.netdev(5)

Driver=¶

systemd.link(5), systemd.network(5)

Duplex=¶

systemd.link(5)

FDBAgeingSec=¶

systemd.netdev(5)

FallbackDNS=¶

resolved.conf(5)

FallbackNTP=¶

timesyncd.conf(5)

Gateway=¶

systemd.network(5)

Group=¶

systemd.netdev(5)

Host=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

IPv4LL=¶

systemd.network(5)

IPv4LLRoute=¶

systemd.network(5)

Id=¶

systemd.netdev(5)

KernelCommandLine=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

Kind=¶

systemd.netdev(5)

L2MissNotification=¶

systemd.netdev(5)

L3MissNotification=¶

systemd.netdev(5)

LACPTransmitRate=¶

systemd.netdev(5)

LLMNR=¶

resolved.conf(5), systemd.network(5)

Label=¶

systemd.network(5)

Local=¶

systemd.netdev(5)

MACAddress=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

MACAddressPolicy=¶

systemd.link(5)

MACVLAN=¶

systemd.network(5)

MIIMonitorSec=¶

systemd.netdev(5)

MTUBytes=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

MacLearning=¶

systemd.netdev(5)

Metric=¶

systemd.network(5)

Mode=¶

systemd.netdev(5)

MultiQueue=¶

systemd.netdev(5)

NTP=¶

systemd.network(5), timesyncd.conf(5)

Name=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

NamePolicy=¶

systemd.link(5)

OneQueue=¶

systemd.netdev(5)

OriginalName=¶

systemd.link(5)

PacketInfo=¶

systemd.netdev(5)

Path=¶

systemd.link(5), systemd.network(5)

Peer=¶

systemd.network(5)

Remote=¶

systemd.netdev(5)

RequestBroadcast=¶

systemd.network(5)

RouteMetric=¶

systemd.network(5)

RouteShortCircuit=¶

systemd.netdev(5)

SendHostname=¶

systemd.network(5)

Source=¶

systemd.network(5)

TOS=¶

systemd.netdev(5)

TTL=¶

systemd.netdev(5)

TransmitHashPolicy=¶

systemd.netdev(5)

Tunnel=¶

systemd.network(5)

Type=¶

systemd.link(5), systemd.network(5)

UpDelaySec=¶

systemd.netdev(5)

UseDNS=¶

systemd.network(5)

UseDomains=¶

systemd.network(5)

UseHostname=¶

systemd.network(5)

UseMTU=¶

systemd.network(5)

UseRoutes=¶

systemd.network(5)

User=¶

systemd.netdev(5)

VLAN=¶

systemd.network(5)

VXLAN=¶

systemd.network(5)

VendorClassIdentifier=¶

systemd.network(5)

Virtualization=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

WakeOnLan=¶

systemd.link(5)

Journal fields¶

Fields in the journal events with a well known meaning.

CODE_FILE=¶

systemd.journal-fields(7)

CODE_FUNC=¶

systemd.journal-fields(7)

CODE_LINE=¶

systemd.journal-fields(7)

COREDUMP_UNIT=¶

systemd.journal-fields(7)

COREDUMP_USER_UNIT=¶

systemd.journal-fields(7)

ERRNO=¶

systemd.journal-fields(7)

MESSAGE=¶

systemd.journal-fields(7)

MESSAGE_ID=¶

systemd.journal-fields(7)

OBJECT_AUDIT_LOGINUID=¶

systemd.journal-fields(7)

OBJECT_AUDIT_SESSION=¶

systemd.journal-fields(7)

OBJECT_CMDLINE=¶

systemd.journal-fields(7)

OBJECT_COMM=¶

systemd.journal-fields(7)

OBJECT_EXE=¶

systemd.journal-fields(7)

OBJECT_GID=¶

systemd.journal-fields(7)

OBJECT_PID=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_CGROUP=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_OWNER_UID=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_SESSION=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_UNIT=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_USER_UNIT=¶

systemd.journal-fields(7)

OBJECT_UID=¶

systemd.journal-fields(7)

PRIORITY=¶

systemd.journal-fields(7)

SYSLOG_FACILITY=¶

systemd.journal-fields(7)

SYSLOG_IDENTIFIER=¶

systemd.journal-fields(7)

SYSLOG_PID=¶

systemd.journal-fields(7)

_AUDIT_LOGINUID=¶

systemd.journal-fields(7)

_AUDIT_SESSION=¶

systemd.journal-fields(7)

_BOOT_ID=¶

systemd.journal-fields(7)

_CAP_EFFECTIVE=¶

systemd.journal-fields(7)

_CMDLINE=¶

systemd.journal-fields(7)

_COMM=¶

systemd.journal-fields(7)

_EXE=¶

systemd.journal-fields(7)

_GID=¶

systemd.journal-fields(7)

_HOSTNAME=¶

systemd.journal-fields(7)

_KERNEL_DEVICE=¶

systemd.journal-fields(7)

_KERNEL_SUBSYSTEM=¶

systemd.journal-fields(7)

_MACHINE_ID=¶

systemd.journal-fields(7)

_PID=¶

systemd.journal-fields(7)

_SELINUX_CONTEXT=¶

systemd.journal-fields(7)

_SOURCE_REALTIME_TIMESTAMP=¶

systemd.journal-fields(7)

_SYSTEMD_CGROUP=¶

systemd.journal-fields(7)

_SYSTEMD_OWNER_UID=¶

systemd.journal-fields(7)

_SYSTEMD_SESSION=¶

systemd.journal-fields(7)

_SYSTEMD_SLICE=¶

systemd.journal-fields(7)

_SYSTEMD_UNIT=¶

systemd.journal-fields(7)

_SYSTEMD_USER_UNIT=¶

systemd.journal-fields(7)

_TRANSPORT=¶

systemd.journal-fields(7)

_UDEV_DEVLINK=¶

systemd.journal-fields(7)

_UDEV_DEVNODE=¶

systemd.journal-fields(7)

_UDEV_SYSNAME=¶

systemd.journal-fields(7)

_UID=¶

systemd.journal-fields(7)

__CURSOR=¶

systemd.journal-fields(7)

__MONOTONIC_TIMESTAMP=¶

systemd.journal-fields(7)

__REALTIME_TIMESTAMP=¶

systemd.journal-fields(7)

PAM configuration directives¶

Directives for configuring PAM behaviour.

ARPProxy=¶

systemd.netdev(5)

Address=¶

systemd.network(5)

Alias=¶

systemd.link(5)

Architecture=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

BitsPerSecond=¶

systemd.link(5)

Bond=¶

systemd.network(5)

Bridge=¶

systemd.network(5)

Broadcast=¶

systemd.network(5)

Cost=¶

systemd.network(5)

CriticalConnection=¶

systemd.network(5)

DHCP=¶

systemd.network(5)

DHCPServer=¶

systemd.network(5)

DNS=¶

resolved.conf(5), systemd.network(5)

Description=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

Destination=¶

systemd.network(5)

DiscoverPathMTU=¶

systemd.netdev(5)

Domains=¶

systemd.network(5)

DownDelaySec=¶

systemd.netdev(5)

Driver=¶

systemd.link(5), systemd.network(5)

Duplex=¶

systemd.link(5)

FDBAgeingSec=¶

systemd.netdev(5)

FallbackDNS=¶

resolved.conf(5)

FallbackNTP=¶

timesyncd.conf(5)

Gateway=¶

systemd.network(5)

Group=¶

systemd.netdev(5)

Host=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

IPForward=¶

systemd.network(5)

IPMasquerade=¶

systemd.network(5)

IPv4LLRoute=¶

systemd.network(5)

IPv6Token=¶

systemd.network(5)

Id=¶

systemd.netdev(5)

KernelCommandLine=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

Kind=¶

systemd.netdev(5)

L2MissNotification=¶

systemd.netdev(5)

L3MissNotification=¶

systemd.netdev(5)

LACPTransmitRate=¶

systemd.netdev(5)

LLDP=¶

systemd.network(5)

LLMNR=¶

resolved.conf(5), systemd.network(5)

Label=¶

systemd.network(5)

LinkLocalAddressing=¶

systemd.network(5)

Local=¶

systemd.netdev(5)

MACAddress=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

MACAddressPolicy=¶

systemd.link(5)

MACVLAN=¶

systemd.network(5)

MIIMonitorSec=¶

systemd.netdev(5)

MTUBytes=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

MacLearning=¶

systemd.netdev(5)

Metric=¶

systemd.network(5)

Mode=¶

systemd.netdev(5)

MultiQueue=¶

systemd.netdev(5)

NTP=¶

systemd.network(5), timesyncd.conf(5)

Name=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

NamePolicy=¶

systemd.link(5)

OneQueue=¶

systemd.netdev(5)

OriginalName=¶

systemd.link(5)

PacketInfo=¶

systemd.netdev(5)

Path=¶

systemd.link(5), systemd.network(5)

Peer=¶

systemd.network(5)

Remote=¶

systemd.netdev(5)

RequestBroadcast=¶

systemd.network(5)

RouteMetric=¶

systemd.network(5)

RouteShortCircuit=¶

systemd.netdev(5)

Scope=¶

systemd.network(5)

SendHostname=¶

systemd.network(5)

Source=¶

systemd.network(5)

TOS=¶

systemd.netdev(5)

TTL=¶

systemd.netdev(5)

TransmitHashPolicy=¶

systemd.netdev(5)

Tunnel=¶

systemd.network(5)

Type=¶

systemd.link(5), systemd.network(5)

UpDelaySec=¶

systemd.netdev(5)

UseDNS=¶

systemd.network(5)

UseDomains=¶

systemd.network(5)

UseHostname=¶

systemd.network(5)

UseMTU=¶

systemd.network(5)

UseRoutes=¶

systemd.network(5)

User=¶

systemd.netdev(5)

VLAN=¶

systemd.network(5)

VLANId=¶

systemd.network(5)

VXLAN=¶

systemd.network(5)

VendorClassIdentifier=¶

systemd.network(5)

Virtualization=¶

systemd.link(5), systemd.netdev(5), systemd.network(5)

WakeOnLan=¶

systemd.link(5)

Journal fields¶

Fields in the journal events with a well known meaning.

CODE_FILE=¶

systemd.journal-fields(7)

CODE_FUNC=¶

systemd.journal-fields(7)

CODE_LINE=¶

systemd.journal-fields(7)

COREDUMP_UNIT=¶

systemd.journal-fields(7)

COREDUMP_USER_UNIT=¶

systemd.journal-fields(7)

ERRNO=¶

systemd.journal-fields(7)

MESSAGE=¶

systemd.journal-fields(7)

MESSAGE_ID=¶

systemd.journal-fields(7)

OBJECT_AUDIT_LOGINUID=¶

systemd.journal-fields(7)

OBJECT_AUDIT_SESSION=¶

systemd.journal-fields(7)

OBJECT_CMDLINE=¶

systemd.journal-fields(7)

OBJECT_COMM=¶

systemd.journal-fields(7)

OBJECT_EXE=¶

systemd.journal-fields(7)

OBJECT_GID=¶

systemd.journal-fields(7)

OBJECT_PID=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_CGROUP=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_OWNER_UID=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_SESSION=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_UNIT=¶

systemd.journal-fields(7)

OBJECT_SYSTEMD_USER_UNIT=¶

systemd.journal-fields(7)

OBJECT_UID=¶

systemd.journal-fields(7)

PRIORITY=¶

systemd.journal-fields(7)

SYSLOG_FACILITY=¶

systemd.journal-fields(7)

SYSLOG_IDENTIFIER=¶

systemd.journal-fields(7)

SYSLOG_PID=¶

systemd.journal-fields(7)

_AUDIT_LOGINUID=¶

systemd.journal-fields(7)

_AUDIT_SESSION=¶

systemd.journal-fields(7)

_BOOT_ID=¶

systemd.journal-fields(7)

_CAP_EFFECTIVE=¶

systemd.journal-fields(7)

_CMDLINE=¶

systemd.journal-fields(7)

_COMM=¶

systemd.journal-fields(7)

_EXE=¶

systemd.journal-fields(7)

_GID=¶

systemd.journal-fields(7)

_HOSTNAME=¶

systemd.journal-fields(7)

_KERNEL_DEVICE=¶

systemd.journal-fields(7)

_KERNEL_SUBSYSTEM=¶

systemd.journal-fields(7)

_MACHINE_ID=¶

systemd.journal-fields(7)

_PID=¶

systemd.journal-fields(7)

_SELINUX_CONTEXT=¶

systemd.journal-fields(7)

_SOURCE_REALTIME_TIMESTAMP=¶

systemd.journal-fields(7)

_SYSTEMD_CGROUP=¶

systemd.journal-fields(7)

_SYSTEMD_OWNER_UID=¶

systemd.journal-fields(7)

_SYSTEMD_SESSION=¶

systemd.journal-fields(7)

_SYSTEMD_SLICE=¶

systemd.journal-fields(7)

_SYSTEMD_UNIT=¶

systemd.journal-fields(7)

_SYSTEMD_USER_UNIT=¶

systemd.journal-fields(7)

_TRANSPORT=¶

systemd.journal-fields(7)

_UDEV_DEVLINK=¶

systemd.journal-fields(7)

_UDEV_DEVNODE=¶

systemd.journal-fields(7)

_UDEV_SYSNAME=¶

systemd.journal-fields(7)

_UID=¶

systemd.journal-fields(7)

__CURSOR=¶

systemd.journal-fields(7)

__MONOTONIC_TIMESTAMP=¶

systemd.journal-fields(7)

__REALTIME_TIMESTAMP=¶

systemd.journal-fields(7)

PAM configuration directives¶

Directives for configuring PAM behaviour.

/etc/crypttab and /etc/fstab options¶

Options which influence mounted filesystems and - encrypted volumes.

System manager directives¶

Directives for configuring the behaviour of the - systemd process.

CPUAffinity=¶

systemd-system.conf(5)

CapabilityBoundingSet=¶

systemd-system.conf(5)

CrashChVT=¶

systemd-system.conf(5)

CrashShell=¶

systemd-system.conf(5)

DefaultBlockIOAccounting=¶

systemd-system.conf(5)

DefaultCPUAccounting=¶

systemd-system.conf(5)

DefaultEnvironment=¶

systemd-system.conf(5)

DefaultLimitAS=¶

systemd-system.conf(5)

DefaultLimitCORE=¶

systemd-system.conf(5)

DefaultLimitCPU=¶

systemd-system.conf(5)

DefaultLimitDATA=¶

systemd-system.conf(5)

DefaultLimitFSIZE=¶

systemd-system.conf(5)

DefaultLimitLOCKS=¶

systemd-system.conf(5)

DefaultLimitMEMLOCK=¶

systemd-system.conf(5)

DefaultLimitMSGQUEUE=¶

systemd-system.conf(5)

DefaultLimitNICE=¶

systemd-system.conf(5)

DefaultLimitNOFILE=¶

systemd-system.conf(5)

DefaultLimitNPROC=¶

systemd-system.conf(5)

DefaultLimitRSS=¶

systemd-system.conf(5)

DefaultLimitRTPRIO=¶

systemd-system.conf(5)

DefaultLimitRTTIME=¶

systemd-system.conf(5)

DefaultLimitSIGPENDING=¶

systemd-system.conf(5)

DefaultLimitSTACK=¶

systemd-system.conf(5)

DefaultMemoryAccounting=¶

systemd-system.conf(5)

DefaultRestartSec=¶

systemd-system.conf(5)

DefaultStandardError=¶

systemd-system.conf(5)

DefaultStandardOutput=¶

systemd-system.conf(5)

DefaultStartLimitBurst=¶

systemd-system.conf(5)

DefaultStartLimitInterval=¶

systemd-system.conf(5)

DefaultTimeoutStartSec=¶

systemd-system.conf(5)

DefaultTimeoutStopSec=¶

systemd-system.conf(5)

DefaultTimerAccuracySec=¶

systemd-system.conf(5)

DumpCore=¶

systemd-system.conf(5)

HibernateMode=¶

systemd-sleep.conf(5)

HibernateState=¶

systemd-sleep.conf(5)

HybridSleepMode=¶

systemd-sleep.conf(5)

HybridSleepState=¶

systemd-sleep.conf(5)

JoinControllers=¶

systemd-system.conf(5)

LogColor=¶

systemd-system.conf(5)

LogLevel=¶

systemd-system.conf(5)

LogLocation=¶

systemd-system.conf(5)

LogTarget=¶

systemd-system.conf(5)

RuntimeWatchdogSec=¶

systemd-system.conf(5)

ShowStatus=¶

systemd-system.conf(5)

ShutdownWatchdogSec=¶

systemd-system.conf(5)

SuspendMode=¶

systemd-sleep.conf(5)

SuspendState=¶

systemd-sleep.conf(5)

SystemCallArchitectures=¶

systemd-system.conf(5)

TimerSlackNSec=¶

systemd-system.conf(5)

bootchart.conf directives¶

Directives for configuring the behaviour of the - systemd-bootchart process.

command line options¶

Command-line options accepted by programs in the - systemd suite.

--accept¶

systemd-activate(8)

--accept-cached¶

systemd-ask-password(1)

--acquired¶

busctl(1)

--action=¶

udevadm(8)

--activatable¶

busctl(1)

--address=¶

busctl(1), systemd-bus-proxyd(8)

--adjust-system-clock¶

timedatectl(1)

--after¶

systemctl(1)

--after-cursor=¶

journalctl(1), systemd-journal-upload(8)

--all¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-cgls(1)

--allow-interactive-authorization=¶

busctl(1)

--attr-match=¶

udevadm(8)

--attr-nomatch=¶

udevadm(8)

--attribute-walk¶

udevadm(8)

--augment-creds=¶

busctl(1)

--auto-start=¶

busctl(1)

--batch¶

systemd-cgtop(1)

--before¶

systemctl(1)

--bind-ro=¶

systemd-nspawn(1)

--bind=¶

systemd-nspawn(1)

--boot¶

systemd-nspawn(1), systemd-tmpfiles(8)

--boot=¶

journalctl(1)

--booted¶

systemd-notify(1)

--capability=¶

systemd-nspawn(1)

--catalog¶

journalctl(1)

--cert=¶

systemd-journal-gatewayd.service(8)

--children-max=¶

systemd-udevd.service(8), udevadm(8)

--clean¶

systemd-tmpfiles(8)

--cleanup-db¶

udevadm(8)

--cmdline¶

systemd-bootchart(1)

--compress¶

systemd-journal-remote(8)

--confirm-spawn¶

systemd(1)

--console¶

systemd-tty-ask-password-agent(1)

--container¶

systemd-detect-virt(1)

--control-group¶

systemd-bootchart(1)

--copy¶

systemd-firstboot(1)

--copy-locale¶

systemd-firstboot(1)

--copy-root-password¶

systemd-firstboot(1)

--copy-timezone¶

systemd-firstboot(1)

--crash-shell¶

systemd(1)

--create¶

systemd-tmpfiles(8)

--cursor=¶

journalctl(1), systemd-journal-upload(8)

--daemon¶

systemd-udevd.service(8)

--debug¶

systemd-udevd.service(8), udevadm(8)

--default-standard-error=¶

systemd(1)

--default-standard-output=¶

systemd(1)

--delay=¶

systemd-cgtop(1)

--depth=¶

systemd-cgtop(1)

--description=¶

systemd-run(1)

--device-id-of-file=¶

udevadm(8)

--diff=¶

systemd-delta(1)

--directory=¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1)

--disk-usage¶

journalctl(1)

--dmesg¶

journalctl(1)

--drop-capability=¶

systemd-nspawn(1)

--dry-run¶

udevadm(8)

--dump-catalog¶

journalctl(1)

--dump-configuration-items¶

systemd(1)

--dump-core¶

systemd(1)

--echo¶

systemd-ask-password(1)

--entropy¶

systemd-bootchart(1)

--event-timeout=¶

systemd-udevd.service(8)

--exclude-prefix=¶

systemd-tmpfiles(8)

--exec-delay=¶

systemd-udevd.service(8)

--exit¶

udevadm(8)

--exit-if-exists=¶

udevadm(8)

--expect-reply=¶

busctl(1)

--export¶

udevadm(8)

--export-db¶

udevadm(8)

--export-prefix=¶

udevadm(8)

--field=¶

coredumpctl(1), journalctl(1)

--file=¶

journalctl(1), systemd-journal-upload(8)

--flush¶

journalctl(1)

--follow¶

journalctl(1)

--force¶

halt(8), journalctl(1), systemctl(1)

--freq¶

systemd-bootchart(1)

--from-pattern=¶

systemd-analyze(1)

--full¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-cgls(1)

--fuzz=¶

systemd-analyze(1)

--getter=¶

systemd-journal-remote(8)

--gid=¶

systemd-run(1)

--global¶

systemctl(1)

--halt¶

halt(8), shutdown(8)

--header¶

journalctl(1)

--help¶

bootctl(1), busctl(1), coredumpctl(1), halt(8), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), runlevel(8), shutdown(8), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-ask-password(1), systemd-bootchart(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), systemd-udevd.service(8), telinit(8), timedatectl(1), udevadm(8)

--host=¶

busctl(1), hostnamectl(1), localectl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-run(1), timedatectl(1)

--hostname=¶

systemd-firstboot(1)

--icon=¶

systemd-ask-password(1)

--identifier=¶

journalctl(1), systemd-cat(1)

--ignore-inhibitors¶

systemctl(1)

--image=¶

systemd-nspawn(1)

--init¶

systemd-bootchart(1)

--interface=¶

systemd-networkd-wait-online.service(8)

--interval=¶

journalctl(1)

--iterations=¶

systemd-cgtop(1)

--job-mode=¶

systemctl(1)

--keep-unit¶

systemd-nspawn(1)

--kernel¶

udevadm(8)

--key=¶

systemd-journal-gatewayd.service(8)

--kill-who=¶

loginctl(1), machinectl(1), systemctl(1)

--level-prefix=¶

systemd-cat(1)

--lines=¶

journalctl(1), systemctl(1)

systemd-nspawn(1)

--list¶

busctl(1), systemd-inhibit(1), systemd-tty-ask-password-agent(1)

--list-boots¶

journalctl(1)

--list-catalog¶

journalctl(1)

--listen-http=¶

systemd-journal-remote(8)

--listen-https=¶

systemd-journal-remote(8)

--listen-raw=¶

systemd-journal-remote(8)

--listen=¶

systemd-activate(8)

--locale-messages=¶

systemd-firstboot(1)

--locale=¶

systemd-firstboot(1)

--log-color=¶

systemd(1)

--log-level=¶

systemd(1)

--log-location=¶

systemd(1)

--log-priority=¶

udevadm(8)

--log-target=¶

systemd(1)

--machine-id=¶

systemd-firstboot(1)

--machine=¶

busctl(1), hostnamectl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-nspawn(1), systemd-run(1), timedatectl(1)

--mangle¶

systemd-escape(1)

--match=¶

busctl(1)

--merge¶

journalctl(1), systemd-journal-upload(8)

--mode=¶

systemd-inhibit(1)

--multiple¶

systemd-ask-password(1)

--name-match=¶

udevadm(8)

--name=¶

udevadm(8)

--network-bridge=¶

systemd-nspawn(1)

--network-interface=¶

systemd-nspawn(1)

--network-macvlan=¶

systemd-nspawn(1)

--network-veth¶

systemd-nspawn(1)

--new-id128¶

journalctl(1)

--nice=¶

systemd-run(1)

--no-ask-password¶

hostnamectl(1), localectl(1), loginctl(1), systemctl(1), timedatectl(1)

--no-block¶

systemctl(1)

--no-compress¶

systemd-journal-remote(8)

--no-convert¶

localectl(1)

--no-filter¶

systemd-bootchart(1)

--no-full¶

journalctl(1)

--no-legend¶

busctl(1), coredumpctl(1), loginctl(1), machinectl(1), systemctl(1)

--no-man¶

systemd-analyze(1)

--no-pager¶

busctl(1), coredumpctl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-delta(1), timedatectl(1)

--no-reload¶

systemctl(1)

--no-seal¶

systemd-journal-remote(8)

--no-tail¶

journalctl(1)

--no-tty¶

systemd-ask-password(1)

--no-wall¶

halt(8), shutdown(8), systemctl(1), telinit(8)

--no-wtmp¶

halt(8)

--on-active=¶

systemd-run(1)

--on-boot=¶

systemd-run(1)

--on-calendar=¶

systemd-run(1)

--on-startup=¶

systemd-run(1)

--on-unit-active=¶

systemd-run(1)

--on-unit-inactive=¶

systemd-run(1)

--order¶

systemd-analyze(1)

--output¶

systemd-bootchart(1)

--output=¶

coredumpctl(1), journalctl(1), systemctl(1), systemd-journal-remote(8)

--pager-end¶

journalctl(1)

--parent-match=¶

udevadm(8)

--path¶

systemd-escape(1)

--path=¶

udevadm(8)

--personality=¶

systemd-nspawn(1)

--pid=¶

systemd-notify(1)

--plain¶

systemctl(1)

--plymouth¶

systemd-tty-ask-password-agent(1)

--poweroff¶

halt(8), shutdown(8)

--prefix=¶

systemd-tmpfiles(8)

--preset-mode=¶

systemctl(1)

--pretty¶

hostnamectl(1)

--priority=¶

journalctl(1), systemd-cat(1)

--private-network¶

systemd-nspawn(1)

--prompt¶

systemd-firstboot(1)

--prompt-hostname¶

systemd-firstboot(1)

--prompt-locale¶

systemd-firstboot(1)

--prompt-root-password¶

systemd-firstboot(1)

--prompt-timezone¶

systemd-firstboot(1)

--property¶

udevadm(8)

--property-match=¶

udevadm(8)

--property=¶

loginctl(1), machinectl(1), systemctl(1), systemd-run(1), udevadm(8)

--pss¶

systemd-bootchart(1)

--query¶

systemd-tty-ask-password-agent(1)

--query=¶

udevadm(8)

--quiet¶

busctl(1), journalctl(1), systemctl(1), systemd-detect-virt(1), systemd-nspawn(1)

--read-only¶

systemd-nspawn(1)

--ready¶

systemd-notify(1)

--reboot¶

halt(8), shutdown(8)

--recursive¶

systemctl(1)

--register=¶

systemd-nspawn(1)

--rel¶

systemd-bootchart(1)

--reload¶

udevadm(8)

--remain-after-exit¶

systemd-run(1)

--remove¶

systemd-tmpfiles(8)

--require¶

systemd-analyze(1)

--resolve-names=¶

systemd-udevd.service(8), udevadm(8)

--reverse¶

journalctl(1), systemctl(1)

--root¶

udevadm(8)

--root-password-file=¶

systemd-firstboot(1)

--root-password=¶

systemd-firstboot(1)

--root=¶

journalctl(1), systemctl(1), systemd-firstboot(1), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-sysusers(8), systemd-tmpfiles(8), udevadm(8)

--runtime¶

systemctl(1)

--sample¶

systemd-bootchart(1)

--save-state¶

systemd-journal-upload(8)

--scale-x¶

systemd-bootchart(1)

--scale-y¶

systemd-bootchart(1)

--scope¶

systemd-run(1)

--seal¶

systemd-journal-remote(8)

--selinux-apifs-context=¶

systemd-nspawn(1)

--selinux-context=¶

systemd-nspawn(1)

--send-sighup¶

systemd-run(1)

--service-type=¶

systemd-run(1)

--setenv=¶

systemd-activate(8), systemd-nspawn(1), systemd-run(1)

--setup-keys¶

journalctl(1)

--setup-machine-id¶

systemd-firstboot(1)

--share-system¶

systemd-nspawn(1)

--show-cursor¶

journalctl(1)

--show-machine¶

busctl(1)

--show-status=¶

systemd(1)

--show-types¶

systemctl(1)

--signal=¶

loginctl(1), machinectl(1), systemctl(1)

--since=¶

journalctl(1)

--size=¶

busctl(1)

--slice=¶

systemd-nspawn(1), systemd-run(1)

--split-mode¶

systemd-journal-remote(8)

--start-exec-queue¶

udevadm(8)

--state=¶

systemctl(1)

--static¶

hostnamectl(1)

--status=¶

systemd-notify(1)

--stop-exec-queue¶

udevadm(8)

--subsystem-match=¶

udevadm(8)

--subsystem-nomatch=¶

udevadm(8)

--suffix=¶

systemd-escape(1), systemd-path(1)

--sysname-match=¶

udevadm(8)

--system¶

busctl(1), journalctl(1), systemctl(1), systemd(1), systemd-analyze(1), systemd-journal-upload(8), systemd-run(1)

--tag-match=¶

udevadm(8)

--template=¶

systemd-escape(1)

--test¶

systemd(1)

--test=¶

udevadm(8)

--timeout=¶

busctl(1), systemd-ask-password(1), udevadm(8)

--timer-property=¶

systemd-run(1)

--timezone=¶

systemd-firstboot(1)

--tmpfs=¶

systemd-nspawn(1)

--to-pattern=¶

systemd-analyze(1)

--transient¶

hostnamectl(1)

--type=¶

systemctl(1), systemd-delta(1), udevadm(8)

--udev¶

udevadm(8)

--uid=¶

systemd-run(1)

--unescape¶

systemd-escape(1)

--unique¶

busctl(1)

--unit=¶

journalctl(1), systemd(1), systemd-run(1)

--until=¶

journalctl(1)

--update¶

udevadm(8)

--update-catalog¶

journalctl(1)

--url=¶

systemd-journal-remote(8), systemd-journal-upload(8)

--user¶

busctl(1), journalctl(1), systemctl(1), systemd(1), systemd-analyze(1), systemd-journal-upload(8), systemd-run(1)

--user-unit=¶

journalctl(1)

--user=¶

systemd-nspawn(1)

--usr¶

udevadm(8)

--utc¶

journalctl(1)

--uuid=¶

systemd-nspawn(1)

--vacuum-size=¶

journalctl(1)

--vacuum-time=¶

journalctl(1)

--verbose¶

busctl(1), udevadm(8)

--verify¶

journalctl(1)

--verify-key=¶

journalctl(1)

--version¶

bootctl(1), busctl(1), coredumpctl(1), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), systemd-udevd.service(8), timedatectl(1), udevadm(8)

--vm¶

systemd-detect-virt(1)

--volatile¶

systemd-nspawn(1)

--wall¶

systemd-tty-ask-password-agent(1)

--watch¶

systemd-tty-ask-password-agent(1)

--what=¶

systemd-inhibit(1)

--who=¶

systemd-inhibit(1)

--why=¶

systemd-inhibit(1)

--wtmp-only¶

halt(8)

-1¶

coredumpctl(1)

-A¶

udevadm(8)

-C¶

systemd-bootchart(1)

-D¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1)

-E¶

systemd-activate(8), udevadm(8)

-F¶

coredumpctl(1), journalctl(1), systemd-bootchart(1)

-H¶

busctl(1), hostnamectl(1), localectl(1), loginctl(1), machinectl(1), shutdown(8), systemctl(1), systemd-analyze(1), systemd-run(1), timedatectl(1)

-L¶

systemd-nspawn(1)

-M¶

busctl(1), hostnamectl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-nspawn(1), systemd-run(1), timedatectl(1)

-N¶

udevadm(8)

-P¶

shutdown(8), udevadm(8)

-R¶

udevadm(8)

-S¶

udevadm(8)

-Z¶

systemd-nspawn(1)

-a¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-activate(8), udevadm(8)

-b¶

journalctl(1), systemd-cgtop(1), systemd-nspawn(1), udevadm(8)

-c¶

journalctl(1), shutdown(8), systemd-cgtop(1), systemd-detect-virt(1), udevadm(8)

-d¶

halt(8), systemd-cgtop(1), udevadm(8)

-e¶

journalctl(1), systemd-bootchart(1), udevadm(8)

-f¶

halt(8), journalctl(1), systemctl(1), systemd-bootchart(1)

-g¶

systemd-bootchart(1), udevadm(8)

-h¶

bootctl(1), busctl(1), coredumpctl(1), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), shutdown(8), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-ask-password(1), systemd-bootchart(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), timedatectl(1), udevadm(8)

-i¶

systemctl(1), systemd-bootchart(1), systemd-cgtop(1), systemd-networkd-wait-online.service(8), systemd-nspawn(1)

-j¶

systemd-nspawn(1)

-k¶

journalctl(1), shutdown(8), systemd-cgls(1), udevadm(8)

-l¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-activate(8), systemd-cgls(1), udevadm(8)

-m¶

journalctl(1), systemd-cgtop(1), systemd-journal-upload(8), udevadm(8)

-n¶

journalctl(1), systemctl(1), systemd-bootchart(1), systemd-cgtop(1), udevadm(8)

-o¶

coredumpctl(1), journalctl(1), systemctl(1), systemd-bootchart(1)

-p¶

halt(8), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-bootchart(1), systemd-cat(1), systemd-cgtop(1), systemd-escape(1), systemd-run(1), udevadm(8)

-q¶

journalctl(1), systemctl(1), systemd-detect-virt(1), systemd-nspawn(1), udevadm(8)

-r¶

journalctl(1), shutdown(8), systemctl(1), systemd-bootchart(1), udevadm(8)

-s¶

loginctl(1), machinectl(1), systemctl(1), udevadm(8)

-t¶

journalctl(1), systemctl(1), systemd-cat(1), systemd-cgtop(1), systemd-delta(1), udevadm(8)

-u¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1), udevadm(8)

-v¶

systemd-detect-virt(1), udevadm(8)

-w¶

halt(8)

-x¶

journalctl(1), systemd-bootchart(1), udevadm(8)

-y¶

systemd-bootchart(1), udevadm(8)

auto¶

systemd.resource-control(5)

cat¶

journalctl(1)

closed¶

systemd.resource-control(5)

driver¶

systemd.journal-fields(7)

export¶

journalctl(1)

hibernate¶

systemd-suspend.service(8)

hybrid-sleep¶

systemd-suspend.service(8)

journal¶

systemd.journal-fields(7)

json¶

journalctl(1)

json-pretty¶

journalctl(1)

json-sse¶

journalctl(1)

kernel¶

systemd.journal-fields(7)

short¶

journalctl(1)

short-iso¶

journalctl(1)

short-monotonic¶

journalctl(1)

short-precise¶

journalctl(1)

stdout¶

systemd.journal-fields(7)

strict¶

systemd.resource-control(5)

suspend¶

systemd-suspend.service(8)

syslog¶

systemd.journal-fields(7)

verbose¶

journalctl(1)

Constants¶

Various constant used and/or defined by systemd.

-0¶

journalctl(1)

-1¶

journalctl(1), sd_journal_get_fd(3), sd_login_monitor_new(3), systemd(1)

-EADDRINUSE¶

sd_bus_request_name(3)

-EALREADY¶

sd_bus_request_name(3)

-EBUSY¶

sd_event_add_child(3), sd_event_add_signal(3)

-ECHILD¶

sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_journal_open(3)

-EEXIST¶

sd_bus_request_name(3)

-EINVAL¶

sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_open_user(3), sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_event_set_name(3)

-EMFILE¶

sd_event_new(3)

-ENODATA¶

sd_bus_creds_get_pid(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_negotiate_fds(3)

-ENOENT¶

sd_bus_creds_get_pid(3)

-ENOMEM¶

sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_new(3), sd_bus_open_user(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_new(3), sd_event_set_name(3)

-ENOTCONN¶

sd_bus_request_name(3)

-ENOTSUP¶

sd_event_add_time(3)

-ENXIO¶

sd_bus_creds_get_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3)

-EPERM¶

sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_negotiate_fds(3)

-ESRCH¶

sd_bus_creds_new_from_pid(3), sd_bus_request_name(3)

-ESTALE¶

sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3)

0¶

systemctl(1)

1¶

journalctl(1)

2¶

journalctl(1)

AF_INET¶

sd_is_fifo(3), systemd.exec(5)

AF_INET6¶

sd_is_fifo(3), systemd.exec(5)

systemd.socket(5)

AF_UNIX¶

daemon(7), pam_systemd(8), sd_is_fifo(3), sd_notify(3), systemd(1), systemd-journald.service(8), systemd.exec(5), systemd.socket(5)

AF_UNSPEC¶

sd_is_fifo(3)

CAP_DAC_OVERRIDE¶

systemd.exec(5)

CAP_MKNOD¶

systemd.exec(5)

CAP_SYS_ADMIN¶

systemd.exec(5)

CAP_SYS_PTRACE¶

systemd.exec(5)

CLOCK_BOOTTIME_ALARM¶

sd_event_add_time(3)

CLOCK_MONOTONIC¶

bootchart.conf(5), sd_event_add_time(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_fd(3), sd_journal_get_realtime_usec(3), sd_journal_seek_head(3), sd_login_monitor_new(3), systemd.journal-fields(7)

CLOCK_REALTIME¶

sd_event_add_time(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_realtime_usec(3), sd_journal_seek_head(3), systemd.journal-fields(7)

EACCES¶

systemd.exec(5)

EPERM¶

systemd.exec(5)

EUCLEAN¶

systemd.exec(5)

IP_FREEBIND¶

daemon(7)

LOG_ALERT¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_CRIT¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_DEBUG¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_EMERG¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_ERR¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_INFO¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_NOTICE¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_WARNING¶

sd_journal_print(3), sd_journal_stream_fd(3)

NUL¶

sd_bus_message_append(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_path_encode(3), sd_event_set_name(3), sd_id128_to_string(3), systemd.socket(5)

NULL¶

sd-login(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_strv(3), sd_bus_new(3), sd_bus_open_user(3), sd_bus_path_encode(3), sd_event_add_signal(3), sd_event_new(3), sd_event_set_name(3), sd_get_seats(3), sd_is_fifo(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_realtime_usec(3), sd_journal_open(3), sd_journal_print(3), sd_login_monitor_new(3), sd_seat_get_active(3), sd_session_is_active(3), sd_uid_get_state(3)

O_NONBLOCK¶

systemd.service(5)

POLLIN¶

sd_journal_get_fd(3), sd_login_monitor_new(3)

POLLOUT¶

sd_journal_get_fd(3), sd_login_monitor_new(3)

RLIMIT_NOFILE¶

daemon(7)

SD_BUS_CREDS_AUDIT_LOGIN_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_AUDIT_SESSION_ID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_BOUNDING_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_CGROUP¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_CMDLINE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_COMM¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_EFFECTIVE_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_EXE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_GID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_INHERITABLE_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_OWNER_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_PERMITTED_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_PID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SELINUX_CONTEXT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SESSION¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SLICE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_TID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_TID_COMM¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UNIQUE_NAME¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UNIT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_USER_UNIT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_WELL_KNOWN_NAMES¶

sd_bus_creds_new_from_pid(3)

SD_BUS_ERROR_ACCESS_DENIED¶

sd_bus_error(3)

SD_BUS_ERROR_ADDRESS_IN_USE¶

sd_bus_error(3)

SD_BUS_ERROR_AUTH_FAILED¶

sd_bus_error(3)

SD_BUS_ERROR_BAD_ADDRESS¶

sd_bus_error(3)

SD_BUS_ERROR_DISCONNECTED¶

sd_bus_error(3)

SD_BUS_ERROR_FAILED¶

sd_bus_error(3)

SD_BUS_ERROR_FILE_EXISTS¶

sd_bus_error(3)

SD_BUS_ERROR_FILE_NOT_FOUND¶

sd_bus_error(3)

SD_BUS_ERROR_INCONSISTENT_MESSAGE¶

sd_bus_error(3)

SD_BUS_ERROR_INVALID_ARGS¶

sd_bus_error(3)

SD_BUS_ERROR_INVALID_SIGNATURE¶

sd_bus_error(3)

SD_BUS_ERROR_IO_ERROR¶

sd_bus_error(3)

SD_BUS_ERROR_LIMITS_EXCEEDED¶

sd_bus_error(3)

SD_BUS_ERROR_MAKE_CONST(name, message)¶

sd_bus_error(3)

SD_BUS_ERROR_MATCH_RULE_INVALID¶

sd_bus_error(3)

SD_BUS_ERROR_MATCH_RULE_NOT_FOUND¶

sd_bus_error(3)

SD_BUS_ERROR_NAME_HAS_NO_OWNER¶

sd_bus_error(3)

SD_BUS_ERROR_NOT_SUPPORTED¶

sd_bus_error(3)

SD_BUS_ERROR_NO_MEMORY¶

sd_bus_error(3)

SD_BUS_ERROR_NO_NETWORK¶

sd_bus_error(3)

SD_BUS_ERROR_NO_REPLY¶

sd_bus_error(3)

SD_BUS_ERROR_NO_SERVER¶

sd_bus_error(3)

SD_BUS_ERROR_NULL¶

sd_bus_error(3)

SD_BUS_ERROR_PROPERTY_READ_ONLY¶

sd_bus_error(3)

SD_BUS_ERROR_SERVICE_UNKNOWN¶

sd_bus_error(3)

SD_BUS_ERROR_TIMEOUT¶

sd_bus_error(3)

SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_INTERFACE¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_METHOD¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_OBJECT¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_PROPERTY¶

sd_bus_error(3)

SD_BUS_TYPE_ARRAY¶

sd_bus_message_append(3)

SD_BUS_TYPE_BOOLEAN¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_BYTE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_DICT_ENTRY_BEGIN¶

sd_bus_message_append(3)

SD_BUS_TYPE_DICT_ENTRY_END¶

sd_bus_message_append(3)

SD_BUS_TYPE_DOUBLE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT16¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT32¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT64¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_OBJECT_PATH¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_SIGNATURE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_STRING¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_STRUCT_BEGIN¶

sd_bus_message_append(3)

SD_BUS_TYPE_STRUCT_END¶

sd_bus_message_append(3)

SD_BUS_TYPE_UINT16¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UINT32¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UINT64¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UNIX_FD¶

sd_bus_message_append(3), sd_bus_message_append_basic(3), sd_bus_negotiate_fds(3)

SD_BUS_TYPE_VARIANT¶

sd_bus_message_append(3)

SD_EVENT_ON¶

sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3)

SD_EVENT_ONESHOT¶

sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_time(3)

SD_JOURNAL_APPEND¶

sd_journal_get_fd(3)

SD_JOURNAL_CURRENT_USER¶

sd_journal_open(3)

SD_JOURNAL_INVALIDATE¶

sd_journal_get_fd(3)

SD_JOURNAL_LOCAL_ONLY¶

sd_journal_get_usage(3), sd_journal_open(3)

SD_JOURNAL_NOP¶

sd_journal_get_fd(3)

SD_JOURNAL_RUNTIME_ONLY¶

sd_journal_open(3)

SD_JOURNAL_SYSTEM¶

sd_journal_open(3)

SD_JOURNAL_SYSTEM_ONLY¶

sd_journal_open(3)

SD_WARNING¶

sd_journal_stream_fd(3)

SIGABRT¶

systemd.service(5)

SIGHUP¶

daemon(7), systemd(1), systemd.kill(5), systemd.service(5)

SIGINT¶

loginctl(1), machinectl(1), systemctl(1), systemd(1), systemd.service(5), systemd.special(7)

SIGKILL¶

systemd.kill(5), systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.swap(5)

SIGPIPE¶

systemd.exec(5), systemd.service(5)

SIGPWR¶

systemd(1)

SIGRTMIN+0¶

systemd(1)

SIGRTMIN+1¶

systemd(1)

SIGRTMIN+13¶

systemd(1)

SIGRTMIN+14¶

systemd(1)

SIGRTMIN+15¶

systemd(1)

SIGRTMIN+16¶

systemd(1)

SIGRTMIN+2¶

systemd(1)

SIGRTMIN+20¶

systemd(1)

SIGRTMIN+21¶

systemd(1)

SIGRTMIN+22¶

systemd(1)

SIGRTMIN+23¶

systemd(1)

SIGRTMIN+24¶

systemd(1)

SIGRTMIN+26¶

systemd(1)

SIGRTMIN+27¶

systemd(1)

SIGRTMIN+28¶

systemd(1)

SIGRTMIN+3¶

systemd(1)

SIGRTMIN+4¶

systemd(1)

SIGRTMIN+5¶

systemd(1)

SIGRTMIN+6¶

systemd(1)

SIGSTOP¶

loginctl(1), machinectl(1), systemctl(1)

SIGSYS¶

systemd.exec(5)

SIGTERM¶

daemon(7), loginctl(1), machinectl(1), systemctl(1), systemd(1), systemd.kill(5), systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.special(7), systemd.swap(5)

SIGUSR1¶

systemd(1)

SIGUSR2¶

systemd(1)

SIGWINCH¶

systemd(1)

SIG_DFL¶

daemon(7)

SOCK_DGRAM¶

sd_is_fifo(3), systemd-journald.service(8), systemd.socket(5)

SOCK_SEQPACKET¶

systemd.socket(5)

SOCK_STREAM¶

sd_is_fifo(3), systemd.socket(5)

TCP_DEFER_ACCEPT¶

systemd.socket(5)

WCONTINUED¶

sd_event_add_child(3)

WEXITED¶

sd_event_add_child(3)

WSTOPPED¶

sd_event_add_child(3)

_NSIG¶

daemon(7)

_SD_BUS_CREDS_ALL¶

sd_bus_creds_new_from_pid(3)

all¶

udevadm(8)

application/event-stream¶

systemd-journal-gatewayd.service(8)

application/json¶

systemd-journal-gatewayd.service(8)

application/vnd.fdo.journal¶

systemd-journal-gatewayd.service(8)

arm¶

systemd.exec(5)

auto¶

systemd(1)

early¶

udevadm(8)

false¶

sd_bus_error(3)

host¶

systemd-journal-remote(8)

https¶

systemd-journal-upload(8)

late¶

udevadm(8)

libsystemd¶

sd-daemon(3), sd-id128(3), sd-journal(3), sd-login(3), sd_booted(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_negotiate_fds(3), sd_bus_new(3), sd_bus_open_user(3), sd_bus_path_encode(3), sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_event_new(3), sd_event_set_name(3), sd_get_seats(3), sd_is_fifo(3), sd_journal_add_match(3), sd_journal_get_catalog(3), sd_journal_get_cursor(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_data(3), sd_journal_get_fd(3), sd_journal_get_realtime_usec(3), sd_journal_get_usage(3), sd_journal_next(3), sd_journal_open(3), sd_journal_print(3), sd_journal_query_unique(3), sd_journal_seek_head(3), sd_journal_stream_fd(3), sd_listen_fds(3), sd_login_monitor_new(3), sd_machine_get_class(3), sd_notify(3), sd_pid_get_session(3), sd_seat_get_active(3), sd_session_is_active(3), sd_uid_get_state(3), sd_watchdog_enabled(3)

libsystemd-bus¶

sd_bus_message_append(3)

m¶

systemd.resource-control(5)

name¶

udevadm(8)

native¶

systemd.exec(5)

never¶

udevadm(8)

none¶

systemd-journal-remote(8)

path¶

udevadm(8)

property¶

udevadm(8)

r¶

systemd.resource-control(5)

simple¶

systemd-run(1)

udevadm(8)

text/plain¶

systemd-journal-gatewayd.service(8)

true¶

sd_bus_error(3)

w¶

systemd.resource-control(5)

x32¶

systemd.exec(5)

x86¶

systemd.exec(5)

x86-64¶

systemd.exec(5)

~¶

systemd.exec(5)

Miscellaneous options and directives¶

Other configuration elements which don't fit in - any of the above groups.

$LISTEN_FDS¶

systemd-journal-remote(8)

ANSI_COLOR=¶

os-release(5)

BUG_REPORT_URL=¶

os-release(5)

BUILD_ID=¶

os-release(5)

C¶

tmpfiles.d(5)

CHASSIS=¶

machine-info(5)

CPE_NAME=¶

os-release(5)

Compress=¶

coredump.conf(5), journald.conf(5)

D¶

tmpfiles.d(5)

DEPLOYMENT=¶

machine-info(5)

ExternalSizeMax=¶

coredump.conf(5)

F¶

tmpfiles.d(5)

FONT=¶

vconsole.conf(5)

FONT_MAP=¶

vconsole.conf(5)

FONT_UNIMAP=¶

vconsole.conf(5)

ForwardToConsole=¶

journald.conf(5)

ForwardToKMsg=¶

journald.conf(5)

ForwardToSyslog=¶

journald.conf(5)

ForwardToWall=¶

journald.conf(5)

HOME_URL=¶

os-release(5)

HandleHibernateKey=¶

logind.conf(5)

HandleLidSwitch=¶

logind.conf(5)

HandleLidSwitchDocked=¶

logind.conf(5)

HandlePowerKey=¶

logind.conf(5)

HandleSuspendKey=¶

logind.conf(5)

HibernateKeyIgnoreInhibited=¶

logind.conf(5)

ICON_NAME=¶

machine-info(5)

ID=¶

os-release(5)

ID_LIKE=¶

os-release(5)

IdleAction=¶

logind.conf(5)

IdleActionSec=¶

logind.conf(5)

InhibitDelayMaxSec=¶

logind.conf(5)

JournalSizeMax=¶

coredump.conf(5)

KEYMAP=¶

vconsole.conf(5)

KEYMAP_TOGGLE=¶

vconsole.conf(5)

KeepFree=¶

coredump.conf(5)

KillExcludeUsers=¶

logind.conf(5)

KillOnlyUsers=¶

logind.conf(5)

KillUserProcesses=¶

logind.conf(5)

L¶

tmpfiles.d(5)

L+¶

tmpfiles.d(5)

LOCATION=¶

machine-info(5)

LidSwitchIgnoreInhibited=¶

logind.conf(5)

MaxFileSec=¶

journald.conf(5)

MaxLevelConsole=¶

journald.conf(5)

MaxLevelKMsg=¶

journald.conf(5)

MaxLevelStore=¶

journald.conf(5)

MaxLevelSyslog=¶

journald.conf(5)

MaxLevelWall=¶

journald.conf(5)

MaxRetentionSec=¶

journald.conf(5)

MaxUse=¶

coredump.conf(5)

NAME=¶

os-release(5)

NAutoVTs=¶

logind.conf(5)

PRETTY_HOSTNAME=¶

machine-info(5)

PRETTY_NAME=¶

os-release(5)

PowerKeyIgnoreInhibited=¶

logind.conf(5)

ProcessSizeMax=¶

coredump.conf(5)

R¶

tmpfiles.d(5)

RateLimitBurst=¶

journald.conf(5)

RateLimitInterval=¶

journald.conf(5)

RemoveIPC=¶

logind.conf(5)

ReserveVT=¶

logind.conf(5)

RuntimeDirectorySize=¶

logind.conf(5)

RuntimeKeepFree=¶

journald.conf(5)

RuntimeMaxFileSize=¶

journald.conf(5)

RuntimeMaxUse=¶

journald.conf(5)

SD_BUS_NAME_ALLOW_REPLACEMENT¶

sd_bus_request_name(3)

SD_BUS_NAME_QUEUE¶

sd_bus_request_name(3)

SD_BUS_NAME_REPLACE_EXISTING¶

sd_bus_request_name(3)

SUPPORT_URL=¶

os-release(5)

Seal=¶

journald.conf(5)

SplitMode=¶

journald.conf(5)

Storage=¶

coredump.conf(5), journald.conf(5)

SuspendKeyIgnoreInhibited=¶

logind.conf(5)

SyncIntervalSec=¶

journald.conf(5)

SystemKeepFree=¶

journald.conf(5)

SystemMaxFileSize=¶

journald.conf(5)

SystemMaxUse=¶

journald.conf(5)

TTYPath=¶

journald.conf(5)

VERSION=¶

os-release(5)

VERSION_ID=¶

os-release(5)

X¶

tmpfiles.d(5)

Z¶

tmpfiles.d(5)

b¶

tmpfiles.d(5)

b+¶

tmpfiles.d(5)

c¶

tmpfiles.d(5)

c+¶

tmpfiles.d(5)

d¶

tmpfiles.d(5)

equivalent¶

systemd-delta(1)

extended¶

systemd-delta(1)

f¶

tmpfiles.d(5)

g¶

sysusers.d(5)

h¶

tmpfiles.d(5)

m¶

sysusers.d(5), tmpfiles.d(5)

masked¶

systemd-delta(1)

min¶

tmpfiles.d(5)

ms¶

tmpfiles.d(5)

overridden¶

systemd-delta(1)

p¶

tmpfiles.d(5)

p+¶

tmpfiles.d(5)

r¶

sysusers.d(5), tmpfiles.d(5)

redirected¶

systemd-delta(1)

s¶

tmpfiles.d(5)

t¶

tmpfiles.d(5)

u¶

sysusers.d(5)

udev_log¶

udev.conf(5)

unchanged¶

systemd-delta(1)

us¶

tmpfiles.d(5)

w¶

tmpfiles.d(5)

x¶

tmpfiles.d(5)

z¶

tmpfiles.d(5)

Files and directories¶

Paths and file names referred to in the - documentation.

/¶

file-hierarchy(7), systemd-gpt-auto-generator(8), systemd-remount-fs.service(8), systemd.unit(5), sysusers.d(5)

$HOME/.config/systemd/user/¶

systemd.unit(5)

$HOME/.local/share/systemd/user/¶

systemd.unit(5)

$XDG_CONFIG_HOME/systemd/user/¶

systemd.unit(5)

$XDG_DATA_HOME/systemd/user/¶

systemd.unit(5)

$XDG_RUNTIME_DIR/systemd/user/¶

systemd.unit(5)

-.slice¶

systemd.special(7)

/bin¶

file-hierarchy(7), systemd.exec(5)

/bin/ls¶

systemd-cat(1)

/boot¶

file-hierarchy(7), kernel-install(8), systemd-efi-boot-generator(8), systemd-gpt-auto-generator(8)

/boot/loader/entries/MACHINE-ID-KERNEL-VERSION.conf¶

kernel-install(8)

/dev¶

file-hierarchy(7), systemd-nspawn(1), systemd-remount-fs.service(8), systemd.device(5), systemd.journal-fields(7), systemd.resource-control(5), udev(7), udevadm(8)

/dev/console¶

journald.conf(5), systemd-getty-generator(8), systemd-tty-ask-password-agent(1), systemd.exec(5)

/dev/disk/by-foo/bar¶

systemd-hibernate-resume-generator(8)

/dev/full¶

systemd.resource-control(5)

/dev/hw_random¶

crypttab(5)

/dev/initctl¶

systemd(1), systemd-initctl.service(8)

/dev/mapper/¶

crypttab(5)

/dev/mapper/home¶

systemd-gpt-auto-generator(8)

/dev/mapper/srv¶

systemd-gpt-auto-generator(8)

/dev/net/tun¶

systemd.netdev(5)

/dev/null¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), daemon(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sysctl.d(5), systemctl(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.exec(5), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.resource-control(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), tmpfiles.d(5), udev(7)

/dev/random¶

crypttab(5), systemd.exec(5), systemd.resource-control(5)

/dev/sda¶

systemd.exec(5)

/dev/sda5¶

systemd.resource-control(5)

/dev/shm¶

file-hierarchy(7)

/dev/urandom¶

crypttab(5), sd_id128_randomize(3), systemd.resource-control(5)

/dev/watchdog¶

systemd-system.conf(5)

/dev/zero¶

systemd.exec(5), systemd.resource-control(5)

/etc¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), journald.conf(5), logind.conf(5), modules-load.d(5), nss-myhostname(8), os-release(5), resolved.conf(5), sysctl.d(5), systemctl(1), systemd-delta(1), systemd-machine-id-commit(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd-update-done.service(8), systemd.exec(5), systemd.link(5), systemd.mount(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), udev(7), udevadm(8)

/etc/.updated¶

systemd-update-done.service(8)

/etc/adjtime¶

timedatectl(1)

/etc/binfmt.d/*.conf¶

binfmt.d(5)

/etc/crypttab¶

crypttab(5), systemd-cryptsetup-generator(8), systemd-cryptsetup@.service(8), systemd-gpt-auto-generator(8)

/etc/fstab¶

kernel-command-line(7), systemd(1), systemd-fsck@.service(8), systemd-fstab-generator(8), systemd-gpt-auto-generator(8), systemd-remount-fs.service(8), systemd.automount(5), systemd.mount(5), systemd.special(7), systemd.swap(5)

/etc/group¶

sysusers.d(5)

/etc/hostname¶

hostname(5), hostnamectl(1), machine-info(5)

/etc/hosts¶

nss-myhostname(8)

/etc/init.d/¶

systemd-sysv-generator(8)

/etc/kernel/cmdline¶

kernel-install(8)

/etc/kernel/install.d/¶

kernel-install(8)

/etc/kernel/install.d/*.install¶

kernel-install(8)

/etc/locale.conf¶

locale.conf(5), systemd(1)

/etc/localtime¶

localtime(5), timedatectl(1)

/etc/machine-id¶

kernel-install(8), machine-id(5), systemd-machine-id-commit(1), systemd-machine-id-commit.service(8), systemd-machine-id-setup(1), systemd-nspawn(1)

/etc/machine-info¶

hostnamectl(1), machine-info(5)

/etc/modules-load.d/program.conf¶

modules-load.d(5)

/etc/modules-load.d/*.conf¶

modules-load.d(5)

/etc/modules-load.d/bridge.conf¶

sysctl.d(5)

/etc/nsswitch.conf¶

nss-myhostname(8)

/etc/os-release¶

kernel-install(8), os-release(5), systemd-nspawn(1)

/etc/passwd¶

sysusers.d(5)

/etc/resolv.conf¶

resolved.conf(5), systemd-resolved.service(8)

/etc/sysctl.d/*.conf¶

sysctl.d(5)

/etc/sysctl.d/bridge.conf¶

sysctl.d(5)

/etc/sysctl.d/domain-name.conf¶

sysctl.d(5)

/etc/systemd/bootchart.conf¶

bootchart.conf(5), systemd-bootchart(1)

/etc/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/etc/systemd/coredump.conf¶

coredump.conf(5)

/etc/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/etc/systemd/journal-remote.conf¶

systemd-journal-upload(8)

/etc/systemd/journal-upload.conf¶

systemd-journal-upload(8)

/etc/systemd/journald.conf¶

journald.conf(5), systemd-journald.service(8)

/etc/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/etc/systemd/logind.conf¶

logind.conf(5)

/etc/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/etc/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/etc/systemd/resolved.conf¶

resolved.conf(5)

/etc/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/etc/systemd/sleep.conf¶

systemd-sleep.conf(5), systemd-suspend.service(8)

/etc/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/etc/systemd/system/¶

systemd.unit(5)

/etc/systemd/system-preset/¶

systemd.preset(5)

/etc/systemd/system-preset/*.preset¶

systemd.preset(5)

/etc/systemd/system-preset/00-lennart.preset¶

systemd.preset(5)

/etc/systemd/system.conf¶

systemd-system.conf(5)

/etc/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/etc/systemd/timesyncd.conf¶

timesyncd.conf(5)

/etc/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/etc/systemd/user/¶

systemd.unit(5)

/etc/systemd/user-preset/*.preset¶

systemd.preset(5)

/etc/systemd/user.conf¶

systemd-system.conf(5)

/etc/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/etc/tmpfiles.d¶

tmpfiles.d(5)

/etc/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/etc/udev/hwdb.bin¶

udev(7), udevadm(8)

/etc/udev/hwdb.d¶

udev(7), udevadm(8)

/etc/udev/rules.d¶

udev(7)

/etc/udev/rules.d/99-bridge.rules¶

sysctl.d(5)

/etc/udev/udev.conf¶

udev.conf(5)

/etc/vconsole.conf¶

vconsole.conf(5)

/home¶

file-hierarchy(7), systemd-gpt-auto-generator(8), systemd.exec(5)

/home/lennart¶

systemd.automount(5)

/lib¶

file-hierarchy(7), systemd-delta(1)

/lib64¶

file-hierarchy(7)

/proc¶

busctl(1), file-hierarchy(7), sd-login(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_is_fifo(3), systemd(1), systemd-remount-fs.service(8), systemd.socket(5), tmpfiles.d(5)

/proc/cmdline¶

kernel-command-line(7), kernel-install(8), systemd(1)

/proc/devices¶

systemd.resource-control(5)

/proc/self/fd¶

daemon(7)

/proc/self/mountinfo¶

systemd.mount(5)

/proc/self/sessionid¶

pam_systemd(8)

/proc/sys¶

file-hierarchy(7), systemd-nspawn(1)

/proc/sys/kernel/domainname¶

sysctl.d(5)

/proc/sys/kernel/random/boot_id¶

sd_id128_get_machine(3)

/proc/sys/net/ipv4/conf/enp3s0.200/forwarding¶

sysctl.d(5)

/proc/sys/net/ipv4/tcp_keepalive_time¶

systemd.socket(5)

/proc/sys/net/ipv6/bindv6only¶

systemd.socket(5)

/root¶

file-hierarchy(7)

/run¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sd-login(3), sysctl.d(5), systemctl(1), systemd-delta(1), systemd-journald.service(8), systemd-nspawn(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.exec(5), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), tmpfiles.d(5), udev(7)

/run/binfmt.d/*.conf¶

binfmt.d(5)

/run/foobar.pid¶

daemon(7)

/run/log¶

bootchart.conf(5), file-hierarchy(7), systemd-bootchart(1)

/run/log/journal¶

journalctl(1), journald.conf(5), systemd-journald.service(8)

/run/modules-load.d/*.conf¶

modules-load.d(5)

/run/nologin¶

shutdown(8), systemd-user-sessions.service(8)

/run/sysctl.d/*.conf¶

sysctl.d(5)

/run/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/run/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/run/systemd/journal/syslog¶

systemd-journald.service(8)

/run/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/run/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/run/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/run/systemd/notify¶

systemd(1)

/run/systemd/private¶

systemd(1)

/run/systemd/resolve/resolv.conf¶

systemd-resolved.service(8)

/run/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/run/systemd/shutdownd¶

systemd(1)

/run/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/run/systemd/system/¶

sd_booted(3), systemd.unit(5)

/run/systemd/system-preset/*.preset¶

systemd.preset(5)

/run/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/run/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/run/systemd/user/¶

systemd.unit(5)

/run/systemd/user-preset/*.preset¶

systemd.preset(5)

/run/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/run/tmpfiles.d¶

tmpfiles.d(5)

/run/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/run/udev/hwdb.d¶

udev(7)

/run/udev/rules.d¶

udev(7)

/run/udev/static_node-tags/tag¶

udev(7)

/run/user¶

file-hierarchy(7), systemd.exec(5)

/run/user/$USER¶

pam_systemd(8)

/sbin¶

file-hierarchy(7), systemd.exec(5)

/sbin/fsck.¶

systemd-fsck@.service(8)

/sbin/init¶

bootchart.conf(5)

/sbin/nologin¶

sysusers.d(5)

/srv¶

file-hierarchy(7), systemd-gpt-auto-generator(8)

/sys¶

file-hierarchy(7), loginctl(1), sd_is_fifo(3), systemd(1), systemd-nspawn(1), systemd-remount-fs.service(8), systemd.device(5), systemd.journal-fields(7), systemd.socket(5), tmpfiles.d(5), udevadm(8)

/sys/fs/cgroup¶

sd-login(3), systemd-cgls(1)

/sys/fs/cgroup/systemd/¶

systemd(1), systemd.unit(5)

/sys/fs/selinux¶

systemd-nspawn(1)

/sys/power/disk¶

systemd-sleep.conf(5)

/sys/power/resume¶

systemd-hibernate-resume@.service(8)

/sys/power/state¶

systemd-sleep.conf(5), systemd-suspend.service(8)

/sysroot¶

bootup(7)

/sysroot/etc/fstab¶

bootup(7)

/system-update¶

systemd-system-update-generator(8), systemd.special(7)

/tmp¶

crypttab(5), file-hierarchy(7), systemd.exec(5), systemd.unit(5), tmpfiles.d(5)

/tmp/var¶

systemd.unit(5)

/upload¶

systemd-journal-remote(8)

/usr¶

bootup(7), file-hierarchy(7), systemd-fstab-generator(8), systemd-nspawn(1), systemd-remount-fs.service(8), systemd-update-done.service(8), systemd.exec(5), systemd.mount(5), systemd.unit(5)

/usr/bin¶

file-hierarchy(7), systemd.exec(5)

/usr/bin/mount¶

systemctl(1)

/usr/bin/umount¶

systemctl(1)

/usr/include¶

file-hierarchy(7)

/usr/lib¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sysctl.d(5), systemd-delta(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), sysusers.d(5), timesyncd.conf(5), udev(7)

/usr/lib/binfmt.d/*.conf¶

binfmt.d(5)

/usr/lib/kernel/install.d/¶

kernel-install(8)

/usr/lib/kernel/install.d/*.install¶

kernel-install(8)

/usr/lib/modules-load.d/*.conf¶

modules-load.d(5)

/usr/lib/os-release¶

kernel-install(8), os-release(5), systemd-nspawn(1)

/usr/lib/sysctl.d/*.conf¶

sysctl.d(5)

/usr/lib/sysctl.d/50-coredump.conf¶

systemd-coredump(8)

/usr/lib/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/usr/lib/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/usr/lib/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/usr/lib/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/usr/lib/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/usr/lib/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/usr/lib/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/usr/lib/systemd/system¶

systemd(1), systemd.unit(5)

/usr/lib/systemd/system-generators/systemd-cryptsetup-generator¶

systemd-cryptsetup-generator(8)

/usr/lib/systemd/system-generators/systemd-debug-generator¶

systemd-debug-generator(8)

/usr/lib/systemd/system-generators/systemd-efi-boot-generator¶

systemd-efi-boot-generator(8)

/usr/lib/systemd/system-generators/systemd-fstab-generator¶

systemd-fstab-generator(8)

/usr/lib/systemd/system-generators/systemd-getty-generator¶

systemd-getty-generator(8)

/usr/lib/systemd/system-generators/systemd-gpt-auto-generator¶

systemd-gpt-auto-generator(8)

/usr/lib/systemd/system-generators/systemd-hibernate-resume-generator¶

systemd-hibernate-resume-generator(8)

/usr/lib/systemd/system-generators/systemd-system-update-generator¶

systemd-system-update-generator(8)

/usr/lib/systemd/system-generators/systemd-sysv-generator¶

systemd-sysv-generator(8)

/usr/lib/systemd/system-preset/*.preset¶

systemd.preset(5)

/usr/lib/systemd/system-preset/50-gnome.preset¶

systemd.preset(5)

/usr/lib/systemd/system-preset/99-default.preset¶

systemd.preset(5)

/usr/lib/systemd/system-shutdown/¶

systemd-halt.service(8)

/usr/lib/systemd/system-sleep¶

systemd-suspend.service(8)

/usr/lib/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/usr/lib/systemd/systemd-activate¶

systemd-activate(8)

/usr/lib/systemd/systemd-backlight¶

systemd-backlight@.service(8)

/usr/lib/systemd/systemd-binfmt¶

systemd-binfmt.service(8)

/usr/lib/systemd/systemd-bootchart¶

systemd-bootchart(1)

/usr/lib/systemd/systemd-bus-proxyd¶

systemd-bus-proxyd(8)

/usr/lib/systemd/systemd-coredump¶

systemd-coredump(8)

/usr/lib/systemd/systemd-cryptsetup¶

systemd-cryptsetup@.service(8)

/usr/lib/systemd/systemd-fsck¶

systemd-fsck@.service(8)

/usr/lib/systemd/systemd-hibernate-resume¶

systemd-hibernate-resume@.service(8)

/usr/lib/systemd/systemd-hostnamed¶

systemd-hostnamed.service(8)

/usr/lib/systemd/systemd-initctl¶

systemd-initctl.service(8)

/usr/lib/systemd/systemd-journal-gatewayd¶

systemd-journal-gatewayd.service(8)

/usr/lib/systemd/systemd-journald¶

systemd-journald.service(8)

/usr/lib/systemd/systemd-localed¶

systemd-localed.service(8)

/usr/lib/systemd/systemd-logind¶

systemd-logind.service(8)

/usr/lib/systemd/systemd-machine-id-commit¶

systemd-machine-id-commit.service(8)

/usr/lib/systemd/systemd-machined¶

systemd-machined.service(8)

/usr/lib/systemd/systemd-modules-load¶

systemd-modules-load.service(8)

/usr/lib/systemd/systemd-networkd¶

systemd-networkd.service(8)

/usr/lib/systemd/systemd-networkd-wait-online¶

systemd-networkd-wait-online.service(8)

/usr/lib/systemd/systemd-quotacheck¶

systemd-quotacheck.service(8)

/usr/lib/systemd/systemd-random-seed¶

systemd-random-seed.service(8)

/usr/lib/systemd/systemd-remount-fs¶

systemd-remount-fs.service(8)

/usr/lib/systemd/systemd-resolved¶

systemd-resolved.service(8)

/usr/lib/systemd/systemd-rfkill¶

systemd-rfkill@.service(8)

/usr/lib/systemd/systemd-shutdown¶

systemd-halt.service(8)

/usr/lib/systemd/systemd-shutdownd¶

systemd-shutdownd.service(8)

/usr/lib/systemd/systemd-sysctl¶

systemd-sysctl.service(8)

/usr/lib/systemd/systemd-timedated¶

systemd-timedated.service(8)

/usr/lib/systemd/systemd-timesyncd¶

systemd-timesyncd.service(8)

/usr/lib/systemd/systemd-udevd¶

systemd-udevd.service(8)

/usr/lib/systemd/systemd-update-done¶

systemd-update-done.service(8)

/usr/lib/systemd/systemd-update-utmp¶

systemd-update-utmp.service(8)

/usr/lib/systemd/systemd-user-sessions¶

systemd-user-sessions.service(8)

/usr/lib/systemd/systemd-vconsole-setup¶

systemd-vconsole-setup.service(8)

/usr/lib/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/usr/lib/systemd/user/¶

systemd.unit(5)

/usr/lib/systemd/user-preset/*.preset¶

systemd.preset(5)

/usr/lib/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/usr/lib/sysusers.d/*.conf¶

sysusers.d(5)

/usr/lib/tmpfiles.d¶

tmpfiles.d(5)

/usr/lib/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/usr/lib/udev¶

udev(7)

/usr/lib/udev/hwdb.bin¶

udev(7), udevadm(8)

/usr/lib/udev/hwdb.d¶

udev(7)

/usr/lib/udev/rules.d¶

udev(7)

/usr/lib64¶

file-hierarchy(7)

/usr/local/bin¶

systemd.exec(5)

/usr/local/lib/systemd/system¶

systemd(1)

/usr/local/sbin¶

systemd.exec(5)

/usr/sbin¶

file-hierarchy(7), systemd.exec(5)

/usr/share¶

file-hierarchy(7)

/usr/share/doc¶

file-hierarchy(7)

/usr/share/factory¶

file-hierarchy(7), tmpfiles.d(5)

/usr/share/factory/etc¶

file-hierarchy(7)

/usr/share/factory/var¶

file-hierarchy(7)

/usr/share/zoneinfo/¶

localtime(5)

/var¶

file-hierarchy(7), journald.conf(5), systemd-journald.service(8), systemd-nspawn(1), systemd-update-done.service(8), systemd.unit(5), tmpfiles.d(5)

/var/.updated¶

systemd-update-done.service(8)

/var/cache¶

file-hierarchy(7)

/var/lib¶

file-hierarchy(7)

/var/lib/dbus/machine-id¶

machine-id(5)

/var/lib/systemd/backlight/¶

systemd-backlight@.service(8)

/var/lib/systemd/coredump¶

coredump.conf(5), systemd-coredump(8)

/var/lib/systemd/journal-upload/state¶

systemd-journal-upload(8)

/var/lib/systemd/random-seed¶

systemd-random-seed.service(8)

/var/lib/systemd/rfkill/¶

systemd-rfkill@.service(8)

/var/log¶

file-hierarchy(7)

/var/log/journal¶

journalctl(1), journald.conf(5), systemd-journald.service(8), systemd-nspawn(1)

/var/log/journal/remote/¶

systemd-journal-remote(8)

/var/log/journal/some.host/remote-some~host.journal¶

systemd-journal-remote(8)

/var/run¶

file-hierarchy(7), tmpfiles.d(5)

/var/run/dbus/system_bus_socket¶

systemd-bus-proxyd@.service(8)

/var/run/utmp¶

runlevel(8)

/var/spool¶

file-hierarchy(7)

/var/tmp¶

file-hierarchy(7), systemd.exec(5), tmpfiles.d(5)

automount.automount¶

systemd.automount(5), systemd.unit(5)

basic.target¶

systemd.special(7)

bluetooth.target¶

systemd.special(7)

bootctl¶

bootctl(1)

busctl¶

busctl(1)

coredumpctl¶

coredumpctl(1)

cryptsetup-pre.target¶

systemd.special(7)

cryptsetup.target¶

systemd.special(7)

ctrl-alt-del.target¶

systemd.special(7)

dbus.service¶

systemd.special(7)

dbus.socket¶

systemd.special(7)

default.target¶

systemd.special(7)

device.device¶

systemd.device(5), systemd.unit(5)

display-manager.service¶

systemd.special(7)

emergency.target¶

systemd.special(7)

exit.target¶

systemd.special(7)

final.target¶

systemd.special(7)

getty.target¶

systemd.special(7)

graphical.target¶

systemd.special(7)

halt¶

halt(8)

halt.target¶

systemd.special(7)

hibernate.target¶

systemd.special(7)

hostnamectl¶

hostnamectl(1)

hybrid-sleep.target¶

systemd.special(7)

init¶

systemd(1)

initrd-fs.target¶

systemd.special(7)

initrd-root-fs.target¶

systemd.special(7)

journalctl¶

journalctl(1)

kbrequest.target¶

systemd.special(7)

kernel-install¶

kernel-install(8)

kexec.target¶

systemd.special(7)

systemd.link(5)

local-fs-pre.target¶

systemd.special(7)

local-fs.target¶

systemd.special(7)

localectl¶

localectl(1)

loginctl¶

loginctl(1)

machine.slice¶

systemd.special(7)

machinectl¶

machinectl(1)

mount.mount¶

systemd.exec(5), systemd.kill(5), systemd.mount(5), systemd.resource-control(5), systemd.unit(5)

multi-user.target¶

systemd.special(7)

netdev.netdev¶

systemd.netdev(5)

network.network¶

systemd.network(5)

network-online.target¶

systemd.special(7)

network-pre.target¶

systemd.special(7)

network.target¶

systemd.special(7)

nss-lookup.target¶

systemd.special(7)

nss-myhostname.la¶

nss-myhostname(8)

nss-user-lookup.target¶

systemd.special(7)

pam_systemd.so¶

pam_systemd(8)

path.path¶

systemd.path(5), systemd.unit(5)

paths.target¶

systemd.special(7)

pkg-config¶

sd-daemon(3), sd-id128(3), sd-journal(3), sd-login(3)

poweroff¶

halt(8)

poweroff.target¶

systemd.special(7)

printer.target¶

systemd.special(7)

reboot¶

halt(8)

reboot.target¶

systemd.special(7)

remote-fs-pre.target¶

systemd.special(7)

remote-fs.target¶

systemd.special(7)

rescue.target¶

systemd.special(7)

rpcbind.target¶

systemd.special(7)

runlevel¶

runlevel(8)

runlevel2.target¶

systemd.special(7)

runlevel3.target¶

systemd.special(7)

runlevel4.target¶

systemd.special(7)

runlevel5.target¶

systemd.special(7)

scope.scope¶

systemd.kill(5), systemd.resource-control(5), systemd.scope(5), systemd.unit(5)

service.service¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.service(5), systemd.unit(5)

shutdown¶

shutdown(8)

shutdown.target¶

systemd.special(7)

sigpwr.target¶

systemd.special(7)

sleep.target¶

systemd.special(7)

slice.slice¶

systemd.resource-control(5), systemd.slice(5), systemd.unit(5)

smartcard.target¶

systemd.special(7)

snapshot.snapshot¶

systemd.snapshot(5), systemd.unit(5)

socket.socket¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.socket(5), systemd.unit(5)

sockets.target¶

systemd.special(7)

sound.target¶

systemd.special(7)

suspend.target¶

systemd.special(7)

swap.swap¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.swap(5), systemd.unit(5)

swap.target¶

systemd.special(7)

sysinit.target¶

systemd.special(7)

syslog.socket¶

systemd.special(7)

system-update.target¶

systemd.special(7)

system.slice¶

systemd.special(7)

systemctl¶

systemctl(1)

systemd¶

systemd(1)

systemd-analyze¶

systemd-analyze(1)

systemd-ask-password¶

systemd-ask-password(1)

systemd-ask-password-console.path¶

systemd-ask-password-console.service(8)

systemd-ask-password-console.service¶

systemd-ask-password-console.service(8)

systemd-ask-password-wall.path¶

systemd-ask-password-console.service(8)

systemd-ask-password-wall.service¶

systemd-ask-password-console.service(8)

systemd-backlight@.service¶

systemd-backlight@.service(8)

systemd-binfmt.service¶

systemd-binfmt.service(8)

systemd-bus-proxyd.socket¶

systemd-bus-proxyd@.service(8)

systemd-bus-proxyd@.service¶

systemd-bus-proxyd@.service(8)

systemd-cat¶

systemd-cat(1)

systemd-cgls¶

systemd-cgls(1)

systemd-cgtop¶

systemd-cgtop(1)

systemd-cryptsetup@.service¶

systemd-cryptsetup@.service(8)

systemd-delta¶

systemd-delta(1)

systemd-detect-virt¶

systemd-detect-virt(1)

systemd-escape¶

systemd-escape(1)

systemd-firstboot¶

systemd-firstboot(1)

systemd-firstboot.service¶

systemd-firstboot(1)

systemd-fsck-root.service¶

systemd-fsck@.service(8)

systemd-fsck@.service¶

systemd-fsck@.service(8)

systemd-halt.service¶

systemd-halt.service(8)

systemd-hibernate-resume@.service¶

systemd-hibernate-resume@.service(8)

systemd-hibernate.service¶

systemd-suspend.service(8)

systemd-hostnamed.service¶

systemd-hostnamed.service(8)

systemd-hybrid-sleep.service¶

systemd-suspend.service(8)

systemd-inhibit¶

systemd-inhibit(1)

systemd-initctl.service¶

systemd-initctl.service(8)

systemd-initctl.socket¶

systemd-initctl.service(8)

systemd-journal-gatewayd.service¶

systemd-journal-gatewayd.service(8)

systemd-journal-gatewayd.socket¶

systemd-journal-gatewayd.service(8)

systemd-journal-remote¶

systemd-journal-remote(8)

systemd-journal-upload¶

systemd-journal-upload(8)

systemd-journald-dev-log.socket¶

systemd-journald.service(8)

systemd-journald.service¶

systemd-journald.service(8)

systemd-journald.socket¶

systemd-journald.service(8)

systemd-kexec.service¶

systemd-halt.service(8)

systemd-localed.service¶

systemd-localed.service(8)

systemd-logind.service¶

systemd-logind.service(8)

systemd-machine-id-commit¶

systemd-machine-id-commit(1)

systemd-machine-id-commit.service¶

systemd-machine-id-commit.service(8)

systemd-machine-id-setup¶

systemd-machine-id-setup(1)

systemd-machined.service¶

systemd-machined.service(8)

systemd-modules-load.service¶

systemd-modules-load.service(8)

systemd-networkd-wait-online.service¶

systemd-networkd-wait-online.service(8)

systemd-networkd.service¶

systemd-networkd.service(8)

systemd-notify¶

systemd-notify(1)

systemd-nspawn¶

systemd-nspawn(1)

systemd-path¶

systemd-path(1)

systemd-poweroff.service¶

systemd-halt.service(8)

systemd-quotacheck.service¶

systemd-quotacheck.service(8)

systemd-random-seed.service¶

systemd-random-seed.service(8)

systemd-reboot.service¶

systemd-halt.service(8)

systemd-remount-fs.service¶

systemd-remount-fs.service(8)

systemd-resolved.service¶

systemd-resolved.service(8)

systemd-rfkill@.service¶

systemd-rfkill@.service(8)

systemd-run¶

systemd-run(1)

systemd-shutdownd.service¶

systemd-shutdownd.service(8)

systemd-shutdownd.socket¶

systemd-shutdownd.service(8)

systemd-socket-proxyd¶

systemd-socket-proxyd(8)

systemd-suspend.service¶

systemd-suspend.service(8)

systemd-sysctl.service¶

systemd-sysctl.service(8)

systemd-sysusers¶

systemd-sysusers(8)

systemd-sysusers.service¶

systemd-sysusers(8)

systemd-timedated.service¶

systemd-timedated.service(8)

systemd-timesyncd.service¶

systemd-timesyncd.service(8)

systemd-tmpfiles¶

systemd-tmpfiles(8)

systemd-tmpfiles-clean.service¶

systemd-tmpfiles(8)

systemd-tmpfiles-clean.timer¶

systemd-tmpfiles(8)

systemd-tmpfiles-setup-dev.service¶

systemd-tmpfiles(8)

systemd-tmpfiles-setup.service¶

systemd-tmpfiles(8)

systemd-tty-ask-password-agent¶

systemd-tty-ask-password-agent(1)

systemd-udevd-control.socket¶

systemd-udevd.service(8)

systemd-udevd-kernel.socket¶

systemd-udevd.service(8)

systemd-udevd.service¶

systemd-udevd.service(8)

systemd-update-done.service¶

systemd-update-done.service(8)

systemd-update-utmp-runlevel.service¶

systemd-update-utmp.service(8)

systemd-update-utmp.service¶

systemd-update-utmp.service(8)

systemd-user-sessions.service¶

systemd-user-sessions.service(8)

systemd-vconsole-setup.service¶

systemd-vconsole-setup.service(8)

target.target¶

systemd.target(5), systemd.unit(5)

telinit¶

telinit(8)

time-sync.target¶

systemd.special(7)

timedatectl¶

timedatectl(1)

timer.timer¶

systemd.timer(5), systemd.unit(5)

timers.target¶

systemd.special(7)

udevadm¶

udevadm(8)

umount.target¶

systemd.special(7)

user.slice¶

systemd.special(7)

Colophon¶

This index contains 1777 entries in 14 sections, -referring to 192 individual manual pages. + encrypted volumes.

System manager directives¶

Directives for configuring the behaviour of the + systemd process.

CPUAffinity=¶

systemd-system.conf(5)

CapabilityBoundingSet=¶

systemd-system.conf(5)

CrashChVT=¶

systemd-system.conf(5)

CrashShell=¶

systemd-system.conf(5)

DefaultBlockIOAccounting=¶

systemd-system.conf(5)

DefaultCPUAccounting=¶

systemd-system.conf(5)

DefaultEnvironment=¶

systemd-system.conf(5)

DefaultLimitAS=¶

systemd-system.conf(5)

DefaultLimitCORE=¶

systemd-system.conf(5)

DefaultLimitCPU=¶

systemd-system.conf(5)

DefaultLimitDATA=¶

systemd-system.conf(5)

DefaultLimitFSIZE=¶

systemd-system.conf(5)

DefaultLimitLOCKS=¶

systemd-system.conf(5)

DefaultLimitMEMLOCK=¶

systemd-system.conf(5)

DefaultLimitMSGQUEUE=¶

systemd-system.conf(5)

DefaultLimitNICE=¶

systemd-system.conf(5)

DefaultLimitNOFILE=¶

systemd-system.conf(5)

DefaultLimitNPROC=¶

systemd-system.conf(5)

DefaultLimitRSS=¶

systemd-system.conf(5)

DefaultLimitRTPRIO=¶

systemd-system.conf(5)

DefaultLimitRTTIME=¶

systemd-system.conf(5)

DefaultLimitSIGPENDING=¶

systemd-system.conf(5)

DefaultLimitSTACK=¶

systemd-system.conf(5)

DefaultMemoryAccounting=¶

systemd-system.conf(5)

DefaultRestartSec=¶

systemd-system.conf(5)

DefaultStandardError=¶

systemd-system.conf(5)

DefaultStandardOutput=¶

systemd-system.conf(5)

DefaultStartLimitBurst=¶

systemd-system.conf(5)

DefaultStartLimitInterval=¶

systemd-system.conf(5)

DefaultTimeoutStartSec=¶

systemd-system.conf(5)

DefaultTimeoutStopSec=¶

systemd-system.conf(5)

DefaultTimerAccuracySec=¶

systemd-system.conf(5)

DumpCore=¶

systemd-system.conf(5)

HibernateMode=¶

systemd-sleep.conf(5)

HibernateState=¶

systemd-sleep.conf(5)

HybridSleepMode=¶

systemd-sleep.conf(5)

HybridSleepState=¶

systemd-sleep.conf(5)

JoinControllers=¶

systemd-system.conf(5)

LogColor=¶

systemd-system.conf(5)

LogLevel=¶

systemd-system.conf(5)

LogLocation=¶

systemd-system.conf(5)

LogTarget=¶

systemd-system.conf(5)

RuntimeWatchdogSec=¶

systemd-system.conf(5)

ShowStatus=¶

systemd-system.conf(5)

ShutdownWatchdogSec=¶

systemd-system.conf(5)

SuspendMode=¶

systemd-sleep.conf(5)

SuspendState=¶

systemd-sleep.conf(5)

SystemCallArchitectures=¶

systemd-system.conf(5)

TimerSlackNSec=¶

systemd-system.conf(5)

bootchart.conf directives¶

Directives for configuring the behaviour of the + systemd-bootchart process.

command line options¶

Command-line options accepted by programs in the + systemd suite.

--accept¶

systemd-activate(8)

--accept-cached¶

systemd-ask-password(1)

--acquired¶

busctl(1)

--action=¶

udevadm(8)

--activatable¶

busctl(1)

--address=¶

busctl(1), systemd-bus-proxyd(8)

--adjust-system-clock¶

timedatectl(1)

--after¶

systemctl(1)

--after-cursor=¶

journalctl(1), systemd-journal-upload(8)

--all¶

journalctl(1), loginctl(1), machinectl(1), networkctl(1), systemctl(1), systemd-cgls(1)

--allow-interactive-authorization=¶

busctl(1)

--attr-match=¶

udevadm(8)

--attr-nomatch=¶

udevadm(8)

--attribute-walk¶

udevadm(8)

--augment-creds=¶

busctl(1)

--auto-start=¶

busctl(1)

--batch¶

systemd-cgtop(1)

--before¶

systemctl(1)

--bind-ro=¶

systemd-nspawn(1)

--bind=¶

systemd-nspawn(1)

--boot¶

systemd-nspawn(1), systemd-tmpfiles(8)

--boot=¶

journalctl(1)

--booted¶

systemd-notify(1)

--capability=¶

systemd-nspawn(1)

--catalog¶

journalctl(1)

--cert=¶

systemd-journal-gatewayd.service(8)

--children-max=¶

systemd-udevd.service(8), udevadm(8)

--clean¶

systemd-tmpfiles(8)

--cleanup-db¶

udevadm(8)

--cmdline¶

systemd-bootchart(1)

--compress¶

systemd-journal-remote(8)

--confirm-spawn¶

systemd(1)

--console¶

systemd-tty-ask-password-agent(1)

--container¶

systemd-detect-virt(1)

--control-group¶

systemd-bootchart(1)

--copy¶

systemd-firstboot(1)

--copy-locale¶

systemd-firstboot(1)

--copy-root-password¶

systemd-firstboot(1)

--copy-timezone¶

systemd-firstboot(1)

--crash-shell¶

systemd(1)

--create¶

systemd-tmpfiles(8)

--cursor=¶

journalctl(1), systemd-journal-upload(8)

--daemon¶

systemd-udevd.service(8)

--debug¶

systemd-udevd.service(8), udevadm(8)

--default-standard-error=¶

systemd(1)

--default-standard-output=¶

systemd(1)

--delay=¶

systemd-cgtop(1)

--depth=¶

systemd-cgtop(1)

--description=¶

systemd-run(1)

--device-id-of-file=¶

udevadm(8)

--diff=¶

systemd-delta(1)

--directory=¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1)

--disk-usage¶

journalctl(1)

--dkr-index-url¶

machinectl(1)

--dmesg¶

journalctl(1)

--drop-capability=¶

systemd-nspawn(1)

--dry-run¶

udevadm(8)

--dump-catalog¶

journalctl(1)

--dump-configuration-items¶

systemd(1)

--dump-core¶

systemd(1)

--echo¶

systemd-ask-password(1)

--entropy¶

systemd-bootchart(1)

--ephemeral¶

systemd-nspawn(1)

--event-timeout=¶

systemd-udevd.service(8)

--exclude-prefix=¶

systemd-tmpfiles(8)

--exec-delay=¶

systemd-udevd.service(8)

--exit¶

udevadm(8)

--exit-if-exists=¶

udevadm(8)

--expect-reply=¶

busctl(1)

--export¶

udevadm(8)

--export-db¶

udevadm(8)

--export-prefix=¶

udevadm(8)

--field=¶

coredumpctl(1), journalctl(1)

--file=¶

journalctl(1), systemd-journal-upload(8)

--flush¶

journalctl(1)

--follow¶

journalctl(1)

--force¶

halt(8), journalctl(1), machinectl(1), systemctl(1)

--freq¶

systemd-bootchart(1)

--from-pattern=¶

systemd-analyze(1)

--full¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-cgls(1)

--fuzz=¶

systemd-analyze(1)

--getter=¶

systemd-journal-remote(8)

--gid=¶

systemd-run(1)

--global¶

systemctl(1)

--halt¶

halt(8), shutdown(8)

--header¶

journalctl(1)

--help¶

bootctl(1), busctl(1), coredumpctl(1), halt(8), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), networkctl(1), runlevel(8), shutdown(8), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-ask-password(1), systemd-bootchart(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-hwdb(8), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), systemd-udevd.service(8), telinit(8), timedatectl(1), udevadm(8)

--host=¶

busctl(1), hostnamectl(1), localectl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-run(1), timedatectl(1)

--hostname=¶

systemd-firstboot(1)

--icon=¶

systemd-ask-password(1)

--identifier=¶

journalctl(1), systemd-cat(1)

--ignore-inhibitors¶

systemctl(1)

--ignore=¶

systemd-networkd-wait-online.service(8)

--image=¶

systemd-nspawn(1)

--init¶

systemd-bootchart(1)

--interface=¶

systemd-networkd-wait-online.service(8)

--interval=¶

journalctl(1)

--iterations=¶

systemd-cgtop(1)

--job-mode=¶

systemctl(1)

--keep-unit¶

systemd-nspawn(1)

--kernel¶

udevadm(8)

--key=¶

systemd-journal-gatewayd.service(8)

--kill-who=¶

loginctl(1), machinectl(1), systemctl(1)

--level-prefix=¶

systemd-cat(1)

--lines=¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1)

systemd-nspawn(1)

--list¶

busctl(1), systemd-inhibit(1), systemd-tty-ask-password-agent(1)

--list-boots¶

journalctl(1)

--list-catalog¶

journalctl(1)

--listen-http=¶

systemd-journal-remote(8)

--listen-https=¶

systemd-journal-remote(8)

--listen-raw=¶

systemd-journal-remote(8)

--listen=¶

systemd-activate(8)

--locale-messages=¶

systemd-firstboot(1)

--locale=¶

systemd-firstboot(1)

--log-color=¶

systemd(1)

--log-level=¶

systemd(1)

--log-location=¶

systemd(1)

--log-priority=¶

udevadm(8)

--log-target=¶

systemd(1)

--machine-id=¶

systemd-firstboot(1)

--machine=¶

busctl(1), hostnamectl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-nspawn(1), systemd-run(1), timedatectl(1)

--mangle¶

systemd-escape(1)

--match=¶

busctl(1)

--merge¶

journalctl(1), systemd-journal-upload(8)

--mkdir¶

machinectl(1)

--mode=¶

systemd-inhibit(1)

--multiple¶

systemd-ask-password(1)

--name-match=¶

udevadm(8)

--name=¶

udevadm(8)

--network-bridge=¶

systemd-nspawn(1)

--network-interface=¶

systemd-nspawn(1)

--network-ipvlan=¶

systemd-nspawn(1)

--network-macvlan=¶

systemd-nspawn(1)

--network-veth¶

systemd-nspawn(1)

--new-id128¶

journalctl(1)

--nice=¶

systemd-run(1)

--no-ask-password¶

hostnamectl(1), localectl(1), loginctl(1), machinectl(1), systemctl(1), timedatectl(1)

--no-block¶

systemctl(1)

--no-compress¶

systemd-journal-remote(8)

--no-convert¶

localectl(1)

--no-filter¶

systemd-bootchart(1)

--no-full¶

journalctl(1)

--no-legend¶

busctl(1), coredumpctl(1), loginctl(1), machinectl(1), systemctl(1)

--no-man¶

systemd-analyze(1)

--no-pager¶

busctl(1), coredumpctl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), networkctl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-delta(1), timedatectl(1)

--no-reload¶

systemctl(1)

--no-seal¶

systemd-journal-remote(8)

--no-tail¶

journalctl(1)

--no-tty¶

systemd-ask-password(1)

--no-wall¶

halt(8), shutdown(8), systemctl(1), telinit(8)

--no-wtmp¶

halt(8)

--on-active=¶

systemd-run(1)

--on-boot=¶

systemd-run(1)

--on-calendar=¶

systemd-run(1)

--on-startup=¶

systemd-run(1)

--on-unit-active=¶

systemd-run(1)

--on-unit-inactive=¶

systemd-run(1)

--order¶

systemd-analyze(1)

--output¶

systemd-bootchart(1)

--output=¶

coredumpctl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-journal-remote(8)

--pager-end¶

journalctl(1)

--parent-match=¶

udevadm(8)

--path¶

systemd-escape(1)

--path=¶

udevadm(8)

--personality=¶

systemd-nspawn(1)

--pid=¶

systemd-notify(1)

--plain¶

systemctl(1)

--plymouth¶

systemd-tty-ask-password-agent(1)

--port=¶

systemd-nspawn(1)

--poweroff¶

halt(8), shutdown(8)

--prefix=¶

systemd-tmpfiles(8)

--preset-mode=¶

systemctl(1)

--pretty¶

hostnamectl(1)

--priority=¶

journalctl(1), systemd-cat(1)

--private-network¶

systemd-nspawn(1)

--prompt¶

systemd-firstboot(1)

--prompt-hostname¶

systemd-firstboot(1)

--prompt-locale¶

systemd-firstboot(1)

--prompt-root-password¶

systemd-firstboot(1)

--prompt-timezone¶

systemd-firstboot(1)

--property¶

udevadm(8)

--property-match=¶

udevadm(8)

--property=¶

loginctl(1), machinectl(1), systemctl(1), systemd-run(1), udevadm(8)

--pss¶

systemd-bootchart(1)

--pty¶

systemd-run(1)

--query¶

systemd-tty-ask-password-agent(1)

--query=¶

udevadm(8)

--quiet¶

busctl(1), journalctl(1), systemctl(1), systemd-detect-virt(1), systemd-nspawn(1), systemd-run(1)

--read-only¶

machinectl(1), systemd-nspawn(1)

--ready¶

systemd-notify(1)

--reboot¶

halt(8), shutdown(8)

--recursive¶

systemctl(1)

--register=¶

systemd-nspawn(1)

--rel¶

systemd-bootchart(1)

--reload¶

udevadm(8)

--remain-after-exit¶

systemd-run(1)

--remove¶

systemd-tmpfiles(8)

--require¶

systemd-analyze(1)

--resolve-names=¶

systemd-udevd.service(8), udevadm(8)

--reverse¶

journalctl(1), systemctl(1)

--root¶

udevadm(8)

--root-password-file=¶

systemd-firstboot(1)

--root-password=¶

systemd-firstboot(1)

--root=¶

journalctl(1), systemctl(1), systemd-firstboot(1), systemd-hwdb(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-sysusers(8), systemd-tmpfiles(8)

--runtime¶

systemctl(1)

--sample¶

systemd-bootchart(1)

--save-state¶

systemd-journal-upload(8)

--scale-x¶

systemd-bootchart(1)

--scale-y¶

systemd-bootchart(1)

--scope¶

systemd-run(1)

--seal¶

systemd-journal-remote(8)

--selinux-apifs-context=¶

systemd-nspawn(1)

--selinux-context=¶

systemd-nspawn(1)

--send-sighup¶

systemd-run(1)

--service-type=¶

systemd-run(1)

--setenv=¶

systemd-activate(8), systemd-nspawn(1), systemd-run(1)

--setup-keys¶

journalctl(1)

--setup-machine-id¶

systemd-firstboot(1)

--share-system¶

systemd-nspawn(1)

--show-cursor¶

journalctl(1)

--show-machine¶

busctl(1)

--show-status=¶

systemd(1)

--show-types¶

systemctl(1)

--signal=¶

loginctl(1), machinectl(1), systemctl(1)

--since=¶

journalctl(1)

--size=¶

busctl(1)

--slice=¶

systemd-nspawn(1), systemd-run(1)

--split-mode¶

systemd-journal-remote(8)

--start-exec-queue¶

udevadm(8)

--state=¶

systemctl(1)

--static¶

hostnamectl(1)

--status=¶

systemd-notify(1)

--stop-exec-queue¶

udevadm(8)

--subsystem-match=¶

udevadm(8)

--subsystem-nomatch=¶

udevadm(8)

--suffix=¶

systemd-escape(1), systemd-path(1)

--sysname-match=¶

udevadm(8)

--system¶

busctl(1), journalctl(1), systemctl(1), systemd(1), systemd-analyze(1), systemd-journal-upload(8), systemd-run(1)

--tag-match=¶

udevadm(8)

--template=¶

systemd-escape(1), systemd-nspawn(1)

--test¶

systemd(1)

--timeout=¶

busctl(1), systemd-ask-password(1), systemd-networkd-wait-online.service(8), udevadm(8)

--timer-property=¶

systemd-run(1)

--timezone=¶

systemd-firstboot(1)

--tmpfs=¶

systemd-nspawn(1)

--to-pattern=¶

systemd-analyze(1)

--transient¶

hostnamectl(1)

--type=¶

systemctl(1), systemd-delta(1), udevadm(8)

--udev¶

udevadm(8)

--uid=¶

systemd-run(1)

--unescape¶

systemd-escape(1)

--unique¶

busctl(1)

--unit=¶

journalctl(1), systemd(1), systemd-run(1)

--until=¶

journalctl(1)

--update-catalog¶

journalctl(1)

--url=¶

systemd-journal-remote(8), systemd-journal-upload(8)

--user¶

busctl(1), journalctl(1), systemctl(1), systemd(1), systemd-analyze(1), systemd-journal-upload(8), systemd-run(1)

--user-unit=¶

journalctl(1)

--user=¶

systemd-nspawn(1)

--usr¶

systemd-hwdb(8)

--utc¶

journalctl(1)

--uuid=¶

systemd-nspawn(1)

--vacuum-size=¶

journalctl(1)

--vacuum-time=¶

journalctl(1)

--verbose¶

busctl(1), udevadm(8)

--verify¶

journalctl(1)

--verify-key=¶

journalctl(1)

--verify=¶

machinectl(1)

--version¶

bootctl(1), busctl(1), coredumpctl(1), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), networkctl(1), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), systemd-udevd.service(8), timedatectl(1), udevadm(8)

--vm¶

systemd-detect-virt(1)

--volatile¶

systemd-nspawn(1)

--wall¶

systemd-tty-ask-password-agent(1)

--watch¶

systemd-tty-ask-password-agent(1)

--what=¶

systemd-inhibit(1)

--who=¶

systemd-inhibit(1)

--why=¶

systemd-inhibit(1)

--wtmp-only¶

halt(8)

-1¶

coredumpctl(1)

-A¶

udevadm(8)

-C¶

systemd-bootchart(1)

-D¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1)

-E¶

systemd-activate(8), udevadm(8)

-F¶

coredumpctl(1), journalctl(1), systemd-bootchart(1)

-H¶

busctl(1), hostnamectl(1), localectl(1), loginctl(1), machinectl(1), shutdown(8), systemctl(1), systemd-analyze(1), systemd-run(1), timedatectl(1)

-L¶

systemd-nspawn(1)

-M¶

busctl(1), hostnamectl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-analyze(1), systemd-cgls(1), systemd-nspawn(1), systemd-run(1), timedatectl(1)

-N¶

udevadm(8)

-P¶

shutdown(8), udevadm(8)

-R¶

udevadm(8)

-S¶

udevadm(8)

-Z¶

systemd-nspawn(1)

-a¶

journalctl(1), loginctl(1), machinectl(1), networkctl(1), systemctl(1), systemd-activate(8), udevadm(8)

-b¶

journalctl(1), systemd-cgtop(1), systemd-nspawn(1), udevadm(8)

-c¶

journalctl(1), shutdown(8), systemd-cgtop(1), systemd-detect-virt(1), udevadm(8)

-d¶

halt(8), systemd-cgtop(1), udevadm(8)

-e¶

journalctl(1), systemd-bootchart(1), udevadm(8)

-f¶

halt(8), journalctl(1), systemctl(1), systemd-bootchart(1)

-g¶

systemd-bootchart(1), udevadm(8)

-h¶

bootctl(1), busctl(1), coredumpctl(1), hostnamectl(1), journalctl(1), localectl(1), loginctl(1), machinectl(1), networkctl(1), shutdown(8), systemctl(1), systemd(1), systemd-activate(8), systemd-analyze(1), systemd-ask-password(1), systemd-bootchart(1), systemd-bus-proxyd(8), systemd-cat(1), systemd-cgls(1), systemd-cgtop(1), systemd-delta(1), systemd-detect-virt(1), systemd-escape(1), systemd-firstboot(1), systemd-hwdb(8), systemd-inhibit(1), systemd-journal-gatewayd.service(8), systemd-journal-remote(8), systemd-journal-upload(8), systemd-machine-id-commit(1), systemd-machine-id-setup(1), systemd-notify(1), systemd-nspawn(1), systemd-path(1), systemd-run(1), systemd-socket-proxyd(8), systemd-suspend.service(8), systemd-sysusers(8), systemd-tmpfiles(8), systemd-tty-ask-password-agent(1), timedatectl(1), udevadm(8)

-i¶

systemctl(1), systemd-bootchart(1), systemd-cgtop(1), systemd-networkd-wait-online.service(8), systemd-nspawn(1)

-j¶

systemd-nspawn(1)

-k¶

journalctl(1), shutdown(8), systemd-cgls(1), udevadm(8)

-l¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-activate(8), systemd-cgls(1), udevadm(8)

-m¶

journalctl(1), systemd-cgtop(1), systemd-journal-upload(8), udevadm(8)

-n¶

journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-bootchart(1), systemd-cgtop(1), systemd-nspawn(1), udevadm(8)

-o¶

coredumpctl(1), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-bootchart(1)

-p¶

halt(8), journalctl(1), loginctl(1), machinectl(1), systemctl(1), systemd-bootchart(1), systemd-cat(1), systemd-cgtop(1), systemd-escape(1), systemd-nspawn(1), systemd-run(1), udevadm(8)

-q¶

journalctl(1), systemctl(1), systemd-detect-virt(1), systemd-nspawn(1), systemd-run(1), udevadm(8)

-r¶

journalctl(1), shutdown(8), systemctl(1), systemd-bootchart(1), systemd-hwdb(8), udevadm(8)

-s¶

loginctl(1), machinectl(1), systemctl(1), udevadm(8)

-t¶

journalctl(1), systemctl(1), systemd-cat(1), systemd-cgtop(1), systemd-delta(1), systemd-run(1), udevadm(8)

-u¶

journalctl(1), systemd-journal-upload(8), systemd-nspawn(1), udevadm(8)

-v¶

systemd-detect-virt(1), udevadm(8)

-w¶

halt(8)

-x¶

journalctl(1), systemd-bootchart(1), systemd-nspawn(1), udevadm(8)

-y¶

systemd-bootchart(1), udevadm(8)

auto¶

systemd.resource-control(5)

cat¶

journalctl(1)

closed¶

systemd.resource-control(5)

driver¶

systemd.journal-fields(7)

export¶

journalctl(1)

hibernate¶

systemd-suspend.service(8)

hybrid-sleep¶

systemd-suspend.service(8)

journal¶

systemd.journal-fields(7)

json¶

journalctl(1)

json-pretty¶

journalctl(1)

json-sse¶

journalctl(1)

kernel¶

systemd.journal-fields(7)

short¶

journalctl(1)

short-iso¶

journalctl(1)

short-monotonic¶

journalctl(1)

short-precise¶

journalctl(1)

stdout¶

systemd.journal-fields(7)

strict¶

systemd.resource-control(5)

suspend¶

systemd-suspend.service(8)

syslog¶

systemd.journal-fields(7)

verbose¶

journalctl(1)

Constants¶

Various constant used and/or defined by systemd.

-1¶

sd_journal_get_fd(3), sd_login_monitor_new(3)

-0¶

journalctl(1)

-1¶

journalctl(1), sd_journal_get_fd(3), systemd(1)

-EADDRINUSE¶

sd_bus_request_name(3)

-EALREADY¶

sd_bus_request_name(3)

-EBUSY¶

sd_event_add_child(3), sd_event_add_signal(3)

-ECHILD¶

sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_journal_open(3)

-EEXIST¶

sd_bus_request_name(3)

-EINVAL¶

sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_open_user(3), sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_event_set_name(3)

-EMFILE¶

sd_event_new(3)

-ENODATA¶

sd_bus_creds_get_pid(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_negotiate_fds(3)

-ENOENT¶

sd_bus_creds_get_pid(3)

-ENOMEM¶

sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_new(3), sd_bus_open_user(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_new(3), sd_event_set_name(3)

-ENOTCONN¶

sd_bus_request_name(3)

-ENOTSUP¶

sd_event_add_time(3)

-ENXIO¶

sd_bus_creds_get_pid(3), sd_bus_error(3), sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3)

-EPERM¶

sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_negotiate_fds(3)

-ESRCH¶

sd_bus_creds_new_from_pid(3), sd_bus_request_name(3)

-ESTALE¶

sd_bus_message_append(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_journal_get_realtime_usec(3)

0¶

systemctl(1)

1¶

journalctl(1)

2¶

journalctl(1)

AF_INET¶

sd_is_fifo(3), systemd.exec(5)

AF_INET6¶

sd_is_fifo(3), systemd.exec(5)

systemd.socket(5)

AF_UNIX¶

daemon(7), pam_systemd(8), sd_is_fifo(3), sd_notify(3), systemd(1), systemd-journald.service(8), systemd.exec(5), systemd.socket(5)

AF_UNSPEC¶

sd_is_fifo(3)

CAP_ADMIN¶

systemd-tmpfiles(8)

CAP_DAC_OVERRIDE¶

systemd.exec(5)

CAP_MKNOD¶

systemd.exec(5)

CAP_SYS_ADMIN¶

systemd.exec(5)

CAP_SYS_PTRACE¶

systemd.exec(5)

CLOCK_BOOTTIME_ALARM¶

sd_event_add_time(3)

CLOCK_MONOTONIC¶

bootchart.conf(5), sd_bus_message_get_monotonic_usec(3), sd_event_add_time(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_fd(3), sd_journal_get_realtime_usec(3), sd_journal_seek_head(3), sd_login_monitor_new(3), systemd.journal-fields(7)

CLOCK_REALTIME¶

sd_bus_message_get_monotonic_usec(3), sd_event_add_time(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_realtime_usec(3), sd_journal_seek_head(3), systemd.journal-fields(7)

EACCES¶

systemd.exec(5)

EPERM¶

systemd.exec(5)

EUCLEAN¶

systemd.exec(5)

IP_FREEBIND¶

daemon(7)

LOG_ALERT¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_CRIT¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_DEBUG¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_EMERG¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_ERR¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_INFO¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_NOTICE¶

sd_journal_print(3), sd_journal_stream_fd(3)

LOG_WARNING¶

sd_journal_print(3), sd_journal_stream_fd(3)

NUL¶

sd_bus_message_append(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_path_encode(3), sd_event_set_name(3), sd_id128_to_string(3), systemd.socket(5)

NULL¶

sd-login(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_strv(3), sd_bus_new(3), sd_bus_open_user(3), sd_bus_path_encode(3), sd_event_add_signal(3), sd_event_new(3), sd_event_set_name(3), sd_get_seats(3), sd_is_fifo(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_realtime_usec(3), sd_journal_open(3), sd_journal_print(3), sd_login_monitor_new(3), sd_seat_get_active(3), sd_session_is_active(3), sd_uid_get_state(3)

O_NONBLOCK¶

systemd.service(5)

PAM_SUCCESS¶

pam_systemd(8)

POLLIN¶

sd_journal_get_fd(3), sd_login_monitor_new(3)

POLLOUT¶

sd_journal_get_fd(3), sd_login_monitor_new(3)

RLIMIT_NOFILE¶

daemon(7)

SD_BUS_CREDS_AUDIT_LOGIN_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_AUDIT_SESSION_ID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_BOUNDING_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_CGROUP¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_CMDLINE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_COMM¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_EFFECTIVE_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_EXE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_GID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_INHERITABLE_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_OWNER_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_PERMITTED_CAPS¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_PID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SELINUX_CONTEXT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SESSION¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_SLICE¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_TID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_TID_COMM¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UID¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UNIQUE_NAME¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_UNIT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_USER_UNIT¶

sd_bus_creds_new_from_pid(3)

SD_BUS_CREDS_WELL_KNOWN_NAMES¶

sd_bus_creds_new_from_pid(3)

SD_BUS_ERROR_ACCESS_DENIED¶

sd_bus_error(3)

SD_BUS_ERROR_ADDRESS_IN_USE¶

sd_bus_error(3)

SD_BUS_ERROR_AUTH_FAILED¶

sd_bus_error(3)

SD_BUS_ERROR_BAD_ADDRESS¶

sd_bus_error(3)

SD_BUS_ERROR_DISCONNECTED¶

sd_bus_error(3)

SD_BUS_ERROR_FAILED¶

sd_bus_error(3)

SD_BUS_ERROR_FILE_EXISTS¶

sd_bus_error(3)

SD_BUS_ERROR_FILE_NOT_FOUND¶

sd_bus_error(3)

SD_BUS_ERROR_INCONSISTENT_MESSAGE¶

sd_bus_error(3)

SD_BUS_ERROR_INVALID_ARGS¶

sd_bus_error(3)

SD_BUS_ERROR_INVALID_SIGNATURE¶

sd_bus_error(3)

SD_BUS_ERROR_IO_ERROR¶

sd_bus_error(3)

SD_BUS_ERROR_LIMITS_EXCEEDED¶

sd_bus_error(3)

SD_BUS_ERROR_MAKE_CONST(name, message)¶

sd_bus_error(3)

SD_BUS_ERROR_MATCH_RULE_INVALID¶

sd_bus_error(3)

SD_BUS_ERROR_MATCH_RULE_NOT_FOUND¶

sd_bus_error(3)

SD_BUS_ERROR_NAME_HAS_NO_OWNER¶

sd_bus_error(3)

SD_BUS_ERROR_NOT_SUPPORTED¶

sd_bus_error(3)

SD_BUS_ERROR_NO_MEMORY¶

sd_bus_error(3)

SD_BUS_ERROR_NO_NETWORK¶

sd_bus_error(3)

SD_BUS_ERROR_NO_REPLY¶

sd_bus_error(3)

SD_BUS_ERROR_NO_SERVER¶

sd_bus_error(3)

SD_BUS_ERROR_NULL¶

sd_bus_error(3)

SD_BUS_ERROR_PROPERTY_READ_ONLY¶

sd_bus_error(3)

SD_BUS_ERROR_SERVICE_UNKNOWN¶

sd_bus_error(3)

SD_BUS_ERROR_TIMEOUT¶

sd_bus_error(3)

SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_INTERFACE¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_METHOD¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_OBJECT¶

sd_bus_error(3)

SD_BUS_ERROR_UNKNOWN_PROPERTY¶

sd_bus_error(3)

SD_BUS_TYPE_ARRAY¶

sd_bus_message_append(3)

SD_BUS_TYPE_BOOLEAN¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_BYTE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_DICT_ENTRY_BEGIN¶

sd_bus_message_append(3)

SD_BUS_TYPE_DICT_ENTRY_END¶

sd_bus_message_append(3)

SD_BUS_TYPE_DOUBLE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT16¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT32¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_INT64¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_OBJECT_PATH¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_SIGNATURE¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_STRING¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_STRUCT_BEGIN¶

sd_bus_message_append(3)

SD_BUS_TYPE_STRUCT_END¶

sd_bus_message_append(3)

SD_BUS_TYPE_UINT16¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UINT32¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UINT64¶

sd_bus_message_append(3), sd_bus_message_append_basic(3)

SD_BUS_TYPE_UNIX_FD¶

sd_bus_message_append(3), sd_bus_message_append_basic(3), sd_bus_negotiate_fds(3)

SD_BUS_TYPE_VARIANT¶

sd_bus_message_append(3)

SD_EVENT_ON¶

sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3)

SD_EVENT_ONESHOT¶

sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_time(3)

SD_JOURNAL_APPEND¶

sd_journal_get_fd(3)

SD_JOURNAL_CURRENT_USER¶

sd_journal_open(3)

SD_JOURNAL_INVALIDATE¶

sd_journal_get_fd(3)

SD_JOURNAL_LOCAL_ONLY¶

sd_journal_get_usage(3), sd_journal_open(3)

SD_JOURNAL_NOP¶

sd_journal_get_fd(3)

SD_JOURNAL_RUNTIME_ONLY¶

sd_journal_open(3)

SD_JOURNAL_SYSTEM¶

sd_journal_open(3)

SD_JOURNAL_SYSTEM_ONLY¶

sd_journal_open(3)

SD_WARNING¶

sd_journal_stream_fd(3)

SIGABRT¶

systemd.service(5)

SIGHUP¶

daemon(7), systemd(1), systemd.kill(5), systemd.service(5)

SIGINT¶

loginctl(1), machinectl(1), systemctl(1), systemd(1), systemd.service(5), systemd.special(7)

SIGKILL¶

systemd.kill(5), systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.swap(5)

SIGPIPE¶

systemd.exec(5), systemd.service(5)

SIGPWR¶

systemd(1)

SIGRTMIN+0¶

systemd(1)

SIGRTMIN+1¶

systemd(1)

SIGRTMIN+13¶

systemd(1)

SIGRTMIN+14¶

systemd(1)

SIGRTMIN+15¶

systemd(1)

SIGRTMIN+16¶

systemd(1)

SIGRTMIN+2¶

systemd(1)

SIGRTMIN+20¶

systemd(1)

SIGRTMIN+21¶

systemd(1)

SIGRTMIN+22¶

systemd(1)

SIGRTMIN+23¶

systemd(1)

SIGRTMIN+24¶

systemd(1)

SIGRTMIN+26¶

systemd(1)

SIGRTMIN+27¶

systemd(1)

SIGRTMIN+28¶

systemd(1)

SIGRTMIN+3¶

systemd(1)

SIGRTMIN+4¶

systemd(1)

SIGRTMIN+5¶

systemd(1)

SIGRTMIN+6¶

systemd(1)

SIGSTOP¶

loginctl(1), machinectl(1), systemctl(1)

SIGSYS¶

systemd.exec(5)

SIGTERM¶

daemon(7), loginctl(1), machinectl(1), systemctl(1), systemd(1), systemd.kill(5), systemd.mount(5), systemd.service(5), systemd.socket(5), systemd.special(7), systemd.swap(5)

SIGUSR1¶

systemd(1)

SIGUSR2¶

systemd(1)

SIGWINCH¶

systemd(1)

SIG_DFL¶

daemon(7)

SOCK_DGRAM¶

sd_is_fifo(3), systemd-journald.service(8), systemd.socket(5)

SOCK_SEQPACKET¶

systemd.socket(5)

SOCK_STREAM¶

sd_is_fifo(3), systemd.socket(5)

TCP_DEFER_ACCEPT¶

systemd.socket(5)

WCONTINUED¶

sd_event_add_child(3)

WEXITED¶

sd_event_add_child(3)

WSTOPPED¶

sd_event_add_child(3)

_NSIG¶

daemon(7)

_SD_BUS_CREDS_ALL¶

sd_bus_creds_new_from_pid(3)

all¶

udevadm(8)

application/event-stream¶

systemd-journal-gatewayd.service(8)

application/json¶

systemd-journal-gatewayd.service(8)

application/vnd.fdo.journal¶

systemd-journal-gatewayd.service(8)

arm¶

systemd.exec(5)

auto¶

systemd(1)

early¶

udevadm(8)

false¶

sd_bus_error(3)

host¶

systemd-journal-remote(8)

https¶

systemd-journal-upload(8)

late¶

udevadm(8)

libsystemd¶

sd-daemon(3), sd-id128(3), sd-journal(3), sd-login(3), sd_booted(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_bus_error(3), sd_bus_message_append_array(3), sd_bus_message_append_basic(3), sd_bus_message_append_string_memfd(3), sd_bus_message_append_strv(3), sd_bus_message_get_cookie(3), sd_bus_message_get_monotonic_usec(3), sd_bus_negotiate_fds(3), sd_bus_new(3), sd_bus_open_user(3), sd_bus_path_encode(3), sd_bus_request_name(3), sd_event_add_child(3), sd_event_add_defer(3), sd_event_add_signal(3), sd_event_add_time(3), sd_event_get_fd(3), sd_event_new(3), sd_event_set_name(3), sd_get_seats(3), sd_is_fifo(3), sd_journal_add_match(3), sd_journal_get_catalog(3), sd_journal_get_cursor(3), sd_journal_get_cutoff_realtime_usec(3), sd_journal_get_data(3), sd_journal_get_fd(3), sd_journal_get_realtime_usec(3), sd_journal_get_usage(3), sd_journal_next(3), sd_journal_open(3), sd_journal_print(3), sd_journal_query_unique(3), sd_journal_seek_head(3), sd_journal_stream_fd(3), sd_listen_fds(3), sd_login_monitor_new(3), sd_machine_get_class(3), sd_notify(3), sd_pid_get_session(3), sd_seat_get_active(3), sd_session_is_active(3), sd_uid_get_state(3), sd_watchdog_enabled(3)

libsystemd-bus¶

sd_bus_message_append(3)

m¶

systemd.resource-control(5)

name¶

udevadm(8)

native¶

systemd.exec(5)

never¶

udevadm(8)

none¶

systemd-journal-remote(8)

path¶

udevadm(8)

property¶

udevadm(8)

r¶

systemd.resource-control(5)

simple¶

systemd-run(1)

udevadm(8)

text/plain¶

systemd-journal-gatewayd.service(8)

true¶

sd_bus_error(3)

w¶

systemd.resource-control(5)

x32¶

systemd.exec(5)

x86¶

systemd.exec(5)

x86-64¶

systemd.exec(5)

~¶

systemd.exec(5)

Miscellaneous options and directives¶

Other configuration elements which don't fit in + any of the above groups.

$LISTEN_FDS¶

systemd-journal-remote(8)

A¶

tmpfiles.d(5)

A+¶

tmpfiles.d(5)

ANSI_COLOR=¶

os-release(5)

BUG_REPORT_URL=¶

os-release(5)

BUILD_ID=¶

os-release(5)

C¶

tmpfiles.d(5)

CHASSIS=¶

machine-info(5)

CPE_NAME=¶

os-release(5)

Compress=¶

coredump.conf(5), journald.conf(5)

D¶

tmpfiles.d(5)

DEPLOYMENT=¶

machine-info(5)

ExternalSizeMax=¶

coredump.conf(5)

F¶

tmpfiles.d(5)

FONT=¶

vconsole.conf(5)

FONT_MAP=¶

vconsole.conf(5)

FONT_UNIMAP=¶

vconsole.conf(5)

ForwardToConsole=¶

journald.conf(5)

ForwardToKMsg=¶

journald.conf(5)

ForwardToSyslog=¶

journald.conf(5)

ForwardToWall=¶

journald.conf(5)

HOME_URL=¶

os-release(5)

HandleHibernateKey=¶

logind.conf(5)

HandleLidSwitch=¶

logind.conf(5)

HandleLidSwitchDocked=¶

logind.conf(5)

HandlePowerKey=¶

logind.conf(5)

HandleSuspendKey=¶

logind.conf(5)

HibernateKeyIgnoreInhibited=¶

logind.conf(5)

ICON_NAME=¶

machine-info(5)

ID=¶

os-release(5)

ID_LIKE=¶

os-release(5)

IdleAction=¶

logind.conf(5)

IdleActionSec=¶

logind.conf(5)

InhibitDelayMaxSec=¶

logind.conf(5)

JournalSizeMax=¶

coredump.conf(5)

KEYMAP=¶

vconsole.conf(5)

KEYMAP_TOGGLE=¶

vconsole.conf(5)

KeepFree=¶

coredump.conf(5)

KillExcludeUsers=¶

logind.conf(5)

KillOnlyUsers=¶

logind.conf(5)

KillUserProcesses=¶

logind.conf(5)

L¶

tmpfiles.d(5)

L+¶

tmpfiles.d(5)

LOCATION=¶

machine-info(5)

LidSwitchIgnoreInhibited=¶

logind.conf(5)

MaxFileSec=¶

journald.conf(5)

MaxLevelConsole=¶

journald.conf(5)

MaxLevelKMsg=¶

journald.conf(5)

MaxLevelStore=¶

journald.conf(5)

MaxLevelSyslog=¶

journald.conf(5)

MaxLevelWall=¶

journald.conf(5)

MaxRetentionSec=¶

journald.conf(5)

MaxUse=¶

coredump.conf(5)

NAME=¶

os-release(5)

NAutoVTs=¶

logind.conf(5)

PRETTY_HOSTNAME=¶

machine-info(5)

PRETTY_NAME=¶

os-release(5)

PRIVACY_POLICY_URL=¶

os-release(5)

PowerKeyIgnoreInhibited=¶

logind.conf(5)

ProcessSizeMax=¶

coredump.conf(5)

R¶

tmpfiles.d(5)

RateLimitBurst=¶

journald.conf(5)

RateLimitInterval=¶

journald.conf(5)

RemoveIPC=¶

logind.conf(5)

ReserveVT=¶

logind.conf(5)

RuntimeDirectorySize=¶

logind.conf(5)

RuntimeKeepFree=¶

journald.conf(5)

RuntimeMaxFileSize=¶

journald.conf(5)

RuntimeMaxUse=¶

journald.conf(5)

SD_BUS_NAME_ALLOW_REPLACEMENT¶

sd_bus_request_name(3)

SD_BUS_NAME_QUEUE¶

sd_bus_request_name(3)

SD_BUS_NAME_REPLACE_EXISTING¶

sd_bus_request_name(3)

SUPPORT_URL=¶

os-release(5)

Seal=¶

journald.conf(5)

SplitMode=¶

journald.conf(5)

Storage=¶

coredump.conf(5), journald.conf(5)

SuspendKeyIgnoreInhibited=¶

logind.conf(5)

SyncIntervalSec=¶

journald.conf(5)

SystemKeepFree=¶

journald.conf(5)

SystemMaxFileSize=¶

journald.conf(5)

SystemMaxUse=¶

journald.conf(5)

T¶

tmpfiles.d(5)

TTYPath=¶

journald.conf(5)

VERSION=¶

os-release(5)

VERSION_ID=¶

os-release(5)

X¶

tmpfiles.d(5)

Z¶

tmpfiles.d(5)

a¶

tmpfiles.d(5)

a+¶

tmpfiles.d(5)

b¶

tmpfiles.d(5)

b+¶

tmpfiles.d(5)

c¶

tmpfiles.d(5)

c+¶

tmpfiles.d(5)

d¶

tmpfiles.d(5)

equivalent¶

systemd-delta(1)

extended¶

systemd-delta(1)

f¶

tmpfiles.d(5)

g¶

sysusers.d(5)

h¶

tmpfiles.d(5)

m¶

sysusers.d(5), tmpfiles.d(5)

masked¶

systemd-delta(1)

min¶

tmpfiles.d(5)

ms¶

tmpfiles.d(5)

overridden¶

systemd-delta(1)

p¶

tmpfiles.d(5)

p+¶

tmpfiles.d(5)

r¶

sysusers.d(5), tmpfiles.d(5)

redirected¶

systemd-delta(1)

s¶

tmpfiles.d(5)

t¶

tmpfiles.d(5)

u¶

sysusers.d(5)

udev_log¶

udev.conf(5)

unchanged¶

systemd-delta(1)

us¶

tmpfiles.d(5)

v¶

tmpfiles.d(5)

w¶

tmpfiles.d(5)

x¶

tmpfiles.d(5)

z¶

tmpfiles.d(5)

Files and directories¶

Paths and file names referred to in the + documentation.

/¶

file-hierarchy(7), systemd-gpt-auto-generator(8), systemd-remount-fs.service(8), systemd.unit(5), sysusers.d(5)

$HOME/.config/systemd/user/¶

systemd.unit(5)

$HOME/.local/share/systemd/user/¶

systemd.unit(5)

$XDG_CONFIG_HOME/systemd/user/¶

systemd.unit(5)

$XDG_DATA_HOME/systemd/user/¶

systemd.unit(5)

$XDG_RUNTIME_DIR/systemd/user/¶

systemd.unit(5)

-.slice¶

systemd.special(7)

/bin¶

file-hierarchy(7), systemd.exec(5)

/bin/bash¶

systemd-run(1)

/bin/ls¶

systemd-cat(1)

/boot¶

file-hierarchy(7), kernel-install(8), systemd-efi-boot-generator(8), systemd-gpt-auto-generator(8), systemd.exec(5)

/boot/loader/entries/MACHINE-ID-KERNEL-VERSION.conf¶

kernel-install(8)

/dev¶

file-hierarchy(7), systemd-nspawn(1), systemd-remount-fs.service(8), systemd.device(5), systemd.generator(7), systemd.journal-fields(7), systemd.resource-control(5), udev(7), udevadm(8)

/dev/console¶

journald.conf(5), systemd-getty-generator(8), systemd-tty-ask-password-agent(1), systemd.exec(5)

/dev/disk/by-foo/bar¶

systemd-hibernate-resume-generator(8)

/dev/full¶

systemd.resource-control(5)

/dev/hw_random¶

crypttab(5)

/dev/initctl¶

systemd(1), systemd-initctl.service(8)

/dev/kmsg¶

systemd.generator(7)

/dev/mapper/¶

crypttab(5)

/dev/mapper/home¶

systemd-gpt-auto-generator(8)

/dev/mapper/srv¶

systemd-gpt-auto-generator(8)

/dev/net/tun¶

systemd.netdev(5)

/dev/null¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), daemon(7), hwdb(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sysctl.d(5), systemctl(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.exec(5), systemd.generator(7), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.resource-control(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), tmpfiles.d(5), udev(7)

/dev/random¶

crypttab(5), systemd.exec(5), systemd.resource-control(5)

/dev/sda¶

systemd.exec(5)

/dev/sda5¶

systemd.resource-control(5)

/dev/shm¶

file-hierarchy(7)

/dev/urandom¶

crypttab(5), sd_id128_randomize(3), systemd.resource-control(5)

/dev/watchdog¶

systemd-system.conf(5)

/dev/zero¶

systemd.exec(5), systemd.resource-control(5)

/etc¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), hwdb(7), journald.conf(5), logind.conf(5), modules-load.d(5), nss-myhostname(8), os-release(5), resolved.conf(5), sysctl.d(5), systemctl(1), systemd-delta(1), systemd-machine-id-commit(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd-update-done.service(8), systemd.exec(5), systemd.generator(7), systemd.link(5), systemd.mount(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), udev(7)

/etc/.updated¶

systemd-update-done.service(8)

/etc/adjtime¶

timedatectl(1)

/etc/binfmt.d/*.conf¶

binfmt.d(5)

/etc/crypttab¶

crypttab(5), systemd-cryptsetup-generator(8), systemd-cryptsetup@.service(8), systemd-gpt-auto-generator(8)

/etc/fstab¶

kernel-command-line(7), systemd(1), systemd-fsck@.service(8), systemd-fstab-generator(8), systemd-gpt-auto-generator(8), systemd-remount-fs.service(8), systemd.automount(5), systemd.generator(7), systemd.mount(5), systemd.special(7), systemd.swap(5)

/etc/group¶

sysusers.d(5)

/etc/hostname¶

hostname(5), hostnamectl(1), machine-info(5)

/etc/hosts¶

nss-myhostname(8), nss-mymachines(8)

/etc/init.d/¶

systemd-sysv-generator(8)

/etc/kernel/cmdline¶

kernel-install(8)

/etc/kernel/install.d/¶

kernel-install(8)

/etc/kernel/install.d/*.install¶

kernel-install(8)

/etc/locale.conf¶

locale.conf(5), systemd(1)

/etc/localtime¶

localtime(5), timedatectl(1)

/etc/machine-id¶

kernel-install(8), machine-id(5), systemd-machine-id-commit(1), systemd-machine-id-commit.service(8), systemd-machine-id-setup(1), systemd-nspawn(1)

/etc/machine-info¶

hostnamectl(1), machine-info(5)

/etc/modules-load.d/program.conf¶

modules-load.d(5)

/etc/modules-load.d/*.conf¶

modules-load.d(5)

/etc/modules-load.d/bridge.conf¶

sysctl.d(5)

/etc/nsswitch.conf¶

nss-myhostname(8), nss-mymachines(8)

/etc/os-release¶

kernel-install(8), os-release(5), systemd-nspawn(1)

/etc/passwd¶

sysusers.d(5)

/etc/resolv.conf¶

resolved.conf(5), systemd-resolved.service(8)

/etc/sysctl.d/*.conf¶

sysctl.d(5)

/etc/sysctl.d/bridge.conf¶

sysctl.d(5)

/etc/sysctl.d/domain-name.conf¶

sysctl.d(5)

/etc/systemd/bootchart.conf¶

bootchart.conf(5), systemd-bootchart(1)

/etc/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/etc/systemd/coredump.conf¶

coredump.conf(5)

/etc/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/etc/systemd/import-pubring.gpg¶

machinectl(1)

/etc/systemd/journal-remote.conf¶

systemd-journal-upload(8)

/etc/systemd/journal-upload.conf¶

systemd-journal-upload(8)

/etc/systemd/journald.conf¶

journald.conf(5), systemd-journald.service(8)

/etc/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/etc/systemd/logind.conf¶

logind.conf(5)

/etc/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/etc/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/etc/systemd/resolved.conf¶

resolved.conf(5)

/etc/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/etc/systemd/sleep.conf¶

systemd-sleep.conf(5), systemd-suspend.service(8)

/etc/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/etc/systemd/system/¶

systemd.unit(5)

/etc/systemd/system-generators/¶

systemd.generator(7)

/etc/systemd/system-preset/¶

systemd.preset(5)

/etc/systemd/system-preset/*.preset¶

systemd.preset(5)

/etc/systemd/system-preset/00-lennart.preset¶

systemd.preset(5)

/etc/systemd/system.conf¶

systemd-system.conf(5)

/etc/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/etc/systemd/system/httpd.service¶

systemd.unit(5)

/etc/systemd/system/httpd.service.d/local.conf¶

systemd.unit(5)

/etc/systemd/system/multi-user.target.wants/foo.service¶

systemd.unit(5)

/etc/systemd/timesyncd.conf¶

timesyncd.conf(5)

/etc/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/etc/systemd/user/¶

systemd.unit(5)

/etc/systemd/user-generators/¶

systemd.generator(7)

/etc/systemd/user-preset/*.preset¶

systemd.preset(5)

/etc/systemd/user.conf¶

systemd-system.conf(5)

/etc/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/etc/tmpfiles.d¶

tmpfiles.d(5)

/etc/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/etc/udev/hwdb.bin¶

hwdb(7)

/etc/udev/hwdb.d¶

hwdb(7)

/etc/udev/rules.d¶

udev(7)

/etc/udev/rules.d/99-bridge.rules¶

sysctl.d(5)

/etc/udev/udev.conf¶

udev.conf(5)

/etc/vconsole.conf¶

vconsole.conf(5)

/home¶

file-hierarchy(7), systemd-gpt-auto-generator(8), systemd.exec(5)

/home/lennart¶

systemd.automount(5)

/lib¶

file-hierarchy(7), systemd-delta(1)

/lib64¶

file-hierarchy(7)

/path/to/generator¶

systemd.generator(7)

/proc¶

busctl(1), file-hierarchy(7), sd-login(3), sd_bus_creds_get_pid(3), sd_bus_creds_new_from_pid(3), sd_is_fifo(3), systemd(1), systemd-remount-fs.service(8), systemd.generator(7), systemd.socket(5), tmpfiles.d(5)

/proc/cmdline¶

kernel-command-line(7), kernel-install(8), systemd(1)

/proc/devices¶

systemd.resource-control(5)

/proc/self/fd¶

daemon(7)

/proc/self/mountinfo¶

systemd.mount(5)

/proc/self/sessionid¶

pam_systemd(8)

/proc/sys¶

file-hierarchy(7), systemd-nspawn(1)

/proc/sys/kernel/domainname¶

sysctl.d(5)

/proc/sys/kernel/random/boot_id¶

sd_id128_get_machine(3)

/proc/sys/net/ipv4/conf/enp3s0.200/forwarding¶

sysctl.d(5)

/proc/sys/net/ipv4/tcp_keepalive_time¶

systemd.socket(5)

/proc/sys/net/ipv6/bindv6only¶

systemd.socket(5)

/root¶

file-hierarchy(7)

/run¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), hwdb(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sd-login(3), sd_notify(3), sysctl.d(5), systemctl(1), systemd-delta(1), systemd-journald.service(8), systemd-nspawn(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.exec(5), systemd.generator(7), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), systemd.service(5), systemd.unit(5), sysusers.d(5), timesyncd.conf(5), tmpfiles.d(5), udev(7)

/run/binfmt.d/*.conf¶

binfmt.d(5)

/run/foobar.pid¶

daemon(7)

/run/log¶

bootchart.conf(5), file-hierarchy(7), systemd-bootchart(1)

/run/log/journal¶

journalctl(1), journald.conf(5), systemd-journald.service(8)

/run/modules-load.d/*.conf¶

modules-load.d(5)

/run/nologin¶

shutdown(8), systemd-user-sessions.service(8)

/run/sysctl.d/*.conf¶

sysctl.d(5)

/run/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/run/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/run/systemd/journal/syslog¶

systemd-journald.service(8)

/run/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/run/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/run/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/run/systemd/notify¶

systemd(1)

/run/systemd/private¶

systemd(1)

/run/systemd/resolve/resolv.conf¶

systemd-resolved.service(8)

/run/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/run/systemd/shutdownd¶

systemd(1)

/run/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/run/systemd/system/¶

sd_booted(3), systemd.unit(5)

/run/systemd/system-generators/¶

systemd.generator(7)

/run/systemd/system-preset/*.preset¶

systemd.preset(5)

/run/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/run/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/run/systemd/user/¶

systemd.unit(5)

/run/systemd/user-generators/¶

systemd.generator(7)

/run/systemd/user-preset/*.preset¶

systemd.preset(5)

/run/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/run/tmpfiles.d¶

tmpfiles.d(5)

/run/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/run/udev/hwdb.d¶

hwdb(7)

/run/udev/rules.d¶

udev(7)

/run/udev/static_node-tags/tag¶

udev(7)

/run/user¶

file-hierarchy(7), systemd.exec(5)

/run/user/$USER¶

pam_systemd(8)

/sbin¶

file-hierarchy(7), systemd.exec(5)

/sbin/fsck.¶

systemd-fsck@.service(8)

/sbin/nologin¶

sysusers.d(5)

/srv¶

file-hierarchy(7), systemd-gpt-auto-generator(8)

/srv/webserver¶

systemd.unit(5)

/srv/www¶

systemd.unit(5)

/sys¶

file-hierarchy(7), loginctl(1), sd_is_fifo(3), systemd(1), systemd-nspawn(1), systemd-remount-fs.service(8), systemd.device(5), systemd.generator(7), systemd.journal-fields(7), systemd.socket(5), tmpfiles.d(5), udevadm(8)

/sys/fs/cgroup¶

sd-login(3), systemd-cgls(1)

/sys/fs/cgroup/systemd/¶

systemd(1), systemd.unit(5)

/sys/fs/selinux¶

systemd-nspawn(1)

/sys/power/disk¶

systemd-sleep.conf(5)

/sys/power/resume¶

systemd-hibernate-resume@.service(8)

/sys/power/state¶

systemd-sleep.conf(5), systemd-suspend.service(8)

/sysroot¶

bootup(7)

/sysroot/etc/fstab¶

bootup(7)

/system-update¶

systemd-system-update-generator(8), systemd.special(7)

/tmp¶

crypttab(5), file-hierarchy(7), systemd.exec(5), systemd.unit(5), tmpfiles.d(5)

/tmp/var¶

systemd.unit(5)

/upload¶

systemd-journal-remote(8)

/usr¶

bootup(7), file-hierarchy(7), machinectl(1), systemd-fstab-generator(8), systemd-nspawn(1), systemd-remount-fs.service(8), systemd-update-done.service(8), systemd.exec(5), systemd.generator(7), systemd.mount(5), systemd.unit(5)

/usr/bin¶

file-hierarchy(7), systemd.exec(5)

/usr/bin/mount¶

systemctl(1)

/usr/bin/umount¶

systemctl(1)

/usr/include¶

file-hierarchy(7)

/usr/lib¶

binfmt.d(5), bootchart.conf(5), coredump.conf(5), file-hierarchy(7), hwdb(7), journald.conf(5), logind.conf(5), modules-load.d(5), resolved.conf(5), sysctl.d(5), systemd-delta(1), systemd-sleep.conf(5), systemd-system.conf(5), systemd.link(5), systemd.netdev(5), systemd.network(5), systemd.preset(5), sysusers.d(5), timesyncd.conf(5), udev(7)

/usr/lib/binfmt.d/*.conf¶

binfmt.d(5)

/usr/lib/kernel/install.d/¶

kernel-install(8)

/usr/lib/kernel/install.d/*.install¶

kernel-install(8)

/usr/lib/machines/¶

machinectl(1)

/usr/lib/modules-load.d/*.conf¶

modules-load.d(5)

/usr/lib/os-release¶

kernel-install(8), os-release(5), systemd-nspawn(1)

/usr/lib/sysctl.d/*.conf¶

sysctl.d(5)

/usr/lib/sysctl.d/50-coredump.conf¶

systemd-coredump(8)

/usr/lib/systemd/bootchart.conf.d/*.conf¶

bootchart.conf(5)

/usr/lib/systemd/coredump.conf.d/*.conf¶

coredump.conf(5)

/usr/lib/systemd/import-pubring.gpg¶

machinectl(1)

/usr/lib/systemd/journald.conf.d/*.conf¶

journald.conf(5)

/usr/lib/systemd/logind.conf.d/*.conf¶

logind.conf(5)

/usr/lib/systemd/network¶

systemd-networkd.service(8), systemd.link(5), systemd.netdev(5), systemd.network(5)

/usr/lib/systemd/resolved.conf.d/*.conf¶

resolved.conf(5)

/usr/lib/systemd/sleep.conf.d/*.conf¶

systemd-sleep.conf(5)

/usr/lib/systemd/system¶

systemd(1), systemd.unit(5)

/usr/lib/systemd/system-generators/¶

systemd.generator(7)

/usr/lib/systemd/system-generators/systemd-cryptsetup-generator¶

systemd-cryptsetup-generator(8)

/usr/lib/systemd/system-generators/systemd-debug-generator¶

systemd-debug-generator(8)

/usr/lib/systemd/system-generators/systemd-efi-boot-generator¶

systemd-efi-boot-generator(8)

/usr/lib/systemd/system-generators/systemd-fstab-generator¶

systemd-fstab-generator(8)

/usr/lib/systemd/system-generators/systemd-getty-generator¶

systemd-getty-generator(8)

/usr/lib/systemd/system-generators/systemd-gpt-auto-generator¶

systemd-gpt-auto-generator(8)

/usr/lib/systemd/system-generators/systemd-hibernate-resume-generator¶

systemd-hibernate-resume-generator(8)

/usr/lib/systemd/system-generators/systemd-system-update-generator¶

systemd-system-update-generator(8)

/usr/lib/systemd/system-generators/systemd-sysv-generator¶

systemd-sysv-generator(8)

/usr/lib/systemd/system-preset/*.preset¶

systemd.preset(5)

/usr/lib/systemd/system-preset/50-gnome.preset¶

systemd.preset(5)

/usr/lib/systemd/system-preset/99-default.preset¶

systemd.preset(5)

/usr/lib/systemd/system-shutdown/¶

systemd-halt.service(8)

/usr/lib/systemd/system-sleep¶

systemd-suspend.service(8)

/usr/lib/systemd/system.conf.d/*.conf¶

systemd-system.conf(5)

/usr/lib/systemd/system/httpd.service¶

systemd.unit(5)

/usr/lib/systemd/systemd¶

bootchart.conf(5)

/usr/lib/systemd/systemd-activate¶

systemd-activate(8)

/usr/lib/systemd/systemd-backlight¶

systemd-backlight@.service(8)

/usr/lib/systemd/systemd-binfmt¶

systemd-binfmt.service(8)

/usr/lib/systemd/systemd-bootchart¶

systemd-bootchart(1)

/usr/lib/systemd/systemd-bus-proxyd¶

systemd-bus-proxyd(8)

/usr/lib/systemd/systemd-coredump¶

systemd-coredump(8)

/usr/lib/systemd/systemd-cryptsetup¶

systemd-cryptsetup@.service(8)

/usr/lib/systemd/systemd-fsck¶

systemd-fsck@.service(8)

/usr/lib/systemd/systemd-hibernate-resume¶

systemd-hibernate-resume@.service(8)

/usr/lib/systemd/systemd-hostnamed¶

systemd-hostnamed.service(8)

/usr/lib/systemd/systemd-initctl¶

systemd-initctl.service(8)

/usr/lib/systemd/systemd-journal-gatewayd¶

systemd-journal-gatewayd.service(8)

/usr/lib/systemd/systemd-journald¶

systemd-journald.service(8)

/usr/lib/systemd/systemd-localed¶

systemd-localed.service(8)

/usr/lib/systemd/systemd-logind¶

systemd-logind.service(8)

/usr/lib/systemd/systemd-machine-id-commit¶

systemd-machine-id-commit.service(8)

/usr/lib/systemd/systemd-machined¶

systemd-machined.service(8)

/usr/lib/systemd/systemd-modules-load¶

systemd-modules-load.service(8)

/usr/lib/systemd/systemd-networkd¶

systemd-networkd.service(8)

/usr/lib/systemd/systemd-networkd-wait-online¶

systemd-networkd-wait-online.service(8)

/usr/lib/systemd/systemd-quotacheck¶

systemd-quotacheck.service(8)

/usr/lib/systemd/systemd-random-seed¶

systemd-random-seed.service(8)

/usr/lib/systemd/systemd-remount-fs¶

systemd-remount-fs.service(8)

/usr/lib/systemd/systemd-resolved¶

systemd-resolved.service(8)

/usr/lib/systemd/systemd-rfkill¶

systemd-rfkill@.service(8)

/usr/lib/systemd/systemd-shutdown¶

systemd-halt.service(8)

/usr/lib/systemd/systemd-shutdownd¶

systemd-shutdownd.service(8)

/usr/lib/systemd/systemd-sysctl¶

systemd-sysctl.service(8)

/usr/lib/systemd/systemd-timedated¶

systemd-timedated.service(8)

/usr/lib/systemd/systemd-timesyncd¶

systemd-timesyncd.service(8)

/usr/lib/systemd/systemd-udevd¶

systemd-udevd.service(8)

/usr/lib/systemd/systemd-update-done¶

systemd-update-done.service(8)

/usr/lib/systemd/systemd-update-utmp¶

systemd-update-utmp.service(8)

/usr/lib/systemd/systemd-user-sessions¶

systemd-user-sessions.service(8)

/usr/lib/systemd/systemd-vconsole-setup¶

systemd-vconsole-setup.service(8)

/usr/lib/systemd/timesyncd.conf.d/*.conf¶

timesyncd.conf(5)

/usr/lib/systemd/user/¶

systemd.unit(5)

/usr/lib/systemd/user-generators/¶

systemd.generator(7)

/usr/lib/systemd/user-preset/*.preset¶

systemd.preset(5)

/usr/lib/systemd/user.conf.d/*.conf¶

systemd-system.conf(5)

/usr/lib/sysusers.d/*.conf¶

sysusers.d(5)

/usr/lib/tmpfiles.d¶

tmpfiles.d(5)

/usr/lib/tmpfiles.d/*.conf¶

tmpfiles.d(5)

/usr/lib/udev¶

udev(7)

/usr/lib/udev/hwdb.bin¶

hwdb(7)

/usr/lib/udev/hwdb.d¶

hwdb(7)

/usr/lib/udev/rules.d¶

udev(7)

/usr/lib64¶

file-hierarchy(7)

/usr/local/bin¶

systemd.exec(5)

/usr/local/lib/machines/¶

machinectl(1)

/usr/local/lib/systemd/system¶

systemd(1)

/usr/local/lib/systemd/system-generators/¶

systemd.generator(7)

/usr/local/lib/systemd/user-generators/¶

systemd.generator(7)

/usr/local/sbin¶

systemd.exec(5)

/usr/sbin¶

file-hierarchy(7), systemd.exec(5)

/usr/sbin/foo-daemon¶

systemd.service(5)

/usr/share¶

file-hierarchy(7)

/usr/share/dbus-1/system-services/org.example.simple-dbus-service.service¶

systemd.service(5)

/usr/share/doc¶

file-hierarchy(7)

/usr/share/factory¶

file-hierarchy(7), tmpfiles.d(5)

/usr/share/factory/etc¶

file-hierarchy(7)

/usr/share/factory/var¶

file-hierarchy(7)

/usr/share/zoneinfo/¶

localtime(5)

/var¶

file-hierarchy(7), journald.conf(5), systemd-journald.service(8), systemd-nspawn(1), systemd-update-done.service(8), systemd.unit(5), tmpfiles.d(5)

/var/.updated¶

systemd-update-done.service(8)

/var/cache¶

file-hierarchy(7)

/var/lib¶

file-hierarchy(7)

/var/lib/container/¶

machinectl(1)

/var/lib/dbus/machine-id¶

machine-id(5)

/var/lib/machines/¶

machinectl(1), systemd-nspawn(1)

/var/lib/systemd/backlight/¶

systemd-backlight@.service(8)

/var/lib/systemd/clock¶

systemd-timesyncd.service(8)

/var/lib/systemd/coredump¶

coredump.conf(5), systemd-coredump(8)

/var/lib/systemd/journal-upload/state¶

systemd-journal-upload(8)

/var/lib/systemd/random-seed¶

systemd-random-seed.service(8)

/var/lib/systemd/rfkill/¶

systemd-rfkill@.service(8)

/var/log¶

file-hierarchy(7)

/var/log/journal¶

journalctl(1), journald.conf(5), systemd-journald.service(8), systemd-nspawn(1)

/var/log/journal/remote/¶

systemd-journal-remote(8)

/var/log/journal/some.host/remote-some~host.journal¶

systemd-journal-remote(8)

/var/run¶

file-hierarchy(7), tmpfiles.d(5)

/var/run/dbus/system_bus_socket¶

systemd-bus-proxyd@.service(8)

/var/run/utmp¶

runlevel(8)

/var/spool¶

file-hierarchy(7)

/var/tmp¶

file-hierarchy(7), systemd.exec(5), tmpfiles.d(5)

automount.automount¶

systemd.automount(5), systemd.unit(5)

basic.target¶

systemd.special(7)

bluetooth.target¶

systemd.special(7)

bootctl¶

bootctl(1)

busctl¶

busctl(1)

coredumpctl¶

coredumpctl(1)

cryptsetup-pre.target¶

systemd.special(7)

cryptsetup.target¶

systemd.special(7)

ctrl-alt-del.target¶

systemd.special(7)

dbus.service¶

systemd.special(7)

dbus.socket¶

systemd.special(7)

default.target¶

systemd.special(7)

device.device¶

systemd.device(5), systemd.unit(5)

display-manager.service¶

systemd.special(7)

emergency.target¶

systemd.special(7)

exit.target¶

systemd.special(7)

final.target¶

systemd.special(7)

getty.target¶

systemd.special(7)

graphical.target¶

systemd.special(7)

halt¶

halt(8)

halt.target¶

systemd.special(7)

hibernate.target¶

systemd.special(7)

hostnamectl¶

hostnamectl(1)

hybrid-sleep.target¶

systemd.special(7)

init¶

systemd(1)

initrd-fs.target¶

systemd.special(7)

initrd-root-fs.target¶

systemd.special(7)

journalctl¶

journalctl(1)

kbrequest.target¶

systemd.special(7)

kernel-install¶

kernel-install(8)

kexec.target¶

systemd.special(7)

libnss_myhostname.so.2¶

nss-myhostname(8)

libnss_mymachines.so.2¶

nss-mymachines(8)

systemd.link(5)

local-fs-pre.target¶

systemd.special(7)

local-fs.target¶

systemd.special(7)

localectl¶

localectl(1)

loginctl¶

loginctl(1)

machine.slice¶

systemd.special(7)

machinectl¶

machinectl(1)

mount.mount¶

systemd.exec(5), systemd.kill(5), systemd.mount(5), systemd.resource-control(5), systemd.unit(5)

multi-user.target¶

systemd.special(7)

netdev.netdev¶

systemd.netdev(5)

network.network¶

systemd.network(5)

network-online.target¶

systemd.special(7)

network-pre.target¶

systemd.special(7)

network.target¶

systemd.special(7)

networkctl¶

networkctl(1)

nss-lookup.target¶

systemd.special(7)

nss-user-lookup.target¶

systemd.special(7)

pam_systemd.so¶

pam_systemd(8)

path.path¶

systemd.path(5), systemd.unit(5)

paths.target¶

systemd.special(7)

pkg-config¶

sd-daemon(3), sd-id128(3), sd-journal(3), sd-login(3)

poweroff¶

halt(8)

poweroff.target¶

systemd.special(7)

printer.target¶

systemd.special(7)

reboot¶

halt(8)

reboot.target¶

systemd.special(7)

remote-fs-pre.target¶

systemd.special(7)

remote-fs.target¶

systemd.special(7)

rescue.target¶

systemd.special(7)

rpcbind.target¶

systemd.special(7)

runlevel¶

runlevel(8)

runlevel2.target¶

systemd.special(7)

runlevel3.target¶

systemd.special(7)

runlevel4.target¶

systemd.special(7)

runlevel5.target¶

systemd.special(7)

scope.scope¶

systemd.kill(5), systemd.resource-control(5), systemd.scope(5), systemd.unit(5)

service.service¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.service(5), systemd.unit(5)

shutdown¶

shutdown(8)

shutdown.target¶

systemd.special(7)

sigpwr.target¶

systemd.special(7)

sleep.target¶

systemd.special(7)

slice.slice¶

systemd.resource-control(5), systemd.slice(5), systemd.unit(5)

smartcard.target¶

systemd.special(7)

snapshot.snapshot¶

systemd.snapshot(5), systemd.unit(5)

socket.socket¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.socket(5), systemd.unit(5)

sockets.target¶

systemd.special(7)

sound.target¶

systemd.special(7)

suspend.target¶

systemd.special(7)

swap.swap¶

systemd.exec(5), systemd.kill(5), systemd.resource-control(5), systemd.swap(5), systemd.unit(5)

swap.target¶

systemd.special(7)

sysinit.target¶

systemd.special(7)

syslog.socket¶

systemd.special(7)

system-update.target¶

systemd.special(7)

system.slice¶

systemd.special(7)

systemctl¶

systemctl(1)

systemd¶

systemd(1)

systemd-analyze¶

systemd-analyze(1)

systemd-ask-password¶

systemd-ask-password(1)

systemd-ask-password-console.path¶

systemd-ask-password-console.service(8)

systemd-ask-password-console.service¶

systemd-ask-password-console.service(8)

systemd-ask-password-wall.path¶

systemd-ask-password-console.service(8)

systemd-ask-password-wall.service¶

systemd-ask-password-console.service(8)

systemd-backlight@.service¶

systemd-backlight@.service(8)

systemd-binfmt.service¶

systemd-binfmt.service(8)

systemd-bus-proxyd.socket¶

systemd-bus-proxyd@.service(8)

systemd-bus-proxyd@.service¶

systemd-bus-proxyd@.service(8)

systemd-cat¶

systemd-cat(1)

systemd-cgls¶

systemd-cgls(1)

systemd-cgtop¶

systemd-cgtop(1)

systemd-cryptsetup@.service¶

systemd-cryptsetup@.service(8)

systemd-delta¶

systemd-delta(1)

systemd-detect-virt¶

systemd-detect-virt(1)

systemd-escape¶

systemd-escape(1)

systemd-firstboot¶

systemd-firstboot(1)

systemd-firstboot.service¶

systemd-firstboot(1)

systemd-fsck-root.service¶

systemd-fsck@.service(8)

systemd-fsck@.service¶

systemd-fsck@.service(8)

systemd-halt.service¶

systemd-halt.service(8)

systemd-hibernate-resume@.service¶

systemd-hibernate-resume@.service(8)

systemd-hibernate.service¶

systemd-suspend.service(8)

systemd-hostnamed.service¶

systemd-hostnamed.service(8)

systemd-hwdb¶

systemd-hwdb(8)

systemd-hybrid-sleep.service¶

systemd-suspend.service(8)

systemd-inhibit¶

systemd-inhibit(1)

systemd-initctl.service¶

systemd-initctl.service(8)

systemd-initctl.socket¶

systemd-initctl.service(8)

systemd-journal-gatewayd.service¶

systemd-journal-gatewayd.service(8)

systemd-journal-gatewayd.socket¶

systemd-journal-gatewayd.service(8)

systemd-journal-remote¶

systemd-journal-remote(8)

systemd-journal-upload¶

systemd-journal-upload(8)

systemd-journald-dev-log.socket¶

systemd-journald.service(8)

systemd-journald.service¶

systemd-journald.service(8)

systemd-journald.socket¶

systemd-journald.service(8)

systemd-kexec.service¶

systemd-halt.service(8)

systemd-localed.service¶

systemd-localed.service(8)

systemd-logind.service¶

systemd-logind.service(8)

systemd-machine-id-commit¶

systemd-machine-id-commit(1)

systemd-machine-id-commit.service¶

systemd-machine-id-commit.service(8)

systemd-machine-id-setup¶

systemd-machine-id-setup(1)

systemd-machined.service¶

systemd-machined.service(8)

systemd-modules-load.service¶

systemd-modules-load.service(8)

systemd-networkd-wait-online.service¶

systemd-networkd-wait-online.service(8)

systemd-networkd.service¶

systemd-networkd.service(8)

systemd-notify¶

systemd-notify(1)

systemd-nspawn¶

systemd-nspawn(1)

systemd-path¶

systemd-path(1)

systemd-poweroff.service¶

systemd-halt.service(8)

systemd-quotacheck.service¶

systemd-quotacheck.service(8)

systemd-random-seed.service¶

systemd-random-seed.service(8)

systemd-reboot.service¶

systemd-halt.service(8)

systemd-remount-fs.service¶

systemd-remount-fs.service(8)

systemd-resolved.service¶

systemd-resolved.service(8)

systemd-rfkill@.service¶

systemd-rfkill@.service(8)

systemd-run¶

systemd-run(1)

systemd-shutdownd.service¶

systemd-shutdownd.service(8)

systemd-shutdownd.socket¶

systemd-shutdownd.service(8)

systemd-socket-proxyd¶

systemd-socket-proxyd(8)

systemd-suspend.service¶

systemd-suspend.service(8)

systemd-sysctl.service¶

systemd-sysctl.service(8)

systemd-sysusers¶

systemd-sysusers(8)

systemd-sysusers.service¶

systemd-sysusers(8)

systemd-timedated.service¶

systemd-timedated.service(8)

systemd-timesyncd.service¶

systemd-timesyncd.service(8)

systemd-tmpfiles¶

systemd-tmpfiles(8)

systemd-tmpfiles-clean.service¶

systemd-tmpfiles(8)

systemd-tmpfiles-clean.timer¶

systemd-tmpfiles(8)

systemd-tmpfiles-setup-dev.service¶

systemd-tmpfiles(8)

systemd-tmpfiles-setup.service¶

systemd-tmpfiles(8)

systemd-tty-ask-password-agent¶

systemd-tty-ask-password-agent(1)

systemd-udevd-control.socket¶

systemd-udevd.service(8)

systemd-udevd-kernel.socket¶

systemd-udevd.service(8)

systemd-udevd.service¶

systemd-udevd.service(8)

systemd-update-done.service¶

systemd-update-done.service(8)

systemd-update-utmp-runlevel.service¶

systemd-update-utmp.service(8)

systemd-update-utmp.service¶

systemd-update-utmp.service(8)

systemd-user-sessions.service¶

systemd-user-sessions.service(8)

systemd-vconsole-setup.service¶

systemd-vconsole-setup.service(8)

target.target¶

systemd.target(5), systemd.unit(5)

telinit¶

telinit(8)

time-sync.target¶

systemd.special(7)

timedatectl¶

timedatectl(1)

timer.timer¶

systemd.timer(5), systemd.unit(5)

timers.target¶

systemd.special(7)

udevadm¶

udevadm(8)

umount.target¶

systemd.special(7)

user.slice¶

systemd.special(7)

Colophon¶

This index contains 1829 entries in 14 sections, +referring to 197 individual manual pages.

diff --git a/man/systemd.directives.xml b/man/systemd.directives.xml index aa7167bb2..c65c0dc67 100644 --- a/man/systemd.directives.xml +++ b/man/systemd.directives.xml @@ -202,6 +202,8 @@ FailureAction=systemd.service5 +FileDescriptorStoreMax=systemd.service5 + FreeBind=systemd.socket5 Group=systemd.exec5 @@ -1037,10 +1039,14 @@ Host=systemd.link5, systemd.netdev5, systemd.network5 -IPv4LL=systemd.network5 +IPForward=systemd.network5 + +IPMasquerade=systemd.network5 IPv4LLRoute=systemd.network5 +IPv6Token=systemd.network5 + Id=systemd.netdev5 KernelCommandLine=systemd.link5, systemd.netdev5, systemd.network5 @@ -1053,10 +1059,14 @@ LACPTransmitRate=systemd.netdev5 +LLDP=systemd.network5 + LLMNR=resolved.conf5, systemd.network5 Label=systemd.network5 +LinkLocalAddressing=systemd.network5 + Local=systemd.netdev5 MACAddress=systemd.link5, systemd.netdev5, systemd.network5 @@ -1101,6 +1111,8 @@ RouteShortCircuit=systemd.netdev5 +Scope=systemd.network5 + SendHostname=systemd.network5 Source=systemd.network5 @@ -1131,6 +1143,8 @@ VLAN=systemd.network5 +VLANId=systemd.network5 + VXLAN=systemd.network5 VendorClassIdentifier=systemd.network5 @@ -1285,10 +1299,10 @@ crypttab5 -systemd.swap5 - crypttab5 +crypttab5 + crypttab5 crypttab5 @@ -1498,7 +1512,7 @@ journalctl1, systemd-journal-upload8 -journalctl1, loginctl1, machinectl1, systemctl1, systemd-cgls1 +journalctl1, loginctl1, machinectl1, networkctl1, systemctl1, systemd-cgls1 busctl1 @@ -1586,6 +1600,8 @@ journalctl1 +machinectl1 + journalctl1 systemd-nspawn1 @@ -1602,6 +1618,8 @@ systemd-bootchart1 +systemd-nspawn1 + systemd-udevd.service8 systemd-tmpfiles8 @@ -1628,7 +1646,7 @@ journalctl1 -halt8, journalctl1, systemctl1 +halt8, journalctl1, machinectl1, systemctl1 systemd-bootchart1 @@ -1648,7 +1666,7 @@ journalctl1 -bootctl1, busctl1, coredumpctl1, halt8, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, runlevel8, shutdown8, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-ask-password1, systemd-bootchart1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, systemd-udevd.service8, telinit8, timedatectl1, udevadm8 +bootctl1, busctl1, coredumpctl1, halt8, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, networkctl1, runlevel8, shutdown8, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-ask-password1, systemd-bootchart1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-hwdb8, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, systemd-udevd.service8, telinit8, timedatectl1, udevadm8 busctl1, hostnamectl1, localectl1, loginctl1, machinectl1, systemctl1, systemd-analyze1, systemd-run1, timedatectl1 @@ -1660,6 +1678,8 @@ systemctl1 +systemd-networkd-wait-online.service8 + systemd-nspawn1 systemd-bootchart1 @@ -1682,7 +1702,7 @@ systemd-cat1 -journalctl1, systemctl1 +journalctl1, loginctl1, machinectl1, systemctl1 systemd-nspawn1 @@ -1724,6 +1744,8 @@ journalctl1, systemd-journal-upload8 +machinectl1 + systemd-inhibit1 systemd-ask-password1 @@ -1736,6 +1758,8 @@ systemd-nspawn1 +systemd-nspawn1 + systemd-nspawn1 systemd-nspawn1 @@ -1744,7 +1768,7 @@ systemd-run1 -hostnamectl1, localectl1, loginctl1, systemctl1, timedatectl1 +hostnamectl1, localectl1, loginctl1, machinectl1, systemctl1, timedatectl1 systemctl1 @@ -1760,7 +1784,7 @@ systemd-analyze1 -busctl1, coredumpctl1, journalctl1, localectl1, loginctl1, machinectl1, systemctl1, systemd-analyze1, systemd-cgls1, systemd-delta1, timedatectl1 +busctl1, coredumpctl1, journalctl1, localectl1, loginctl1, machinectl1, networkctl1, systemctl1, systemd-analyze1, systemd-cgls1, systemd-delta1, timedatectl1 systemctl1 @@ -1790,7 +1814,7 @@ systemd-bootchart1 -coredumpctl1, journalctl1, systemctl1, systemd-journal-remote8 +coredumpctl1, journalctl1, loginctl1, machinectl1, systemctl1, systemd-journal-remote8 journalctl1 @@ -1808,6 +1832,8 @@ systemd-tty-ask-password-agent1 +systemd-nspawn1 + halt8, shutdown8 systemd-tmpfiles8 @@ -1838,13 +1864,15 @@ systemd-bootchart1 +systemd-run1 + systemd-tty-ask-password-agent1 udevadm8 -busctl1, journalctl1, systemctl1, systemd-detect-virt1, systemd-nspawn1 +busctl1, journalctl1, systemctl1, systemd-detect-virt1, systemd-nspawn1, systemd-run1 -systemd-nspawn1 +machinectl1, systemd-nspawn1 systemd-notify1 @@ -1874,7 +1902,7 @@ systemd-firstboot1 -journalctl1, systemctl1, systemd-firstboot1, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-sysusers8, systemd-tmpfiles8, udevadm8 +journalctl1, systemctl1, systemd-firstboot1, systemd-hwdb8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-sysusers8, systemd-tmpfiles8 systemctl1 @@ -1946,13 +1974,11 @@ udevadm8 -systemd-escape1 +systemd-escape1, systemd-nspawn1 systemd1 -udevadm8 - -busctl1, systemd-ask-password1, udevadm8 +busctl1, systemd-ask-password1, systemd-networkd-wait-online.service8, udevadm8 systemd-run1 @@ -1978,8 +2004,6 @@ journalctl1 -udevadm8 - journalctl1 systemd-journal-remote8, systemd-journal-upload8 @@ -1990,7 +2014,7 @@ systemd-nspawn1 -udevadm8 +systemd-hwdb8 journalctl1 @@ -2006,7 +2030,9 @@ journalctl1 -bootctl1, busctl1, coredumpctl1, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, systemd-udevd.service8, timedatectl1, udevadm8 +machinectl1 + +bootctl1, busctl1, coredumpctl1, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, networkctl1, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, systemd-udevd.service8, timedatectl1, udevadm8 systemd-detect-virt1 @@ -2052,7 +2078,7 @@ systemd-nspawn1 -journalctl1, loginctl1, machinectl1, systemctl1, systemd-activate8, udevadm8 +journalctl1, loginctl1, machinectl1, networkctl1, systemctl1, systemd-activate8, udevadm8 journalctl1, systemd-cgtop1, systemd-nspawn1, udevadm8 @@ -2066,7 +2092,7 @@ systemd-bootchart1, udevadm8 -bootctl1, busctl1, coredumpctl1, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, shutdown8, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-ask-password1, systemd-bootchart1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, timedatectl1, udevadm8 +bootctl1, busctl1, coredumpctl1, hostnamectl1, journalctl1, localectl1, loginctl1, machinectl1, networkctl1, shutdown8, systemctl1, systemd1, systemd-activate8, systemd-analyze1, systemd-ask-password1, systemd-bootchart1, systemd-bus-proxyd8, systemd-cat1, systemd-cgls1, systemd-cgtop1, systemd-delta1, systemd-detect-virt1, systemd-escape1, systemd-firstboot1, systemd-hwdb8, systemd-inhibit1, systemd-journal-gatewayd.service8, systemd-journal-remote8, systemd-journal-upload8, systemd-machine-id-commit1, systemd-machine-id-setup1, systemd-notify1, systemd-nspawn1, systemd-path1, systemd-run1, systemd-socket-proxyd8, systemd-suspend.service8, systemd-sysusers8, systemd-tmpfiles8, systemd-tty-ask-password-agent1, timedatectl1, udevadm8 systemctl1, systemd-bootchart1, systemd-cgtop1, systemd-networkd-wait-online.service8, systemd-nspawn1 @@ -2078,19 +2104,19 @@ journalctl1, systemd-cgtop1, systemd-journal-upload8, udevadm8 -journalctl1, systemctl1, systemd-bootchart1, systemd-cgtop1, udevadm8 +journalctl1, loginctl1, machinectl1, systemctl1, systemd-bootchart1, systemd-cgtop1, systemd-nspawn1, udevadm8 -coredumpctl1, journalctl1, systemctl1, systemd-bootchart1 +coredumpctl1, journalctl1, loginctl1, machinectl1, systemctl1, systemd-bootchart1 -halt8, journalctl1, loginctl1, machinectl1, systemctl1, systemd-bootchart1, systemd-cat1, systemd-cgtop1, systemd-escape1, systemd-run1, udevadm8 +halt8, journalctl1, loginctl1, machinectl1, systemctl1, systemd-bootchart1, systemd-cat1, systemd-cgtop1, systemd-escape1, systemd-nspawn1, systemd-run1, udevadm8 -journalctl1, systemctl1, systemd-detect-virt1, systemd-nspawn1, udevadm8 +journalctl1, systemctl1, systemd-detect-virt1, systemd-nspawn1, systemd-run1, udevadm8 -journalctl1, shutdown8, systemctl1, systemd-bootchart1, udevadm8 +journalctl1, shutdown8, systemctl1, systemd-bootchart1, systemd-hwdb8, udevadm8 loginctl1, machinectl1, systemctl1, udevadm8 -journalctl1, systemctl1, systemd-cat1, systemd-cgtop1, systemd-delta1, udevadm8 +journalctl1, systemctl1, systemd-cat1, systemd-cgtop1, systemd-delta1, systemd-run1, udevadm8 journalctl1, systemd-journal-upload8, systemd-nspawn1, udevadm8 @@ -2098,7 +2124,7 @@ halt8 -journalctl1, systemd-bootchart1, udevadm8 +journalctl1, systemd-bootchart1, systemd-nspawn1, udevadm8 systemd-bootchart1, udevadm8 @@ -2152,9 +2178,11 @@ Various constant used and/or defined by systemd. - -0journalctl1 + -1sd_journal_get_fd3, sd_login_monitor_new3 + +-0journalctl1 --1journalctl1, sd_journal_get_fd3, sd_login_monitor_new3, systemd1 +-1journalctl1, sd_journal_get_fd3, systemd1 -EADDRINUSEsd_bus_request_name3 @@ -2186,7 +2214,7 @@ -ESRCHsd_bus_creds_new_from_pid3, sd_bus_request_name3 --ESTALEsd_bus_message_append3, sd_bus_message_append_array3, sd_bus_message_append_basic3, sd_bus_message_append_string_memfd3, sd_bus_message_append_strv3, sd_event_add_child3, sd_event_add_defer3, sd_event_add_signal3, sd_event_add_time3 +-ESTALEsd_bus_message_append3, sd_bus_message_append_array3, sd_bus_message_append_basic3, sd_bus_message_append_string_memfd3, sd_bus_message_append_strv3, sd_event_add_child3, sd_event_add_defer3, sd_event_add_signal3, sd_event_add_time3, sd_journal_get_realtime_usec3 0systemctl1 @@ -2204,6 +2232,8 @@ AF_UNSPECsd_is_fifo3 +CAP_ADMINsystemd-tmpfiles8 + CAP_DAC_OVERRIDEsystemd.exec5 CAP_MKNODsystemd.exec5 @@ -2214,9 +2244,9 @@ CLOCK_BOOTTIME_ALARMsd_event_add_time3 -CLOCK_MONOTONICbootchart.conf5, sd_event_add_time3, sd_journal_get_cutoff_realtime_usec3, sd_journal_get_fd3, sd_journal_get_realtime_usec3, sd_journal_seek_head3, sd_login_monitor_new3, systemd.journal-fields7 +CLOCK_MONOTONICbootchart.conf5, sd_bus_message_get_monotonic_usec3, sd_event_add_time3, sd_journal_get_cutoff_realtime_usec3, sd_journal_get_fd3, sd_journal_get_realtime_usec3, sd_journal_seek_head3, sd_login_monitor_new3, systemd.journal-fields7 -CLOCK_REALTIMEsd_event_add_time3, sd_journal_get_cutoff_realtime_usec3, sd_journal_get_realtime_usec3, sd_journal_seek_head3, systemd.journal-fields7 +CLOCK_REALTIMEsd_bus_message_get_monotonic_usec3, sd_event_add_time3, sd_journal_get_cutoff_realtime_usec3, sd_journal_get_realtime_usec3, sd_journal_seek_head3, systemd.journal-fields7 EACCESsystemd.exec5 @@ -2248,6 +2278,8 @@ O_NONBLOCKsystemd.service5 +PAM_SUCCESSpam_systemd8 + POLLINsd_journal_get_fd3, sd_login_monitor_new3 POLLOUTsd_journal_get_fd3, sd_login_monitor_new3 @@ -2575,6 +2607,10 @@ $LISTEN_FDSsystemd-journal-remote8 +Atmpfiles.d5 + +A+tmpfiles.d5 + ANSI_COLOR=os-release5 BUG_REPORT_URL=os-release5 @@ -2683,6 +2719,8 @@ PRETTY_NAME=os-release5 +PRIVACY_POLICY_URL=os-release5 + PowerKeyIgnoreInhibited=logind.conf5 ProcessSizeMax=coredump.conf5 @@ -2729,6 +2767,8 @@ SystemMaxUse=journald.conf5 +Ttmpfiles.d5 + TTYPath=journald.conf5 VERSION=os-release5 @@ -2739,6 +2779,10 @@ Ztmpfiles.d5 +atmpfiles.d5 + +a+tmpfiles.d5 + btmpfiles.d5 b+tmpfiles.d5 @@ -2789,6 +2833,8 @@ ustmpfiles.d5 +vtmpfiles.d5 + wtmpfiles.d5 xtmpfiles.d5 @@ -2820,13 +2866,15 @@ /binfile-hierarchy7, systemd.exec5 +/bin/bashsystemd-run1 + /bin/lssystemd-cat1 -/bootfile-hierarchy7, kernel-install8, systemd-efi-boot-generator8, systemd-gpt-auto-generator8 +/bootfile-hierarchy7, kernel-install8, systemd-efi-boot-generator8, systemd-gpt-auto-generator8, systemd.exec5 /boot/loader/entries/MACHINE-ID-KERNEL-VERSION.confkernel-install8 -/devfile-hierarchy7, systemd-nspawn1, systemd-remount-fs.service8, systemd.device5, systemd.journal-fields7, systemd.resource-control5, udev7, udevadm8 +/devfile-hierarchy7, systemd-nspawn1, systemd-remount-fs.service8, systemd.device5, systemd.generator7, systemd.journal-fields7, systemd.resource-control5, udev7, udevadm8 /dev/consolejournald.conf5, systemd-getty-generator8, systemd-tty-ask-password-agent1, systemd.exec5 @@ -2838,6 +2886,8 @@ /dev/initctlsystemd1, systemd-initctl.service8 +/dev/kmsgsystemd.generator7 + /dev/mapper/crypttab5 /dev/mapper/homesystemd-gpt-auto-generator8 @@ -2846,7 +2896,7 @@ /dev/net/tunsystemd.netdev5 -/dev/nullbinfmt.d5, bootchart.conf5, coredump.conf5, daemon7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sysctl.d5, systemctl1, systemd-sleep.conf5, systemd-system.conf5, systemd.exec5, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.resource-control5, systemd.unit5, sysusers.d5, timesyncd.conf5, tmpfiles.d5, udev7 +/dev/nullbinfmt.d5, bootchart.conf5, coredump.conf5, daemon7, hwdb7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sysctl.d5, systemctl1, systemd-sleep.conf5, systemd-system.conf5, systemd.exec5, systemd.generator7, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.resource-control5, systemd.unit5, sysusers.d5, timesyncd.conf5, tmpfiles.d5, udev7 /dev/randomcrypttab5, systemd.exec5, systemd.resource-control5 @@ -2862,7 +2912,7 @@ /dev/zerosystemd.exec5, systemd.resource-control5 -/etcbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, journald.conf5, logind.conf5, modules-load.d5, nss-myhostname8, os-release5, resolved.conf5, sysctl.d5, systemctl1, systemd-delta1, systemd-machine-id-commit1, systemd-sleep.conf5, systemd-system.conf5, systemd-update-done.service8, systemd.exec5, systemd.link5, systemd.mount5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.unit5, sysusers.d5, timesyncd.conf5, udev7, udevadm8 +/etcbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, hwdb7, journald.conf5, logind.conf5, modules-load.d5, nss-myhostname8, os-release5, resolved.conf5, sysctl.d5, systemctl1, systemd-delta1, systemd-machine-id-commit1, systemd-sleep.conf5, systemd-system.conf5, systemd-update-done.service8, systemd.exec5, systemd.generator7, systemd.link5, systemd.mount5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.unit5, sysusers.d5, timesyncd.conf5, udev7 /etc/.updatedsystemd-update-done.service8 @@ -2872,13 +2922,13 @@ /etc/crypttabcrypttab5, systemd-cryptsetup-generator8, systemd-cryptsetup@.service8, systemd-gpt-auto-generator8 -/etc/fstabkernel-command-line7, systemd1, systemd-fsck@.service8, systemd-fstab-generator8, systemd-gpt-auto-generator8, systemd-remount-fs.service8, systemd.automount5, systemd.mount5, systemd.special7, systemd.swap5 +/etc/fstabkernel-command-line7, systemd1, systemd-fsck@.service8, systemd-fstab-generator8, systemd-gpt-auto-generator8, systemd-remount-fs.service8, systemd.automount5, systemd.generator7, systemd.mount5, systemd.special7, systemd.swap5 /etc/groupsysusers.d5 /etc/hostnamehostname5, hostnamectl1, machine-info5 -/etc/hostsnss-myhostname8 +/etc/hostsnss-myhostname8, nss-mymachines8 /etc/init.d/systemd-sysv-generator8 @@ -2902,7 +2952,7 @@ /etc/modules-load.d/bridge.confsysctl.d5 -/etc/nsswitch.confnss-myhostname8 +/etc/nsswitch.confnss-myhostname8, nss-mymachines8 /etc/os-releasekernel-install8, os-release5, systemd-nspawn1 @@ -2924,6 +2974,8 @@ /etc/systemd/coredump.conf.d/*.confcoredump.conf5 +/etc/systemd/import-pubring.gpgmachinectl1 + /etc/systemd/journal-remote.confsystemd-journal-upload8 /etc/systemd/journal-upload.confsystemd-journal-upload8 @@ -2948,6 +3000,8 @@ /etc/systemd/system/systemd.unit5 +/etc/systemd/system-generators/systemd.generator7 + /etc/systemd/system-preset/systemd.preset5 /etc/systemd/system-preset/*.presetsystemd.preset5 @@ -2958,12 +3012,20 @@ /etc/systemd/system.conf.d/*.confsystemd-system.conf5 +/etc/systemd/system/httpd.servicesystemd.unit5 + +/etc/systemd/system/httpd.service.d/local.confsystemd.unit5 + +/etc/systemd/system/multi-user.target.wants/foo.servicesystemd.unit5 + /etc/systemd/timesyncd.conftimesyncd.conf5 /etc/systemd/timesyncd.conf.d/*.conftimesyncd.conf5 /etc/systemd/user/systemd.unit5 +/etc/systemd/user-generators/systemd.generator7 + /etc/systemd/user-preset/*.presetsystemd.preset5 /etc/systemd/user.confsystemd-system.conf5 @@ -2974,9 +3036,9 @@ /etc/tmpfiles.d/*.conftmpfiles.d5 -/etc/udev/hwdb.binudev7, udevadm8 +/etc/udev/hwdb.binhwdb7 -/etc/udev/hwdb.dudev7, udevadm8 +/etc/udev/hwdb.dhwdb7 /etc/udev/rules.dudev7 @@ -2994,7 +3056,9 @@ /lib64file-hierarchy7 -/procbusctl1, file-hierarchy7, sd-login3, sd_bus_creds_get_pid3, sd_bus_creds_new_from_pid3, sd_is_fifo3, systemd1, systemd-remount-fs.service8, systemd.socket5, tmpfiles.d5 +/path/to/generatorsystemd.generator7 + +/procbusctl1, file-hierarchy7, sd-login3, sd_bus_creds_get_pid3, sd_bus_creds_new_from_pid3, sd_is_fifo3, systemd1, systemd-remount-fs.service8, systemd.generator7, systemd.socket5, tmpfiles.d5 /proc/cmdlinekernel-command-line7, kernel-install8, systemd1 @@ -3020,7 +3084,7 @@ /rootfile-hierarchy7 -/runbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sd-login3, sysctl.d5, systemctl1, systemd-delta1, systemd-journald.service8, systemd-nspawn1, systemd-sleep.conf5, systemd-system.conf5, systemd.exec5, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.unit5, sysusers.d5, timesyncd.conf5, tmpfiles.d5, udev7 +/runbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, hwdb7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sd-login3, sd_notify3, sysctl.d5, systemctl1, systemd-delta1, systemd-journald.service8, systemd-nspawn1, systemd-sleep.conf5, systemd-system.conf5, systemd.exec5, systemd.generator7, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, systemd.service5, systemd.unit5, sysusers.d5, timesyncd.conf5, tmpfiles.d5, udev7 /run/binfmt.d/*.confbinfmt.d5 @@ -3062,6 +3126,8 @@ /run/systemd/system/sd_booted3, systemd.unit5 +/run/systemd/system-generators/systemd.generator7 + /run/systemd/system-preset/*.presetsystemd.preset5 /run/systemd/system.conf.d/*.confsystemd-system.conf5 @@ -3070,6 +3136,8 @@ /run/systemd/user/systemd.unit5 +/run/systemd/user-generators/systemd.generator7 + /run/systemd/user-preset/*.presetsystemd.preset5 /run/systemd/user.conf.d/*.confsystemd-system.conf5 @@ -3078,7 +3146,7 @@ /run/tmpfiles.d/*.conftmpfiles.d5 -/run/udev/hwdb.dudev7 +/run/udev/hwdb.dhwdb7 /run/udev/rules.dudev7 @@ -3092,13 +3160,15 @@ /sbin/fsck.systemd-fsck@.service8 -/sbin/initbootchart.conf5 - /sbin/nologinsysusers.d5 /srvfile-hierarchy7, systemd-gpt-auto-generator8 -/sysfile-hierarchy7, loginctl1, sd_is_fifo3, systemd1, systemd-nspawn1, systemd-remount-fs.service8, systemd.device5, systemd.journal-fields7, systemd.socket5, tmpfiles.d5, udevadm8 +/srv/webserversystemd.unit5 + +/srv/wwwsystemd.unit5 + +/sysfile-hierarchy7, loginctl1, sd_is_fifo3, systemd1, systemd-nspawn1, systemd-remount-fs.service8, systemd.device5, systemd.generator7, systemd.journal-fields7, systemd.socket5, tmpfiles.d5, udevadm8 /sys/fs/cgroupsd-login3, systemd-cgls1 @@ -3124,7 +3194,7 @@ /uploadsystemd-journal-remote8 -/usrbootup7, file-hierarchy7, systemd-fstab-generator8, systemd-nspawn1, systemd-remount-fs.service8, systemd-update-done.service8, systemd.exec5, systemd.mount5, systemd.unit5 +/usrbootup7, file-hierarchy7, machinectl1, systemd-fstab-generator8, systemd-nspawn1, systemd-remount-fs.service8, systemd-update-done.service8, systemd.exec5, systemd.generator7, systemd.mount5, systemd.unit5 /usr/binfile-hierarchy7, systemd.exec5 @@ -3134,7 +3204,7 @@ /usr/includefile-hierarchy7 -/usr/libbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sysctl.d5, systemd-delta1, systemd-sleep.conf5, systemd-system.conf5, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, sysusers.d5, timesyncd.conf5, udev7 +/usr/libbinfmt.d5, bootchart.conf5, coredump.conf5, file-hierarchy7, hwdb7, journald.conf5, logind.conf5, modules-load.d5, resolved.conf5, sysctl.d5, systemd-delta1, systemd-sleep.conf5, systemd-system.conf5, systemd.link5, systemd.netdev5, systemd.network5, systemd.preset5, sysusers.d5, timesyncd.conf5, udev7 /usr/lib/binfmt.d/*.confbinfmt.d5 @@ -3142,6 +3212,8 @@ /usr/lib/kernel/install.d/*.installkernel-install8 +/usr/lib/machines/machinectl1 + /usr/lib/modules-load.d/*.confmodules-load.d5 /usr/lib/os-releasekernel-install8, os-release5, systemd-nspawn1 @@ -3154,6 +3226,8 @@ /usr/lib/systemd/coredump.conf.d/*.confcoredump.conf5 +/usr/lib/systemd/import-pubring.gpgmachinectl1 + /usr/lib/systemd/journald.conf.d/*.confjournald.conf5 /usr/lib/systemd/logind.conf.d/*.conflogind.conf5 @@ -3166,6 +3240,8 @@ /usr/lib/systemd/systemsystemd1, systemd.unit5 +/usr/lib/systemd/system-generators/systemd.generator7 + /usr/lib/systemd/system-generators/systemd-cryptsetup-generatorsystemd-cryptsetup-generator8 /usr/lib/systemd/system-generators/systemd-debug-generatorsystemd-debug-generator8 @@ -3196,6 +3272,10 @@ /usr/lib/systemd/system.conf.d/*.confsystemd-system.conf5 +/usr/lib/systemd/system/httpd.servicesystemd.unit5 + +/usr/lib/systemd/systemdbootchart.conf5 + /usr/lib/systemd/systemd-activatesystemd-activate8 /usr/lib/systemd/systemd-backlightsystemd-backlight@.service8 @@ -3270,6 +3350,8 @@ /usr/lib/systemd/user/systemd.unit5 +/usr/lib/systemd/user-generators/systemd.generator7 + /usr/lib/systemd/user-preset/*.presetsystemd.preset5 /usr/lib/systemd/user.conf.d/*.confsystemd-system.conf5 @@ -3282,9 +3364,9 @@ /usr/lib/udevudev7 -/usr/lib/udev/hwdb.binudev7, udevadm8 +/usr/lib/udev/hwdb.binhwdb7 -/usr/lib/udev/hwdb.dudev7 +/usr/lib/udev/hwdb.dhwdb7 /usr/lib/udev/rules.dudev7 @@ -3292,14 +3374,24 @@ /usr/local/binsystemd.exec5 +/usr/local/lib/machines/machinectl1 + /usr/local/lib/systemd/systemsystemd1 +/usr/local/lib/systemd/system-generators/systemd.generator7 + +/usr/local/lib/systemd/user-generators/systemd.generator7 + /usr/local/sbinsystemd.exec5 /usr/sbinfile-hierarchy7, systemd.exec5 +/usr/sbin/foo-daemonsystemd.service5 + /usr/sharefile-hierarchy7 +/usr/share/dbus-1/system-services/org.example.simple-dbus-service.servicesystemd.service5 + /usr/share/docfile-hierarchy7 /usr/share/factoryfile-hierarchy7, tmpfiles.d5 @@ -3318,10 +3410,16 @@ /var/libfile-hierarchy7 +/var/lib/container/machinectl1 + /var/lib/dbus/machine-idmachine-id5 +/var/lib/machines/machinectl1, systemd-nspawn1 + /var/lib/systemd/backlight/systemd-backlight@.service8 +/var/lib/systemd/clocksystemd-timesyncd.service8 + /var/lib/systemd/coredumpcoredump.conf5, systemd-coredump8 /var/lib/systemd/journal-upload/statesystemd-journal-upload8 @@ -3410,6 +3508,10 @@ kexec.targetsystemd.special7 +libnss_myhostname.so.2nss-myhostname8 + +libnss_mymachines.so.2nss-mymachines8 + link.linksystemd.link5 local-fs-pre.targetsystemd.special7 @@ -3438,9 +3540,9 @@ network.targetsystemd.special7 -nss-lookup.targetsystemd.special7 +networkctlnetworkctl1 -nss-myhostname.lanss-myhostname8 +nss-lookup.targetsystemd.special7 nss-user-lookup.targetsystemd.special7 @@ -3572,6 +3674,8 @@ systemd-hostnamed.servicesystemd-hostnamed.service8 +systemd-hwdbsystemd-hwdb8 + systemd-hybrid-sleep.servicesystemd-suspend.service8 systemd-inhibitsystemd-inhibit1 @@ -3705,8 +3809,8 @@ Colophon - This index contains 1777 entries in 14 sections, -referring to 192 individual manual pages. + This index contains 1829 entries in 14 sections, +referring to 197 individual manual pages. diff --git a/man/systemd.exec.5 b/man/systemd.exec.5 index 5514877e0..80249ec39 100644 --- a/man/systemd.exec.5 +++ b/man/systemd.exec.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.EXEC" "5" "" "systemd 218" "systemd.exec" +.TH "SYSTEMD\&.EXEC" "5" "" "systemd 219" "systemd.exec" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -660,7 +660,9 @@ for details\&. Note that this option will disconnect all socket families from th Takes a boolean argument or "full"\&. If true, mounts the /usr -directory read\-only for processes invoked by this unit\&. If set to +and +/boot +directories read\-only for processes invoked by this unit\&. If set to "full", the /etc directory is mounted read\-only, too\&. This setting ensures that any modification of the vendor supplied operating system (and optionally its configuration) is prohibited for the service\&. It is recommended to enable this setting for all long\-running services, unless they are involved with system updates or need to modify the operating system in other ways\&. Note however that processes retaining the CAP_SYS_ADMIN capability can undo the effect of this setting\&. This setting is hence particularly useful for daemons which have this capability removed, for example with diff --git a/man/systemd.exec.html b/man/systemd.exec.html index ddf486128..e59942048 100644 --- a/man/systemd.exec.html +++ b/man/systemd.exec.html @@ -19,1098 +19,716 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.exec — Execution environment configuration

Synopsis

service.service, - socket.socket, - mount.mount, - swap.swap

Description¶

Unit configuration files for services, sockets, - mount points, and swap devices share a subset of - configuration options which define the execution - environment of spawned processes.

This man page lists the configuration options - shared by these four unit types. See - systemd.unit(5) - for the common options of all unit configuration - files, and - systemd.service(5), - systemd.socket(5), - systemd.swap(5), - and - systemd.mount(5) - for more information on the specific unit - configuration files. The execution specific - configuration options are configured in the [Service], - [Socket], [Mount], or [Swap] sections, depending on the unit - type.

Options¶

WorkingDirectory=¶

Takes an absolute - directory path. Sets the working - directory for executed processes. If - not set, defaults to the root directory - when systemd is running as a system - instance and the respective user's - home directory if run as - user.

RootDirectory=¶

Takes an absolute - directory path. Sets the root - directory for executed processes, with - the - chroot(2) - system call. If this is used, it must - be ensured that the process and all - its auxiliary files are available in - the chroot() - jail.

User=, Group=¶

Sets the Unix user - or group that the processes are executed - as, respectively. Takes a single user or group - name or ID as argument. If no group is - set, the default group of the user is - chosen.

SupplementaryGroups=¶

Sets the supplementary - Unix groups the processes are executed - as. This takes a space-separated list - of group names or IDs. This option may - be specified more than once in which - case all listed groups are set as - supplementary groups. When the empty - string is assigned the list of - supplementary groups is reset, and all - assignments prior to this one will - have no effect. In any way, this - option does not override, but extends - the list of supplementary groups - configured in the system group - database for the - user.

Nice=¶

Sets the default nice - level (scheduling priority) for - executed processes. Takes an integer - between -20 (highest priority) and 19 - (lowest priority). See - setpriority(2) - for details.

OOMScoreAdjust=¶

Sets the adjustment - level for the Out-Of-Memory killer for - executed processes. Takes an integer - between -1000 (to disable OOM killing - for this process) and 1000 (to make - killing of this process under memory - pressure very likely). See proc.txt - for details.

IOSchedulingClass=¶

Sets the IO scheduling - class for executed processes. Takes an - integer between 0 and 3 or one of the - strings none, - realtime, - best-effort or - idle. See - ioprio_set(2) - for details.

IOSchedulingPriority=¶

Sets the IO scheduling - priority for executed processes. Takes - an integer between 0 (highest - priority) and 7 (lowest priority). The - available priorities depend on the - selected IO scheduling class (see - above). See - ioprio_set(2) - for details.

CPUSchedulingPolicy=¶

Sets the CPU - scheduling policy for executed - processes. Takes one of - other, - batch, - idle, - fifo or - rr. See - sched_setscheduler(2) - for details.

CPUSchedulingPriority=¶

Sets the CPU - scheduling priority for executed - processes. The available priority - range depends on the selected CPU - scheduling policy (see above). For - real-time scheduling policies an - integer between 1 (lowest priority) - and 99 (highest priority) can be used. - See sched_setscheduler(2) - for details. -

CPUSchedulingResetOnFork=¶

Takes a boolean - argument. If true, elevated CPU - scheduling priorities and policies - will be reset when the executed - processes fork, and can hence not leak - into child processes. See - sched_setscheduler(2) - for details. Defaults to false.

CPUAffinity=¶

Controls the CPU - affinity of the executed - processes. Takes a space-separated - list of CPU indices. This option may - be specified more than once in which - case the specified CPU affinity masks - are merged. If the empty string is - assigned, the mask is reset, all - assignments prior to this will have no - effect. See - sched_setaffinity(2) - for details.

UMask=¶

Controls the file mode - creation mask. Takes an access mode in - octal notation. See - umask(2) - for details. Defaults to - 0022.

Environment=¶

Sets environment - variables for executed - processes. Takes a space-separated - list of variable assignments. This - option may be specified more than once - in which case all listed variables - will be set. If the same variable is - set twice, the later setting will - override the earlier setting. If the - empty string is assigned to this - option, the list of environment - variables is reset, all prior - assignments have no effect. - Variable expansion is not performed - inside the strings, however, specifier - expansion is possible. The $ character has - no special meaning. - If you need to assign a value containing spaces - to a variable, use double quotes (") - for the assignment.

Example: -

Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"

- gives three variables "VAR1", - "VAR2", "VAR3" - with the values "word1 word2", - "word3", "$word 5 6". -

- See - environ(7) - for details about environment variables.

EnvironmentFile=¶

Similar to - Environment= but - reads the environment variables from a - text file. The text file should - contain new-line-separated variable - assignments. Empty lines and lines - starting with ; or # will be ignored, - which may be used for commenting. A line - ending with a backslash will be concatenated - with the following one, allowing multiline variable - definitions. The parser strips leading - and trailing whitespace from the values - of assignments, unless you use - double quotes (").

The argument passed should be an - absolute filename or wildcard - expression, optionally prefixed with - "-", which indicates - that if the file does not exist, it - will not be read and no error or warning - message is logged. This option may be - specified more than once in which case - all specified files are read. If the - empty string is assigned to this - option, the list of file to read is - reset, all prior assignments have no - effect.

The files listed with this - directive will be read shortly before - the process is executed (more - specifically, after all - processes from a previous unit state - terminated. This means you can - generate these files in one unit - state, and read it with this option in - the next). Settings from these files - override settings made with - Environment=. If - the same variable is set twice from - these files, the files will be read in - the order they are specified and the - later setting will override the - earlier setting.

StandardInput=¶

Controls where file - descriptor 0 (STDIN) of the executed - processes is connected to. Takes one - of null, - tty, - tty-force, - tty-fail or - socket.

If null is - selected, standard input will be - connected to - /dev/null, - i.e. all read attempts by the process - will result in immediate EOF.

If tty is - selected, standard input is connected - to a TTY (as configured by - TTYPath=, see - below) and the executed process - becomes the controlling process of the - terminal. If the terminal is already - being controlled by another process, - the executed process waits until the - current controlling process releases - the terminal.

tty-force is similar - to tty, but the - executed process is forcefully and - immediately made the controlling - process of the terminal, potentially - removing previous controlling - processes from the - terminal.

tty-fail is - similar to tty but if - the terminal already has a controlling - process start-up of the executed - process fails.

The socket - option is only valid in - socket-activated services, and only - when the socket configuration file - (see - systemd.socket(5) - for details) specifies a single socket - only. If this option is set, standard - input will be connected to the socket - the service was activated from, which - is primarily useful for compatibility - with daemons designed for use with the - traditional - inetd(8) - daemon.

This setting defaults to - null.

StandardOutput=¶

Controls where file - descriptor 1 (STDOUT) of the executed - processes is connected to. Takes one - of inherit, - null, - tty, - journal, - syslog, - kmsg, - journal+console, - syslog+console, - kmsg+console or - socket.

inherit - duplicates the file descriptor of - standard input for standard - output.

null connects - standard output to - /dev/null, - i.e. everything written to it will be - lost.

tty connects - standard output to a tty (as - configured via - TTYPath=, see - below). If the TTY is used for output - only, the executed process will not - become the controlling process of the - terminal, and will not fail or wait - for other processes to release the - terminal.

journal - connects standard output with the - journal which is accessible via - journalctl(1). - Note that everything that is written - to syslog or kmsg (see below) is - implicitly stored in the journal as - well, the specific two options listed - below are hence supersets of this - one.

syslog connects - standard output to the syslog(3) - system syslog service, in addition to - the journal. Note that the journal - daemon is usually configured to - forward everything it receives to - syslog anyway, in which case this - option is no different from - journal.

kmsg connects - standard output with the kernel log - buffer which is accessible via - dmesg(1), - in addition to the journal. The - journal daemon might be configured to - send all logs to kmsg anyway, in which - case this option is no different from - journal.

journal+console, - syslog+console and - kmsg+console work in - a similar way as the three options - above but copy the output to the - system console as well.

socket connects - standard output to a socket acquired - via socket activation. The semantics - are similar to the same option of - StandardInput=.

This setting defaults to the - value set with - DefaultStandardOutput= - in - systemd-system.conf(5), - which defaults to - journal.

StandardError=¶

Controls where file - descriptor 2 (STDERR) of the - executed processes is connected to. - The available options are identical to - those of - StandardOutput=, - with one exception: if set to - inherit the file - descriptor used for standard output is - duplicated for standard error. This - setting defaults to the value set with - DefaultStandardError= - in - systemd-system.conf(5), - which defaults to - inherit.

TTYPath=¶

Sets the terminal - device node to use if standard input, output, - or error are connected to a - TTY (see above). Defaults to - /dev/console.

TTYReset=¶

Reset the terminal - device specified with - TTYPath= before and - after execution. Defaults to - "no".

TTYVHangup=¶

Disconnect all clients - which have opened the terminal device - specified with - TTYPath= - before and after execution. Defaults - to - "no".

TTYVTDisallocate=¶

If the terminal - device specified with - TTYPath= is a - virtual console terminal, try to - deallocate the TTY before and after - execution. This ensures that the - screen and scrollback buffer is - cleared. Defaults to - "no".

SyslogIdentifier=¶

Sets the process name - to prefix log lines sent to the - logging system or the kernel log - buffer with. If not set, defaults to - the process name of the executed - process. This option is only useful - when - StandardOutput= or - StandardError= are - set to syslog, - journal or - kmsg (or to the same - settings in combination with - +console).

SyslogFacility=¶

Sets the syslog - facility to use when logging to - syslog. One of kern, - user, - mail, - daemon, - auth, - syslog, - lpr, - news, - uucp, - cron, - authpriv, - ftp, - local0, - local1, - local2, - local3, - local4, - local5, - local6 or - local7. See - syslog(3) - for details. This option is only - useful when - StandardOutput= or - StandardError= are - set to syslog. - Defaults to - daemon.

SyslogLevel=¶

Default syslog level - to use when logging to syslog or the - kernel log buffer. One of - emerg, - alert, - crit, - err, - warning, - notice, - info, - debug. See - syslog(3) - for details. This option is only - useful when - StandardOutput= or - StandardError= are - set to syslog or - kmsg. Note that - individual lines output by the daemon - might be prefixed with a different log - level which can be used to override - the default log level specified - here. The interpretation of these - prefixes may be disabled with - SyslogLevelPrefix=, - see below. For details see - sd-daemon(3). + gudev systemd 219


Name

systemd.exec — Execution environment configuration

Synopsis

service.service, + socket.socket, + mount.mount, + swap.swap

Description¶

Unit configuration files for services, sockets, mount + points, and swap devices share a subset of configuration options + which define the execution environment of spawned + processes.

This man page lists the configuration options shared by + these four unit types. See + systemd.unit(5) + for the common options of all unit configuration files, and + systemd.service(5), + systemd.socket(5), + systemd.swap(5), + and + systemd.mount(5) + for more information on the specific unit configuration files. The + execution specific configuration options are configured in the + [Service], [Socket], [Mount], or [Swap] sections, depending on the + unit type.

Options¶

WorkingDirectory=¶

Takes an absolute directory path. Sets the + working directory for executed processes. If not set, defaults + to the root directory when systemd is running as a system + instance and the respective user's home directory if run as + user.

RootDirectory=¶

Takes an absolute directory path. Sets the + root directory for executed processes, with the + chroot(2) + system call. If this is used, it must be ensured that the + process and all its auxiliary files are available in the + chroot() jail.

User=, Group=¶

Sets the Unix user or group that the processes + are executed as, respectively. Takes a single user or group + name or ID as argument. If no group is set, the default group + of the user is chosen.

SupplementaryGroups=¶

Sets the supplementary Unix groups the + processes are executed as. This takes a space-separated list + of group names or IDs. This option may be specified more than + once in which case all listed groups are set as supplementary + groups. When the empty string is assigned the list of + supplementary groups is reset, and all assignments prior to + this one will have no effect. In any way, this option does not + override, but extends the list of supplementary groups + configured in the system group database for the + user.

Nice=¶

Sets the default nice level (scheduling + priority) for executed processes. Takes an integer between -20 + (highest priority) and 19 (lowest priority). See + setpriority(2) + for details.

OOMScoreAdjust=¶

Sets the adjustment level for the + Out-Of-Memory killer for executed processes. Takes an integer + between -1000 (to disable OOM killing for this process) and + 1000 (to make killing of this process under memory pressure + very likely). See proc.txt + for details.

IOSchedulingClass=¶

Sets the IO scheduling class for executed + processes. Takes an integer between 0 and 3 or one of the + strings none, realtime, + best-effort or idle. See + ioprio_set(2) + for details.

IOSchedulingPriority=¶

Sets the IO scheduling priority for executed + processes. Takes an integer between 0 (highest priority) and 7 + (lowest priority). The available priorities depend on the + selected IO scheduling class (see above). See + ioprio_set(2) + for details.

CPUSchedulingPolicy=¶

Sets the CPU scheduling policy for executed + processes. Takes one of + other, + batch, + idle, + fifo or + rr. See + sched_setscheduler(2) + for details.

CPUSchedulingPriority=¶

Sets the CPU scheduling priority for executed + processes. The available priority range depends on the + selected CPU scheduling policy (see above). For real-time + scheduling policies an integer between 1 (lowest priority) and + 99 (highest priority) can be used. See + sched_setscheduler(2) + for details.

CPUSchedulingResetOnFork=¶

Takes a boolean argument. If true, elevated + CPU scheduling priorities and policies will be reset when the + executed processes fork, and can hence not leak into child + processes. See + sched_setscheduler(2) + for details. Defaults to false.

CPUAffinity=¶

Controls the CPU affinity of the executed + processes. Takes a space-separated list of CPU indices. This + option may be specified more than once in which case the + specified CPU affinity masks are merged. If the empty string + is assigned, the mask is reset, all assignments prior to this + will have no effect. See + sched_setaffinity(2) + for details.

UMask=¶

Controls the file mode creation mask. Takes an + access mode in octal notation. See + umask(2) + for details. Defaults to 0022.

Environment=¶

Sets environment variables for executed + processes. Takes a space-separated list of variable + assignments. This option may be specified more than once in + which case all listed variables will be set. If the same + variable is set twice, the later setting will override the + earlier setting. If the empty string is assigned to this + option, the list of environment variables is reset, all prior + assignments have no effect. Variable expansion is not + performed inside the strings, however, specifier expansion is + possible. The $ character has no special meaning. If you need + to assign a value containing spaces to a variable, use double + quotes (") for the assignment.

Example: +

Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"

+ gives three variables "VAR1", + "VAR2", "VAR3" + with the values "word1 word2", + "word3", "$word 5 6". +

+ See + environ(7) + for details about environment variables.

EnvironmentFile=¶

Similar to Environment= but + reads the environment variables from a text file. The text + file should contain new-line-separated variable assignments. + Empty lines and lines starting with ; or # will be ignored, + which may be used for commenting. A line ending with a + backslash will be concatenated with the following one, + allowing multiline variable definitions. The parser strips + leading and trailing whitespace from the values of + assignments, unless you use double quotes (").

The argument passed should be an absolute filename or + wildcard expression, optionally prefixed with + "-", which indicates that if the file does + not exist, it will not be read and no error or warning message + is logged. This option may be specified more than once in + which case all specified files are read. If the empty string + is assigned to this option, the list of file to read is reset, + all prior assignments have no effect.

The files listed with this directive will be read + shortly before the process is executed (more specifically, + after all processes from a previous unit state terminated. + This means you can generate these files in one unit state, and + read it with this option in the next). Settings from these + files override settings made with + Environment=. If the same variable is set + twice from these files, the files will be read in the order + they are specified and the later setting will override the + earlier setting.

StandardInput=¶

Controls where file descriptor 0 (STDIN) of + the executed processes is connected to. Takes one of + null, + tty, + tty-force, + tty-fail or + socket.

If null is selected, standard input + will be connected to /dev/null, i.e. all + read attempts by the process will result in immediate + EOF.

If tty is selected, standard input is + connected to a TTY (as configured by + TTYPath=, see below) and the executed + process becomes the controlling process of the terminal. If + the terminal is already being controlled by another process, + the executed process waits until the current controlling + process releases the terminal.

tty-force is similar to + tty, but the executed process is forcefully + and immediately made the controlling process of the terminal, + potentially removing previous controlling processes from the + terminal.

tty-fail is similar to + tty but if the terminal already has a + controlling process start-up of the executed process + fails.

The socket option is only valid in + socket-activated services, and only when the socket + configuration file (see + systemd.socket(5) + for details) specifies a single socket only. If this option is + set, standard input will be connected to the socket the + service was activated from, which is primarily useful for + compatibility with daemons designed for use with the + traditional + inetd(8) + daemon.

This setting defaults to + null.

StandardOutput=¶

Controls where file descriptor 1 (STDOUT) of + the executed processes is connected to. Takes one of + inherit, + null, + tty, + journal, + syslog, + kmsg, + journal+console, + syslog+console, + kmsg+console or + socket.

inherit duplicates the file descriptor + of standard input for standard output.

null connects standard output to + /dev/null, i.e. everything written to it + will be lost.

tty connects standard output to a tty + (as configured via TTYPath=, see below). If + the TTY is used for output only, the executed process will not + become the controlling process of the terminal, and will not + fail or wait for other processes to release the + terminal.

journal connects standard output with + the journal which is accessible via + journalctl(1). + Note that everything that is written to syslog or kmsg (see + below) is implicitly stored in the journal as well, the + specific two options listed below are hence supersets of this + one.

syslog connects standard output to the + syslog(3) + system syslog service, in addition to the journal. Note that + the journal daemon is usually configured to forward everything + it receives to syslog anyway, in which case this option is no + different from journal.

kmsg connects standard output with the + kernel log buffer which is accessible via + dmesg(1), + in addition to the journal. The journal daemon might be + configured to send all logs to kmsg anyway, in which case this + option is no different from journal.

journal+console, + syslog+console and + kmsg+console work in a similar way as the + three options above but copy the output to the system console + as well.

socket connects standard output to a + socket acquired via socket activation. The semantics are + similar to the same option of + StandardInput=.

This setting defaults to the value set with + DefaultStandardOutput= in + systemd-system.conf(5), + which defaults to journal.

StandardError=¶

Controls where file descriptor 2 (STDERR) of + the executed processes is connected to. The available options + are identical to those of StandardOutput=, + with one exception: if set to inherit the + file descriptor used for standard output is duplicated for + standard error. This setting defaults to the value set with + DefaultStandardError= in + systemd-system.conf(5), + which defaults to inherit.

TTYPath=¶

Sets the terminal device node to use if + standard input, output, or error are connected to a TTY (see + above). Defaults to + /dev/console.

TTYReset=¶

Reset the terminal device specified with + TTYPath= before and after execution. + Defaults to "no".

TTYVHangup=¶

Disconnect all clients which have opened the + terminal device specified with TTYPath= + before and after execution. Defaults to + "no".

TTYVTDisallocate=¶

If the terminal device specified with + TTYPath= is a virtual console terminal, try + to deallocate the TTY before and after execution. This ensures + that the screen and scrollback buffer is cleared. Defaults to + "no".

SyslogIdentifier=¶

Sets the process name to prefix log lines sent + to the logging system or the kernel log buffer with. If not + set, defaults to the process name of the executed process. + This option is only useful when + StandardOutput= or + StandardError= are set to + syslog, journal or + kmsg (or to the same settings in combination + with +console).

SyslogFacility=¶

Sets the syslog facility to use when logging + to syslog. One of kern, + user, mail, + daemon, auth, + syslog, lpr, + news, uucp, + cron, authpriv, + ftp, local0, + local1, local2, + local3, local4, + local5, local6 or + local7. See + syslog(3) + for details. This option is only useful when + StandardOutput= or + StandardError= are set to + syslog. Defaults to + daemon.

SyslogLevel=¶

Default syslog level to use when logging to + syslog or the kernel log buffer. One of + emerg, + alert, + crit, + err, + warning, + notice, + info, + debug. See + syslog(3) + for details. This option is only useful when + StandardOutput= or + StandardError= are set to + syslog or kmsg. Note that + individual lines output by the daemon might be prefixed with a + different log level which can be used to override the default + log level specified here. The interpretation of these prefixes + may be disabled with SyslogLevelPrefix=, + see below. For details see + sd-daemon(3). - Defaults to - info.

SyslogLevelPrefix=¶

Takes a boolean - argument. If true and - StandardOutput= or - StandardError= are - set to syslog, - kmsg or - journal, log lines - written by the executed process that - are prefixed with a log level will be - passed on to syslog with this log - level set but the prefix removed. If - set to false, the interpretation of - these prefixes is disabled and the - logged lines are passed on as-is. For - details about this prefixing see - sd-daemon(3). - Defaults to true.

TimerSlackNSec=¶

Sets the timer slack - in nanoseconds for the executed - processes. The timer slack controls - the accuracy of wake-ups triggered by - timers. See - prctl(2) - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too.

LimitCPU=, LimitFSIZE=, LimitDATA=, LimitSTACK=, LimitCORE=, LimitRSS=, LimitNOFILE=, LimitAS=, LimitNPROC=, LimitMEMLOCK=, LimitLOCKS=, LimitSIGPENDING=, LimitMSGQUEUE=, LimitNICE=, LimitRTPRIO=, LimitRTTIME=¶

These settings set both - soft and hard limits of various resources for - executed processes. See - setrlimit(2) - for details. Use the string - infinity to - configure no limit on a specific - resource.

PAMName=¶

Sets the PAM service - name to set up a session as. If set, - the executed process will be - registered as a PAM session under the - specified service name. This is only - useful in conjunction with the - User= setting. If - not set, no PAM session will be opened - for the executed processes. See - pam(8) - for details.

CapabilityBoundingSet=¶

Controls which - capabilities to include in the - capability bounding set for the - executed process. See - capabilities(7) - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name(3), - e.g. CAP_SYS_ADMIN, - CAP_DAC_OVERRIDE, - CAP_SYS_PTRACE. - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with "~", - all but the listed capabilities will - be included, the effect of the - assignment inverted. Note that this - option also affects the respective - capabilities in the effective, - permitted and inheritable capability - sets, on top of what - Capabilities= - does. If this option is not used, the - capability bounding set is not - modified on process execution, hence - no limits on the capabilities of the - process are enforced. This option may - appear more than once in which case - the bounding sets are merged. If the - empty string is assigned to this - option, the bounding set is reset to - the empty capability set, and all - prior settings have no effect. If set - to "~" (without any - further argument), the bounding set is - reset to the full set of available - capabilities, also undoing any - previous settings.

SecureBits=¶

Controls the secure - bits set for the executed process. - Takes a space-separated combination of - options from the following list: - keep-caps, - keep-caps-locked, - no-setuid-fixup, - no-setuid-fixup-locked, - noroot, and - noroot-locked. This - option may appear more than once in - which case the secure bits are ORed. - If the empty string is assigned to - this option, the bits are reset to 0. - See capabilities(7) - for details.

Capabilities=¶

Controls the - capabilities(7) - set for the executed process. Take a - capability string describing the - effective, permitted and inherited - capability sets as documented in - cap_from_text(3). - Note that these capability sets are - usually influenced (and filtered) by the capabilities - attached to the executed file. Due to - that - CapabilityBoundingSet= - is probably a much more useful - setting.

ReadWriteDirectories=, ReadOnlyDirectories=, InaccessibleDirectories=¶

Sets up a new file - system namespace for executed - processes. These options may be used - to limit access a process might have - to the main file system - hierarchy. Each setting takes a - space-separated list of absolute - directory paths. Directories listed in - ReadWriteDirectories= - are accessible from within the - namespace with the same access rights - as from outside. Directories listed in - ReadOnlyDirectories= - are accessible for reading only, - writing will be refused even if the - usual file access controls would - permit this. Directories listed in - InaccessibleDirectories= - will be made inaccessible for - processes inside the namespace. Note - that restricting access with these - options does not extend to submounts - of a directory that are created later - on. These options may be specified - more than once in which case all - directories listed will have limited - access from within the namespace. If - the empty string is assigned to this - option, the specific list is reset, - and all prior assignments have no - effect.

Paths in - ReadOnlyDirectories= - and - InaccessibleDirectories= - may be prefixed with - "-", in which case - they will be ignored when they do not - exist. Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to - install mount points in the main mount - namespace.

PrivateTmp=¶

Takes a boolean - argument. If true, sets up a new file - system namespace for the executed - processes and mounts private - /tmp and - /var/tmp - directories inside it that is not - shared by processes outside of the - namespace. This is useful to secure - access to temporary files of the - process, but makes sharing between - processes via - /tmp or - /var/tmp - impossible. If this is enabled, all - temporary files created by a service - in these directories will be removed - after the service is stopped. Defaults - to false. It is possible to run two or - more units within the same private - /tmp and - /var/tmp - namespace by using the - JoinsNamespaceOf= - directive, see - systemd.unit(5) - for details. Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to install - mount points in the main mount - namespace.

PrivateDevices=¶

Takes a boolean - argument. If true, sets up a new /dev - namespace for the executed processes - and only adds API pseudo devices such - as /dev/null, - /dev/zero or - /dev/random (as - well as the pseudo TTY subsystem) to - it, but no physical devices such as - /dev/sda. This is - useful to securely turn off physical - device access by the executed - process. Defaults to false. Enabling - this option will also remove - CAP_MKNOD from - the capability bounding set for the - unit (see above), and set - DevicePolicy=closed - (see - systemd.resource-control(5) - for details). Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to - install mount points in the main mount - namespace.

PrivateNetwork=¶

Takes a boolean - argument. If true, sets up a new - network namespace for the executed - processes and configures only the - loopback network device - "lo" inside it. No - other network devices will be - available to the executed process. - This is useful to securely turn off - network access by the executed - process. Defaults to false. It is - possible to run two or more units - within the same private network - namespace by using the - JoinsNamespaceOf= - directive, see - systemd.unit(5) - for details. Note that this option - will disconnect all socket families - from the host, this includes - AF_NETLINK and AF_UNIX. The latter has - the effect that AF_UNIX sockets in the - abstract socket namespace will become - unavailable to the processes (however, - those located in the file system will - continue to be - accessible).

ProtectSystem=¶

Takes a boolean - argument or - "full". If true, - mounts the /usr - directory read-only for processes - invoked by this unit. If set to - "full", the - /etc directory is mounted - read-only, too. This setting ensures - that any modification of the vendor - supplied operating system (and - optionally its configuration) is - prohibited for the service. It is - recommended to enable this setting for - all long-running services, unless they - are involved with system updates or - need to modify the operating system in - other ways. Note however that - processes retaining the CAP_SYS_ADMIN - capability can undo the effect of this - setting. This setting is hence - particularly useful for daemons which - have this capability removed, for - example with - CapabilityBoundingSet=. Defaults - to off.

ProtectHome=¶

Takes a boolean - argument or - "read-only". If true, - the directories - /home and - /run/user are - made inaccessible and empty for - processes invoked by this unit. If set - to "read-only", the - two directories are made read-only - instead. It is recommended to enable - this setting for all long-running - services (in particular network-facing - ones), to ensure they cannot get access - to private user data, unless the - services actually require access to - the user's private data. Note however - that processes retaining the - CAP_SYS_ADMIN capability can undo the - effect of this setting. This setting - is hence particularly useful for - daemons which have this capability - removed, for example with - CapabilityBoundingSet=. Defaults - to off.

MountFlags=¶

Takes a mount - propagation flag: - shared, - slave or - private, which - control whether mounts in the file - system namespace set up for this - unit's processes will receive or - propagate mounts or unmounts. See - mount(2) - for details. Defaults to - shared. Use - shared to ensure that - mounts and unmounts are propagated - from the host to the container and - vice versa. Use slave - to run processes so that none of their - mounts and unmounts will propagate to - the host. Use private - to also ensure that no mounts and - unmounts from the host will propagate - into the unit processes' - namespace. Note that - slave means that file - systems mounted on the host might stay - mounted continuously in the unit's - namespace, and thus keep the device - busy. Note that the file system - namespace related options - (PrivateTmp=, - PrivateDevices=, - ProtectSystem=, - ProtectHome=, - ReadOnlyDirectories=, - InaccessibleDirectories= - and - ReadWriteDirectories=) - require that mount and unmount - propagation from the unit's file - system namespace is disabled, and - hence downgrade - shared to - slave. -

UtmpIdentifier=¶

Takes a four - character identifier string for an - utmp/wtmp entry for this service. This - should only be set for services such - as getty - implementations where utmp/wtmp - entries must be created and cleared - before and after execution. If the - configured string is longer than four - characters, it is truncated and the - terminal four characters are - used. This setting interprets %I style - string replacements. This setting is - unset by default, i.e. no utmp/wtmp - entries are created or cleaned up for - this service.

SELinuxContext=¶

Set the SELinux - security context of the executed - process. If set, this will override - the automated domain - transition. However, the policy still - needs to authorize the transition. This - directive is ignored if SELinux is - disabled. If prefixed by - "-", all errors will - be ignored. See - setexeccon(3) - for details.

AppArmorProfile=¶

Takes a profile name as argument. - The process executed by the unit will switch to - this profile when started. Profiles must already - be loaded in the kernel, or the unit will fail. - This result in a non operation if AppArmor is not - enabled. If prefixed by "-", all errors - will be ignored. -

SmackProcessLabel=¶

Takes a - SMACK64 security - label as argument. The process - executed by the unit will be started - under this label and SMACK will decide - whether the processes is allowed to - run or not based on it. The process - will continue to run under the label - specified here unless the executable - has its own - SMACK64EXEC label, in - which case the process will transition - to run under that label. When not - specified, the label that systemd is - running under is used. This directive - is ignored if SMACK is - disabled.

The value may be prefixed by - "-", in which case - all errors will be ignored. An empty - value may be specified to unset - previous assignments.

IgnoreSIGPIPE=¶

Takes a boolean - argument. If true, causes SIGPIPE to be - ignored in the executed - process. Defaults to true because - SIGPIPE generally is useful only in - shell pipelines.

NoNewPrivileges=¶

Takes a boolean - argument. If true, ensures that the - service process and all its children - can never gain new privileges. This - option is more powerful than the respective - secure bits flags (see above), as it - also prohibits UID changes of any - kind. This is the simplest, most - effective way to ensure that a process - and its children can never elevate - privileges again.

SystemCallFilter=¶

Takes a - space-separated list of system call - names. If this setting is used, all - system calls executed by the unit - processes except for the listed ones - will result in immediate process - termination with the - SIGSYS signal - (whitelisting). If the first character - of the list is "~", - the effect is inverted: only the - listed system calls will result in - immediate process termination - (blacklisting). If running in user - mode and this option is used, - NoNewPrivileges=yes - is implied. This feature makes use of the - Secure Computing Mode 2 interfaces of - the kernel ('seccomp filtering') and - is useful for enforcing a minimal - sandboxing environment. Note that the - execve, - rt_sigreturn, - sigreturn, - exit_group, - exit system calls - are implicitly whitelisted and do not - need to be listed explicitly. This - option may be specified more than once - in which case the filter masks are - merged. If the empty string is - assigned, the filter is reset, all - prior assignments will have no - effect.

If you specify both types of - this option (i.e. whitelisting and - blacklisting), the first encountered - will take precedence and will dictate - the default action (termination or - approval of a system call). Then the - next occurrences of this option will - add or delete the listed system calls - from the set of the filtered system - calls, depending of its type and the - default action. (For example, if you have started - with a whitelisting of - read and - write, and right - after it add a blacklisting of - write, then - write will be - removed from the set.) -

SystemCallErrorNumber=¶

Takes an - "errno" error number - name to return when the system call - filter configured with - SystemCallFilter= - is triggered, instead of terminating - the process immediately. Takes an - error name such as - EPERM, - EACCES or - EUCLEAN. When this - setting is not used, or when the empty - string is assigned, the process will be - terminated immediately when the filter - is triggered.

SystemCallArchitectures=¶

Takes a space - separated list of architecture - identifiers to include in the system - call filter. The known architecture - identifiers are - x86, - x86-64, - x32, - arm as well as - the special identifier - native. Only - system calls of the specified - architectures will be permitted to - processes of this unit. This is an - effective way to disable compatibility - with non-native architectures for - processes, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. The special - native identifier - implicitly maps to the native - architecture of the system (or more - strictly: to the architecture the - system manager is compiled for). If - running in user mode and this option - is used, - NoNewPrivileges=yes - is implied. Note that setting this - option to a non-empty list implies - that native is - included too. By default, this option - is set to the empty list, i.e. no - architecture system call filtering is - applied.

RestrictAddressFamilies=¶

Restricts the set of - socket address families accessible to - the processes of this unit. Takes a - space-separated list of address family - names to whitelist, such as - AF_UNIX, - AF_INET or - AF_INET6. When - prefixed with ~ - the listed address families will be - applied as blacklist, otherwise as - whitelist. Note that this restricts - access to the - socket(2) - system call only. Sockets passed into - the process by other means (for - example, by using socket activation - with socket units, see - systemd.socket(5)) - are unaffected. Also, sockets created - with socketpair() - (which creates connected AF_UNIX - sockets only) are unaffected. Note - that this option has no effect on - 32-bit x86 and is ignored (but works - correctly on x86-64). If running in user - mode and this option is used, - NoNewPrivileges=yes - is implied. By default, no - restriction applies, all address - families are accessible to - processes. If assigned the empty - string, any previous list changes are - undone.

Use this option to limit - exposure of processes to remote - systems, in particular via exotic - network protocols. Note that in most - cases, the local - AF_UNIX address - family should be included in the - configured whitelist as it is - frequently used for local - communication, including for - syslog(2) - logging.

Personality=¶

Controls which - kernel architecture - uname(2) - shall report, when invoked by unit - processes. Takes one of - x86 and - x86-64. This is - useful when running 32-bit services on - a 64-bit host system. If not specified, - the personality is left unmodified and - thus reflects the personality of the - host system's - kernel.

RuntimeDirectory=, RuntimeDirectoryMode=¶

Takes a list of - directory names. If set, one or more - directories by the specified names - will be created below - /run (for system - services) or below - $XDG_RUNTIME_DIR - (for user services) when the unit is - started, and removed when the unit is - stopped. The directories will have the - access mode specified in - RuntimeDirectoryMode=, - and will be owned by the user and - group specified in - User= and - Group=. Use this to - manage one or more runtime directories - of the unit and bind their lifetime to - the daemon runtime. The specified - directory names must be relative, and - may not include a - "/", i.e. must refer - to simple directories to create or - remove. This is particularly useful - for unprivileged daemons that cannot - create runtime directories in - /run due to lack - of privileges, and to make sure the - runtime directory is cleaned up - automatically after use. For runtime - directories that require more complex - or different configuration or lifetime - guarantees, please consider using - tmpfiles.d(5).

Environment variables in spawned processes¶

Processes started by the system are executed in - a clean environment in which select variables - listed below are set. System processes started by systemd - do not inherit variables from PID 1, but processes - started by user systemd instances inherit all - environment variables from the user systemd instance. -

$PATH¶

Colon-separated list - of directories to use when launching - executables. Systemd uses a fixed - value of - /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. -

$LANG¶

Locale. Can be set in - locale.conf(5) - or on the kernel command line (see - systemd(1) - and - kernel-command-line(7)). -

$USER, $LOGNAME, $HOME, $SHELL¶

User name (twice), home - directory, and the login shell. - The variables are set for the units that - have User= set, - which includes user - systemd instances. - See - passwd(5). -

$XDG_RUNTIME_DIR¶

The directory for volatile - state. Set for the user systemd - instance, and also in user sessions. - See - pam_systemd(8). -

$XDG_SESSION_ID, $XDG_SEAT, $XDG_VTNR¶

The identifier of the - session, the seat name, and - virtual terminal of the session. Set - by - pam_systemd(8) - for login sessions. - $XDG_SEAT and - $XDG_VTNR will - only be set when attached to a seat and a - tty.

$MAINPID¶

The PID of the units - main process if it is known. This is - only set for control processes as - invoked by - ExecReload= and - similar.

$MANAGERPID¶

The PID of the user - systemd instance, - set for processes spawned by it. -

$LISTEN_FDS, $LISTEN_PID¶

Information about file - descriptors passed to a service for - socket activation. See - sd_listen_fds(3). -

$TERM¶

Terminal type, set - only for units connected to a terminal - (StandardInput=tty, - StandardOutput=tty, - or - StandardError=tty). - See - termcap(5). -

Additional variables may be configured by the - following means: for processes spawned in specific - units, use the Environment= and - EnvironmentFile= options above; to - specify variables globally, use - DefaultEnvironment= (see - systemd-system.conf(5)) - or the kernel option - systemd.setenv= (see - systemd(1)). Additional - variables may also be set through PAM, - cf. pam_env(8).

+ Defaults to + info.

SyslogLevelPrefix=¶

Takes a boolean argument. If true and + StandardOutput= or + StandardError= are set to + syslog, kmsg or + journal, log lines written by the executed + process that are prefixed with a log level will be passed on + to syslog with this log level set but the prefix removed. If + set to false, the interpretation of these prefixes is disabled + and the logged lines are passed on as-is. For details about + this prefixing see + sd-daemon(3). + Defaults to true.

TimerSlackNSec=¶

Sets the timer slack in nanoseconds for the + executed processes. The timer slack controls the accuracy of + wake-ups triggered by timers. See + prctl(2) + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too.

LimitCPU=, LimitFSIZE=, LimitDATA=, LimitSTACK=, LimitCORE=, LimitRSS=, LimitNOFILE=, LimitAS=, LimitNPROC=, LimitMEMLOCK=, LimitLOCKS=, LimitSIGPENDING=, LimitMSGQUEUE=, LimitNICE=, LimitRTPRIO=, LimitRTTIME=¶

These settings set both soft and hard limits + of various resources for executed processes. See + setrlimit(2) + for details. Use the string infinity to + configure no limit on a specific resource.

PAMName=¶

Sets the PAM service name to set up a session + as. If set, the executed process will be registered as a PAM + session under the specified service name. This is only useful + in conjunction with the User= setting. If + not set, no PAM session will be opened for the executed + processes. See + pam(8) + for details.

CapabilityBoundingSet=¶

Controls which capabilities to include in the + capability bounding set for the executed process. See + capabilities(7) + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name(3), + e.g. CAP_SYS_ADMIN, + CAP_DAC_OVERRIDE, + CAP_SYS_PTRACE. Capabilities listed will + be included in the bounding set, all others are removed. If + the list of capabilities is prefixed with + "~", all but the listed capabilities will be + included, the effect of the assignment inverted. Note that + this option also affects the respective capabilities in the + effective, permitted and inheritable capability sets, on top + of what Capabilities= does. If this option + is not used, the capability bounding set is not modified on + process execution, hence no limits on the capabilities of the + process are enforced. This option may appear more than once in + which case the bounding sets are merged. If the empty string + is assigned to this option, the bounding set is reset to the + empty capability set, and all prior settings have no effect. + If set to "~" (without any further argument), + the bounding set is reset to the full set of available + capabilities, also undoing any previous + settings.

SecureBits=¶

Controls the secure bits set for the executed + process. Takes a space-separated combination of options from + the following list: + keep-caps, + keep-caps-locked, + no-setuid-fixup, + no-setuid-fixup-locked, + noroot, and + noroot-locked. + This option may appear more than once in which case the secure + bits are ORed. If the empty string is assigned to this option, + the bits are reset to 0. See + capabilities(7) + for details.

Capabilities=¶

Controls the + capabilities(7) + set for the executed process. Take a capability string + describing the effective, permitted and inherited capability + sets as documented in + cap_from_text(3). + Note that these capability sets are usually influenced (and + filtered) by the capabilities attached to the executed file. + Due to that CapabilityBoundingSet= is + probably a much more useful setting.

ReadWriteDirectories=, ReadOnlyDirectories=, InaccessibleDirectories=¶

Sets up a new file system namespace for + executed processes. These options may be used to limit access + a process might have to the main file system hierarchy. Each + setting takes a space-separated list of absolute directory + paths. Directories listed in + ReadWriteDirectories= are accessible from + within the namespace with the same access rights as from + outside. Directories listed in + ReadOnlyDirectories= are accessible for + reading only, writing will be refused even if the usual file + access controls would permit this. Directories listed in + InaccessibleDirectories= will be made + inaccessible for processes inside the namespace. Note that + restricting access with these options does not extend to + submounts of a directory that are created later on. These + options may be specified more than once in which case all + directories listed will have limited access from within the + namespace. If the empty string is assigned to this option, the + specific list is reset, and all prior assignments have no + effect.

Paths in + ReadOnlyDirectories= + and + InaccessibleDirectories= + may be prefixed with + "-", in which case + they will be ignored when they do not + exist. Note that using this + setting will disconnect propagation of + mounts from the service to the host + (propagation in the opposite direction + continues to work). This means that + this setting may not be used for + services which shall be able to + install mount points in the main mount + namespace.

PrivateTmp=¶

Takes a boolean argument. If true, sets up a + new file system namespace for the executed processes and + mounts private /tmp and + /var/tmp directories inside it that is + not shared by processes outside of the namespace. This is + useful to secure access to temporary files of the process, but + makes sharing between processes via /tmp + or /var/tmp impossible. If this is + enabled, all temporary files created by a service in these + directories will be removed after the service is stopped. + Defaults to false. It is possible to run two or more units + within the same private /tmp and + /var/tmp namespace by using the + JoinsNamespaceOf= directive, see + systemd.unit(5) + for details. Note that using this setting will disconnect + propagation of mounts from the service to the host + (propagation in the opposite direction continues to work). + This means that this setting may not be used for services + which shall be able to install mount points in the main mount + namespace.

PrivateDevices=¶

Takes a boolean argument. If true, sets up a + new /dev namespace for the executed processes and only adds + API pseudo devices such as /dev/null, + /dev/zero or + /dev/random (as well as the pseudo TTY + subsystem) to it, but no physical devices such as + /dev/sda. This is useful to securely turn + off physical device access by the executed process. Defaults + to false. Enabling this option will also remove + CAP_MKNOD from the capability bounding + set for the unit (see above), and set + DevicePolicy=closed (see + systemd.resource-control(5) + for details). Note that using this setting will disconnect + propagation of mounts from the service to the host + (propagation in the opposite direction continues to work). + This means that this setting may not be used for services + which shall be able to install mount points in the main mount + namespace.

PrivateNetwork=¶

Takes a boolean argument. If true, sets up a + new network namespace for the executed processes and + configures only the loopback network device + "lo" inside it. No other network devices will + be available to the executed process. This is useful to + securely turn off network access by the executed process. + Defaults to false. It is possible to run two or more units + within the same private network namespace by using the + JoinsNamespaceOf= directive, see + systemd.unit(5) + for details. Note that this option will disconnect all socket + families from the host, this includes AF_NETLINK and AF_UNIX. + The latter has the effect that AF_UNIX sockets in the abstract + socket namespace will become unavailable to the processes + (however, those located in the file system will continue to be + accessible).

ProtectSystem=¶

Takes a boolean argument or + "full". If true, mounts the + /usr and /boot + directories read-only for processes invoked by this unit. If + set to "full", the /etc + directory is mounted read-only, too. This setting ensures that + any modification of the vendor supplied operating system (and + optionally its configuration) is prohibited for the service. + It is recommended to enable this setting for all long-running + services, unless they are involved with system updates or need + to modify the operating system in other ways. Note however + that processes retaining the CAP_SYS_ADMIN capability can undo + the effect of this setting. This setting is hence particularly + useful for daemons which have this capability removed, for + example with CapabilityBoundingSet=. + Defaults to off.

ProtectHome=¶

Takes a boolean argument or + "read-only". If true, the directories + /home and /run/user + are made inaccessible and empty for processes invoked by this + unit. If set to "read-only", the two + directories are made read-only instead. It is recommended to + enable this setting for all long-running services (in + particular network-facing ones), to ensure they cannot get + access to private user data, unless the services actually + require access to the user's private data. Note however that + processes retaining the CAP_SYS_ADMIN capability can undo the + effect of this setting. This setting is hence particularly + useful for daemons which have this capability removed, for + example with CapabilityBoundingSet=. + Defaults to off.

MountFlags=¶

Takes a mount propagation flag: + shared, slave or + private, which control whether mounts in the + file system namespace set up for this unit's processes will + receive or propagate mounts or unmounts. See + mount(2) + for details. Defaults to shared. Use + shared to ensure that mounts and unmounts are + propagated from the host to the container and vice versa. Use + slave to run processes so that none of their + mounts and unmounts will propagate to the host. Use + private to also ensure that no mounts and + unmounts from the host will propagate into the unit processes' + namespace. Note that slave means that file + systems mounted on the host might stay mounted continuously in + the unit's namespace, and thus keep the device busy. Note that + the file system namespace related options + (PrivateTmp=, + PrivateDevices=, + ProtectSystem=, + ProtectHome=, + ReadOnlyDirectories=, + InaccessibleDirectories= and + ReadWriteDirectories=) require that mount + and unmount propagation from the unit's file system namespace + is disabled, and hence downgrade shared to + slave.

UtmpIdentifier=¶

Takes a four character identifier string for + an utmp/wtmp entry for this service. This should only be set + for services such as getty implementations + where utmp/wtmp entries must be created and cleared before and + after execution. If the configured string is longer than four + characters, it is truncated and the terminal four characters + are used. This setting interprets %I style string + replacements. This setting is unset by default, i.e. no + utmp/wtmp entries are created or cleaned up for this + service.

SELinuxContext=¶

Set the SELinux security context of the + executed process. If set, this will override the automated + domain transition. However, the policy still needs to + authorize the transition. This directive is ignored if SELinux + is disabled. If prefixed by "-", all errors + will be ignored. See + setexeccon(3) + for details.

AppArmorProfile=¶

Takes a profile name as argument. The process + executed by the unit will switch to this profile when started. + Profiles must already be loaded in the kernel, or the unit + will fail. This result in a non operation if AppArmor is not + enabled. If prefixed by "-", all errors will + be ignored.

SmackProcessLabel=¶

Takes a SMACK64 security + label as argument. The process executed by the unit will be + started under this label and SMACK will decide whether the + processes is allowed to run or not based on it. The process + will continue to run under the label specified here unless the + executable has its own SMACK64EXEC label, in + which case the process will transition to run under that + label. When not specified, the label that systemd is running + under is used. This directive is ignored if SMACK is + disabled.

The value may be prefixed by "-", in + which case all errors will be ignored. An empty value may be + specified to unset previous assignments.

IgnoreSIGPIPE=¶

Takes a boolean argument. If true, causes + SIGPIPE to be ignored in the executed + process. Defaults to true because SIGPIPE + generally is useful only in shell pipelines.

NoNewPrivileges=¶

Takes a boolean argument. If true, ensures + that the service process and all its children can never gain + new privileges. This option is more powerful than the + respective secure bits flags (see above), as it also prohibits + UID changes of any kind. This is the simplest, most effective + way to ensure that a process and its children can never + elevate privileges again.

SystemCallFilter=¶

Takes a space-separated list of system call + names. If this setting is used, all system calls executed by + the unit processes except for the listed ones will result in + immediate process termination with the + SIGSYS signal (whitelisting). If the + first character of the list is "~", the + effect is inverted: only the listed system calls will result + in immediate process termination (blacklisting). If running in + user mode and this option is used, + NoNewPrivileges=yes is implied. This + feature makes use of the Secure Computing Mode 2 interfaces of + the kernel ('seccomp filtering') and is useful for enforcing a + minimal sandboxing environment. Note that the + execve, + rt_sigreturn, + sigreturn, + exit_group, exit + system calls are implicitly whitelisted and do not need to be + listed explicitly. This option may be specified more than once + in which case the filter masks are merged. If the empty string + is assigned, the filter is reset, all prior assignments will + have no effect.

If you specify both types of this option (i.e. + whitelisting and blacklisting), the first encountered will + take precedence and will dictate the default action + (termination or approval of a system call). Then the next + occurrences of this option will add or delete the listed + system calls from the set of the filtered system calls, + depending of its type and the default action. (For example, if + you have started with a whitelisting of + read and write, and + right after it add a blacklisting of + write, then write + will be removed from the set.)

SystemCallErrorNumber=¶

Takes an "errno" error number + name to return when the system call filter configured with + SystemCallFilter= is triggered, instead of + terminating the process immediately. Takes an error name such + as EPERM, EACCES or + EUCLEAN. When this setting is not used, + or when the empty string is assigned, the process will be + terminated immediately when the filter is + triggered.

SystemCallArchitectures=¶

Takes a space separated list of architecture + identifiers to include in the system call filter. The known + architecture identifiers are x86, + x86-64, x32, + arm as well as the special identifier + native. Only system calls of the + specified architectures will be permitted to processes of this + unit. This is an effective way to disable compatibility with + non-native architectures for processes, for example to + prohibit execution of 32-bit x86 binaries on 64-bit x86-64 + systems. The special native identifier + implicitly maps to the native architecture of the system (or + more strictly: to the architecture the system manager is + compiled for). If running in user mode and this option is + used, NoNewPrivileges=yes is implied. Note + that setting this option to a non-empty list implies that + native is included too. By default, this + option is set to the empty list, i.e. no architecture system + call filtering is applied.

RestrictAddressFamilies=¶

Restricts the set of socket address families + accessible to the processes of this unit. Takes a + space-separated list of address family names to whitelist, + such as + AF_UNIX, + AF_INET or + AF_INET6. When + prefixed with ~ the listed address + families will be applied as blacklist, otherwise as whitelist. + Note that this restricts access to the + socket(2) + system call only. Sockets passed into the process by other + means (for example, by using socket activation with socket + units, see + systemd.socket(5)) + are unaffected. Also, sockets created with + socketpair() (which creates connected + AF_UNIX sockets only) are unaffected. Note that this option + has no effect on 32-bit x86 and is ignored (but works + correctly on x86-64). If running in user mode and this option + is used, NoNewPrivileges=yes is implied. By + default, no restriction applies, all address families are + accessible to processes. If assigned the empty string, any + previous list changes are undone.

Use this option to limit exposure of processes to remote + systems, in particular via exotic network protocols. Note that + in most cases, the local AF_UNIX address + family should be included in the configured whitelist as it is + frequently used for local communication, including for + syslog(2) + logging.

Personality=¶

Controls which kernel architecture + uname(2) + shall report, when invoked by unit processes. Takes one of + x86 and x86-64. This + is useful when running 32-bit services on a 64-bit host + system. If not specified, the personality is left unmodified + and thus reflects the personality of the host system's + kernel.

RuntimeDirectory=, RuntimeDirectoryMode=¶

Takes a list of directory names. If set, one + or more directories by the specified names will be created + below /run (for system services) or below + $XDG_RUNTIME_DIR (for user services) when + the unit is started, and removed when the unit is stopped. The + directories will have the access mode specified in + RuntimeDirectoryMode=, and will be owned by + the user and group specified in User= and + Group=. Use this to manage one or more + runtime directories of the unit and bind their lifetime to the + daemon runtime. The specified directory names must be + relative, and may not include a "/", i.e. + must refer to simple directories to create or remove. This is + particularly useful for unprivileged daemons that cannot + create runtime directories in /run due to + lack of privileges, and to make sure the runtime directory is + cleaned up automatically after use. For runtime directories + that require more complex or different configuration or + lifetime guarantees, please consider using + tmpfiles.d(5).

Environment variables in spawned processes¶

Processes started by the system are executed in a clean + environment in which select variables listed below are set. System + processes started by systemd do not inherit variables from PID 1, + but processes started by user systemd instances inherit all + environment variables from the user systemd instance. +

$PATH¶

Colon-separated list of directories to use + when launching executables. Systemd uses a fixed value of + /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. +

$LANG¶

Locale. Can be set in + locale.conf(5) + or on the kernel command line (see + systemd(1) + and + kernel-command-line(7)). +

$USER, $LOGNAME, $HOME, $SHELL¶

User name (twice), home directory, and the + login shell. The variables are set for the units that have + User= set, which includes user + systemd instances. See + passwd(5). +

$XDG_RUNTIME_DIR¶

The directory for volatile state. Set for the + user systemd instance, and also in user + sessions. See + pam_systemd(8). +

$XDG_SESSION_ID, $XDG_SEAT, $XDG_VTNR¶

The identifier of the session, the seat name, + and virtual terminal of the session. Set by + pam_systemd(8) + for login sessions. $XDG_SEAT and + $XDG_VTNR will only be set when attached to + a seat and a tty.

$MAINPID¶

The PID of the units main process if it is + known. This is only set for control processes as invoked by + ExecReload= and similar.

$MANAGERPID¶

The PID of the user systemd + instance, set for processes spawned by it.

$LISTEN_FDS, $LISTEN_PID¶

Information about file descriptors passed to a + service for socket activation. See + sd_listen_fds(3). +

$TERM¶

Terminal type, set only for units connected to + a terminal (StandardInput=tty, + StandardOutput=tty, or + StandardError=tty). See + termcap(5). +

Additional variables may be configured by the following + means: for processes spawned in specific units, use the + Environment= and + EnvironmentFile= options above; to specify + variables globally, use DefaultEnvironment= + (see + systemd-system.conf(5)) + or the kernel option systemd.setenv= (see + systemd(1)). + Additional variables may also be set through PAM, + cf. pam_env(8).

diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index b338899d8..11b160e58 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -1,6 +1,5 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.exec - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.exec - 5 - - - - systemd.exec - Execution environment configuration - - - - service.service, - socket.socket, - mount.mount, - swap.swap - - - - Description - - Unit configuration files for services, sockets, - mount points, and swap devices share a subset of - configuration options which define the execution - environment of spawned processes. - - This man page lists the configuration options - shared by these four unit types. See - systemd.unit5 - for the common options of all unit configuration - files, and - systemd.service5, - systemd.socket5, - systemd.swap5, - and - systemd.mount5 - for more information on the specific unit - configuration files. The execution specific - configuration options are configured in the [Service], - [Socket], [Mount], or [Swap] sections, depending on the unit - type. - - - - Options - - - - - WorkingDirectory= - - Takes an absolute - directory path. Sets the working - directory for executed processes. If - not set, defaults to the root directory - when systemd is running as a system - instance and the respective user's - home directory if run as - user. - - - - RootDirectory= - - Takes an absolute - directory path. Sets the root - directory for executed processes, with - the - chroot2 - system call. If this is used, it must - be ensured that the process and all - its auxiliary files are available in - the chroot() - jail. - - - - User= - Group= - - Sets the Unix user - or group that the processes are executed - as, respectively. Takes a single user or group - name or ID as argument. If no group is - set, the default group of the user is - chosen. - - - - SupplementaryGroups= - - Sets the supplementary - Unix groups the processes are executed - as. This takes a space-separated list - of group names or IDs. This option may - be specified more than once in which - case all listed groups are set as - supplementary groups. When the empty - string is assigned the list of - supplementary groups is reset, and all - assignments prior to this one will - have no effect. In any way, this - option does not override, but extends - the list of supplementary groups - configured in the system group - database for the - user. - - - - Nice= - - Sets the default nice - level (scheduling priority) for - executed processes. Takes an integer - between -20 (highest priority) and 19 - (lowest priority). See - setpriority2 - for details. - - - - OOMScoreAdjust= - - Sets the adjustment - level for the Out-Of-Memory killer for - executed processes. Takes an integer - between -1000 (to disable OOM killing - for this process) and 1000 (to make - killing of this process under memory - pressure very likely). See proc.txt - for details. - - - - IOSchedulingClass= - - Sets the IO scheduling - class for executed processes. Takes an - integer between 0 and 3 or one of the - strings , - , - or - . See - ioprio_set2 - for details. - - - - IOSchedulingPriority= - - Sets the IO scheduling - priority for executed processes. Takes - an integer between 0 (highest - priority) and 7 (lowest priority). The - available priorities depend on the - selected IO scheduling class (see - above). See - ioprio_set2 - for details. - - - - CPUSchedulingPolicy= - - Sets the CPU - scheduling policy for executed - processes. Takes one of - , - , - , - or - . See - sched_setscheduler2 - for details. - - - - CPUSchedulingPriority= - - Sets the CPU - scheduling priority for executed - processes. The available priority - range depends on the selected CPU - scheduling policy (see above). For - real-time scheduling policies an - integer between 1 (lowest priority) - and 99 (highest priority) can be used. - See sched_setscheduler2 - for details. - - - - - CPUSchedulingResetOnFork= - - Takes a boolean - argument. If true, elevated CPU - scheduling priorities and policies - will be reset when the executed - processes fork, and can hence not leak - into child processes. See - sched_setscheduler2 - for details. Defaults to false. - - - - CPUAffinity= - - Controls the CPU - affinity of the executed - processes. Takes a space-separated - list of CPU indices. This option may - be specified more than once in which - case the specified CPU affinity masks - are merged. If the empty string is - assigned, the mask is reset, all - assignments prior to this will have no - effect. See - sched_setaffinity2 - for details. - - - - UMask= - - Controls the file mode - creation mask. Takes an access mode in - octal notation. See - umask2 - for details. Defaults to - 0022. - - - - Environment= - - Sets environment - variables for executed - processes. Takes a space-separated - list of variable assignments. This - option may be specified more than once - in which case all listed variables - will be set. If the same variable is - set twice, the later setting will - override the earlier setting. If the - empty string is assigned to this - option, the list of environment - variables is reset, all prior - assignments have no effect. - Variable expansion is not performed - inside the strings, however, specifier - expansion is possible. The $ character has - no special meaning. - If you need to assign a value containing spaces - to a variable, use double quotes (") - for the assignment. - - Example: - Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" - gives three variables VAR1, - VAR2, VAR3 - with the values word1 word2, - word3, $word 5 6. - - - - See - environ7 - for details about environment variables. - - - EnvironmentFile= - Similar to - Environment= but - reads the environment variables from a - text file. The text file should - contain new-line-separated variable - assignments. Empty lines and lines - starting with ; or # will be ignored, - which may be used for commenting. A line - ending with a backslash will be concatenated - with the following one, allowing multiline variable - definitions. The parser strips leading - and trailing whitespace from the values - of assignments, unless you use - double quotes ("). - - The argument passed should be an - absolute filename or wildcard - expression, optionally prefixed with - -, which indicates - that if the file does not exist, it - will not be read and no error or warning - message is logged. This option may be - specified more than once in which case - all specified files are read. If the - empty string is assigned to this - option, the list of file to read is - reset, all prior assignments have no - effect. - - The files listed with this - directive will be read shortly before - the process is executed (more - specifically, after all - processes from a previous unit state - terminated. This means you can - generate these files in one unit - state, and read it with this option in - the next). Settings from these files - override settings made with - Environment=. If - the same variable is set twice from - these files, the files will be read in - the order they are specified and the - later setting will override the - earlier setting. - - - - StandardInput= - Controls where file - descriptor 0 (STDIN) of the executed - processes is connected to. Takes one - of , - , - , - or - . - - If is - selected, standard input will be - connected to - /dev/null, - i.e. all read attempts by the process - will result in immediate EOF. - - If is - selected, standard input is connected - to a TTY (as configured by - TTYPath=, see - below) and the executed process - becomes the controlling process of the - terminal. If the terminal is already - being controlled by another process, - the executed process waits until the - current controlling process releases - the terminal. - - is similar - to , but the - executed process is forcefully and - immediately made the controlling - process of the terminal, potentially - removing previous controlling - processes from the - terminal. - - is - similar to but if - the terminal already has a controlling - process start-up of the executed - process fails. - - The - option is only valid in - socket-activated services, and only - when the socket configuration file - (see - systemd.socket5 - for details) specifies a single socket - only. If this option is set, standard - input will be connected to the socket - the service was activated from, which - is primarily useful for compatibility - with daemons designed for use with the - traditional - inetd8 - daemon. - - This setting defaults to - . - - - StandardOutput= - Controls where file - descriptor 1 (STDOUT) of the executed - processes is connected to. Takes one - of , - , - , - , - , - , - , - , - or - . - - - duplicates the file descriptor of - standard input for standard - output. - - connects - standard output to - /dev/null, - i.e. everything written to it will be - lost. - - connects - standard output to a tty (as - configured via - TTYPath=, see - below). If the TTY is used for output - only, the executed process will not - become the controlling process of the - terminal, and will not fail or wait - for other processes to release the - terminal. - - - connects standard output with the - journal which is accessible via - journalctl1. - Note that everything that is written - to syslog or kmsg (see below) is - implicitly stored in the journal as - well, the specific two options listed - below are hence supersets of this - one. - - connects - standard output to the syslog3 - system syslog service, in addition to - the journal. Note that the journal - daemon is usually configured to - forward everything it receives to - syslog anyway, in which case this - option is no different from - . - - connects - standard output with the kernel log - buffer which is accessible via - dmesg1, - in addition to the journal. The - journal daemon might be configured to - send all logs to kmsg anyway, in which - case this option is no different from - . - - , - and - work in - a similar way as the three options - above but copy the output to the - system console as well. - - connects - standard output to a socket acquired - via socket activation. The semantics - are similar to the same option of - StandardInput=. - - This setting defaults to the - value set with - - in - systemd-system.conf5, - which defaults to - . - - - StandardError= - Controls where file - descriptor 2 (STDERR) of the - executed processes is connected to. - The available options are identical to - those of - StandardOutput=, - with one exception: if set to - the file - descriptor used for standard output is - duplicated for standard error. This - setting defaults to the value set with - - in - systemd-system.conf5, - which defaults to - . - - - TTYPath= - Sets the terminal - device node to use if standard input, output, - or error are connected to a - TTY (see above). Defaults to - /dev/console. - - - TTYReset= - Reset the terminal - device specified with - TTYPath= before and - after execution. Defaults to - no. - - - TTYVHangup= - Disconnect all clients - which have opened the terminal device - specified with - TTYPath= - before and after execution. Defaults - to - no. - - - TTYVTDisallocate= - If the terminal - device specified with - TTYPath= is a - virtual console terminal, try to - deallocate the TTY before and after - execution. This ensures that the - screen and scrollback buffer is - cleared. Defaults to - no. - - - SyslogIdentifier= - Sets the process name - to prefix log lines sent to the - logging system or the kernel log - buffer with. If not set, defaults to - the process name of the executed - process. This option is only useful - when - StandardOutput= or - StandardError= are - set to , - or - (or to the same - settings in combination with - ). - - - SyslogFacility= - Sets the syslog - facility to use when logging to - syslog. One of , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - or - . See - syslog3 - for details. This option is only - useful when - StandardOutput= or - StandardError= are - set to . - Defaults to - . - - - SyslogLevel= - Default syslog level - to use when logging to syslog or the - kernel log buffer. One of - , - , - , - , - , - , - , - . See - syslog3 - for details. This option is only - useful when - StandardOutput= or - StandardError= are - set to or - . Note that - individual lines output by the daemon - might be prefixed with a different log - level which can be used to override - the default log level specified - here. The interpretation of these - prefixes may be disabled with - SyslogLevelPrefix=, - see below. For details see - sd-daemon3. - - Defaults to - . - - - - SyslogLevelPrefix= - Takes a boolean - argument. If true and - StandardOutput= or - StandardError= are - set to , - or - , log lines - written by the executed process that - are prefixed with a log level will be - passed on to syslog with this log - level set but the prefix removed. If - set to false, the interpretation of - these prefixes is disabled and the - logged lines are passed on as-is. For - details about this prefixing see - sd-daemon3. - Defaults to true. - - - - TimerSlackNSec= - Sets the timer slack - in nanoseconds for the executed - processes. The timer slack controls - the accuracy of wake-ups triggered by - timers. See - prctl2 - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too. - - - - LimitCPU= - LimitFSIZE= - LimitDATA= - LimitSTACK= - LimitCORE= - LimitRSS= - LimitNOFILE= - LimitAS= - LimitNPROC= - LimitMEMLOCK= - LimitLOCKS= - LimitSIGPENDING= - LimitMSGQUEUE= - LimitNICE= - LimitRTPRIO= - LimitRTTIME= - These settings set both - soft and hard limits of various resources for - executed processes. See - setrlimit2 - for details. Use the string - infinity to - configure no limit on a specific - resource. - - - Limit directives and their equivalent with ulimit - - - - - - - Directive - ulimit equivalent - - - - - LimitCPU - ulimit -t - - - LimitFSIZE - ulimit -f - - - LimitDATA - ulimit -d - - - LimitSTACK - ulimit -s - - - LimitCORE - ulimit -c - - - LimitRSS - ulimit -m - - - LimitNOFILE - ulimit -n - - - LimitAS - ulimit -v - - - LimitNPROC - ulimit -u - - - LimitMEMLOCK - ulimit -l - - - LimitLOCKS - ulimit -x - - - LimitSIGPENDING - ulimit -i - - - LimitMSGQUEUE - ulimit -q - - - LimitNICE - ulimit -e - - - LimitRTPRIO - ulimit -r - - - LimitRTTIME - No equivalent - - - -
-
- - - PAMName= - Sets the PAM service - name to set up a session as. If set, - the executed process will be - registered as a PAM session under the - specified service name. This is only - useful in conjunction with the - User= setting. If - not set, no PAM session will be opened - for the executed processes. See - pam8 - for details. - - - - CapabilityBoundingSet= - - Controls which - capabilities to include in the - capability bounding set for the - executed process. See - capabilities7 - for details. Takes a whitespace-separated - list of capability names as read by - cap_from_name3, - e.g. CAP_SYS_ADMIN, - CAP_DAC_OVERRIDE, - CAP_SYS_PTRACE. - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, - all but the listed capabilities will - be included, the effect of the - assignment inverted. Note that this - option also affects the respective - capabilities in the effective, - permitted and inheritable capability - sets, on top of what - Capabilities= - does. If this option is not used, the - capability bounding set is not - modified on process execution, hence - no limits on the capabilities of the - process are enforced. This option may - appear more than once in which case - the bounding sets are merged. If the - empty string is assigned to this - option, the bounding set is reset to - the empty capability set, and all - prior settings have no effect. If set - to ~ (without any - further argument), the bounding set is - reset to the full set of available - capabilities, also undoing any - previous settings. - - - - SecureBits= - Controls the secure - bits set for the executed process. - Takes a space-separated combination of - options from the following list: - , - , - , - , - , and - . This - option may appear more than once in - which case the secure bits are ORed. - If the empty string is assigned to - this option, the bits are reset to 0. - See capabilities7 - for details. - - - - Capabilities= - Controls the - capabilities7 - set for the executed process. Take a - capability string describing the - effective, permitted and inherited - capability sets as documented in - cap_from_text3. - Note that these capability sets are - usually influenced (and filtered) by the capabilities - attached to the executed file. Due to - that - CapabilityBoundingSet= - is probably a much more useful - setting. - - - - ReadWriteDirectories= - ReadOnlyDirectories= - InaccessibleDirectories= - - Sets up a new file - system namespace for executed - processes. These options may be used - to limit access a process might have - to the main file system - hierarchy. Each setting takes a - space-separated list of absolute - directory paths. Directories listed in - ReadWriteDirectories= - are accessible from within the - namespace with the same access rights - as from outside. Directories listed in - ReadOnlyDirectories= - are accessible for reading only, - writing will be refused even if the - usual file access controls would - permit this. Directories listed in - InaccessibleDirectories= - will be made inaccessible for - processes inside the namespace. Note - that restricting access with these - options does not extend to submounts - of a directory that are created later - on. These options may be specified - more than once in which case all - directories listed will have limited - access from within the namespace. If - the empty string is assigned to this - option, the specific list is reset, - and all prior assignments have no - effect. - Paths in - ReadOnlyDirectories= - and - InaccessibleDirectories= - may be prefixed with - -, in which case - they will be ignored when they do not - exist. Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to - install mount points in the main mount - namespace. - - - - PrivateTmp= - - Takes a boolean - argument. If true, sets up a new file - system namespace for the executed - processes and mounts private - /tmp and - /var/tmp - directories inside it that is not - shared by processes outside of the - namespace. This is useful to secure - access to temporary files of the - process, but makes sharing between - processes via - /tmp or - /var/tmp - impossible. If this is enabled, all - temporary files created by a service - in these directories will be removed - after the service is stopped. Defaults - to false. It is possible to run two or - more units within the same private - /tmp and - /var/tmp - namespace by using the - JoinsNamespaceOf= - directive, see - systemd.unit5 - for details. Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to install - mount points in the main mount - namespace. - - - - PrivateDevices= - - Takes a boolean - argument. If true, sets up a new /dev - namespace for the executed processes - and only adds API pseudo devices such - as /dev/null, - /dev/zero or - /dev/random (as - well as the pseudo TTY subsystem) to - it, but no physical devices such as - /dev/sda. This is - useful to securely turn off physical - device access by the executed - process. Defaults to false. Enabling - this option will also remove - CAP_MKNOD from - the capability bounding set for the - unit (see above), and set - DevicePolicy=closed - (see - systemd.resource-control5 - for details). Note that using this - setting will disconnect propagation of - mounts from the service to the host - (propagation in the opposite direction - continues to work). This means that - this setting may not be used for - services which shall be able to - install mount points in the main mount - namespace. - - - - PrivateNetwork= - - Takes a boolean - argument. If true, sets up a new - network namespace for the executed - processes and configures only the - loopback network device - lo inside it. No - other network devices will be - available to the executed process. - This is useful to securely turn off - network access by the executed - process. Defaults to false. It is - possible to run two or more units - within the same private network - namespace by using the - JoinsNamespaceOf= - directive, see - systemd.unit5 - for details. Note that this option - will disconnect all socket families - from the host, this includes - AF_NETLINK and AF_UNIX. The latter has - the effect that AF_UNIX sockets in the - abstract socket namespace will become - unavailable to the processes (however, - those located in the file system will - continue to be - accessible). - - - - ProtectSystem= - - Takes a boolean - argument or - full. If true, - mounts the /usr - directory read-only for processes - invoked by this unit. If set to - full, the - /etc directory is mounted - read-only, too. This setting ensures - that any modification of the vendor - supplied operating system (and - optionally its configuration) is - prohibited for the service. It is - recommended to enable this setting for - all long-running services, unless they - are involved with system updates or - need to modify the operating system in - other ways. Note however that - processes retaining the CAP_SYS_ADMIN - capability can undo the effect of this - setting. This setting is hence - particularly useful for daemons which - have this capability removed, for - example with - CapabilityBoundingSet=. Defaults - to off. - - - - ProtectHome= - - Takes a boolean - argument or - read-only. If true, - the directories - /home and - /run/user are - made inaccessible and empty for - processes invoked by this unit. If set - to read-only, the - two directories are made read-only - instead. It is recommended to enable - this setting for all long-running - services (in particular network-facing - ones), to ensure they cannot get access - to private user data, unless the - services actually require access to - the user's private data. Note however - that processes retaining the - CAP_SYS_ADMIN capability can undo the - effect of this setting. This setting - is hence particularly useful for - daemons which have this capability - removed, for example with - CapabilityBoundingSet=. Defaults - to off. - - - - MountFlags= - - Takes a mount - propagation flag: - , - or - , which - control whether mounts in the file - system namespace set up for this - unit's processes will receive or - propagate mounts or unmounts. See - mount2 - for details. Defaults to - . Use - to ensure that - mounts and unmounts are propagated - from the host to the container and - vice versa. Use - to run processes so that none of their - mounts and unmounts will propagate to - the host. Use - to also ensure that no mounts and - unmounts from the host will propagate - into the unit processes' - namespace. Note that - means that file - systems mounted on the host might stay - mounted continuously in the unit's - namespace, and thus keep the device - busy. Note that the file system - namespace related options - (PrivateTmp=, - PrivateDevices=, - ProtectSystem=, - ProtectHome=, - ReadOnlyDirectories=, - InaccessibleDirectories= - and - ReadWriteDirectories=) - require that mount and unmount - propagation from the unit's file - system namespace is disabled, and - hence downgrade - to - . - - - - - UtmpIdentifier= - - Takes a four - character identifier string for an - utmp/wtmp entry for this service. This - should only be set for services such - as getty - implementations where utmp/wtmp - entries must be created and cleared - before and after execution. If the - configured string is longer than four - characters, it is truncated and the - terminal four characters are - used. This setting interprets %I style - string replacements. This setting is - unset by default, i.e. no utmp/wtmp - entries are created or cleaned up for - this service. - - - - SELinuxContext= - - Set the SELinux - security context of the executed - process. If set, this will override - the automated domain - transition. However, the policy still - needs to authorize the transition. This - directive is ignored if SELinux is - disabled. If prefixed by - -, all errors will - be ignored. See - setexeccon3 - for details. - - - - AppArmorProfile= - - Takes a profile name as argument. - The process executed by the unit will switch to - this profile when started. Profiles must already - be loaded in the kernel, or the unit will fail. - This result in a non operation if AppArmor is not - enabled. If prefixed by -, all errors - will be ignored. - - - - - SmackProcessLabel= - - Takes a - security - label as argument. The process - executed by the unit will be started - under this label and SMACK will decide - whether the processes is allowed to - run or not based on it. The process - will continue to run under the label - specified here unless the executable - has its own - label, in - which case the process will transition - to run under that label. When not - specified, the label that systemd is - running under is used. This directive - is ignored if SMACK is - disabled. - - The value may be prefixed by - -, in which case - all errors will be ignored. An empty - value may be specified to unset - previous assignments. - - - - - IgnoreSIGPIPE= - - Takes a boolean - argument. If true, causes SIGPIPE to be - ignored in the executed - process. Defaults to true because - SIGPIPE generally is useful only in - shell pipelines. - - - - NoNewPrivileges= - - Takes a boolean - argument. If true, ensures that the - service process and all its children - can never gain new privileges. This - option is more powerful than the respective - secure bits flags (see above), as it - also prohibits UID changes of any - kind. This is the simplest, most - effective way to ensure that a process - and its children can never elevate - privileges again. - - - - SystemCallFilter= - - Takes a - space-separated list of system call - names. If this setting is used, all - system calls executed by the unit - processes except for the listed ones - will result in immediate process - termination with the - SIGSYS signal - (whitelisting). If the first character - of the list is ~, - the effect is inverted: only the - listed system calls will result in - immediate process termination - (blacklisting). If running in user - mode and this option is used, - NoNewPrivileges=yes - is implied. This feature makes use of the - Secure Computing Mode 2 interfaces of - the kernel ('seccomp filtering') and - is useful for enforcing a minimal - sandboxing environment. Note that the - execve, - rt_sigreturn, - sigreturn, - exit_group, - exit system calls - are implicitly whitelisted and do not - need to be listed explicitly. This - option may be specified more than once - in which case the filter masks are - merged. If the empty string is - assigned, the filter is reset, all - prior assignments will have no - effect. - - If you specify both types of - this option (i.e. whitelisting and - blacklisting), the first encountered - will take precedence and will dictate - the default action (termination or - approval of a system call). Then the - next occurrences of this option will - add or delete the listed system calls - from the set of the filtered system - calls, depending of its type and the - default action. (For example, if you have started - with a whitelisting of - read and - write, and right - after it add a blacklisting of - write, then - write will be - removed from the set.) - - - - - SystemCallErrorNumber= - - Takes an - errno error number - name to return when the system call - filter configured with - SystemCallFilter= - is triggered, instead of terminating - the process immediately. Takes an - error name such as - EPERM, - EACCES or - EUCLEAN. When this - setting is not used, or when the empty - string is assigned, the process will be - terminated immediately when the filter - is triggered. - - - - SystemCallArchitectures= - - Takes a space - separated list of architecture - identifiers to include in the system - call filter. The known architecture - identifiers are - x86, - x86-64, - x32, - arm as well as - the special identifier - native. Only - system calls of the specified - architectures will be permitted to - processes of this unit. This is an - effective way to disable compatibility - with non-native architectures for - processes, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. The special - native identifier - implicitly maps to the native - architecture of the system (or more - strictly: to the architecture the - system manager is compiled for). If - running in user mode and this option - is used, - NoNewPrivileges=yes - is implied. Note that setting this - option to a non-empty list implies - that native is - included too. By default, this option - is set to the empty list, i.e. no - architecture system call filtering is - applied. - - - - RestrictAddressFamilies= - - Restricts the set of - socket address families accessible to - the processes of this unit. Takes a - space-separated list of address family - names to whitelist, such as - AF_UNIX, - AF_INET or - AF_INET6. When - prefixed with ~ - the listed address families will be - applied as blacklist, otherwise as - whitelist. Note that this restricts - access to the - socket2 - system call only. Sockets passed into - the process by other means (for - example, by using socket activation - with socket units, see - systemd.socket5) - are unaffected. Also, sockets created - with socketpair() - (which creates connected AF_UNIX - sockets only) are unaffected. Note - that this option has no effect on - 32-bit x86 and is ignored (but works - correctly on x86-64). If running in user - mode and this option is used, - NoNewPrivileges=yes - is implied. By default, no - restriction applies, all address - families are accessible to - processes. If assigned the empty - string, any previous list changes are - undone. - - Use this option to limit - exposure of processes to remote - systems, in particular via exotic - network protocols. Note that in most - cases, the local - AF_UNIX address - family should be included in the - configured whitelist as it is - frequently used for local - communication, including for - syslog2 - logging. - - - - Personality= - - Controls which - kernel architecture - uname2 - shall report, when invoked by unit - processes. Takes one of - x86 and - x86-64. This is - useful when running 32-bit services on - a 64-bit host system. If not specified, - the personality is left unmodified and - thus reflects the personality of the - host system's - kernel. - - - - RuntimeDirectory= - RuntimeDirectoryMode= - - Takes a list of - directory names. If set, one or more - directories by the specified names - will be created below - /run (for system - services) or below - $XDG_RUNTIME_DIR - (for user services) when the unit is - started, and removed when the unit is - stopped. The directories will have the - access mode specified in - RuntimeDirectoryMode=, - and will be owned by the user and - group specified in - User= and - Group=. Use this to - manage one or more runtime directories - of the unit and bind their lifetime to - the daemon runtime. The specified - directory names must be relative, and - may not include a - /, i.e. must refer - to simple directories to create or - remove. This is particularly useful - for unprivileged daemons that cannot - create runtime directories in - /run due to lack - of privileges, and to make sure the - runtime directory is cleaned up - automatically after use. For runtime - directories that require more complex - or different configuration or lifetime - guarantees, please consider using - tmpfiles.d5. - - -
-
- - - Environment variables in spawned processes - - Processes started by the system are executed in - a clean environment in which select variables - listed below are set. System processes started by systemd - do not inherit variables from PID 1, but processes - started by user systemd instances inherit all - environment variables from the user systemd instance. - - - - - $PATH - - Colon-separated list - of directories to use when launching - executables. Systemd uses a fixed - value of - /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. - - - - - $LANG - - Locale. Can be set in - locale.conf5 - or on the kernel command line (see - systemd1 - and - kernel-command-line7). - - - - - $USER - $LOGNAME - $HOME - $SHELL - - User name (twice), home - directory, and the login shell. - The variables are set for the units that - have User= set, - which includes user - systemd instances. - See - passwd5. - - - - - $XDG_RUNTIME_DIR - - The directory for volatile - state. Set for the user systemd - instance, and also in user sessions. - See - pam_systemd8. - - - - - $XDG_SESSION_ID - $XDG_SEAT - $XDG_VTNR - - The identifier of the - session, the seat name, and - virtual terminal of the session. Set - by - pam_systemd8 - for login sessions. - $XDG_SEAT and - $XDG_VTNR will - only be set when attached to a seat and a - tty. - - - - $MAINPID - - The PID of the units - main process if it is known. This is - only set for control processes as - invoked by - ExecReload= and - similar. - - - - $MANAGERPID - - The PID of the user - systemd instance, - set for processes spawned by it. - - - - - $LISTEN_FDS - $LISTEN_PID - - Information about file - descriptors passed to a service for - socket activation. See - sd_listen_fds3. - - - - - $TERM - - Terminal type, set - only for units connected to a terminal - (StandardInput=tty, - StandardOutput=tty, - or - StandardError=tty). - See - termcap5. - - - - - Additional variables may be configured by the - following means: for processes spawned in specific - units, use the Environment= and - EnvironmentFile= options above; to - specify variables globally, use - DefaultEnvironment= (see - systemd-system.conf5) - or the kernel option - systemd.setenv= (see - systemd1). Additional - variables may also be set through PAM, - cf. pam_env8. - - - - See Also - - systemd1, - systemctl1, - journalctl8, - systemd.unit5, - systemd.service5, - systemd.socket5, - systemd.swap5, - systemd.mount5, - systemd.kill5, - systemd.resource-control5, - systemd.directives7, - tmpfiles.d5, - exec3 - - + + systemd.exec + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.exec + 5 + + + + systemd.exec + Execution environment configuration + + + + service.service, + socket.socket, + mount.mount, + swap.swap + + + + Description + + Unit configuration files for services, sockets, mount + points, and swap devices share a subset of configuration options + which define the execution environment of spawned + processes. + + This man page lists the configuration options shared by + these four unit types. See + systemd.unit5 + for the common options of all unit configuration files, and + systemd.service5, + systemd.socket5, + systemd.swap5, + and + systemd.mount5 + for more information on the specific unit configuration files. The + execution specific configuration options are configured in the + [Service], [Socket], [Mount], or [Swap] sections, depending on the + unit type. + + + + Options + + + + + WorkingDirectory= + + Takes an absolute directory path. Sets the + working directory for executed processes. If not set, defaults + to the root directory when systemd is running as a system + instance and the respective user's home directory if run as + user. + + + + RootDirectory= + + Takes an absolute directory path. Sets the + root directory for executed processes, with the + chroot2 + system call. If this is used, it must be ensured that the + process and all its auxiliary files are available in the + chroot() jail. + + + + User= + Group= + + Sets the Unix user or group that the processes + are executed as, respectively. Takes a single user or group + name or ID as argument. If no group is set, the default group + of the user is chosen. + + + + SupplementaryGroups= + + Sets the supplementary Unix groups the + processes are executed as. This takes a space-separated list + of group names or IDs. This option may be specified more than + once in which case all listed groups are set as supplementary + groups. When the empty string is assigned the list of + supplementary groups is reset, and all assignments prior to + this one will have no effect. In any way, this option does not + override, but extends the list of supplementary groups + configured in the system group database for the + user. + + + + Nice= + + Sets the default nice level (scheduling + priority) for executed processes. Takes an integer between -20 + (highest priority) and 19 (lowest priority). See + setpriority2 + for details. + + + + OOMScoreAdjust= + + Sets the adjustment level for the + Out-Of-Memory killer for executed processes. Takes an integer + between -1000 (to disable OOM killing for this process) and + 1000 (to make killing of this process under memory pressure + very likely). See proc.txt + for details. + + + + IOSchedulingClass= + + Sets the IO scheduling class for executed + processes. Takes an integer between 0 and 3 or one of the + strings , , + or . See + ioprio_set2 + for details. + + + + IOSchedulingPriority= + + Sets the IO scheduling priority for executed + processes. Takes an integer between 0 (highest priority) and 7 + (lowest priority). The available priorities depend on the + selected IO scheduling class (see above). See + ioprio_set2 + for details. + + + + CPUSchedulingPolicy= + + Sets the CPU scheduling policy for executed + processes. Takes one of + , + , + , + or + . See + sched_setscheduler2 + for details. + + + + CPUSchedulingPriority= + + Sets the CPU scheduling priority for executed + processes. The available priority range depends on the + selected CPU scheduling policy (see above). For real-time + scheduling policies an integer between 1 (lowest priority) and + 99 (highest priority) can be used. See + sched_setscheduler2 + for details. + + + + CPUSchedulingResetOnFork= + + Takes a boolean argument. If true, elevated + CPU scheduling priorities and policies will be reset when the + executed processes fork, and can hence not leak into child + processes. See + sched_setscheduler2 + for details. Defaults to false. + + + + CPUAffinity= + + Controls the CPU affinity of the executed + processes. Takes a space-separated list of CPU indices. This + option may be specified more than once in which case the + specified CPU affinity masks are merged. If the empty string + is assigned, the mask is reset, all assignments prior to this + will have no effect. See + sched_setaffinity2 + for details. + + + + UMask= + + Controls the file mode creation mask. Takes an + access mode in octal notation. See + umask2 + for details. Defaults to 0022. + + + + Environment= + + Sets environment variables for executed + processes. Takes a space-separated list of variable + assignments. This option may be specified more than once in + which case all listed variables will be set. If the same + variable is set twice, the later setting will override the + earlier setting. If the empty string is assigned to this + option, the list of environment variables is reset, all prior + assignments have no effect. Variable expansion is not + performed inside the strings, however, specifier expansion is + possible. The $ character has no special meaning. If you need + to assign a value containing spaces to a variable, use double + quotes (") for the assignment. + + Example: + Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" + gives three variables VAR1, + VAR2, VAR3 + with the values word1 word2, + word3, $word 5 6. + + + + See + environ7 + for details about environment variables. + + + EnvironmentFile= + Similar to Environment= but + reads the environment variables from a text file. The text + file should contain new-line-separated variable assignments. + Empty lines and lines starting with ; or # will be ignored, + which may be used for commenting. A line ending with a + backslash will be concatenated with the following one, + allowing multiline variable definitions. The parser strips + leading and trailing whitespace from the values of + assignments, unless you use double quotes ("). + + The argument passed should be an absolute filename or + wildcard expression, optionally prefixed with + -, which indicates that if the file does + not exist, it will not be read and no error or warning message + is logged. This option may be specified more than once in + which case all specified files are read. If the empty string + is assigned to this option, the list of file to read is reset, + all prior assignments have no effect. + + The files listed with this directive will be read + shortly before the process is executed (more specifically, + after all processes from a previous unit state terminated. + This means you can generate these files in one unit state, and + read it with this option in the next). Settings from these + files override settings made with + Environment=. If the same variable is set + twice from these files, the files will be read in the order + they are specified and the later setting will override the + earlier setting. + + + + StandardInput= + Controls where file descriptor 0 (STDIN) of + the executed processes is connected to. Takes one of + , + , + , + or + . + + If is selected, standard input + will be connected to /dev/null, i.e. all + read attempts by the process will result in immediate + EOF. + + If is selected, standard input is + connected to a TTY (as configured by + TTYPath=, see below) and the executed + process becomes the controlling process of the terminal. If + the terminal is already being controlled by another process, + the executed process waits until the current controlling + process releases the terminal. + + is similar to + , but the executed process is forcefully + and immediately made the controlling process of the terminal, + potentially removing previous controlling processes from the + terminal. + + is similar to + but if the terminal already has a + controlling process start-up of the executed process + fails. + + The option is only valid in + socket-activated services, and only when the socket + configuration file (see + systemd.socket5 + for details) specifies a single socket only. If this option is + set, standard input will be connected to the socket the + service was activated from, which is primarily useful for + compatibility with daemons designed for use with the + traditional + inetd8 + daemon. + + This setting defaults to + . + + + StandardOutput= + Controls where file descriptor 1 (STDOUT) of + the executed processes is connected to. Takes one of + , + , + , + , + , + , + , + , + or + . + + duplicates the file descriptor + of standard input for standard output. + + connects standard output to + /dev/null, i.e. everything written to it + will be lost. + + connects standard output to a tty + (as configured via TTYPath=, see below). If + the TTY is used for output only, the executed process will not + become the controlling process of the terminal, and will not + fail or wait for other processes to release the + terminal. + + connects standard output with + the journal which is accessible via + journalctl1. + Note that everything that is written to syslog or kmsg (see + below) is implicitly stored in the journal as well, the + specific two options listed below are hence supersets of this + one. + + connects standard output to the + syslog3 + system syslog service, in addition to the journal. Note that + the journal daemon is usually configured to forward everything + it receives to syslog anyway, in which case this option is no + different from . + + connects standard output with the + kernel log buffer which is accessible via + dmesg1, + in addition to the journal. The journal daemon might be + configured to send all logs to kmsg anyway, in which case this + option is no different from . + + , + and + work in a similar way as the + three options above but copy the output to the system console + as well. + + connects standard output to a + socket acquired via socket activation. The semantics are + similar to the same option of + StandardInput=. + + This setting defaults to the value set with + in + systemd-system.conf5, + which defaults to . + + + StandardError= + Controls where file descriptor 2 (STDERR) of + the executed processes is connected to. The available options + are identical to those of StandardOutput=, + with one exception: if set to the + file descriptor used for standard output is duplicated for + standard error. This setting defaults to the value set with + in + systemd-system.conf5, + which defaults to . + + + TTYPath= + Sets the terminal device node to use if + standard input, output, or error are connected to a TTY (see + above). Defaults to + /dev/console. + + + TTYReset= + Reset the terminal device specified with + TTYPath= before and after execution. + Defaults to no. + + + TTYVHangup= + Disconnect all clients which have opened the + terminal device specified with TTYPath= + before and after execution. Defaults to + no. + + + TTYVTDisallocate= + If the terminal device specified with + TTYPath= is a virtual console terminal, try + to deallocate the TTY before and after execution. This ensures + that the screen and scrollback buffer is cleared. Defaults to + no. + + + SyslogIdentifier= + Sets the process name to prefix log lines sent + to the logging system or the kernel log buffer with. If not + set, defaults to the process name of the executed process. + This option is only useful when + StandardOutput= or + StandardError= are set to + , or + (or to the same settings in combination + with ). + + + SyslogFacility= + Sets the syslog facility to use when logging + to syslog. One of , + , , + , , + , , + , , + , , + , , + , , + , , + , or + . See + syslog3 + for details. This option is only useful when + StandardOutput= or + StandardError= are set to + . Defaults to + . + + + SyslogLevel= + Default syslog level to use when logging to + syslog or the kernel log buffer. One of + , + , + , + , + , + , + , + . See + syslog3 + for details. This option is only useful when + StandardOutput= or + StandardError= are set to + or . Note that + individual lines output by the daemon might be prefixed with a + different log level which can be used to override the default + log level specified here. The interpretation of these prefixes + may be disabled with SyslogLevelPrefix=, + see below. For details see + sd-daemon3. + + Defaults to + . + + + + SyslogLevelPrefix= + Takes a boolean argument. If true and + StandardOutput= or + StandardError= are set to + , or + , log lines written by the executed + process that are prefixed with a log level will be passed on + to syslog with this log level set but the prefix removed. If + set to false, the interpretation of these prefixes is disabled + and the logged lines are passed on as-is. For details about + this prefixing see + sd-daemon3. + Defaults to true. + + + + TimerSlackNSec= + Sets the timer slack in nanoseconds for the + executed processes. The timer slack controls the accuracy of + wake-ups triggered by timers. See + prctl2 + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too. + + + + LimitCPU= + LimitFSIZE= + LimitDATA= + LimitSTACK= + LimitCORE= + LimitRSS= + LimitNOFILE= + LimitAS= + LimitNPROC= + LimitMEMLOCK= + LimitLOCKS= + LimitSIGPENDING= + LimitMSGQUEUE= + LimitNICE= + LimitRTPRIO= + LimitRTTIME= + These settings set both soft and hard limits + of various resources for executed processes. See + setrlimit2 + for details. Use the string infinity to + configure no limit on a specific resource. + + + Limit directives and their equivalent with ulimit + + + + + + + Directive + ulimit equivalent + + + + + LimitCPU + ulimit -t + + + LimitFSIZE + ulimit -f + + + LimitDATA + ulimit -d + + + LimitSTACK + ulimit -s + + + LimitCORE + ulimit -c + + + LimitRSS + ulimit -m + + + LimitNOFILE + ulimit -n + + + LimitAS + ulimit -v + + + LimitNPROC + ulimit -u + + + LimitMEMLOCK + ulimit -l + + + LimitLOCKS + ulimit -x + + + LimitSIGPENDING + ulimit -i + + + LimitMSGQUEUE + ulimit -q + + + LimitNICE + ulimit -e + + + LimitRTPRIO + ulimit -r + + + LimitRTTIME + No equivalent + + + +
+
+ + + PAMName= + Sets the PAM service name to set up a session + as. If set, the executed process will be registered as a PAM + session under the specified service name. This is only useful + in conjunction with the User= setting. If + not set, no PAM session will be opened for the executed + processes. See + pam8 + for details. + + + + CapabilityBoundingSet= + + Controls which capabilities to include in the + capability bounding set for the executed process. See + capabilities7 + for details. Takes a whitespace-separated list of capability + names as read by + cap_from_name3, + e.g. CAP_SYS_ADMIN, + CAP_DAC_OVERRIDE, + CAP_SYS_PTRACE. Capabilities listed will + be included in the bounding set, all others are removed. If + the list of capabilities is prefixed with + ~, all but the listed capabilities will be + included, the effect of the assignment inverted. Note that + this option also affects the respective capabilities in the + effective, permitted and inheritable capability sets, on top + of what Capabilities= does. If this option + is not used, the capability bounding set is not modified on + process execution, hence no limits on the capabilities of the + process are enforced. This option may appear more than once in + which case the bounding sets are merged. If the empty string + is assigned to this option, the bounding set is reset to the + empty capability set, and all prior settings have no effect. + If set to ~ (without any further argument), + the bounding set is reset to the full set of available + capabilities, also undoing any previous + settings. + + + + SecureBits= + Controls the secure bits set for the executed + process. Takes a space-separated combination of options from + the following list: + , + , + , + , + , and + . + This option may appear more than once in which case the secure + bits are ORed. If the empty string is assigned to this option, + the bits are reset to 0. See + capabilities7 + for details. + + + + Capabilities= + Controls the + capabilities7 + set for the executed process. Take a capability string + describing the effective, permitted and inherited capability + sets as documented in + cap_from_text3. + Note that these capability sets are usually influenced (and + filtered) by the capabilities attached to the executed file. + Due to that CapabilityBoundingSet= is + probably a much more useful setting. + + + + ReadWriteDirectories= + ReadOnlyDirectories= + InaccessibleDirectories= + + Sets up a new file system namespace for + executed processes. These options may be used to limit access + a process might have to the main file system hierarchy. Each + setting takes a space-separated list of absolute directory + paths. Directories listed in + ReadWriteDirectories= are accessible from + within the namespace with the same access rights as from + outside. Directories listed in + ReadOnlyDirectories= are accessible for + reading only, writing will be refused even if the usual file + access controls would permit this. Directories listed in + InaccessibleDirectories= will be made + inaccessible for processes inside the namespace. Note that + restricting access with these options does not extend to + submounts of a directory that are created later on. These + options may be specified more than once in which case all + directories listed will have limited access from within the + namespace. If the empty string is assigned to this option, the + specific list is reset, and all prior assignments have no + effect. + Paths in + ReadOnlyDirectories= + and + InaccessibleDirectories= + may be prefixed with + -, in which case + they will be ignored when they do not + exist. Note that using this + setting will disconnect propagation of + mounts from the service to the host + (propagation in the opposite direction + continues to work). This means that + this setting may not be used for + services which shall be able to + install mount points in the main mount + namespace. + + + + PrivateTmp= + + Takes a boolean argument. If true, sets up a + new file system namespace for the executed processes and + mounts private /tmp and + /var/tmp directories inside it that is + not shared by processes outside of the namespace. This is + useful to secure access to temporary files of the process, but + makes sharing between processes via /tmp + or /var/tmp impossible. If this is + enabled, all temporary files created by a service in these + directories will be removed after the service is stopped. + Defaults to false. It is possible to run two or more units + within the same private /tmp and + /var/tmp namespace by using the + JoinsNamespaceOf= directive, see + systemd.unit5 + for details. Note that using this setting will disconnect + propagation of mounts from the service to the host + (propagation in the opposite direction continues to work). + This means that this setting may not be used for services + which shall be able to install mount points in the main mount + namespace. + + + + PrivateDevices= + + Takes a boolean argument. If true, sets up a + new /dev namespace for the executed processes and only adds + API pseudo devices such as /dev/null, + /dev/zero or + /dev/random (as well as the pseudo TTY + subsystem) to it, but no physical devices such as + /dev/sda. This is useful to securely turn + off physical device access by the executed process. Defaults + to false. Enabling this option will also remove + CAP_MKNOD from the capability bounding + set for the unit (see above), and set + DevicePolicy=closed (see + systemd.resource-control5 + for details). Note that using this setting will disconnect + propagation of mounts from the service to the host + (propagation in the opposite direction continues to work). + This means that this setting may not be used for services + which shall be able to install mount points in the main mount + namespace. + + + + PrivateNetwork= + + Takes a boolean argument. If true, sets up a + new network namespace for the executed processes and + configures only the loopback network device + lo inside it. No other network devices will + be available to the executed process. This is useful to + securely turn off network access by the executed process. + Defaults to false. It is possible to run two or more units + within the same private network namespace by using the + JoinsNamespaceOf= directive, see + systemd.unit5 + for details. Note that this option will disconnect all socket + families from the host, this includes AF_NETLINK and AF_UNIX. + The latter has the effect that AF_UNIX sockets in the abstract + socket namespace will become unavailable to the processes + (however, those located in the file system will continue to be + accessible). + + + + ProtectSystem= + + Takes a boolean argument or + full. If true, mounts the + /usr and /boot + directories read-only for processes invoked by this unit. If + set to full, the /etc + directory is mounted read-only, too. This setting ensures that + any modification of the vendor supplied operating system (and + optionally its configuration) is prohibited for the service. + It is recommended to enable this setting for all long-running + services, unless they are involved with system updates or need + to modify the operating system in other ways. Note however + that processes retaining the CAP_SYS_ADMIN capability can undo + the effect of this setting. This setting is hence particularly + useful for daemons which have this capability removed, for + example with CapabilityBoundingSet=. + Defaults to off. + + + + ProtectHome= + + Takes a boolean argument or + read-only. If true, the directories + /home and /run/user + are made inaccessible and empty for processes invoked by this + unit. If set to read-only, the two + directories are made read-only instead. It is recommended to + enable this setting for all long-running services (in + particular network-facing ones), to ensure they cannot get + access to private user data, unless the services actually + require access to the user's private data. Note however that + processes retaining the CAP_SYS_ADMIN capability can undo the + effect of this setting. This setting is hence particularly + useful for daemons which have this capability removed, for + example with CapabilityBoundingSet=. + Defaults to off. + + + + MountFlags= + + Takes a mount propagation flag: + , or + , which control whether mounts in the + file system namespace set up for this unit's processes will + receive or propagate mounts or unmounts. See + mount2 + for details. Defaults to . Use + to ensure that mounts and unmounts are + propagated from the host to the container and vice versa. Use + to run processes so that none of their + mounts and unmounts will propagate to the host. Use + to also ensure that no mounts and + unmounts from the host will propagate into the unit processes' + namespace. Note that means that file + systems mounted on the host might stay mounted continuously in + the unit's namespace, and thus keep the device busy. Note that + the file system namespace related options + (PrivateTmp=, + PrivateDevices=, + ProtectSystem=, + ProtectHome=, + ReadOnlyDirectories=, + InaccessibleDirectories= and + ReadWriteDirectories=) require that mount + and unmount propagation from the unit's file system namespace + is disabled, and hence downgrade to + . + + + + UtmpIdentifier= + + Takes a four character identifier string for + an utmp/wtmp entry for this service. This should only be set + for services such as getty implementations + where utmp/wtmp entries must be created and cleared before and + after execution. If the configured string is longer than four + characters, it is truncated and the terminal four characters + are used. This setting interprets %I style string + replacements. This setting is unset by default, i.e. no + utmp/wtmp entries are created or cleaned up for this + service. + + + + SELinuxContext= + + Set the SELinux security context of the + executed process. If set, this will override the automated + domain transition. However, the policy still needs to + authorize the transition. This directive is ignored if SELinux + is disabled. If prefixed by -, all errors + will be ignored. See + setexeccon3 + for details. + + + + AppArmorProfile= + + Takes a profile name as argument. The process + executed by the unit will switch to this profile when started. + Profiles must already be loaded in the kernel, or the unit + will fail. This result in a non operation if AppArmor is not + enabled. If prefixed by -, all errors will + be ignored. + + + + SmackProcessLabel= + + Takes a security + label as argument. The process executed by the unit will be + started under this label and SMACK will decide whether the + processes is allowed to run or not based on it. The process + will continue to run under the label specified here unless the + executable has its own label, in + which case the process will transition to run under that + label. When not specified, the label that systemd is running + under is used. This directive is ignored if SMACK is + disabled. + + The value may be prefixed by -, in + which case all errors will be ignored. An empty value may be + specified to unset previous assignments. + + + + + IgnoreSIGPIPE= + + Takes a boolean argument. If true, causes + SIGPIPE to be ignored in the executed + process. Defaults to true because SIGPIPE + generally is useful only in shell pipelines. + + + + NoNewPrivileges= + + Takes a boolean argument. If true, ensures + that the service process and all its children can never gain + new privileges. This option is more powerful than the + respective secure bits flags (see above), as it also prohibits + UID changes of any kind. This is the simplest, most effective + way to ensure that a process and its children can never + elevate privileges again. + + + + SystemCallFilter= + + Takes a space-separated list of system call + names. If this setting is used, all system calls executed by + the unit processes except for the listed ones will result in + immediate process termination with the + SIGSYS signal (whitelisting). If the + first character of the list is ~, the + effect is inverted: only the listed system calls will result + in immediate process termination (blacklisting). If running in + user mode and this option is used, + NoNewPrivileges=yes is implied. This + feature makes use of the Secure Computing Mode 2 interfaces of + the kernel ('seccomp filtering') and is useful for enforcing a + minimal sandboxing environment. Note that the + execve, + rt_sigreturn, + sigreturn, + exit_group, exit + system calls are implicitly whitelisted and do not need to be + listed explicitly. This option may be specified more than once + in which case the filter masks are merged. If the empty string + is assigned, the filter is reset, all prior assignments will + have no effect. + + If you specify both types of this option (i.e. + whitelisting and blacklisting), the first encountered will + take precedence and will dictate the default action + (termination or approval of a system call). Then the next + occurrences of this option will add or delete the listed + system calls from the set of the filtered system calls, + depending of its type and the default action. (For example, if + you have started with a whitelisting of + read and write, and + right after it add a blacklisting of + write, then write + will be removed from the set.) + + + + SystemCallErrorNumber= + + Takes an errno error number + name to return when the system call filter configured with + SystemCallFilter= is triggered, instead of + terminating the process immediately. Takes an error name such + as EPERM, EACCES or + EUCLEAN. When this setting is not used, + or when the empty string is assigned, the process will be + terminated immediately when the filter is + triggered. + + + + SystemCallArchitectures= + + Takes a space separated list of architecture + identifiers to include in the system call filter. The known + architecture identifiers are x86, + x86-64, x32, + arm as well as the special identifier + native. Only system calls of the + specified architectures will be permitted to processes of this + unit. This is an effective way to disable compatibility with + non-native architectures for processes, for example to + prohibit execution of 32-bit x86 binaries on 64-bit x86-64 + systems. The special native identifier + implicitly maps to the native architecture of the system (or + more strictly: to the architecture the system manager is + compiled for). If running in user mode and this option is + used, NoNewPrivileges=yes is implied. Note + that setting this option to a non-empty list implies that + native is included too. By default, this + option is set to the empty list, i.e. no architecture system + call filtering is applied. + + + + RestrictAddressFamilies= + + Restricts the set of socket address families + accessible to the processes of this unit. Takes a + space-separated list of address family names to whitelist, + such as + AF_UNIX, + AF_INET or + AF_INET6. When + prefixed with ~ the listed address + families will be applied as blacklist, otherwise as whitelist. + Note that this restricts access to the + socket2 + system call only. Sockets passed into the process by other + means (for example, by using socket activation with socket + units, see + systemd.socket5) + are unaffected. Also, sockets created with + socketpair() (which creates connected + AF_UNIX sockets only) are unaffected. Note that this option + has no effect on 32-bit x86 and is ignored (but works + correctly on x86-64). If running in user mode and this option + is used, NoNewPrivileges=yes is implied. By + default, no restriction applies, all address families are + accessible to processes. If assigned the empty string, any + previous list changes are undone. + + Use this option to limit exposure of processes to remote + systems, in particular via exotic network protocols. Note that + in most cases, the local AF_UNIX address + family should be included in the configured whitelist as it is + frequently used for local communication, including for + syslog2 + logging. + + + + Personality= + + Controls which kernel architecture + uname2 + shall report, when invoked by unit processes. Takes one of + x86 and x86-64. This + is useful when running 32-bit services on a 64-bit host + system. If not specified, the personality is left unmodified + and thus reflects the personality of the host system's + kernel. + + + + RuntimeDirectory= + RuntimeDirectoryMode= + + Takes a list of directory names. If set, one + or more directories by the specified names will be created + below /run (for system services) or below + $XDG_RUNTIME_DIR (for user services) when + the unit is started, and removed when the unit is stopped. The + directories will have the access mode specified in + RuntimeDirectoryMode=, and will be owned by + the user and group specified in User= and + Group=. Use this to manage one or more + runtime directories of the unit and bind their lifetime to the + daemon runtime. The specified directory names must be + relative, and may not include a /, i.e. + must refer to simple directories to create or remove. This is + particularly useful for unprivileged daemons that cannot + create runtime directories in /run due to + lack of privileges, and to make sure the runtime directory is + cleaned up automatically after use. For runtime directories + that require more complex or different configuration or + lifetime guarantees, please consider using + tmpfiles.d5. + + +
+
+ + + Environment variables in spawned processes + + Processes started by the system are executed in a clean + environment in which select variables listed below are set. System + processes started by systemd do not inherit variables from PID 1, + but processes started by user systemd instances inherit all + environment variables from the user systemd instance. + + + + + $PATH + + Colon-separated list of directories to use + when launching executables. Systemd uses a fixed value of + /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. + + + + + $LANG + + Locale. Can be set in + locale.conf5 + or on the kernel command line (see + systemd1 + and + kernel-command-line7). + + + + + $USER + $LOGNAME + $HOME + $SHELL + + User name (twice), home directory, and the + login shell. The variables are set for the units that have + User= set, which includes user + systemd instances. See + passwd5. + + + + + $XDG_RUNTIME_DIR + + The directory for volatile state. Set for the + user systemd instance, and also in user + sessions. See + pam_systemd8. + + + + + $XDG_SESSION_ID + $XDG_SEAT + $XDG_VTNR + + The identifier of the session, the seat name, + and virtual terminal of the session. Set by + pam_systemd8 + for login sessions. $XDG_SEAT and + $XDG_VTNR will only be set when attached to + a seat and a tty. + + + + $MAINPID + + The PID of the units main process if it is + known. This is only set for control processes as invoked by + ExecReload= and similar. + + + + $MANAGERPID + + The PID of the user systemd + instance, set for processes spawned by it. + + + + $LISTEN_FDS + $LISTEN_PID + + Information about file descriptors passed to a + service for socket activation. See + sd_listen_fds3. + + + + + $TERM + + Terminal type, set only for units connected to + a terminal (StandardInput=tty, + StandardOutput=tty, or + StandardError=tty). See + termcap5. + + + + + Additional variables may be configured by the following + means: for processes spawned in specific units, use the + Environment= and + EnvironmentFile= options above; to specify + variables globally, use DefaultEnvironment= + (see + systemd-system.conf5) + or the kernel option systemd.setenv= (see + systemd1). + Additional variables may also be set through PAM, + cf. pam_env8. + + + + See Also + + systemd1, + systemctl1, + journalctl8, + systemd.unit5, + systemd.service5, + systemd.socket5, + systemd.swap5, + systemd.mount5, + systemd.kill5, + systemd.resource-control5, + systemd.directives7, + tmpfiles.d5, + exec3 + +
diff --git a/man/systemd.generator.7 b/man/systemd.generator.7 new file mode 100644 index 000000000..342a8be3f --- /dev/null +++ b/man/systemd.generator.7 @@ -0,0 +1,344 @@ +'\" t +.TH "SYSTEMD\&.GENERATOR" "7" "" "systemd 219" "systemd.generator" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +systemd.generator \- Systemd unit generators +.SH "SYNOPSIS" +.HP \w'\fB/path/to/generator\fR\ 'u +\fB/path/to/generator\fR \fInormal\-dir\fR \fIearly\-dir\fR \fIlate\-dir\fR +.PP +.nf +/run/systemd/system\-generators/* +/etc/systemd/system\-generators/* +/usr/local/lib/systemd/system\-generators/* +/usr/lib/systemd/system\-generators/* +.fi +.PP +.nf +/run/systemd/user\-generators/* +/etc/systemd/user\-generators/* +/usr/local/lib/systemd/user\-generators/* +/usr/lib/systemd/user\-generators/* +.fi +.sp +.SH "DESCRIPTION" +.PP +Generators are small binaries that live in +/usr/lib/systemd/user\-generators/ +and other directories listed above\&. +\fBsystemd\fR(1) +will execute those binaries very early at bootup and at configuration reload time \(em before unit files are loaded\&. Generators can dynamically generate unit files or create symbolic links to unit files to add additional dependencies, thus extending or overriding existing definitions\&. Their main purpose is to convert configuration files that are not native unit files dynamically into native unit files\&. +.PP +Generators are loaded from a set of paths determined during compilation, listed above\&. System and user generators are loaded from directories with names ending in +system\-generators/ +and +user\-generators/, respectively\&. Generators found in directories listed earlier override the ones with the same name in directories lower in the list\&. A symlink to +/dev/null +or an empty file can be used to mask a generator, thereby preventing it from running\&. Please note that the order of the two directories with the highest priority is reversed with respect to the unit load path and generators in +/run +overwrite those in +/etc\&. +.PP +After installing new generators or updating the configuration, +\fBsystemctl daemon\-reload\fR +may be executed\&. This will delete the previous configuration created by generators, re\-run all generators, and cause +\fBsystemd\fR +to reload units from disk\&. See +\fBsystemctl\fR(1) +for more information\&. +.SH "WRITING GENERATORS" +.PP +Generators are invoked with three arguments: paths to runtime directories where generators can place their generated unit files or symlinks\&. +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +\fInormal\-dir\fR +.sp +argv[1] may be used to override unit files in +/usr, but not those in +/etc\&. This means that unit files placed in this directory take precedence over vendor unit configuration but not over native user/administrator unit configuration\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +\fIearly\-dir\fR +.sp +argv[2] may be used to override unit files in +/usr +and in +/etc\&. This means that unit files placed in this directory take precedence over all configuration, both vendor and user/administrator\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 3.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 3." 4.2 +.\} +\fIlate\-dir\fR +.sp +argv[3] may be used to extend the unit file tree without overridding any other unit files\&. Any native configuration files supplied by the vendor or user/administrator take precedence over the generated ones placed in this directory\&. +.RE +.SS "Notes" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +All generators are executed in parallel\&. That means all executables are started at the very same time and need to be able to cope with this parallelism\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Generators are run very early at boot and cannot rely on any external services\&. They may not talk to any other process\&. That includes simple things such as logging to +\fBsyslog\fR(3), or +\fBsystemd\fR +itself (this means: no +\fBsystemctl\fR(1)!)\&. They can however rely on the most basic kernel functionality to be available, including mounted +/sys, +/proc, +/dev\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Units written by generators are removed when configuration is reloaded\&. That means the lifetime of the generated units is closely bound to the reload cycles of +\fBsystemd\fR +itself\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Generators should only be used to generate unit files, not any other kind of configuration\&. Due to the lifecycle logic mentioned above generators are not a good fit to generate dynamic configuration for other services\&. If you need to generate dynamic configuration for other services do so in normal services you order before the service in question\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Since +\fBsyslog\fR(3) +is not available (see above) log messages have to be written to +/dev/kmsg +instead\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +It is a good idea to use the +\fISourcePath=\fR +directive in generated unit files to specify the source configuration file you are generating the unit from\&. This makes things more easily understood by the user and also has the benefit that systemd can warn the user about configuration files that changed on disk but have not been read yet by systemd\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Generators may write out dynamic unit files or just hook unit files into other units with the usual +\&.wants/ +or +\&.requires/ +symlinks\&. Often it is nicer to simply instantiate a template unit file from +/usr +with a generator instead of writing out entirely dynamic unit files\&. Of course this works only if a single parameter is to be used\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If you are careful you can implement generators in shell scripts\&. We do recommend C code however, since generators delay are executed synchronously and hence delay the entire boot if they are slow\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Regarding overriding semantics: there are two rules we try to follow when thinking about the overriding semantics: +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +User configuration should override vendor configuration\&. This (mostly) means that stuff from +/etc +should override stuff from +/usr\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +Native configuration should override non\-native configuration\&. This (mostly) means that stuff you generate should never override native unit files for the same purpose\&. +.RE +.sp +Of these two rules the first rule is probably the more important one and breaks the second one sometimes\&. Hence, when deciding whether to user argv[1], argv[2], or argv[3], your default choice should probably be argv[1]\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Instead of heading off now and writing all kind of generators for legacy configuration file formats, please think twice! It\*(Aqs often a better idea to just deprecate old stuff instead of keeping it artificially alive\&. +.RE +.SH "EXAMPLES" +.PP +\fBExample\ \&1.\ \&systemd-fstab-generator\fR +.PP +\fBsystemd-fstab-generator\fR(8) +converts +/etc/fstab +into native mount units\&. It uses argv[1] as location to place the generated unit files in order to allow the user to override +/etc/fstab +with her own native unit files, but also to ensure that +/etc/fstab +overrides any vendor default from +/usr\&. +.PP +After editing +/etc/fstab, the user should invoke +\fBsystemctl daemon\-reload\fR\&. This will re\-run all generators and cause +\fBsystemd\fR +to reload units from disk\&. To actually mount new directories added to +fstab, +\fBsystemctl start \fR\fB\fI/path/to/mountpoint\fR\fR +or +\fBsystemctl start local\-fs\&.target\fR +may be used\&. +.PP +\fBExample\ \&2.\ \&systemd-system-update-generator\fR +.PP +\fBsystemd-system-update-generator\fR(8) +temporarily redirects +default\&.target +to +system\-update\&.target +if a system update is scheduled\&. Since this needs to override the default user configuration for +default\&.target +it uses argv[2]\&. For details about this logic, see +\m[blue]\fBImplementing Offline System Updates\fR\m[]\&\s-2\u[1]\d\s+2\&. +.PP +\fBExample\ \&3.\ \&Debuging a generator\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +dir=$(mktemp \-d) +SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/system\-generators/systemd\-fstab\-generator \e + "$dir" "$dir" "$dir" +find $dir +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.PP +\fBsystemd\fR(1), +\fBsystemd-cryptsetup-generator\fR(8), +\fBsystemd-debug-generator\fR(8), +\fBsystemd-efi-boot-generator\fR(8), +\fBsystemd-fstab-generator\fR(8), +\fBfstab\fR(5), +\fBsystemd-getty-generator\fR(8), +\fBsystemd-gpt-auto-generator\fR(8), +\fBsystemd-hibernate-resume-generator\fR(8), +\fBsystemd-system-update-generator\fR(8), +\fBsystemd-sysv-generator\fR(8), +\fBsystemd.unit\fR(5), +\fBsystemctl\fR(1) +.SH "NOTES" +.IP " 1." 4 +Implementing Offline System Updates +.RS 4 +\%http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates +.RE diff --git a/man/systemd.generator.html b/man/systemd.generator.html new file mode 100644 index 000000000..2afb8f60c --- /dev/null +++ b/man/systemd.generator.html @@ -0,0 +1,184 @@ +systemd.generatorIndex · + Directives · + Python · + libudev · + gudev systemd 219

Name

systemd.generator — Systemd unit generators

Synopsis

/path/to/generator normal-dir early-dir late-dir

+

/run/systemd/system-generators/*
+/etc/systemd/system-generators/*
+/usr/local/lib/systemd/system-generators/*
+/usr/lib/systemd/system-generators/*

+

+

/run/systemd/user-generators/*
+/etc/systemd/user-generators/*
+/usr/local/lib/systemd/user-generators/*
+/usr/lib/systemd/user-generators/*

+

Description¶

Generators are small binaries that live in + /usr/lib/systemd/user-generators/ and other directories + listed above. + systemd(1) + will execute those binaries very early at bootup and at + configuration reload time — before unit files are loaded. + Generators can dynamically generate unit files or create symbolic + links to unit files to add additional dependencies, thus extending + or overriding existing definitions. Their main purpose is to + convert configuration files that are not native unit files + dynamically into native unit files.

Generators are loaded from a set of paths determined during + compilation, listed above. System and user generators are loaded + from directories with names ending in + system-generators/ and + user-generators/, respectively. Generators + found in directories listed earlier override the ones with the + same name in directories lower in the list. A symlink to + /dev/null or an empty file can be used to + mask a generator, thereby preventing it from running. Please note + that the order of the two directories with the highest priority is + reversed with respect to the unit load path and generators in + /run overwrite those in + /etc.

After installing new generators or updating the + configuration, systemctl daemon-reload may be + executed. This will delete the previous configuration created by + generators, re-run all generators, and cause + systemd to reload units from disk. See + systemctl(1) + for more information. +

Writing generators¶

Generators are invoked with three arguments: paths to + runtime directories where generators can place their generated + unit files or symlinks.

  1. normal-dir

    argv[1] may be used to override unit files in + /usr, but not those in + /etc. This means that unit files placed + in this directory take precedence over vendor unit + configuration but not over native user/administrator unit + configuration.

  2. early-dir

    argv[2] may be used to override unit files in + /usr and in + /etc. This means that unit files placed + in this directory take precedence over all configuration, + both vendor and user/administrator.

  3. late-dir

    argv[3] may be used to extend the unit file tree without + overridding any other unit files. Any native configuration + files supplied by the vendor or user/administrator take + precedence over the generated ones placed in this directory. +

Notes¶

  • + All generators are executed in parallel. That means all + executables are started at the very same time and need to + be able to cope with this parallelism. +

  • + Generators are run very early at boot and cannot rely on + any external services. They may not talk to any other + process. That includes simple things such as logging to + syslog(3), + or systemd itself (this means: no + systemctl(1)!). They + can however rely on the most basic kernel functionality to + be available, including mounted /sys, + /proc, /dev. +

  • + Units written by generators are removed when configuration + is reloaded. That means the lifetime of the generated + units is closely bound to the reload cycles of + systemd itself. +

  • + Generators should only be used to generate unit files, not + any other kind of configuration. Due to the lifecycle + logic mentioned above generators are not a good fit to + generate dynamic configuration for other services. If you + need to generate dynamic configuration for other services + do so in normal services you order before the service in + question. +

  • + Since + syslog(3) + is not available (see above) log messages have to be + written to /dev/kmsg instead. +

  • + It is a good idea to use the + SourcePath= directive in generated unit + files to specify the source configuration file you are + generating the unit from. This makes things more easily + understood by the user and also has the benefit that + systemd can warn the user about configuration files that + changed on disk but have not been read yet by systemd. +

  • + Generators may write out dynamic unit files or just hook + unit files into other units with the usual + .wants/ or + .requires/ symlinks. Often it is + nicer to simply instantiate a template unit file from + /usr with a generator instead of + writing out entirely dynamic unit files. Of course this + works only if a single parameter is to be used. +

  • + If you are careful you can implement generators in shell + scripts. We do recommend C code however, since generators + delay are executed synchronously and hence delay the + entire boot if they are slow. +

  • Regarding overriding semantics: there are two rules we + try to follow when thinking about the overriding semantics: +

    1. User configuration should override vendor + configuration. This (mostly) means that stuff from + /etc should override stuff from + /usr.

    2. Native configuration should override non-native + configuration. This (mostly) means that stuff you + generate should never override native unit files for the + same purpose.

    Of these two rules the first rule is probably the more + important one and breaks the second one sometimes. Hence, + when deciding whether to user argv[1], argv[2], or argv[3], + your default choice should probably be argv[1].

  • + Instead of heading off now and writing all kind of + generators for legacy configuration file formats, please + think twice! It's often a better idea to just deprecate + old stuff instead of keeping it artificially alive. +

Examples¶

Example 1. systemd-fstab-generator

systemd-fstab-generator(8) + converts /etc/fstab into native mount + units. It uses argv[1] as location to place the generated unit + files in order to allow the user to override + /etc/fstab with her own native unit files, + but also to ensure that /etc/fstab + overrides any vendor default from /usr. +

After editing /etc/fstab, the user + should invoke systemctl daemon-reload. This + will re-run all generators and cause systemd + to reload units from disk. To actually mount new directories + added to fstab, systemctl start + /path/to/mountpoint or + systemctl start local-fs.target may be used. +


Example 2. systemd-system-update-generator

systemd-system-update-generator(8) + temporarily redirects default.target to + system-update.target if a system update is + scheduled. Since this needs to override the default user + configuration for default.target it uses + argv[2]. For details about this logic, see + Implementing + Offline System Updates.


Example 3. Debuging a generator

dir=$(mktemp -d)
+SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/system-generators/systemd-fstab-generator \
+        "$dir" "$dir" "$dir"
+find $dir

diff --git a/man/systemd.generator.xml b/man/systemd.generator.xml new file mode 100644 index 000000000..ccb698752 --- /dev/null +++ b/man/systemd.generator.xml @@ -0,0 +1,346 @@ + + +%entities; +]> + + + + + + systemd.generator + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.generator + 7 + + + + systemd.generator + Systemd unit generators + + + + + /path/to/generator + normal-dir + early-dir + late-dir + + + + /run/systemd/system-generators/* +/etc/systemd/system-generators/* +/usr/local/lib/systemd/system-generators/* +&systemgeneratordir;/* + + + + /run/systemd/user-generators/* +/etc/systemd/user-generators/* +/usr/local/lib/systemd/user-generators/* +&usergeneratordir;/* + + + + + Description + Generators are small binaries that live in + &usergeneratordir;/ and other directories + listed above. + systemd1 + will execute those binaries very early at bootup and at + configuration reload time — before unit files are loaded. + Generators can dynamically generate unit files or create symbolic + links to unit files to add additional dependencies, thus extending + or overriding existing definitions. Their main purpose is to + convert configuration files that are not native unit files + dynamically into native unit files. + + Generators are loaded from a set of paths determined during + compilation, listed above. System and user generators are loaded + from directories with names ending in + system-generators/ and + user-generators/, respectively. Generators + found in directories listed earlier override the ones with the + same name in directories lower in the list. A symlink to + /dev/null or an empty file can be used to + mask a generator, thereby preventing it from running. Please note + that the order of the two directories with the highest priority is + reversed with respect to the unit load path and generators in + /run overwrite those in + /etc. + + After installing new generators or updating the + configuration, systemctl daemon-reload may be + executed. This will delete the previous configuration created by + generators, re-run all generators, and cause + systemd to reload units from disk. See + systemctl1 + for more information. + + + + + Writing generators + + Generators are invoked with three arguments: paths to + runtime directories where generators can place their generated + unit files or symlinks. + + + + normal-dir + argv[1] may be used to override unit files in + /usr, but not those in + /etc. This means that unit files placed + in this directory take precedence over vendor unit + configuration but not over native user/administrator unit + configuration. + + + + early-dir + argv[2] may be used to override unit files in + /usr and in + /etc. This means that unit files placed + in this directory take precedence over all configuration, + both vendor and user/administrator. + + + + late-dir + argv[3] may be used to extend the unit file tree without + overridding any other unit files. Any native configuration + files supplied by the vendor or user/administrator take + precedence over the generated ones placed in this directory. + + + + + + Notes + + + + + All generators are executed in parallel. That means all + executables are started at the very same time and need to + be able to cope with this parallelism. + + + + + + Generators are run very early at boot and cannot rely on + any external services. They may not talk to any other + process. That includes simple things such as logging to + syslog3, + or systemd itself (this means: no + systemctl1!). They + can however rely on the most basic kernel functionality to + be available, including mounted /sys, + /proc, /dev. + + + + + + Units written by generators are removed when configuration + is reloaded. That means the lifetime of the generated + units is closely bound to the reload cycles of + systemd itself. + + + + + + Generators should only be used to generate unit files, not + any other kind of configuration. Due to the lifecycle + logic mentioned above generators are not a good fit to + generate dynamic configuration for other services. If you + need to generate dynamic configuration for other services + do so in normal services you order before the service in + question. + + + + + + Since + syslog3 + is not available (see above) log messages have to be + written to /dev/kmsg instead. + + + + + + It is a good idea to use the + SourcePath= directive in generated unit + files to specify the source configuration file you are + generating the unit from. This makes things more easily + understood by the user and also has the benefit that + systemd can warn the user about configuration files that + changed on disk but have not been read yet by systemd. + + + + + + Generators may write out dynamic unit files or just hook + unit files into other units with the usual + .wants/ or + .requires/ symlinks. Often it is + nicer to simply instantiate a template unit file from + /usr with a generator instead of + writing out entirely dynamic unit files. Of course this + works only if a single parameter is to be used. + + + + + + If you are careful you can implement generators in shell + scripts. We do recommend C code however, since generators + delay are executed synchronously and hence delay the + entire boot if they are slow. + + + + + Regarding overriding semantics: there are two rules we + try to follow when thinking about the overriding semantics: + + + + + User configuration should override vendor + configuration. This (mostly) means that stuff from + /etc should override stuff from + /usr. + + + + Native configuration should override non-native + configuration. This (mostly) means that stuff you + generate should never override native unit files for the + same purpose. + + + + Of these two rules the first rule is probably the more + important one and breaks the second one sometimes. Hence, + when deciding whether to user argv[1], argv[2], or argv[3], + your default choice should probably be argv[1]. + + + + + Instead of heading off now and writing all kind of + generators for legacy configuration file formats, please + think twice! It's often a better idea to just deprecate + old stuff instead of keeping it artificially alive. + + + + + + + + Examples + + systemd-fstab-generator + + systemd-fstab-generator8 + converts /etc/fstab into native mount + units. It uses argv[1] as location to place the generated unit + files in order to allow the user to override + /etc/fstab with her own native unit files, + but also to ensure that /etc/fstab + overrides any vendor default from /usr. + + + After editing /etc/fstab, the user + should invoke systemctl daemon-reload. This + will re-run all generators and cause systemd + to reload units from disk. To actually mount new directories + added to fstab, systemctl start + /path/to/mountpoint or + systemctl start local-fs.target may be used. + + + + + systemd-system-update-generator + + systemd-system-update-generator8 + temporarily redirects default.target to + system-update.target if a system update is + scheduled. Since this needs to override the default user + configuration for default.target it uses + argv[2]. For details about this logic, see + Implementing + Offline System Updates. + + + + Debuging a generator + + dir=$(mktemp -d) +SYSTEMD_LOG_LEVEL=debug &systemgeneratordir;/systemd-fstab-generator \ + "$dir" "$dir" "$dir" +find $dir + + + + + See also + + + systemd1, + systemd-cryptsetup-generator8, + systemd-debug-generator8, + systemd-efi-boot-generator8, + systemd-fstab-generator8, + fstab5, + systemd-getty-generator8, + systemd-gpt-auto-generator8, + systemd-hibernate-resume-generator8, + systemd-system-update-generator8, + systemd-sysv-generator8, + systemd.unit5, + systemctl1 + + + diff --git a/man/systemd.html b/man/systemd.html index e96e7faa1..55e643c1d 100644 --- a/man/systemd.html +++ b/man/systemd.html @@ -19,653 +19,474 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd, init — systemd system and service manager

Synopsis

systemd [OPTIONS...]

init [OPTIONS...] {COMMAND}

Description¶

systemd is a system and service manager for - Linux operating systems. When run as first process on - boot (as PID 1), it acts as init system that brings - up and maintains userspace services.

For compatibility with SysV, if systemd is called - as init and a PID that is not - 1, it will execute telinit and pass - all command line arguments unmodified. That means - init and telinit - are mostly equivalent when invoked from normal login sessions. See - telinit(8) - for more information.

When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. See - systemd-system.conf(5) - for more information.

Options¶

The following options are understood:

--test¶

Determine startup - sequence, dump it and exit. This is an - option useful for debugging - only.

--dump-configuration-items¶

Dump understood unit - configuration items. This outputs a - terse but complete list of - configuration items understood in unit - definition files.

--unit=¶

Set default unit to - activate on startup. If not specified, - defaults to - default.target.

--system, --user¶

For --system, - tell systemd to run a - system instance, even if the process ID is - not 1, i.e. systemd is not run as init process. - --user does the opposite, - running a user instance even if the process - ID is 1. - Normally it should not be necessary to - pass these options, as systemd - automatically detects the mode it is - started in. These options are hence of - little use except for debugging. Note - that it is not supported booting and - maintaining a full system with systemd - running in --system - mode, but PID not 1. In practice, - passing --system explicitly is - only useful in conjunction with - --test.

--dump-core¶

Dump core on - crash. This switch has no effect when - run as user - instance.

--crash-shell¶

Run shell on - crash. This switch has no effect when - run as user - instance.

--confirm-spawn¶

Ask for confirmation - when spawning processes. This switch - has no effect when run as user - instance.

--show-status=¶

Show terse service - status information while booting. This - switch has no effect when run as user - instance. Takes a boolean argument - which may be omitted which is - interpreted as - true.

--log-target=¶

Set log - target. Argument must be one of - console, - journal, - kmsg, - journal-or-kmsg, - null.

--log-level=¶

Set log level. As - argument this accepts a numerical log - level or the well-known syslog(3) - symbolic names (lowercase): - emerg, - alert, - crit, - err, - warning, - notice, - info, - debug.

--log-color=¶

Highlight important - log messages. Argument is a boolean - value. If the argument is omitted, it - defaults to - true.

--log-location=¶

Include code location - in log messages. This is mostly - relevant for debugging - purposes. Argument is a boolean - value. If the argument is omitted - it defaults to - true.

--default-standard-output=, --default-standard-error=¶

Sets the default - output or error output for all - services and sockets, respectively. That is, controls - the default for - StandardOutput= - and StandardError= - (see - systemd.exec(5) - for details). Takes one of - inherit, - null, - tty, - journal, - journal+console, - syslog, - syslog+console, - kmsg, - kmsg+console. If the - argument is omitted - --default-standard-output= - defaults to journal - and - --default-standard-error= - to - inherit.

-h, --help¶

Print a short help text and exit. -

--version¶

Print a short version string and exit.

Concepts¶

systemd provides a dependency system between - various entities called "units" of 12 different - types. Units encapsulate various objects that are - relevant for system boot-up and maintenance. The - majority of units are configured in unit configuration - files, whose syntax and basic set of options is - described in - systemd.unit(5), - however some are created automatically from other - configuration, dynamically from system state or - programmatically at runtime. Units may be "active" - (meaning started, bound, plugged in, ..., depending on - the unit type, see below), or "inactive" (meaning - stopped, unbound, unplugged, ...), as well as in the - process of being activated or deactivated, - i.e. between the two states (these states are called - "activating", "deactivating"). A special "failed" - state is available as well, which is very similar to - "inactive" and is entered when the service failed in - some way (process returned error code on exit, or - crashed, or an operation timed out). If this state is - entered, the cause will be logged, for later - reference. Note that the various unit types may have a - number of additional substates, which are mapped to - the five generalized unit states described - here.

The following unit types are available:

  1. Service units, which start and control - daemons and the processes they consist of. For - details see - systemd.service(5).

  2. Socket units, which - encapsulate local IPC or network sockets in - the system, useful for socket-based - activation. For details about socket units see - systemd.socket(5), - for details on socket-based activation and - other forms of activation, see - daemon(7).

  3. Target units are useful to - group units, or provide well-known - synchronization points during boot-up, see - systemd.target(5).

  4. Device units expose kernel - devices in systemd and may be used to - implement device-based activation. For details - see - systemd.device(5).

  5. Mount units control mount - points in the file system, for details see - systemd.mount(5).

  6. Automount units provide - automount capabilities, for on-demand mounting - of file systems as well as parallelized - boot-up. See - systemd.automount(5).

  7. Snapshot units can be used to - temporarily save the state of the set of - systemd units, which later may be restored by - activating the saved snapshot unit. For more - information see - systemd.snapshot(5).

  8. Timer units are useful for - triggering activation of other units based on - timers. You may find details in - systemd.timer(5).

  9. Swap units are very similar to - mount units and encapsulate memory swap - partitions or files of the operating - system. They are described in systemd.swap(5).

  10. Path units may be used - to activate other services when file system - objects change or are modified. See - systemd.path(5).

  11. Slice units may be used to - group units which manage system processes - (such as service and scope units) in a - hierarchical tree for resource management - purposes. See - systemd.slice(5).

  12. Scope units are similar to - service units, but manage foreign processes - instead of starting them as well. See - systemd.scope(5).

Units are named as their configuration - files. Some units have special semantics. A detailed - list is available in - systemd.special(7).

systemd knows various kinds of dependencies, - including positive and negative requirement - dependencies (i.e. Requires= and - Conflicts=) as well as ordering - dependencies (After= and - Before=). NB: ordering and - requirement dependencies are orthogonal. If only a - requirement dependency exists between two units - (e.g. foo.service requires - bar.service), but no ordering - dependency (e.g. foo.service - after bar.service) and both are - requested to start, they will be started in - parallel. It is a common pattern that both requirement - and ordering dependencies are placed between two - units. Also note that the majority of dependencies are - implicitly created and maintained by systemd. In most - cases, it should be unnecessary to declare additional - dependencies manually, however it is possible to do - this.

Application programs and units (via - dependencies) may request state changes of units. In - systemd, these requests are encapsulated as 'jobs' and - maintained in a job queue. Jobs may succeed or can - fail, their execution is ordered based on the ordering - dependencies of the units they have been scheduled - for.

On boot systemd activates the target unit - default.target whose job is to - activate on-boot services and other on-boot units by - pulling them in via dependencies. Usually the unit - name is just an alias (symlink) for either - graphical.target (for - fully-featured boots into the UI) or - multi-user.target (for limited - console-only boots for use in embedded or server - environments, or similar; a subset of - graphical.target). However, it is at the discretion of - the administrator to configure it as an alias to any - other target unit. See - systemd.special(7) - for details about these target units.

Processes systemd spawns are placed in - individual Linux control groups named after the unit - which they belong to in the private systemd - hierarchy. (see cgroups.txt - for more information about control groups, or short - "cgroups"). systemd uses this to effectively keep - track of processes. Control group information is - maintained in the kernel, and is accessible via the - file system hierarchy (beneath - /sys/fs/cgroup/systemd/), or in tools - such as - ps(1) - (ps xawf -eo pid,user,cgroup,args - is particularly useful to list all processes and the - systemd units they belong to.).

systemd is compatible with the SysV init system - to a large degree: SysV init scripts are supported and - simply read as an alternative (though limited) - configuration file format. The SysV - /dev/initctl interface is - provided, and compatibility implementations of the - various SysV client tools are available. In addition to - that, various established Unix functionality such as - /etc/fstab or the - utmp database are - supported.

systemd has a minimal transaction system: if a - unit is requested to start up or shut down it will add - it and all its dependencies to a temporary - transaction. Then, it will verify if the transaction - is consistent (i.e. whether the ordering of all units - is cycle-free). If it is not, systemd will try to fix - it up, and removes non-essential jobs from the - transaction that might remove the loop. Also, systemd - tries to suppress non-essential jobs in the - transaction that would stop a running service. Finally - it is checked whether the jobs of the transaction - contradict jobs that have already been queued, and - optionally the transaction is aborted then. If all - worked out and the transaction is consistent and - minimized in its impact it is merged with all already - outstanding jobs and added to the run - queue. Effectively this means that before executing a - requested operation, systemd will verify that it makes - sense, fixing it if possible, and only failing if it - really cannot work.

Systemd contains native implementations of - various tasks that need to be executed as part of the - boot process. For example, it sets the hostname or - configures the loopback network device. It also sets - up and mounts various API file systems, such as - /sys or - /proc.

For more information about the concepts and - ideas behind systemd, please refer to the Original - Design Document.

Note that some but not all interfaces provided - by systemd are covered by the Interface - Stability Promise.

Units may be generated dynamically at boot and - system manager reload time, for example based on other - configuration files or parameters passed on the kernel - command line. For details see the Generators - Specification.

Systems which invoke systemd in a container - or initrd environment should implement the - Container - Interface or initrd - Interface specifications, respectively.

Directories¶

System unit directories¶

The systemd system - manager reads unit configuration from - various directories. Packages that - want to install unit files shall place - them in the directory returned by - pkg-config systemd - --variable=systemdsystemunitdir. Other - directories checked are - /usr/local/lib/systemd/system - and - /usr/lib/systemd/system. User - configuration always takes - precedence. pkg-config - systemd - --variable=systemdsystemconfdir - returns the path of the system - configuration directory. Packages - should alter the content of these - directories only with the - enable and - disable commands of - the - systemctl(1) - tool. Full list of directories is provided in - systemd.unit(5). -

User unit directories¶

Similar rules apply - for the user unit - directories. However, here the XDG - Base Directory specification - is followed to find - units. Applications should place their - unit files in the directory returned - by pkg-config systemd - --variable=systemduserunitdir. Global - configuration is done in the directory - reported by pkg-config - systemd - --variable=systemduserconfdir. The - enable and - disable commands of - the - systemctl(1) - tool can handle both global (i.e. for - all users) and private (for one user) - enabling/disabling of - units. Full list of directories is provided in - systemd.unit(5). -

SysV init scripts directory¶

The location of the - SysV init script directory varies - between distributions. If systemd - cannot find a native unit file for a - requested service, it will look for a - SysV init script of the same name - (with the - .service suffix - removed).

The location of the - SysV runlevel link farm directory - varies between distributions. systemd - will take the link farm into account - when figuring out whether a service - shall be enabled. Note that a service - unit with a native unit configuration - file cannot be started by activating it - in the SysV runlevel link - farm.

Signals¶

SIGTERM¶

Upon receiving this - signal the systemd system manager - serializes its state, reexecutes - itself and deserializes the saved - state again. This is mostly equivalent - to systemctl - daemon-reexec.

systemd user managers will - start the - exit.target unit - when this signal is received. This is - mostly equivalent to - systemctl --user start - exit.target.

SIGINT¶

Upon receiving this - signal the systemd system manager will - start the - ctrl-alt-del.target unit. This - is mostly equivalent to - systemctl start - ctl-alt-del.target.

systemd user managers - treat this signal the same way as - SIGTERM.

SIGWINCH¶

When this signal is - received the systemd system manager - will start the - kbrequest.target - unit. This is mostly equivalent to - systemctl start - kbrequest.target.

This signal is ignored by - systemd user - managers.

SIGPWR¶

When this signal is - received the systemd manager - will start the - sigpwr.target - unit. This is mostly equivalent to - systemctl start - sigpwr.target.

SIGUSR1¶

When this signal is - received the systemd manager will try - to reconnect to the D-Bus - bus.

SIGUSR2¶

When this signal is - received the systemd manager will log - its complete state in human readable - form. The data logged is the same as - printed by systemd-analyze - dump.

SIGHUP¶

Reloads the complete - daemon configuration. This is mostly - equivalent to systemctl - daemon-reload.

SIGRTMIN+0¶

Enters default mode, starts the - default.target - unit. This is mostly equivalent to - systemctl start - default.target.

SIGRTMIN+1¶

Enters rescue mode, - starts the - rescue.target - unit. This is mostly equivalent to - systemctl isolate - rescue.target.

SIGRTMIN+2¶

Enters emergency mode, - starts the - emergency.service - unit. This is mostly equivalent to - systemctl isolate - emergency.service.

SIGRTMIN+3¶

Halts the machine, - starts the - halt.target - unit. This is mostly equivalent to - systemctl start - halt.target.

SIGRTMIN+4¶

Powers off the machine, - starts the - poweroff.target - unit. This is mostly equivalent to - systemctl start - poweroff.target.

SIGRTMIN+5¶

Reboots the machine, - starts the - reboot.target - unit. This is mostly equivalent to - systemctl start - reboot.target.

SIGRTMIN+6¶

Reboots the machine via kexec, - starts the - kexec.target - unit. This is mostly equivalent to - systemctl start - kexec.target.

SIGRTMIN+13¶

Immediately halts the machine.

SIGRTMIN+14¶

Immediately powers off the machine.

SIGRTMIN+15¶

Immediately reboots the machine.

SIGRTMIN+16¶

Immediately reboots the machine with kexec.

SIGRTMIN+20¶

Enables display of - status messages on the console, as - controlled via - systemd.show_status=1 - on the kernel command - line.

SIGRTMIN+21¶

Disables display of - status messages on the console, as - controlled via - systemd.show_status=0 - on the kernel command - line.

SIGRTMIN+22, SIGRTMIN+23¶

Sets the log level to - "debug" - (or "info" on - SIGRTMIN+23), as - controlled via - systemd.log_level=debug - (or systemd.log_level=info - on SIGRTMIN+23) on - the kernel command - line.

SIGRTMIN+24¶

Immediately exits the - manager (only available for --user - instances).

SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28¶

Sets the log level to - "journal-or-kmsg" (or - "console" on - SIGRTMIN+27, - "kmsg" on - SIGRTMIN+28), as - controlled via - systemd.log_target=journal-or-kmsg - (or - systemd.log_target=console - on SIGRTMIN+27 or - systemd.log_target=kmsg - on SIGRTMIN+28) - on the kernel command - line.

Environment¶

$SYSTEMD_LOG_LEVEL¶

systemd reads the - log level from this environment - variable. This can be overridden with - --log-level=.

$SYSTEMD_LOG_TARGET¶

systemd reads the - log target from this environment - variable. This can be overridden with - --log-target=.

$SYSTEMD_LOG_COLOR¶

Controls whether - systemd highlights important log - messages. This can be overridden with - --log-color=.

$SYSTEMD_LOG_LOCATION¶

Controls whether - systemd prints the code location along - with log messages. This can be - overridden with - --log-location=.

$XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS¶

The systemd user - manager uses these variables in - accordance to the XDG - Base Directory specification - to find its configuration.

$SYSTEMD_UNIT_PATH¶

Controls where systemd - looks for unit - files.

$SYSTEMD_SYSVINIT_PATH¶

Controls where systemd - looks for SysV init scripts.

$SYSTEMD_SYSVRCND_PATH¶

Controls where systemd - looks for SysV init script runlevel link - farms.

$LISTEN_PID, $LISTEN_FDS¶

Set by systemd for - supervised processes during - socket-based activation. See - sd_listen_fds(3) - for more information. -

$NOTIFY_SOCKET¶

Set by systemd for - supervised processes for status and - start-up completion notification. See - sd_notify(3) - for more information. -

Kernel Command Line¶

When run as system instance systemd parses a - number of kernel command line - arguments[1]:

systemd.unit=, rd.systemd.unit=¶

Overrides the unit to - activate on boot. Defaults to - default.target. This - may be used to temporarily boot into a - different boot unit, for example - rescue.target or - emergency.service. See - systemd.special(7) - for details about these units. The - option prefixed with - "rd." is honored - only in the initial RAM disk (initrd), - while the one that is not prefixed only - in the main system.

systemd.dump_core=¶

Takes a boolean - argument. If true, - systemd dumps core when it - crashes. Otherwise, no core dump is - created. Defaults to - true.

systemd.crash_shell=¶

Takes a boolean - argument. If true, - systemd spawns a shell when it - crashes. Otherwise, no shell is - spawned. Defaults to - false, for security - reasons, as the shell is not protected - by any password - authentication.

systemd.crash_chvt=¶

Takes an integer - argument. If positive systemd - activates the specified virtual - terminal when it crashes. Defaults to - -1.

systemd.confirm_spawn=¶

Takes a boolean - argument. If true, - asks for confirmation when spawning - processes. Defaults to - false.

systemd.show_status=¶

Takes a boolean - argument or the constant - auto. If - true, shows terse - service status updates on the console - during bootup. - auto behaves like - false until a service - fails or there is a significant delay - in boot. Defaults to - true, unless - quiet is passed as - kernel command line option in which - case it defaults to - auto.

systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=¶

Controls log output, - with the same effect as the - $SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION - environment variables described above.

systemd.default_standard_output=, systemd.default_standard_error=¶

Controls default - standard output and error output for - services, with the same effect as the - --default-standard-output= - and --default-standard-error= - command line arguments described - above, respectively.

systemd.setenv=¶

Takes a string - argument in the form VARIABLE=VALUE. - May be used to set default environment - variables to add to forked child processes. - May be used more than once to set multiple - variables.

quiet¶

Turn off - status output at boot, much like - systemd.show_status=false - would. Note that this option is also - read by the kernel itself and disables - kernel log output. Passing this option - hence turns off the usual output from - both the system manager and the kernel. -

debug¶

Turn on debugging - output. This is equivalent to - systemd.log_level=debug. - Note that this option is also read by - the kernel itself and enables kernel - debug output. Passing this option - hence turns on the debug output from - both the system manager and the - kernel.

emergency, -b¶

Boot into emergency - mode. This is equivalent to - systemd.unit=emergency.target - and provided for compatibility reasons - and to be easier to - type.

rescue, single, s, S, 1¶

Boot into rescue - mode. This is equivalent to - systemd.unit=rescue.target - and provided for compatibility reasons - and to be easier to - type.

2, 3, 4, 5¶

Boot into the - specified legacy SysV runlevel. These - are equivalent to - systemd.unit=runlevel2.target, - systemd.unit=runlevel3.target, - systemd.unit=runlevel4.target, - and systemd.unit=runlevel5.target, respectively, - and provided for compatibility reasons - and to be easier to - type.

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Set the system locale - to use. This overrides the settings in - /etc/locale.conf. For - more information see - locale.conf(5) - and - locale(7). -

For other kernel command line parameters - understood by components of the core OS, please refer - to - kernel-command-line(7).

Sockets and FIFOs¶

/run/systemd/notify¶

Daemon status - notification socket. This is an - AF_UNIX datagram socket and is used to - implement the daemon notification - logic as implemented by - sd_notify(3).

/run/systemd/shutdownd¶

Used internally by the - shutdown(8) - tool to implement delayed - shutdowns. This is an AF_UNIX datagram - socket.

/run/systemd/private¶

Used internally as - communication channel between - systemctl(1) - and the systemd process. This is an - AF_UNIX stream socket. This interface - is private to systemd and should not - be used in external - projects.

/dev/initctl¶

Limited compatibility - support for the SysV client interface, - as implemented by the - systemd-initctl.service - unit. This is a named pipe in the file - system. This interface is obsolete and - should not be used in new - applications.



[1] If run inside a Linux - container these arguments may be passed as command - line arguments to systemd itself, next to any of the - command line options listed in the Options section - above. If run outside of Linux containers, these - arguments are parsed from - /proc/cmdline - instead.

+ gudev systemd 219

Name

systemd, init — systemd system and service manager

Synopsis

systemd [OPTIONS...]

init [OPTIONS...] {COMMAND}

Description¶

systemd is a system and service manager for Linux operating + systems. When run as first process on boot (as PID 1), it acts as + init system that brings up and maintains userspace + services.

For compatibility with SysV, if systemd is called as + init and a PID that is not 1, it will execute + telinit and pass all command line arguments + unmodified. That means init and + telinit are mostly equivalent when invoked from + normal login sessions. See + telinit(8) + for more information.

When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. See + systemd-system.conf(5) + for more information.

Options¶

The following options are understood:

--test¶

Determine startup sequence, dump it and exit. + This is an option useful for debugging only.

--dump-configuration-items¶

Dump understood unit configuration items. This + outputs a terse but complete list of configuration items + understood in unit definition files.

--unit=¶

Set default unit to activate on startup. If + not specified, defaults to + default.target.

--system, --user¶

For --system, tell systemd to + run a system instance, even if the process ID is not 1, i.e. + systemd is not run as init process. --user + does the opposite, running a user instance even if the process + ID is 1. Normally it should not be necessary to pass these + options, as systemd automatically detects the mode it is + started in. These options are hence of little use except for + debugging. Note that it is not supported booting and + maintaining a full system with systemd running in + --system mode, but PID not 1. In practice, + passing --system explicitly is only useful in + conjunction with --test.

--dump-core¶

Dump core on crash. This switch has no effect + when run as user instance.

--crash-shell¶

Run shell on + crash. This switch has no effect when + run as user + instance.

--confirm-spawn¶

Ask for confirmation when spawning processes. + This switch has no effect when run as user + instance.

--show-status=¶

Show terse service status information while + booting. This switch has no effect when run as user instance. + Takes a boolean argument which may be omitted which is + interpreted as true.

--log-target=¶

Set log target. Argument must be one of + console, + journal, + kmsg, + journal-or-kmsg, + null.

--log-level=¶

Set log level. As + argument this accepts a numerical log + level or the well-known syslog(3) + symbolic names (lowercase): + emerg, + alert, + crit, + err, + warning, + notice, + info, + debug.

--log-color=¶

Highlight important log messages. Argument is + a boolean value. If the argument is omitted, it defaults to + true.

--log-location=¶

Include code location in log messages. This is + mostly relevant for debugging purposes. Argument is a boolean + value. If the argument is omitted it defaults to + true.

--default-standard-output=, --default-standard-error=¶

Sets the default output or error output for + all services and sockets, respectively. That is, controls the + default for StandardOutput= and + StandardError= (see + systemd.exec(5) + for details). Takes one of + inherit, + null, + tty, + journal, + journal+console, + syslog, + syslog+console, + kmsg, + kmsg+console. If the + argument is omitted + --default-standard-output= defaults to + journal and + --default-standard-error= to + inherit.

-h, --help¶

Print a short help text and exit. +

--version¶

Print a short version string and exit.

Concepts¶

systemd provides a dependency system between various + entities called "units" of 12 different types. Units encapsulate + various objects that are relevant for system boot-up and + maintenance. The majority of units are configured in unit + configuration files, whose syntax and basic set of options is + described in + systemd.unit(5), + however some are created automatically from other configuration, + dynamically from system state or programmatically at runtime. + Units may be "active" (meaning started, bound, plugged in, ..., + depending on the unit type, see below), or "inactive" (meaning + stopped, unbound, unplugged, ...), as well as in the process of + being activated or deactivated, i.e. between the two states (these + states are called "activating", "deactivating"). A special + "failed" state is available as well, which is very similar to + "inactive" and is entered when the service failed in some way + (process returned error code on exit, or crashed, or an operation + timed out). If this state is entered, the cause will be logged, + for later reference. Note that the various unit types may have a + number of additional substates, which are mapped to the five + generalized unit states described here.

The following unit types are available:

  1. Service units, which start and control daemons + and the processes they consist of. For details see + systemd.service(5).

  2. Socket units, which encapsulate local IPC or + network sockets in the system, useful for socket-based + activation. For details about socket units see + systemd.socket(5), + for details on socket-based activation and other forms of + activation, see + daemon(7).

  3. Target units are useful to group units, or + provide well-known synchronization points during boot-up, see + systemd.target(5).

  4. Device units expose kernel devices in systemd + and may be used to implement device-based activation. For + details see + systemd.device(5).

  5. Mount units control mount points in the file + system, for details see + systemd.mount(5).

  6. Automount units provide automount capabilities, + for on-demand mounting of file systems as well as parallelized + boot-up. See + systemd.automount(5).

  7. Snapshot units can be used to temporarily save + the state of the set of systemd units, which later may be + restored by activating the saved snapshot unit. For more + information see + systemd.snapshot(5).

  8. Timer units are useful for triggering activation + of other units based on timers. You may find details in + systemd.timer(5).

  9. Swap units are very similar to mount units and + encapsulate memory swap partitions or files of the operating + system. They are described in + systemd.swap(5).

  10. Path units may be used to activate other + services when file system objects change or are modified. See + systemd.path(5).

  11. Slice units may be used to group units which + manage system processes (such as service and scope units) in a + hierarchical tree for resource management purposes. See + systemd.slice(5).

  12. Scope units are similar to service units, but + manage foreign processes instead of starting them as well. See + systemd.scope(5).

Units are named as their configuration files. Some units + have special semantics. A detailed list is available in + systemd.special(7).

systemd knows various kinds of dependencies, including + positive and negative requirement dependencies (i.e. + Requires= and Conflicts=) as + well as ordering dependencies (After= and + Before=). NB: ordering and requirement + dependencies are orthogonal. If only a requirement dependency + exists between two units (e.g. foo.service + requires bar.service), but no ordering + dependency (e.g. foo.service after + bar.service) and both are requested to start, + they will be started in parallel. It is a common pattern that both + requirement and ordering dependencies are placed between two + units. Also note that the majority of dependencies are implicitly + created and maintained by systemd. In most cases, it should be + unnecessary to declare additional dependencies manually, however + it is possible to do this.

Application programs and units (via dependencies) may + request state changes of units. In systemd, these requests are + encapsulated as 'jobs' and maintained in a job queue. Jobs may + succeed or can fail, their execution is ordered based on the + ordering dependencies of the units they have been scheduled + for.

On boot systemd activates the target unit + default.target whose job is to activate + on-boot services and other on-boot units by pulling them in via + dependencies. Usually the unit name is just an alias (symlink) for + either graphical.target (for fully-featured + boots into the UI) or multi-user.target (for + limited console-only boots for use in embedded or server + environments, or similar; a subset of graphical.target). However, + it is at the discretion of the administrator to configure it as an + alias to any other target unit. See + systemd.special(7) + for details about these target units.

Processes systemd spawns are placed in individual Linux + control groups named after the unit which they belong to in the + private systemd hierarchy. (see cgroups.txt + for more information about control groups, or short "cgroups"). + systemd uses this to effectively keep track of processes. Control + group information is maintained in the kernel, and is accessible + via the file system hierarchy (beneath + /sys/fs/cgroup/systemd/), or in tools such as + ps(1) + (ps xawf -eo pid,user,cgroup,args is + particularly useful to list all processes and the systemd units + they belong to.).

systemd is compatible with the SysV init system to a large + degree: SysV init scripts are supported and simply read as an + alternative (though limited) configuration file format. The SysV + /dev/initctl interface is provided, and + compatibility implementations of the various SysV client tools are + available. In addition to that, various established Unix + functionality such as /etc/fstab or the + utmp database are supported.

systemd has a minimal transaction system: if a unit is + requested to start up or shut down it will add it and all its + dependencies to a temporary transaction. Then, it will verify if + the transaction is consistent (i.e. whether the ordering of all + units is cycle-free). If it is not, systemd will try to fix it up, + and removes non-essential jobs from the transaction that might + remove the loop. Also, systemd tries to suppress non-essential + jobs in the transaction that would stop a running service. Finally + it is checked whether the jobs of the transaction contradict jobs + that have already been queued, and optionally the transaction is + aborted then. If all worked out and the transaction is consistent + and minimized in its impact it is merged with all already + outstanding jobs and added to the run queue. Effectively this + means that before executing a requested operation, systemd will + verify that it makes sense, fixing it if possible, and only + failing if it really cannot work.

Systemd contains native implementations of various tasks + that need to be executed as part of the boot process. For example, + it sets the hostname or configures the loopback network device. It + also sets up and mounts various API file systems, such as + /sys or /proc.

For more information about the concepts and + ideas behind systemd, please refer to the + Original Design Document.

Note that some but not all interfaces provided + by systemd are covered by the + Interface + Stability Promise.

Units may be generated dynamically at boot and system + manager reload time, for example based on other configuration + files or parameters passed on the kernel command line. For details + see the + Generators Specification.

Systems which invoke systemd in a container or initrd + environment should implement the + Container Interface or + initrd Interface + specifications, respectively.

Directories¶

System unit directories¶

The systemd system manager reads unit + configuration from various directories. Packages that want to + install unit files shall place them in the directory returned + by pkg-config systemd + --variable=systemdsystemunitdir. Other directories + checked are /usr/local/lib/systemd/system + and /usr/lib/systemd/system. User + configuration always takes precedence. pkg-config + systemd --variable=systemdsystemconfdir returns the + path of the system configuration directory. Packages should + alter the content of these directories only with the + enable and disable + commands of the + systemctl(1) + tool. Full list of directories is provided in + systemd.unit(5). +

User unit directories¶

Similar rules apply for the user unit + directories. However, here the + XDG + Base Directory specification is followed to find + units. Applications should place their unit files in the + directory returned by pkg-config systemd + --variable=systemduserunitdir. Global configuration + is done in the directory reported by pkg-config + systemd --variable=systemduserconfdir. The + enable and disable + commands of the + systemctl(1) + tool can handle both global (i.e. for all users) and private + (for one user) enabling/disabling of units. Full list of + directories is provided in + systemd.unit(5). +

SysV init scripts directory¶

The location of the SysV init script directory + varies between distributions. If systemd cannot find a native + unit file for a requested service, it will look for a SysV + init script of the same name (with the + .service suffix + removed).

The location of the SysV runlevel link farm + directory varies between distributions. systemd will take the + link farm into account when figuring out whether a service + shall be enabled. Note that a service unit with a native unit + configuration file cannot be started by activating it in the + SysV runlevel link farm.

Signals¶

SIGTERM¶

Upon receiving this signal the systemd system + manager serializes its state, reexecutes itself and + deserializes the saved state again. This is mostly equivalent + to systemctl daemon-reexec.

systemd user managers will start the + exit.target unit when this signal is + received. This is mostly equivalent to systemctl + --user start exit.target.

SIGINT¶

Upon receiving this signal the systemd system + manager will start the + ctrl-alt-del.target unit. This is mostly + equivalent to systemctl start + ctl-alt-del.target. If this signal is received more + often than 7 times per 2s an immediate reboot is triggered. + Note that pressing Ctrl-Alt-Del on the console will trigger + this signal. Hence, if a reboot is hanging pressing + Ctrl-Alt-Del more than 7 times in 2s is a relatively safe way + to trigger an immediate reboot.

systemd user managers treat this signal the same way as + SIGTERM.

SIGWINCH¶

When this signal is received the systemd + system manager will start the + kbrequest.target unit. This is mostly + equivalent to systemctl start + kbrequest.target.

This signal is ignored by systemd user + managers.

SIGPWR¶

When this signal is received the systemd + manager will start the sigpwr.target + unit. This is mostly equivalent to systemctl start + sigpwr.target.

SIGUSR1¶

When this signal is received the systemd + manager will try to reconnect to the D-Bus + bus.

SIGUSR2¶

When this signal is received the systemd + manager will log its complete state in human readable form. + The data logged is the same as printed by + systemd-analyze dump.

SIGHUP¶

Reloads the complete daemon configuration. + This is mostly equivalent to systemctl + daemon-reload.

SIGRTMIN+0¶

Enters default mode, starts the + default.target unit. This is mostly + equivalent to systemctl start + default.target.

SIGRTMIN+1¶

Enters rescue mode, starts the + rescue.target unit. This is mostly + equivalent to systemctl isolate + rescue.target.

SIGRTMIN+2¶

Enters emergency mode, starts the + emergency.service unit. This is mostly + equivalent to systemctl isolate + emergency.service.

SIGRTMIN+3¶

Halts the machine, starts the + halt.target unit. This is mostly + equivalent to systemctl start + halt.target.

SIGRTMIN+4¶

Powers off the machine, starts the + poweroff.target unit. This is mostly + equivalent to systemctl start + poweroff.target.

SIGRTMIN+5¶

Reboots the machine, starts the + reboot.target unit. This is mostly + equivalent to systemctl start + reboot.target.

SIGRTMIN+6¶

Reboots the machine via kexec, starts the + kexec.target unit. This is mostly + equivalent to systemctl start + kexec.target.

SIGRTMIN+13¶

Immediately halts the machine.

SIGRTMIN+14¶

Immediately powers off the machine.

SIGRTMIN+15¶

Immediately reboots the machine.

SIGRTMIN+16¶

Immediately reboots the machine with kexec.

SIGRTMIN+20¶

Enables display of status messages on the + console, as controlled via + systemd.show_status=1 on the kernel command + line.

SIGRTMIN+21¶

Disables display of + status messages on the console, as + controlled via + systemd.show_status=0 + on the kernel command + line.

SIGRTMIN+22, SIGRTMIN+23¶

Sets the log level to "debug" + (or "info" on + SIGRTMIN+23), as controlled via + systemd.log_level=debug (or + systemd.log_level=info on + SIGRTMIN+23) on the kernel command + line.

SIGRTMIN+24¶

Immediately exits the manager (only available + for --user instances).

SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28¶

Sets the log level to + "journal-or-kmsg" (or + "console" on + SIGRTMIN+27, "kmsg" on + SIGRTMIN+28), as controlled via + systemd.log_target=journal-or-kmsg (or + systemd.log_target=console on + SIGRTMIN+27 or + systemd.log_target=kmsg on + SIGRTMIN+28) on the kernel command + line.

Environment¶

$SYSTEMD_LOG_LEVEL¶

systemd reads the log level from this + environment variable. This can be overridden with + --log-level=.

$SYSTEMD_LOG_TARGET¶

systemd reads the log target from this + environment variable. This can be overridden with + --log-target=.

$SYSTEMD_LOG_COLOR¶

Controls whether systemd highlights important + log messages. This can be overridden with + --log-color=.

$SYSTEMD_LOG_LOCATION¶

Controls whether systemd prints the code + location along with log messages. This can be overridden with + --log-location=.

$XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS¶

The systemd user manager uses these variables + in accordance to the XDG + Base Directory specification to find its + configuration.

$SYSTEMD_UNIT_PATH¶

Controls where systemd looks for unit + files.

$SYSTEMD_SYSVINIT_PATH¶

Controls where systemd looks for SysV init + scripts.

$SYSTEMD_SYSVRCND_PATH¶

Controls where systemd looks for SysV init + script runlevel link farms.

$LISTEN_PID, $LISTEN_FDS¶

Set by systemd for supervised processes during + socket-based activation. See + sd_listen_fds(3) + for more information.

$NOTIFY_SOCKET¶

Set by systemd for supervised processes for + status and start-up completion notification. See + sd_notify(3) + for more information.

Kernel Command Line¶

When run as system instance systemd parses a number of + kernel command line arguments[1]:

systemd.unit=, rd.systemd.unit=¶

Overrides the unit to activate on boot. + Defaults to default.target. This may be + used to temporarily boot into a different boot unit, for + example rescue.target or + emergency.service. See + systemd.special(7) + for details about these units. The option prefixed with + "rd." is honored only in the initial RAM disk + (initrd), while the one that is not prefixed only in the main + system.

systemd.dump_core=¶

Takes a boolean argument. If + true, systemd dumps core when it crashes. + Otherwise, no core dump is created. Defaults to + true.

systemd.crash_shell=¶

Takes a boolean argument. If + true, systemd spawns a shell when it crashes. + Otherwise, no shell is spawned. Defaults to + false, for security reasons, as the shell is + not protected by any password + authentication.

systemd.crash_chvt=¶

Takes an integer argument. If positive systemd + activates the specified virtual terminal when it crashes. + Defaults to -1.

systemd.confirm_spawn=¶

Takes a boolean argument. If + true, asks for confirmation when spawning + processes. Defaults to + false.

systemd.show_status=¶

Takes a boolean argument or the constant + auto. If true, shows + terse service status updates on the console during bootup. + auto behaves like false + until a service fails or there is a significant delay in boot. + Defaults to true, unless + quiet is passed as kernel command line option + in which case it defaults to + auto.

systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=¶

Controls log output, with the same effect as + the $SYSTEMD_LOG_TARGET, + $SYSTEMD_LOG_LEVEL, + $SYSTEMD_LOG_COLOR, + $SYSTEMD_LOG_LOCATION environment variables + described above.

systemd.default_standard_output=, systemd.default_standard_error=¶

Controls default standard output and error + output for services, with the same effect as the + --default-standard-output= and + --default-standard-error= command line + arguments described above, respectively.

systemd.setenv=¶

Takes a string argument in the form + VARIABLE=VALUE. May be used to set default environment + variables to add to forked child processes. May be used more + than once to set multiple variables.

quiet¶

Turn off status output at boot, much like + systemd.show_status=false would. Note that + this option is also read by the kernel itself and disables + kernel log output. Passing this option hence turns off the + usual output from both the system manager and the kernel. +

debug¶

Turn on debugging output. This is equivalent + to systemd.log_level=debug. Note that this + option is also read by the kernel itself and enables kernel + debug output. Passing this option hence turns on the debug + output from both the system manager and the + kernel.

emergency, -b¶

Boot into emergency mode. This is equivalent + to systemd.unit=emergency.target and + provided for compatibility reasons and to be easier to + type.

rescue, single, s, S, 1¶

Boot into rescue mode. This is equivalent to + systemd.unit=rescue.target and provided for + compatibility reasons and to be easier to + type.

2, 3, 4, 5¶

Boot into the specified legacy SysV runlevel. + These are equivalent to + systemd.unit=runlevel2.target, + systemd.unit=runlevel3.target, + systemd.unit=runlevel4.target, and + systemd.unit=runlevel5.target, + respectively, and provided for compatibility reasons and to be + easier to type.

locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=¶

Set the system locale to use. This overrides + the settings in /etc/locale.conf. For + more information see + locale.conf(5) + and + locale(7). +

For other kernel command line parameters understood by + components of the core OS, please refer to + kernel-command-line(7).

Sockets and FIFOs¶

/run/systemd/notify¶

Daemon status notification socket. This is an + AF_UNIX datagram socket and is used to + implement the daemon notification logic as implemented by + sd_notify(3).

/run/systemd/shutdownd¶

Used internally by the + shutdown(8) + tool to implement delayed shutdowns. This is an + AF_UNIX datagram + socket.

/run/systemd/private¶

Used internally as communication channel + between + systemctl(1) + and the systemd process. This is an + AF_UNIX stream socket. This interface is + private to systemd and should not be used in external + projects.

/dev/initctl¶

Limited compatibility support for the SysV + client interface, as implemented by the + systemd-initctl.service unit. This is a + named pipe in the file system. This interface is obsolete and + should not be used in new applications.



[1] If run inside a Linux + container these arguments may be passed as command line arguments + to systemd itself, next to any of the command line options listed + in the Options section above. If run outside of Linux containers, + these arguments are parsed from /proc/cmdline + instead.

diff --git a/man/systemd.index.7 b/man/systemd.index.7 index 134fc8bab..f01395552 100644 --- a/man/systemd.index.7 +++ b/man/systemd.index.7 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.INDEX" "7" "" "systemd 218" "systemd.index" +.TH "SYSTEMD\&.INDEX" "7" "" "systemd 219" "systemd.index" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -80,6 +80,9 @@ systemd.index \- List all manpages from the systemd project \fBhostnamectl\fR(1) \-\- Control the system hostname .br +\fBhwdb\fR(7) +\-\- Hardware Database +.br .SH "I" .PP @@ -110,6 +113,12 @@ systemd.index \- List all manpages from the systemd project .SH "L" .PP +\fBlibnss_myhostname.so.2\fR(8) +\-\- Provide hostname resolution for the locally configured system hostname\&. +.br +\fBlibnss_mymachines.so.2\fR(8) +\-\- Provide hostname resolution for local container instances\&. +.br \fBlocale.conf\fR(5) \-\- Configuration file for locale settings .br @@ -146,9 +155,15 @@ systemd.index \- List all manpages from the systemd project .SH "N" .PP +\fBnetworkctl\fR(1) +\-\- Query the status of network links +.br \fBnss-myhostname\fR(8) \-\- Provide hostname resolution for the locally configured system hostname\&. .br +\fBnss-mymachines\fR(8) +\-\- Provide hostname resolution for local container instances\&. +.br .SH "O" .PP @@ -803,6 +818,15 @@ systemd.index \- List all manpages from the systemd project \fBsd_pid_get_user_unit\fR(3) \-\- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer .br +\fBsd_pid_notify\fR(3) +\-\- Notify service manager about start\-up completion and other service status changes +.br +\fBsd_pid_notify_with_fds\fR(3) +\-\- Notify service manager about start\-up completion and other service status changes +.br +\fBsd_pid_notifyf\fR(3) +\-\- Notify service manager about start\-up completion and other service status changes +.br \fBsd_seat_can_graphical\fR(3) \-\- Determine state of a specific seat .br @@ -1025,6 +1049,9 @@ systemd.index \- List all manpages from the systemd project \fBsystemd-hostnamed.service\fR(8) \-\- Host name bus mechanism .br +\fBsystemd-hwdb\fR(8) +\-\- hardware database management tool +.br \fBsystemd-hybrid-sleep.service\fR(8) \-\- System sleep state logic .br @@ -1292,6 +1319,9 @@ systemd.index \- List all manpages from the systemd project \fBsystemd.exec\fR(5) \-\- Execution environment configuration .br +\fBsystemd.generator\fR(7) +\-\- Systemd unit generators +.br \fBsystemd.journal-fields\fR(7) \-\- Special journal fields .br @@ -1399,4 +1429,4 @@ systemd.index \- List all manpages from the systemd project .PP \fBsystemd.directives\fR(7) .PP -This index contains 440 entries, referring to 194 individual manual pages\&. +This index contains 450 entries, referring to 199 individual manual pages\&. diff --git a/man/systemd.index.html b/man/systemd.index.html index aba159e58..6df3538a7 100644 --- a/man/systemd.index.html +++ b/man/systemd.index.html @@ -19,6 +19,6 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.index — List all manpages from the systemd project

B¶

binfmt.d(5) -- Configure additional binary formats for executables at boot
bootchart.conf(5) -- Boot performance analysis graphing tool configuration files
bootchart.conf.d(5) -- Boot performance analysis graphing tool configuration files
bootctl(1) -- Control the firmware and boot manager settings
bootup(7) -- System bootup process
busctl(1) -- Introspect the bus

C¶

coredump.conf(5) -- Coredump storage configuration files
coredump.conf.d(5) -- Coredump storage configuration files
coredumpctl(1) -- Retrieve coredumps from the journal
crypttab(5) -- Configuration for encrypted block devices

D¶

daemon(7) -- Writing and packaging system daemons

F¶

file-hierarchy(7) -- File system hierarchy overview

H¶

halt(8) -- Halt, power-off or reboot the machine
hostname(5) -- Local hostname configuration file
hostnamectl(1) -- Control the system hostname

I¶

init(1) -- systemd system and service manager

J¶

journalctl(1) -- Query the systemd journal
journald.conf(5) -- Journal service configuration files
journald.conf.d(5) -- Journal service configuration files

K¶

kernel-command-line(7) -- Kernel command line parameters
kernel-install(8) -- Add and remove kernel and initramfs images to and from /boot

L¶

locale.conf(5) -- Configuration file for locale settings
localectl(1) -- Control the system locale and keyboard layout settings
localtime(5) -- Local timezone configuration file
loginctl(1) -- Control the systemd login manager
logind.conf(5) -- Login manager configuration files
logind.conf.d(5) -- Login manager configuration files

M¶

machine-id(5) -- Local machine ID configuration file
machine-info(5) -- Local machine information file
machinectl(1) -- Control the systemd machine manager
modules-load.d(5) -- Configure kernel modules to load at boot

N¶

nss-myhostname(8) -- Provide hostname resolution for the locally configured system hostname.

O¶

os-release(5) -- Operating system identification

P¶

pam_systemd(8) -- Register user sessions in the systemd login manager
poweroff(8) -- Halt, power-off or reboot the machine

R¶

reboot(8) -- Halt, power-off or reboot the machine
resolved.conf(5) -- Network Name Resolution configuration files
resolved.conf.d(5) -- Network Name Resolution configuration files
runlevel(8) -- Print previous and current SysV runlevel

S¶

sd-daemon(3) -- APIs for new-style daemons
sd-id128(3) -- APIs for processing 128-bit IDs
sd-journal(3) -- APIs for submitting and querying log entries to and from the journal
sd-login(3) -- APIs for tracking logins
SD_ALERT(3) -- APIs for new-style daemons
sd_booted(3) -- Test whether the system is running the systemd init system
sd_bus_creds_get_audit_login_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_audit_session_id(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cgroup(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cmdline(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_connection_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_exe(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_gid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_mask(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_get_owner_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_pid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_selinux_context(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_session(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_slice(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unique_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_user_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_well_known_names(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_bounding_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_effective_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_inheritable_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_permitted_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_new_from_pid(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_ref(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_unref(3) -- Retrieve credentials object for the specified PID
sd_bus_default_system(3) -- Open a connection to the system or user bus
sd_bus_default_user(3) -- Open a connection to the system or user bus
sd_bus_error(3) -- sd-bus error handling
sd_bus_error_copy(3) -- sd-bus error handling
sd_bus_error_free(3) -- sd-bus error handling
sd_bus_error_get_errno(3) -- sd-bus error handling
sd_bus_error_has_name(3) -- sd-bus error handling
sd_bus_error_is_set(3) -- sd-bus error handling
sd_bus_error_set(3) -- sd-bus error handling
sd_bus_error_set_const(3) -- sd-bus error handling
sd_bus_error_set_errno(3) -- sd-bus error handling
sd_bus_error_set_errnof(3) -- sd-bus error handling
sd_bus_message_append(3) -- Attach parts of message based on a format string
sd_bus_message_append_array(3) -- Attach an array of items to a message
sd_bus_message_append_array_iovec(3) -- Attach an array of items to a message
sd_bus_message_append_array_memfd(3) -- Attach an array of items to a message
sd_bus_message_append_array_space(3) -- Attach an array of items to a message
sd_bus_message_append_basic(3) -- Attach a single part to a message
sd_bus_message_append_string_iovec(3) -- Attach a string to a message
sd_bus_message_append_string_memfd(3) -- Attach a string to a message
sd_bus_message_append_string_space(3) -- Attach a string to a message
sd_bus_message_append_strv(3) -- Attach an array of strings to a message
sd_bus_message_get_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_monotonic_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_realtime_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_reply_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_seqnum(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_negotiate_creds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_fds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_timestamps(3) -- Control feature negotiation on bus connections
sd_bus_new(3) -- Create a new bus object and create or destroy references to it
sd_bus_open_system(3) -- Open a connection to the system or user bus
sd_bus_open_system_container(3) -- Open a connection to the system or user bus
sd_bus_open_system_remote(3) -- Open a connection to the system or user bus
sd_bus_open_user(3) -- Open a connection to the system or user bus
sd_bus_path_decode(3) -- Convert an external identifier into an object path and back
sd_bus_path_encode(3) -- Convert an external identifier into an object path and back
sd_bus_ref(3) -- Create a new bus object and create or destroy references to it
sd_bus_release_name(3) -- Request or release a well-known name on a bus
sd_bus_request_name(3) -- Request or release a well-known name on a bus
sd_bus_unref(3) -- Create a new bus object and create or destroy references to it
SD_CRIT(3) -- APIs for new-style daemons
SD_DEBUG(3) -- APIs for new-style daemons
SD_EMERG(3) -- APIs for new-style daemons
SD_ERR(3) -- APIs for new-style daemons
sd_event_add_child(3) -- Add a child state change event source to an event loop
sd_event_add_defer(3) -- Add static event sources to an event loop
sd_event_add_exit(3) -- Add static event sources to an event loop
sd_event_add_post(3) -- Add static event sources to an event loop
sd_event_add_signal(3) -- Add a signal event source to an event loop
sd_event_add_time(3) -- Add a timer event source to an event loop
sd_event_default(3) -- Acquire and release an event loop object
sd_event_get_fd(3) -- Obtain a file descriptor to poll for event loop events
sd_event_get_name(3) -- Set human-readable names for event sources
sd_event_new(3) -- Acquire and release an event loop object
sd_event_ref(3) -- Acquire and release an event loop object
sd_event_set_name(3) -- Set human-readable names for event sources
sd_event_source_get_child_pid(3) -- Add a child state change event source to an event loop
sd_event_source_get_signal(3) -- Add a signal event source to an event loop
sd_event_source_get_time(3) -- Add a timer event source to an event loop
sd_event_source_get_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_source_get_time_clock(3) -- Add a timer event source to an event loop
sd_event_source_set_time(3) -- Add a timer event source to an event loop
sd_event_source_set_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_unref(3) -- Acquire and release an event loop object
sd_get_machine_names(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_seats(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_sessions(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_uids(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
SD_ID128_CONST_STR(3) -- APIs for processing 128-bit IDs
sd_id128_equal(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_STR(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_VAL(3) -- APIs for processing 128-bit IDs
sd_id128_from_string(3) -- Format or parse 128-bit IDs as strings
sd_id128_get_boot(3) -- Retrieve 128-bit IDs
sd_id128_get_machine(3) -- Retrieve 128-bit IDs
SD_ID128_MAKE(3) -- APIs for processing 128-bit IDs
sd_id128_randomize(3) -- Generate 128-bit IDs
sd_id128_t(3) -- APIs for processing 128-bit IDs
sd_id128_to_string(3) -- Format or parse 128-bit IDs as strings
SD_INFO(3) -- APIs for new-style daemons
sd_is_fifo(3) -- Check the type of a file descriptor
sd_is_mq(3) -- Check the type of a file descriptor
sd_is_socket(3) -- Check the type of a file descriptor
sd_is_socket_inet(3) -- Check the type of a file descriptor
sd_is_socket_unix(3) -- Check the type of a file descriptor
sd_is_special(3) -- Check the type of a file descriptor
sd_journal(3) -- Open the system journal for reading
sd_journal_add_conjunction(3) -- Add or remove entry matches
sd_journal_add_disjunction(3) -- Add or remove entry matches
sd_journal_add_match(3) -- Add or remove entry matches
SD_JOURNAL_APPEND(3) -- Journal change notification interface
sd_journal_close(3) -- Open the system journal for reading
SD_JOURNAL_CURRENT_USER(3) -- Open the system journal for reading
sd_journal_enumerate_data(3) -- Read data fields from the current journal entry
sd_journal_enumerate_unique(3) -- Read unique data fields from the journal
sd_journal_flush_matches(3) -- Add or remove entry matches
SD_JOURNAL_FOREACH(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_BACKWARDS(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_DATA(3) -- Read data fields from the current journal entry
SD_JOURNAL_FOREACH_UNIQUE(3) -- Read unique data fields from the journal
sd_journal_get_catalog(3) -- Retrieve message catalog entry
sd_journal_get_catalog_for_message_id(3) -- Retrieve message catalog entry
sd_journal_get_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_get_cutoff_monotonic_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_cutoff_realtime_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_data(3) -- Read data fields from the current journal entry
sd_journal_get_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_get_events(3) -- Journal change notification interface
sd_journal_get_fd(3) -- Journal change notification interface
sd_journal_get_monotonic_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_realtime_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_timeout(3) -- Journal change notification interface
sd_journal_get_usage(3) -- Journal disk usage
SD_JOURNAL_INVALIDATE(3) -- Journal change notification interface
SD_JOURNAL_LOCAL_ONLY(3) -- Open the system journal for reading
sd_journal_next(3) -- Advance or set back the read pointer in the journal
sd_journal_next_skip(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_NOP(3) -- Journal change notification interface
sd_journal_open(3) -- Open the system journal for reading
sd_journal_open_container(3) -- Open the system journal for reading
sd_journal_open_directory(3) -- Open the system journal for reading
sd_journal_open_files(3) -- Open the system journal for reading
sd_journal_perror(3) -- Submit log entries to the journal
sd_journal_previous(3) -- Advance or set back the read pointer in the journal
sd_journal_previous_skip(3) -- Advance or set back the read pointer in the journal
sd_journal_print(3) -- Submit log entries to the journal
sd_journal_printv(3) -- Submit log entries to the journal
sd_journal_process(3) -- Journal change notification interface
sd_journal_query_unique(3) -- Read unique data fields from the journal
sd_journal_reliable_fd(3) -- Journal change notification interface
sd_journal_restart_data(3) -- Read data fields from the current journal entry
sd_journal_restart_unique(3) -- Read unique data fields from the journal
SD_JOURNAL_RUNTIME_ONLY(3) -- Open the system journal for reading
sd_journal_seek_cursor(3) -- Seek to a position in the journal
sd_journal_seek_head(3) -- Seek to a position in the journal
sd_journal_seek_monotonic_usec(3) -- Seek to a position in the journal
sd_journal_seek_realtime_usec(3) -- Seek to a position in the journal
sd_journal_seek_tail(3) -- Seek to a position in the journal
sd_journal_send(3) -- Submit log entries to the journal
sd_journal_sendv(3) -- Submit log entries to the journal
sd_journal_set_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_stream_fd(3) -- Create log stream file descriptor to the journal
SD_JOURNAL_SUPPRESS_LOCATION(3) -- Submit log entries to the journal
SD_JOURNAL_SYSTEM(3) -- Open the system journal for reading
sd_journal_test_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_wait(3) -- Journal change notification interface
sd_listen_fds(3) -- Check for file descriptors passed by the system manager
SD_LISTEN_FDS_START(3) -- Check for file descriptors passed by the system manager
sd_login_monitor(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_flush(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_events(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_fd(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_timeout(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_new(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_unref(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_machine_get_class(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
sd_machine_get_ifindices(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
SD_NOTICE(3) -- APIs for new-style daemons
sd_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_peer_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_seat_can_graphical(3) -- Determine state of a specific seat
sd_seat_can_multi_session(3) -- Determine state of a specific seat
sd_seat_can_tty(3) -- Determine state of a specific seat
sd_seat_get_active(3) -- Determine state of a specific seat
sd_seat_get_sessions(3) -- Determine state of a specific seat
sd_session_get_class(3) -- Determine state of a specific session
sd_session_get_desktop(3) -- Determine state of a specific session
sd_session_get_display(3) -- Determine state of a specific session
sd_session_get_remote_host(3) -- Determine state of a specific session
sd_session_get_remote_user(3) -- Determine state of a specific session
sd_session_get_seat(3) -- Determine state of a specific session
sd_session_get_service(3) -- Determine state of a specific session
sd_session_get_state(3) -- Determine state of a specific session
sd_session_get_tty(3) -- Determine state of a specific session
sd_session_get_type(3) -- Determine state of a specific session
sd_session_get_uid(3) -- Determine state of a specific session
sd_session_get_vt(3) -- Determine state of a specific session
sd_session_is_active(3) -- Determine state of a specific session
sd_session_is_remote(3) -- Determine state of a specific session
sd_uid_get_display(3) -- Determine login state of a specific Unix user ID
sd_uid_get_seats(3) -- Determine login state of a specific Unix user ID
sd_uid_get_sessions(3) -- Determine login state of a specific Unix user ID
sd_uid_get_state(3) -- Determine login state of a specific Unix user ID
sd_uid_is_on_seat(3) -- Determine login state of a specific Unix user ID
SD_WARNING(3) -- APIs for new-style daemons
sd_watchdog_enabled(3) -- Check whether the service manager expects watchdog keep-alive notifications from a service
shutdown(8) -- Halt, power-off or reboot the machine
sleep.conf.d(5) -- Suspend and hibernation configuration file
sysctl.d(5) -- Configure kernel parameters at boot
system.conf.d(5) -- System and session service manager configuration files
systemctl(1) -- Control the systemd system and service manager
systemd(1) -- systemd system and service manager
systemd-activate(8) -- Test socket activation of daemons
systemd-analyze(1) -- Analyze system boot-up performance
systemd-ask-password(1) -- Query the user for a system password
systemd-ask-password-console.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-console.service(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.service(8) -- Query the user for system passwords on the console and via wall
systemd-backlight(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-backlight@.service(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-binfmt(8) -- Configure additional binary formats for executables at boot
systemd-binfmt.service(8) -- Configure additional binary formats for executables at boot
systemd-bootchart(1) -- Boot performance graphing tool
systemd-bus-proxyd(8) -- Connect STDIO or a socket to a given bus address
systemd-bus-proxyd.socket(8) -- Proxy classic D-Bus clients to kdbus
systemd-bus-proxyd@.service(8) -- Proxy classic D-Bus clients to kdbus
systemd-cat(1) -- Connect a pipeline or program's output with the journal
systemd-cgls(1) -- Recursively show control group contents
systemd-cgtop(1) -- Show top control groups by their resource usage
systemd-coredump(8) -- Log and store core dumps
systemd-cryptsetup(8) -- Full disk decryption logic
systemd-cryptsetup-generator(8) -- Unit generator for
systemd-cryptsetup@.service(8) -- Full disk decryption logic
systemd-debug-generator(8) -- Generator for enabling a runtime debug shell and masking specific units at boot
systemd-delta(1) -- Find overridden configuration files
systemd-detect-virt(1) -- Detect execution in a virtualized environment
systemd-efi-boot-generator(8) -- Generator for automatically mounting the EFI System Partition used by the current boot to
systemd-escape(1) -- Escape strings for usage in system unit names
systemd-firstboot(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-firstboot.service(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-fsck(8) -- File system checker logic
systemd-fsck-root.service(8) -- File system checker logic
systemd-fsck@.service(8) -- File system checker logic
systemd-fstab-generator(8) -- Unit generator for /etc/fstab
systemd-getty-generator(8) -- Generator for enabling getty instances on the console
systemd-gpt-auto-generator(8) -- Generator for automatically discovering and mounting root,
systemd-halt.service(8) -- System shutdown logic
systemd-hibernate-resume(8) -- Resume from hibernation
systemd-hibernate-resume-generator(8) -- Unit generator for resume= kernel parameter
systemd-hibernate-resume@.service(8) -- Resume from hibernation
systemd-hibernate.service(8) -- System sleep state logic
systemd-hostnamed(8) -- Host name bus mechanism
systemd-hostnamed.service(8) -- Host name bus mechanism
systemd-hybrid-sleep.service(8) -- System sleep state logic
systemd-inhibit(1) -- Execute a program with an inhibition lock taken
systemd-initctl(8) -- /dev/initctl compatibility
systemd-initctl.service(8) -- /dev/initctl compatibility
systemd-initctl.socket(8) -- /dev/initctl compatibility
systemd-journal-gatewayd(8) -- HTTP server for journal events
systemd-journal-gatewayd.service(8) -- HTTP server for journal events
systemd-journal-gatewayd.socket(8) -- HTTP server for journal events
systemd-journal-remote(8) -- Receive journal messages over the network
systemd-journal-upload(8) -- Send journal messages over the network
systemd-journald(8) -- Journal service
systemd-journald-dev-log.socket(8) -- Journal service
systemd-journald.service(8) -- Journal service
systemd-journald.socket(8) -- Journal service
systemd-kexec.service(8) -- System shutdown logic
systemd-localed(8) -- Locale bus mechanism
systemd-localed.service(8) -- Locale bus mechanism
systemd-logind(8) -- Login manager
systemd-logind.service(8) -- Login manager
systemd-machine-id-commit(1) -- Commit transient machine ID to /etc/machine-id
systemd-machine-id-commit.service(8) -- Commit transient machine-id to disk
systemd-machine-id-setup(1) -- Initialize the machine ID in /etc/machine-id
systemd-machined(8) -- Virtual machine and container registration manager
systemd-machined.service(8) -- Virtual machine and container registration manager
systemd-modules-load(8) -- Load kernel modules at boot
systemd-modules-load.service(8) -- Load kernel modules at boot
systemd-networkd(8) -- Network manager
systemd-networkd-wait-online(8) -- Wait for network to come online
systemd-networkd-wait-online.service(8) -- Wait for network to come online
systemd-networkd.service(8) -- Network manager
systemd-notify(1) -- Notify service manager about start-up completion and other daemon status changes
systemd-nspawn(1) -- Spawn a namespace container for debugging, testing and building
systemd-path(1) -- List and query system and user paths
systemd-poweroff.service(8) -- System shutdown logic
systemd-quotacheck(8) -- File system quota checker logic
systemd-quotacheck.service(8) -- File system quota checker logic
systemd-random-seed(8) -- Load and save the system random seed at boot and shutdown
systemd-random-seed.service(8) -- Load and save the system random seed at boot and shutdown
systemd-reboot.service(8) -- System shutdown logic
systemd-remount-fs(8) -- Remount root and kernel file systems
systemd-remount-fs.service(8) -- Remount root and kernel file systems
systemd-resolved(8) -- Network Name Resolution manager
systemd-resolved.service(8) -- Network Name Resolution manager
systemd-rfkill(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-rfkill@.service(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-run(1) -- Run programs in transient scope or service or timer units
systemd-shutdown(8) -- System shutdown logic
systemd-shutdownd(8) -- Scheduled shutdown service
systemd-shutdownd.service(8) -- Scheduled shutdown service
systemd-shutdownd.socket(8) -- Scheduled shutdown service
systemd-sleep(8) -- System sleep state logic
systemd-sleep.conf(5) -- Suspend and hibernation configuration file
systemd-socket-proxyd(8) -- Bidirectionally proxy local sockets to another (possibly remote) socket.
systemd-suspend.service(8) -- System sleep state logic
systemd-sysctl(8) -- Configure kernel parameters at boot
systemd-sysctl.service(8) -- Configure kernel parameters at boot
systemd-system-update-generator(8) -- Generator for redirecting boot to offline update mode
systemd-system.conf(5) -- System and session service manager configuration files
systemd-sysusers(8) -- Allocate system users and groups
systemd-sysusers.service(8) -- Allocate system users and groups
systemd-sysv-generator(8) -- Unit generator for SysV init scripts
systemd-timedated(8) -- Time and date bus mechanism
systemd-timedated.service(8) -- Time and date bus mechanism
systemd-timesyncd(8) -- Network Time Synchronization
systemd-timesyncd.service(8) -- Network Time Synchronization
systemd-tmpfiles(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.timer(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup-dev.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tty-ask-password-agent(1) -- List or process pending systemd password requests
systemd-udevd(8) -- Device event managing daemon
systemd-udevd-control.socket(8) -- Device event managing daemon
systemd-udevd-kernel.socket(8) -- Device event managing daemon
systemd-udevd.service(8) -- Device event managing daemon
systemd-update-done(8) -- Mark
systemd-update-done.service(8) -- Mark
systemd-update-utmp(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp-runlevel.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-user-sessions(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user-sessions.service(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user.conf(5) -- System and session service manager configuration files
systemd-vconsole-setup(8) -- Configure the virtual console at boot
systemd-vconsole-setup.service(8) -- Configure the virtual console at boot
systemd.automount(5) -- Automount unit configuration
systemd.device(5) -- Device unit configuration
systemd.directives(7) -- Index of configuration directives
systemd.exec(5) -- Execution environment configuration
systemd.journal-fields(7) -- Special journal fields
systemd.kill(5) -- Process killing procedure configuration
systemd.link(5) -- Network device configuration
systemd.mount(5) -- Mount unit configuration
systemd.netdev(5) -- Virtual Network Device configuration
systemd.network(5) -- Network configuration
systemd.path(5) -- Path unit configuration
systemd.preset(5) -- Service enablement presets
systemd.resource-control(5) -- Resource control unit settings
systemd.scope(5) -- Scope unit configuration
systemd.service(5) -- Service unit configuration
systemd.slice(5) -- Slice unit configuration
systemd.snapshot(5) -- Snapshot unit configuration
systemd.socket(5) -- Socket unit configuration
systemd.special(7) -- Special systemd units
systemd.swap(5) -- Swap unit configuration
systemd.target(5) -- Target unit configuration
systemd.time(7) -- Time and date specifications
systemd.timer(5) -- Timer unit configuration
systemd.unit(5) -- Unit configuration
sysusers.d(5) -- Declarative allocation of system users and groups

T¶

telinit(8) -- Change SysV runlevel
timedatectl(1) -- Control the system time and date
timesyncd.conf(5) -- Network Time Synchronization configuration files
timesyncd.conf.d(5) -- Network Time Synchronization configuration files
tmpfiles.d(5) -- Configuration for creation, deletion and cleaning of volatile and temporary files

U¶

udev(7) -- Dynamic device management
udev.conf(5) -- Configuration for device event managing daemon
udevadm(8) -- udev management tool
user.conf.d(5) -- System and session service manager configuration files

V¶

vconsole.conf(5) -- Configuration file for the virtual console

See Also¶

+ gudev systemd 219


Name

systemd.index — List all manpages from the systemd project

B¶

binfmt.d(5) -- Configure additional binary formats for executables at boot
bootchart.conf(5) -- Boot performance analysis graphing tool configuration files
bootchart.conf.d(5) -- Boot performance analysis graphing tool configuration files
bootctl(1) -- Control the firmware and boot manager settings
bootup(7) -- System bootup process
busctl(1) -- Introspect the bus

C¶

coredump.conf(5) -- Coredump storage configuration files
coredump.conf.d(5) -- Coredump storage configuration files
coredumpctl(1) -- Retrieve coredumps from the journal
crypttab(5) -- Configuration for encrypted block devices

D¶

daemon(7) -- Writing and packaging system daemons

F¶

file-hierarchy(7) -- File system hierarchy overview

H¶

halt(8) -- Halt, power-off or reboot the machine
hostname(5) -- Local hostname configuration file
hostnamectl(1) -- Control the system hostname
hwdb(7) -- Hardware Database

I¶

init(1) -- systemd system and service manager

J¶

journalctl(1) -- Query the systemd journal
journald.conf(5) -- Journal service configuration files
journald.conf.d(5) -- Journal service configuration files

K¶

kernel-command-line(7) -- Kernel command line parameters
kernel-install(8) -- Add and remove kernel and initramfs images to and from /boot

L¶

libnss_myhostname.so.2(8) -- Provide hostname resolution for the locally configured system hostname.
libnss_mymachines.so.2(8) -- Provide hostname resolution for local container instances.
locale.conf(5) -- Configuration file for locale settings
localectl(1) -- Control the system locale and keyboard layout settings
localtime(5) -- Local timezone configuration file
loginctl(1) -- Control the systemd login manager
logind.conf(5) -- Login manager configuration files
logind.conf.d(5) -- Login manager configuration files

M¶

machine-id(5) -- Local machine ID configuration file
machine-info(5) -- Local machine information file
machinectl(1) -- Control the systemd machine manager
modules-load.d(5) -- Configure kernel modules to load at boot

N¶

networkctl(1) -- Query the status of network links
nss-myhostname(8) -- Provide hostname resolution for the locally configured system hostname.
nss-mymachines(8) -- Provide hostname resolution for local container instances.

O¶

os-release(5) -- Operating system identification

P¶

pam_systemd(8) -- Register user sessions in the systemd login manager
poweroff(8) -- Halt, power-off or reboot the machine

R¶

reboot(8) -- Halt, power-off or reboot the machine
resolved.conf(5) -- Network Name Resolution configuration files
resolved.conf.d(5) -- Network Name Resolution configuration files
runlevel(8) -- Print previous and current SysV runlevel

S¶

sd-daemon(3) -- APIs for new-style daemons
sd-id128(3) -- APIs for processing 128-bit IDs
sd-journal(3) -- APIs for submitting and querying log entries to and from the journal
sd-login(3) -- APIs for tracking logins
SD_ALERT(3) -- APIs for new-style daemons
sd_booted(3) -- Test whether the system is running the systemd init system
sd_bus_creds_get_audit_login_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_audit_session_id(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cgroup(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_cmdline(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_connection_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_exe(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_gid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_mask(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_get_owner_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_pid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_selinux_context(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_session(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_slice(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_tid_comm(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_uid(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unique_name(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_user_unit(3) -- Retrieve fields from a credentials object
sd_bus_creds_get_well_known_names(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_bounding_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_effective_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_inheritable_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_has_permitted_cap(3) -- Retrieve fields from a credentials object
sd_bus_creds_new_from_pid(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_ref(3) -- Retrieve credentials object for the specified PID
sd_bus_creds_unref(3) -- Retrieve credentials object for the specified PID
sd_bus_default_system(3) -- Open a connection to the system or user bus
sd_bus_default_user(3) -- Open a connection to the system or user bus
sd_bus_error(3) -- sd-bus error handling
sd_bus_error_copy(3) -- sd-bus error handling
sd_bus_error_free(3) -- sd-bus error handling
sd_bus_error_get_errno(3) -- sd-bus error handling
sd_bus_error_has_name(3) -- sd-bus error handling
sd_bus_error_is_set(3) -- sd-bus error handling
sd_bus_error_set(3) -- sd-bus error handling
sd_bus_error_set_const(3) -- sd-bus error handling
sd_bus_error_set_errno(3) -- sd-bus error handling
sd_bus_error_set_errnof(3) -- sd-bus error handling
sd_bus_message_append(3) -- Attach parts of message based on a format string
sd_bus_message_append_array(3) -- Attach an array of items to a message
sd_bus_message_append_array_iovec(3) -- Attach an array of items to a message
sd_bus_message_append_array_memfd(3) -- Attach an array of items to a message
sd_bus_message_append_array_space(3) -- Attach an array of items to a message
sd_bus_message_append_basic(3) -- Attach a single part to a message
sd_bus_message_append_string_iovec(3) -- Attach a string to a message
sd_bus_message_append_string_memfd(3) -- Attach a string to a message
sd_bus_message_append_string_space(3) -- Attach a string to a message
sd_bus_message_append_strv(3) -- Attach an array of strings to a message
sd_bus_message_get_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_monotonic_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_realtime_usec(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_message_get_reply_cookie(3) -- Returns the transaction cookie of a message
sd_bus_message_get_seqnum(3) -- Retrieve the sender timestamps and sequence number of a message
sd_bus_negotiate_creds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_fds(3) -- Control feature negotiation on bus connections
sd_bus_negotiate_timestamps(3) -- Control feature negotiation on bus connections
sd_bus_new(3) -- Create a new bus object and create or destroy references to it
sd_bus_open_system(3) -- Open a connection to the system or user bus
sd_bus_open_system_container(3) -- Open a connection to the system or user bus
sd_bus_open_system_remote(3) -- Open a connection to the system or user bus
sd_bus_open_user(3) -- Open a connection to the system or user bus
sd_bus_path_decode(3) -- Convert an external identifier into an object path and back
sd_bus_path_encode(3) -- Convert an external identifier into an object path and back
sd_bus_ref(3) -- Create a new bus object and create or destroy references to it
sd_bus_release_name(3) -- Request or release a well-known name on a bus
sd_bus_request_name(3) -- Request or release a well-known name on a bus
sd_bus_unref(3) -- Create a new bus object and create or destroy references to it
SD_CRIT(3) -- APIs for new-style daemons
SD_DEBUG(3) -- APIs for new-style daemons
SD_EMERG(3) -- APIs for new-style daemons
SD_ERR(3) -- APIs for new-style daemons
sd_event_add_child(3) -- Add a child state change event source to an event loop
sd_event_add_defer(3) -- Add static event sources to an event loop
sd_event_add_exit(3) -- Add static event sources to an event loop
sd_event_add_post(3) -- Add static event sources to an event loop
sd_event_add_signal(3) -- Add a signal event source to an event loop
sd_event_add_time(3) -- Add a timer event source to an event loop
sd_event_default(3) -- Acquire and release an event loop object
sd_event_get_fd(3) -- Obtain a file descriptor to poll for event loop events
sd_event_get_name(3) -- Set human-readable names for event sources
sd_event_new(3) -- Acquire and release an event loop object
sd_event_ref(3) -- Acquire and release an event loop object
sd_event_set_name(3) -- Set human-readable names for event sources
sd_event_source_get_child_pid(3) -- Add a child state change event source to an event loop
sd_event_source_get_signal(3) -- Add a signal event source to an event loop
sd_event_source_get_time(3) -- Add a timer event source to an event loop
sd_event_source_get_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_source_get_time_clock(3) -- Add a timer event source to an event loop
sd_event_source_set_time(3) -- Add a timer event source to an event loop
sd_event_source_set_time_accuracy(3) -- Add a timer event source to an event loop
sd_event_unref(3) -- Acquire and release an event loop object
sd_get_machine_names(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_seats(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_sessions(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
sd_get_uids(3) -- Determine available seats, sessions, logged in users and virtual machines/containers
SD_ID128_CONST_STR(3) -- APIs for processing 128-bit IDs
sd_id128_equal(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_STR(3) -- APIs for processing 128-bit IDs
SD_ID128_FORMAT_VAL(3) -- APIs for processing 128-bit IDs
sd_id128_from_string(3) -- Format or parse 128-bit IDs as strings
sd_id128_get_boot(3) -- Retrieve 128-bit IDs
sd_id128_get_machine(3) -- Retrieve 128-bit IDs
SD_ID128_MAKE(3) -- APIs for processing 128-bit IDs
sd_id128_randomize(3) -- Generate 128-bit IDs
sd_id128_t(3) -- APIs for processing 128-bit IDs
sd_id128_to_string(3) -- Format or parse 128-bit IDs as strings
SD_INFO(3) -- APIs for new-style daemons
sd_is_fifo(3) -- Check the type of a file descriptor
sd_is_mq(3) -- Check the type of a file descriptor
sd_is_socket(3) -- Check the type of a file descriptor
sd_is_socket_inet(3) -- Check the type of a file descriptor
sd_is_socket_unix(3) -- Check the type of a file descriptor
sd_is_special(3) -- Check the type of a file descriptor
sd_journal(3) -- Open the system journal for reading
sd_journal_add_conjunction(3) -- Add or remove entry matches
sd_journal_add_disjunction(3) -- Add or remove entry matches
sd_journal_add_match(3) -- Add or remove entry matches
SD_JOURNAL_APPEND(3) -- Journal change notification interface
sd_journal_close(3) -- Open the system journal for reading
SD_JOURNAL_CURRENT_USER(3) -- Open the system journal for reading
sd_journal_enumerate_data(3) -- Read data fields from the current journal entry
sd_journal_enumerate_unique(3) -- Read unique data fields from the journal
sd_journal_flush_matches(3) -- Add or remove entry matches
SD_JOURNAL_FOREACH(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_BACKWARDS(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_FOREACH_DATA(3) -- Read data fields from the current journal entry
SD_JOURNAL_FOREACH_UNIQUE(3) -- Read unique data fields from the journal
sd_journal_get_catalog(3) -- Retrieve message catalog entry
sd_journal_get_catalog_for_message_id(3) -- Retrieve message catalog entry
sd_journal_get_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_get_cutoff_monotonic_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_cutoff_realtime_usec(3) -- Read cut-off timestamps from the current journal entry
sd_journal_get_data(3) -- Read data fields from the current journal entry
sd_journal_get_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_get_events(3) -- Journal change notification interface
sd_journal_get_fd(3) -- Journal change notification interface
sd_journal_get_monotonic_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_realtime_usec(3) -- Read timestamps from the current journal entry
sd_journal_get_timeout(3) -- Journal change notification interface
sd_journal_get_usage(3) -- Journal disk usage
SD_JOURNAL_INVALIDATE(3) -- Journal change notification interface
SD_JOURNAL_LOCAL_ONLY(3) -- Open the system journal for reading
sd_journal_next(3) -- Advance or set back the read pointer in the journal
sd_journal_next_skip(3) -- Advance or set back the read pointer in the journal
SD_JOURNAL_NOP(3) -- Journal change notification interface
sd_journal_open(3) -- Open the system journal for reading
sd_journal_open_container(3) -- Open the system journal for reading
sd_journal_open_directory(3) -- Open the system journal for reading
sd_journal_open_files(3) -- Open the system journal for reading
sd_journal_perror(3) -- Submit log entries to the journal
sd_journal_previous(3) -- Advance or set back the read pointer in the journal
sd_journal_previous_skip(3) -- Advance or set back the read pointer in the journal
sd_journal_print(3) -- Submit log entries to the journal
sd_journal_printv(3) -- Submit log entries to the journal
sd_journal_process(3) -- Journal change notification interface
sd_journal_query_unique(3) -- Read unique data fields from the journal
sd_journal_reliable_fd(3) -- Journal change notification interface
sd_journal_restart_data(3) -- Read data fields from the current journal entry
sd_journal_restart_unique(3) -- Read unique data fields from the journal
SD_JOURNAL_RUNTIME_ONLY(3) -- Open the system journal for reading
sd_journal_seek_cursor(3) -- Seek to a position in the journal
sd_journal_seek_head(3) -- Seek to a position in the journal
sd_journal_seek_monotonic_usec(3) -- Seek to a position in the journal
sd_journal_seek_realtime_usec(3) -- Seek to a position in the journal
sd_journal_seek_tail(3) -- Seek to a position in the journal
sd_journal_send(3) -- Submit log entries to the journal
sd_journal_sendv(3) -- Submit log entries to the journal
sd_journal_set_data_threshold(3) -- Read data fields from the current journal entry
sd_journal_stream_fd(3) -- Create log stream file descriptor to the journal
SD_JOURNAL_SUPPRESS_LOCATION(3) -- Submit log entries to the journal
SD_JOURNAL_SYSTEM(3) -- Open the system journal for reading
sd_journal_test_cursor(3) -- Get cursor string for or test cursor string against the current journal entry
sd_journal_wait(3) -- Journal change notification interface
sd_listen_fds(3) -- Check for file descriptors passed by the system manager
SD_LISTEN_FDS_START(3) -- Check for file descriptors passed by the system manager
sd_login_monitor(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_flush(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_events(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_fd(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_get_timeout(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_new(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_login_monitor_unref(3) -- Monitor login sessions, seats, users and virtual machines/containers
sd_machine_get_class(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
sd_machine_get_ifindices(3) -- Determine the class and network interface indices of a locally running virtual machine or container.
SD_NOTICE(3) -- APIs for new-style daemons
sd_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_peer_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_peer_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_machine_name(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_owner_uid(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_session(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_slice(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_get_user_unit(3) -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peer
sd_pid_notify(3) -- Notify service manager about start-up completion and other service status changes
sd_pid_notify_with_fds(3) -- Notify service manager about start-up completion and other service status changes
sd_pid_notifyf(3) -- Notify service manager about start-up completion and other service status changes
sd_seat_can_graphical(3) -- Determine state of a specific seat
sd_seat_can_multi_session(3) -- Determine state of a specific seat
sd_seat_can_tty(3) -- Determine state of a specific seat
sd_seat_get_active(3) -- Determine state of a specific seat
sd_seat_get_sessions(3) -- Determine state of a specific seat
sd_session_get_class(3) -- Determine state of a specific session
sd_session_get_desktop(3) -- Determine state of a specific session
sd_session_get_display(3) -- Determine state of a specific session
sd_session_get_remote_host(3) -- Determine state of a specific session
sd_session_get_remote_user(3) -- Determine state of a specific session
sd_session_get_seat(3) -- Determine state of a specific session
sd_session_get_service(3) -- Determine state of a specific session
sd_session_get_state(3) -- Determine state of a specific session
sd_session_get_tty(3) -- Determine state of a specific session
sd_session_get_type(3) -- Determine state of a specific session
sd_session_get_uid(3) -- Determine state of a specific session
sd_session_get_vt(3) -- Determine state of a specific session
sd_session_is_active(3) -- Determine state of a specific session
sd_session_is_remote(3) -- Determine state of a specific session
sd_uid_get_display(3) -- Determine login state of a specific Unix user ID
sd_uid_get_seats(3) -- Determine login state of a specific Unix user ID
sd_uid_get_sessions(3) -- Determine login state of a specific Unix user ID
sd_uid_get_state(3) -- Determine login state of a specific Unix user ID
sd_uid_is_on_seat(3) -- Determine login state of a specific Unix user ID
SD_WARNING(3) -- APIs for new-style daemons
sd_watchdog_enabled(3) -- Check whether the service manager expects watchdog keep-alive notifications from a service
shutdown(8) -- Halt, power-off or reboot the machine
sleep.conf.d(5) -- Suspend and hibernation configuration file
sysctl.d(5) -- Configure kernel parameters at boot
system.conf.d(5) -- System and session service manager configuration files
systemctl(1) -- Control the systemd system and service manager
systemd(1) -- systemd system and service manager
systemd-activate(8) -- Test socket activation of daemons
systemd-analyze(1) -- Analyze system boot-up performance
systemd-ask-password(1) -- Query the user for a system password
systemd-ask-password-console.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-console.service(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.path(8) -- Query the user for system passwords on the console and via wall
systemd-ask-password-wall.service(8) -- Query the user for system passwords on the console and via wall
systemd-backlight(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-backlight@.service(8) -- Load and save the display backlight brightness at boot and shutdown
systemd-binfmt(8) -- Configure additional binary formats for executables at boot
systemd-binfmt.service(8) -- Configure additional binary formats for executables at boot
systemd-bootchart(1) -- Boot performance graphing tool
systemd-bus-proxyd(8) -- Connect STDIO or a socket to a given bus address
systemd-bus-proxyd.socket(8) -- Proxy classic D-Bus clients to kdbus
systemd-bus-proxyd@.service(8) -- Proxy classic D-Bus clients to kdbus
systemd-cat(1) -- Connect a pipeline or program's output with the journal
systemd-cgls(1) -- Recursively show control group contents
systemd-cgtop(1) -- Show top control groups by their resource usage
systemd-coredump(8) -- Log and store core dumps
systemd-cryptsetup(8) -- Full disk decryption logic
systemd-cryptsetup-generator(8) -- Unit generator for
systemd-cryptsetup@.service(8) -- Full disk decryption logic
systemd-debug-generator(8) -- Generator for enabling a runtime debug shell and masking specific units at boot
systemd-delta(1) -- Find overridden configuration files
systemd-detect-virt(1) -- Detect execution in a virtualized environment
systemd-efi-boot-generator(8) -- Generator for automatically mounting the EFI System Partition used by the current boot to
systemd-escape(1) -- Escape strings for usage in system unit names
systemd-firstboot(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-firstboot.service(1) -- Initialize basic system settings on or before the first boot-up of a system
systemd-fsck(8) -- File system checker logic
systemd-fsck-root.service(8) -- File system checker logic
systemd-fsck@.service(8) -- File system checker logic
systemd-fstab-generator(8) -- Unit generator for /etc/fstab
systemd-getty-generator(8) -- Generator for enabling getty instances on the console
systemd-gpt-auto-generator(8) -- Generator for automatically discovering and mounting root,
systemd-halt.service(8) -- System shutdown logic
systemd-hibernate-resume(8) -- Resume from hibernation
systemd-hibernate-resume-generator(8) -- Unit generator for resume= kernel parameter
systemd-hibernate-resume@.service(8) -- Resume from hibernation
systemd-hibernate.service(8) -- System sleep state logic
systemd-hostnamed(8) -- Host name bus mechanism
systemd-hostnamed.service(8) -- Host name bus mechanism
systemd-hwdb(8) -- hardware database management tool
systemd-hybrid-sleep.service(8) -- System sleep state logic
systemd-inhibit(1) -- Execute a program with an inhibition lock taken
systemd-initctl(8) -- /dev/initctl compatibility
systemd-initctl.service(8) -- /dev/initctl compatibility
systemd-initctl.socket(8) -- /dev/initctl compatibility
systemd-journal-gatewayd(8) -- HTTP server for journal events
systemd-journal-gatewayd.service(8) -- HTTP server for journal events
systemd-journal-gatewayd.socket(8) -- HTTP server for journal events
systemd-journal-remote(8) -- Receive journal messages over the network
systemd-journal-upload(8) -- Send journal messages over the network
systemd-journald(8) -- Journal service
systemd-journald-dev-log.socket(8) -- Journal service
systemd-journald.service(8) -- Journal service
systemd-journald.socket(8) -- Journal service
systemd-kexec.service(8) -- System shutdown logic
systemd-localed(8) -- Locale bus mechanism
systemd-localed.service(8) -- Locale bus mechanism
systemd-logind(8) -- Login manager
systemd-logind.service(8) -- Login manager
systemd-machine-id-commit(1) -- Commit transient machine ID to /etc/machine-id
systemd-machine-id-commit.service(8) -- Commit transient machine-id to disk
systemd-machine-id-setup(1) -- Initialize the machine ID in /etc/machine-id
systemd-machined(8) -- Virtual machine and container registration manager
systemd-machined.service(8) -- Virtual machine and container registration manager
systemd-modules-load(8) -- Load kernel modules at boot
systemd-modules-load.service(8) -- Load kernel modules at boot
systemd-networkd(8) -- Network manager
systemd-networkd-wait-online(8) -- Wait for network to come online
systemd-networkd-wait-online.service(8) -- Wait for network to come online
systemd-networkd.service(8) -- Network manager
systemd-notify(1) -- Notify service manager about start-up completion and other daemon status changes
systemd-nspawn(1) -- Spawn a namespace container for debugging, testing and building
systemd-path(1) -- List and query system and user paths
systemd-poweroff.service(8) -- System shutdown logic
systemd-quotacheck(8) -- File system quota checker logic
systemd-quotacheck.service(8) -- File system quota checker logic
systemd-random-seed(8) -- Load and save the system random seed at boot and shutdown
systemd-random-seed.service(8) -- Load and save the system random seed at boot and shutdown
systemd-reboot.service(8) -- System shutdown logic
systemd-remount-fs(8) -- Remount root and kernel file systems
systemd-remount-fs.service(8) -- Remount root and kernel file systems
systemd-resolved(8) -- Network Name Resolution manager
systemd-resolved.service(8) -- Network Name Resolution manager
systemd-rfkill(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-rfkill@.service(8) -- Load and save the RF kill switch state at boot and shutdown
systemd-run(1) -- Run programs in transient scope or service or timer units
systemd-shutdown(8) -- System shutdown logic
systemd-shutdownd(8) -- Scheduled shutdown service
systemd-shutdownd.service(8) -- Scheduled shutdown service
systemd-shutdownd.socket(8) -- Scheduled shutdown service
systemd-sleep(8) -- System sleep state logic
systemd-sleep.conf(5) -- Suspend and hibernation configuration file
systemd-socket-proxyd(8) -- Bidirectionally proxy local sockets to another (possibly remote) socket.
systemd-suspend.service(8) -- System sleep state logic
systemd-sysctl(8) -- Configure kernel parameters at boot
systemd-sysctl.service(8) -- Configure kernel parameters at boot
systemd-system-update-generator(8) -- Generator for redirecting boot to offline update mode
systemd-system.conf(5) -- System and session service manager configuration files
systemd-sysusers(8) -- Allocate system users and groups
systemd-sysusers.service(8) -- Allocate system users and groups
systemd-sysv-generator(8) -- Unit generator for SysV init scripts
systemd-timedated(8) -- Time and date bus mechanism
systemd-timedated.service(8) -- Time and date bus mechanism
systemd-timesyncd(8) -- Network Time Synchronization
systemd-timesyncd.service(8) -- Network Time Synchronization
systemd-tmpfiles(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-clean.timer(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup-dev.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tmpfiles-setup.service(8) -- Creates, deletes and cleans up volatile and temporary files and directories
systemd-tty-ask-password-agent(1) -- List or process pending systemd password requests
systemd-udevd(8) -- Device event managing daemon
systemd-udevd-control.socket(8) -- Device event managing daemon
systemd-udevd-kernel.socket(8) -- Device event managing daemon
systemd-udevd.service(8) -- Device event managing daemon
systemd-update-done(8) -- Mark
systemd-update-done.service(8) -- Mark
systemd-update-utmp(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp-runlevel.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-update-utmp.service(8) -- Write audit and utmp updates at bootup, runlevel changes and shutdown
systemd-user-sessions(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user-sessions.service(8) -- Permit user logins after boot, prohibit user logins at shutdown
systemd-user.conf(5) -- System and session service manager configuration files
systemd-vconsole-setup(8) -- Configure the virtual console at boot
systemd-vconsole-setup.service(8) -- Configure the virtual console at boot
systemd.automount(5) -- Automount unit configuration
systemd.device(5) -- Device unit configuration
systemd.directives(7) -- Index of configuration directives
systemd.exec(5) -- Execution environment configuration
systemd.generator(7) -- Systemd unit generators
systemd.journal-fields(7) -- Special journal fields
systemd.kill(5) -- Process killing procedure configuration
systemd.link(5) -- Network device configuration
systemd.mount(5) -- Mount unit configuration
systemd.netdev(5) -- Virtual Network Device configuration
systemd.network(5) -- Network configuration
systemd.path(5) -- Path unit configuration
systemd.preset(5) -- Service enablement presets
systemd.resource-control(5) -- Resource control unit settings
systemd.scope(5) -- Scope unit configuration
systemd.service(5) -- Service unit configuration
systemd.slice(5) -- Slice unit configuration
systemd.snapshot(5) -- Snapshot unit configuration
systemd.socket(5) -- Socket unit configuration
systemd.special(7) -- Special systemd units
systemd.swap(5) -- Swap unit configuration
systemd.target(5) -- Target unit configuration
systemd.time(7) -- Time and date specifications
systemd.timer(5) -- Timer unit configuration
systemd.unit(5) -- Unit configuration
sysusers.d(5) -- Declarative allocation of system users and groups

T¶

telinit(8) -- Change SysV runlevel
timedatectl(1) -- Control the system time and date
timesyncd.conf(5) -- Network Time Synchronization configuration files
timesyncd.conf.d(5) -- Network Time Synchronization configuration files
tmpfiles.d(5) -- Configuration for creation, deletion and cleaning of volatile and temporary files

U¶

udev(7) -- Dynamic device management
udev.conf(5) -- Configuration for device event managing daemon
udevadm(8) -- udev management tool
user.conf.d(5) -- System and session service manager configuration files

V¶

vconsole.conf(5) -- Configuration file for the virtual console

See Also¶

systemd.directives(7) -

This index contains 440 entries, referring to 194 individual manual pages.

+

This index contains 450 entries, referring to 199 individual manual pages.

diff --git a/man/systemd.index.xml b/man/systemd.index.xml index 1e20982ba..5904ac082 100644 --- a/man/systemd.index.xml +++ b/man/systemd.index.xml @@ -23,11 +23,11 @@ systemd.index List all manpages from the systemd project -Bbinfmt.d5 -- Configure additional binary formats for executables at bootbootchart.conf5 -- Boot performance analysis graphing tool configuration filesbootchart.conf.d5 -- Boot performance analysis graphing tool configuration filesbootctl1 -- Control the firmware and boot manager settingsbootup7 -- System bootup processbusctl1 -- Introspect the busCcoredump.conf5 -- Coredump storage configuration filescoredump.conf.d5 -- Coredump storage configuration filescoredumpctl1 -- Retrieve coredumps from the journalcrypttab5 -- Configuration for encrypted block devicesDdaemon7 -- Writing and packaging system daemonsFfile-hierarchy7 -- File system hierarchy overviewHhalt8 -- Halt, power-off or reboot the machinehostname5 -- Local hostname configuration filehostnamectl1 -- Control the system hostnameIinit1 -- systemd system and service managerJjournalctl1 -- Query the systemd journaljournald.conf5 -- Journal service configuration filesjournald.conf.d5 -- Journal service configuration filesKkernel-command-line7 -- Kernel command line parameterskernel-install8 -- Add and remove kernel and initramfs images to and from /bootLlocale.conf5 -- Configuration file for locale settingslocalectl1 -- Control the system locale and keyboard layout settingslocaltime5 -- Local timezone configuration fileloginctl1 -- Control the systemd login managerlogind.conf5 -- Login manager configuration fileslogind.conf.d5 -- Login manager configuration filesMmachine-id5 -- Local machine ID configuration filemachine-info5 -- Local machine information filemachinectl1 -- Control the systemd machine managermodules-load.d5 -- Configure kernel modules to load at bootNnss-myhostname8 -- Provide hostname resolution for the locally configured system hostname.Oos-release5 -- Operating system identificationPpam_systemd8 -- Register user sessions in the systemd login managerpoweroff8 -- Halt, power-off or reboot the machineRreboot8 -- Halt, power-off or reboot the machineresolved.conf5 -- Network Name Resolution configuration filesresolved.conf.d5 -- Network Name Resolution configuration filesrunlevel8 -- Print previous and current SysV runlevelSsd-daemon3 -- APIs for new-style daemonssd-id1283 -- APIs for processing 128-bit IDssd-journal3 -- APIs for submitting and querying log entries to and from the journalsd-login3 -- APIs for tracking loginsSD_ALERT3 -- APIs for new-style daemonssd_booted3 -- Test whether the system is running the systemd init systemsd_bus_creds_get_audit_login_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_audit_session_id3 -- Retrieve fields from a credentials objectsd_bus_creds_get_cgroup3 -- Retrieve fields from a credentials objectsd_bus_creds_get_cmdline3 -- Retrieve fields from a credentials objectsd_bus_creds_get_comm3 -- Retrieve fields from a credentials objectsd_bus_creds_get_connection_name3 -- Retrieve fields from a credentials objectsd_bus_creds_get_exe3 -- Retrieve fields from a credentials objectsd_bus_creds_get_gid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_mask3 -- Retrieve credentials object for the specified PIDsd_bus_creds_get_owner_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_pid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_selinux_context3 -- Retrieve fields from a credentials objectsd_bus_creds_get_session3 -- Retrieve fields from a credentials objectsd_bus_creds_get_slice3 -- Retrieve fields from a credentials objectsd_bus_creds_get_tid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_tid_comm3 -- Retrieve fields from a credentials objectsd_bus_creds_get_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_unique_name3 -- Retrieve fields from a credentials objectsd_bus_creds_get_unit3 -- Retrieve fields from a credentials objectsd_bus_creds_get_user_unit3 -- Retrieve fields from a credentials objectsd_bus_creds_get_well_known_names3 -- Retrieve fields from a credentials objectsd_bus_creds_has_bounding_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_effective_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_inheritable_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_permitted_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_new_from_pid3 -- Retrieve credentials object for the specified PIDsd_bus_creds_ref3 -- Retrieve credentials object for the specified PIDsd_bus_creds_unref3 -- Retrieve credentials object for the specified PIDsd_bus_default_system3 -- Open a connection to the system or user bussd_bus_default_user3 -- Open a connection to the system or user bussd_bus_error3 -- sd-bus error handlingsd_bus_error_copy3 -- sd-bus error handlingsd_bus_error_free3 -- sd-bus error handlingsd_bus_error_get_errno3 -- sd-bus error handlingsd_bus_error_has_name3 -- sd-bus error handlingsd_bus_error_is_set3 -- sd-bus error handlingsd_bus_error_set3 -- sd-bus error handlingsd_bus_error_set_const3 -- sd-bus error handlingsd_bus_error_set_errno3 -- sd-bus error handlingsd_bus_error_set_errnof3 -- sd-bus error handlingsd_bus_message_append3 -- Attach parts of message based on a format stringsd_bus_message_append_array3 -- Attach an array of items to a messagesd_bus_message_append_array_iovec3 -- Attach an array of items to a messagesd_bus_message_append_array_memfd3 -- Attach an array of items to a messagesd_bus_message_append_array_space3 -- Attach an array of items to a messagesd_bus_message_append_basic3 -- Attach a single part to a messagesd_bus_message_append_string_iovec3 -- Attach a string to a messagesd_bus_message_append_string_memfd3 -- Attach a string to a messagesd_bus_message_append_string_space3 -- Attach a string to a messagesd_bus_message_append_strv3 -- Attach an array of strings to a messagesd_bus_message_get_cookie3 -- Returns the transaction cookie of a messagesd_bus_message_get_monotonic_usec3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_message_get_realtime_usec3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_message_get_reply_cookie3 -- Returns the transaction cookie of a messagesd_bus_message_get_seqnum3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_negotiate_creds3 -- Control feature negotiation on bus connectionssd_bus_negotiate_fds3 -- Control feature negotiation on bus connectionssd_bus_negotiate_timestamps3 -- Control feature negotiation on bus connectionssd_bus_new3 -- Create a new bus object and create or destroy references to itsd_bus_open_system3 -- Open a connection to the system or user bussd_bus_open_system_container3 -- Open a connection to the system or user bussd_bus_open_system_remote3 -- Open a connection to the system or user bussd_bus_open_user3 -- Open a connection to the system or user bussd_bus_path_decode3 -- Convert an external identifier into an object path and backsd_bus_path_encode3 -- Convert an external identifier into an object path and backsd_bus_ref3 -- Create a new bus object and create or destroy references to itsd_bus_release_name3 -- Request or release a well-known name on a bussd_bus_request_name3 -- Request or release a well-known name on a bussd_bus_unref3 -- Create a new bus object and create or destroy references to itSD_CRIT3 -- APIs for new-style daemonsSD_DEBUG3 -- APIs for new-style daemonsSD_EMERG3 -- APIs for new-style daemonsSD_ERR3 -- APIs for new-style daemonssd_event_add_child3 -- Add a child state change event source to an event loopsd_event_add_defer3 -- Add static event sources to an event loopsd_event_add_exit3 -- Add static event sources to an event loopsd_event_add_post3 -- Add static event sources to an event loopsd_event_add_signal3 -- Add a signal event source to an event loopsd_event_add_time3 -- Add a timer event source to an event loopsd_event_default3 -- Acquire and release an event loop objectsd_event_get_fd3 -- Obtain a file descriptor to poll for event loop eventssd_event_get_name3 -- Set human-readable names for event sourcessd_event_new3 -- Acquire and release an event loop objectsd_event_ref3 -- Acquire and release an event loop objectsd_event_set_name3 -- Set human-readable names for event sourcessd_event_source_get_child_pid3 -- Add a child state change event source to an event loopsd_event_source_get_signal3 -- Add a signal event source to an event loopsd_event_source_get_time3 -- Add a timer event source to an event loopsd_event_source_get_time_accuracy3 -- Add a timer event source to an event loopsd_event_source_get_time_clock3 -- Add a timer event source to an event loopsd_event_source_set_time3 -- Add a timer event source to an event loopsd_event_source_set_time_accuracy3 -- Add a timer event source to an event loopsd_event_unref3 -- Acquire and release an event loop objectsd_get_machine_names3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_seats3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_sessions3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_uids3 -- Determine available seats, sessions, logged in users and virtual machines/containersSD_ID128_CONST_STR3 -- APIs for processing 128-bit IDssd_id128_equal3 -- APIs for processing 128-bit IDsSD_ID128_FORMAT_STR3 -- APIs for processing 128-bit IDsSD_ID128_FORMAT_VAL3 -- APIs for processing 128-bit IDssd_id128_from_string3 -- Format or parse 128-bit IDs as stringssd_id128_get_boot3 -- Retrieve 128-bit IDssd_id128_get_machine3 -- Retrieve 128-bit IDsSD_ID128_MAKE3 -- APIs for processing 128-bit IDssd_id128_randomize3 -- Generate 128-bit IDssd_id128_t3 -- APIs for processing 128-bit IDssd_id128_to_string3 -- Format or parse 128-bit IDs as stringsSD_INFO3 -- APIs for new-style daemonssd_is_fifo3 -- Check the type of a file descriptorsd_is_mq3 -- Check the type of a file descriptorsd_is_socket3 -- Check the type of a file descriptorsd_is_socket_inet3 -- Check the type of a file descriptorsd_is_socket_unix3 -- Check the type of a file descriptorsd_is_special3 -- Check the type of a file descriptorsd_journal3 -- Open the system journal for readingsd_journal_add_conjunction3 -- Add or remove entry matchessd_journal_add_disjunction3 -- Add or remove entry matchessd_journal_add_match3 -- Add or remove entry matchesSD_JOURNAL_APPEND3 -- Journal change notification interfacesd_journal_close3 -- Open the system journal for readingSD_JOURNAL_CURRENT_USER3 -- Open the system journal for readingsd_journal_enumerate_data3 -- Read data fields from the current journal entrysd_journal_enumerate_unique3 -- Read unique data fields from the journalsd_journal_flush_matches3 -- Add or remove entry matchesSD_JOURNAL_FOREACH3 -- Advance or set back the read pointer in the journalSD_JOURNAL_FOREACH_BACKWARDS3 -- Advance or set back the read pointer in the journalSD_JOURNAL_FOREACH_DATA3 -- Read data fields from the current journal entrySD_JOURNAL_FOREACH_UNIQUE3 -- Read unique data fields from the journalsd_journal_get_catalog3 -- Retrieve message catalog entrysd_journal_get_catalog_for_message_id3 -- Retrieve message catalog entrysd_journal_get_cursor3 -- Get cursor string for or test cursor string against the current journal entrysd_journal_get_cutoff_monotonic_usec3 -- Read cut-off timestamps from the current journal entrysd_journal_get_cutoff_realtime_usec3 -- Read cut-off timestamps from the current journal entrysd_journal_get_data3 -- Read data fields from the current journal entrysd_journal_get_data_threshold3 -- Read data fields from the current journal entrysd_journal_get_events3 -- Journal change notification interfacesd_journal_get_fd3 -- Journal change notification interfacesd_journal_get_monotonic_usec3 -- Read timestamps from the current journal entrysd_journal_get_realtime_usec3 -- Read timestamps from the current journal entrysd_journal_get_timeout3 -- Journal change notification interfacesd_journal_get_usage3 -- Journal disk usageSD_JOURNAL_INVALIDATE3 -- Journal change notification interfaceSD_JOURNAL_LOCAL_ONLY3 -- Open the system journal for readingsd_journal_next3 -- Advance or set back the read pointer in the journalsd_journal_next_skip3 -- Advance or set back the read pointer in the journalSD_JOURNAL_NOP3 -- Journal change notification interfacesd_journal_open3 -- Open the system journal for readingsd_journal_open_container3 -- Open the system journal for readingsd_journal_open_directory3 -- Open the system journal for readingsd_journal_open_files3 -- Open the system journal for readingsd_journal_perror3 -- Submit log entries to the journalsd_journal_previous3 -- Advance or set back the read pointer in the journalsd_journal_previous_skip3 -- Advance or set back the read pointer in the journalsd_journal_print3 -- Submit log entries to the journalsd_journal_printv3 -- Submit log entries to the journalsd_journal_process3 -- Journal change notification interfacesd_journal_query_unique3 -- Read unique data fields from the journalsd_journal_reliable_fd3 -- Journal change notification interfacesd_journal_restart_data3 -- Read data fields from the current journal entrysd_journal_restart_unique3 -- Read unique data fields from the journalSD_JOURNAL_RUNTIME_ONLY3 -- Open the system journal for readingsd_journal_seek_cursor3 -- Seek to a position in the journalsd_journal_seek_head3 -- Seek to a position in the journalsd_journal_seek_monotonic_usec3 -- Seek to a position in the journalsd_journal_seek_realtime_usec3 -- Seek to a position in the journalsd_journal_seek_tail3 -- Seek to a position in the journalsd_journal_send3 -- Submit log entries to the journalsd_journal_sendv3 -- Submit log entries to the journalsd_journal_set_data_threshold3 -- Read data fields from the current journal entrysd_journal_stream_fd3 -- Create log stream file descriptor to the journalSD_JOURNAL_SUPPRESS_LOCATION3 -- Submit log entries to the journalSD_JOURNAL_SYSTEM3 -- Open the system journal for readingsd_journal_test_cursor3 -- Get cursor string for or test cursor string against the current journal entrysd_journal_wait3 -- Journal change notification interfacesd_listen_fds3 -- Check for file descriptors passed by the system managerSD_LISTEN_FDS_START3 -- Check for file descriptors passed by the system managersd_login_monitor3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_flush3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_events3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_fd3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_timeout3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_new3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_unref3 -- Monitor login sessions, seats, users and virtual machines/containerssd_machine_get_class3 -- Determine the class and network interface indices of a locally running virtual machine or container.sd_machine_get_ifindices3 -- Determine the class and network interface indices of a locally running virtual machine or container.SD_NOTICE3 -- APIs for new-style daemonssd_notify3 -- Notify service manager about start-up completion and other service status changessd_notifyf3 -- Notify service manager about start-up completion and other service status changessd_peer_get_machine_name3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_owner_uid3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_session3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_slice3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_user_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_machine_name3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_owner_uid3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_session3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_slice3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_user_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_seat_can_graphical3 -- Determine state of a specific seatsd_seat_can_multi_session3 -- Determine state of a specific seatsd_seat_can_tty3 -- Determine state of a specific seatsd_seat_get_active3 -- Determine state of a specific seatsd_seat_get_sessions3 -- Determine state of a specific seatsd_session_get_class3 -- Determine state of a specific sessionsd_session_get_desktop3 -- Determine state of a specific sessionsd_session_get_display3 -- Determine state of a specific sessionsd_session_get_remote_host3 -- Determine state of a specific sessionsd_session_get_remote_user3 -- Determine state of a specific sessionsd_session_get_seat3 -- Determine state of a specific sessionsd_session_get_service3 -- Determine state of a specific sessionsd_session_get_state3 -- Determine state of a specific sessionsd_session_get_tty3 -- Determine state of a specific sessionsd_session_get_type3 -- Determine state of a specific sessionsd_session_get_uid3 -- Determine state of a specific sessionsd_session_get_vt3 -- Determine state of a specific sessionsd_session_is_active3 -- Determine state of a specific sessionsd_session_is_remote3 -- Determine state of a specific sessionsd_uid_get_display3 -- Determine login state of a specific Unix user IDsd_uid_get_seats3 -- Determine login state of a specific Unix user IDsd_uid_get_sessions3 -- Determine login state of a specific Unix user IDsd_uid_get_state3 -- Determine login state of a specific Unix user IDsd_uid_is_on_seat3 -- Determine login state of a specific Unix user IDSD_WARNING3 -- APIs for new-style daemonssd_watchdog_enabled3 -- Check whether the service manager expects watchdog keep-alive notifications from a serviceshutdown8 -- Halt, power-off or reboot the machinesleep.conf.d5 -- Suspend and hibernation configuration filesysctl.d5 -- Configure kernel parameters at bootsystem.conf.d5 -- System and session service manager configuration filessystemctl1 -- Control the systemd system and service managersystemd1 -- systemd system and service managersystemd-activate8 -- Test socket activation of daemonssystemd-analyze1 -- Analyze system boot-up performancesystemd-ask-password1 -- Query the user for a system passwordsystemd-ask-password-console.path8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-console.service8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-wall.path8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-wall.service8 -- Query the user for system passwords on the console and via wallsystemd-backlight8 -- Load and save the display backlight brightness at boot and shutdownsystemd-backlight@.service8 -- Load and save the display backlight brightness at boot and shutdownsystemd-binfmt8 -- Configure additional binary formats for executables at bootsystemd-binfmt.service8 -- Configure additional binary formats for executables at bootsystemd-bootchart1 -- Boot performance graphing toolsystemd-bus-proxyd8 -- Connect STDIO or a socket to a given bus addresssystemd-bus-proxyd.socket8 -- Proxy classic D-Bus clients to kdbussystemd-bus-proxyd@.service8 -- Proxy classic D-Bus clients to kdbussystemd-cat1 -- Connect a pipeline or program's output with the journalsystemd-cgls1 -- Recursively show control group contentssystemd-cgtop1 -- Show top control groups by their resource usagesystemd-coredump8 -- Log and store core dumpssystemd-cryptsetup8 -- Full disk decryption logicsystemd-cryptsetup-generator8 -- Unit generator forsystemd-cryptsetup@.service8 -- Full disk decryption logicsystemd-debug-generator8 -- Generator for enabling a runtime debug shell and masking specific units at bootsystemd-delta1 -- Find overridden configuration filessystemd-detect-virt1 -- Detect execution in a virtualized environmentsystemd-efi-boot-generator8 -- Generator for automatically mounting the EFI System Partition used by the current boot tosystemd-escape1 -- Escape strings for usage in system unit namessystemd-firstboot1 -- Initialize basic system settings on or before the first boot-up of a systemsystemd-firstboot.service1 -- Initialize basic system settings on or before the first boot-up of a systemsystemd-fsck8 -- File system checker logicsystemd-fsck-root.service8 -- File system checker logicsystemd-fsck@.service8 -- File system checker logicsystemd-fstab-generator8 -- Unit generator for /etc/fstabsystemd-getty-generator8 -- Generator for enabling getty instances on the consolesystemd-gpt-auto-generator8 -- Generator for automatically discovering and mounting root,systemd-halt.service8 -- System shutdown logicsystemd-hibernate-resume8 -- Resume from hibernationsystemd-hibernate-resume-generator8 -- Unit generator for resume= kernel parametersystemd-hibernate-resume@.service8 -- Resume from hibernationsystemd-hibernate.service8 -- System sleep state logicsystemd-hostnamed8 -- Host name bus mechanismsystemd-hostnamed.service8 -- Host name bus mechanismsystemd-hybrid-sleep.service8 -- System sleep state logicsystemd-inhibit1 -- Execute a program with an inhibition lock takensystemd-initctl8 -- /dev/initctl compatibilitysystemd-initctl.service8 -- /dev/initctl compatibilitysystemd-initctl.socket8 -- /dev/initctl compatibilitysystemd-journal-gatewayd8 -- HTTP server for journal eventssystemd-journal-gatewayd.service8 -- HTTP server for journal eventssystemd-journal-gatewayd.socket8 -- HTTP server for journal eventssystemd-journal-remote8 -- Receive journal messages over the networksystemd-journal-upload8 -- Send journal messages over the networksystemd-journald8 -- Journal servicesystemd-journald-dev-log.socket8 -- Journal servicesystemd-journald.service8 -- Journal servicesystemd-journald.socket8 -- Journal servicesystemd-kexec.service8 -- System shutdown logicsystemd-localed8 -- Locale bus mechanismsystemd-localed.service8 -- Locale bus mechanismsystemd-logind8 -- Login managersystemd-logind.service8 -- Login managersystemd-machine-id-commit1 -- Commit transient machine ID to /etc/machine-idsystemd-machine-id-commit.service8 -- Commit transient machine-id to disksystemd-machine-id-setup1 -- Initialize the machine ID in /etc/machine-idsystemd-machined8 -- Virtual machine and container registration managersystemd-machined.service8 -- Virtual machine and container registration managersystemd-modules-load8 -- Load kernel modules at bootsystemd-modules-load.service8 -- Load kernel modules at bootsystemd-networkd8 -- Network managersystemd-networkd-wait-online8 -- Wait for network to come onlinesystemd-networkd-wait-online.service8 -- Wait for network to come onlinesystemd-networkd.service8 -- Network managersystemd-notify1 -- Notify service manager about start-up completion and other daemon status changessystemd-nspawn1 -- Spawn a namespace container for debugging, testing and buildingsystemd-path1 -- List and query system and user pathssystemd-poweroff.service8 -- System shutdown logicsystemd-quotacheck8 -- File system quota checker logicsystemd-quotacheck.service8 -- File system quota checker logicsystemd-random-seed8 -- Load and save the system random seed at boot and shutdownsystemd-random-seed.service8 -- Load and save the system random seed at boot and shutdownsystemd-reboot.service8 -- System shutdown logicsystemd-remount-fs8 -- Remount root and kernel file systemssystemd-remount-fs.service8 -- Remount root and kernel file systemssystemd-resolved8 -- Network Name Resolution managersystemd-resolved.service8 -- Network Name Resolution managersystemd-rfkill8 -- Load and save the RF kill switch state at boot and shutdownsystemd-rfkill@.service8 -- Load and save the RF kill switch state at boot and shutdownsystemd-run1 -- Run programs in transient scope or service or timer unitssystemd-shutdown8 -- System shutdown logicsystemd-shutdownd8 -- Scheduled shutdown servicesystemd-shutdownd.service8 -- Scheduled shutdown servicesystemd-shutdownd.socket8 -- Scheduled shutdown servicesystemd-sleep8 -- System sleep state logicsystemd-sleep.conf5 -- Suspend and hibernation configuration filesystemd-socket-proxyd8 -- Bidirectionally proxy local sockets to another (possibly remote) socket.systemd-suspend.service8 -- System sleep state logicsystemd-sysctl8 -- Configure kernel parameters at bootsystemd-sysctl.service8 -- Configure kernel parameters at bootsystemd-system-update-generator8 -- Generator for redirecting boot to offline update modesystemd-system.conf5 -- System and session service manager configuration filessystemd-sysusers8 -- Allocate system users and groupssystemd-sysusers.service8 -- Allocate system users and groupssystemd-sysv-generator8 -- Unit generator for SysV init scriptssystemd-timedated8 -- Time and date bus mechanismsystemd-timedated.service8 -- Time and date bus mechanismsystemd-timesyncd8 -- Network Time Synchronizationsystemd-timesyncd.service8 -- Network Time Synchronizationsystemd-tmpfiles8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-clean.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-clean.timer8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-setup-dev.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-setup.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tty-ask-password-agent1 -- List or process pending systemd password requestssystemd-udevd8 -- Device event managing daemonsystemd-udevd-control.socket8 -- Device event managing daemonsystemd-udevd-kernel.socket8 -- Device event managing daemonsystemd-udevd.service8 -- Device event managing daemonsystemd-update-done8 -- Marksystemd-update-done.service8 -- Marksystemd-update-utmp8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-update-utmp-runlevel.service8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-update-utmp.service8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-user-sessions8 -- Permit user logins after boot, prohibit user logins at shutdownsystemd-user-sessions.service8 -- Permit user logins after boot, prohibit user logins at shutdownsystemd-user.conf5 -- System and session service manager configuration filessystemd-vconsole-setup8 -- Configure the virtual console at bootsystemd-vconsole-setup.service8 -- Configure the virtual console at bootsystemd.automount5 -- Automount unit configurationsystemd.device5 -- Device unit configurationsystemd.directives7 -- Index of configuration directivessystemd.exec5 -- Execution environment configurationsystemd.journal-fields7 -- Special journal fieldssystemd.kill5 -- Process killing procedure configurationsystemd.link5 -- Network device configurationsystemd.mount5 -- Mount unit configurationsystemd.netdev5 -- Virtual Network Device configurationsystemd.network5 -- Network configurationsystemd.path5 -- Path unit configurationsystemd.preset5 -- Service enablement presetssystemd.resource-control5 -- Resource control unit settingssystemd.scope5 -- Scope unit configurationsystemd.service5 -- Service unit configurationsystemd.slice5 -- Slice unit configurationsystemd.snapshot5 -- Snapshot unit configurationsystemd.socket5 -- Socket unit configurationsystemd.special7 -- Special systemd unitssystemd.swap5 -- Swap unit configurationsystemd.target5 -- Target unit configurationsystemd.time7 -- Time and date specificationssystemd.timer5 -- Timer unit configurationsystemd.unit5 -- Unit configurationsysusers.d5 -- Declarative allocation of system users and groupsTtelinit8 -- Change SysV runleveltimedatectl1 -- Control the system time and datetimesyncd.conf5 -- Network Time Synchronization configuration filestimesyncd.conf.d5 -- Network Time Synchronization configuration filestmpfiles.d5 -- Configuration for creation, deletion and cleaning of volatile and temporary filesUudev7 -- Dynamic device managementudev.conf5 -- Configuration for device event managing daemonudevadm8 -- udev management tooluser.conf.d5 -- System and session service manager configuration filesVvconsole.conf5 -- Configuration file for the virtual console +Bbinfmt.d5 -- Configure additional binary formats for executables at bootbootchart.conf5 -- Boot performance analysis graphing tool configuration filesbootchart.conf.d5 -- Boot performance analysis graphing tool configuration filesbootctl1 -- Control the firmware and boot manager settingsbootup7 -- System bootup processbusctl1 -- Introspect the busCcoredump.conf5 -- Coredump storage configuration filescoredump.conf.d5 -- Coredump storage configuration filescoredumpctl1 -- Retrieve coredumps from the journalcrypttab5 -- Configuration for encrypted block devicesDdaemon7 -- Writing and packaging system daemonsFfile-hierarchy7 -- File system hierarchy overviewHhalt8 -- Halt, power-off or reboot the machinehostname5 -- Local hostname configuration filehostnamectl1 -- Control the system hostnamehwdb7 -- Hardware DatabaseIinit1 -- systemd system and service managerJjournalctl1 -- Query the systemd journaljournald.conf5 -- Journal service configuration filesjournald.conf.d5 -- Journal service configuration filesKkernel-command-line7 -- Kernel command line parameterskernel-install8 -- Add and remove kernel and initramfs images to and from /bootLlibnss_myhostname.so.28 -- Provide hostname resolution for the locally configured system hostname.libnss_mymachines.so.28 -- Provide hostname resolution for local container instances.locale.conf5 -- Configuration file for locale settingslocalectl1 -- Control the system locale and keyboard layout settingslocaltime5 -- Local timezone configuration fileloginctl1 -- Control the systemd login managerlogind.conf5 -- Login manager configuration fileslogind.conf.d5 -- Login manager configuration filesMmachine-id5 -- Local machine ID configuration filemachine-info5 -- Local machine information filemachinectl1 -- Control the systemd machine managermodules-load.d5 -- Configure kernel modules to load at bootNnetworkctl1 -- Query the status of network linksnss-myhostname8 -- Provide hostname resolution for the locally configured system hostname.nss-mymachines8 -- Provide hostname resolution for local container instances.Oos-release5 -- Operating system identificationPpam_systemd8 -- Register user sessions in the systemd login managerpoweroff8 -- Halt, power-off or reboot the machineRreboot8 -- Halt, power-off or reboot the machineresolved.conf5 -- Network Name Resolution configuration filesresolved.conf.d5 -- Network Name Resolution configuration filesrunlevel8 -- Print previous and current SysV runlevelSsd-daemon3 -- APIs for new-style daemonssd-id1283 -- APIs for processing 128-bit IDssd-journal3 -- APIs for submitting and querying log entries to and from the journalsd-login3 -- APIs for tracking loginsSD_ALERT3 -- APIs for new-style daemonssd_booted3 -- Test whether the system is running the systemd init systemsd_bus_creds_get_audit_login_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_audit_session_id3 -- Retrieve fields from a credentials objectsd_bus_creds_get_cgroup3 -- Retrieve fields from a credentials objectsd_bus_creds_get_cmdline3 -- Retrieve fields from a credentials objectsd_bus_creds_get_comm3 -- Retrieve fields from a credentials objectsd_bus_creds_get_connection_name3 -- Retrieve fields from a credentials objectsd_bus_creds_get_exe3 -- Retrieve fields from a credentials objectsd_bus_creds_get_gid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_mask3 -- Retrieve credentials object for the specified PIDsd_bus_creds_get_owner_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_pid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_selinux_context3 -- Retrieve fields from a credentials objectsd_bus_creds_get_session3 -- Retrieve fields from a credentials objectsd_bus_creds_get_slice3 -- Retrieve fields from a credentials objectsd_bus_creds_get_tid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_tid_comm3 -- Retrieve fields from a credentials objectsd_bus_creds_get_uid3 -- Retrieve fields from a credentials objectsd_bus_creds_get_unique_name3 -- Retrieve fields from a credentials objectsd_bus_creds_get_unit3 -- Retrieve fields from a credentials objectsd_bus_creds_get_user_unit3 -- Retrieve fields from a credentials objectsd_bus_creds_get_well_known_names3 -- Retrieve fields from a credentials objectsd_bus_creds_has_bounding_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_effective_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_inheritable_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_has_permitted_cap3 -- Retrieve fields from a credentials objectsd_bus_creds_new_from_pid3 -- Retrieve credentials object for the specified PIDsd_bus_creds_ref3 -- Retrieve credentials object for the specified PIDsd_bus_creds_unref3 -- Retrieve credentials object for the specified PIDsd_bus_default_system3 -- Open a connection to the system or user bussd_bus_default_user3 -- Open a connection to the system or user bussd_bus_error3 -- sd-bus error handlingsd_bus_error_copy3 -- sd-bus error handlingsd_bus_error_free3 -- sd-bus error handlingsd_bus_error_get_errno3 -- sd-bus error handlingsd_bus_error_has_name3 -- sd-bus error handlingsd_bus_error_is_set3 -- sd-bus error handlingsd_bus_error_set3 -- sd-bus error handlingsd_bus_error_set_const3 -- sd-bus error handlingsd_bus_error_set_errno3 -- sd-bus error handlingsd_bus_error_set_errnof3 -- sd-bus error handlingsd_bus_message_append3 -- Attach parts of message based on a format stringsd_bus_message_append_array3 -- Attach an array of items to a messagesd_bus_message_append_array_iovec3 -- Attach an array of items to a messagesd_bus_message_append_array_memfd3 -- Attach an array of items to a messagesd_bus_message_append_array_space3 -- Attach an array of items to a messagesd_bus_message_append_basic3 -- Attach a single part to a messagesd_bus_message_append_string_iovec3 -- Attach a string to a messagesd_bus_message_append_string_memfd3 -- Attach a string to a messagesd_bus_message_append_string_space3 -- Attach a string to a messagesd_bus_message_append_strv3 -- Attach an array of strings to a messagesd_bus_message_get_cookie3 -- Returns the transaction cookie of a messagesd_bus_message_get_monotonic_usec3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_message_get_realtime_usec3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_message_get_reply_cookie3 -- Returns the transaction cookie of a messagesd_bus_message_get_seqnum3 -- Retrieve the sender timestamps and sequence number of a messagesd_bus_negotiate_creds3 -- Control feature negotiation on bus connectionssd_bus_negotiate_fds3 -- Control feature negotiation on bus connectionssd_bus_negotiate_timestamps3 -- Control feature negotiation on bus connectionssd_bus_new3 -- Create a new bus object and create or destroy references to itsd_bus_open_system3 -- Open a connection to the system or user bussd_bus_open_system_container3 -- Open a connection to the system or user bussd_bus_open_system_remote3 -- Open a connection to the system or user bussd_bus_open_user3 -- Open a connection to the system or user bussd_bus_path_decode3 -- Convert an external identifier into an object path and backsd_bus_path_encode3 -- Convert an external identifier into an object path and backsd_bus_ref3 -- Create a new bus object and create or destroy references to itsd_bus_release_name3 -- Request or release a well-known name on a bussd_bus_request_name3 -- Request or release a well-known name on a bussd_bus_unref3 -- Create a new bus object and create or destroy references to itSD_CRIT3 -- APIs for new-style daemonsSD_DEBUG3 -- APIs for new-style daemonsSD_EMERG3 -- APIs for new-style daemonsSD_ERR3 -- APIs for new-style daemonssd_event_add_child3 -- Add a child state change event source to an event loopsd_event_add_defer3 -- Add static event sources to an event loopsd_event_add_exit3 -- Add static event sources to an event loopsd_event_add_post3 -- Add static event sources to an event loopsd_event_add_signal3 -- Add a signal event source to an event loopsd_event_add_time3 -- Add a timer event source to an event loopsd_event_default3 -- Acquire and release an event loop objectsd_event_get_fd3 -- Obtain a file descriptor to poll for event loop eventssd_event_get_name3 -- Set human-readable names for event sourcessd_event_new3 -- Acquire and release an event loop objectsd_event_ref3 -- Acquire and release an event loop objectsd_event_set_name3 -- Set human-readable names for event sourcessd_event_source_get_child_pid3 -- Add a child state change event source to an event loopsd_event_source_get_signal3 -- Add a signal event source to an event loopsd_event_source_get_time3 -- Add a timer event source to an event loopsd_event_source_get_time_accuracy3 -- Add a timer event source to an event loopsd_event_source_get_time_clock3 -- Add a timer event source to an event loopsd_event_source_set_time3 -- Add a timer event source to an event loopsd_event_source_set_time_accuracy3 -- Add a timer event source to an event loopsd_event_unref3 -- Acquire and release an event loop objectsd_get_machine_names3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_seats3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_sessions3 -- Determine available seats, sessions, logged in users and virtual machines/containerssd_get_uids3 -- Determine available seats, sessions, logged in users and virtual machines/containersSD_ID128_CONST_STR3 -- APIs for processing 128-bit IDssd_id128_equal3 -- APIs for processing 128-bit IDsSD_ID128_FORMAT_STR3 -- APIs for processing 128-bit IDsSD_ID128_FORMAT_VAL3 -- APIs for processing 128-bit IDssd_id128_from_string3 -- Format or parse 128-bit IDs as stringssd_id128_get_boot3 -- Retrieve 128-bit IDssd_id128_get_machine3 -- Retrieve 128-bit IDsSD_ID128_MAKE3 -- APIs for processing 128-bit IDssd_id128_randomize3 -- Generate 128-bit IDssd_id128_t3 -- APIs for processing 128-bit IDssd_id128_to_string3 -- Format or parse 128-bit IDs as stringsSD_INFO3 -- APIs for new-style daemonssd_is_fifo3 -- Check the type of a file descriptorsd_is_mq3 -- Check the type of a file descriptorsd_is_socket3 -- Check the type of a file descriptorsd_is_socket_inet3 -- Check the type of a file descriptorsd_is_socket_unix3 -- Check the type of a file descriptorsd_is_special3 -- Check the type of a file descriptorsd_journal3 -- Open the system journal for readingsd_journal_add_conjunction3 -- Add or remove entry matchessd_journal_add_disjunction3 -- Add or remove entry matchessd_journal_add_match3 -- Add or remove entry matchesSD_JOURNAL_APPEND3 -- Journal change notification interfacesd_journal_close3 -- Open the system journal for readingSD_JOURNAL_CURRENT_USER3 -- Open the system journal for readingsd_journal_enumerate_data3 -- Read data fields from the current journal entrysd_journal_enumerate_unique3 -- Read unique data fields from the journalsd_journal_flush_matches3 -- Add or remove entry matchesSD_JOURNAL_FOREACH3 -- Advance or set back the read pointer in the journalSD_JOURNAL_FOREACH_BACKWARDS3 -- Advance or set back the read pointer in the journalSD_JOURNAL_FOREACH_DATA3 -- Read data fields from the current journal entrySD_JOURNAL_FOREACH_UNIQUE3 -- Read unique data fields from the journalsd_journal_get_catalog3 -- Retrieve message catalog entrysd_journal_get_catalog_for_message_id3 -- Retrieve message catalog entrysd_journal_get_cursor3 -- Get cursor string for or test cursor string against the current journal entrysd_journal_get_cutoff_monotonic_usec3 -- Read cut-off timestamps from the current journal entrysd_journal_get_cutoff_realtime_usec3 -- Read cut-off timestamps from the current journal entrysd_journal_get_data3 -- Read data fields from the current journal entrysd_journal_get_data_threshold3 -- Read data fields from the current journal entrysd_journal_get_events3 -- Journal change notification interfacesd_journal_get_fd3 -- Journal change notification interfacesd_journal_get_monotonic_usec3 -- Read timestamps from the current journal entrysd_journal_get_realtime_usec3 -- Read timestamps from the current journal entrysd_journal_get_timeout3 -- Journal change notification interfacesd_journal_get_usage3 -- Journal disk usageSD_JOURNAL_INVALIDATE3 -- Journal change notification interfaceSD_JOURNAL_LOCAL_ONLY3 -- Open the system journal for readingsd_journal_next3 -- Advance or set back the read pointer in the journalsd_journal_next_skip3 -- Advance or set back the read pointer in the journalSD_JOURNAL_NOP3 -- Journal change notification interfacesd_journal_open3 -- Open the system journal for readingsd_journal_open_container3 -- Open the system journal for readingsd_journal_open_directory3 -- Open the system journal for readingsd_journal_open_files3 -- Open the system journal for readingsd_journal_perror3 -- Submit log entries to the journalsd_journal_previous3 -- Advance or set back the read pointer in the journalsd_journal_previous_skip3 -- Advance or set back the read pointer in the journalsd_journal_print3 -- Submit log entries to the journalsd_journal_printv3 -- Submit log entries to the journalsd_journal_process3 -- Journal change notification interfacesd_journal_query_unique3 -- Read unique data fields from the journalsd_journal_reliable_fd3 -- Journal change notification interfacesd_journal_restart_data3 -- Read data fields from the current journal entrysd_journal_restart_unique3 -- Read unique data fields from the journalSD_JOURNAL_RUNTIME_ONLY3 -- Open the system journal for readingsd_journal_seek_cursor3 -- Seek to a position in the journalsd_journal_seek_head3 -- Seek to a position in the journalsd_journal_seek_monotonic_usec3 -- Seek to a position in the journalsd_journal_seek_realtime_usec3 -- Seek to a position in the journalsd_journal_seek_tail3 -- Seek to a position in the journalsd_journal_send3 -- Submit log entries to the journalsd_journal_sendv3 -- Submit log entries to the journalsd_journal_set_data_threshold3 -- Read data fields from the current journal entrysd_journal_stream_fd3 -- Create log stream file descriptor to the journalSD_JOURNAL_SUPPRESS_LOCATION3 -- Submit log entries to the journalSD_JOURNAL_SYSTEM3 -- Open the system journal for readingsd_journal_test_cursor3 -- Get cursor string for or test cursor string against the current journal entrysd_journal_wait3 -- Journal change notification interfacesd_listen_fds3 -- Check for file descriptors passed by the system managerSD_LISTEN_FDS_START3 -- Check for file descriptors passed by the system managersd_login_monitor3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_flush3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_events3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_fd3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_get_timeout3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_new3 -- Monitor login sessions, seats, users and virtual machines/containerssd_login_monitor_unref3 -- Monitor login sessions, seats, users and virtual machines/containerssd_machine_get_class3 -- Determine the class and network interface indices of a locally running virtual machine or container.sd_machine_get_ifindices3 -- Determine the class and network interface indices of a locally running virtual machine or container.SD_NOTICE3 -- APIs for new-style daemonssd_notify3 -- Notify service manager about start-up completion and other service status changessd_notifyf3 -- Notify service manager about start-up completion and other service status changessd_peer_get_machine_name3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_owner_uid3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_session3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_slice3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_peer_get_user_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_machine_name3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_owner_uid3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_session3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_slice3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_get_user_unit3 -- Determine session, service, owner of a session, container/VM or slice of a specific PID or socket peersd_pid_notify3 -- Notify service manager about start-up completion and other service status changessd_pid_notify_with_fds3 -- Notify service manager about start-up completion and other service status changessd_pid_notifyf3 -- Notify service manager about start-up completion and other service status changessd_seat_can_graphical3 -- Determine state of a specific seatsd_seat_can_multi_session3 -- Determine state of a specific seatsd_seat_can_tty3 -- Determine state of a specific seatsd_seat_get_active3 -- Determine state of a specific seatsd_seat_get_sessions3 -- Determine state of a specific seatsd_session_get_class3 -- Determine state of a specific sessionsd_session_get_desktop3 -- Determine state of a specific sessionsd_session_get_display3 -- Determine state of a specific sessionsd_session_get_remote_host3 -- Determine state of a specific sessionsd_session_get_remote_user3 -- Determine state of a specific sessionsd_session_get_seat3 -- Determine state of a specific sessionsd_session_get_service3 -- Determine state of a specific sessionsd_session_get_state3 -- Determine state of a specific sessionsd_session_get_tty3 -- Determine state of a specific sessionsd_session_get_type3 -- Determine state of a specific sessionsd_session_get_uid3 -- Determine state of a specific sessionsd_session_get_vt3 -- Determine state of a specific sessionsd_session_is_active3 -- Determine state of a specific sessionsd_session_is_remote3 -- Determine state of a specific sessionsd_uid_get_display3 -- Determine login state of a specific Unix user IDsd_uid_get_seats3 -- Determine login state of a specific Unix user IDsd_uid_get_sessions3 -- Determine login state of a specific Unix user IDsd_uid_get_state3 -- Determine login state of a specific Unix user IDsd_uid_is_on_seat3 -- Determine login state of a specific Unix user IDSD_WARNING3 -- APIs for new-style daemonssd_watchdog_enabled3 -- Check whether the service manager expects watchdog keep-alive notifications from a serviceshutdown8 -- Halt, power-off or reboot the machinesleep.conf.d5 -- Suspend and hibernation configuration filesysctl.d5 -- Configure kernel parameters at bootsystem.conf.d5 -- System and session service manager configuration filessystemctl1 -- Control the systemd system and service managersystemd1 -- systemd system and service managersystemd-activate8 -- Test socket activation of daemonssystemd-analyze1 -- Analyze system boot-up performancesystemd-ask-password1 -- Query the user for a system passwordsystemd-ask-password-console.path8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-console.service8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-wall.path8 -- Query the user for system passwords on the console and via wallsystemd-ask-password-wall.service8 -- Query the user for system passwords on the console and via wallsystemd-backlight8 -- Load and save the display backlight brightness at boot and shutdownsystemd-backlight@.service8 -- Load and save the display backlight brightness at boot and shutdownsystemd-binfmt8 -- Configure additional binary formats for executables at bootsystemd-binfmt.service8 -- Configure additional binary formats for executables at bootsystemd-bootchart1 -- Boot performance graphing toolsystemd-bus-proxyd8 -- Connect STDIO or a socket to a given bus addresssystemd-bus-proxyd.socket8 -- Proxy classic D-Bus clients to kdbussystemd-bus-proxyd@.service8 -- Proxy classic D-Bus clients to kdbussystemd-cat1 -- Connect a pipeline or program's output with the journalsystemd-cgls1 -- Recursively show control group contentssystemd-cgtop1 -- Show top control groups by their resource usagesystemd-coredump8 -- Log and store core dumpssystemd-cryptsetup8 -- Full disk decryption logicsystemd-cryptsetup-generator8 -- Unit generator forsystemd-cryptsetup@.service8 -- Full disk decryption logicsystemd-debug-generator8 -- Generator for enabling a runtime debug shell and masking specific units at bootsystemd-delta1 -- Find overridden configuration filessystemd-detect-virt1 -- Detect execution in a virtualized environmentsystemd-efi-boot-generator8 -- Generator for automatically mounting the EFI System Partition used by the current boot tosystemd-escape1 -- Escape strings for usage in system unit namessystemd-firstboot1 -- Initialize basic system settings on or before the first boot-up of a systemsystemd-firstboot.service1 -- Initialize basic system settings on or before the first boot-up of a systemsystemd-fsck8 -- File system checker logicsystemd-fsck-root.service8 -- File system checker logicsystemd-fsck@.service8 -- File system checker logicsystemd-fstab-generator8 -- Unit generator for /etc/fstabsystemd-getty-generator8 -- Generator for enabling getty instances on the consolesystemd-gpt-auto-generator8 -- Generator for automatically discovering and mounting root,systemd-halt.service8 -- System shutdown logicsystemd-hibernate-resume8 -- Resume from hibernationsystemd-hibernate-resume-generator8 -- Unit generator for resume= kernel parametersystemd-hibernate-resume@.service8 -- Resume from hibernationsystemd-hibernate.service8 -- System sleep state logicsystemd-hostnamed8 -- Host name bus mechanismsystemd-hostnamed.service8 -- Host name bus mechanismsystemd-hwdb8 -- hardware database management toolsystemd-hybrid-sleep.service8 -- System sleep state logicsystemd-inhibit1 -- Execute a program with an inhibition lock takensystemd-initctl8 -- /dev/initctl compatibilitysystemd-initctl.service8 -- /dev/initctl compatibilitysystemd-initctl.socket8 -- /dev/initctl compatibilitysystemd-journal-gatewayd8 -- HTTP server for journal eventssystemd-journal-gatewayd.service8 -- HTTP server for journal eventssystemd-journal-gatewayd.socket8 -- HTTP server for journal eventssystemd-journal-remote8 -- Receive journal messages over the networksystemd-journal-upload8 -- Send journal messages over the networksystemd-journald8 -- Journal servicesystemd-journald-dev-log.socket8 -- Journal servicesystemd-journald.service8 -- Journal servicesystemd-journald.socket8 -- Journal servicesystemd-kexec.service8 -- System shutdown logicsystemd-localed8 -- Locale bus mechanismsystemd-localed.service8 -- Locale bus mechanismsystemd-logind8 -- Login managersystemd-logind.service8 -- Login managersystemd-machine-id-commit1 -- Commit transient machine ID to /etc/machine-idsystemd-machine-id-commit.service8 -- Commit transient machine-id to disksystemd-machine-id-setup1 -- Initialize the machine ID in /etc/machine-idsystemd-machined8 -- Virtual machine and container registration managersystemd-machined.service8 -- Virtual machine and container registration managersystemd-modules-load8 -- Load kernel modules at bootsystemd-modules-load.service8 -- Load kernel modules at bootsystemd-networkd8 -- Network managersystemd-networkd-wait-online8 -- Wait for network to come onlinesystemd-networkd-wait-online.service8 -- Wait for network to come onlinesystemd-networkd.service8 -- Network managersystemd-notify1 -- Notify service manager about start-up completion and other daemon status changessystemd-nspawn1 -- Spawn a namespace container for debugging, testing and buildingsystemd-path1 -- List and query system and user pathssystemd-poweroff.service8 -- System shutdown logicsystemd-quotacheck8 -- File system quota checker logicsystemd-quotacheck.service8 -- File system quota checker logicsystemd-random-seed8 -- Load and save the system random seed at boot and shutdownsystemd-random-seed.service8 -- Load and save the system random seed at boot and shutdownsystemd-reboot.service8 -- System shutdown logicsystemd-remount-fs8 -- Remount root and kernel file systemssystemd-remount-fs.service8 -- Remount root and kernel file systemssystemd-resolved8 -- Network Name Resolution managersystemd-resolved.service8 -- Network Name Resolution managersystemd-rfkill8 -- Load and save the RF kill switch state at boot and shutdownsystemd-rfkill@.service8 -- Load and save the RF kill switch state at boot and shutdownsystemd-run1 -- Run programs in transient scope or service or timer unitssystemd-shutdown8 -- System shutdown logicsystemd-shutdownd8 -- Scheduled shutdown servicesystemd-shutdownd.service8 -- Scheduled shutdown servicesystemd-shutdownd.socket8 -- Scheduled shutdown servicesystemd-sleep8 -- System sleep state logicsystemd-sleep.conf5 -- Suspend and hibernation configuration filesystemd-socket-proxyd8 -- Bidirectionally proxy local sockets to another (possibly remote) socket.systemd-suspend.service8 -- System sleep state logicsystemd-sysctl8 -- Configure kernel parameters at bootsystemd-sysctl.service8 -- Configure kernel parameters at bootsystemd-system-update-generator8 -- Generator for redirecting boot to offline update modesystemd-system.conf5 -- System and session service manager configuration filessystemd-sysusers8 -- Allocate system users and groupssystemd-sysusers.service8 -- Allocate system users and groupssystemd-sysv-generator8 -- Unit generator for SysV init scriptssystemd-timedated8 -- Time and date bus mechanismsystemd-timedated.service8 -- Time and date bus mechanismsystemd-timesyncd8 -- Network Time Synchronizationsystemd-timesyncd.service8 -- Network Time Synchronizationsystemd-tmpfiles8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-clean.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-clean.timer8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-setup-dev.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tmpfiles-setup.service8 -- Creates, deletes and cleans up volatile and temporary files and directoriessystemd-tty-ask-password-agent1 -- List or process pending systemd password requestssystemd-udevd8 -- Device event managing daemonsystemd-udevd-control.socket8 -- Device event managing daemonsystemd-udevd-kernel.socket8 -- Device event managing daemonsystemd-udevd.service8 -- Device event managing daemonsystemd-update-done8 -- Marksystemd-update-done.service8 -- Marksystemd-update-utmp8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-update-utmp-runlevel.service8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-update-utmp.service8 -- Write audit and utmp updates at bootup, runlevel changes and shutdownsystemd-user-sessions8 -- Permit user logins after boot, prohibit user logins at shutdownsystemd-user-sessions.service8 -- Permit user logins after boot, prohibit user logins at shutdownsystemd-user.conf5 -- System and session service manager configuration filessystemd-vconsole-setup8 -- Configure the virtual console at bootsystemd-vconsole-setup.service8 -- Configure the virtual console at bootsystemd.automount5 -- Automount unit configurationsystemd.device5 -- Device unit configurationsystemd.directives7 -- Index of configuration directivessystemd.exec5 -- Execution environment configurationsystemd.generator7 -- Systemd unit generatorssystemd.journal-fields7 -- Special journal fieldssystemd.kill5 -- Process killing procedure configurationsystemd.link5 -- Network device configurationsystemd.mount5 -- Mount unit configurationsystemd.netdev5 -- Virtual Network Device configurationsystemd.network5 -- Network configurationsystemd.path5 -- Path unit configurationsystemd.preset5 -- Service enablement presetssystemd.resource-control5 -- Resource control unit settingssystemd.scope5 -- Scope unit configurationsystemd.service5 -- Service unit configurationsystemd.slice5 -- Slice unit configurationsystemd.snapshot5 -- Snapshot unit configurationsystemd.socket5 -- Socket unit configurationsystemd.special7 -- Special systemd unitssystemd.swap5 -- Swap unit configurationsystemd.target5 -- Target unit configurationsystemd.time7 -- Time and date specificationssystemd.timer5 -- Timer unit configurationsystemd.unit5 -- Unit configurationsysusers.d5 -- Declarative allocation of system users and groupsTtelinit8 -- Change SysV runleveltimedatectl1 -- Control the system time and datetimesyncd.conf5 -- Network Time Synchronization configuration filestimesyncd.conf.d5 -- Network Time Synchronization configuration filestmpfiles.d5 -- Configuration for creation, deletion and cleaning of volatile and temporary filesUudev7 -- Dynamic device managementudev.conf5 -- Configuration for device event managing daemonudevadm8 -- udev management tooluser.conf.d5 -- System and session service manager configuration filesVvconsole.conf5 -- Configuration file for the virtual console See Also systemd.directives7 - This index contains 440 entries, referring to 194 individual manual pages. + This index contains 450 entries, referring to 199 individual manual pages. diff --git a/man/systemd.journal-fields.7 b/man/systemd.journal-fields.7 index 9317db0f8..523751737 100644 --- a/man/systemd.journal-fields.7 +++ b/man/systemd.journal-fields.7 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.JOURNAL\-FIELDS" "7" "" "systemd 218" "systemd.journal-fields" +.TH "SYSTEMD\&.JOURNAL\-FIELDS" "7" "" "systemd 219" "systemd.journal-fields" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.journal-fields.html b/man/systemd.journal-fields.html index fa0129494..9655342e1 100644 --- a/man/systemd.journal-fields.html +++ b/man/systemd.journal-fields.html @@ -19,252 +19,163 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.journal-fields — Special journal fields

Description¶

Entries in the journal resemble an environment - block in their syntax but with fields that can - include binary data. Primarily, fields are formatted - UTF-8 text strings, and binary formatting is used only - where formatting as UTF-8 text strings makes little - sense. New fields may freely be defined by - applications, but a few fields have special - meaning. All fields with special meanings are - optional. In some cases, fields may appear more than - once per entry.

User Journal Fields¶

User fields are fields that are directly passed - from clients and stored in the journal.

MESSAGE=¶

The human-readable - message string for this - entry. This is supposed to be - the primary text shown to the - user. It is usually not - translated (but might be in - some cases), and is not - supposed to be parsed for meta - data.

MESSAGE_ID=¶

A 128-bit message - identifier ID for recognizing - certain message types, if this - is desirable. This should - contain a 128-bit ID formatted - as a lower-case hexadecimal - string, without any separating - dashes or suchlike. This is - recommended to be a - UUID-compatible ID, but this is not - enforced, and formatted - differently. Developers can - generate a new ID for this - purpose with journalctl - --new-id. -

PRIORITY=¶

A priority value between - 0 ("emerg") - and 7 - ("debug") - formatted as a decimal - string. This field is - compatible with syslog's - priority concept.

CODE_FILE=, CODE_LINE=, CODE_FUNC=¶

The code location - generating this message, if - known. Contains the source - filename, the line number and - the function name.

ERRNO=¶

The low-level Unix error - number causing this entry, if - any. Contains the numeric - value of - errno(3) - formatted as a decimal - string.

SYSLOG_FACILITY=, SYSLOG_IDENTIFIER=, SYSLOG_PID=¶

Syslog compatibility - fields containing the facility - (formatted as decimal string), - the identifier string - (i.e. "tag"), and the client - PID. (Note that the tag is - usually derived from glibc's - program_invocation_short_name - variable, see program_invocation_short_name(3).)

Trusted Journal Fields¶

Fields prefixed with an underscore are trusted - fields, i.e. fields that are implicitly added by the - journal and cannot be altered by client code.

_PID=, _UID=, _GID=¶

The process, user, and - group ID of the process the - journal entry originates from - formatted as a decimal - string.

_COMM=, _EXE=, _CMDLINE=¶

The name, the executable - path, and the command line of - the process the journal entry - originates from.

_CAP_EFFECTIVE=¶

The effective capabilities(7) of - the process the journal entry - originates from.

_AUDIT_SESSION=, _AUDIT_LOGINUID=¶

The session and login - UID of the process the journal - entry originates from, as - maintained by the kernel audit - subsystem.

_SYSTEMD_CGROUP=, _SYSTEMD_SESSION=, _SYSTEMD_UNIT=, _SYSTEMD_USER_UNIT=, _SYSTEMD_OWNER_UID=, _SYSTEMD_SLICE=¶

The control group path - in the systemd hierarchy, the - systemd session ID (if any), - the systemd unit name (if - any), the systemd user session - unit name (if any), the owner - UID of the systemd session (if - any) and the systemd slice - unit of the process the - journal entry originates - from.

_SELINUX_CONTEXT=¶

The SELinux security - context (label) of the process - the journal entry originates - from.

_SOURCE_REALTIME_TIMESTAMP=¶

The earliest trusted - timestamp of the message, if - any is known that is different - from the reception time of the - journal. This is the time in - microseconds since the epoch UTC, - formatted as a decimal - string.

_BOOT_ID=¶

The kernel boot ID for - the boot the message was - generated in, formatted as - a 128-bit hexadecimal - string.

_MACHINE_ID=¶

The machine ID of the - originating host, as available - in - machine-id(5).

_HOSTNAME=¶

The name of the - originating host.

_TRANSPORT=¶

How the entry was - received by the journal - service. Valid transports are: -

- driver - ¶

for - internally - generated - messages -

- syslog - ¶

for those - received via the - local syslog - socket with the - syslog protocol -

- journal - ¶

for those - received via the - native journal - protocol -

- stdout - ¶

for those - read from a - service's - standard output - or error output -

- kernel - ¶

for those - read from the - kernel -

Kernel Journal Fields¶

Kernel fields are fields that are used by - messages originating in the kernel and stored in the - journal.

_KERNEL_DEVICE=¶

The kernel device - name. If the entry is - associated to a block device, - the major and minor of the - device node, separated by ":" - and prefixed by "b". Similar - for character devices but - prefixed by "c". For network - devices, this is the interface index - prefixed by "n". For all other - devices, this is the subsystem name - prefixed by "+", followed by - ":", followed by the kernel - device name.

_KERNEL_SUBSYSTEM=¶

The kernel subsystem name.

_UDEV_SYSNAME=¶

The kernel device name - as it shows up in the device - tree below - /sys.

_UDEV_DEVNODE=¶

The device node path of - this device in - /dev.

_UDEV_DEVLINK=¶

Additional symlink names - pointing to the device node in - /dev. This - field is frequently set more - than once per entry.

Fields to log on behalf of a different program¶

Fields in this section are used by programs - to specify that they are logging on behalf of another - program or unit. -

Fields used by the systemd-coredump - coredump kernel helper: -

COREDUMP_UNIT=, COREDUMP_USER_UNIT=¶

Used to annotate - messages containing coredumps from - system and session units. - See - coredumpctl(1). -

Priviledged programs (currently UID 0) may - attach OBJECT_PID= to a - message. This will instruct - systemd-journald to attach - additional fields on behalf of the caller:

OBJECT_PID=PID¶

PID of the program that this - message pertains to. -

OBJECT_UID=, OBJECT_GID=, OBJECT_COMM=, OBJECT_EXE=, OBJECT_CMDLINE=, OBJECT_AUDIT_SESSION=, OBJECT_AUDIT_LOGINUID=, OBJECT_SYSTEMD_CGROUP=, OBJECT_SYSTEMD_SESSION=, OBJECT_SYSTEMD_OWNER_UID=, OBJECT_SYSTEMD_UNIT=, OBJECT_SYSTEMD_USER_UNIT=¶

These are additional fields added automatically - by systemd-journald. - Their meaning is the same as - _UID=, - _GID=, - _COMM=, - _EXE=, - _CMDLINE=, - _AUDIT_SESSION=, - _AUDIT_LOGINUID=, - _SYSTEMD_CGROUP=, - _SYSTEMD_SESSION=, - _SYSTEMD_UNIT=, - _SYSTEMD_USER_UNIT=, and - _SYSTEMD_OWNER_UID= - as described above, except that the - process identified by PID - is described, instead of the process - which logged the message.

Address Fields¶

During serialization into external formats, such - as the Journal - Export Format or the Journal - JSON Format, the addresses of journal entries - are serialized into fields prefixed with double - underscores. Note that these are not proper fields when - stored in the journal but for addressing metadata of - entries. They cannot be written as part of structured - log entries via calls such as - sd_journal_send(3). They - may also not be used as matches for - sd_journal_add_match(3)

__CURSOR=¶

The cursor for the - entry. A cursor is an opaque - text string that uniquely - describes the position of an - entry in the journal and is - portable across machines, - platforms and journal files. -

__REALTIME_TIMESTAMP=¶

The wallclock time - (CLOCK_REALTIME) - at the point in time the entry - was received by the journal, - in microseconds since the epoch - UTC, formatted as a decimal - string. This has different - properties from - "_SOURCE_REALTIME_TIMESTAMP=", - as it is usually a bit later - but more likely to be monotonic. -

__MONOTONIC_TIMESTAMP=¶

The monotonic time - (CLOCK_MONOTONIC) - at the point in time the entry - was received by the journal in - microseconds, formatted as a decimal - string. To be useful as an - address for the entry, this - should be combined with the - boot ID in "_BOOT_ID=". -

+ gudev systemd 219

Name

systemd.journal-fields — Special journal fields

Description¶

Entries in the journal resemble an environment block in + their syntax but with fields that can include binary data. + Primarily, fields are formatted UTF-8 text strings, and binary + formatting is used only where formatting as UTF-8 text strings + makes little sense. New fields may freely be defined by + applications, but a few fields have special meaning. All fields + with special meanings are optional. In some cases, fields may + appear more than once per entry.

User Journal Fields¶

User fields are fields that are directly passed from clients + and stored in the journal.

MESSAGE=¶

The human-readable message string for this entry. This + is supposed to be the primary text shown to the user. It is + usually not translated (but might be in some cases), and is + not supposed to be parsed for meta data.

MESSAGE_ID=¶

A 128-bit message identifier ID for recognizing + certain message types, if this is desirable. This should + contain a 128-bit ID formatted as a lower-case hexadecimal + string, without any separating dashes or suchlike. This is + recommended to be a UUID-compatible ID, but this is not + enforced, and formatted differently. Developers can generate + a new ID for this purpose with journalctl + --new-id. +

PRIORITY=¶

A priority value between 0 ("emerg") + and 7 ("debug") formatted as a decimal + string. This field is compatible with syslog's priority + concept.

CODE_FILE=, CODE_LINE=, CODE_FUNC=¶

The code location generating this message, if known. + Contains the source filename, the line number and the + function name.

ERRNO=¶

The low-level Unix error number causing this entry, if + any. Contains the numeric value of + errno(3) + formatted as a decimal string.

SYSLOG_FACILITY=, SYSLOG_IDENTIFIER=, SYSLOG_PID=¶

Syslog compatibility fields containing the facility + (formatted as decimal string), the identifier string (i.e. + "tag"), and the client PID. (Note that the tag is usually + derived from glibc's + program_invocation_short_name variable, + see + program_invocation_short_name(3).)

Trusted Journal Fields¶

Fields prefixed with an underscore are trusted fields, i.e. + fields that are implicitly added by the journal and cannot be + altered by client code.

_PID=, _UID=, _GID=¶

The process, user, and group ID of the process the + journal entry originates from formatted as a decimal + string.

_COMM=, _EXE=, _CMDLINE=¶

The name, the executable path, and the command line of + the process the journal entry originates from.

_CAP_EFFECTIVE=¶

The effective + capabilities(7) + of the process the journal entry originates from.

_AUDIT_SESSION=, _AUDIT_LOGINUID=¶

The session and login UID of the process the journal + entry originates from, as maintained by the kernel audit + subsystem.

_SYSTEMD_CGROUP=, _SYSTEMD_SESSION=, _SYSTEMD_UNIT=, _SYSTEMD_USER_UNIT=, _SYSTEMD_OWNER_UID=, _SYSTEMD_SLICE=¶

The control group path in the systemd hierarchy, the + systemd session ID (if any), the systemd unit name (if any), + the systemd user session unit name (if any), the owner UID + of the systemd session (if any) and the systemd slice unit + of the process the journal entry originates from.

_SELINUX_CONTEXT=¶

The SELinux security context (label) of the process + the journal entry originates from.

_SOURCE_REALTIME_TIMESTAMP=¶

The earliest trusted timestamp of the message, if any + is known that is different from the reception time of the + journal. This is the time in microseconds since the epoch + UTC, formatted as a decimal string.

_BOOT_ID=¶

The kernel boot ID for the boot the message was + generated in, formatted as a 128-bit hexadecimal + string.

_MACHINE_ID=¶

The machine ID of the originating host, as available + in + machine-id(5).

_HOSTNAME=¶

The name of the originating host.

_TRANSPORT=¶

How the entry was received by the journal service. + Valid transports are: +

+ driver + ¶

for internally generated messages +

+ syslog + ¶

for those received via the local syslog socket + with the syslog protocol +

+ journal + ¶

for those received via the native journal + protocol +

+ stdout + ¶

for those read from a service's standard output + or error output +

+ kernel + ¶

for those read from the kernel +

Kernel Journal Fields¶

Kernel fields are fields that are used by messages + originating in the kernel and stored in the journal.

_KERNEL_DEVICE=¶

The kernel device name. If the entry is associated to + a block device, the major and minor of the device node, + separated by ":" and prefixed by + "b". Similar for character devices but + prefixed by "c". For network devices, this + is the interface index prefixed by "n". For + all other devices, this is the subsystem name prefixed by + "+", followed by ":", + followed by the kernel device name.

_KERNEL_SUBSYSTEM=¶

The kernel subsystem name.

_UDEV_SYSNAME=¶

The kernel device name as it shows up in the device + tree below /sys.

_UDEV_DEVNODE=¶

The device node path of this device in + /dev.

_UDEV_DEVLINK=¶

Additional symlink names pointing to the device node + in /dev. This field is frequently set + more than once per entry.

Fields to log on behalf of a different program¶

Fields in this section are used by programs to specify that + they are logging on behalf of another program or unit. +

Fields used by the systemd-coredump + coredump kernel helper: +

COREDUMP_UNIT=, COREDUMP_USER_UNIT=¶

Used to annotate messages containing coredumps from + system and session units. See + coredumpctl(1). +

Priviledged programs (currently UID 0) may attach + OBJECT_PID= to a message. This will instruct + systemd-journald to attach additional fields on + behalf of the caller:

OBJECT_PID=PID¶

PID of the program that this message pertains to. +

OBJECT_UID=, OBJECT_GID=, OBJECT_COMM=, OBJECT_EXE=, OBJECT_CMDLINE=, OBJECT_AUDIT_SESSION=, OBJECT_AUDIT_LOGINUID=, OBJECT_SYSTEMD_CGROUP=, OBJECT_SYSTEMD_SESSION=, OBJECT_SYSTEMD_OWNER_UID=, OBJECT_SYSTEMD_UNIT=, OBJECT_SYSTEMD_USER_UNIT=¶

These are additional fields added automatically by + systemd-journald. Their meaning is the + same as + _UID=, + _GID=, + _COMM=, + _EXE=, + _CMDLINE=, + _AUDIT_SESSION=, + _AUDIT_LOGINUID=, + _SYSTEMD_CGROUP=, + _SYSTEMD_SESSION=, + _SYSTEMD_UNIT=, + _SYSTEMD_USER_UNIT=, and + _SYSTEMD_OWNER_UID= + as described above, except that the process identified by + PID is described, instead of the + process which logged the message.

Address Fields¶

During serialization into external formats, such as the + Journal + Export Format or the Journal + JSON Format, the addresses of journal entries are + serialized into fields prefixed with double underscores. Note that + these are not proper fields when stored in the journal but for + addressing metadata of entries. They cannot be written as part of + structured log entries via calls such as + sd_journal_send(3). + They may also not be used as matches for + sd_journal_add_match(3)

__CURSOR=¶

The cursor for the entry. A cursor is an opaque text + string that uniquely describes the position of an entry in + the journal and is portable across machines, platforms and + journal files. +

__REALTIME_TIMESTAMP=¶

The wallclock time + (CLOCK_REALTIME) at the point in time + the entry was received by the journal, in microseconds since + the epoch UTC, formatted as a decimal string. This has + different properties from + "_SOURCE_REALTIME_TIMESTAMP=", as it is + usually a bit later but more likely to be monotonic. +

__MONOTONIC_TIMESTAMP=¶

The monotonic time + (CLOCK_MONOTONIC) at the point in time + the entry was received by the journal in microseconds, + formatted as a decimal string. To be useful as an address + for the entry, this should be combined with the boot ID in + "_BOOT_ID=". +

diff --git a/man/systemd.journal-fields.xml b/man/systemd.journal-fields.xml index 154b95ac7..1fd46de31 100644 --- a/man/systemd.journal-fields.xml +++ b/man/systemd.journal-fields.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.kill - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.kill - 5 - - - - systemd.kill - Process killing procedure - configuration - - - - service.service, - socket.socket, - mount.mount, - swap.swap, - scope.scope - - - - Description - - Unit configuration files for services, sockets, - mount points, swap devices and scopes share a subset - of configuration options which define the - killing procedure of processes belonging to the unit. - - This man page lists the configuration options - shared by these five unit types. See - systemd.unit5 - for the common options shared by all unit - configuration files, and - systemd.service5, - systemd.socket5, - systemd.swap5, - systemd.mount5 - and - systemd.scope5 - for more information on the configuration file options - specific to each unit type. - - The kill procedure - configuration options are configured in the [Service], - [Socket], [Mount] or [Swap] section, depending on the - unit type. - - - - Options - - - - - KillMode= - Specifies how - processes of this unit shall be - killed. One of - , - , - , - . - - If set to - , all - remaining processes in the control - group of this unit will be killed on - unit stop (for services: after the - stop command is executed, as - configured with - ExecStop=). If set - to , only the - main process itself is killed. If set - to , the - SIGTERM signal - (see below) is sent to the main - process while the subsequent - SIGKILL signal - (see below) is sent to all remaining - processes of the unit's control - group. If set to - , no process is - killed. In this case, only the stop - command will be executed on unit stop, - but no process be killed - otherwise. Processes remaining alive - after stop are left in their control - group and the control group continues - to exist after stop unless it is - empty. - - Processes will first be - terminated via - SIGTERM (unless - the signal to send is changed via - KillSignal=). Optionally, - this is immediately followed by a - SIGHUP (if - enabled with - SendSIGHUP=). If - then, after a delay (configured via the - TimeoutStopSec= option), - processes still remain, the - termination request is repeated with - the SIGKILL - signal (unless this is disabled via - the SendSIGKILL= - option). See - kill2 - for more - information. - - Defaults to - . - - - - KillSignal= - Specifies which signal - to use when killing a service. This - controls the signal that is sent as - first step of shutting down a unit - (see above), and is usually followed - by SIGKILL (see - above and below). For a list of valid - signals, see - signal7. Defaults - to SIGTERM. - - - - - SendSIGHUP= - Specifies whether to - send SIGHUP to - remaining processes immediately after - sending the signal configured with - KillSignal=. This - is useful to indicate to shells and - shell-like programs that their - connection has been severed. Takes a - boolean value. Defaults to "no". - - - - - SendSIGKILL= - Specifies whether to - send SIGKILL to remaining processes - after a timeout, if the normal - shutdown procedure left processes of - the service around. Takes a boolean - value. Defaults to "yes". - - - - - - - - See Also - - systemd1, - systemctl1, - journalctl8, - systemd.unit5, - systemd.service5, - systemd.socket5, - systemd.swap5, - systemd.mount5, - systemd.exec5, - systemd.directives7, - kill2, - signal7 - - + + systemd.kill + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.kill + 5 + + + + systemd.kill + Process killing procedure + configuration + + + + service.service, + socket.socket, + mount.mount, + swap.swap, + scope.scope + + + + Description + + Unit configuration files for services, sockets, mount + points, swap devices and scopes share a subset of configuration + options which define the killing procedure of processes belonging + to the unit. + + This man page lists the configuration options shared by + these five unit types. See + systemd.unit5 + for the common options shared by all unit configuration files, and + systemd.service5, + systemd.socket5, + systemd.swap5, + systemd.mount5 + and + systemd.scope5 + for more information on the configuration file options specific to + each unit type. + + The kill procedure configuration options are configured in + the [Service], [Socket], [Mount] or [Swap] section, depending on + the unit type. + + + + Options + + + + + KillMode= + Specifies how processes of this unit shall be + killed. One of + , + , + , + . + + If set to , all remaining + processes in the control group of this unit will be killed on + unit stop (for services: after the stop command is executed, + as configured with ExecStop=). If set to + , only the main process itself is + killed. If set to , the + SIGTERM signal (see below) is sent to the + main process while the subsequent SIGKILL + signal (see below) is sent to all remaining processes of the + unit's control group. If set to , no + process is killed. In this case, only the stop command will be + executed on unit stop, but no process be killed otherwise. + Processes remaining alive after stop are left in their control + group and the control group continues to exist after stop + unless it is empty. + + Processes will first be terminated via + SIGTERM (unless the signal to send is + changed via KillSignal=). Optionally, this + is immediately followed by a SIGHUP (if + enabled with SendSIGHUP=). If then, after a + delay (configured via the TimeoutStopSec= + option), processes still remain, the termination request is + repeated with the SIGKILL signal (unless + this is disabled via the SendSIGKILL= + option). See + kill2 + for more information. + + Defaults to + . + + + + KillSignal= + Specifies which signal to use when killing a + service. This controls the signal that is sent as first step + of shutting down a unit (see above), and is usually followed + by SIGKILL (see above and below). For a + list of valid signals, see + signal7. + Defaults to SIGTERM. + + + + SendSIGHUP= + Specifies whether to send + SIGHUP to remaining processes immediately + after sending the signal configured with + KillSignal=. This is useful to indicate to + shells and shell-like programs that their connection has been + severed. Takes a boolean value. Defaults to "no". + + + + + SendSIGKILL= + Specifies whether to send + SIGKILL to remaining processes after a + timeout, if the normal shutdown procedure left processes of + the service around. Takes a boolean value. Defaults to "yes". + + + + + + + + See Also + + systemd1, + systemctl1, + journalctl8, + systemd.unit5, + systemd.service5, + systemd.socket5, + systemd.swap5, + systemd.mount5, + systemd.exec5, + systemd.directives7, + kill2, + signal7 + + diff --git a/man/systemd.link.5 b/man/systemd.link.5 index 1ba2f9ae0..04ae12d02 100644 --- a/man/systemd.link.5 +++ b/man/systemd.link.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.LINK" "5" "" "systemd 218" "systemd.link" +.TH "SYSTEMD\&.LINK" "5" "" "systemd 219" "systemd.link" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -47,9 +47,13 @@ with the same name as a link file in .PP The link file contains a "[Match]" -section, which determines if a given link file may be applied to a given device; and a +section, which determines if a given link file may be applied to a given device, as well as a "[Link]" -section specifying how the device should be configured\&. The first (in lexical order) of the link files that matches a given device is applied\&. +section specifying how the device should be configured\&. The first (in lexical order) of the link files that matches a given device is applied\&. Note that a default file +99\-default\&.link +is shipped by the system, any user\-supplied +\&.link +should hence have a lexically earlier name to be considered at all\&. .SH "[MATCH] SECTION OPTIONS" .PP A link file is said to match a device if each of the entries in the @@ -63,18 +67,18 @@ The hardware address\&. .PP \fIOriginalName=\fR .RS 4 -The device name, as exposed by the udev property "INTERFACE"\&. May contain shell style globs\&. This can not be used to match on names that have already been changed from userspace\&. Caution is adviced when matching on kernel\-assigned names, as they are known to be unstable between reboots\&. +A whitespace\-separated list of shell\-style globs matching the device name, as exposed by the udev property "INTERFACE"\&. This can not be used to match on names that have already been changed from userspace\&. Caution is advised when matching on kernel\-assigned names, as they are known to be unstable between reboots\&. .RE .PP \fIPath=\fR .RS 4 -The persistent path, as exposed by the udev property -"ID_PATH"\&. May contain shell style globs\&. +A whitespace\-separated list of shell\-style globs matching the persistent path, as exposed by the udev property +"ID_PATH"\&. .RE .PP \fIDriver=\fR .RS 4 -The driver currently bound to the device, as exposed by the udev property +A whitespace\-separated list of shell\-style globs matching the driver currently bound to the device, as exposed by the udev property "DRIVER" of its parent device, or if that is not set, the driver as exposed by "ethtool \-i" @@ -83,7 +87,7 @@ of the device itself\&. .PP \fIType=\fR .RS 4 -The device type, as exposed by the udev property +A whitespace\-separated list of shell\-style globs matching the device type, as exposed by the udev property "DEVTYPE"\&. .RE .PP @@ -146,7 +150,7 @@ The policy by which the MAC address should be set\&. The available policies are: .PP "persistent" .RS 4 -If the hardware has a persistent MAC address, as most hardware should, and if it is used by the kernel, nothing is done\&. Otherwise, a new MAC address is generated which is guaranteed to be the same on every boot for the given machine and the given device, but which is otherwise random\&. +If the hardware has a persistent MAC address, as most hardware should, and if it is used by the kernel, nothing is done\&. Otherwise, a new MAC address is generated which is guaranteed to be the same on every boot for the given machine and the given device, but which is otherwise random\&. This feature depends on ID_NET_NAME_* properties existing for the link, on hardware where these properties are not set the generation of a persistent MAC address will fail\&. .RE .PP "random" @@ -284,4 +288,6 @@ MACAddress=cb:a9:87:65:43:21 .SH "SEE ALSO" .PP \fBsystemd-udevd.service\fR(8), -\fBudevadm\fR(8) +\fBudevadm\fR(8), +\fBsystemd.netdev\fR(5), +\fBsystemd.network\fR(5) diff --git a/man/systemd.link.html b/man/systemd.link.html index 66f13fb5c..7fe564865 100644 --- a/man/systemd.link.html +++ b/man/systemd.link.html @@ -19,115 +19,119 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.link — Network device configuration

Synopsis

link.link

Description¶

Network link configuration is performed by the net_setup_link - udev builtin.

The link files are read from the files located in the - system network directory /usr/lib/systemd/network, - the volatile runtime network directory /run/systemd/network, - and the local administration network directory /etc/systemd/network. - Link files must have the extension .link; other extensions are ignored. - All link files are collectively sorted and processed in lexical order, - regardless of the directories in which they live. However, files with - identical filenames replace each other. Files in /etc - have the highest priority, files in /run take precedence - over files with the same name in /usr/lib. This can be - used to override a system-supplied link file with a local file if needed; - a symlink in /etc with the same name as a link file in - /usr/lib, pointing to /dev/null, - disables the link file entirely.

The link file contains a "[Match]" section, which - determines if a given link file may be applied to a given device; and a - "[Link]" section specifying how the device should be - configured. The first (in lexical order) of the link files that matches - a given device is applied.

[Match] Section Options¶

A link file is said to match a device if each of the entries in the - "[Match]" section matches, or if the section is empty. - The following keys are accepted:

MACAddress=¶

The hardware address.

OriginalName=¶

The device name, as exposed by the udev - property "INTERFACE". May contain shell style - globs. This can not be used to match on names - that have already been changed from userspace. - Caution is adviced when matching on - kernel-assigned names, as they are known to - be unstable between reboots.

Path=¶

The persistent path, as exposed by the - udev property "ID_PATH". May - contain shell style globs.

Driver=¶

The driver currently bound to the device, - as exposed by the udev property "DRIVER" - of its parent device, or if that is not set, the - driver as exposed by "ethtool -i" - of the device itself.

Type=¶

The device type, as exposed by the udev - property "DEVTYPE".

Host=¶

Matches against the hostname or machine - ID of the host. See "ConditionHost=" in - systemd.unit(5) - for details.

Virtualization=¶

Checks whether the system is executed in - a virtualized environment and optionally test - whether it is a specific implementation. See - "ConditionVirtualization=" in - systemd.unit(5) - for details.

KernelCommandLine=¶

Checks whether a specific kernel command - line option is set (or if prefixed with the - exclamation mark unset). See - "ConditionKernelCommandLine=" in - systemd.unit(5) - for details.

Architecture=¶

Checks whether the system is running on a - specific architecture. See - "ConditionArchitecture=" in - systemd.unit(5) - for details.

[Link] Section Options¶

The "[Link]" section accepts the following - keys:

Description=¶

A description of the device.

Alias=¶

The "ifalias" is set to - this value.

MACAddressPolicy=¶

The policy by which the MAC address - should be set. The available policies are: -

"persistent"¶

If the hardware has a persistent - MAC address, as most hardware should, - and if it is used by the kernel, nothing - is done. Otherwise, a new MAC address - is generated which is guaranteed to be - the same on every boot for the given - machine and the given device, but which - is otherwise random.

"random"¶

If the kernel is using a random MAC - address, nothing is done. Otherwise, a new - address is randomly generated each time the - device appears, typically at boot.

MACAddress=¶

The MAC address to use, if no - "MACAddressPolicy=" - is specified.

NamePolicy=¶

An ordered, space-separated list of - policies by which the interface name should - be set. "NamePolicy" may be - disabled by specifying - "net.ifnames=0" on the kernel - command line. Each of the policies may fail, and - the first successful one is used. The name is - not set directly, but is exported to udev as - the property "ID_NET_NAME", - which is, by default, used by a udev rule to set - "NAME". If the name has already - been set by userspace, no renaming is performed. - The available policies are:

"kernel"¶

If the kernel claims that the name it - has set for a device is predictable, then - no renaming is performed. -

"database"¶

The name is set based on entries in - the udev's Hardware Database with the key - "ID_NET_NAME_FROM_DATABASE". -

"onboard"¶

The name is set based on information given by - the firmware for on-board devices, as exported by - the udev property "ID_NET_NAME_ONBOARD". -

"slot"¶

The name is set based on information given by - the firmware for hot-plug devices, as exported by - the udev property "ID_NET_NAME_SLOT". -

"path"¶

The name is set based on the device's physical - location, as exported by the udev property - "ID_NET_NAME_PATH".

"mac"¶

The name is set based on the device's - persistent MAC address, as exported by the udev - property "ID_NET_NAME_MAC".

Name=¶

The interface name to use in case all the - policies specified in - NamePolicy= fail, or in case - NamePolicy= is missing or - disabled.

MTUBytes=¶

The maximum transmission unit in bytes to - set for the device. The usual suffixes K, M, G, - are supported and are understood to the base of - 1024.

BitsPerSecond=¶

The speed to set for the device, the - value is rounded down to the nearest Mbps. - The usual suffixes K, M, G, are supported and - are understood to the base of 1000.

Duplex=¶

The duplex mode to set for the device. - The accepted values are "half" - and "full".

WakeOnLan=¶

The Wake-on-LAN policy to set for the - device. The supported values are:

"phy"¶

Wake on PHY activity.

"magic"¶

Wake on receipt of a magic packet. -

"off"¶

Never wake.

Example¶

Example 1. /etc/systemd/network/wireless.link

[Match]
+  gudev systemd 219

Name

systemd.link — Network device configuration

Synopsis

link.link

Description¶

Network link configuration is performed by the + net_setup_link udev builtin.

The link files are read from the files located in the system + network directory /usr/lib/systemd/network, + the volatile runtime network directory + /run/systemd/network, and the local + administration network directory + /etc/systemd/network. Link files must have + the extension .link; other extensions are + ignored. All link files are collectively sorted and processed in + lexical order, regardless of the directories in which they live. + However, files with identical filenames replace each other. Files + in /etc have the highest priority, files in + /run take precedence over files with the same + name in /usr/lib. This can be used to + override a system-supplied link file with a local file if needed; + a symlink in /etc with the same name as a + link file in /usr/lib, pointing to + /dev/null, disables the link file + entirely.

The link file contains a "[Match]" section, + which determines if a given link file may be applied to a given + device, as well as a "[Link]" section specifying + how the device should be configured. The first (in lexical order) + of the link files that matches a given device is applied. Note + that a default file 99-default.link is + shipped by the system, any user-supplied + .link should hence have a lexically earlier + name to be considered at all.

[Match] Section Options¶

A link file is said to match a device if each of the entries + in the "[Match]" section matches, or if the + section is empty. The following keys are accepted:

MACAddress=¶

The hardware address.

OriginalName=¶

A whitespace-separated list of shell-style globs matching + the device name, as exposed by the udev property + "INTERFACE". This can not be used to match on names that have + already been changed from userspace. Caution is advised when matching on + kernel-assigned names, as they are known to be unstable + between reboots.

Path=¶

A whitespace-separated list of shell-style globs matching + the persistent path, as exposed by the udev property + "ID_PATH".

Driver=¶

A whitespace-separated list of shell-style globs matching + the driver currently bound to the device, + as exposed by the udev property "DRIVER" + of its parent device, or if that is not set, the + driver as exposed by "ethtool -i" + of the device itself.

Type=¶

A whitespace-separated list of shell-style globs matching + the device type, as exposed by the udev + property "DEVTYPE".

Host=¶

Matches against the hostname or machine + ID of the host. See "ConditionHost=" in + systemd.unit(5) + for details.

Virtualization=¶

Checks whether the system is executed in + a virtualized environment and optionally test + whether it is a specific implementation. See + "ConditionVirtualization=" in + systemd.unit(5) + for details.

KernelCommandLine=¶

Checks whether a specific kernel command line option + is set (or if prefixed with the exclamation mark unset). See + "ConditionKernelCommandLine=" in + systemd.unit(5) + for details.

Architecture=¶

Checks whether the system is running on a specific + architecture. See "ConditionArchitecture=" + in + systemd.unit(5) + for details.

[Link] Section Options¶

The "[Link]" section accepts the following + keys:

Description=¶

A description of the device.

Alias=¶

The "ifalias" is set to this + value.

MACAddressPolicy=¶

The policy by which the MAC address should be set. The + available policies are: +

"persistent"¶

If the hardware has a persistent MAC address, as + most hardware should, and if it is used by the kernel, + nothing is done. Otherwise, a new MAC address is + generated which is guaranteed to be the same on every + boot for the given machine and the given device, but + which is otherwise random. This feature depends on ID_NET_NAME_* + properties existing for the link, on hardware where these + properties are not set the generation of a persistent MAC address + will fail.

"random"¶

If the kernel is using a random MAC address, + nothing is done. Otherwise, a new address is randomly + generated each time the device appears, typically at + boot.

MACAddress=¶

The MAC address to use, if no + "MACAddressPolicy=" + is specified.

NamePolicy=¶

An ordered, space-separated list of policies by which + the interface name should be set. + "NamePolicy" may be disabled by specifying + "net.ifnames=0" on the kernel command line. + Each of the policies may fail, and the first successful one + is used. The name is not set directly, but is exported to + udev as the property "ID_NET_NAME", which + is, by default, used by a udev rule to set + "NAME". If the name has already been set by + userspace, no renaming is performed. The available policies + are:

"kernel"¶

If the kernel claims that the name it has set + for a device is predictable, then no renaming is + performed.

"database"¶

The name is set based on entries in the udev's + Hardware Database with the key + "ID_NET_NAME_FROM_DATABASE". +

"onboard"¶

The name is set based on information given by + the firmware for on-board devices, as exported by the + udev property "ID_NET_NAME_ONBOARD". +

"slot"¶

The name is set based on information given by + the firmware for hot-plug devices, as exported by the + udev property "ID_NET_NAME_SLOT". +

"path"¶

The name is set based on the device's physical + location, as exported by the udev property + "ID_NET_NAME_PATH".

"mac"¶

The name is set based on the device's persistent + MAC address, as exported by the udev property + "ID_NET_NAME_MAC".

Name=¶

The interface name to use in case all the + policies specified in + NamePolicy= fail, or in case + NamePolicy= is missing or + disabled.

MTUBytes=¶

The maximum transmission unit in bytes to set for the + device. The usual suffixes K, M, G, are supported and are + understood to the base of 1024.

BitsPerSecond=¶

The speed to set for the device, the value is rounded + down to the nearest Mbps. The usual suffixes K, M, G, are + supported and are understood to the base of 1000.

Duplex=¶

The duplex mode to set for the device. The accepted + values are "half" and + "full".

WakeOnLan=¶

The Wake-on-LAN policy to set for the device. The + supported values are:

"phy"¶

Wake on PHY activity.

"magic"¶

Wake on receipt of a magic packet. +

"off"¶

Never wake.

Example¶

Example 1. /etc/systemd/network/wireless.link

[Match]
 MACAddress=12:34:56:78:9a:bc
 Driver=brcmsmac
 Path=pci-0000:02:00.0-*
@@ -141,7 +145,9 @@ Name=wireless0
 MTUBytes=1450
 BitsPerSecond=10M
 WakeOnLan=magic
-MACAddress=cb:a9:87:65:43:21

+MACAddress=cb:a9:87:65:43:21

diff --git a/man/systemd.link.xml b/man/systemd.link.xml index 0eb395089..3fac760b0 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.link - systemd + + systemd.link + systemd - - - Developer - Tom - Gundersen - - - + + + Developer + Tom + Gundersen + + + - - systemd.link - 5 - + + systemd.link + 5 + - - systemd.link - Network device configuration - + + systemd.link + Network device configuration + - - link.link - + + link.link + - - Description + + Description - Network link configuration is performed by the net_setup_link - udev builtin. + Network link configuration is performed by the + net_setup_link udev builtin. - The link files are read from the files located in the - system network directory /usr/lib/systemd/network, - the volatile runtime network directory /run/systemd/network, - and the local administration network directory /etc/systemd/network. - Link files must have the extension .link; other extensions are ignored. - All link files are collectively sorted and processed in lexical order, - regardless of the directories in which they live. However, files with - identical filenames replace each other. Files in /etc - have the highest priority, files in /run take precedence - over files with the same name in /usr/lib. This can be - used to override a system-supplied link file with a local file if needed; - a symlink in /etc with the same name as a link file in - /usr/lib, pointing to /dev/null, - disables the link file entirely. + The link files are read from the files located in the system + network directory /usr/lib/systemd/network, + the volatile runtime network directory + /run/systemd/network, and the local + administration network directory + /etc/systemd/network. Link files must have + the extension .link; other extensions are + ignored. All link files are collectively sorted and processed in + lexical order, regardless of the directories in which they live. + However, files with identical filenames replace each other. Files + in /etc have the highest priority, files in + /run take precedence over files with the same + name in /usr/lib. This can be used to + override a system-supplied link file with a local file if needed; + a symlink in /etc with the same name as a + link file in /usr/lib, pointing to + /dev/null, disables the link file + entirely. - The link file contains a [Match] section, which - determines if a given link file may be applied to a given device; and a - [Link] section specifying how the device should be - configured. The first (in lexical order) of the link files that matches - a given device is applied. - + The link file contains a [Match] section, + which determines if a given link file may be applied to a given + device, as well as a [Link] section specifying + how the device should be configured. The first (in lexical order) + of the link files that matches a given device is applied. Note + that a default file 99-default.link is + shipped by the system, any user-supplied + .link should hence have a lexically earlier + name to be considered at all. + - - [Match] Section Options + + [Match] Section Options - A link file is said to match a device if each of the entries in the - [Match] section matches, or if the section is empty. - The following keys are accepted: + A link file is said to match a device if each of the entries + in the [Match] section matches, or if the + section is empty. The following keys are accepted: - - - MACAddress= - - The hardware address. - - - - OriginalName= - - The device name, as exposed by the udev - property "INTERFACE". May contain shell style - globs. This can not be used to match on names - that have already been changed from userspace. - Caution is adviced when matching on - kernel-assigned names, as they are known to - be unstable between reboots. - - - - Path= - - The persistent path, as exposed by the - udev property ID_PATH. May - contain shell style globs. - - - - Driver= - - The driver currently bound to the device, - as exposed by the udev property DRIVER - of its parent device, or if that is not set, the - driver as exposed by ethtool -i - of the device itself. - - - - Type= - - The device type, as exposed by the udev - property DEVTYPE. - - - - Host= - - Matches against the hostname or machine - ID of the host. See ConditionHost= in - systemd.unit5 - for details. - - - - Virtualization= - - Checks whether the system is executed in - a virtualized environment and optionally test - whether it is a specific implementation. See - ConditionVirtualization= in - systemd.unit5 - for details. - - - - KernelCommandLine= - - Checks whether a specific kernel command - line option is set (or if prefixed with the - exclamation mark unset). See - ConditionKernelCommandLine= in - systemd.unit5 - for details. - - - - Architecture= - - Checks whether the system is running on a - specific architecture. See - ConditionArchitecture= in - systemd.unit5 - for details. - - - + + + MACAddress= + + The hardware address. + + + + OriginalName= + + A whitespace-separated list of shell-style globs matching + the device name, as exposed by the udev property + "INTERFACE". This can not be used to match on names that have + already been changed from userspace. Caution is advised when matching on + kernel-assigned names, as they are known to be unstable + between reboots. + + + + Path= + + A whitespace-separated list of shell-style globs matching + the persistent path, as exposed by the udev property + ID_PATH. + + + + Driver= + + A whitespace-separated list of shell-style globs matching + the driver currently bound to the device, + as exposed by the udev property DRIVER + of its parent device, or if that is not set, the + driver as exposed by ethtool -i + of the device itself. + + + + Type= + + A whitespace-separated list of shell-style globs matching + the device type, as exposed by the udev + property DEVTYPE. + + + + Host= + + Matches against the hostname or machine + ID of the host. See ConditionHost= in + systemd.unit5 + for details. + + + + Virtualization= + + Checks whether the system is executed in + a virtualized environment and optionally test + whether it is a specific implementation. See + ConditionVirtualization= in + systemd.unit5 + for details. + + + + KernelCommandLine= + + Checks whether a specific kernel command line option + is set (or if prefixed with the exclamation mark unset). See + ConditionKernelCommandLine= in + systemd.unit5 + for details. + + + + Architecture= + + Checks whether the system is running on a specific + architecture. See ConditionArchitecture= + in + systemd.unit5 + for details. + + + - + - - [Link] Section Options + + [Link] Section Options - The [Link] section accepts the following - keys: + The [Link] section accepts the following + keys: - - - Description= - - A description of the device. - - - - Alias= - - The ifalias is set to - this value. - - - - MACAddressPolicy= - - The policy by which the MAC address - should be set. The available policies are: - + + + Description= + + A description of the device. + + + + Alias= + + The ifalias is set to this + value. + + + + MACAddressPolicy= + + The policy by which the MAC address should be set. The + available policies are: + - - - persistent - - If the hardware has a persistent - MAC address, as most hardware should, - and if it is used by the kernel, nothing - is done. Otherwise, a new MAC address - is generated which is guaranteed to be - the same on every boot for the given - machine and the given device, but which - is otherwise random. - - - - random - - If the kernel is using a random MAC - address, nothing is done. Otherwise, a new - address is randomly generated each time the - device appears, typically at boot. - - - - - - - MACAddress= - - The MAC address to use, if no - MACAddressPolicy= - is specified. - - - - NamePolicy= - - An ordered, space-separated list of - policies by which the interface name should - be set. NamePolicy may be - disabled by specifying - net.ifnames=0 on the kernel - command line. Each of the policies may fail, and - the first successful one is used. The name is - not set directly, but is exported to udev as - the property ID_NET_NAME, - which is, by default, used by a udev rule to set - NAME. If the name has already - been set by userspace, no renaming is performed. - The available policies are: + + + persistent + + If the hardware has a persistent MAC address, as + most hardware should, and if it is used by the kernel, + nothing is done. Otherwise, a new MAC address is + generated which is guaranteed to be the same on every + boot for the given machine and the given device, but + which is otherwise random. This feature depends on ID_NET_NAME_* + properties existing for the link, on hardware where these + properties are not set the generation of a persistent MAC address + will fail. + + + + random + + If the kernel is using a random MAC address, + nothing is done. Otherwise, a new address is randomly + generated each time the device appears, typically at + boot. + + + + + + + MACAddress= + + The MAC address to use, if no + MACAddressPolicy= + is specified. + + + + NamePolicy= + + An ordered, space-separated list of policies by which + the interface name should be set. + NamePolicy may be disabled by specifying + net.ifnames=0 on the kernel command line. + Each of the policies may fail, and the first successful one + is used. The name is not set directly, but is exported to + udev as the property ID_NET_NAME, which + is, by default, used by a udev rule to set + NAME. If the name has already been set by + userspace, no renaming is performed. The available policies + are: - - - kernel - - If the kernel claims that the name it - has set for a device is predictable, then - no renaming is performed. - - - - - database - - The name is set based on entries in - the udev's Hardware Database with the key - ID_NET_NAME_FROM_DATABASE. - - - - - onboard - - The name is set based on information given by - the firmware for on-board devices, as exported by - the udev property ID_NET_NAME_ONBOARD. - - - - - slot - - The name is set based on information given by - the firmware for hot-plug devices, as exported by - the udev property ID_NET_NAME_SLOT. - - - - - path - - The name is set based on the device's physical - location, as exported by the udev property - ID_NET_NAME_PATH. - - - - mac - - The name is set based on the device's - persistent MAC address, as exported by the udev - property ID_NET_NAME_MAC. - - - - - - - Name= - - The interface name to use in case all the - policies specified in - NamePolicy= fail, or in case - NamePolicy= is missing or - disabled. - - - - MTUBytes= - - The maximum transmission unit in bytes to - set for the device. The usual suffixes K, M, G, - are supported and are understood to the base of - 1024. - - - - BitsPerSecond= - - The speed to set for the device, the - value is rounded down to the nearest Mbps. - The usual suffixes K, M, G, are supported and - are understood to the base of 1000. - - - - Duplex= - - The duplex mode to set for the device. - The accepted values are half - and full. - - - - WakeOnLan= - - The Wake-on-LAN policy to set for the - device. The supported values are: + + + kernel + + If the kernel claims that the name it has set + for a device is predictable, then no renaming is + performed. + + + + database + + The name is set based on entries in the udev's + Hardware Database with the key + ID_NET_NAME_FROM_DATABASE. + + + + + onboard + + The name is set based on information given by + the firmware for on-board devices, as exported by the + udev property ID_NET_NAME_ONBOARD. + + + + + slot + + The name is set based on information given by + the firmware for hot-plug devices, as exported by the + udev property ID_NET_NAME_SLOT. + + + + + path + + The name is set based on the device's physical + location, as exported by the udev property + ID_NET_NAME_PATH. + + + + mac + + The name is set based on the device's persistent + MAC address, as exported by the udev property + ID_NET_NAME_MAC. + + + + + + + Name= + + The interface name to use in case all the + policies specified in + NamePolicy= fail, or in case + NamePolicy= is missing or + disabled. + + + + MTUBytes= + + The maximum transmission unit in bytes to set for the + device. The usual suffixes K, M, G, are supported and are + understood to the base of 1024. + + + + BitsPerSecond= + + The speed to set for the device, the value is rounded + down to the nearest Mbps. The usual suffixes K, M, G, are + supported and are understood to the base of 1000. + + + + Duplex= + + The duplex mode to set for the device. The accepted + values are half and + full. + + + + WakeOnLan= + + The Wake-on-LAN policy to set for the device. The + supported values are: - - - phy - - Wake on PHY activity. - - - - magic - - Wake on receipt of a magic packet. - - - - - off - - Never wake. - - - - - - - + + + phy + + Wake on PHY activity. + + + + magic + + Wake on receipt of a magic packet. + + + + + off + + Never wake. + + + + + +
+ - - Example - - /etc/systemd/network/wireless.link + + Example + + /etc/systemd/network/wireless.link - [Match] + [Match] MACAddress=12:34:56:78:9a:bc Driver=brcmsmac Path=pci-0000:02:00.0-* @@ -396,19 +399,25 @@ MTUBytes=1450 BitsPerSecond=10M WakeOnLan=magic MACAddress=cb:a9:87:65:43:21 - - + + - - See Also - - - systemd-udevd.service8 - , - - udevadm8 - - - + + See Also + + + systemd-udevd.service8 + , + + udevadm8 + , + + systemd.netdev5 + , + + systemd.network5 + + + diff --git a/man/systemd.mount.5 b/man/systemd.mount.5 index a35f91e96..5b2a6fe79 100644 --- a/man/systemd.mount.5 +++ b/man/systemd.mount.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.MOUNT" "5" "" "systemd 218" "systemd.mount" +.TH "SYSTEMD\&.MOUNT" "5" "" "systemd 219" "systemd.mount" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.mount.html b/man/systemd.mount.html index bc788e72c..348755a15 100644 --- a/man/systemd.mount.html +++ b/man/systemd.mount.html @@ -19,194 +19,158 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.mount — Mount unit configuration

Synopsis

mount.mount

Description¶

A unit configuration file whose name ends in - ".mount" encodes information about - a file system mount point controlled and supervised by - systemd.

This man page lists the configuration options - specific to this unit type. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - mount specific configuration options are configured - in the [Mount] section.

Additional options are listed in - systemd.exec(5), - which define the execution environment the - mount(8) - binary is executed in, and in - systemd.kill(5), - which define the way the processes are terminated, and - in - systemd.resource-control(5), - which configure resource control settings for the - processes of the service. Note that the User= and - Group= options are not particularly useful for mount - units specifying a "Type=" option or - using configuration not specified in - /etc/fstab; - mount(8) - will refuse options that are not listed in - /etc/fstab if it is not run as - UID 0.

Mount units must be named after the mount point - directories they control. Example: the mount point - /home/lennart must be configured - in a unit file - home-lennart.mount. For details - about the escaping logic used to convert a file system - path to a unit name, see - systemd.unit(5).

Optionally, a mount unit may be accompanied by - an automount unit, to allow on-demand or parallelized - mounting. See - systemd.automount(5).

If a mount point is beneath another mount point - in the file system hierarchy, a dependency between both - units is created automatically.

Mount points created at runtime (independently of - unit files or /etc/fstab) will be - monitored by systemd and appear like any other mount - unit in systemd. - See /proc/self/mountinfo description - in proc(5). -

Some file systems have special semantics as API - file systems for kernel-to-userspace and - userspace-to-userpace interfaces. Some of them may not - be changed via mount units, and cannot be disabled. - For a longer discussion see API - File Systems.

fstab¶

Mount units may either be configured via unit - files, or via /etc/fstab (see - fstab(5) - for details). Mounts listed in - /etc/fstab will be converted into - native units dynamically at boot and when the - configuration of the system manager is reloaded. In - general, configuring mount points through - /etc/fstab is the preferred - approach. See - systemd-fstab-generator(8) - for details about the conversion.

When reading /etc/fstab a - few special mount options are understood by systemd - which influence how dependencies are created for mount - points. systemd will create a dependency of type - Wants or Requires - (see option nofail below), from - either local-fs.target or - remote-fs.target, depending - whether the file system is local or remote.

x-systemd.automount¶

An automount unit will be created - for the file system. See - systemd.automount(5) - for details.

x-systemd.device-timeout=¶

Configure how long systemd should - wait for a device to show up before giving up on - an entry from - /etc/fstab. Specify a time in - seconds or explicitly append a unit as - "s", "min", - "h", - "ms".

Note that this option can only be used in - /etc/fstab, and will be - ignored when part of Options= - setting in a unit file.

noauto, auto¶

With noauto, this - mount will not be added as a dependency for - local-fs.target or - remote-fs.target. This means - that it will not be mounted automatically during - boot, unless it is pulled in by some other - unit. Option auto has the - opposite meaning and is the default.

nofail¶

With nofail this - mount will be only wanted, not required, by - local-fs.target or - remote-fs.target. This means - that the boot will continue even if this mount - point is not mounted successfully.

x-initrd.mount¶

An additional filesystem to be - mounted in the initramfs. See - initrd-fs.target description - in - systemd.special(7). -

If a mount point is configured in both - /etc/fstab and a unit file that - is stored below /usr, the former - will take precedence. If the unit file is stored below - /etc, it will take - precedence. This means: native unit files take - precedence over traditional configuration files, but - this is superseded by the rule that configuration in - /etc will always take precedence - over configuration in - /usr.

Options¶

Mount files must include a [Mount] section, - which carries information about the file system mount points it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec(5) - and - systemd.kill(5). The - options specific to the [Mount] section of mount - units are the following:

What=¶

Takes an absolute path - of a device node, file or other - resource to mount. See - mount(8) - for details. If this refers to a - device node, a dependency on the - respective device unit is - automatically created. (See - systemd.device(5) for more information.) - This option is - mandatory.

Where=¶

Takes an absolute path - of a directory of the mount point. If - the mount point does not exist at the - time of mounting, it is created. This - string must be reflected in the unit - filename. (See above.) This option is - mandatory.

Type=¶

Takes a string for the - file system type. See - mount(8) - for details. This setting is - optional.

Options=¶

Mount options to use - when mounting. This takes a - comma-separated list of options. This - setting is optional.

SloppyOptions=¶

Takes a boolean - argument. If true, parsing of the - options specified in - Options= is - relaxed, and unknown mount options are - tolerated. This corresponds with - mount(8)'s - -s - switch. Defaults to - off.

DirectoryMode=¶

Directories of mount - points (and any parent directories) - are automatically created if - needed. This option specifies the file - system access mode used when creating - these directories. Takes an access - mode in octal notation. Defaults to - 0755.

TimeoutSec=¶

Configures the time to - wait for the mount command to - finish. If a command does not exit - within the configured time, the mount - will be considered failed and be shut - down again. All commands still running - will be terminated forcibly via - SIGTERM, and after another delay of - this time with SIGKILL. (See - KillMode= in - systemd.kill(5).) - Takes a unit-less value in seconds, or - a time span value such as "5min - 20s". Pass 0 to disable the timeout - logic. The default value is set from the manager configuration - file's DefaultTimeoutStart= variable.

Check - systemd.exec(5) - and - systemd.kill(5) - for more settings.

+ gudev systemd 219

Name

systemd.mount — Mount unit configuration

Synopsis

mount.mount

Description¶

A unit configuration file whose name ends in + ".mount" encodes information about a file system + mount point controlled and supervised by systemd.

This man page lists the configuration options specific to + this unit type. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The mount specific configuration options are + configured in the [Mount] section.

Additional options are listed in + systemd.exec(5), + which define the execution environment the + mount(8) + binary is executed in, and in + systemd.kill(5), + which define the way the processes are terminated, and in + systemd.resource-control(5), + which configure resource control settings for the processes of the + service. Note that the User= and Group= options are not + particularly useful for mount units specifying a + "Type=" option or using configuration not + specified in /etc/fstab; + mount(8) + will refuse options that are not listed in + /etc/fstab if it is not run as UID 0.

Mount units must be named after the mount point directories + they control. Example: the mount point + /home/lennart must be + configured in a unit file home-lennart.mount. + For details about the escaping logic used to convert a file system + path to a unit name, see + systemd.unit(5).

Optionally, a mount unit may be accompanied by an automount + unit, to allow on-demand or parallelized mounting. See + systemd.automount(5).

If a mount point is beneath another mount point in the file + system hierarchy, a dependency between both units is created + automatically.

Mount points created at runtime (independently of unit files + or /etc/fstab) will be monitored by systemd + and appear like any other mount unit in systemd. See + /proc/self/mountinfo description in + proc(5). +

Some file systems have special semantics as API file systems + for kernel-to-userspace and userspace-to-userpace interfaces. Some + of them may not be changed via mount units, and cannot be + disabled. For a longer discussion see API + File Systems.

fstab¶

Mount units may either be configured via unit files, or via + /etc/fstab (see + fstab(5) + for details). Mounts listed in /etc/fstab + will be converted into native units dynamically at boot and when + the configuration of the system manager is reloaded. In general, + configuring mount points through /etc/fstab + is the preferred approach. See + systemd-fstab-generator(8) + for details about the conversion.

When reading /etc/fstab a few special + mount options are understood by systemd which influence how + dependencies are created for mount points. systemd will create a + dependency of type Wants or + Requires (see option nofail + below), from either local-fs.target or + remote-fs.target, depending whether the file + system is local or remote.

x-systemd.automount¶

An automount unit will be created for the file + system. See + systemd.automount(5) + for details.

x-systemd.device-timeout=¶

Configure how long systemd should wait for a + device to show up before giving up on an entry from + /etc/fstab. Specify a time in seconds or + explicitly append a unit as "s", + "min", "h", + "ms".

Note that this option can only be used in + /etc/fstab, and will be + ignored when part of Options= + setting in a unit file.

noauto, auto¶

With noauto, this mount will + not be added as a dependency for + local-fs.target or + remote-fs.target. This means that it will + not be mounted automatically during boot, unless it is pulled + in by some other unit. Option auto has the + opposite meaning and is the default.

nofail¶

With nofail this mount will + be only wanted, not required, by + local-fs.target or + remote-fs.target. This means that the + boot will continue even if this mount point is not mounted + successfully.

x-initrd.mount¶

An additional filesystem to be mounted in the + initramfs. See initrd-fs.target + description in + systemd.special(7). +

If a mount point is configured in both + /etc/fstab and a unit file that is stored + below /usr, the former will take precedence. + If the unit file is stored below /etc, it + will take precedence. This means: native unit files take + precedence over traditional configuration files, but this is + superseded by the rule that configuration in + /etc will always take precedence over + configuration in /usr.

Options¶

Mount files must include a [Mount] section, which carries + information about the file system mount points it supervises. A + number of options that may be used in this section are shared with + other unit types. These options are documented in + systemd.exec(5) + and + systemd.kill(5). + The options specific to the [Mount] section of mount units are the + following:

What=¶

Takes an absolute path of a device node, file + or other resource to mount. See + mount(8) + for details. If this refers to a device node, a dependency on + the respective device unit is automatically created. (See + systemd.device(5) + for more information.) This option is + mandatory.

Where=¶

Takes an absolute path of a directory of the + mount point. If the mount point does not exist at the time of + mounting, it is created. This string must be reflected in the + unit filename. (See above.) This option is + mandatory.

Type=¶

Takes a string for the file system type. See + mount(8) + for details. This setting is optional.

Options=¶

Mount options to use when mounting. This takes + a comma-separated list of options. This setting is + optional.

SloppyOptions=¶

Takes a boolean argument. If true, parsing of + the options specified in Options= is + relaxed, and unknown mount options are tolerated. This + corresponds with + mount(8)'s + -s switch. Defaults to + off.

DirectoryMode=¶

Directories of mount points (and any parent + directories) are automatically created if needed. This option + specifies the file system access mode used when creating these + directories. Takes an access mode in octal notation. Defaults + to 0755.

TimeoutSec=¶

Configures the time to wait for the mount + command to finish. If a command does not exit within the + configured time, the mount will be considered failed and be + shut down again. All commands still running will be terminated + forcibly via SIGTERM, and after another + delay of this time with SIGKILL. (See + KillMode= in + systemd.kill(5).) + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass 0 to disable the timeout logic. The + default value is set from the manager configuration file's + DefaultTimeoutStart= + variable.

Check + systemd.exec(5) + and + systemd.kill(5) + for more settings.

diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml index 852738659..5cbde8b84 100644 --- a/man/systemd.mount.xml +++ b/man/systemd.mount.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.mount - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.mount - 5 - - - - systemd.mount - Mount unit configuration - - - - mount.mount - - - - Description - - A unit configuration file whose name ends in - .mount encodes information about - a file system mount point controlled and supervised by - systemd. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - mount specific configuration options are configured - in the [Mount] section. - - Additional options are listed in - systemd.exec5, - which define the execution environment the - mount8 - binary is executed in, and in - systemd.kill5, - which define the way the processes are terminated, and - in - systemd.resource-control5, - which configure resource control settings for the - processes of the service. Note that the User= and - Group= options are not particularly useful for mount - units specifying a Type= option or - using configuration not specified in - /etc/fstab; - mount8 - will refuse options that are not listed in - /etc/fstab if it is not run as - UID 0. - - Mount units must be named after the mount point - directories they control. Example: the mount point - /home/lennart must be configured - in a unit file - home-lennart.mount. For details - about the escaping logic used to convert a file system - path to a unit name, see - systemd.unit5. - - Optionally, a mount unit may be accompanied by - an automount unit, to allow on-demand or parallelized - mounting. See - systemd.automount5. - - If a mount point is beneath another mount point - in the file system hierarchy, a dependency between both - units is created automatically. - - Mount points created at runtime (independently of - unit files or /etc/fstab) will be - monitored by systemd and appear like any other mount - unit in systemd. - See /proc/self/mountinfo description - in proc5. - - - Some file systems have special semantics as API - file systems for kernel-to-userspace and - userspace-to-userpace interfaces. Some of them may not - be changed via mount units, and cannot be disabled. - For a longer discussion see API - File Systems. - - - - <filename>fstab</filename> - - Mount units may either be configured via unit - files, or via /etc/fstab (see - fstab5 - for details). Mounts listed in - /etc/fstab will be converted into - native units dynamically at boot and when the - configuration of the system manager is reloaded. In - general, configuring mount points through - /etc/fstab is the preferred - approach. See - systemd-fstab-generator8 - for details about the conversion. - - When reading /etc/fstab a - few special mount options are understood by systemd - which influence how dependencies are created for mount - points. systemd will create a dependency of type - or - (see option below), from - either local-fs.target or - remote-fs.target, depending - whether the file system is local or remote. - - - - - - - An automount unit will be created - for the file system. See - systemd.automount5 - for details. - - - - - - Configure how long systemd should - wait for a device to show up before giving up on - an entry from - /etc/fstab. Specify a time in - seconds or explicitly append a unit as - s, min, - h, - ms. - - Note that this option can only be used in - /etc/fstab, and will be - ignored when part of Options= - setting in a unit file. - - - - - - - - With , this - mount will not be added as a dependency for - local-fs.target or - remote-fs.target. This means - that it will not be mounted automatically during - boot, unless it is pulled in by some other - unit. Option has the - opposite meaning and is the default. - - - - - - - With this - mount will be only wanted, not required, by - local-fs.target or - remote-fs.target. This means - that the boot will continue even if this mount - point is not mounted successfully. - - - - - - - An additional filesystem to be - mounted in the initramfs. See - initrd-fs.target description - in - systemd.special7. - - - - - If a mount point is configured in both - /etc/fstab and a unit file that - is stored below /usr, the former - will take precedence. If the unit file is stored below - /etc, it will take - precedence. This means: native unit files take - precedence over traditional configuration files, but - this is superseded by the rule that configuration in - /etc will always take precedence - over configuration in - /usr. - - - - Options - - Mount files must include a [Mount] section, - which carries information about the file system mount points it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec5 - and - systemd.kill5. The - options specific to the [Mount] section of mount - units are the following: - - - - - What= - Takes an absolute path - of a device node, file or other - resource to mount. See - mount8 - for details. If this refers to a - device node, a dependency on the - respective device unit is - automatically created. (See - systemd.device5 for more information.) - This option is - mandatory. - - - - Where= - Takes an absolute path - of a directory of the mount point. If - the mount point does not exist at the - time of mounting, it is created. This - string must be reflected in the unit - filename. (See above.) This option is - mandatory. - - - - Type= - Takes a string for the - file system type. See - mount8 - for details. This setting is - optional. - - - - Options= - - Mount options to use - when mounting. This takes a - comma-separated list of options. This - setting is optional. - - - - SloppyOptions= - - Takes a boolean - argument. If true, parsing of the - options specified in - Options= is - relaxed, and unknown mount options are - tolerated. This corresponds with - mount8's - -s - switch. Defaults to - off. - - - - DirectoryMode= - Directories of mount - points (and any parent directories) - are automatically created if - needed. This option specifies the file - system access mode used when creating - these directories. Takes an access - mode in octal notation. Defaults to - 0755. - - - - TimeoutSec= - Configures the time to - wait for the mount command to - finish. If a command does not exit - within the configured time, the mount - will be considered failed and be shut - down again. All commands still running - will be terminated forcibly via - SIGTERM, and after another delay of - this time with SIGKILL. (See - in - systemd.kill5.) - Takes a unit-less value in seconds, or - a time span value such as "5min - 20s". Pass 0 to disable the timeout - logic. The default value is set from the manager configuration - file's DefaultTimeoutStart= variable. - - - - Check - systemd.exec5 - and - systemd.kill5 - for more settings. - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.exec5, - systemd.kill5, - systemd.resource-control5, - systemd.service5, - systemd.device5, - proc5, - mount8, - systemd-fstab-generator8, - systemd.directives7 - - + + systemd.mount + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.mount + 5 + + + + systemd.mount + Mount unit configuration + + + + mount.mount + + + + Description + + A unit configuration file whose name ends in + .mount encodes information about a file system + mount point controlled and supervised by systemd. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The mount specific configuration options are + configured in the [Mount] section. + + Additional options are listed in + systemd.exec5, + which define the execution environment the + mount8 + binary is executed in, and in + systemd.kill5, + which define the way the processes are terminated, and in + systemd.resource-control5, + which configure resource control settings for the processes of the + service. Note that the User= and Group= options are not + particularly useful for mount units specifying a + Type= option or using configuration not + specified in /etc/fstab; + mount8 + will refuse options that are not listed in + /etc/fstab if it is not run as UID 0. + + Mount units must be named after the mount point directories + they control. Example: the mount point + /home/lennart must be + configured in a unit file home-lennart.mount. + For details about the escaping logic used to convert a file system + path to a unit name, see + systemd.unit5. + + Optionally, a mount unit may be accompanied by an automount + unit, to allow on-demand or parallelized mounting. See + systemd.automount5. + + If a mount point is beneath another mount point in the file + system hierarchy, a dependency between both units is created + automatically. + + Mount points created at runtime (independently of unit files + or /etc/fstab) will be monitored by systemd + and appear like any other mount unit in systemd. See + /proc/self/mountinfo description in + proc5. + + + Some file systems have special semantics as API file systems + for kernel-to-userspace and userspace-to-userpace interfaces. Some + of them may not be changed via mount units, and cannot be + disabled. For a longer discussion see API + File Systems. + + + + <filename>fstab</filename> + + Mount units may either be configured via unit files, or via + /etc/fstab (see + fstab5 + for details). Mounts listed in /etc/fstab + will be converted into native units dynamically at boot and when + the configuration of the system manager is reloaded. In general, + configuring mount points through /etc/fstab + is the preferred approach. See + systemd-fstab-generator8 + for details about the conversion. + + When reading /etc/fstab a few special + mount options are understood by systemd which influence how + dependencies are created for mount points. systemd will create a + dependency of type or + (see option + below), from either local-fs.target or + remote-fs.target, depending whether the file + system is local or remote. + + + + + + + An automount unit will be created for the file + system. See + systemd.automount5 + for details. + + + + + + Configure how long systemd should wait for a + device to show up before giving up on an entry from + /etc/fstab. Specify a time in seconds or + explicitly append a unit as s, + min, h, + ms. + + Note that this option can only be used in + /etc/fstab, and will be + ignored when part of Options= + setting in a unit file. + + + + + + + + With , this mount will + not be added as a dependency for + local-fs.target or + remote-fs.target. This means that it will + not be mounted automatically during boot, unless it is pulled + in by some other unit. Option has the + opposite meaning and is the default. + + + + + + + With this mount will + be only wanted, not required, by + local-fs.target or + remote-fs.target. This means that the + boot will continue even if this mount point is not mounted + successfully. + + + + + + + An additional filesystem to be mounted in the + initramfs. See initrd-fs.target + description in + systemd.special7. + + + + + If a mount point is configured in both + /etc/fstab and a unit file that is stored + below /usr, the former will take precedence. + If the unit file is stored below /etc, it + will take precedence. This means: native unit files take + precedence over traditional configuration files, but this is + superseded by the rule that configuration in + /etc will always take precedence over + configuration in /usr. + + + + Options + + Mount files must include a [Mount] section, which carries + information about the file system mount points it supervises. A + number of options that may be used in this section are shared with + other unit types. These options are documented in + systemd.exec5 + and + systemd.kill5. + The options specific to the [Mount] section of mount units are the + following: + + + + + What= + Takes an absolute path of a device node, file + or other resource to mount. See + mount8 + for details. If this refers to a device node, a dependency on + the respective device unit is automatically created. (See + systemd.device5 + for more information.) This option is + mandatory. + + + + Where= + Takes an absolute path of a directory of the + mount point. If the mount point does not exist at the time of + mounting, it is created. This string must be reflected in the + unit filename. (See above.) This option is + mandatory. + + + + Type= + Takes a string for the file system type. See + mount8 + for details. This setting is optional. + + + + Options= + + Mount options to use when mounting. This takes + a comma-separated list of options. This setting is + optional. + + + + SloppyOptions= + + Takes a boolean argument. If true, parsing of + the options specified in Options= is + relaxed, and unknown mount options are tolerated. This + corresponds with + mount8's + -s switch. Defaults to + off. + + + + DirectoryMode= + Directories of mount points (and any parent + directories) are automatically created if needed. This option + specifies the file system access mode used when creating these + directories. Takes an access mode in octal notation. Defaults + to 0755. + + + + TimeoutSec= + Configures the time to wait for the mount + command to finish. If a command does not exit within the + configured time, the mount will be considered failed and be + shut down again. All commands still running will be terminated + forcibly via SIGTERM, and after another + delay of this time with SIGKILL. (See + in + systemd.kill5.) + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass 0 to disable the timeout logic. The + default value is set from the manager configuration file's + DefaultTimeoutStart= + variable. + + + + Check + systemd.exec5 + and + systemd.kill5 + for more settings. + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.exec5, + systemd.kill5, + systemd.resource-control5, + systemd.service5, + systemd.device5, + proc5, + mount8, + systemd-fstab-generator8, + systemd.directives7 + + diff --git a/man/systemd.netdev.5 b/man/systemd.netdev.5 index 492c3a39a..97e848af7 100644 --- a/man/systemd.netdev.5 +++ b/man/systemd.netdev.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.NETDEV" "5" "" "systemd 218" "systemd.network" +.TH "SYSTEMD\&.NETDEV" "5" "" "systemd 219" "systemd.network" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -48,6 +48,136 @@ take precedence over files with the same name in with the same name as a configuration file in /usr/lib, pointing to /dev/null, disables the configuration file entirely\&. +.SH "SUPPORTED NETDEV KINDS" +.PP +The following kinds of virtual network devices may be configured in +\&.netdev +files: +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&1.\ \&Supported kinds of virtual network devices +.TS +allbox tab(:); +lB lB. +T{ +Kind +T}:T{ +Description +T} +.T& +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l. +T{ +\fIbond\fR +T}:T{ +A bond device is an aggregation of all its slave devices\&. See \m[blue]\fBLinux Ethernet Bonding Driver HOWTO\fR\m[]\&\s-2\u[1]\d\s+2 for details\&.Local configuration +T} +T{ +\fIbridge\fR +T}:T{ +A bridge devcie is a software switch, each of its slave devices and the bridge itself are ports of the switch\&. +T} +T{ +\fIdummy\fR +T}:T{ +A dummy device drops all packets sent to it\&. +T} +T{ +\fIgre\fR +T}:T{ +A Level 3 GRE tunnel over IPv4\&. See \m[blue]\fBRFC 2784\fR\m[]\&\s-2\u[2]\d\s+2 for details\&. +T} +T{ +\fIgretap\fR +T}:T{ +A Level 2 GRE tunnel over IPv4\&. +T} +T{ +\fIip6gre\fR +T}:T{ +A Level 3 GRE tunnel over IPv6\&. +T} +T{ +\fIip6tnl\fR +T}:T{ +An IPv4 or IPv6 tunnel over IPv6 +T} +T{ +\fIip6gretap\fR +T}:T{ +An Level 2 GRE tunnel over IPv6\&. +T} +T{ +\fIipip\fR +T}:T{ +An IPv4 over IPv4 tunnel\&. +T} +T{ +\fIipvlan\fR +T}:T{ +An ipvlan device is a stacked device which receives packets from its underlying device based on IP address filtering\&. +T} +T{ +\fImacvlan\fR +T}:T{ +A macvlan device is a stacked device which receives packets from its underlying device based on MAC address filtering\&. +T} +T{ +\fIsit\fR +T}:T{ +An IPv6 over IPv4 tunnel\&. +T} +T{ +\fItap\fR +T}:T{ +A persistent Level 2 tunnel between a network device and a device node\&. +T} +T{ +\fItun\fR +T}:T{ +A persistent Level 3 tunnel between a network device and a device node\&. +T} +T{ +\fIveth\fR +T}:T{ +An ethernet tunnel between a pair of network devices\&. +T} +T{ +\fIvlan\fR +T}:T{ +A VLAN is a stacked device which receives packets from its underlying device based on VLAN tagging\&. See \m[blue]\fBIEEE 802\&.1Q\fR\m[]\&\s-2\u[3]\d\s+2 for details\&. +T} +T{ +\fIvti\fR +T}:T{ +An IPv4 over IPSec tunnel\&. +T} +T{ +\fIvxlan\fR +T}:T{ +A virtual extensible LAN (vxlan), for connecting Cloud computing deployments\&. +T} +.TE +.sp 1 .SH "[MATCH] SECTION OPTIONS" .PP A virtual network device is only created if the @@ -107,22 +237,9 @@ The interface name used when creating the netdev\&. This option is compulsory\&. .PP \fIKind=\fR .RS 4 -The netdev kind\&. Currently, -"bridge", -"bond", -"vlan", -"macvlan", -"vxlan", -"ipip", -"gre", -"sit", -"vti", -"veth", -"tun", -"tap" -and -"dummy" -are supported\&. This option is compulsory\&. +The netdev kind\&. This option is compulsory\&. See the +"Supported netdev kinds" +section for the valid keys\&. .RE .PP \fIMTUBytes=\fR @@ -166,16 +283,29 @@ section only applies for netdevs of kind The MACVLAN mode to use\&. The supported options are "private", "vepa", -"bridge" -and +"bridge", and "passthru"\&. .RE +.SH "[IPVLAN] SECTION OPTIONS" +.PP +The +"[IPVLAN]" +section only applies for netdevs of kind +"ipvlan", and accepts the following key: +.PP +\fIMode=\fR +.RS 4 +The IPVLAN mode to use\&. The supported options are +"L2" +and +"L3"\&. +.RE .SH "[VXLAN] SECTION OPTIONS" .PP The "[VXLAN]" section only applies for netdevs of kind -"vxlan", and accepts the following key: +"vxlan", and accepts the following keys: .PP \fIId=\fR .RS 4 @@ -233,9 +363,12 @@ The section only applies for netdevs of kind "ipip", "sit", -"gre" -and -"vti" +"gre", +"gretap", +"ip6gre", +"ip6gretap", +"vti", and +"ip6tnl" and accepts the following keys: .PP \fILocal=\fR @@ -251,7 +384,7 @@ The remote endpoint of the tunnel\&. \fITOS=\fR .RS 4 The Type Of Service byte value for a tunnel interface\&. For details about the TOS see the -\m[blue]\fBType of Service in the Internet Protocol Suite\fR\m[]\&\s-2\u[1]\d\s+2 +\m[blue]\fBType of Service in the Internet Protocol Suite\fR\m[]\&\s-2\u[4]\d\s+2 document\&. .RE .PP @@ -264,6 +397,19 @@ A fixed Time To Live N on tunneled packets\&. N is a number in the range 1\-255\ .RS 4 A boolean\&. When true, enables Path MTU Discovery on the tunnel\&. .RE +.PP +\fIMode=\fR +.RS 4 +An +"ip6tnl" +tunnels can have three modes +"ip6ip6" +for IPv6 over IPv6, +"ipip6" +for IPv4 over IPv6 or +"any" +for either\&. +.RE .SH "[PEER] SECTION OPTIONS" .PP The @@ -547,9 +693,25 @@ MACAddress=12:34:56:78:9a:bc .PP \fBsystemd\fR(1), \fBsystemd-networkd\fR(8), +\fBsystemd.link\fR(5), \fBsystemd.network\fR(5) .SH "NOTES" .IP " 1." 4 +Linux Ethernet Bonding Driver HOWTO +.RS 4 +\%https://www.kernel.org/doc/Documentation/networking/bonding.txt +.RE +.IP " 2." 4 +RFC 2784 +.RS 4 +\%https://tools.ietf.org/html/rfc2784 +.RE +.IP " 3." 4 +IEEE 802.1Q +.RS 4 +\%http://www.ieee802.org/1/pages/802.1Q.html +.RE +.IP " 4." 4 Type of Service in the Internet Protocol Suite .RS 4 \%http://tools.ietf.org/html/rfc1349 diff --git a/man/systemd.netdev.html b/man/systemd.netdev.html index 746def2c4..3eb96194b 100644 --- a/man/systemd.netdev.html +++ b/man/systemd.netdev.html @@ -19,137 +19,177 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.netdev — Virtual Network Device configuration

Synopsis

netdev.netdev

Description¶

Network setup is performed by - systemd-networkd(8). -

Virtual Network Device files must have the extension - .netdev; other extensions are ignored. Virtual - network devices are created as soon as networkd is started. If a netdev - with the specified name already exists, networkd will use that as-is - rather than create its own. Note that the settings of the pre-existing - netdev will not be changed by networkd.

The .netdev files are read from the files located in the - system network directory /usr/lib/systemd/network, - the volatile runtime network directory - /run/systemd/network and the local administration - network directory /etc/systemd/network. - All configuration files are collectively sorted and processed in lexical order, - regardless of the directories in which they live. However, files with - identical filenames replace each other. Files in - /etc have the highest priority, files in - /run take precedence over files with the same - name in /usr/lib. This can be used to override a - system-supplied configuration file with a local file if needed; a symlink in - /etc with the same name as a configuration file in - /usr/lib, pointing to /dev/null, - disables the configuration file entirely.

[Match] Section Options¶

A virtual network device is only created if the - "[Match]" section matches the current - environment, or if the section is empty. The following keys are accepted:

Host=¶

Matches against the hostname or machine ID of the - host. See "ConditionHost=" in - systemd.unit(5) - for details. -

Virtualization=¶

Checks whether the system is executed in a virtualized - environment and optionally test whether it is a specific - implementation. See "ConditionVirtualization=" in - systemd.unit(5) - for details. -

KernelCommandLine=¶

Checks whether a specific kernel command line option is - set (or if prefixed with the exclamation mark unset). See - "ConditionKernelCommandLine=" in - systemd.unit(5) - for details. -

Architecture=¶

Checks whether the system is running on a specific - architecture. See "ConditionArchitecture=" in - systemd.unit(5) - for details. -

[NetDev] Section Options¶

The "[NetDev]" section accepts the following - keys:

Description=¶

A free-form description of the netdev. -

Name=¶

The interface name used when creating the - netdev. This option is compulsory.

Kind=¶

The netdev kind. Currently, "bridge", - "bond", "vlan", - "macvlan", "vxlan", - "ipip", "gre", - "sit", "vti", - "veth", "tun", - "tap" and "dummy" - are supported. This option is compulsory.

MTUBytes=¶

The maximum transmission unit in bytes to - set for the device. The usual suffixes K, M, G, - are supported and are understood to the base of - 1024. This key is not currently suported for - "tun" or "tap" devices. -

MACAddress=¶

The MAC address to use for the device. - If none is given, one is generated based on - the interface name and the - machine-id(5). - This key is not currently suported for "tun" or "tap" devices. -

[VLAN] Section Options¶

The "[VLAN]" section only applies for netdevs of kind "vlan", - and accepts the following key:

Id=¶

The VLAN ID to use. An integer in the range 0–4094. - This option is compulsory.

[MACVLAN] Section Options¶

The "[MACVLAN]" section only applies for netdevs of kind - "macvlan", and accepts the following key:

Mode=¶

The MACVLAN mode to use. The supported options are - "private", "vepa", - "bridge" and "passthru". -

[VXLAN] Section Options¶

The "[VXLAN]" section only applies for netdevs of kind - "vxlan", and accepts the following key:

Id=¶

The VXLAN ID to use.

Group=¶

An assigned multicast group IP address.

TOS=¶

The Type Of Service byte value for a vxlan interface.

TTL=¶

A fixed Time To Live N on Virtual eXtensible Local Area Network packets. - N is a number in the range 1-255. 0 is a special value meaning that packets - inherit the TTL value.

MacLearning=¶

A boolean. When true, enables dynamic MAC learning - to discover remote MAC addresses.

FDBAgeingSec=¶

The lifetime of Forwarding Database entry learnt by the kernel in seconds.

ARPProxy=¶

A boolean. When true, enables ARP proxy.

L2MissNotification=¶

A boolean. When true, enables netlink LLADDR miss notifications.

L3MissNotification=¶

A boolean. When true, enables netlink IP ADDR miss notifications.

RouteShortCircuit=¶

A boolean. When true route short circuit is turned on.

[Tunnel] Section Options¶

The "[Tunnel]" section only applies for netdevs of kind - "ipip", "sit", "gre" and - "vti" and accepts the following keys:

Local=¶

A static local address for tunneled packets. - It must be an address on another interface of this host.

Remote=¶

The remote endpoint of the tunnel.

TOS=¶

The Type Of Service byte value for a tunnel interface. - For details about the TOS see the - - Type of Service in the Internet Protocol Suite - document. -

TTL=¶

A fixed Time To Live N on tunneled packets. - N is a number in the range 1-255. 0 is a special value meaning that packets - inherit the TTL value. The default value for IPv4 tunnels is: inherit. - The default value for IPv6 tunnels is: 64.

DiscoverPathMTU=¶

A boolean. When true, enables Path MTU Discovery on the tunnel.

[Peer] Section Options¶

The "[Peer]" section only applies for netdevs of kind "veth" - and accepts the following key:

Name=¶

The interface name used when creating the netdev. - This option is compulsory.

MACAddress=¶

The peer MACAddress, if not set it is generated in the same - way as the MAC address of the main interface.

[Tun] Section Options¶

The "[Tun]" section only applies for netdevs of kind - "tun", and accepts the following keys:

OneQueue=¶

Takes a boolean argument. Configures whether - all packets are queued at the device (enabled), or a fixed number - of packets are queued at the device and the rest at the - "qdisc". Defaults to "no".

MultiQueue=¶

Takes a boolean argument. Configures whether to - use multiple file descriptors (queues) to parallelize packets - sending and receiving. Defaults to "no".

PacketInfo=¶

Takes a boolean argument. Configures whether packets - should be prepened with four extra bytes (two flag bytes and two - protocol bytes). If disabled it indicates that the packets will be - pure IP packets. Defaults to "no".

User=¶

User to grant access to the /dev/net/tun - device.

Group=¶

Group to grant access to the /dev/net/tun - device.

[Tap] Section Options¶

The "[Tap]" section only applies for netdevs of kind - "tap", and accepts the same keys as the - "[Tun]" section.

[Bond] Section Options¶

The "[Bond]" section accepts the following - key:

Mode=¶

Specifies one of the bonding policies. The default is - "balance-rr" (round robin). Possible values are - "balance-rr", - "active-backup", - "balance-xor", - "broadcast", - "802.3ad", - "balance-tlb", and - "balance-alb". -

TransmitHashPolicy=¶

Selects the transmit hash policy to use for slave selection in - balance-xor, 802.3ad, and tlb modes. Possible values are - "layer2", - "layer3+4", - "layer2+3", - "encap2+3", - "802.3ad", and - "encap3+4". -

LACPTransmitRate=¶

Specifies the rate with which link partner - transmits Link Aggregation Control Protocol Data Unit packets - in 802.3ad mode. Possible values are - "slow", which requests partner to transmit LACPDUs every 30 seconds, and - "fast", which requests partner to transmit LACPDUs every second. - The default value is "slow".

MIIMonitorSec=¶

Specifies the frequency that Media Independent Interface link - monitoring will occur. A value of zero disables MII link monitoring. - This values is rounded down to the nearest millisecond. The default - value is 0.

UpDelaySec=¶

Specifies the delay before a link is enabled after a link up - status has been detected. This value is rounded down to a multiple of - MIIMonitorSec. The default value is 0.

DownDelaySec=¶

Specifies the delay before a link is disabled after a link down - status has been detected. This value is rounded down to a multiple of - MIIMonitorSec. The default value is 0.

Example¶

Example 1. /etc/systemd/network/bridge.netdev

[NetDev]
+  gudev systemd 219

Name

systemd.netdev — Virtual Network Device configuration

Synopsis

netdev.netdev

Description¶

Network setup is performed by + systemd-networkd(8). +

Virtual Network Device files must have the extension + .netdev; other extensions are ignored. + Virtual network devices are created as soon as networkd is + started. If a netdev with the specified name already exists, + networkd will use that as-is rather than create its own. Note that + the settings of the pre-existing netdev will not be changed by + networkd.

The .netdev files are read from the + files located in the system network directory + /usr/lib/systemd/network, the volatile + runtime network directory + /run/systemd/network and the local + administration network directory + /etc/systemd/network. All configuration files + are collectively sorted and processed in lexical order, regardless + of the directories in which they live. However, files with + identical filenames replace each other. Files in + /etc have the highest priority, files in + /run take precedence over files with the same + name in /usr/lib. This can be used to + override a system-supplied configuration file with a local file if + needed; a symlink in /etc with the same name + as a configuration file in /usr/lib, pointing + to /dev/null, disables the configuration file + entirely.

Supported netdev kinds¶

The following kinds of virtual network devices may be + configured in .netdev files:

Table 1. Supported kinds of virtual network devices

KindDescription
bondA bond device is an aggregation of all its slave devices. See Linux Ethernet Bonding Driver HOWTO for details.Local configuration
bridgeA bridge devcie is a software switch, each of its slave devices and the bridge itself are ports of the switch.
dummyA dummy device drops all packets sent to it.
greA Level 3 GRE tunnel over IPv4. See RFC 2784 for details.
gretapA Level 2 GRE tunnel over IPv4.
ip6greA Level 3 GRE tunnel over IPv6.
ip6tnlAn IPv4 or IPv6 tunnel over IPv6
ip6gretapAn Level 2 GRE tunnel over IPv6.
ipipAn IPv4 over IPv4 tunnel.
ipvlanAn ipvlan device is a stacked device which receives packets from its underlying device based on IP address filtering.
macvlanA macvlan device is a stacked device which receives packets from its underlying device based on MAC address filtering.
sitAn IPv6 over IPv4 tunnel.
tapA persistent Level 2 tunnel between a network device and a device node.
tunA persistent Level 3 tunnel between a network device and a device node.
vethAn ethernet tunnel between a pair of network devices.
vlanA VLAN is a stacked device which receives packets from its underlying device based on VLAN tagging. See IEEE 802.1Q for details.
vtiAn IPv4 over IPSec tunnel.
vxlanA virtual extensible LAN (vxlan), for connecting Cloud computing deployments.

[Match] Section Options¶

A virtual network device is only created if the + "[Match]" section matches the current + environment, or if the section is empty. The following keys are + accepted:

Host=¶

Matches against the hostname or machine ID of the + host. See "ConditionHost=" in + systemd.unit(5) + for details. +

Virtualization=¶

Checks whether the system is executed in a virtualized + environment and optionally test whether it is a specific + implementation. See + "ConditionVirtualization=" in + systemd.unit(5) + for details. +

KernelCommandLine=¶

Checks whether a specific kernel command line option + is set (or if prefixed with the exclamation mark unset). See + "ConditionKernelCommandLine=" in + systemd.unit(5) + for details. +

Architecture=¶

Checks whether the system is running on a specific + architecture. See "ConditionArchitecture=" in + systemd.unit(5) + for details. +

[NetDev] Section Options¶

The "[NetDev]" section accepts the + following keys:

Description=¶

A free-form description of the netdev.

Name=¶

The interface name used when creating the netdev. + This option is compulsory.

Kind=¶

The netdev kind. This option is compulsory. See the + "Supported netdev kinds" section for the + valid keys.

MTUBytes=¶

The maximum transmission unit in bytes to set for + the device. The usual suffixes K, M, G, are supported and + are understood to the base of 1024. This key is not + currently suported for "tun" or + "tap" devices. +

MACAddress=¶

The MAC address to use for the device. If none is + given, one is generated based on the interface name and + the + machine-id(5). + This key is not currently suported for + "tun" or "tap" devices. +

[VLAN] Section Options¶

The "[VLAN]" section only applies for + netdevs of kind "vlan", and accepts the + following key:

Id=¶

The VLAN ID to use. An integer in the range 0–4094. + This option is compulsory.

[MACVLAN] Section Options¶

The "[MACVLAN]" section only applies for + netdevs of kind "macvlan", and accepts the + following key:

Mode=¶

The MACVLAN mode to use. The supported options are + "private", + "vepa", + "bridge", and + "passthru". +

[IPVLAN] Section Options¶

The "[IPVLAN]" section only applies for + netdevs of kind "ipvlan", and accepts the + following key:

Mode=¶

The IPVLAN mode to use. The supported options are + "L2" and "L3". +

[VXLAN] Section Options¶

The "[VXLAN]" section only applies for + netdevs of kind "vxlan", and accepts the + following keys:

Id=¶

The VXLAN ID to use.

Group=¶

An assigned multicast group IP address.

TOS=¶

The Type Of Service byte value for a vxlan interface.

TTL=¶

A fixed Time To Live N on Virtual eXtensible Local + Area Network packets. N is a number in the range 1-255. 0 + is a special value meaning that packets inherit the TTL + value.

MacLearning=¶

A boolean. When true, enables dynamic MAC learning + to discover remote MAC addresses.

FDBAgeingSec=¶

The lifetime of Forwarding Database entry learnt by + the kernel in seconds.

ARPProxy=¶

A boolean. When true, enables ARP proxy.

L2MissNotification=¶

A boolean. When true, enables netlink LLADDR miss + notifications.

L3MissNotification=¶

A boolean. When true, enables netlink IP ADDR miss + notifications.

RouteShortCircuit=¶

A boolean. When true route short circuit is turned + on.

[Tunnel] Section Options¶

The "[Tunnel]" section only applies for + netdevs of kind + "ipip", + "sit", + "gre", + "gretap", + "ip6gre", + "ip6gretap", + "vti", and + "ip6tnl" and accepts + the following keys:

Local=¶

A static local address for tunneled packets. It must + be an address on another interface of this host.

Remote=¶

The remote endpoint of the tunnel.

TOS=¶

The Type Of Service byte value for a tunnel interface. + For details about the TOS see the + Type of + Service in the Internet Protocol Suite document. +

TTL=¶

A fixed Time To Live N on tunneled packets. N is a + number in the range 1-255. 0 is a special value meaning that + packets inherit the TTL value. The default value for IPv4 + tunnels is: inherit. The default value for IPv6 tunnels is: + 64.

DiscoverPathMTU=¶

A boolean. When true, enables Path MTU Discovery on + the tunnel.

Mode=¶

An "ip6tnl" tunnels can have three + modes + "ip6ip6" for IPv6 over IPv6, + "ipip6" for IPv4 over IPv6 or + "any" for either. +

[Peer] Section Options¶

The "[Peer]" section only applies for + netdevs of kind "veth" and accepts the + following key:

Name=¶

The interface name used when creating the netdev. + This option is compulsory.

MACAddress=¶

The peer MACAddress, if not set it is generated in + the same way as the MAC address of the main + interface.

[Tun] Section Options¶

The "[Tun]" section only applies for + netdevs of kind "tun", and accepts the following + keys:

OneQueue=¶

Takes a boolean argument. Configures whether + all packets are queued at the device (enabled), or a fixed + number of packets are queued at the device and the rest at the + "qdisc". Defaults to + "no".

MultiQueue=¶

Takes a boolean argument. Configures whether + to use multiple file descriptors (queues) to parallelize + packets sending and receiving. Defaults to + "no".

PacketInfo=¶

Takes a boolean argument. Configures whether + packets should be prepened with four extra bytes (two flag + bytes and two protocol bytes). If disabled it indicates that + the packets will be pure IP packets. Defaults to + "no".

User=¶

User to grant access to the + /dev/net/tun device.

Group=¶

Group to grant access to the + /dev/net/tun device.

[Tap] Section Options¶

The "[Tap]" section only applies for + netdevs of kind "tap", and accepts the same keys + as the "[Tun]" section.

[Bond] Section Options¶

The "[Bond]" section accepts the following + key:

Mode=¶

Specifies one of the bonding policies. The default is + "balance-rr" (round robin). Possible values are + "balance-rr", + "active-backup", + "balance-xor", + "broadcast", + "802.3ad", + "balance-tlb", and + "balance-alb". +

TransmitHashPolicy=¶

Selects the transmit hash policy to use for slave + selection in balance-xor, 802.3ad, and tlb modes. Possible + values are + "layer2", + "layer3+4", + "layer2+3", + "encap2+3", + "802.3ad", and + "encap3+4". +

LACPTransmitRate=¶

Specifies the rate with which link partner transmits + Link Aggregation Control Protocol Data Unit packets in + 802.3ad mode. Possible values are "slow", + which requests partner to transmit LACPDUs every 30 seconds, + and "fast", which requests partner to + transmit LACPDUs every second. The default value is + "slow".

MIIMonitorSec=¶

Specifies the frequency that Media Independent + Interface link monitoring will occur. A value of zero + disables MII link monitoring. This values is rounded down to + the nearest millisecond. The default value is 0.

UpDelaySec=¶

Specifies the delay before a link is enabled after a + link up status has been detected. This value is rounded down + to a multiple of MIIMonitorSec. The default value is + 0.

DownDelaySec=¶

Specifies the delay before a link is disabled after a + link down status has been detected. This value is rounded + down to a multiple of MIIMonitorSec. The default value is + 0.

Example¶

Example 1. /etc/systemd/network/bridge.netdev

[NetDev]
 Name=bridge0
-Kind=bridge

Example 2. /etc/systemd/network/vlan1.netdev

[Match]
+Kind=bridge

Example 2. /etc/systemd/network/vlan1.netdev

[Match]
 Virtualization=no
 
 [NetDev]
@@ -157,7 +197,7 @@ Name=vlan1
 Kind=vlan
 
 [VLAN]
-Id=1

Example 3. /etc/systemd/network/ipip.netdev

[NetDev]
+Id=1

Example 3. /etc/systemd/network/ipip.netdev

[NetDev]
 Name=ipip-tun
 Kind=ipip
 MTUBytes=1480
@@ -165,43 +205,44 @@ MTUBytes=1480
 [Tunnel]
 Local=192.168.223.238
 Remote=192.169.224.239
-TTL=64

Example 4. /etc/systemd/network/tap.netdev

[NetDev]
+TTL=64

Example 4. /etc/systemd/network/tap.netdev

[NetDev]
 Name=tap-test
 Kind=tap
 
 [Tap]
 MultiQueue=true
-PacketInfo=true

Example 5. /etc/systemd/network/sit.netdev

[NetDev]
+PacketInfo=true

Example 5. /etc/systemd/network/sit.netdev

[NetDev]
 Name=sit-tun
 Kind=sit
 MTUBytes=1480
 
 [Tunnel]
 Local=10.65.223.238
-Remote=10.65.223.239

Example 6. /etc/systemd/network/gre.netdev

[NetDev]
+Remote=10.65.223.239

Example 6. /etc/systemd/network/gre.netdev

[NetDev]
 Name=gre-tun
 Kind=gre
 MTUBytes=1480
 
 [Tunnel]
 Local=10.65.223.238
-Remote=10.65.223.239

Example 7. /etc/systemd/network/vti.netdev

[NetDev]
+Remote=10.65.223.239

Example 7. /etc/systemd/network/vti.netdev

[NetDev]
 Name=vti-tun
 Kind=vti
 MTUBytes=1480
 
 [Tunnel]
 Local=10.65.223.238
-Remote=10.65.223.239

Example 8. /etc/systemd/network/veth.netdev

[NetDev]
+Remote=10.65.223.239

Example 8. /etc/systemd/network/veth.netdev

[NetDev]
 Name=veth-test
 Kind=veth
 
 [Peer]
-Name=veth-peer

Example 9. /etc/systemd/network/dummy.netdev

[NetDev]
+Name=veth-peer

Example 9. /etc/systemd/network/dummy.netdev

[NetDev]
 Name=dummy-test
 Kind=dummy
-MACAddress=12:34:56:78:9a:bc

+MACAddress=12:34:56:78:9a:bc

diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 45934f207..4480e1999 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.path - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.path - 5 - - - - systemd.path - Path unit configuration - - - - path.path - - - - Description - - A unit configuration file whose name ends in - .path encodes information about - a path monitored by systemd, for - path-based activation. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - path specific configuration options are configured in - the [Path] section. - - For each path file, a matching unit file must - exist, describing the unit to activate when the path - changes. By default, a service by the same name as the - path (except for the suffix) is activated. Example: a - path file foo.path activates a - matching service foo.service. The - unit to activate may be controlled by - Unit= (see below). - - Internally, path units use the - inotify7 - API to monitor file systems. Due to that, it suffers by the - same limitations as inotify, and for example cannot be - used to monitor files or directories changed by other - machines on remote NFS file systems. - - If a path unit is beneath another mount - point in the file system hierarchy, a dependency - between both units is created automatically. - - Unless DefaultDependencies=false - is used, path units will implicitly have dependencies of - type Conflicts= and - Before= on - shutdown.target. These ensure - that path units are terminated cleanly prior to system - shutdown. Only path units involved with early boot or - late system shutdown should disable this option. - - - - - Options - - Path files must include a [Path] section, - which carries information about the path(s) it - monitors. The options specific to the [Path] section - of path units are the following: - - - - PathExists= - PathExistsGlob= - PathChanged= - PathModified= - DirectoryNotEmpty= - - Defines paths to - monitor for certain changes: - PathExists= may be - used to watch the mere existence of a - file or directory. If the file - specified exists, the configured unit - is - activated. PathExistsGlob= - works similar, but checks for the - existence of at least one file - matching the globbing pattern - specified. PathChanged= - may be used to watch a file or - directory and activate the configured - unit whenever it changes. It is not - activated on every write to the - watched file but it is activated if - the file which was open for writing - gets - closed. PathModified= - is similar, but additionally it is - activated also on simple writes to the - watched file. - DirectoryNotEmpty= - may be used to watch a directory and - activate the configured unit whenever - it contains at least one file. - - The arguments of these - directives must be absolute file - system paths. - - Multiple directives may be - combined, of the same and of different - types, to watch multiple paths. If the - empty string is assigned to any of - these options, the list of paths to - watch is reset, and any prior - assignments of these options will not - have any effect. - - If a path already exists - (in case of - PathExists= and - PathExistsGlob=) or - a directory already is not empty (in - case of - DirectoryNotEmpty=) - at the time the path unit is - activated, then the configured unit is - immediately activated as - well. Something similar does not apply - to PathChanged= and - PathModified=. - - If the path itself or any of the - containing directories are not - accessible, systemd - will watch for permission changes and - notice that conditions are satisfied - when permissions allow that. - - - - Unit= - - The unit to activate - when any of the configured paths - changes. The argument is a unit name, - whose suffix is not - .path. If not - specified, this value defaults to a - service that has the same name as the - path unit, except for the suffix. (See - above.) It is recommended that the - unit name that is activated and the - unit name of the path unit are named - identical, except for the - suffix. - - - MakeDirectory= - - Takes a boolean - argument. If true, the directories to - watch are created before - watching. This option is ignored for - PathExists= - settings. Defaults to - . - - - DirectoryMode= - - If - MakeDirectory= is - enabled, use the mode specified here to - create the directories in - question. Takes an access mode in - octal notation. Defaults to - . - - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.service5, - inotify7, - systemd.directives7 - - + + systemd.path + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.path + 5 + + + + systemd.path + Path unit configuration + + + + path.path + + + + Description + + A unit configuration file whose name ends in + .path encodes information about a path + monitored by systemd, for path-based activation. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The path specific configuration options are + configured in the [Path] section. + + For each path file, a matching unit file must exist, + describing the unit to activate when the path changes. By default, + a service by the same name as the path (except for the suffix) is + activated. Example: a path file foo.path + activates a matching service foo.service. The + unit to activate may be controlled by Unit= + (see below). + + Internally, path units use the + inotify7 + API to monitor file systems. Due to that, it suffers by the same + limitations as inotify, and for example cannot be used to monitor + files or directories changed by other machines on remote NFS file + systems. + + If a path unit is beneath another mount point in the file + system hierarchy, a dependency between both units is created + automatically. + + Unless DefaultDependencies=false is used, + path units will implicitly have dependencies of type + Conflicts= and Before= on + shutdown.target. These ensure that path units + are terminated cleanly prior to system shutdown. Only path units + involved with early boot or late system shutdown should disable + this option. + + + + + Options + + Path files must include a [Path] section, which carries + information about the path(s) it monitors. The options specific to + the [Path] section of path units are the following: + + + + PathExists= + PathExistsGlob= + PathChanged= + PathModified= + DirectoryNotEmpty= + + Defines paths to monitor for certain changes: + PathExists= may be used to watch the mere + existence of a file or directory. If the file specified + exists, the configured unit is activated. + PathExistsGlob= works similar, but checks + for the existence of at least one file matching the globbing + pattern specified. PathChanged= may be used + to watch a file or directory and activate the configured unit + whenever it changes. It is not activated on every write to the + watched file but it is activated if the file which was open + for writing gets closed. PathModified= is + similar, but additionally it is activated also on simple + writes to the watched file. + DirectoryNotEmpty= may be used to watch a + directory and activate the configured unit whenever it + contains at least one file. + + The arguments of these directives must be absolute file + system paths. + + Multiple directives may be combined, of the same and of + different types, to watch multiple paths. If the empty string + is assigned to any of these options, the list of paths to + watch is reset, and any prior assignments of these options + will not have any effect. + + If a path already exists (in case of + PathExists= and + PathExistsGlob=) or a directory already is + not empty (in case of DirectoryNotEmpty=) + at the time the path unit is activated, then the configured + unit is immediately activated as well. Something similar does + not apply to PathChanged= and + PathModified=. + + If the path itself or any of the containing directories + are not accessible, systemd will watch for + permission changes and notice that conditions are satisfied + when permissions allow that. + + + Unit= + + The unit to activate when any of the + configured paths changes. The argument is a unit name, whose + suffix is not .path. If not specified, this + value defaults to a service that has the same name as the path + unit, except for the suffix. (See above.) It is recommended + that the unit name that is activated and the unit name of the + path unit are named identical, except for the + suffix. + + + MakeDirectory= + + Takes a boolean argument. If true, the + directories to watch are created before watching. This option + is ignored for PathExists= settings. + Defaults to . + + + DirectoryMode= + + If MakeDirectory= is + enabled, use the mode specified here to create the directories + in question. Takes an access mode in octal notation. Defaults + to . + + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.service5, + inotify7, + systemd.directives7 + + diff --git a/man/systemd.preset.5 b/man/systemd.preset.5 index 6da4d3b0f..71c327015 100644 --- a/man/systemd.preset.5 +++ b/man/systemd.preset.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.PRESET" "5" "" "systemd 218" "systemd.preset" +.TH "SYSTEMD\&.PRESET" "5" "" "systemd 219" "systemd.preset" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.preset.html b/man/systemd.preset.html index bcd752be9..f7ff34599 100644 --- a/man/systemd.preset.html +++ b/man/systemd.preset.html @@ -19,89 +19,75 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.preset — Service enablement presets

Synopsis

/etc/systemd/system-preset/*.preset

/run/systemd/system-preset/*.preset

/usr/lib/systemd/system-preset/*.preset

/etc/systemd/user-preset/*.preset

/run/systemd/user-preset/*.preset

/usr/lib/systemd/user-preset/*.preset

Description¶

Preset files may be used to encode policy which - units shall be enabled by default and which ones - shall be disabled. They are read by systemctl - preset (for more information see - systemctl(1)) - which uses this information to enable or disable a - unit according to preset policy. systemctl - preset is used by the post install - scriptlets of RPM packages (or other OS package formats), - to enable/disable specific units by default on package - installation, enforcing distribution, spin or - administrator preset policy. This allows choosing a certain - set of units to be enabled/disabled even before - installing the actual package.

For more information on the preset logic please - have a look at the Presets - document.

It is not recommended to ship preset files - within the respective software packages implementing - the units, but rather centralize them in a - distribution or spin default policy, which can be - amended by administrator policy.

If no preset files exist, systemctl - preset will enable all units that are - installed by default. If this is not desired and all - units shall rather be disabled, it is necessary to ship - a preset file with a single, catchall - "disable *" line. (See example 1, - below.)

Preset File Format¶

The preset files contain a list of - directives consisting of either the word - "enable" or - "disable" followed by a space and a - unit name (possibly with shell style wildcards), - separated by newlines. Empty lines and lines whose - first non-whitespace character is # or ; are - ignored.

Two different directives are understood: - "enable" may be used to enable units - by default, "disable" to disable - units by default.

If multiple lines apply to a unit name, the - first matching one takes precedence over all - others.

Each preset file shall be named in the style of - <priority>-<program>.conf. - Files in /etc/ override files - with the same name in /usr/lib/ - and /run/. Files in - /run/ override files with the - same name in /usr/lib/. Packages - should install their preset files in - /usr/lib/. Files in - /etc/ are reserved for the local - administrator, who may use this logic to override the - preset files installed by vendor packages. All preset - files are sorted by their filename in lexicographic - order, regardless of which of the directories they - reside in. If multiple files specify the same unit name, - the entry in the file with the lexicographically earliest - name will be applied. It is recommended to prefix all - filenames with a two-digit number and a dash, to simplify - the ordering of the files.

If the administrator wants to disable a preset - file supplied by the vendor, the recommended way is to - place a symlink to /dev/null in - /etc/systemd/system-preset/ - bearing the same filename.

Example¶

Example 1. Default off example /usr/lib/systemd/system-preset/99-default.preset:

disable *

This disables all units. Due to the filename - prefix "99-", it will be read last and - hence can easily be overridden by spin or - administrator preset policy or suchlike.

Example 2. A GNOME spin example /usr/lib/systemd/system-preset/50-gnome.preset:

enable gdm.service
+  gudev systemd 219

Name

systemd.preset — Service enablement presets

Synopsis

/etc/systemd/system-preset/*.preset

/run/systemd/system-preset/*.preset

/usr/lib/systemd/system-preset/*.preset

/etc/systemd/user-preset/*.preset

/run/systemd/user-preset/*.preset

/usr/lib/systemd/user-preset/*.preset

Description¶

Preset files may be used to encode policy which units shall + be enabled by default and which ones shall be disabled. They are + read by systemctl preset (for more information + see + systemctl(1)) + which uses this information to enable or disable a unit according + to preset policy. systemctl preset is used by + the post install scriptlets of RPM packages (or other OS package + formats), to enable/disable specific units by default on package + installation, enforcing distribution, spin or administrator preset + policy. This allows choosing a certain set of units to be + enabled/disabled even before installing the actual package.

For more information on the preset logic please have a look + at the Presets + document.

It is not recommended to ship preset files within the + respective software packages implementing the units, but rather + centralize them in a distribution or spin default policy, which + can be amended by administrator policy.

If no preset files exist, systemctl + preset will enable all units that are installed by + default. If this is not desired and all units shall rather be + disabled, it is necessary to ship a preset file with a single, + catchall "disable *" line. (See example 1, + below.)

Preset File Format¶

The preset files contain a list of directives consisting of + either the word "enable" or + "disable" followed by a space and a unit name + (possibly with shell style wildcards), separated by newlines. + Empty lines and lines whose first non-whitespace character is # or + ; are ignored.

Two different directives are understood: + "enable" may be used to enable units by default, + "disable" to disable units by default.

If multiple lines apply to a unit name, the first matching + one takes precedence over all others.

Each preset file shall be named in the style of + <priority>-<program>.conf. Files + in /etc/ override files with the same name in + /usr/lib/ and /run/. + Files in /run/ override files with the same + name in /usr/lib/. Packages should install + their preset files in /usr/lib/. Files in + /etc/ are reserved for the local + administrator, who may use this logic to override the preset files + installed by vendor packages. All preset files are sorted by their + filename in lexicographic order, regardless of which of the + directories they reside in. If multiple files specify the same + unit name, the entry in the file with the lexicographically + earliest name will be applied. It is recommended to prefix all + filenames with a two-digit number and a dash, to simplify the + ordering of the files.

If the administrator wants to disable a preset file supplied + by the vendor, the recommended way is to place a symlink to + /dev/null in + /etc/systemd/system-preset/ bearing the same + filename.

Example¶

Example 1. Default off example /usr/lib/systemd/system-preset/99-default.preset:

disable *

This disables all units. Due to the filename prefix + "99-", it will be read last and hence can easily + be overridden by spin or administrator preset policy or + suchlike.

Example 2. A GNOME spin example /usr/lib/systemd/system-preset/50-gnome.preset:

enable gdm.service
 enable colord.service
 enable accounts-daemon.service
 enable avahi-daemon.*

This enables the three mentioned units, plus all - avahi-daemon regardless of which - unit type. A file like this could be useful for - inclusion in a GNOME spin of a distribution. It will - ensure that the units necessary for GNOME are properly - enabled as they are installed. It leaves all other - units untouched, and subject to other (later) preset - files, for example like the one from the first example - above.

Example 3. Administrator policy /etc/systemd/system-preset/00-lennart.preset:

enable httpd.service
+    avahi-daemon regardless of which unit type. A
+    file like this could be useful for inclusion in a GNOME spin of a
+    distribution. It will ensure that the units necessary for GNOME
+    are properly enabled as they are installed. It leaves all other
+    units untouched, and subject to other (later) preset files, for
+    example like the one from the first example above.

Example 3. Administrator policy /etc/systemd/system-preset/00-lennart.preset:

enable httpd.service
 enable sshd.service
 enable postfix.service
-disable *

This enables three specific services and - disables all others. This is useful for administrators - to specifically select the units to enable, and - disable all others. Due to the filename prefix - "00-" it will be read early and hence - overrides all other preset policy files.

+disable *

This enables three specific services and disables all + others. This is useful for administrators to specifically select + the units to enable, and disable all others. Due to the filename + prefix "00-" it will be read early and hence + overrides all other preset policy files.

diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 55cb4de17..2f9add8d6 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -21,183 +21,169 @@ --> - - systemd.preset - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.preset - 5 - - - - systemd.preset - Service enablement presets - - - - /etc/systemd/system-preset/*.preset - /run/systemd/system-preset/*.preset - /usr/lib/systemd/system-preset/*.preset - /etc/systemd/user-preset/*.preset - /run/systemd/user-preset/*.preset - /usr/lib/systemd/user-preset/*.preset - - - - Description - - Preset files may be used to encode policy which - units shall be enabled by default and which ones - shall be disabled. They are read by systemctl - preset (for more information see - systemctl1) - which uses this information to enable or disable a - unit according to preset policy. systemctl - preset is used by the post install - scriptlets of RPM packages (or other OS package formats), - to enable/disable specific units by default on package - installation, enforcing distribution, spin or - administrator preset policy. This allows choosing a certain - set of units to be enabled/disabled even before - installing the actual package. - - For more information on the preset logic please - have a look at the Presets - document. - - It is not recommended to ship preset files - within the respective software packages implementing - the units, but rather centralize them in a - distribution or spin default policy, which can be - amended by administrator policy. - - If no preset files exist, systemctl - preset will enable all units that are - installed by default. If this is not desired and all - units shall rather be disabled, it is necessary to ship - a preset file with a single, catchall - "disable *" line. (See example 1, - below.) - - - - Preset File Format - - The preset files contain a list of - directives consisting of either the word - enable or - disable followed by a space and a - unit name (possibly with shell style wildcards), - separated by newlines. Empty lines and lines whose - first non-whitespace character is # or ; are - ignored. - - Two different directives are understood: - enable may be used to enable units - by default, disable to disable - units by default. - - If multiple lines apply to a unit name, the - first matching one takes precedence over all - others. - - Each preset file shall be named in the style of - <priority>-<program>.conf. - Files in /etc/ override files - with the same name in /usr/lib/ - and /run/. Files in - /run/ override files with the - same name in /usr/lib/. Packages - should install their preset files in - /usr/lib/. Files in - /etc/ are reserved for the local - administrator, who may use this logic to override the - preset files installed by vendor packages. All preset - files are sorted by their filename in lexicographic - order, regardless of which of the directories they - reside in. If multiple files specify the same unit name, - the entry in the file with the lexicographically earliest - name will be applied. It is recommended to prefix all - filenames with a two-digit number and a dash, to simplify - the ordering of the files. - - If the administrator wants to disable a preset - file supplied by the vendor, the recommended way is to - place a symlink to /dev/null in - /etc/systemd/system-preset/ - bearing the same filename. - - - - Example - - - Default off example <filename>/usr/lib/systemd/system-preset/99-default.preset</filename>: - - disable * - - - This disables all units. Due to the filename - prefix 99-, it will be read last and - hence can easily be overridden by spin or - administrator preset policy or suchlike. - - - A GNOME spin example <filename>/usr/lib/systemd/system-preset/50-gnome.preset</filename>: - - enable gdm.service + + systemd.preset + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.preset + 5 + + + + systemd.preset + Service enablement presets + + + + /etc/systemd/system-preset/*.preset + /run/systemd/system-preset/*.preset + /usr/lib/systemd/system-preset/*.preset + /etc/systemd/user-preset/*.preset + /run/systemd/user-preset/*.preset + /usr/lib/systemd/user-preset/*.preset + + + + Description + + Preset files may be used to encode policy which units shall + be enabled by default and which ones shall be disabled. They are + read by systemctl preset (for more information + see + systemctl1) + which uses this information to enable or disable a unit according + to preset policy. systemctl preset is used by + the post install scriptlets of RPM packages (or other OS package + formats), to enable/disable specific units by default on package + installation, enforcing distribution, spin or administrator preset + policy. This allows choosing a certain set of units to be + enabled/disabled even before installing the actual package. + + For more information on the preset logic please have a look + at the Presets + document. + + It is not recommended to ship preset files within the + respective software packages implementing the units, but rather + centralize them in a distribution or spin default policy, which + can be amended by administrator policy. + + If no preset files exist, systemctl + preset will enable all units that are installed by + default. If this is not desired and all units shall rather be + disabled, it is necessary to ship a preset file with a single, + catchall "disable *" line. (See example 1, + below.) + + + + Preset File Format + + The preset files contain a list of directives consisting of + either the word enable or + disable followed by a space and a unit name + (possibly with shell style wildcards), separated by newlines. + Empty lines and lines whose first non-whitespace character is # or + ; are ignored. + + Two different directives are understood: + enable may be used to enable units by default, + disable to disable units by default. + + If multiple lines apply to a unit name, the first matching + one takes precedence over all others. + + Each preset file shall be named in the style of + <priority>-<program>.conf. Files + in /etc/ override files with the same name in + /usr/lib/ and /run/. + Files in /run/ override files with the same + name in /usr/lib/. Packages should install + their preset files in /usr/lib/. Files in + /etc/ are reserved for the local + administrator, who may use this logic to override the preset files + installed by vendor packages. All preset files are sorted by their + filename in lexicographic order, regardless of which of the + directories they reside in. If multiple files specify the same + unit name, the entry in the file with the lexicographically + earliest name will be applied. It is recommended to prefix all + filenames with a two-digit number and a dash, to simplify the + ordering of the files. + + If the administrator wants to disable a preset file supplied + by the vendor, the recommended way is to place a symlink to + /dev/null in + /etc/systemd/system-preset/ bearing the same + filename. + + + + Example + + + Default off example <filename>/usr/lib/systemd/system-preset/99-default.preset</filename>: + + disable * + + + This disables all units. Due to the filename prefix + 99-, it will be read last and hence can easily + be overridden by spin or administrator preset policy or + suchlike. + + + A GNOME spin example <filename>/usr/lib/systemd/system-preset/50-gnome.preset</filename>: + + enable gdm.service enable colord.service enable accounts-daemon.service enable avahi-daemon.* - + - This enables the three mentioned units, plus all - avahi-daemon regardless of which - unit type. A file like this could be useful for - inclusion in a GNOME spin of a distribution. It will - ensure that the units necessary for GNOME are properly - enabled as they are installed. It leaves all other - units untouched, and subject to other (later) preset - files, for example like the one from the first example - above. + This enables the three mentioned units, plus all + avahi-daemon regardless of which unit type. A + file like this could be useful for inclusion in a GNOME spin of a + distribution. It will ensure that the units necessary for GNOME + are properly enabled as they are installed. It leaves all other + units untouched, and subject to other (later) preset files, for + example like the one from the first example above. - - Administrator policy <filename>/etc/systemd/system-preset/00-lennart.preset</filename>: + + Administrator policy <filename>/etc/systemd/system-preset/00-lennart.preset</filename>: - enable httpd.service + enable httpd.service enable sshd.service enable postfix.service disable * - - - This enables three specific services and - disables all others. This is useful for administrators - to specifically select the units to enable, and - disable all others. Due to the filename prefix - 00- it will be read early and hence - overrides all other preset policy files. - - - - See Also - - systemd1, - systemctl1, - systemd-delta1 - - + + + This enables three specific services and disables all + others. This is useful for administrators to specifically select + the units to enable, and disable all others. Due to the filename + prefix 00- it will be read early and hence + overrides all other preset policy files. + + + + See Also + + systemd1, + systemctl1, + systemd-delta1 + + diff --git a/man/systemd.resource-control.5 b/man/systemd.resource-control.5 index ef59f2d37..ecba3096a 100644 --- a/man/systemd.resource-control.5 +++ b/man/systemd.resource-control.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.RESOURCE\-CONTROL" "5" "" "systemd 218" "systemd.resource-control" +.TH "SYSTEMD\&.RESOURCE\-CONTROL" "5" "" "systemd 219" "systemd.resource-control" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ systemd.resource-control \- Resource control unit settings \fIswap\fR\&.swap .SH "DESCRIPTION" .PP -Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes\&. Internally, this relies on the Control Groups kernel concept for organizing processes in a hierarchial tree of named groups for the purpose of resource management\&. +Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes\&. Internally, this relies on the Control Groups kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of resource management\&. .PP This man page lists the configuration options shared by those six unit types\&. See \fBsystemd.unit\fR(5) @@ -72,7 +72,7 @@ only applies to the startup phase of the system, \fICPUShares=\fR applies to normal runtime of the system, and if the former is not set also to the startup phase\&. Using \fIStartupCPUShares=\fR -allows priorizing specific services at boot\-up differently than during normal runtime\&. +allows prioritizing specific services at boot\-up differently than during normal runtime\&. .sp Those options imply "CPUAccounting=true"\&. @@ -80,7 +80,7 @@ Those options imply .PP \fICPUQuota=\fR .RS 4 -Assign the specified CPU time quota to the processes executed\&. Takes a percentage value, suffixed with "%"\&. The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one CPU\&. Use values > 100% for alloting CPU time on more than one CPU\&. This controls the +Assign the specified CPU time quota to the processes executed\&. Takes a percentage value, suffixed with "%"\&. The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one CPU\&. Use values > 100% for allotting CPU time on more than one CPU\&. This controls the "cpu\&.cfs_quota_us" control group attribute\&. For details about this control group attribute, see \m[blue]\fBsched\-design\-CFS\&.txt\fR\m[]\&\s-2\u[2]\d\s+2\&. @@ -131,7 +131,7 @@ While \fIStartupBlockIOWeight=\fR only applies to the startup phase of the system, \fIBlockIOWeight=\fR -applies to the later runtime of the system, and if the former is not set also to the startup phase\&. This allows priorizing specific services at boot\-up differently than during runtime\&. +applies to the later runtime of the system, and if the former is not set also to the startup phase\&. This allows prioritizing specific services at boot\-up differently than during runtime\&. .sp Implies "BlockIOAccounting=true"\&. @@ -239,9 +239,9 @@ For units of type slice, the only accepted value for this setting is the parent .PP \fIDelegate=\fR .RS 4 -Turns on delegation of further resource control partitioning to processes of the unit\&. For unpriviliged services (i\&.e\&. those using the +Turns on delegation of further resource control partitioning to processes of the unit\&. For unprivileged services (i\&.e\&. those using the \fIUser=\fR -setting) this allows processes to create a subhierarchy beneath its control group path\&. For priviliged services and scopes this ensures the processes will have all control group controllers enabled\&. +setting) this allows processes to create a subhierarchy beneath its control group path\&. For privileged services and scopes this ensures the processes will have all control group controllers enabled\&. .RE .SH "SEE ALSO" .PP diff --git a/man/systemd.resource-control.html b/man/systemd.resource-control.html index 0b554f0fe..63da7c58d 100644 --- a/man/systemd.resource-control.html +++ b/man/systemd.resource-control.html @@ -19,18 +19,18 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.resource-control — Resource control unit settings

Synopsis

+ gudev systemd 219


Name

systemd.resource-control — Resource control unit settings

Synopsis

slice.slice, scope.scope, service.service, socket.socket, mount.mount, swap.swap -

Description¶

Unit configuration files for services, slices, scopes, +

Description¶

Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes. Internally, this relies on the Control Groups - kernel concept for organizing processes in a hierarchial tree of + kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of resource management.

This man page lists the configuration options shared by those six unit types. See systemd.unit(5) @@ -47,7 +47,7 @@ [Slice], [Scope], [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type.

See the New Control Group Interfaces for an introduction on how to make - use of resource control APIs from programs.

Options¶

Units of the types listed above can have settings + use of resource control APIs from programs.

Options¶

Units of the types listed above can have settings for resource control configuration:

CPUAccounting=¶

Turn on CPU usage accounting for this unit. Takes a boolean argument. Note that turning on CPU accounting for one unit might also implicitly turn it on for all units @@ -66,13 +66,13 @@ CPUShares= applies to normal runtime of the system, and if the former is not set also to the startup phase. Using StartupCPUShares= allows - priorizing specific services at boot-up differently than + prioritizing specific services at boot-up differently than during normal runtime.

Those options imply "CPUAccounting=true".

CPUQuota=¶

Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one - CPU. Use values > 100% for alloting CPU time on more than + CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the "cpu.cfs_quota_us" control group attribute. For details about this control group attribute, @@ -111,7 +111,7 @@ applies to the startup phase of the system, BlockIOWeight= applies to the later runtime of the system, and if the former is not set also to the - startup phase. This allows priorizing specific services at + startup phase. This allows prioritizing specific services at boot-up differently than during runtime.

Implies "BlockIOAccounting=true".

BlockIODeviceWeight=device weight¶

Set the per-device overall block IO weight for the executed processes. Takes a space-separated pair of a file @@ -194,12 +194,12 @@ this setting is the parent slice. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units.

Delegate=¶

Turns on delegation of further resource control - partitioning to processes of the unit. For unpriviliged + partitioning to processes of the unit. For unprivileged services (i.e. those using the User= setting) this allows processes to create a subhierarchy - beneath its control group path. For priviliged services and + beneath its control group path. For privileged services and scopes this ensures the processes will have all control - group controllers enabled.

See Also¶

+ group controllers enabled.

See Also¶

systemd(1), systemd.unit(5), systemd.service(5), diff --git a/man/systemd.resource-control.xml b/man/systemd.resource-control.xml index b050a1752..8f4e7a3f1 100644 --- a/man/systemd.resource-control.xml +++ b/man/systemd.resource-control.xml @@ -1,25 +1,24 @@ - @@ -65,7 +64,7 @@ along with systemd; If not, see . sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes. Internally, this relies on the Control Groups - kernel concept for organizing processes in a hierarchial tree of + kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of resource management. This man page lists the configuration options shared by @@ -132,7 +131,7 @@ along with systemd; If not, see . CPUShares= applies to normal runtime of the system, and if the former is not set also to the startup phase. Using StartupCPUShares= allows - priorizing specific services at boot-up differently than + prioritizing specific services at boot-up differently than during normal runtime. Those options imply @@ -148,7 +147,7 @@ along with systemd; If not, see . executed. Takes a percentage value, suffixed with "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one - CPU. Use values > 100% for alloting CPU time on more than + CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the cpu.cfs_quota_us control group attribute. For details about this control group attribute, @@ -230,7 +229,7 @@ along with systemd; If not, see . applies to the startup phase of the system, BlockIOWeight= applies to the later runtime of the system, and if the former is not set also to the - startup phase. This allows priorizing specific services at + startup phase. This allows prioritizing specific services at boot-up differently than during runtime. Implies @@ -399,10 +398,10 @@ along with systemd; If not, see . Turns on delegation of further resource control - partitioning to processes of the unit. For unpriviliged + partitioning to processes of the unit. For unprivileged services (i.e. those using the User= setting) this allows processes to create a subhierarchy - beneath its control group path. For priviliged services and + beneath its control group path. For privileged services and scopes this ensures the processes will have all control group controllers enabled. diff --git a/man/systemd.scope.5 b/man/systemd.scope.5 index 9e9d1623e..94727774b 100644 --- a/man/systemd.scope.5 +++ b/man/systemd.scope.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SCOPE" "5" "" "systemd 218" "systemd.scope" +.TH "SYSTEMD\&.SCOPE" "5" "" "systemd 219" "systemd.scope" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.scope.html b/man/systemd.scope.html index aa15eee68..b283eb583 100644 --- a/man/systemd.scope.html +++ b/man/systemd.scope.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd.scope — Scope unit configuration

Synopsis

scope.scope

Description¶

Scope units are not configured via unit configuration files, + gudev systemd 219


Name

systemd.scope — Scope unit configuration

Synopsis

scope.scope

Description¶

Scope units are not configured via unit configuration files, but are only created programmatically using the bus interfaces of systemd. They are named similar to filenames. A unit whose name ends in ".scope" refers to a scope unit. Scopes @@ -38,7 +38,7 @@ that scope units are removed prior to system shutdown. Only scope units involved with early boot or late system shutdown should disable this option. -

See Also¶

+

See Also¶

systemd(1), systemd-run(1), systemd.unit(5), diff --git a/man/systemd.scope.xml b/man/systemd.scope.xml index 5d03d907a..59eede959 100644 --- a/man/systemd.scope.xml +++ b/man/systemd.scope.xml @@ -1,5 +1,4 @@ - diff --git a/man/systemd.service.5 b/man/systemd.service.5 index 8b701403a..6360bce2c 100644 --- a/man/systemd.service.5 +++ b/man/systemd.service.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SERVICE" "5" "" "systemd 218" "systemd.service" +.TH "SYSTEMD\&.SERVICE" "5" "" "systemd 219" "systemd.service" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -243,7 +243,7 @@ is specified, then the service must have \fIRemainAfterExit=yes\fR set\&. .sp -For each of the specified commands, the first argument must be an absolute and literal path to an executable\&. Optionally, if the absolute file name is prefixed with +For each of the specified commands, the first argument must be an absolute path to an executable\&. Optionally, if this file name is prefixed with "@", the second token will be passed as "argv[0]" to the executed process, followed by the further arguments specified\&. If the absolute filename is prefixed with @@ -559,7 +559,8 @@ Takes a list of exit status definitions that when returned by the main service p .RS 4 .\} .nf -SuccessExitStatus=1 2 8 SIGKILL +SuccessExitStatus=1 2 8 + SIGKILL .fi .if n \{\ .RE @@ -586,7 +587,8 @@ Takes a list of exit status definitions that when returned by the main service p .RS 4 .\} .nf -RestartPreventExitStatus=1 6 SIGABRT +RestartPreventExitStatus=1 6 + SIGABRT .fi .if n \{\ .RE @@ -760,6 +762,16 @@ is a reboot action\&. This works just like the optional argument to command\&. .RE .PP +\fIFileDescriptorStoreMax=\fR +.RS 4 +Configure how many file descriptors may be stored in the service manager for the service using +\fBsd_pid_notify_with_fds\fR(3)\*(Aqs +"FDSTORE=1" +messages\&. This is useful for implementing service restart schemes where the state is serialized to +/run +and the file descriptors passed to the service manager, to allow restarts without losing state\&. Defaults to 0, i\&.e\&. no file descriptors may be stored in the service manager by default\&. All file descriptors passed to the service manager from a specific service are passed back to the service\*(Aqs main process on the next service restart\&. Any file descriptors passed to the service manager are automatically closed when POLLHUP or POLLERR is seen on them, or when the service is fully stopped and no job queued or being executed for it\&. +.RE +.PP Check \fBsystemd.exec\fR(5) and @@ -779,7 +791,7 @@ options\&. Multiple command lines may be concatenated in a single directive by separating them with semicolons (these semicolons must be passed as separate words)\&. Lone semicolons may be escaped as "\e;"\&. .PP -Each command line is split on whitespace, with the first item being the command to execute, and the subsequent items being the arguments\&. Double quotes ("\&.\&.\&.") and single quotes (\*(Aq\&.\&.\&.\*(Aq) may be used, in which case everything until the next matching quote becomes part of the same argument\&. Quotes themselves are removed after parsing\&. In addition, a trailing backslash ("\e") may be used to merge lines\&. +Each command line is split on whitespace, with the first item being the command to execute, and the subsequent items being the arguments\&. Double quotes ("\&.\&.\&.") and single quotes (\*(Aq\&.\&.\&.\*(Aq) may be used, in which case everything until the next matching quote becomes part of the same argument\&. C\-style escapes are also supported, see table below\&. Quotes themselves are removed after parsing and escape sequences substituted\&. In addition, a trailing backslash ("\e") may be used to merge lines\&. .PP This syntax is intended to be very similar to shell syntax, but only the meta\-characters and expansions described in the following paragraphs are understood\&. Specifically, redirection using "<", @@ -790,6 +802,8 @@ This syntax is intended to be very similar to shell syntax, but only the meta\-c "&", and \fIother elements of shell syntax are not supported\fR\&. .PP +The command to execute must an absolute path name\&. It may contain spaces, but control characters are not allowed\&. +.PP The command line accepts "%" specifiers as described in @@ -911,6 +925,343 @@ with five arguments: "&", ";", and "/bin/ls"\&. +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&2.\ \&C escapes supported in command lines and environment variables +.TS +allbox tab(:); +lB lB. +T{ +Literal +T}:T{ +Actual value +T} +.T& +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l +l l. +T{ +"\ea" +T}:T{ +bell +T} +T{ +"\eb" +T}:T{ +backspace +T} +T{ +"\ef" +T}:T{ +form feed +T} +T{ +"\en" +T}:T{ +newline +T} +T{ +"\er" +T}:T{ +carriage return +T} +T{ +"\et" +T}:T{ +tab +T} +T{ +"\ev" +T}:T{ +vertical tab +T} +T{ +"\e\e" +T}:T{ +backslash +T} +T{ +"\e"" +T}:T{ +double quotation mark +T} +T{ +"\e\*(Aq" +T}:T{ +single quotation mark +T} +T{ +"\es" +T}:T{ +space +T} +T{ +"\ex\fIxx\fR" +T}:T{ +character number \fIxx\fR in hexadecimal encoding +T} +T{ +"\e\fInnn\fR" +T}:T{ +character number \fInnn\fR in octal encoding +T} +.TE +.sp 1 +.SH "EXAMPLES" +.PP +\fBExample\ \&1.\ \&Simple service\fR +.PP +The following unit file creates a service that will execute +/usr/sbin/foo\-daemon\&. Since no +\fIType=\fR +is specified, the default +\fIType=\fR\fBsimple\fR +will be assumed\&. systemd will assume the unit to be started immediately after the program has begun executing\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Foo + +[Service] +ExecStart=/usr/sbin/foo\-daemon + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Note that systemd assumes here that the process started by systemd will continue running until the service terminates\&. If the program daemonizes itself (i\&.e\&. forks), please use +\fIType=\fR\fBforking\fR +instead\&. +.PP +Since no +\fIExecStop=\fR +was specified, systemd will send SIGTERM to all processes started from this service, and after a timeout also SIGKILL\&. This behavior can be modified, see +\fBsystemd.kill\fR(5) +for details\&. +.PP +Note that this unit type does not include any type of notification when a service has completed initialization\&. For this, you should use other unit types, such as +\fIType=\fR\fBnotify\fR +if the service understands systemd\*(Aqs notification protocol, +\fIType=\fR\fBforking\fR +if the service can background itself or +\fIType=\fR\fBdbus\fR +if the unit acquires a DBus name once initialization is complete\&. See below\&. +.PP +\fBExample\ \&2.\ \&Oneshot service\fR +.PP +Sometimes units should just execute an action without keeping active processes, such as a filesystem check or a cleanup action on boot\&. For this, +\fIType=\fR\fBoneshot\fR +exists\&. Units of this type will wait until the process specified terminates and then fall back to being inactive\&. The following unit will perform a clenaup action: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Cleanup old Foo data + +[Service] +Type=oneshot +ExecStart=/usr/sbin/foo\-cleanup + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Note that systemd will consider the unit to be in the state \*(Aqstarting\*(Aq until the program has terminated, so ordered dependencies will wait for the program to finish before starting themselves\&. The unit will revert to the \*(Aqinactive\*(Aq state after the execution is done, never reaching the \*(Aqactive\*(Aq state\&. That means another request to start the unit will perform the action again\&. +.PP +\fIType=\fR\fBoneshot\fR +are the only service units that may have more than one +\fIExecStart=\fR +specified\&. They will be executed in order until either they are all successful or one of them fails\&. +.PP +\fBExample\ \&3.\ \&Stoppable oneshot service\fR +.PP +Similarly to the oneshot services, there are sometimes units that need to execute a program to set up something and then execute another to shut it down, but no process remains active while they are considered \*(Aqstarted\*(Aq\&. Network configuration can sometimes fall into this category\&. Another use case is if a oneshot service shall not be executed a each time when they are pulled in as a dependency, but only the first time\&. +.PP +For this, systemd knows the setting +\fIRemainAfterExit=\fR\fByes\fR, which causes systemd to consider the unit to be active if the start action exited successfully\&. This directive can be used with all types, but is most useful with +\fIType=\fR\fBoneshot\fR +and +\fIType=\fR\fBsimple\fR\&. With +\fIType=\fR\fBoneshot\fR +systemd waits until the start action has completed before it considers the unit to be active, so dependencies start only after the start action has succeeded\&. With +\fIType=\fR\fBsimple\fR +dependencies will start immediately after the start action has been dispatched\&. The following unit provides an example for a simple static firewall\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Simple firewall + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/sbin/simple\-firewall\-start +ExecStop=/usr/local/sbin/simple\-firewall\-stop + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Since the unit is considered to be running after the start action has exited, invoking +\fBsystemctl start\fR +on that unit again will cause no action to be taken\&. +.PP +\fBExample\ \&4.\ \&Traditional forking services\fR +.PP +Many traditional daemons/services background (i\&.e\&. fork, daemonize) themselves when starting\&. Set +\fIType=\fR\fBforking\fR +in the service\*(Aqs unit file to support this mode of operation\&. systemd will consider the service to be in the process of initialization while the original program is still running\&. Once it exits successfully and at least a process remains (and +\fIRemainAfterExit=\fR\fBno\fR), the service is considered started\&. +.PP +Often a traditional daemon only consists of one process\&. Therefore, if only one process is left after the original process terminates, systemd will consider that process the main process of the service\&. In that case, the +\fI$MAINPID\fR +variable will be available in +\fIExecReload=\fR, +\fIExecStop=\fR, etc\&. +.PP +In case more than one process remains, systemd will be unable to determine the main process, so it will not assume there is one\&. In that case, +\fI$MAINPID\fR +will not expand to anything\&. However, if the process decides to write a traditional PID file, systemd will be able to read the main PID from there\&. Please set +\fIPIDFile=\fR +accordingly\&. Note that the daemon should write that file before finishing with its initialization, otherwise systemd might try to read the file before it exists\&. +.PP +The following example shows a simple daemon that forks and just starts one process in the background: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Some simple daemon + +[Service] +Type=forking +ExecStart=/usr/sbin/my\-simple\-daemon \-d + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Please see +\fBsystemd.kill\fR(5) +for details on how you can influence the way systemd terminates the service\&. +.PP +\fBExample\ \&5.\ \&DBus services\fR +.PP +For services that acquire a name on the DBus system bus, use +\fIType=\fR\fBdbus\fR +and set +\fIBusName=\fR +accordingly\&. The service should not fork (daemonize)\&. systemd will consider the service to be initialized once the name has been acquired on the system bus\&. The following example shows a typical DBus service: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Simple DBus service + +[Service] +Type=dbus +BusName=org\&.example\&.simple\-dbus\-service +ExecStart=/usr/sbin/simple\-dbus\-service + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +For +\fIbus\-activatable\fR +services, don\*(Aqt include a +"[Install]" +section in the systemd service file, but use the +\fISystemdService=\fR +option in the corresponding DBus service file, for example (/usr/share/dbus\-1/system\-services/org\&.example\&.simple\-dbus\-service\&.service): +.sp +.if n \{\ +.RS 4 +.\} +.nf +[D\-BUS Service] +Name=org\&.example\&.simple\-dbus\-service +Exec=/usr/sbin/simple\-dbus\-service +User=root +SystemdService=simple\-dbus\-service\&.service +.fi +.if n \{\ +.RE +.\} +.PP +Please see +\fBsystemd.kill\fR(5) +for details on how you can influence the way systemd terminates the service\&. +.PP +\fBExample\ \&6.\ \&Services that notify systemd about their initialization\fR +.PP +\fIType=\fR\fBsimple\fR +services are really easy to write, but have the major disadvantage of systemd not being able to tell when initialization of the given service is complete\&. For this reason, systemd supports a simple notification protocol that allows daemons to make systemd aware that they are done initializing\&. Use +\fIType=\fR\fBnotify\fR +for this\&. A typical service file for such a daemon would look like this: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Simple notifying service + +[Service] +Type=notify +ExecStart=/usr/sbin/simple\-notifying\-service + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Note that the daemon has to support systemd\*(Aqs notification protocol, else systemd will think the service hasn\*(Aqt started yet and kill it after a timeout\&. For an example of how to update daemons to support this protocol transparently, take a look at +\fBsd_notify\fR(3)\&. systemd will consider the unit to be in the \*(Aqstarting\*(Aq state until a readiness notification has arrived\&. +.PP +Please see +\fBsystemd.kill\fR(5) +for details on how you can influence the way systemd terminates the service\&. .SH "SEE ALSO" .PP \fBsystemd\fR(1), diff --git a/man/systemd.service.html b/man/systemd.service.html index 0954bce8f..7620c303d 100644 --- a/man/systemd.service.html +++ b/man/systemd.service.html @@ -19,858 +19,771 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd.service — Service unit configuration

Synopsis

service.service

Description¶

A unit configuration file whose name ends in - .service encodes information - about a process controlled and supervised by - systemd.

This man page lists the configuration options - specific to this unit type. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic "[Unit]" and - "[Install]" sections. The service - specific configuration options are configured in the - "[Service]" section.

Additional options are listed in - systemd.exec(5), - which define the execution environment the commands - are executed in, and in - systemd.kill(5), - which define the way the processes of the service are - terminated, and in - systemd.resource-control(5), - which configure resource control settings for the - processes of the service.

Unless DefaultDependencies= - is set to false, service units will - implicitly have dependencies of type - Requires= and - After= on - basic.target as well as - dependencies of type Conflicts= and - Before= on - shutdown.target. These ensure - that normal service units pull in basic system - initialization, and are terminated cleanly prior to - system shutdown. Only services involved with early - boot or late system shutdown should disable this - option.

If a service is requested under a certain name - but no unit configuration file is found, systemd looks - for a SysV init script by the same name (with the - .service suffix removed) and - dynamically creates a service unit from that - script. This is useful for compatibility with - SysV. Note that this compatibility is quite - comprehensive but not 100%. For details about the - incompatibilities, see the Incompatibilities - with SysV document. -

Options¶

Service files must include a - "[Service]" section, which carries - information about the service and the process it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec(5) - and - systemd.kill(5). The - options specific to the "[Service]" - section of service units are the following:

Type=¶

Configures the process - start-up type for this service - unit. One of simple, - forking, - oneshot, - dbus, - notify or - idle.

If set to - simple (the default - if neither - Type= nor - BusName=, but - ExecStart= are - specified), it is expected that the - process configured with - ExecStart= is the - main process of the service. In this - mode, if the process offers - functionality to other processes on - the system, its communication channels - should be installed before the daemon - is started up (e.g. sockets set up by - systemd, via socket activation), as - systemd will immediately proceed - starting follow-up units.

If set to - forking, it is - expected that the process configured - with ExecStart= - will call fork() - as part of its start-up. The parent process is - expected to exit when start-up is - complete and all communication - channels are set up. The child continues - to run as the main daemon - process. This is the behavior of - traditional UNIX daemons. If this - setting is used, it is recommended to - also use the - PIDFile= option, so - that systemd can identify the main - process of the daemon. systemd will - proceed with starting follow-up units - as soon as the parent process - exits.

Behavior of - oneshot is similar to - simple; however, it - is expected that the process has to - exit before systemd starts follow-up - units. RemainAfterExit= - is particularly useful for this type - of service. This is the implied - default if neither - Type= or - ExecStart= are - specified.

Behavior of - dbus is similar to - simple; however, it is - expected that the daemon acquires a - name on the D-Bus bus, as configured - by - BusName=. systemd - will proceed with starting follow-up - units after the D-Bus bus name has been - acquired. Service units with this - option configured implicitly gain - dependencies on the - dbus.socket - unit. This type is the default if - BusName= is - specified.

Behavior of - notify is similar to - simple; however, it is - expected that the daemon sends a - notification message via - sd_notify(3) - or an equivalent call when it has finished - starting up. systemd will proceed with - starting follow-up units after this - notification message has been sent. If - this option is used, - NotifyAccess= (see - below) should be set to open access to - the notification socket provided by - systemd. If - NotifyAccess= is - not set, it will be implicitly set to - main. Note that - currently - Type=notify - will not work if used in combination with - PrivateNetwork=yes.

Behavior of - idle is very similar - to simple; however, - actual execution of the service - binary is delayed until all jobs are - dispatched. This may be used to avoid - interleaving of output of shell - services with the status output on the - console.

RemainAfterExit=¶

Takes a boolean value - that specifies whether the service - shall be considered active even when - all its processes exited. Defaults to - no.

GuessMainPID=¶

Takes a boolean value - that specifies whether systemd should - try to guess the main PID of a service - if it cannot be determined - reliably. This option is ignored - unless Type=forking - is set and PIDFile= - is unset because for the other types - or with an explicitly configured PID - file, the main PID is always known. The - guessing algorithm might come to - incorrect conclusions if a daemon - consists of more than one process. If - the main PID cannot be determined, - failure detection and automatic - restarting of a service will not work - reliably. Defaults to - yes.

PIDFile=¶

Takes an absolute file - name pointing to the PID file of this - daemon. Use of this option is - recommended for services where - Type= is set to - forking. systemd will - read the PID of the main process of - the daemon after start-up of the - service. systemd will not write to the - file configured here.

BusName=¶

Takes a D-Bus bus - name that this service is reachable - as. This option is mandatory for - services where - Type= is set to - dbus.

BusPolicy=¶

If specified, a custom - kdbus - endpoint will be created and installed as the - default bus node for the service. Such a custom - endpoint can hold an own set of policy rules - that are enforced on top of the bus-wide ones. - The custom endpoint is named after the service - it was created for, and its node will be - bind-mounted over the default bus node - location, so the service can only access the - bus through its own endpoint. Note that custom - bus endpoints default to a 'deny all' policy. - Hence, if at least one - BusPolicy= directive is - given, you have to make sure to add explicit - rules for everything the service should be able - to do.

The value of this directive is comprised - of two parts; the bus name, and a verb to - specify to granted access, which is one of - see, - talk, or - own. - talk implies - see, and own - implies both talk and - see. - If multiple access levels are specified for the - same bus name, the most powerful one takes - effect. -

Examples:

BusPolicy=org.freedesktop.systemd1 talk
BusPolicy=org.foo.bar see

This option is only available on kdbus enabled systems.

ExecStart=¶

Commands with their - arguments that are executed when this - service is started. The value is split - into zero or more command lines is - according to the rules described below - (see section "Command Lines" below). -

When Type is - not oneshot, only one - command may and must be given. When - Type=oneshot is - used, zero or more commands may be - specified. This can be specified by - providing multiple command lines in - the same directive, or alternatively, - this directive may be specified more - than once with the same effect. If the - empty string is assigned to this - option, the list of commands to start - is reset, prior assignments of this - option will have no effect. If no - ExecStart= is - specified, then the service must have - RemainAfterExit=yes - set.

For each of the specified - commands, the first argument must be - an absolute and literal path to an - executable. Optionally, if the - absolute file name is prefixed with - "@", the second token - will be passed as - "argv[0]" to the - executed process, followed by the - further arguments specified. If the - absolute filename is prefixed with - "-", an exit code of - the command normally considered a - failure (i.e. non-zero exit status or - abnormal exit due to signal) is - ignored and considered success. If - both "-" and - "@" are used, they - can appear in either order.

If more than one command is - specified, the commands are invoked - sequentially in the order they appear - in the unit file. If one of the - commands fails (and is not prefixed - with "-"), other - lines are not executed, and the unit - is considered failed.

Unless - Type=forking is - set, the process started via this - command line will be considered the - main process of the daemon.

ExecStartPre=, ExecStartPost=¶

Additional commands - that are executed before or after - the command in - ExecStart=, respectively. - Syntax is the same as for - ExecStart=, except - that multiple command lines are allowed - and the commands are executed one - after the other, serially.

If any of those commands (not - prefixed with "-") - fail, the rest are not executed and - the unit is considered failed.

ExecReload=¶

Commands to execute to - trigger a configuration reload in the - service. This argument takes multiple - command lines, following the same - scheme as described for - ExecStart= - above. Use of this setting is - optional. Specifier and environment - variable substitution is supported - here following the same scheme as for - ExecStart=.

One additional, special - environment variable is set: if known, - $MAINPID is set to - the main process of the daemon, and - may be used for command lines like the - following:

/bin/kill -HUP $MAINPID

Note however that reloading a - daemon by sending a signal (as with - the example line above) is usually not - a good choice, because this is an - asynchronous operation and hence not - suitable to order reloads of multiple - services against each other. It is - strongly recommended to set - ExecReload= to a - command that not only triggers a - configuration reload of the daemon, - but also synchronously waits for it to - complete.

ExecStop=¶

Commands to execute to - stop the service started via - ExecStart=. This - argument takes multiple command lines, - following the same scheme as described - for ExecStart= - above. Use of this setting is - optional. After the commands configured - in this option are run, all processes - remaining for a service are - terminated according to the - KillMode= setting - (see - systemd.kill(5)). If - this option is not specified, the - process is terminated immediately when - service stop is requested. Specifier - and environment variable substitution - is supported (including - $MAINPID, see - above).

ExecStopPost=¶

Additional commands - that are executed after the service - was stopped. This includes cases where - the commands configured in - ExecStop= were used, - where the service does not have any - ExecStop= defined, or - where the service exited unexpectedly. This - argument takes multiple command lines, - following the same scheme as described - for ExecStart. Use - of these settings is - optional. Specifier and environment - variable substitution is - supported.

RestartSec=¶

Configures the time to - sleep before restarting a service (as - configured with - Restart=). Takes a - unit-less value in seconds, or a time - span value such as "5min - 20s". Defaults to - 100ms.

TimeoutStartSec=¶

Configures the time to - wait for start-up. If a - daemon service does not signal - start-up completion within the - configured time, the service will be - considered failed and will be shut - down again. - Takes a unit-less value in seconds, or a - time span value such as "5min - 20s". Pass "0" to - disable the timeout logic. Defaults to - DefaultTimeoutStartSec= from - the manager configuration file, except - when Type=oneshot is - used, in which case the timeout - is disabled by default - (see systemd-system.conf(5)). -

TimeoutStopSec=¶

Configures the time to - wait for stop. If a service is asked - to stop, but does not terminate in the - specified time, it will be terminated - forcibly via SIGTERM, - and after another timeout of equal duration - with SIGKILL (see - KillMode= - in systemd.kill(5)). - Takes a unit-less value in seconds, or a - time span value such as "5min - 20s". Pass "0" to disable - the timeout logic. Defaults to - DefaultTimeoutStopSec= from the - manager configuration file - (see systemd-system.conf(5)). -

TimeoutSec=¶

A shorthand for configuring - both TimeoutStartSec= - and TimeoutStopSec= - to the specified value. -

WatchdogSec=¶

Configures the - watchdog timeout for a service. The - watchdog is activated when the start-up is - completed. The service must call - sd_notify(3) - regularly with "WATCHDOG=1" - (i.e. the "keep-alive ping"). If the time - between two such calls is larger than - the configured time, then the service - is placed in a failed state and it will - be terminated with SIGABRT. - By setting Restart= to - on-failure or - always, the service - will be automatically restarted. The - time configured here will be passed to - the executed service process in the - WATCHDOG_USEC= - environment variable. This allows - daemons to automatically enable the - keep-alive pinging logic if watchdog - support is enabled for the service. If - this option is used, - NotifyAccess= (see - below) should be set to open access to - the notification socket provided by - systemd. If - NotifyAccess= is - not set, it will be implicitly set to - main. Defaults to 0, - which disables this - feature.

Restart=¶

Configures whether the - service shall be restarted when the - service process exits, is killed, - or a timeout is reached. The service - process may be the main service - process, but it may also be one of the - processes specified with - ExecStartPre=, - ExecStartPost=, - ExecStop=, - ExecStopPost=, or - ExecReload=. - When the death of the process is a - result of systemd operation (e.g. service - stop or restart), the service will not be - restarted. Timeouts include missing - the watchdog "keep-alive ping" - deadline and a service start, reload, - and stop operation timeouts.

Takes one of - no, - on-success, - on-failure, - on-abnormal, - on-watchdog, - on-abort, or - always. If set to - no (the default), the - service will not be restarted. If set - to on-success, it - will be restarted only when the - service process exits cleanly. In - this context, a clean exit means an - exit code of 0, or one of the signals - SIGHUP, - SIGINT, - SIGTERM or - SIGPIPE, and - additionally, exit statuses and - signals specified in - SuccessExitStatus=. - If set to on-failure, - the service will be restarted when the - process exits with a non-zero exit - code, is terminated by a signal - (including on core dump, but excluding - the aforementiond four signals), when - an operation (such as service reload) - times out, and when the configured - watchdog timeout is triggered. If set - to on-abnormal, the - service will be restarted when the - process is terminated by a signal - (including on core dump, excluding the - aforementioned four signals), when an - operation times out, or when the - watchdog timeout is triggered. If set - to on-abort, the - service will be restarted only if the - service process exits due to an - uncaught signal not specified as a - clean exit status. If set to - on-watchdog, the - service will be restarted only if the - watchdog timeout for the service - expires. If set to - always, the service - will be restarted regardless of - whether it exited cleanly or not, got - terminated abnormally by a signal, or - hit a timeout.

Table 1. Exit causes and the effect of the Restart= settings on them

Restart settings/Exit causesnoalwayson-successon-failureon-abnormalon-aborton-watchdog
Clean exit code or signal XX    
Unclean exit code X X   
Unclean signal X XXX 
Timeout X XX  
Watchdog X XX X

As exceptions to the setting - above the service will not be - restarted if the exit code or signal - is specified in - RestartPreventExitStatus= - (see below). Also, the services will - always be restarted if the exit code - or signal is specified in - RestartForceExitStatus= - (see below).

Setting this to - on-failure is the - recommended choice for long-running - services, in order to increase - reliability by attempting automatic - recovery from errors. For services - that shall be able to terminate on - their own choice (and avoid - immediate restarting), - on-abnormal is an - alternative choice.

SuccessExitStatus=¶

Takes a list of exit - status definitions that when returned - by the main service process will be - considered successful termination, in - addition to the normal successful exit - code 0 and the signals SIGHUP, SIGINT, - SIGTERM, and SIGPIPE. Exit status - definitions can either be numeric exit - codes or termination signal names, - separated by spaces. For example: -

SuccessExitStatus=1 2 8 SIGKILL

- ensures that exit codes 1, 2, 8 and - the termination signal - SIGKILL are - considered clean service terminations. -

Note that if a process has a - signal handler installed and exits by - calling - _exit(2) - in response to a signal, the - information about the signal is lost. - Programs should instead perform cleanup and kill themselves with the same signal instead. See - Proper handling of SIGINT/SIGQUIT — How to be a proper program.

This option may appear more than once, - in which case the list of successful - exit statuses is merged. If the empty - string is assigned to this option, the - list is reset, all prior assignments - of this option will have no - effect.

RestartPreventExitStatus=¶

Takes a list of exit - status definitions that when returned - by the main service process will - prevent automatic service restarts, - regardless of the restart setting - configured with - Restart=. Exit - status definitions can either be - numeric exit codes or termination - signal names, and are separated by - spaces. Defaults to the empty list, so - that, by default, no exit status is - excluded from the configured restart - logic. For example: -

RestartPreventExitStatus=1 6 SIGABRT

ensures that exit - codes 1 and 6 and the termination - signal SIGABRT will - not result in automatic service - restarting. This - option may appear more than once, in - which case the list of restart-preventing - statuses is merged. If the empty - string is assigned to this option, the - list is reset and all prior assignments - of this option will have no - effect.

RestartForceExitStatus=¶

Takes a list of exit - status definitions that when returned - by the main service process will force - automatic service restarts, regardless - of the restart setting configured with - Restart=. The - argument format is similar to - RestartPreventExitStatus=.

PermissionsStartOnly=¶

Takes a boolean - argument. If true, the permission-related - execution options, as - configured with - User= and similar - options (see - systemd.exec(5) - for more information), are only applied - to the process started with - ExecStart=, and not - to the various other - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= - commands. If false, the setting is - applied to all configured commands the - same way. Defaults to - false.

RootDirectoryStartOnly=¶

Takes a boolean - argument. If true, the root directory, - as configured with the - RootDirectory= - option (see - systemd.exec(5) - for more information), is only applied - to the process started with - ExecStart=, and not - to the various other - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= - commands. If false, the setting is - applied to all configured commands the - same way. Defaults to - false.

NonBlocking=¶

Set the - O_NONBLOCK flag - for all file descriptors passed via - socket-based activation. If true, all - file descriptors >= 3 (i.e. all except - stdin, stdout, and stderr) will have - the O_NONBLOCK flag - set and hence are in - non-blocking mode. This option is only - useful in conjunction with a socket - unit, as described in - systemd.socket(5). Defaults - to false.

NotifyAccess=¶

Controls access to the - service status notification socket, as - accessible via the - sd_notify(3) - call. Takes one of - none (the default), - main or - all. If - none, no daemon status - updates are accepted from the service - processes, all status update messages - are ignored. If main, - only service updates sent from the - main process of the service are - accepted. If all, all - services updates from all members of - the service's control group are - accepted. This option should be set to - open access to the notification socket - when using - Type=notify or - WatchdogSec= (see - above). If those options are used but - NotifyAccess= is not - configured, it will be implicitly set - to - main.

Sockets=¶

Specifies the name of - the socket units this service shall - inherit socket file descriptors - from when the service is - started. Normally it should not be - necessary to use this setting as all - socket file descriptors whose unit - shares the same name as the service - (subject to the different unit name - suffix of course) are passed to the - spawned process.

Note that the same socket file - descriptors may be passed to multiple - processes simultaneously. Also note - that a different service may be - activated on incoming socket traffic - than the one which is ultimately - configured to inherit the socket file - descriptors. Or in other words: the - Service= setting of - .socket units - does not have to match the inverse of - the Sockets= - setting of the - .service it - refers to.

This option may appear more than - once, in which case the list of socket - units is merged. If the empty string - is assigned to this option, the list of - sockets is reset, and all prior uses of - this setting will have no - effect.

StartLimitInterval=, StartLimitBurst=¶

Configure service - start rate limiting. By default, - services which are started more - than 5 times within 10 seconds are not - permitted to start any more times - until the 10 second interval ends. With - these two options, this rate limiting - may be modified. Use - StartLimitInterval= - to configure the checking interval (defaults to - DefaultStartLimitInterval= in - manager configuration file, set to 0 to disable - any kind of rate limiting). Use - StartLimitBurst= to - configure how many starts per interval - are allowed (defaults to - DefaultStartLimitBurst= in - manager configuration file). These - configuration options are particularly - useful in conjunction with - Restart=; however, - they apply to all kinds of starts - (including manual), not just those - triggered by the - Restart= logic. - Note that units which are configured - for Restart= and - which reach the start limit are not - attempted to be restarted anymore; - however, they may still be restarted - manually at a later point, from which - point on, the restart logic is again - activated. Note that - systemctl - reset-failed will cause the - restart rate counter for a service to - be flushed, which is useful if the - administrator wants to manually start - a service and the start limit - interferes with - that.

StartLimitAction=¶

Configure the action - to take if the rate limit configured - with - StartLimitInterval= - and - StartLimitBurst= is - hit. Takes one of - none, - reboot, - reboot-force, - reboot-immediate, - poweroff, - poweroff-force or - poweroff-immediate. If - none is set, hitting - the rate limit will trigger no action - besides that the start will not be - permitted. reboot - causes a reboot following the normal - shutdown procedure (i.e. equivalent to - systemctl reboot). - reboot-force causes a - forced reboot which will terminate all - processes forcibly but should cause no - dirty file systems on reboot - (i.e. equivalent to systemctl - reboot -f) and - reboot-immediate - causes immediate execution of the - reboot(2) - system call, which might result in - data loss. Similar, - poweroff, - poweroff-force, - poweroff-immediate - have the effect of powering down the - system with similar - semantics. Defaults to - none.

FailureAction=¶

Configure the action - to take when the service enters a failed - state. Takes the same values as - StartLimitAction= - and executes the same actions. - Defaults to none. -

RebootArgument=¶

Configure the optional - argument for the - reboot(2) - system call if - StartLimitAction= - or FailureAction= - is a reboot action. This works just - like the optional argument to - systemctl reboot - command.

Check - systemd.exec(5) - and - systemd.kill(5) - for more settings.

Command lines¶

This section describes command line parsing and - variable and specifier substitions for - ExecStart=, - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= options.

Multiple command lines may be concatenated in a - single directive by separating them with semicolons - (these semicolons must be passed as separate words). - Lone semicolons may be escaped as - "\;".

Each command line is split on whitespace, with - the first item being the command to execute, and the - subsequent items being the arguments. Double quotes - ("...") and single quotes ('...') may be used, in - which case everything until the next matching quote - becomes part of the same argument. Quotes themselves - are removed after parsing. In addition, a trailing - backslash ("\") may be used to merge - lines.

This syntax is intended to be very similar to - shell syntax, but only the meta-characters and - expansions described in the following paragraphs are - understood. Specifically, redirection using - "<", "<<", - ">", and - ">>", pipes using - "|", running programs in the - background using "&", and - other elements of shell syntax are not - supported.

The command line accepts "%" - specifiers as described in - systemd.unit(5). - Note that the first argument of the command line - (i.e. the program to execute) may not include - specifiers.

Basic environment variable substitution is - supported. Use "${FOO}" as part of a - word, or as a word of its own, on the command line, in - which case it will be replaced by the value of the - environment variable including all whitespace it - contains, resulting in a single argument. Use - "$FOO" as a separate word on the - command line, in which case it will be replaced by the - value of the environment variable split at whitespace - resulting in zero or more arguments. For this type of - expansion, quotes and respected when splitting into - words, and afterwards removed.

Example:

Environment="ONE=one" 'TWO=two two'
-ExecStart=/bin/echo $ONE $TWO ${TWO}

This will execute /bin/echo - with four arguments: "one", - "two", "two", and - "two two".

Example:

Environment=ONE='one' "TWO='two two' too" THREE=
+  gudev systemd 219

Name

systemd.service — Service unit configuration

Synopsis

service.service

Description¶

A unit configuration file whose name ends in + .service encodes information about a process + controlled and supervised by systemd.

This man page lists the configuration options specific to + this unit type. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic + "[Unit]" and "[Install]" + sections. The service specific configuration options are + configured in the "[Service]" section.

Additional options are listed in + systemd.exec(5), + which define the execution environment the commands are executed + in, and in + systemd.kill(5), + which define the way the processes of the service are terminated, + and in + systemd.resource-control(5), + which configure resource control settings for the processes of the + service.

Unless DefaultDependencies= is set to + false, service units will implicitly have + dependencies of type Requires= and + After= on basic.target as + well as dependencies of type Conflicts= and + Before= on + shutdown.target. These ensure that normal + service units pull in basic system initialization, and are + terminated cleanly prior to system shutdown. Only services + involved with early boot or late system shutdown should disable + this option.

If a service is requested under a certain name but no unit + configuration file is found, systemd looks for a SysV init script + by the same name (with the .service suffix + removed) and dynamically creates a service unit from that script. + This is useful for compatibility with SysV. Note that this + compatibility is quite comprehensive but not 100%. For details + about the incompatibilities, see the Incompatibilities + with SysV document. +

Options¶

Service files must include a "[Service]" + section, which carries information about the service and the + process it supervises. A number of options that may be used in + this section are shared with other unit types. These options are + documented in + systemd.exec(5) + and + systemd.kill(5). + The options specific to the "[Service]" section + of service units are the following:

Type=¶

Configures the process start-up type for this + service unit. One of + simple, + forking, + oneshot, + dbus, + notify or + idle.

If set to simple (the default if + neither Type= nor + BusName=, but ExecStart= + are specified), it is expected that the process configured + with ExecStart= is the main process of the + service. In this mode, if the process offers functionality to + other processes on the system, its communication channels + should be installed before the daemon is started up (e.g. + sockets set up by systemd, via socket activation), as systemd + will immediately proceed starting follow-up units.

If set to forking, it is expected that + the process configured with ExecStart= will + call fork() as part of its start-up. The + parent process is expected to exit when start-up is complete + and all communication channels are set up. The child continues + to run as the main daemon process. This is the behavior of + traditional UNIX daemons. If this setting is used, it is + recommended to also use the PIDFile= + option, so that systemd can identify the main process of the + daemon. systemd will proceed with starting follow-up units as + soon as the parent process exits.

Behavior of oneshot is similar to + simple; however, it is expected that the + process has to exit before systemd starts follow-up units. + RemainAfterExit= is particularly useful for + this type of service. This is the implied default if neither + Type= or ExecStart= are + specified.

Behavior of dbus is similar to + simple; however, it is expected that the + daemon acquires a name on the D-Bus bus, as configured by + BusName=. systemd will proceed with + starting follow-up units after the D-Bus bus name has been + acquired. Service units with this option configured implicitly + gain dependencies on the dbus.socket + unit. This type is the default if BusName= + is specified.

Behavior of notify is similar to + simple; however, it is expected that the + daemon sends a notification message via + sd_notify(3) + or an equivalent call when it has finished starting up. + systemd will proceed with starting follow-up units after this + notification message has been sent. If this option is used, + NotifyAccess= (see below) should be set to + open access to the notification socket provided by systemd. If + NotifyAccess= is not set, it will be + implicitly set to main. Note that currently + Type=notify will not work + if used in combination with + PrivateNetwork=yes.

Behavior of idle is very similar to + simple; however, actual execution of the + service binary is delayed until all jobs are dispatched. This + may be used to avoid interleaving of output of shell services + with the status output on the console.

RemainAfterExit=¶

Takes a boolean value that specifies whether + the service shall be considered active even when all its + processes exited. Defaults to no.

GuessMainPID=¶

Takes a boolean value that specifies whether + systemd should try to guess the main PID of a service if it + cannot be determined reliably. This option is ignored unless + Type=forking is set and + PIDFile= is unset because for the other types + or with an explicitly configured PID file, the main PID is + always known. The guessing algorithm might come to incorrect + conclusions if a daemon consists of more than one process. If + the main PID cannot be determined, failure detection and + automatic restarting of a service will not work reliably. + Defaults to yes.

PIDFile=¶

Takes an absolute file name pointing to the + PID file of this daemon. Use of this option is recommended for + services where Type= is set to + forking. systemd will read the PID of the + main process of the daemon after start-up of the service. + systemd will not write to the file configured here.

BusName=¶

Takes a D-Bus bus name that this service is + reachable as. This option is mandatory for services where + Type= is set to + dbus.

BusPolicy=¶

If specified, a custom + kdbus + endpoint will be created and installed as the default bus node + for the service. Such a custom endpoint can hold an own set of + policy rules that are enforced on top of the bus-wide ones. + The custom endpoint is named after the service it was created + for, and its node will be bind-mounted over the default bus + node location, so the service can only access the bus through + its own endpoint. Note that custom bus endpoints default to a + 'deny all' policy. Hence, if at least one + BusPolicy= directive is given, you have to + make sure to add explicit rules for everything the service + should be able to do.

The value of this directive is comprised + of two parts; the bus name, and a verb to + specify to granted access, which is one of + see, + talk, or + own. + talk implies + see, and own + implies both talk and + see. + If multiple access levels are specified for the + same bus name, the most powerful one takes + effect. +

Examples:

BusPolicy=org.freedesktop.systemd1 talk
BusPolicy=org.foo.bar see

This option is only available on kdbus enabled systems.

ExecStart=¶

Commands with their arguments that are + executed when this service is started. The value is split into + zero or more command lines is according to the rules described + below (see section "Command Lines" below). +

When Type is not + oneshot, only one command may and must be + given. When Type=oneshot is used, zero or + more commands may be specified. This can be specified by + providing multiple command lines in the same directive, or + alternatively, this directive may be specified more than once + with the same effect. If the empty string is assigned to this + option, the list of commands to start is reset, prior + assignments of this option will have no effect. If no + ExecStart= is specified, then the service + must have RemainAfterExit=yes set.

For each of the specified commands, the first argument + must be an absolute path to an executable. Optionally, if this + file name is prefixed with "@", the second + token will be passed as "argv[0]" to the + executed process, followed by the further arguments specified. + If the absolute filename is prefixed with + "-", an exit code of the command normally + considered a failure (i.e. non-zero exit status or abnormal + exit due to signal) is ignored and considered success. If both + "-" and "@" are used, they + can appear in either order.

If more than one command is specified, the commands are + invoked sequentially in the order they appear in the unit + file. If one of the commands fails (and is not prefixed with + "-"), other lines are not executed, and the + unit is considered failed.

Unless Type=forking is set, the + process started via this command line will be considered the + main process of the daemon.

ExecStartPre=, ExecStartPost=¶

Additional commands that are executed before + or after the command in ExecStart=, + respectively. Syntax is the same as for + ExecStart=, except that multiple command + lines are allowed and the commands are executed one after the + other, serially.

If any of those commands (not prefixed with + "-") fail, the rest are not executed and the + unit is considered failed.

ExecReload=¶

Commands to execute to trigger a configuration + reload in the service. This argument takes multiple command + lines, following the same scheme as described for + ExecStart= above. Use of this setting is + optional. Specifier and environment variable substitution is + supported here following the same scheme as for + ExecStart=.

One additional, special environment variable is set: if + known, $MAINPID is set to the main process + of the daemon, and may be used for command lines like the + following:

/bin/kill -HUP $MAINPID

Note however that reloading a daemon by sending a signal + (as with the example line above) is usually not a good choice, + because this is an asynchronous operation and hence not + suitable to order reloads of multiple services against each + other. It is strongly recommended to set + ExecReload= to a command that not only + triggers a configuration reload of the daemon, but also + synchronously waits for it to complete.

ExecStop=¶

Commands to execute to stop the service + started via ExecStart=. This argument takes + multiple command lines, following the same scheme as described + for ExecStart= above. Use of this setting + is optional. After the commands configured in this option are + run, all processes remaining for a service are terminated + according to the KillMode= setting (see + systemd.kill(5)). + If this option is not specified, the process is terminated + immediately when service stop is requested. Specifier and + environment variable substitution is supported (including + $MAINPID, see above).

ExecStopPost=¶

Additional commands that are executed after + the service was stopped. This includes cases where the + commands configured in ExecStop= were used, + where the service does not have any + ExecStop= defined, or where the service + exited unexpectedly. This argument takes multiple command + lines, following the same scheme as described for + ExecStart. Use of these settings is + optional. Specifier and environment variable substitution is + supported.

RestartSec=¶

Configures the time to sleep before restarting + a service (as configured with Restart=). + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Defaults to 100ms.

TimeoutStartSec=¶

Configures the time to wait for start-up. If a + daemon service does not signal start-up completion within the + configured time, the service will be considered failed and + will be shut down again. Takes a unit-less value in seconds, + or a time span value such as "5min 20s". Pass + "0" to disable the timeout logic. Defaults to + DefaultTimeoutStartSec= from the manager + configuration file, except when + Type=oneshot is used, in which case the + timeout is disabled by default (see + systemd-system.conf(5)). +

TimeoutStopSec=¶

Configures the time to wait for stop. If a + service is asked to stop, but does not terminate in the + specified time, it will be terminated forcibly via + SIGTERM, and after another timeout of + equal duration with SIGKILL (see + KillMode= in + systemd.kill(5)). + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass "0" to disable the + timeout logic. Defaults to + DefaultTimeoutStopSec= from the manager + configuration file (see + systemd-system.conf(5)). +

TimeoutSec=¶

A shorthand for configuring both + TimeoutStartSec= and + TimeoutStopSec= to the specified value. +

WatchdogSec=¶

Configures the watchdog timeout for a service. + The watchdog is activated when the start-up is completed. The + service must call + sd_notify(3) + regularly with "WATCHDOG=1" (i.e. the + "keep-alive ping"). If the time between two such calls is + larger than the configured time, then the service is placed in + a failed state and it will be terminated with + SIGABRT. By setting + Restart= to on-failure or + always, the service will be automatically + restarted. The time configured here will be passed to the + executed service process in the + WATCHDOG_USEC= environment variable. This + allows daemons to automatically enable the keep-alive pinging + logic if watchdog support is enabled for the service. If this + option is used, NotifyAccess= (see below) + should be set to open access to the notification socket + provided by systemd. If NotifyAccess= is + not set, it will be implicitly set to main. + Defaults to 0, which disables this feature.

Restart=¶

Configures whether the service shall be + restarted when the service process exits, is killed, or a + timeout is reached. The service process may be the main + service process, but it may also be one of the processes + specified with ExecStartPre=, + ExecStartPost=, + ExecStop=, + ExecStopPost=, or + ExecReload=. When the death of the process + is a result of systemd operation (e.g. service stop or + restart), the service will not be restarted. Timeouts include + missing the watchdog "keep-alive ping" deadline and a service + start, reload, and stop operation timeouts.

Takes one of + no, + on-success, + on-failure, + on-abnormal, + on-watchdog, + on-abort, or + always. + If set to no (the default), the service will + not be restarted. If set to on-success, it + will be restarted only when the service process exits cleanly. + In this context, a clean exit means an exit code of 0, or one + of the signals + SIGHUP, + SIGINT, + SIGTERM or + SIGPIPE, and + additionally, exit statuses and signals specified in + SuccessExitStatus=. If set to + on-failure, the service will be restarted + when the process exits with a non-zero exit code, is + terminated by a signal (including on core dump, but excluding + the aforementiond four signals), when an operation (such as + service reload) times out, and when the configured watchdog + timeout is triggered. If set to on-abnormal, + the service will be restarted when the process is terminated + by a signal (including on core dump, excluding the + aforementioned four signals), when an operation times out, or + when the watchdog timeout is triggered. If set to + on-abort, the service will be restarted only + if the service process exits due to an uncaught signal not + specified as a clean exit status. If set to + on-watchdog, the service will be restarted + only if the watchdog timeout for the service expires. If set + to always, the service will be restarted + regardless of whether it exited cleanly or not, got terminated + abnormally by a signal, or hit a timeout.

Table 1. Exit causes and the effect of the Restart= settings on them

Restart settings/Exit causesnoalwayson-successon-failureon-abnormalon-aborton-watchdog
Clean exit code or signal XX    
Unclean exit code X X   
Unclean signal X XXX 
Timeout X XX  
Watchdog X XX X

As exceptions to the setting above the service will not + be restarted if the exit code or signal is specified in + RestartPreventExitStatus= (see below). + Also, the services will always be restarted if the exit code + or signal is specified in + RestartForceExitStatus= (see below).

Setting this to on-failure is the + recommended choice for long-running services, in order to + increase reliability by attempting automatic recovery from + errors. For services that shall be able to terminate on their + own choice (and avoid immediate restarting), + on-abnormal is an alternative choice.

SuccessExitStatus=¶

Takes a list of exit status definitions that + when returned by the main service process will be considered + successful termination, in addition to the normal successful + exit code 0 and the signals SIGHUP, + SIGINT, SIGTERM, and + SIGPIPE. Exit status definitions can + either be numeric exit codes or termination signal names, + separated by spaces. For example: +

SuccessExitStatus=1 2 8
+        SIGKILL

ensures that exit codes 1, 2, 8 and + the termination signal SIGKILL are + considered clean service terminations. +

Note that if a process has a signal handler installed + and exits by calling + _exit(2) + in response to a signal, the information about the signal is + lost. Programs should instead perform cleanup and kill + themselves with the same signal instead. See + Proper + handling of SIGINT/SIGQUIT — How to be a proper + program.

This option may appear more than once, in which case the + list of successful exit statuses is merged. If the empty + string is assigned to this option, the list is reset, all + prior assignments of this option will have no + effect.

RestartPreventExitStatus=¶

Takes a list of exit status definitions that + when returned by the main service process will prevent + automatic service restarts, regardless of the restart setting + configured with Restart=. Exit status + definitions can either be numeric exit codes or termination + signal names, and are separated by spaces. Defaults to the + empty list, so that, by default, no exit status is excluded + from the configured restart logic. For example: +

RestartPreventExitStatus=1 6
+        SIGABRT

ensures that exit codes 1 and 6 and + the termination signal SIGABRT will not + result in automatic service restarting. This option may appear + more than once, in which case the list of restart-preventing + statuses is merged. If the empty string is assigned to this + option, the list is reset and all prior assignments of this + option will have no effect.

RestartForceExitStatus=¶

Takes a list of exit status definitions that + when returned by the main service process will force automatic + service restarts, regardless of the restart setting configured + with Restart=. The argument format is + similar to + RestartPreventExitStatus=.

PermissionsStartOnly=¶

Takes a boolean argument. If true, the + permission-related execution options, as configured with + User= and similar options (see + systemd.exec(5) + for more information), are only applied to the process started + with + ExecStart=, and not to the various other + ExecStartPre=, + ExecStartPost=, + ExecReload=, + ExecStop=, and + ExecStopPost= + commands. If false, the setting is applied to all configured + commands the same way. Defaults to false.

RootDirectoryStartOnly=¶

Takes a boolean argument. If true, the root + directory, as configured with the + RootDirectory= option (see + systemd.exec(5) + for more information), is only applied to the process started + with ExecStart=, and not to the various + other ExecStartPre=, + ExecStartPost=, + ExecReload=, ExecStop=, + and ExecStopPost= commands. If false, the + setting is applied to all configured commands the same way. + Defaults to false.

NonBlocking=¶

Set the O_NONBLOCK flag + for all file descriptors passed via socket-based activation. + If true, all file descriptors >= 3 (i.e. all except stdin, + stdout, and stderr) will have the + O_NONBLOCK flag set and hence are in + non-blocking mode. This option is only useful in conjunction + with a socket unit, as described in + systemd.socket(5). + Defaults to false.

NotifyAccess=¶

Controls access to the service status + notification socket, as accessible via the + sd_notify(3) + call. Takes one of none (the default), + main or all. If + none, no daemon status updates are accepted + from the service processes, all status update messages are + ignored. If main, only service updates sent + from the main process of the service are accepted. If + all, all services updates from all members of + the service's control group are accepted. This option should + be set to open access to the notification socket when using + Type=notify or + WatchdogSec= (see above). If those options + are used but NotifyAccess= is not + configured, it will be implicitly set to + main.

Sockets=¶

Specifies the name of the socket units this + service shall inherit socket file descriptors from when the + service is started. Normally it should not be necessary to use + this setting as all socket file descriptors whose unit shares + the same name as the service (subject to the different unit + name suffix of course) are passed to the spawned + process.

Note that the same socket file descriptors may be passed + to multiple processes simultaneously. Also note that a + different service may be activated on incoming socket traffic + than the one which is ultimately configured to inherit the + socket file descriptors. Or in other words: the + Service= setting of + .socket units does not have to match the + inverse of the Sockets= setting of the + .service it refers to.

This option may appear more than once, in which case the + list of socket units is merged. If the empty string is + assigned to this option, the list of sockets is reset, and all + prior uses of this setting will have no + effect.

StartLimitInterval=, StartLimitBurst=¶

Configure service start rate limiting. By + default, services which are started more than 5 times within + 10 seconds are not permitted to start any more times until the + 10 second interval ends. With these two options, this rate + limiting may be modified. Use + StartLimitInterval= to configure the + checking interval (defaults to + DefaultStartLimitInterval= in manager + configuration file, set to 0 to disable any kind of rate + limiting). Use StartLimitBurst= to + configure how many starts per interval are allowed (defaults + to DefaultStartLimitBurst= in manager + configuration file). These configuration options are + particularly useful in conjunction with + Restart=; however, they apply to all kinds + of starts (including manual), not just those triggered by the + Restart= logic. Note that units which are + configured for Restart= and which reach the + start limit are not attempted to be restarted anymore; + however, they may still be restarted manually at a later + point, from which point on, the restart logic is again + activated. Note that systemctl reset-failed + will cause the restart rate counter for a service to be + flushed, which is useful if the administrator wants to + manually start a service and the start limit interferes with + that.

StartLimitAction=¶

Configure the action to take if the rate limit + configured with StartLimitInterval= and + StartLimitBurst= is hit. Takes one of + none, + reboot, + reboot-force, + reboot-immediate, + poweroff, + poweroff-force or + poweroff-immediate. If + none is set, hitting the rate limit will + trigger no action besides that the start will not be + permitted. reboot causes a reboot following + the normal shutdown procedure (i.e. equivalent to + systemctl reboot). + reboot-force causes a forced reboot which + will terminate all processes forcibly but should cause no + dirty file systems on reboot (i.e. equivalent to + systemctl reboot -f) and + reboot-immediate causes immediate execution + of the + reboot(2) + system call, which might result in data loss. Similar, + poweroff, poweroff-force, + poweroff-immediate have the effect of + powering down the system with similar semantics. Defaults to + none.

FailureAction=¶

Configure the action to take when the service + enters a failed state. Takes the same values as + StartLimitAction= and executes the same + actions. Defaults to none.

RebootArgument=¶

Configure the optional argument for the + reboot(2) + system call if StartLimitAction= or + FailureAction= is a reboot action. This + works just like the optional argument to systemctl + reboot command.

FileDescriptorStoreMax=¶

Configure how many file descriptors may be + stored in the service manager for the service using + sd_pid_notify_with_fds(3)'s + "FDSTORE=1" messages. This is useful for + implementing service restart schemes where the state is + serialized to /run and the file + descriptors passed to the service manager, to allow restarts + without losing state. Defaults to 0, i.e. no file descriptors + may be stored in the service manager by default. All file + descriptors passed to the service manager from a specific + service are passed back to the service's main process on the + next service restart. Any file descriptors passed to the + service manager are automatically closed when POLLHUP or + POLLERR is seen on them, or when the service is fully stopped + and no job queued or being executed for it.

Check + systemd.exec(5) + and + systemd.kill(5) + for more settings.

Command lines¶

This section describes command line parsing and + variable and specifier substitions for + ExecStart=, + ExecStartPre=, + ExecStartPost=, + ExecReload=, + ExecStop=, and + ExecStopPost= options.

Multiple command lines may be concatenated in a single + directive by separating them with semicolons (these semicolons + must be passed as separate words). Lone semicolons may be escaped + as "\;".

Each command line is split on whitespace, with the first + item being the command to execute, and the subsequent items being + the arguments. Double quotes ("...") and single quotes ('...') may + be used, in which case everything until the next matching quote + becomes part of the same argument. C-style escapes are also + supported, see table below. Quotes themselves are removed after + parsing and escape sequences substituted. In addition, a trailing + backslash ("\") may be used to merge lines. +

This syntax is intended to be very similar to shell syntax, + but only the meta-characters and expansions described in the + following paragraphs are understood. Specifically, redirection + using + "<", + "<<", + ">", and + ">>", pipes using + "|", running programs in the background using + "&", and other elements of shell + syntax are not supported.

The command to execute must an absolute path name. It may + contain spaces, but control characters are not allowed.

The command line accepts "%" specifiers as + described in + systemd.unit(5). + Note that the first argument of the command line (i.e. the program + to execute) may not include specifiers.

Basic environment variable substitution is supported. Use + "${FOO}" as part of a word, or as a word of its + own, on the command line, in which case it will be replaced by the + value of the environment variable including all whitespace it + contains, resulting in a single argument. Use + "$FOO" as a separate word on the command line, in + which case it will be replaced by the value of the environment + variable split at whitespace resulting in zero or more arguments. + For this type of expansion, quotes and respected when splitting + into words, and afterwards removed.

Example:

Environment="ONE=one" 'TWO=two two'
+ExecStart=/bin/echo $ONE $TWO ${TWO}

This will execute /bin/echo with four + arguments: "one", "two", + "two", and "two two".

Example:

Environment=ONE='one' "TWO='two two' too" THREE=
 ExecStart=/bin/echo ${ONE} ${TWO} ${THREE}
 ExecStart=/bin/echo $ONE $TWO $THREE

This results in echo being - called twice, the first time with arguments - "'one'", - "'two two' too", "", - and the second time with arguments - "one", "two two", - "too". -

To pass a literal dollar sign, use - "$$". Variables whose value is not - known at expansion time are treated as empty - strings. Note that the first argument (i.e. the - program to execute) may not be a variable.

Variables to be used in this fashion may be - defined through Environment= and - EnvironmentFile=. In addition, - variables listed in the section "Environment variables - in spawned processes" in - systemd.exec(5), - which are considered "static configuration", may be - used (this includes e.g. $USER, but - not $TERM).

Note that shell command lines are not directly - supported. If shell command lines are to be used, they - need to be passed explicitly to a shell implementation - of some kind. Example:

ExecStart=/bin/sh -c 'dmesg | tac'

Example:

ExecStart=/bin/echo one ; /bin/echo "two two"

This will execute /bin/echo - two times, each time with one argument: - "one" and "two two", - respectively. Because two commands are specified, - Type=oneshot must be used.

Example:

ExecStart=/bin/echo / >/dev/null & \; \
+    called twice, the first time with arguments
+    "'one'",
+    "'two two' too", "",
+    and the second time with arguments
+    "one", "two two",
+    "too".
+    

To pass a literal dollar sign, use "$$". + Variables whose value is not known at expansion time are treated + as empty strings. Note that the first argument (i.e. the program + to execute) may not be a variable.

Variables to be used in this fashion may be defined through + Environment= and + EnvironmentFile=. In addition, variables listed + in the section "Environment variables in spawned processes" in + systemd.exec(5), + which are considered "static configuration", may be used (this + includes e.g. $USER, but not + $TERM).

Note that shell command lines are not directly supported. If + shell command lines are to be used, they need to be passed + explicitly to a shell implementation of some kind. Example:

ExecStart=/bin/sh -c 'dmesg | tac'

Example:

ExecStart=/bin/echo one ; /bin/echo "two two"

This will execute /bin/echo two times, + each time with one argument: "one" and + "two two", respectively. Because two commands are + specified, Type=oneshot must be used.

Example:

ExecStart=/bin/echo / >/dev/null & \; \
 /bin/ls

This will execute /bin/echo - with five arguments: "/", - ">/dev/null", - "&", ";", and - "/bin/ls".

+ with five arguments: "/", + ">/dev/null", + "&", ";", and + "/bin/ls".

Table 2. C escapes supported in command lines and environment variables

LiteralActual value
"\a"bell
"\b"backspace
"\f"form feed
"\n"newline
"\r"carriage return
"\t"tab
"\v"vertical tab
"\\"backslash
"\""double quotation mark
"\'"single quotation mark
"\s"space
"\xxx"character number xx in hexadecimal encoding
"\nnn"character number nnn in octal encoding

Examples¶

Example 1. Simple service

The following unit file creates a service that will + execute /usr/sbin/foo-daemon. Since no + Type= is specified, the default + Type=simple will be assumed. + systemd will assume the unit to be started immediately after the + program has begun executing.

[Unit]
+Description=Foo
+
+[Service]
+ExecStart=/usr/sbin/foo-daemon
+
+[Install]
+WantedBy=multi-user.target

Note that systemd assumes here that the process started by + systemd will continue running until the service terminates. If + the program daemonizes itself (i.e. forks), please use + Type=forking instead.

Since no ExecStop= was specified, + systemd will send SIGTERM to all processes started from this + service, and after a timeout also SIGKILL. This behavior can be + modified, see + systemd.kill(5) + for details.

Note that this unit type does not include any type of + notification when a service has completed initialization. For + this, you should use other unit types, such as + Type=notify if the service + understands systemd's notification protocol, + Type=forking if the service + can background itself or + Type=dbus if the unit + acquires a DBus name once initialization is complete. See + below.


Example 2. Oneshot service

Sometimes units should just execute an action without + keeping active processes, such as a filesystem check or a + cleanup action on boot. For this, + Type=oneshot exists. Units + of this type will wait until the process specified terminates + and then fall back to being inactive. The following unit will + perform a clenaup action:

[Unit]
+Description=Cleanup old Foo data
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/foo-cleanup
+
+[Install]
+WantedBy=multi-user.target

Note that systemd will consider the unit to be in the + state 'starting' until the program has terminated, so ordered + dependencies will wait for the program to finish before starting + themselves. The unit will revert to the 'inactive' state after + the execution is done, never reaching the 'active' state. That + means another request to start the unit will perform the action + again.

Type=oneshot are the + only service units that may have more than one + ExecStart= specified. They will be executed + in order until either they are all successful or one of them + fails.


Example 3. Stoppable oneshot service

Similarly to the oneshot services, there are sometimes + units that need to execute a program to set up something and + then execute another to shut it down, but no process remains + active while they are considered 'started'. Network + configuration can sometimes fall into this category. Another use + case is if a oneshot service shall not be executed a each time + when they are pulled in as a dependency, but only the first + time.

For this, systemd knows the setting + RemainAfterExit=yes, which + causes systemd to consider the unit to be active if the start + action exited successfully. This directive can be used with all + types, but is most useful with + Type=oneshot and + Type=simple. With + Type=oneshot systemd waits + until the start action has completed before it considers the + unit to be active, so dependencies start only after the start + action has succeeded. With + Type=simple dependencies + will start immediately after the start action has been + dispatched. The following unit provides an example for a simple + static firewall.

[Unit]
+Description=Simple firewall
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/local/sbin/simple-firewall-start
+ExecStop=/usr/local/sbin/simple-firewall-stop
+
+[Install]
+WantedBy=multi-user.target

Since the unit is considered to be running after the start + action has exited, invoking systemctl start + on that unit again will cause no action to be taken.


Example 4. Traditional forking services

Many traditional daemons/services background (i.e. fork, + daemonize) themselves when starting. Set + Type=forking in the + service's unit file to support this mode of operation. systemd + will consider the service to be in the process of initialization + while the original program is still running. Once it exits + successfully and at least a process remains (and + RemainAfterExit=no), the + service is considered started.

Often a traditional daemon only consists of one process. + Therefore, if only one process is left after the original + process terminates, systemd will consider that process the main + process of the service. In that case, the + $MAINPID variable will be available in + ExecReload=, ExecStop=, + etc.

In case more than one process remains, systemd will be + unable to determine the main process, so it will not assume + there is one. In that case, $MAINPID will not + expand to anything. However, if the process decides to write a + traditional PID file, systemd will be able to read the main PID + from there. Please set PIDFile= accordingly. + Note that the daemon should write that file before finishing + with its initialization, otherwise systemd might try to read the + file before it exists.

The following example shows a simple daemon that forks and + just starts one process in the background:

[Unit]
+Description=Some simple daemon
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/my-simple-daemon -d
+
+[Install]
+WantedBy=multi-user.target

Please see + systemd.kill(5) + for details on how you can influence the way systemd terminates + the service.


Example 5. DBus services

For services that acquire a name on the DBus system bus, + use Type=dbus and set + BusName= accordingly. The service should not + fork (daemonize). systemd will consider the service to be + initialized once the name has been acquired on the system bus. + The following example shows a typical DBus service:

[Unit]
+Description=Simple DBus service
+
+[Service]
+Type=dbus
+BusName=org.example.simple-dbus-service
+ExecStart=/usr/sbin/simple-dbus-service
+
+[Install]
+WantedBy=multi-user.target

For bus-activatable services, don't + include a "[Install]" section in the systemd + service file, but use the SystemdService= + option in the corresponding DBus service file, for example + (/usr/share/dbus-1/system-services/org.example.simple-dbus-service.service):

[D-BUS Service]
+Name=org.example.simple-dbus-service
+Exec=/usr/sbin/simple-dbus-service
+User=root
+SystemdService=simple-dbus-service.service

Please see + systemd.kill(5) + for details on how you can influence the way systemd terminates + the service.


Example 6. Services that notify systemd about their initialization

Type=simple services + are really easy to write, but have the major disadvantage of + systemd not being able to tell when initialization of the given + service is complete. For this reason, systemd supports a simple + notification protocol that allows daemons to make systemd aware + that they are done initializing. Use + Type=notify for this. A + typical service file for such a daemon would look like + this:

[Unit]
+Description=Simple notifying service
+
+[Service]
+Type=notify
+ExecStart=/usr/sbin/simple-notifying-service
+
+[Install]
+WantedBy=multi-user.target

Note that the daemon has to support systemd's notification + protocol, else systemd will think the service hasn't started yet + and kill it after a timeout. For an example of how to update + daemons to support this protocol transparently, take a look at + sd_notify(3). + systemd will consider the unit to be in the 'starting' state + until a readiness notification has arrived.

Please see + systemd.kill(5) + for details on how you can influence the way systemd terminates + the service.


diff --git a/man/systemd.service.xml b/man/systemd.service.xml index da9079cbb..c03b4e8a5 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.service - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.service - 5 - - - - systemd.service - Service unit configuration - - - - service.service - - - - Description - - A unit configuration file whose name ends in - .service encodes information - about a process controlled and supervised by - systemd. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and - [Install] sections. The service - specific configuration options are configured in the - [Service] section. - - Additional options are listed in - systemd.exec5, - which define the execution environment the commands - are executed in, and in - systemd.kill5, - which define the way the processes of the service are - terminated, and in - systemd.resource-control5, - which configure resource control settings for the - processes of the service. - - Unless DefaultDependencies= - is set to , service units will - implicitly have dependencies of type - Requires= and - After= on - basic.target as well as - dependencies of type Conflicts= and - Before= on - shutdown.target. These ensure - that normal service units pull in basic system - initialization, and are terminated cleanly prior to - system shutdown. Only services involved with early - boot or late system shutdown should disable this - option. - - If a service is requested under a certain name - but no unit configuration file is found, systemd looks - for a SysV init script by the same name (with the - .service suffix removed) and - dynamically creates a service unit from that - script. This is useful for compatibility with - SysV. Note that this compatibility is quite - comprehensive but not 100%. For details about the - incompatibilities, see the Incompatibilities - with SysV document. - - - - - Options - - Service files must include a - [Service] section, which carries - information about the service and the process it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec5 - and - systemd.kill5. The - options specific to the [Service] - section of service units are the following: - - - - Type= - - Configures the process - start-up type for this service - unit. One of , - , - , - , - or - . - - If set to - (the default - if neither - Type= nor - BusName=, but - ExecStart= are - specified), it is expected that the - process configured with - ExecStart= is the - main process of the service. In this - mode, if the process offers - functionality to other processes on - the system, its communication channels - should be installed before the daemon - is started up (e.g. sockets set up by - systemd, via socket activation), as - systemd will immediately proceed - starting follow-up units. - - If set to - , it is - expected that the process configured - with ExecStart= - will call fork() - as part of its start-up. The parent process is - expected to exit when start-up is - complete and all communication - channels are set up. The child continues - to run as the main daemon - process. This is the behavior of - traditional UNIX daemons. If this - setting is used, it is recommended to - also use the - PIDFile= option, so - that systemd can identify the main - process of the daemon. systemd will - proceed with starting follow-up units - as soon as the parent process - exits. - - Behavior of - is similar to - ; however, it - is expected that the process has to - exit before systemd starts follow-up - units. RemainAfterExit= - is particularly useful for this type - of service. This is the implied - default if neither - Type= or - ExecStart= are - specified. - - Behavior of - is similar to - ; however, it is - expected that the daemon acquires a - name on the D-Bus bus, as configured - by - BusName=. systemd - will proceed with starting follow-up - units after the D-Bus bus name has been - acquired. Service units with this - option configured implicitly gain - dependencies on the - dbus.socket - unit. This type is the default if - BusName= is - specified. - - Behavior of - is similar to - ; however, it is - expected that the daemon sends a - notification message via - sd_notify3 - or an equivalent call when it has finished - starting up. systemd will proceed with - starting follow-up units after this - notification message has been sent. If - this option is used, - NotifyAccess= (see - below) should be set to open access to - the notification socket provided by - systemd. If - NotifyAccess= is - not set, it will be implicitly set to - . Note that - currently - Type= - will not work if used in combination with - PrivateNetwork=. - - Behavior of - is very similar - to ; however, - actual execution of the service - binary is delayed until all jobs are - dispatched. This may be used to avoid - interleaving of output of shell - services with the status output on the - console. - - - - - RemainAfterExit= - - Takes a boolean value - that specifies whether the service - shall be considered active even when - all its processes exited. Defaults to - . - - - - - GuessMainPID= - - Takes a boolean value - that specifies whether systemd should - try to guess the main PID of a service - if it cannot be determined - reliably. This option is ignored - unless - is set and - is unset because for the other types - or with an explicitly configured PID - file, the main PID is always known. The - guessing algorithm might come to - incorrect conclusions if a daemon - consists of more than one process. If - the main PID cannot be determined, - failure detection and automatic - restarting of a service will not work - reliably. Defaults to - . - - - - - PIDFile= - - Takes an absolute file - name pointing to the PID file of this - daemon. Use of this option is - recommended for services where - Type= is set to - . systemd will - read the PID of the main process of - the daemon after start-up of the - service. systemd will not write to the - file configured here. - - - - - BusName= - - Takes a D-Bus bus - name that this service is reachable - as. This option is mandatory for - services where - Type= is set to - . - - - - - BusPolicy= - - If specified, a custom - kdbus - endpoint will be created and installed as the - default bus node for the service. Such a custom - endpoint can hold an own set of policy rules - that are enforced on top of the bus-wide ones. - The custom endpoint is named after the service - it was created for, and its node will be - bind-mounted over the default bus node - location, so the service can only access the - bus through its own endpoint. Note that custom - bus endpoints default to a 'deny all' policy. - Hence, if at least one - BusPolicy= directive is - given, you have to make sure to add explicit - rules for everything the service should be able - to do. - The value of this directive is comprised - of two parts; the bus name, and a verb to - specify to granted access, which is one of - , - , or - . - implies - , and - implies both and - . - If multiple access levels are specified for the - same bus name, the most powerful one takes - effect. - - Examples: - BusPolicy=org.freedesktop.systemd1 talk - BusPolicy=org.foo.bar see - This option is only available on kdbus enabled systems. - - - - - ExecStart= - Commands with their - arguments that are executed when this - service is started. The value is split - into zero or more command lines is - according to the rules described below - (see section "Command Lines" below). - - - When Type is - not , only one - command may and must be given. When - Type=oneshot is - used, zero or more commands may be - specified. This can be specified by - providing multiple command lines in - the same directive, or alternatively, - this directive may be specified more - than once with the same effect. If the - empty string is assigned to this - option, the list of commands to start - is reset, prior assignments of this - option will have no effect. If no - ExecStart= is - specified, then the service must have - RemainAfterExit=yes - set. - - For each of the specified - commands, the first argument must be - an absolute and literal path to an - executable. Optionally, if the - absolute file name is prefixed with - @, the second token - will be passed as - argv[0] to the - executed process, followed by the - further arguments specified. If the - absolute filename is prefixed with - -, an exit code of - the command normally considered a - failure (i.e. non-zero exit status or - abnormal exit due to signal) is - ignored and considered success. If - both - and - @ are used, they - can appear in either order. - - If more than one command is - specified, the commands are invoked - sequentially in the order they appear - in the unit file. If one of the - commands fails (and is not prefixed - with -), other - lines are not executed, and the unit - is considered failed. - - Unless - Type=forking is - set, the process started via this - command line will be considered the - main process of the daemon. - - - - - - ExecStartPre= - ExecStartPost= - Additional commands - that are executed before or after - the command in - ExecStart=, respectively. - Syntax is the same as for - ExecStart=, except - that multiple command lines are allowed - and the commands are executed one - after the other, serially. - - If any of those commands (not - prefixed with -) - fail, the rest are not executed and - the unit is considered failed. - - - - - ExecReload= - Commands to execute to - trigger a configuration reload in the - service. This argument takes multiple - command lines, following the same - scheme as described for - ExecStart= - above. Use of this setting is - optional. Specifier and environment - variable substitution is supported - here following the same scheme as for - ExecStart=. - - One additional, special - environment variable is set: if known, - $MAINPID is set to - the main process of the daemon, and - may be used for command lines like the - following: - - /bin/kill -HUP $MAINPID - - Note however that reloading a - daemon by sending a signal (as with - the example line above) is usually not - a good choice, because this is an - asynchronous operation and hence not - suitable to order reloads of multiple - services against each other. It is - strongly recommended to set - ExecReload= to a - command that not only triggers a - configuration reload of the daemon, - but also synchronously waits for it to - complete. - - - - - ExecStop= - Commands to execute to - stop the service started via - ExecStart=. This - argument takes multiple command lines, - following the same scheme as described - for ExecStart= - above. Use of this setting is - optional. After the commands configured - in this option are run, all processes - remaining for a service are - terminated according to the - KillMode= setting - (see - systemd.kill5). If - this option is not specified, the - process is terminated immediately when - service stop is requested. Specifier - and environment variable substitution - is supported (including - $MAINPID, see - above). - - - - ExecStopPost= - Additional commands - that are executed after the service - was stopped. This includes cases where - the commands configured in - ExecStop= were used, - where the service does not have any - ExecStop= defined, or - where the service exited unexpectedly. This - argument takes multiple command lines, - following the same scheme as described - for ExecStart. Use - of these settings is - optional. Specifier and environment - variable substitution is - supported. - - - - RestartSec= - Configures the time to - sleep before restarting a service (as - configured with - Restart=). Takes a - unit-less value in seconds, or a time - span value such as "5min - 20s". Defaults to - 100ms. - - - - TimeoutStartSec= - Configures the time to - wait for start-up. If a - daemon service does not signal - start-up completion within the - configured time, the service will be - considered failed and will be shut - down again. - Takes a unit-less value in seconds, or a - time span value such as "5min - 20s". Pass 0 to - disable the timeout logic. Defaults to - DefaultTimeoutStartSec= from - the manager configuration file, except - when Type=oneshot is - used, in which case the timeout - is disabled by default - (see systemd-system.conf5). - - - - - TimeoutStopSec= - Configures the time to - wait for stop. If a service is asked - to stop, but does not terminate in the - specified time, it will be terminated - forcibly via SIGTERM, - and after another timeout of equal duration - with SIGKILL (see - KillMode= - in systemd.kill5). - Takes a unit-less value in seconds, or a - time span value such as "5min - 20s". Pass 0 to disable - the timeout logic. Defaults to - DefaultTimeoutStopSec= from the - manager configuration file - (see systemd-system.conf5). - - - - - TimeoutSec= - A shorthand for configuring - both TimeoutStartSec= - and TimeoutStopSec= - to the specified value. - - - - - WatchdogSec= - Configures the - watchdog timeout for a service. The - watchdog is activated when the start-up is - completed. The service must call - sd_notify3 - regularly with WATCHDOG=1 - (i.e. the "keep-alive ping"). If the time - between two such calls is larger than - the configured time, then the service - is placed in a failed state and it will - be terminated with SIGABRT. - By setting Restart= to - or - , the service - will be automatically restarted. The - time configured here will be passed to - the executed service process in the - WATCHDOG_USEC= - environment variable. This allows - daemons to automatically enable the - keep-alive pinging logic if watchdog - support is enabled for the service. If - this option is used, - NotifyAccess= (see - below) should be set to open access to - the notification socket provided by - systemd. If - NotifyAccess= is - not set, it will be implicitly set to - . Defaults to 0, - which disables this - feature. - - - - Restart= - Configures whether the - service shall be restarted when the - service process exits, is killed, - or a timeout is reached. The service - process may be the main service - process, but it may also be one of the - processes specified with - ExecStartPre=, - ExecStartPost=, - ExecStop=, - ExecStopPost=, or - ExecReload=. - When the death of the process is a - result of systemd operation (e.g. service - stop or restart), the service will not be - restarted. Timeouts include missing - the watchdog "keep-alive ping" - deadline and a service start, reload, - and stop operation timeouts. - - Takes one of - , - , - , - , - , - , or - . If set to - (the default), the - service will not be restarted. If set - to , it - will be restarted only when the - service process exits cleanly. In - this context, a clean exit means an - exit code of 0, or one of the signals - SIGHUP, - SIGINT, - SIGTERM or - SIGPIPE, and - additionally, exit statuses and - signals specified in - SuccessExitStatus=. - If set to , - the service will be restarted when the - process exits with a non-zero exit - code, is terminated by a signal - (including on core dump, but excluding - the aforementiond four signals), when - an operation (such as service reload) - times out, and when the configured - watchdog timeout is triggered. If set - to , the - service will be restarted when the - process is terminated by a signal - (including on core dump, excluding the - aforementioned four signals), when an - operation times out, or when the - watchdog timeout is triggered. If set - to , the - service will be restarted only if the - service process exits due to an - uncaught signal not specified as a - clean exit status. If set to - , the - service will be restarted only if the - watchdog timeout for the service - expires. If set to - , the service - will be restarted regardless of - whether it exited cleanly or not, got - terminated abnormally by a signal, or - hit a timeout. - - - Exit causes and the effect of the <varname>Restart=</varname> settings on them - - - - - - - Restart settings/Exit causes - - - - - - - - - - - - Clean exit code or signal - - X - X - - - - - - - Unclean exit code - - X - - X - - - - - - Unclean signal - - X - - X - X - X - - - - Timeout - - X - - X - X - - - - - Watchdog - - X - - X - X - - X - - - -
- - As exceptions to the setting - above the service will not be - restarted if the exit code or signal - is specified in - RestartPreventExitStatus= - (see below). Also, the services will - always be restarted if the exit code - or signal is specified in - RestartForceExitStatus= - (see below). - - Setting this to - is the - recommended choice for long-running - services, in order to increase - reliability by attempting automatic - recovery from errors. For services - that shall be able to terminate on - their own choice (and avoid - immediate restarting), - is an - alternative choice. -
-
- - - SuccessExitStatus= - Takes a list of exit - status definitions that when returned - by the main service process will be - considered successful termination, in - addition to the normal successful exit - code 0 and the signals SIGHUP, SIGINT, - SIGTERM, and SIGPIPE. Exit status - definitions can either be numeric exit - codes or termination signal names, - separated by spaces. For example: - SuccessExitStatus=1 2 8 SIGKILL - ensures that exit codes 1, 2, 8 and - the termination signal - SIGKILL are - considered clean service terminations. - - - Note that if a process has a - signal handler installed and exits by - calling - _exit2 - in response to a signal, the - information about the signal is lost. - Programs should instead perform cleanup and kill themselves with the same signal instead. See - Proper handling of SIGINT/SIGQUIT — How to be a proper program. - - This option may appear more than once, - in which case the list of successful - exit statuses is merged. If the empty - string is assigned to this option, the - list is reset, all prior assignments - of this option will have no - effect. - - - - RestartPreventExitStatus= - Takes a list of exit - status definitions that when returned - by the main service process will - prevent automatic service restarts, - regardless of the restart setting - configured with - Restart=. Exit - status definitions can either be - numeric exit codes or termination - signal names, and are separated by - spaces. Defaults to the empty list, so - that, by default, no exit status is - excluded from the configured restart - logic. For example: - RestartPreventExitStatus=1 6 SIGABRT ensures that exit - codes 1 and 6 and the termination - signal SIGABRT will - not result in automatic service - restarting. This - option may appear more than once, in - which case the list of restart-preventing - statuses is merged. If the empty - string is assigned to this option, the - list is reset and all prior assignments - of this option will have no - effect. - - - - RestartForceExitStatus= - Takes a list of exit - status definitions that when returned - by the main service process will force - automatic service restarts, regardless - of the restart setting configured with - Restart=. The - argument format is similar to - RestartPreventExitStatus=. - - - - PermissionsStartOnly= - Takes a boolean - argument. If true, the permission-related - execution options, as - configured with - User= and similar - options (see - systemd.exec5 - for more information), are only applied - to the process started with - ExecStart=, and not - to the various other - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= - commands. If false, the setting is - applied to all configured commands the - same way. Defaults to - false. - - - - RootDirectoryStartOnly= - Takes a boolean - argument. If true, the root directory, - as configured with the - RootDirectory= - option (see - systemd.exec5 - for more information), is only applied - to the process started with - ExecStart=, and not - to the various other - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= - commands. If false, the setting is - applied to all configured commands the - same way. Defaults to - false. - - - - NonBlocking= - Set the - O_NONBLOCK flag - for all file descriptors passed via - socket-based activation. If true, all - file descriptors >= 3 (i.e. all except - stdin, stdout, and stderr) will have - the O_NONBLOCK flag - set and hence are in - non-blocking mode. This option is only - useful in conjunction with a socket - unit, as described in - systemd.socket5. Defaults - to false. - - - - NotifyAccess= - Controls access to the - service status notification socket, as - accessible via the - sd_notify3 - call. Takes one of - (the default), - or - . If - , no daemon status - updates are accepted from the service - processes, all status update messages - are ignored. If , - only service updates sent from the - main process of the service are - accepted. If , all - services updates from all members of - the service's control group are - accepted. This option should be set to - open access to the notification socket - when using - Type=notify or - WatchdogSec= (see - above). If those options are used but - NotifyAccess= is not - configured, it will be implicitly set - to - . - - - - Sockets= - Specifies the name of - the socket units this service shall - inherit socket file descriptors - from when the service is - started. Normally it should not be - necessary to use this setting as all - socket file descriptors whose unit - shares the same name as the service - (subject to the different unit name - suffix of course) are passed to the - spawned process. - - Note that the same socket file - descriptors may be passed to multiple - processes simultaneously. Also note - that a different service may be - activated on incoming socket traffic - than the one which is ultimately - configured to inherit the socket file - descriptors. Or in other words: the - Service= setting of - .socket units - does not have to match the inverse of - the Sockets= - setting of the - .service it - refers to. - - This option may appear more than - once, in which case the list of socket - units is merged. If the empty string - is assigned to this option, the list of - sockets is reset, and all prior uses of - this setting will have no - effect. - - - - StartLimitInterval= - StartLimitBurst= - - Configure service - start rate limiting. By default, - services which are started more - than 5 times within 10 seconds are not - permitted to start any more times - until the 10 second interval ends. With - these two options, this rate limiting - may be modified. Use - StartLimitInterval= - to configure the checking interval (defaults to - DefaultStartLimitInterval= in - manager configuration file, set to 0 to disable - any kind of rate limiting). Use - StartLimitBurst= to - configure how many starts per interval - are allowed (defaults to - DefaultStartLimitBurst= in - manager configuration file). These - configuration options are particularly - useful in conjunction with - Restart=; however, - they apply to all kinds of starts - (including manual), not just those - triggered by the - Restart= logic. - Note that units which are configured - for Restart= and - which reach the start limit are not - attempted to be restarted anymore; - however, they may still be restarted - manually at a later point, from which - point on, the restart logic is again - activated. Note that - systemctl - reset-failed will cause the - restart rate counter for a service to - be flushed, which is useful if the - administrator wants to manually start - a service and the start limit - interferes with - that. - - - - StartLimitAction= - - Configure the action - to take if the rate limit configured - with - StartLimitInterval= - and - StartLimitBurst= is - hit. Takes one of - , - , - , - , - , - or - . If - is set, hitting - the rate limit will trigger no action - besides that the start will not be - permitted. - causes a reboot following the normal - shutdown procedure (i.e. equivalent to - systemctl reboot). - causes a - forced reboot which will terminate all - processes forcibly but should cause no - dirty file systems on reboot - (i.e. equivalent to systemctl - reboot -f) and - - causes immediate execution of the - reboot2 - system call, which might result in - data loss. Similar, - , - , - - have the effect of powering down the - system with similar - semantics. Defaults to - . - - - - FailureAction= - Configure the action - to take when the service enters a failed - state. Takes the same values as - StartLimitAction= - and executes the same actions. - Defaults to . - - - - - RebootArgument= - Configure the optional - argument for the - reboot2 - system call if - StartLimitAction= - or FailureAction= - is a reboot action. This works just - like the optional argument to - systemctl reboot - command. - - -
- - Check - systemd.exec5 - and - systemd.kill5 - for more settings. - -
- - - Command lines - - This section describes command line parsing and - variable and specifier substitions for - ExecStart=, - ExecStartPre=, - ExecStartPost=, - ExecReload=, - ExecStop=, and - ExecStopPost= options. - - Multiple command lines may be concatenated in a - single directive by separating them with semicolons - (these semicolons must be passed as separate words). - Lone semicolons may be escaped as - \;. - - Each command line is split on whitespace, with - the first item being the command to execute, and the - subsequent items being the arguments. Double quotes - ("...") and single quotes ('...') may be used, in - which case everything until the next matching quote - becomes part of the same argument. Quotes themselves - are removed after parsing. In addition, a trailing - backslash (\) may be used to merge - lines. - - This syntax is intended to be very similar to - shell syntax, but only the meta-characters and - expansions described in the following paragraphs are - understood. Specifically, redirection using - <, <<, - >, and - >>, pipes using - |, running programs in the - background using &, and - other elements of shell syntax are not - supported. - - The command line accepts % - specifiers as described in - systemd.unit5. - Note that the first argument of the command line - (i.e. the program to execute) may not include - specifiers. - - Basic environment variable substitution is - supported. Use ${FOO} as part of a - word, or as a word of its own, on the command line, in - which case it will be replaced by the value of the - environment variable including all whitespace it - contains, resulting in a single argument. Use - $FOO as a separate word on the - command line, in which case it will be replaced by the - value of the environment variable split at whitespace - resulting in zero or more arguments. For this type of - expansion, quotes and respected when splitting into - words, and afterwards removed. - - Example: - - Environment="ONE=one" 'TWO=two two' + + systemd.service + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.service + 5 + + + + systemd.service + Service unit configuration + + + + service.service + + + + Description + + A unit configuration file whose name ends in + .service encodes information about a process + controlled and supervised by systemd. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic + [Unit] and [Install] + sections. The service specific configuration options are + configured in the [Service] section. + + Additional options are listed in + systemd.exec5, + which define the execution environment the commands are executed + in, and in + systemd.kill5, + which define the way the processes of the service are terminated, + and in + systemd.resource-control5, + which configure resource control settings for the processes of the + service. + + Unless DefaultDependencies= is set to + , service units will implicitly have + dependencies of type Requires= and + After= on basic.target as + well as dependencies of type Conflicts= and + Before= on + shutdown.target. These ensure that normal + service units pull in basic system initialization, and are + terminated cleanly prior to system shutdown. Only services + involved with early boot or late system shutdown should disable + this option. + + If a service is requested under a certain name but no unit + configuration file is found, systemd looks for a SysV init script + by the same name (with the .service suffix + removed) and dynamically creates a service unit from that script. + This is useful for compatibility with SysV. Note that this + compatibility is quite comprehensive but not 100%. For details + about the incompatibilities, see the Incompatibilities + with SysV document. + + + + + Options + + Service files must include a [Service] + section, which carries information about the service and the + process it supervises. A number of options that may be used in + this section are shared with other unit types. These options are + documented in + systemd.exec5 + and + systemd.kill5. + The options specific to the [Service] section + of service units are the following: + + + + Type= + + Configures the process start-up type for this + service unit. One of + , + , + , + , + or + . + + If set to (the default if + neither Type= nor + BusName=, but ExecStart= + are specified), it is expected that the process configured + with ExecStart= is the main process of the + service. In this mode, if the process offers functionality to + other processes on the system, its communication channels + should be installed before the daemon is started up (e.g. + sockets set up by systemd, via socket activation), as systemd + will immediately proceed starting follow-up units. + + If set to , it is expected that + the process configured with ExecStart= will + call fork() as part of its start-up. The + parent process is expected to exit when start-up is complete + and all communication channels are set up. The child continues + to run as the main daemon process. This is the behavior of + traditional UNIX daemons. If this setting is used, it is + recommended to also use the PIDFile= + option, so that systemd can identify the main process of the + daemon. systemd will proceed with starting follow-up units as + soon as the parent process exits. + + Behavior of is similar to + ; however, it is expected that the + process has to exit before systemd starts follow-up units. + RemainAfterExit= is particularly useful for + this type of service. This is the implied default if neither + Type= or ExecStart= are + specified. + + Behavior of is similar to + ; however, it is expected that the + daemon acquires a name on the D-Bus bus, as configured by + BusName=. systemd will proceed with + starting follow-up units after the D-Bus bus name has been + acquired. Service units with this option configured implicitly + gain dependencies on the dbus.socket + unit. This type is the default if BusName= + is specified. + + Behavior of is similar to + ; however, it is expected that the + daemon sends a notification message via + sd_notify3 + or an equivalent call when it has finished starting up. + systemd will proceed with starting follow-up units after this + notification message has been sent. If this option is used, + NotifyAccess= (see below) should be set to + open access to the notification socket provided by systemd. If + NotifyAccess= is not set, it will be + implicitly set to . Note that currently + Type= will not work + if used in combination with + PrivateNetwork=. + + Behavior of is very similar to + ; however, actual execution of the + service binary is delayed until all jobs are dispatched. This + may be used to avoid interleaving of output of shell services + with the status output on the console. + + + + + RemainAfterExit= + + Takes a boolean value that specifies whether + the service shall be considered active even when all its + processes exited. Defaults to . + + + + + GuessMainPID= + + Takes a boolean value that specifies whether + systemd should try to guess the main PID of a service if it + cannot be determined reliably. This option is ignored unless + is set and + is unset because for the other types + or with an explicitly configured PID file, the main PID is + always known. The guessing algorithm might come to incorrect + conclusions if a daemon consists of more than one process. If + the main PID cannot be determined, failure detection and + automatic restarting of a service will not work reliably. + Defaults to . + + + + + PIDFile= + + Takes an absolute file name pointing to the + PID file of this daemon. Use of this option is recommended for + services where Type= is set to + . systemd will read the PID of the + main process of the daemon after start-up of the service. + systemd will not write to the file configured here. + + + + + BusName= + + Takes a D-Bus bus name that this service is + reachable as. This option is mandatory for services where + Type= is set to + . + + + + + BusPolicy= + + If specified, a custom + kdbus + endpoint will be created and installed as the default bus node + for the service. Such a custom endpoint can hold an own set of + policy rules that are enforced on top of the bus-wide ones. + The custom endpoint is named after the service it was created + for, and its node will be bind-mounted over the default bus + node location, so the service can only access the bus through + its own endpoint. Note that custom bus endpoints default to a + 'deny all' policy. Hence, if at least one + BusPolicy= directive is given, you have to + make sure to add explicit rules for everything the service + should be able to do. + The value of this directive is comprised + of two parts; the bus name, and a verb to + specify to granted access, which is one of + , + , or + . + implies + , and + implies both and + . + If multiple access levels are specified for the + same bus name, the most powerful one takes + effect. + + Examples: + BusPolicy=org.freedesktop.systemd1 talk + BusPolicy=org.foo.bar see + This option is only available on kdbus enabled systems. + + + + + ExecStart= + Commands with their arguments that are + executed when this service is started. The value is split into + zero or more command lines is according to the rules described + below (see section "Command Lines" below). + + + When Type is not + , only one command may and must be + given. When Type=oneshot is used, zero or + more commands may be specified. This can be specified by + providing multiple command lines in the same directive, or + alternatively, this directive may be specified more than once + with the same effect. If the empty string is assigned to this + option, the list of commands to start is reset, prior + assignments of this option will have no effect. If no + ExecStart= is specified, then the service + must have RemainAfterExit=yes set. + + For each of the specified commands, the first argument + must be an absolute path to an executable. Optionally, if this + file name is prefixed with @, the second + token will be passed as argv[0] to the + executed process, followed by the further arguments specified. + If the absolute filename is prefixed with + -, an exit code of the command normally + considered a failure (i.e. non-zero exit status or abnormal + exit due to signal) is ignored and considered success. If both + - and @ are used, they + can appear in either order. + + If more than one command is specified, the commands are + invoked sequentially in the order they appear in the unit + file. If one of the commands fails (and is not prefixed with + -), other lines are not executed, and the + unit is considered failed. + + Unless Type=forking is set, the + process started via this command line will be considered the + main process of the daemon. + + + + + ExecStartPre= + ExecStartPost= + Additional commands that are executed before + or after the command in ExecStart=, + respectively. Syntax is the same as for + ExecStart=, except that multiple command + lines are allowed and the commands are executed one after the + other, serially. + + If any of those commands (not prefixed with + -) fail, the rest are not executed and the + unit is considered failed. + + + + + ExecReload= + Commands to execute to trigger a configuration + reload in the service. This argument takes multiple command + lines, following the same scheme as described for + ExecStart= above. Use of this setting is + optional. Specifier and environment variable substitution is + supported here following the same scheme as for + ExecStart=. + + One additional, special environment variable is set: if + known, $MAINPID is set to the main process + of the daemon, and may be used for command lines like the + following: + + /bin/kill -HUP $MAINPID + + Note however that reloading a daemon by sending a signal + (as with the example line above) is usually not a good choice, + because this is an asynchronous operation and hence not + suitable to order reloads of multiple services against each + other. It is strongly recommended to set + ExecReload= to a command that not only + triggers a configuration reload of the daemon, but also + synchronously waits for it to complete. + + + + + ExecStop= + Commands to execute to stop the service + started via ExecStart=. This argument takes + multiple command lines, following the same scheme as described + for ExecStart= above. Use of this setting + is optional. After the commands configured in this option are + run, all processes remaining for a service are terminated + according to the KillMode= setting (see + systemd.kill5). + If this option is not specified, the process is terminated + immediately when service stop is requested. Specifier and + environment variable substitution is supported (including + $MAINPID, see above). + + + + ExecStopPost= + Additional commands that are executed after + the service was stopped. This includes cases where the + commands configured in ExecStop= were used, + where the service does not have any + ExecStop= defined, or where the service + exited unexpectedly. This argument takes multiple command + lines, following the same scheme as described for + ExecStart. Use of these settings is + optional. Specifier and environment variable substitution is + supported. + + + + RestartSec= + Configures the time to sleep before restarting + a service (as configured with Restart=). + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Defaults to 100ms. + + + + TimeoutStartSec= + Configures the time to wait for start-up. If a + daemon service does not signal start-up completion within the + configured time, the service will be considered failed and + will be shut down again. Takes a unit-less value in seconds, + or a time span value such as "5min 20s". Pass + 0 to disable the timeout logic. Defaults to + DefaultTimeoutStartSec= from the manager + configuration file, except when + Type=oneshot is used, in which case the + timeout is disabled by default (see + systemd-system.conf5). + + + + + TimeoutStopSec= + Configures the time to wait for stop. If a + service is asked to stop, but does not terminate in the + specified time, it will be terminated forcibly via + SIGTERM, and after another timeout of + equal duration with SIGKILL (see + KillMode= in + systemd.kill5). + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass 0 to disable the + timeout logic. Defaults to + DefaultTimeoutStopSec= from the manager + configuration file (see + systemd-system.conf5). + + + + + TimeoutSec= + A shorthand for configuring both + TimeoutStartSec= and + TimeoutStopSec= to the specified value. + + + + + WatchdogSec= + Configures the watchdog timeout for a service. + The watchdog is activated when the start-up is completed. The + service must call + sd_notify3 + regularly with WATCHDOG=1 (i.e. the + "keep-alive ping"). If the time between two such calls is + larger than the configured time, then the service is placed in + a failed state and it will be terminated with + SIGABRT. By setting + Restart= to or + , the service will be automatically + restarted. The time configured here will be passed to the + executed service process in the + WATCHDOG_USEC= environment variable. This + allows daemons to automatically enable the keep-alive pinging + logic if watchdog support is enabled for the service. If this + option is used, NotifyAccess= (see below) + should be set to open access to the notification socket + provided by systemd. If NotifyAccess= is + not set, it will be implicitly set to . + Defaults to 0, which disables this feature. + + + + Restart= + Configures whether the service shall be + restarted when the service process exits, is killed, or a + timeout is reached. The service process may be the main + service process, but it may also be one of the processes + specified with ExecStartPre=, + ExecStartPost=, + ExecStop=, + ExecStopPost=, or + ExecReload=. When the death of the process + is a result of systemd operation (e.g. service stop or + restart), the service will not be restarted. Timeouts include + missing the watchdog "keep-alive ping" deadline and a service + start, reload, and stop operation timeouts. + + Takes one of + , + , + , + , + , + , or + . + If set to (the default), the service will + not be restarted. If set to , it + will be restarted only when the service process exits cleanly. + In this context, a clean exit means an exit code of 0, or one + of the signals + SIGHUP, + SIGINT, + SIGTERM or + SIGPIPE, and + additionally, exit statuses and signals specified in + SuccessExitStatus=. If set to + , the service will be restarted + when the process exits with a non-zero exit code, is + terminated by a signal (including on core dump, but excluding + the aforementiond four signals), when an operation (such as + service reload) times out, and when the configured watchdog + timeout is triggered. If set to , + the service will be restarted when the process is terminated + by a signal (including on core dump, excluding the + aforementioned four signals), when an operation times out, or + when the watchdog timeout is triggered. If set to + , the service will be restarted only + if the service process exits due to an uncaught signal not + specified as a clean exit status. If set to + , the service will be restarted + only if the watchdog timeout for the service expires. If set + to , the service will be restarted + regardless of whether it exited cleanly or not, got terminated + abnormally by a signal, or hit a timeout. + + + Exit causes and the effect of the <varname>Restart=</varname> settings on them + + + + + + + Restart settings/Exit causes + + + + + + + + + + + + Clean exit code or signal + + X + X + + + + + + + Unclean exit code + + X + + X + + + + + + Unclean signal + + X + + X + X + X + + + + Timeout + + X + + X + X + + + + + Watchdog + + X + + X + X + + X + + + +
+ + As exceptions to the setting above the service will not + be restarted if the exit code or signal is specified in + RestartPreventExitStatus= (see below). + Also, the services will always be restarted if the exit code + or signal is specified in + RestartForceExitStatus= (see below). + + Setting this to is the + recommended choice for long-running services, in order to + increase reliability by attempting automatic recovery from + errors. For services that shall be able to terminate on their + own choice (and avoid immediate restarting), + is an alternative choice. +
+
+ + + SuccessExitStatus= + Takes a list of exit status definitions that + when returned by the main service process will be considered + successful termination, in addition to the normal successful + exit code 0 and the signals SIGHUP, + SIGINT, SIGTERM, and + SIGPIPE. Exit status definitions can + either be numeric exit codes or termination signal names, + separated by spaces. For example: + SuccessExitStatus=1 2 8 + SIGKILL ensures that exit codes 1, 2, 8 and + the termination signal SIGKILL are + considered clean service terminations. + + + Note that if a process has a signal handler installed + and exits by calling + _exit2 + in response to a signal, the information about the signal is + lost. Programs should instead perform cleanup and kill + themselves with the same signal instead. See + Proper + handling of SIGINT/SIGQUIT — How to be a proper + program. + + This option may appear more than once, in which case the + list of successful exit statuses is merged. If the empty + string is assigned to this option, the list is reset, all + prior assignments of this option will have no + effect. + + + + RestartPreventExitStatus= + Takes a list of exit status definitions that + when returned by the main service process will prevent + automatic service restarts, regardless of the restart setting + configured with Restart=. Exit status + definitions can either be numeric exit codes or termination + signal names, and are separated by spaces. Defaults to the + empty list, so that, by default, no exit status is excluded + from the configured restart logic. For example: + RestartPreventExitStatus=1 6 + SIGABRT ensures that exit codes 1 and 6 and + the termination signal SIGABRT will not + result in automatic service restarting. This option may appear + more than once, in which case the list of restart-preventing + statuses is merged. If the empty string is assigned to this + option, the list is reset and all prior assignments of this + option will have no effect. + + + + RestartForceExitStatus= + Takes a list of exit status definitions that + when returned by the main service process will force automatic + service restarts, regardless of the restart setting configured + with Restart=. The argument format is + similar to + RestartPreventExitStatus=. + + + + PermissionsStartOnly= + Takes a boolean argument. If true, the + permission-related execution options, as configured with + User= and similar options (see + systemd.exec5 + for more information), are only applied to the process started + with + ExecStart=, and not to the various other + ExecStartPre=, + ExecStartPost=, + ExecReload=, + ExecStop=, and + ExecStopPost= + commands. If false, the setting is applied to all configured + commands the same way. Defaults to false. + + + + RootDirectoryStartOnly= + Takes a boolean argument. If true, the root + directory, as configured with the + RootDirectory= option (see + systemd.exec5 + for more information), is only applied to the process started + with ExecStart=, and not to the various + other ExecStartPre=, + ExecStartPost=, + ExecReload=, ExecStop=, + and ExecStopPost= commands. If false, the + setting is applied to all configured commands the same way. + Defaults to false. + + + + NonBlocking= + Set the O_NONBLOCK flag + for all file descriptors passed via socket-based activation. + If true, all file descriptors >= 3 (i.e. all except stdin, + stdout, and stderr) will have the + O_NONBLOCK flag set and hence are in + non-blocking mode. This option is only useful in conjunction + with a socket unit, as described in + systemd.socket5. + Defaults to false. + + + + NotifyAccess= + Controls access to the service status + notification socket, as accessible via the + sd_notify3 + call. Takes one of (the default), + or . If + , no daemon status updates are accepted + from the service processes, all status update messages are + ignored. If , only service updates sent + from the main process of the service are accepted. If + , all services updates from all members of + the service's control group are accepted. This option should + be set to open access to the notification socket when using + Type=notify or + WatchdogSec= (see above). If those options + are used but NotifyAccess= is not + configured, it will be implicitly set to + . + + + + Sockets= + Specifies the name of the socket units this + service shall inherit socket file descriptors from when the + service is started. Normally it should not be necessary to use + this setting as all socket file descriptors whose unit shares + the same name as the service (subject to the different unit + name suffix of course) are passed to the spawned + process. + + Note that the same socket file descriptors may be passed + to multiple processes simultaneously. Also note that a + different service may be activated on incoming socket traffic + than the one which is ultimately configured to inherit the + socket file descriptors. Or in other words: the + Service= setting of + .socket units does not have to match the + inverse of the Sockets= setting of the + .service it refers to. + + This option may appear more than once, in which case the + list of socket units is merged. If the empty string is + assigned to this option, the list of sockets is reset, and all + prior uses of this setting will have no + effect. + + + + StartLimitInterval= + StartLimitBurst= + + Configure service start rate limiting. By + default, services which are started more than 5 times within + 10 seconds are not permitted to start any more times until the + 10 second interval ends. With these two options, this rate + limiting may be modified. Use + StartLimitInterval= to configure the + checking interval (defaults to + DefaultStartLimitInterval= in manager + configuration file, set to 0 to disable any kind of rate + limiting). Use StartLimitBurst= to + configure how many starts per interval are allowed (defaults + to DefaultStartLimitBurst= in manager + configuration file). These configuration options are + particularly useful in conjunction with + Restart=; however, they apply to all kinds + of starts (including manual), not just those triggered by the + Restart= logic. Note that units which are + configured for Restart= and which reach the + start limit are not attempted to be restarted anymore; + however, they may still be restarted manually at a later + point, from which point on, the restart logic is again + activated. Note that systemctl reset-failed + will cause the restart rate counter for a service to be + flushed, which is useful if the administrator wants to + manually start a service and the start limit interferes with + that. + + + + StartLimitAction= + + Configure the action to take if the rate limit + configured with StartLimitInterval= and + StartLimitBurst= is hit. Takes one of + , + , + , + , + , + or + . If + is set, hitting the rate limit will + trigger no action besides that the start will not be + permitted. causes a reboot following + the normal shutdown procedure (i.e. equivalent to + systemctl reboot). + causes a forced reboot which + will terminate all processes forcibly but should cause no + dirty file systems on reboot (i.e. equivalent to + systemctl reboot -f) and + causes immediate execution + of the + reboot2 + system call, which might result in data loss. Similar, + , , + have the effect of + powering down the system with similar semantics. Defaults to + . + + + + FailureAction= + Configure the action to take when the service + enters a failed state. Takes the same values as + StartLimitAction= and executes the same + actions. Defaults to . + + + + RebootArgument= + Configure the optional argument for the + reboot2 + system call if StartLimitAction= or + FailureAction= is a reboot action. This + works just like the optional argument to systemctl + reboot command. + + + + FileDescriptorStoreMax= + Configure how many file descriptors may be + stored in the service manager for the service using + sd_pid_notify_with_fds3's + FDSTORE=1 messages. This is useful for + implementing service restart schemes where the state is + serialized to /run and the file + descriptors passed to the service manager, to allow restarts + without losing state. Defaults to 0, i.e. no file descriptors + may be stored in the service manager by default. All file + descriptors passed to the service manager from a specific + service are passed back to the service's main process on the + next service restart. Any file descriptors passed to the + service manager are automatically closed when POLLHUP or + POLLERR is seen on them, or when the service is fully stopped + and no job queued or being executed for it. + + +
+ + Check + systemd.exec5 + and + systemd.kill5 + for more settings. + +
+ + + Command lines + + This section describes command line parsing and + variable and specifier substitions for + ExecStart=, + ExecStartPre=, + ExecStartPost=, + ExecReload=, + ExecStop=, and + ExecStopPost= options. + + Multiple command lines may be concatenated in a single + directive by separating them with semicolons (these semicolons + must be passed as separate words). Lone semicolons may be escaped + as \;. + + Each command line is split on whitespace, with the first + item being the command to execute, and the subsequent items being + the arguments. Double quotes ("...") and single quotes ('...') may + be used, in which case everything until the next matching quote + becomes part of the same argument. C-style escapes are also + supported, see table below. Quotes themselves are removed after + parsing and escape sequences substituted. In addition, a trailing + backslash (\) may be used to merge lines. + + + This syntax is intended to be very similar to shell syntax, + but only the meta-characters and expansions described in the + following paragraphs are understood. Specifically, redirection + using + <, + <<, + >, and + >>, pipes using + |, running programs in the background using + &, and other elements of shell + syntax are not supported. + + The command to execute must an absolute path name. It may + contain spaces, but control characters are not allowed. + + The command line accepts % specifiers as + described in + systemd.unit5. + Note that the first argument of the command line (i.e. the program + to execute) may not include specifiers. + + Basic environment variable substitution is supported. Use + ${FOO} as part of a word, or as a word of its + own, on the command line, in which case it will be replaced by the + value of the environment variable including all whitespace it + contains, resulting in a single argument. Use + $FOO as a separate word on the command line, in + which case it will be replaced by the value of the environment + variable split at whitespace resulting in zero or more arguments. + For this type of expansion, quotes and respected when splitting + into words, and afterwards removed. + + Example: + + Environment="ONE=one" 'TWO=two two' ExecStart=/bin/echo $ONE $TWO ${TWO} - This will execute /bin/echo - with four arguments: one, - two, two, and - two two. + This will execute /bin/echo with four + arguments: one, two, + two, and two two. - Example: - Environment=ONE='one' "TWO='two two' too" THREE= + Example: + Environment=ONE='one' "TWO='two two' too" THREE= ExecStart=/bin/echo ${ONE} ${TWO} ${THREE} ExecStart=/bin/echo $ONE $TWO $THREE - This results in echo being - called twice, the first time with arguments - 'one', - 'two two' too, , - and the second time with arguments - one, two two, - too. - - - To pass a literal dollar sign, use - $$. Variables whose value is not - known at expansion time are treated as empty - strings. Note that the first argument (i.e. the - program to execute) may not be a variable. - - Variables to be used in this fashion may be - defined through Environment= and - EnvironmentFile=. In addition, - variables listed in the section "Environment variables - in spawned processes" in - systemd.exec5, - which are considered "static configuration", may be - used (this includes e.g. $USER, but - not $TERM). - - Note that shell command lines are not directly - supported. If shell command lines are to be used, they - need to be passed explicitly to a shell implementation - of some kind. Example: - ExecStart=/bin/sh -c 'dmesg | tac' - - Example: - - ExecStart=/bin/echo one ; /bin/echo "two two" - - This will execute /bin/echo - two times, each time with one argument: - one and two two, - respectively. Because two commands are specified, - Type=oneshot must be used. - - Example: - - ExecStart=/bin/echo / >/dev/null & \; \ + This results in echo being + called twice, the first time with arguments + 'one', + 'two two' too, , + and the second time with arguments + one, two two, + too. + + + To pass a literal dollar sign, use $$. + Variables whose value is not known at expansion time are treated + as empty strings. Note that the first argument (i.e. the program + to execute) may not be a variable. + + Variables to be used in this fashion may be defined through + Environment= and + EnvironmentFile=. In addition, variables listed + in the section "Environment variables in spawned processes" in + systemd.exec5, + which are considered "static configuration", may be used (this + includes e.g. $USER, but not + $TERM). + + Note that shell command lines are not directly supported. If + shell command lines are to be used, they need to be passed + explicitly to a shell implementation of some kind. Example: + ExecStart=/bin/sh -c 'dmesg | tac' + + Example: + + ExecStart=/bin/echo one ; /bin/echo "two two" + + This will execute /bin/echo two times, + each time with one argument: one and + two two, respectively. Because two commands are + specified, Type=oneshot must be used. + + Example: + + ExecStart=/bin/echo / >/dev/null & \; \ /bin/ls - This will execute /bin/echo - with five arguments: /, - >/dev/null, - &, ;, and - /bin/ls. - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.exec5, - systemd.resource-control5, - systemd.kill5, - systemd.directives7 - - + This will execute /bin/echo + with five arguments: /, + >/dev/null, + &, ;, and + /bin/ls. + + + C escapes supported in command lines and environment variables + + + + + + Literal + Actual value + + + + + \a + bell + + + \b + backspace + + + \f + form feed + + + \n + newline + + + \r + carriage return + + + \t + tab + + + \v + vertical tab + + + \\ + backslash + + + \" + double quotation mark + + + \' + single quotation mark + + + \s + space + + + \xxx + character number xx in hexadecimal encoding + + + \nnn + character number nnn in octal encoding + + + +
+
+ + + Examples + + + Simple service + + The following unit file creates a service that will + execute /usr/sbin/foo-daemon. Since no + Type= is specified, the default + Type= will be assumed. + systemd will assume the unit to be started immediately after the + program has begun executing. + + [Unit] +Description=Foo + +[Service] +ExecStart=/usr/sbin/foo-daemon + +[Install] +WantedBy=multi-user.target + + Note that systemd assumes here that the process started by + systemd will continue running until the service terminates. If + the program daemonizes itself (i.e. forks), please use + Type= instead. + + Since no ExecStop= was specified, + systemd will send SIGTERM to all processes started from this + service, and after a timeout also SIGKILL. This behavior can be + modified, see + systemd.kill5 + for details. + + Note that this unit type does not include any type of + notification when a service has completed initialization. For + this, you should use other unit types, such as + Type= if the service + understands systemd's notification protocol, + Type= if the service + can background itself or + Type= if the unit + acquires a DBus name once initialization is complete. See + below. + + + + Oneshot service + + Sometimes units should just execute an action without + keeping active processes, such as a filesystem check or a + cleanup action on boot. For this, + Type= exists. Units + of this type will wait until the process specified terminates + and then fall back to being inactive. The following unit will + perform a clenaup action: + + [Unit] +Description=Cleanup old Foo data + +[Service] +Type=oneshot +ExecStart=/usr/sbin/foo-cleanup + +[Install] +WantedBy=multi-user.target + + Note that systemd will consider the unit to be in the + state 'starting' until the program has terminated, so ordered + dependencies will wait for the program to finish before starting + themselves. The unit will revert to the 'inactive' state after + the execution is done, never reaching the 'active' state. That + means another request to start the unit will perform the action + again. + + Type= are the + only service units that may have more than one + ExecStart= specified. They will be executed + in order until either they are all successful or one of them + fails. + + + + Stoppable oneshot service + + Similarly to the oneshot services, there are sometimes + units that need to execute a program to set up something and + then execute another to shut it down, but no process remains + active while they are considered 'started'. Network + configuration can sometimes fall into this category. Another use + case is if a oneshot service shall not be executed a each time + when they are pulled in as a dependency, but only the first + time. + + For this, systemd knows the setting + RemainAfterExit=, which + causes systemd to consider the unit to be active if the start + action exited successfully. This directive can be used with all + types, but is most useful with + Type= and + Type=. With + Type= systemd waits + until the start action has completed before it considers the + unit to be active, so dependencies start only after the start + action has succeeded. With + Type= dependencies + will start immediately after the start action has been + dispatched. The following unit provides an example for a simple + static firewall. + + [Unit] +Description=Simple firewall + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/sbin/simple-firewall-start +ExecStop=/usr/local/sbin/simple-firewall-stop + +[Install] +WantedBy=multi-user.target + + Since the unit is considered to be running after the start + action has exited, invoking systemctl start + on that unit again will cause no action to be taken. + + + + Traditional forking services + + Many traditional daemons/services background (i.e. fork, + daemonize) themselves when starting. Set + Type= in the + service's unit file to support this mode of operation. systemd + will consider the service to be in the process of initialization + while the original program is still running. Once it exits + successfully and at least a process remains (and + RemainAfterExit=), the + service is considered started. + + Often a traditional daemon only consists of one process. + Therefore, if only one process is left after the original + process terminates, systemd will consider that process the main + process of the service. In that case, the + $MAINPID variable will be available in + ExecReload=, ExecStop=, + etc. + + In case more than one process remains, systemd will be + unable to determine the main process, so it will not assume + there is one. In that case, $MAINPID will not + expand to anything. However, if the process decides to write a + traditional PID file, systemd will be able to read the main PID + from there. Please set PIDFile= accordingly. + Note that the daemon should write that file before finishing + with its initialization, otherwise systemd might try to read the + file before it exists. + + The following example shows a simple daemon that forks and + just starts one process in the background: + + [Unit] +Description=Some simple daemon + +[Service] +Type=forking +ExecStart=/usr/sbin/my-simple-daemon -d + +[Install] +WantedBy=multi-user.target + + Please see + systemd.kill5 + for details on how you can influence the way systemd terminates + the service. + + + + DBus services + + For services that acquire a name on the DBus system bus, + use Type= and set + BusName= accordingly. The service should not + fork (daemonize). systemd will consider the service to be + initialized once the name has been acquired on the system bus. + The following example shows a typical DBus service: + + [Unit] +Description=Simple DBus service + +[Service] +Type=dbus +BusName=org.example.simple-dbus-service +ExecStart=/usr/sbin/simple-dbus-service + +[Install] +WantedBy=multi-user.target + + For bus-activatable services, don't + include a [Install] section in the systemd + service file, but use the SystemdService= + option in the corresponding DBus service file, for example + (/usr/share/dbus-1/system-services/org.example.simple-dbus-service.service): + + [D-BUS Service] +Name=org.example.simple-dbus-service +Exec=/usr/sbin/simple-dbus-service +User=root +SystemdService=simple-dbus-service.service + + Please see + systemd.kill5 + for details on how you can influence the way systemd terminates + the service. + + + + Services that notify systemd about their initialization + + Type= services + are really easy to write, but have the major disadvantage of + systemd not being able to tell when initialization of the given + service is complete. For this reason, systemd supports a simple + notification protocol that allows daemons to make systemd aware + that they are done initializing. Use + Type= for this. A + typical service file for such a daemon would look like + this: + + [Unit] +Description=Simple notifying service + +[Service] +Type=notify +ExecStart=/usr/sbin/simple-notifying-service + +[Install] +WantedBy=multi-user.target + + Note that the daemon has to support systemd's notification + protocol, else systemd will think the service hasn't started yet + and kill it after a timeout. For an example of how to update + daemons to support this protocol transparently, take a look at + sd_notify3. + systemd will consider the unit to be in the 'starting' state + until a readiness notification has arrived. + + Please see + systemd.kill5 + for details on how you can influence the way systemd terminates + the service. + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.exec5, + systemd.resource-control5, + systemd.kill5, + systemd.directives7 + +
diff --git a/man/systemd.slice.5 b/man/systemd.slice.5 index e621bc748..25b84607c 100644 --- a/man/systemd.slice.5 +++ b/man/systemd.slice.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SLICE" "5" "" "systemd 218" "systemd.slice" +.TH "SYSTEMD\&.SLICE" "5" "" "systemd 219" "systemd.slice" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.slice.html b/man/systemd.slice.html index dc33933c8..732f8d5b9 100644 --- a/man/systemd.slice.html +++ b/man/systemd.slice.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.slice — Slice unit configuration

Synopsis

slice.slice

Description¶

A unit configuration file whose name ends in + gudev systemd 219


Name

systemd.slice — Slice unit configuration

Synopsis

slice.slice

Description¶

A unit configuration file whose name ends in ".slice" encodes information about a slice which is a concept for hierarchically managing resources of a group of processes. This management is performed by creating a node in the @@ -61,7 +61,7 @@ that slice units are removed prior to system shutdown. Only slice units involved with early boot or late system shutdown should disable this option. -

See Also¶

+

See Also¶

systemd(1), systemd.unit(5), systemd.resource-control(5), diff --git a/man/systemd.slice.xml b/man/systemd.slice.xml index 987df50e1..f0bac4176 100644 --- a/man/systemd.slice.xml +++ b/man/systemd.slice.xml @@ -1,25 +1,24 @@ - diff --git a/man/systemd.snapshot.5 b/man/systemd.snapshot.5 index 94eef0805..af3c7862c 100644 --- a/man/systemd.snapshot.5 +++ b/man/systemd.snapshot.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SNAPSHOT" "5" "" "systemd 218" "systemd.snapshot" +.TH "SYSTEMD\&.SNAPSHOT" "5" "" "systemd 219" "systemd.snapshot" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.snapshot.html b/man/systemd.snapshot.html index 031cefdd2..a6a09a643 100644 --- a/man/systemd.snapshot.html +++ b/man/systemd.snapshot.html @@ -19,25 +19,21 @@ Directives · Python · libudev · - gudev systemd 218


Name

systemd.snapshot — Snapshot unit configuration

Synopsis

snapshot.snapshot

Description¶

Snapshot units are not configured via unit - configuration files. Nonetheless they are named - similar to filenames. A unit whose name ends in - ".snapshot" refers to a dynamic - snapshot of the systemd runtime state.

Snapshots are not configured on disk but created - dynamically via systemctl snapshot - (see - systemctl(1) - for details) or an equivalent command. When created, - they will automatically get dependencies on the - currently activated units. They act as saved - runtime state of the systemd manager. Later on, the - user may choose to return to the saved state via - systemctl isolate. They are - useful to roll back to a defined state after - temporarily starting/stopping services or - similar.

+ gudev systemd 219

Name

systemd.snapshot — Snapshot unit configuration

Synopsis

snapshot.snapshot

Description¶

Snapshot units are not configured via unit configuration + files. Nonetheless they are named similar to filenames. A unit + whose name ends in ".snapshot" refers to a + dynamic snapshot of the systemd runtime state.

Snapshots are not configured on disk but created dynamically + via systemctl snapshot (see + systemctl(1) + for details) or an equivalent command. When created, they will + automatically get dependencies on the currently activated units. + They act as saved runtime state of the systemd manager. Later on, + the user may choose to return to the saved state via + systemctl isolate. They are useful to roll back + to a defined state after temporarily starting/stopping services or + similar.

diff --git a/man/systemd.snapshot.xml b/man/systemd.snapshot.xml index f08e38e07..96069c324 100644 --- a/man/systemd.snapshot.xml +++ b/man/systemd.snapshot.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.snapshot - systemd + + systemd.snapshot + systemd - - - Developer - Lennart - Poettering - lennart@poettering.net - - - + + + Developer + Lennart + Poettering + lennart@poettering.net + + + - - systemd.snapshot - 5 - + + systemd.snapshot + 5 + - - systemd.snapshot - Snapshot unit configuration - + + systemd.snapshot + Snapshot unit configuration + - - snapshot.snapshot - + + snapshot.snapshot + - - Description + + Description - Snapshot units are not configured via unit - configuration files. Nonetheless they are named - similar to filenames. A unit whose name ends in - .snapshot refers to a dynamic - snapshot of the systemd runtime state. + Snapshot units are not configured via unit configuration + files. Nonetheless they are named similar to filenames. A unit + whose name ends in .snapshot refers to a + dynamic snapshot of the systemd runtime state. - Snapshots are not configured on disk but created - dynamically via systemctl snapshot - (see - systemctl1 - for details) or an equivalent command. When created, - they will automatically get dependencies on the - currently activated units. They act as saved - runtime state of the systemd manager. Later on, the - user may choose to return to the saved state via - systemctl isolate. They are - useful to roll back to a defined state after - temporarily starting/stopping services or - similar. - + Snapshots are not configured on disk but created dynamically + via systemctl snapshot (see + systemctl1 + for details) or an equivalent command. When created, they will + automatically get dependencies on the currently activated units. + They act as saved runtime state of the systemd manager. Later on, + the user may choose to return to the saved state via + systemctl isolate. They are useful to roll back + to a defined state after temporarily starting/stopping services or + similar. + - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.directives7 - - + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.directives7 + + diff --git a/man/systemd.socket.5 b/man/systemd.socket.5 index f98c68008..55716b2f9 100644 --- a/man/systemd.socket.5 +++ b/man/systemd.socket.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SOCKET" "5" "" "systemd 218" "systemd.socket" +.TH "SYSTEMD\&.SOCKET" "5" "" "systemd 219" "systemd.socket" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.socket.html b/man/systemd.socket.html index 4693d59e2..0fea85804 100644 --- a/man/systemd.socket.html +++ b/man/systemd.socket.html @@ -19,604 +19,423 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.socket — Socket unit configuration

Synopsis

socket.socket

Description¶

A unit configuration file whose name ends in - ".socket" encodes information about - an IPC or network socket or a file system FIFO - controlled and supervised by systemd, for socket-based - activation.

This man page lists the configuration options - specific to this unit type. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - socket specific configuration options are configured - in the [Socket] section.

Additional options are listed in - systemd.exec(5), - which define the execution environment the - ExecStartPre=, - ExecStartPost=, - ExecStopPre= and - ExecStopPost= commands are executed - in, and in - systemd.kill(5), - which define the way the processes are terminated, and - in - systemd.resource-control(5), - which configure resource control settings for the - processes of the socket.

For each socket file, a matching service file - must exist, describing the service to start on - incoming traffic on the socket (see - systemd.service(5) - for more information about .service files). The name - of the .service unit is by default the same as the - name of the .socket unit, but can be altered with the - Service= option described below. - Depending on the setting of the Accept= - option described below, this .service unit must either - be named like the .socket unit, but with the suffix - replaced, unless overridden with - Service=; or it must be a template - unit named the same way. Example: a socket file - foo.socket needs a matching - service foo.service if - Accept=false is set. If - Accept=true is set, a service - template file foo@.service must - exist from which services are instantiated for each - incoming connection.

Unless DefaultDependencies= - is set to false, socket units will - implicitly have dependencies of type - Requires= and - After= on - sysinit.target as well as - dependencies of type Conflicts= and - Before= on - shutdown.target. These ensure - that socket units pull in basic system - initialization, and are terminated cleanly prior to - system shutdown. Only sockets involved with early - boot or late system shutdown should disable this - option.

Socket units will have a - Before= dependency on the service - which they trigger added implicitly. No implicit - WantedBy= or - RequiredBy= dependency from the - socket to the service is added. This means that the - service may be started without the socket, in which - case it must be able to open sockets by itself. To - prevent this, an explicit Requires= - dependency may be added.

Socket units may be used to implement on-demand - starting of services, as well as parallelized starting - of services. See the blog stories linked at the end - for an introduction.

Note that the daemon software configured for - socket activation with socket units needs to be able - to accept sockets from systemd, either via systemd's - native socket passing interface (see - sd_listen_fds(3) - for details) or via the traditional - inetd(8)-style - socket passing (i.e. sockets passed in via standard input and - output, using StandardInput=socket - in the service file).

Options¶

Socket files must include a [Socket] section, - which carries information about the socket or FIFO it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec(5) - and - systemd.kill(5). The - options specific to the [Socket] section of socket - units are the following:

ListenStream=, ListenDatagram=, ListenSequentialPacket=¶

Specifies an address - to listen on for a stream - (SOCK_STREAM), datagram (SOCK_DGRAM), - or sequential packet - (SOCK_SEQPACKET) socket, respectively. The address - can be written in various formats:

If the address starts with a - slash ("/"), it is read as file system - socket in the AF_UNIX socket - family.

If the address starts with an at - symbol ("@"), it is read as abstract - namespace socket in the - AF_UNIX - family. The "@" is - replaced with a - NUL character - before binding. For details, see - unix(7).

If the address string is a - single number, it is read as port - number to listen on via - IPv6. Depending on the value of - BindIPv6Only= (see below) this - might result in the service being - available via both IPv6 and IPv4 (default) or - just via IPv6. -

If the address string is a - string in the format v.w.x.y:z, it is - read as IPv4 specifier for listening - on an address v.w.x.y on a port - z.

If the address string is a - string in the format [x]:y, it is read - as IPv6 address x on a port y. Note - that this might make the service - available via IPv4, too, depending on - the BindIPv6Only= - setting (see below). -

Note that SOCK_SEQPACKET - (i.e. ListenSequentialPacket=) - is only available for AF_UNIX - sockets. SOCK_STREAM - (i.e. ListenStream=) - when used for IP sockets refers to TCP - sockets, SOCK_DGRAM - (i.e. ListenDatagram=) - to UDP.

These options may be specified - more than once in which case incoming - traffic on any of the sockets will - trigger service activation, and all - listed sockets will be passed to the - service, regardless of whether there is - incoming traffic on them or not. If - the empty string is assigned to any of - these options, the list of addresses - to listen on is reset, all prior uses - of any of these options will have no - effect.

It is also possible to have more - than one socket unit for the same - service when using - Service=, and the - service will receive all the sockets - configured in all the socket units. - Sockets configured in one unit are - passed in the order of configuration, - but no ordering between socket units - is specified.

If an IP address is used here, - it is often desirable to listen on it - before the interface it is configured - on is up and running, and even - regardless of whether it will be up and - running at any point. To deal with this, - it is recommended to set the - FreeBind= option - described below.

ListenFIFO=¶

Specifies a file - system FIFO to listen on. This expects - an absolute file system path as - argument. Behavior otherwise is very - similar to the - ListenDatagram= - directive above.

ListenSpecial=¶

Specifies a special - file in the file system to listen - on. This expects an absolute file - system path as argument. Behavior - otherwise is very similar to the - ListenFIFO= - directive above. Use this to open - character device nodes as well as - special files in - /proc and - /sys.

ListenNetlink=¶

Specifies a Netlink - family to create a socket for to - listen on. This expects a short string - referring to the AF_NETLINK family - name (such as audit - or kobject-uevent) - as argument, optionally suffixed by a - whitespace followed by a multicast - group integer. Behavior otherwise is - very similar to the - ListenDatagram= - directive above.

ListenMessageQueue=¶

Specifies a POSIX - message queue name to listen on. This - expects a valid message queue name - (i.e. beginning with /). Behavior - otherwise is very similar to the - ListenFIFO= - directive above. On Linux message - queue descriptors are actually file - descriptors and can be inherited - between processes.

BindIPv6Only=¶

Takes a one of - default, - both or - ipv6-only. Controls - the IPV6_V6ONLY socket option (see - ipv6(7) - for details). If - both, IPv6 sockets - bound will be accessible via both IPv4 - and IPv6. If - ipv6-only, they will - be accessible via IPv6 only. If - default (which is the - default, surprise!), the system wide - default setting is used, as controlled - by - /proc/sys/net/ipv6/bindv6only, - which in turn defaults to the - equivalent of - both.

Backlog=¶

Takes an unsigned - integer argument. Specifies the number - of connections to queue that have not - been accepted yet. This setting - matters only for stream and sequential - packet sockets. See - listen(2) - for details. Defaults to SOMAXCONN - (128).

BindToDevice=¶

Specifies a network - interface name to bind this socket - to. If set, traffic will only be - accepted from the specified network - interfaces. This controls the - SO_BINDTODEVICE socket option (see - socket(7) - for details). If this option is used, - an automatic dependency from this - socket unit on the network interface - device unit - (systemd.device(5) - is created.

SocketUser=, SocketGroup=¶

Takes a UNIX - user/group name. When specified, - all AF_UNIX sockets and FIFO nodes in - the file system are owned by the - specified user and group. If unset - (the default), the nodes are owned by - the root user/group (if run in system - context) or the invoking user/group - (if run in user context). If only a - user is specified but no group, then - the group is derived from the user's - default group.

SocketMode=¶

If listening on a file - system socket or FIFO, this option - specifies the file system access mode - used when creating the file - node. Takes an access mode in octal - notation. Defaults to - 0666.

DirectoryMode=¶

If listening on a file - system socket or FIFO, the parent - directories are automatically created - if needed. This option specifies the - file system access mode used when - creating these directories. Takes an - access mode in octal - notation. Defaults to - 0755.

Accept=¶

Takes a boolean - argument. If true, a service instance - is spawned for each incoming - connection and only the connection - socket is passed to it. If false, all - listening sockets themselves are - passed to the started service unit, - and only one service unit is spawned - for all connections (also see - above). This value is ignored for - datagram sockets and FIFOs where a - single service unit unconditionally - handles all incoming traffic. Defaults - to false. For - performance reasons, it is recommended - to write new daemons only in a way - that is suitable for - Accept=false. A - daemon listening on an AF_UNIX socket - may, but does not need to, call - close(2) - on the received socket before - exiting. However, it must not unlink - the socket from a file system. It - should not invoke - shutdown(2) - on sockets it got with - Accept=false, but - it may do so for sockets it got with - Accept=true set. - Setting Accept=true - is mostly useful to allow daemons - designed for usage with - inetd(8) - to work unmodified with systemd socket - activation.

MaxConnections=¶

The maximum number of - connections to simultaneously run - services instances for, when - Accept=true is - set. If more concurrent connections - are coming in, they will be refused - until at least one existing connection - is terminated. This setting has no - effect on sockets configured with - Accept=false or datagram - sockets. Defaults to - 64.

KeepAlive=¶

Takes a boolean - argument. If true, the TCP/IP stack - will send a keep alive message after - 2h (depending on the configuration of - /proc/sys/net/ipv4/tcp_keepalive_time) - for all TCP streams accepted on this - socket. This controls the SO_KEEPALIVE - socket option (see - socket(7) - and the TCP - Keepalive HOWTO for details.) - Defaults to - false.

KeepAliveTimeSec=¶

Takes time (in seconds) as argument . The connection needs to remain - idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE - socket option (see - socket(7) - and the TCP - Keepalive HOWTO for details.) - Defaults value is 7200 seconds (2 hours).

KeepAliveIntervalSec=¶

Takes time (in seconds) as argument between individual keepalive probes, - if the socket option SO_KEEPALIVE has been set on this socket seconds as argument. - This controls the TCP_KEEPINTVL socket option (see - socket(7) - and the TCP - Keepalive HOWTO for details.) - Defaults value is 75 seconds.

KeepAliveProbes=¶

Takes integer as argument. It's the number of unacknowledged probes to - send before considering the connection dead and notifying the application layer. - This controls the TCP_KEEPCNT socket option (see - socket(7) - and the TCP - Keepalive HOWTO for details.) - Defaults value is 9.

NoDelay=¶

Takes a boolean - argument. TCP Nagle's algorithm works by combining a number of - small outgoing messages, and sending them all at once. - This controls the TCP_NODELAY socket option (see - tcp(7) - Defaults to - false.

Priority=¶

Takes an integer - argument controlling the priority for - all traffic sent from this - socket. This controls the SO_PRIORITY - socket option (see - socket(7) - for details.).

DeferAcceptSec=¶

Takes time (in - seconds) as argument. If set, the - listening process will be awakened - only when data arrives on the socket, - and not immediately when connection is - established. When this option is set, - the - TCP_DEFER_ACCEPT - socket option will be used (see - tcp(7)), - and the kernel will ignore initial ACK - packets without any data. The argument - specifies the approximate amount of - time the kernel should wait for - incoming data before falling back to - the normal behaviour of honouring - empty ACK packets. This option is - beneficial for protocols where the - client sends the data first (e.g. - HTTP, in contrast to SMTP), because - the server process will not be woken - up unnecessarily before it can take - any action. -

If the client also uses the - TCP_DEFER_ACCEPT - option, the latency of the initial - connection may be reduced, because the - kernel will send data in the final - packet establishing the connection - (the third packet in the "three-way - handshake").

Disabled by default.

ReceiveBuffer=, SendBuffer=¶

Takes an integer - argument controlling the receive or - send buffer sizes of this socket, - respectively. This controls the - SO_RCVBUF and SO_SNDBUF socket options - (see - socket(7) - for details.). The usual suffixes K, - M, G are supported and are understood - to the base of 1024.

IPTOS=¶

Takes an integer - argument controlling the IP - Type-Of-Service field for packets - generated from this socket. This - controls the IP_TOS socket option (see - ip(7) - for details.). Either a numeric string - or one of low-delay, - throughput, - reliability or - low-cost may be - specified.

IPTTL=¶

Takes an integer - argument controlling the IPv4 - Time-To-Live/IPv6 Hop-Count field for - packets generated from this - socket. This sets the - IP_TTL/IPV6_UNICAST_HOPS socket - options (see - ip(7) - and - ipv6(7) - for details.)

Mark=¶

Takes an integer - value. Controls the firewall mark of - packets generated by this socket. This - can be used in the firewall logic to - filter packets from this socket. This - sets the SO_MARK socket option. See - iptables(8) - for details.

ReusePort=¶

Takes a boolean - value. If true, allows multiple bind(2)s - to this TCP or UDP port. This - controls the SO_REUSEPORT socket - option. See - socket(7) - for details.

SmackLabel=, SmackLabelIPIn=, SmackLabelIPOut=¶

Takes a string - value. Controls the extended - attributes - "security.SMACK64", - "security.SMACK64IPIN" - and - "security.SMACK64IPOUT", - respectively, i.e. the security label - of the FIFO, or the security label for - the incoming or outgoing connections - of the socket, respectively. See - Smack.txt - for details.

SELinuxContextFromNet=¶

Takes a boolean - argument. When true, systemd will attempt - to figure out the SELinux label used - for the instantiated service from the - information handed by the peer over the - network. Note that only the security - level is used from the information - provided by the peer. Other parts of - the resulting SELinux context originate - from either the target binary that is - effectively triggered by socket unit - or from the value of the - SELinuxContext= - option. This configuration option only - affects sockets with - Accept= mode set to - "true". Also note that - this option is useful only when - MLS/MCS SELinux policy is - deployed. Defaults to - "false". -

PipeSize=¶

Takes a size in - bytes. Controls the pipe buffer size - of FIFOs configured in this socket - unit. See - fcntl(2) - for details. The usual suffixes K, M, - G are supported and are understood to - the base of 1024.

MessageQueueMaxMessages=, - MessageQueueMessageSize=¶

These two settings - take integer values and control the - mq_maxmsg field or the mq_msgsize field, respectively, when - creating the message queue. Note that - either none or both of these variables - need to be set. See - mq_setattr(3) - for details.

FreeBind=¶

Takes a boolean - value. Controls whether the socket can - be bound to non-local IP - addresses. This is useful to configure - sockets listening on specific IP - addresses before those IP addresses - are successfully configured on a - network interface. This sets the - IP_FREEBIND socket option. For - robustness reasons it is recommended - to use this option whenever you bind a - socket to a specific IP - address. Defaults to false.

Transparent=¶

Takes a boolean - value. Controls the IP_TRANSPARENT - socket option. Defaults to - false.

Broadcast=¶

Takes a boolean - value. This controls the SO_BROADCAST - socket option, which allows broadcast - datagrams to be sent from this - socket. Defaults to - false.

PassCredentials=¶

Takes a boolean - value. This controls the SO_PASSCRED - socket option, which allows AF_UNIX sockets to - receive the credentials of the sending - process in an ancillary message. - Defaults to - false.

PassSecurity=¶

Takes a boolean - value. This controls the SO_PASSSEC - socket option, which allows AF_UNIX - sockets to receive the security - context of the sending process in an - ancillary message. Defaults to - false.

TCPCongestion=¶

Takes a string - value. Controls the TCP congestion - algorithm used by this socket. Should - be one of "westwood", "veno", "cubic", - "lp" or any other available algorithm - supported by the IP stack. This - setting applies only to stream - sockets.

ExecStartPre=, ExecStartPost=¶

Takes one or more - command lines, which are executed - before or after the listening - sockets/FIFOs are created and - bound, respectively. The first token of the command - line must be an absolute filename, - then followed by arguments for the - process. Multiple command lines may be - specified following the same scheme as - used for - ExecStartPre= of - service unit files.

ExecStopPre=, ExecStopPost=¶

Additional commands - that are executed before or after - the listening sockets/FIFOs are closed - and removed, respectively. Multiple command lines - may be specified following the same - scheme as used for - ExecStartPre= of - service unit files.

TimeoutSec=¶

Configures the time to - wait for the commands specified in - ExecStartPre=, - ExecStartPost=, - ExecStopPre= and - ExecStopPost= to - finish. If a command does not exit - within the configured time, the socket - will be considered failed and be shut - down again. All commands still running - will be terminated forcibly via - SIGTERM, and after another delay of - this time with SIGKILL. (See - KillMode= in systemd.kill(5).) - Takes a unit-less value in seconds, or - a time span value such as "5min - 20s". Pass "0" to disable the timeout - logic. Defaults to DefaultTimeoutStartSec= from the - manager configuration file - (see systemd-system.conf(5)). -

Service=¶

Specifies the service - unit name to activate on incoming - traffic. This setting is only allowed - for sockets with - Accept=no. It - defaults to the service that bears the - same name as the socket (with the - suffix replaced). In most cases, it - should not be necessary to use this - option.

RemoveOnStop=¶

Takes a boolean - argument. If enabled, any file nodes - created by this socket unit are - removed when it is stopped. This - applies to AF_UNIX sockets in the file - system, POSIX message queues, FIFOs, - as well as any symlinks to - them configured with - Symlinks=. Normally, - it should not be necessary to use this - option, and is not recommended as - services might continue to run after - the socket unit has been terminated - and it should still be possible to - communicate with them via their file - system node. Defaults to - off.

Symlinks=¶

Takes a list of file - system paths. The specified paths will - be created as symlinks to the AF_UNIX - socket path or FIFO path of this - socket unit. If this setting is used, - only one AF_UNIX socket in the file - system or one FIFO may be configured - for the socket unit. Use this option - to manage one or more symlinked alias - names for a socket, binding their - lifecycle together. Defaults to the - empty list.

Check - systemd.exec(5) - and - systemd.kill(5) - for more settings.

+ gudev systemd 219

Name

systemd.socket — Socket unit configuration

Synopsis

socket.socket

Description¶

A unit configuration file whose name ends in + ".socket" encodes information about an IPC or + network socket or a file system FIFO controlled and supervised by + systemd, for socket-based activation.

This man page lists the configuration options specific to + this unit type. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The socket specific configuration options are + configured in the [Socket] section.

Additional options are listed in + systemd.exec(5), + which define the execution environment the + ExecStartPre=, ExecStartPost=, + ExecStopPre= and ExecStopPost= + commands are executed in, and in + systemd.kill(5), + which define the way the processes are terminated, and in + systemd.resource-control(5), + which configure resource control settings for the processes of the + socket.

For each socket file, a matching service file must exist, + describing the service to start on incoming traffic on the socket + (see + systemd.service(5) + for more information about .service files). The name of the + .service unit is by default the same as the name of the .socket + unit, but can be altered with the Service= option + described below. Depending on the setting of the + Accept= option described below, this .service + unit must either be named like the .socket unit, but with the + suffix replaced, unless overridden with Service=; + or it must be a template unit named the same way. Example: a + socket file foo.socket needs a matching + service foo.service if + Accept=false is set. If + Accept=true is set, a service template file + foo@.service must exist from which services + are instantiated for each incoming connection.

Unless DefaultDependencies= is set to + false, socket units will implicitly have + dependencies of type Requires= and + After= on sysinit.target + as well as dependencies of type Conflicts= and + Before= on + shutdown.target. These ensure that socket + units pull in basic system initialization, and are terminated + cleanly prior to system shutdown. Only sockets involved with early + boot or late system shutdown should disable this option.

Socket units will have a Before= + dependency on the service which they trigger added implicitly. No + implicit WantedBy= or + RequiredBy= dependency from the socket to the + service is added. This means that the service may be started + without the socket, in which case it must be able to open sockets + by itself. To prevent this, an explicit + Requires= dependency may be added.

Socket units may be used to implement on-demand starting of + services, as well as parallelized starting of services. See the + blog stories linked at the end for an introduction.

Note that the daemon software configured for socket + activation with socket units needs to be able to accept sockets + from systemd, either via systemd's native socket passing interface + (see + sd_listen_fds(3) + for details) or via the traditional + inetd(8)-style + socket passing (i.e. sockets passed in via standard input and + output, using StandardInput=socket in the + service file).

Options¶

Socket files must include a [Socket] section, which carries + information about the socket or FIFO it supervises. A number of + options that may be used in this section are shared with other + unit types. These options are documented in + systemd.exec(5) + and + systemd.kill(5). + The options specific to the [Socket] section of socket units are + the following:

ListenStream=, ListenDatagram=, ListenSequentialPacket=¶

Specifies an address to listen on for a stream + (SOCK_STREAM), datagram + (SOCK_DGRAM), or sequential packet + (SOCK_SEQPACKET) socket, respectively. + The address can be written in various formats:

If the address starts with a slash + ("/"), it is read as file system socket in + the AF_UNIX socket family.

If the address starts with an at symbol + ("@"), it is read as abstract namespace + socket in the AF_UNIX family. The + "@" is replaced with a + NUL character before binding. For + details, see + unix(7).

If the address string is a single number, it is read as + port number to listen on via IPv6. Depending on the value of + BindIPv6Only= (see below) this might result + in the service being available via both IPv6 and IPv4 + (default) or just via IPv6. +

If the address string is a string in the format + v.w.x.y:z, it is read as IPv4 specifier for listening on an + address v.w.x.y on a port z.

If the address string is a string in the format [x]:y, + it is read as IPv6 address x on a port y. Note that this might + make the service available via IPv4, too, depending on the + BindIPv6Only= setting (see below). +

Note that SOCK_SEQPACKET (i.e. + ListenSequentialPacket=) is only available + for AF_UNIX sockets. + SOCK_STREAM (i.e. + ListenStream=) when used for IP sockets + refers to TCP sockets, SOCK_DGRAM (i.e. + ListenDatagram=) to UDP.

These options may be specified more than once in which + case incoming traffic on any of the sockets will trigger + service activation, and all listed sockets will be passed to + the service, regardless of whether there is incoming traffic + on them or not. If the empty string is assigned to any of + these options, the list of addresses to listen on is reset, + all prior uses of any of these options will have no + effect.

It is also possible to have more than one socket unit + for the same service when using Service=, + and the service will receive all the sockets configured in all + the socket units. Sockets configured in one unit are passed in + the order of configuration, but no ordering between socket + units is specified.

If an IP address is used here, it is often desirable to + listen on it before the interface it is configured on is up + and running, and even regardless of whether it will be up and + running at any point. To deal with this, it is recommended to + set the FreeBind= option described + below.

ListenFIFO=¶

Specifies a file system FIFO to listen on. + This expects an absolute file system path as argument. + Behavior otherwise is very similar to the + ListenDatagram= directive + above.

ListenSpecial=¶

Specifies a special file in the file system to + listen on. This expects an absolute file system path as + argument. Behavior otherwise is very similar to the + ListenFIFO= directive above. Use this to + open character device nodes as well as special files in + /proc and + /sys.

ListenNetlink=¶

Specifies a Netlink family to create a socket + for to listen on. This expects a short string referring to the + AF_NETLINK family name (such as + audit or kobject-uevent) + as argument, optionally suffixed by a whitespace followed by a + multicast group integer. Behavior otherwise is very similar to + the ListenDatagram= directive + above.

ListenMessageQueue=¶

Specifies a POSIX message queue name to listen + on. This expects a valid message queue name (i.e. beginning + with /). Behavior otherwise is very similar to the + ListenFIFO= directive above. On Linux + message queue descriptors are actually file descriptors and + can be inherited between processes.

BindIPv6Only=¶

Takes a one of default, + both or ipv6-only. Controls + the IPV6_V6ONLY socket option (see + ipv6(7) + for details). If both, IPv6 sockets bound + will be accessible via both IPv4 and IPv6. If + ipv6-only, they will be accessible via IPv6 + only. If default (which is the default, + surprise!), the system wide default setting is used, as + controlled by + /proc/sys/net/ipv6/bindv6only, which in + turn defaults to the equivalent of + both.

Backlog=¶

Takes an unsigned integer argument. Specifies + the number of connections to queue that have not been accepted + yet. This setting matters only for stream and sequential + packet sockets. See + listen(2) + for details. Defaults to SOMAXCONN (128).

BindToDevice=¶

Specifies a network interface name to bind + this socket to. If set, traffic will only be accepted from the + specified network interfaces. This controls the + SO_BINDTODEVICE socket option (see + socket(7) + for details). If this option is used, an automatic dependency + from this socket unit on the network interface device unit + (systemd.device(5) + is created.

SocketUser=, SocketGroup=¶

Takes a UNIX user/group name. When specified, + all AF_UNIX sockets and FIFO nodes in the file system are + owned by the specified user and group. If unset (the default), + the nodes are owned by the root user/group (if run in system + context) or the invoking user/group (if run in user context). + If only a user is specified but no group, then the group is + derived from the user's default group.

SocketMode=¶

If listening on a file system socket or FIFO, + this option specifies the file system access mode used when + creating the file node. Takes an access mode in octal + notation. Defaults to 0666.

DirectoryMode=¶

If listening on a file system socket or FIFO, + the parent directories are automatically created if needed. + This option specifies the file system access mode used when + creating these directories. Takes an access mode in octal + notation. Defaults to 0755.

Accept=¶

Takes a boolean argument. If true, a service + instance is spawned for each incoming connection and only the + connection socket is passed to it. If false, all listening + sockets themselves are passed to the started service unit, and + only one service unit is spawned for all connections (also see + above). This value is ignored for datagram sockets and FIFOs + where a single service unit unconditionally handles all + incoming traffic. Defaults to false. For + performance reasons, it is recommended to write new daemons + only in a way that is suitable for + Accept=false. A daemon listening on an + AF_UNIX socket may, but does not need to, + call + close(2) + on the received socket before exiting. However, it must not + unlink the socket from a file system. It should not invoke + shutdown(2) + on sockets it got with Accept=false, but it + may do so for sockets it got with + Accept=true set. Setting + Accept=true is mostly useful to allow + daemons designed for usage with + inetd(8) + to work unmodified with systemd socket + activation.

MaxConnections=¶

The maximum number of connections to + simultaneously run services instances for, when + Accept=true is set. If more concurrent + connections are coming in, they will be refused until at least + one existing connection is terminated. This setting has no + effect on sockets configured with + Accept=false or datagram sockets. Defaults to + 64.

KeepAlive=¶

Takes a boolean argument. If true, the TCP/IP + stack will send a keep alive message after 2h (depending on + the configuration of + /proc/sys/net/ipv4/tcp_keepalive_time) + for all TCP streams accepted on this socket. This controls the + SO_KEEPALIVE socket option (see + socket(7) + and the TCP + Keepalive HOWTO for details.) Defaults to + false.

KeepAliveTimeSec=¶

Takes time (in seconds) as argument . The connection needs to remain + idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE + socket option (see + socket(7) + and the TCP + Keepalive HOWTO for details.) + Defaults value is 7200 seconds (2 hours).

KeepAliveIntervalSec=¶

Takes time (in seconds) as argument between + individual keepalive probes, if the socket option SO_KEEPALIVE + has been set on this socket seconds as argument. This controls + the TCP_KEEPINTVL socket option (see + socket(7) + and the TCP + Keepalive HOWTO for details.) Defaults value is 75 + seconds.

KeepAliveProbes=¶

Takes integer as argument. It's the number of + unacknowledged probes to send before considering the + connection dead and notifying the application layer. This + controls the TCP_KEEPCNT socket option (see + socket(7) + and the TCP + Keepalive HOWTO for details.) Defaults value is + 9.

NoDelay=¶

Takes a boolean argument. TCP Nagle's + algorithm works by combining a number of small outgoing + messages, and sending them all at once. This controls the + TCP_NODELAY socket option (see + tcp(7) + Defaults to false.

Priority=¶

Takes an integer argument controlling the + priority for all traffic sent from this socket. This controls + the SO_PRIORITY socket option (see + socket(7) + for details.).

DeferAcceptSec=¶

Takes time (in seconds) as argument. If set, + the listening process will be awakened only when data arrives + on the socket, and not immediately when connection is + established. When this option is set, the + TCP_DEFER_ACCEPT socket option will be + used (see + tcp(7)), + and the kernel will ignore initial ACK packets without any + data. The argument specifies the approximate amount of time + the kernel should wait for incoming data before falling back + to the normal behaviour of honouring empty ACK packets. This + option is beneficial for protocols where the client sends the + data first (e.g. HTTP, in contrast to SMTP), because the + server process will not be woken up unnecessarily before it + can take any action. +

If the client also uses the + TCP_DEFER_ACCEPT option, the latency of + the initial connection may be reduced, because the kernel will + send data in the final packet establishing the connection (the + third packet in the "three-way handshake").

Disabled by default.

ReceiveBuffer=, SendBuffer=¶

Takes an integer argument controlling the + receive or send buffer sizes of this socket, respectively. + This controls the SO_RCVBUF and SO_SNDBUF socket options (see + socket(7) + for details.). The usual suffixes K, M, G are supported and + are understood to the base of 1024.

IPTOS=¶

Takes an integer argument controlling the IP + Type-Of-Service field for packets generated from this socket. + This controls the IP_TOS socket option (see + ip(7) + for details.). Either a numeric string or one of + low-delay, throughput, + reliability or low-cost may + be specified.

IPTTL=¶

Takes an integer argument controlling the IPv4 + Time-To-Live/IPv6 Hop-Count field for packets generated from + this socket. This sets the IP_TTL/IPV6_UNICAST_HOPS socket + options (see + ip(7) + and + ipv6(7) + for details.)

Mark=¶

Takes an integer value. Controls the firewall + mark of packets generated by this socket. This can be used in + the firewall logic to filter packets from this socket. This + sets the SO_MARK socket option. See + iptables(8) + for details.

ReusePort=¶

Takes a boolean value. If true, allows + multiple + bind(2)s + to this TCP or UDP port. This controls the SO_REUSEPORT socket + option. See + socket(7) + for details.

SmackLabel=, SmackLabelIPIn=, SmackLabelIPOut=¶

Takes a string value. Controls the extended + attributes "security.SMACK64", + "security.SMACK64IPIN" and + "security.SMACK64IPOUT", respectively, i.e. + the security label of the FIFO, or the security label for the + incoming or outgoing connections of the socket, respectively. + See Smack.txt + for details.

SELinuxContextFromNet=¶

Takes a boolean argument. When true, systemd + will attempt to figure out the SELinux label used for the + instantiated service from the information handed by the peer + over the network. Note that only the security level is used + from the information provided by the peer. Other parts of the + resulting SELinux context originate from either the target + binary that is effectively triggered by socket unit or from + the value of the SELinuxContext= option. + This configuration option only affects sockets with + Accept= mode set to + "true". Also note that this option is useful + only when MLS/MCS SELinux policy is deployed. Defaults to + "false".

PipeSize=¶

Takes a size in bytes. Controls the pipe + buffer size of FIFOs configured in this socket unit. See + fcntl(2) + for details. The usual suffixes K, M, G are supported and are + understood to the base of 1024.

MessageQueueMaxMessages=, + MessageQueueMessageSize=¶

These two settings take integer values and + control the mq_maxmsg field or the mq_msgsize field, + respectively, when creating the message queue. Note that + either none or both of these variables need to be set. See + mq_setattr(3) + for details.

FreeBind=¶

Takes a boolean value. Controls whether the + socket can be bound to non-local IP addresses. This is useful + to configure sockets listening on specific IP addresses before + those IP addresses are successfully configured on a network + interface. This sets the IP_FREEBIND socket option. For + robustness reasons it is recommended to use this option + whenever you bind a socket to a specific IP address. Defaults + to false.

Transparent=¶

Takes a boolean value. Controls the + IP_TRANSPARENT socket option. Defaults to + false.

Broadcast=¶

Takes a boolean value. This controls the + SO_BROADCAST socket option, which allows broadcast datagrams + to be sent from this socket. Defaults to + false.

PassCredentials=¶

Takes a boolean value. This controls the + SO_PASSCRED socket option, which allows + AF_UNIX sockets to receive the + credentials of the sending process in an ancillary message. + Defaults to false.

PassSecurity=¶

Takes a boolean value. This controls the + SO_PASSSEC socket option, which allows + AF_UNIX sockets to receive the security + context of the sending process in an ancillary message. + Defaults to false.

TCPCongestion=¶

Takes a string value. Controls the TCP + congestion algorithm used by this socket. Should be one of + "westwood", "veno", "cubic", "lp" or any other available + algorithm supported by the IP stack. This setting applies only + to stream sockets.

ExecStartPre=, ExecStartPost=¶

Takes one or more command lines, which are + executed before or after the listening sockets/FIFOs are + created and bound, respectively. The first token of the + command line must be an absolute filename, then followed by + arguments for the process. Multiple command lines may be + specified following the same scheme as used for + ExecStartPre= of service unit + files.

ExecStopPre=, ExecStopPost=¶

Additional commands that are executed before + or after the listening sockets/FIFOs are closed and removed, + respectively. Multiple command lines may be specified + following the same scheme as used for + ExecStartPre= of service unit + files.

TimeoutSec=¶

Configures the time to wait for the commands + specified in ExecStartPre=, + ExecStartPost=, + ExecStopPre= and + ExecStopPost= to finish. If a command does + not exit within the configured time, the socket will be + considered failed and be shut down again. All commands still + running will be terminated forcibly via + SIGTERM, and after another delay of this + time with SIGKILL. (See + KillMode= in + systemd.kill(5).) + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass "0" to disable the + timeout logic. Defaults to + DefaultTimeoutStartSec= from the manager + configuration file (see + systemd-system.conf(5)). +

Service=¶

Specifies the service unit name to activate on + incoming traffic. This setting is only allowed for sockets + with Accept=no. It defaults to the service + that bears the same name as the socket (with the suffix + replaced). In most cases, it should not be necessary to use + this option.

RemoveOnStop=¶

Takes a boolean argument. If enabled, any file + nodes created by this socket unit are removed when it is + stopped. This applies to AF_UNIX sockets in the file system, + POSIX message queues, FIFOs, as well as any symlinks to them + configured with Symlinks=. Normally, it + should not be necessary to use this option, and is not + recommended as services might continue to run after the socket + unit has been terminated and it should still be possible to + communicate with them via their file system node. Defaults to + off.

Symlinks=¶

Takes a list of file system paths. The + specified paths will be created as symlinks to the AF_UNIX + socket path or FIFO path of this socket unit. If this setting + is used, only one AF_UNIX socket in the file system or one + FIFO may be configured for the socket unit. Use this option to + manage one or more symlinked alias names for a socket, binding + their lifecycle together. Defaults to the empty + list.

Check + systemd.exec(5) + and + systemd.kill(5) + for more settings.

diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index 57f769f23..3938345fa 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.socket - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.socket - 5 - - - - systemd.socket - Socket unit configuration - - - - socket.socket - - - - Description - - A unit configuration file whose name ends in - .socket encodes information about - an IPC or network socket or a file system FIFO - controlled and supervised by systemd, for socket-based - activation. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - socket specific configuration options are configured - in the [Socket] section. - - Additional options are listed in - systemd.exec5, - which define the execution environment the - , - , - and - commands are executed - in, and in - systemd.kill5, - which define the way the processes are terminated, and - in - systemd.resource-control5, - which configure resource control settings for the - processes of the socket. - - For each socket file, a matching service file - must exist, describing the service to start on - incoming traffic on the socket (see - systemd.service5 - for more information about .service files). The name - of the .service unit is by default the same as the - name of the .socket unit, but can be altered with the - option described below. - Depending on the setting of the - option described below, this .service unit must either - be named like the .socket unit, but with the suffix - replaced, unless overridden with - ; or it must be a template - unit named the same way. Example: a socket file - foo.socket needs a matching - service foo.service if - is set. If - is set, a service - template file foo@.service must - exist from which services are instantiated for each - incoming connection. - - Unless DefaultDependencies= - is set to , socket units will - implicitly have dependencies of type - Requires= and - After= on - sysinit.target as well as - dependencies of type Conflicts= and - Before= on - shutdown.target. These ensure - that socket units pull in basic system - initialization, and are terminated cleanly prior to - system shutdown. Only sockets involved with early - boot or late system shutdown should disable this - option. - - Socket units will have a - Before= dependency on the service - which they trigger added implicitly. No implicit - WantedBy= or - RequiredBy= dependency from the - socket to the service is added. This means that the - service may be started without the socket, in which - case it must be able to open sockets by itself. To - prevent this, an explicit Requires= - dependency may be added. - - Socket units may be used to implement on-demand - starting of services, as well as parallelized starting - of services. See the blog stories linked at the end - for an introduction. - - Note that the daemon software configured for - socket activation with socket units needs to be able - to accept sockets from systemd, either via systemd's - native socket passing interface (see - sd_listen_fds3 - for details) or via the traditional - inetd8-style - socket passing (i.e. sockets passed in via standard input and - output, using StandardInput=socket - in the service file). - - - - Options - - Socket files must include a [Socket] section, - which carries information about the socket or FIFO it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec5 - and - systemd.kill5. The - options specific to the [Socket] section of socket - units are the following: - - - - ListenStream= - ListenDatagram= - ListenSequentialPacket= - Specifies an address - to listen on for a stream - (SOCK_STREAM), datagram (SOCK_DGRAM), - or sequential packet - (SOCK_SEQPACKET) socket, respectively. The address - can be written in various formats: - - If the address starts with a - slash (/), it is read as file system - socket in the AF_UNIX socket - family. - - If the address starts with an at - symbol (@), it is read as abstract - namespace socket in the - AF_UNIX - family. The @ is - replaced with a - NUL character - before binding. For details, see - unix7. - - If the address string is a - single number, it is read as port - number to listen on via - IPv6. Depending on the value of - BindIPv6Only= (see below) this - might result in the service being - available via both IPv6 and IPv4 (default) or - just via IPv6. - - - If the address string is a - string in the format v.w.x.y:z, it is - read as IPv4 specifier for listening - on an address v.w.x.y on a port - z. - - If the address string is a - string in the format [x]:y, it is read - as IPv6 address x on a port y. Note - that this might make the service - available via IPv4, too, depending on - the BindIPv6Only= - setting (see below). - - - Note that SOCK_SEQPACKET - (i.e. ListenSequentialPacket=) - is only available for AF_UNIX - sockets. SOCK_STREAM - (i.e. ListenStream=) - when used for IP sockets refers to TCP - sockets, SOCK_DGRAM - (i.e. ListenDatagram=) - to UDP. - - These options may be specified - more than once in which case incoming - traffic on any of the sockets will - trigger service activation, and all - listed sockets will be passed to the - service, regardless of whether there is - incoming traffic on them or not. If - the empty string is assigned to any of - these options, the list of addresses - to listen on is reset, all prior uses - of any of these options will have no - effect. - - It is also possible to have more - than one socket unit for the same - service when using - Service=, and the - service will receive all the sockets - configured in all the socket units. - Sockets configured in one unit are - passed in the order of configuration, - but no ordering between socket units - is specified. - - If an IP address is used here, - it is often desirable to listen on it - before the interface it is configured - on is up and running, and even - regardless of whether it will be up and - running at any point. To deal with this, - it is recommended to set the - FreeBind= option - described below. - - - - ListenFIFO= - Specifies a file - system FIFO to listen on. This expects - an absolute file system path as - argument. Behavior otherwise is very - similar to the - ListenDatagram= - directive above. - - - - ListenSpecial= - Specifies a special - file in the file system to listen - on. This expects an absolute file - system path as argument. Behavior - otherwise is very similar to the - ListenFIFO= - directive above. Use this to open - character device nodes as well as - special files in - /proc and - /sys. - - - - ListenNetlink= - Specifies a Netlink - family to create a socket for to - listen on. This expects a short string - referring to the AF_NETLINK family - name (such as audit - or kobject-uevent) - as argument, optionally suffixed by a - whitespace followed by a multicast - group integer. Behavior otherwise is - very similar to the - ListenDatagram= - directive above. - - - - ListenMessageQueue= - Specifies a POSIX - message queue name to listen on. This - expects a valid message queue name - (i.e. beginning with /). Behavior - otherwise is very similar to the - ListenFIFO= - directive above. On Linux message - queue descriptors are actually file - descriptors and can be inherited - between processes. - - - - BindIPv6Only= - Takes a one of - , - or - . Controls - the IPV6_V6ONLY socket option (see - ipv67 - for details). If - , IPv6 sockets - bound will be accessible via both IPv4 - and IPv6. If - , they will - be accessible via IPv6 only. If - (which is the - default, surprise!), the system wide - default setting is used, as controlled - by - /proc/sys/net/ipv6/bindv6only, - which in turn defaults to the - equivalent of - . - - - - - Backlog= - Takes an unsigned - integer argument. Specifies the number - of connections to queue that have not - been accepted yet. This setting - matters only for stream and sequential - packet sockets. See - listen2 - for details. Defaults to SOMAXCONN - (128). - - - - BindToDevice= - Specifies a network - interface name to bind this socket - to. If set, traffic will only be - accepted from the specified network - interfaces. This controls the - SO_BINDTODEVICE socket option (see - socket7 - for details). If this option is used, - an automatic dependency from this - socket unit on the network interface - device unit - (systemd.device5 - is created. - - - - SocketUser= - SocketGroup= - - Takes a UNIX - user/group name. When specified, - all AF_UNIX sockets and FIFO nodes in - the file system are owned by the - specified user and group. If unset - (the default), the nodes are owned by - the root user/group (if run in system - context) or the invoking user/group - (if run in user context). If only a - user is specified but no group, then - the group is derived from the user's - default group. - - - - SocketMode= - If listening on a file - system socket or FIFO, this option - specifies the file system access mode - used when creating the file - node. Takes an access mode in octal - notation. Defaults to - 0666. - - - - DirectoryMode= - If listening on a file - system socket or FIFO, the parent - directories are automatically created - if needed. This option specifies the - file system access mode used when - creating these directories. Takes an - access mode in octal - notation. Defaults to - 0755. - - - - Accept= - Takes a boolean - argument. If true, a service instance - is spawned for each incoming - connection and only the connection - socket is passed to it. If false, all - listening sockets themselves are - passed to the started service unit, - and only one service unit is spawned - for all connections (also see - above). This value is ignored for - datagram sockets and FIFOs where a - single service unit unconditionally - handles all incoming traffic. Defaults - to . For - performance reasons, it is recommended - to write new daemons only in a way - that is suitable for - . A - daemon listening on an AF_UNIX socket - may, but does not need to, call - close2 - on the received socket before - exiting. However, it must not unlink - the socket from a file system. It - should not invoke - shutdown2 - on sockets it got with - Accept=false, but - it may do so for sockets it got with - Accept=true set. - Setting Accept=true - is mostly useful to allow daemons - designed for usage with - inetd8 - to work unmodified with systemd socket - activation. - - - - MaxConnections= - The maximum number of - connections to simultaneously run - services instances for, when - is - set. If more concurrent connections - are coming in, they will be refused - until at least one existing connection - is terminated. This setting has no - effect on sockets configured with - or datagram - sockets. Defaults to - 64. - - - - KeepAlive= - Takes a boolean - argument. If true, the TCP/IP stack - will send a keep alive message after - 2h (depending on the configuration of - /proc/sys/net/ipv4/tcp_keepalive_time) - for all TCP streams accepted on this - socket. This controls the SO_KEEPALIVE - socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) - Defaults to - . - - - - KeepAliveTimeSec= - Takes time (in seconds) as argument . The connection needs to remain - idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE - socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) - Defaults value is 7200 seconds (2 hours). - - - - KeepAliveIntervalSec= - Takes time (in seconds) as argument between individual keepalive probes, - if the socket option SO_KEEPALIVE has been set on this socket seconds as argument. - This controls the TCP_KEEPINTVL socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) - Defaults value is 75 seconds. - - - - KeepAliveProbes= - Takes integer as argument. It's the number of unacknowledged probes to - send before considering the connection dead and notifying the application layer. - This controls the TCP_KEEPCNT socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) - Defaults value is 9. - - - - NoDelay= - Takes a boolean - argument. TCP Nagle's algorithm works by combining a number of - small outgoing messages, and sending them all at once. - This controls the TCP_NODELAY socket option (see - tcp7 - Defaults to - . - - - - Priority= - Takes an integer - argument controlling the priority for - all traffic sent from this - socket. This controls the SO_PRIORITY - socket option (see - socket7 - for details.). - - - - DeferAcceptSec= - - Takes time (in - seconds) as argument. If set, the - listening process will be awakened - only when data arrives on the socket, - and not immediately when connection is - established. When this option is set, - the - TCP_DEFER_ACCEPT - socket option will be used (see - tcp7), - and the kernel will ignore initial ACK - packets without any data. The argument - specifies the approximate amount of - time the kernel should wait for - incoming data before falling back to - the normal behaviour of honouring - empty ACK packets. This option is - beneficial for protocols where the - client sends the data first (e.g. - HTTP, in contrast to SMTP), because - the server process will not be woken - up unnecessarily before it can take - any action. - - - If the client also uses the - TCP_DEFER_ACCEPT - option, the latency of the initial - connection may be reduced, because the - kernel will send data in the final - packet establishing the connection - (the third packet in the "three-way - handshake"). - - Disabled by default. - - - - - ReceiveBuffer= - SendBuffer= - Takes an integer - argument controlling the receive or - send buffer sizes of this socket, - respectively. This controls the - SO_RCVBUF and SO_SNDBUF socket options - (see - socket7 - for details.). The usual suffixes K, - M, G are supported and are understood - to the base of 1024. - - - - IPTOS= - Takes an integer - argument controlling the IP - Type-Of-Service field for packets - generated from this socket. This - controls the IP_TOS socket option (see - ip7 - for details.). Either a numeric string - or one of , - , - or - may be - specified. - - - - IPTTL= - Takes an integer - argument controlling the IPv4 - Time-To-Live/IPv6 Hop-Count field for - packets generated from this - socket. This sets the - IP_TTL/IPV6_UNICAST_HOPS socket - options (see - ip7 - and - ipv67 - for details.) - - - - Mark= - Takes an integer - value. Controls the firewall mark of - packets generated by this socket. This - can be used in the firewall logic to - filter packets from this socket. This - sets the SO_MARK socket option. See - iptables8 - for details. - - - - ReusePort= - Takes a boolean - value. If true, allows multiple bind2s - to this TCP or UDP port. This - controls the SO_REUSEPORT socket - option. See - socket7 - for details. - - - - SmackLabel= - SmackLabelIPIn= - SmackLabelIPOut= - Takes a string - value. Controls the extended - attributes - security.SMACK64, - security.SMACK64IPIN - and - security.SMACK64IPOUT, - respectively, i.e. the security label - of the FIFO, or the security label for - the incoming or outgoing connections - of the socket, respectively. See - Smack.txt - for details. - - - - SELinuxContextFromNet= - Takes a boolean - argument. When true, systemd will attempt - to figure out the SELinux label used - for the instantiated service from the - information handed by the peer over the - network. Note that only the security - level is used from the information - provided by the peer. Other parts of - the resulting SELinux context originate - from either the target binary that is - effectively triggered by socket unit - or from the value of the - SELinuxContext= - option. This configuration option only - affects sockets with - Accept= mode set to - true. Also note that - this option is useful only when - MLS/MCS SELinux policy is - deployed. Defaults to - false. - - - - - PipeSize= - Takes a size in - bytes. Controls the pipe buffer size - of FIFOs configured in this socket - unit. See - fcntl2 - for details. The usual suffixes K, M, - G are supported and are understood to - the base of 1024. - - - - MessageQueueMaxMessages=, - MessageQueueMessageSize= - These two settings - take integer values and control the - mq_maxmsg field or the mq_msgsize field, respectively, when - creating the message queue. Note that - either none or both of these variables - need to be set. See - mq_setattr3 - for details. - - - - FreeBind= - Takes a boolean - value. Controls whether the socket can - be bound to non-local IP - addresses. This is useful to configure - sockets listening on specific IP - addresses before those IP addresses - are successfully configured on a - network interface. This sets the - IP_FREEBIND socket option. For - robustness reasons it is recommended - to use this option whenever you bind a - socket to a specific IP - address. Defaults to . - - - - Transparent= - Takes a boolean - value. Controls the IP_TRANSPARENT - socket option. Defaults to - . - - - - Broadcast= - Takes a boolean - value. This controls the SO_BROADCAST - socket option, which allows broadcast - datagrams to be sent from this - socket. Defaults to - . - - - - PassCredentials= - Takes a boolean - value. This controls the SO_PASSCRED - socket option, which allows AF_UNIX sockets to - receive the credentials of the sending - process in an ancillary message. - Defaults to - . - - - - PassSecurity= - Takes a boolean - value. This controls the SO_PASSSEC - socket option, which allows AF_UNIX - sockets to receive the security - context of the sending process in an - ancillary message. Defaults to - . - - - - TCPCongestion= - Takes a string - value. Controls the TCP congestion - algorithm used by this socket. Should - be one of "westwood", "veno", "cubic", - "lp" or any other available algorithm - supported by the IP stack. This - setting applies only to stream - sockets. - - - - ExecStartPre= - ExecStartPost= - Takes one or more - command lines, which are executed - before or after the listening - sockets/FIFOs are created and - bound, respectively. The first token of the command - line must be an absolute filename, - then followed by arguments for the - process. Multiple command lines may be - specified following the same scheme as - used for - ExecStartPre= of - service unit files. - - - - ExecStopPre= - ExecStopPost= - Additional commands - that are executed before or after - the listening sockets/FIFOs are closed - and removed, respectively. Multiple command lines - may be specified following the same - scheme as used for - ExecStartPre= of - service unit files. - - - - TimeoutSec= - Configures the time to - wait for the commands specified in - ExecStartPre=, - ExecStartPost=, - ExecStopPre= and - ExecStopPost= to - finish. If a command does not exit - within the configured time, the socket - will be considered failed and be shut - down again. All commands still running - will be terminated forcibly via - SIGTERM, and after another delay of - this time with SIGKILL. (See - in systemd.kill5.) - Takes a unit-less value in seconds, or - a time span value such as "5min - 20s". Pass 0 to disable the timeout - logic. Defaults to DefaultTimeoutStartSec= from the - manager configuration file - (see systemd-system.conf5). - - - - - Service= - Specifies the service - unit name to activate on incoming - traffic. This setting is only allowed - for sockets with - Accept=no. It - defaults to the service that bears the - same name as the socket (with the - suffix replaced). In most cases, it - should not be necessary to use this - option. - - - - RemoveOnStop= - Takes a boolean - argument. If enabled, any file nodes - created by this socket unit are - removed when it is stopped. This - applies to AF_UNIX sockets in the file - system, POSIX message queues, FIFOs, - as well as any symlinks to - them configured with - Symlinks=. Normally, - it should not be necessary to use this - option, and is not recommended as - services might continue to run after - the socket unit has been terminated - and it should still be possible to - communicate with them via their file - system node. Defaults to - off. - - - - Symlinks= - Takes a list of file - system paths. The specified paths will - be created as symlinks to the AF_UNIX - socket path or FIFO path of this - socket unit. If this setting is used, - only one AF_UNIX socket in the file - system or one FIFO may be configured - for the socket unit. Use this option - to manage one or more symlinked alias - names for a socket, binding their - lifecycle together. Defaults to the - empty list. - - - - - Check - systemd.exec5 - and - systemd.kill5 - for more settings. - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.exec5, - systemd.kill5, - systemd.resource-control5, - systemd.service5, - systemd.directives7 - - - - For more extensive descriptions see the "systemd for Developers" series: - Socket Activation, - Socket Activation, part II, - Converting inetd Services, - Socket Activated Internet Services and OS Containers. - - + + systemd.socket + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.socket + 5 + + + + systemd.socket + Socket unit configuration + + + + socket.socket + + + + Description + + A unit configuration file whose name ends in + .socket encodes information about an IPC or + network socket or a file system FIFO controlled and supervised by + systemd, for socket-based activation. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The socket specific configuration options are + configured in the [Socket] section. + + Additional options are listed in + systemd.exec5, + which define the execution environment the + , , + and + commands are executed in, and in + systemd.kill5, + which define the way the processes are terminated, and in + systemd.resource-control5, + which configure resource control settings for the processes of the + socket. + + For each socket file, a matching service file must exist, + describing the service to start on incoming traffic on the socket + (see + systemd.service5 + for more information about .service files). The name of the + .service unit is by default the same as the name of the .socket + unit, but can be altered with the option + described below. Depending on the setting of the + option described below, this .service + unit must either be named like the .socket unit, but with the + suffix replaced, unless overridden with ; + or it must be a template unit named the same way. Example: a + socket file foo.socket needs a matching + service foo.service if + is set. If + is set, a service template file + foo@.service must exist from which services + are instantiated for each incoming connection. + + Unless DefaultDependencies= is set to + , socket units will implicitly have + dependencies of type Requires= and + After= on sysinit.target + as well as dependencies of type Conflicts= and + Before= on + shutdown.target. These ensure that socket + units pull in basic system initialization, and are terminated + cleanly prior to system shutdown. Only sockets involved with early + boot or late system shutdown should disable this option. + + Socket units will have a Before= + dependency on the service which they trigger added implicitly. No + implicit WantedBy= or + RequiredBy= dependency from the socket to the + service is added. This means that the service may be started + without the socket, in which case it must be able to open sockets + by itself. To prevent this, an explicit + Requires= dependency may be added. + + Socket units may be used to implement on-demand starting of + services, as well as parallelized starting of services. See the + blog stories linked at the end for an introduction. + + Note that the daemon software configured for socket + activation with socket units needs to be able to accept sockets + from systemd, either via systemd's native socket passing interface + (see + sd_listen_fds3 + for details) or via the traditional + inetd8-style + socket passing (i.e. sockets passed in via standard input and + output, using StandardInput=socket in the + service file). + + + + Options + + Socket files must include a [Socket] section, which carries + information about the socket or FIFO it supervises. A number of + options that may be used in this section are shared with other + unit types. These options are documented in + systemd.exec5 + and + systemd.kill5. + The options specific to the [Socket] section of socket units are + the following: + + + + ListenStream= + ListenDatagram= + ListenSequentialPacket= + Specifies an address to listen on for a stream + (SOCK_STREAM), datagram + (SOCK_DGRAM), or sequential packet + (SOCK_SEQPACKET) socket, respectively. + The address can be written in various formats: + + If the address starts with a slash + (/), it is read as file system socket in + the AF_UNIX socket family. + + If the address starts with an at symbol + (@), it is read as abstract namespace + socket in the AF_UNIX family. The + @ is replaced with a + NUL character before binding. For + details, see + unix7. + + If the address string is a single number, it is read as + port number to listen on via IPv6. Depending on the value of + BindIPv6Only= (see below) this might result + in the service being available via both IPv6 and IPv4 + (default) or just via IPv6. + + + If the address string is a string in the format + v.w.x.y:z, it is read as IPv4 specifier for listening on an + address v.w.x.y on a port z. + + If the address string is a string in the format [x]:y, + it is read as IPv6 address x on a port y. Note that this might + make the service available via IPv4, too, depending on the + BindIPv6Only= setting (see below). + + + Note that SOCK_SEQPACKET (i.e. + ListenSequentialPacket=) is only available + for AF_UNIX sockets. + SOCK_STREAM (i.e. + ListenStream=) when used for IP sockets + refers to TCP sockets, SOCK_DGRAM (i.e. + ListenDatagram=) to UDP. + + These options may be specified more than once in which + case incoming traffic on any of the sockets will trigger + service activation, and all listed sockets will be passed to + the service, regardless of whether there is incoming traffic + on them or not. If the empty string is assigned to any of + these options, the list of addresses to listen on is reset, + all prior uses of any of these options will have no + effect. + + It is also possible to have more than one socket unit + for the same service when using Service=, + and the service will receive all the sockets configured in all + the socket units. Sockets configured in one unit are passed in + the order of configuration, but no ordering between socket + units is specified. + + If an IP address is used here, it is often desirable to + listen on it before the interface it is configured on is up + and running, and even regardless of whether it will be up and + running at any point. To deal with this, it is recommended to + set the FreeBind= option described + below. + + + + ListenFIFO= + Specifies a file system FIFO to listen on. + This expects an absolute file system path as argument. + Behavior otherwise is very similar to the + ListenDatagram= directive + above. + + + + ListenSpecial= + Specifies a special file in the file system to + listen on. This expects an absolute file system path as + argument. Behavior otherwise is very similar to the + ListenFIFO= directive above. Use this to + open character device nodes as well as special files in + /proc and + /sys. + + + + ListenNetlink= + Specifies a Netlink family to create a socket + for to listen on. This expects a short string referring to the + AF_NETLINK family name (such as + audit or kobject-uevent) + as argument, optionally suffixed by a whitespace followed by a + multicast group integer. Behavior otherwise is very similar to + the ListenDatagram= directive + above. + + + + ListenMessageQueue= + Specifies a POSIX message queue name to listen + on. This expects a valid message queue name (i.e. beginning + with /). Behavior otherwise is very similar to the + ListenFIFO= directive above. On Linux + message queue descriptors are actually file descriptors and + can be inherited between processes. + + + + BindIPv6Only= + Takes a one of , + or . Controls + the IPV6_V6ONLY socket option (see + ipv67 + for details). If , IPv6 sockets bound + will be accessible via both IPv4 and IPv6. If + , they will be accessible via IPv6 + only. If (which is the default, + surprise!), the system wide default setting is used, as + controlled by + /proc/sys/net/ipv6/bindv6only, which in + turn defaults to the equivalent of + . + + + + + Backlog= + Takes an unsigned integer argument. Specifies + the number of connections to queue that have not been accepted + yet. This setting matters only for stream and sequential + packet sockets. See + listen2 + for details. Defaults to SOMAXCONN (128). + + + + BindToDevice= + Specifies a network interface name to bind + this socket to. If set, traffic will only be accepted from the + specified network interfaces. This controls the + SO_BINDTODEVICE socket option (see + socket7 + for details). If this option is used, an automatic dependency + from this socket unit on the network interface device unit + (systemd.device5 + is created. + + + + SocketUser= + SocketGroup= + + Takes a UNIX user/group name. When specified, + all AF_UNIX sockets and FIFO nodes in the file system are + owned by the specified user and group. If unset (the default), + the nodes are owned by the root user/group (if run in system + context) or the invoking user/group (if run in user context). + If only a user is specified but no group, then the group is + derived from the user's default group. + + + + SocketMode= + If listening on a file system socket or FIFO, + this option specifies the file system access mode used when + creating the file node. Takes an access mode in octal + notation. Defaults to 0666. + + + + DirectoryMode= + If listening on a file system socket or FIFO, + the parent directories are automatically created if needed. + This option specifies the file system access mode used when + creating these directories. Takes an access mode in octal + notation. Defaults to 0755. + + + + Accept= + Takes a boolean argument. If true, a service + instance is spawned for each incoming connection and only the + connection socket is passed to it. If false, all listening + sockets themselves are passed to the started service unit, and + only one service unit is spawned for all connections (also see + above). This value is ignored for datagram sockets and FIFOs + where a single service unit unconditionally handles all + incoming traffic. Defaults to . For + performance reasons, it is recommended to write new daemons + only in a way that is suitable for + . A daemon listening on an + AF_UNIX socket may, but does not need to, + call + close2 + on the received socket before exiting. However, it must not + unlink the socket from a file system. It should not invoke + shutdown2 + on sockets it got with Accept=false, but it + may do so for sockets it got with + Accept=true set. Setting + Accept=true is mostly useful to allow + daemons designed for usage with + inetd8 + to work unmodified with systemd socket + activation. + + + + MaxConnections= + The maximum number of connections to + simultaneously run services instances for, when + is set. If more concurrent + connections are coming in, they will be refused until at least + one existing connection is terminated. This setting has no + effect on sockets configured with + or datagram sockets. Defaults to + 64. + + + + KeepAlive= + Takes a boolean argument. If true, the TCP/IP + stack will send a keep alive message after 2h (depending on + the configuration of + /proc/sys/net/ipv4/tcp_keepalive_time) + for all TCP streams accepted on this socket. This controls the + SO_KEEPALIVE socket option (see + socket7 + and the TCP + Keepalive HOWTO for details.) Defaults to + . + + + + KeepAliveTimeSec= + Takes time (in seconds) as argument . The connection needs to remain + idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE + socket option (see + socket7 + and the TCP + Keepalive HOWTO for details.) + Defaults value is 7200 seconds (2 hours). + + + + KeepAliveIntervalSec= + Takes time (in seconds) as argument between + individual keepalive probes, if the socket option SO_KEEPALIVE + has been set on this socket seconds as argument. This controls + the TCP_KEEPINTVL socket option (see + socket7 + and the TCP + Keepalive HOWTO for details.) Defaults value is 75 + seconds. + + + + KeepAliveProbes= + Takes integer as argument. It's the number of + unacknowledged probes to send before considering the + connection dead and notifying the application layer. This + controls the TCP_KEEPCNT socket option (see + socket7 + and the TCP + Keepalive HOWTO for details.) Defaults value is + 9. + + + + NoDelay= + Takes a boolean argument. TCP Nagle's + algorithm works by combining a number of small outgoing + messages, and sending them all at once. This controls the + TCP_NODELAY socket option (see + tcp7 + Defaults to . + + + + Priority= + Takes an integer argument controlling the + priority for all traffic sent from this socket. This controls + the SO_PRIORITY socket option (see + socket7 + for details.). + + + + DeferAcceptSec= + + Takes time (in seconds) as argument. If set, + the listening process will be awakened only when data arrives + on the socket, and not immediately when connection is + established. When this option is set, the + TCP_DEFER_ACCEPT socket option will be + used (see + tcp7), + and the kernel will ignore initial ACK packets without any + data. The argument specifies the approximate amount of time + the kernel should wait for incoming data before falling back + to the normal behaviour of honouring empty ACK packets. This + option is beneficial for protocols where the client sends the + data first (e.g. HTTP, in contrast to SMTP), because the + server process will not be woken up unnecessarily before it + can take any action. + + + If the client also uses the + TCP_DEFER_ACCEPT option, the latency of + the initial connection may be reduced, because the kernel will + send data in the final packet establishing the connection (the + third packet in the "three-way handshake"). + + Disabled by default. + + + + + ReceiveBuffer= + SendBuffer= + Takes an integer argument controlling the + receive or send buffer sizes of this socket, respectively. + This controls the SO_RCVBUF and SO_SNDBUF socket options (see + socket7 + for details.). The usual suffixes K, M, G are supported and + are understood to the base of 1024. + + + + IPTOS= + Takes an integer argument controlling the IP + Type-Of-Service field for packets generated from this socket. + This controls the IP_TOS socket option (see + ip7 + for details.). Either a numeric string or one of + , , + or may + be specified. + + + + IPTTL= + Takes an integer argument controlling the IPv4 + Time-To-Live/IPv6 Hop-Count field for packets generated from + this socket. This sets the IP_TTL/IPV6_UNICAST_HOPS socket + options (see + ip7 + and + ipv67 + for details.) + + + + Mark= + Takes an integer value. Controls the firewall + mark of packets generated by this socket. This can be used in + the firewall logic to filter packets from this socket. This + sets the SO_MARK socket option. See + iptables8 + for details. + + + + ReusePort= + Takes a boolean value. If true, allows + multiple + bind2s + to this TCP or UDP port. This controls the SO_REUSEPORT socket + option. See + socket7 + for details. + + + + SmackLabel= + SmackLabelIPIn= + SmackLabelIPOut= + Takes a string value. Controls the extended + attributes security.SMACK64, + security.SMACK64IPIN and + security.SMACK64IPOUT, respectively, i.e. + the security label of the FIFO, or the security label for the + incoming or outgoing connections of the socket, respectively. + See Smack.txt + for details. + + + + SELinuxContextFromNet= + Takes a boolean argument. When true, systemd + will attempt to figure out the SELinux label used for the + instantiated service from the information handed by the peer + over the network. Note that only the security level is used + from the information provided by the peer. Other parts of the + resulting SELinux context originate from either the target + binary that is effectively triggered by socket unit or from + the value of the SELinuxContext= option. + This configuration option only affects sockets with + Accept= mode set to + true. Also note that this option is useful + only when MLS/MCS SELinux policy is deployed. Defaults to + false. + + + + PipeSize= + Takes a size in bytes. Controls the pipe + buffer size of FIFOs configured in this socket unit. See + fcntl2 + for details. The usual suffixes K, M, G are supported and are + understood to the base of 1024. + + + + MessageQueueMaxMessages=, + MessageQueueMessageSize= + These two settings take integer values and + control the mq_maxmsg field or the mq_msgsize field, + respectively, when creating the message queue. Note that + either none or both of these variables need to be set. See + mq_setattr3 + for details. + + + + FreeBind= + Takes a boolean value. Controls whether the + socket can be bound to non-local IP addresses. This is useful + to configure sockets listening on specific IP addresses before + those IP addresses are successfully configured on a network + interface. This sets the IP_FREEBIND socket option. For + robustness reasons it is recommended to use this option + whenever you bind a socket to a specific IP address. Defaults + to . + + + + Transparent= + Takes a boolean value. Controls the + IP_TRANSPARENT socket option. Defaults to + . + + + + Broadcast= + Takes a boolean value. This controls the + SO_BROADCAST socket option, which allows broadcast datagrams + to be sent from this socket. Defaults to + . + + + + PassCredentials= + Takes a boolean value. This controls the + SO_PASSCRED socket option, which allows + AF_UNIX sockets to receive the + credentials of the sending process in an ancillary message. + Defaults to . + + + + PassSecurity= + Takes a boolean value. This controls the + SO_PASSSEC socket option, which allows + AF_UNIX sockets to receive the security + context of the sending process in an ancillary message. + Defaults to . + + + + TCPCongestion= + Takes a string value. Controls the TCP + congestion algorithm used by this socket. Should be one of + "westwood", "veno", "cubic", "lp" or any other available + algorithm supported by the IP stack. This setting applies only + to stream sockets. + + + + ExecStartPre= + ExecStartPost= + Takes one or more command lines, which are + executed before or after the listening sockets/FIFOs are + created and bound, respectively. The first token of the + command line must be an absolute filename, then followed by + arguments for the process. Multiple command lines may be + specified following the same scheme as used for + ExecStartPre= of service unit + files. + + + + ExecStopPre= + ExecStopPost= + Additional commands that are executed before + or after the listening sockets/FIFOs are closed and removed, + respectively. Multiple command lines may be specified + following the same scheme as used for + ExecStartPre= of service unit + files. + + + + TimeoutSec= + Configures the time to wait for the commands + specified in ExecStartPre=, + ExecStartPost=, + ExecStopPre= and + ExecStopPost= to finish. If a command does + not exit within the configured time, the socket will be + considered failed and be shut down again. All commands still + running will be terminated forcibly via + SIGTERM, and after another delay of this + time with SIGKILL. (See + in + systemd.kill5.) + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass 0 to disable the + timeout logic. Defaults to + DefaultTimeoutStartSec= from the manager + configuration file (see + systemd-system.conf5). + + + + + Service= + Specifies the service unit name to activate on + incoming traffic. This setting is only allowed for sockets + with Accept=no. It defaults to the service + that bears the same name as the socket (with the suffix + replaced). In most cases, it should not be necessary to use + this option. + + + + RemoveOnStop= + Takes a boolean argument. If enabled, any file + nodes created by this socket unit are removed when it is + stopped. This applies to AF_UNIX sockets in the file system, + POSIX message queues, FIFOs, as well as any symlinks to them + configured with Symlinks=. Normally, it + should not be necessary to use this option, and is not + recommended as services might continue to run after the socket + unit has been terminated and it should still be possible to + communicate with them via their file system node. Defaults to + off. + + + + Symlinks= + Takes a list of file system paths. The + specified paths will be created as symlinks to the AF_UNIX + socket path or FIFO path of this socket unit. If this setting + is used, only one AF_UNIX socket in the file system or one + FIFO may be configured for the socket unit. Use this option to + manage one or more symlinked alias names for a socket, binding + their lifecycle together. Defaults to the empty + list. + + + + + Check + systemd.exec5 + and + systemd.kill5 + for more settings. + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.exec5, + systemd.kill5, + systemd.resource-control5, + systemd.service5, + systemd.directives7 + + + + For more extensive descriptions see the "systemd for Developers" series: + Socket Activation, + Socket Activation, part II, + Converting inetd Services, + Socket Activated Internet Services and OS Containers. + + diff --git a/man/systemd.special.7 b/man/systemd.special.7 index 4b1d407fb..2878260fa 100644 --- a/man/systemd.special.7 +++ b/man/systemd.special.7 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.SPECIAL" "7" "" "systemd 218" "systemd.special" +.TH "SYSTEMD\&.SPECIAL" "7" "" "systemd 219" "systemd.special" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.special.html b/man/systemd.special.html index 0d873df6c..723e06f7a 100644 --- a/man/systemd.special.html +++ b/man/systemd.special.html @@ -19,656 +19,368 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.special — Special systemd units

Synopsis

basic.target, - bluetooth.target, - ctrl-alt-del.target, - cryptsetup.target, - cryptsetup-pre.target, - dbus.service, - dbus.socket, - default.target, - display-manager.service, - emergency.target, - exit.target, - final.target, - getty.target, - graphical.target, - halt.target, - hibernate.target, - hybrid-sleep.target, - initrd-fs.target, - kbrequest.target, - kexec.target, - local-fs.target, - local-fs-pre.target, - multi-user.target, - network.target, - network-online.target, - network-pre.target, - nss-lookup.target, - nss-user-lookup.target, - paths.target, - poweroff.target, - printer.target, - reboot.target, - remote-fs.target, - remote-fs-pre.target, - rescue.target, - initrd-root-fs.target, - rpcbind.target, - runlevel2.target, - runlevel3.target, - runlevel4.target, - runlevel5.target, - shutdown.target, - sigpwr.target, - sleep.target, - smartcard.target, - sockets.target, - sound.target, - suspend.target, - swap.target, - sysinit.target, - syslog.socket, - system-update.target, - time-sync.target, - timers.target, - umount.target, - -.slice, - system.slice, - user.slice, - machine.slice

Description¶

A few units are treated specially by - systemd. They have special internal semantics and - cannot be renamed.

Special System Units¶

basic.target¶

A special target unit - covering basic boot-up.

systemd automatically - adds dependencies of the types - Requires= - and After= - for this target unit to all - services (except for those - with - DefaultDependencies=no).

Usually this should - pull-in all mount points, swap - devices, sockets, timers, and - path units and other basic - initialization necessary for - general purpose - daemons.

ctrl-alt-del.target¶

systemd starts this - target whenever - Control+Alt+Del is pressed on - the console. Usually this - should be aliased (symlinked) - to - reboot.target.

cryptsetup.target¶

A target that pulls in - setup services for all - encrypted block - devices.

dbus.service¶

A special unit for the - D-Bus bus daemon. As soon as - this service is fully started - up systemd will connect to it - and register its - service.

dbus.socket¶

A special unit for the - D-Bus system bus socket. All - units with - Type=dbus - automatically gain a - dependency on this - unit.

default.target¶

The default unit systemd - starts at bootup. Usually this - should be aliased (symlinked) - to - multi-user.target - or - graphical.target.

The default unit systemd - starts at bootup can be - overridden with the - systemd.unit= - kernel command line option.

display-manager.service¶

The display manager - service. Usually this should - be aliased (symlinked) to - gdm.service - or a similar display manager - service.

emergency.target¶

A special target unit - that starts an emergency - shell on the main - console. This unit is supposed - to be used with the kernel - command line option - systemd.unit= - and has otherwise little use. -

final.target¶

A special target unit - that is used during the - shutdown logic and may be used - to pull in late services after - all normal services are - already terminated and all - mounts unmounted. -

getty.target¶

A special target unit - that pulls in statically - configured local TTY - getty - instances. -

graphical.target¶

A special target unit - for setting up a graphical - login screen. This pulls in - multi-user.target.

Units that are needed - for graphical logins shall add - Wants= - dependencies for their unit to - this unit (or - multi-user.target) - during installation. This is - best configured via - WantedBy=graphical.target - in the unit's - "[Install]" - section.

hibernate.target¶

A special target unit - for hibernating the - system. This pulls in - sleep.target.

hybrid-sleep.target¶

A special target unit - for hibernating and suspending the - system at the same time. This pulls in - sleep.target.

halt.target¶

A special target unit - for shutting down and halting - the system. Note that this - target is distinct from - poweroff.target - in that it generally really - just halts the system rather - than powering it down.

Applications wanting to - halt the system should start - this unit.

initrd-fs.target¶

systemd-fstab-generator(3) - automatically adds - dependencies of type - Before= to - sysroot-usr.mount - and all mount points found in - /etc/fstab - that have - x-initrd.mount - and not have noauto - mount options set.

kbrequest.target¶

systemd starts this - target whenever Alt+ArrowUp is - pressed on the console. This - is a good candidate to be - aliased (symlinked) to - rescue.target.

kexec.target¶

A special target unit - for shutting down and rebooting the system via kexec.

Applications wanting to - reboot the system with kexec should start - this unit.

local-fs.target¶

systemd-fstab-generator(3) - automatically adds - dependencies of type - Before= to - all mount units that refer to - local mount points for this - target unit. In addition, it - adds dependencies of type - Wants= to - this target unit for those - mounts listed in - /etc/fstab - that have the - auto mount - option set.

multi-user.target¶

A special target unit - for setting up a multi-user - system (non-graphical). This - is pulled in by - graphical.target.

Units that are needed - for a multi-user system shall - add Wants= - dependencies for their unit to - this unit during - installation. This is best - configured via - WantedBy=multi-user.target - in the unit's - "[Install]" - section.

network-online.target¶

Units that strictly - require a configured network - connection should pull in - network-online.target - (via a - Wants= type - dependency) and order - themselves after it. This - target unit is intended to - pull in a service that delays - further execution until the - network is sufficiently set - up. What precisely this - requires is left to the - implementation of the network - managing service.

Note the distinction - between this unit and - network.target. This - unit is an active unit - (i.e. pulled in by the - consumer rather than the - provider of this - functionality) and pulls in a - service which possibly adds - substantial delays to further - execution. In contrast, - network.target - is a passive unit (i.e. pulled - in by the provider of the - functionality, rather than the - consumer) that usually does - not delay execution - much. Usually, - network.target - is part of the boot of most - systems, while - network-online.target - is not, except when at least - one unit requires it. Also see - Running - Services After the Network is - up for more - information.

All mount units for - remote network file systems - automatically pull in this - unit, and order themselves - after it. Note that networking - daemons that simply provide - functionality to other hosts - generally do not need to pull - this in.

paths.target¶

A special target unit - that sets up all path units - (see - systemd.path(5) - for details) that shall be - active after boot.

It is recommended that - path units installed by - applications get pulled in via - Wants= - dependencies from this - unit. This is best configured - via a - WantedBy=paths.target - in the path unit's - "[Install]" - section.

poweroff.target¶

A special target unit - for shutting down and powering off the system.

Applications wanting to - power off the system should start - this unit.

runlevel0.target - is an alias for this target - unit, for compatibility with SysV.

reboot.target¶

A special target unit - for shutting down and rebooting the system.

Applications wanting to - reboot the system should start - this unit.

runlevel6.target - is an alias for this target - unit, for compatibility with SysV.

remote-fs.target¶

Similar to - local-fs.target, - but for remote mount - points.

systemd automatically - adds dependencies of type - After= for - this target unit to all SysV - init script service units with - an LSB header referring to the - "$remote_fs" - facility.

rescue.target¶

A special target unit - for setting up the base system - and a rescue shell.

runlevel1.target - is an alias for this target - unit, for compatibility with SysV.

initrd-root-fs.target¶

systemd-fstab-generator(3) - automatically adds - dependencies of type - Before= to - the - sysroot.mount - unit, which is generated from - the kernel command line. -

runlevel2.target, runlevel3.target, runlevel4.target, runlevel5.target¶

These are targets that - are called whenever the SysV - compatibility code asks for - runlevel 2, 3, 4, 5, - respectively. It is a good - idea to make this an alias for - (i.e. symlink to) - multi-user.target - (for runlevel 2) or - graphical.target - (the others).

shutdown.target¶

A special target unit - that terminates the services - on system shutdown.

Services that shall be - terminated on system shutdown - shall add Conflicts= - dependencies to this unit for - their service unit, which is - implicitly done when - DefaultDependencies=yes - is set (the default).

sigpwr.target¶

A special target that is - started when systemd receives - the SIGPWR process signal, - which is normally sent by the - kernel or UPS daemons when - power fails.

sleep.target¶

A special target unit - that is pulled in by - suspend.target, - hibernate.target - and - hybrid-sleep.target - and may be used to hook units - into the sleep state - logic.

sockets.target¶

A special target unit - that sets up all socket - units.(see - systemd.socket(5) - for details) that shall be - active after boot.

Services that can be - socket-activated shall add - Wants= - dependencies to this unit for - their socket unit during - installation. This is best - configured via a - WantedBy=sockets.target - in the socket unit's - "[Install]" - section.

suspend.target¶

A special target unit - for suspending the - system. This pulls in - sleep.target.

swap.target¶

Similar to - local-fs.target, but for swap - partitions and swap - files.

sysinit.target¶

A special target unit - covering early boot-up scripts.

syslog.socket¶

The socket unit - syslog implementations should - listen on. All userspace log - messages will be made - available on this socket. For - more information about syslog - integration, please consult - the Syslog - Interface - document.

system-update.target¶

A special target unit - that is used for off-line - system updates. - systemd-system-update-generator(8) - will redirect the boot process - to this target if - /system-update - exists. For more information - see the System - Updates - Specification.

timers.target¶

A special target unit - that sets up all timer - units (see - systemd.timer(5) - for details) that shall be - active after boot.

It is recommended that - timer units installed by - applications get pulled in via - Wants= - dependencies from this - unit. This is best configured - via - WantedBy=timers.target - in the timer unit's - "[Install]" - section.

umount.target¶

A special target unit - that umounts all mount and - automount points on system - shutdown.

Mounts that shall be - unmounted on system shutdown - shall add Conflicts - dependencies to this unit for - their mount unit, which is - implicitly done when - DefaultDependencies=yes - is set (the default).

Special System Units for Devices¶

Some target units are automatically pulled in as - devices of certain kinds show up in the system. These - may be used to automatically activate various services - based on the specific type of the available - hardware.

bluetooth.target¶

This target is started - automatically as soon as a - Bluetooth controller is - plugged in or becomes - available at boot.

This may be used to pull - in Bluetooth management - daemons dynamically when - Bluetooth hardware is - found.

printer.target¶

This target is started - automatically as soon as a - printer is plugged in or - becomes available at - boot.

This may be used to pull - in printer management - daemons dynamically when - printer hardware is - found.

smartcard.target¶

This target is started - automatically as soon as a - smartcard controller is - plugged in or becomes - available at boot.

This may be used to pull - in smartcard management - daemons dynamically when - smartcard hardware is - found.

sound.target¶

This target is started - automatically as soon as a - sound card is plugged in or - becomes available at - boot.

This may be used to pull - in audio management daemons - dynamically when audio - hardware is found.

Special Passive System Units ¶

A number of special system targets are defined - that can be used to properly order boot-up of optional - services. These targets are generally not part of the - initial boot transaction, unless they are explicitly - pulled in by one of the implementing services. Note - specifically that these passive - target units are generally not pulled in by the - consumer of a service, but by the provider of the - service. This means: a consuming service should order - itself after these targets (as appropriate), but not - pull it in. A providing service should order itself - before these targets (as appropriate) and pull it in - (via a Wants= type - dependency).

Note that these passive units cannot be started - manually, i.e. "systemctl start - time-sync.target" will fail with an - error. They can only be pulled in by dependency. This - is enforced since they exist for ordering purposes - only and thus are not useful as only unit within a - transaction.

cryptsetup-pre.target¶

This passive target unit - may be pulled in by services - that want to run before any - encrypted block device is set - up. All encrypted block - devices are set up after this - target has been reached. Since - the shutdown order is - implicitly the reverse - start-up order between units, - this target is particularly - useful to ensure that a - service is shut down only - after all encrypted block - devices are fully - stopped.

local-fs-pre.target¶

This target unit is - automatically ordered before - all local mount points marked - with auto - (see above). It can be used to - execute certain units before - all local mounts.

network.target¶

This unit is supposed to - indicate when network - functionality is available, - but it is only very weakly - defined what that is supposed - to mean, with one exception: - at shutdown, a unit that is - ordered after - network.target - will be stopped before the - network -- to whatever level - it might be set up then -- is - shut down. It is hence useful - when writing service files - that require network access on - shutdown, which should order - themselves after this target, - but not pull it in. Also see - Running - Services After the Network is - up for more - information. Also see - network-online.target - described above.

systemd automatically - adds dependencies of type - After= for - this target unit to all SysV - init script service units with - an LSB header referring to the - "$network" - facility.

network-pre.target¶

This passive target unit - may be pulled in by services - that want to run before any - network is set up, for example - for the purpose of setting up a - firewall. All network - management software orders - itself after this target, but - does not pull it in.

nss-lookup.target¶

A target that should be - used as synchronization point - for all host/network name - service lookups. Note that - this is independent of - user/group name lookups for - which - nss-user-lookup.target - should be used. All services - for which the availability of - full host/network name - resolution is essential should - be ordered after this target, - but not pull it in. systemd - automatically adds - dependencies of type - After= for - this target unit to all SysV - init script service units with - an LSB header referring to the - "$named" - facility.

nss-user-lookup.target¶

A target that should be - used as synchronization point - for all user/group name - service lookups. Note that - this is independent of - host/network name lookups for - which - nss-lookup.target - should be used. All services - for which the availability of - the full user/group database is - essential should be ordered - after this target, but not - pull it in. Note that system - users are always resolvable, - and hence do not require any - special ordering against this - target.

remote-fs-pre.target¶

This target unit is - automatically ordered before - all remote mount point units - (see above). It can be used to - run certain units before the - remote mounts are - established. Note that this - unit is generally not part of - the initial transaction, - unless the unit that wants to - be ordered before all remote - mounts pulls it in via a - Wants= type - dependency. If the unit wants - to be pulled in by the first - remote mount showing up, it - should use - network-online.target - (see above).

rpcbind.target¶

The portmapper/rpcbind - pulls in this target and - orders itself before it, to - indicate its - availability. systemd - automatically adds - dependencies of type - After= for - this target unit to all SysV - init script service units with - an LSB header referring to the - "$portmap" - facility.

time-sync.target¶

Services responsible for - synchronizing the system clock - from a remote source (such as - NTP client implementations) - should pull in this target and - order themselves before - it. All services where correct - time is essential should be - ordered after this unit, but - not pull it in. systemd - automatically adds - dependencies of type - After= for - this target unit to all SysV - init script service units with - an LSB header referring to the - "$time" - facility.

Special User Units¶

When systemd runs as a user instance, the - following special units are available, which have - similar definitions as their system counterparts: - default.target, - shutdown.target, - sockets.target, - timers.target, - paths.target, - bluetooth.target, - printer.target, - smartcard.target, - sound.target.

In addition, the following special unit is - understood only when systemd runs as service instance:

exit.target¶

A special service unit - for shutting down the - user service manager.

Applications wanting to - terminate the user service - manager should start this - unit. If systemd receives - SIGTERM or SIGINT when running - as user service daemon, it will - start this unit.

Normally, this pulls in - shutdown.target - which in turn should be - conflicted by all units that - want to be shut down on - user service manager exit.

Special Slice Units¶

There are four ".slice" units - which form the basis of the hierarchy for assignment - of resources for services, users, and virtual machines - or containers.

-.slice¶

The root slice is the - root of the hierarchy. It - usually does not contain units - directly, but may be used to - set defaults for the whole - tree.

system.slice¶

By default, all services - services started by - systemd are - found in this slice.

user.slice¶

By default, all user - processes and services started - on behalf of the user, - including the per-user systemd - instance are found in this - slice.

machine.slice¶

By default, all virtual - machines and containers - registered with - systemd-machined - are found in this slice. -

+ gudev systemd 219

Name

systemd.special — Special systemd units

Synopsis

basic.target, + bluetooth.target, + ctrl-alt-del.target, + cryptsetup.target, + cryptsetup-pre.target, + dbus.service, + dbus.socket, + default.target, + display-manager.service, + emergency.target, + exit.target, + final.target, + getty.target, + graphical.target, + halt.target, + hibernate.target, + hybrid-sleep.target, + initrd-fs.target, + kbrequest.target, + kexec.target, + local-fs.target, + local-fs-pre.target, + multi-user.target, + network.target, + network-online.target, + network-pre.target, + nss-lookup.target, + nss-user-lookup.target, + paths.target, + poweroff.target, + printer.target, + reboot.target, + remote-fs.target, + remote-fs-pre.target, + rescue.target, + initrd-root-fs.target, + rpcbind.target, + runlevel2.target, + runlevel3.target, + runlevel4.target, + runlevel5.target, + shutdown.target, + sigpwr.target, + sleep.target, + smartcard.target, + sockets.target, + sound.target, + suspend.target, + swap.target, + sysinit.target, + syslog.socket, + system-update.target, + time-sync.target, + timers.target, + umount.target, + -.slice, + system.slice, + user.slice, + machine.slice

Description¶

A few units are treated specially by systemd. They have + special internal semantics and cannot be renamed.

Special System Units¶

basic.target¶

A special target unit covering basic boot-up.

systemd automatically adds dependencies of the types + Requires= and After= + for this target unit to all services (except for those with + DefaultDependencies=no).

Usually this should pull-in all mount points, swap + devices, sockets, timers, and path units and other basic + initialization necessary for general purpose daemons.

ctrl-alt-del.target¶

systemd starts this target whenever Control+Alt+Del is + pressed on the console. Usually this should be aliased + (symlinked) to reboot.target.

cryptsetup.target¶

A target that pulls in setup services for all + encrypted block devices.

dbus.service¶

A special unit for the D-Bus bus daemon. As soon as + this service is fully started up systemd will connect to it + and register its service.

dbus.socket¶

A special unit for the D-Bus system bus socket. All + units with Type=dbus automatically gain a + dependency on this unit.

default.target¶

The default unit systemd starts at bootup. Usually + this should be aliased (symlinked) to + multi-user.target or + graphical.target.

The default unit systemd starts at bootup can be + overridden with the systemd.unit= kernel + command line option.

display-manager.service¶

The display manager service. Usually this should be + aliased (symlinked) to gdm.service or a + similar display manager service.

emergency.target¶

A special target unit that starts an emergency shell + on the main console. This unit is supposed to be used with + the kernel command line option + systemd.unit= and has otherwise little + use. +

final.target¶

A special target unit that is used during the shutdown + logic and may be used to pull in late services after all + normal services are already terminated and all mounts + unmounted. +

getty.target¶

A special target unit that pulls in statically + configured local TTY getty instances. +

graphical.target¶

A special target unit for setting up a graphical login + screen. This pulls in + multi-user.target.

Units that are needed for graphical logins shall add + Wants= dependencies for their unit to + this unit (or multi-user.target) during + installation. This is best configured via + WantedBy=graphical.target in the unit's + "[Install]" section.

hibernate.target¶

A special target unit for hibernating the system. This + pulls in sleep.target.

hybrid-sleep.target¶

A special target unit for hibernating and suspending + the system at the same time. This pulls in + sleep.target.

halt.target¶

A special target unit for shutting down and halting + the system. Note that this target is distinct from + poweroff.target in that it generally + really just halts the system rather than powering it + down.

Applications wanting to halt the system should start + this unit.

initrd-fs.target¶

systemd-fstab-generator(3) + automatically adds dependencies of type + Before= to + sysroot-usr.mount and all mount points + found in /etc/fstab that have + x-initrd.mount and not have + noauto mount options set.

kbrequest.target¶

systemd starts this target whenever Alt+ArrowUp is + pressed on the console. This is a good candidate to be + aliased (symlinked) to + rescue.target.

kexec.target¶

A special target unit for shutting down and rebooting + the system via kexec.

Applications wanting to reboot the system with kexec + should start this unit.

local-fs.target¶

systemd-fstab-generator(3) + automatically adds dependencies of type + Before= to all mount units that refer to + local mount points for this target unit. In addition, it + adds dependencies of type Wants= to this + target unit for those mounts listed in + /etc/fstab that have the + auto mount option set.

multi-user.target¶

A special target unit for setting up a multi-user + system (non-graphical). This is pulled in by + graphical.target.

Units that are needed for a multi-user system shall + add Wants= dependencies for their unit to + this unit during installation. This is best configured via + WantedBy=multi-user.target in the unit's + "[Install]" section.

network-online.target¶

Units that strictly require a configured network + connection should pull in + network-online.target (via a + Wants= type dependency) and order + themselves after it. This target unit is intended to pull in + a service that delays further execution until the network is + sufficiently set up. What precisely this requires is left to + the implementation of the network managing service.

Note the distinction between this unit and + network.target. This unit is an active + unit (i.e. pulled in by the consumer rather than the + provider of this functionality) and pulls in a service which + possibly adds substantial delays to further execution. In + contrast, network.target is a passive + unit (i.e. pulled in by the provider of the functionality, + rather than the consumer) that usually does not delay + execution much. Usually, network.target + is part of the boot of most systems, while + network-online.target is not, except + when at least one unit requires it. Also see Running + Services After the Network is up for more + information.

All mount units for remote network file systems + automatically pull in this unit, and order themselves after + it. Note that networking daemons that simply provide + functionality to other hosts generally do not need to pull + this in.

paths.target¶

A special target unit that sets up all path units (see + systemd.path(5) + for details) that shall be active after boot.

It is recommended that path units installed by + applications get pulled in via Wants= + dependencies from this unit. This is best configured via a + WantedBy=paths.target in the path unit's + "[Install]" section.

poweroff.target¶

A special target unit for shutting down and powering + off the system.

Applications wanting to power off the system should + start this unit.

runlevel0.target is an alias for + this target unit, for compatibility with SysV.

reboot.target¶

A special target unit for shutting down and rebooting + the system.

Applications wanting to reboot the system should start + this unit.

runlevel6.target is an alias for + this target unit, for compatibility with SysV.

remote-fs.target¶

Similar to local-fs.target, but + for remote mount points.

systemd automatically adds dependencies of type + After= for this target unit to all SysV + init script service units with an LSB header referring to + the "$remote_fs" facility.

rescue.target¶

A special target unit for setting up the base system + and a rescue shell.

runlevel1.target is an alias for + this target unit, for compatibility with SysV.

initrd-root-fs.target¶

systemd-fstab-generator(3) + automatically adds dependencies of type + Before= to the + sysroot.mount unit, which is generated + from the kernel command line. +

runlevel2.target, runlevel3.target, runlevel4.target, runlevel5.target¶

These are targets that are called whenever the SysV + compatibility code asks for runlevel 2, 3, 4, 5, + respectively. It is a good idea to make this an alias for + (i.e. symlink to) multi-user.target + (for runlevel 2) or graphical.target + (the others).

shutdown.target¶

A special target unit that terminates the services on + system shutdown.

Services that shall be terminated on system shutdown + shall add Conflicts= dependencies to this + unit for their service unit, which is implicitly done when + DefaultDependencies=yes is set (the + default).

sigpwr.target¶

A special target that is started when systemd receives + the SIGPWR process signal, which is normally sent by the + kernel or UPS daemons when power fails.

sleep.target¶

A special target unit that is pulled in by + suspend.target, + hibernate.target and + hybrid-sleep.target and may be used to + hook units into the sleep state logic.

sockets.target¶

A special target unit that sets up all socket + units.(see + systemd.socket(5) + for details) that shall be active after boot.

Services that can be socket-activated shall add + Wants= dependencies to this unit for + their socket unit during installation. This is best + configured via a WantedBy=sockets.target + in the socket unit's "[Install]" + section.

suspend.target¶

A special target unit for suspending the system. This + pulls in sleep.target.

swap.target¶

Similar to local-fs.target, but + for swap partitions and swap files.

sysinit.target¶

A special target unit covering early boot-up + scripts.

syslog.socket¶

The socket unit syslog implementations should listen + on. All userspace log messages will be made available on + this socket. For more information about syslog integration, + please consult the Syslog + Interface document.

system-update.target¶

A special target unit that is used for off-line system + updates. + systemd-system-update-generator(8) + will redirect the boot process to this target if + /system-update exists. For more + information see the System + Updates Specification.

timers.target¶

A special target unit that sets up all timer units + (see + systemd.timer(5) + for details) that shall be active after boot.

It is recommended that timer units installed by + applications get pulled in via Wants= + dependencies from this unit. This is best configured via + WantedBy=timers.target in the timer + unit's "[Install]" section.

umount.target¶

A special target unit that umounts all mount and + automount points on system shutdown.

Mounts that shall be unmounted on system shutdown + shall add Conflicts dependencies to this unit for their + mount unit, which is implicitly done when + DefaultDependencies=yes is set (the + default).

Special System Units for Devices¶

Some target units are automatically pulled in as devices of + certain kinds show up in the system. These may be used to + automatically activate various services based on the specific type + of the available hardware.

bluetooth.target¶

This target is started automatically as soon as a + Bluetooth controller is plugged in or becomes available at + boot.

This may be used to pull in Bluetooth management + daemons dynamically when Bluetooth hardware is found.

printer.target¶

This target is started automatically as soon as a + printer is plugged in or becomes available at boot.

This may be used to pull in printer management daemons + dynamically when printer hardware is found.

smartcard.target¶

This target is started automatically as soon as a + smartcard controller is plugged in or becomes available at + boot.

This may be used to pull in smartcard management + daemons dynamically when smartcard hardware is found.

sound.target¶

This target is started automatically as soon as a + sound card is plugged in or becomes available at + boot.

This may be used to pull in audio management daemons + dynamically when audio hardware is found.

Special Passive System Units ¶

A number of special system targets are defined that can be + used to properly order boot-up of optional services. These targets + are generally not part of the initial boot transaction, unless + they are explicitly pulled in by one of the implementing services. + Note specifically that these passive target + units are generally not pulled in by the consumer of a service, + but by the provider of the service. This means: a consuming + service should order itself after these targets (as appropriate), + but not pull it in. A providing service should order itself before + these targets (as appropriate) and pull it in (via a + Wants= type dependency).

Note that these passive units cannot be started manually, + i.e. "systemctl start time-sync.target" will fail + with an error. They can only be pulled in by dependency. This is + enforced since they exist for ordering purposes only and thus are + not useful as only unit within a transaction.

cryptsetup-pre.target¶

This passive target unit may be pulled in by services + that want to run before any encrypted block device is set + up. All encrypted block devices are set up after this target + has been reached. Since the shutdown order is implicitly the + reverse start-up order between units, this target is + particularly useful to ensure that a service is shut down + only after all encrypted block devices are fully + stopped.

local-fs-pre.target¶

This target unit is + automatically ordered before + all local mount points marked + with auto + (see above). It can be used to + execute certain units before + all local mounts.

network.target¶

This unit is supposed to indicate when network + functionality is available, but it is only very weakly + defined what that is supposed to mean, with one exception: + at shutdown, a unit that is ordered after + network.target will be stopped before + the network -- to whatever level it might be set up then -- + is shut down. It is hence useful when writing service files + that require network access on shutdown, which should order + themselves after this target, but not pull it in. Also see + Running + Services After the Network is up for more + information. Also see + network-online.target described + above.

systemd automatically adds dependencies of type + After= for this target unit to all SysV + init script service units with an LSB header referring to + the "$network" facility.

network-pre.target¶

This passive target unit may be pulled in by services + that want to run before any network is set up, for example + for the purpose of setting up a firewall. All network + management software orders itself after this target, but + does not pull it in.

nss-lookup.target¶

A target that should be used as synchronization point + for all host/network name service lookups. Note that this is + independent of user/group name lookups for which + nss-user-lookup.target should be used. + All services for which the availability of full host/network + name resolution is essential should be ordered after this + target, but not pull it in. systemd automatically adds + dependencies of type After= for this + target unit to all SysV init script service units with an + LSB header referring to the "$named" + facility.

nss-user-lookup.target¶

A target that should be used as synchronization point + for all user/group name service lookups. Note that this is + independent of host/network name lookups for which + nss-lookup.target should be used. All + services for which the availability of the full user/group + database is essential should be ordered after this target, + but not pull it in. Note that system users are always + resolvable, and hence do not require any special ordering + against this target.

remote-fs-pre.target¶

This target unit is automatically ordered before all + remote mount point units (see above). It can be used to run + certain units before the remote mounts are established. Note + that this unit is generally not part of the initial + transaction, unless the unit that wants to be ordered before + all remote mounts pulls it in via a + Wants= type dependency. If the unit wants + to be pulled in by the first remote mount showing up, it + should use network-online.target (see + above).

rpcbind.target¶

The portmapper/rpcbind pulls in this target and orders + itself before it, to indicate its availability. systemd + automatically adds dependencies of type + After= for this target unit to all SysV + init script service units with an LSB header referring to + the "$portmap" facility.

time-sync.target¶

Services responsible for synchronizing the system + clock from a remote source (such as NTP client + implementations) should pull in this target and order + themselves before it. All services where correct time is + essential should be ordered after this unit, but not pull it + in. systemd automatically adds dependencies of type + After= for this target unit to all SysV + init script service units with an LSB header referring to + the "$time" facility.

Special User Units¶

When systemd runs as a user instance, the following special + units are available, which have similar definitions as their + system counterparts: + default.target, + shutdown.target, + sockets.target, + timers.target, + paths.target, + bluetooth.target, + printer.target, + smartcard.target, + sound.target.

In addition, the following special unit is understood only + when systemd runs as service instance:

exit.target¶

A special service unit for shutting down the user + service manager.

Applications wanting to terminate the user service + manager should start this unit. If systemd receives + SIGTERM or SIGINT + when running as user service daemon, it will start this + unit.

Normally, this pulls in + shutdown.target which in turn should be + conflicted by all units that want to be shut down on user + service manager exit.

Special Slice Units¶

There are four ".slice" units which form + the basis of the hierarchy for assignment of resources for + services, users, and virtual machines or containers.

-.slice¶

The root slice is the root of the hierarchy. It + usually does not contain units directly, but may be used to + set defaults for the whole tree.

system.slice¶

By default, all services services started by + systemd are found in this slice.

user.slice¶

By default, all user processes and services started on + behalf of the user, including the per-user systemd instance + are found in this slice.

machine.slice¶

By default, all virtual machines and containers + registered with systemd-machined are + found in this slice. +

diff --git a/man/systemd.special.xml b/man/systemd.special.xml index 863d7f35d..cf76aaf60 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.swap - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.swap - 5 - - - - systemd.swap - Swap unit configuration - - - - swap.swap - - - - Description - - A unit configuration file whose name ends in - .swap encodes information about a - swap device or file for memory paging controlled and - supervised by systemd. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The swap - specific configuration options are configured in the - [Swap] section. - - Additional options are listed in - systemd.exec5, - which define the execution environment the - swapon8 - binary is executed in, and in - systemd.kill5, - which define the way the processes are - terminated, and in - systemd.resource-control5, - which configure resource control settings for the - processes of the service. - - Swap units must be named after the devices - or files they control. Example: the swap device - /dev/sda5 must be configured in a - unit file dev-sda5.swap. For - details about the escaping logic used to convert a - file system path to a unit name, see - systemd.unit5. - - All swap units automatically get the appropriate - dependencies on the devices or on the mount points - of the files they are activated from. - - Swap units with - DefaultDependencies= enabled - implicitly acquire a conflicting dependency to - umount.target so that they are - deactivated at shutdown. - - - - <filename>fstab</filename> - - Swap units may either be configured via unit - files, or via /etc/fstab (see - fstab5 - for details). Swaps listed in - /etc/fstab will be converted into - native units dynamically at boot and when the - configuration of the system manager is - reloaded. See - systemd-fstab-generator8 - for details about the conversion. - - If a swap device or file is configured in both - /etc/fstab and a unit file, the - configuration in the latter takes precedence. - - When reading /etc/fstab a - few special options are understood by systemd which - influence how dependencies are created for swap - units. - - - - - - - With the - swap unit will not be added as a dependency for - swap.target. This means that - it will not be activated automatically during - boot, unless it is pulled in by some other - unit. Option has the - opposite meaning and is the default. - - - - - - - - With the - swap unit will be only wanted, not required by - swap.target. This means that - the boot will continue even if this swap device is - not activated successfully. Option - has the opposite meaning and - is the default. - - - - - - - Options - - Swap files must include a [Swap] section, which - carries information about the swap device it - supervises. A number of options that may be used in - this section are shared with other unit types. These - options are documented in - systemd.exec5 - and - systemd.kill5. The - options specific to the [Swap] section of swap units - are the following: - - - - - What= - Takes an absolute path - of a device node or file to use for - paging. See - swapon8 - for details. If this refers to a - device node, a dependency on the - respective device unit is - automatically created. (See - systemd.device5 - for more information.) If this refers - to a file, a dependency on the - respective mount unit is automatically - created. (See - systemd.mount5 - for more information.) This option is - mandatory. - - - - Priority= - - Swap priority to use - when activating the swap device or - file. This takes an integer. This - setting is optional. - - - - Options= - - May contain an option - string for the swap device. This may - be used for controlling discard - options among other functionality, if - the swap backing device supports the - discard or trim operation. (See - swapon8 - for more information.) - - - - - TimeoutSec= - Configures the time to - wait for the swapon command to - finish. If a command does not exit - within the configured time, the swap - will be considered failed and be shut - down again. All commands still running - will be terminated forcibly via - SIGTERM, and after another delay of - this time with SIGKILL. (See - in - systemd.kill5.) - Takes a unit-less value in seconds, or - a time span value such as "5min - 20s". Pass 0 to disable the timeout - logic. Defaults to DefaultTimeoutStartSec= from the - manager configuration file - (see systemd-system.conf5). - - - - - Check - systemd.exec5 - and - systemd.kill5 - for more settings. - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.exec5, - systemd.kill5, - systemd.resource-control5, - systemd.device5, - systemd.mount5, - swapon8, - systemd-fstab-generator8, - systemd.directives7 - - + + systemd.swap + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.swap + 5 + + + + systemd.swap + Swap unit configuration + + + + swap.swap + + + + Description + + A unit configuration file whose name ends in + .swap encodes information about a swap device + or file for memory paging controlled and supervised by + systemd. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The swap specific configuration options are + configured in the [Swap] section. + + Additional options are listed in + systemd.exec5, + which define the execution environment the + swapon8 + binary is executed in, and in + systemd.kill5, + which define the way the processes are terminated, and in + systemd.resource-control5, + which configure resource control settings for the processes of the + service. + + Swap units must be named after the devices + or files they control. Example: the swap device + /dev/sda5 must be configured in a + unit file dev-sda5.swap. For details about + the escaping logic used to convert a file system path to a unit + name, see + systemd.unit5. + + All swap units automatically get the appropriate + dependencies on the devices or on the mount points of the files + they are activated from. + + Swap units with DefaultDependencies= + enabled implicitly acquire a conflicting dependency to + umount.target so that they are deactivated at + shutdown. + + + + <filename>fstab</filename> + + Swap units may either be configured via unit files, or via + /etc/fstab (see + fstab5 + for details). Swaps listed in /etc/fstab will + be converted into native units dynamically at boot and when the + configuration of the system manager is reloaded. See + systemd-fstab-generator8 + for details about the conversion. + + If a swap device or file is configured in both + /etc/fstab and a unit file, the configuration + in the latter takes precedence. + + When reading /etc/fstab a few special + options are understood by systemd which influence how dependencies + are created for swap units. + + + + + + + With the swap unit + will not be added as a dependency for + swap.target. This means that it will not + be activated automatically during boot, unless it is pulled in + by some other unit. Option has the + opposite meaning and is the default. + + + + + + + With the swap unit + will be only wanted, not required by + swap.target. This means that the boot + will continue even if this swap device is not activated + successfully. + + + + + + + Options + + Swap files must include a [Swap] section, which carries + information about the swap device it supervises. A number of + options that may be used in this section are shared with other + unit types. These options are documented in + systemd.exec5 + and + systemd.kill5. + The options specific to the [Swap] section of swap units are the + following: + + + + + What= + Takes an absolute path of a device node or + file to use for paging. See + swapon8 + for details. If this refers to a device node, a dependency on + the respective device unit is automatically created. (See + systemd.device5 + for more information.) If this refers to a file, a dependency + on the respective mount unit is automatically created. (See + systemd.mount5 + for more information.) This option is + mandatory. + + + + Priority= + + Swap priority to use when activating the swap + device or file. This takes an integer. This setting is + optional. + + + + Options= + + May contain an option string for the swap + device. This may be used for controlling discard options among + other functionality, if the swap backing device supports the + discard or trim operation. (See + swapon8 + for more information.) + + + + TimeoutSec= + Configures the time to wait for the swapon + command to finish. If a command does not exit within the + configured time, the swap will be considered failed and be + shut down again. All commands still running will be terminated + forcibly via SIGTERM, and after another + delay of this time with SIGKILL. (See + in + systemd.kill5.) + Takes a unit-less value in seconds, or a time span value such + as "5min 20s". Pass 0 to disable the + timeout logic. Defaults to + DefaultTimeoutStartSec= from the manager + configuration file (see + systemd-system.conf5). + + + + + Check + systemd.exec5 + and + systemd.kill5 + for more settings. + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.exec5, + systemd.kill5, + systemd.resource-control5, + systemd.device5, + systemd.mount5, + swapon8, + systemd-fstab-generator8, + systemd.directives7 + + diff --git a/man/systemd.target.5 b/man/systemd.target.5 index 5000ce1a4..a2e71d5f7 100644 --- a/man/systemd.target.5 +++ b/man/systemd.target.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.TARGET" "5" "" "systemd 218" "systemd.target" +.TH "SYSTEMD\&.TARGET" "5" "" "systemd 219" "systemd.target" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/systemd.target.html b/man/systemd.target.html index 1e69b7bc0..96fc31f6e 100644 --- a/man/systemd.target.html +++ b/man/systemd.target.html @@ -19,42 +19,36 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.target — Target unit configuration

Synopsis

target.target

Description¶

A unit configuration file whose name ends in - ".target" encodes information about - a target unit of systemd, which is used for grouping - units and as well-known synchronization points during - start-up.

This unit type has no specific options. See - systemd.unit(5) - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. A - separate [Target] section does not exist, since no - target-specific options may be configured.

Target units do not offer any additional - functionality on top of the generic functionality - provided by units. They exist merely to group units via dependencies - (useful as boot targets), and to establish - standardized names for synchronization points used in - dependencies between units. Among other things, target - units are a more flexible replacement for SysV - runlevels in the classic SysV init system. (And for - compatibility reasons special - target units such as - runlevel3.target exist which are used by - the SysV runlevel compatibility code in systemd. See - systemd.special(7) - for details).

Unless DefaultDependencies= - is set to false, target units will - implicitly complement all configured dependencies of - type Wants=, - Requires=, - RequiresOverridable= with - dependencies of type After= if the - units in question also have - DefaultDependencies=true. -

+ gudev systemd 219

Name

systemd.target — Target unit configuration

Synopsis

target.target

Description¶

A unit configuration file whose name ends in + ".target" encodes information about a target unit + of systemd, which is used for grouping units and as well-known + synchronization points during start-up.

This unit type has no specific options. See + systemd.unit(5) + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. A separate [Target] section does not exist, + since no target-specific options may be configured.

Target units do not offer any additional functionality on + top of the generic functionality provided by units. They exist + merely to group units via dependencies (useful as boot targets), + and to establish standardized names for synchronization points + used in dependencies between units. Among other things, target + units are a more flexible replacement for SysV runlevels in the + classic SysV init system. (And for compatibility reasons special + target units such as runlevel3.target exist + which are used by the SysV runlevel compatibility code in systemd. + See + systemd.special(7) + for details).

Unless DefaultDependencies= is set to + false, target units will implicitly complement + all configured dependencies of type Wants=, + Requires=, + RequiresOverridable= with dependencies of type + After= if the units in question also have + DefaultDependencies=true. +

diff --git a/man/systemd.target.xml b/man/systemd.target.xml index e2cdfd83c..e790e9b77 100644 --- a/man/systemd.target.xml +++ b/man/systemd.target.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.target - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.target - 5 - - - - systemd.target - Target unit configuration - - - - target.target - - - - Description - - A unit configuration file whose name ends in - .target encodes information about - a target unit of systemd, which is used for grouping - units and as well-known synchronization points during - start-up. - - This unit type has no specific options. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. A - separate [Target] section does not exist, since no - target-specific options may be configured. - - Target units do not offer any additional - functionality on top of the generic functionality - provided by units. They exist merely to group units via dependencies - (useful as boot targets), and to establish - standardized names for synchronization points used in - dependencies between units. Among other things, target - units are a more flexible replacement for SysV - runlevels in the classic SysV init system. (And for - compatibility reasons special - target units such as - runlevel3.target exist which are used by - the SysV runlevel compatibility code in systemd. See - systemd.special7 - for details). - - Unless DefaultDependencies= - is set to , target units will - implicitly complement all configured dependencies of - type Wants=, - Requires=, - RequiresOverridable= with - dependencies of type After= if the - units in question also have - DefaultDependencies=true. - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.special7, - systemd.directives7 - - + + systemd.target + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.target + 5 + + + + systemd.target + Target unit configuration + + + + target.target + + + + Description + + A unit configuration file whose name ends in + .target encodes information about a target unit + of systemd, which is used for grouping units and as well-known + synchronization points during start-up. + + This unit type has no specific options. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. A separate [Target] section does not exist, + since no target-specific options may be configured. + + Target units do not offer any additional functionality on + top of the generic functionality provided by units. They exist + merely to group units via dependencies (useful as boot targets), + and to establish standardized names for synchronization points + used in dependencies between units. Among other things, target + units are a more flexible replacement for SysV runlevels in the + classic SysV init system. (And for compatibility reasons special + target units such as runlevel3.target exist + which are used by the SysV runlevel compatibility code in systemd. + See + systemd.special7 + for details). + + Unless DefaultDependencies= is set to + , target units will implicitly complement + all configured dependencies of type Wants=, + Requires=, + RequiresOverridable= with dependencies of type + After= if the units in question also have + DefaultDependencies=true. + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.special7, + systemd.directives7 + + diff --git a/man/systemd.time.7 b/man/systemd.time.7 index 62061f548..c72c8ef4c 100644 --- a/man/systemd.time.7 +++ b/man/systemd.time.7 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.TIME" "7" "" "systemd 218" "systemd.time" +.TH "SYSTEMD\&.TIME" "7" "" "systemd 219" "systemd.time" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -216,18 +216,18 @@ Examples for valid timestamps and their normalized form (assuming the current ti .nf Fri 2012\-11\-23 11:12:13 → Fri 2012\-11\-23 11:12:13 2012\-11\-23 11:12:13 → Fri 2012\-11\-23 11:12:13 - 2012\-11\-23 → Fri 2012\-11\-23 00:00:00 - 12\-11\-23 → Fri 2012\-11\-23 00:00:00 - 11:12:13 → Fri 2012\-11\-23 11:12:13 - 11:12 → Fri 2012\-11\-23 11:12:00 - now → Fri 2012\-11\-23 18:15:22 - today → Fri 2012\-11\-23 00:00:00 - yesterday → Fri 2012\-11\-22 00:00:00 - tomorrow → Fri 2012\-11\-24 00:00:00 - +3h30min → Fri 2012\-11\-23 21:45:22 - \-5s → Fri 2012\-11\-23 18:15:17 - 11min ago → Fri 2012\-11\-23 18:04:22 - @1395716396 → Tue 2014\-03\-25 03:59:56 + 2012\-11\-23 → Fri 2012\-11\-23 00:00:00 + 12\-11\-23 → Fri 2012\-11\-23 00:00:00 + 11:12:13 → Fri 2012\-11\-23 11:12:13 + 11:12 → Fri 2012\-11\-23 11:12:00 + now → Fri 2012\-11\-23 18:15:22 + today → Fri 2012\-11\-23 00:00:00 + yesterday → Fri 2012\-11\-22 00:00:00 + tomorrow → Fri 2012\-11\-24 00:00:00 + +3h30min → Fri 2012\-11\-23 21:45:22 + \-5s → Fri 2012\-11\-23 18:15:17 + 11min ago → Fri 2012\-11\-23 18:04:22 + @1395716396 → Tue 2014\-03\-25 03:59:56 .fi .if n \{\ .RE @@ -254,7 +254,7 @@ Thu,Fri 2012\-*\-1,5 11:12:13 .RE .\} .PP -The above refers to 11:12:13 of the first or fifth day of any month of the year 2012, given that it is a Thursday or Friday\&. +The above refers to 11:12:13 of the first or fifth day of any month of the year 2012, but only if that day is a Thursday or Friday\&. .PP The weekday specification is optional\&. If specified, it should consist of one or more English language weekday names, either in the abbreviated (Wed) or non\-abbreviated (Wednesday) form (case does not matter), separated by commas\&. Specifying two weekdays separated by "\-" @@ -305,31 +305,31 @@ Examples for valid timestamps and their normalized form: .nf Sat,Thu,Mon\-Wed,Sat\-Sun → Mon\-Thu,Sat,Sun *\-*\-* 00:00:00 Mon,Sun 12\-*\-* 2,1:23 → Mon,Sun 2012\-*\-* 01,02:23:00 - Wed *\-1 → Wed *\-*\-01 00:00:00 - Wed\-Wed,Wed *\-1 → Wed *\-*\-01 00:00:00 - Wed, 17:48 → Wed *\-*\-* 17:48:00 + Wed *\-1 → Wed *\-*\-01 00:00:00 + Wed\-Wed,Wed *\-1 → Wed *\-*\-01 00:00:00 + Wed, 17:48 → Wed *\-*\-* 17:48:00 Wed\-Sat,Tue 12\-10\-15 1:2:3 → Tue\-Sat 2012\-10\-15 01:02:03 - *\-*\-7 0:0:0 → *\-*\-07 00:00:00 - 10\-15 → *\-10\-15 00:00:00 + *\-*\-7 0:0:0 → *\-*\-07 00:00:00 + 10\-15 → *\-10\-15 00:00:00 monday *\-12\-* 17:00 → Mon *\-12\-* 17:00:00 Mon,Fri *\-*\-3,1,2 *:30:45 → Mon,Fri *\-*\-01,02,03 *:30:45 12,14,13,12:20,10,30 → *\-*\-* 12,13,14:10,20,30:00 mon,fri *\-1/2\-1,3 *:30:45 → Mon,Fri *\-01/2\-01,03 *:30:45 - 03\-05 08:05:40 → *\-03\-05 08:05:40 - 08:05:40 → *\-*\-* 08:05:40 - 05:40 → *\-*\-* 05:40:00 + 03\-05 08:05:40 → *\-03\-05 08:05:40 + 08:05:40 → *\-*\-* 08:05:40 + 05:40 → *\-*\-* 05:40:00 Sat,Sun 12\-05 08:05:40 → Sat,Sun *\-12\-05 08:05:40 - Sat,Sun 08:05:40 → Sat,Sun *\-*\-* 08:05:40 - 2003\-03\-05 05:40 → 2003\-03\-05 05:40:00 - 2003\-03\-05 → 2003\-03\-05 00:00:00 - 03\-05 → *\-03\-05 00:00:00 - hourly → *\-*\-* *:00:00 - daily → *\-*\-* 00:00:00 - monthly → *\-*\-01 00:00:00 - weekly → Mon *\-*\-* 00:00:00 - yearly → *\-01\-01 00:00:00 - annually → *\-01\-01 00:00:00 - *:2/3 → *\-*\-* *:02/3:00 + Sat,Sun 08:05:40 → Sat,Sun *\-*\-* 08:05:40 + 2003\-03\-05 05:40 → 2003\-03\-05 05:40:00 + 2003\-03\-05 → 2003\-03\-05 00:00:00 + 03\-05 → *\-03\-05 00:00:00 + hourly → *\-*\-* *:00:00 + daily → *\-*\-* 00:00:00 + monthly → *\-*\-01 00:00:00 + weekly → Mon *\-*\-* 00:00:00 + yearly → *\-01\-01 00:00:00 + annually → *\-01\-01 00:00:00 + *:2/3 → *\-*\-* *:02/3:00 .fi .if n \{\ .RE diff --git a/man/systemd.time.html b/man/systemd.time.html index 957811988..5c812f3f5 100644 --- a/man/systemd.time.html +++ b/man/systemd.time.html @@ -19,156 +19,143 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.time — Time and date specifications

Description¶

In systemd, timestamps, time spans, and calendar - events are displayed and may be specified in closely - related syntaxes.

Displaying Time Spans¶

Time spans refer to time durations. On display, - systemd will present time spans as a space-separated - series of time values each suffixed by a time - unit.

2h 30min

All specified time values are meant to be added - up. The above hence refers to 150 minutes.

Parsing Time Spans¶

When parsing, systemd will accept the same - time span syntax. Separating spaces may be omitted. The - following time units are understood:

  • usec, us

  • msec, ms

  • seconds, second, sec, s

  • minutes, minute, min, m

  • hours, hour, hr, h

  • days, day, d

  • weeks, week, w

  • months, month

  • years, year, y

If no time unit is specified, generally seconds - are assumed, but some exceptions exist and are marked - as such. In a few cases "ns", - "nsec" is accepted too, where the - granularity of the time span allows for this.

Examples for valid time span specifications:

2 h
+  gudev systemd 219

Name

systemd.time — Time and date specifications

Description¶

In systemd, timestamps, time spans, and calendar events are + displayed and may be specified in closely related syntaxes.

Displaying Time Spans¶

Time spans refer to time durations. On display, systemd will + present time spans as a space-separated series of time values each + suffixed by a time unit.

2h 30min

All specified time values are meant to be added up. The + above hence refers to 150 minutes.

Parsing Time Spans¶

When parsing, systemd will accept the same time span syntax. + Separating spaces may be omitted. The following time units are + understood:

  • usec, us

  • msec, ms

  • seconds, second, sec, s

  • minutes, minute, min, m

  • hours, hour, hr, h

  • days, day, d

  • weeks, week, w

  • months, month

  • years, year, y

If no time unit is specified, generally seconds are assumed, + but some exceptions exist and are marked as such. In a few cases + "ns", "nsec" is accepted too, + where the granularity of the time span allows for this.

Examples for valid time span specifications:

2 h
 2hours
 48hr
 1y 12month
 55s500ms
-300ms20s 5day

Displaying Timestamps¶

Timestamps refer to specific, unique points in - time. On display, systemd will format these in the - local timezone as follows:

Fri 2012-11-23 23:02:15 CET

The weekday is printed according to the locale - choice of the user.

Parsing Timestamps¶

When parsing systemd will accept a similar - timestamp syntax, but excluding any timezone - specification (this limitation might be removed - eventually). The weekday specification is optional, - but when the weekday is specified it must either be - in the abbreviated ("Wed") or - non-abbreviated ("Wednesday") English - language form (case does not matter), and is not - subject to the locale choice of the user. Either the - date, or the time part may be omitted, in which case - the current date or 00:00:00, resp., is assumed. The - seconds component of the time may also be omitted, in - which case ":00" is assumed. Year numbers may be - specified in full or may be abbreviated (omitting the - century).

A timestamp is considered invalid if a weekday - is specified and the date does not actually match the - specified day of the week.

When parsing, systemd will also accept a few - special placeholders instead of timestamps: - "now" may be used to refer to the - current time (or of the invocation of the command - that is currently executed). "today", - "yesterday", - "tomorrow" refer to 00:00:00 of the - current day, the day before or the next day, - respectively.

When parsing, systemd will also accept relative - time specifications. A time span (see above) that is - prefixed with "+" is evaluated to the - current time plus the specified time - span. Correspondingly, a time span that is prefixed - with "-" is evaluated to the current - time minus the specified time span. Instead of - prefixing the time span with "+" or - "-", it may also be suffixed with a - space and the word "left" or - "ago".

Finally, a timespan prefixed with - "@" is evaluated relative to the UNIX - time epoch 1st Jan, 1970, 00:00.

Examples for valid timestamps and their - normalized form (assuming the current time was - 2012-11-23 18:15:22):

Fri 2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
+300ms20s 5day

Displaying Timestamps¶

Timestamps refer to specific, unique points in time. On + display, systemd will format these in the local timezone as + follows:

Fri 2012-11-23 23:02:15 CET

The weekday is printed according to the locale choice of the + user.

Parsing Timestamps¶

When parsing systemd will accept a similar timestamp syntax, + but excluding any timezone specification (this limitation might be + removed eventually). The weekday specification is optional, but + when the weekday is specified it must either be in the abbreviated + ("Wed") or non-abbreviated + ("Wednesday") English language form (case does + not matter), and is not subject to the locale choice of the user. + Either the date, or the time part may be omitted, in which case + the current date or 00:00:00, resp., is assumed. The seconds + component of the time may also be omitted, in which case ":00" is + assumed. Year numbers may be specified in full or may be + abbreviated (omitting the century).

A timestamp is considered invalid if a weekday is specified + and the date does not actually match the specified day of the + week.

When parsing, systemd will also accept a few special + placeholders instead of timestamps: "now" may be + used to refer to the current time (or of the invocation of the + command that is currently executed). "today", + "yesterday", "tomorrow" refer to + 00:00:00 of the current day, the day before or the next day, + respectively.

When parsing, systemd will also accept relative time + specifications. A time span (see above) that is prefixed with + "+" is evaluated to the current time plus the + specified time span. Correspondingly, a time span that is prefixed + with "-" is evaluated to the current time minus + the specified time span. Instead of prefixing the time span with + "+" or "-", it may also be + suffixed with a space and the word "left" or + "ago".

Finally, a timespan prefixed with "@" is + evaluated relative to the UNIX time epoch 1st Jan, 1970, + 00:00.

Examples for valid timestamps and their normalized form + (assuming the current time was 2012-11-23 18:15:22):

Fri 2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
     2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
-             2012-11-23 → Fri 2012-11-23 00:00:00
-               12-11-23 → Fri 2012-11-23 00:00:00
-               11:12:13 → Fri 2012-11-23 11:12:13
-                  11:12 → Fri 2012-11-23 11:12:00
-                    now → Fri 2012-11-23 18:15:22
-                  today → Fri 2012-11-23 00:00:00
-              yesterday → Fri 2012-11-22 00:00:00
-               tomorrow → Fri 2012-11-24 00:00:00
-               +3h30min → Fri 2012-11-23 21:45:22
-                    -5s → Fri 2012-11-23 18:15:17
-              11min ago → Fri 2012-11-23 18:04:22
-            @1395716396 → Tue 2014-03-25 03:59:56

Note that timestamps printed by systemd will not - be parsed correctly by systemd, as the timezone - specification is not accepted, and printing timestamps - is subject to locale settings for the weekday while - parsing only accepts English weekday names.

In some cases, systemd will display a relative - timestamp (relative to the current time, or the time - of invocation of the command) instead or in addition - to an absolute timestamp as described above. A - relative timestamp is formatted as follows:

2 months 5 days ago

Note that any relative timestamp will also parse - correctly where a timestamp is expected. (see above)

Calendar Events¶

Calendar events may be used to refer to one or - more points in time in a single expression. They form - a superset of the absolute timestamps explained above:

Thu,Fri 2012-*-1,5 11:12:13

The above refers to 11:12:13 of the first or - fifth day of any month of the year 2012, given that it - is a Thursday or Friday.

The weekday specification is optional. If - specified, it should consist of one or more English - language weekday names, either in the abbreviated - (Wed) or non-abbreviated (Wednesday) form (case does - not matter), separated by commas. Specifying two - weekdays separated by "-" refers to a - range of continuous weekdays. "," and - "-" may be combined freely.

In the date and time specifications, any - component may be specified as "*" in - which case any value will match. Alternatively, each - component can be specified as a list of values separated - by commas. Values may also be suffixed with - "/" and a repetition value, which - indicates that the value and all values plus multiples - of the repetition value are matched.

Either time or date specification may be - omitted, in which case the current day and 00:00:00 is - implied, respectively. If the second component is not - specified, ":00" is assumed.

Timezone names may not be specified.

The special expressions - "minutely", - "hourly", "daily", - "monthly", "weekly", - "yearly", - "quarterly", - "semiannually" may be used as - calendar events which refer to - "*-*-* *:*:00", - "*-*-* *:00:00", - "*-*-* 00:00:00", - "*-*-01 00:00:00", - "Mon *-*-* 00:00:00", - "*-01-01 00:00:00", - "*-01,04,07,10-01 00:00:0" and - "*-01,07-01 00:00:00" respectively. -

Examples for valid timestamps and their - normalized form:

   Sat,Thu,Mon-Wed,Sat-Sun → Mon-Thu,Sat,Sun *-*-* 00:00:00
+       2012-11-23 → Fri 2012-11-23 00:00:00
+         12-11-23 → Fri 2012-11-23 00:00:00
+         11:12:13 → Fri 2012-11-23 11:12:13
+      11:12 → Fri 2012-11-23 11:12:00
+        now → Fri 2012-11-23 18:15:22
+      today → Fri 2012-11-23 00:00:00
+        yesterday → Fri 2012-11-22 00:00:00
+         tomorrow → Fri 2012-11-24 00:00:00
+         +3h30min → Fri 2012-11-23 21:45:22
+        -5s → Fri 2012-11-23 18:15:17
+        11min ago → Fri 2012-11-23 18:04:22
+      @1395716396 → Tue 2014-03-25 03:59:56

Note that timestamps printed by systemd will not be parsed + correctly by systemd, as the timezone specification is not + accepted, and printing timestamps is subject to locale settings + for the weekday while parsing only accepts English weekday + names.

In some cases, systemd will display a relative timestamp + (relative to the current time, or the time of invocation of the + command) instead or in addition to an absolute timestamp as + described above. A relative timestamp is formatted as + follows:

2 months 5 days ago

Note that any relative timestamp will also parse correctly + where a timestamp is expected. (see above)

Calendar Events¶

Calendar events may be used to refer to one or more points + in time in a single expression. They form a superset of the + absolute timestamps explained above:

Thu,Fri 2012-*-1,5 11:12:13

The above refers to 11:12:13 of the first or fifth day of + any month of the year 2012, but only if that day is a Thursday or + Friday.

The weekday specification is optional. If specified, it + should consist of one or more English language weekday names, + either in the abbreviated (Wed) or non-abbreviated (Wednesday) + form (case does not matter), separated by commas. Specifying two + weekdays separated by "-" refers to a range of + continuous weekdays. "," and "-" + may be combined freely.

In the date and time specifications, any component may be + specified as "*" in which case any value will + match. Alternatively, each component can be specified as a list of + values separated by commas. Values may also be suffixed with + "/" and a repetition value, which indicates that + the value and all values plus multiples of the repetition value + are matched.

Either time or date specification may be omitted, in which + case the current day and 00:00:00 is implied, respectively. If the + second component is not specified, ":00" is + assumed.

Timezone names may not be specified.

The special expressions + "minutely", + "hourly", "daily", + "monthly", "weekly", + "yearly", + "quarterly", + "semiannually" may be used as + calendar events which refer to + "*-*-* *:*:00", + "*-*-* *:00:00", + "*-*-* 00:00:00", + "*-*-01 00:00:00", + "Mon *-*-* 00:00:00", + "*-01-01 00:00:00", + "*-01,04,07,10-01 00:00:0" and + "*-01,07-01 00:00:00" respectively. +

Examples for valid timestamps and their + normalized form:

   Sat,Thu,Mon-Wed,Sat-Sun → Mon-Thu,Sat,Sun *-*-* 00:00:00
      Mon,Sun 12-*-* 2,1:23 → Mon,Sun 2012-*-* 01,02:23:00
-                   Wed *-1 → Wed *-*-01 00:00:00
-           Wed-Wed,Wed *-1 → Wed *-*-01 00:00:00
-                Wed, 17:48 → Wed *-*-* 17:48:00
+       Wed *-1 → Wed *-*-01 00:00:00
+     Wed-Wed,Wed *-1 → Wed *-*-01 00:00:00
+    Wed, 17:48 → Wed *-*-* 17:48:00
 Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03
-               *-*-7 0:0:0 → *-*-07 00:00:00
-                     10-15 → *-10-15 00:00:00
+         *-*-7 0:0:0 → *-*-07 00:00:00
+         10-15 → *-10-15 00:00:00
        monday *-12-* 17:00 → Mon *-12-* 17:00:00
  Mon,Fri *-*-3,1,2 *:30:45 → Mon,Fri *-*-01,02,03 *:30:45
       12,14,13,12:20,10,30 → *-*-* 12,13,14:10,20,30:00
  mon,fri *-1/2-1,3 *:30:45 → Mon,Fri *-01/2-01,03 *:30:45
-            03-05 08:05:40 → *-03-05 08:05:40
-                  08:05:40 → *-*-* 08:05:40
-                     05:40 → *-*-* 05:40:00
+      03-05 08:05:40 → *-03-05 08:05:40
+      08:05:40 → *-*-* 08:05:40
+         05:40 → *-*-* 05:40:00
     Sat,Sun 12-05 08:05:40 → Sat,Sun *-12-05 08:05:40
-          Sat,Sun 08:05:40 → Sat,Sun *-*-* 08:05:40
-          2003-03-05 05:40 → 2003-03-05 05:40:00
-                2003-03-05 → 2003-03-05 00:00:00
-                     03-05 → *-03-05 00:00:00
-                    hourly → *-*-* *:00:00
-                     daily → *-*-* 00:00:00
-                   monthly → *-*-01 00:00:00
-                    weekly → Mon *-*-* 00:00:00
-                    yearly → *-01-01 00:00:00
-                  annually → *-01-01 00:00:00
-                     *:2/3 → *-*-* *:02/3:00

Calendar events are used by timer units, see - systemd.timer(5) - for details.

+ Sat,Sun 08:05:40 → Sat,Sun *-*-* 08:05:40 + 2003-03-05 05:40 → 2003-03-05 05:40:00 + 2003-03-05 → 2003-03-05 00:00:00 + 03-05 → *-03-05 00:00:00 + hourly → *-*-* *:00:00 + daily → *-*-* 00:00:00 + monthly → *-*-01 00:00:00 + weekly → Mon *-*-* 00:00:00 + yearly → *-01-01 00:00:00 + annually → *-01-01 00:00:00 + *:2/3 → *-*-* *:02/3:00

Calendar events are used by timer units, see + systemd.timer(5) + for details.

diff --git a/man/systemd.time.xml b/man/systemd.time.xml index f35ccd7f1..da0729725 100644 --- a/man/systemd.time.xml +++ b/man/systemd.time.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - systemd.timer - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.timer - 5 - - - - systemd.timer - Timer unit configuration - - - - timer.timer - - - - Description - - A unit configuration file whose name ends in - .timer encodes information about - a timer controlled and supervised by systemd, for - timer-based activation. - - This man page lists the configuration options - specific to this unit type. See - systemd.unit5 - for the common options of all unit configuration - files. The common configuration items are configured - in the generic [Unit] and [Install] sections. The - timer specific configuration options are configured in - the [Timer] section. - - For each timer file, a matching unit file must - exist, describing the unit to activate when the timer - elapses. By default, a service by the same name as the - timer (except for the suffix) is activated. Example: a - timer file foo.timer activates a - matching service foo.service. The - unit to activate may be controlled by - Unit= (see below). - - Unless DefaultDependencies= - is set to , all timer units will - implicitly have dependencies of type - Conflicts= and - Before= on - shutdown.target to ensure that - they are stopped cleanly prior to system shutdown. - Timer units with at least one - OnCalendar= directive will have an - additional After= dependency on - timer-sync.target to avoid - being started before the system clock has been - correctly set. Only timer units involved with early - boot or late system shutdown should disable the - DefaultDependencies= option. - - - - Options - - Timer files must include a [Timer] section, - which carries information about the timer it - defines. The options specific to the [Timer] section - of timer units are the following: - - - - OnActiveSec= - OnBootSec= - OnStartupSec= - OnUnitActiveSec= - OnUnitInactiveSec= - - Defines monotonic timers - relative to different starting points: - OnActiveSec= defines a - timer relative to the moment the timer - itself is - activated. OnBootSec= - defines a timer relative to when the - machine was booted - up. OnStartupSec= - defines a timer relative to when - systemd was first - started. OnUnitActiveSec= - defines a timer relative to when the - unit the timer is activating was last - activated. OnUnitInactiveSec= - defines a timer relative to when the - unit the timer is activating was last - deactivated. - - Multiple directives may be - combined of the same and of different - types. For example, by combining - OnBootSec= and - OnUnitActiveSec=, it is - possible to define a timer that - elapses in regular intervals and - activates a specific service each - time. - - The arguments to the directives - are time spans configured in - seconds. Example: "OnBootSec=50" means - 50s after boot-up. The argument may - also include time units. Example: - "OnBootSec=5h 30min" means 5 hours and - 30 minutes after boot-up. For details - about the syntax of time spans, see - systemd.unit5. - - If a timer configured with - OnBootSec= or - OnStartupSec= is - already in the past when the timer - unit is activated, it will immediately - elapse and the configured unit is - started. This is not the case for - timers defined in the other - directives. - - These are monotonic timers, - independent of wall-clock time and timezones. If the - computer is temporarily suspended, the - monotonic clock stops too. - - If the empty string is assigned - to any of these options, the list of - timers is reset, and all prior - assignments will have no - effect. - - Note that timers do not - necessarily expire at the precise - time configured with these settings, - as they are subject to the - AccuracySec= - setting below. - - - - - OnCalendar= - - Defines realtime - (i.e. wallclock) timers with calendar - event expressions. See - systemd.time7 - for more information on the syntax of - calendar event expressions. Otherwise, - the semantics are similar to - OnActiveSec= and - related settings. - - Note that timers do not - necessarily expire at the precise - time configured with this setting, - as it is subject to the - AccuracySec= - setting below. - - - - AccuracySec= - - Specify the accuracy - the timer shall elapse with. Defaults - to 1min. The timer is scheduled to - elapse within a time window starting - with the time specified in - OnCalendar=, - OnActiveSec=, - OnBootSec=, - OnStartupSec=, - OnUnitActiveSec= or - OnUnitInactiveSec= - and ending the time configured with - AccuracySec= - later. Within this time window, the - expiry time will be placed at a - host-specific, randomized but stable - position that is synchronized between - all local timer units. This is done in - order to distribute the wake-up time - in networked installations, as well as - optimizing power consumption to - suppress unnecessary CPU wake-ups. To - get best accuracy, set this option to - 1us. Note that the timer is still - subject to the timer slack configured - via - systemd-system.conf5's - TimerSlackNSec= - setting. See - prctl2 - for details. To optimize power - consumption, make sure to set this - value as high as possible and as low - as necessary. - - - Unit= - - The unit to activate - when this timer elapses. The argument is a - unit name, whose suffix is not - .timer. If not - specified, this value defaults to a - service that has the same name as the - timer unit, except for the - suffix. (See above.) It is recommended - that the unit name that is activated - and the unit name of the timer unit - are named identically, except for the - suffix. - - - - - Persistent= - - Takes a boolean - argument. If true, the time when the - service unit was last triggered is - stored on disk. When the timer is - activated, the service unit is - triggered immediately if it would have - been triggered at least once during - the time when the timer was inactive. - This is useful to catch up on missed - runs of the service when the machine - was off. Note that this setting only - has an effect on timers configured - with OnCalendar=. - - - - - WakeSystem= - - Takes a boolean - argument. If true, an elapsing timer - will cause the system to resume from - suspend, should it be suspended and if - the system supports this. Note that - this option will only make sure the - system resumes on the appropriate - times, it will not take care of - suspending it again after any work - that is to be done is - finished. Defaults to - false. - - - - - - See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.service5, - systemd.time7, - systemd.directives7, - systemd-system.conf5, - prctl2 - - + + systemd.timer + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.timer + 5 + + + + systemd.timer + Timer unit configuration + + + + timer.timer + + + + Description + + A unit configuration file whose name ends in + .timer encodes information about a timer + controlled and supervised by systemd, for timer-based + activation. + + This man page lists the configuration options specific to + this unit type. See + systemd.unit5 + for the common options of all unit configuration files. The common + configuration items are configured in the generic [Unit] and + [Install] sections. The timer specific configuration options are + configured in the [Timer] section. + + For each timer file, a matching unit file must exist, + describing the unit to activate when the timer elapses. By + default, a service by the same name as the timer (except for the + suffix) is activated. Example: a timer file + foo.timer activates a matching service + foo.service. The unit to activate may be + controlled by Unit= (see below). + + Unless DefaultDependencies= is set to + , all timer units will implicitly have + dependencies of type Conflicts= and + Before= on shutdown.target + to ensure that they are stopped cleanly prior to system shutdown. + Timer units with at least one OnCalendar= + directive will have an additional After= + dependency on timer-sync.target to avoid + being started before the system clock has been correctly set. Only + timer units involved with early boot or late system shutdown + should disable the DefaultDependencies= + option. + + + + Options + + Timer files must include a [Timer] section, which carries + information about the timer it defines. The options specific to + the [Timer] section of timer units are the following: + + + + OnActiveSec= + OnBootSec= + OnStartupSec= + OnUnitActiveSec= + OnUnitInactiveSec= + + Defines monotonic timers relative to different + starting points: OnActiveSec= defines a + timer relative to the moment the timer itself is activated. + OnBootSec= defines a timer relative to when + the machine was booted up. OnStartupSec= + defines a timer relative to when systemd was first started. + OnUnitActiveSec= defines a timer relative + to when the unit the timer is activating was last activated. + OnUnitInactiveSec= defines a timer relative + to when the unit the timer is activating was last + deactivated. + + Multiple directives may be combined of the same and of + different types. For example, by combining + OnBootSec= and + OnUnitActiveSec=, it is possible to define + a timer that elapses in regular intervals and activates a + specific service each time. + + The arguments to the directives are time spans + configured in seconds. Example: "OnBootSec=50" means 50s after + boot-up. The argument may also include time units. Example: + "OnBootSec=5h 30min" means 5 hours and 30 minutes after + boot-up. For details about the syntax of time spans, see + systemd.unit5. + + If a timer configured with OnBootSec= + or OnStartupSec= is already in the past + when the timer unit is activated, it will immediately elapse + and the configured unit is started. This is not the case for + timers defined in the other directives. + + These are monotonic timers, independent of wall-clock + time and timezones. If the computer is temporarily suspended, + the monotonic clock stops too. + + If the empty string is assigned to any of these options, + the list of timers is reset, and all prior assignments will + have no effect. + + Note that timers do not necessarily expire at the + precise time configured with these settings, as they are + subject to the AccuracySec= setting + below. + + + + + OnCalendar= + + Defines realtime (i.e. wallclock) timers with + calendar event expressions. See + systemd.time7 + for more information on the syntax of calendar event + expressions. Otherwise, the semantics are similar to + OnActiveSec= and related settings. + + Note that timers do not necessarily expire at the + precise time configured with this setting, as it is subject to + the AccuracySec= setting + below. + + + + AccuracySec= + + Specify the accuracy the timer shall elapse + with. Defaults to 1min. The timer is scheduled to elapse + within a time window starting with the time specified in + OnCalendar=, + OnActiveSec=, + OnBootSec=, + OnStartupSec=, + OnUnitActiveSec= or + OnUnitInactiveSec= and ending the time + configured with AccuracySec= later. Within + this time window, the expiry time will be placed at a + host-specific, randomized but stable position that is + synchronized between all local timer units. This is done in + order to distribute the wake-up time in networked + installations, as well as optimizing power consumption to + suppress unnecessary CPU wake-ups. To get best accuracy, set + this option to 1us. Note that the timer is still subject to + the timer slack configured via + systemd-system.conf5's + TimerSlackNSec= setting. See + prctl2 + for details. To optimize power consumption, make sure to set + this value as high as possible and as low as + necessary. + + + Unit= + + The unit to activate when this timer elapses. + The argument is a unit name, whose suffix is not + .timer. If not specified, this value + defaults to a service that has the same name as the timer + unit, except for the suffix. (See above.) It is recommended + that the unit name that is activated and the unit name of the + timer unit are named identically, except for the + suffix. + + + + + Persistent= + + Takes a boolean argument. If true, the time + when the service unit was last triggered is stored on disk. + When the timer is activated, the service unit is triggered + immediately if it would have been triggered at least once + during the time when the timer was inactive. This is useful to + catch up on missed runs of the service when the machine was + off. Note that this setting only has an effect on timers + configured with OnCalendar=. + + + + + WakeSystem= + + Takes a boolean argument. If true, an elapsing + timer will cause the system to resume from suspend, should it + be suspended and if the system supports this. Note that this + option will only make sure the system resumes on the + appropriate times, it will not take care of suspending it + again after any work that is to be done is finished. Defaults + to false. + + + + + + See Also + + systemd1, + systemctl1, + systemd.unit5, + systemd.service5, + systemd.time7, + systemd.directives7, + systemd-system.conf5, + prctl2 + + diff --git a/man/systemd.unit.5 b/man/systemd.unit.5 index eea5d7c93..a7e7d8979 100644 --- a/man/systemd.unit.5 +++ b/man/systemd.unit.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSTEMD\&.UNIT" "5" "" "systemd 218" "systemd.unit" +.TH "SYSTEMD\&.UNIT" "5" "" "systemd 219" "systemd.unit" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ systemd.unit \- Unit configuration /run/systemd/system/* /usr/lib/systemd/system/* \&.\&.\&. - + .fi .PP .nf @@ -54,7 +54,7 @@ $XDG_DATA_HOME/systemd/user/* $HOME/\&.local/share/systemd/user/* /usr/lib/systemd/user/* \&.\&.\&. - + .fi .SH "DESCRIPTION" .PP @@ -148,7 +148,9 @@ Some unit names reflect paths existing in the file system namespace\&. Example: dev\-sda\&.device refers to a device with the device node /dev/sda -in the file system namespace\&. If this applies, a special way to escape the path name is used, so that the result is usable as part of a filename\&. Basically, given a path, "/" is replaced by "\-", and all unprintable characters and the "\-" are replaced by C\-style "\ex2d" escapes\&. The root directory "/" is encoded as single dash, while otherwise the initial and ending "/" is removed from all paths during transformation\&. This escaping is reversible\&. +in the file system namespace\&. If this applies, a special way to escape the path name is used, so that the result is usable as part of a filename\&. Basically, given a path, "/" is replaced by "\-" and all other characters which are not ASCII alphanumerics are replaced by C\-style "\ex2d" escapes (except that "_" is never replaced and "\&." is only replaced when it would be the first character in the escaped path)\&. The root directory "/" is encoded as single dash, while otherwise the initial and ending "/" are removed from all paths during transformation\&. This escaping is reversible\&. Properly escaped paths can be generated using the +\fBsystemd-escape\fR(1) +command\&. .PP Optionally, units may be instantiated from a template file at runtime\&. This allows creation of multiple units from a single configuration file\&. If systemd looks for a unit configuration file, it will first search for the literal unit name in the file system\&. If that yields no success and the unit name contains an "@" @@ -176,7 +178,7 @@ Unit files are loaded from a set of paths determined during compilation, describ .PP When systemd is running in user mode (\fB\-\-user\fR) and the variable \fI$SYSTEMD_UNIT_PATH\fR -is set, this contents of this variable overrides the unit load path\&. If +is set, the contents of this variable overrides the unit load path\&. If \fI$SYSTEMD_UNIT_PATH\fR ends with an empty component (":"), the usual unit load path will be appended to the contents of the variable\&. .sp @@ -996,6 +998,161 @@ Use "%%" in place of "%" to specify a single percent sign\&. T} .TE .sp 1 +.PP +Please note that specifiers +"%U", +"%h", +"%s" +are mostly useless when systemd is running in system mode\&. PID 1 cannot query the user account database for information, so the specifiers only work as shortcuts for things which are already specified in a different way in the unit file\&. They are fully functional when systemd is running in +\fB\-\-user\fR +mode\&. +.SH "EXAMPLES" +.PP +\fBExample\ \&1.\ \&Allowing units to be enabled\fR +.PP +The following snippet (highlighted) allows a unit (e\&.g\&. +foo\&.service) to be enabled via +\fBsystemctl enable\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Foo + +[Service] +ExecStart=/usr/sbin/foo\-daemon + +\fI[Install]\fR +\fIWantedBy=multi\-user\&.target\fR +.fi +.if n \{\ +.RE +.\} +.PP +After running +\fBsystemctl enable\fR, a symlink +/etc/systemd/system/multi\-user\&.target\&.wants/foo\&.service +linking to the actual unit will be created\&. It tells systemd to pull in the unit when starting +multi\-user\&.target\&. The inverse +\fBsystemctl disable\fR +will remove that symlink again\&. +.PP +\fBExample\ \&2.\ \&Overriding vendor settings\fR +.PP +There are two methods of overriding vendor settings in unit files: copying the unit file from +/usr/lib/systemd/system +to +/etc/systemd/system +and modifying the chosen settings\&. Alternatively, one can create a directory named +\fIunit\fR\&.d/ +within +/etc/systemd/system +and place a drop\-in file +\fIname\fR\&.conf +there that only changes the specific settings one is interested in\&. Note that multiple such drop\-in files are read if present\&. +.PP +The advantage of the first method is that one easily overrides the complete unit, the vendor unit is not parsed at all anymore\&. It has the disadvantage that improvements to the unit file by the vendor are not automatically incorporated on updates\&. +.PP +The advantage of the second method is that one only overrides the settings one specifically wants, where updates to the unit by the vendor automatically apply\&. This has the disadvantage that some future updates by the vendor might be incompatible with the local changes\&. +.PP +Note that for drop\-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), such as +\fIConditionPathExists=\fR +(or e\&.g\&. +\fIExecStart=\fR +in service units), one needs to first clear the list before re\-adding all entries except the one that is to be removed\&. See below for an example\&. +.PP +This also applies for user instances of systemd, but with different locations for the unit files\&. See the section on unit load paths for further details\&. +.PP +Suppose there is a vendor\-supplied unit +/usr/lib/systemd/system/httpd\&.service +with the following contents: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Some HTTP server +After=remote\-fs\&.target sqldb\&.service +Requires=sqldb\&.service +AssertPathExists=/srv/webserver + +[Service] +Type=notify +ExecStart=/usr/sbin/some\-fancy\-httpd\-server +Nice=5 + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Now one wants to change some settings as an administrator: firstly, in the local setup, +/srv/webserver +might not exist, because the HTTP server is configured to use +/srv/www +instead\&. Secondly, the local configuration makes the HTTP server also depend on a memory cache service, +memcached\&.service, that should be pulled in (\fIRequires=\fR) and also be ordered appropriately (\fIAfter=\fR)\&. Thirdly, in order to harden the service a bit more, the administrator would like to set the +\fIPrivateTmp=\fR +setting (see +\fBsystemd.service\fR(5) +for details)\&. And lastly, the administrator would like to reset the niceness of the service to its default value of 0\&. +.PP +The first possibility is to copy the unit file to +/etc/systemd/system/httpd\&.service +and change the chosen settings: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +Description=Some HTTP server +After=remote\-fs\&.target sqldb\&.service \fImemcached\&.service\fR +Requires=sqldb\&.service \fImemcached\&.service\fR +AssertPathExists=\fI/srv/www\fR + +[Service] +Type=notify +ExecStart=/usr/sbin/some\-fancy\-httpd\-server +\fINice=0\fR +\fIPrivateTmp=yes\fR + +[Install] +WantedBy=multi\-user\&.target +.fi +.if n \{\ +.RE +.\} +.PP +Alternatively, the administrator could create a drop\-in file +/etc/systemd/system/httpd\&.service\&.d/local\&.conf +with the following contents: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[Unit] +After=memcached\&.service +Requires=memcached\&.service +# Reset all assertions and then re\-add the condition we want +AssertPathExists= +AssertPathExists=/srv/www + +[Service] +Nice=0 +PrivateTmp=yes +.fi +.if n \{\ +.RE +.\} +.PP +Note that dependencies (\fIAfter=\fR, etc\&.) cannot be reset to an empty list, so dependencies can only be added in drop\-ins\&. If you want to remove dependencies, you have to override the entire unit\&. .SH "SEE ALSO" .PP \fBsystemd\fR(1), @@ -1014,7 +1171,7 @@ T} \fBsystemd.scope\fR(5), \fBsystemd.slice\fR(5), \fBsystemd.time\fR(7), -\fBsystemd-verify\fR(1), +\fBsystemd-analyze\fR(1), \fBcapabilities\fR(7), \fBsystemd.directives\fR(7), \fBuname\fR(1) diff --git a/man/systemd.unit.html b/man/systemd.unit.html index 79210fd97..eef25ac55 100644 --- a/man/systemd.unit.html +++ b/man/systemd.unit.html @@ -19,22 +19,22 @@ Directives · Python · libudev · - gudev systemd 218

Name

systemd.unit — Unit configuration

Synopsis

service.service, - socket.socket, - device.device, - mount.mount, - automount.automount, - swap.swap, - target.target, - path.path, - timer.timer, - snapshot.snapshot, - slice.slice, - scope.scope

/etc/systemd/system/*
+ gudev systemd 219


Name

systemd.unit — Unit configuration

Synopsis

service.service, + socket.socket, + device.device, + mount.mount, + automount.automount, + swap.swap, + target.target, + path.path, + timer.timer, + snapshot.snapshot, + slice.slice, + scope.scope

/etc/systemd/system/*
/run/systemd/system/*
/usr/lib/systemd/system/*
...
-                

$XDG_CONFIG_HOME/systemd/user/*
+    

$XDG_CONFIG_HOME/systemd/user/*
$HOME/.config/systemd/user/*
/etc/systemd/user/*
$XDG_RUNTIME_DIR/systemd/user/*
@@ -43,958 +43,769 @@ $HOME/.local/share/systemd/user/*
/usr/lib/systemd/user/*
...
-                

Description¶

A unit configuration file encodes information - about a service, a socket, a device, a mount point, an - automount point, a swap file or partition, a start-up - target, a watched file system path, a timer controlled - and supervised by - systemd(1), - a temporary system state snapshot, a resource - management slice or a group of externally created - processes. The syntax is inspired by XDG - Desktop Entry Specification - .desktop files, which are in turn - inspired by Microsoft Windows - .ini files.

This man page lists the common configuration - options of all the unit types. These options need to - be configured in the [Unit] or [Install] - sections of the unit files.

In addition to the generic [Unit] and [Install] - sections described here, each unit may have a - type-specific section, e.g. [Service] for a service - unit. See the respective man pages for more - information: - systemd.service(5), - systemd.socket(5), - systemd.device(5), - systemd.mount(5), - systemd.automount(5), - systemd.swap(5), - systemd.target(5), - systemd.path(5), - systemd.timer(5), - systemd.snapshot(5). - systemd.slice(5). - systemd.scope(5). -

Various settings are allowed to be specified - more than once, in which case the interpretation - depends on the setting. Often, multiple settings form - a list, and setting to an empty value "resets", which - means that previous assignments are ignored. When this - is allowed, it is mentioned in the description of the - setting. Note that using multiple assignments to the - same value makes the unit file incompatible with - parsers for the XDG .desktop file - format.

Unit files are loaded from a set of paths - determined during compilation, described in the next section. -

Unit files may contain additional options on top - of those listed here. If systemd encounters an unknown - option, it will write a warning log message but - continue loading the unit. If an option or section name - is prefixed with X-, it is ignored - completely by systemd. Options within an ignored - section do not need the prefix. Applications may use - this to include additional information in the unit - files.

Boolean arguments used in unit files can be - written in various formats. For positive settings the - strings 1, yes, - true and on are - equivalent. For negative settings, the strings - 0, no, - false and off are - equivalent.

Time span values encoded in unit files can be - written in various formats. A stand-alone number - specifies a time in seconds. If suffixed with a time - unit, the unit is honored. A concatenation of multiple - values with units is supported, in which case the - values are added up. Example: "50" refers to 50 - seconds; "2min 200ms" refers to 2 minutes plus 200 - milliseconds, i.e. 120200ms. The following time units - are understood: s, min, h, d, w, ms, us. For details - see - systemd.time(7).

Empty lines and lines starting with # or ; are - ignored. This may be used for commenting. Lines ending - in a backslash are concatenated with the following - line while reading and the backslash is replaced by a - space character. This may be used to wrap long lines.

Along with a unit file - foo.service, the directory - foo.service.wants/ may exist. All - unit files symlinked from such a directory are - implicitly added as dependencies of type - Wants= to the unit. This is useful - to hook units into the start-up of other units, - without having to modify their unit files. For details - about the semantics of Wants=, see - below. The preferred way to create symlinks in the - .wants/ directory of a unit file - is with the enable command of the - systemctl(1) - tool which reads information from the [Install] - section of unit files (see below). A similar - functionality exists for Requires= - type dependencies as well, the directory suffix is - .requires/ in this case.

Along with a unit file - foo.service, a directory - foo.service.d/ may exist. All - files with the suffix ".conf" from - this directory will be parsed after the file itself is - parsed. This is useful to alter or add configuration - settings to a unit, without having to modify their - unit files. Make sure that the file that is included - has the appropriate section headers before any - directive. Note that for instanced units this logic - will first look for the instance - ".d/" subdirectory and read its - ".conf" files, followed by the - template ".d/" subdirectory and reads - its ".conf" files.

Note that while systemd offers a flexible - dependency system between units it is recommended to - use this functionality only sparingly and instead rely - on techniques such as bus-based or socket-based - activation which make dependencies implicit, resulting - in a both simpler and more flexible system.

Some unit names reflect paths existing in the - file system namespace. Example: a device unit - dev-sda.device refers to a device - with the device node /dev/sda in - the file system namespace. If this applies, a special - way to escape the path name is used, so that the - result is usable as part of a filename. Basically, - given a path, "/" is replaced by "-", and all - unprintable characters and the "-" are replaced by - C-style "\x2d" escapes. The root directory "/" is - encoded as single dash, while otherwise the initial - and ending "/" is removed from all paths during - transformation. This escaping is reversible.

Optionally, units may be instantiated from a - template file at runtime. This allows creation of - multiple units from a single configuration file. If - systemd looks for a unit configuration file, it will - first search for the literal unit name in the - file system. If that yields no success and the unit - name contains an "@" character, systemd will look for a - unit template that shares the same name but with the - instance string (i.e. the part between the "@" character - and the suffix) removed. Example: if a service - getty@tty3.service is requested - and no file by that name is found, systemd will look - for getty@.service and - instantiate a service from that configuration file if - it is found.

To refer to the instance string from - within the configuration file you may use the special - "%i" specifier in many of the - configuration options. See below for details.

If a unit file is empty (i.e. has the file size - 0) or is symlinked to /dev/null, - its configuration will not be loaded and it appears - with a load state of "masked", and - cannot be activated. Use this as an effective way to - fully disable a unit, making it impossible to start it - even manually.

The unit file format is covered by the - Interface - Stability Promise.

Unit Load Path¶

Unit files are loaded from a set of paths - determined during compilation, described in the two - tables below. Unit files found in directories listed - earlier override files with the same name in - directories lower in the list.

When systemd is running in user mode - (--user) and the variable - $SYSTEMD_UNIT_PATH is set, this - contents of this variable overrides the unit load - path. If $SYSTEMD_UNIT_PATH ends - with an empty component (":"), the - usual unit load path will be appended to the contents - of the variable.

Table 1.  - Load path when running in system mode (--system). -

PathDescription
/etc/systemd/systemLocal configuration
/run/systemd/systemRuntime units
/usr/lib/systemd/systemUnits of installed packages

Table 2.  - Load path when running in user mode (--user). -

PathDescription
$XDG_CONFIG_HOME/systemd/userUser configuration (only used when $XDG_CONFIG_HOME is set)
$HOME/.config/systemd/userUser configuration (only used when $XDG_CONFIG_HOME is not set)
/etc/systemd/userLocal configuration
$XDG_RUNTIME_DIR/systemd/userRuntime units (only used when $XDG_RUNTIME_DIR is set)
/run/systemd/userRuntime units
$XDG_DATA_HOME/systemd/userUnits of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)
$HOME/.local/share/systemd/userUnits of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set)
/usr/lib/systemd/userUnits of packages that have been installed system-wide

Additional units might be loaded into systemd - ("linked") from directories not on the unit load - path. See the link command for - systemctl(1). Also, - some units are dynamically created via generators - Generators. -

[Unit] Section Options¶

Unit file may include a [Unit] section, which - carries generic information about the unit that is not - dependent on the type of unit:

Description=¶

A free-form string - describing the unit. This is intended - for use in UIs to show descriptive - information along with the unit - name. The description should contain a name - that means something to the end user. - "Apache2 Web Server" is a good - example. Bad examples are - "high-performance light-weight HTTP - server" (too generic) or - "Apache2" (too specific and - meaningless for people who do not know - Apache).

Documentation=¶

A space-separated list - of URIs referencing documentation for - this unit or its - configuration. Accepted are only URIs - of the types - "http://", - "https://", - "file:", - "info:", - "man:". For more - information about the syntax of these - URIs, see - uri(7). The - URIs should be listed in order of - relevance, starting with the most - relevant. It is a good idea to first - reference documentation that explains - what the unit's purpose is, followed - by how it is configured, followed by - any other related documentation. This - option may be specified more than once, - in which case the specified list of - URIs is merged. If the empty string is - assigned to this option, the list is - reset and all prior assignments will - have no effect.

Requires=¶

Configures requirement - dependencies on other units. If this - unit gets activated, the units listed - here will be activated as well. If one - of the other units gets deactivated or - its activation fails, this unit will - be deactivated. This option may be - specified more than once or multiple - space-separated units may be specified - in one option in which case - requirement dependencies for all - listed names will be created. Note - that requirement dependencies do not - influence the order in which services - are started or stopped. This has to be - configured independently with the - After= or - Before= options. If - a unit - foo.service - requires a unit - bar.service as - configured with - Requires= and no - ordering is configured with - After= or - Before=, then both - units will be started simultaneously - and without any delay between them if - foo.service is - activated. Often it is a better choice - to use Wants= - instead of - Requires= in order - to achieve a system that is more - robust when dealing with failing - services.

Note that dependencies of this - type may also be configured outside of - the unit configuration file by - adding a symlink to a - .requires/ directory - accompanying the unit file. For - details see above.

RequiresOverridable=¶

Similar to - Requires=. - Dependencies listed in - RequiresOverridable= - which cannot be fulfilled or fail to - start are ignored if the startup was - explicitly requested by the user. If - the start-up was pulled in indirectly - by some dependency or automatic - start-up of units that is not - requested by the user, this dependency - must be fulfilled and otherwise the - transaction fails. Hence, this option - may be used to configure dependencies - that are normally honored unless the - user explicitly starts up the unit, in - which case whether they failed or not - is irrelevant.

Requisite=, RequisiteOverridable=¶

Similar to - Requires= and - RequiresOverridable=, - respectively. However, if the units - listed here are not started already, - they will not be started and the - transaction will fail immediately. -

Wants=¶

A weaker version of - Requires=. Units - listed in this option will be started - if the configuring unit is. However, - if the listed units fail to start - or cannot be added to the transaction, - this has no impact on the validity of - the transaction as a whole. This is - the recommended way to hook start-up - of one unit to the start-up of another - unit.

Note that dependencies of this - type may also be configured outside of - the unit configuration file by adding - symlinks to a - .wants/ directory - accompanying the unit file. For - details, see above.

BindsTo=¶

Configures requirement - dependencies, very similar in style to - Requires=, however - in addition to this behavior, it also - declares that this unit is stopped - when any of the units listed suddenly - disappears. Units can suddenly, - unexpectedly disappear if a service - terminates on its own choice, a device - is unplugged or a mount point - unmounted without involvement of - systemd.

PartOf=¶

Configures dependencies - similar to Requires=, - but limited to stopping and restarting - of units. When systemd stops or restarts - the units listed here, the action is - propagated to this unit. - Note that this is a one-way dependency — - changes to this unit do not affect the - listed units. -

Conflicts=¶

A space-separated list - of unit names. Configures negative - requirement dependencies. If a unit - has a Conflicts= - setting on another unit, starting the - former will stop the latter and vice - versa. Note that this setting is - independent of and orthogonal to the - After= and - Before= ordering - dependencies.

If a unit A that conflicts with - a unit B is scheduled to be started at - the same time as B, the transaction - will either fail (in case both are - required part of the transaction) or - be modified to be fixed (in case one - or both jobs are not a required part - of the transaction). In the latter - case, the job that is not the required - will be removed, or in case both are - not required, the unit that conflicts - will be started and the unit that is - conflicted is - stopped.

Before=, After=¶

A space-separated list - of unit names. Configures ordering - dependencies between units. If a unit - foo.service - contains a setting - Before=bar.service - and both units are being started, - bar.service's - start-up is delayed until - foo.service is - started up. Note that this setting is - independent of and orthogonal to the - requirement dependencies as configured - by Requires=. It is - a common pattern to include a unit - name in both the - After= and - Requires= option, in - which case the unit listed will be - started before the unit that is - configured with these options. This - option may be specified more than - once, in which case ordering - dependencies for all listed names are - created. After= is - the inverse of - Before=, i.e. while - After= ensures that - the configured unit is started after - the listed unit finished starting up, - Before= ensures the - opposite, i.e. that the configured - unit is fully started up before the - listed unit is started. Note that when - two units with an ordering dependency - between them are shut down, the - inverse of the start-up order is - applied. i.e. if a unit is configured - with After= on - another unit, the former is stopped - before the latter if both are shut - down. If one unit with an ordering - dependency on another unit is shut - down while the latter is started up, - the shut down is ordered before the - start-up regardless of whether the - ordering dependency is actually of - type After= or - Before=. If two - units have no ordering dependencies - between them, they are shut down or - started up simultaneously, and no - ordering takes - place.

OnFailure=¶

A space-separated list - of one or more units that are - activated when this unit enters the - "failed" - state.

PropagatesReloadTo=, ReloadPropagatedFrom=¶

A space-separated list - of one or more units where reload - requests on this unit will be - propagated to, or reload requests on - the other unit will be propagated to - this unit, respectively. Issuing a - reload request on a unit will - automatically also enqueue a reload - request on all units that the reload - request shall be propagated to via - these two settings.

JoinsNamespaceOf=¶

For units that start - processes (such as service units), - lists one or more other units whose - network and/or temporary file - namespace to join. This only applies - to unit types which support the - PrivateNetwork= and - PrivateTmp= - directives (see - systemd.exec(5) - for details). If a unit that has this - setting set is started, its processes - will see the same - /tmp, - /tmp/var and - network namespace as one listed unit - that is started. If multiple listed - units are already started, it is not - defined which namespace is - joined. Note that this setting only - has an effect if - PrivateNetwork= - and/or PrivateTmp= - is enabled for both the unit that - joins the namespace and the unit whose - namespace is joined.

RequiresMountsFor=¶

Takes a - space-separated list of absolute - paths. Automatically adds dependencies - of type Requires= - and After= for all - mount units required to access the - specified path.

Mount points marked with - noauto are not - mounted automatically and will be - ignored for the purposes of this - option. If such a mount should be a - requirement for this unit, - direct dependencies on the mount - units may be added - (Requires= and - After= or - some other combination). -

OnFailureJobMode=¶

Takes a value of - "fail", - "replace", - "replace-irreversibly", - "isolate", - "flush", - "ignore-dependencies" - or - "ignore-requirements". Defaults - to - "replace". Specifies - how the units listed in - OnFailure= will be - enqueued. See - systemctl(1)'s - --job-mode= option - for details on the possible values. If - this is set to - "isolate", only a - single unit may be listed in - OnFailure=..

IgnoreOnIsolate=¶

Takes a boolean - argument. If true, - this unit will not be stopped when - isolating another unit. Defaults to - false.

IgnoreOnSnapshot=¶

Takes a boolean - argument. If true, - this unit will not be included in - snapshots. Defaults to - true for device and - snapshot units, false - for the others.

StopWhenUnneeded=¶

Takes a boolean - argument. If true, - this unit will be stopped when it is - no longer used. Note that in order to - minimize the work to be executed, - systemd will not stop units by default - unless they are conflicting with other - units, or the user explicitly - requested their shut down. If this - option is set, a unit will be - automatically cleaned up if no other - active unit requires it. Defaults to - false.

RefuseManualStart=, RefuseManualStop=¶

Takes a boolean - argument. If true, - this unit can only be activated - or deactivated indirectly. In - this case, explicit start-up - or termination requested by the - user is denied, however if it is - started or stopped as a - dependency of another unit, start-up - or termination will succeed. This - is mostly a safety feature to ensure - that the user does not accidentally - activate units that are not intended - to be activated explicitly, and not - accidentally deactivate units that are - not intended to be deactivated. - These options default to - false.

AllowIsolate=¶

Takes a boolean - argument. If true, - this unit may be used with the - systemctl isolate - command. Otherwise, this will be - refused. It probably is a good idea to - leave this disabled except for target - units that shall be used similar to - runlevels in SysV init systems, just - as a precaution to avoid unusable - system states. This option defaults to - false.

DefaultDependencies=¶

Takes a boolean - argument. If true, - (the default), a few default - dependencies will implicitly be - created for the unit. The actual - dependencies created depend on the - unit type. For example, for service - units, these dependencies ensure that - the service is started only after - basic system initialization is - completed and is properly terminated on - system shutdown. See the respective - man pages for details. Generally, only - services involved with early boot or - late shutdown should set this option - to false. It is - highly recommended to leave this - option enabled for the majority of - common units. If set to - false, this option - does not disable all implicit - dependencies, just non-essential - ones.

JobTimeoutSec=, JobTimeoutAction=, JobTimeoutRebootArgument=¶

When a job for this - unit is queued a time-out may be - configured. If this time limit is - reached, the job will be cancelled, - the unit however will not change state - or even enter the - "failed" mode. This - value defaults to 0 (job timeouts - disabled), except for device - units. NB: this timeout is independent - from any unit-specific timeout (for - example, the timeout set with - StartTimeoutSec= in service - units) as the job timeout has no - effect on the unit itself, only on the - job that might be pending for it. Or - in other words: unit-specific timeouts - are useful to abort unit state - changes, and revert them. The job - timeout set with this option however - is useful to abort only the job - waiting for the unit state to - change.

JobTimeoutAction= - optionally configures an additional - action to take when the time-out is - hit. It takes the same values as the - per-service - StartLimitAction= - setting, see - systemd.service(5) - for details. Defaults to - none. JobTimeoutRebootArgument= - configures an optional reboot string - to pass to the - reboot(2) - system call.

ConditionArchitecture=, ConditionVirtualization=, ConditionHost=, ConditionKernelCommandLine=, ConditionSecurity=, ConditionCapability=, ConditionACPower=, ConditionNeedsUpdate=, ConditionFirstBoot=, ConditionPathExists=, ConditionPathExistsGlob=, ConditionPathIsDirectory=, ConditionPathIsSymbolicLink=, ConditionPathIsMountPoint=, ConditionPathIsReadWrite=, ConditionDirectoryNotEmpty=, ConditionFileNotEmpty=, ConditionFileIsExecutable=¶

Before starting a unit - verify that the specified condition is - true. If it is not true, the starting - of the unit will be skipped, however - all ordering dependencies of it are - still respected. A failing condition - will not result in the unit being - moved into a failure state. The - condition is checked at the time the - queued start job is to be - executed.

ConditionArchitecture= - may be used to check whether the - system is running on a specific - architecture. Takes one of - x86, - x86-64, - ppc, - ppc-le, - ppc64, - ppc64-le, - ia64, - parisc, - parisc64, - s390, - s390x, - sparc, - sparc64, - mips, - mips-le, - mips64, - mips64-le, - alpha, - arm, - arm-be, - arm64, - arm64-be, - sh, - sh64, - m86k, - tilegx, - cris to test - against a specific architecture. The - architecture is determined from the - information returned by - uname(2) - and is thus subject to - personality(2). Note - that a Personality= - setting in the same unit file has no - effect on this condition. A special - architecture name - native is mapped to - the architecture the system manager - itself is compiled for. The test may - be negated by prepending an - exclamation mark.

ConditionVirtualization= - may be used to check whether the - system is executed in a virtualized - environment and optionally test - whether it is a specific - implementation. Takes either boolean - value to check if being executed in - any virtualized environment, or one of - vm and - container to test - against a generic type of - virtualization solution, or one of - qemu, - kvm, - zvm, - vmware, - microsoft, - oracle, - xen, - bochs, - uml, - openvz, - lxc, - lxc-libvirt, - systemd-nspawn, - docker to test - against a specific implementation. See - systemd-detect-virt(1) - for a full list of known - virtualization technologies and their - identifiers. If multiple - virtualization technologies are - nested, only the innermost is - considered. The test may be negated by - prepending an exclamation mark.

ConditionHost= - may be used to match against the - hostname or machine ID of the - host. This either takes a hostname - string (optionally with shell style - globs) which is tested against the - locally set hostname as returned by - gethostname(2), - or a machine ID formatted as string - (see - machine-id(5)). - The test may be negated by prepending - an exclamation mark.

ConditionKernelCommandLine= - may be used to check whether a - specific kernel command line option is - set (or if prefixed with the - exclamation mark unset). The argument - must either be a single word, or an - assignment (i.e. two words, separated - "="). In the former - case the kernel command line is - searched for the word appearing as is, - or as left hand side of an - assignment. In the latter case, the - exact assignment is looked for with - right and left hand side - matching.

ConditionSecurity= - may be used to check whether the given - security module is enabled on the - system. Currently the recognized - values values are - selinux, - apparmor, - ima, - smack and - audit. The test may - be negated by prepending an - exclamation mark.

ConditionCapability= - may be used to check whether the given - capability exists in the capability - bounding set of the service manager - (i.e. this does not check whether - capability is actually available in - the permitted or effective sets, see - capabilities(7) - for details). Pass a capability name - such as "CAP_MKNOD", - possibly prefixed with an exclamation - mark to negate the check.

ConditionACPower= - may be used to check whether the - system has AC power, or is exclusively - battery powered at the time of - activation of the unit. This takes a - boolean argument. If set to - true, the condition - will hold only if at least one AC - connector of the system is connected - to a power source, or if no AC - connectors are known. Conversely, if - set to false, the - condition will hold only if there is - at least one AC connector known and - all AC connectors are disconnected - from a power source.

ConditionNeedsUpdate= - takes one of /var - or /etc as - argument, possibly prefixed with a - "!" (for inverting - the condition). This condition may be - used to conditionalize units on - whether the specified directory - requires an update because - /usr's - modification time is newer than the - stamp file - .updated in the - specified directory. This is useful to - implement offline updates of the - vendor operating system resources in - /usr that require - updating of /etc - or /var on the - next following boot. Units making use - of this condition should order - themselves before - systemd-update-done.service(8), - to make sure they run before the stamp - files's modification time gets reset - indicating a completed update.

ConditionFirstBoot= - takes a boolean argument. This - condition may be used to - conditionalize units on whether the - system is booting up with an - unpopulated /etc - directory. This may be used to - populate /etc on - the first boot after factory reset, or - when a new system instances boots up - for the first time.

With - ConditionPathExists= - a file existence condition is - checked before a unit is started. If - the specified absolute path name does - not exist, the condition will - fail. If the absolute path name passed - to - ConditionPathExists= - is prefixed with an exclamation mark - ("!"), the test is negated, and the unit - is only started if the path does not - exist.

ConditionPathExistsGlob= - is similar to - ConditionPathExists=, - but checks for the existence of at - least one file or directory matching - the specified globbing pattern.

ConditionPathIsDirectory= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a - directory.

ConditionPathIsSymbolicLink= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a symbolic - link.

ConditionPathIsMountPoint= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a mount - point.

ConditionPathIsReadWrite= - is similar to - ConditionPathExists= - but verifies whether the underlying - file system is readable and writable - (i.e. not mounted - read-only).

ConditionDirectoryNotEmpty= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a non-empty - directory.

ConditionFileNotEmpty= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and refers to a regular file - with a non-zero size.

ConditionFileIsExecutable= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists, is a regular file and marked - executable.

If multiple conditions are - specified, the unit will be executed if - all of them apply (i.e. a logical AND - is applied). Condition checks can be - prefixed with a pipe symbol (|) in - which case a condition becomes a - triggering condition. If at least one - triggering condition is defined for a - unit, then the unit will be executed if - at least one of the triggering - conditions apply and all of the - non-triggering conditions. If you - prefix an argument with the pipe - symbol and an exclamation mark, the - pipe symbol must be passed first, the - exclamation second. Except for - ConditionPathIsSymbolicLink=, - all path checks follow symlinks. If - any of these options is assigned the - empty string, the list of conditions is - reset completely, all previous - condition settings (of any kind) will - have no effect.

AssertArchitecture=, AssertVirtualization=, AssertHost=, AssertKernelCommandLine=, AssertSecurity=, AssertCapability=, AssertACPower=, AssertNeedsUpdate=, AssertFirstBoot=, AssertPathExists=, AssertPathExistsGlob=, AssertPathIsDirectory=, AssertPathIsSymbolicLink=, AssertPathIsMountPoint=, AssertPathIsReadWrite=, AssertDirectoryNotEmpty=, AssertFileNotEmpty=, AssertFileIsExecutable=¶

Similar to the - ConditionArchitecture=, - ConditionVirtualization=, - ... condition settings described above - these settings add assertion checks to - the start-up of the unit. However, - unlike the conditions settings any - assertion setting that is not met - results in failure of the start - job it was triggered by.

SourcePath=¶

A path to a - configuration file this unit has been - generated from. This is primarily - useful for implementation of generator - tools that convert configuration from - an external configuration file format - into native unit files. This - functionality should not be used in - normal units.

[Install] Section Options¶

Unit file may include an - "[Install]" section, which carries - installation information for the unit. This section is - not interpreted by - systemd(1) - during runtime. It is used exclusively by the - enable and - disable commands of the - systemctl(1) - tool during installation of a unit:

Alias=¶

A space-separated list - of additional names this unit shall be - installed under. The names listed here - must have the same suffix (i.e. type) - as the unit file name. This option may - be specified more than once, in which - case all listed names are used. At - installation time, systemctl - enable will create symlinks - from these names to the unit - filename.

WantedBy=, RequiredBy=¶

This option may be - used more than once, or a - space-separated list of unit names may - be given. A symbolic link is created - in the .wants/ or - .requires/ - directory of each of the listed units - when this unit is installed by - systemctl enable. - This has the effect that a dependency - of type Wants= or - Requires= is added - from the listed unit to the current - unit. The primary result is that the - current unit will be started when the - listed unit is started. See the - description of - Wants= and - Requires= in the - [Unit] section for details.

WantedBy=foo.service - in a service - bar.service is - mostly equivalent to - Alias=foo.service.wants/bar.service - in the same file. In case of template - units, systemctl enable - must be called with an instance name, and - this instance will be added to the - .wants/ or - .requires/ list - of the listed unit. - E.g. WantedBy=getty.target - in a service - getty@.service - will result in systemctl - enable getty@tty2.service - creating a - getty.target.wants/getty@tty2.service - link to getty@.service. -

Also=¶

Additional units to - install/deinstall when this unit is - installed/deinstalled. If the user - requests installation/deinstallation - of a unit with this option configured, - systemctl enable - and systemctl - disable will automatically - install/uninstall units listed in this option as - well.

This option may be used more - than once, or a space-separated list - of unit names may be - given.

DefaultInstance=¶

In template unit files, - this specifies for which instance the - unit shall be enabled if the template - is enabled without any explicitly set - instance. This option has no effect in - non-template unit files. The specified - string must be usable as instance - identifier.

The following specifiers are interpreted in the - Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v. - For their meaning see the next section. -

Specifiers¶

Many settings resolve specifiers which may be - used to write generic unit files referring to runtime - or unit parameters that are replaced when the unit - files are loaded. The following specifiers are - understood:

Table 3. Specifiers available in unit files

SpecifierMeaningDetails
"%n"Full unit name 
"%N"Unescaped full unit nameSame as "%n", but with escaping undone
"%p"Prefix nameFor instantiated units, this refers to the string before the "@" character of the unit name. For non-instantiated units, this refers to the name of the unit with the type suffix removed.
"%P"Unescaped prefix nameSame as "%p", but with escaping undone
"%i"Instance nameFor instantiated units: this is the string between the "@" character and the suffix of the unit name.
"%I"Unescaped instance nameSame as "%i", but with escaping undone
"%f"Unescaped filenameThis is either the unescaped instance name (if applicable) with / prepended (if applicable), or the prefix name prepended with /.
"%c"Control group path of the unitThis path does not include the /sys/fs/cgroup/systemd/ prefix.
"%r"Control group path of the slice the unit is placed inThis usually maps to the parent cgroup path of "%c".
"%R"Root control group path below which slices and units are placedFor system instances, this resolves to /, except in containers, where this maps to the container's root control group path.
"%t"Runtime directoryThis is either /run (for the system manager) or the path "$XDG_RUNTIME_DIR" resolves to (for user managers).
"%u"User nameThis is the name of the configured user of the unit, or (if none is set) the user running the systemd instance.
"%U"User UIDThis is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user.
"%h"User home directoryThis is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.
"%s"User shellThis is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.
"%m"Machine IDThe machine ID of the running system, formatted as string. See machine-id(5) for more information.
"%b"Boot IDThe boot ID of the running system, formatted as string. See random(4) for more information.
"%H"Host nameThe hostname of the running system at the point in time the unit configuation is loaded.
"%v"Kernel releaseIdentical to uname -r output
"%%"Single percent signUse "%%" in place of "%" to specify a single percent sign.

+    

Description¶

A unit configuration file encodes information about a + service, a socket, a device, a mount point, an automount point, a + swap file or partition, a start-up target, a watched file system + path, a timer controlled and supervised by + systemd(1), + a temporary system state snapshot, a resource management slice or + a group of externally created processes. The syntax is inspired by + XDG + Desktop Entry Specification .desktop + files, which are in turn inspired by Microsoft Windows + .ini files.

This man page lists the common configuration options of all + the unit types. These options need to be configured in the [Unit] + or [Install] sections of the unit files.

In addition to the generic [Unit] and [Install] sections + described here, each unit may have a type-specific section, e.g. + [Service] for a service unit. See the respective man pages for + more information: + systemd.service(5), + systemd.socket(5), + systemd.device(5), + systemd.mount(5), + systemd.automount(5), + systemd.swap(5), + systemd.target(5), + systemd.path(5), + systemd.timer(5), + systemd.snapshot(5). + systemd.slice(5). + systemd.scope(5). +

Various settings are allowed to be specified more than once, + in which case the interpretation depends on the setting. Often, + multiple settings form a list, and setting to an empty value + "resets", which means that previous assignments are ignored. When + this is allowed, it is mentioned in the description of the + setting. Note that using multiple assignments to the same value + makes the unit file incompatible with parsers for the XDG + .desktop file format.

Unit files are loaded from a set of paths determined during + compilation, described in the next section.

Unit files may contain additional options on top of those + listed here. If systemd encounters an unknown option, it will + write a warning log message but continue loading the unit. If an + option or section name is prefixed with X-, it is + ignored completely by systemd. Options within an ignored section + do not need the prefix. Applications may use this to include + additional information in the unit files.

Boolean arguments used in unit files can be written in + various formats. For positive settings the strings + 1, yes, true + and on are equivalent. For negative settings, the + strings 0, no, + false and off are + equivalent.

Time span values encoded in unit files can be written in + various formats. A stand-alone number specifies a time in seconds. + If suffixed with a time unit, the unit is honored. A concatenation + of multiple values with units is supported, in which case the + values are added up. Example: "50" refers to 50 seconds; "2min + 200ms" refers to 2 minutes plus 200 milliseconds, i.e. 120200ms. + The following time units are understood: s, min, h, d, w, ms, us. + For details see + systemd.time(7).

Empty lines and lines starting with # or ; are + ignored. This may be used for commenting. Lines ending + in a backslash are concatenated with the following + line while reading and the backslash is replaced by a + space character. This may be used to wrap long lines.

Along with a unit file foo.service, the + directory foo.service.wants/ may exist. All + unit files symlinked from such a directory are implicitly added as + dependencies of type Wants= to the unit. This + is useful to hook units into the start-up of other units, without + having to modify their unit files. For details about the semantics + of Wants=, see below. The preferred way to + create symlinks in the .wants/ directory of a + unit file is with the enable command of the + systemctl(1) + tool which reads information from the [Install] section of unit + files (see below). A similar functionality exists for + Requires= type dependencies as well, the + directory suffix is .requires/ in this + case.

Along with a unit file foo.service, a + directory foo.service.d/ may exist. All files + with the suffix ".conf" from this directory will + be parsed after the file itself is parsed. This is useful to alter + or add configuration settings to a unit, without having to modify + their unit files. Make sure that the file that is included has the + appropriate section headers before any directive. Note that for + instanced units this logic will first look for the instance + ".d/" subdirectory and read its + ".conf" files, followed by the template + ".d/" subdirectory and reads its + ".conf" files.

Note that while systemd offers a flexible dependency system + between units it is recommended to use this functionality only + sparingly and instead rely on techniques such as bus-based or + socket-based activation which make dependencies implicit, + resulting in a both simpler and more flexible system.

Some unit names reflect paths existing in the file system + namespace. Example: a device unit + dev-sda.device refers to a device with the + device node /dev/sda in the + file system namespace. If this applies, a special way to escape + the path name is used, so that the result is usable as part of a + filename. Basically, given a path, "/" is replaced by "-" and all + other characters which are not ASCII alphanumerics are replaced by + C-style "\x2d" escapes (except that "_" is never replaced and "." + is only replaced when it would be the first character in the + escaped path). The root directory "/" is encoded as single dash, + while otherwise the initial and ending "/" are removed from all + paths during transformation. This escaping is reversible. Properly + escaped paths can be generated using the + systemd-escape(1) + command.

Optionally, units may be instantiated from a + template file at runtime. This allows creation of + multiple units from a single configuration file. If + systemd looks for a unit configuration file, it will + first search for the literal unit name in the + file system. If that yields no success and the unit + name contains an "@" character, systemd will look for a + unit template that shares the same name but with the + instance string (i.e. the part between the "@" character + and the suffix) removed. Example: if a service + getty@tty3.service is requested + and no file by that name is found, systemd will look + for getty@.service and + instantiate a service from that configuration file if + it is found.

To refer to the instance string from within the + configuration file you may use the special "%i" + specifier in many of the configuration options. See below for + details.

If a unit file is empty (i.e. has the file size 0) or is + symlinked to /dev/null, its configuration + will not be loaded and it appears with a load state of + "masked", and cannot be activated. Use this as an + effective way to fully disable a unit, making it impossible to + start it even manually.

The unit file format is covered by the + Interface + Stability Promise.

Unit Load Path¶

Unit files are loaded from a set of paths determined during + compilation, described in the two tables below. Unit files found + in directories listed earlier override files with the same name in + directories lower in the list.

When systemd is running in user mode + (--user) and the variable + $SYSTEMD_UNIT_PATH is set, the contents of this + variable overrides the unit load path. If + $SYSTEMD_UNIT_PATH ends with an empty component + (":"), the usual unit load path will be appended + to the contents of the variable.

Table 1.  + Load path when running in system mode (--system). +

PathDescription
/etc/systemd/systemLocal configuration
/run/systemd/systemRuntime units
/usr/lib/systemd/systemUnits of installed packages

Table 2.  + Load path when running in user mode (--user). +

PathDescription
$XDG_CONFIG_HOME/systemd/userUser configuration (only used when $XDG_CONFIG_HOME is set)
$HOME/.config/systemd/userUser configuration (only used when $XDG_CONFIG_HOME is not set)
/etc/systemd/userLocal configuration
$XDG_RUNTIME_DIR/systemd/userRuntime units (only used when $XDG_RUNTIME_DIR is set)
/run/systemd/userRuntime units
$XDG_DATA_HOME/systemd/userUnits of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)
$HOME/.local/share/systemd/userUnits of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set)
/usr/lib/systemd/userUnits of packages that have been installed system-wide

Additional units might be loaded into systemd ("linked") + from directories not on the unit load path. See the + link command for + systemctl(1). + Also, some units are dynamically created via generators Generators. +

[Unit] Section Options¶

Unit file may include a [Unit] section, which carries + generic information about the unit that is not dependent on the + type of unit:

Description=¶

A free-form string describing the unit. This + is intended for use in UIs to show descriptive information + along with the unit name. The description should contain a + name that means something to the end user. "Apache2 + Web Server" is a good example. Bad examples are + "high-performance light-weight HTTP server" + (too generic) or "Apache2" (too specific and + meaningless for people who do not know + Apache).

Documentation=¶

A space-separated list of URIs referencing + documentation for this unit or its configuration. Accepted are + only URIs of the types "http://", + "https://", "file:", + "info:", "man:". For more + information about the syntax of these URIs, see uri(7). + The URIs should be listed in order of relevance, starting with + the most relevant. It is a good idea to first reference + documentation that explains what the unit's purpose is, + followed by how it is configured, followed by any other + related documentation. This option may be specified more than + once, in which case the specified list of URIs is merged. If + the empty string is assigned to this option, the list is reset + and all prior assignments will have no + effect.

Requires=¶

Configures requirement dependencies on other + units. If this unit gets activated, the units listed here will + be activated as well. If one of the other units gets + deactivated or its activation fails, this unit will be + deactivated. This option may be specified more than once or + multiple space-separated units may be specified in one option + in which case requirement dependencies for all listed names + will be created. Note that requirement dependencies do not + influence the order in which services are started or stopped. + This has to be configured independently with the + After= or Before= + options. If a unit foo.service requires a + unit bar.service as configured with + Requires= and no ordering is configured + with After= or Before=, + then both units will be started simultaneously and without any + delay between them if foo.service is + activated. Often it is a better choice to use + Wants= instead of + Requires= in order to achieve a system that + is more robust when dealing with failing services.

Note that dependencies of this type may also be + configured outside of the unit configuration file by adding a + symlink to a .requires/ directory + accompanying the unit file. For details see + above.

RequiresOverridable=¶

Similar to Requires=. + Dependencies listed in RequiresOverridable= + which cannot be fulfilled or fail to start are ignored if the + startup was explicitly requested by the user. If the start-up + was pulled in indirectly by some dependency or automatic + start-up of units that is not requested by the user, this + dependency must be fulfilled and otherwise the transaction + fails. Hence, this option may be used to configure + dependencies that are normally honored unless the user + explicitly starts up the unit, in which case whether they + failed or not is irrelevant.

Requisite=, RequisiteOverridable=¶

Similar to Requires= and + RequiresOverridable=, respectively. + However, if the units listed here are not started already, + they will not be started and the transaction will fail + immediately.

Wants=¶

A weaker version of + Requires=. Units listed in this option will + be started if the configuring unit is. However, if the listed + units fail to start or cannot be added to the transaction, + this has no impact on the validity of the transaction as a + whole. This is the recommended way to hook start-up of one + unit to the start-up of another unit.

Note that dependencies of this type may also be + configured outside of the unit configuration file by adding + symlinks to a .wants/ directory + accompanying the unit file. For details, see + above.

BindsTo=¶

Configures requirement dependencies, very + similar in style to Requires=, however in + addition to this behavior, it also declares that this unit is + stopped when any of the units listed suddenly disappears. + Units can suddenly, unexpectedly disappear if a service + terminates on its own choice, a device is unplugged or a mount + point unmounted without involvement of + systemd.

PartOf=¶

Configures dependencies similar to + Requires=, but limited to stopping and + restarting of units. When systemd stops or restarts the units + listed here, the action is propagated to this unit. Note that + this is a one-way dependency — changes to this unit do not + affect the listed units.

Conflicts=¶

A space-separated list of unit names. + Configures negative requirement dependencies. If a unit has a + Conflicts= setting on another unit, + starting the former will stop the latter and vice versa. Note + that this setting is independent of and orthogonal to the + After= and Before= + ordering dependencies.

If a unit A that conflicts with a unit B is scheduled to + be started at the same time as B, the transaction will either + fail (in case both are required part of the transaction) or be + modified to be fixed (in case one or both jobs are not a + required part of the transaction). In the latter case, the job + that is not the required will be removed, or in case both are + not required, the unit that conflicts will be started and the + unit that is conflicted is stopped.

Before=, After=¶

A space-separated list of unit names. + Configures ordering dependencies between units. If a unit + foo.service contains a setting + Before=bar.service and both units are being + started, bar.service's start-up is + delayed until foo.service is started up. + Note that this setting is independent of and orthogonal to the + requirement dependencies as configured by + Requires=. It is a common pattern to + include a unit name in both the After= and + Requires= option, in which case the unit + listed will be started before the unit that is configured with + these options. This option may be specified more than once, in + which case ordering dependencies for all listed names are + created. After= is the inverse of + Before=, i.e. while + After= ensures that the configured unit is + started after the listed unit finished starting up, + Before= ensures the opposite, i.e. that the + configured unit is fully started up before the listed unit is + started. Note that when two units with an ordering dependency + between them are shut down, the inverse of the start-up order + is applied. i.e. if a unit is configured with + After= on another unit, the former is + stopped before the latter if both are shut down. If one unit + with an ordering dependency on another unit is shut down while + the latter is started up, the shut down is ordered before the + start-up regardless of whether the ordering dependency is + actually of type After= or + Before=. If two units have no ordering + dependencies between them, they are shut down or started up + simultaneously, and no ordering takes place. +

OnFailure=¶

A space-separated list of one or more units + that are activated when this unit enters the + "failed" state.

PropagatesReloadTo=, ReloadPropagatedFrom=¶

A space-separated list of one or more units + where reload requests on this unit will be propagated to, or + reload requests on the other unit will be propagated to this + unit, respectively. Issuing a reload request on a unit will + automatically also enqueue a reload request on all units that + the reload request shall be propagated to via these two + settings.

JoinsNamespaceOf=¶

For units that start processes (such as + service units), lists one or more other units whose network + and/or temporary file namespace to join. This only applies to + unit types which support the + PrivateNetwork= and + PrivateTmp= directives (see + systemd.exec(5) + for details). If a unit that has this setting set is started, + its processes will see the same /tmp, + /tmp/var and network namespace as one + listed unit that is started. If multiple listed units are + already started, it is not defined which namespace is joined. + Note that this setting only has an effect if + PrivateNetwork= and/or + PrivateTmp= is enabled for both the unit + that joins the namespace and the unit whose namespace is + joined.

RequiresMountsFor=¶

Takes a space-separated list of absolute + paths. Automatically adds dependencies of type + Requires= and After= for + all mount units required to access the specified path.

Mount points marked with noauto are not + mounted automatically and will be ignored for the purposes of + this option. If such a mount should be a requirement for this + unit, direct dependencies on the mount units may be added + (Requires= and After= or + some other combination).

OnFailureJobMode=¶

Takes a value of + "fail", + "replace", + "replace-irreversibly", + "isolate", + "flush", + "ignore-dependencies" or + "ignore-requirements". Defaults to + "replace". Specifies how the units listed in + OnFailure= will be enqueued. See + systemctl(1)'s + --job-mode= option for details on the + possible values. If this is set to "isolate", + only a single unit may be listed in + OnFailure=..

IgnoreOnIsolate=¶

Takes a boolean argument. If + true, this unit will not be stopped when + isolating another unit. Defaults to + false.

IgnoreOnSnapshot=¶

Takes a boolean argument. If + true, this unit will not be included in + snapshots. Defaults to true for device and + snapshot units, false for the + others.

StopWhenUnneeded=¶

Takes a boolean argument. If + true, this unit will be stopped when it is no + longer used. Note that in order to minimize the work to be + executed, systemd will not stop units by default unless they + are conflicting with other units, or the user explicitly + requested their shut down. If this option is set, a unit will + be automatically cleaned up if no other active unit requires + it. Defaults to false.

RefuseManualStart=, RefuseManualStop=¶

Takes a boolean argument. If + true, this unit can only be activated or + deactivated indirectly. In this case, explicit start-up or + termination requested by the user is denied, however if it is + started or stopped as a dependency of another unit, start-up + or termination will succeed. This is mostly a safety feature + to ensure that the user does not accidentally activate units + that are not intended to be activated explicitly, and not + accidentally deactivate units that are not intended to be + deactivated. These options default to + false.

AllowIsolate=¶

Takes a boolean argument. If + true, this unit may be used with the + systemctl isolate command. Otherwise, this + will be refused. It probably is a good idea to leave this + disabled except for target units that shall be used similar to + runlevels in SysV init systems, just as a precaution to avoid + unusable system states. This option defaults to + false.

DefaultDependencies=¶

Takes a boolean argument. If + true, (the default), a few default + dependencies will implicitly be created for the unit. The + actual dependencies created depend on the unit type. For + example, for service units, these dependencies ensure that the + service is started only after basic system initialization is + completed and is properly terminated on system shutdown. See + the respective man pages for details. Generally, only services + involved with early boot or late shutdown should set this + option to false. It is highly recommended to + leave this option enabled for the majority of common units. If + set to false, this option does not disable + all implicit dependencies, just non-essential + ones.

JobTimeoutSec=, JobTimeoutAction=, JobTimeoutRebootArgument=¶

When a job for this unit is queued a time-out + may be configured. If this time limit is reached, the job will + be cancelled, the unit however will not change state or even + enter the "failed" mode. This value defaults + to 0 (job timeouts disabled), except for device units. NB: + this timeout is independent from any unit-specific timeout + (for example, the timeout set with + StartTimeoutSec= in service units) as the + job timeout has no effect on the unit itself, only on the job + that might be pending for it. Or in other words: unit-specific + timeouts are useful to abort unit state changes, and revert + them. The job timeout set with this option however is useful + to abort only the job waiting for the unit state to + change.

JobTimeoutAction= + optionally configures an additional + action to take when the time-out is + hit. It takes the same values as the + per-service + StartLimitAction= + setting, see + systemd.service(5) + for details. Defaults to + none. JobTimeoutRebootArgument= + configures an optional reboot string + to pass to the + reboot(2) + system call.

ConditionArchitecture=, ConditionVirtualization=, ConditionHost=, ConditionKernelCommandLine=, ConditionSecurity=, ConditionCapability=, ConditionACPower=, ConditionNeedsUpdate=, ConditionFirstBoot=, ConditionPathExists=, ConditionPathExistsGlob=, ConditionPathIsDirectory=, ConditionPathIsSymbolicLink=, ConditionPathIsMountPoint=, ConditionPathIsReadWrite=, ConditionDirectoryNotEmpty=, ConditionFileNotEmpty=, ConditionFileIsExecutable=¶

Before starting a unit verify that the + specified condition is true. If it is not true, the starting + of the unit will be skipped, however all ordering dependencies + of it are still respected. A failing condition will not result + in the unit being moved into a failure state. The condition is + checked at the time the queued start job is to be + executed.

ConditionArchitecture= may be used to + check whether the system is running on a specific + architecture. Takes one of + x86, + x86-64, + ppc, + ppc-le, + ppc64, + ppc64-le, + ia64, + parisc, + parisc64, + s390, + s390x, + sparc, + sparc64, + mips, + mips-le, + mips64, + mips64-le, + alpha, + arm, + arm-be, + arm64, + arm64-be, + sh, + sh64, + m86k, + tilegx, + cris to test + against a specific architecture. The architecture is + determined from the information returned by + uname(2) + and is thus subject to + personality(2). + Note that a Personality= setting in the + same unit file has no effect on this condition. A special + architecture name native is mapped to the + architecture the system manager itself is compiled for. The + test may be negated by prepending an exclamation mark.

ConditionVirtualization= may be used + to check whether the system is executed in a virtualized + environment and optionally test whether it is a specific + implementation. Takes either boolean value to check if being + executed in any virtualized environment, or one of + vm and + container to test against a generic type of + virtualization solution, or one of + qemu, + kvm, + zvm, + vmware, + microsoft, + oracle, + xen, + bochs, + uml, + openvz, + lxc, + lxc-libvirt, + systemd-nspawn, + docker to test + against a specific implementation. See + systemd-detect-virt(1) + for a full list of known virtualization technologies and their + identifiers. If multiple virtualization technologies are + nested, only the innermost is considered. The test may be + negated by prepending an exclamation mark.

ConditionHost= may be used to match + against the hostname or machine ID of the host. This either + takes a hostname string (optionally with shell style globs) + which is tested against the locally set hostname as returned + by + gethostname(2), + or a machine ID formatted as string (see + machine-id(5)). + The test may be negated by prepending an exclamation + mark.

ConditionKernelCommandLine= may be + used to check whether a specific kernel command line option is + set (or if prefixed with the exclamation mark unset). The + argument must either be a single word, or an assignment (i.e. + two words, separated "="). In the former case + the kernel command line is searched for the word appearing as + is, or as left hand side of an assignment. In the latter case, + the exact assignment is looked for with right and left hand + side matching.

ConditionSecurity= may be used to + check whether the given security module is enabled on the + system. Currently the recognized values values are + selinux, + apparmor, + ima, + smack and + audit. The test may be negated by + prepending an exclamation mark.

ConditionCapability= may be used to + check whether the given capability exists in the capability + bounding set of the service manager (i.e. this does not check + whether capability is actually available in the permitted or + effective sets, see + capabilities(7) + for details). Pass a capability name such as + "CAP_MKNOD", possibly prefixed with an + exclamation mark to negate the check.

ConditionACPower= may be used to + check whether the system has AC power, or is exclusively + battery powered at the time of activation of the unit. This + takes a boolean argument. If set to true, + the condition will hold only if at least one AC connector of + the system is connected to a power source, or if no AC + connectors are known. Conversely, if set to + false, the condition will hold only if + there is at least one AC connector known and all AC connectors + are disconnected from a power source.

ConditionNeedsUpdate= takes one of + /var or /etc as + argument, possibly prefixed with a "!" (for + inverting the condition). This condition may be used to + conditionalize units on whether the specified directory + requires an update because /usr's + modification time is newer than the stamp file + .updated in the specified directory. This + is useful to implement offline updates of the vendor operating + system resources in /usr that require + updating of /etc or + /var on the next following boot. Units + making use of this condition should order themselves before + systemd-update-done.service(8), + to make sure they run before the stamp files's modification + time gets reset indicating a completed update.

ConditionFirstBoot= takes a boolean + argument. This condition may be used to conditionalize units + on whether the system is booting up with an unpopulated + /etc directory. This may be used to + populate /etc on the first boot after + factory reset, or when a new system instances boots up for the + first time.

With ConditionPathExists= a file + existence condition is checked before a unit is started. If + the specified absolute path name does not exist, the condition + will fail. If the absolute path name passed to + ConditionPathExists= is prefixed with an + exclamation mark ("!"), the test is negated, + and the unit is only started if the path does not + exist.

ConditionPathExistsGlob= is similar + to ConditionPathExists=, but checks for the + existence of at least one file or directory matching the + specified globbing pattern.

ConditionPathIsDirectory= is similar + to ConditionPathExists= but verifies + whether a certain path exists and is a directory.

ConditionPathIsSymbolicLink= is + similar to ConditionPathExists= but + verifies whether a certain path exists and is a symbolic + link.

ConditionPathIsMountPoint= is similar + to ConditionPathExists= but verifies + whether a certain path exists and is a mount point.

ConditionPathIsReadWrite= is similar + to ConditionPathExists= but verifies + whether the underlying file system is readable and writable + (i.e. not mounted read-only).

ConditionDirectoryNotEmpty= is + similar to ConditionPathExists= but + verifies whether a certain path exists and is a non-empty + directory.

ConditionFileNotEmpty= is similar to + ConditionPathExists= but verifies whether a + certain path exists and refers to a regular file with a + non-zero size.

ConditionFileIsExecutable= is similar + to ConditionPathExists= but verifies + whether a certain path exists, is a regular file and marked + executable.

If multiple conditions are specified, the unit will be + executed if all of them apply (i.e. a logical AND is applied). + Condition checks can be prefixed with a pipe symbol (|) in + which case a condition becomes a triggering condition. If at + least one triggering condition is defined for a unit, then the + unit will be executed if at least one of the triggering + conditions apply and all of the non-triggering conditions. If + you prefix an argument with the pipe symbol and an exclamation + mark, the pipe symbol must be passed first, the exclamation + second. Except for + ConditionPathIsSymbolicLink=, all path + checks follow symlinks. If any of these options is assigned + the empty string, the list of conditions is reset completely, + all previous condition settings (of any kind) will have no + effect.

AssertArchitecture=, AssertVirtualization=, AssertHost=, AssertKernelCommandLine=, AssertSecurity=, AssertCapability=, AssertACPower=, AssertNeedsUpdate=, AssertFirstBoot=, AssertPathExists=, AssertPathExistsGlob=, AssertPathIsDirectory=, AssertPathIsSymbolicLink=, AssertPathIsMountPoint=, AssertPathIsReadWrite=, AssertDirectoryNotEmpty=, AssertFileNotEmpty=, AssertFileIsExecutable=¶

Similar to the + ConditionArchitecture=, + ConditionVirtualization=, ... condition + settings described above these settings add assertion checks + to the start-up of the unit. However, unlike the conditions + settings any assertion setting that is not met results in + failure of the start job it was triggered + by.

SourcePath=¶

A path to a configuration file this unit has + been generated from. This is primarily useful for + implementation of generator tools that convert configuration + from an external configuration file format into native unit + files. This functionality should not be used in normal + units.

[Install] Section Options¶

Unit file may include an "[Install]" + section, which carries installation information for the unit. This + section is not interpreted by + systemd(1) + during runtime. It is used exclusively by the + enable and disable commands + of the + systemctl(1) + tool during installation of a unit:

Alias=¶

A space-separated list of additional names + this unit shall be installed under. The names listed here must + have the same suffix (i.e. type) as the unit file name. This + option may be specified more than once, in which case all + listed names are used. At installation time, + systemctl enable will create symlinks from + these names to the unit filename.

WantedBy=, RequiredBy=¶

This option may be used more than once, or a + space-separated list of unit names may be given. A symbolic + link is created in the .wants/ or + .requires/ directory of each of the + listed units when this unit is installed by systemctl + enable. This has the effect that a dependency of + type Wants= or Requires= + is added from the listed unit to the current unit. The primary + result is that the current unit will be started when the + listed unit is started. See the description of + Wants= and Requires= in + the [Unit] section for details.

WantedBy=foo.service in a service + bar.service is mostly equivalent to + Alias=foo.service.wants/bar.service in the + same file. In case of template units, systemctl + enable must be called with an instance name, and + this instance will be added to the + .wants/ or + .requires/ list of the listed unit. E.g. + WantedBy=getty.target in a service + getty@.service will result in + systemctl enable getty@tty2.service + creating a + getty.target.wants/getty@tty2.service + link to getty@.service. +

Also=¶

Additional units to install/deinstall when + this unit is installed/deinstalled. If the user requests + installation/deinstallation of a unit with this option + configured, systemctl enable and + systemctl disable will automatically + install/uninstall units listed in this option as well.

This option may be used more than once, or a + space-separated list of unit names may be + given.

DefaultInstance=¶

In template unit files, this specifies for + which instance the unit shall be enabled if the template is + enabled without any explicitly set instance. This option has + no effect in non-template unit files. The specified string + must be usable as instance identifier.

The following specifiers are interpreted in the Install + section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v. For their meaning + see the next section. +

Specifiers¶

Many settings resolve specifiers which may be used to write + generic unit files referring to runtime or unit parameters that + are replaced when the unit files are loaded. The following + specifiers are understood:

Table 3. Specifiers available in unit files

SpecifierMeaningDetails
"%n"Full unit name 
"%N"Unescaped full unit nameSame as "%n", but with escaping undone
"%p"Prefix nameFor instantiated units, this refers to the string before the "@" character of the unit name. For non-instantiated units, this refers to the name of the unit with the type suffix removed.
"%P"Unescaped prefix nameSame as "%p", but with escaping undone
"%i"Instance nameFor instantiated units: this is the string between the "@" character and the suffix of the unit name.
"%I"Unescaped instance nameSame as "%i", but with escaping undone
"%f"Unescaped filenameThis is either the unescaped instance name (if applicable) with / prepended (if applicable), or the prefix name prepended with /.
"%c"Control group path of the unitThis path does not include the /sys/fs/cgroup/systemd/ prefix.
"%r"Control group path of the slice the unit is placed inThis usually maps to the parent cgroup path of "%c".
"%R"Root control group path below which slices and units are placedFor system instances, this resolves to /, except in containers, where this maps to the container's root control group path.
"%t"Runtime directoryThis is either /run (for the system manager) or the path "$XDG_RUNTIME_DIR" resolves to (for user managers).
"%u"User nameThis is the name of the configured user of the unit, or (if none is set) the user running the systemd instance.
"%U"User UIDThis is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user.
"%h"User home directoryThis is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.
"%s"User shellThis is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.
"%m"Machine IDThe machine ID of the running system, formatted as string. See machine-id(5) for more information.
"%b"Boot IDThe boot ID of the running system, formatted as string. See random(4) for more information.
"%H"Host nameThe hostname of the running system at the point in time the unit configuation is loaded.
"%v"Kernel releaseIdentical to uname -r output
"%%"Single percent signUse "%%" in place of "%" to specify a single percent sign.

Please note that specifiers "%U", + "%h", "%s" are mostly useless + when systemd is running in system mode. PID 1 cannot query the + user account database for information, so the specifiers only work + as shortcuts for things which are already specified in a different + way in the unit file. They are fully functional when systemd is + running in --user mode.

Examples¶

Example 1. Allowing units to be enabled

The following snippet (highlighted) allows a unit (e.g. + foo.service) to be enabled via + systemctl enable:

[Unit]
+Description=Foo
+
+[Service]
+ExecStart=/usr/sbin/foo-daemon
+
+[Install]
+WantedBy=multi-user.target

After running systemctl enable, a + symlink + /etc/systemd/system/multi-user.target.wants/foo.service + linking to the actual unit will be created. It tells systemd to + pull in the unit when starting + multi-user.target. The inverse + systemctl disable will remove that symlink + again.


Example 2. Overriding vendor settings

There are two methods of overriding vendor settings in + unit files: copying the unit file from + /usr/lib/systemd/system to + /etc/systemd/system and modifying the + chosen settings. Alternatively, one can create a directory named + unit.d/ within + /etc/systemd/system and place a drop-in + file name.conf + there that only changes the specific settings one is interested + in. Note that multiple such drop-in files are read if + present.

The advantage of the first method is that one easily + overrides the complete unit, the vendor unit is not parsed at + all anymore. It has the disadvantage that improvements to the + unit file by the vendor are not automatically incorporated on + updates.

The advantage of the second method is that one only + overrides the settings one specifically wants, where updates to + the unit by the vendor automatically apply. This has the + disadvantage that some future updates by the vendor might be + incompatible with the local changes.

Note that for drop-in files, if one wants to remove + entries from a setting that is parsed as a list (and is not a + dependency), such as ConditionPathExists= (or + e.g. ExecStart= in service units), one needs + to first clear the list before re-adding all entries except the + one that is to be removed. See below for an example.

This also applies for user instances of systemd, but with + different locations for the unit files. See the section on unit + load paths for further details.

Suppose there is a vendor-supplied unit + /usr/lib/systemd/system/httpd.service with + the following contents:

[Unit]
+Description=Some HTTP server
+After=remote-fs.target sqldb.service
+Requires=sqldb.service
+AssertPathExists=/srv/webserver
+
+[Service]
+Type=notify
+ExecStart=/usr/sbin/some-fancy-httpd-server
+Nice=5
+
+[Install]
+WantedBy=multi-user.target

Now one wants to change some settings as an administrator: + firstly, in the local setup, /srv/webserver + might not exist, because the HTTP server is configured to use + /srv/www instead. Secondly, the local + configuration makes the HTTP server also depend on a memory + cache service, memcached.service, that + should be pulled in (Requires=) and also be + ordered appropriately (After=). Thirdly, in + order to harden the service a bit more, the administrator would + like to set the PrivateTmp= setting (see + systemd.service(5) + for details). And lastly, the administrator would like to reset + the niceness of the service to its default value of 0.

The first possibility is to copy the unit file to + /etc/systemd/system/httpd.service and + change the chosen settings:

[Unit]
+Description=Some HTTP server
+After=remote-fs.target sqldb.service memcached.service
+Requires=sqldb.service memcached.service
+AssertPathExists=/srv/www
+
+[Service]
+Type=notify
+ExecStart=/usr/sbin/some-fancy-httpd-server
+Nice=0
+PrivateTmp=yes
+
+[Install]
+WantedBy=multi-user.target

Alternatively, the administrator could create a drop-in + file + /etc/systemd/system/httpd.service.d/local.conf + with the following contents:

[Unit]
+After=memcached.service
+Requires=memcached.service
+# Reset all assertions and then re-add the condition we want
+AssertPathExists=
+AssertPathExists=/srv/www
+
+[Service]
+Nice=0
+PrivateTmp=yes

Note that dependencies (After=, etc.) + cannot be reset to an empty list, so dependencies can only be + added in drop-ins. If you want to remove dependencies, you have + to override the entire unit.


diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 2e298ca04..09e11b471 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1,6 +1,6 @@ %entities; ]> @@ -26,51 +26,51 @@ - - systemd.unit - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd.unit - 5 - - - - systemd.unit - Unit configuration - - - - service.service, - socket.socket, - device.device, - mount.mount, - automount.automount, - swap.swap, - target.target, - path.path, - timer.timer, - snapshot.snapshot, - slice.slice, - scope.scope - - /etc/systemd/system/* + + systemd.unit + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd.unit + 5 + + + + systemd.unit + Unit configuration + + + + service.service, + socket.socket, + device.device, + mount.mount, + automount.automount, + swap.swap, + target.target, + path.path, + timer.timer, + snapshot.snapshot, + slice.slice, + scope.scope + + /etc/systemd/system/* /run/systemd/system/* /usr/lib/systemd/system/* ... - + - $XDG_CONFIG_HOME/systemd/user/* + $XDG_CONFIG_HOME/systemd/user/* $HOME/.config/systemd/user/* /etc/systemd/user/* $XDG_RUNTIME_DIR/systemd/user/* @@ -79,1509 +79,1367 @@ $HOME/.local/share/systemd/user/* /usr/lib/systemd/user/* ... - - - - - Description - - A unit configuration file encodes information - about a service, a socket, a device, a mount point, an - automount point, a swap file or partition, a start-up - target, a watched file system path, a timer controlled - and supervised by - systemd1, - a temporary system state snapshot, a resource - management slice or a group of externally created - processes. The syntax is inspired by XDG - Desktop Entry Specification - .desktop files, which are in turn - inspired by Microsoft Windows - .ini files. - - This man page lists the common configuration - options of all the unit types. These options need to - be configured in the [Unit] or [Install] - sections of the unit files. - - In addition to the generic [Unit] and [Install] - sections described here, each unit may have a - type-specific section, e.g. [Service] for a service - unit. See the respective man pages for more - information: - systemd.service5, - systemd.socket5, - systemd.device5, - systemd.mount5, - systemd.automount5, - systemd.swap5, - systemd.target5, - systemd.path5, - systemd.timer5, - systemd.snapshot5. - systemd.slice5. - systemd.scope5. - - - Various settings are allowed to be specified - more than once, in which case the interpretation - depends on the setting. Often, multiple settings form - a list, and setting to an empty value "resets", which - means that previous assignments are ignored. When this - is allowed, it is mentioned in the description of the - setting. Note that using multiple assignments to the - same value makes the unit file incompatible with - parsers for the XDG .desktop file - format. - - Unit files are loaded from a set of paths - determined during compilation, described in the next section. - - - Unit files may contain additional options on top - of those listed here. If systemd encounters an unknown - option, it will write a warning log message but - continue loading the unit. If an option or section name - is prefixed with , it is ignored - completely by systemd. Options within an ignored - section do not need the prefix. Applications may use - this to include additional information in the unit - files. - - Boolean arguments used in unit files can be - written in various formats. For positive settings the - strings , , - and are - equivalent. For negative settings, the strings - , , - and are - equivalent. - - Time span values encoded in unit files can be - written in various formats. A stand-alone number - specifies a time in seconds. If suffixed with a time - unit, the unit is honored. A concatenation of multiple - values with units is supported, in which case the - values are added up. Example: "50" refers to 50 - seconds; "2min 200ms" refers to 2 minutes plus 200 - milliseconds, i.e. 120200ms. The following time units - are understood: s, min, h, d, w, ms, us. For details - see - systemd.time7. - - Empty lines and lines starting with # or ; are - ignored. This may be used for commenting. Lines ending - in a backslash are concatenated with the following - line while reading and the backslash is replaced by a - space character. This may be used to wrap long lines. - - Along with a unit file - foo.service, the directory - foo.service.wants/ may exist. All - unit files symlinked from such a directory are - implicitly added as dependencies of type - Wants= to the unit. This is useful - to hook units into the start-up of other units, - without having to modify their unit files. For details - about the semantics of Wants=, see - below. The preferred way to create symlinks in the - .wants/ directory of a unit file - is with the enable command of the - systemctl1 - tool which reads information from the [Install] - section of unit files (see below). A similar - functionality exists for Requires= - type dependencies as well, the directory suffix is - .requires/ in this case. - - Along with a unit file - foo.service, a directory - foo.service.d/ may exist. All - files with the suffix .conf from - this directory will be parsed after the file itself is - parsed. This is useful to alter or add configuration - settings to a unit, without having to modify their - unit files. Make sure that the file that is included - has the appropriate section headers before any - directive. Note that for instanced units this logic - will first look for the instance - .d/ subdirectory and read its - .conf files, followed by the - template .d/ subdirectory and reads - its .conf files. - - - - Note that while systemd offers a flexible - dependency system between units it is recommended to - use this functionality only sparingly and instead rely - on techniques such as bus-based or socket-based - activation which make dependencies implicit, resulting - in a both simpler and more flexible system. - - Some unit names reflect paths existing in the - file system namespace. Example: a device unit - dev-sda.device refers to a device - with the device node /dev/sda in - the file system namespace. If this applies, a special - way to escape the path name is used, so that the - result is usable as part of a filename. Basically, - given a path, "/" is replaced by "-", and all - unprintable characters and the "-" are replaced by - C-style "\x2d" escapes. The root directory "/" is - encoded as single dash, while otherwise the initial - and ending "/" is removed from all paths during - transformation. This escaping is reversible. - - Optionally, units may be instantiated from a - template file at runtime. This allows creation of - multiple units from a single configuration file. If - systemd looks for a unit configuration file, it will - first search for the literal unit name in the - file system. If that yields no success and the unit - name contains an @ character, systemd will look for a - unit template that shares the same name but with the - instance string (i.e. the part between the @ character - and the suffix) removed. Example: if a service - getty@tty3.service is requested - and no file by that name is found, systemd will look - for getty@.service and - instantiate a service from that configuration file if - it is found. - - To refer to the instance string from - within the configuration file you may use the special - %i specifier in many of the - configuration options. See below for details. - - If a unit file is empty (i.e. has the file size - 0) or is symlinked to /dev/null, - its configuration will not be loaded and it appears - with a load state of masked, and - cannot be activated. Use this as an effective way to - fully disable a unit, making it impossible to start it - even manually. - - The unit file format is covered by the - Interface - Stability Promise. - - - - - Unit Load Path - - Unit files are loaded from a set of paths - determined during compilation, described in the two - tables below. Unit files found in directories listed - earlier override files with the same name in - directories lower in the list. - - When systemd is running in user mode - () and the variable - $SYSTEMD_UNIT_PATH is set, this - contents of this variable overrides the unit load - path. If $SYSTEMD_UNIT_PATH ends - with an empty component (:), the - usual unit load path will be appended to the contents - of the variable. - - - - Load path when running in system mode (<option>--system</option>). - - - - - - - - Path - Description - - - - - /etc/systemd/system - Local configuration - - - /run/systemd/system - Runtime units - - - /usr/lib/systemd/system - Units of installed packages - - - -
- - - - Load path when running in user mode (<option>--user</option>). - - - - - - - - Path - Description - - - - - $XDG_CONFIG_HOME/systemd/user - User configuration (only used when $XDG_CONFIG_HOME is set) - - - $HOME/.config/systemd/user - User configuration (only used when $XDG_CONFIG_HOME is not set) - - - /etc/systemd/user - Local configuration - - - $XDG_RUNTIME_DIR/systemd/user - Runtime units (only used when $XDG_RUNTIME_DIR is set) - - - /run/systemd/user - Runtime units - - - $XDG_DATA_HOME/systemd/user - Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set) - - - $HOME/.local/share/systemd/user - Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set) - - - /usr/lib/systemd/user - Units of packages that have been installed system-wide - - - -
- - Additional units might be loaded into systemd - ("linked") from directories not on the unit load - path. See the link command for - systemctl1. Also, - some units are dynamically created via generators - Generators. - -
- - - [Unit] Section Options - - Unit file may include a [Unit] section, which - carries generic information about the unit that is not - dependent on the type of unit: - - - - - Description= - A free-form string - describing the unit. This is intended - for use in UIs to show descriptive - information along with the unit - name. The description should contain a name - that means something to the end user. - Apache2 Web Server is a good - example. Bad examples are - high-performance light-weight HTTP - server (too generic) or - Apache2 (too specific and - meaningless for people who do not know - Apache). - - - - Documentation= - A space-separated list - of URIs referencing documentation for - this unit or its - configuration. Accepted are only URIs - of the types - http://, - https://, - file:, - info:, - man:. For more - information about the syntax of these - URIs, see - uri7. The - URIs should be listed in order of - relevance, starting with the most - relevant. It is a good idea to first - reference documentation that explains - what the unit's purpose is, followed - by how it is configured, followed by - any other related documentation. This - option may be specified more than once, - in which case the specified list of - URIs is merged. If the empty string is - assigned to this option, the list is - reset and all prior assignments will - have no effect. - - - - Requires= - - Configures requirement - dependencies on other units. If this - unit gets activated, the units listed - here will be activated as well. If one - of the other units gets deactivated or - its activation fails, this unit will - be deactivated. This option may be - specified more than once or multiple - space-separated units may be specified - in one option in which case - requirement dependencies for all - listed names will be created. Note - that requirement dependencies do not - influence the order in which services - are started or stopped. This has to be - configured independently with the - After= or - Before= options. If - a unit - foo.service - requires a unit - bar.service as - configured with - Requires= and no - ordering is configured with - After= or - Before=, then both - units will be started simultaneously - and without any delay between them if - foo.service is - activated. Often it is a better choice - to use Wants= - instead of - Requires= in order - to achieve a system that is more - robust when dealing with failing - services. - - Note that dependencies of this - type may also be configured outside of - the unit configuration file by - adding a symlink to a - .requires/ directory - accompanying the unit file. For - details see above. - - - - RequiresOverridable= - - Similar to - Requires=. - Dependencies listed in - RequiresOverridable= - which cannot be fulfilled or fail to - start are ignored if the startup was - explicitly requested by the user. If - the start-up was pulled in indirectly - by some dependency or automatic - start-up of units that is not - requested by the user, this dependency - must be fulfilled and otherwise the - transaction fails. Hence, this option - may be used to configure dependencies - that are normally honored unless the - user explicitly starts up the unit, in - which case whether they failed or not - is irrelevant. - - - - Requisite= - RequisiteOverridable= - - Similar to - Requires= and - RequiresOverridable=, - respectively. However, if the units - listed here are not started already, - they will not be started and the - transaction will fail immediately. - - - - - Wants= - - A weaker version of - Requires=. Units - listed in this option will be started - if the configuring unit is. However, - if the listed units fail to start - or cannot be added to the transaction, - this has no impact on the validity of - the transaction as a whole. This is - the recommended way to hook start-up - of one unit to the start-up of another - unit. - - Note that dependencies of this - type may also be configured outside of - the unit configuration file by adding - symlinks to a - .wants/ directory - accompanying the unit file. For - details, see above. - - - - BindsTo= - - Configures requirement - dependencies, very similar in style to - Requires=, however - in addition to this behavior, it also - declares that this unit is stopped - when any of the units listed suddenly - disappears. Units can suddenly, - unexpectedly disappear if a service - terminates on its own choice, a device - is unplugged or a mount point - unmounted without involvement of - systemd. - - - - PartOf= - - Configures dependencies - similar to Requires=, - but limited to stopping and restarting - of units. When systemd stops or restarts - the units listed here, the action is - propagated to this unit. - Note that this is a one-way dependency — - changes to this unit do not affect the - listed units. - - - - - Conflicts= - - A space-separated list - of unit names. Configures negative - requirement dependencies. If a unit - has a Conflicts= - setting on another unit, starting the - former will stop the latter and vice - versa. Note that this setting is - independent of and orthogonal to the - After= and - Before= ordering - dependencies. - - If a unit A that conflicts with - a unit B is scheduled to be started at - the same time as B, the transaction - will either fail (in case both are - required part of the transaction) or - be modified to be fixed (in case one - or both jobs are not a required part - of the transaction). In the latter - case, the job that is not the required - will be removed, or in case both are - not required, the unit that conflicts - will be started and the unit that is - conflicted is - stopped. - - - - Before= - After= - - A space-separated list - of unit names. Configures ordering - dependencies between units. If a unit - foo.service - contains a setting - - and both units are being started, - bar.service's - start-up is delayed until - foo.service is - started up. Note that this setting is - independent of and orthogonal to the - requirement dependencies as configured - by Requires=. It is - a common pattern to include a unit - name in both the - After= and - Requires= option, in - which case the unit listed will be - started before the unit that is - configured with these options. This - option may be specified more than - once, in which case ordering - dependencies for all listed names are - created. After= is - the inverse of - Before=, i.e. while - After= ensures that - the configured unit is started after - the listed unit finished starting up, - Before= ensures the - opposite, i.e. that the configured - unit is fully started up before the - listed unit is started. Note that when - two units with an ordering dependency - between them are shut down, the - inverse of the start-up order is - applied. i.e. if a unit is configured - with After= on - another unit, the former is stopped - before the latter if both are shut - down. If one unit with an ordering - dependency on another unit is shut - down while the latter is started up, - the shut down is ordered before the - start-up regardless of whether the - ordering dependency is actually of - type After= or - Before=. If two - units have no ordering dependencies - between them, they are shut down or - started up simultaneously, and no - ordering takes - place. - - - - OnFailure= - - A space-separated list - of one or more units that are - activated when this unit enters the - failed - state. - - - - PropagatesReloadTo= - ReloadPropagatedFrom= - - A space-separated list - of one or more units where reload - requests on this unit will be - propagated to, or reload requests on - the other unit will be propagated to - this unit, respectively. Issuing a - reload request on a unit will - automatically also enqueue a reload - request on all units that the reload - request shall be propagated to via - these two settings. - - - - JoinsNamespaceOf= - - For units that start - processes (such as service units), - lists one or more other units whose - network and/or temporary file - namespace to join. This only applies - to unit types which support the - PrivateNetwork= and - PrivateTmp= - directives (see - systemd.exec5 - for details). If a unit that has this - setting set is started, its processes - will see the same - /tmp, - /tmp/var and - network namespace as one listed unit - that is started. If multiple listed - units are already started, it is not - defined which namespace is - joined. Note that this setting only - has an effect if - PrivateNetwork= - and/or PrivateTmp= - is enabled for both the unit that - joins the namespace and the unit whose - namespace is joined. - - - - RequiresMountsFor= - - Takes a - space-separated list of absolute - paths. Automatically adds dependencies - of type Requires= - and After= for all - mount units required to access the - specified path. - - Mount points marked with - are not - mounted automatically and will be - ignored for the purposes of this - option. If such a mount should be a - requirement for this unit, - direct dependencies on the mount - units may be added - (Requires= and - After= or - some other combination). - - - - - OnFailureJobMode= - - Takes a value of - fail, - replace, - replace-irreversibly, - isolate, - flush, - ignore-dependencies - or - ignore-requirements. Defaults - to - replace. Specifies - how the units listed in - OnFailure= will be - enqueued. See - systemctl1's - option - for details on the possible values. If - this is set to - isolate, only a - single unit may be listed in - OnFailure=.. - - - - IgnoreOnIsolate= - - Takes a boolean - argument. If , - this unit will not be stopped when - isolating another unit. Defaults to - . - - - - IgnoreOnSnapshot= - - Takes a boolean - argument. If , - this unit will not be included in - snapshots. Defaults to - for device and - snapshot units, - for the others. - - - - StopWhenUnneeded= - - Takes a boolean - argument. If , - this unit will be stopped when it is - no longer used. Note that in order to - minimize the work to be executed, - systemd will not stop units by default - unless they are conflicting with other - units, or the user explicitly - requested their shut down. If this - option is set, a unit will be - automatically cleaned up if no other - active unit requires it. Defaults to - . - - - - RefuseManualStart= - RefuseManualStop= - - Takes a boolean - argument. If , - this unit can only be activated - or deactivated indirectly. In - this case, explicit start-up - or termination requested by the - user is denied, however if it is - started or stopped as a - dependency of another unit, start-up - or termination will succeed. This - is mostly a safety feature to ensure - that the user does not accidentally - activate units that are not intended - to be activated explicitly, and not - accidentally deactivate units that are - not intended to be deactivated. - These options default to - . - - - - AllowIsolate= - - Takes a boolean - argument. If , - this unit may be used with the - systemctl isolate - command. Otherwise, this will be - refused. It probably is a good idea to - leave this disabled except for target - units that shall be used similar to - runlevels in SysV init systems, just - as a precaution to avoid unusable - system states. This option defaults to - . - - - - DefaultDependencies= - - Takes a boolean - argument. If , - (the default), a few default - dependencies will implicitly be - created for the unit. The actual - dependencies created depend on the - unit type. For example, for service - units, these dependencies ensure that - the service is started only after - basic system initialization is - completed and is properly terminated on - system shutdown. See the respective - man pages for details. Generally, only - services involved with early boot or - late shutdown should set this option - to . It is - highly recommended to leave this - option enabled for the majority of - common units. If set to - , this option - does not disable all implicit - dependencies, just non-essential - ones. - - - - JobTimeoutSec= - JobTimeoutAction= - JobTimeoutRebootArgument= - - When a job for this - unit is queued a time-out may be - configured. If this time limit is - reached, the job will be cancelled, - the unit however will not change state - or even enter the - failed mode. This - value defaults to 0 (job timeouts - disabled), except for device - units. NB: this timeout is independent - from any unit-specific timeout (for - example, the timeout set with - StartTimeoutSec= in service - units) as the job timeout has no - effect on the unit itself, only on the - job that might be pending for it. Or - in other words: unit-specific timeouts - are useful to abort unit state - changes, and revert them. The job - timeout set with this option however - is useful to abort only the job - waiting for the unit state to - change. - - JobTimeoutAction= - optionally configures an additional - action to take when the time-out is - hit. It takes the same values as the - per-service - StartLimitAction= - setting, see - systemd.service5 - for details. Defaults to - . JobTimeoutRebootArgument= - configures an optional reboot string - to pass to the - reboot2 - system call. - - - - ConditionArchitecture= - ConditionVirtualization= - ConditionHost= - ConditionKernelCommandLine= - ConditionSecurity= - ConditionCapability= - ConditionACPower= - ConditionNeedsUpdate= - ConditionFirstBoot= - ConditionPathExists= - ConditionPathExistsGlob= - ConditionPathIsDirectory= - ConditionPathIsSymbolicLink= - ConditionPathIsMountPoint= - ConditionPathIsReadWrite= - ConditionDirectoryNotEmpty= - ConditionFileNotEmpty= - ConditionFileIsExecutable= - - - - Before starting a unit - verify that the specified condition is - true. If it is not true, the starting - of the unit will be skipped, however - all ordering dependencies of it are - still respected. A failing condition - will not result in the unit being - moved into a failure state. The - condition is checked at the time the - queued start job is to be - executed. - - ConditionArchitecture= - may be used to check whether the - system is running on a specific - architecture. Takes one of - x86, - x86-64, - ppc, - ppc-le, - ppc64, - ppc64-le, - ia64, - parisc, - parisc64, - s390, - s390x, - sparc, - sparc64, - mips, - mips-le, - mips64, - mips64-le, - alpha, - arm, - arm-be, - arm64, - arm64-be, - sh, - sh64, - m86k, - tilegx, - cris to test - against a specific architecture. The - architecture is determined from the - information returned by - uname2 - and is thus subject to - personality2. Note - that a Personality= - setting in the same unit file has no - effect on this condition. A special - architecture name - native is mapped to - the architecture the system manager - itself is compiled for. The test may - be negated by prepending an - exclamation mark. - - ConditionVirtualization= - may be used to check whether the - system is executed in a virtualized - environment and optionally test - whether it is a specific - implementation. Takes either boolean - value to check if being executed in - any virtualized environment, or one of - vm and - container to test - against a generic type of - virtualization solution, or one of - qemu, - kvm, - zvm, - vmware, - microsoft, - oracle, - xen, - bochs, - uml, - openvz, - lxc, - lxc-libvirt, - systemd-nspawn, - docker to test - against a specific implementation. See - systemd-detect-virt1 - for a full list of known - virtualization technologies and their - identifiers. If multiple - virtualization technologies are - nested, only the innermost is - considered. The test may be negated by - prepending an exclamation mark. - - ConditionHost= - may be used to match against the - hostname or machine ID of the - host. This either takes a hostname - string (optionally with shell style - globs) which is tested against the - locally set hostname as returned by - gethostname2, - or a machine ID formatted as string - (see - machine-id5). - The test may be negated by prepending - an exclamation mark. - - ConditionKernelCommandLine= - may be used to check whether a - specific kernel command line option is - set (or if prefixed with the - exclamation mark unset). The argument - must either be a single word, or an - assignment (i.e. two words, separated - =). In the former - case the kernel command line is - searched for the word appearing as is, - or as left hand side of an - assignment. In the latter case, the - exact assignment is looked for with - right and left hand side - matching. - - ConditionSecurity= - may be used to check whether the given - security module is enabled on the - system. Currently the recognized - values values are - selinux, - apparmor, - ima, - smack and - audit. The test may - be negated by prepending an - exclamation mark. - - ConditionCapability= - may be used to check whether the given - capability exists in the capability - bounding set of the service manager - (i.e. this does not check whether - capability is actually available in - the permitted or effective sets, see - capabilities7 - for details). Pass a capability name - such as CAP_MKNOD, - possibly prefixed with an exclamation - mark to negate the check. - - ConditionACPower= - may be used to check whether the - system has AC power, or is exclusively - battery powered at the time of - activation of the unit. This takes a - boolean argument. If set to - true, the condition - will hold only if at least one AC - connector of the system is connected - to a power source, or if no AC - connectors are known. Conversely, if - set to false, the - condition will hold only if there is - at least one AC connector known and - all AC connectors are disconnected - from a power source. - - ConditionNeedsUpdate= - takes one of /var - or /etc as - argument, possibly prefixed with a - ! (for inverting - the condition). This condition may be - used to conditionalize units on - whether the specified directory - requires an update because - /usr's - modification time is newer than the - stamp file - .updated in the - specified directory. This is useful to - implement offline updates of the - vendor operating system resources in - /usr that require - updating of /etc - or /var on the - next following boot. Units making use - of this condition should order - themselves before - systemd-update-done.service8, - to make sure they run before the stamp - files's modification time gets reset - indicating a completed update. - - ConditionFirstBoot= - takes a boolean argument. This - condition may be used to - conditionalize units on whether the - system is booting up with an - unpopulated /etc - directory. This may be used to - populate /etc on - the first boot after factory reset, or - when a new system instances boots up - for the first time. - - With - ConditionPathExists= - a file existence condition is - checked before a unit is started. If - the specified absolute path name does - not exist, the condition will - fail. If the absolute path name passed - to - ConditionPathExists= - is prefixed with an exclamation mark - (!), the test is negated, and the unit - is only started if the path does not - exist. - - ConditionPathExistsGlob= - is similar to - ConditionPathExists=, - but checks for the existence of at - least one file or directory matching - the specified globbing pattern. - - ConditionPathIsDirectory= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a - directory. - - ConditionPathIsSymbolicLink= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a symbolic - link. - - ConditionPathIsMountPoint= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a mount - point. - - ConditionPathIsReadWrite= - is similar to - ConditionPathExists= - but verifies whether the underlying - file system is readable and writable - (i.e. not mounted - read-only). - - ConditionDirectoryNotEmpty= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and is a non-empty - directory. - - ConditionFileNotEmpty= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists and refers to a regular file - with a non-zero size. - - ConditionFileIsExecutable= - is similar to - ConditionPathExists= - but verifies whether a certain path - exists, is a regular file and marked - executable. - - If multiple conditions are - specified, the unit will be executed if - all of them apply (i.e. a logical AND - is applied). Condition checks can be - prefixed with a pipe symbol (|) in - which case a condition becomes a - triggering condition. If at least one - triggering condition is defined for a - unit, then the unit will be executed if - at least one of the triggering - conditions apply and all of the - non-triggering conditions. If you - prefix an argument with the pipe - symbol and an exclamation mark, the - pipe symbol must be passed first, the - exclamation second. Except for - ConditionPathIsSymbolicLink=, - all path checks follow symlinks. If - any of these options is assigned the - empty string, the list of conditions is - reset completely, all previous - condition settings (of any kind) will - have no effect. - - - - AssertArchitecture= - AssertVirtualization= - AssertHost= - AssertKernelCommandLine= - AssertSecurity= - AssertCapability= - AssertACPower= - AssertNeedsUpdate= - AssertFirstBoot= - AssertPathExists= - AssertPathExistsGlob= - AssertPathIsDirectory= - AssertPathIsSymbolicLink= - AssertPathIsMountPoint= - AssertPathIsReadWrite= - AssertDirectoryNotEmpty= - AssertFileNotEmpty= - AssertFileIsExecutable= - - Similar to the - ConditionArchitecture=, - ConditionVirtualization=, - ... condition settings described above - these settings add assertion checks to - the start-up of the unit. However, - unlike the conditions settings any - assertion setting that is not met - results in failure of the start - job it was triggered by. - - - - SourcePath= - A path to a - configuration file this unit has been - generated from. This is primarily - useful for implementation of generator - tools that convert configuration from - an external configuration file format - into native unit files. This - functionality should not be used in - normal units. - - - - - - - [Install] Section Options - - Unit file may include an - [Install] section, which carries - installation information for the unit. This section is - not interpreted by - systemd1 - during runtime. It is used exclusively by the - enable and - disable commands of the - systemctl1 - tool during installation of a unit: - - - - Alias= - - A space-separated list - of additional names this unit shall be - installed under. The names listed here - must have the same suffix (i.e. type) - as the unit file name. This option may - be specified more than once, in which - case all listed names are used. At - installation time, systemctl - enable will create symlinks - from these names to the unit - filename. - - - - WantedBy= - RequiredBy= - - This option may be - used more than once, or a - space-separated list of unit names may - be given. A symbolic link is created - in the .wants/ or - .requires/ - directory of each of the listed units - when this unit is installed by - systemctl enable. - This has the effect that a dependency - of type Wants= or - Requires= is added - from the listed unit to the current - unit. The primary result is that the - current unit will be started when the - listed unit is started. See the - description of - Wants= and - Requires= in the - [Unit] section for details. - - WantedBy=foo.service - in a service - bar.service is - mostly equivalent to - Alias=foo.service.wants/bar.service - in the same file. In case of template - units, systemctl enable - must be called with an instance name, and - this instance will be added to the - .wants/ or - .requires/ list - of the listed unit. - E.g. WantedBy=getty.target - in a service - getty@.service - will result in systemctl - enable getty@tty2.service - creating a - getty.target.wants/getty@tty2.service - link to getty@.service. - - - - - Also= - - Additional units to - install/deinstall when this unit is - installed/deinstalled. If the user - requests installation/deinstallation - of a unit with this option configured, - systemctl enable - and systemctl - disable will automatically - install/uninstall units listed in this option as - well. - - This option may be used more - than once, or a space-separated list - of unit names may be - given. - - - - DefaultInstance= - - In template unit files, - this specifies for which instance the - unit shall be enabled if the template - is enabled without any explicitly set - instance. This option has no effect in - non-template unit files. The specified - string must be usable as instance - identifier. - - - - The following specifiers are interpreted in the - Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v. - For their meaning see the next section. - - - - - Specifiers - - Many settings resolve specifiers which may be - used to write generic unit files referring to runtime - or unit parameters that are replaced when the unit - files are loaded. The following specifiers are - understood: - - - Specifiers available in unit files - - - - - - - Specifier - Meaning - Details - - - - - %n - Full unit name - - - - %N - Unescaped full unit name - Same as %n, but with escaping undone - - - %p - Prefix name - For instantiated units, this refers to the string before the @ character of the unit name. For non-instantiated units, this refers to the name of the unit with the type suffix removed. - - - %P - Unescaped prefix name - Same as %p, but with escaping undone - - - %i - Instance name - For instantiated units: this is the string between the @ character and the suffix of the unit name. - - - %I - Unescaped instance name - Same as %i, but with escaping undone - - - %f - Unescaped filename - This is either the unescaped instance name (if applicable) with / prepended (if applicable), or the prefix name prepended with /. - - - %c - Control group path of the unit - This path does not include the /sys/fs/cgroup/systemd/ prefix. - - - %r - Control group path of the slice the unit is placed in - This usually maps to the parent cgroup path of %c. - - - %R - Root control group path below which slices and units are placed - For system instances, this resolves to /, except in containers, where this maps to the container's root control group path. - - - %t - Runtime directory - This is either /run (for the system manager) or the path $XDG_RUNTIME_DIR resolves to (for user managers). - - - %u - User name - This is the name of the configured user of the unit, or (if none is set) the user running the systemd instance. - - - %U - User UID - This is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user. - - - %h - User home directory - This is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to %U, this specifier is not available for units run by the systemd system instance, unless the configured user is the root user. - - - %s - User shell - This is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to %U, this specifier is not available for units run by the systemd system instance, unless the configured user is the root user. - - - %m - Machine ID - The machine ID of the running system, formatted as string. See machine-id5 for more information. - - - %b - Boot ID - The boot ID of the running system, formatted as string. See random4 for more information. - - - %H - Host name - The hostname of the running system at the point in time the unit configuation is loaded. - - - %v - Kernel release - Identical to uname -r output - - - %% - Single percent sign - Use %% in place of % to specify a single percent sign. - - - -
-
- - - See Also - - systemd1, - systemctl1, - systemd.special7, - systemd.service5, - systemd.socket5, - systemd.device5, - systemd.mount5, - systemd.automount5, - systemd.swap5, - systemd.target5, - systemd.path5, - systemd.timer5, - systemd.snapshot5, - systemd.scope5, - systemd.slice5, - systemd.time7, - systemd-verify1, - capabilities7, - systemd.directives7, - uname1 - - + + + + + Description + + A unit configuration file encodes information about a + service, a socket, a device, a mount point, an automount point, a + swap file or partition, a start-up target, a watched file system + path, a timer controlled and supervised by + systemd1, + a temporary system state snapshot, a resource management slice or + a group of externally created processes. The syntax is inspired by + XDG + Desktop Entry Specification .desktop + files, which are in turn inspired by Microsoft Windows + .ini files. + + This man page lists the common configuration options of all + the unit types. These options need to be configured in the [Unit] + or [Install] sections of the unit files. + + In addition to the generic [Unit] and [Install] sections + described here, each unit may have a type-specific section, e.g. + [Service] for a service unit. See the respective man pages for + more information: + systemd.service5, + systemd.socket5, + systemd.device5, + systemd.mount5, + systemd.automount5, + systemd.swap5, + systemd.target5, + systemd.path5, + systemd.timer5, + systemd.snapshot5. + systemd.slice5. + systemd.scope5. + + + Various settings are allowed to be specified more than once, + in which case the interpretation depends on the setting. Often, + multiple settings form a list, and setting to an empty value + "resets", which means that previous assignments are ignored. When + this is allowed, it is mentioned in the description of the + setting. Note that using multiple assignments to the same value + makes the unit file incompatible with parsers for the XDG + .desktop file format. + + Unit files are loaded from a set of paths determined during + compilation, described in the next section. + + Unit files may contain additional options on top of those + listed here. If systemd encounters an unknown option, it will + write a warning log message but continue loading the unit. If an + option or section name is prefixed with , it is + ignored completely by systemd. Options within an ignored section + do not need the prefix. Applications may use this to include + additional information in the unit files. + + Boolean arguments used in unit files can be written in + various formats. For positive settings the strings + , , + and are equivalent. For negative settings, the + strings , , + and are + equivalent. + + Time span values encoded in unit files can be written in + various formats. A stand-alone number specifies a time in seconds. + If suffixed with a time unit, the unit is honored. A concatenation + of multiple values with units is supported, in which case the + values are added up. Example: "50" refers to 50 seconds; "2min + 200ms" refers to 2 minutes plus 200 milliseconds, i.e. 120200ms. + The following time units are understood: s, min, h, d, w, ms, us. + For details see + systemd.time7. + + Empty lines and lines starting with # or ; are + ignored. This may be used for commenting. Lines ending + in a backslash are concatenated with the following + line while reading and the backslash is replaced by a + space character. This may be used to wrap long lines. + + Along with a unit file foo.service, the + directory foo.service.wants/ may exist. All + unit files symlinked from such a directory are implicitly added as + dependencies of type Wants= to the unit. This + is useful to hook units into the start-up of other units, without + having to modify their unit files. For details about the semantics + of Wants=, see below. The preferred way to + create symlinks in the .wants/ directory of a + unit file is with the enable command of the + systemctl1 + tool which reads information from the [Install] section of unit + files (see below). A similar functionality exists for + Requires= type dependencies as well, the + directory suffix is .requires/ in this + case. + + Along with a unit file foo.service, a + directory foo.service.d/ may exist. All files + with the suffix .conf from this directory will + be parsed after the file itself is parsed. This is useful to alter + or add configuration settings to a unit, without having to modify + their unit files. Make sure that the file that is included has the + appropriate section headers before any directive. Note that for + instanced units this logic will first look for the instance + .d/ subdirectory and read its + .conf files, followed by the template + .d/ subdirectory and reads its + .conf files. + + + + Note that while systemd offers a flexible dependency system + between units it is recommended to use this functionality only + sparingly and instead rely on techniques such as bus-based or + socket-based activation which make dependencies implicit, + resulting in a both simpler and more flexible system. + + Some unit names reflect paths existing in the file system + namespace. Example: a device unit + dev-sda.device refers to a device with the + device node /dev/sda in the + file system namespace. If this applies, a special way to escape + the path name is used, so that the result is usable as part of a + filename. Basically, given a path, "/" is replaced by "-" and all + other characters which are not ASCII alphanumerics are replaced by + C-style "\x2d" escapes (except that "_" is never replaced and "." + is only replaced when it would be the first character in the + escaped path). The root directory "/" is encoded as single dash, + while otherwise the initial and ending "/" are removed from all + paths during transformation. This escaping is reversible. Properly + escaped paths can be generated using the + systemd-escape1 + command. + + Optionally, units may be instantiated from a + template file at runtime. This allows creation of + multiple units from a single configuration file. If + systemd looks for a unit configuration file, it will + first search for the literal unit name in the + file system. If that yields no success and the unit + name contains an @ character, systemd will look for a + unit template that shares the same name but with the + instance string (i.e. the part between the @ character + and the suffix) removed. Example: if a service + getty@tty3.service is requested + and no file by that name is found, systemd will look + for getty@.service and + instantiate a service from that configuration file if + it is found. + + To refer to the instance string from within the + configuration file you may use the special %i + specifier in many of the configuration options. See below for + details. + + If a unit file is empty (i.e. has the file size 0) or is + symlinked to /dev/null, its configuration + will not be loaded and it appears with a load state of + masked, and cannot be activated. Use this as an + effective way to fully disable a unit, making it impossible to + start it even manually. + + The unit file format is covered by the + Interface + Stability Promise. + + + + + Unit Load Path + + Unit files are loaded from a set of paths determined during + compilation, described in the two tables below. Unit files found + in directories listed earlier override files with the same name in + directories lower in the list. + + When systemd is running in user mode + () and the variable + $SYSTEMD_UNIT_PATH is set, the contents of this + variable overrides the unit load path. If + $SYSTEMD_UNIT_PATH ends with an empty component + (:), the usual unit load path will be appended + to the contents of the variable. + + + + Load path when running in system mode (<option>--system</option>). + + + + + + + + Path + Description + + + + + /etc/systemd/system + Local configuration + + + /run/systemd/system + Runtime units + + + /usr/lib/systemd/system + Units of installed packages + + + +
+ + + + Load path when running in user mode (<option>--user</option>). + + + + + + + + Path + Description + + + + + $XDG_CONFIG_HOME/systemd/user + User configuration (only used when $XDG_CONFIG_HOME is set) + + + $HOME/.config/systemd/user + User configuration (only used when $XDG_CONFIG_HOME is not set) + + + /etc/systemd/user + Local configuration + + + $XDG_RUNTIME_DIR/systemd/user + Runtime units (only used when $XDG_RUNTIME_DIR is set) + + + /run/systemd/user + Runtime units + + + $XDG_DATA_HOME/systemd/user + Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set) + + + $HOME/.local/share/systemd/user + Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set) + + + /usr/lib/systemd/user + Units of packages that have been installed system-wide + + + +
+ + Additional units might be loaded into systemd ("linked") + from directories not on the unit load path. See the + link command for + systemctl1. + Also, some units are dynamically created via generators Generators. + +
+ + + [Unit] Section Options + + Unit file may include a [Unit] section, which carries + generic information about the unit that is not dependent on the + type of unit: + + + + + Description= + A free-form string describing the unit. This + is intended for use in UIs to show descriptive information + along with the unit name. The description should contain a + name that means something to the end user. Apache2 + Web Server is a good example. Bad examples are + high-performance light-weight HTTP server + (too generic) or Apache2 (too specific and + meaningless for people who do not know + Apache). + + + + Documentation= + A space-separated list of URIs referencing + documentation for this unit or its configuration. Accepted are + only URIs of the types http://, + https://, file:, + info:, man:. For more + information about the syntax of these URIs, see uri7. + The URIs should be listed in order of relevance, starting with + the most relevant. It is a good idea to first reference + documentation that explains what the unit's purpose is, + followed by how it is configured, followed by any other + related documentation. This option may be specified more than + once, in which case the specified list of URIs is merged. If + the empty string is assigned to this option, the list is reset + and all prior assignments will have no + effect. + + + + Requires= + + Configures requirement dependencies on other + units. If this unit gets activated, the units listed here will + be activated as well. If one of the other units gets + deactivated or its activation fails, this unit will be + deactivated. This option may be specified more than once or + multiple space-separated units may be specified in one option + in which case requirement dependencies for all listed names + will be created. Note that requirement dependencies do not + influence the order in which services are started or stopped. + This has to be configured independently with the + After= or Before= + options. If a unit foo.service requires a + unit bar.service as configured with + Requires= and no ordering is configured + with After= or Before=, + then both units will be started simultaneously and without any + delay between them if foo.service is + activated. Often it is a better choice to use + Wants= instead of + Requires= in order to achieve a system that + is more robust when dealing with failing services. + + Note that dependencies of this type may also be + configured outside of the unit configuration file by adding a + symlink to a .requires/ directory + accompanying the unit file. For details see + above. + + + + RequiresOverridable= + + Similar to Requires=. + Dependencies listed in RequiresOverridable= + which cannot be fulfilled or fail to start are ignored if the + startup was explicitly requested by the user. If the start-up + was pulled in indirectly by some dependency or automatic + start-up of units that is not requested by the user, this + dependency must be fulfilled and otherwise the transaction + fails. Hence, this option may be used to configure + dependencies that are normally honored unless the user + explicitly starts up the unit, in which case whether they + failed or not is irrelevant. + + + + Requisite= + RequisiteOverridable= + + Similar to Requires= and + RequiresOverridable=, respectively. + However, if the units listed here are not started already, + they will not be started and the transaction will fail + immediately. + + + + Wants= + + A weaker version of + Requires=. Units listed in this option will + be started if the configuring unit is. However, if the listed + units fail to start or cannot be added to the transaction, + this has no impact on the validity of the transaction as a + whole. This is the recommended way to hook start-up of one + unit to the start-up of another unit. + + Note that dependencies of this type may also be + configured outside of the unit configuration file by adding + symlinks to a .wants/ directory + accompanying the unit file. For details, see + above. + + + + BindsTo= + + Configures requirement dependencies, very + similar in style to Requires=, however in + addition to this behavior, it also declares that this unit is + stopped when any of the units listed suddenly disappears. + Units can suddenly, unexpectedly disappear if a service + terminates on its own choice, a device is unplugged or a mount + point unmounted without involvement of + systemd. + + + + PartOf= + + Configures dependencies similar to + Requires=, but limited to stopping and + restarting of units. When systemd stops or restarts the units + listed here, the action is propagated to this unit. Note that + this is a one-way dependency — changes to this unit do not + affect the listed units. + + + + Conflicts= + + A space-separated list of unit names. + Configures negative requirement dependencies. If a unit has a + Conflicts= setting on another unit, + starting the former will stop the latter and vice versa. Note + that this setting is independent of and orthogonal to the + After= and Before= + ordering dependencies. + + If a unit A that conflicts with a unit B is scheduled to + be started at the same time as B, the transaction will either + fail (in case both are required part of the transaction) or be + modified to be fixed (in case one or both jobs are not a + required part of the transaction). In the latter case, the job + that is not the required will be removed, or in case both are + not required, the unit that conflicts will be started and the + unit that is conflicted is stopped. + + + + Before= + After= + + A space-separated list of unit names. + Configures ordering dependencies between units. If a unit + foo.service contains a setting + and both units are being + started, bar.service's start-up is + delayed until foo.service is started up. + Note that this setting is independent of and orthogonal to the + requirement dependencies as configured by + Requires=. It is a common pattern to + include a unit name in both the After= and + Requires= option, in which case the unit + listed will be started before the unit that is configured with + these options. This option may be specified more than once, in + which case ordering dependencies for all listed names are + created. After= is the inverse of + Before=, i.e. while + After= ensures that the configured unit is + started after the listed unit finished starting up, + Before= ensures the opposite, i.e. that the + configured unit is fully started up before the listed unit is + started. Note that when two units with an ordering dependency + between them are shut down, the inverse of the start-up order + is applied. i.e. if a unit is configured with + After= on another unit, the former is + stopped before the latter if both are shut down. If one unit + with an ordering dependency on another unit is shut down while + the latter is started up, the shut down is ordered before the + start-up regardless of whether the ordering dependency is + actually of type After= or + Before=. If two units have no ordering + dependencies between them, they are shut down or started up + simultaneously, and no ordering takes place. + + + + + OnFailure= + + A space-separated list of one or more units + that are activated when this unit enters the + failed state. + + + + PropagatesReloadTo= + ReloadPropagatedFrom= + + A space-separated list of one or more units + where reload requests on this unit will be propagated to, or + reload requests on the other unit will be propagated to this + unit, respectively. Issuing a reload request on a unit will + automatically also enqueue a reload request on all units that + the reload request shall be propagated to via these two + settings. + + + + JoinsNamespaceOf= + + For units that start processes (such as + service units), lists one or more other units whose network + and/or temporary file namespace to join. This only applies to + unit types which support the + PrivateNetwork= and + PrivateTmp= directives (see + systemd.exec5 + for details). If a unit that has this setting set is started, + its processes will see the same /tmp, + /tmp/var and network namespace as one + listed unit that is started. If multiple listed units are + already started, it is not defined which namespace is joined. + Note that this setting only has an effect if + PrivateNetwork= and/or + PrivateTmp= is enabled for both the unit + that joins the namespace and the unit whose namespace is + joined. + + + + RequiresMountsFor= + + Takes a space-separated list of absolute + paths. Automatically adds dependencies of type + Requires= and After= for + all mount units required to access the specified path. + + Mount points marked with are not + mounted automatically and will be ignored for the purposes of + this option. If such a mount should be a requirement for this + unit, direct dependencies on the mount units may be added + (Requires= and After= or + some other combination). + + + + OnFailureJobMode= + + Takes a value of + fail, + replace, + replace-irreversibly, + isolate, + flush, + ignore-dependencies or + ignore-requirements. Defaults to + replace. Specifies how the units listed in + OnFailure= will be enqueued. See + systemctl1's + option for details on the + possible values. If this is set to isolate, + only a single unit may be listed in + OnFailure=.. + + + + IgnoreOnIsolate= + + Takes a boolean argument. If + , this unit will not be stopped when + isolating another unit. Defaults to + . + + + + IgnoreOnSnapshot= + + Takes a boolean argument. If + , this unit will not be included in + snapshots. Defaults to for device and + snapshot units, for the + others. + + + + StopWhenUnneeded= + + Takes a boolean argument. If + , this unit will be stopped when it is no + longer used. Note that in order to minimize the work to be + executed, systemd will not stop units by default unless they + are conflicting with other units, or the user explicitly + requested their shut down. If this option is set, a unit will + be automatically cleaned up if no other active unit requires + it. Defaults to . + + + + RefuseManualStart= + RefuseManualStop= + + Takes a boolean argument. If + , this unit can only be activated or + deactivated indirectly. In this case, explicit start-up or + termination requested by the user is denied, however if it is + started or stopped as a dependency of another unit, start-up + or termination will succeed. This is mostly a safety feature + to ensure that the user does not accidentally activate units + that are not intended to be activated explicitly, and not + accidentally deactivate units that are not intended to be + deactivated. These options default to + . + + + + AllowIsolate= + + Takes a boolean argument. If + , this unit may be used with the + systemctl isolate command. Otherwise, this + will be refused. It probably is a good idea to leave this + disabled except for target units that shall be used similar to + runlevels in SysV init systems, just as a precaution to avoid + unusable system states. This option defaults to + . + + + + DefaultDependencies= + + Takes a boolean argument. If + , (the default), a few default + dependencies will implicitly be created for the unit. The + actual dependencies created depend on the unit type. For + example, for service units, these dependencies ensure that the + service is started only after basic system initialization is + completed and is properly terminated on system shutdown. See + the respective man pages for details. Generally, only services + involved with early boot or late shutdown should set this + option to . It is highly recommended to + leave this option enabled for the majority of common units. If + set to , this option does not disable + all implicit dependencies, just non-essential + ones. + + + + JobTimeoutSec= + JobTimeoutAction= + JobTimeoutRebootArgument= + + When a job for this unit is queued a time-out + may be configured. If this time limit is reached, the job will + be cancelled, the unit however will not change state or even + enter the failed mode. This value defaults + to 0 (job timeouts disabled), except for device units. NB: + this timeout is independent from any unit-specific timeout + (for example, the timeout set with + StartTimeoutSec= in service units) as the + job timeout has no effect on the unit itself, only on the job + that might be pending for it. Or in other words: unit-specific + timeouts are useful to abort unit state changes, and revert + them. The job timeout set with this option however is useful + to abort only the job waiting for the unit state to + change. + + JobTimeoutAction= + optionally configures an additional + action to take when the time-out is + hit. It takes the same values as the + per-service + StartLimitAction= + setting, see + systemd.service5 + for details. Defaults to + . JobTimeoutRebootArgument= + configures an optional reboot string + to pass to the + reboot2 + system call. + + + + ConditionArchitecture= + ConditionVirtualization= + ConditionHost= + ConditionKernelCommandLine= + ConditionSecurity= + ConditionCapability= + ConditionACPower= + ConditionNeedsUpdate= + ConditionFirstBoot= + ConditionPathExists= + ConditionPathExistsGlob= + ConditionPathIsDirectory= + ConditionPathIsSymbolicLink= + ConditionPathIsMountPoint= + ConditionPathIsReadWrite= + ConditionDirectoryNotEmpty= + ConditionFileNotEmpty= + ConditionFileIsExecutable= + + + + Before starting a unit verify that the + specified condition is true. If it is not true, the starting + of the unit will be skipped, however all ordering dependencies + of it are still respected. A failing condition will not result + in the unit being moved into a failure state. The condition is + checked at the time the queued start job is to be + executed. + + ConditionArchitecture= may be used to + check whether the system is running on a specific + architecture. Takes one of + x86, + x86-64, + ppc, + ppc-le, + ppc64, + ppc64-le, + ia64, + parisc, + parisc64, + s390, + s390x, + sparc, + sparc64, + mips, + mips-le, + mips64, + mips64-le, + alpha, + arm, + arm-be, + arm64, + arm64-be, + sh, + sh64, + m86k, + tilegx, + cris to test + against a specific architecture. The architecture is + determined from the information returned by + uname2 + and is thus subject to + personality2. + Note that a Personality= setting in the + same unit file has no effect on this condition. A special + architecture name native is mapped to the + architecture the system manager itself is compiled for. The + test may be negated by prepending an exclamation mark. + + ConditionVirtualization= may be used + to check whether the system is executed in a virtualized + environment and optionally test whether it is a specific + implementation. Takes either boolean value to check if being + executed in any virtualized environment, or one of + vm and + container to test against a generic type of + virtualization solution, or one of + qemu, + kvm, + zvm, + vmware, + microsoft, + oracle, + xen, + bochs, + uml, + openvz, + lxc, + lxc-libvirt, + systemd-nspawn, + docker to test + against a specific implementation. See + systemd-detect-virt1 + for a full list of known virtualization technologies and their + identifiers. If multiple virtualization technologies are + nested, only the innermost is considered. The test may be + negated by prepending an exclamation mark. + + ConditionHost= may be used to match + against the hostname or machine ID of the host. This either + takes a hostname string (optionally with shell style globs) + which is tested against the locally set hostname as returned + by + gethostname2, + or a machine ID formatted as string (see + machine-id5). + The test may be negated by prepending an exclamation + mark. + + ConditionKernelCommandLine= may be + used to check whether a specific kernel command line option is + set (or if prefixed with the exclamation mark unset). The + argument must either be a single word, or an assignment (i.e. + two words, separated =). In the former case + the kernel command line is searched for the word appearing as + is, or as left hand side of an assignment. In the latter case, + the exact assignment is looked for with right and left hand + side matching. + + ConditionSecurity= may be used to + check whether the given security module is enabled on the + system. Currently the recognized values values are + selinux, + apparmor, + ima, + smack and + audit. The test may be negated by + prepending an exclamation mark. + + ConditionCapability= may be used to + check whether the given capability exists in the capability + bounding set of the service manager (i.e. this does not check + whether capability is actually available in the permitted or + effective sets, see + capabilities7 + for details). Pass a capability name such as + CAP_MKNOD, possibly prefixed with an + exclamation mark to negate the check. + + ConditionACPower= may be used to + check whether the system has AC power, or is exclusively + battery powered at the time of activation of the unit. This + takes a boolean argument. If set to true, + the condition will hold only if at least one AC connector of + the system is connected to a power source, or if no AC + connectors are known. Conversely, if set to + false, the condition will hold only if + there is at least one AC connector known and all AC connectors + are disconnected from a power source. + + ConditionNeedsUpdate= takes one of + /var or /etc as + argument, possibly prefixed with a ! (for + inverting the condition). This condition may be used to + conditionalize units on whether the specified directory + requires an update because /usr's + modification time is newer than the stamp file + .updated in the specified directory. This + is useful to implement offline updates of the vendor operating + system resources in /usr that require + updating of /etc or + /var on the next following boot. Units + making use of this condition should order themselves before + systemd-update-done.service8, + to make sure they run before the stamp files's modification + time gets reset indicating a completed update. + + ConditionFirstBoot= takes a boolean + argument. This condition may be used to conditionalize units + on whether the system is booting up with an unpopulated + /etc directory. This may be used to + populate /etc on the first boot after + factory reset, or when a new system instances boots up for the + first time. + + With ConditionPathExists= a file + existence condition is checked before a unit is started. If + the specified absolute path name does not exist, the condition + will fail. If the absolute path name passed to + ConditionPathExists= is prefixed with an + exclamation mark (!), the test is negated, + and the unit is only started if the path does not + exist. + + ConditionPathExistsGlob= is similar + to ConditionPathExists=, but checks for the + existence of at least one file or directory matching the + specified globbing pattern. + + ConditionPathIsDirectory= is similar + to ConditionPathExists= but verifies + whether a certain path exists and is a directory. + + ConditionPathIsSymbolicLink= is + similar to ConditionPathExists= but + verifies whether a certain path exists and is a symbolic + link. + + ConditionPathIsMountPoint= is similar + to ConditionPathExists= but verifies + whether a certain path exists and is a mount point. + + ConditionPathIsReadWrite= is similar + to ConditionPathExists= but verifies + whether the underlying file system is readable and writable + (i.e. not mounted read-only). + + ConditionDirectoryNotEmpty= is + similar to ConditionPathExists= but + verifies whether a certain path exists and is a non-empty + directory. + + ConditionFileNotEmpty= is similar to + ConditionPathExists= but verifies whether a + certain path exists and refers to a regular file with a + non-zero size. + + ConditionFileIsExecutable= is similar + to ConditionPathExists= but verifies + whether a certain path exists, is a regular file and marked + executable. + + If multiple conditions are specified, the unit will be + executed if all of them apply (i.e. a logical AND is applied). + Condition checks can be prefixed with a pipe symbol (|) in + which case a condition becomes a triggering condition. If at + least one triggering condition is defined for a unit, then the + unit will be executed if at least one of the triggering + conditions apply and all of the non-triggering conditions. If + you prefix an argument with the pipe symbol and an exclamation + mark, the pipe symbol must be passed first, the exclamation + second. Except for + ConditionPathIsSymbolicLink=, all path + checks follow symlinks. If any of these options is assigned + the empty string, the list of conditions is reset completely, + all previous condition settings (of any kind) will have no + effect. + + + + AssertArchitecture= + AssertVirtualization= + AssertHost= + AssertKernelCommandLine= + AssertSecurity= + AssertCapability= + AssertACPower= + AssertNeedsUpdate= + AssertFirstBoot= + AssertPathExists= + AssertPathExistsGlob= + AssertPathIsDirectory= + AssertPathIsSymbolicLink= + AssertPathIsMountPoint= + AssertPathIsReadWrite= + AssertDirectoryNotEmpty= + AssertFileNotEmpty= + AssertFileIsExecutable= + + Similar to the + ConditionArchitecture=, + ConditionVirtualization=, ... condition + settings described above these settings add assertion checks + to the start-up of the unit. However, unlike the conditions + settings any assertion setting that is not met results in + failure of the start job it was triggered + by. + + + + SourcePath= + A path to a configuration file this unit has + been generated from. This is primarily useful for + implementation of generator tools that convert configuration + from an external configuration file format into native unit + files. This functionality should not be used in normal + units. + + + + + + + [Install] Section Options + + Unit file may include an [Install] + section, which carries installation information for the unit. This + section is not interpreted by + systemd1 + during runtime. It is used exclusively by the + enable and disable commands + of the + systemctl1 + tool during installation of a unit: + + + + Alias= + + A space-separated list of additional names + this unit shall be installed under. The names listed here must + have the same suffix (i.e. type) as the unit file name. This + option may be specified more than once, in which case all + listed names are used. At installation time, + systemctl enable will create symlinks from + these names to the unit filename. + + + + WantedBy= + RequiredBy= + + This option may be used more than once, or a + space-separated list of unit names may be given. A symbolic + link is created in the .wants/ or + .requires/ directory of each of the + listed units when this unit is installed by systemctl + enable. This has the effect that a dependency of + type Wants= or Requires= + is added from the listed unit to the current unit. The primary + result is that the current unit will be started when the + listed unit is started. See the description of + Wants= and Requires= in + the [Unit] section for details. + + WantedBy=foo.service in a service + bar.service is mostly equivalent to + Alias=foo.service.wants/bar.service in the + same file. In case of template units, systemctl + enable must be called with an instance name, and + this instance will be added to the + .wants/ or + .requires/ list of the listed unit. E.g. + WantedBy=getty.target in a service + getty@.service will result in + systemctl enable getty@tty2.service + creating a + getty.target.wants/getty@tty2.service + link to getty@.service. + + + + + Also= + + Additional units to install/deinstall when + this unit is installed/deinstalled. If the user requests + installation/deinstallation of a unit with this option + configured, systemctl enable and + systemctl disable will automatically + install/uninstall units listed in this option as well. + + This option may be used more than once, or a + space-separated list of unit names may be + given. + + + + DefaultInstance= + + In template unit files, this specifies for + which instance the unit shall be enabled if the template is + enabled without any explicitly set instance. This option has + no effect in non-template unit files. The specified string + must be usable as instance identifier. + + + + The following specifiers are interpreted in the Install + section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v. For their meaning + see the next section. + + + + + Specifiers + + Many settings resolve specifiers which may be used to write + generic unit files referring to runtime or unit parameters that + are replaced when the unit files are loaded. The following + specifiers are understood: + + + Specifiers available in unit files + + + + + + + Specifier + Meaning + Details + + + + + %n + Full unit name + + + + %N + Unescaped full unit name + Same as %n, but with escaping undone + + + %p + Prefix name + For instantiated units, this refers to the string before the @ character of the unit name. For non-instantiated units, this refers to the name of the unit with the type suffix removed. + + + %P + Unescaped prefix name + Same as %p, but with escaping undone + + + %i + Instance name + For instantiated units: this is the string between the @ character and the suffix of the unit name. + + + %I + Unescaped instance name + Same as %i, but with escaping undone + + + %f + Unescaped filename + This is either the unescaped instance name (if applicable) with / prepended (if applicable), or the prefix name prepended with /. + + + %c + Control group path of the unit + This path does not include the /sys/fs/cgroup/systemd/ prefix. + + + %r + Control group path of the slice the unit is placed in + This usually maps to the parent cgroup path of %c. + + + %R + Root control group path below which slices and units are placed + For system instances, this resolves to /, except in containers, where this maps to the container's root control group path. + + + %t + Runtime directory + This is either /run (for the system manager) or the path $XDG_RUNTIME_DIR resolves to (for user managers). + + + %u + User name + This is the name of the configured user of the unit, or (if none is set) the user running the systemd instance. + + + %U + User UID + This is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user. + + + %h + User home directory + This is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to %U, this specifier is not available for units run by the systemd system instance, unless the configured user is the root user. + + + %s + User shell + This is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to %U, this specifier is not available for units run by the systemd system instance, unless the configured user is the root user. + + + %m + Machine ID + The machine ID of the running system, formatted as string. See machine-id5 for more information. + + + %b + Boot ID + The boot ID of the running system, formatted as string. See random4 for more information. + + + %H + Host name + The hostname of the running system at the point in time the unit configuation is loaded. + + + %v + Kernel release + Identical to uname -r output + + + %% + Single percent sign + Use %% in place of % to specify a single percent sign. + + + +
+ + Please note that specifiers %U, + %h, %s are mostly useless + when systemd is running in system mode. PID 1 cannot query the + user account database for information, so the specifiers only work + as shortcuts for things which are already specified in a different + way in the unit file. They are fully functional when systemd is + running in mode. +
+ + + Examples + + + Allowing units to be enabled + + The following snippet (highlighted) allows a unit (e.g. + foo.service) to be enabled via + systemctl enable: + + [Unit] +Description=Foo + +[Service] +ExecStart=/usr/sbin/foo-daemon + +[Install] +WantedBy=multi-user.target + + After running systemctl enable, a + symlink + /etc/systemd/system/multi-user.target.wants/foo.service + linking to the actual unit will be created. It tells systemd to + pull in the unit when starting + multi-user.target. The inverse + systemctl disable will remove that symlink + again. + + + + Overriding vendor settings + + There are two methods of overriding vendor settings in + unit files: copying the unit file from + /usr/lib/systemd/system to + /etc/systemd/system and modifying the + chosen settings. Alternatively, one can create a directory named + unit.d/ within + /etc/systemd/system and place a drop-in + file name.conf + there that only changes the specific settings one is interested + in. Note that multiple such drop-in files are read if + present. + + The advantage of the first method is that one easily + overrides the complete unit, the vendor unit is not parsed at + all anymore. It has the disadvantage that improvements to the + unit file by the vendor are not automatically incorporated on + updates. + + The advantage of the second method is that one only + overrides the settings one specifically wants, where updates to + the unit by the vendor automatically apply. This has the + disadvantage that some future updates by the vendor might be + incompatible with the local changes. + + Note that for drop-in files, if one wants to remove + entries from a setting that is parsed as a list (and is not a + dependency), such as ConditionPathExists= (or + e.g. ExecStart= in service units), one needs + to first clear the list before re-adding all entries except the + one that is to be removed. See below for an example. + + This also applies for user instances of systemd, but with + different locations for the unit files. See the section on unit + load paths for further details. + + Suppose there is a vendor-supplied unit + /usr/lib/systemd/system/httpd.service with + the following contents: + + [Unit] +Description=Some HTTP server +After=remote-fs.target sqldb.service +Requires=sqldb.service +AssertPathExists=/srv/webserver + +[Service] +Type=notify +ExecStart=/usr/sbin/some-fancy-httpd-server +Nice=5 + +[Install] +WantedBy=multi-user.target + + Now one wants to change some settings as an administrator: + firstly, in the local setup, /srv/webserver + might not exist, because the HTTP server is configured to use + /srv/www instead. Secondly, the local + configuration makes the HTTP server also depend on a memory + cache service, memcached.service, that + should be pulled in (Requires=) and also be + ordered appropriately (After=). Thirdly, in + order to harden the service a bit more, the administrator would + like to set the PrivateTmp= setting (see + systemd.service5 + for details). And lastly, the administrator would like to reset + the niceness of the service to its default value of 0. + + The first possibility is to copy the unit file to + /etc/systemd/system/httpd.service and + change the chosen settings: + + [Unit] +Description=Some HTTP server +After=remote-fs.target sqldb.service memcached.service +Requires=sqldb.service memcached.service +AssertPathExists=/srv/www + +[Service] +Type=notify +ExecStart=/usr/sbin/some-fancy-httpd-server +Nice=0 +PrivateTmp=yes + +[Install] +WantedBy=multi-user.target + + Alternatively, the administrator could create a drop-in + file + /etc/systemd/system/httpd.service.d/local.conf + with the following contents: + + [Unit] +After=memcached.service +Requires=memcached.service +# Reset all assertions and then re-add the condition we want +AssertPathExists= +AssertPathExists=/srv/www + +[Service] +Nice=0 +PrivateTmp=yes + + Note that dependencies (After=, etc.) + cannot be reset to an empty list, so dependencies can only be + added in drop-ins. If you want to remove dependencies, you have + to override the entire unit. + + + + + See Also + + systemd1, + systemctl1, + systemd.special7, + systemd.service5, + systemd.socket5, + systemd.device5, + systemd.mount5, + systemd.automount5, + systemd.swap5, + systemd.target5, + systemd.path5, + systemd.timer5, + systemd.snapshot5, + systemd.scope5, + systemd.slice5, + systemd.time7, + systemd-analyze1, + capabilities7, + systemd.directives7, + uname1 + +
diff --git a/man/systemd.xml b/man/systemd.xml index e0e8d37a9..80591dc73 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - systemd - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd - 1 - - - - systemd - init - systemd system and service manager - - - - - systemd OPTIONS - - - init OPTIONS COMMAND - - - - - Description - - systemd is a system and service manager for - Linux operating systems. When run as first process on - boot (as PID 1), it acts as init system that brings - up and maintains userspace services. - - For compatibility with SysV, if systemd is called - as init and a PID that is not - 1, it will execute telinit and pass - all command line arguments unmodified. That means - init and telinit - are mostly equivalent when invoked from normal login sessions. See - telinit8 - for more information. - - When run as a system instance, systemd interprets the - configuration file system.conf and the - files in system.conf.d directories; when - run as a user instance, systemd interprets the configuration - file user.conf and the files in - user.conf.d directories. See - systemd-system.conf5 - for more information. - - - - Options - - The following options are understood: - - - - - - Determine startup - sequence, dump it and exit. This is an - option useful for debugging - only. - - - - - Dump understood unit - configuration items. This outputs a - terse but complete list of - configuration items understood in unit - definition files. - - - - - Set default unit to - activate on startup. If not specified, - defaults to - default.target. - - - - - - For , - tell systemd to run a - system instance, even if the process ID is - not 1, i.e. systemd is not run as init process. - does the opposite, - running a user instance even if the process - ID is 1. - Normally it should not be necessary to - pass these options, as systemd - automatically detects the mode it is - started in. These options are hence of - little use except for debugging. Note - that it is not supported booting and - maintaining a full system with systemd - running in - mode, but PID not 1. In practice, - passing explicitly is - only useful in conjunction with - . - - - - - Dump core on - crash. This switch has no effect when - run as user - instance. - - - - - Run shell on - crash. This switch has no effect when - run as user - instance. - - - - - Ask for confirmation - when spawning processes. This switch - has no effect when run as user - instance. - - - - - Show terse service - status information while booting. This - switch has no effect when run as user - instance. Takes a boolean argument - which may be omitted which is - interpreted as - . - - - - - Set log - target. Argument must be one of - , - , - , - , - . - - - - - Set log level. As - argument this accepts a numerical log - level or the well-known syslog3 - symbolic names (lowercase): - , - , - , - , - , - , - , - . - - - - - Highlight important - log messages. Argument is a boolean - value. If the argument is omitted, it - defaults to - . - - - - - Include code location - in log messages. This is mostly - relevant for debugging - purposes. Argument is a boolean - value. If the argument is omitted - it defaults to - . - - - - - - Sets the default - output or error output for all - services and sockets, respectively. That is, controls - the default for - - and - (see - systemd.exec5 - for details). Takes one of - , - , - , - , - , - , - , - , - . If the - argument is omitted - - defaults to - and - - to - . - - - - - - - - - Concepts - - systemd provides a dependency system between - various entities called "units" of 12 different - types. Units encapsulate various objects that are - relevant for system boot-up and maintenance. The - majority of units are configured in unit configuration - files, whose syntax and basic set of options is - described in - systemd.unit5, - however some are created automatically from other - configuration, dynamically from system state or - programmatically at runtime. Units may be "active" - (meaning started, bound, plugged in, ..., depending on - the unit type, see below), or "inactive" (meaning - stopped, unbound, unplugged, ...), as well as in the - process of being activated or deactivated, - i.e. between the two states (these states are called - "activating", "deactivating"). A special "failed" - state is available as well, which is very similar to - "inactive" and is entered when the service failed in - some way (process returned error code on exit, or - crashed, or an operation timed out). If this state is - entered, the cause will be logged, for later - reference. Note that the various unit types may have a - number of additional substates, which are mapped to - the five generalized unit states described - here. - - The following unit types are available: - - - Service units, which start and control - daemons and the processes they consist of. For - details see - systemd.service5. - - Socket units, which - encapsulate local IPC or network sockets in - the system, useful for socket-based - activation. For details about socket units see - systemd.socket5, - for details on socket-based activation and - other forms of activation, see - daemon7. - - Target units are useful to - group units, or provide well-known - synchronization points during boot-up, see - systemd.target5. - - Device units expose kernel - devices in systemd and may be used to - implement device-based activation. For details - see - systemd.device5. - - Mount units control mount - points in the file system, for details see - systemd.mount5. - - Automount units provide - automount capabilities, for on-demand mounting - of file systems as well as parallelized - boot-up. See - systemd.automount5. - - Snapshot units can be used to - temporarily save the state of the set of - systemd units, which later may be restored by - activating the saved snapshot unit. For more - information see - systemd.snapshot5. - - Timer units are useful for - triggering activation of other units based on - timers. You may find details in - systemd.timer5. - - Swap units are very similar to - mount units and encapsulate memory swap - partitions or files of the operating - system. They are described in systemd.swap5. - - Path units may be used - to activate other services when file system - objects change or are modified. See - systemd.path5. - - Slice units may be used to - group units which manage system processes - (such as service and scope units) in a - hierarchical tree for resource management - purposes. See - systemd.slice5. - - Scope units are similar to - service units, but manage foreign processes - instead of starting them as well. See - systemd.scope5. - - - - Units are named as their configuration - files. Some units have special semantics. A detailed - list is available in - systemd.special7. - - systemd knows various kinds of dependencies, - including positive and negative requirement - dependencies (i.e. Requires= and - Conflicts=) as well as ordering - dependencies (After= and - Before=). NB: ordering and - requirement dependencies are orthogonal. If only a - requirement dependency exists between two units - (e.g. foo.service requires - bar.service), but no ordering - dependency (e.g. foo.service - after bar.service) and both are - requested to start, they will be started in - parallel. It is a common pattern that both requirement - and ordering dependencies are placed between two - units. Also note that the majority of dependencies are - implicitly created and maintained by systemd. In most - cases, it should be unnecessary to declare additional - dependencies manually, however it is possible to do - this. - - Application programs and units (via - dependencies) may request state changes of units. In - systemd, these requests are encapsulated as 'jobs' and - maintained in a job queue. Jobs may succeed or can - fail, their execution is ordered based on the ordering - dependencies of the units they have been scheduled - for. - - On boot systemd activates the target unit - default.target whose job is to - activate on-boot services and other on-boot units by - pulling them in via dependencies. Usually the unit - name is just an alias (symlink) for either - graphical.target (for - fully-featured boots into the UI) or - multi-user.target (for limited - console-only boots for use in embedded or server - environments, or similar; a subset of - graphical.target). However, it is at the discretion of - the administrator to configure it as an alias to any - other target unit. See - systemd.special7 - for details about these target units. - - Processes systemd spawns are placed in - individual Linux control groups named after the unit - which they belong to in the private systemd - hierarchy. (see cgroups.txt - for more information about control groups, or short - "cgroups"). systemd uses this to effectively keep - track of processes. Control group information is - maintained in the kernel, and is accessible via the - file system hierarchy (beneath - /sys/fs/cgroup/systemd/), or in tools - such as - ps1 - (ps xawf -eo pid,user,cgroup,args - is particularly useful to list all processes and the - systemd units they belong to.). - - systemd is compatible with the SysV init system - to a large degree: SysV init scripts are supported and - simply read as an alternative (though limited) - configuration file format. The SysV - /dev/initctl interface is - provided, and compatibility implementations of the - various SysV client tools are available. In addition to - that, various established Unix functionality such as - /etc/fstab or the - utmp database are - supported. - - systemd has a minimal transaction system: if a - unit is requested to start up or shut down it will add - it and all its dependencies to a temporary - transaction. Then, it will verify if the transaction - is consistent (i.e. whether the ordering of all units - is cycle-free). If it is not, systemd will try to fix - it up, and removes non-essential jobs from the - transaction that might remove the loop. Also, systemd - tries to suppress non-essential jobs in the - transaction that would stop a running service. Finally - it is checked whether the jobs of the transaction - contradict jobs that have already been queued, and - optionally the transaction is aborted then. If all - worked out and the transaction is consistent and - minimized in its impact it is merged with all already - outstanding jobs and added to the run - queue. Effectively this means that before executing a - requested operation, systemd will verify that it makes - sense, fixing it if possible, and only failing if it - really cannot work. - - Systemd contains native implementations of - various tasks that need to be executed as part of the - boot process. For example, it sets the hostname or - configures the loopback network device. It also sets - up and mounts various API file systems, such as - /sys or - /proc. - - For more information about the concepts and - ideas behind systemd, please refer to the Original - Design Document. - - Note that some but not all interfaces provided - by systemd are covered by the Interface - Stability Promise. - - Units may be generated dynamically at boot and - system manager reload time, for example based on other - configuration files or parameters passed on the kernel - command line. For details see the Generators - Specification. - - Systems which invoke systemd in a container - or initrd environment should implement the - Container - Interface or initrd - Interface specifications, respectively. - - - - Directories - - - - System unit directories - - The systemd system - manager reads unit configuration from - various directories. Packages that - want to install unit files shall place - them in the directory returned by - pkg-config systemd - --variable=systemdsystemunitdir. Other - directories checked are - /usr/local/lib/systemd/system - and - /usr/lib/systemd/system. User - configuration always takes - precedence. pkg-config - systemd - --variable=systemdsystemconfdir - returns the path of the system - configuration directory. Packages - should alter the content of these - directories only with the - enable and - disable commands of - the - systemctl1 - tool. Full list of directories is provided in - systemd.unit5. - - - - - - - User unit directories - - Similar rules apply - for the user unit - directories. However, here the XDG - Base Directory specification - is followed to find - units. Applications should place their - unit files in the directory returned - by pkg-config systemd - --variable=systemduserunitdir. Global - configuration is done in the directory - reported by pkg-config - systemd - --variable=systemduserconfdir. The - enable and - disable commands of - the - systemctl1 - tool can handle both global (i.e. for - all users) and private (for one user) - enabling/disabling of - units. Full list of directories is provided in - systemd.unit5. - - - - - - - SysV init scripts directory - - The location of the - SysV init script directory varies - between distributions. If systemd - cannot find a native unit file for a - requested service, it will look for a - SysV init script of the same name - (with the - .service suffix - removed). - - - - - - SysV runlevel link farm directory - - The location of the - SysV runlevel link farm directory - varies between distributions. systemd - will take the link farm into account - when figuring out whether a service - shall be enabled. Note that a service - unit with a native unit configuration - file cannot be started by activating it - in the SysV runlevel link - farm. - - - - - - Signals - - - - SIGTERM - - Upon receiving this - signal the systemd system manager - serializes its state, reexecutes - itself and deserializes the saved - state again. This is mostly equivalent - to systemctl - daemon-reexec. - - systemd user managers will - start the - exit.target unit - when this signal is received. This is - mostly equivalent to - systemctl --user start - exit.target. - - - - SIGINT - - Upon receiving this - signal the systemd system manager will - start the - ctrl-alt-del.target unit. This - is mostly equivalent to - systemctl start - ctl-alt-del.target. - - systemd user managers - treat this signal the same way as - SIGTERM. - - - - SIGWINCH - - When this signal is - received the systemd system manager - will start the - kbrequest.target - unit. This is mostly equivalent to - systemctl start - kbrequest.target. - - This signal is ignored by - systemd user - managers. - - - - SIGPWR - - When this signal is - received the systemd manager - will start the - sigpwr.target - unit. This is mostly equivalent to - systemctl start - sigpwr.target. - - - - SIGUSR1 - - When this signal is - received the systemd manager will try - to reconnect to the D-Bus - bus. - - - - SIGUSR2 - - When this signal is - received the systemd manager will log - its complete state in human readable - form. The data logged is the same as - printed by systemd-analyze - dump. - - - - SIGHUP - - Reloads the complete - daemon configuration. This is mostly - equivalent to systemctl - daemon-reload. - - - - SIGRTMIN+0 - - Enters default mode, starts the - default.target - unit. This is mostly equivalent to - systemctl start - default.target. - - - - SIGRTMIN+1 - - Enters rescue mode, - starts the - rescue.target - unit. This is mostly equivalent to - systemctl isolate - rescue.target. - - - - SIGRTMIN+2 - - Enters emergency mode, - starts the - emergency.service - unit. This is mostly equivalent to - systemctl isolate - emergency.service. - - - - SIGRTMIN+3 - - Halts the machine, - starts the - halt.target - unit. This is mostly equivalent to - systemctl start - halt.target. - - - - SIGRTMIN+4 - - Powers off the machine, - starts the - poweroff.target - unit. This is mostly equivalent to - systemctl start - poweroff.target. - - - - SIGRTMIN+5 - - Reboots the machine, - starts the - reboot.target - unit. This is mostly equivalent to - systemctl start - reboot.target. - - - - SIGRTMIN+6 - - Reboots the machine via kexec, - starts the - kexec.target - unit. This is mostly equivalent to - systemctl start - kexec.target. - - - - SIGRTMIN+13 - - Immediately halts the machine. - - - - SIGRTMIN+14 - - Immediately powers off the machine. - - - - SIGRTMIN+15 - - Immediately reboots the machine. - - - - SIGRTMIN+16 - - Immediately reboots the machine with kexec. - - - - SIGRTMIN+20 - - Enables display of - status messages on the console, as - controlled via - systemd.show_status=1 - on the kernel command - line. - - - - SIGRTMIN+21 - - Disables display of - status messages on the console, as - controlled via - systemd.show_status=0 - on the kernel command - line. - - - - SIGRTMIN+22 - SIGRTMIN+23 - - Sets the log level to - debug - (or info on - SIGRTMIN+23), as - controlled via - systemd.log_level=debug - (or systemd.log_level=info - on SIGRTMIN+23) on - the kernel command - line. - - - - SIGRTMIN+24 - - Immediately exits the - manager (only available for --user - instances). - - - - SIGRTMIN+26 - SIGRTMIN+27 - SIGRTMIN+28 - - Sets the log level to - journal-or-kmsg (or - console on - SIGRTMIN+27, - kmsg on - SIGRTMIN+28), as - controlled via - systemd.log_target=journal-or-kmsg - (or - systemd.log_target=console - on SIGRTMIN+27 or - systemd.log_target=kmsg - on SIGRTMIN+28) - on the kernel command - line. - - - - - - Environment - - - - $SYSTEMD_LOG_LEVEL - systemd reads the - log level from this environment - variable. This can be overridden with - . - - - - $SYSTEMD_LOG_TARGET - systemd reads the - log target from this environment - variable. This can be overridden with - . - - - - $SYSTEMD_LOG_COLOR - Controls whether - systemd highlights important log - messages. This can be overridden with - . - - - - $SYSTEMD_LOG_LOCATION - Controls whether - systemd prints the code location along - with log messages. This can be - overridden with - . - - - - $XDG_CONFIG_HOME - $XDG_CONFIG_DIRS - $XDG_DATA_HOME - $XDG_DATA_DIRS - - The systemd user - manager uses these variables in - accordance to the XDG - Base Directory specification - to find its configuration. - - - - $SYSTEMD_UNIT_PATH - - Controls where systemd - looks for unit - files. - - - - $SYSTEMD_SYSVINIT_PATH - - Controls where systemd - looks for SysV init scripts. - - - - $SYSTEMD_SYSVRCND_PATH - - Controls where systemd - looks for SysV init script runlevel link - farms. - - - - $LISTEN_PID - $LISTEN_FDS - - Set by systemd for - supervised processes during - socket-based activation. See - sd_listen_fds3 - for more information. - - - - - $NOTIFY_SOCKET - - Set by systemd for - supervised processes for status and - start-up completion notification. See - sd_notify3 - for more information. - - - - - - - Kernel Command Line - - When run as system instance systemd parses a - number of kernel command line - argumentsIf run inside a Linux - container these arguments may be passed as command - line arguments to systemd itself, next to any of the - command line options listed in the Options section - above. If run outside of Linux containers, these - arguments are parsed from - /proc/cmdline - instead.: - - - - systemd.unit= - rd.systemd.unit= - - Overrides the unit to - activate on boot. Defaults to - default.target. This - may be used to temporarily boot into a - different boot unit, for example - rescue.target or - emergency.service. See - systemd.special7 - for details about these units. The - option prefixed with - rd. is honored - only in the initial RAM disk (initrd), - while the one that is not prefixed only - in the main system. - - - - systemd.dump_core= - - Takes a boolean - argument. If , - systemd dumps core when it - crashes. Otherwise, no core dump is - created. Defaults to - . - - - - systemd.crash_shell= - - Takes a boolean - argument. If , - systemd spawns a shell when it - crashes. Otherwise, no shell is - spawned. Defaults to - , for security - reasons, as the shell is not protected - by any password - authentication. - - - - systemd.crash_chvt= - - Takes an integer - argument. If positive systemd - activates the specified virtual - terminal when it crashes. Defaults to - -1. - - - - systemd.confirm_spawn= - - Takes a boolean - argument. If , - asks for confirmation when spawning - processes. Defaults to - . - - - - systemd.show_status= - - Takes a boolean - argument or the constant - auto. If - , shows terse - service status updates on the console - during bootup. - auto behaves like - until a service - fails or there is a significant delay - in boot. Defaults to - , unless - is passed as - kernel command line option in which - case it defaults to - auto. - - - - systemd.log_target= - systemd.log_level= - systemd.log_color= - systemd.log_location= - - Controls log output, - with the same effect as the - $SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION - environment variables described above. - - - - systemd.default_standard_output= - systemd.default_standard_error= - Controls default - standard output and error output for - services, with the same effect as the - - and - command line arguments described - above, respectively. - - - - systemd.setenv= - - Takes a string - argument in the form VARIABLE=VALUE. - May be used to set default environment - variables to add to forked child processes. - May be used more than once to set multiple - variables. - - - - quiet - - Turn off - status output at boot, much like - systemd.show_status=false - would. Note that this option is also - read by the kernel itself and disables - kernel log output. Passing this option - hence turns off the usual output from - both the system manager and the kernel. - - - - - debug - - Turn on debugging - output. This is equivalent to - systemd.log_level=debug. - Note that this option is also read by - the kernel itself and enables kernel - debug output. Passing this option - hence turns on the debug output from - both the system manager and the - kernel. - - - - emergency - -b - - Boot into emergency - mode. This is equivalent to - systemd.unit=emergency.target - and provided for compatibility reasons - and to be easier to - type. - - - - rescue - single - s - S - 1 - - Boot into rescue - mode. This is equivalent to - systemd.unit=rescue.target - and provided for compatibility reasons - and to be easier to - type. - - - - 2 - 3 - 4 - 5 - - Boot into the - specified legacy SysV runlevel. These - are equivalent to - systemd.unit=runlevel2.target, - systemd.unit=runlevel3.target, - systemd.unit=runlevel4.target, - and systemd.unit=runlevel5.target, respectively, - and provided for compatibility reasons - and to be easier to - type. - - - - locale.LANG= - locale.LANGUAGE= - locale.LC_CTYPE= - locale.LC_NUMERIC= - locale.LC_TIME= - locale.LC_COLLATE= - locale.LC_MONETARY= - locale.LC_MESSAGES= - locale.LC_PAPER= - locale.LC_NAME= - locale.LC_ADDRESS= - locale.LC_TELEPHONE= - locale.LC_MEASUREMENT= - locale.LC_IDENTIFICATION= - - Set the system locale - to use. This overrides the settings in - /etc/locale.conf. For - more information see - locale.conf5 - and - locale7. - - - - - For other kernel command line parameters - understood by components of the core OS, please refer - to - kernel-command-line7. - - - - Sockets and FIFOs - - - - /run/systemd/notify - - Daemon status - notification socket. This is an - AF_UNIX datagram socket and is used to - implement the daemon notification - logic as implemented by - sd_notify3. - - - - - /run/systemd/shutdownd - - Used internally by the - shutdown8 - tool to implement delayed - shutdowns. This is an AF_UNIX datagram - socket. - - - - /run/systemd/private - - Used internally as - communication channel between - systemctl1 - and the systemd process. This is an - AF_UNIX stream socket. This interface - is private to systemd and should not - be used in external - projects. - - - - /dev/initctl - - Limited compatibility - support for the SysV client interface, - as implemented by the - systemd-initctl.service - unit. This is a named pipe in the file - system. This interface is obsolete and - should not be used in new - applications. - - - - - - See Also - - The systemd Homepage, - systemd-system.conf5, - locale.conf5, - systemctl1, - journalctl1, - systemd-notify1, - daemon7, - sd-daemon3, - systemd.unit5, - systemd.special5, - pkg-config1, - kernel-command-line7, - bootup7, - systemd.directives7 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + systemd + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + systemd + 1 + + + + systemd + init + systemd system and service manager + + + + + systemd OPTIONS + + + init OPTIONS COMMAND + + + + + Description + + systemd is a system and service manager for Linux operating + systems. When run as first process on boot (as PID 1), it acts as + init system that brings up and maintains userspace + services. + + For compatibility with SysV, if systemd is called as + init and a PID that is not 1, it will execute + telinit and pass all command line arguments + unmodified. That means init and + telinit are mostly equivalent when invoked from + normal login sessions. See + telinit8 + for more information. + + When run as a system instance, systemd interprets the + configuration file system.conf and the files + in system.conf.d directories; when run as a + user instance, systemd interprets the configuration file + user.conf and the files in + user.conf.d directories. See + systemd-system.conf5 + for more information. + + + + Options + + The following options are understood: + + + + + + Determine startup sequence, dump it and exit. + This is an option useful for debugging only. + + + + + Dump understood unit configuration items. This + outputs a terse but complete list of configuration items + understood in unit definition files. + + + + + Set default unit to activate on startup. If + not specified, defaults to + default.target. + + + + + + For , tell systemd to + run a system instance, even if the process ID is not 1, i.e. + systemd is not run as init process. + does the opposite, running a user instance even if the process + ID is 1. Normally it should not be necessary to pass these + options, as systemd automatically detects the mode it is + started in. These options are hence of little use except for + debugging. Note that it is not supported booting and + maintaining a full system with systemd running in + mode, but PID not 1. In practice, + passing explicitly is only useful in + conjunction with . + + + + + Dump core on crash. This switch has no effect + when run as user instance. + + + + + Run shell on + crash. This switch has no effect when + run as user + instance. + + + + + Ask for confirmation when spawning processes. + This switch has no effect when run as user + instance. + + + + + Show terse service status information while + booting. This switch has no effect when run as user instance. + Takes a boolean argument which may be omitted which is + interpreted as . + + + + + Set log target. Argument must be one of + , + , + , + , + . + + + + + Set log level. As + argument this accepts a numerical log + level or the well-known syslog3 + symbolic names (lowercase): + , + , + , + , + , + , + , + . + + + + + Highlight important log messages. Argument is + a boolean value. If the argument is omitted, it defaults to + . + + + + + Include code location in log messages. This is + mostly relevant for debugging purposes. Argument is a boolean + value. If the argument is omitted it defaults to + . + + + + + + Sets the default output or error output for + all services and sockets, respectively. That is, controls the + default for and + (see + systemd.exec5 + for details). Takes one of + , + , + , + , + , + , + , + , + . If the + argument is omitted + defaults to + and + to + . + + + + + + + + + Concepts + + systemd provides a dependency system between various + entities called "units" of 12 different types. Units encapsulate + various objects that are relevant for system boot-up and + maintenance. The majority of units are configured in unit + configuration files, whose syntax and basic set of options is + described in + systemd.unit5, + however some are created automatically from other configuration, + dynamically from system state or programmatically at runtime. + Units may be "active" (meaning started, bound, plugged in, ..., + depending on the unit type, see below), or "inactive" (meaning + stopped, unbound, unplugged, ...), as well as in the process of + being activated or deactivated, i.e. between the two states (these + states are called "activating", "deactivating"). A special + "failed" state is available as well, which is very similar to + "inactive" and is entered when the service failed in some way + (process returned error code on exit, or crashed, or an operation + timed out). If this state is entered, the cause will be logged, + for later reference. Note that the various unit types may have a + number of additional substates, which are mapped to the five + generalized unit states described here. + + The following unit types are available: + + + Service units, which start and control daemons + and the processes they consist of. For details see + systemd.service5. + + Socket units, which encapsulate local IPC or + network sockets in the system, useful for socket-based + activation. For details about socket units see + systemd.socket5, + for details on socket-based activation and other forms of + activation, see + daemon7. + + Target units are useful to group units, or + provide well-known synchronization points during boot-up, see + systemd.target5. + + Device units expose kernel devices in systemd + and may be used to implement device-based activation. For + details see + systemd.device5. + + Mount units control mount points in the file + system, for details see + systemd.mount5. + + Automount units provide automount capabilities, + for on-demand mounting of file systems as well as parallelized + boot-up. See + systemd.automount5. + + Snapshot units can be used to temporarily save + the state of the set of systemd units, which later may be + restored by activating the saved snapshot unit. For more + information see + systemd.snapshot5. + + Timer units are useful for triggering activation + of other units based on timers. You may find details in + systemd.timer5. + + Swap units are very similar to mount units and + encapsulate memory swap partitions or files of the operating + system. They are described in + systemd.swap5. + + Path units may be used to activate other + services when file system objects change or are modified. See + systemd.path5. + + Slice units may be used to group units which + manage system processes (such as service and scope units) in a + hierarchical tree for resource management purposes. See + systemd.slice5. + + Scope units are similar to service units, but + manage foreign processes instead of starting them as well. See + systemd.scope5. + + + + Units are named as their configuration files. Some units + have special semantics. A detailed list is available in + systemd.special7. + + systemd knows various kinds of dependencies, including + positive and negative requirement dependencies (i.e. + Requires= and Conflicts=) as + well as ordering dependencies (After= and + Before=). NB: ordering and requirement + dependencies are orthogonal. If only a requirement dependency + exists between two units (e.g. foo.service + requires bar.service), but no ordering + dependency (e.g. foo.service after + bar.service) and both are requested to start, + they will be started in parallel. It is a common pattern that both + requirement and ordering dependencies are placed between two + units. Also note that the majority of dependencies are implicitly + created and maintained by systemd. In most cases, it should be + unnecessary to declare additional dependencies manually, however + it is possible to do this. + + Application programs and units (via dependencies) may + request state changes of units. In systemd, these requests are + encapsulated as 'jobs' and maintained in a job queue. Jobs may + succeed or can fail, their execution is ordered based on the + ordering dependencies of the units they have been scheduled + for. + + On boot systemd activates the target unit + default.target whose job is to activate + on-boot services and other on-boot units by pulling them in via + dependencies. Usually the unit name is just an alias (symlink) for + either graphical.target (for fully-featured + boots into the UI) or multi-user.target (for + limited console-only boots for use in embedded or server + environments, or similar; a subset of graphical.target). However, + it is at the discretion of the administrator to configure it as an + alias to any other target unit. See + systemd.special7 + for details about these target units. + + Processes systemd spawns are placed in individual Linux + control groups named after the unit which they belong to in the + private systemd hierarchy. (see cgroups.txt + for more information about control groups, or short "cgroups"). + systemd uses this to effectively keep track of processes. Control + group information is maintained in the kernel, and is accessible + via the file system hierarchy (beneath + /sys/fs/cgroup/systemd/), or in tools such as + ps1 + (ps xawf -eo pid,user,cgroup,args is + particularly useful to list all processes and the systemd units + they belong to.). + + systemd is compatible with the SysV init system to a large + degree: SysV init scripts are supported and simply read as an + alternative (though limited) configuration file format. The SysV + /dev/initctl interface is provided, and + compatibility implementations of the various SysV client tools are + available. In addition to that, various established Unix + functionality such as /etc/fstab or the + utmp database are supported. + + systemd has a minimal transaction system: if a unit is + requested to start up or shut down it will add it and all its + dependencies to a temporary transaction. Then, it will verify if + the transaction is consistent (i.e. whether the ordering of all + units is cycle-free). If it is not, systemd will try to fix it up, + and removes non-essential jobs from the transaction that might + remove the loop. Also, systemd tries to suppress non-essential + jobs in the transaction that would stop a running service. Finally + it is checked whether the jobs of the transaction contradict jobs + that have already been queued, and optionally the transaction is + aborted then. If all worked out and the transaction is consistent + and minimized in its impact it is merged with all already + outstanding jobs and added to the run queue. Effectively this + means that before executing a requested operation, systemd will + verify that it makes sense, fixing it if possible, and only + failing if it really cannot work. + + Systemd contains native implementations of various tasks + that need to be executed as part of the boot process. For example, + it sets the hostname or configures the loopback network device. It + also sets up and mounts various API file systems, such as + /sys or /proc. + + For more information about the concepts and + ideas behind systemd, please refer to the + Original Design Document. + + Note that some but not all interfaces provided + by systemd are covered by the + Interface + Stability Promise. + + Units may be generated dynamically at boot and system + manager reload time, for example based on other configuration + files or parameters passed on the kernel command line. For details + see the + Generators Specification. + + Systems which invoke systemd in a container or initrd + environment should implement the + Container Interface or + initrd Interface + specifications, respectively. + + + + Directories + + + + System unit directories + + The systemd system manager reads unit + configuration from various directories. Packages that want to + install unit files shall place them in the directory returned + by pkg-config systemd + --variable=systemdsystemunitdir. Other directories + checked are /usr/local/lib/systemd/system + and /usr/lib/systemd/system. User + configuration always takes precedence. pkg-config + systemd --variable=systemdsystemconfdir returns the + path of the system configuration directory. Packages should + alter the content of these directories only with the + enable and disable + commands of the + systemctl1 + tool. Full list of directories is provided in + systemd.unit5. + + + + + + + User unit directories + + Similar rules apply for the user unit + directories. However, here the + XDG + Base Directory specification is followed to find + units. Applications should place their unit files in the + directory returned by pkg-config systemd + --variable=systemduserunitdir. Global configuration + is done in the directory reported by pkg-config + systemd --variable=systemduserconfdir. The + enable and disable + commands of the + systemctl1 + tool can handle both global (i.e. for all users) and private + (for one user) enabling/disabling of units. Full list of + directories is provided in + systemd.unit5. + + + + + + + SysV init scripts directory + + The location of the SysV init script directory + varies between distributions. If systemd cannot find a native + unit file for a requested service, it will look for a SysV + init script of the same name (with the + .service suffix + removed). + + + + + + SysV runlevel link farm directory + + The location of the SysV runlevel link farm + directory varies between distributions. systemd will take the + link farm into account when figuring out whether a service + shall be enabled. Note that a service unit with a native unit + configuration file cannot be started by activating it in the + SysV runlevel link farm. + + + + + + Signals + + + + SIGTERM + + Upon receiving this signal the systemd system + manager serializes its state, reexecutes itself and + deserializes the saved state again. This is mostly equivalent + to systemctl daemon-reexec. + + systemd user managers will start the + exit.target unit when this signal is + received. This is mostly equivalent to systemctl + --user start exit.target. + + + + SIGINT + + Upon receiving this signal the systemd system + manager will start the + ctrl-alt-del.target unit. This is mostly + equivalent to systemctl start + ctl-alt-del.target. If this signal is received more + often than 7 times per 2s an immediate reboot is triggered. + Note that pressing Ctrl-Alt-Del on the console will trigger + this signal. Hence, if a reboot is hanging pressing + Ctrl-Alt-Del more than 7 times in 2s is a relatively safe way + to trigger an immediate reboot. + + systemd user managers treat this signal the same way as + SIGTERM. + + + + SIGWINCH + + When this signal is received the systemd + system manager will start the + kbrequest.target unit. This is mostly + equivalent to systemctl start + kbrequest.target. + + This signal is ignored by systemd user + managers. + + + + SIGPWR + + When this signal is received the systemd + manager will start the sigpwr.target + unit. This is mostly equivalent to systemctl start + sigpwr.target. + + + + SIGUSR1 + + When this signal is received the systemd + manager will try to reconnect to the D-Bus + bus. + + + + SIGUSR2 + + When this signal is received the systemd + manager will log its complete state in human readable form. + The data logged is the same as printed by + systemd-analyze dump. + + + + SIGHUP + + Reloads the complete daemon configuration. + This is mostly equivalent to systemctl + daemon-reload. + + + + SIGRTMIN+0 + + Enters default mode, starts the + default.target unit. This is mostly + equivalent to systemctl start + default.target. + + + + SIGRTMIN+1 + + Enters rescue mode, starts the + rescue.target unit. This is mostly + equivalent to systemctl isolate + rescue.target. + + + + SIGRTMIN+2 + + Enters emergency mode, starts the + emergency.service unit. This is mostly + equivalent to systemctl isolate + emergency.service. + + + + SIGRTMIN+3 + + Halts the machine, starts the + halt.target unit. This is mostly + equivalent to systemctl start + halt.target. + + + + SIGRTMIN+4 + + Powers off the machine, starts the + poweroff.target unit. This is mostly + equivalent to systemctl start + poweroff.target. + + + + SIGRTMIN+5 + + Reboots the machine, starts the + reboot.target unit. This is mostly + equivalent to systemctl start + reboot.target. + + + + SIGRTMIN+6 + + Reboots the machine via kexec, starts the + kexec.target unit. This is mostly + equivalent to systemctl start + kexec.target. + + + + SIGRTMIN+13 + + Immediately halts the machine. + + + + SIGRTMIN+14 + + Immediately powers off the machine. + + + + SIGRTMIN+15 + + Immediately reboots the machine. + + + + SIGRTMIN+16 + + Immediately reboots the machine with kexec. + + + + SIGRTMIN+20 + + Enables display of status messages on the + console, as controlled via + systemd.show_status=1 on the kernel command + line. + + + + SIGRTMIN+21 + + Disables display of + status messages on the console, as + controlled via + systemd.show_status=0 + on the kernel command + line. + + + + SIGRTMIN+22 + SIGRTMIN+23 + + Sets the log level to debug + (or info on + SIGRTMIN+23), as controlled via + systemd.log_level=debug (or + systemd.log_level=info on + SIGRTMIN+23) on the kernel command + line. + + + + SIGRTMIN+24 + + Immediately exits the manager (only available + for --user instances). + + + + SIGRTMIN+26 + SIGRTMIN+27 + SIGRTMIN+28 + + Sets the log level to + journal-or-kmsg (or + console on + SIGRTMIN+27, kmsg on + SIGRTMIN+28), as controlled via + systemd.log_target=journal-or-kmsg (or + systemd.log_target=console on + SIGRTMIN+27 or + systemd.log_target=kmsg on + SIGRTMIN+28) on the kernel command + line. + + + + + + Environment + + + + $SYSTEMD_LOG_LEVEL + systemd reads the log level from this + environment variable. This can be overridden with + . + + + + $SYSTEMD_LOG_TARGET + systemd reads the log target from this + environment variable. This can be overridden with + . + + + + $SYSTEMD_LOG_COLOR + Controls whether systemd highlights important + log messages. This can be overridden with + . + + + + $SYSTEMD_LOG_LOCATION + Controls whether systemd prints the code + location along with log messages. This can be overridden with + . + + + + $XDG_CONFIG_HOME + $XDG_CONFIG_DIRS + $XDG_DATA_HOME + $XDG_DATA_DIRS + + The systemd user manager uses these variables + in accordance to the XDG + Base Directory specification to find its + configuration. + + + + $SYSTEMD_UNIT_PATH + + Controls where systemd looks for unit + files. + + + + $SYSTEMD_SYSVINIT_PATH + + Controls where systemd looks for SysV init + scripts. + + + + $SYSTEMD_SYSVRCND_PATH + + Controls where systemd looks for SysV init + script runlevel link farms. + + + + $LISTEN_PID + $LISTEN_FDS + + Set by systemd for supervised processes during + socket-based activation. See + sd_listen_fds3 + for more information. + + + + $NOTIFY_SOCKET + + Set by systemd for supervised processes for + status and start-up completion notification. See + sd_notify3 + for more information. + + + + + + Kernel Command Line + + When run as system instance systemd parses a number of + kernel command line argumentsIf run inside a Linux + container these arguments may be passed as command line arguments + to systemd itself, next to any of the command line options listed + in the Options section above. If run outside of Linux containers, + these arguments are parsed from /proc/cmdline + instead.: + + + + systemd.unit= + rd.systemd.unit= + + Overrides the unit to activate on boot. + Defaults to default.target. This may be + used to temporarily boot into a different boot unit, for + example rescue.target or + emergency.service. See + systemd.special7 + for details about these units. The option prefixed with + rd. is honored only in the initial RAM disk + (initrd), while the one that is not prefixed only in the main + system. + + + + systemd.dump_core= + + Takes a boolean argument. If + , systemd dumps core when it crashes. + Otherwise, no core dump is created. Defaults to + . + + + + systemd.crash_shell= + + Takes a boolean argument. If + , systemd spawns a shell when it crashes. + Otherwise, no shell is spawned. Defaults to + , for security reasons, as the shell is + not protected by any password + authentication. + + + + systemd.crash_chvt= + + Takes an integer argument. If positive systemd + activates the specified virtual terminal when it crashes. + Defaults to -1. + + + + systemd.confirm_spawn= + + Takes a boolean argument. If + , asks for confirmation when spawning + processes. Defaults to + . + + + + systemd.show_status= + + Takes a boolean argument or the constant + auto. If , shows + terse service status updates on the console during bootup. + auto behaves like + until a service fails or there is a significant delay in boot. + Defaults to , unless + is passed as kernel command line option + in which case it defaults to + auto. + + + + systemd.log_target= + systemd.log_level= + systemd.log_color= + systemd.log_location= + + Controls log output, with the same effect as + the $SYSTEMD_LOG_TARGET, + $SYSTEMD_LOG_LEVEL, + $SYSTEMD_LOG_COLOR, + $SYSTEMD_LOG_LOCATION environment variables + described above. + + + + systemd.default_standard_output= + systemd.default_standard_error= + Controls default standard output and error + output for services, with the same effect as the + and + command line + arguments described above, respectively. + + + + systemd.setenv= + + Takes a string argument in the form + VARIABLE=VALUE. May be used to set default environment + variables to add to forked child processes. May be used more + than once to set multiple variables. + + + + quiet + + Turn off status output at boot, much like + systemd.show_status=false would. Note that + this option is also read by the kernel itself and disables + kernel log output. Passing this option hence turns off the + usual output from both the system manager and the kernel. + + + + + debug + + Turn on debugging output. This is equivalent + to systemd.log_level=debug. Note that this + option is also read by the kernel itself and enables kernel + debug output. Passing this option hence turns on the debug + output from both the system manager and the + kernel. + + + + emergency + -b + + Boot into emergency mode. This is equivalent + to systemd.unit=emergency.target and + provided for compatibility reasons and to be easier to + type. + + + + rescue + single + s + S + 1 + + Boot into rescue mode. This is equivalent to + systemd.unit=rescue.target and provided for + compatibility reasons and to be easier to + type. + + + + 2 + 3 + 4 + 5 + + Boot into the specified legacy SysV runlevel. + These are equivalent to + systemd.unit=runlevel2.target, + systemd.unit=runlevel3.target, + systemd.unit=runlevel4.target, and + systemd.unit=runlevel5.target, + respectively, and provided for compatibility reasons and to be + easier to type. + + + + locale.LANG= + locale.LANGUAGE= + locale.LC_CTYPE= + locale.LC_NUMERIC= + locale.LC_TIME= + locale.LC_COLLATE= + locale.LC_MONETARY= + locale.LC_MESSAGES= + locale.LC_PAPER= + locale.LC_NAME= + locale.LC_ADDRESS= + locale.LC_TELEPHONE= + locale.LC_MEASUREMENT= + locale.LC_IDENTIFICATION= + + Set the system locale to use. This overrides + the settings in /etc/locale.conf. For + more information see + locale.conf5 + and + locale7. + + + + + For other kernel command line parameters understood by + components of the core OS, please refer to + kernel-command-line7. + + + + Sockets and FIFOs + + + + /run/systemd/notify + + Daemon status notification socket. This is an + AF_UNIX datagram socket and is used to + implement the daemon notification logic as implemented by + sd_notify3. + + + + + /run/systemd/shutdownd + + Used internally by the + shutdown8 + tool to implement delayed shutdowns. This is an + AF_UNIX datagram + socket. + + + + /run/systemd/private + + Used internally as communication channel + between + systemctl1 + and the systemd process. This is an + AF_UNIX stream socket. This interface is + private to systemd and should not be used in external + projects. + + + + /dev/initctl + + Limited compatibility support for the SysV + client interface, as implemented by the + systemd-initctl.service unit. This is a + named pipe in the file system. This interface is obsolete and + should not be used in new applications. + + + + + + See Also + + The systemd Homepage, + systemd-system.conf5, + locale.conf5, + systemctl1, + journalctl1, + systemd-notify1, + daemon7, + sd-daemon3, + systemd.unit5, + systemd.special5, + pkg-config1, + kernel-command-line7, + bootup7, + systemd.directives7 + + diff --git a/man/sysusers.d.5 b/man/sysusers.d.5 index b08ac5fc4..35bd8840b 100644 --- a/man/sysusers.d.5 +++ b/man/sysusers.d.5 @@ -1,5 +1,5 @@ '\" t -.TH "SYSUSERS\&.D" "5" "" "systemd 218" "sysusers.d" +.TH "SYSUSERS\&.D" "5" "" "systemd 219" "sysusers.d" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/sysusers.d.html b/man/sysusers.d.html index c4ba4c3d9..8d3c53a22 100644 --- a/man/sysusers.d.html +++ b/man/sysusers.d.html @@ -19,115 +19,75 @@ Directives · Python · libudev · - gudev systemd 218

Name

sysusers.d — Declarative allocation of system users and groups

Synopsis

/usr/lib/sysusers.d/*.conf

Description¶

systemd-sysusers uses the - files from sysusers.d directory - to create system users and groups at package - installation or boot time. This tool may be used to - allocate system users and groups only, it is not - useful for creating non-system users and groups, as it - accesses /etc/passwd and - /etc/group directly, bypassing - any more complex user databases, for example any - database involving NIS or LDAP.

Configuration Format¶

Each configuration file shall be named in the - style of - package.conf - or - package-part.conf. - The second variant should be used when it is desirable - to make it easy to override just this part of - configuration.

The file format is one line per user or group - containing name, ID, GECOS field description and home directory:

# Type Name ID GECOS
+  gudev systemd 219

Name

sysusers.d — Declarative allocation of system users and groups

Synopsis

/usr/lib/sysusers.d/*.conf

Description¶

systemd-sysusers uses the files from + sysusers.d directory to create system users + and groups at package installation or boot time. This tool may be + used to allocate system users and groups only, it is not useful + for creating non-system users and groups, as it accesses + /etc/passwd and + /etc/group directly, bypassing any more + complex user databases, for example any database involving NIS or + LDAP.

Configuration Format¶

Each configuration file shall be named in the style of + package.conf or + package-part.conf. + The second variant should be used when it is desirable to make it + easy to override just this part of configuration.

The file format is one line per user or group containing + name, ID, GECOS field description and home directory:

# Type Name ID GECOS
 u httpd 440 "HTTP User"
 u authd /usr/bin/authd "Authorization user"
 g input - -
 m authd input
-u root 0 "Superuser" /root

Type¶

The type consists of a single - letter. The following line types are - understood:

u¶

Create a - system user and group of the - specified name should they not - exist yet. The user's primary - group will be set to the group - bearing the same name. The - user's shell will be set to - /sbin/nologin, - the home directory to the - specified home directory, or - / if none - is given. The account will be - created disabled, so that - logins are not - allowed.

g¶

Create a - system group of the specified - name should it not exist - yet. Note that - u - implicitly create a matching - group. The group will be - created with no password - set.

m¶

Add a user to - a group. If the user or group - are not existing yet, they - will be implicitly - created.

r¶

Add a range of - numeric UIDs/GIDs to the pool - to allocate new UIDs and GIDs - from. If no line of this type - is specified the range of - UIDs/GIDs is set to some - compiled-in default. Note that - both UIDs and GIDs are - allocated from the same pool, - in order to ensure that users - and groups of the same name - are likely to carry the same - numeric UID and - GID.

Name¶

The name field specifies the user or - group name. It should be shorter than 31 - characters and avoid any non-ASCII characters, - and not begin with a numeric character. It is - strongly recommended to pick user and group - names that are unlikely to clash with normal - users created by the administrator. A good - scheme to guarantee this is by prefixing all - system and group names with the underscore, - and avoiding too generic names.

For m lines this - field should contain the user name to add to a - group.

For lines of type r - this field should be set to - "-".

ID¶

For u and - g the numeric 32bit UID or - GID of the user/group. Do not use IDs 65535 or - 4294967295, as they have special placeholder - meanings. Specify "-" for - automatic UID/GID allocation for the user or - group. Alternatively, specify an absolute path - in the file system. In this case the UID/GID - is read from the path's owner/group. This is - useful to create users whose UID/GID match the - owners of pre-existing files (such as SUID or - SGID binaries).

For m lines this - field should contain the group name to add to - a user to.

For lines of type r - this field should be set to a UID/GID range in - the format "FROM-TO" where - both values are formatted as decimal ASCII - numbers. Alternatively, a single UID/GID may - be specified formatted as decimal ASCII - numbers.

GECOS¶

A short, descriptive string for users to - be created, enclosed in quotation marks. Note - that this field may not contain colons.

Only applies to lines of type - u and should otherwise be - left unset, or be set to - "-".

Home Directory¶

The home directory for a new system - user. If omitted defaults to the root - directory. It is recommended to not - unnecessarily specify home directories for - system users, unless software strictly - requires one to be set.

Only applies to lines of type - u and should otherwise be - left unset, or be set to - "-".

Configuration Directories and Precedence

Configuration files are read from directories in +u root 0 "Superuser" /root

Type¶

The type consists of a single letter. The following line + types are understood:

u¶

Create a system user and group of the + specified name should they not exist yet. The user's primary + group will be set to the group bearing the same name. The + user's shell will be set to + /sbin/nologin, the home directory to + the specified home directory, or / if + none is given. The account will be created disabled, so that + logins are not allowed.

g¶

Create a system group of the specified name + should it not exist yet. Note that u + implicitly create a matching group. The group will be + created with no password set.

m¶

Add a user to a group. If the user or group + are not existing yet, they will be implicitly + created.

r¶

Add a range of numeric UIDs/GIDs to the pool + to allocate new UIDs and GIDs from. If no line of this type + is specified the range of UIDs/GIDs is set to some + compiled-in default. Note that both UIDs and GIDs are + allocated from the same pool, in order to ensure that users + and groups of the same name are likely to carry the same + numeric UID and GID.

Name¶

The name field specifies the user or group name. It should + be shorter than 31 characters and avoid any non-ASCII + characters, and not begin with a numeric character. It is + strongly recommended to pick user and group names that are + unlikely to clash with normal users created by the + administrator. A good scheme to guarantee this is by prefixing + all system and group names with the underscore, and avoiding too + generic names.

For m lines this field should contain + the user name to add to a group.

For lines of type r this field should + be set to "-".

ID¶

For u and g the + numeric 32bit UID or GID of the user/group. Do not use IDs 65535 + or 4294967295, as they have special placeholder meanings. + Specify "-" for automatic UID/GID allocation + for the user or group. Alternatively, specify an absolute path + in the file system. In this case the UID/GID is read from the + path's owner/group. This is useful to create users whose UID/GID + match the owners of pre-existing files (such as SUID or SGID + binaries).

For m lines this field should contain + the group name to add to a user to.

For lines of type r this field should + be set to a UID/GID range in the format + "FROM-TO" where both values are formatted as + decimal ASCII numbers. Alternatively, a single UID/GID may be + specified formatted as decimal ASCII numbers.

GECOS¶

A short, descriptive string for users to be created, + enclosed in quotation marks. Note that this field may not + contain colons.

Only applies to lines of type u and + should otherwise be left unset, or be set to + "-".

Home Directory¶

The home directory for a new system user. If omitted + defaults to the root directory. It is recommended to not + unnecessarily specify home directories for system users, unless + software strictly requires one to be set.

Only applies to lines of type u and + should otherwise be left unset, or be set to + "-".

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -147,12 +107,11 @@ u root 0 "Superuser" /root

Idempotence¶

Note that systemd-sysusers - will do nothing if the specified users or groups - already exist, so normally there no reason to override - sysusers.d vendor configuration, - except to block certain users or groups from being - created.

+ configuration file.

Idempotence¶

Note that systemd-sysusers will do + nothing if the specified users or groups already exist, so + normally there no reason to override + sysusers.d vendor configuration, except to + block certain users or groups from being created.

diff --git a/man/sysusers.d.xml b/man/sysusers.d.xml index ac2db9885..99aa07a1c 100644 --- a/man/sysusers.d.xml +++ b/man/sysusers.d.xml @@ -20,245 +20,204 @@ along with systemd; If not, see . --> - - - sysusers.d - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - sysusers.d - 5 - - - - sysusers.d - Declarative allocation of system users and groups - - - - /usr/lib/sysusers.d/*.conf - - - - Description - - systemd-sysusers uses the - files from sysusers.d directory - to create system users and groups at package - installation or boot time. This tool may be used to - allocate system users and groups only, it is not - useful for creating non-system users and groups, as it - accesses /etc/passwd and - /etc/group directly, bypassing - any more complex user databases, for example any - database involving NIS or LDAP. - - - - Configuration Format - - Each configuration file shall be named in the - style of - package.conf - or - package-part.conf. - The second variant should be used when it is desirable - to make it easy to override just this part of - configuration. - - The file format is one line per user or group - containing name, ID, GECOS field description and home directory: - - # Type Name ID GECOS + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + sysusers.d + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sysusers.d + 5 + + + + sysusers.d + Declarative allocation of system users and groups + + + + /usr/lib/sysusers.d/*.conf + + + + Description + + systemd-sysusers uses the files from + sysusers.d directory to create system users + and groups at package installation or boot time. This tool may be + used to allocate system users and groups only, it is not useful + for creating non-system users and groups, as it accesses + /etc/passwd and + /etc/group directly, bypassing any more + complex user databases, for example any database involving NIS or + LDAP. + + + + Configuration Format + + Each configuration file shall be named in the style of + package.conf or + package-part.conf. + The second variant should be used when it is desirable to make it + easy to override just this part of configuration. + + The file format is one line per user or group containing + name, ID, GECOS field description and home directory: + + # Type Name ID GECOS u httpd 440 "HTTP User" u authd /usr/bin/authd "Authorization user" g input - - m authd input u root 0 "Superuser" /root - - Type - - The type consists of a single - letter. The following line types are - understood: - - - - u - Create a - system user and group of the - specified name should they not - exist yet. The user's primary - group will be set to the group - bearing the same name. The - user's shell will be set to - /sbin/nologin, - the home directory to the - specified home directory, or - / if none - is given. The account will be - created disabled, so that - logins are not - allowed. - - - - g - Create a - system group of the specified - name should it not exist - yet. Note that - u - implicitly create a matching - group. The group will be - created with no password - set. - - - - m - Add a user to - a group. If the user or group - are not existing yet, they - will be implicitly - created. - - - - r - Add a range of - numeric UIDs/GIDs to the pool - to allocate new UIDs and GIDs - from. If no line of this type - is specified the range of - UIDs/GIDs is set to some - compiled-in default. Note that - both UIDs and GIDs are - allocated from the same pool, - in order to ensure that users - and groups of the same name - are likely to carry the same - numeric UID and - GID. - - - - - - - Name - - The name field specifies the user or - group name. It should be shorter than 31 - characters and avoid any non-ASCII characters, - and not begin with a numeric character. It is - strongly recommended to pick user and group - names that are unlikely to clash with normal - users created by the administrator. A good - scheme to guarantee this is by prefixing all - system and group names with the underscore, - and avoiding too generic names. - - For m lines this - field should contain the user name to add to a - group. - - For lines of type r - this field should be set to - -. - - - - ID - - For u and - g the numeric 32bit UID or - GID of the user/group. Do not use IDs 65535 or - 4294967295, as they have special placeholder - meanings. Specify - for - automatic UID/GID allocation for the user or - group. Alternatively, specify an absolute path - in the file system. In this case the UID/GID - is read from the path's owner/group. This is - useful to create users whose UID/GID match the - owners of pre-existing files (such as SUID or - SGID binaries). - - For m lines this - field should contain the group name to add to - a user to. - - For lines of type r - this field should be set to a UID/GID range in - the format FROM-TO where - both values are formatted as decimal ASCII - numbers. Alternatively, a single UID/GID may - be specified formatted as decimal ASCII - numbers. - - - - GECOS - - A short, descriptive string for users to - be created, enclosed in quotation marks. Note - that this field may not contain colons. - - Only applies to lines of type - u and should otherwise be - left unset, or be set to - -. - - - - Home Directory - - The home directory for a new system - user. If omitted defaults to the root - directory. It is recommended to not - unnecessarily specify home directories for - system users, unless software strictly - requires one to be set. - - Only applies to lines of type - u and should otherwise be - left unset, or be set to - -. - - - - - - - - Idempotence - - Note that systemd-sysusers - will do nothing if the specified users or groups - already exist, so normally there no reason to override - sysusers.d vendor configuration, - except to block certain users or groups from being - created. - - - - See Also - - systemd1, - systemd-sysusers8 - - + + Type + + The type consists of a single letter. The following line + types are understood: + + + + u + Create a system user and group of the + specified name should they not exist yet. The user's primary + group will be set to the group bearing the same name. The + user's shell will be set to + /sbin/nologin, the home directory to + the specified home directory, or / if + none is given. The account will be created disabled, so that + logins are not allowed. + + + + g + Create a system group of the specified name + should it not exist yet. Note that u + implicitly create a matching group. The group will be + created with no password set. + + + + m + Add a user to a group. If the user or group + are not existing yet, they will be implicitly + created. + + + + r + Add a range of numeric UIDs/GIDs to the pool + to allocate new UIDs and GIDs from. If no line of this type + is specified the range of UIDs/GIDs is set to some + compiled-in default. Note that both UIDs and GIDs are + allocated from the same pool, in order to ensure that users + and groups of the same name are likely to carry the same + numeric UID and GID. + + + + + + + Name + + The name field specifies the user or group name. It should + be shorter than 31 characters and avoid any non-ASCII + characters, and not begin with a numeric character. It is + strongly recommended to pick user and group names that are + unlikely to clash with normal users created by the + administrator. A good scheme to guarantee this is by prefixing + all system and group names with the underscore, and avoiding too + generic names. + + For m lines this field should contain + the user name to add to a group. + + For lines of type r this field should + be set to -. + + + + ID + + For u and g the + numeric 32bit UID or GID of the user/group. Do not use IDs 65535 + or 4294967295, as they have special placeholder meanings. + Specify - for automatic UID/GID allocation + for the user or group. Alternatively, specify an absolute path + in the file system. In this case the UID/GID is read from the + path's owner/group. This is useful to create users whose UID/GID + match the owners of pre-existing files (such as SUID or SGID + binaries). + + For m lines this field should contain + the group name to add to a user to. + + For lines of type r this field should + be set to a UID/GID range in the format + FROM-TO where both values are formatted as + decimal ASCII numbers. Alternatively, a single UID/GID may be + specified formatted as decimal ASCII numbers. + + + + GECOS + + A short, descriptive string for users to be created, + enclosed in quotation marks. Note that this field may not + contain colons. + + Only applies to lines of type u and + should otherwise be left unset, or be set to + -. + + + + Home Directory + + The home directory for a new system user. If omitted + defaults to the root directory. It is recommended to not + unnecessarily specify home directories for system users, unless + software strictly requires one to be set. + + Only applies to lines of type u and + should otherwise be left unset, or be set to + -. + + + + + + + + Idempotence + + Note that systemd-sysusers will do + nothing if the specified users or groups already exist, so + normally there no reason to override + sysusers.d vendor configuration, except to + block certain users or groups from being created. + + + + See Also + + systemd1, + systemd-sysusers8 + + diff --git a/man/telinit.8 b/man/telinit.8 index 8059c7419..9f15d92a9 100644 --- a/man/telinit.8 +++ b/man/telinit.8 @@ -1,5 +1,5 @@ '\" t -.TH "TELINIT" "8" "" "systemd 218" "telinit" +.TH "TELINIT" "8" "" "systemd 219" "telinit" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/telinit.html b/man/telinit.html index 8c50ce6af..254af3ff6 100644 --- a/man/telinit.html +++ b/man/telinit.html @@ -19,51 +19,35 @@ Directives · Python · libudev · - gudev systemd 218

Name

telinit — Change SysV runlevel

Synopsis

telinit [OPTIONS...] {COMMAND}

Description¶

telinit may be used to change - the SysV system runlevel. Since the concept of SysV - runlevels is obsolete the runlevel requests - will be transparently translated into systemd unit - activation requests.

Options¶

The following options are understood:

--help¶

Print a short help text and exit. -

--no-wall¶

Do not send wall - message before - reboot/halt/power-off.

The following commands are understood:

0¶

Power-off the - machine. This is translated into an - activation request for - poweroff.target - and is equivalent to - systemctl - poweroff.

6¶

Reboot the - machine. This is translated into an - activation request for - reboot.target and - is equivalent to systemctl - reboot.

2, 3, 4, 5¶

Change the SysV - runlevel. This is translated into an - activation request for - runlevel2.target, - runlevel3.target, - ... and is equivalent to - systemctl isolate - runlevel2.target, - systemctl isolate - runlevel3.target, - ...

1, s, S¶

Change into system - rescue mode. This is translated into - an activation request for - rescue.target and - is equivalent to systemctl - rescue.

q, Q¶

Reload daemon - configuration. This is equivalent to - systemctl - daemon-reload.

u, U¶

Serialize state, - reexecute daemon and deserialize state - again. This is equivalent to - systemctl - daemon-reexec.

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Notes¶

This is a legacy command available for compatibility - only. It should not be used anymore, as the concept of - runlevels is obsolete.

See Also¶

- systemd(1), - systemctl(1), - wall(1) -

+ gudev systemd 219

Name

telinit — Change SysV runlevel

Synopsis

telinit [OPTIONS...] {COMMAND}

Description¶

telinit may be used to change the SysV + system runlevel. Since the concept of SysV runlevels is obsolete + the runlevel requests will be transparently translated into + systemd unit activation requests.

Options¶

The following options are understood:

--help¶

Print a short help text and exit. +

--no-wall¶

Do not send wall message before + reboot/halt/power-off.

The following commands are understood:

0¶

Power-off the machine. This is translated into + an activation request for poweroff.target + and is equivalent to systemctl + poweroff.

6¶

Reboot the machine. This is translated into an + activation request for reboot.target and + is equivalent to systemctl + reboot.

2, 3, 4, 5¶

Change the SysV runlevel. This is translated + into an activation request for + runlevel2.target, + runlevel3.target, ... and is equivalent + to systemctl isolate runlevel2.target, + systemctl isolate runlevel3.target, + ...

1, s, S¶

Change into system rescue mode. This is + translated into an activation request for + rescue.target and is equivalent to + systemctl rescue.

q, Q¶

Reload daemon configuration. This is + equivalent to systemctl + daemon-reload.

u, U¶

Serialize state, reexecute daemon and + deserialize state again. This is equivalent to + systemctl daemon-reexec.

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

Notes¶

This is a legacy command available for compatibility only. + It should not be used anymore, as the concept of runlevels is + obsolete.

See Also¶

+ systemd(1), + systemctl(1), + wall(1) +

diff --git a/man/telinit.xml b/man/telinit.xml index 33ea118bc..02d31fbd4 100644 --- a/man/telinit.xml +++ b/man/telinit.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - telinit - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - telinit - 8 - - - - telinit - Change SysV runlevel - - - - - telinit OPTIONS COMMAND - - - - - Description - - telinit may be used to change - the SysV system runlevel. Since the concept of SysV - runlevels is obsolete the runlevel requests - will be transparently translated into systemd unit - activation requests. - - - - - Options - - The following options are understood: - - - - - - - - - - - - Do not send wall - message before - reboot/halt/power-off. - - - - The following commands are understood: - - - - 0 - - Power-off the - machine. This is translated into an - activation request for - poweroff.target - and is equivalent to - systemctl - poweroff. - - - - 6 - - Reboot the - machine. This is translated into an - activation request for - reboot.target and - is equivalent to systemctl - reboot. - - - - 2 - 3 - 4 - 5 - - Change the SysV - runlevel. This is translated into an - activation request for - runlevel2.target, - runlevel3.target, - ... and is equivalent to - systemctl isolate - runlevel2.target, - systemctl isolate - runlevel3.target, - ... - - - - 1 - s - S - - Change into system - rescue mode. This is translated into - an activation request for - rescue.target and - is equivalent to systemctl - rescue. - - - - q - Q - - Reload daemon - configuration. This is equivalent to - systemctl - daemon-reload. - - - - u - U - - Serialize state, - reexecute daemon and deserialize state - again. This is equivalent to - systemctl - daemon-reexec. - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - Notes - - This is a legacy command available for compatibility - only. It should not be used anymore, as the concept of - runlevels is obsolete. - - - - See Also - - systemd1, - systemctl1, - wall1 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + telinit + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + telinit + 8 + + + + telinit + Change SysV runlevel + + + + + telinit OPTIONS COMMAND + + + + + Description + + telinit may be used to change the SysV + system runlevel. Since the concept of SysV runlevels is obsolete + the runlevel requests will be transparently translated into + systemd unit activation requests. + + + + + Options + + The following options are understood: + + + + + + + + + + + + Do not send wall message before + reboot/halt/power-off. + + + + The following commands are understood: + + + + 0 + + Power-off the machine. This is translated into + an activation request for poweroff.target + and is equivalent to systemctl + poweroff. + + + + 6 + + Reboot the machine. This is translated into an + activation request for reboot.target and + is equivalent to systemctl + reboot. + + + + 2 + 3 + 4 + 5 + + Change the SysV runlevel. This is translated + into an activation request for + runlevel2.target, + runlevel3.target, ... and is equivalent + to systemctl isolate runlevel2.target, + systemctl isolate runlevel3.target, + ... + + + + 1 + s + S + + Change into system rescue mode. This is + translated into an activation request for + rescue.target and is equivalent to + systemctl rescue. + + + + q + Q + + Reload daemon configuration. This is + equivalent to systemctl + daemon-reload. + + + + u + U + + Serialize state, reexecute daemon and + deserialize state again. This is equivalent to + systemctl daemon-reexec. + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure + code otherwise. + + + + Notes + + This is a legacy command available for compatibility only. + It should not be used anymore, as the concept of runlevels is + obsolete. + + + + See Also + + systemd1, + systemctl1, + wall1 + + diff --git a/man/timedatectl.1 b/man/timedatectl.1 index c66be3155..39279017c 100644 --- a/man/timedatectl.1 +++ b/man/timedatectl.1 @@ -1,5 +1,5 @@ '\" t -.TH "TIMEDATECTL" "1" "" "systemd 218" "timedatectl" +.TH "TIMEDATECTL" "1" "" "systemd 219" "timedatectl" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -152,20 +152,20 @@ Show current settings: $ timedatectl Local time: Fri, 2012\-11\-02 09:26:46 CET Universal time: Fri, 2012\-11\-02 08:26:46 UTC - RTC time: Fri, 2012\-11\-02 08:26:45 - Timezone: Europe/Warsaw + RTC time: Fri, 2012\-11\-02 08:26:45 + Timezone: Europe/Warsaw UTC offset: +0100 NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: CEST → CET, DST became inactive - Sun, 2012\-10\-28 02:59:59 CEST - Sun, 2012\-10\-28 02:00:00 CET + Sun, 2012\-10\-28 02:59:59 CEST + Sun, 2012\-10\-28 02:00:00 CET Next DST change: CET → CEST, DST will become active - the clock will jump one hour forward - Sun, 2013\-03\-31 01:59:59 CET - Sun, 2013\-03\-31 03:00:00 CEST + the clock will jump one hour forward + Sun, 2013\-03\-31 01:59:59 CET + Sun, 2013\-03\-31 03:00:00 CEST .fi .if n \{\ .RE @@ -194,8 +194,8 @@ Password: ******** .nf $ systemctl status chronyd\&.service chronyd\&.service \- NTP client/server - Loaded: loaded (/usr/lib/systemd/system/chronyd\&.service; enabled) - Active: active (running) since Fri, 2012\-11\-02 09:36:25 CET; 5s ago + Loaded: loaded (/usr/lib/systemd/system/chronyd\&.service; enabled) + Active: active (running) since Fri, 2012\-11\-02 09:36:25 CET; 5s ago \&.\&.\&. .fi .if n \{\ diff --git a/man/timedatectl.html b/man/timedatectl.html index 7ae0d6cf7..1f99a560c 100644 --- a/man/timedatectl.html +++ b/man/timedatectl.html @@ -19,21 +19,16 @@ Directives · Python · libudev · - gudev systemd 218

Name

timedatectl — Control the system time and date

Synopsis

timedatectl [OPTIONS...] {COMMAND}

Description¶

timedatectl may be used to - query and change the system clock and its - settings.

Use - systemd-firstboot(1) - to initialize the system time zone for mounted (but not - booted) system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user - for authentication for privileged - operations.

--adjust-system-clock¶

If - set-local-rtc is - invoked and this option is passed, the - system clock is synchronized from the - RTC again, taking the new setting into - account. Otherwise, the RTC is - synchronized from the system - clock.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a + gudev systemd 219


Name

timedatectl — Control the system time and date

Synopsis

timedatectl [OPTIONS...] {COMMAND}

Description¶

timedatectl may be used to query and + change the system clock and its settings.

Use + systemd-firstboot(1) + to initialize the system time zone for mounted (but not booted) + system images.

Options¶

The following options are understood:

--no-ask-password¶

Do not query the user for authentication for + privileged operations.

--adjust-system-clock¶

If set-local-rtc is invoked + and this option is passed, the system clock is synchronized + from the RTC again, taking the new setting into account. + Otherwise, the RTC is synchronized from the system + clock.

-H, --host=¶

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which @@ -44,52 +39,36 @@ HOST.

-M, --machine=¶

Execute operation on a local container. Specify a container name to connect to.

-h, --help¶

Print a short help text and exit.

--version¶

Print a short version string and exit.

--no-pager¶

Do not pipe output into a pager.

The following commands are understood:

status¶

Show current settings - of the system clock and - RTC.

set-time [TIME]¶

Set the system clock - to the specified time. This will also - update the RTC time accordingly. The time - may be specified in the format - "2012-10-30 - 18:17:16".

set-timezone [TIMEZONE]¶

Set the system time - zone to the specified value. Available - timezones can be listed with - list-timezones. If - the RTC is configured to be in the - local time, this will also update the - RTC time. This call will alter the - /etc/localtime - symlink. See - localtime(5) - for more - information.

list-timezones¶

List available time - zones, one per line. Entries from the - list can be set as the system - timezone with - set-timezone.

set-local-rtc [BOOL]¶

Takes a boolean - argument. If "0", the - system is configured to maintain the - RTC in universal time. If - "1", it will maintain - the RTC in local time instead. Note - that maintaining the RTC in the local - timezone is not fully supported and - will create various problems with time - zone changes and daylight saving - adjustments. If at all possible, keep the - RTC in UTC mode. Note that invoking this - will also synchronize the RTC from the - system clock, unless - --adjust-system-clock is - passed (see above). This command will - change the 3rd line of - /etc/adjtime, as - documented in - hwclock(8).

set-ntp [BOOL]¶

Takes a boolean - argument. Controls whether NTP based - network time synchronization is - enabled (if - available).

Exit status¶

On success, 0 is returned, a non-zero failure - code otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when + of the system clock and + RTC.

set-time [TIME]¶

Set the system clock to the specified time. + This will also update the RTC time accordingly. The time may + be specified in the format "2012-10-30 + 18:17:16".

set-timezone [TIMEZONE]¶

Set the system time zone to the specified + value. Available timezones can be listed with + list-timezones. If the RTC is configured to + be in the local time, this will also update the RTC time. This + call will alter the /etc/localtime + symlink. See + localtime(5) + for more information.

list-timezones¶

List available time zones, one per line. + Entries from the list can be set as the system timezone with + set-timezone.

set-local-rtc [BOOL]¶

Takes a boolean argument. If + "0", the system is configured to maintain the + RTC in universal time. If "1", it will + maintain the RTC in local time instead. Note that maintaining + the RTC in the local timezone is not fully supported and will + create various problems with time zone changes and daylight + saving adjustments. If at all possible, keep the RTC in UTC + mode. Note that invoking this will also synchronize the RTC + from the system clock, unless + --adjust-system-clock is passed (see above). + This command will change the 3rd line of + /etc/adjtime, as documented in + hwclock(8). +

set-ntp [BOOL]¶

Takes a boolean argument. Controls whether NTP + based network time synchronization is enabled (if + available).

Exit status¶

On success, 0 is returned, a non-zero failure + code otherwise.

Environment¶

$SYSTEMD_PAGER¶

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value @@ -97,43 +76,43 @@ --no-pager.

$SYSTEMD_LESS¶

Override the default options passed to less - ("FRSXMK").

Examples¶

Show current settings: -

$ timedatectl
+                        ("FRSXMK").

Examples¶

Show current settings: +

$ timedatectl
       Local time: Fri, 2012-11-02 09:26:46 CET
   Universal time: Fri, 2012-11-02 08:26:46 UTC
-        RTC time: Fri, 2012-11-02 08:26:45
-        Timezone: Europe/Warsaw
+  RTC time: Fri, 2012-11-02 08:26:45
+  Timezone: Europe/Warsaw
       UTC offset: +0100
      NTP enabled: no
 NTP synchronized: no
  RTC in local TZ: no
       DST active: no
  Last DST change: CEST → CET, DST became inactive
-                  Sun, 2012-10-28 02:59:59 CEST
-                  Sun, 2012-10-28 02:00:00 CET
+      Sun, 2012-10-28 02:59:59 CEST
+      Sun, 2012-10-28 02:00:00 CET
  Next DST change: CET → CEST, DST will become active
-                  the clock will jump one hour forward
-                  Sun, 2013-03-31 01:59:59 CET
-                  Sun, 2013-03-31 03:00:00 CEST

-

Enable an NTP daemon (chronyd): -

$ timedatectl set-ntp true
+      the clock will jump one hour forward
+      Sun, 2013-03-31 01:59:59 CET
+      Sun, 2013-03-31 03:00:00 CEST

+

Enable an NTP daemon (chronyd): +

$ timedatectl set-ntp true
 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
 Authentication is required to control whether network time synchronization shall be enabled.
 Authenticating as: user
 Password: ********
 ==== AUTHENTICATION COMPLETE ===

-

$ systemctl status chronyd.service
+    

$ systemctl status chronyd.service
 chronyd.service - NTP client/server
-          Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
-          Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
+    Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
+    Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
 ...

-

+

diff --git a/man/timedatectl.xml b/man/timedatectl.xml index f3edb8d61..98ec013eb 100644 --- a/man/timedatectl.xml +++ b/man/timedatectl.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - - timedatectl - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - timedatectl - 1 - - - - timedatectl - Control the system time and date - - - - - timedatectl OPTIONS COMMAND - - - - - Description - - timedatectl may be used to - query and change the system clock and its - settings. - - Use - systemd-firstboot1 - to initialize the system time zone for mounted (but not - booted) system images. - - - - Options - - The following options are understood: - - - - - - Do not query the user - for authentication for privileged - operations. - - - - - - If - set-local-rtc is - invoked and this option is passed, the - system clock is synchronized from the - RTC again, taking the new setting into - account. Otherwise, the RTC is - synchronized from the system - clock. - - - - - - - - - - - The following commands are understood: - - - - status - - Show current settings - of the system clock and - RTC. - - - - set-time [TIME] - - Set the system clock - to the specified time. This will also - update the RTC time accordingly. The time - may be specified in the format - "2012-10-30 - 18:17:16". - - - - set-timezone [TIMEZONE] - - Set the system time - zone to the specified value. Available - timezones can be listed with - list-timezones. If - the RTC is configured to be in the - local time, this will also update the - RTC time. This call will alter the - /etc/localtime - symlink. See - localtime5 - for more - information. - - - - list-timezones - - List available time - zones, one per line. Entries from the - list can be set as the system - timezone with - set-timezone. - - - - set-local-rtc [BOOL] - - Takes a boolean - argument. If 0, the - system is configured to maintain the - RTC in universal time. If - 1, it will maintain - the RTC in local time instead. Note - that maintaining the RTC in the local - timezone is not fully supported and - will create various problems with time - zone changes and daylight saving - adjustments. If at all possible, keep the - RTC in UTC mode. Note that invoking this - will also synchronize the RTC from the - system clock, unless - is - passed (see above). This command will - change the 3rd line of - /etc/adjtime, as - documented in - hwclock8. - - - - set-ntp [BOOL] - - Takes a boolean - argument. Controls whether NTP based - network time synchronization is - enabled (if - available). - - - - - - - - Exit status - - On success, 0 is returned, a non-zero failure - code otherwise. - - - - - - Examples - Show current settings: - $ timedatectl + xmlns:xi="http://www.w3.org/2001/XInclude"> + + + timedatectl + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + timedatectl + 1 + + + + timedatectl + Control the system time and date + + + + + timedatectl OPTIONS COMMAND + + + + + Description + + timedatectl may be used to query and + change the system clock and its settings. + + Use + systemd-firstboot1 + to initialize the system time zone for mounted (but not booted) + system images. + + + + Options + + The following options are understood: + + + + + + Do not query the user for authentication for + privileged operations. + + + + + + If set-local-rtc is invoked + and this option is passed, the system clock is synchronized + from the RTC again, taking the new setting into account. + Otherwise, the RTC is synchronized from the system + clock. + + + + + + + + + + + The following commands are understood: + + + + status + + Show current settings + of the system clock and + RTC. + + + + set-time [TIME] + + Set the system clock to the specified time. + This will also update the RTC time accordingly. The time may + be specified in the format "2012-10-30 + 18:17:16". + + + + set-timezone [TIMEZONE] + + Set the system time zone to the specified + value. Available timezones can be listed with + list-timezones. If the RTC is configured to + be in the local time, this will also update the RTC time. This + call will alter the /etc/localtime + symlink. See + localtime5 + for more information. + + + + list-timezones + + List available time zones, one per line. + Entries from the list can be set as the system timezone with + set-timezone. + + + + set-local-rtc [BOOL] + + Takes a boolean argument. If + 0, the system is configured to maintain the + RTC in universal time. If 1, it will + maintain the RTC in local time instead. Note that maintaining + the RTC in the local timezone is not fully supported and will + create various problems with time zone changes and daylight + saving adjustments. If at all possible, keep the RTC in UTC + mode. Note that invoking this will also synchronize the RTC + from the system clock, unless + is passed (see above). + This command will change the 3rd line of + /etc/adjtime, as documented in + hwclock8. + + + + + set-ntp [BOOL] + + Takes a boolean argument. Controls whether NTP + based network time synchronization is enabled (if + available). + + + + + + + + Exit status + + On success, 0 is returned, a non-zero failure + code otherwise. + + + + + + Examples + Show current settings: + $ timedatectl Local time: Fri, 2012-11-02 09:26:46 CET Universal time: Fri, 2012-11-02 08:26:46 UTC - RTC time: Fri, 2012-11-02 08:26:45 - Timezone: Europe/Warsaw + RTC time: Fri, 2012-11-02 08:26:45 + Timezone: Europe/Warsaw UTC offset: +0100 NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: CEST → CET, DST became inactive - Sun, 2012-10-28 02:59:59 CEST - Sun, 2012-10-28 02:00:00 CET + Sun, 2012-10-28 02:59:59 CEST + Sun, 2012-10-28 02:00:00 CET Next DST change: CET → CEST, DST will become active - the clock will jump one hour forward - Sun, 2013-03-31 01:59:59 CET - Sun, 2013-03-31 03:00:00 CEST - + the clock will jump one hour forward + Sun, 2013-03-31 01:59:59 CET + Sun, 2013-03-31 03:00:00 CEST + - Enable an NTP daemon (chronyd): - $ timedatectl set-ntp true + Enable an NTP daemon (chronyd): + $ timedatectl set-ntp true ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp === Authentication is required to control whether network time synchronization shall be enabled. Authenticating as: user Password: ******** ==== AUTHENTICATION COMPLETE === - $ systemctl status chronyd.service + $ systemctl status chronyd.service chronyd.service - NTP client/server - Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled) - Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago + Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled) + Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago ... - - - - - See Also - - systemd1, - hwclock8, - date1, - localtime5, - systemctl1, - systemd-timedated.service8, - systemd-firstboot1 - - + + + + + See Also + + systemd1, + hwclock8, + date1, + localtime5, + systemctl1, + systemd-timedated.service8, + systemd-firstboot1 + + diff --git a/man/timesyncd.conf.5 b/man/timesyncd.conf.5 index 64e11c376..aa06a9e13 100644 --- a/man/timesyncd.conf.5 +++ b/man/timesyncd.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "TIMESYNCD\&.CONF" "5" "" "systemd 218" "timesyncd.conf" +.TH "TIMESYNCD\&.CONF" "5" "" "systemd 219" "timesyncd.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/timesyncd.conf.d.html b/man/timesyncd.conf.d.html index cee630892..48c22f20a 100644 --- a/man/timesyncd.conf.d.html +++ b/man/timesyncd.conf.d.html @@ -19,8 +19,8 @@ Directives · Python · libudev · - gudev systemd 218

Name

timesyncd.conf, timesyncd.conf.d — Network Time Synchronization configuration files

Synopsis

/etc/systemd/timesyncd.conf

/etc/systemd/timesyncd.conf.d/*.conf

/run/systemd/timesyncd.conf.d/*.conf

/usr/lib/systemd/timesyncd.conf.d/*.conf

Description¶

These configuration files control NTP network time - synchronization.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

timesyncd.conf, timesyncd.conf.d — Network Time Synchronization configuration files

Synopsis

/etc/systemd/timesyncd.conf

/etc/systemd/timesyncd.conf.d/*.conf

/run/systemd/timesyncd.conf.d/*.conf

/usr/lib/systemd/timesyncd.conf.d/*.conf

Description¶

These configuration files control NTP network time + synchronization.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -44,31 +44,23 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

NTP=¶

A space separated list - of NTP servers host names or IP - addresses. During runtime this list is - combined with any per-interface NTP - servers acquired from - systemd-networkd.service(8). systemd-timesyncd - will contact all configured system or - per-interface servers in turn until - one is found that responds. This - setting defaults to the empty - list.

FallbackNTP=¶

A space separated list - of NTP server host names or IP - addresses to be used as the fallback - NTP servers. Any per-interface NTP - servers obtained from - systemd-networkd.service(8) - take precedence over this setting, as - do any servers set via - NTP= above. This - setting is hence only used if no other - NTP server information is known. If - this option is not given, a - compiled-in list of NTP servers is - used instead.

+ file.

Options¶

NTP=¶

A space separated list of NTP servers host + names or IP addresses. During runtime this list is combined + with any per-interface NTP servers acquired from + systemd-networkd.service(8). + systemd-timesyncd will contact all configured system or + per-interface servers in turn until one is found that + responds. This setting defaults to the empty + list.

FallbackNTP=¶

A space separated list of NTP server host + names or IP addresses to be used as the fallback NTP servers. + Any per-interface NTP servers obtained from + systemd-networkd.service(8) + take precedence over this setting, as do any servers set via + NTP= above. This setting is hence only used + if no other NTP server information is known. If this option is + not given, a compiled-in list of NTP servers is used + instead.

diff --git a/man/timesyncd.conf.html b/man/timesyncd.conf.html index cee630892..48c22f20a 100644 --- a/man/timesyncd.conf.html +++ b/man/timesyncd.conf.html @@ -19,8 +19,8 @@ Directives · Python · libudev · - gudev systemd 218

Name

timesyncd.conf, timesyncd.conf.d — Network Time Synchronization configuration files

Synopsis

/etc/systemd/timesyncd.conf

/etc/systemd/timesyncd.conf.d/*.conf

/run/systemd/timesyncd.conf.d/*.conf

/usr/lib/systemd/timesyncd.conf.d/*.conf

Description¶

These configuration files control NTP network time - synchronization.

Configuration Directories and Precedence

Configuration files are read from directories in + gudev systemd 219


Name

timesyncd.conf, timesyncd.conf.d — Network Time Synchronization configuration files

Synopsis

/etc/systemd/timesyncd.conf

/etc/systemd/timesyncd.conf.d/*.conf

/run/systemd/timesyncd.conf.d/*.conf

/usr/lib/systemd/timesyncd.conf.d/*.conf

Description¶

These configuration files control NTP network time + synchronization.

Configuration Directories and Precedence

Configuration files are read from directories in /etc/, /run/, and /usr/lib/, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -44,31 +44,23 @@ /etc/. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.

Options¶

NTP=¶

A space separated list - of NTP servers host names or IP - addresses. During runtime this list is - combined with any per-interface NTP - servers acquired from - systemd-networkd.service(8). systemd-timesyncd - will contact all configured system or - per-interface servers in turn until - one is found that responds. This - setting defaults to the empty - list.

FallbackNTP=¶

A space separated list - of NTP server host names or IP - addresses to be used as the fallback - NTP servers. Any per-interface NTP - servers obtained from - systemd-networkd.service(8) - take precedence over this setting, as - do any servers set via - NTP= above. This - setting is hence only used if no other - NTP server information is known. If - this option is not given, a - compiled-in list of NTP servers is - used instead.

+ file.

Options¶

NTP=¶

A space separated list of NTP servers host + names or IP addresses. During runtime this list is combined + with any per-interface NTP servers acquired from + systemd-networkd.service(8). + systemd-timesyncd will contact all configured system or + per-interface servers in turn until one is found that + responds. This setting defaults to the empty + list.

FallbackNTP=¶

A space separated list of NTP server host + names or IP addresses to be used as the fallback NTP servers. + Any per-interface NTP servers obtained from + systemd-networkd.service(8) + take precedence over this setting, as do any servers set via + NTP= above. This setting is hence only used + if no other NTP server information is known. If this option is + not given, a compiled-in list of NTP servers is used + instead.

diff --git a/man/timesyncd.conf.xml b/man/timesyncd.conf.xml index 1a56c2c5c..1127970a1 100644 --- a/man/timesyncd.conf.xml +++ b/man/timesyncd.conf.xml @@ -1,7 +1,6 @@ - + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - - timesyncd.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - timesyncd.conf - 5 - - - - timesyncd.conf - timesyncd.conf.d - Network Time Synchronization configuration files - - - - /etc/systemd/timesyncd.conf - /etc/systemd/timesyncd.conf.d/*.conf - /run/systemd/timesyncd.conf.d/*.conf - /usr/lib/systemd/timesyncd.conf.d/*.conf - - - - Description - - These configuration files control NTP network time - synchronization. - - - - - - - - Options - - - - - NTP= - A space separated list - of NTP servers host names or IP - addresses. During runtime this list is - combined with any per-interface NTP - servers acquired from - systemd-networkd.service8. systemd-timesyncd - will contact all configured system or - per-interface servers in turn until - one is found that responds. This - setting defaults to the empty - list. - - - - FallbackNTP= - A space separated list - of NTP server host names or IP - addresses to be used as the fallback - NTP servers. Any per-interface NTP - servers obtained from - systemd-networkd.service8 - take precedence over this setting, as - do any servers set via - NTP= above. This - setting is hence only used if no other - NTP server information is known. If - this option is not given, a - compiled-in list of NTP servers is - used instead. - - - - - - - See Also - - systemd1, - systemd-timesyncd.service8, - systemd-networkd.service8 - - + xmlns:xi="http://www.w3.org/2001/XInclude"> + + timesyncd.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + timesyncd.conf + 5 + + + + timesyncd.conf + timesyncd.conf.d + Network Time Synchronization configuration files + + + + /etc/systemd/timesyncd.conf + /etc/systemd/timesyncd.conf.d/*.conf + /run/systemd/timesyncd.conf.d/*.conf + /usr/lib/systemd/timesyncd.conf.d/*.conf + + + + Description + + These configuration files control NTP network time + synchronization. + + + + + + + + Options + + + + + NTP= + A space separated list of NTP servers host + names or IP addresses. During runtime this list is combined + with any per-interface NTP servers acquired from + systemd-networkd.service8. + systemd-timesyncd will contact all configured system or + per-interface servers in turn until one is found that + responds. This setting defaults to the empty + list. + + + + FallbackNTP= + A space separated list of NTP server host + names or IP addresses to be used as the fallback NTP servers. + Any per-interface NTP servers obtained from + systemd-networkd.service8 + take precedence over this setting, as do any servers set via + NTP= above. This setting is hence only used + if no other NTP server information is known. If this option is + not given, a compiled-in list of NTP servers is used + instead. + + + + + + + See Also + + systemd1, + systemd-timesyncd.service8, + systemd-networkd.service8 + + diff --git a/man/tmpfiles.d.5 b/man/tmpfiles.d.5 index 9f56f005b..6d006bb9d 100644 --- a/man/tmpfiles.d.5 +++ b/man/tmpfiles.d.5 @@ -1,5 +1,5 @@ '\" t -.TH "TMPFILES\&.D" "5" "" "systemd 218" "tmpfiles.d" +.TH "TMPFILES\&.D" "5" "" "systemd 219" "tmpfiles.d" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -87,8 +87,8 @@ The configuration format is one line per path containing type, path, mode, owner .\} .nf #Type Path Mode UID GID Age Argument -d /run/user 0755 root root 10d \- -L /tmp/foobar \- \- \- \- /dev/null + d /run/user 0755 root root 10d \- + L /tmp/foobar \- \- \- \- /dev/null .fi .if n \{\ .RE @@ -124,6 +124,12 @@ Create a directory if it does not exist yet\&. Create or empty a directory\&. .RE .PP +\fIv\fR +.RS 4 +Create a subvolume if the path does not exist yet and the file system supports this (btrfs)\&. Otherwise create a normal directory, in the same way as +\fId\fR\&. +.RE +.PP \fIp\fR, \fIp+\fR .RS 4 Create a named pipe (FIFO) if it does not exist yet\&. If suffixed with @@ -204,17 +210,28 @@ Recursively set the access mode, group and user, and restore the SELinux securit .PP \fIt\fR .RS 4 -Set extended attributes on item\&. It may be used in conjunction with other types (only -\fId\fR, -\fID\fR, -\fIf\fR, -\fIF\fR, -\fIL\fR, -\fIp\fR, -\fIc\fR, -\fIb\fR, makes sense)\&. If used as a standalone line, then +Set extended attributes\&. Lines of this type accept shell\-style globs in place of normal path names\&. This can be useful for setting SMACK labels\&. +.RE +.PP +\fIT\fR +.RS 4 +Recursively set extended attributes\&. Lines of this type accept shell\-style globs in place of normal path names\&. This can be useful for setting SMACK labels\&. +.RE +.PP +\fIa\fR, \fIa+\fR +.RS 4 +Set POSIX ACLs (access control lists)\&. If suffixed with +\fI+\fR, specified entries will be added to the existing set\&. \fBsystemd\-tmpfiles\fR -will try to set extended attributes on specified path\&. This can be especially used to set SMACK labels\&. +will automatically add the required base entries for user and group based on the access mode of the file, unless base entries already exist or are explictly specified\&. The mask will be added if not specified explicitly or already present\&. Lines of this type accept shell\-style globs in place of normal path names\&. This can be useful for allowing additional access to certain files\&. +.RE +.PP +\fIA\fR, \fIA+\fR +.RS 4 +Same as +\fIa\fR +and +\fIa+\fR, but recursive\&. .RE .PP If the exclamation mark is used, this line is only safe of execute during boot, and can break a running system\&. Lines without the exclamation mark are presumed to be safe to execute at any time, e\&.g\&. on package upgrades\&. @@ -230,10 +247,10 @@ For example: .\} .nf # Make sure these are created by default so that nobody else can -d /tmp/\&.X11\-unix 1777 root root 10d + d /tmp/\&.X11\-unix 1777 root root 10d -# Unlink the X11 lock files -r! /tmp/\&.X[0\-9]*\-lock + # Unlink the X11 lock files + r! /tmp/\&.X[0\-9]*\-lock .fi .if n \{\ .RE @@ -305,7 +322,8 @@ T} .sp 1 .SS "Mode" .PP -The file access mode to use when creating this file or directory\&. If omitted or when set to \-, the default is used: 0755 for directories, 0644 for all other file objects\&. For +The file access mode to use when creating this file or directory\&. If omitted or when set to +"\-", the default is used: 0755 for directories, 0644 for all other file objects\&. For \fIz\fR, \fIZ\fR lines, if omitted or when set to @@ -314,7 +332,8 @@ lines, if omitted or when set to \fIr\fR, \fIR\fR, \fIL\fR, -\fIt\fR +\fIt\fR, and +\fIa\fR lines\&. .PP Optionally, if prefixed with @@ -326,12 +345,14 @@ The user and group to use for this file or directory\&. This may either be a num "\-", the default 0 (root) is used\&. For \fIz\fR, \fIZ\fR -lines, when omitted or when set to \-, the file ownership will not be modified\&. These parameters are ignored for +lines, when omitted or when set to +"\-", the file ownership will not be modified\&. These parameters are ignored for \fIx\fR, \fIr\fR, \fIR\fR, \fIL\fR, -\fIt\fR +\fIt\fR, and +\fIa\fR lines\&. .SS "Age" .PP @@ -341,7 +362,9 @@ The date field, when set, is used to decide what files to delete when cleaning\& .RS 4 .RE .PP -If multiple integers and units are specified, the time values are summed up\&. If an integer is given without a unit, s is assumed\&. +If multiple integers and units are specified, the time values are summed up\&. If an integer is given without a unit, +\fIs\fR +is assumed\&. .PP When the age is set to zero, the files are cleaned unconditionally\&. .PP @@ -369,7 +392,9 @@ determines the major/minor of the device node, with major and minor formatted as may be used to specify a short string that is written to the file, suffixed by a newline\&. For \fIC\fR, specifies the source file or directory\&. For \fIt\fR -determines extended attributes to be set\&. Ignored for all other lines\&. +determines extended attributes to be set\&. For +\fIa\fR +determines ACL attributes to be set\&. Ignored for all other lines\&. .SH "EXAMPLE" .PP \fBExample\ \&1.\ \&/etc/tmpfiles.d/screen.conf example\fR @@ -382,8 +407,8 @@ needs two directories created at boot with specific modes and ownership\&. .\} .nf d /run/screens 1777 root root 10d -d /run/uscreens 0755 root root 10d12h -t /run/screen \- \- \- \- user\&.name="John Smith" security\&.SMACK64=screen + d /run/uscreens 0755 root root 10d12h + t /run/screen \- \- \- \- user\&.name="John Smith" security\&.SMACK64=screen .fi .if n \{\ .RE @@ -399,7 +424,7 @@ needs a directory created at boot with specific mode and ownership and its conte .\} .nf d /var/tmp/abrt 0755 abrt abrt -x /var/tmp/abrt/* + x /var/tmp/abrt/* .fi .if n \{\ .RE @@ -409,4 +434,9 @@ x /var/tmp/abrt/* \fBsystemd\fR(1), \fBsystemd-tmpfiles\fR(8), \fBsystemd-delta\fR(1), -\fBsystemd.exec\fR(5) +\fBsystemd.exec\fR(5), +\fBattr\fR(5), +\fBgetfattr\fR(1), +\fBsetfattr\fR(1), +\fBsetfacl\fR(1), +\fBgetfacl\fR(1) diff --git a/man/tmpfiles.d.html b/man/tmpfiles.d.html index 3fa89454a..f1e92db7f 100644 --- a/man/tmpfiles.d.html +++ b/man/tmpfiles.d.html @@ -19,291 +19,219 @@ Directives · Python · libudev · - gudev systemd 218

Name

tmpfiles.d — Configuration for creation, deletion and - cleaning of volatile and temporary files

Synopsis

/etc/tmpfiles.d/*.conf

/run/tmpfiles.d/*.conf

/usr/lib/tmpfiles.d/*.conf

Description¶

systemd-tmpfiles uses the - configuration files from the above directories to describe the - creation, cleaning and removal of volatile and - temporary files and directories which usually reside - in directories such as /run - or /tmp.

Volatile and temporary files and directories are - those located in /run (and its - alias /var/run), - /tmp, - /var/tmp, the API file systems - such as /sys or - /proc, as well as some other - directories below /var.

System daemons frequently require private - runtime directories below /run to - place communication sockets and similar in. For these, - consider declaring them in their unit files using - RuntimeDirectory= - (see systemd.exec(5) for details), - if this is feasible.

Configuration Format¶

Each configuration file shall be named in the - style of - package.conf - or - package-part.conf. - The second variant should be used when it is desirable - to make it easy to override just this part of - configuration.

Files in /etc/tmpfiles.d - override files with the same name in - /usr/lib/tmpfiles.d and - /run/tmpfiles.d. Files in - /run/tmpfiles.d override files - with the same name in - /usr/lib/tmpfiles.d. Packages - should install their configuration files in - /usr/lib/tmpfiles.d. Files in - /etc/tmpfiles.d are reserved for - the local administrator, who may use this logic to - override the configuration files installed by vendor - packages. All configuration files are sorted by their - filename in lexicographic order, regardless of which - of the directories they reside in. If multiple files - specify the same path, the entry in the file with the - lexicographically earliest name will be applied. - All other conflicting entries will be logged as - errors. When two lines are prefix and suffix of each - other, then the prefix is always processed first, the - suffix later. Otherwise, the files/directories are - processed in the order they are listed.

If the administrator wants to disable a - configuration file supplied by the vendor, the - recommended way is to place a symlink to - /dev/null in - /etc/tmpfiles.d/ bearing the - same filename.

The configuration format is one line per path - containing type, path, mode, ownership, age, and argument - fields:

#Type Path        Mode UID  GID  Age Argument
-d    /run/user   0755 root root 10d -
-L    /tmp/foobar -    -    -    -   /dev/null

Type¶

The type consists of a single letter and - optionally an exclamation mark.

The following line types are understood:

f¶

Create a file if it does not exist yet. If the argument parameter is given, it will be written to the file.

F¶

Create or truncate a file. If the argument parameter is given, it will be written to the file.

w¶

Write the argument parameter to a file, if the file exists. - Lines of this type accept shell-style globs in place of normal path - names. The argument parameter will be written without a trailing - newline. C-style backslash escapes are interpreted.

d¶

Create a directory if it does not exist yet.

D¶

Create or empty a directory.

p, p+¶

Create a named - pipe (FIFO) if it does not - exist yet. If suffixed with - + and a - file already exists where the - pipe is to be created, it will - be removed and be replaced by - the pipe.

L, L+¶

Create a - symlink if it does not exist - yet. If suffixed with - + and a - file already exists where the - symlink is to be created, it - will be removed and be - replaced by the - symlink. If the argument is omitted, - symlinks to files with the same name - residing in the directory - /usr/share/factory/ - are created.

c, c+¶

Create a - character device node if it - does not exist yet. If - suffixed with - + and a - file already exists where the - device node is to be created, - it will be removed and be - replaced by the device - node. It is recommended to suffix this - entry with an exclamation mark to only - create static device nodes at boot, - as udev will not manage static device - nodes that are created at runtime. -

b, b+¶

Create a block - device node if it does not - exist yet. If suffixed with - + and a - file already exists where the - device node is to be created, - it will be removed and be - replaced by the device - node. It is recommended to suffix this - entry with an exclamation mark to only - create static device nodes at boot, - as udev will not manage static device - nodes that are created at runtime. -

C¶

Recursively - copy a file or directory, if - the destination files or - directories do not exist - yet. Note that this command - will not descend into - subdirectories if the - destination directory already - exists. Instead, the entire - copy operation is - skipped. If the argument is omitted, - files from the source directory - /usr/share/factory/ - with the same name are copied.

x¶

Ignore a path - during cleaning. Use this type - to exclude paths from clean-up - as controlled with the Age - parameter. Note that lines of - this type do not influence the - effect of r - or R lines. - Lines of this type accept - shell-style globs in place of - normal path names. -

X¶

Ignore a path - during cleaning. Use this type - to exclude paths from clean-up - as controlled with the Age - parameter. Unlike - x, this - parameter will not exclude the - content if path is a - directory, but only directory - itself. Note that lines of - this type do not influence the - effect of r - or R lines. - Lines of this type accept - shell-style globs in place of - normal path names. -

r¶

Remove a file - or directory if it exists. - This may not be used to remove - non-empty directories, use - R for that. - Lines of this type accept - shell-style globs in place of - normal path - names.

R¶

Recursively - remove a path and all its - subdirectories (if it is a - directory). Lines of this type - accept shell-style globs in - place of normal path - names.

z¶

Adjust the - access mode, group and user, - and restore the SELinux security - context of a file or directory, - if it exists. Lines of this - type accept shell-style globs - in place of normal path names. -

Z¶

Recursively - set the access mode, group and - user, and restore the SELinux - security context of a file or - directory if it exists, as - well as of its subdirectories - and the files contained - therein (if applicable). Lines - of this type accept - shell-style globs in place of - normal path - names.

t¶

Set extended - attributes on item. It may be - used in conjunction with other - types (only d, - D, f, - F, L, - p, c, - b, makes sense). - If used as a standalone line, then - systemd-tmpfiles - will try to set extended - attributes on specified path. - This can be especially used to set - SMACK labels. -

If the exclamation mark is used, this - line is only safe of execute during boot, and - can break a running system. Lines without the - exclamation mark are presumed to be safe to - execute at any time, e.g. on package upgrades. - systemd-tmpfiles will - execute line with an exclamation mark only if - option --boot is given. -

For example: -

# Make sure these are created by default so that nobody else can
-d /tmp/.X11-unix 1777 root root 10d
+  gudev systemd 219

Name

tmpfiles.d — Configuration for creation, deletion and cleaning of + volatile and temporary files

Synopsis

/etc/tmpfiles.d/*.conf

/run/tmpfiles.d/*.conf

/usr/lib/tmpfiles.d/*.conf

Description¶

systemd-tmpfiles uses the configuration + files from the above directories to describe the creation, + cleaning and removal of volatile and temporary files and + directories which usually reside in directories such as + /run or /tmp.

Volatile and temporary files and directories are those + located in /run (and its alias + /var/run), /tmp, + /var/tmp, the API file systems such as + /sys or /proc, as well + as some other directories below /var.

System daemons frequently require private runtime + directories below /run to place communication + sockets and similar in. For these, consider declaring them in + their unit files using RuntimeDirectory= (see + systemd.exec(5) + for details), if this is feasible.

Configuration Format¶

Each configuration file shall be named in the style of + package.conf or + package-part.conf. + The second variant should be used when it is desirable to make it + easy to override just this part of configuration.

Files in /etc/tmpfiles.d override files + with the same name in /usr/lib/tmpfiles.d and + /run/tmpfiles.d. Files in + /run/tmpfiles.d override files with the same + name in /usr/lib/tmpfiles.d. Packages should + install their configuration files in + /usr/lib/tmpfiles.d. Files in + /etc/tmpfiles.d are reserved for the local + administrator, who may use this logic to override the + configuration files installed by vendor packages. All + configuration files are sorted by their filename in lexicographic + order, regardless of which of the directories they reside in. If + multiple files specify the same path, the entry in the file with + the lexicographically earliest name will be applied. All other + conflicting entries will be logged as errors. When two lines are + prefix and suffix of each other, then the prefix is always + processed first, the suffix later. Otherwise, the + files/directories are processed in the order they are + listed.

If the administrator wants to disable a configuration file + supplied by the vendor, the recommended way is to place a symlink + to /dev/null in + /etc/tmpfiles.d/ bearing the same filename. +

The configuration format is one line per path containing + type, path, mode, ownership, age, and argument fields:

#Type Path        Mode UID  GID  Age Argument
+    d    /run/user   0755 root root 10d -
+    L    /tmp/foobar -    -    -    -   /dev/null

Type¶

The type consists of a single letter and optionally an + exclamation mark.

The following line types are understood:

f¶

Create a file if it does not exist yet. If + the argument parameter is given, it will be written to the + file.

F¶

Create or truncate a file. If the argument + parameter is given, it will be written to the file.

w¶

Write the argument parameter to a file, if + the file exists. Lines of this type accept shell-style + globs in place of normal path names. The argument parameter + will be written without a trailing newline. C-style + backslash escapes are interpreted.

d¶

Create a directory if it does not exist yet. +

D¶

Create or empty a directory.

v¶

Create a subvolume if the path does not + exist yet and the file system supports this + (btrfs). Otherwise create a normal directory, in the same + way as d.

p, p+¶

Create a named pipe (FIFO) if it does not + exist yet. If suffixed with + and a file + already exists where the pipe is to be created, it will be + removed and be replaced by the pipe.

L, L+¶

Create a symlink if it does not exist + yet. If suffixed with + and a file + already exists where the symlink is to be created, it will + be removed and be replaced by the symlink. If the argument + is omitted, symlinks to files with the same name residing in + the directory /usr/share/factory/ are + created.

c, c+¶

Create a character device node if it does + not exist yet. If suffixed with + and a + file already exists where the device node is to be created, + it will be removed and be replaced by the device node. It is + recommended to suffix this entry with an exclamation mark to + only create static device nodes at boot, as udev will not + manage static device nodes that are created at runtime. +

b, b+¶

Create a block device node if it does not + exist yet. If suffixed with + and a file + already exists where the device node is to be created, it + will be removed and be replaced by the device node. It is + recommended to suffix this entry with an exclamation mark to + only create static device nodes at boot, as udev will not + manage static device nodes that are created at runtime. +

C¶

Recursively copy a file or directory, if the + destination files or directories do not exist yet. Note that + this command will not descend into subdirectories if the + destination directory already exists. Instead, the entire + copy operation is skipped. If the argument is omitted, files + from the source directory + /usr/share/factory/ with the same name + are copied.

x¶

Ignore a path during cleaning. Use this type + to exclude paths from clean-up as controlled with the Age + parameter. Note that lines of this type do not influence the + effect of r or R + lines. Lines of this type accept shell-style globs in place + of normal path names.

X¶

Ignore a path during cleaning. Use this type + to exclude paths from clean-up as controlled with the Age + parameter. Unlike x, this parameter will + not exclude the content if path is a directory, but only + directory itself. Note that lines of this type do not + influence the effect of r or + R lines. Lines of this type accept + shell-style globs in place of normal path names. +

r¶

Remove a file or directory if it exists. + This may not be used to remove non-empty directories, use + R for that. Lines of this type accept + shell-style globs in place of normal path + names.

R¶

Recursively remove a path and all its + subdirectories (if it is a directory). Lines of this type + accept shell-style globs in place of normal path + names.

z¶

Adjust the access mode, group and user, and + restore the SELinux security context of a file or directory, + if it exists. Lines of this type accept shell-style globs in + place of normal path names.

Z¶

Recursively set the access mode, group and + user, and restore the SELinux security context of a file or + directory if it exists, as well as of its subdirectories and + the files contained therein (if applicable). Lines of this + type accept shell-style globs in place of normal path names. +

t¶

Set extended attributes. Lines of this type + accept shell-style globs in place of normal path names. + This can be useful for setting SMACK labels. +

T¶

Recursively set extended attributes. Lines + of this type accept shell-style globs in place of normal + path names. This can be useful for setting SMACK labels. +

a, a+¶

Set POSIX ACLs (access control lists). If + suffixed with +, specified entries will + be added to the existing set. + systemd-tmpfiles will automatically add + the required base entries for user and group based on the + access mode of the file, unless base entries already exist + or are explictly specified. The mask will be added if not + specified explicitly or already present. Lines of this type + accept shell-style globs in place of normal path names. This + can be useful for allowing additional access to certain + files.

A, A+¶

Same as a and + a+, but recursive.

If the exclamation mark is used, this line is only safe of + execute during boot, and can break a running system. Lines + without the exclamation mark are presumed to be safe to execute + at any time, e.g. on package upgrades. + systemd-tmpfiles will execute line with an + exclamation mark only if option --boot is + given.

For example: +

# Make sure these are created by default so that nobody else can
+      d /tmp/.X11-unix 1777 root root 10d
 
-# Unlink the X11 lock files
-r! /tmp/.X[0-9]*-lock

- The second line in contrast to the first one - would break a running system, and will only be - executed with --boot.

Path¶

The file system path specification supports simple specifier - expansion. The following expansions are - understood:

Table 1. Specifiers available

SpecifierMeaningDetails
"%m"Machine IDThe machine ID of the running system, formatted as string. See machine-id(5) for more information.
"%b"Boot IDThe boot ID of the running system, formatted as string. See random(4) for more information.
"%H"Host nameThe hostname of the running system.
"%v"Kernel releaseIdentical to uname -r output.
"%%"Escaped %Single percent sign.

Mode¶

The file access mode to use when - creating this file or directory. If omitted or - when set to -, the default is used: 0755 for - directories, 0644 for all other file objects. - For z, Z - lines, if omitted or when set to - "-", the file access mode - will not be modified. This parameter is - ignored for x, - r, R, - L, t lines.

Optionally, if prefixed with - "~", the access mode is masked - based on the already set access bits for - existing file or directories: if the existing - file has all executable bits unset, all - executable bits are removed from the new - access mode, too. Similarly, if all read bits - are removed from the old access mode, they will - be removed from the new access mode too, and - if all write bits are removed, they will be - removed from the new access mode too. In - addition, the sticky/SUID/SGID bit is removed unless - applied to a directory. This - functionality is particularly useful in - conjunction with Z.

UID, GID¶

The user and group to use for this file - or directory. This may either be a numeric - user/group ID or a user or group name. If - omitted or when set to "-", - the default 0 (root) is used. For - z, Z - lines, when omitted or when set to -, the file - ownership will not be modified. These - parameters are ignored for - x, r, - R, L, - t lines.

Age¶

The date field, when set, is used to - decide what files to delete when cleaning. If - a file or directory is older than the current - time minus the age field, it is deleted. The - field format is a series of integers each - followed by one of the following - postfixes for the respective time units:

s, min, h, d, w, ms, m, us¶

If multiple integers and units are specified, the time - values are summed up. If an integer is given without a unit, - s is assumed. -

When the age is set to zero, the files are cleaned - unconditionally.

The age field only applies to lines - starting with d, - D, and - x. If omitted or set to - "-", no automatic clean-up is - done.

If the age field starts with a tilde - character "~", the clean-up - is only applied to files and directories one - level inside the directory specified, but not - the files and directories immediately inside - it.

Argument¶

For L lines - determines the destination path of the - symlink. For c, - b determines the - major/minor of the device node, with major and - minor formatted as integers, separated by - ":", e.g. - "1:3". For - f, F, - and w may be used to - specify a short string that is written to the - file, suffixed by a newline. For - C, specifies the source file - or directory. For t determines - extended attributes to be set. Ignored for all other lines.

Example¶

Example 1. /etc/tmpfiles.d/screen.conf example

screen needs two directories created at boot with specific modes and ownership.

d /run/screens  1777 root root 10d
-d /run/uscreens 0755 root root 10d12h
-t /run/screen - - - - user.name="John Smith" security.SMACK64=screen

Example 2. /etc/tmpfiles.d/abrt.conf example

abrt needs a directory created at boot with specific mode and ownership and its content should be preserved.

d /var/tmp/abrt 0755 abrt abrt
-x /var/tmp/abrt/*

+ # Unlink the X11 lock files + r! /tmp/.X[0-9]*-lock

+ The second line in contrast to the first one would break a + running system, and will only be executed with + --boot.

Path¶

The file system path specification supports simple + specifier expansion. The following expansions are + understood:

Table 1. Specifiers available

SpecifierMeaningDetails
"%m"Machine IDThe machine ID of the running system, formatted as string. See machine-id(5) for more information.
"%b"Boot IDThe boot ID of the running system, formatted as string. See random(4) for more information.
"%H"Host nameThe hostname of the running system.
"%v"Kernel releaseIdentical to uname -r output.
"%%"Escaped %Single percent sign.

Mode¶

The file access mode to use when creating this file or + directory. If omitted or when set to "-", the + default is used: 0755 for directories, 0644 for all other file + objects. For z, Z lines, + if omitted or when set to "-", the file access + mode will not be modified. This parameter is ignored for + x, r, + R, L, t, + and a lines.

Optionally, if prefixed with "~", the + access mode is masked based on the already set access bits for + existing file or directories: if the existing file has all + executable bits unset, all executable bits are removed from the + new access mode, too. Similarly, if all read bits are removed + from the old access mode, they will be removed from the new + access mode too, and if all write bits are removed, they will be + removed from the new access mode too. In addition, the + sticky/SUID/SGID bit is removed unless applied to a + directory. This functionality is particularly useful in + conjunction with Z.

UID, GID¶

The user and group to use for this file or directory. This + may either be a numeric user/group ID or a user or group + name. If omitted or when set to "-", the + default 0 (root) is used. For z, + Z lines, when omitted or when set to + "-", the file ownership will not be + modified. These parameters are ignored for x, + r, R, + L, t, and + a lines.

Age¶

The date field, when set, is used to decide what files to + delete when cleaning. If a file or directory is older than the + current time minus the age field, it is deleted. The field + format is a series of integers each followed by one of the + following postfixes for the respective time units:

s, min, h, d, w, ms, m, us¶

If multiple integers and units are specified, the time + values are summed up. If an integer is given without a unit, + s is assumed. +

When the age is set to zero, the files are cleaned + unconditionally.

The age field only applies to lines + starting with d, + D, and + x. If omitted or set to + "-", no automatic clean-up is + done.

If the age field starts with a tilde character + "~", the clean-up is only applied to files and + directories one level inside the directory specified, but not + the files and directories immediately inside it.

Argument¶

For L lines determines the destination + path of the symlink. For c, + b determines the major/minor of the device + node, with major and minor formatted as integers, separated by + ":", e.g. "1:3". For + f, F, and + w may be used to specify a short string that + is written to the file, suffixed by a newline. For + C, specifies the source file or + directory. For t determines extended + attributes to be set. For a determines + ACL attributes to be set. Ignored for all other lines.

Example¶

Example 1. /etc/tmpfiles.d/screen.conf example

screen needs two directories created at + boot with specific modes and ownership.

d /run/screens  1777 root root 10d
+      d /run/uscreens 0755 root root 10d12h
+      t /run/screen - - - - user.name="John Smith" security.SMACK64=screen

Example 2. /etc/tmpfiles.d/abrt.conf example

abrt needs a directory created at boot with specific mode and ownership and its content should be preserved.

d /var/tmp/abrt 0755 abrt abrt
+      x /var/tmp/abrt/*

diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 4f2e6406a..8815bf997 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -21,564 +21,515 @@ --> - - tmpfiles.d - systemd - - - - Documentation - Brandon - Philips - brandon@ifup.org - - - - - - tmpfiles.d - 5 - - - - tmpfiles.d - Configuration for creation, deletion and - cleaning of volatile and temporary files - - - - /etc/tmpfiles.d/*.conf - /run/tmpfiles.d/*.conf - /usr/lib/tmpfiles.d/*.conf - - - - Description - - systemd-tmpfiles uses the - configuration files from the above directories to describe the - creation, cleaning and removal of volatile and - temporary files and directories which usually reside - in directories such as /run - or /tmp. - - Volatile and temporary files and directories are - those located in /run (and its - alias /var/run), - /tmp, - /var/tmp, the API file systems - such as /sys or - /proc, as well as some other - directories below /var. - - System daemons frequently require private - runtime directories below /run to - place communication sockets and similar in. For these, - consider declaring them in their unit files using - RuntimeDirectory= - (see systemd.exec5 for details), - if this is feasible. - - - - Configuration Format - - Each configuration file shall be named in the - style of - package.conf - or - package-part.conf. - The second variant should be used when it is desirable - to make it easy to override just this part of - configuration. - - Files in /etc/tmpfiles.d - override files with the same name in - /usr/lib/tmpfiles.d and - /run/tmpfiles.d. Files in - /run/tmpfiles.d override files - with the same name in - /usr/lib/tmpfiles.d. Packages - should install their configuration files in - /usr/lib/tmpfiles.d. Files in - /etc/tmpfiles.d are reserved for - the local administrator, who may use this logic to - override the configuration files installed by vendor - packages. All configuration files are sorted by their - filename in lexicographic order, regardless of which - of the directories they reside in. If multiple files - specify the same path, the entry in the file with the - lexicographically earliest name will be applied. - All other conflicting entries will be logged as - errors. When two lines are prefix and suffix of each - other, then the prefix is always processed first, the - suffix later. Otherwise, the files/directories are - processed in the order they are listed. - - If the administrator wants to disable a - configuration file supplied by the vendor, the - recommended way is to place a symlink to - /dev/null in - /etc/tmpfiles.d/ bearing the - same filename. - - The configuration format is one line per path - containing type, path, mode, ownership, age, and argument - fields: - - #Type Path Mode UID GID Age Argument -d /run/user 0755 root root 10d - -L /tmp/foobar - - - - /dev/null - - - Type - - The type consists of a single letter and - optionally an exclamation mark. - - The following line types are understood: - - - - f - Create a file if it does not exist yet. If the argument parameter is given, it will be written to the file. - - - - F - Create or truncate a file. If the argument parameter is given, it will be written to the file. - - - - w - Write the argument parameter to a file, if the file exists. - Lines of this type accept shell-style globs in place of normal path - names. The argument parameter will be written without a trailing - newline. C-style backslash escapes are interpreted. - - - - d - Create a directory if it does not exist yet. - - - - D - Create or empty a directory. - - - - p - p+ - Create a named - pipe (FIFO) if it does not - exist yet. If suffixed with - + and a - file already exists where the - pipe is to be created, it will - be removed and be replaced by - the pipe. - - - - L - L+ - Create a - symlink if it does not exist - yet. If suffixed with - + and a - file already exists where the - symlink is to be created, it - will be removed and be - replaced by the - symlink. If the argument is omitted, - symlinks to files with the same name - residing in the directory - /usr/share/factory/ - are created. - - - - c - c+ - Create a - character device node if it - does not exist yet. If - suffixed with - + and a - file already exists where the - device node is to be created, - it will be removed and be - replaced by the device - node. It is recommended to suffix this - entry with an exclamation mark to only - create static device nodes at boot, - as udev will not manage static device - nodes that are created at runtime. - - - - - b - b+ - Create a block - device node if it does not - exist yet. If suffixed with - + and a - file already exists where the - device node is to be created, - it will be removed and be - replaced by the device - node. It is recommended to suffix this - entry with an exclamation mark to only - create static device nodes at boot, - as udev will not manage static device - nodes that are created at runtime. - - - - - C - Recursively - copy a file or directory, if - the destination files or - directories do not exist - yet. Note that this command - will not descend into - subdirectories if the - destination directory already - exists. Instead, the entire - copy operation is - skipped. If the argument is omitted, - files from the source directory - /usr/share/factory/ - with the same name are copied. - - - - x - Ignore a path - during cleaning. Use this type - to exclude paths from clean-up - as controlled with the Age - parameter. Note that lines of - this type do not influence the - effect of r - or R lines. - Lines of this type accept - shell-style globs in place of - normal path names. - - - - - X - Ignore a path - during cleaning. Use this type - to exclude paths from clean-up - as controlled with the Age - parameter. Unlike - x, this - parameter will not exclude the - content if path is a - directory, but only directory - itself. Note that lines of - this type do not influence the - effect of r - or R lines. - Lines of this type accept - shell-style globs in place of - normal path names. - - - - - r - Remove a file - or directory if it exists. - This may not be used to remove - non-empty directories, use - R for that. - Lines of this type accept - shell-style globs in place of - normal path - names. - - - - R - Recursively - remove a path and all its - subdirectories (if it is a - directory). Lines of this type - accept shell-style globs in - place of normal path - names. - - - - z - Adjust the - access mode, group and user, - and restore the SELinux security - context of a file or directory, - if it exists. Lines of this - type accept shell-style globs - in place of normal path names. - - - - - Z - Recursively - set the access mode, group and - user, and restore the SELinux - security context of a file or - directory if it exists, as - well as of its subdirectories - and the files contained - therein (if applicable). Lines - of this type accept - shell-style globs in place of - normal path - names. - - - - t - Set extended - attributes on item. It may be - used in conjunction with other - types (only d, - D, f, - F, L, - p, c, - b, makes sense). - If used as a standalone line, then - systemd-tmpfiles - will try to set extended - attributes on specified path. - This can be especially used to set - SMACK labels. - - - - - If the exclamation mark is used, this - line is only safe of execute during boot, and - can break a running system. Lines without the - exclamation mark are presumed to be safe to - execute at any time, e.g. on package upgrades. - systemd-tmpfiles will - execute line with an exclamation mark only if - option is given. - - - For example: - # Make sure these are created by default so that nobody else can -d /tmp/.X11-unix 1777 root root 10d - -# Unlink the X11 lock files -r! /tmp/.X[0-9]*-lock - The second line in contrast to the first one - would break a running system, and will only be - executed with . - - - - Path - - The file system path specification supports simple specifier - expansion. The following expansions are - understood: - - - Specifiers available - - - - - - - Specifier - Meaning - Details - - - - - %m - Machine ID - The machine ID of the running system, formatted as string. See machine-id5 for more information. - - - %b - Boot ID - The boot ID of the running system, formatted as string. See random4 for more information. - - - %H - Host name - The hostname of the running system. - - - %v - Kernel release - Identical to uname -r output. - - - %% - Escaped % - Single percent sign. - - - -
-
- - - Mode - - The file access mode to use when - creating this file or directory. If omitted or - when set to -, the default is used: 0755 for - directories, 0644 for all other file objects. - For z, Z - lines, if omitted or when set to - -, the file access mode - will not be modified. This parameter is - ignored for x, - r, R, - L, t lines. - - Optionally, if prefixed with - ~, the access mode is masked - based on the already set access bits for - existing file or directories: if the existing - file has all executable bits unset, all - executable bits are removed from the new - access mode, too. Similarly, if all read bits - are removed from the old access mode, they will - be removed from the new access mode too, and - if all write bits are removed, they will be - removed from the new access mode too. In - addition, the sticky/SUID/SGID bit is removed unless - applied to a directory. This - functionality is particularly useful in - conjunction with Z. - - - - UID, GID - - The user and group to use for this file - or directory. This may either be a numeric - user/group ID or a user or group name. If - omitted or when set to -, - the default 0 (root) is used. For - z, Z - lines, when omitted or when set to -, the file - ownership will not be modified. These - parameters are ignored for - x, r, - R, L, - t lines. - - - - Age - The date field, when set, is used to - decide what files to delete when cleaning. If - a file or directory is older than the current - time minus the age field, it is deleted. The - field format is a series of integers each - followed by one of the following - postfixes for the respective time units: - - - - s - min - h - d - w - ms - m - us - - - If multiple integers and units are specified, the time - values are summed up. If an integer is given without a unit, - s is assumed. - - - When the age is set to zero, the files are cleaned - unconditionally. - - The age field only applies to lines - starting with d, - D, and - x. If omitted or set to - -, no automatic clean-up is - done. - - If the age field starts with a tilde - character ~, the clean-up - is only applied to files and directories one - level inside the directory specified, but not - the files and directories immediately inside - it. - - - - Argument - - For L lines - determines the destination path of the - symlink. For c, - b determines the - major/minor of the device node, with major and - minor formatted as integers, separated by - :, e.g. - 1:3. For - f, F, - and w may be used to - specify a short string that is written to the - file, suffixed by a newline. For - C, specifies the source file - or directory. For t determines - extended attributes to be set. Ignored for all other lines. - - -
- - - Example - - /etc/tmpfiles.d/screen.conf example - screen needs two directories created at boot with specific modes and ownership. - - d /run/screens 1777 root root 10d -d /run/uscreens 0755 root root 10d12h -t /run/screen - - - - user.name="John Smith" security.SMACK64=screen - - - /etc/tmpfiles.d/abrt.conf example - abrt needs a directory created at boot with specific mode and ownership and its content should be preserved. - - d /var/tmp/abrt 0755 abrt abrt -x /var/tmp/abrt/* - - - - - See Also - - systemd1, - systemd-tmpfiles8, - systemd-delta1, - systemd.exec5 - - + + tmpfiles.d + systemd + + + + Documentation + Brandon + Philips + brandon@ifup.org + + + + + + tmpfiles.d + 5 + + + + tmpfiles.d + Configuration for creation, deletion and cleaning of + volatile and temporary files + + + + /etc/tmpfiles.d/*.conf + /run/tmpfiles.d/*.conf + /usr/lib/tmpfiles.d/*.conf + + + + Description + + systemd-tmpfiles uses the configuration + files from the above directories to describe the creation, + cleaning and removal of volatile and temporary files and + directories which usually reside in directories such as + /run or /tmp. + + Volatile and temporary files and directories are those + located in /run (and its alias + /var/run), /tmp, + /var/tmp, the API file systems such as + /sys or /proc, as well + as some other directories below /var. + + System daemons frequently require private runtime + directories below /run to place communication + sockets and similar in. For these, consider declaring them in + their unit files using RuntimeDirectory= (see + systemd.exec5 + for details), if this is feasible. + + + + Configuration Format + + Each configuration file shall be named in the style of + package.conf or + package-part.conf. + The second variant should be used when it is desirable to make it + easy to override just this part of configuration. + + Files in /etc/tmpfiles.d override files + with the same name in /usr/lib/tmpfiles.d and + /run/tmpfiles.d. Files in + /run/tmpfiles.d override files with the same + name in /usr/lib/tmpfiles.d. Packages should + install their configuration files in + /usr/lib/tmpfiles.d. Files in + /etc/tmpfiles.d are reserved for the local + administrator, who may use this logic to override the + configuration files installed by vendor packages. All + configuration files are sorted by their filename in lexicographic + order, regardless of which of the directories they reside in. If + multiple files specify the same path, the entry in the file with + the lexicographically earliest name will be applied. All other + conflicting entries will be logged as errors. When two lines are + prefix and suffix of each other, then the prefix is always + processed first, the suffix later. Otherwise, the + files/directories are processed in the order they are + listed. + + If the administrator wants to disable a configuration file + supplied by the vendor, the recommended way is to place a symlink + to /dev/null in + /etc/tmpfiles.d/ bearing the same filename. + + + The configuration format is one line per path containing + type, path, mode, ownership, age, and argument fields: + + #Type Path Mode UID GID Age Argument + d /run/user 0755 root root 10d - + L /tmp/foobar - - - - /dev/null + + + Type + + The type consists of a single letter and optionally an + exclamation mark. + + The following line types are understood: + + + + f + Create a file if it does not exist yet. If + the argument parameter is given, it will be written to the + file. + + + + F + Create or truncate a file. If the argument + parameter is given, it will be written to the file. + + + + + w + Write the argument parameter to a file, if + the file exists. Lines of this type accept shell-style + globs in place of normal path names. The argument parameter + will be written without a trailing newline. C-style + backslash escapes are interpreted. + + + + d + Create a directory if it does not exist yet. + + + + + D + Create or empty a directory. + + + + v + Create a subvolume if the path does not + exist yet and the file system supports this + (btrfs). Otherwise create a normal directory, in the same + way as d. + + + + p + p+ + Create a named pipe (FIFO) if it does not + exist yet. If suffixed with + and a file + already exists where the pipe is to be created, it will be + removed and be replaced by the pipe. + + + + L + L+ + Create a symlink if it does not exist + yet. If suffixed with + and a file + already exists where the symlink is to be created, it will + be removed and be replaced by the symlink. If the argument + is omitted, symlinks to files with the same name residing in + the directory /usr/share/factory/ are + created. + + + + c + c+ + Create a character device node if it does + not exist yet. If suffixed with + and a + file already exists where the device node is to be created, + it will be removed and be replaced by the device node. It is + recommended to suffix this entry with an exclamation mark to + only create static device nodes at boot, as udev will not + manage static device nodes that are created at runtime. + + + + + b + b+ + Create a block device node if it does not + exist yet. If suffixed with + and a file + already exists where the device node is to be created, it + will be removed and be replaced by the device node. It is + recommended to suffix this entry with an exclamation mark to + only create static device nodes at boot, as udev will not + manage static device nodes that are created at runtime. + + + + + C + Recursively copy a file or directory, if the + destination files or directories do not exist yet. Note that + this command will not descend into subdirectories if the + destination directory already exists. Instead, the entire + copy operation is skipped. If the argument is omitted, files + from the source directory + /usr/share/factory/ with the same name + are copied. + + + + x + Ignore a path during cleaning. Use this type + to exclude paths from clean-up as controlled with the Age + parameter. Note that lines of this type do not influence the + effect of r or R + lines. Lines of this type accept shell-style globs in place + of normal path names. + + + + X + Ignore a path during cleaning. Use this type + to exclude paths from clean-up as controlled with the Age + parameter. Unlike x, this parameter will + not exclude the content if path is a directory, but only + directory itself. Note that lines of this type do not + influence the effect of r or + R lines. Lines of this type accept + shell-style globs in place of normal path names. + + + + + r + Remove a file or directory if it exists. + This may not be used to remove non-empty directories, use + R for that. Lines of this type accept + shell-style globs in place of normal path + names. + + + + R + Recursively remove a path and all its + subdirectories (if it is a directory). Lines of this type + accept shell-style globs in place of normal path + names. + + + + z + Adjust the access mode, group and user, and + restore the SELinux security context of a file or directory, + if it exists. Lines of this type accept shell-style globs in + place of normal path names. + + + + Z + Recursively set the access mode, group and + user, and restore the SELinux security context of a file or + directory if it exists, as well as of its subdirectories and + the files contained therein (if applicable). Lines of this + type accept shell-style globs in place of normal path names. + + + + + t + Set extended attributes. Lines of this type + accept shell-style globs in place of normal path names. + This can be useful for setting SMACK labels. + + + + + T + Recursively set extended attributes. Lines + of this type accept shell-style globs in place of normal + path names. This can be useful for setting SMACK labels. + + + + + a + a+ + Set POSIX ACLs (access control lists). If + suffixed with +, specified entries will + be added to the existing set. + systemd-tmpfiles will automatically add + the required base entries for user and group based on the + access mode of the file, unless base entries already exist + or are explictly specified. The mask will be added if not + specified explicitly or already present. Lines of this type + accept shell-style globs in place of normal path names. This + can be useful for allowing additional access to certain + files. + + + + A + A+ + Same as a and + a+, but recursive. + + + + If the exclamation mark is used, this line is only safe of + execute during boot, and can break a running system. Lines + without the exclamation mark are presumed to be safe to execute + at any time, e.g. on package upgrades. + systemd-tmpfiles will execute line with an + exclamation mark only if option is + given. + + For example: + # Make sure these are created by default so that nobody else can + d /tmp/.X11-unix 1777 root root 10d + + # Unlink the X11 lock files + r! /tmp/.X[0-9]*-lock + The second line in contrast to the first one would break a + running system, and will only be executed with + . + + + + Path + + The file system path specification supports simple + specifier expansion. The following expansions are + understood: + + + Specifiers available + + + + + + + Specifier + Meaning + Details + + + + + %m + Machine ID + The machine ID of the running system, formatted as string. See machine-id5 for more information. + + + %b + Boot ID + The boot ID of the running system, formatted as string. See random4 for more information. + + + %H + Host name + The hostname of the running system. + + + %v + Kernel release + Identical to uname -r output. + + + %% + Escaped % + Single percent sign. + + + +
+
+ + + Mode + + The file access mode to use when creating this file or + directory. If omitted or when set to -, the + default is used: 0755 for directories, 0644 for all other file + objects. For z, Z lines, + if omitted or when set to -, the file access + mode will not be modified. This parameter is ignored for + x, r, + R, L, t, + and a lines. + + Optionally, if prefixed with ~, the + access mode is masked based on the already set access bits for + existing file or directories: if the existing file has all + executable bits unset, all executable bits are removed from the + new access mode, too. Similarly, if all read bits are removed + from the old access mode, they will be removed from the new + access mode too, and if all write bits are removed, they will be + removed from the new access mode too. In addition, the + sticky/SUID/SGID bit is removed unless applied to a + directory. This functionality is particularly useful in + conjunction with Z. + + + + UID, GID + + The user and group to use for this file or directory. This + may either be a numeric user/group ID or a user or group + name. If omitted or when set to -, the + default 0 (root) is used. For z, + Z lines, when omitted or when set to + -, the file ownership will not be + modified. These parameters are ignored for x, + r, R, + L, t, and + a lines. + + + + Age + The date field, when set, is used to decide what files to + delete when cleaning. If a file or directory is older than the + current time minus the age field, it is deleted. The field + format is a series of integers each followed by one of the + following postfixes for the respective time units: + + + + s + min + h + d + w + ms + m + us + + + If multiple integers and units are specified, the time + values are summed up. If an integer is given without a unit, + s is assumed. + + + When the age is set to zero, the files are cleaned + unconditionally. + + The age field only applies to lines + starting with d, + D, and + x. If omitted or set to + -, no automatic clean-up is + done. + + If the age field starts with a tilde character + ~, the clean-up is only applied to files and + directories one level inside the directory specified, but not + the files and directories immediately inside it. + + + + Argument + + For L lines determines the destination + path of the symlink. For c, + b determines the major/minor of the device + node, with major and minor formatted as integers, separated by + :, e.g. 1:3. For + f, F, and + w may be used to specify a short string that + is written to the file, suffixed by a newline. For + C, specifies the source file or + directory. For t determines extended + attributes to be set. For a determines + ACL attributes to be set. Ignored for all other lines. + + +
+ + + Example + + /etc/tmpfiles.d/screen.conf example + screen needs two directories created at + boot with specific modes and ownership. + + d /run/screens 1777 root root 10d + d /run/uscreens 0755 root root 10d12h + t /run/screen - - - - user.name="John Smith" security.SMACK64=screen + + + /etc/tmpfiles.d/abrt.conf example + abrt needs a directory created at boot with specific mode and ownership and its content should be preserved. + + d /var/tmp/abrt 0755 abrt abrt + x /var/tmp/abrt/* + + + + + See Also + + systemd1, + systemd-tmpfiles8, + systemd-delta1, + systemd.exec5, + attr5, + getfattr1, + setfattr1, + setfacl1, + getfacl1 + +
diff --git a/man/udev.7 b/man/udev.7 index 63a89f530..4c3fe19f1 100644 --- a/man/udev.7 +++ b/man/udev.7 @@ -1,5 +1,5 @@ '\" t -.TH "UDEV" "7" "" "systemd 218" "udev" +.TH "UDEV" "7" "" "systemd 219" "udev" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -172,7 +172,7 @@ Test the existence of a file\&. An octal mode mask can be specified if needed\&. .PP \fIPROGRAM\fR .RS 4 -Execute a program to determine whether there is a match; the key is true if the program returns successfully\&. The device properties are made available to the executed program in the environment\&. The program\*(Aqs standard ouput is available in the +Execute a program to determine whether there is a match; the key is true if the program returns successfully\&. The device properties are made available to the executed program in the environment\&. The program\*(Aqs standard output is available in the \fIRESULT\fR key\&. .sp @@ -533,37 +533,6 @@ The "$" character itself\&. .RE -.SH "HARDWARE DATABASE FILES" -.PP -The hwdb files are read from the files located in the system hwdb directory -/usr/lib/udev/hwdb\&.d, the volatile runtime directory -/run/udev/hwdb\&.d -and the local administration directory -/etc/udev/hwdb\&.d\&. All hwdb files are collectively sorted and processed in lexical order, regardless of the directories in which they live\&. However, files with identical filenames replace each other\&. Files in -/etc -have the highest priority, files in -/run -take precedence over files with the same name in -/usr/lib\&. This can be used to override a system\-supplied hwdb file with a local file if needed; a symlink in -/etc -with the same name as a hwdb file in -/usr/lib, pointing to -/dev/null, disables the hwdb file entirely\&. hwdb files must have the extension -\&.hwdb; other extensions are ignored\&. -.PP -The hwdb file contains data records consisting of matches and associated key\-value pairs\&. Every record in the hwdb starts with one or more match string, specifying a shell glob to compare the database lookup string against\&. Multiple match lines are specified in additional consecutive lines\&. Every match line is compared indivdually, they are combined by OR\&. Every match line must start at the first character of the line\&. -.PP -The match lines are followed by one or more key\-value pair lines, which are recognized by a leading space character\&. The key name and value are separated by -"="\&. An empty line signifies the end of a record\&. Lines beginning with -"#" -are ignored\&. -.PP -The content of all hwdb files is read by -\fBudevadm\fR(8) -and compiled to a binary database located at -/etc/udev/hwdb\&.bin, or alternatively -/usr/lib/udev/hwdb\&.bin -if you want ship the compiled database in an immutable image\&. During runtime only the binary database is used\&. .SH "SEE ALSO" .PP \fBsystemd-udevd.service\fR(8), diff --git a/man/udev.conf.5 b/man/udev.conf.5 index 6b79e4070..5add26f0e 100644 --- a/man/udev.conf.5 +++ b/man/udev.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "UDEV\&.CONF" "5" "" "systemd 218" "udev.conf" +.TH "UDEV\&.CONF" "5" "" "systemd 219" "udev.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/udev.conf.html b/man/udev.conf.html index d52fee33e..ffe68342d 100644 --- a/man/udev.conf.html +++ b/man/udev.conf.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218

Name

udev.conf — Configuration for device event managing daemon

Synopsis

/etc/udev/udev.conf

Description¶

+ gudev systemd 219


Name

udev.conf — Configuration for device event managing daemon

Synopsis

/etc/udev/udev.conf

Description¶

systemd-udevd(8) expects its main configuration file at /etc/udev/udev.conf. It consists of a set @@ -33,7 +33,7 @@ In addition, systemd-udevd can be configured by command line options and the kernel command line (see systemd-udevd(8)). -

See Also¶

+

See Also¶

systemd-udevd(8), udev(7), udevadm(8) diff --git a/man/udev.conf.xml b/man/udev.conf.xml index e87d6e97c..e104e53f5 100644 --- a/man/udev.conf.xml +++ b/man/udev.conf.xml @@ -1,5 +1,4 @@ - diff --git a/man/udev.html b/man/udev.html index 5f56d4ebc..1d687b7a6 100644 --- a/man/udev.html +++ b/man/udev.html @@ -19,7 +19,7 @@ Directives · Python · libudev · - gudev systemd 218


Name

udev — Dynamic device management

Description¶

udev supplies the system software with device events, manages permissions + gudev systemd 219


Name

udev — Dynamic device management

Description¶

udev supplies the system software with device events, manages permissions of device nodes and may create additional symlinks in the /dev directory, or renames network interfaces. The kernel usually just assigns unpredictable device names based on the order of discovery. Meaningful symlinks or network device @@ -31,7 +31,7 @@ provide additional device information to be stored in the udev database or to be used to create meaningful symlink names.

All device information udev processes is stored in the udev database and sent out to possible event subscribers. Access to all stored data and the event - sources is provided by the library libudev.

Rules Files¶

The udev rules are read from the files located in the + sources is provided by the library libudev.

Rules Files¶

The udev rules are read from the files located in the system rules directory /usr/lib/udev/rules.d, the volatile runtime directory /run/udev/rules.d and the local administration directory /etc/udev/rules.d. @@ -72,7 +72,7 @@ if needed.

PROGRAM¶

Execute a program to determine whether there is a match; the key is true if the program returns successfully. The device properties are made available to the - executed program in the environment. The program's standard ouput + executed program in the environment. The program's standard output is available in the RESULT key.

This can only be used for very short-running foreground tasks. For details, see RUN.

RESULT¶

Match the returned string of the last PROGRAM call. This key can be used in the same or in any later rule after a @@ -187,34 +187,7 @@ If the number is followed by the "+" character, this part plus all remaining parts of the result string are substituted: "%c{N+}".

$parent, %P¶

The node name of the parent device.

$name¶

The current name of the device. If not changed by a rule, it is the name of the kernel device.

A space-separated list of the current symlinks. The value is - only set during a remove event or if an earlier rule assigned a value.

$root, %r¶

The udev_root value.

$sys, %S¶

The sysfs mount point.

$devnode, %N¶

The name of the device node.

%%¶

The "%" character itself.

$$¶

The "$" character itself.

Hardware Database Files¶

The hwdb files are read from the files located in the - system hwdb directory /usr/lib/udev/hwdb.d, - the volatile runtime directory /run/udev/hwdb.d - and the local administration directory /etc/udev/hwdb.d. - All hwdb files are collectively sorted and processed in lexical order, - regardless of the directories in which they live. However, files with - identical filenames replace each other. Files in /etc - have the highest priority, files in /run take precedence - over files with the same name in /usr/lib. This can be - used to override a system-supplied hwdb file with a local file if needed; - a symlink in /etc with the same name as a hwdb file in - /usr/lib, pointing to /dev/null, - disables the hwdb file entirely. hwdb files must have the extension - .hwdb; other extensions are ignored.

The hwdb file contains data records consisting of matches and - associated key-value pairs. Every record in the hwdb starts with one or - more match string, specifying a shell glob to compare the database - lookup string against. Multiple match lines are specified in additional - consecutive lines. Every match line is compared indivdually, they are - combined by OR. Every match line must start at the first character of - the line.

The match lines are followed by one or more key-value pair lines, which - are recognized by a leading space character. The key name and value are separated - by "=". An empty line signifies the end - of a record. Lines beginning with "#" are ignored.

The content of all hwdb files is read by - udevadm(8) - and compiled to a binary database located at /etc/udev/hwdb.bin, - or alternatively /usr/lib/udev/hwdb.bin if you want ship the compiled - database in an immutable image. - During runtime only the binary database is used.

See Also¶

+ only set during a remove event or if an earlier rule assigned a value.

$root, %r¶

The udev_root value.

$sys, %S¶

The sysfs mount point.

$devnode, %N¶

The name of the device node.

%%¶

The "%" character itself.

$$¶

The "$" character itself.

See Also¶

systemd-udevd.service(8), udevadm(8), systemd.link(5) diff --git a/man/udev.xml b/man/udev.xml index 1113a66a2..a948ea79a 100644 --- a/man/udev.xml +++ b/man/udev.xml @@ -1,5 +1,4 @@ - @@ -262,7 +261,7 @@ Execute a program to determine whether there is a match; the key is true if the program returns successfully. The device properties are made available to the - executed program in the environment. The program's standard ouput + executed program in the environment. The program's standard output is available in the RESULT key. This can only be used for very short-running foreground tasks. For details, see RUN. @@ -735,43 +734,6 @@ - Hardware Database Files - The hwdb files are read from the files located in the - system hwdb directory /usr/lib/udev/hwdb.d, - the volatile runtime directory /run/udev/hwdb.d - and the local administration directory /etc/udev/hwdb.d. - All hwdb files are collectively sorted and processed in lexical order, - regardless of the directories in which they live. However, files with - identical filenames replace each other. Files in /etc - have the highest priority, files in /run take precedence - over files with the same name in /usr/lib. This can be - used to override a system-supplied hwdb file with a local file if needed; - a symlink in /etc with the same name as a hwdb file in - /usr/lib, pointing to /dev/null, - disables the hwdb file entirely. hwdb files must have the extension - .hwdb; other extensions are ignored. - - The hwdb file contains data records consisting of matches and - associated key-value pairs. Every record in the hwdb starts with one or - more match string, specifying a shell glob to compare the database - lookup string against. Multiple match lines are specified in additional - consecutive lines. Every match line is compared indivdually, they are - combined by OR. Every match line must start at the first character of - the line. - - The match lines are followed by one or more key-value pair lines, which - are recognized by a leading space character. The key name and value are separated - by =. An empty line signifies the end - of a record. Lines beginning with # are ignored. - - The content of all hwdb files is read by - udevadm8 - and compiled to a binary database located at /etc/udev/hwdb.bin, - or alternatively /usr/lib/udev/hwdb.bin if you want ship the compiled - database in an immutable image. - During runtime only the binary database is used. - - See Also diff --git a/man/udevadm.8 b/man/udevadm.8 index 521d1fb9b..82f26cea9 100644 --- a/man/udevadm.8 +++ b/man/udevadm.8 @@ -1,5 +1,5 @@ '\" t -.TH "UDEVADM" "8" "" "systemd 218" "udevadm" +.TH "UDEVADM" "8" "" "systemd 219" "udevadm" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,8 +34,6 @@ udevadm \- udev management tool \fBudevadm control \fR\fB\fIcommand\fR\fR .HP \w'\fBudevadm\ monitor\ \fR\fB[options]\fR\ 'u \fBudevadm monitor \fR\fB[options]\fR -.HP \w'\fBudevadm\ hwdb\ \fR\fB[options]\fR\ 'u -\fBudevadm hwdb \fR\fB[options]\fR .HP \w'\fBudevadm\ test\ \fR\fB[options]\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u \fBudevadm test \fR\fB[options]\fR\fB \fR\fB\fIdevpath\fR\fR .HP \w'\fBudevadm\ test\-builtin\ \fR\fB[options]\fR\fB\ \fR\fB\fIcommand\fR\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u @@ -349,41 +347,6 @@ Filter events by property\&. Only udev events with a given tag attached will pas .RS 4 Print help text\&. .RE -.SS "udevadm hwdb [\fIoptions\fR]" -.PP -Maintain the hardware database index in -/etc/udev/hwdb\&.bin\&. -.PP -\fB\-u\fR, \fB\-\-update\fR -.RS 4 -Compile the hardware database information located in /usr/lib/udev/hwdb\&.d/, /etc/udev/hwdb\&.d/ and store it in -/etc/udev/hwdb\&.bin\&. This should be done after any update to the source files; it will not be called automatically\&. The running udev daemon will detect a new database on its own and does not need to be notified about it\&. -.RE -.PP -\fB\-\-usr\fR -.RS 4 -Put the compiled database into -/usr/lib/udev/hwdb\&.bin -instead\&. Use this if you want to ship a pre\-compiled database in immutable system images, or don\*(Aqt use -/etc/udev/hwdb\&.d -and want to avoid large binary files in -/etc\&. -.RE -.PP -\fB\-t\fR, \fB\-\-test=\fR\fB\fIstring\fR\fR -.RS 4 -Query the database with a modalias string, and print the retrieved properties\&. -.RE -.PP -\fB\-r\fR, \fB\-\-root=\fR\fB\fIstring\fR\fR -.RS 4 -Alternative root path in the file system for reading and writing files\&. -.RE -.PP -\fB\-h\fR, \fB\-\-help\fR -.RS 4 -Print help text\&. -.RE .SS "udevadm test [\fIoptions\fR] [\fIdevpath\fR]" .PP Simulate a udev event run for the given device, and print debug output\&. diff --git a/man/udevadm.html b/man/udevadm.html index 44aeda086..ae35caafd 100644 --- a/man/udevadm.html +++ b/man/udevadm.html @@ -19,10 +19,10 @@ Directives · Python · libudev · - gudev systemd 218


Name

udevadm — udev management tool

Synopsis

udevadm [--debug] [--version] [--help]

udevadm info options

udevadm trigger [options]

udevadm settle [options]

udevadm control command

udevadm monitor [options]

udevadm hwdb [options]

udevadm test [options] devpath

udevadm test-builtin [options] command devpath

Description¶

udevadm expects a command and command + gudev systemd 219


Name

udevadm — udev management tool

Synopsis

udevadm [--debug] [--version] [--help]

udevadm info options

udevadm trigger [options]

udevadm settle [options]

udevadm control command

udevadm monitor [options]

udevadm test [options] devpath

udevadm test-builtin [options] command devpath

Description¶

udevadm expects a command and command specific options. It controls the runtime behavior of systemd-udevd, requests kernel events, manages - the event queue, and provides simple debugging mechanisms.

Options¶

--debug¶

Print debug messages to standard error.

--version¶

Print version number.

-h, --help¶

Print help text.

Options¶

--debug¶

Print debug messages to standard error.

--version¶

Print version number.

-h, --help¶

Print help text.

udevadm info @@ -56,7 +56,7 @@ lives on.

-e, --export-db¶

Export the content of the udev database.

-c, --cleanup-db¶

Cleanup the udev database.

--version¶

Print version.

-h, --help¶

Print help text.

In addition an optional positional argument can be used to specify a device name or a sys path. It must start with /dev or /sys - respectively.

udevadm trigger [options] @@ -89,14 +89,14 @@ device.

-h, --help¶

Print help text.

In addition optional positional arguments can be used to specify device names or sys paths. They must start with /dev or /sys - respectively.

udevadm settle [options] ¶

Watches the udev event queue, and exits if all current events are handled.

-t, --timeout=SECONDS¶

Maximum number of seconds to wait for the event queue to become empty. The default value is 120 seconds. A value of 0 will check if the queue is empty and always - return immediately.

-E, --exit-if-exists=FILE¶

Stop waiting if file exists.

-h, --help¶

Print help text.

udevadm control command¶

Modify the internal state of the running udev daemon.

-x, --exit¶

Signal and wait for systemd-udevd to exit.

-l, --log-priority=value¶

Set the internal log level of + return immediately.

-E, --exit-if-exists=FILE¶

Stop waiting if file exists.

-h, --help¶

Print help text.

udevadm control command¶

Modify the internal state of the running udev daemon.

-x, --exit¶

Signal and wait for systemd-udevd to exit.

-l, --log-priority=value¶

Set the internal log level of systemd-udevd. Valid values are the numerical syslog priorities or their textual representations: emerg, @@ -107,26 +107,14 @@ will be queued.

-S, --start-exec-queue¶

Signal systemd-udevd to enable the execution of events.

-R, --reload¶

Signal systemd-udevd to reload the rules files and other databases like the kernel module index. Reloading rules and databases does not apply any changes to already existing devices; the new configuration will only be applied to new events.

-p, --property=KEY=value¶

Set a global property for all events.

-m, --children-max=value¶

Set the maximum number of events, systemd-udevd will handle at the - same time.

--timeout=seconds¶

The maximum number of seconds to wait for a reply from systemd-udevd.

-h, --help¶

Print help text.

--timeout=seconds¶

The maximum number of seconds to wait for a reply from systemd-udevd.

-h, --help¶

Print help text.

udevadm monitor [options] ¶

Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event. -

-k, --kernel¶

Print the kernel uevents.

-u, --udev¶

Print the udev event after the rule processing.

-p, --property¶

Also print the properties of the event.

-s, --subsystem-match=string[/string]¶

Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.

-t, --tag-match=string¶

Filter events by property. Only udev events with a given tag attached will pass.

-h, --help¶

Print help text.

udevadm hwdb - [options] - ¶

Maintain the hardware database index in /etc/udev/hwdb.bin.

-u, --update¶

Compile the hardware database information located in /usr/lib/udev/hwdb.d/, - /etc/udev/hwdb.d/ and store it in /etc/udev/hwdb.bin. This should be done after - any update to the source files; it will not be called automatically. The running - udev daemon will detect a new database on its own and does not need to be - notified about it.

--usr¶

Put the compiled database into /usr/lib/udev/hwdb.bin instead. - Use this if you want to ship a pre-compiled database in immutable system images, or - don't use /etc/udev/hwdb.d and want to avoid large binary files in - /etc.

-t, --test=string¶

Query the database with a modalias string, and print the - retrieved properties.

-r, --root=string¶

Alternative root path in the file system for reading and writing files.

-h, --help¶

Print help text.

-k, --kernel¶

Print the kernel uevents.

-u, --udev¶

Print the udev event after the rule processing.

-p, --property¶

Also print the properties of the event.

-s, --subsystem-match=string[/string]¶

Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.

-t, --tag-match=string¶

Filter events by property. Only udev events with a given tag attached will pass.

-h, --help¶

Print help text.

udevadm test @@ -138,7 +126,7 @@ parsed. When set to late, names will be resolved for every event. When set to never, names will never be resolved - and all devices will be owned by root.

-h, --help¶

Print help text.

-h, --help¶

Print help text.

devpath] ¶

Run a built-in command COMMAND for device DEVPATH, and print debug - output.

-h, --help¶

Print help text.

See Also¶

udev(7), + output.

-h, --help¶

Print help text.

diff --git a/man/udevadm.xml b/man/udevadm.xml index 38c1935fa..8ef9e23aa 100644 --- a/man/udevadm.xml +++ b/man/udevadm.xml @@ -1,5 +1,4 @@ - @@ -48,9 +47,6 @@ udevadm monitor options - - udevadm hwdb options - udevadm test options devpath @@ -512,56 +508,6 @@ - udevadm hwdb - <arg choice="opt"><replaceable>options</replaceable></arg> - - Maintain the hardware database index in /etc/udev/hwdb.bin. - - - - - - Compile the hardware database information located in /usr/lib/udev/hwdb.d/, - /etc/udev/hwdb.d/ and store it in /etc/udev/hwdb.bin. This should be done after - any update to the source files; it will not be called automatically. The running - udev daemon will detect a new database on its own and does not need to be - notified about it. - - - - - - Put the compiled database into /usr/lib/udev/hwdb.bin instead. - Use this if you want to ship a pre-compiled database in immutable system images, or - don't use /etc/udev/hwdb.d and want to avoid large binary files in - /etc. - - - - - - - Query the database with a modalias string, and print the - retrieved properties. - - - - - - - Alternative root path in the file system for reading and writing files. - - - - - - - Print help text. - - - - - udevadm test <arg choice="opt"><replaceable>options</replaceable></arg> <arg><replaceable>devpath</replaceable></arg> diff --git a/man/user.conf.d.html b/man/user.conf.d.html index ef0fc2a36..45b790689 100644 --- a/man/user.conf.d.html +++ b/man/user.conf.d.html @@ -19,14 +19,14 @@ <a href="systemd.directives.html">Directives </a>· <a href="../python-systemd/index.html">Python </a>· <a href="../libudev/index.html">libudev </a>· - <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 218</span><hr><div class="refentry"><a name="systemd-system.conf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">/etc/systemd/system.conf</code></p><p><code class="filename">/etc/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/run/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/usr/lib/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/etc/systemd/user.conf</code></p><p><code class="filename">/etc/systemd/user.conf.d/*.conf</code></p><p><code class="filename">/run/systemd/user.conf.d/*.conf</code></p><p><code class="filename">/usr/lib/systemd/user.conf.d/*.conf</code></p></div><div class="refsect1"><a name="idm140581162333696"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>When run as a system instance, systemd interprets the - configuration file <code class="filename">system.conf</code> and the - files in <code class="filename">system.conf.d</code> directories; when - run as a user instance, systemd interprets the configuration - file <code class="filename">user.conf</code> and the files in - <code class="filename">user.conf.d</code> directories. These - configuration files contain a few settings controlling - basic manager operations.</p></div><div class="refsection"><a name="confd"></a><h2>Configuration Directories and Precedence</h2><p>Configuration files are read from directories in + <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="systemd-system.conf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-system.conf, system.conf.d, systemd-user.conf, user.conf.d — System and session service manager configuration files</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">/etc/systemd/system.conf</code></p><p><code class="filename">/etc/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/run/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/usr/lib/systemd/system.conf.d/*.conf</code></p><p><code class="filename">/etc/systemd/user.conf</code></p><p><code class="filename">/etc/systemd/user.conf.d/*.conf</code></p><p><code class="filename">/run/systemd/user.conf.d/*.conf</code></p><p><code class="filename">/usr/lib/systemd/user.conf.d/*.conf</code></p></div><div class="refsect1"><a name="idm140311371378672"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>When run as a system instance, systemd interprets the + configuration file <code class="filename">system.conf</code> and the files + in <code class="filename">system.conf.d</code> directories; when run as a + user instance, systemd interprets the configuration file + <code class="filename">user.conf</code> and the files in + <code class="filename">user.conf.d</code> directories. These configuration + files contain a few settings controlling basic manager + operations.</p></div><div class="refsection"><a name="confd"></a><h2>Configuration Directories and Precedence</h2><p>Configuration files are read from directories in <code class="filename">/etc/</code>, <code class="filename">/run/</code>, and <code class="filename">/usr/lib/</code>, in order of precedence. Each configuration file in these configuration directories shall be named in @@ -50,240 +50,153 @@ <code class="filename">/etc/</code>. This file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration - file.</p></div><div class="refsect1"><a name="idm140581162327632"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>All options are configured in the - "<code class="literal">[Manager]</code>" section:</p><div class="variablelist"><dl class="variablelist"><dt id="LogLevel="><span class="term"><code class="varname">LogLevel=</code>, </span><span class="term"><code class="varname">LogTarget=</code>, </span><span class="term"><code class="varname">LogColor=</code>, </span><span class="term"><code class="varname">LogLocation=</code>, </span><span class="term"><code class="varname">DumpCore=yes</code>, </span><span class="term"><code class="varname">CrashShell=no</code>, </span><span class="term"><code class="varname">ShowStatus=yes</code>, </span><span class="term"><code class="varname">CrashChVT=1</code>, </span><span class="term"><code class="varname">DefaultStandardOutput=journal</code>, </span><span class="term"><code class="varname">DefaultStandardError=inherit</code></span><a class="headerlink" title="Permalink to this term" href="#LogLevel=">¶</a></dt><dd><p>Configures various - parameters of basic manager - operation. These options may be - overridden by the respective command - line arguments. See - <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a> - for details about these command line - arguments.</p></dd><dt id="CPUAffinity="><span class="term"><code class="varname">CPUAffinity=</code></span><a class="headerlink" title="Permalink to this term" href="#CPUAffinity=">¶</a></dt><dd><p>Configures the initial - CPU affinity for the init - process. Takes a space-separated list - of CPU indices.</p></dd><dt id="JoinControllers=cpu,cpuacct net_cls,netprio"><span class="term"><code class="varname">JoinControllers=cpu,cpuacct net_cls,netprio</code></span><a class="headerlink" title="Permalink to this term" href="#JoinControllers=cpu,cpuacct%20net_cls,netprio">¶</a></dt><dd><p>Configures controllers - that shall be mounted in a single - hierarchy. By default, systemd will - mount all controllers which are - enabled in the kernel in individual - hierarchies, with the exception of - those listed in this setting. Takes a - space-separated list of comma-separated - controller names, in order - to allow multiple joined - hierarchies. Defaults to - 'cpu,cpuacct'. Pass an empty string to - ensure that systemd mounts all - controllers in separate - hierarchies.</p><p>Note that this option is only - applied once, at very early boot. If - you use an initial RAM disk (initrd) - that uses systemd, it might hence be - necessary to rebuild the initrd if - this option is changed, and make sure - the new configuration file is included - in it. Otherwise, the initrd might - mount the controller hierarchies in a - different configuration than intended, - and the main system cannot remount - them anymore.</p></dd><dt id="RuntimeWatchdogSec="><span class="term"><code class="varname">RuntimeWatchdogSec=</code>, </span><span class="term"><code class="varname">ShutdownWatchdogSec=</code></span><a class="headerlink" title="Permalink to this term" href="#RuntimeWatchdogSec=">¶</a></dt><dd><p>Configure the hardware - watchdog at runtime and at - reboot. Takes a timeout value in - seconds (or in other time units if - suffixed with "<code class="literal">ms</code>", - "<code class="literal">min</code>", - "<code class="literal">h</code>", - "<code class="literal">d</code>", - "<code class="literal">w</code>"). If - <code class="varname">RuntimeWatchdogSec=</code> - is set to a non-zero value, the - watchdog hardware - (<code class="filename">/dev/watchdog</code>) - will be programmed to automatically - reboot the system if it is not - contacted within the specified timeout - interval. The system manager will - ensure to contact it at least once in - half the specified timeout - interval. This feature requires a - hardware watchdog device to be - present, as it is commonly the case in - embedded and server systems. Not all - hardware watchdogs allow configuration - of the reboot timeout, in which case - the closest available timeout is - picked. <code class="varname">ShutdownWatchdogSec=</code> - may be used to configure the hardware - watchdog when the system is asked to - reboot. It works as a safety net to - ensure that the reboot takes place - even if a clean reboot attempt times - out. By default - <code class="varname">RuntimeWatchdogSec=</code> - defaults to 0 (off), and - <code class="varname">ShutdownWatchdogSec=</code> - to 10min. These settings have no - effect if a hardware watchdog is not - available.</p></dd><dt id="CapabilityBoundingSet="><span class="term"><code class="varname">CapabilityBoundingSet=</code></span><a class="headerlink" title="Permalink to this term" href="#CapabilityBoundingSet=">¶</a></dt><dd><p>Controls which - capabilities to include in the - capability bounding set for PID 1 and - its children. See - <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a> - for details. Takes a whitespace-separated - list of capability names as read by - <a href="cap_from_name.html"><span class="citerefentry"><span class="refentrytitle">cap_from_name</span>(3)</span></a>. - Capabilities listed will be included - in the bounding set, all others are - removed. If the list of capabilities - is prefixed with ~, all but the listed - capabilities will be included, the - effect of the assignment - inverted. Note that this option also - affects the respective capabilities in - the effective, permitted and - inheritable capability sets. The - capability bounding set may also be - individually configured for units - using the - <code class="varname">CapabilityBoundingSet=</code> - directive for units, but note that - capabilities dropped for PID 1 cannot - be regained in individual units, they - are lost for good.</p></dd><dt id="SystemCallArchitectures="><span class="term"><code class="varname">SystemCallArchitectures=</code></span><a class="headerlink" title="Permalink to this term" href="#SystemCallArchitectures=">¶</a></dt><dd><p>Takes a - space-separated list of architecture - identifiers. Selects from which - architectures system calls may be - invoked on this system. This may be - used as an effective way to disable - invocation of non-native binaries - system-wide, for example to prohibit - execution of 32-bit x86 binaries on - 64-bit x86-64 systems. This option - operates system-wide, and acts - similar to the - <code class="varname">SystemCallArchitectures=</code> - setting of unit files, see - <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a> - for details. This setting defaults to - the empty list, in which case no - filtering of system calls based on - architecture is applied. Known - architecture identifiers are - "<code class="literal">x86</code>", - "<code class="literal">x86-64</code>", - "<code class="literal">x32</code>", - "<code class="literal">arm</code>" and the special - identifier - "<code class="literal">native</code>". The latter - implicitly maps to the native - architecture of the system (or more - specifically, the architecture the - system manager was compiled for). Set - this setting to - "<code class="literal">native</code>" to prohibit - execution of any non-native - binaries. When a binary executes a - system call of an architecture that is - not listed in this setting, it will be - immediately terminated with the SIGSYS - signal.</p></dd><dt id="TimerSlackNSec="><span class="term"><code class="varname">TimerSlackNSec=</code></span><a class="headerlink" title="Permalink to this term" href="#TimerSlackNSec=">¶</a></dt><dd><p>Sets the timer slack - in nanoseconds for PID 1, which is - inherited by all executed processes, - unless overridden individually, for - example with the - <code class="varname">TimerSlackNSec=</code> - setting in service units (for details - see - <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>). The - timer slack controls the accuracy of - wake-ups triggered by system - timers. See - <a href="http://man7.org/linux/man-pages/man2/prctl.2.html"><span class="citerefentry"><span class="refentrytitle">prctl</span>(2)</span></a> - for more information. Note that in - contrast to most other time span - definitions this parameter takes an - integer value in nano-seconds if no - unit is specified. The usual time - units are understood - too.</p></dd><dt id="DefaultTimerAccuracySec="><span class="term"><code class="varname">DefaultTimerAccuracySec=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultTimerAccuracySec=">¶</a></dt><dd><p>Sets the default - accuracy of timer units. This controls - the global default for the - <code class="varname">AccuracySec=</code> - setting of timer units, see - <a href="systemd.timer.html"><span class="citerefentry"><span class="refentrytitle">systemd.timer</span>(5)</span></a> - for - details. <code class="varname">AccuracySec=</code> - set in individual units override the - global default for the specific - unit. Defaults to 1min. Note that the - accuracy of timer units is also - affected by the configured timer slack - for PID 1, see - <code class="varname">TimerSlackNSec=</code> - above.</p></dd><dt id="DefaultTimeoutStartSec="><span class="term"><code class="varname">DefaultTimeoutStartSec=</code>, </span><span class="term"><code class="varname">DefaultTimeoutStopSec=</code>, </span><span class="term"><code class="varname">DefaultRestartSec=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultTimeoutStartSec=">¶</a></dt><dd><p>Configures the default - timeouts for starting and stopping of - units, as well as the default time to - sleep between automatic restarts of - units, as configured per-unit in - <code class="varname">TimeoutStartSec=</code>, - <code class="varname">TimeoutStopSec=</code> and - <code class="varname">RestartSec=</code> (for - services, see - <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a> - for details on the per-unit - settings). For non-service units, - <code class="varname">DefaultTimeoutStartSec=</code> - sets the default - <code class="varname">TimeoutSec=</code> value. - </p></dd><dt id="DefaultStartLimitInterval="><span class="term"><code class="varname">DefaultStartLimitInterval=</code>, </span><span class="term"><code class="varname">DefaultStartLimitBurst=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultStartLimitInterval=">¶</a></dt><dd><p>Configure the default - unit start rate limiting, as - configured per-service by - <code class="varname">StartLimitInterval=</code> - and - <code class="varname">StartLimitBurst=</code>. See - <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a> - for details on the per-service - settings.</p></dd><dt id="DefaultEnvironment="><span class="term"><code class="varname">DefaultEnvironment=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultEnvironment=">¶</a></dt><dd><p>Sets manager - environment variables passed to all - executed processes. Takes a - space-separated list of variable - assignments. See - <a href="http://man7.org/linux/man-pages/man7/environ.7.html"><span class="citerefentry"><span class="refentrytitle">environ</span>(7)</span></a> - for details about environment - variables.</p><p>Example: + file.</p></div><div class="refsect1"><a name="idm140311371372688"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>All options are configured in the + "<code class="literal">[Manager]</code>" section:</p><div class="variablelist"><dl class="variablelist"><dt id="LogLevel="><span class="term"><code class="varname">LogLevel=</code>, </span><span class="term"><code class="varname">LogTarget=</code>, </span><span class="term"><code class="varname">LogColor=</code>, </span><span class="term"><code class="varname">LogLocation=</code>, </span><span class="term"><code class="varname">DumpCore=yes</code>, </span><span class="term"><code class="varname">CrashShell=no</code>, </span><span class="term"><code class="varname">ShowStatus=yes</code>, </span><span class="term"><code class="varname">CrashChVT=1</code>, </span><span class="term"><code class="varname">DefaultStandardOutput=journal</code>, </span><span class="term"><code class="varname">DefaultStandardError=inherit</code></span><a class="headerlink" title="Permalink to this term" href="#LogLevel=">¶</a></dt><dd><p>Configures various parameters of basic manager + operation. These options may be overridden by the respective + command line arguments. See + <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a> + for details about these command line + arguments.</p></dd><dt id="CPUAffinity="><span class="term"><code class="varname">CPUAffinity=</code></span><a class="headerlink" title="Permalink to this term" href="#CPUAffinity=">¶</a></dt><dd><p>Configures the initial CPU affinity for the + init process. Takes a space-separated list of CPU + indices.</p></dd><dt id="JoinControllers=cpu,cpuacct net_cls,netprio"><span class="term"><code class="varname">JoinControllers=cpu,cpuacct net_cls,netprio</code></span><a class="headerlink" title="Permalink to this term" href="#JoinControllers=cpu,cpuacct%20net_cls,netprio">¶</a></dt><dd><p>Configures controllers that shall be mounted + in a single hierarchy. By default, systemd will mount all + controllers which are enabled in the kernel in individual + hierarchies, with the exception of those listed in this + setting. Takes a space-separated list of comma-separated + controller names, in order to allow multiple joined + hierarchies. Defaults to 'cpu,cpuacct'. Pass an empty string + to ensure that systemd mounts all controllers in separate + hierarchies.</p><p>Note that this option is only applied once, at very + early boot. If you use an initial RAM disk (initrd) that uses + systemd, it might hence be necessary to rebuild the initrd if + this option is changed, and make sure the new configuration + file is included in it. Otherwise, the initrd might mount the + controller hierarchies in a different configuration than + intended, and the main system cannot remount them + anymore.</p></dd><dt id="RuntimeWatchdogSec="><span class="term"><code class="varname">RuntimeWatchdogSec=</code>, </span><span class="term"><code class="varname">ShutdownWatchdogSec=</code></span><a class="headerlink" title="Permalink to this term" href="#RuntimeWatchdogSec=">¶</a></dt><dd><p>Configure the hardware watchdog at runtime and + at reboot. Takes a timeout value in seconds (or in other time + units if suffixed with "<code class="literal">ms</code>", + "<code class="literal">min</code>", "<code class="literal">h</code>", + "<code class="literal">d</code>", "<code class="literal">w</code>"). If + <code class="varname">RuntimeWatchdogSec=</code> is set to a non-zero + value, the watchdog hardware + (<code class="filename">/dev/watchdog</code>) will be programmed to + automatically reboot the system if it is not contacted within + the specified timeout interval. The system manager will ensure + to contact it at least once in half the specified timeout + interval. This feature requires a hardware watchdog device to + be present, as it is commonly the case in embedded and server + systems. Not all hardware watchdogs allow configuration of the + reboot timeout, in which case the closest available timeout is + picked. <code class="varname">ShutdownWatchdogSec=</code> may be used to + configure the hardware watchdog when the system is asked to + reboot. It works as a safety net to ensure that the reboot + takes place even if a clean reboot attempt times out. By + default <code class="varname">RuntimeWatchdogSec=</code> defaults to 0 + (off), and <code class="varname">ShutdownWatchdogSec=</code> to 10min. + These settings have no effect if a hardware watchdog is not + available.</p></dd><dt id="CapabilityBoundingSet="><span class="term"><code class="varname">CapabilityBoundingSet=</code></span><a class="headerlink" title="Permalink to this term" href="#CapabilityBoundingSet=">¶</a></dt><dd><p>Controls which capabilities to include in the + capability bounding set for PID 1 and its children. See + <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a> + for details. Takes a whitespace-separated list of capability + names as read by + <a href="cap_from_name.html"><span class="citerefentry"><span class="refentrytitle">cap_from_name</span>(3)</span></a>. + Capabilities listed will be included in the bounding set, all + others are removed. If the list of capabilities is prefixed + with ~, all but the listed capabilities will be included, the + effect of the assignment inverted. Note that this option also + affects the respective capabilities in the effective, + permitted and inheritable capability sets. The capability + bounding set may also be individually configured for units + using the <code class="varname">CapabilityBoundingSet=</code> directive + for units, but note that capabilities dropped for PID 1 cannot + be regained in individual units, they are lost for + good.</p></dd><dt id="SystemCallArchitectures="><span class="term"><code class="varname">SystemCallArchitectures=</code></span><a class="headerlink" title="Permalink to this term" href="#SystemCallArchitectures=">¶</a></dt><dd><p>Takes a space-separated list of architecture + identifiers. Selects from which architectures system calls may + be invoked on this system. This may be used as an effective + way to disable invocation of non-native binaries system-wide, + for example to prohibit execution of 32-bit x86 binaries on + 64-bit x86-64 systems. This option operates system-wide, and + acts similar to the + <code class="varname">SystemCallArchitectures=</code> setting of unit + files, see + <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a> + for details. This setting defaults to the empty list, in which + case no filtering of system calls based on architecture is + applied. Known architecture identifiers are + "<code class="literal">x86</code>", "<code class="literal">x86-64</code>", + "<code class="literal">x32</code>", "<code class="literal">arm</code>" and the special + identifier "<code class="literal">native</code>". The latter implicitly + maps to the native architecture of the system (or more + specifically, the architecture the system manager was compiled + for). Set this setting to "<code class="literal">native</code>" to + prohibit execution of any non-native binaries. When a binary + executes a system call of an architecture that is not listed + in this setting, it will be immediately terminated with the + SIGSYS signal.</p></dd><dt id="TimerSlackNSec="><span class="term"><code class="varname">TimerSlackNSec=</code></span><a class="headerlink" title="Permalink to this term" href="#TimerSlackNSec=">¶</a></dt><dd><p>Sets the timer slack in nanoseconds for PID 1, + which is inherited by all executed processes, unless + overridden individually, for example with the + <code class="varname">TimerSlackNSec=</code> setting in service units + (for details see + <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>). + The timer slack controls the accuracy of wake-ups triggered by + system timers. See + <a href="http://man7.org/linux/man-pages/man2/prctl.2.html"><span class="citerefentry"><span class="refentrytitle">prctl</span>(2)</span></a> + for more information. Note that in contrast to most other time + span definitions this parameter takes an integer value in + nano-seconds if no unit is specified. The usual time units are + understood too.</p></dd><dt id="DefaultTimerAccuracySec="><span class="term"><code class="varname">DefaultTimerAccuracySec=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultTimerAccuracySec=">¶</a></dt><dd><p>Sets the default accuracy of timer units. This + controls the global default for the + <code class="varname">AccuracySec=</code> setting of timer units, see + <a href="systemd.timer.html"><span class="citerefentry"><span class="refentrytitle">systemd.timer</span>(5)</span></a> + for details. <code class="varname">AccuracySec=</code> set in individual + units override the global default for the specific unit. + Defaults to 1min. Note that the accuracy of timer units is + also affected by the configured timer slack for PID 1, see + <code class="varname">TimerSlackNSec=</code> above.</p></dd><dt id="DefaultTimeoutStartSec="><span class="term"><code class="varname">DefaultTimeoutStartSec=</code>, </span><span class="term"><code class="varname">DefaultTimeoutStopSec=</code>, </span><span class="term"><code class="varname">DefaultRestartSec=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultTimeoutStartSec=">¶</a></dt><dd><p>Configures the default timeouts for starting + and stopping of units, as well as the default time to sleep + between automatic restarts of units, as configured per-unit in + <code class="varname">TimeoutStartSec=</code>, + <code class="varname">TimeoutStopSec=</code> and + <code class="varname">RestartSec=</code> (for services, see + <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a> + for details on the per-unit settings). For non-service units, + <code class="varname">DefaultTimeoutStartSec=</code> sets the default + <code class="varname">TimeoutSec=</code> value. </p></dd><dt id="DefaultStartLimitInterval="><span class="term"><code class="varname">DefaultStartLimitInterval=</code>, </span><span class="term"><code class="varname">DefaultStartLimitBurst=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultStartLimitInterval=">¶</a></dt><dd><p>Configure the default unit start rate + limiting, as configured per-service by + <code class="varname">StartLimitInterval=</code> and + <code class="varname">StartLimitBurst=</code>. See + <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a> + for details on the per-service settings.</p></dd><dt id="DefaultEnvironment="><span class="term"><code class="varname">DefaultEnvironment=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultEnvironment=">¶</a></dt><dd><p>Sets manager environment variables passed to + all executed processes. Takes a space-separated list of + variable assignments. See + <a href="http://man7.org/linux/man-pages/man7/environ.7.html"><span class="citerefentry"><span class="refentrytitle">environ</span>(7)</span></a> + for details about environment variables.</p><p>Example: - </p><pre class="programlisting">DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</pre><p> + </p><pre class="programlisting">DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</pre><p> - Sets three variables - "<code class="literal">VAR1</code>", - "<code class="literal">VAR2</code>", - "<code class="literal">VAR3</code>".</p></dd><dt id="DefaultCPUAccounting="><span class="term"><code class="varname">DefaultCPUAccounting=</code>, </span><span class="term"><code class="varname">DefaultBlockIOAccounting=</code>, </span><span class="term"><code class="varname">DefaultMemoryAccounting=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultCPUAccounting=">¶</a></dt><dd><p>Configure the default - resource accounting settings, as - configured per-unit by - <code class="varname">CPUAccounting=</code>, - <code class="varname">BlockIOAccounting=</code> - and - <code class="varname">MemoryAccounting=</code>. See - <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a> - for details on the per-unit - settings.</p></dd><dt id="DefaultLimitCPU="><span class="term"><code class="varname">DefaultLimitCPU=</code>, </span><span class="term"><code class="varname">DefaultLimitFSIZE=</code>, </span><span class="term"><code class="varname">DefaultLimitDATA=</code>, </span><span class="term"><code class="varname">DefaultLimitSTACK=</code>, </span><span class="term"><code class="varname">DefaultLimitCORE=</code>, </span><span class="term"><code class="varname">DefaultLimitRSS=</code>, </span><span class="term"><code class="varname">DefaultLimitNOFILE=</code>, </span><span class="term"><code class="varname">DefaultLimitAS=</code>, </span><span class="term"><code class="varname">DefaultLimitNPROC=</code>, </span><span class="term"><code class="varname">DefaultLimitMEMLOCK=</code>, </span><span class="term"><code class="varname">DefaultLimitLOCKS=</code>, </span><span class="term"><code class="varname">DefaultLimitSIGPENDING=</code>, </span><span class="term"><code class="varname">DefaultLimitMSGQUEUE=</code>, </span><span class="term"><code class="varname">DefaultLimitNICE=</code>, </span><span class="term"><code class="varname">DefaultLimitRTPRIO=</code>, </span><span class="term"><code class="varname">DefaultLimitRTTIME=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultLimitCPU=">¶</a></dt><dd><p>These settings control - various default resource limits for - units. See - <a href="http://man7.org/linux/man-pages/man2/setrlimit.2.html"><span class="citerefentry"><span class="refentrytitle">setrlimit</span>(2)</span></a> - for details. Use the string - <code class="varname">infinity</code> to - configure no limit on a specific - resource. These settings may be - overridden in individual units - using the corresponding LimitXXX= - directives. Note that these resource - limits are only defaults for units, - they are not applied to PID 1 - itself.</p></dd></dl></div></div><div class="refsect1"><a name="idm140581161227200"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p> - <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>, - <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>, - <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>, - <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>, - <a href="http://man7.org/linux/man-pages/man7/environ.7.html"><span class="citerefentry"><span class="refentrytitle">environ</span>(7)</span></a>, - <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a> - </p></div></div></body></html> + Sets three variables + "<code class="literal">VAR1</code>", + "<code class="literal">VAR2</code>", + "<code class="literal">VAR3</code>".</p></dd><dt id="DefaultCPUAccounting="><span class="term"><code class="varname">DefaultCPUAccounting=</code>, </span><span class="term"><code class="varname">DefaultBlockIOAccounting=</code>, </span><span class="term"><code class="varname">DefaultMemoryAccounting=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultCPUAccounting=">¶</a></dt><dd><p>Configure the default resource accounting + settings, as configured per-unit by + <code class="varname">CPUAccounting=</code>, + <code class="varname">BlockIOAccounting=</code> and + <code class="varname">MemoryAccounting=</code>. See + <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a> + for details on the per-unit settings.</p></dd><dt id="DefaultLimitCPU="><span class="term"><code class="varname">DefaultLimitCPU=</code>, </span><span class="term"><code class="varname">DefaultLimitFSIZE=</code>, </span><span class="term"><code class="varname">DefaultLimitDATA=</code>, </span><span class="term"><code class="varname">DefaultLimitSTACK=</code>, </span><span class="term"><code class="varname">DefaultLimitCORE=</code>, </span><span class="term"><code class="varname">DefaultLimitRSS=</code>, </span><span class="term"><code class="varname">DefaultLimitNOFILE=</code>, </span><span class="term"><code class="varname">DefaultLimitAS=</code>, </span><span class="term"><code class="varname">DefaultLimitNPROC=</code>, </span><span class="term"><code class="varname">DefaultLimitMEMLOCK=</code>, </span><span class="term"><code class="varname">DefaultLimitLOCKS=</code>, </span><span class="term"><code class="varname">DefaultLimitSIGPENDING=</code>, </span><span class="term"><code class="varname">DefaultLimitMSGQUEUE=</code>, </span><span class="term"><code class="varname">DefaultLimitNICE=</code>, </span><span class="term"><code class="varname">DefaultLimitRTPRIO=</code>, </span><span class="term"><code class="varname">DefaultLimitRTTIME=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultLimitCPU=">¶</a></dt><dd><p>These settings control various default + resource limits for units. See + <a href="http://man7.org/linux/man-pages/man2/setrlimit.2.html"><span class="citerefentry"><span class="refentrytitle">setrlimit</span>(2)</span></a> + for details. Use the string <code class="varname">infinity</code> to + configure no limit on a specific resource. These settings may + be overridden in individual units using the corresponding + LimitXXX= directives. Note that these resource limits are only + defaults for units, they are not applied to PID 1 + itself.</p></dd></dl></div></div><div class="refsect1"><a name="idm140311370277552"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p> + <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>, + <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>, + <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>, + <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>, + <a href="http://man7.org/linux/man-pages/man7/environ.7.html"><span class="citerefentry"><span class="refentrytitle">environ</span>(7)</span></a>, + <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a> + </p></div></div></body></html> diff --git a/man/vconsole.conf.5 b/man/vconsole.conf.5 index a608a8bc6..0eb60523a 100644 --- a/man/vconsole.conf.5 +++ b/man/vconsole.conf.5 @@ -1,5 +1,5 @@ '\" t -.TH "VCONSOLE\&.CONF" "5" "" "systemd 218" "vconsole.conf" +.TH "VCONSOLE\&.CONF" "5" "" "systemd 219" "vconsole.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -74,7 +74,7 @@ Configures the console font, the console map and the unicode font map\&. .\} .nf KEYMAP=de\-latin1 -FONT=latarcyrheb\-sun16 +FONT=eurlatgr .fi .if n \{\ .RE diff --git a/man/vconsole.conf.html b/man/vconsole.conf.html index 62fbf76b1..55d46dbec 100644 --- a/man/vconsole.conf.html +++ b/man/vconsole.conf.html @@ -19,42 +19,35 @@ <a href="systemd.directives.html">Directives </a>· <a href="../python-systemd/index.html">Python </a>· <a href="../libudev/index.html">libudev </a>· - <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 218</span><hr><div class="refentry"><a name="vconsole.conf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vconsole.conf — Configuration file for the virtual console</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">/etc/vconsole.conf</code></p></div><div class="refsect1"><a name="idm140252371531152"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>The <code class="filename">/etc/vconsole.conf</code> file - configures the virtual console, i.e. keyboard mapping - and console font. It is applied at boot by - <a href="systemd-vconsole-setup.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-vconsole-setup.service</span>(8)</span></a>.</p><p>The basic file format of the - <code class="filename">vconsole.conf</code> is a - newline-separated list of environment-like - shell-compatible variable assignments. It is possible - to source the configuration from shell scripts, - however, beyond mere variable assignments no shell - features are supported, allowing applications to read - the file without implementing a shell compatible - execution engine.</p><p>Note that the kernel command line options - <code class="varname">vconsole.keymap=</code>, - <code class="varname">vconsole.keymap.toggle=</code>, - <code class="varname">vconsole.font=</code>, - <code class="varname">vconsole.font.map=</code>, - <code class="varname">vconsole.font.unimap=</code> may be used - to override the console settings at boot.</p><p>Depending on the operating system other - configuration files might be checked for configuration - of the virtual console as well, however only as - fallback.</p></div><div class="refsect1"><a name="idm140252372704256"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="KEYMAP="><span class="term"><code class="varname">KEYMAP=</code>, </span><span class="term"><code class="varname">KEYMAP_TOGGLE=</code></span><a class="headerlink" title="Permalink to this term" href="#KEYMAP=">¶</a></dt><dd><p>Configures the key - mapping table for the - keyboard. <code class="varname">KEYMAP=</code> - defaults to "<code class="literal">us</code>" if - not set. The - <code class="varname">KEYMAP_TOGGLE=</code> can - be used to configure a second toggle - keymap and is by default - unset.</p></dd><dt id="FONT="><span class="term"><code class="varname">FONT=</code>, </span><span class="term"><code class="varname">FONT_MAP=</code>, </span><span class="term"><code class="varname">FONT_UNIMAP=</code></span><a class="headerlink" title="Permalink to this term" href="#FONT=">¶</a></dt><dd><p>Configures the console - font, the console map and the unicode - font map.</p></dd></dl></div></div><div class="refsect1"><a name="idm140252372913248"></a><h2 id="Example">Example<a class="headerlink" title="Permalink to this headline" href="#Example">¶</a></h2><div class="example"><a name="idm140252371267648"></a><p class="title"><b>Example 1. German keyboard and console</b></p><div class="example-contents"><p><code class="filename">/etc/vconsole.conf</code>:</p><pre class="programlisting">KEYMAP=de-latin1 -FONT=latarcyrheb-sun16</pre></div></div><br class="example-break"></div><div class="refsect1"><a name="idm140252373883168"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p> - <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>, - <a href="systemd-vconsole-setup.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-vconsole-setup.service</span>(8)</span></a>, - <a href="loadkeys.html"><span class="citerefentry"><span class="refentrytitle">loadkeys</span>(1)</span></a>, - <a href="setfont.html"><span class="citerefentry"><span class="refentrytitle">setfont</span>(8)</span></a>, - <a href="locale.conf.html"><span class="citerefentry"><span class="refentrytitle">locale.conf</span>(5)</span></a>, - <a href="systemd-localed.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-localed.service</span>(8)</span></a> - </p></div></div></body></html> + <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="vconsole.conf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vconsole.conf — Configuration file for the virtual console</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">/etc/vconsole.conf</code></p></div><div class="refsect1"><a name="idm140384138872096"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>The <code class="filename">/etc/vconsole.conf</code> file configures + the virtual console, i.e. keyboard mapping and console font. It is + applied at boot by + <a href="systemd-vconsole-setup.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-vconsole-setup.service</span>(8)</span></a>.</p><p>The basic file format of the + <code class="filename">vconsole.conf</code> is a newline-separated list of + environment-like shell-compatible variable assignments. It is + possible to source the configuration from shell scripts, however, + beyond mere variable assignments no shell features are supported, + allowing applications to read the file without implementing a + shell compatible execution engine.</p><p>Note that the kernel command line options + <code class="varname">vconsole.keymap=</code>, + <code class="varname">vconsole.keymap.toggle=</code>, + <code class="varname">vconsole.font=</code>, + <code class="varname">vconsole.font.map=</code>, + <code class="varname">vconsole.font.unimap=</code> may be used + to override the console settings at boot.</p><p>Depending on the operating system other configuration files + might be checked for configuration of the virtual console as well, + however only as fallback.</p></div><div class="refsect1"><a name="idm140384138864576"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="KEYMAP="><span class="term"><code class="varname">KEYMAP=</code>, </span><span class="term"><code class="varname">KEYMAP_TOGGLE=</code></span><a class="headerlink" title="Permalink to this term" href="#KEYMAP=">¶</a></dt><dd><p>Configures the key mapping table for the + keyboard. <code class="varname">KEYMAP=</code> defaults to + "<code class="literal">us</code>" if not set. The + <code class="varname">KEYMAP_TOGGLE=</code> can be used to configure a + second toggle keymap and is by default + unset.</p></dd><dt id="FONT="><span class="term"><code class="varname">FONT=</code>, </span><span class="term"><code class="varname">FONT_MAP=</code>, </span><span class="term"><code class="varname">FONT_UNIMAP=</code></span><a class="headerlink" title="Permalink to this term" href="#FONT=">¶</a></dt><dd><p>Configures the console font, the console map + and the unicode font map.</p></dd></dl></div></div><div class="refsect1"><a name="idm140384142756352"></a><h2 id="Example">Example<a class="headerlink" title="Permalink to this headline" href="#Example">¶</a></h2><div class="example"><a name="idm140384142755680"></a><p class="title"><b>Example 1. German keyboard and console</b></p><div class="example-contents"><p><code class="filename">/etc/vconsole.conf</code>:</p><pre class="programlisting">KEYMAP=de-latin1 +FONT=eurlatgr</pre></div></div><br class="example-break"></div><div class="refsect1"><a name="idm140384142753088"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p> + <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>, + <a href="systemd-vconsole-setup.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-vconsole-setup.service</span>(8)</span></a>, + <a href="loadkeys.html"><span class="citerefentry"><span class="refentrytitle">loadkeys</span>(1)</span></a>, + <a href="setfont.html"><span class="citerefentry"><span class="refentrytitle">setfont</span>(8)</span></a>, + <a href="locale.conf.html"><span class="citerefentry"><span class="refentrytitle">locale.conf</span>(5)</span></a>, + <a href="systemd-localed.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-localed.service</span>(8)</span></a> + </p></div></div></body></html> diff --git a/man/vconsole.conf.xml b/man/vconsole.conf.xml index 09a477670..17bea8b68 100644 --- a/man/vconsole.conf.xml +++ b/man/vconsole.conf.xml @@ -1,7 +1,6 @@ <?xml version='1.0'?> <!--*-nxml-*--> -<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <!-- This file is part of systemd. @@ -23,125 +22,118 @@ --> <refentry id="vconsole.conf" conditional='ENABLE_VCONSOLE'> - <refentryinfo> - <title>vconsole.conf - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - vconsole.conf - 5 - - - - vconsole.conf - Configuration file for the virtual console - - - - /etc/vconsole.conf - - - - Description - - The /etc/vconsole.conf file - configures the virtual console, i.e. keyboard mapping - and console font. It is applied at boot by - systemd-vconsole-setup.service8. - - The basic file format of the - vconsole.conf is a - newline-separated list of environment-like - shell-compatible variable assignments. It is possible - to source the configuration from shell scripts, - however, beyond mere variable assignments no shell - features are supported, allowing applications to read - the file without implementing a shell compatible - execution engine. - - Note that the kernel command line options - vconsole.keymap=, - vconsole.keymap.toggle=, - vconsole.font=, - vconsole.font.map=, - vconsole.font.unimap= may be used - to override the console settings at boot. - - Depending on the operating system other - configuration files might be checked for configuration - of the virtual console as well, however only as - fallback. - - - - Options - - The following options are understood: - - - - - KEYMAP= - KEYMAP_TOGGLE= - - Configures the key - mapping table for the - keyboard. KEYMAP= - defaults to us if - not set. The - KEYMAP_TOGGLE= can - be used to configure a second toggle - keymap and is by default - unset. - - - - FONT= - FONT_MAP= - FONT_UNIMAP= - - Configures the console - font, the console map and the unicode - font map. - - - - - - - Example - - - German keyboard and console - - /etc/vconsole.conf: - - KEYMAP=de-latin1 -FONT=latarcyrheb-sun16 - - - - - - See Also - - systemd1, - systemd-vconsole-setup.service8, - loadkeys1, - setfont8, - locale.conf5, - systemd-localed.service8 - - + + vconsole.conf + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + vconsole.conf + 5 + + + + vconsole.conf + Configuration file for the virtual console + + + + /etc/vconsole.conf + + + + Description + + The /etc/vconsole.conf file configures + the virtual console, i.e. keyboard mapping and console font. It is + applied at boot by + systemd-vconsole-setup.service8. + + The basic file format of the + vconsole.conf is a newline-separated list of + environment-like shell-compatible variable assignments. It is + possible to source the configuration from shell scripts, however, + beyond mere variable assignments no shell features are supported, + allowing applications to read the file without implementing a + shell compatible execution engine. + + Note that the kernel command line options + vconsole.keymap=, + vconsole.keymap.toggle=, + vconsole.font=, + vconsole.font.map=, + vconsole.font.unimap= may be used + to override the console settings at boot. + + Depending on the operating system other configuration files + might be checked for configuration of the virtual console as well, + however only as fallback. + + + + Options + + The following options are understood: + + + + + KEYMAP= + KEYMAP_TOGGLE= + + Configures the key mapping table for the + keyboard. KEYMAP= defaults to + us if not set. The + KEYMAP_TOGGLE= can be used to configure a + second toggle keymap and is by default + unset. + + + + FONT= + FONT_MAP= + FONT_UNIMAP= + + Configures the console font, the console map + and the unicode font map. + + + + + + + Example + + + German keyboard and console + + /etc/vconsole.conf: + + KEYMAP=de-latin1 +FONT=eurlatgr + + + + + + See Also + + systemd1, + systemd-vconsole-setup.service8, + loadkeys1, + setfont8, + locale.conf5, + systemd-localed.service8 + + diff --git a/network/80-container-host0.network b/network/80-container-host0.network index 6863ca9ce..a778ecfef 100644 --- a/network/80-container-host0.network +++ b/network/80-container-host0.network @@ -10,5 +10,5 @@ Virtualization=container Name=host0 [Network] -DHCP=both -IPv4LL=yes +DHCP=yes +LinkLocalAddressing=yes diff --git a/network/80-container-ve.network b/network/80-container-ve.network index cb04c7cb3..72c20eba5 100644 --- a/network/80-container-ve.network +++ b/network/80-container-ve.network @@ -10,6 +10,8 @@ Name=ve-* Driver=veth [Network] +# Default to using a /28 prefix, giving up to 13 addresses per container. Address=0.0.0.0/28 -IPv4LL=yes +LinkLocalAddressing=yes DHCPServer=yes +IPMasquerade=yes diff --git a/po/LINGUAS b/po/LINGUAS index f214ece48..2ec9f827d 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,7 +1,10 @@ de el fr +hu it pl +pt_BR ru uk +sv diff --git a/po/POTFILES.in b/po/POTFILES.in index 2829c87f1..b4c1121d1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,5 +1,7 @@ +src/core/org.freedesktop.systemd1.policy.in.in src/hostname/org.freedesktop.hostname1.policy.in +src/import/org.freedesktop.import1.policy.in src/locale/org.freedesktop.locale1.policy.in src/login/org.freedesktop.login1.policy.in +src/machine/org.freedesktop.machine1.policy.in src/timedate/org.freedesktop.timedate1.policy.in -src/core/org.freedesktop.systemd1.policy.in.in diff --git a/po/de.po b/po/de.po index a41e33dc2..69c1fb9f8 100644 --- a/po/de.po +++ b/po/de.po @@ -9,16 +9,59 @@ msgstr "" "Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?" "product=systemd&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2014-06-02 10:25+0000\n" -"PO-Revision-Date: 2014-06-02 22:43+0100\n" -"Last-Translator: Benjamin Steinwender \n" +"POT-Creation-Date: 2015-01-22 14:27+0000\n" +"PO-Revision-Date: 2015-01-29 19:00+0100\n" +"Last-Translator: Christian Kirbach \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.6.5\n" +"X-Generator: Poedit 1.5.4\n" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Passphrase zurück an das System senden" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "" +"Legitimierung ist zum Senden des eingegebenen Kennworts zurück an das System " +"notwendig." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Systemdienste und Einheiten verwalten" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +#| msgid "Authentication is required to access the system and service manager." +msgid "Authentication is required to manage system services or units." +msgstr "" +"Legitimierung ist notwendig für die Verwaltung von Systemdiensten und " +"Einheiten" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Systemdienste und Einheitendateien verwalten" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +#| msgid "Authentication is required to access the system and service manager." +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"Legitimierung ist notwendig für die Verwaltung von Systemdiensten und " +"Einheitendateien." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +#| msgid "Reboot the system" +msgid "Reload the systemd state" +msgstr "Den systemd-Zustand neu laden" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +#| msgid "Authentication is required to set the system time." +msgid "Authentication is required to reload the systemd state." +msgstr "Legitimierung ist zum erneuten Laden des systemd-Zustands notwendig." #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 msgid "Set host name" @@ -50,6 +93,17 @@ msgstr "" "Legitimierung ist zum Festlegen der lokalen Maschinen-Information " "erforderlich." +#: ../src/import/org.freedesktop.import1.policy.in.h:1 +msgid "Download a VM or container image" +msgstr "Abbild einer VM oder eines Containers herunterladen" + +#: ../src/import/org.freedesktop.import1.policy.in.h:2 +#| msgid "Authentication is required to set local machine information." +msgid "Authentication is required to download a VM or container image" +msgstr "" +"Legitimierung ist zum Herunterladen eines VM- oder Containerabbilds " +"erforderlich" + #: ../src/locale/org.freedesktop.locale1.policy.in.h:1 msgid "Set system locale" msgstr "Die lokale Sprachumgebung festlegen" @@ -76,8 +130,7 @@ msgstr "Anwendungen dürfen das Herunterfahren des Systems unterbinden" #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " -"shutdown." +"Authentication is required for an application to inhibit system shutdown." msgstr "" "Legitimierung ist notwendig, um Anwendungen das Herunterfahren des Systems " "zu erlauben." @@ -87,8 +140,7 @@ msgid "Allow applications to delay system shutdown" msgstr "Anwendungen dürfen das Herunterfahren des Systems verzögern" #: ../src/login/org.freedesktop.login1.policy.in.h:4 -msgid "" -"Authentication is required to allow an application to delay system shutdown." +msgid "Authentication is required for an application to delay system shutdown." msgstr "" "Legitimierung ist notwendig, um Anwendungen das Verzögern des Herunterfahren " "des Systems zu erlauben." @@ -98,8 +150,7 @@ msgid "Allow applications to inhibit system sleep" msgstr "Anwendungen dürfen den Bereitschaftsmodus unterbinden" #: ../src/login/org.freedesktop.login1.policy.in.h:6 -msgid "" -"Authentication is required to allow an application to inhibit system sleep." +msgid "Authentication is required for an application to inhibit system sleep." msgstr "" "Legitimierung ist erforderlich, um Anwendungen das Unterbinden des " "Bereitschaftsmodus zu erlauben." @@ -109,8 +160,7 @@ msgid "Allow applications to delay system sleep" msgstr "Anwendungen dürfen den Bereitschaftsmodus verzögern" #: ../src/login/org.freedesktop.login1.policy.in.h:8 -msgid "" -"Authentication is required to allow an application to delay system sleep." +msgid "Authentication is required for an application to delay system sleep." msgstr "" "Legitimierung ist erforderlich, um Anwendungen das Verzögern des " "Bereitschaftsmodus zu erlauben." @@ -121,8 +171,8 @@ msgstr "Anwendungen dürfen den automatischen Bereitschaftsmodus unterbinden" #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " -"system suspend." +"Authentication is required for an application to inhibit automatic system " +"suspend." msgstr "" "Legitimierung ist notwendig, um Anwendungen das Unterbinden des " "automatischen Bereitschaftsmodus zu erlauben." @@ -135,8 +185,8 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the power key." +"Authentication is required for an application to inhibit system handling of " +"the power key." msgstr "" "Legitmierung ist erforderlich, um Anwendungen das Unterbinden der Auswertung " "der Ein-/Ausschaltknopfs des Systems zu erlauben." @@ -149,8 +199,8 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the suspend key." +"Authentication is required for an application to inhibit system handling of " +"the suspend key." msgstr "" "Legitimierung ist erforderlich, um Anwendungen das Unterbinden der " "Auswertung des Bereitschaftsknopfes des Systems zu erlauben." @@ -162,8 +212,8 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the hibernate key." +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." msgstr "" "Legitimierung ist erforderlich, um Anwendungen das Unterbinden der " "Auswertung des Knopfs für den Ruhezustand zu erlauben." @@ -175,8 +225,8 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the lid switch." +"Authentication is required for an application to inhibit system handling of " +"the lid switch." msgstr "" "Legitimierung ist erforderlich, um Anwendungen das Unterbinden der " "Auswertung des Notebookdeckelschalters des Systems zu erlauben." @@ -186,8 +236,7 @@ msgid "Allow non-logged-in users to run programs" msgstr "Nicht angemeldete Benutzer dürfen Programme ausführen" #: ../src/login/org.freedesktop.login1.policy.in.h:20 -msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +msgid "Authentication is required to run programs as a non-logged-in user." msgstr "" "Legitimierung ist erforderlich, damit nicht angemeldete Benutzer Programme " "ausführen dürfen." @@ -356,6 +405,15 @@ msgstr "" "Legitimierung ist zum Versetzen des System in den Ruhezustand notwendig, " "während eine Anwendung wünscht dies zu verhindern." +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "In einem lokalen Container anmelden" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +#| msgid "Authentication is required to set the local host name." +msgid "Authentication is required to log into a local container" +msgstr "Legitimierung ist zum Anmelden in einem lokalen Container notwendig" + #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 msgid "Set system time" msgstr "Die Systemzeit festlegen" @@ -396,23 +454,5 @@ msgstr "" "Legitimierung ist zum Festlegen, ob Netzwerkzeitabgeich eingeschaltet sein " "soll, erforderlich." -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 -msgid "Send passphrase back to system" -msgstr "Passphrase zurück an das System senden" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 -msgid "" -"Authentication is required to send the entered passphrase back to the system." -msgstr "" -"Legitimierung ist zum Senden des eingegebenen Kennworts zurück an das System " -"notwendig." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 -msgid "Privileged system and service manager access" -msgstr "Privilegierter Zugriff auf die System- und Dienstverwaltung" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 -msgid "Authentication is required to access the system and service manager." -msgstr "" -"Legitimierung ist notwendig für den Zugriff auf die System- und " -"Dienstverwaltung." +#~ msgid "Privileged system and service manager access" +#~ msgstr "Privilegierter Zugriff auf die System- und Dienstverwaltung" diff --git a/po/el.po b/po/el.po index 1570565a4..8f7a0edb2 100644 --- a/po/el.po +++ b/po/el.po @@ -73,7 +73,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "shutdown." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει τον " @@ -86,7 +86,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:4 msgid "" -"Authentication is required to allow an application to delay system shutdown." +"Authentication is required for an application to delay system shutdown." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να καθυστερήσει " "τον τερματισμό του συστήματος." @@ -97,7 +97,7 @@ msgstr "Να επιτρέπεται στις εφαρμογές να αποτρ #: ../src/login/org.freedesktop.login1.policy.in.h:6 msgid "" -"Authentication is required to allow an application to inhibit system sleep." +"Authentication is required for an application to inhibit system sleep." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " "ύπνωση του συστήματος." @@ -108,7 +108,7 @@ msgstr "Να επιτρέπεται στις εφαρμογές να καθυσ #: ../src/login/org.freedesktop.login1.policy.in.h:8 msgid "" -"Authentication is required to allow an application to delay system sleep." +"Authentication is required for an application to delay system sleep." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να καθυστερήσει " "την ύπνωση του συστήματος." @@ -121,7 +121,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " +"Authentication is required for an application to inhibit automatic " "system suspend." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " @@ -135,7 +135,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the power key." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " @@ -149,7 +149,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the suspend key." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " @@ -163,7 +163,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the hibernate key." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " @@ -177,7 +177,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the lid switch." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μια εφαρμογή να αποτρέψει την " @@ -189,7 +189,7 @@ msgstr "Να επιτρέπεται σε μη συνδεμένους χρήστ #: ../src/login/org.freedesktop.login1.policy.in.h:20 msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +"Authentication is required to run programs as a non-logged-in user." msgstr "" "Απαιτείται πιστοποίηση για να επιτρέπεται σε μη συνδεμένους χρήστες να " "εκτελούν προγράμματα." diff --git a/po/fr.po b/po/fr.po index 7240cc57a..4d4fc6b35 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,14 +1,14 @@ # French translations for systemd package # Traductions françaises du paquet systemd. # This file is distributed under the same license as the systemd package. -# Sylvain Plantefève , 2013. +# Sylvain Plantefève , 2013-2015 # msgid "" msgstr "" "Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-11-14 17:49+0100\n" -"PO-Revision-Date: 2014-04-29 09:17+0300\n" +"POT-Creation-Date: 2015-01-22 16:03+0100\n" +"PO-Revision-Date: 2014-12-28 13:04+0100\n" "Last-Translator: Sylvain Plantefève \n" "Language-Team: French\n" "Language: fr\n" @@ -17,6 +17,42 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Renvoyer la phrase secrète au système" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "Authentification requise pour renvoyer la phrase secrète au système." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Gérer les services système ou les unités" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +msgid "Authentication is required to manage system services or units." +msgstr "" +"Authentification requise pour gérer les services système ou les unités." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Gérer le service système ou ses fichiers unités" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"Authentification requise pour gérer le service système ou ses fichiers " +"unités." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "Recharger l'état de systemd" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "Authentification requise pour recharger l'état de systemd" + #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 msgid "Set host name" msgstr "Définir le nom d'hôte" @@ -34,8 +70,8 @@ msgid "" "Authentication is required to set the statically configured local host name, " "as well as the pretty host name." msgstr "" -"Authentification requise pour définir le nom d'hôte local de manière statique, " -"tout comme le nom d'hôte familier." +"Authentification requise pour définir le nom d'hôte local de manière " +"statique, tout comme le nom d'hôte familier." #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5 msgid "Set machine information" @@ -46,6 +82,16 @@ msgid "Authentication is required to set local machine information." msgstr "" "Authentification requise pour définir les informations sur la machine locale." +#: ../src/import/org.freedesktop.import1.policy.in.h:1 +msgid "Download a VM or container image" +msgstr "Télécharger une image de machine virtuelle (VM) ou de conteneur" + +#: ../src/import/org.freedesktop.import1.policy.in.h:2 +msgid "Authentication is required to download a VM or container image" +msgstr "" +"Authentification requise pour télécharger une image de " +"machine virtuelle (VM) ou de conteneur." + #: ../src/locale/org.freedesktop.locale1.policy.in.h:1 msgid "Set system locale" msgstr "Définir la langue du système" @@ -60,7 +106,8 @@ msgstr "Définir les paramètres de clavier du système" #: ../src/locale/org.freedesktop.locale1.policy.in.h:4 msgid "Authentication is required to set the system keyboard settings." -msgstr "Authentification requise pour définir les paramètres de clavier du système." +msgstr "" +"Authentification requise pour définir les paramètres de clavier du système." #: ../src/login/org.freedesktop.login1.policy.in.h:1 msgid "Allow applications to inhibit system shutdown" @@ -68,8 +115,7 @@ msgstr "Permet aux applications d'empêcher l'arrêt du système" #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " -"shutdown." +"Authentication is required for an application to inhibit system shutdown." msgstr "" "Authentification requise pour permettre à une application d'empêcher l'arrêt " "du système." @@ -79,19 +125,17 @@ msgid "Allow applications to delay system shutdown" msgstr "Permet aux applications de retarder l'arrêt du système" #: ../src/login/org.freedesktop.login1.policy.in.h:4 -msgid "" -"Authentication is required to allow an application to delay system shutdown." +msgid "Authentication is required for an application to delay system shutdown." msgstr "" -"Authentification requise pour permettre à une application de retarder l'arrêt " -"du système." +"Authentification requise pour permettre à une application de retarder " +"l'arrêt du système." #: ../src/login/org.freedesktop.login1.policy.in.h:5 msgid "Allow applications to inhibit system sleep" msgstr "Permet aux applications d'empêcher la mise en veille du système" #: ../src/login/org.freedesktop.login1.policy.in.h:6 -msgid "" -"Authentication is required to allow an application to inhibit system sleep." +msgid "Authentication is required for an application to inhibit system sleep." msgstr "" "Authentification requise pour permettre à une application d'empêcher la mise " "en veille du système." @@ -101,33 +145,34 @@ msgid "Allow applications to delay system sleep" msgstr "Permet aux applications de retarder la mise en veille du système" #: ../src/login/org.freedesktop.login1.policy.in.h:8 -msgid "" -"Authentication is required to allow an application to delay system sleep." +msgid "Authentication is required for an application to delay system sleep." msgstr "" -"Authentification requise pour permettre à une application de retarder la mise " -"en veille du système." +"Authentification requise pour permettre à une application de retarder la " +"mise en veille du système." #: ../src/login/org.freedesktop.login1.policy.in.h:9 msgid "Allow applications to inhibit automatic system suspend" -msgstr "Permet aux applications d'empêcher l'hibernation automatique du système" +msgstr "" +"Permet aux applications d'empêcher l'hibernation automatique du système" #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " -"system suspend." +"Authentication is required for an application to inhibit automatic system " +"suspend." msgstr "" "Authentification requise pour permettre à une application d'empêcher " "l'hibernation automatique du système." #: ../src/login/org.freedesktop.login1.policy.in.h:11 msgid "Allow applications to inhibit system handling of the power key" -msgstr "Permet aux applications d'empêcher la gestion du bouton d'alimentation " -" du système" +msgstr "" +"Permet aux applications d'empêcher la gestion du bouton d'alimentation du " +"système" #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the power key." +"Authentication is required for an application to inhibit system handling of " +"the power key." msgstr "" "Authentification requise pour permettre à une application d'empêcher la " "gestion du bouton d'alimentation du système." @@ -140,11 +185,11 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the suspend key." +"Authentication is required for an application to inhibit system handling of " +"the suspend key." msgstr "" -"Authentification requise pour permettre à une application d'empêcher la gestion " -"du bouton de mise en veille du système." +"Authentification requise pour permettre à une application d'empêcher la " +"gestion du bouton de mise en veille du système." #: ../src/login/org.freedesktop.login1.policy.in.h:15 msgid "Allow applications to inhibit system handling of the hibernate key" @@ -154,11 +199,11 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the hibernate key." +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." msgstr "" -"Authentification requise pour permettre à une application d'empêcher la gestion " -"du bouton d'hibernation du système." +"Authentification requise pour permettre à une application d'empêcher la " +"gestion du bouton d'hibernation du système." #: ../src/login/org.freedesktop.login1.policy.in.h:17 msgid "Allow applications to inhibit system handling of the lid switch" @@ -168,8 +213,8 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the lid switch." +"Authentication is required for an application to inhibit system handling of " +"the lid switch." msgstr "" "Authentification requise pour permettre à une application d'empêcher la " "gestion par le système du rabat de l'écran." @@ -179,8 +224,7 @@ msgid "Allow non-logged-in users to run programs" msgstr "Permet aux utilisateurs non connectés d'exécuter des programmes" #: ../src/login/org.freedesktop.login1.policy.in.h:20 -msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +msgid "Authentication is required to run programs as a non-logged-in user." msgstr "" "Authentification requise pour permettre aux utilisateurs non connectés " "d'exécuter des programmes." @@ -191,7 +235,8 @@ msgstr "Permet d'associer des périphériques à des postes (seats)" #: ../src/login/org.freedesktop.login1.policy.in.h:22 msgid "Authentication is required for attaching a device to a seat." -msgstr "Authentification requise pour associer un périphérique à un poste (seat)." +msgstr "" +"Authentification requise pour associer un périphérique à un poste (seat)." #: ../src/login/org.freedesktop.login1.policy.in.h:23 msgid "Flush device to seat attachments" @@ -201,8 +246,8 @@ msgstr "Révoquer les associations de périphériques aux postes (seats)" msgid "" "Authentication is required for resetting how devices are attached to seats." msgstr "" -"Authentification requise pour révoquer les associations de périphériques " -"aux postes (seats)." +"Authentification requise pour révoquer les associations de périphériques aux " +"postes (seats)." #: ../src/login/org.freedesktop.login1.policy.in.h:25 msgid "Power off the system" @@ -233,8 +278,8 @@ msgid "" "Authentication is required for powering off the system while an application " "asked to inhibit it." msgstr "" -"Authentification requise pour éteindre le système alors qu'une application " -"a demandé de l'empêcher." +"Authentification requise pour éteindre le système alors qu'une application a " +"demandé de l'empêcher." #: ../src/login/org.freedesktop.login1.policy.in.h:31 msgid "Reboot the system" @@ -265,8 +310,8 @@ msgid "" "Authentication is required for rebooting the system while an application " "asked to inhibit it." msgstr "" -"Authentification requise pour redémarrer le système alors qu'une application " -" a demandé de l'empêcher." +"Authentification requise pour redémarrer le système alors qu'une " +"application a demandé de l'empêcher." #: ../src/login/org.freedesktop.login1.policy.in.h:37 msgid "Suspend the system" @@ -278,19 +323,21 @@ msgstr "Authentification requise pour mettre le système en veille." #: ../src/login/org.freedesktop.login1.policy.in.h:39 msgid "Suspend the system while other users are logged in" -msgstr "Mettre le système en veille alors que d'autres utilisateurs sont connectés" +msgstr "" +"Mettre le système en veille alors que d'autres utilisateurs sont connectés" #: ../src/login/org.freedesktop.login1.policy.in.h:40 msgid "" "Authentication is required for suspending the system while other users are " "logged in." msgstr "" -"Authentification requise pour mettre le système en veille alors que " -"d'autres utilisateurs sont connectés." +"Authentification requise pour mettre le système en veille alors que d'autres " +"utilisateurs sont connectés." #: ../src/login/org.freedesktop.login1.policy.in.h:41 msgid "Suspend the system while an application asked to inhibit it" -msgstr "Mettre le système en veille alors qu'une application a demandé de l'empêcher" +msgstr "" +"Mettre le système en veille alors qu'une application a demandé de l'empêcher" #: ../src/login/org.freedesktop.login1.policy.in.h:42 msgid "" @@ -310,7 +357,9 @@ msgstr "Authentification requise pour mettre le système en hibernation." #: ../src/login/org.freedesktop.login1.policy.in.h:45 msgid "Hibernate the system while other users are logged in" -msgstr "Mettre le système en hibernation alors que d'autres utilisateurs sont connectés" +msgstr "" +"Mettre le système en hibernation alors que d'autres utilisateurs sont " +"connectés" #: ../src/login/org.freedesktop.login1.policy.in.h:46 msgid "" @@ -334,6 +383,15 @@ msgstr "" "Authentification requise pour mettre le système en hibernation alors qu'une " "application a demandé de l'empêcher." +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Connexion dans un conteneur local" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "" +"Authentification requise pour permettre la connexion dans un conteneur local." + #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 msgid "Set system time" msgstr "Définir l'heure du système" @@ -361,8 +419,8 @@ msgid "" "Authentication is required to control whether the RTC stores the local or " "UTC time." msgstr "" -"Authentification requise pour positionner l'horloge matérielle à l'heure locale " -"ou sur le temps universel coordonné (UTC)." +"Authentification requise pour positionner l'horloge matérielle à l'heure " +"locale ou sur le temps universel coordonné (UTC)." #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7 msgid "Turn network time synchronization on or off" @@ -373,51 +431,5 @@ msgid "" "Authentication is required to control whether network time synchronization " "shall be enabled." msgstr "" -"Authentification requise pour activer ou désactiver la synchronisation " -"de l'heure avec le réseau." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 -msgid "Send passphrase back to system" -msgstr "Renvoyer la phrase secrète au système" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 -msgid "" -"Authentication is required to send the entered passphrase back to the system." -msgstr "" -"Authentification requise pour renvoyer la phrase secrète au système." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 -msgid "Privileged system and service manager access" -msgstr "Accès privilégié au gestionnaire du système et des services" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 -msgid "Authentication is required to access the system and service manager." -msgstr "" -"Authentification requise pour accéder au gestionnaire du système et des " -"services." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 -msgid "Manage system services or units" -msgstr "Gérer les services système ou les unités" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 -msgid "Authentication is required to manage system services or units." -msgstr "" -"Authentification requise pour gérer les services système ou les unités." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 -msgid "Manage system service or unit files" -msgstr "Gérer le service système ou ses fichiers unités" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 -msgid "Authentication is required to manage system service or unit files." -msgstr "" -"Authentification requise pour gérer le service système ou ses fichiers unités." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9 -msgid "Reload the systemd state" -msgstr "Recharger l'état de systemd" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:10 -msgid "Authentication is required to reload the systemd state." -msgstr "Authentification requise pour recharger l'état de systemd" +"Authentification requise pour activer ou désactiver la synchronisation de " +"l'heure avec le réseau." diff --git a/po/hu.po b/po/hu.po new file mode 100644 index 000000000..a914b3c73 --- /dev/null +++ b/po/hu.po @@ -0,0 +1,413 @@ +# Hungarian translation of systemd +# Copyright (C) 2015. Free Software Foundation, Inc. +# This file is distributed under the same license as the systemd package. +# +# Gabor Kelemen , 2015. +msgid "" +msgstr "" +"Project-Id-Version: systemd master\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-02 22:59+0100\n" +"PO-Revision-Date: 2015-01-02 22:58+0100\n" +"Last-Translator: Gabor Kelemen \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.5\n" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 +msgid "Set host name" +msgstr "Gépnév beállítása" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:2 +msgid "Authentication is required to set the local host name." +msgstr "Hitelesítés szükséges a helyi gépnév beállításához." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:3 +msgid "Set static host name" +msgstr "Statikus gépnév beállítása" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:4 +msgid "" +"Authentication is required to set the statically configured local host name, " +"as well as the pretty host name." +msgstr "" +"Hitelesítés szükséges a statikusan megadott helyi gépnév, valamint a szép " +"gépnév beállításához." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5 +msgid "Set machine information" +msgstr "Gépinformációk beállítása" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:6 +msgid "Authentication is required to set local machine information." +msgstr "Hitelesítés szükséges a helyi gép információinak beállításához." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:1 +msgid "Set system locale" +msgstr "Területi beállítás megadása" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:2 +msgid "Authentication is required to set the system locale." +msgstr "Hitelesítés szükséges a rendszer területi beállításainak megadásához." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:3 +msgid "Set system keyboard settings" +msgstr "Rendszer billentyűzetbeállítások megadása" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:4 +msgid "Authentication is required to set the system keyboard settings." +msgstr "" +"Hitelesítés szükséges a rendszer billentyűzetbeállításainak megadásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:1 +msgid "Allow applications to inhibit system shutdown" +msgstr "Alkalmazások meggátolhatják a rendszer leállítását" + +#: ../src/login/org.freedesktop.login1.policy.in.h:2 +msgid "" +"Authentication is required for an application to inhibit system shutdown." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a rendszerleállítás " +"meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:3 +msgid "Allow applications to delay system shutdown" +msgstr "Alkalmazások késleltethetik a rendszer leállítását" + +#: ../src/login/org.freedesktop.login1.policy.in.h:4 +msgid "Authentication is required for an application to delay system shutdown." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a rendszerleállítás " +"késleltetéséhez." + +#: ../src/login/org.freedesktop.login1.policy.in.h:5 +msgid "Allow applications to inhibit system sleep" +msgstr "Alkalmazások meggátolhatják a rendszer altatását" + +#: ../src/login/org.freedesktop.login1.policy.in.h:6 +msgid "Authentication is required for an application to inhibit system sleep." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a rendszeraltatás meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:7 +msgid "Allow applications to delay system sleep" +msgstr "Alkalmazások késleltethetik a rendszer altatását" + +#: ../src/login/org.freedesktop.login1.policy.in.h:8 +msgid "Authentication is required for an application to delay system sleep." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a rendszeraltatás " +"késleltetéséhez." + +#: ../src/login/org.freedesktop.login1.policy.in.h:9 +msgid "Allow applications to inhibit automatic system suspend" +msgstr "Alkalmazások meggátolhatják a rendszer automatikus felfüggesztését" + +#: ../src/login/org.freedesktop.login1.policy.in.h:10 +msgid "" +"Authentication is required for an application to inhibit automatic system " +"suspend." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára az automatikus " +"rendszerfelfüggesztés meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:11 +msgid "Allow applications to inhibit system handling of the power key" +msgstr "" +"Alkalmazások meggátolhatják a bekapcsoló gomb rendszer általi kezelését" + +#: ../src/login/org.freedesktop.login1.policy.in.h:12 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the power key." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a bekapcsoló gomb rendszer " +"általi kezelésének meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:13 +msgid "Allow applications to inhibit system handling of the suspend key" +msgstr "" +"Alkalmazások meggátolhatják a felfüggesztés gomb rendszer általi kezelését" + +#: ../src/login/org.freedesktop.login1.policy.in.h:14 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the suspend key." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a felfüggesztés gomb rendszer " +"általi kezelésének meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:15 +msgid "Allow applications to inhibit system handling of the hibernate key" +msgstr "" +"Alkalmazások meggátolhatják a hibernálás gomb rendszer általi kezelését" + +#: ../src/login/org.freedesktop.login1.policy.in.h:16 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a hibernálás gomb rendszer " +"általi kezelésének meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:17 +msgid "Allow applications to inhibit system handling of the lid switch" +msgstr "Alkalmazások meggátolhatják a fedélkapcsoló rendszer általi kezelését" + +#: ../src/login/org.freedesktop.login1.policy.in.h:18 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the lid switch." +msgstr "" +"Hitelesítés szükséges egy alkalmazás számára a fedélkapcsoló rendszer általi " +"kezelésének meggátlásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:19 +msgid "Allow non-logged-in users to run programs" +msgstr "Programfuttatás engedélyezése be nem jelentkezett felhasználók számára" + +#: ../src/login/org.freedesktop.login1.policy.in.h:20 +msgid "Authentication is required to run programs as a non-logged-in user." +msgstr "" +"Hitelesítés szükséges a programfuttatáshoz be nem jelentkezett " +"felhasználóként." + +#: ../src/login/org.freedesktop.login1.policy.in.h:21 +msgid "Allow attaching devices to seats" +msgstr "Eszközök csatolásának engedélyezése munkaállomásokhoz" + +#: ../src/login/org.freedesktop.login1.policy.in.h:22 +msgid "Authentication is required for attaching a device to a seat." +msgstr "" +"Hitelesítés szükséges eszköz csatolásának engedélyezéséhez egy " +"munkaállomáshoz" + +#: ../src/login/org.freedesktop.login1.policy.in.h:23 +msgid "Flush device to seat attachments" +msgstr "Eszközök és munkaállomások csatolásainak törlése" + +#: ../src/login/org.freedesktop.login1.policy.in.h:24 +msgid "" +"Authentication is required for resetting how devices are attached to seats." +msgstr "" +"Hitelesítés szükséges az eszközök munkaállomásokhoz csatolásainak " +"alaphelyzetbe állításához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:25 +msgid "Power off the system" +msgstr "A rendszer kikapcsolása" + +#: ../src/login/org.freedesktop.login1.policy.in.h:26 +msgid "Authentication is required for powering off the system." +msgstr "Hitelesítés szükséges a rendszer kikapcsolásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:27 +msgid "Power off the system while other users are logged in" +msgstr "" +"A rendszer kikapcsolása miközben be vannak jelentkezve más felhasználók" + +#: ../src/login/org.freedesktop.login1.policy.in.h:28 +msgid "" +"Authentication is required for powering off the system while other users are " +"logged in." +msgstr "" +"Hitelesítés szükséges a rendszer kikapcsolásához miközben be vannak " +"jelentkezve más felhasználók." + +#: ../src/login/org.freedesktop.login1.policy.in.h:29 +msgid "Power off the system while an application asked to inhibit it" +msgstr "" +"A rendszer kikapcsolása miközben egy alkalmazás ennek meggátlását kérte" + +#: ../src/login/org.freedesktop.login1.policy.in.h:30 +msgid "" +"Authentication is required for powering off the system while an application " +"asked to inhibit it." +msgstr "" +"Hitelesítés szükséges a rendszer kikapcsolásához miközben egy alkalmazás " +"ennek meggátlását kérte." + +#: ../src/login/org.freedesktop.login1.policy.in.h:31 +msgid "Reboot the system" +msgstr "A rendszer újraindítása" + +#: ../src/login/org.freedesktop.login1.policy.in.h:32 +msgid "Authentication is required for rebooting the system." +msgstr "Hitelesítés szükséges a rendszer újraindításához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:33 +msgid "Reboot the system while other users are logged in" +msgstr "A rendszer újraindítása mialatt be vannak jelentkezve más felhasználók" + +#: ../src/login/org.freedesktop.login1.policy.in.h:34 +msgid "" +"Authentication is required for rebooting the system while other users are " +"logged in." +msgstr "" +"Hitelesítés szükséges a rendszer újraindításához miközben be vannak " +"jelentkezve más felhasználók." + +#: ../src/login/org.freedesktop.login1.policy.in.h:35 +msgid "Reboot the system while an application asked to inhibit it" +msgstr "" +"A rendszer újraindítása miközben egy alkalmazás ennek meggátlását kérte" + +#: ../src/login/org.freedesktop.login1.policy.in.h:36 +msgid "" +"Authentication is required for rebooting the system while an application " +"asked to inhibit it." +msgstr "" +"Hitelesítés szükséges a rendszer újraindításához miközben egy alkalmazás " +"ennek meggátlását kérte." + +#: ../src/login/org.freedesktop.login1.policy.in.h:37 +msgid "Suspend the system" +msgstr "A rendszer felfüggesztése" + +#: ../src/login/org.freedesktop.login1.policy.in.h:38 +msgid "Authentication is required for suspending the system." +msgstr "Hitelesítés szükséges a rendszer felfüggesztéséhez." + +#: ../src/login/org.freedesktop.login1.policy.in.h:39 +msgid "Suspend the system while other users are logged in" +msgstr "" +"A rendszer felfüggesztése mialatt be vannak jelentkezve más felhasználók" + +#: ../src/login/org.freedesktop.login1.policy.in.h:40 +msgid "" +"Authentication is required for suspending the system while other users are " +"logged in." +msgstr "" +"Hitelesítés szükséges a rendszer felfüggesztéséhez miközben be vannak " +"jelentkezve más felhasználók." + +#: ../src/login/org.freedesktop.login1.policy.in.h:41 +msgid "Suspend the system while an application asked to inhibit it" +msgstr "" +"A rendszer felfüggesztése miközben egy alkalmazás ennek meggátlását kérte" + +#: ../src/login/org.freedesktop.login1.policy.in.h:42 +msgid "" +"Authentication is required for suspending the system while an application " +"asked to inhibit it." +msgstr "" +"Hitelesítés szükséges a rendszer felfüggesztéséhez miközben egy alkalmazás " +"ennek meggátlását kérte." + +#: ../src/login/org.freedesktop.login1.policy.in.h:43 +msgid "Hibernate the system" +msgstr "A rendszer hibernálása" + +#: ../src/login/org.freedesktop.login1.policy.in.h:44 +msgid "Authentication is required for hibernating the system." +msgstr "Hitelesítés szükséges a rendszer hibernálásához." + +#: ../src/login/org.freedesktop.login1.policy.in.h:45 +msgid "Hibernate the system while other users are logged in" +msgstr "A rendszer hibernálása mialatt be vannak jelentkezve más felhasználók" + +#: ../src/login/org.freedesktop.login1.policy.in.h:46 +msgid "" +"Authentication is required for hibernating the system while other users are " +"logged in." +msgstr "" +"Hitelesítés szükséges a rendszer hibernálásához miközben be vannak " +"jelentkezve más felhasználók." + +#: ../src/login/org.freedesktop.login1.policy.in.h:47 +msgid "Hibernate the system while an application asked to inhibit it" +msgstr "A rendszer hibernálása miközben egy alkalmazás ennek meggátlását kérte" + +#: ../src/login/org.freedesktop.login1.policy.in.h:48 +msgid "" +"Authentication is required for hibernating the system while an application " +"asked to inhibit it." +msgstr "" +"Hitelesítés szükséges a rendszer hibernálásához miközben egy alkalmazás " +"ennek meggátlását kérte." + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Bejelentkezés helyi konténerbe" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "Hitelesítés szükséges a bejelentkezéshez egy helyi konténerbe." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 +msgid "Set system time" +msgstr "Rendszeridő beállítása" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:2 +msgid "Authentication is required to set the system time." +msgstr "Hitelesítés szükséges a rendszeridő beállításához." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:3 +msgid "Set system timezone" +msgstr "Rendszer időzónájának beállítása" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:4 +msgid "Authentication is required to set the system timezone." +msgstr "Hitelesítés szükséges a rendszer időzónájának beállításához." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:5 +msgid "Set RTC to local timezone or UTC" +msgstr "Az RTC beállítása helyi időzónára vagy UTC-re" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:6 +msgid "" +"Authentication is required to control whether the RTC stores the local or " +"UTC time." +msgstr "" +"Hitelesítés szükséges az RTC beállításához a helyi időzóna vagy UTC " +"tárolására." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7 +msgid "Turn network time synchronization on or off" +msgstr "Hálózati időszinkronizáció be- vagy kikapcsolása" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:8 +msgid "" +"Authentication is required to control whether network time synchronization " +"shall be enabled." +msgstr "Hitelesítés szükséges a hálózati időszinkronizáció engedélyezéséhez." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Jelmondat visszaküldése a rendszernek" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "" +"Hitelesítés szükséges a bevitt jelmondat visszaküldéséhez a rendszernek." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Rendszerszolgáltatások vagy -egységek kezelése" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +msgid "Authentication is required to manage system services or units." +msgstr "" +"Hitelesítés szükséges a rendszerszolgáltatások vagy -egységek kezeléséhez." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Rendszerszolgáltatás- vagy egységfájlok kezelése" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"Hitelesítés szükséges a rendszerszolgáltatás- vagy egységfájlok kezeléséhez." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "A systemd állapotának újratöltése" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "Hitelesítés szükséges a systemd állapotának újratöltéséhez." diff --git a/po/it.po b/po/it.po index e459f8b24..93a1e79b1 100644 --- a/po/it.po +++ b/po/it.po @@ -1,14 +1,14 @@ # Italian translations for systemd package # Traduzione in italiano per il pacchetto systemd # This file is distributed under the same license as the systemd package. -# Daniele Medri , 2013. +# Daniele Medri , 2013-2015. # msgid "" msgstr "" "Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-11-22 17:49+0100\n" -"PO-Revision-Date: 2013-11-22 17:57+0100\n" +"POT-Creation-Date: 2015-01-05 09:26+0100\n" +"PO-Revision-Date: 2015-01-05 10:19+0100\n" "Last-Translator: Daniele Medri \n" "Language-Team: Italian\n" "Language: it\n" @@ -16,6 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 msgid "Set host name" @@ -34,8 +35,8 @@ msgid "" "Authentication is required to set the statically configured local host name, " "as well as the pretty host name." msgstr "" -"Autenticazione richiesta per configurare staticamente il nome host locale " -"e il nome host descrittivo." +"Autenticazione richiesta per configurare staticamente il nome host locale e " +"il nome host descrittivo." #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5 msgid "Set machine information" @@ -43,7 +44,9 @@ msgstr "Configura le informazioni sulla macchina" #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:6 msgid "Authentication is required to set local machine information." -msgstr "Autenticazione richiesta per configurare le informazioni sulla macchina locale." +msgstr "" +"Autenticazione richiesta per configurare le informazioni sulla macchina " +"locale." #: ../src/locale/org.freedesktop.locale1.policy.in.h:1 msgid "Set system locale" @@ -51,7 +54,9 @@ msgstr "Configura le impostazioni regionali di sistema" #: ../src/locale/org.freedesktop.locale1.policy.in.h:2 msgid "Authentication is required to set the system locale." -msgstr "Autenticazione richiesta per configurare le impostazioni regionali di sistema." +msgstr "" +"Autenticazione richiesta per configurare le impostazioni regionali di " +"sistema." #: ../src/locale/org.freedesktop.locale1.policy.in.h:3 msgid "Set system keyboard settings" @@ -67,112 +72,118 @@ msgstr "Consenti alle applicazioni di inibire lo spegnimento del sistema" #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " -"shutdown." +"Authentication is required for an application to inhibit system shutdown." msgstr "" -"Autenticazione richiesta per consentire alle applicazione di inibire " -"lo spegnimento del sistema" +"Autenticazione richiesta per un'applicazione per inibire lo spegnimento del " +"sistema." #: ../src/login/org.freedesktop.login1.policy.in.h:3 msgid "Allow applications to delay system shutdown" msgstr "Consenti alle applicazioni di ritardare lo spegnimento del sistema" #: ../src/login/org.freedesktop.login1.policy.in.h:4 -msgid "" -"Authentication is required to allow an application to delay system shutdown." +msgid "Authentication is required for an application to delay system shutdown." msgstr "" -"Autenticazione richiesta per consentire alle applicazione di ritardare lo spegnimento del sistema." +"Autenticazione richiesta per un'applicazione per ritardare lo spegnimento " +"del sistema." #: ../src/login/org.freedesktop.login1.policy.in.h:5 msgid "Allow applications to inhibit system sleep" msgstr "Consenti alle applicazioni di inibire il sistema in pausa" #: ../src/login/org.freedesktop.login1.policy.in.h:6 -msgid "" -"Authentication is required to allow an application to inhibit system sleep." +msgid "Authentication is required for an application to inhibit system sleep." msgstr "" -"Autenticazione richiesta per consentire alle applicazioni di inibire il sistema in pausa." +"Autenticazione richiesta per un'applicazione per inibire il sistema in pausa." #: ../src/login/org.freedesktop.login1.policy.in.h:7 msgid "Allow applications to delay system sleep" msgstr "Consenti alle applicazioni di ritardare il sistema in pausa" #: ../src/login/org.freedesktop.login1.policy.in.h:8 -msgid "" -"Authentication is required to allow an application to delay system sleep." +msgid "Authentication is required for an application to delay system sleep." msgstr "" -"Autenticazione richiesta per consentire alle applicazioni di ritardare il sistema in pausa." +"Autenticazione richiesta per un'applicazione per ritardare il sistema in " +"pausa." #: ../src/login/org.freedesktop.login1.policy.in.h:9 msgid "Allow applications to inhibit automatic system suspend" -msgstr "Consenti alle applicazioni di inibire la sospesione automatica del sistema" +msgstr "" +"Consenti alle applicazioni di inibire la sospesione automatica del sistema" #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " -"system suspend." +"Authentication is required for an application to inhibit automatic system " +"suspend." msgstr "" -"Autenticazione richiesta per consentire alle applicazioni di inibire " -"la sospensione automatica del sistema." +"Autenticazione richiesta per un'applicazione per inibire la sospensione " +"automatica del sistema." #: ../src/login/org.freedesktop.login1.policy.in.h:11 msgid "Allow applications to inhibit system handling of the power key" -msgstr "Consenti alle applicazioni di inibire al sistema la gestione del tasto di accensione" +msgstr "" +"Consenti alle applicazioni di inibire la gestione di sistema del tasto di " +"accensione" #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the power key." +"Authentication is required for an application to inhibit system handling of " +"the power key." msgstr "" -"Autenticazione richiesta per consentire alle applicazioni di inibire al sistema la gestione " -"del tasto di accensione." +"Autenticazione richiesta per un'applicazione per inibire la gestione di " +"sistema del tasto di accensione." #: ../src/login/org.freedesktop.login1.policy.in.h:13 msgid "Allow applications to inhibit system handling of the suspend key" -msgstr "Consenti alle applicazioni di inibire al sistema la gestione del tasto di sospensione" +msgstr "" +"Consenti alle applicazioni di inibire la gestione di sistema del tasto di " +"sospensione" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the suspend key." +"Authentication is required for an application to inhibit system handling of " +"the suspend key." msgstr "" -"Autenticazione richiesta per consentire ad un'applicazione di inibire al sistema la gestione " -"del tasto di sospensione." +"Autenticazione richiesta per un'applicazione per inibire la gestione di " +"sistema del tasto di sospensione." #: ../src/login/org.freedesktop.login1.policy.in.h:15 msgid "Allow applications to inhibit system handling of the hibernate key" -msgstr "Consenti alle applicazioni di inibire al sistema la gestione del tasto di ibernazione" +msgstr "" +"Consenti alle applicazioni di inibire la gestione di sistema del tasto di " +"ibernazione" #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the hibernate key." +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." msgstr "" -"Autenticazione richiesta per consentire ad un'applicazione di inibire " -"al sistema la gestione del tasto di ibernazione." +"Autenticazione richiesta per un'applicazione per inibire la gestione di " +"sistema del tasto di ibernazione." #: ../src/login/org.freedesktop.login1.policy.in.h:17 msgid "Allow applications to inhibit system handling of the lid switch" -msgstr "Consenti alle applicazioni di inibire al sistema la gestione degli eventi " -"relativi alla chiusura del portatile" +msgstr "" +"Consenti alle applicazioni di inibire la gestione di sistema alla apertura/" +"chiusura del portatile" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the lid switch." +"Authentication is required for an application to inhibit system handling of " +"the lid switch." msgstr "" -"Autenticazione richiesta per consentire alle applicazioni di inibire " -"al sistema la gestione degli eventi relativi alla chiusura del portatile." +"Autenticazione richiesta per consentire ad un'applicazione di inibire la " +"gestione di sistema alla apertura/chiusura del portatile." #: ../src/login/org.freedesktop.login1.policy.in.h:19 msgid "Allow non-logged-in users to run programs" msgstr "Consenti agli utenti non connessi di eseguire programmi" #: ../src/login/org.freedesktop.login1.policy.in.h:20 -msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +msgid "Authentication is required to run programs as a non-logged-in user." msgstr "" -"Autenticazione richiesta per consentire agli utenti non connessi di eseguire programmi." +"Autenticazione richiesta per consentire agli utenti non connessi di eseguire " +"programmi." #: ../src/login/org.freedesktop.login1.policy.in.h:21 msgid "Allow attaching devices to seats" @@ -180,7 +191,8 @@ msgstr "Consenti di collegare dispositivi alle postazioni" #: ../src/login/org.freedesktop.login1.policy.in.h:22 msgid "Authentication is required for attaching a device to a seat." -msgstr "Autenticazione richiesta per collegare un dispositivo alla postazione." +msgstr "" +"Autenticazione richiesta per collegare un dispositivo ad una postazione." #: ../src/login/org.freedesktop.login1.policy.in.h:23 msgid "Flush device to seat attachments" @@ -190,7 +202,8 @@ msgstr "Scollega i dispositivi dalla postazione" msgid "" "Authentication is required for resetting how devices are attached to seats." msgstr "" -"Autenticazione richiesta per scollegare i dispositivi dalla postazione." +"Autenticazione richiesta per ripristinare come i dispositivi sono collegati " +"alle postazioni." #: ../src/login/org.freedesktop.login1.policy.in.h:25 msgid "Power off the system" @@ -209,20 +222,20 @@ msgid "" "Authentication is required for powering off the system while other users are " "logged in." msgstr "" -"Autenticazione richiesta per spegnere il sistema mentre altri utenti " -"sono connessi." +"Autenticazione richiesta per spegnere il sistema mentre altri utenti sono " +"connessi." #: ../src/login/org.freedesktop.login1.policy.in.h:29 msgid "Power off the system while an application asked to inhibit it" -msgstr "Spegnere il sistema nonostante l'inibizione di una applicazione" +msgstr "Spegnere il sistema mentre un'applicazione chiede di inibirne l'azione" #: ../src/login/org.freedesktop.login1.policy.in.h:30 msgid "" "Authentication is required for powering off the system while an application " "asked to inhibit it." msgstr "" -"Autenticazione richiesta per spegnere il sistema nonostante l'inibizione " -"di una applicazione." +"Autenticazione richiesta per spegnere il sistema mentre un'applicazione " +"chiede di inibirne l'azione." #: ../src/login/org.freedesktop.login1.policy.in.h:31 msgid "Reboot the system" @@ -241,20 +254,21 @@ msgid "" "Authentication is required for rebooting the system while other users are " "logged in." msgstr "" -"Autenticazione richiesta per riavviare il sistema mentre altri utenti " -"sono connessi." +"Autenticazione richiesta per riavviare il sistema mentre altri utenti sono " +"connessi." #: ../src/login/org.freedesktop.login1.policy.in.h:35 msgid "Reboot the system while an application asked to inhibit it" -msgstr "Riavviare il sistema nonostante l'inibizione di una applicazione" +msgstr "" +"Riavviare il sistema mentre un'applicazione chiede di inibirne l'azione" #: ../src/login/org.freedesktop.login1.policy.in.h:36 msgid "" "Authentication is required for rebooting the system while an application " "asked to inhibit it." msgstr "" -"Autenticazione richiesta per riavviare il sistema nonostante l'inibizione " -"di una applicazione." +"Autenticazione richiesta per riavviare il sistema mentre un'applicazione " +"chiede di inibirne l'azione." #: ../src/login/org.freedesktop.login1.policy.in.h:37 msgid "Suspend the system" @@ -273,20 +287,21 @@ msgid "" "Authentication is required for suspending the system while other users are " "logged in." msgstr "" -"Autenticazione richiesta per sospendere il sistema mentre altri utenti " -"sono connessi." +"Autenticazione richiesta per sospendere il sistema mentre altri utenti sono " +"connessi." #: ../src/login/org.freedesktop.login1.policy.in.h:41 msgid "Suspend the system while an application asked to inhibit it" -msgstr "Sospendere il sistema nonostante l'inibizione di una applicazione" +msgstr "" +"Sospendere il sistema mentre un'applicazione chiede di inibirne l'azione" #: ../src/login/org.freedesktop.login1.policy.in.h:42 msgid "" "Authentication is required for suspending the system while an application " "asked to inhibit it." msgstr "" -"Autenticazione richiesta per sospendere il sistema nonostante l'inibizione " -"di una applicazione." +"Autenticazione richiesta per sospendere il sistema mentre un'applicazione " +"chiede di inibirne l'azione." #: ../src/login/org.freedesktop.login1.policy.in.h:43 msgid "Hibernate the system" @@ -305,20 +320,28 @@ msgid "" "Authentication is required for hibernating the system while other users are " "logged in." msgstr "" -"Autenticazione richiesta per ibernare il sistema mentre altri utenti " -"sono connessi." +"Autenticazione richiesta per ibernare il sistema mentre altri utenti sono " +"connessi." #: ../src/login/org.freedesktop.login1.policy.in.h:47 msgid "Hibernate the system while an application asked to inhibit it" -msgstr "Ibernare il sistema nonostante l'inibizione di una applicazione" +msgstr "Ibernare il sistema mentre un'applicazione chiede di inibirne l'azione" #: ../src/login/org.freedesktop.login1.policy.in.h:48 msgid "" "Authentication is required for hibernating the system while an application " "asked to inhibit it." msgstr "" -"Autenticazione richiesta per ibernare il sistema nonostante l'inibizione " -"di una applicazione." +"Autenticazione richiesta per ibernare il sistema mentre un'applicazione " +"chiede di inibirne l'azione." + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Accedi in un container locale" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "Autenticazione richiesta per accedere in un container locale" #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 msgid "Set system time" @@ -338,15 +361,17 @@ msgstr "Autenticazione richiesta per configurare il fuso orario di sistema." #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:5 msgid "Set RTC to local timezone or UTC" -msgstr "Configura l'orologio di sistema (RTC) al fuso orario locale o al tempo civile (UTC)" +msgstr "" +"Configura l'orologio di sistema (RTC) al fuso orario locale o al tempo " +"civile (UTC)" #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:6 msgid "" "Authentication is required to control whether the RTC stores the local or " "UTC time." msgstr "" -"Autenticazione richiesta per verificare se l'orologio di sistema (RTC) " -"è configurato all'orario locale o al tempo civile (UTC)." +"Autenticazione richiesta per verificare se l'orologio di sistema (RTC) è " +"configurato all'orario locale o al tempo civile (UTC)." #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7 msgid "Turn network time synchronization on or off" @@ -358,7 +383,7 @@ msgid "" "shall be enabled." msgstr "" "Autenticazione richiesta per verificare se la sincronizzazione dell'orario " -"in rete debba essere attivata." +"in rete possa essere attivata." #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 msgid "Send passphrase back to system" @@ -368,12 +393,34 @@ msgstr "Inviare la frase segreta (passphrase) al sistema" msgid "" "Authentication is required to send the entered passphrase back to the system." msgstr "" -"Autenticazione richiesta per inviare la frase segreta (passphrase) al sistema." +"Autenticazione richiesta per inviare la frase segreta (passphrase) al " +"sistema." #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 -msgid "Privileged system and service manager access" -msgstr "Accesso privilegiato per la gestione del sistema e dei servizi" +msgid "Manage system services or units" +msgstr "Gestisci i servizi o le unità di sistema" #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 -msgid "Authentication is required to access the system and service manager." -msgstr "Autenticazione richiesta per la gestione del sistema e dei servizi." +msgid "Authentication is required to manage system services or units." +msgstr "Autenticazione richiesta per gestire servizi e unità di sistema." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Gestisci i file dei servizi o delle unità di sistema" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"Autenticazione richiesta per gestire i file dei servizi o delle unità di " +"sistema." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "Riavviare lo stato di systemd" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "Autenticazione richiesta per riavviare lo stato di sistemd." + +#~ msgid "Privileged system and service manager access" +#~ msgstr "Accesso privilegiato per la gestione del sistema e dei servizi" diff --git a/po/pl.po b/po/pl.po index 0407fe086..e5987be25 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1,13 +1,13 @@ # translation of pl.po to Polish -# Piotr Drąg , 2011, 2013, 2014. +# Piotr Drąg , 2011, 2013, 2014, 2015. # Zbigniew Jędrzejewski-Szmek , 2011. # msgid "" msgstr "" "Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-24 18:10+0200\n" -"PO-Revision-Date: 2014-08-24 18:15+0200\n" +"POT-Creation-Date: 2015-01-22 15:18+0100\n" +"PO-Revision-Date: 2015-01-22 15:12+0100\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Polish \n" "Language: pl\n" @@ -15,6 +15,45 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Wysłanie hasła z powrotem do systemu" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "" +"Wymagane jest uwierzytelnienie, aby wysłać podane hasło z powrotem do " +"systemu." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Zarządzanie usługami lub jednostkami systemu" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +msgid "Authentication is required to manage system services or units." +msgstr "" +"Wymagane jest uwierzytelnienie, aby zarządzać usługami lub jednostkami " +"systemu." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Zarządzanie plikami usług lub jednostek systemu" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"Wymagane jest uwierzytelnienie, aby zarządzać plikami usług lub jednostek " +"systemu." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "Ponowne wczytanie stanu systemd" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "Wymagane jest uwierzytelnienie, aby ponownie wczytać stan systemd." + #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 msgid "Set host name" msgstr "Ustawienie nazwy komputera" @@ -44,6 +83,16 @@ msgid "Authentication is required to set local machine information." msgstr "" "Wymagane jest uwierzytelnienie, aby ustawić informacje o lokalnym komputerze." +#: ../src/import/org.freedesktop.import1.policy.in.h:1 +msgid "Download a VM or container image" +msgstr "Pobranie obrazu maszyny wirtualnej lub kontenera" + +#: ../src/import/org.freedesktop.import1.policy.in.h:2 +msgid "Authentication is required to download a VM or container image" +msgstr "" +"Wymagane jest uwierzytelnienie, aby pobrać obraz maszyny wirtualnej lub " +"kontenera" + #: ../src/locale/org.freedesktop.locale1.policy.in.h:1 msgid "Set system locale" msgstr "Ustawienie lokalizacji systemu" @@ -66,44 +115,32 @@ msgstr "Zezwolenie programom na wstrzymywanie wyłączenia systemu" #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " -"shutdown." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"wyłączenia systemu." +"Authentication is required for an application to inhibit system shutdown." +msgstr "Program wymaga uwierzytelnienia, aby wstrzymać wyłączenie systemu." #: ../src/login/org.freedesktop.login1.policy.in.h:3 msgid "Allow applications to delay system shutdown" msgstr "Zezwolenie programom na opóźnienie wyłączenia systemu" #: ../src/login/org.freedesktop.login1.policy.in.h:4 -msgid "" -"Authentication is required to allow an application to delay system shutdown." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na opóźnienie " -"wyłączenia systemu." +msgid "Authentication is required for an application to delay system shutdown." +msgstr "Program wymaga uwierzytelnienia, aby opóźnić wyłączenie systemu." #: ../src/login/org.freedesktop.login1.policy.in.h:5 msgid "Allow applications to inhibit system sleep" msgstr "Zezwolenie programom na wstrzymanie uśpienia systemu" #: ../src/login/org.freedesktop.login1.policy.in.h:6 -msgid "" -"Authentication is required to allow an application to inhibit system sleep." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"uśpienia systemu." +msgid "Authentication is required for an application to inhibit system sleep." +msgstr "Program wymaga uwierzytelnienia, aby wstrzymać uśpienie systemu." #: ../src/login/org.freedesktop.login1.policy.in.h:7 msgid "Allow applications to delay system sleep" msgstr "Zezwolenie programom na opóźnienie uśpienia systemu" #: ../src/login/org.freedesktop.login1.policy.in.h:8 -msgid "" -"Authentication is required to allow an application to delay system sleep." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na opóźnienie " -"uśpienia systemu." +msgid "Authentication is required for an application to delay system sleep." +msgstr "Program wymaga uwierzytelnienia, aby opóźnić uśpienie systemu." #: ../src/login/org.freedesktop.login1.policy.in.h:9 msgid "Allow applications to inhibit automatic system suspend" @@ -111,11 +148,10 @@ msgstr "Zezwolenie programom na wstrzymanie automatycznego uśpienia systemu" #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " -"system suspend." +"Authentication is required for an application to inhibit automatic system " +"suspend." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"automatycznego uśpienia systemu." +"Program wymaga uwierzytelnienia, aby wstrzymać automatyczne uśpienie systemu." #: ../src/login/org.freedesktop.login1.policy.in.h:11 msgid "Allow applications to inhibit system handling of the power key" @@ -124,11 +160,11 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the power key." +"Authentication is required for an application to inhibit system handling of " +"the power key." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"obsługi klawisza zasilania przez system." +"Program wymaga uwierzytelnienia, aby wstrzymać obsługę klawisza zasilania " +"przez system." #: ../src/login/org.freedesktop.login1.policy.in.h:13 msgid "Allow applications to inhibit system handling of the suspend key" @@ -137,11 +173,11 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the suspend key." +"Authentication is required for an application to inhibit system handling of " +"the suspend key." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"obsługi klawisza uśpienia przez system." +"Program wymaga uwierzytelnienia, aby wstrzymać obsługę klawisza uśpienia " +"przez system." #: ../src/login/org.freedesktop.login1.policy.in.h:15 msgid "Allow applications to inhibit system handling of the hibernate key" @@ -150,11 +186,11 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the hibernate key." +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"obsługi klawisza hibernacji przez system." +"Program wymaga uwierzytelnienia, aby wstrzymać obsługę klawisza hibernacji " +"przez system." #: ../src/login/org.freedesktop.login1.policy.in.h:17 msgid "Allow applications to inhibit system handling of the lid switch" @@ -163,22 +199,21 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " -"handling of the lid switch." +"Authentication is required for an application to inhibit system handling of " +"the lid switch." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić programowi na wstrzymanie " -"obsługi przełącznika pokrywy przez system." +"Program wymaga uwierzytelnienia, aby wstrzymać obsługę przełącznika pokrywy " +"przez system." #: ../src/login/org.freedesktop.login1.policy.in.h:19 msgid "Allow non-logged-in users to run programs" msgstr "Zezwolenie niezalogowanym użytkownikom na uruchamianie programów" #: ../src/login/org.freedesktop.login1.policy.in.h:20 -msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +msgid "Authentication is required to run programs as a non-logged-in user." msgstr "" -"Wymagane jest uwierzytelnienie, aby zezwolić niezalogowanemu użytkownikowi " -"na uruchamianie programów." +"Wymagane jest uwierzytelnienie, aby uruchamiać programy jako niezalogowany " +"użytkownik." #: ../src/login/org.freedesktop.login1.policy.in.h:21 msgid "Allow attaching devices to seats" @@ -254,8 +289,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:35 msgid "Reboot the system while an application asked to inhibit it" -msgstr "" -"Ponowne uruchomienie systemu, kiedy program poprosił o jego wstrzymanie" +msgstr "Ponowne uruchomienie systemu, kiedy program zażądał jego wstrzymania" #: ../src/login/org.freedesktop.login1.policy.in.h:36 msgid "" @@ -287,7 +321,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:41 msgid "Suspend the system while an application asked to inhibit it" -msgstr "Uśpienie systemu, kiedy program poprosił o jego wstrzymanie" +msgstr "Uśpienie systemu, kiedy program zażądał jego wstrzymania" #: ../src/login/org.freedesktop.login1.policy.in.h:42 msgid "" @@ -329,6 +363,15 @@ msgstr "" "Wymagane jest uwierzytelnienie, aby zahibernować system, kiedy program " "zażądał jej wstrzymania." +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Logowanie do lokalnego kontenera" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "" +"Wymagane jest uwierzytelnienie, aby zalogować się do lokalnego kontenera" + #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 msgid "Set system time" msgstr "Ustawienie czasu systemu" @@ -368,52 +411,3 @@ msgid "" msgstr "" "Wymagane jest uwierzytelnienie, aby kontrolować, czy włączyć synchronizację " "czasu przez sieć." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 -msgid "Send passphrase back to system" -msgstr "Wysłanie hasła z powrotem do systemu" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 -msgid "" -"Authentication is required to send the entered passphrase back to the system." -msgstr "" -"Wymagane jest uwierzytelnienie, aby wysłać podane hasło z powrotem do " -"systemu." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 -msgid "Privileged system and service manager access" -msgstr "Uprawniony dostęp do menedżera systemu i usług" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 -msgid "Authentication is required to access the system and service manager." -msgstr "" -"Wymagane jest uwierzytelnienie, aby uzyskać dostęp do menedżera systemu i " -"usług." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 -msgid "Manage system services or units" -msgstr "Zarządzanie usługami lub jednostkami systemu" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 -msgid "Authentication is required to manage system services or units." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zarządzać usługami lub jednostkami " -"systemu." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 -msgid "Manage system service or unit files" -msgstr "Zarządzanie plikami usług lub jednostek systemu" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 -msgid "Authentication is required to manage system service or unit files." -msgstr "" -"Wymagane jest uwierzytelnienie, aby zarządzać plikami usług lub jednostek " -"systemu." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9 -msgid "Reload the systemd state" -msgstr "Ponowne wczytanie stanu systemd" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:10 -msgid "Authentication is required to reload the systemd state." -msgstr "Wymagane jest uwierzytelnienie, aby ponownie wczytać stan systemd." diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 000000000..520404750 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,421 @@ +# Brazilian Portuguese translation for systemd. +# Copyright (C) 2015 systemd's COPYRIGHT HOLDER +# This file is distributed under the same license as the systemd package. +# Rafael Ferreira , 2014. +# Enrico Nicoletto , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: systemd master\n" +"Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?" +"product=systemd&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2015-01-01 21:18+0000\n" +"PO-Revision-Date: 2015-01-10 12:23-0300\n" +"Last-Translator: Rafael Ferreira \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.7.1\n" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 +msgid "Set host name" +msgstr "Definir nome de máquina" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:2 +msgid "Authentication is required to set the local host name." +msgstr "É necessária autenticação para definir nome de máquina local." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:3 +msgid "Set static host name" +msgstr "Definir nome estático de máquina" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:4 +msgid "" +"Authentication is required to set the statically configured local host name, " +"as well as the pretty host name." +msgstr "" +"É necessária autenticação para definir o nome de máquina local configurado " +"estaticamente, assim como o nome apresentável de máquina." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5 +msgid "Set machine information" +msgstr "Definir informações da máquina" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:6 +msgid "Authentication is required to set local machine information." +msgstr "É necessária autenticação para definir informações de máquina local." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:1 +msgid "Set system locale" +msgstr "Definir configurações regionais do sistema" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:2 +msgid "Authentication is required to set the system locale." +msgstr "" +"É necessária autenticação para definir as configurações regionais do sistema." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:3 +msgid "Set system keyboard settings" +msgstr "Definir configurações de teclado do sistema" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:4 +msgid "Authentication is required to set the system keyboard settings." +msgstr "" +"É necessária autenticação para definir as configurações de teclado do " +"sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:1 +msgid "Allow applications to inhibit system shutdown" +msgstr "Permitir que aplicativos inibam o desligamento do sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:2 +msgid "" +"Authentication is required for an application to inhibit system shutdown." +msgstr "" +"É necessária autenticação para que um aplicativo iniba o desligamento do " +"sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:3 +msgid "Allow applications to delay system shutdown" +msgstr "Permitir que aplicativos atrasem o desligamento do sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:4 +msgid "Authentication is required for an application to delay system shutdown." +msgstr "" +"É necessária autenticação para que um aplicativo atrase o desligamento do " +"sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:5 +msgid "Allow applications to inhibit system sleep" +msgstr "Permitir que aplicativos inibam a suspensão do sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:6 +msgid "Authentication is required for an application to inhibit system sleep." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a suspensão do " +"sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:7 +msgid "Allow applications to delay system sleep" +msgstr "Permite que aplicativos atrasem a suspensão do sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:8 +msgid "Authentication is required for an application to delay system sleep." +msgstr "" +"É necessária autenticação para que um aplicativo atrase a suspensão do " +"sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:9 +msgid "Allow applications to inhibit automatic system suspend" +msgstr "Permitir que aplicativos inibam a suspensão automática do sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:10 +msgid "" +"Authentication is required for an application to inhibit automatic system " +"suspend." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a suspensão " +"automática do sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:11 +msgid "Allow applications to inhibit system handling of the power key" +msgstr "" +"Permitir que aplicativos inibam o sistema de gerenciar o botão de energia" + +#: ../src/login/org.freedesktop.login1.policy.in.h:12 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the power key." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a manipulação do " +"sistema sobre a chave de ligar/desligar." + +#: ../src/login/org.freedesktop.login1.policy.in.h:13 +msgid "Allow applications to inhibit system handling of the suspend key" +msgstr "" +"Permitir que aplicativos inibam o sistema de gerenciar o botão de suspensão" + +#: ../src/login/org.freedesktop.login1.policy.in.h:14 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the suspend key." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a manipulação do " +"sistema sobre a chave de suspensão." + +#: ../src/login/org.freedesktop.login1.policy.in.h:15 +msgid "Allow applications to inhibit system handling of the hibernate key" +msgstr "" +"Permitir que aplicativos inibam o sistema de gerenciar o botão de hibernação" + +#: ../src/login/org.freedesktop.login1.policy.in.h:16 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a manipulação do " +"sistema sobre a chave de hibernar." + +#: ../src/login/org.freedesktop.login1.policy.in.h:17 +msgid "Allow applications to inhibit system handling of the lid switch" +msgstr "" +"Permitir que aplicativos inibam o sistema de gerenciar a abertura/fechamento " +"da tampa do dispositivo portátil" + +#: ../src/login/org.freedesktop.login1.policy.in.h:18 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the lid switch." +msgstr "" +"É necessária autenticação para que um aplicativo iniba a manipulação do " +"sistema sobre o interruptor da tela." + +#: ../src/login/org.freedesktop.login1.policy.in.h:19 +msgid "Allow non-logged-in users to run programs" +msgstr "" +"Permitir que programas sejam executados por usuários que não possuem sessão" + +#: ../src/login/org.freedesktop.login1.policy.in.h:20 +msgid "Authentication is required to run programs as a non-logged-in user." +msgstr "" +"É necessária autenticação para executar programas como usuário sem sessão " +"aberta." + +#: ../src/login/org.freedesktop.login1.policy.in.h:21 +msgid "Allow attaching devices to seats" +msgstr "Permitir conectar dispositivos em estações" + +#: ../src/login/org.freedesktop.login1.policy.in.h:22 +msgid "Authentication is required for attaching a device to a seat." +msgstr "É necessária autenticação para conectar um dispositivo em uma estação." + +#: ../src/login/org.freedesktop.login1.policy.in.h:23 +msgid "Flush device to seat attachments" +msgstr "Liberar dispositivo para conexões da estação" + +#: ../src/login/org.freedesktop.login1.policy.in.h:24 +msgid "" +"Authentication is required for resetting how devices are attached to seats." +msgstr "" +"É necessária autenticação para redefinir a quantidade de dispositivos " +"conectados na estação." + +#: ../src/login/org.freedesktop.login1.policy.in.h:25 +msgid "Power off the system" +msgstr "Desligar o sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:26 +msgid "Authentication is required for powering off the system." +msgstr "É necessária autenticação para desligar o sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:27 +msgid "Power off the system while other users are logged in" +msgstr "Desligar o sistema enquanto outros usuários estão conectados" + +#: ../src/login/org.freedesktop.login1.policy.in.h:28 +msgid "" +"Authentication is required for powering off the system while other users are " +"logged in." +msgstr "" +"É necessária autenticação para desligar o sistema enquanto outros usuários " +"estão conectados." + +#: ../src/login/org.freedesktop.login1.policy.in.h:29 +msgid "Power off the system while an application asked to inhibit it" +msgstr "Desligar o sistema enquanto um aplicativo solicitou inibição" + +#: ../src/login/org.freedesktop.login1.policy.in.h:30 +msgid "" +"Authentication is required for powering off the system while an application " +"asked to inhibit it." +msgstr "" +"É necessária autenticação para desligar o sistema enquanto um aplicativo " +"solicitou inibição." + +#: ../src/login/org.freedesktop.login1.policy.in.h:31 +msgid "Reboot the system" +msgstr "Reiniciar o sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:32 +msgid "Authentication is required for rebooting the system." +msgstr "É necessária autenticação para reiniciar o sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:33 +msgid "Reboot the system while other users are logged in" +msgstr "Reiniciar o sistema enquanto outros usuários estiverem conectados" + +#: ../src/login/org.freedesktop.login1.policy.in.h:34 +msgid "" +"Authentication is required for rebooting the system while other users are " +"logged in." +msgstr "" +"É necessária autenticação para reiniciar o sistema enquanto outros usuários " +"estiverem conectados." + +#: ../src/login/org.freedesktop.login1.policy.in.h:35 +msgid "Reboot the system while an application asked to inhibit it" +msgstr "Reiniciar o sistema enquanto um aplicativo solicitou inibição" + +#: ../src/login/org.freedesktop.login1.policy.in.h:36 +msgid "" +"Authentication is required for rebooting the system while an application " +"asked to inhibit it." +msgstr "" +"É necessária autenticação para reiniciar o sistema enquanto um aplicativo " +"solicitou inibição." + +#: ../src/login/org.freedesktop.login1.policy.in.h:37 +msgid "Suspend the system" +msgstr "Suspender o sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:38 +msgid "Authentication is required for suspending the system." +msgstr "É necessária autenticação para suspender o sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:39 +msgid "Suspend the system while other users are logged in" +msgstr "Suspender o sistema enquanto outros usuários estiverem conectados" + +#: ../src/login/org.freedesktop.login1.policy.in.h:40 +msgid "" +"Authentication is required for suspending the system while other users are " +"logged in." +msgstr "" +"É necessária autenticação para suspender o sistema enquanto outros usuários " +"estiverem conectados." + +#: ../src/login/org.freedesktop.login1.policy.in.h:41 +msgid "Suspend the system while an application asked to inhibit it" +msgstr "Suspender o sistema enquanto um aplicativo solicitou inibição" + +#: ../src/login/org.freedesktop.login1.policy.in.h:42 +msgid "" +"Authentication is required for suspending the system while an application " +"asked to inhibit it." +msgstr "" +"É necessária autenticação para suspender o sistema enquanto um aplicativo " +"solicitou inibição." + +#: ../src/login/org.freedesktop.login1.policy.in.h:43 +msgid "Hibernate the system" +msgstr "Hibernar o sistema" + +#: ../src/login/org.freedesktop.login1.policy.in.h:44 +msgid "Authentication is required for hibernating the system." +msgstr "É necessária autenticação para hibernar o sistema." + +#: ../src/login/org.freedesktop.login1.policy.in.h:45 +msgid "Hibernate the system while other users are logged in" +msgstr "Hibernar o sistema enquanto outros usuários estiverem conectados" + +#: ../src/login/org.freedesktop.login1.policy.in.h:46 +msgid "" +"Authentication is required for hibernating the system while other users are " +"logged in." +msgstr "" +"É necessária autenticação para hibernar o sistema enquanto outros usuários " +"estiverem conectados." + +#: ../src/login/org.freedesktop.login1.policy.in.h:47 +msgid "Hibernate the system while an application asked to inhibit it" +msgstr "Hibernar o sistema enquanto um aplicativo solicitou inibição" + +#: ../src/login/org.freedesktop.login1.policy.in.h:48 +msgid "" +"Authentication is required for hibernating the system while an application " +"asked to inhibit it." +msgstr "" +"É necessária autenticação para hibernar o sistema enquanto um aplicativo " +"solicitou inibição." + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Conectar a um contêiner local" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "É necessária autenticação para se conectar a um contêiner local." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 +msgid "Set system time" +msgstr "Definir horário do sistema" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:2 +msgid "Authentication is required to set the system time." +msgstr "É necessária autenticação para definir o horário do sistema." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:3 +msgid "Set system timezone" +msgstr "Definir fuso horário do sistema" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:4 +msgid "Authentication is required to set the system timezone." +msgstr "É necessária autenticação para definir o fuso horário do sistema." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:5 +msgid "Set RTC to local timezone or UTC" +msgstr "Definir o relógio do sistema (RTC) para fuso horário local ou UTC" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:6 +msgid "" +"Authentication is required to control whether the RTC stores the local or " +"UTC time." +msgstr "" +"É necessária autenticação para controlar se o RTC deve, ou não, armazenar o " +"horário local ou de UTC." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7 +msgid "Turn network time synchronization on or off" +msgstr "Ligar/desligar a sincronização do horário em rede" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:8 +msgid "" +"Authentication is required to control whether network time synchronization " +"shall be enabled." +msgstr "" +"É necessária autenticação para controlar se deve ser habilitada, ou não, a " +"sincronização de horário através de rede." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Enviar frase secreta de volta ao sistema" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "" +"É necessária autenticação para enviar a frase secreta informada de volta ao " +"sistema." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Gerenciar unidades e serviços do sistema" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +msgid "Authentication is required to manage system services or units." +msgstr "" +"É necessária autenticação para gerenciar unidades e serviços do sistema." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Gerenciar arquivos de unidades e serviços do sistema" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "" +"É necessária autenticação para gerenciar arquivos \"unit\" e \"service\" do " +"sistema." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "Recarregar o estado do sistema" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "É necessária autenticação para recarregar o estado do sistema." + +#~ msgid "Privileged system and service manager access" +#~ msgstr "Acesso privilegiado ao gerenciador de serviço e de sistema" diff --git a/po/ru.po b/po/ru.po index de283f7ff..4dda60480 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,13 +1,13 @@ # translation of ru.po to Rissian # Julia Dronova , 2013. -# Sergey Ptashnick <0comffdiz@inbox.ru>, 2013-2014. +# Sergey Ptashnick <0comffdiz@inbox.ru>, 2013-2015. # msgid "" msgstr "" "Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: 0comffdiz@inbox.ru\n" "POT-Creation-Date: 2013-03-24 19:22+0300\n" -"PO-Revision-Date: 2014-08-29 19:29+0400\n" +"PO-Revision-Date: 2015-01-23 20:55+0300\n" "Last-Translator: Sergey Ptashnick <0comffdiz@inbox.ru>\n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -38,6 +38,14 @@ msgstr "Настроить информацию о компьютере" msgid "Authentication is required to set local machine information." msgstr "Чтобы настроить информацию о компьютере, необходимо пройти аутентификацию." +#: ../src/import/org.freedesktop.import1.policy.in.h:1 +msgid "Download a VM or container image" +msgstr "Загрузить образ виртуальной машины или контейнера" + +#: ../src/import/org.freedesktop.import1.policy.in.h:2 +msgid "Authentication is required to download a VM or container image" +msgstr "Чтобы загрузить образ виртуальной машины или контейнера, необходимо пройти аутентификацию." + #: ../src/locale/org.freedesktop.locale1.policy.in.h:1 msgid "Set system locale" msgstr "Настроить системную локаль" @@ -59,7 +67,7 @@ msgid "Allow applications to inhibit system shutdown" msgstr "Разрешить приложениям устанавливать блокировку на выключение системы" #: ../src/login/org.freedesktop.login1.policy.in.h:2 -msgid "Authentication is required to allow an application to inhibit system shutdown." +msgid "Authentication is required for an application to inhibit system shutdown." msgstr "Чтобы разрешить приложениям устанавливать блокировку на выключение системы, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:3 @@ -67,7 +75,7 @@ msgid "Allow applications to delay system shutdown" msgstr "Разрешить приложениям устанавливать задержку на выключение системы" #: ../src/login/org.freedesktop.login1.policy.in.h:4 -msgid "Authentication is required to allow an application to delay system shutdown." +msgid "Authentication is required for an application to delay system shutdown." msgstr "Чтобы разрешить приложениям устанавливать задержку на выключение системы, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:5 @@ -75,7 +83,7 @@ msgid "Allow applications to inhibit system sleep" msgstr "Разрешить приложениям устанавливать блокировку на засыпание системы" #: ../src/login/org.freedesktop.login1.policy.in.h:6 -msgid "Authentication is required to allow an application to inhibit system sleep." +msgid "Authentication is required for an application to inhibit system sleep." msgstr "Чтобы разрешить приложениям устанавливать блокировку на засыпание системы, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:7 @@ -83,7 +91,7 @@ msgid "Allow applications to delay system sleep" msgstr "Разрешить приложениям устанавливать задержку на засыпание системы" #: ../src/login/org.freedesktop.login1.policy.in.h:8 -msgid "Authentication is required to allow an application to delay system sleep." +msgid "Authentication is required for an application to delay system sleep." msgstr "Чтобы разрешить приложениям устанавливать задержку на засыпание системы, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:9 @@ -91,7 +99,7 @@ msgid "Allow applications to inhibit automatic system suspend" msgstr "Разрешить приложениям устанавливать блокировку на автоматический переход системы в ждущий режим" #: ../src/login/org.freedesktop.login1.policy.in.h:10 -msgid "Authentication is required to allow an application to inhibit automatic system suspend." +msgid "Authentication is required for an application to inhibit automatic system suspend." msgstr "Чтобы разрешить приложениям устанавливать блокировку на автоматический переход системы в ждущий режим, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:11 @@ -99,7 +107,7 @@ msgid "Allow applications to inhibit system handling of the power key" msgstr "Разрешить приложениям устанавливать блокировку обработки нажатий на кнопку выключения" #: ../src/login/org.freedesktop.login1.policy.in.h:12 -msgid "Authentication is required to allow an application to inhibit system handling of the power key." +msgid "Authentication is required for an application to inhibit system handling of the power key." msgstr "Чтобы разрешить приложениям устанавливать блокировку обработки нажатий на кнопку выключения, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:13 @@ -107,7 +115,7 @@ msgid "Allow applications to inhibit system handling of the suspend key" msgstr "Разрешить приложениям устанавливать блокировку обработки нажатий на кнопку перехода в ждущий режим" #: ../src/login/org.freedesktop.login1.policy.in.h:14 -msgid "Authentication is required to allow an application to inhibit system handling of the suspend key." +msgid "Authentication is required for an application to inhibit system handling of the suspend key." msgstr "Чтобы разрешить приложениям устанавливать блокировку обработки нажатий на кнопку перехода в ждущий режим, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:15 @@ -115,7 +123,7 @@ msgid "Allow applications to inhibit system handling of the hibernate key" msgstr "Разрешить приложениям устанавливать блокировку обработки нажатий на кнопку перехода в спящий режим" #: ../src/login/org.freedesktop.login1.policy.in.h:16 -msgid "Authentication is required to allow an application to inhibit system handling of the hibernate key." +msgid "Authentication is required for an application to inhibit system handling of the hibernate key." msgstr "Чтобы разрешить приложениям устанавливать блокировку обработки нажатий на кнопку перехода в спящий режим, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:17 @@ -123,7 +131,7 @@ msgid "Allow applications to inhibit system handling of the lid switch" msgstr "Разрешить приложениям устанавливать блокировку на обработку закрытия крышки ноутбука" #: ../src/login/org.freedesktop.login1.policy.in.h:18 -msgid "Authentication is required to allow an application to inhibit system handling of the lid switch." +msgid "Authentication is required for an application to inhibit system handling of the lid switch." msgstr "Чтобы разрешить приложениям устанавливать блокировку на обработку закрытия крышки ноутбука, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:19 @@ -131,7 +139,7 @@ msgid "Allow non-logged-in users to run programs" msgstr "Разрешить пользователям оставлять программы в фоновом режиме после завершения сеанса" #: ../src/login/org.freedesktop.login1.policy.in.h:20 -msgid "Authentication is required to allow a non-logged-in user to run programs." +msgid "Authentication is required to run programs as a non-logged-in user." msgstr "Чтобы разрешить пользователям оставлять программы в фоновом режиме после завершения сеанса, необходимо пройти аутентификацию." #: ../src/login/org.freedesktop.login1.policy.in.h:21 @@ -246,6 +254,14 @@ msgstr "Перевести систему в спящий режим, несмо msgid "Authentication is required for hibernating the system while an application asked to inhibit it." msgstr "Чтобы перевести систему в спящий режим, несмотря на то, что приложение запросило блокировку, необходимо пройти аутентификацию." +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Зайти в локальный контейнер" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container." +msgstr "Чтобы зайти в локальный контейнер, необходимо пройти аутентификацию." + #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 msgid "Set system time" msgstr "Настроить системное время" @@ -287,33 +303,25 @@ msgid "Authentication is required to send the entered passphrase back to the sys msgstr "Чтобы отправить пароль системе, необходимо пройти аутентификацию." #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 -msgid "Privileged system and service manager access" -msgstr "Привилегированный доступ к системному менеджеру" - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 -msgid "Authentication is required to access the system and service manager." -msgstr "Для привилегированного доступа к системному менеджеру необходимо пройти аутентификацию." - -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 msgid "Manage system services or units" msgstr "Управление системными службами и юнитами" -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 msgid "Authentication is required to manage system services or units." msgstr "Для управления системными службами и юнитами, необходимо пройти аутентификацию." -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 msgid "Manage system service or unit files" msgstr "Управление файлами конфигурации системных служб и юнитов" -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 msgid "Authentication is required to manage system service or unit files." msgstr "Для управления файлами конфигурации системных служб и юнитов, необходимо пройти аутентификацию." -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9 +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 msgid "Reload the systemd state" msgstr "Перечитать конфигурацию systemd" -#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:10 +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 msgid "Authentication is required to reload the systemd state." msgstr "Чтобы заставить systemd перечитать конфигурацию, необходимо пройти аутентификацию." diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 000000000..25d4ae825 --- /dev/null +++ b/po/sv.po @@ -0,0 +1,403 @@ +# Swedish translation for systemd. +# Copyright © 2015 systemd's COPYRIGHT HOLDER +# This file is distributed under the same license as the systemd package. +# Josef Andersson , 2015. +msgid "" +msgstr "" +"Project-Id-Version: systemd master\n" +"Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=sys" +"temd&keywords=I18N+L10N&component=general\n" +"POT-Creation-Date: 2015-01-04 11:43+0000\n" +"PO-Revision-Date: 2015-01-05 13:38+0200\n" +"Last-Translator: Josef Andersson \n" +"Language-Team: Swedish\n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.7.1\n" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1 +msgid "Set host name" +msgstr "Ange värdnamn" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:2 +msgid "Authentication is required to set the local host name." +msgstr "Autentisering krävs för att ange lokalt värdnamn." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:3 +msgid "Set static host name" +msgstr "Ange statiskt värdnamn" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:4 +msgid "" +"Authentication is required to set the statically configured local host name, " +"as well as the pretty host name." +msgstr "" +"Autentisering krävs för att ange det statiskt konfigurerade lokala " +"värdnamnet sÃ¥väl som det stiliga värdnamnet." + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5 +msgid "Set machine information" +msgstr "Ange datorinformation" + +#: ../src/hostname/org.freedesktop.hostname1.policy.in.h:6 +msgid "Authentication is required to set local machine information." +msgstr "Autentisering krävs för att ange lokal datorinformation." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:1 +msgid "Set system locale" +msgstr "Ange systemlokal" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:2 +msgid "Authentication is required to set the system locale." +msgstr "Autentisering krävs för att ange systemlokal." + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:3 +msgid "Set system keyboard settings" +msgstr "Ange systeminställningar för tangentbord" + +#: ../src/locale/org.freedesktop.locale1.policy.in.h:4 +msgid "Authentication is required to set the system keyboard settings." +msgstr "Autentisering krävs för att ange systeminställningar för tangentbord." + +#: ../src/login/org.freedesktop.login1.policy.in.h:1 +msgid "Allow applications to inhibit system shutdown" +msgstr "TillÃ¥t program att hindra systemavstängning" + +#: ../src/login/org.freedesktop.login1.policy.in.h:2 +msgid "" +"Authentication is required for an application to inhibit system shutdown." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra systemavstängning." + +#: ../src/login/org.freedesktop.login1.policy.in.h:3 +msgid "Allow applications to delay system shutdown" +msgstr "TillÃ¥t program att fördröja systemavstängning" + +#: ../src/login/org.freedesktop.login1.policy.in.h:4 +msgid "Authentication is required for an application to delay system shutdown." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att fördröja " +"systemavstängning." + +#: ../src/login/org.freedesktop.login1.policy.in.h:5 +msgid "Allow applications to inhibit system sleep" +msgstr "TillÃ¥t program att hindra system att försättas i viloläge" + +#: ../src/login/org.freedesktop.login1.policy.in.h:6 +msgid "Authentication is required for an application to inhibit system sleep." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra ett system att " +"försättas i viloläge." + +#: ../src/login/org.freedesktop.login1.policy.in.h:7 +msgid "Allow applications to delay system sleep" +msgstr "TillÃ¥t program att fördröja att system försätts i viloläge" + +#: ../src/login/org.freedesktop.login1.policy.in.h:8 +msgid "Authentication is required for an application to delay system sleep." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att fördröja ett system att " +"försättas i viloläge." + +#: ../src/login/org.freedesktop.login1.policy.in.h:9 +msgid "Allow applications to inhibit automatic system suspend" +msgstr "TillÃ¥t program att hindra automatiskt systemvänteläge" + +#: ../src/login/org.freedesktop.login1.policy.in.h:10 +msgid "" +"Authentication is required for an application to inhibit automatic system " +"suspend." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra automatiskt " +"systemvänteläge." + +#: ../src/login/org.freedesktop.login1.policy.in.h:11 +msgid "Allow applications to inhibit system handling of the power key" +msgstr "TillÃ¥t program att hindra systemhantering av strömknappen" + +#: ../src/login/org.freedesktop.login1.policy.in.h:12 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the power key." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra systemhantering " +"av strömknappen." + +#: ../src/login/org.freedesktop.login1.policy.in.h:13 +msgid "Allow applications to inhibit system handling of the suspend key" +msgstr "TillÃ¥t program att hindra systemhantering av väntelägesknappen" + +#: ../src/login/org.freedesktop.login1.policy.in.h:14 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the suspend key." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra systemhantering " +"av väntelägesknappen." + +#: ../src/login/org.freedesktop.login1.policy.in.h:15 +msgid "Allow applications to inhibit system handling of the hibernate key" +msgstr "TillÃ¥t program att hindra systemhantering av vilolägesknappen" + +#: ../src/login/org.freedesktop.login1.policy.in.h:16 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the hibernate key." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra systemhantering " +"av vilolägesknappen." + +#: ../src/login/org.freedesktop.login1.policy.in.h:17 +msgid "Allow applications to inhibit system handling of the lid switch" +msgstr "TillÃ¥t program att hindra systemhantering av växel för datorhölje" + +#: ../src/login/org.freedesktop.login1.policy.in.h:18 +msgid "" +"Authentication is required for an application to inhibit system handling of " +"the lid switch." +msgstr "" +"Autentisering krävs för att tillÃ¥ta ett program att hindra systemhantering " +"av brytaren för datorhöljet." + +#: ../src/login/org.freedesktop.login1.policy.in.h:19 +msgid "Allow non-logged-in users to run programs" +msgstr "TillÃ¥t ej inloggade användare att köra program" + +#: ../src/login/org.freedesktop.login1.policy.in.h:20 +msgid "Authentication is required to run programs as a non-logged-in user." +msgstr "" +"Autentisering krävs för att köra program som en icke inloggad användare." + +#: ../src/login/org.freedesktop.login1.policy.in.h:21 +msgid "Allow attaching devices to seats" +msgstr "TillÃ¥t att binda enheter till platser" + +#: ../src/login/org.freedesktop.login1.policy.in.h:22 +msgid "Authentication is required for attaching a device to a seat." +msgstr "Autentisering krävs för att binda en enhet till en plats." + +#: ../src/login/org.freedesktop.login1.policy.in.h:23 +msgid "Flush device to seat attachments" +msgstr "Töm bindningar för enhet-till-plats" + +#: ../src/login/org.freedesktop.login1.policy.in.h:24 +msgid "" +"Authentication is required for resetting how devices are attached to seats." +msgstr "" +"Autentisering krävs för att Ã¥terställa hur enheter är bundna till platser." + +#: ../src/login/org.freedesktop.login1.policy.in.h:25 +msgid "Power off the system" +msgstr "Stäng av systemet" + +#: ../src/login/org.freedesktop.login1.policy.in.h:26 +msgid "Authentication is required for powering off the system." +msgstr "Autentisering krävs för att stänga av systemet." + +#: ../src/login/org.freedesktop.login1.policy.in.h:27 +msgid "Power off the system while other users are logged in" +msgstr "Stäng av systemet medan andra användare är inloggade" + +#: ../src/login/org.freedesktop.login1.policy.in.h:28 +msgid "" +"Authentication is required for powering off the system while other users are " +"logged in." +msgstr "" +"Autentisering krävs för att stänga av systemet medan andra användare är " +"inloggade." + +#: ../src/login/org.freedesktop.login1.policy.in.h:29 +msgid "Power off the system while an application asked to inhibit it" +msgstr "Stäng av systemet även dÃ¥ ett program hindrar det" + +#: ../src/login/org.freedesktop.login1.policy.in.h:30 +msgid "" +"Authentication is required for powering off the system while an application " +"asked to inhibit it." +msgstr "" +"Autentisering krävs för att stänga av systemet även dÃ¥ ett program hindrar " +"det." + +#: ../src/login/org.freedesktop.login1.policy.in.h:31 +msgid "Reboot the system" +msgstr "Starta om systemet" + +#: ../src/login/org.freedesktop.login1.policy.in.h:32 +msgid "Authentication is required for rebooting the system." +msgstr "Autentisering krävs för att starta om systemet." + +#: ../src/login/org.freedesktop.login1.policy.in.h:33 +msgid "Reboot the system while other users are logged in" +msgstr "Starta om systemet medan andra användare är inloggade" + +#: ../src/login/org.freedesktop.login1.policy.in.h:34 +msgid "" +"Authentication is required for rebooting the system while other users are " +"logged in." +msgstr "" +"Autentisering krävs för att starta om systemet medan andra användare är " +"inloggade." + +#: ../src/login/org.freedesktop.login1.policy.in.h:35 +msgid "Reboot the system while an application asked to inhibit it" +msgstr "Starta om systemet även dÃ¥ ett program hindrar det." + +#: ../src/login/org.freedesktop.login1.policy.in.h:36 +msgid "" +"Authentication is required for rebooting the system while an application " +"asked to inhibit it." +msgstr "" +"Autentisering krävs för att starta om systemet även dÃ¥ ett program hindrar " +"det." + +#: ../src/login/org.freedesktop.login1.policy.in.h:37 +msgid "Suspend the system" +msgstr "Försätt system i vänteläge" + +#: ../src/login/org.freedesktop.login1.policy.in.h:38 +msgid "Authentication is required for suspending the system." +msgstr "Autentisering krävs för att försätta system i vänteläge." + +#: ../src/login/org.freedesktop.login1.policy.in.h:39 +msgid "Suspend the system while other users are logged in" +msgstr "Försätt systemet i vänteläge medan andra användare är inloggade" + +#: ../src/login/org.freedesktop.login1.policy.in.h:40 +msgid "" +"Authentication is required for suspending the system while other users are " +"logged in." +msgstr "" +"Autentisering krävs för att försätta systemet i vänteläge medan andra " +"användare är inloggade." + +#: ../src/login/org.freedesktop.login1.policy.in.h:41 +msgid "Suspend the system while an application asked to inhibit it" +msgstr "Försätt systemet i vänteläge även dÃ¥ ett program hindrar det" + +#: ../src/login/org.freedesktop.login1.policy.in.h:42 +msgid "" +"Authentication is required for suspending the system while an application " +"asked to inhibit it." +msgstr "" +"Autentisering krävs för att försätta ett program i vänteläge även dÃ¥ ett " +"program hindrar det." + +#: ../src/login/org.freedesktop.login1.policy.in.h:43 +msgid "Hibernate the system" +msgstr "Försätt systemet i viloläge" + +#: ../src/login/org.freedesktop.login1.policy.in.h:44 +msgid "Authentication is required for hibernating the system." +msgstr "Autentisering krävs för att försätta systemet i viloläge." + +#: ../src/login/org.freedesktop.login1.policy.in.h:45 +msgid "Hibernate the system while other users are logged in" +msgstr "Försätt systemet i viloläge medan andra användare är inloggade" + +#: ../src/login/org.freedesktop.login1.policy.in.h:46 +msgid "" +"Authentication is required for hibernating the system while other users are " +"logged in." +msgstr "" +"Autentisering krävs för att försätta systemet i viloläge medan andra " +"användare är inloggade." + +#: ../src/login/org.freedesktop.login1.policy.in.h:47 +msgid "Hibernate the system while an application asked to inhibit it" +msgstr "Försätt systemet i viloläge även dÃ¥ ett program hindrar det" + +#: ../src/login/org.freedesktop.login1.policy.in.h:48 +msgid "" +"Authentication is required for hibernating the system while an application " +"asked to inhibit it." +msgstr "" +"Autentisering krävs för att försätta ett program i viloläge även dÃ¥ ett " +"program hindrar det." + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:1 +msgid "Log into a local container" +msgstr "Logga till en lokal behÃ¥llare" + +#: ../src/machine/org.freedesktop.machine1.policy.in.h:2 +msgid "Authentication is required to log into a local container" +msgstr "Autentisering krävs för att tillÃ¥ta loggning till en lokal behÃ¥llare." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1 +msgid "Set system time" +msgstr "Ange systemtid" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:2 +msgid "Authentication is required to set the system time." +msgstr "Autentisering krävs för ange systemtiden." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:3 +msgid "Set system timezone" +msgstr "Ange systemets tidszon" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:4 +msgid "Authentication is required to set the system timezone." +msgstr "Autentisering krävs för att ange systemets tidszon." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:5 +msgid "Set RTC to local timezone or UTC" +msgstr "" +"Sätt realtidsklocka (RTC) till lokal tidszon eller koordinerad universell " +"tid (UTC)" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:6 +msgid "" +"Authentication is required to control whether the RTC stores the local or " +"UTC time." +msgstr "" +"Autentisering krävs för att kunna kontrollera huruvida realtidsklockan (RTC) " +"lagrar den lokala eller koordinerade universella tiden (UTC)." + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7 +msgid "Turn network time synchronization on or off" +msgstr "Växla synkronisering av nätverkstid pÃ¥ och av" + +#: ../src/timedate/org.freedesktop.timedate1.policy.in.h:8 +msgid "" +"Authentication is required to control whether network time synchronization " +"shall be enabled." +msgstr "" +"Autentisering krävs för att kontrollera huruvida synkronisering av " +"nätverkstid ska vara aktiverat." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1 +msgid "Send passphrase back to system" +msgstr "Skicka tillbaka lösenfras till system" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2 +msgid "" +"Authentication is required to send the entered passphrase back to the system." +msgstr "" +"Autentisering krävs för att skicka tillbaka den angivna lösenfrasen till " +"systemet." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3 +msgid "Manage system services or units" +msgstr "Hantera systemtjänster eller enheter" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4 +msgid "Authentication is required to manage system services or units." +msgstr "Autentisering krävs för att hantera systemtjänster eller enheter." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5 +msgid "Manage system service or unit files" +msgstr "Hantera systemtjänster eller enhetsfiler" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6 +msgid "Authentication is required to manage system service or unit files." +msgstr "Autentisering krävs för att hantera systemtjänster eller enhetsfiler." + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7 +msgid "Reload the systemd state" +msgstr "Läs om tillstÃ¥ndet för systemd" + +#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8 +msgid "Authentication is required to reload the systemd state." +msgstr "Autentisering krävs för att läsa om tillstÃ¥ndet för systemd." diff --git a/po/uk.po b/po/uk.po index 7a5212a1d..6e32236c3 100644 --- a/po/uk.po +++ b/po/uk.po @@ -70,7 +70,7 @@ msgstr "Дозволити програмам перешкоджати вимк #: ../src/login/org.freedesktop.login1.policy.in.h:2 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "shutdown." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати вимкненню системи." @@ -81,7 +81,7 @@ msgstr "Дозволити програмам затримувати вимкн #: ../src/login/org.freedesktop.login1.policy.in.h:4 msgid "" -"Authentication is required to allow an application to delay system shutdown." +"Authentication is required for an application to delay system shutdown." msgstr "" "Засвідчення потрібно, щоб дозволити програмам затримувати вимкнення системи." @@ -91,7 +91,7 @@ msgstr "Дозволити програмам перешкоджати заси #: ../src/login/org.freedesktop.login1.policy.in.h:6 msgid "" -"Authentication is required to allow an application to inhibit system sleep." +"Authentication is required for an application to inhibit system sleep." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати засинанню системи." @@ -101,7 +101,7 @@ msgstr "Дозволити програмами затримувати заси #: ../src/login/org.freedesktop.login1.policy.in.h:8 msgid "" -"Authentication is required to allow an application to delay system sleep." +"Authentication is required for an application to delay system sleep." msgstr "" "Засвідчення потрібно, щоб дозволити програмам затримувати засинання системи." @@ -111,7 +111,7 @@ msgstr "Дозволити програмам перешкоджати авто #: ../src/login/org.freedesktop.login1.policy.in.h:10 msgid "" -"Authentication is required to allow an application to inhibit automatic " +"Authentication is required for an application to inhibit automatic " "system suspend." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати автоматичному " @@ -123,7 +123,7 @@ msgstr "Дозволити програмам перешкоджати обро #: ../src/login/org.freedesktop.login1.policy.in.h:12 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the power key." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати обробленню " @@ -136,7 +136,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:14 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the suspend key." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати обробленню " @@ -148,7 +148,7 @@ msgstr "Дозволити програмам перешкоджати обро #: ../src/login/org.freedesktop.login1.policy.in.h:16 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the hibernate key." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати обробленню " @@ -162,7 +162,7 @@ msgstr "" #: ../src/login/org.freedesktop.login1.policy.in.h:18 msgid "" -"Authentication is required to allow an application to inhibit system " +"Authentication is required for an application to inhibit system " "handling of the lid switch." msgstr "" "Засвідчення потрібно, щоб дозволити програмам перешкоджати обробленню " @@ -174,7 +174,7 @@ msgstr "Дозволити незареєстрованим користувач #: ../src/login/org.freedesktop.login1.policy.in.h:20 msgid "" -"Authentication is required to allow a non-logged-in user to run programs." +"Authentication is required to run programs as a non-logged-in user." msgstr "" "Засвідчення потрібно, щоб дозволити незареєстрованим користувачам запускати " "програми." diff --git a/rules/60-cdrom_id.rules b/rules/60-cdrom_id.rules index 6eaf76a72..5c3b52ebb 100644 --- a/rules/60-cdrom_id.rules +++ b/rules/60-cdrom_id.rules @@ -15,6 +15,11 @@ ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdr # enable the receiving of media eject button events IMPORT{program}="cdrom_id --lock-media $devnode" +# ejecting a CD does not remove the device node, so mark the systemd device +# unit as inactive while there is no medium; this automatically cleans up of +# stale mounts after ejecting +ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0" + KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100" LABEL="cdrom_end" diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules index 475b15153..25b44a55c 100644 --- a/rules/60-persistent-storage.rules +++ b/rules/60-persistent-storage.rules @@ -14,7 +14,7 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_ SUBSYSTEM!="block", GOTO="persistent_storage_end" # skip rules for inappropriate block devices -KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|zram*", GOTO="persistent_storage_end" +KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|zram*|mmcblk[0-9]*rpmb", GOTO="persistent_storage_end" # ignore partitions that span the entire disk TEST=="whole_disk", GOTO="persistent_storage_end" diff --git a/rules/70-mouse.rules b/rules/70-mouse.rules index 0e359e83f..3ea743aff 100644 --- a/rules/70-mouse.rules +++ b/rules/70-mouse.rules @@ -11,5 +11,8 @@ KERNELS=="input*", ENV{ID_BUS}=="usb", \ KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \ IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ GOTO="mouse_end" +DRIVERS=="psmouse", SUBSYSTEMS=="serio", \ + IMPORT{builtin}="hwdb 'mouse:ps2::name:$attr{device/name}:'", \ + GOTO="mouse_end" LABEL="mouse_end" diff --git a/rules/70-touchpad.rules b/rules/70-touchpad.rules new file mode 100644 index 000000000..88e6fd2f2 --- /dev/null +++ b/rules/70-touchpad.rules @@ -0,0 +1,12 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="touchpad_end" +KERNEL!="event*", GOTO="touchpad_end" +ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end" + +# touchpad:pnpid::* +KERNELS=="serio1", \ + IMPORT{builtin}="hwdb 'touchpad:pnpid:$attr{firmware_id}:'", \ + GOTO="touchpad_end" + +LABEL="touchpad_end" diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index 49520e48d..6a770b1b8 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -30,25 +30,62 @@ __get_machines() { machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } -__get_endpoints() { +__get_busnames() { local mode=$1 local a b busctl $mode list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } +__get_objects() { + local mode=$1 + local busname=$2 + local a b + busctl $mode tree --list --no-legend --no-pager $busname | { while read a b; do echo " $a"; done; }; +} + +__get_interfaces() { + local mode=$1 + local busname=$2 + local path=$3 + local a b + busctl $mode introspect --list --no-legend --no-pager $busname $path | { while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }; +} + +__get_members() { + local mode=$1 + local busname=$2 + local path=$3 + local interface=$4 + local type=$5 + local a b + busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c; do [[ "$b" == "$type" ]] && echo " $a"; done; }; +} + +__get_signature() { + local mode=$1 + local busname=$2 + local path=$3 + local interface=$4 + local member=$5 + local a b + busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" ]] && echo " \"$c\""; done; }; +} + _busctl() { local i verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --no-pager --no-legend --system --user - --show-machine --unique --acquired --activatable' - [ARG]='-H --host -M --machine --address --match' + --show-machine --unique --acquired --activatable --list + --quiet --verbose --expect-reply=no --auto-start=no + --allow-interactive-authorization=yes --augment-creds=no' + [ARG]='-H --host -M --machine --address --match --timeout' ) if __contains_word "--user" ${COMP_WORDS[*]}; then - mode=--user + mode=--user else - mode=--system + mode=--system fi if __contains_word "$prev" ${OPTS[ARG]}; then @@ -70,7 +107,11 @@ _busctl() { local -A VERBS=( [STANDALONE]='list help' - [ENDPOINT]='monitor status' + [BUSNAME]='status monitor capture tree' + [OBJECT]='introspect' + [METHOD]='call' + [PROPERTY_GET]='get-property' + [PROPERTY_SET]='set-property' ) for ((i=0; i < COMP_CWORD; i++)); do @@ -81,12 +122,64 @@ _busctl() { fi done + n=$(($COMP_CWORD - $i)) + if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' - elif __contains_word "$verb" ${VERBS[ENDPOINT]}; then - comps=$( __get_endpoints $mode) + elif __contains_word "$verb" ${VERBS[BUSNAME]}; then + comps=$( __get_busnames $mode) + elif __contains_word "$verb" ${VERBS[OBJECT]}; then + if [[ $n -eq 1 ]] ; then + comps=$( __get_busnames $mode) + elif [[ $n -eq 2 ]] ; then + comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 3 ]] ; then + comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + else + comps='' + fi + elif __contains_word "$verb" ${VERBS[METHOD]}; then + if [[ $n -eq 1 ]] ; then + comps=$( __get_busnames $mode) + elif [[ $n -eq 2 ]] ; then + comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 3 ]] ; then + comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 4 ]] ; then + comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} method) + elif [[ $n -eq 5 ]] ; then + comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + else + comps='' + fi + elif __contains_word "$verb" ${VERBS[PROPERTY_GET]}; then + if [[ $n -eq 1 ]] ; then + comps=$( __get_busnames $mode) + elif [[ $n -eq 2 ]] ; then + comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 3 ]] ; then + comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 4 ]] ; then + comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property) + else + comps='' + fi + elif __contains_word "$verb" ${VERBS[PROPERTY_SET]}; then + if [[ $n -eq 1 ]] ; then + comps=$( __get_busnames $mode) + elif [[ $n -eq 2 ]] ; then + comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 3 ]] ; then + comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + elif [[ $n -eq 4 ]] ; then + comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property) + elif [[ $n -eq 5 ]] ; then + comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) + else + comps='' + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/shell-completion/bash/coredumpctl b/shell-completion/bash/coredumpctl index e23152d6a..609167750 100644 --- a/shell-completion/bash/coredumpctl +++ b/shell-completion/bash/coredumpctl @@ -37,7 +37,7 @@ __journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC} _coredumpctl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} - local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field' + local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field -1' local -A VERBS=( [LIST]='list' diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl index 7a0850dbe..9ad52e03b 100644 --- a/shell-completion/bash/hostnamectl +++ b/shell-completion/bash/hostnamectl @@ -28,7 +28,7 @@ _hostnamectl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --transient --static --pretty - --no-ask-password -H --host' + --no-ask-password -H --host --machine' if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index 14dcd223b..1387524a8 100644 --- a/shell-completion/bash/journalctl +++ b/shell-completion/bash/journalctl @@ -44,11 +44,15 @@ _journalctl() { --disk-usage -f --follow --header -h --help -l --local --new-id128 -m --merge --no-pager --no-tail -q --quiet --setup-keys --this-boot --verify - --version --list-catalog --update-catalog --list-boots' + --version --list-catalog --update-catalog --list-boots + --show-cursor --dmesg -k --pager-end -e -r --reverse + --utc -x --catalog --no-full --force --dump-catalog + --flush' [ARG]='-b --boot --this-boot -D --directory --file -F --field -o --output -u --unit --user-unit -p --priority' [ARGUNKNOWN]='-c --cursor --interval -n --lines --since --until - --verify-key' + --after-cursor --verify-key --identifier + --root --machine' ) if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then @@ -65,7 +69,7 @@ _journalctl() { compopt -o filenames ;; --output|-o) - comps='short short-monotonic verbose export json cat' + comps='short short-iso short-precise short-monotonic verbose export json json-pretty json-sse cat' ;; --field|-F) comps=${__journal_fields[*]} diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl index c9e22af2a..e0c06a794 100644 --- a/shell-completion/bash/localectl +++ b/shell-completion/bash/localectl @@ -34,7 +34,7 @@ _localectl() { local i verb comps locale_vals local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --no-convert --no-pager --no-ask-password - -H --host' + -H --host --machine' if __contains_word "$prev" $OPTS; then case $prev in diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index e7adb93f9..7a083d287 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -33,9 +33,10 @@ _loginctl () { local i verb comps local -A OPTS=( - [STANDALONE]='--all -a --help -h --no-pager --privileged -P --version' - [ARG]='--host -H --kill-who --property -p --signal -s' - ) + [STANDALONE]='--all -a --help -h --no-pager --privileged -P --version + --no-legend --no-ask-password -l --full' + [ARG]='--host -H --kill-who --property -p --signal -s --machine' + ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 77d1b542a..00947029c 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -36,7 +36,7 @@ _systemd_analyze() { local -A OPTS=( [STANDALONE]='--help --version --system --user --from-pattern --to-pattern --order --require --no-pager' - [ARG]='-H --host -M --machine' + [ARG]='-H --host -M --machine --fuzz --man' ) local -A VERBS=( diff --git a/shell-completion/bash/systemd-cgtop b/shell-completion/bash/systemd-cgtop index d7ea42d91..50464990a 100644 --- a/shell-completion/bash/systemd-cgtop +++ b/shell-completion/bash/systemd-cgtop @@ -30,7 +30,8 @@ _systemd_cgtop() { local -A OPTS=( [STANDALONE]='-h --help --version -p -t -c -m -i -b --batch -n --iterations -d --delay' - ) + [ARG]='--cpu --depth' + ) _init_completion || return diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn index f911d1b24..83e34ef02 100644 --- a/shell-completion/bash/systemd-nspawn +++ b/shell-completion/bash/systemd-nspawn @@ -34,6 +34,20 @@ __get_slices() { systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } +__get_machines() { + local a b + machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; +} + +__get_env() { + local a + env | { while read a; do echo " ${a%%=*}"; done; }; +} + +__get_interfaces(){ + cut -f 1 -d ' ' /proc/net/dev | tail -n +3 | tr -s '\n' | tr -d ':' | xargs +} + _systemd_nspawn() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps @@ -42,7 +56,8 @@ _systemd_nspawn() { [STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system --keep-unit --network-veth -j' [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine -S --slice --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge - --personality -i --image' + --personality -i --image --tmpfs --volatile + --network-macvlan' ) _init_completion || return @@ -50,7 +65,8 @@ _systemd_nspawn() { if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --directory|-D) - comps=$(compgen -A directory -- "$cur" ) + compopt -o nospace + comps=$(compgen -S/ -A directory -- "$cur" ) ;; --user|-u) comps=$( __get_users ) @@ -72,16 +88,21 @@ _systemd_nspawn() { comps='no auto guest host' ;; --bind|--bind-ro) - comps='' + compopt -o nospace + comps=$(compgen -S/ -A directory -- "$cur" ) + ;; + --tmpfs) + compopt -o nospace + comps=$(compgen -S/ -A directory -- "$cur" ) ;; --machine|-M) - comps='' + comps=$( __get_machines ) ;; --slice|-S) comps=$( __get_slices ) ;; --setenv) - comps='' + comps=$( __get_env ) ;; --selinux-context|-Z) comps='' @@ -93,15 +114,22 @@ _systemd_nspawn() { comps='yes no' ;; --network-interface) - comps='' + comps=$(__get_interfaces) ;; --network-bridge) comps='' ;; + --network-macvlan) + comps='' + ;; --personality) comps='x86 x86-64' ;; + --volatile) + comps='yes state no' + ;; --image|-i) + compopt -o nospace comps=$( compgen -A file -- "$cur" ) ;; esac diff --git a/shell-completion/bash/timedatectl b/shell-completion/bash/timedatectl index 1a0acc6c7..a57fbd254 100644 --- a/shell-completion/bash/timedatectl +++ b/shell-completion/bash/timedatectl @@ -28,7 +28,7 @@ _timedatectl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --adjust-system-clock --no-pager - --no-ask-password -H --host' + --no-ask-password -H --host --machine' if __contains_word "$prev" $OPTS; then case $prev in diff --git a/shell-completion/zsh/_coredumpctl b/shell-completion/zsh/_coredumpctl index d13bc703a..833c7e2bb 100644 --- a/shell-completion/zsh/_coredumpctl +++ b/shell-completion/zsh/_coredumpctl @@ -4,6 +4,7 @@ _coredumpctl_command(){ local -a _coredumpctl_cmds _coredumpctl_cmds=( 'list:List available coredumps' + 'info:Show detailed information about one or more coredumps' 'dump:Print coredump to stdout' 'gdb:Start gdb on a coredump' ) @@ -30,7 +31,9 @@ _coredumpctl_command(){ _arguments \ {-o+,--output=}'[Write output to FILE]:output file:_files' \ {-F+,--field=}'[Show field in list output]:field' \ + '-1[Show information about most recent entry only]' \ '--no-pager[Do not pipe output into a pager]' \ + '--no-legend[Do not print the column headers]' \ {-h,--help}'[Show this help]' \ '--version[Show package version]' \ '*::coredumpctl commands:_coredumpctl_command' diff --git a/shell-completion/zsh/_sd_outputmodes b/shell-completion/zsh/_sd_outputmodes index dae8a5c0d..3836f79b7 100644 --- a/shell-completion/zsh/_sd_outputmodes +++ b/shell-completion/zsh/_sd_outputmodes @@ -1,5 +1,5 @@ #autoload local -a _output_opts -_output_opts=(short short-monotonic verbose export json json-pretty json-see cat) +_output_opts=(short short-iso short-precise short-monotonic verbose export json json-pretty json-sse cat) _describe -t output 'output mode' _output_opts || compadd "$@" diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 3fa59faca..7f2d5ac0f 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -137,7 +137,7 @@ _filter_units_by_property() { unit=${units[i]} prop=${(f)"$(_call_program units "$service show --no-pager --property="$property" ${unit} 2>/dev/null")"} if [[ "${prop}" = "$property=$value" ]]; then - echo " ${unit}" + echo -E - " ${unit}" fi done } diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze index c101ad0fa..2c0e5433e 100644 --- a/shell-completion/zsh/_systemd-analyze +++ b/shell-completion/zsh/_systemd-analyze @@ -42,13 +42,17 @@ _systemd_analyze_command(){ } _arguments \ - {-h,--help}'[Show help text.]' \ - '--system[Operate on system systemd instance.]' \ - '--user[Operate on user systemd instance.]' \ - '--no-pager[Do not user pager.]' \ - '--no-man[Do not check man pages.]' \ + {-h,--help}'[Show help text]' \ + '--version[Show package version]' \ + '--system[Operate on system systemd instance]' \ + '--user[Operate on user systemd instance]' \ + '--no-pager[Do not pipe output into a pager]' \ + '--man=[Do (not) check for existence of man pages]:boolean:(1 0)' \ '--order[When generating graph for dot, show only order]' \ '--require[When generating graph for dot, show only requirement]' \ + '--fuzz=[When printing the tree of the critical chain, print also services, which finished TIMESPAN earlier, than the latest in the branch]:TIMESPAN' \ + '--from-pattern=[When generating a dependency graph, filter only origins]:GLOB' \ + '--to-pattern=[When generating a dependency graph, filter only destinations]:GLOB' \ {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ {-M+,--machine=}'[Operate on local container]:machine' \ '*::systemd-analyze commands:_systemd_analyze_command' diff --git a/shell-completion/zsh/_systemd-run b/shell-completion/zsh/_systemd-run index 9bb770072..8d6957fa9 100644 --- a/shell-completion/zsh/_systemd-run +++ b/shell-completion/zsh/_systemd-run @@ -26,8 +26,21 @@ _arguments \ {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '--scope[Run this as scope rather than service]' \ '--unit=[Run under the specified unit name]:unit name' \ + {-p+,--property=}'[Set unit property]:NAME=VALUE' \ '--description=[Description for unit]:description' \ '--slice=[Run in the specified slice]:slices:__slices' \ {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ '--send-sighup[Send SIGHUP when terminating]' \ + '--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \ + '--uid=[Run as system user]:user:_users' \ + '--gid=[Run as system group]:group:_groups' \ + '--nice=[Nice level]:nice level' \ + '--setenv=[Set environment]:NAME=VALUE' \ + '--on-active=[Run after SEC seconds]:SEC' \ + '--on-boot=[Run after SEC seconds from machine was booted up]:SEC' \ + '--on-statup=[Run after SEC seconds from systemd was first started]:SEC' \ + '--on-unit-active=[Run after SEC seconds from the last activation]:SEC' \ + '--on-unit-inactive=[Run after SEC seconds from the last deactivation]:SEC' \ + '--on-calendar=[Realtime timer]:SPEC' \ + '--timer-property=[Set timer unit property]:NAME=VALUE' \ '*::command:_command' diff --git a/shell-completion/zsh/_systemd-tmpfiles b/shell-completion/zsh/_systemd-tmpfiles index 4913dedd2..6ff02e5d9 100644 --- a/shell-completion/zsh/_systemd-tmpfiles +++ b/shell-completion/zsh/_systemd-tmpfiles @@ -1,10 +1,13 @@ #compdef systemd-tmpfiles _arguments \ + {-h,--help}'[Show help]' \ + '--version[Show package version]' \ '--create[Create, set ownership/permissions based on the config files.]' \ '--clean[Clean up all files and directories with an age parameter configured.]' \ '--remove[All files and directories marked with r, R in the configuration files are removed.]' \ + '--boot[Execute actions only safe at boot]' \ '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \ '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \ - '--help[Prints a short help text and exits.]' \ + '--root=[Operate on an alternate filesystem root]:directory:_directories' \ '*::files:_files' diff --git a/shell-completion/zsh/_timedatectl b/shell-completion/zsh/_timedatectl index 987c2de88..dfdcfebb3 100644 --- a/shell-completion/zsh/_timedatectl +++ b/shell-completion/zsh/_timedatectl @@ -62,4 +62,5 @@ _arguments -s \ '--no-pager[Do not pipe output into a pager]' \ '--no-ask-password[Do not prompt for password]' \ {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '*::timedatectl commands:_timedatectl_command' diff --git a/src/analyze/analyze-verify.h b/src/analyze/analyze-verify.h index 5c86d9862..f10c34c4a 100644 --- a/src/analyze/analyze-verify.h +++ b/src/analyze/analyze-verify.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#pragma once + #include #include "path-lookup.h" diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 9a5fd741c..591b4ab14 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "sd-bus.h" #include "bus-util.h" @@ -975,56 +974,35 @@ static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop, _cleanup_strv_free_ char **units = NULL; char **unit; int r; + bool match_patterns; assert(u); assert(prop); assert(color); + match_patterns = strv_fnmatch(patterns, u->id, 0); + + if (!strv_isempty(arg_dot_from_patterns) && + !match_patterns && + !strv_fnmatch(arg_dot_from_patterns, u->id, 0)) + return 0; + r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units); if (r < 0) return r; STRV_FOREACH(unit, units) { - char **p; - bool match_found; - - if (!strv_isempty(arg_dot_from_patterns)) { - match_found = false; - - STRV_FOREACH(p, arg_dot_from_patterns) - if (fnmatch(*p, u->id, 0) == 0) { - match_found = true; - break; - } - - if (!match_found) - continue; - } + bool match_patterns2; - if (!strv_isempty(arg_dot_to_patterns)) { - match_found = false; + match_patterns2 = strv_fnmatch(patterns, *unit, 0); - STRV_FOREACH(p, arg_dot_to_patterns) - if (fnmatch(*p, *unit, 0) == 0) { - match_found = true; - break; - } - - if (!match_found) - continue; - } - - if (!strv_isempty(patterns)) { - match_found = false; + if (!strv_isempty(arg_dot_to_patterns) && + !match_patterns2 && + !strv_fnmatch(arg_dot_to_patterns, *unit, 0)) + continue; - STRV_FOREACH(p, patterns) - if (fnmatch(*p, u->id, 0) == 0 || fnmatch(*p, *unit, 0) == 0) { - match_found = true; - break; - } - if (!match_found) - continue; - } + if (!strv_isempty(patterns) && !match_patterns && !match_patterns2) + continue; printf("\t\"%s\"->\"%s\" [color=\"%s\"];\n", u->id, *unit, color); } @@ -1195,18 +1173,15 @@ static void help(void) { " --user Operate on user systemd instance\n" " -H --host=[USER@]HOST Operate on remote host\n" " -M --machine=CONTAINER Operate on local container\n" - " --order When generating a dependency graph, show only order\n" - " --require When generating a dependency graph, show only requirement\n" - " --from-pattern=GLOB, --to-pattern=GLOB\n" - " When generating a dependency graph, filter only origins\n" - " or destinations, respectively\n" - " --fuzz=TIMESPAN When printing the tree of the critical chain, print also\n" - " services, which finished TIMESPAN earlier, than the\n" - " latest in the branch. The unit of TIMESPAN is seconds\n" - " unless specified with a different unit, i.e. 50ms\n" + " --order Show only order in the graph\n" + " --require Show only requirement in the graph\n" + " --from-pattern=GLOB Show only origins in the graph\n" + " --to-pattern=GLOB Show only destinations in the graph\n" + " --fuzz=SECONDS Also print also services which finished SECONDS\n" + " earlier than the latest in the branch\n" " --man[=BOOL] Do [not] check for existence of man pages\n\n" "Commands:\n" - " time Print time spent in the kernel before reaching userspace\n" + " time Print time spent in the kernel\n" " blame Print list of running units ordered by time to init\n" " critical-chain Print a tree of the time critical chain of units\n" " plot Output SVG graphic showing service initialization\n" @@ -1313,7 +1288,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c index 1ce8776d8..ad8ad659d 100644 --- a/src/ask-password/ask-password.c +++ b/src/ask-password/ask-password.c @@ -20,7 +20,7 @@ ***/ #include -#include +#include #include #include #include diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c index 1271a6698..c79ad6520 100644 --- a/src/backlight/backlight.c +++ b/src/backlight/backlight.c @@ -373,6 +373,7 @@ int main(int argc, char *argv[]) { if (streq(argv[1], "load")) { _cleanup_free_ char *value = NULL; + const char *clamp; if (!shall_restore_state()) return EXIT_SUCCESS; @@ -390,7 +391,9 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - clamp_brightness(device, &value, max_brightness); + clamp = udev_device_get_property_value(device, "ID_BACKLIGHT_CLAMP"); + if (!clamp || parse_boolean(clamp) != 0) /* default to clamping */ + clamp_brightness(device, &value, max_brightness); r = udev_device_set_sysattr_value(device, "brightness", value); if (r < 0) { diff --git a/src/boot/boot-loader.h b/src/boot/boot-loader.h index 08827c30a..b3fcdeeda 100644 --- a/src/boot/boot-loader.h +++ b/src/boot/boot-loader.h @@ -21,5 +21,7 @@ along with systemd; If not, see . ***/ +#include "boot.h" + int boot_loader_read_entries(struct boot_info *info); int boot_loader_find_active_entry(struct boot_info *info, const char *loader_active); diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 0808ba44e..64a384bac 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -76,7 +76,7 @@ int sysfd=-1; #define DEFAULT_HZ 25.0 #define DEFAULT_SCALE_X 100.0 /* 100px = 1sec */ #define DEFAULT_SCALE_Y 20.0 /* 16px = 1 process bar */ -#define DEFAULT_INIT "/sbin/init" +#define DEFAULT_INIT ROOTLIBDIR "/systemd/systemd" #define DEFAULT_OUTPUT "/run/log" /* graph defaults */ @@ -87,6 +87,7 @@ bool arg_filter = true; bool arg_show_cmdline = false; bool arg_show_cgroup = false; bool arg_pss = false; +bool arg_percpu = false; int samples; int arg_samples_len = DEFAULT_SAMPLES_LEN; /* we record len+1 (1 start sample) */ double arg_hz = DEFAULT_HZ; @@ -122,6 +123,7 @@ static void parse_conf(void) { { "Bootchart", "ScaleX", config_parse_double, 0, &arg_scale_x }, { "Bootchart", "ScaleY", config_parse_double, 0, &arg_scale_y }, { "Bootchart", "ControlGroup", config_parse_bool, 0, &arg_show_cgroup }, + { "Bootchart", "PerCPU", config_parse_bool, 0, &arg_percpu }, { NULL, NULL, NULL, 0, NULL } }; @@ -151,6 +153,7 @@ static void help(void) { " -F, --no-filter Disable filtering of unimportant or ephemeral processes\n" " -C, --cmdline Display full command lines with arguments\n" " -c, --control-group Display process control group\n" + " --per-cpu Draw each CPU utilization and wait bar also\n" " -h, --help Display this message\n\n" "See bootchart.conf for more information.\n", program_invocation_short_name, @@ -163,20 +166,26 @@ static void help(void) { } static int parse_argv(int argc, char *argv[]) { + + enum { + ARG_PERCPU = 0x100, + }; + static const struct option options[] = { - {"rel", no_argument, NULL, 'r'}, - {"freq", required_argument, NULL, 'f'}, - {"samples", required_argument, NULL, 'n'}, - {"pss", no_argument, NULL, 'p'}, - {"output", required_argument, NULL, 'o'}, - {"init", required_argument, NULL, 'i'}, - {"no-filter", no_argument, NULL, 'F'}, - {"cmdline", no_argument, NULL, 'C'}, - {"control-group", no_argument, NULL, 'c'}, - {"help", no_argument, NULL, 'h'}, - {"scale-x", required_argument, NULL, 'x'}, - {"scale-y", required_argument, NULL, 'y'}, - {"entropy", no_argument, NULL, 'e'}, + {"rel", no_argument, NULL, 'r' }, + {"freq", required_argument, NULL, 'f' }, + {"samples", required_argument, NULL, 'n' }, + {"pss", no_argument, NULL, 'p' }, + {"output", required_argument, NULL, 'o' }, + {"init", required_argument, NULL, 'i' }, + {"no-filter", no_argument, NULL, 'F' }, + {"cmdline", no_argument, NULL, 'C' }, + {"control-group", no_argument, NULL, 'c' }, + {"help", no_argument, NULL, 'h' }, + {"scale-x", required_argument, NULL, 'x' }, + {"scale-y", required_argument, NULL, 'y' }, + {"entropy", no_argument, NULL, 'e' }, + {"per-cpu", no_argument, NULL, ARG_PERCPU}, {} }; int c, r; @@ -237,6 +246,9 @@ static int parse_argv(int argc, char *argv[]) { case 'e': arg_entropy = true; break; + case ARG_PERCPU: + arg_percpu = true; + break; case 'h': help(); return 0; @@ -326,7 +338,7 @@ int main(int argc, char *argv[]) { /* * If the kernel executed us through init=/usr/lib/systemd/systemd-bootchart, then * fork: - * - parent execs executable specified via init_path[] (/sbin/init by default) as pid=1 + * - parent execs executable specified via init_path[] (/usr/lib/systemd/systemd by default) as pid=1 * - child logs data */ if (getpid() == 1) { diff --git a/src/bootchart/bootchart.conf b/src/bootchart/bootchart.conf index c73328fde..2d7cb6121 100644 --- a/src/bootchart/bootchart.conf +++ b/src/bootchart/bootchart.conf @@ -22,3 +22,4 @@ #ScaleX=100 #ScaleY=20 #ControlGroup=no +#PerCPU=no diff --git a/src/bootchart/bootchart.h b/src/bootchart/bootchart.h index 2c3783580..26de0dd9f 100644 --- a/src/bootchart/bootchart.h +++ b/src/bootchart/bootchart.h @@ -118,6 +118,7 @@ extern bool arg_show_cmdline; extern bool arg_show_cgroup; extern bool arg_pss; extern bool arg_entropy; +extern bool arg_percpu; extern bool initcall; extern int samples; extern int cpus; diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index e5569e162..e111fa9cc 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -749,11 +749,14 @@ static void svg_io_bo_bar(void) { } } -static void svg_cpu_bar(void) { +static void svg_cpu_bar(int cpu_num) { svg("\n"); - svg("CPU utilization\n"); + if (cpu_num < 0) + svg("CPU[overall] utilization\n"); + else + svg("CPU[%d] utilization\n", cpu_num); /* surrounding box */ svg_graph_box(5); @@ -766,12 +769,16 @@ static void svg_cpu_bar(void) { ptrt = trt = 0.0; - for (c = 0; c < cpus; c++) - trt += sampledata->runtime[c] - prev_sampledata->runtime[c]; + if (cpu_num < 0) + for (c = 0; c < cpus; c++) + trt += sampledata->runtime[c] - prev_sampledata->runtime[c]; + else + trt = sampledata->runtime[cpu_num] - prev_sampledata->runtime[cpu_num]; trt = trt / 1000000000.0; - trt = trt / (double)cpus; + if (cpu_num < 0) + trt = trt / (double)cpus; if (trt > 0.0) ptrt = trt / (sampledata->sampletime - prev_sampledata->sampletime); @@ -790,11 +797,14 @@ static void svg_cpu_bar(void) { } } -static void svg_wait_bar(void) { +static void svg_wait_bar(int cpu_num) { svg("\n"); - svg("CPU wait\n"); + if (cpu_num < 0) + svg("CPU[overall] wait\n"); + else + svg("CPU[%d] wait\n", cpu_num); /* surrounding box */ svg_graph_box(5); @@ -808,12 +818,16 @@ static void svg_wait_bar(void) { ptwt = twt = 0.0; - for (c = 0; c < cpus; c++) - twt += sampledata->waittime[c] - prev_sampledata->waittime[c]; + if (cpu_num < 0) + for (c = 0; c < cpus; c++) + twt += sampledata->waittime[c] - prev_sampledata->waittime[c]; + else + twt = sampledata->waittime[cpu_num] - prev_sampledata->waittime[cpu_num]; twt = twt / 1000000000.0; - twt = twt / (double)cpus; + if (cpu_num < 0) + twt = twt / (double)cpus; if (twt > 0.0) ptwt = twt / (sampledata->sampletime - prev_sampledata->sampletime); @@ -832,7 +846,6 @@ static void svg_wait_bar(void) { } } - static void svg_entropy_bar(void) { svg("\n"); @@ -1256,6 +1269,8 @@ static void svg_top_ten_pss(void) { void svg_do(const char *build) { struct ps_struct *ps; + double offset = 7; + int c; memzero(&str, sizeof(str)); @@ -1284,25 +1299,31 @@ void svg_do(const char *build) { svg_io_bi_bar(); svg("\n\n"); - svg("\n", 400.0 + (arg_scale_y * 7.0)); + svg("\n", 400.0 + (arg_scale_y * offset)); svg_io_bo_bar(); svg("\n\n"); - svg("\n", 400.0 + (arg_scale_y * 14.0)); - svg_cpu_bar(); - svg("\n\n"); + for (c = -1; c < (arg_percpu ? cpus : 0); c++) { + offset += 7; + svg("\n", 400.0 + (arg_scale_y * offset)); + svg_cpu_bar(c); + svg("\n\n"); - svg("\n", 400.0 + (arg_scale_y * 21.0)); - svg_wait_bar(); - svg("\n\n"); + offset += 7; + svg("\n", 400.0 + (arg_scale_y * offset)); + svg_wait_bar(c); + svg("\n\n"); + } if (kcount) { - svg("\n", 400.0 + (arg_scale_y * 28.0)); + offset += 7; + svg("\n", 400.0 + (arg_scale_y * offset)); svg_do_initcall(0); svg("\n\n"); } - svg("\n", 400.0 + (arg_scale_y * 28.0) + ksize); + offset += 7; + svg("\n", 400.0 + (arg_scale_y * offset) + ksize); svg_ps_bars(); svg("\n\n"); @@ -1315,13 +1336,13 @@ void svg_do(const char *build) { svg("\n\n"); if (arg_entropy) { - svg("\n", 400.0 + (arg_scale_y * 28.0) + ksize + psize); + svg("\n", 400.0 + (arg_scale_y * offset) + ksize + psize); svg_entropy_bar(); svg("\n\n"); } if (arg_pss) { - svg("\n", 400.0 + (arg_scale_y * 28.0) + ksize + psize + esize); + svg("\n", 400.0 + (arg_scale_y * offset) + ksize + psize + esize); svg_pss_graph(); svg("\n\n"); diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c index 5d304538f..b6b005636 100644 --- a/src/bus-proxyd/bus-proxyd.c +++ b/src/bus-proxyd/bus-proxyd.c @@ -6,6 +6,7 @@ Copyright 2010 Lennart Poettering Copyright 2013 Daniel Mack Copyright 2014 Kay Sievers + Copyright 2015 David Herrmann systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -28,12 +29,15 @@ #include #include #include -#include +#include +#include #include #include +#include #include "log.h" #include "util.h" +#include "hashmap.h" #include "socket-util.h" #include "sd-daemon.h" #include "sd-bus.h" @@ -44,22 +48,145 @@ #include "strv.h" #include "def.h" #include "capability.h" -#include "bus-policy.h" #include "bus-control.h" #include "smack-util.h" +#include "set.h" +#include "bus-xml-policy.h" +#include "driver.h" +#include "proxy.h" +#include "synthesize.h" static char *arg_address = NULL; -static char *arg_command_line_buffer = NULL; -static bool arg_drop_privileges = false; static char **arg_configuration = NULL; +typedef struct { + int fd; + SharedPolicy *policy; + uid_t bus_uid; +} ClientContext; + +static ClientContext *client_context_free(ClientContext *c) { + if (!c) + return NULL; + + safe_close(c->fd); + free(c); + + return NULL; +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(ClientContext*, client_context_free); + +static int client_context_new(ClientContext **out) { + _cleanup_(client_context_freep) ClientContext *c = NULL; + + c = new0(ClientContext, 1); + if (!c) + return log_oom(); + + c->fd = -1; + + *out = c; + c = NULL; + return 0; +} + +static void *run_client(void *userdata) { + _cleanup_(client_context_freep) ClientContext *c = userdata; + _cleanup_(proxy_freep) Proxy *p = NULL; + char comm[16]; + int r; + + r = proxy_new(&p, c->fd, c->fd, arg_address); + if (r < 0) + goto exit; + + c->fd = -1; + + /* set comm to "p$PIDu$UID" and suffix with '*' if truncated */ + r = snprintf(comm, sizeof(comm), "p" PID_FMT "u" UID_FMT, p->local_creds.pid, p->local_creds.uid); + if (r >= (ssize_t)sizeof(comm)) + comm[sizeof(comm) - 2] = '*'; + (void) prctl(PR_SET_NAME, comm); + + r = proxy_set_policy(p, c->policy, arg_configuration); + if (r < 0) + goto exit; + + r = proxy_hello_policy(p, c->bus_uid); + if (r < 0) + goto exit; + + r = proxy_run(p); + +exit: + return NULL; +} + +static int loop_clients(int accept_fd, uid_t bus_uid) { + _cleanup_(shared_policy_freep) SharedPolicy *sp = NULL; + pthread_attr_t attr; + int r; + + r = pthread_attr_init(&attr); + if (r < 0) { + return log_error_errno(errno, "Cannot initialize pthread attributes: %m"); + } + + r = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (r < 0) { + r = log_error_errno(errno, "Cannot mark pthread attributes as detached: %m"); + goto finish; + } + + r = shared_policy_new(&sp); + if (r < 0) + goto finish; + + for (;;) { + ClientContext *c; + pthread_t tid; + int fd; + + fd = accept4(accept_fd, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC); + if (fd < 0) { + if (errno == EAGAIN || errno == EINTR) + continue; + + r = log_error_errno(errno, "accept4() failed: %m"); + goto finish; + } + + r = client_context_new(&c); + if (r < 0) { + log_oom(); + close(fd); + continue; + } + + c->fd = fd; + c->policy = sp; + c->bus_uid = bus_uid; + + r = pthread_create(&tid, &attr, run_client, c); + if (r < 0) { + log_error("Cannot spawn thread: %m"); + client_context_free(c); + continue; + } + } + +finish: + pthread_attr_destroy(&attr); + return r; +} + static int help(void) { printf("%s [OPTIONS...]\n\n" - "Connect STDIO or a socket to a given bus address.\n\n" + "DBus proxy server.\n\n" " -h --help Show this help\n" " --version Show package version\n" - " --drop-privileges Drop privileges\n" " --configuration=PATH Configuration file or directory\n" " --machine=MACHINE Connect to specified machine\n" " --address=ADDRESS Connect to the bus specified by ADDRESS\n" @@ -74,7 +201,6 @@ static int parse_argv(int argc, char *argv[]) { enum { ARG_VERSION = 0x100, ARG_ADDRESS, - ARG_DROP_PRIVILEGES, ARG_CONFIGURATION, ARG_MACHINE, }; @@ -83,7 +209,6 @@ static int parse_argv(int argc, char *argv[]) { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, ARG_VERSION }, { "address", required_argument, NULL, ARG_ADDRESS }, - { "drop-privileges", no_argument, NULL, ARG_DROP_PRIVILEGES }, { "configuration", required_argument, NULL, ARG_CONFIGURATION }, { "machine", required_argument, NULL, ARG_MACHINE }, {}, @@ -107,20 +232,10 @@ static int parse_argv(int argc, char *argv[]) { puts(SYSTEMD_FEATURES); return 0; - case ARG_ADDRESS: { - char *a; - - a = strdup(optarg); - if (!a) + case ARG_ADDRESS: + r = free_and_strdup(&arg_address, optarg); + if (r < 0) return log_oom(); - - free(arg_address); - arg_address = a; - break; - } - - case ARG_DROP_PRIVILEGES: - arg_drop_privileges = true; break; case ARG_CONFIGURATION: @@ -138,9 +253,9 @@ static int parse_argv(int argc, char *argv[]) { return log_oom(); #ifdef ENABLE_KDBUS - a = strjoin("x-container-kernel:machine=", e, ";x-container-unix:machine=", e, NULL); + a = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL); #else - a = strjoin("x-container-unix:machine=", e, NULL); + a = strjoin("x-machine-unix:machine=", e, NULL); #endif if (!a) return log_oom(); @@ -158,11 +273,7 @@ static int parse_argv(int argc, char *argv[]) { assert_not_reached("Unhandled option"); } - /* If the first command line argument is only "x" characters - * we'll write who we are talking to into it, so that "ps" is - * explanatory */ - arg_command_line_buffer = argv[optind]; - if (argc > optind + 1 || (arg_command_line_buffer && !in_charset(arg_command_line_buffer, "x"))) { + if (argc > optind) { log_error("Too many arguments"); return -EINVAL; } @@ -176,1584 +287,58 @@ static int parse_argv(int argc, char *argv[]) { return 1; } -static int rename_service(sd_bus *a, sd_bus *b) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - _cleanup_free_ char *p = NULL, *name = NULL; - const char *comm; - char **cmdline; - uid_t uid; - pid_t pid; - int r; - - assert(a); - assert(b); - - r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM, &creds); - if (r < 0) - return r; - - r = sd_bus_creds_get_uid(creds, &uid); - if (r < 0) - return r; - - r = sd_bus_creds_get_pid(creds, &pid); - if (r < 0) - return r; - - r = sd_bus_creds_get_cmdline(creds, &cmdline); - if (r < 0) - return r; - - r = sd_bus_creds_get_comm(creds, &comm); - if (r < 0) - return r; - - name = uid_to_name(uid); - if (!name) - return -ENOMEM; - - p = strv_join(cmdline, " "); - if (!p) - return -ENOMEM; - - /* The status string gets the full command line ... */ - sd_notifyf(false, - "STATUS=Processing requests from client PID "PID_FMT" (%s); UID "UID_FMT" (%s)", - pid, p, - uid, name); - - /* ... and the argv line only the short comm */ - if (arg_command_line_buffer) { - size_t m, w; - - m = strlen(arg_command_line_buffer); - w = snprintf(arg_command_line_buffer, m, - "[PID "PID_FMT"/%s; UID "UID_FMT"/%s]", - pid, comm, - uid, name); - - if (m > w) - memzero(arg_command_line_buffer + w, m - w); - } - - log_debug("Running on behalf of PID "PID_FMT" (%s), UID "UID_FMT" (%s), %s", - pid, p, - uid, name, - a->unique_name); - - return 0; -} - -static int synthesize_name_acquired(sd_bus *a, sd_bus *b, sd_bus_message *m) { - _cleanup_bus_message_unref_ sd_bus_message *n = NULL; - const char *name, *old_owner, *new_owner; - int r; - - assert(a); - assert(b); - assert(m); - - /* If we get NameOwnerChanged for our own name, we need to - * synthesize NameLost/NameAcquired, since socket clients need - * that, even though it is obsoleted on kdbus */ - - if (!a->is_kernel) - return 0; - - if (!sd_bus_message_is_signal(m, "org.freedesktop.DBus", "NameOwnerChanged") || - !streq_ptr(m->path, "/org/freedesktop/DBus") || - !streq_ptr(m->sender, "org.freedesktop.DBus")) - return 0; - - r = sd_bus_message_read(m, "sss", &name, &old_owner, &new_owner); - if (r < 0) - return r; - - r = sd_bus_message_rewind(m, true); - if (r < 0) - return r; - - if (streq(old_owner, a->unique_name)) { - - r = sd_bus_message_new_signal( - b, - &n, - "/org/freedesktop/DBus", - "org.freedesktop.DBus", - "NameLost"); - - } else if (streq(new_owner, a->unique_name)) { - - r = sd_bus_message_new_signal( - b, - &n, - "/org/freedesktop/DBus", - "org.freedesktop.DBus", - "NameAcquired"); - } else - return 0; - - if (r < 0) - return r; - - r = sd_bus_message_append(n, "s", name); - if (r < 0) - return r; - - r = bus_message_append_sender(n, "org.freedesktop.DBus"); - if (r < 0) - return r; - - r = bus_seal_synthetic_message(b, n); - if (r < 0) - return r; - - return sd_bus_send(b, n, NULL); -} - -static int synthetic_driver_send(sd_bus *b, sd_bus_message *m) { - int r; - - assert(b); - assert(m); - - r = bus_message_append_sender(m, "org.freedesktop.DBus"); - if (r < 0) - return r; - - r = bus_seal_synthetic_message(b, m); - if (r < 0) - return r; - - return sd_bus_send(b, m, NULL); -} - -static int synthetic_reply_method_error(sd_bus_message *call, const sd_bus_error *e) { - _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - int r; - - assert(call); - - if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) - return 0; - - r = sd_bus_message_new_method_error(call, &m, e); - if (r < 0) - return r; - - return synthetic_driver_send(call->bus, m); -} - -static int synthetic_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *p) { - - _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; - - assert(call); - - if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) - return 0; - - if (sd_bus_error_is_set(p)) - return synthetic_reply_method_error(call, p); - - sd_bus_error_set_errno(&berror, error); - - return synthetic_reply_method_error(call, &berror); -} - -static int synthetic_reply_method_return(sd_bus_message *call, const char *types, ...) { - _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - int r; - - assert(call); - - if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) - return 0; - - r = sd_bus_message_new_method_return(call, &m); - if (r < 0) - return r; - - if (!isempty(types)) { - va_list ap; - - va_start(ap, types); - r = bus_message_append_ap(m, types, ap); - va_end(ap); - if (r < 0) - return r; - } - - return synthetic_driver_send(call->bus, m); -} - -static int synthetic_reply_return_strv(sd_bus_message *call, char **l) { - _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - int r; - - assert(call); - - r = sd_bus_message_new_method_return(call, &m); - if (r < 0) - return synthetic_reply_method_errno(call, r, NULL); - - r = sd_bus_message_append_strv(m, l); - if (r < 0) - return synthetic_reply_method_errno(call, r, NULL); - - return synthetic_driver_send(call->bus, m); -} - -static int get_creds_by_name(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **_creds, sd_bus_error *error) { - _cleanup_bus_creds_unref_ sd_bus_creds *c = NULL; - int r; - - assert(bus); - assert(name); - assert(_creds); - - r = sd_bus_get_name_creds(bus, name, mask, &c); - if (r == -ESRCH || r == -ENXIO) - return sd_bus_error_setf(error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Name %s is currently not owned by anyone.", name); - if (r < 0) - return r; - - if ((c->mask & mask) != mask) - return -ENOTSUP; - - *_creds = c; - c = NULL; - - return 0; -} - -static int get_creds_by_message(sd_bus *bus, sd_bus_message *m, uint64_t mask, sd_bus_creds **_creds, sd_bus_error *error) { - const char *name; - int r; - - assert(bus); - assert(m); - assert(_creds); - - r = sd_bus_message_read(m, "s", &name); - if (r < 0) - return r; - - return get_creds_by_name(bus, name, mask, _creds, error); -} - -static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *policy, const struct ucred *ucred, Set *owned_names) { - int r; - - assert(a); - assert(b); - assert(m); - - if (!a->is_kernel) - return 0; - - if (!streq_ptr(sd_bus_message_get_destination(m), "org.freedesktop.DBus")) - return 0; - - /* The "Hello()" call is is handled in process_hello() */ - - if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus.Introspectable", "Introspect")) { - - if (!sd_bus_message_has_signature(m, "")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - return synthetic_reply_method_return(m, "s", - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "AddMatch")) { - const char *match; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &match); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_add_match(a, NULL, match, NULL, NULL); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, NULL); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RemoveMatch")) { - const char *match; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &match); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = bus_remove_match_by_string(a, match, NULL, NULL); - if (r == 0) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule not found")); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, NULL); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionSELinuxSecurityContext")) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = get_creds_by_message(a, m, SD_BUS_CREDS_SELINUX_CONTEXT, &creds, &error); - if (r < 0) - return synthetic_reply_method_errno(m, r, &error); - - return synthetic_reply_method_return(m, "y", creds->label, strlen(creds->label)); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixProcessID")) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = get_creds_by_message(a, m, SD_BUS_CREDS_PID, &creds, &error); - if (r < 0) - return synthetic_reply_method_errno(m, r, &error); - - return synthetic_reply_method_return(m, "u", (uint32_t) creds->pid); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixUser")) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = get_creds_by_message(a, m, SD_BUS_CREDS_UID, &creds, &error); - if (r < 0) - return synthetic_reply_method_errno(m, r, &error); - - return synthetic_reply_method_return(m, "u", (uint32_t) creds->uid); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetId")) { - sd_id128_t server_id; - char buf[SD_ID128_STRING_MAX]; - - if (!sd_bus_message_has_signature(m, "")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_get_bus_id(a, &server_id); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, "s", sd_id128_to_string(server_id, buf)); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetNameOwner")) { - const char *name; - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &name); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (streq(name, "org.freedesktop.DBus")) - return synthetic_reply_method_return(m, "s", "org.freedesktop.DBus"); - - r = get_creds_by_name(a, name, SD_BUS_CREDS_UNIQUE_NAME, &creds, &error); - if (r < 0) - return synthetic_reply_method_errno(m, r, &error); - - return synthetic_reply_method_return(m, "s", creds->unique_name); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListActivatableNames")) { - _cleanup_strv_free_ char **names = NULL; - - if (!sd_bus_message_has_signature(m, "")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_list_names(a, NULL, &names); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - /* Let's sort the names list to make it stable */ - strv_sort(names); - - return synthetic_reply_return_strv(m, names); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListNames")) { - _cleanup_strv_free_ char **names = NULL; - - if (!sd_bus_message_has_signature(m, "")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_list_names(a, &names, NULL); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = strv_extend(&names, "org.freedesktop.DBus"); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - /* Let's sort the names list to make it stable */ - strv_sort(names); - - return synthetic_reply_return_strv(m, names); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListQueuedOwners")) { - struct kdbus_cmd_name_list cmd = {}; - struct kdbus_name_list *name_list; - struct kdbus_name_info *name; - _cleanup_strv_free_ char **owners = NULL; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - char *arg0; - int err = 0; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &arg0); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_get_name_creds(a, arg0, 0, NULL); - if (r == -ESRCH || r == -ENXIO) { - sd_bus_error_setf(&error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Could not get owners of name '%s': no such name.", arg0); - return synthetic_reply_method_errno(m, r, &error); - } - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - cmd.flags = KDBUS_NAME_LIST_QUEUED; - r = ioctl(a->input_fd, KDBUS_CMD_NAME_LIST, &cmd); - if (r < 0) - return synthetic_reply_method_errno(m, -errno, NULL); - - name_list = (struct kdbus_name_list *) ((uint8_t *) a->kdbus_buffer + cmd.offset); - - KDBUS_ITEM_FOREACH(name, name_list, names) { - const char *entry_name = NULL; - struct kdbus_item *item; - char *n; +int main(int argc, char *argv[]) { + int r, accept_fd; + uid_t uid, bus_uid; + gid_t gid; - KDBUS_ITEM_FOREACH(item, name, items) - if (item->type == KDBUS_ITEM_OWNED_NAME) - entry_name = item->name.name; + log_set_target(LOG_TARGET_JOURNAL_OR_KMSG); + log_parse_environment(); + log_open(); - if (!streq_ptr(entry_name, arg0)) - continue; + bus_uid = getuid(); - if (asprintf(&n, ":1.%llu", (unsigned long long) name->owner_id) < 0) { - err = -ENOMEM; - break; - } + if (geteuid() == 0) { + const char *user = "systemd-bus-proxy"; - r = strv_consume(&owners, n); - if (r < 0) { - err = r; - break; - } + r = get_user_creds(&user, &uid, &gid, NULL, NULL); + if (r < 0) { + log_error_errno(r, "Cannot resolve user name %s: %m", user); + goto finish; } - r = bus_kernel_cmd_free(a, cmd.offset); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (err < 0) - return synthetic_reply_method_errno(m, err, NULL); - - return synthetic_reply_return_strv(m, owners); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "NameHasOwner")) { - const char *name; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &name); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (streq(name, "org.freedesktop.DBus")) - return synthetic_reply_method_return(m, "b", true); - - r = sd_bus_get_name_creds(a, name, 0, NULL); - if (r < 0 && r != -ESRCH && r != -ENXIO) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, "b", r >= 0); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ReleaseName")) { - const char *name; - - if (!sd_bus_message_has_signature(m, "s")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "s", &name); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_release_name(a, name); + r = drop_privileges(uid, gid, 1ULL << CAP_IPC_OWNER); if (r < 0) { - if (r == -ESRCH) - return synthetic_reply_method_return(m, "u", BUS_NAME_NON_EXISTENT); - if (r == -EADDRINUSE) - return synthetic_reply_method_return(m, "u", BUS_NAME_NOT_OWNER); - - return synthetic_reply_method_errno(m, r, NULL); + log_error_errno(r, "Cannot drop privileges: %m"); + goto finish; } + } - set_remove(owned_names, (char*) name); - - return synthetic_reply_method_return(m, "u", BUS_NAME_RELEASED); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ReloadConfig")) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - if (!sd_bus_message_has_signature(m, "")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_error_setf(&error, SD_BUS_ERROR_NOT_SUPPORTED, "%s() is not supported", sd_bus_message_get_member(m)); - - return synthetic_reply_method_errno(m, r, &error); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RequestName")) { - const char *name; - uint32_t flags, param; - bool in_queue; - - if (!sd_bus_message_has_signature(m, "su")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "su", &name, &flags); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (policy && !policy_check_own(policy, ucred->uid, ucred->gid, name)) - return synthetic_reply_method_errno(m, -EPERM, NULL); - - if ((flags & ~(BUS_NAME_ALLOW_REPLACEMENT|BUS_NAME_REPLACE_EXISTING|BUS_NAME_DO_NOT_QUEUE)) != 0) - return synthetic_reply_method_errno(m, -EINVAL, NULL); + r = parse_argv(argc, argv); + if (r <= 0) + goto finish; - param = 0; - if (flags & BUS_NAME_ALLOW_REPLACEMENT) - param |= SD_BUS_NAME_ALLOW_REPLACEMENT; - if (flags & BUS_NAME_REPLACE_EXISTING) - param |= SD_BUS_NAME_REPLACE_EXISTING; - if (!(flags & BUS_NAME_DO_NOT_QUEUE)) - param |= SD_BUS_NAME_QUEUE; + r = sd_listen_fds(0); + if (r != 1) { + log_error("Illegal number of file descriptors passed"); + goto finish; + } - r = set_put_strdup(owned_names, name); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); + accept_fd = SD_LISTEN_FDS_START; - r = sd_bus_request_name(a, name, param); - if (r < 0) { - if (r == -EALREADY) - return synthetic_reply_method_return(m, "u", BUS_NAME_ALREADY_OWNER); + r = fd_nonblock(accept_fd, false); + if (r < 0) { + log_error_errno(r, "Cannot mark accept-fd non-blocking: %m"); + goto finish; + } - set_remove(owned_names, (char*) name); - - if (r == -EEXIST) - return synthetic_reply_method_return(m, "u", BUS_NAME_EXISTS); - return synthetic_reply_method_errno(m, r, NULL); - } - - in_queue = (r == 0); - - if (in_queue) - return synthetic_reply_method_return(m, "u", BUS_NAME_IN_QUEUE); - - return synthetic_reply_method_return(m, "u", BUS_NAME_PRIMARY_OWNER); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "StartServiceByName")) { - _cleanup_bus_message_unref_ sd_bus_message *msg = NULL; - const char *name; - uint32_t flags; - - if (!sd_bus_message_has_signature(m, "su")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_read(m, "su", &name, &flags); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (flags != 0) - return synthetic_reply_method_errno(m, -EINVAL, NULL); - - r = sd_bus_get_name_creds(a, name, 0, NULL); - if (r >= 0 || streq(name, "org.freedesktop.DBus")) - return synthetic_reply_method_return(m, "u", BUS_START_REPLY_ALREADY_RUNNING); - if (r != -ESRCH) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_message_new_method_call( - a, - &msg, - name, - "/", - "org.freedesktop.DBus.Peer", - "Ping"); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_send(a, msg, NULL); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, "u", BUS_START_REPLY_SUCCESS); - - } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "UpdateActivationEnvironment")) { - _cleanup_bus_message_unref_ sd_bus_message *msg = NULL; - _cleanup_strv_free_ char **args = NULL; - - if (!sd_bus_message_has_signature(m, "a{ss}")) - return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); - - r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "{ss}"); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - while ((r = sd_bus_message_enter_container(m, SD_BUS_TYPE_DICT_ENTRY, "ss")) > 0) { - _cleanup_free_ char *s = NULL; - const char *key; - const char *value; - - r = sd_bus_message_read(m, "ss", &key, &value); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - s = strjoin(key, "=", value, NULL); - if (!s) - return synthetic_reply_method_errno(m, -ENOMEM, NULL); - - r = strv_extend(&args, s); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_message_exit_container(m); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - } - - r = sd_bus_message_exit_container(m); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - if (!args) - return synthetic_reply_method_errno(m, -EINVAL, NULL); - - r = sd_bus_message_new_method_call( - a, - &msg, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "SetEnvironment"); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_message_append_strv(msg, args); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - r = sd_bus_call(a, msg, 0, NULL, NULL); - if (r < 0) - return synthetic_reply_method_errno(m, r, NULL); - - return synthetic_reply_method_return(m, NULL); - - } else { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - - r = sd_bus_error_setf(&error, SD_BUS_ERROR_UNKNOWN_METHOD, "Unknown method '%s'.", m->member); - - return synthetic_reply_method_errno(m, r, &error); - } -} - -static int process_policy(sd_bus *from, sd_bus *to, sd_bus_message *m, Policy *policy, const struct ucred *our_ucred, Set *owned_names) { - int r; - - assert(from); - assert(to); - assert(m); - - if (!policy) - return 0; - - if (from->is_kernel) { - uid_t sender_uid = UID_INVALID; - gid_t sender_gid = GID_INVALID; - char **sender_names = NULL; - bool granted = false; - - /* Driver messages are always OK */ - if (streq_ptr(m->sender, "org.freedesktop.DBus")) - return 0; - - /* The message came from the kernel, and is sent to our legacy client. */ - r = sd_bus_creds_get_well_known_names(&m->creds, &sender_names); - if (r < 0) - return r; - - (void) sd_bus_creds_get_uid(&m->creds, &sender_uid); - (void) sd_bus_creds_get_gid(&m->creds, &sender_gid); - - /* First check whether the sender can send the message to our name */ - if (set_isempty(owned_names)) { - if (policy_check_send(policy, sender_uid, sender_gid, m->header->type, NULL, m->path, m->interface, m->member)) - granted = true; - } else { - Iterator i; - char *n; - - SET_FOREACH(n, owned_names, i) - if (policy_check_send(policy, sender_uid, sender_gid, m->header->type, n, m->path, m->interface, m->member)) { - granted = true; - break; - } - } - - if (granted) { - /* Then check whether us (the recipient) can recieve from the sender's name */ - if (strv_isempty(sender_names)) { - if (policy_check_recv(policy, our_ucred->uid, our_ucred->gid, m->header->type, NULL, m->path, m->interface, m->member)) - return 0; - } else { - char **n; - - STRV_FOREACH(n, sender_names) { - if (policy_check_recv(policy, our_ucred->uid, our_ucred->gid, m->header->type, *n, m->path, m->interface, m->member)) - return 0; - } - } - } - - /* Return an error back to the caller */ - if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL) - return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_ACCESS_DENIED, "Access prohibited by XML receiver policy."); - - /* Return 1, indicating that the message shall not be processed any further */ - return 1; - } - - if (to->is_kernel) { - _cleanup_bus_creds_unref_ sd_bus_creds *destination_creds = NULL; - uid_t destination_uid = UID_INVALID; - gid_t destination_gid = GID_INVALID; - const char *destination_unique = NULL; - char **destination_names = NULL; - bool granted = false; - - /* Driver messages are always OK */ - if (streq_ptr(m->destination, "org.freedesktop.DBus")) - return 0; - - /* The message came from the legacy client, and is sent to kdbus. */ - if (m->destination) { - r = bus_get_name_creds_kdbus(to, m->destination, - SD_BUS_CREDS_WELL_KNOWN_NAMES|SD_BUS_CREDS_UNIQUE_NAME| - SD_BUS_CREDS_UID|SD_BUS_CREDS_GID|SD_BUS_CREDS_PID, - true, &destination_creds); - if (r < 0) - return r; - - r = sd_bus_creds_get_well_known_names(destination_creds, &destination_names); - if (r < 0) - return r; - - r = sd_bus_creds_get_unique_name(destination_creds, &destination_unique); - if (r < 0) - return r; - - (void) sd_bus_creds_get_uid(destination_creds, &destination_uid); - (void) sd_bus_creds_get_gid(destination_creds, &destination_gid); - } - - /* First check if we (the sender) can send to this name */ - if (strv_isempty(destination_names)) { - if (policy_check_send(policy, our_ucred->uid, our_ucred->gid, m->header->type, NULL, m->path, m->interface, m->member)) - granted = true; - } else { - char **n; - - STRV_FOREACH(n, destination_names) { - if (policy_check_send(policy, our_ucred->uid, our_ucred->gid, m->header->type, *n, m->path, m->interface, m->member)) { - - /* If we made a receiver decision, - then remember which name's policy - we used, and to which unique ID it - mapped when we made the - decision. Then, let's pass this to - the kernel when sending the - message, so that it refuses the - operation should the name and - unique ID not map to each other - anymore. */ - - r = free_and_strdup(&m->destination_ptr, *n); - if (r < 0) - return r; - - r = bus_kernel_parse_unique_name(destination_unique, &m->verify_destination_id); - if (r < 0) - break; - - granted = true; - break; - } - } - } - - /* Then check if the recipient can receive from our name */ - if (granted) { - if (set_isempty(owned_names)) { - if (policy_check_recv(policy, destination_uid, destination_gid, m->header->type, NULL, m->path, m->interface, m->member)) - return 0; - } else { - Iterator i; - char *n; - - SET_FOREACH(n, owned_names, i) - if (policy_check_recv(policy, destination_uid, destination_gid, m->header->type, n, m->path, m->interface, m->member)) - return 0; - } - } - - /* Return an error back to the caller */ - if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL) - return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_ACCESS_DENIED, "Access prohibited by XML sender policy."); - - /* Return 1, indicating that the message shall not be processed any further */ - return 1; - } - - return 0; -} - -static int process_hello(sd_bus *a, sd_bus *b, sd_bus_message *m, bool *got_hello) { - _cleanup_bus_message_unref_ sd_bus_message *n = NULL; - bool is_hello; - int r; - - assert(a); - assert(b); - assert(m); - assert(got_hello); - - /* As reaction to hello we need to respond with two messages: - * the callback reply and the NameAcquired for the unique - * name, since hello is otherwise obsolete on kdbus. */ - - is_hello = - sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "Hello") && - streq_ptr(m->destination, "org.freedesktop.DBus"); - - if (!is_hello) { - - if (*got_hello) - return 0; - - log_error("First packet isn't hello (it's %s.%s), aborting.", m->interface, m->member); - return -EIO; - } - - if (*got_hello) { - log_error("Got duplicate hello, aborting."); - return -EIO; - } - - *got_hello = true; - - if (!a->is_kernel) - return 0; - - r = sd_bus_message_new_method_return(m, &n); - if (r < 0) - return log_error_errno(r, "Failed to generate HELLO reply: %m"); - - r = sd_bus_message_append(n, "s", a->unique_name); - if (r < 0) - return log_error_errno(r, "Failed to append unique name to HELLO reply: %m"); - - r = bus_message_append_sender(n, "org.freedesktop.DBus"); - if (r < 0) - return log_error_errno(r, "Failed to append sender to HELLO reply: %m"); - - r = bus_seal_synthetic_message(b, n); - if (r < 0) - return log_error_errno(r, "Failed to seal HELLO reply: %m"); - - r = sd_bus_send(b, n, NULL); - if (r < 0) - return log_error_errno(r, "Failed to send HELLO reply: %m"); - - n = sd_bus_message_unref(n); - r = sd_bus_message_new_signal( - b, - &n, - "/org/freedesktop/DBus", - "org.freedesktop.DBus", - "NameAcquired"); - if (r < 0) - return log_error_errno(r, "Failed to allocate initial NameAcquired message: %m"); - - r = sd_bus_message_append(n, "s", a->unique_name); - if (r < 0) - return log_error_errno(r, "Failed to append unique name to NameAcquired message: %m"); - - r = bus_message_append_sender(n, "org.freedesktop.DBus"); - if (r < 0) - return log_error_errno(r, "Failed to append sender to NameAcquired message: %m"); - - r = bus_seal_synthetic_message(b, n); - if (r < 0) - return log_error_errno(r, "Failed to seal NameAcquired message: %m"); - - r = sd_bus_send(b, n, NULL); - if (r < 0) - return log_error_errno(r, "Failed to send NameAcquired message: %m"); - - return 1; -} - -static int patch_sender(sd_bus *a, sd_bus_message *m) { - char **well_known = NULL; - sd_bus_creds *c; - int r; - - assert(a); - assert(m); - - if (!a->is_kernel) - return 0; - - /* We will change the sender of messages from the bus driver - * so that they originate from the bus driver. This is a - * speciality originating from dbus1, where the bus driver did - * not have a unique id, but only the well-known name. */ - - c = sd_bus_message_get_creds(m); - if (!c) - return 0; - - r = sd_bus_creds_get_well_known_names(c, &well_known); - if (r < 0) - return r; - - if (strv_contains(well_known, "org.freedesktop.DBus")) - m->sender = "org.freedesktop.DBus"; - - return 0; -} - -static int mac_smack_apply_label_and_drop_cap_mac_admin(pid_t its_pid, const char *new_label) { -#ifdef HAVE_SMACK - int r = 0, k; - - if (!mac_smack_use()) - return 0; - - if (new_label && its_pid > 0) - r = mac_smack_apply_pid(its_pid, new_label); - - k = drop_capability(CAP_MAC_ADMIN); - return r < 0 ? r : k; -#else - return 0; -#endif -} - -int main(int argc, char *argv[]) { - - _cleanup_bus_close_unref_ sd_bus *a = NULL, *b = NULL; - sd_id128_t server_id; - int r, in_fd, out_fd; - bool got_hello = false; - bool is_unix; - struct ucred ucred = {}; - _cleanup_free_ char *peersec = NULL; - Policy policy_buffer = {}, *policy = NULL; - _cleanup_set_free_free_ Set *owned_names = NULL; - - log_set_target(LOG_TARGET_JOURNAL_OR_KMSG); - log_parse_environment(); - log_open(); - - r = parse_argv(argc, argv); - if (r <= 0) - goto finish; - - r = sd_listen_fds(0); - if (r == 0) { - in_fd = STDIN_FILENO; - out_fd = STDOUT_FILENO; - } else if (r == 1) { - in_fd = SD_LISTEN_FDS_START; - out_fd = SD_LISTEN_FDS_START; - } else { - log_error("Illegal number of file descriptors passed"); - goto finish; - } - - is_unix = - sd_is_socket(in_fd, AF_UNIX, 0, 0) > 0 && - sd_is_socket(out_fd, AF_UNIX, 0, 0) > 0; - - if (is_unix) { - (void) getpeercred(in_fd, &ucred); - (void) getpeersec(in_fd, &peersec); - - r = mac_smack_apply_label_and_drop_cap_mac_admin(getpid(), peersec); - if (r < 0) - log_warning_errno(r, "Failed to set SMACK label (%s) and drop CAP_MAC_ADMIN: %m", peersec); - } - - if (arg_drop_privileges) { - const char *user = "systemd-bus-proxy"; - uid_t uid; - gid_t gid; - - r = get_user_creds(&user, &uid, &gid, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Cannot resolve user name %s: %m", user); - goto finish; - } - - r = drop_privileges(uid, gid, 1ULL << CAP_IPC_OWNER); - if (r < 0) - goto finish; - } - - owned_names = set_new(&string_hash_ops); - if (!owned_names) { - log_oom(); - goto finish; - } - - r = sd_bus_new(&a); - if (r < 0) { - log_error_errno(r, "Failed to allocate bus: %m"); - goto finish; - } - - r = sd_bus_set_description(a, "sd-proxy"); - if (r < 0) { - log_error_errno(r, "Failed to set bus name: %m"); - goto finish; - } - - r = sd_bus_set_address(a, arg_address); - if (r < 0) { - log_error_errno(r, "Failed to set address to connect to: %m"); - goto finish; - } - - r = sd_bus_negotiate_fds(a, is_unix); - if (r < 0) { - log_error_errno(r, "Failed to set FD negotiation: %m"); - goto finish; - } - - r = sd_bus_negotiate_creds(a, true, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_GID|SD_BUS_CREDS_SELINUX_CONTEXT); - if (r < 0) { - log_error_errno(r, "Failed to set credential negotiation: %m"); - goto finish; - } - - if (ucred.pid > 0) { - a->fake_pids.pid = ucred.pid; - a->fake_pids_valid = true; - - a->fake_creds.uid = ucred.uid; - a->fake_creds.euid = UID_INVALID; - a->fake_creds.suid = UID_INVALID; - a->fake_creds.fsuid = UID_INVALID; - a->fake_creds.gid = ucred.gid; - a->fake_creds.egid = GID_INVALID; - a->fake_creds.sgid = GID_INVALID; - a->fake_creds.fsgid = GID_INVALID; - a->fake_creds_valid = true; - } - - if (peersec) { - a->fake_label = peersec; - peersec = NULL; - } - - a->manual_peer_interface = true; - - r = sd_bus_start(a); - if (r < 0) { - log_error_errno(r, "Failed to start bus client: %m"); - goto finish; - } - - r = sd_bus_get_bus_id(a, &server_id); - if (r < 0) { - log_error_errno(r, "Failed to get server ID: %m"); - goto finish; - } - - if (a->is_kernel) { - if (!arg_configuration) { - const char *scope; - - r = sd_bus_get_scope(a, &scope); - if (r < 0) { - log_error_errno(r, "Couldn't determine bus scope: %m"); - goto finish; - } - - if (streq(scope, "system")) - arg_configuration = strv_new( - "/etc/dbus-1/system.conf", - "/etc/dbus-1/system.d/", - "/etc/dbus-1/system-local.conf", - NULL); - else if (streq(scope, "user")) - arg_configuration = strv_new( - "/etc/dbus-1/session.conf", - "/etc/dbus-1/session.d/", - "/etc/dbus-1/session-local.conf", - NULL); - else { - log_error("Unknown scope %s, don't know which policy to load. Refusing.", scope); - goto finish; - } - - if (!arg_configuration) { - r = log_oom(); - goto finish; - } - } - - r = policy_load(&policy_buffer, arg_configuration); - if (r < 0) { - log_error_errno(r, "Failed to load policy: %m"); - goto finish; - } - - policy = &policy_buffer; - /* policy_dump(policy); */ - - if (!policy_check_hello(policy, ucred.uid, ucred.gid)) { - r = log_error_errno(EPERM, "Policy denied connection."); - goto finish; - } - } - - r = sd_bus_new(&b); - if (r < 0) { - log_error_errno(r, "Failed to allocate bus: %m"); - goto finish; - } - - r = sd_bus_set_fd(b, in_fd, out_fd); - if (r < 0) { - log_error_errno(r, "Failed to set fds: %m"); - goto finish; - } - - r = sd_bus_set_server(b, 1, server_id); - if (r < 0) { - log_error_errno(r, "Failed to set server mode: %m"); - goto finish; - } - - r = sd_bus_negotiate_fds(b, is_unix); - if (r < 0) { - log_error_errno(r, "Failed to set FD negotiation: %m"); - goto finish; - } - - r = sd_bus_negotiate_creds(b, true, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_GID|SD_BUS_CREDS_SELINUX_CONTEXT); - if (r < 0) { - log_error_errno(r, "Failed to set credential negotiation: %m"); - goto finish; - } - - r = sd_bus_set_anonymous(b, true); - if (r < 0) { - log_error_errno(r, "Failed to set anonymous authentication: %m"); - goto finish; - } - - b->manual_peer_interface = true; - - r = sd_bus_start(b); - if (r < 0) { - log_error_errno(r, "Failed to start bus client: %m"); - goto finish; - } - - r = rename_service(a, b); - if (r < 0) - log_debug_errno(r, "Failed to rename process: %m"); - - if (a->is_kernel) { - _cleanup_free_ char *match = NULL; - const char *unique; - - r = sd_bus_get_unique_name(a, &unique); - if (r < 0) { - log_error_errno(r, "Failed to get unique name: %m"); - goto finish; - } - - match = strjoin("type='signal'," - "sender='org.freedesktop.DBus'," - "path='/org/freedesktop/DBus'," - "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'," - "arg1='", - unique, - "'", - NULL); - if (!match) { - log_oom(); - goto finish; - } - - r = sd_bus_add_match(a, NULL, match, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Failed to add match for NameLost: %m"); - goto finish; - } - - free(match); - match = strjoin("type='signal'," - "sender='org.freedesktop.DBus'," - "path='/org/freedesktop/DBus'," - "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'," - "arg2='", - unique, - "'", - NULL); - if (!match) { - log_oom(); - goto finish; - } - - r = sd_bus_add_match(a, NULL, match, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Failed to add match for NameAcquired: %m"); - goto finish; - } - } - - for (;;) { - _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - int events_a, events_b, fd; - uint64_t timeout_a, timeout_b, t; - struct timespec _ts, *ts; - struct pollfd *pollfd; - int k; - - if (got_hello) { - /* Read messages from bus, to pass them on to our client */ - - r = sd_bus_process(a, &m); - if (r < 0) { - /* treat 'connection reset by peer' as clean exit condition */ - if (r == -ECONNRESET) - r = 0; - else - log_error_errno(r, "Failed to process bus a: %m"); - - goto finish; - } - - if (m) { - bool processed = false; - - /* We officially got EOF, let's quit */ - if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) { - r = 0; - goto finish; - } - - k = synthesize_name_acquired(a, b, m); - if (k < 0) { - r = k; - log_error_errno(r, "Failed to synthesize message: %m"); - goto finish; - } - - patch_sender(a, m); - - if (policy) { - k = process_policy(a, b, m, policy, &ucred, owned_names); - if (k < 0) { - r = k; - log_error_errno(r, "Failed to process policy: %m"); - goto finish; - } else if (k > 0) { - r = 1; - processed = true; - } - } - - if (!processed) { - k = sd_bus_send(b, m, NULL); - if (k < 0) { - if (k == -ECONNRESET) - r = 0; - else { - r = k; - log_error_errno(r, "Failed to send message to client: %m"); - } - - goto finish; - } else - r = 1; - } - } - - if (r > 0) - continue; - } - - /* Read messages from our client, to pass them on to the bus */ - r = sd_bus_process(b, &m); - if (r < 0) { - /* treat 'connection reset by peer' as clean exit condition */ - if (r == -ECONNRESET) - r = 0; - else - log_error_errno(r, "Failed to process bus b: %m"); - - goto finish; - } - - if (m) { - bool processed = false; - - /* We officially got EOF, let's quit */ - if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) { - r = 0; - goto finish; - } - - k = process_hello(a, b, m, &got_hello); - if (k < 0) { - r = k; - log_error_errno(r, "Failed to process HELLO: %m"); - goto finish; - } else if (k > 0) { - processed = true; - r = 1; - } - - if (!processed) { - k = process_driver(a, b, m, policy, &ucred, owned_names); - if (k < 0) { - r = k; - log_error_errno(r, "Failed to process driver calls: %m"); - goto finish; - } else if (k > 0) { - processed = true; - r = 1; - } - - if (!processed) { - - for (;;) { - if (policy) { - k = process_policy(b, a, m, policy, &ucred, owned_names); - if (k < 0) { - r = k; - log_error_errno(r, "Failed to process policy: %m"); - goto finish; - } else if (k > 0) { - processed = true; - r = 1; - break; - } - } - - k = sd_bus_send(a, m, NULL); - if (k < 0) { - if (k == -EREMCHG) - /* The name database changed since the policy check, hence let's check again */ - continue; - else if (k == -ECONNRESET) - r = 0; - else { - r = k; - log_error_errno(r, "Failed to send message to bus: %m"); - } - - goto finish; - } else - r = 1; - - break; - } - } - } - } - - if (r > 0) - continue; - - fd = sd_bus_get_fd(a); - if (fd < 0) { - log_error_errno(r, "Failed to get fd: %m"); - goto finish; - } - - events_a = sd_bus_get_events(a); - if (events_a < 0) { - log_error_errno(r, "Failed to get events mask: %m"); - goto finish; - } - - r = sd_bus_get_timeout(a, &timeout_a); - if (r < 0) { - log_error_errno(r, "Failed to get timeout: %m"); - goto finish; - } - - events_b = sd_bus_get_events(b); - if (events_b < 0) { - log_error_errno(r, "Failed to get events mask: %m"); - goto finish; - } - - r = sd_bus_get_timeout(b, &timeout_b); - if (r < 0) { - log_error_errno(r, "Failed to get timeout: %m"); - goto finish; - } - - t = timeout_a; - if (t == (uint64_t) -1 || (timeout_b != (uint64_t) -1 && timeout_b < timeout_a)) - t = timeout_b; - - if (t == (uint64_t) -1) - ts = NULL; - else { - usec_t nw; - - nw = now(CLOCK_MONOTONIC); - if (t > nw) - t -= nw; - else - t = 0; - - ts = timespec_store(&_ts, t); - } - - pollfd = (struct pollfd[3]) { - {.fd = fd, .events = events_a, }, - {.fd = in_fd, .events = events_b & POLLIN, }, - {.fd = out_fd, .events = events_b & POLLOUT, } - }; - - r = ppoll(pollfd, 3, ts, NULL); - if (r < 0) { - log_error_errno(errno, "ppoll() failed: %m"); - goto finish; - } - } + r = loop_clients(accept_fd, bus_uid); finish: sd_notify(false, "STOPPING=1\n" "STATUS=Shutting down."); - policy_free(&policy_buffer); strv_free(arg_configuration); free(arg_address); diff --git a/src/bus-proxyd/bus-policy.c b/src/bus-proxyd/bus-xml-policy.c similarity index 75% rename from src/bus-proxyd/bus-policy.c rename to src/bus-proxyd/bus-xml-policy.c index 59cc1d788..f6ac0c009 100644 --- a/src/bus-proxyd/bus-policy.c +++ b/src/bus-proxyd/bus-xml-policy.c @@ -22,10 +22,12 @@ #include "xml.h" #include "fileio.h" #include "strv.h" +#include "set.h" #include "conf-files.h" #include "bus-internal.h" #include "bus-message.h" -#include "bus-policy.h" +#include "bus-xml-policy.h" +#include "sd-login.h" static void policy_item_free(PolicyItem *i) { assert(i); @@ -62,6 +64,7 @@ static int file_load(Policy *p, const char *path) { STATE_BUSCONFIG, STATE_POLICY, STATE_POLICY_CONTEXT, + STATE_POLICY_CONSOLE, STATE_POLICY_USER, STATE_POLICY_GROUP, STATE_POLICY_OTHER_ATTRIBUTE, @@ -80,6 +83,8 @@ static int file_load(Policy *p, const char *path) { POLICY_CATEGORY_NONE, POLICY_CATEGORY_DEFAULT, POLICY_CATEGORY_MANDATORY, + POLICY_CATEGORY_ON_CONSOLE, + POLICY_CATEGORY_NO_CONSOLE, POLICY_CATEGORY_USER, POLICY_CATEGORY_GROUP } policy_category = POLICY_CATEGORY_NONE; @@ -156,15 +161,14 @@ static int file_load(Policy *p, const char *path) { if (t == XML_ATTRIBUTE_NAME) { if (streq(name, "context")) state = STATE_POLICY_CONTEXT; + else if (streq(name, "at_console")) + state = STATE_POLICY_CONSOLE; else if (streq(name, "user")) state = STATE_POLICY_USER; else if (streq(name, "group")) state = STATE_POLICY_GROUP; else { - if (streq(name, "at_console")) - log_debug("Attribute %s of tag unsupported at %s:%u, ignoring.", name, path, line); - else - log_warning("Attribute %s of tag unknown at %s:%u, ignoring.", name, path, line); + log_warning("Attribute %s of tag unknown at %s:%u, ignoring.", name, path, line); state = STATE_POLICY_OTHER_ATTRIBUTE; } } else if (t == XML_TAG_CLOSE_EMPTY || @@ -217,6 +221,26 @@ static int file_load(Policy *p, const char *path) { break; + case STATE_POLICY_CONSOLE: + + if (t == XML_ATTRIBUTE_VALUE) { + if (streq(name, "true")) { + policy_category = POLICY_CATEGORY_ON_CONSOLE; + state = STATE_POLICY; + } else if (streq(name, "false")) { + policy_category = POLICY_CATEGORY_NO_CONSOLE; + state = STATE_POLICY; + } else { + log_error("at_console= parameter %s unknown for at %s:%u.", name, path, line); + return -EINVAL; + } + } else { + log_error("Unexpected token (4.1) at %s:%u.", path, line); + return -EINVAL; + } + + break; + case STATE_POLICY_USER: if (t == XML_ATTRIBUTE_VALUE) { @@ -279,7 +303,6 @@ static int file_load(Policy *p, const char *path) { ic = POLICY_ITEM_GROUP; else if (streq(name, "eavesdrop")) { log_debug("Unsupported attribute %s= at %s:%u, ignoring.", name, path, line); - i->class = POLICY_ITEM_IGNORE; state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE; break; } else { @@ -289,7 +312,7 @@ static int file_load(Policy *p, const char *path) { } if (i->class != _POLICY_ITEM_CLASS_UNSET && ic != i->class) { - log_error("send_ and receive_ fields mixed on same tag at %s:%u.", path, line); + log_error("send_, receive_/eavesdrop fields mixed on same tag at %s:%u.", path, line); return -EINVAL; } @@ -330,15 +353,18 @@ static int file_load(Policy *p, const char *path) { } else if (t == XML_TAG_CLOSE_EMPTY || (t == XML_TAG_CLOSE && streq(name, i->type == POLICY_ITEM_ALLOW ? "allow" : "deny"))) { - if (i->class == _POLICY_ITEM_CLASS_UNSET) { - log_error("Policy not set at %s:%u.", path, line); - return -EINVAL; - } + /* If the tag is fully empty so far, we consider it a recv */ + if (i->class == _POLICY_ITEM_CLASS_UNSET) + i->class = POLICY_ITEM_RECV; if (policy_category == POLICY_CATEGORY_DEFAULT) item_append(i, &p->default_items); else if (policy_category == POLICY_CATEGORY_MANDATORY) item_append(i, &p->mandatory_items); + else if (policy_category == POLICY_CATEGORY_ON_CONSOLE) + item_append(i, &p->on_console_items); + else if (policy_category == POLICY_CATEGORY_NO_CONSOLE) + item_append(i, &p->no_console_items); else if (policy_category == POLICY_CATEGORY_USER) { const char *u = policy_user; @@ -423,8 +449,10 @@ static int file_load(Policy *p, const char *path) { return -EINVAL; } - i->interface = name; - name = NULL; + if (!streq(name, "*")) { + i->interface = name; + name = NULL; + } state = STATE_ALLOW_DENY; } else { log_error("Unexpected token (9) at %s:%u.", path, line); @@ -442,8 +470,10 @@ static int file_load(Policy *p, const char *path) { return -EINVAL; } - i->member = name; - name = NULL; + if (!streq(name, "*")) { + i->member = name; + name = NULL; + } state = STATE_ALLOW_DENY; } else { log_error("Unexpected token (10) in %s:%u.", path, line); @@ -461,8 +491,10 @@ static int file_load(Policy *p, const char *path) { return -EINVAL; } - i->error = name; - name = NULL; + if (!streq(name, "*")) { + i->error = name; + name = NULL; + } state = STATE_ALLOW_DENY; } else { log_error("Unexpected token (11) in %s:%u.", path, line); @@ -480,8 +512,10 @@ static int file_load(Policy *p, const char *path) { return -EINVAL; } - i->path = name; - name = NULL; + if (!streq(name, "*")) { + i->path = name; + name = NULL; + } state = STATE_ALLOW_DENY; } else { log_error("Unexpected token (12) in %s:%u.", path, line); @@ -500,10 +534,12 @@ static int file_load(Policy *p, const char *path) { return -EINVAL; } - r = bus_message_type_from_string(name, &i->message_type); - if (r < 0) { - log_error("Invalid message type in %s:%u.", path, line); - return -EINVAL; + if (!streq(name, "*")) { + r = bus_message_type_from_string(name, &i->message_type); + if (r < 0) { + log_error("Invalid message type in %s:%u.", path, line); + return -EINVAL; + } } state = STATE_ALLOW_DENY; @@ -546,6 +582,17 @@ static int file_load(Policy *p, const char *path) { i->gid_valid = true; } break; + + case POLICY_ITEM_SEND: + case POLICY_ITEM_RECV: + + if (streq(name, "*")) { + free(name); + name = NULL; + } + break; + + default: break; } @@ -727,7 +774,8 @@ static int policy_check(Policy *p, const struct policy_check_filter *filter) { * 1. Check default items * 2. Check group items * 3. Check user items - * 4. Check mandatory items + * 4. Check on/no_console items + * 5. Check mandatory items * * Later rules override earlier rules. */ @@ -752,6 +800,13 @@ static int policy_check(Policy *p, const struct policy_check_filter *filter) { } } + if (filter->uid != UID_INVALID && sd_uid_get_seats(filter->uid, -1, NULL) > 0) + v = check_policy_items(p->on_console_items, filter); + else + v = check_policy_items(p->no_console_items, filter); + if (v != DUNNO) + verdict = v; + v = check_policy_items(p->mandatory_items, filter); if (v != DUNNO) verdict = v; @@ -811,14 +866,14 @@ bool policy_check_hello(Policy *p, uid_t uid, gid_t gid) { return verdict == ALLOW; } -bool policy_check_recv(Policy *p, - uid_t uid, - gid_t gid, - int message_type, - const char *name, - const char *path, - const char *interface, - const char *member) { +bool policy_check_one_recv(Policy *p, + uid_t uid, + gid_t gid, + int message_type, + const char *name, + const char *path, + const char *interface, + const char *member) { struct policy_check_filter filter = { .class = POLICY_ITEM_RECV, @@ -831,27 +886,63 @@ bool policy_check_recv(Policy *p, .member = member, }; - int verdict; - assert(p); - verdict = policy_check(p, &filter); - - log_full(LOG_AUTH | (verdict != ALLOW ? LOG_WARNING : LOG_DEBUG), - "Recieve permission check for uid=" UID_FMT " gid=" GID_FMT" message=%s name=%s interface=%s path=%s member=%s: %s", - uid, gid, bus_message_type_to_string(message_type), strna(name), strna(path), strna(interface), strna(member), strna(verdict_to_string(verdict))); - - return verdict == ALLOW; + return policy_check(p, &filter) == ALLOW; } -bool policy_check_send(Policy *p, +bool policy_check_recv(Policy *p, uid_t uid, gid_t gid, int message_type, - const char *name, + Set *names, + char **namesv, const char *path, const char *interface, - const char *member) { + const char *member, + bool dbus_to_kernel) { + + char *n, **nv, *last = NULL; + bool allow = false; + Iterator i; + + assert(p); + + if (set_isempty(names) && strv_isempty(namesv)) { + allow = policy_check_one_recv(p, uid, gid, message_type, NULL, path, interface, member); + } else { + SET_FOREACH(n, names, i) { + last = n; + allow = policy_check_one_recv(p, uid, gid, message_type, n, path, interface, member); + if (allow) + break; + } + if (!allow) { + STRV_FOREACH(nv, namesv) { + last = *nv; + allow = policy_check_one_recv(p, uid, gid, message_type, *nv, path, interface, member); + if (allow) + break; + } + } + } + + log_full(LOG_AUTH | (!allow ? LOG_WARNING : LOG_DEBUG), + "Receive permission check %s for uid=" UID_FMT " gid=" GID_FMT" message=%s name=%s path=%s interface=%s member=%s: %s", + dbus_to_kernel ? "dbus-1 to kernel" : "kernel to dbus-1", uid, gid, bus_message_type_to_string(message_type), strna(last), + strna(path), strna(interface), strna(member), allow ? "ALLOW" : "DENY"); + + return allow; +} + +bool policy_check_one_send(Policy *p, + uid_t uid, + gid_t gid, + int message_type, + const char *name, + const char *path, + const char *interface, + const char *member) { struct policy_check_filter filter = { .class = POLICY_ITEM_SEND, @@ -864,17 +955,57 @@ bool policy_check_send(Policy *p, .member = member, }; - int verdict; + assert(p); + + return policy_check(p, &filter) == ALLOW; +} + +bool policy_check_send(Policy *p, + uid_t uid, + gid_t gid, + int message_type, + Set *names, + char **namesv, + const char *path, + const char *interface, + const char *member, + bool dbus_to_kernel, + char **out_used_name) { + + char *n, **nv, *last = NULL; + bool allow = false; + Iterator i; assert(p); - verdict = policy_check(p, &filter); + if (set_isempty(names) && strv_isempty(namesv)) { + allow = policy_check_one_send(p, uid, gid, message_type, NULL, path, interface, member); + } else { + SET_FOREACH(n, names, i) { + last = n; + allow = policy_check_one_send(p, uid, gid, message_type, n, path, interface, member); + if (allow) + break; + } + if (!allow) { + STRV_FOREACH(nv, namesv) { + last = *nv; + allow = policy_check_one_send(p, uid, gid, message_type, *nv, path, interface, member); + if (allow) + break; + } + } + } - log_full(LOG_AUTH | (verdict != ALLOW ? LOG_WARNING : LOG_DEBUG), - "Send permission check for uid=" UID_FMT " gid=" GID_FMT" message=%s name=%s interface=%s path=%s member=%s: %s", - uid, gid, bus_message_type_to_string(message_type), strna(name), strna(path), strna(interface), strna(member), strna(verdict_to_string(verdict))); + if (out_used_name) + *out_used_name = last; - return verdict == ALLOW; + log_full(LOG_AUTH | (!allow ? LOG_WARNING : LOG_DEBUG), + "Send permission check %s for uid=" UID_FMT " gid=" GID_FMT" message=%s name=%s path=%s interface=%s member=%s: %s", + dbus_to_kernel ? "dbus-1 to kernel" : "kernel to dbus-1", uid, gid, bus_message_type_to_string(message_type), strna(last), + strna(path), strna(interface), strna(member), allow ? "ALLOW" : "DENY"); + + return allow; } int policy_load(Policy *p, char **files) { @@ -920,6 +1051,16 @@ void policy_free(Policy *p) { policy_item_free(i); } + while ((i = p->on_console_items)) { + LIST_REMOVE(items, p->on_console_items, i); + policy_item_free(i); + } + + while ((i = p->no_console_items)) { + LIST_REMOVE(items, p->no_console_items, i); + policy_item_free(i); + } + while ((first = hashmap_steal_first(p->user_items))) { while ((i = first)) { @@ -988,7 +1129,7 @@ static void dump_items(PolicyItem *items, const char *prefix) { user = uid_to_name(i->uid); - printf("%sUser: %s (%d)\n", + printf("%sUser: %s ("UID_FMT")\n", prefix, strna(user), i->uid); } @@ -997,7 +1138,7 @@ static void dump_items(PolicyItem *items, const char *prefix) { group = gid_to_name(i->gid); - printf("%sGroup: %s (%d)\n", + printf("%sGroup: %s ("GID_FMT")\n", prefix, strna(group), i->gid); } printf("%s-\n", prefix); @@ -1026,8 +1167,142 @@ void policy_dump(Policy *p) { printf("%s User Items:\n", draw_special_char(DRAW_ARROW)); dump_hashmap_items(p->user_items); + printf("%s On-Console Items:\n", draw_special_char(DRAW_ARROW)); + dump_items(p->on_console_items, "\t"); + + printf("%s No-Console Items:\n", draw_special_char(DRAW_ARROW)); + dump_items(p->no_console_items, "\t"); + printf("%s Mandatory Items:\n", draw_special_char(DRAW_ARROW)); dump_items(p->mandatory_items, "\t"); + + fflush(stdout); +} + +int shared_policy_new(SharedPolicy **out) { + SharedPolicy *sp; + int r; + + sp = new0(SharedPolicy, 1); + if (!sp) + return log_oom(); + + r = pthread_mutex_init(&sp->lock, NULL); + if (r < 0) { + log_error_errno(r, "Cannot initialize shared policy mutex: %m"); + goto exit_free; + } + + r = pthread_rwlock_init(&sp->rwlock, NULL); + if (r < 0) { + log_error_errno(r, "Cannot initialize shared policy rwlock: %m"); + goto exit_mutex; + } + + *out = sp; + sp = NULL; + return 0; + + /* pthread lock destruction is not fail-safe... meh! */ +exit_mutex: + pthread_mutex_destroy(&sp->lock); +exit_free: + free(sp); + return r; +} + +SharedPolicy *shared_policy_free(SharedPolicy *sp) { + if (!sp) + return NULL; + + policy_free(sp->policy); + pthread_rwlock_destroy(&sp->rwlock); + pthread_mutex_destroy(&sp->lock); + strv_free(sp->configuration); + free(sp); + + return NULL; +} + +static int shared_policy_reload_unlocked(SharedPolicy *sp, char **configuration) { + Policy old, buffer = {}; + bool free_old; + int r; + + assert(sp); + + r = policy_load(&buffer, configuration); + if (r < 0) + return log_error_errno(r, "Failed to load policy: %m"); + + log_debug("Reloading configuration"); + /* policy_dump(&buffer); */ + + pthread_rwlock_wrlock(&sp->rwlock); + memcpy(&old, &sp->buffer, sizeof(old)); + memcpy(&sp->buffer, &buffer, sizeof(buffer)); + free_old = !!sp->policy; + sp->policy = &sp->buffer; + pthread_rwlock_unlock(&sp->rwlock); + + if (free_old) + policy_free(&old); + + return 0; +} + +int shared_policy_reload(SharedPolicy *sp) { + int r; + + assert(sp); + + pthread_mutex_lock(&sp->lock); + r = shared_policy_reload_unlocked(sp, sp->configuration); + pthread_mutex_unlock(&sp->lock); + + return r; +} + +int shared_policy_preload(SharedPolicy *sp, char **configuration) { + _cleanup_strv_free_ char **conf = NULL; + int r = 0; + + assert(sp); + + conf = strv_copy(configuration); + if (!conf) + return log_oom(); + + pthread_mutex_lock(&sp->lock); + if (!sp->policy) { + r = shared_policy_reload_unlocked(sp, conf); + if (r >= 0) { + sp->configuration = conf; + conf = NULL; + } + } + pthread_mutex_unlock(&sp->lock); + + return r; +} + +Policy *shared_policy_acquire(SharedPolicy *sp) { + assert(sp); + + pthread_rwlock_rdlock(&sp->rwlock); + if (sp->policy) + return sp->policy; + pthread_rwlock_unlock(&sp->rwlock); + + return NULL; +} + +void shared_policy_release(SharedPolicy *sp, Policy *p) { + assert(sp); + assert(!p || sp->policy == p); + + if (p) + pthread_rwlock_unlock(&sp->rwlock); } static const char* const policy_item_type_table[_POLICY_ITEM_TYPE_MAX] = { diff --git a/src/bus-proxyd/bus-policy.h b/src/bus-proxyd/bus-xml-policy.h similarity index 62% rename from src/bus-proxyd/bus-policy.h rename to src/bus-proxyd/bus-xml-policy.h index 933a53ceb..f2ec1bbea 100644 --- a/src/bus-proxyd/bus-policy.h +++ b/src/bus-proxyd/bus-xml-policy.h @@ -22,9 +22,11 @@ ***/ #include +#include #include "list.h" #include "hashmap.h" +#include "set.h" typedef enum PolicyItemType { _POLICY_ITEM_TYPE_UNSET = 0, @@ -69,31 +71,64 @@ struct PolicyItem { typedef struct Policy { LIST_HEAD(PolicyItem, default_items); LIST_HEAD(PolicyItem, mandatory_items); + LIST_HEAD(PolicyItem, on_console_items); + LIST_HEAD(PolicyItem, no_console_items); Hashmap *user_items; Hashmap *group_items; } Policy; +typedef struct SharedPolicy { + char **configuration; + pthread_mutex_t lock; + pthread_rwlock_t rwlock; + Policy buffer; + Policy *policy; +} SharedPolicy; + +/* policy */ + int policy_load(Policy *p, char **files); void policy_free(Policy *p); bool policy_check_own(Policy *p, uid_t uid, gid_t gid, const char *name); bool policy_check_hello(Policy *p, uid_t uid, gid_t gid); +bool policy_check_one_recv(Policy *p, + uid_t uid, + gid_t gid, + int message_type, + const char *name, + const char *path, + const char *interface, + const char *member); bool policy_check_recv(Policy *p, uid_t uid, gid_t gid, int message_type, - const char *name, + Set *names, + char **namesv, const char *path, const char *interface, - const char *member); + const char *member, + bool dbus_to_kernel); +bool policy_check_one_send(Policy *p, + uid_t uid, + gid_t gid, + int message_type, + const char *name, + const char *path, + const char *interface, + const char *member); bool policy_check_send(Policy *p, uid_t uid, gid_t gid, int message_type, - const char *name, + Set *names, + char **namesv, const char *path, const char *interface, - const char *member); + const char *member, + bool dbus_to_kernel, + char **out_used_name); void policy_dump(Policy *p); @@ -102,3 +137,15 @@ PolicyItemType policy_item_type_from_string(const char *s) _pure_; const char* policy_item_class_to_string(PolicyItemClass t) _const_; PolicyItemClass policy_item_class_from_string(const char *s) _pure_; + +/* shared policy */ + +int shared_policy_new(SharedPolicy **out); +SharedPolicy *shared_policy_free(SharedPolicy *sp); + +int shared_policy_reload(SharedPolicy *sp); +int shared_policy_preload(SharedPolicy *sp, char **configuration); +Policy *shared_policy_acquire(SharedPolicy *sp); +void shared_policy_release(SharedPolicy *sp, Policy *p); + +DEFINE_TRIVIAL_CLEANUP_FUNC(SharedPolicy*, shared_policy_free); diff --git a/src/bus-proxyd/driver.c b/src/bus-proxyd/driver.c new file mode 100644 index 000000000..bc2c0c86f --- /dev/null +++ b/src/bus-proxyd/driver.c @@ -0,0 +1,608 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + Copyright 2013 Daniel Mack + Copyright 2014 Kay Sievers + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include + +#include "log.h" +#include "util.h" +#include "sd-bus.h" +#include "bus-internal.h" +#include "bus-message.h" +#include "bus-util.h" +#include "build.h" +#include "strv.h" +#include "def.h" +#include "capability.h" +#include "bus-control.h" +#include "set.h" +#include "driver.h" +#include "synthesize.h" + +static int get_creds_by_name(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **_creds, sd_bus_error *error) { + _cleanup_bus_creds_unref_ sd_bus_creds *c = NULL; + int r; + + assert(bus); + assert(name); + assert(_creds); + + r = sd_bus_get_name_creds(bus, name, mask, &c); + if (r == -ESRCH || r == -ENXIO) + return sd_bus_error_setf(error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Name %s is currently not owned by anyone.", name); + if (r < 0) + return r; + + if ((c->mask & mask) != mask) + return -ENOTSUP; + + *_creds = c; + c = NULL; + + return 0; +} + +static int get_creds_by_message(sd_bus *bus, sd_bus_message *m, uint64_t mask, sd_bus_creds **_creds, sd_bus_error *error) { + const char *name; + int r; + + assert(bus); + assert(m); + assert(_creds); + + r = sd_bus_message_read(m, "s", &name); + if (r < 0) + return r; + + return get_creds_by_name(bus, name, mask, _creds, error); +} + +int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPolicy *sp, const struct ucred *ucred, Set *owned_names) { + int r; + + assert(a); + assert(b); + assert(m); + + if (!a->is_kernel) + return 0; + + if (!streq_ptr(sd_bus_message_get_destination(m), "org.freedesktop.DBus")) + return 0; + + /* The "Hello()" call is is handled in process_hello() */ + + if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus.Introspectable", "Introspect")) { + + if (!sd_bus_message_has_signature(m, "")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + return synthetic_reply_method_return(m, "s", + "\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n"); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "AddMatch")) { + const char *match; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &match); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_add_match(a, NULL, match, NULL, NULL); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, NULL); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RemoveMatch")) { + const char *match; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &match); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = bus_remove_match_by_string(a, match, NULL, NULL); + if (r == 0) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule not found")); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, NULL); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionSELinuxSecurityContext")) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = get_creds_by_message(a, m, SD_BUS_CREDS_SELINUX_CONTEXT, &creds, &error); + if (r < 0) + return synthetic_reply_method_errno(m, r, &error); + + return synthetic_reply_method_return(m, "y", creds->label, strlen(creds->label)); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixProcessID")) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = get_creds_by_message(a, m, SD_BUS_CREDS_PID, &creds, &error); + if (r < 0) + return synthetic_reply_method_errno(m, r, &error); + + return synthetic_reply_method_return(m, "u", (uint32_t) creds->pid); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixUser")) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = get_creds_by_message(a, m, SD_BUS_CREDS_EUID, &creds, &error); + if (r < 0) + return synthetic_reply_method_errno(m, r, &error); + + return synthetic_reply_method_return(m, "u", (uint32_t) creds->euid); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetId")) { + sd_id128_t server_id; + char buf[SD_ID128_STRING_MAX]; + + if (!sd_bus_message_has_signature(m, "")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_get_bus_id(a, &server_id); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, "s", sd_id128_to_string(server_id, buf)); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetNameOwner")) { + const char *name; + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &name); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (streq(name, "org.freedesktop.DBus")) + return synthetic_reply_method_return(m, "s", "org.freedesktop.DBus"); + + r = get_creds_by_name(a, name, SD_BUS_CREDS_UNIQUE_NAME, &creds, &error); + if (r < 0) + return synthetic_reply_method_errno(m, r, &error); + + return synthetic_reply_method_return(m, "s", creds->unique_name); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListActivatableNames")) { + _cleanup_strv_free_ char **names = NULL; + + if (!sd_bus_message_has_signature(m, "")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_list_names(a, NULL, &names); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + /* Let's sort the names list to make it stable */ + strv_sort(names); + + return synthetic_reply_method_return_strv(m, names); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListNames")) { + _cleanup_strv_free_ char **names = NULL; + + if (!sd_bus_message_has_signature(m, "")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_list_names(a, &names, NULL); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = strv_extend(&names, "org.freedesktop.DBus"); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + /* Let's sort the names list to make it stable */ + strv_sort(names); + + return synthetic_reply_method_return_strv(m, names); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListQueuedOwners")) { + struct kdbus_cmd_list cmd = { + .flags = KDBUS_LIST_QUEUED, + .size = sizeof(cmd), + }; + struct kdbus_info *name_list, *name; + _cleanup_strv_free_ char **owners = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + char *arg0; + int err = 0; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &arg0); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_get_name_creds(a, arg0, 0, NULL); + if (r == -ESRCH || r == -ENXIO) { + sd_bus_error_setf(&error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Could not get owners of name '%s': no such name.", arg0); + return synthetic_reply_method_errno(m, r, &error); + } + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = ioctl(a->input_fd, KDBUS_CMD_LIST, &cmd); + if (r < 0) + return synthetic_reply_method_errno(m, -errno, NULL); + + name_list = (struct kdbus_info *) ((uint8_t *) a->kdbus_buffer + cmd.offset); + + KDBUS_FOREACH(name, name_list, cmd.list_size) { + const char *entry_name = NULL; + struct kdbus_item *item; + char *n; + + KDBUS_ITEM_FOREACH(item, name, items) + if (item->type == KDBUS_ITEM_OWNED_NAME) + entry_name = item->name.name; + + if (!streq_ptr(entry_name, arg0)) + continue; + + if (asprintf(&n, ":1.%llu", (unsigned long long) name->id) < 0) { + err = -ENOMEM; + break; + } + + r = strv_consume(&owners, n); + if (r < 0) { + err = r; + break; + } + } + + r = bus_kernel_cmd_free(a, cmd.offset); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (err < 0) + return synthetic_reply_method_errno(m, err, NULL); + + return synthetic_reply_method_return_strv(m, owners); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "NameHasOwner")) { + const char *name; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &name); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (streq(name, "org.freedesktop.DBus")) + return synthetic_reply_method_return(m, "b", true); + + r = sd_bus_get_name_creds(a, name, 0, NULL); + if (r < 0 && r != -ESRCH && r != -ENXIO) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, "b", r >= 0); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ReleaseName")) { + const char *name; + + if (!sd_bus_message_has_signature(m, "s")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "s", &name); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_release_name(a, name); + if (r < 0) { + if (r == -ESRCH) + return synthetic_reply_method_return(m, "u", BUS_NAME_NON_EXISTENT); + if (r == -EADDRINUSE) + return synthetic_reply_method_return(m, "u", BUS_NAME_NOT_OWNER); + + return synthetic_reply_method_errno(m, r, NULL); + } + + set_remove(owned_names, (char*) name); + + return synthetic_reply_method_return(m, "u", BUS_NAME_RELEASED); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ReloadConfig")) { + if (!sd_bus_message_has_signature(m, "")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = shared_policy_reload(sp); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, NULL); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RequestName")) { + const char *name; + uint32_t flags, param; + bool in_queue; + + if (!sd_bus_message_has_signature(m, "su")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "su", &name, &flags); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (sp) { + Policy *policy; + bool denied; + + policy = shared_policy_acquire(sp); + denied = !policy_check_own(policy, ucred->uid, ucred->gid, name); + shared_policy_release(sp, policy); + if (denied) + return synthetic_reply_method_errno(m, -EPERM, NULL); + } + + if ((flags & ~(BUS_NAME_ALLOW_REPLACEMENT|BUS_NAME_REPLACE_EXISTING|BUS_NAME_DO_NOT_QUEUE)) != 0) + return synthetic_reply_method_errno(m, -EINVAL, NULL); + + param = 0; + if (flags & BUS_NAME_ALLOW_REPLACEMENT) + param |= SD_BUS_NAME_ALLOW_REPLACEMENT; + if (flags & BUS_NAME_REPLACE_EXISTING) + param |= SD_BUS_NAME_REPLACE_EXISTING; + if (!(flags & BUS_NAME_DO_NOT_QUEUE)) + param |= SD_BUS_NAME_QUEUE; + + r = set_put_strdup(owned_names, name); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_request_name(a, name, param); + if (r < 0) { + if (r == -EALREADY) + return synthetic_reply_method_return(m, "u", BUS_NAME_ALREADY_OWNER); + + set_remove(owned_names, (char*) name); + + if (r == -EEXIST) + return synthetic_reply_method_return(m, "u", BUS_NAME_EXISTS); + return synthetic_reply_method_errno(m, r, NULL); + } + + in_queue = (r == 0); + + if (in_queue) + return synthetic_reply_method_return(m, "u", BUS_NAME_IN_QUEUE); + + return synthetic_reply_method_return(m, "u", BUS_NAME_PRIMARY_OWNER); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "StartServiceByName")) { + _cleanup_bus_message_unref_ sd_bus_message *msg = NULL; + const char *name; + uint32_t flags; + + if (!sd_bus_message_has_signature(m, "su")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_read(m, "su", &name, &flags); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (flags != 0) + return synthetic_reply_method_errno(m, -EINVAL, NULL); + + r = sd_bus_get_name_creds(a, name, 0, NULL); + if (r >= 0 || streq(name, "org.freedesktop.DBus")) + return synthetic_reply_method_return(m, "u", BUS_START_REPLY_ALREADY_RUNNING); + if (r != -ESRCH) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_message_new_method_call( + a, + &msg, + name, + "/", + "org.freedesktop.DBus.Peer", + "Ping"); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_send(a, msg, NULL); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, "u", BUS_START_REPLY_SUCCESS); + + } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "UpdateActivationEnvironment")) { + _cleanup_bus_message_unref_ sd_bus_message *msg = NULL; + _cleanup_strv_free_ char **args = NULL; + + if (!sd_bus_message_has_signature(m, "a{ss}")) + return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters")); + + r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "{ss}"); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + while ((r = sd_bus_message_enter_container(m, SD_BUS_TYPE_DICT_ENTRY, "ss")) > 0) { + _cleanup_free_ char *s = NULL; + const char *key; + const char *value; + + r = sd_bus_message_read(m, "ss", &key, &value); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + s = strjoin(key, "=", value, NULL); + if (!s) + return synthetic_reply_method_errno(m, -ENOMEM, NULL); + + r = strv_extend(&args, s); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_message_exit_container(m); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + } + + r = sd_bus_message_exit_container(m); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + if (!args) + return synthetic_reply_method_errno(m, -EINVAL, NULL); + + r = sd_bus_message_new_method_call( + a, + &msg, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "SetEnvironment"); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_message_append_strv(msg, args); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + r = sd_bus_call(a, msg, 0, NULL, NULL); + if (r < 0) + return synthetic_reply_method_errno(m, r, NULL); + + return synthetic_reply_method_return(m, NULL); + + } else { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + + r = sd_bus_error_setf(&error, SD_BUS_ERROR_UNKNOWN_METHOD, "Unknown method '%s'.", m->member); + + return synthetic_reply_method_errno(m, r, &error); + } +} diff --git a/src/core/bus-common.c b/src/bus-proxyd/driver.h similarity index 63% rename from src/core/bus-common.c rename to src/bus-proxyd/driver.h index 4a61cb9a3..b8cedf5ce 100644 --- a/src/core/bus-common.c +++ b/src/bus-proxyd/driver.h @@ -1,9 +1,11 @@ /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ +#pragma once + /*** This file is part of systemd. - Copyright 2014 Daniel Mack + Copyright 2014 Lennart Poettering systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -19,17 +21,7 @@ along with systemd; If not, see . ***/ -#include "special.h" -#include "bus-kernel.h" -#include "bus-internal.h" -#include "bus-util.h" -#include "service.h" -#include "bus-common.h" - -static const char* const bus_policy_access_table[_BUS_POLICY_ACCESS_MAX] = { - [BUS_POLICY_ACCESS_SEE] = "see", - [BUS_POLICY_ACCESS_TALK] = "talk", - [BUS_POLICY_ACCESS_OWN] = "own", -}; +#include "sd-bus.h" +#include "bus-xml-policy.h" -DEFINE_STRING_TABLE_LOOKUP(bus_policy_access, BusPolicyAccess); +int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPolicy *sp, const struct ucred *ucred, Set *owned_names); diff --git a/src/bus-proxyd/proxy.c b/src/bus-proxyd/proxy.c new file mode 100644 index 000000000..3dea908f5 --- /dev/null +++ b/src/bus-proxyd/proxy.c @@ -0,0 +1,856 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + Copyright 2013 Daniel Mack + Copyright 2014 Kay Sievers + Copyright 2014 David Herrmann + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "log.h" +#include "util.h" +#include "socket-util.h" +#include "sd-daemon.h" +#include "sd-bus.h" +#include "bus-internal.h" +#include "bus-message.h" +#include "bus-util.h" +#include "build.h" +#include "strv.h" +#include "def.h" +#include "capability.h" +#include "bus-control.h" +#include "smack-util.h" +#include "set.h" +#include "bus-xml-policy.h" +#include "driver.h" +#include "proxy.h" +#include "synthesize.h" + +static int proxy_create_destination(Proxy *p, const char *destination, const char *local_sec, bool negotiate_fds) { + _cleanup_bus_close_unref_ sd_bus *b = NULL; + int r; + + r = sd_bus_new(&b); + if (r < 0) + return log_error_errno(r, "Failed to allocate bus: %m"); + + r = sd_bus_set_description(b, "sd-proxy"); + if (r < 0) + return log_error_errno(r, "Failed to set bus name: %m"); + + r = sd_bus_set_address(b, destination); + if (r < 0) + return log_error_errno(r, "Failed to set address to connect to: %m"); + + r = sd_bus_negotiate_fds(b, negotiate_fds); + if (r < 0) + return log_error_errno(r, "Failed to set FD negotiation: %m"); + + r = sd_bus_negotiate_creds(b, true, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SELINUX_CONTEXT); + if (r < 0) + return log_error_errno(r, "Failed to set credential negotiation: %m"); + + if (p->local_creds.pid > 0) { + b->fake_pids.pid = p->local_creds.pid; + b->fake_pids_valid = true; + + b->fake_creds.uid = UID_INVALID; + b->fake_creds.euid = p->local_creds.uid; + b->fake_creds.suid = UID_INVALID; + b->fake_creds.fsuid = UID_INVALID; + b->fake_creds.gid = GID_INVALID; + b->fake_creds.egid = p->local_creds.gid; + b->fake_creds.sgid = GID_INVALID; + b->fake_creds.fsgid = GID_INVALID; + b->fake_creds_valid = true; + } + + if (local_sec) { + b->fake_label = strdup(local_sec); + if (!b->fake_label) + return log_oom(); + } + + b->manual_peer_interface = true; + + r = sd_bus_start(b); + if (r < 0) + return log_error_errno(r, "Failed to start bus client: %m"); + + p->destination_bus = b; + b = NULL; + return 0; +} + +static int proxy_create_local(Proxy *p, int in_fd, int out_fd, bool negotiate_fds) { + _cleanup_bus_close_unref_ sd_bus *b = NULL; + sd_id128_t server_id; + int r; + + r = sd_bus_new(&b); + if (r < 0) + return log_error_errno(r, "Failed to allocate bus: %m"); + + r = sd_bus_set_fd(b, in_fd, out_fd); + if (r < 0) + return log_error_errno(r, "Failed to set fds: %m"); + + r = sd_bus_get_bus_id(p->destination_bus, &server_id); + if (r < 0) + return log_error_errno(r, "Failed to get server ID: %m"); + + r = sd_bus_set_server(b, 1, server_id); + if (r < 0) + return log_error_errno(r, "Failed to set server mode: %m"); + + r = sd_bus_negotiate_fds(b, negotiate_fds); + if (r < 0) + return log_error_errno(r, "Failed to set FD negotiation: %m"); + + r = sd_bus_negotiate_creds(b, true, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SELINUX_CONTEXT); + if (r < 0) + return log_error_errno(r, "Failed to set credential negotiation: %m"); + + r = sd_bus_set_anonymous(b, true); + if (r < 0) + return log_error_errno(r, "Failed to set anonymous authentication: %m"); + + b->manual_peer_interface = true; + + r = sd_bus_start(b); + if (r < 0) + return log_error_errno(r, "Failed to start bus client: %m"); + + p->local_bus = b; + b = NULL; + return 0; +} + +static int proxy_prepare_matches(Proxy *p) { + _cleanup_free_ char *match = NULL; + const char *unique; + int r; + + if (!p->destination_bus->is_kernel) + return 0; + + r = sd_bus_get_unique_name(p->destination_bus, &unique); + if (r < 0) + return log_error_errno(r, "Failed to get unique name: %m"); + + match = strjoin("type='signal'," + "sender='org.freedesktop.DBus'," + "path='/org/freedesktop/DBus'," + "interface='org.freedesktop.DBus'," + "member='NameOwnerChanged'," + "arg1='", + unique, + "'", + NULL); + if (!match) + return log_oom(); + + r = sd_bus_add_match(p->destination_bus, NULL, match, NULL, NULL); + if (r < 0) + return log_error_errno(r, "Failed to add match for NameLost: %m"); + + free(match); + match = strjoin("type='signal'," + "sender='org.freedesktop.DBus'," + "path='/org/freedesktop/DBus'," + "interface='org.freedesktop.DBus'," + "member='NameOwnerChanged'," + "arg2='", + unique, + "'", + NULL); + if (!match) + return log_oom(); + + r = sd_bus_add_match(p->destination_bus, NULL, match, NULL, NULL); + if (r < 0) + return log_error_errno(r, "Failed to add match for NameAcquired: %m"); + + return 0; +} + +int proxy_new(Proxy **out, int in_fd, int out_fd, const char *destination) { + _cleanup_(proxy_freep) Proxy *p = NULL; + _cleanup_free_ char *local_sec = NULL; + bool is_unix; + int r; + + p = new0(Proxy, 1); + if (!p) + return log_oom(); + + p->local_in = in_fd; + p->local_out = out_fd; + + p->owned_names = set_new(&string_hash_ops); + if (!p->owned_names) + return log_oom(); + + is_unix = sd_is_socket(in_fd, AF_UNIX, 0, 0) > 0 && + sd_is_socket(out_fd, AF_UNIX, 0, 0) > 0; + + if (is_unix) { + (void) getpeercred(in_fd, &p->local_creds); + (void) getpeersec(in_fd, &local_sec); + } + + r = proxy_create_destination(p, destination, local_sec, is_unix); + if (r < 0) + return r; + + r = proxy_create_local(p, in_fd, out_fd, is_unix); + if (r < 0) + return r; + + r = proxy_prepare_matches(p); + if (r < 0) + return r; + + *out = p; + p = NULL; + return 0; +} + +Proxy *proxy_free(Proxy *p) { + if (!p) + return NULL; + + sd_bus_close_unrefp(&p->local_bus); + sd_bus_close_unrefp(&p->destination_bus); + set_free_free(p->owned_names); + free(p); + + return NULL; +} + +int proxy_set_policy(Proxy *p, SharedPolicy *sp, char **configuration) { + _cleanup_strv_free_ char **strv = NULL; + Policy *policy; + int r; + + assert(p); + assert(sp); + + /* no need to load legacy policy if destination is not kdbus */ + if (!p->destination_bus->is_kernel) + return 0; + + p->policy = sp; + + policy = shared_policy_acquire(sp); + if (policy) { + /* policy already pre-loaded */ + shared_policy_release(sp, policy); + return 0; + } + + if (!configuration) { + const char *scope; + + r = sd_bus_get_scope(p->destination_bus, &scope); + if (r < 0) + return log_error_errno(r, "Couldn't determine bus scope: %m"); + + if (streq(scope, "system")) + strv = strv_new("/etc/dbus-1/system.conf", + "/etc/dbus-1/system.d/", + "/etc/dbus-1/system-local.conf", + NULL); + else if (streq(scope, "user")) + strv = strv_new("/etc/dbus-1/session.conf", + "/etc/dbus-1/session.d/", + "/etc/dbus-1/session-local.conf", + NULL); + else + return log_error("Unknown scope %s, don't know which policy to load. Refusing.", scope); + + if (!strv) + return log_oom(); + + configuration = strv; + } + + return shared_policy_preload(sp, configuration); +} + +int proxy_hello_policy(Proxy *p, uid_t original_uid) { + Policy *policy; + int r = 0; + + assert(p); + + if (!p->policy) + return 0; + + policy = shared_policy_acquire(p->policy); + + if (p->local_creds.uid == original_uid) + log_debug("Permitting access, since bus owner matches bus client."); + else if (policy_check_hello(policy, p->local_creds.uid, p->local_creds.gid)) + log_debug("Permitting access due to XML policy."); + else + r = log_error_errno(EPERM, "Policy denied connection."); + + shared_policy_release(p->policy, policy); + + return r; +} + +static int proxy_wait(Proxy *p) { + uint64_t timeout_destination, timeout_local, t; + int events_destination, events_local, fd; + struct timespec _ts, *ts; + struct pollfd *pollfd; + int r; + + assert(p); + + fd = sd_bus_get_fd(p->destination_bus); + if (fd < 0) + return log_error_errno(fd, "Failed to get fd: %m"); + + events_destination = sd_bus_get_events(p->destination_bus); + if (events_destination < 0) + return log_error_errno(events_destination, "Failed to get events mask: %m"); + + r = sd_bus_get_timeout(p->destination_bus, &timeout_destination); + if (r < 0) + return log_error_errno(r, "Failed to get timeout: %m"); + + events_local = sd_bus_get_events(p->local_bus); + if (events_local < 0) + return log_error_errno(events_local, "Failed to get events mask: %m"); + + r = sd_bus_get_timeout(p->local_bus, &timeout_local); + if (r < 0) + return log_error_errno(r, "Failed to get timeout: %m"); + + t = timeout_destination; + if (t == (uint64_t) -1 || (timeout_local != (uint64_t) -1 && timeout_local < timeout_destination)) + t = timeout_local; + + if (t == (uint64_t) -1) + ts = NULL; + else { + usec_t nw; + + nw = now(CLOCK_MONOTONIC); + if (t > nw) + t -= nw; + else + t = 0; + + ts = timespec_store(&_ts, t); + } + + pollfd = (struct pollfd[3]) { + { .fd = fd, .events = events_destination, }, + { .fd = p->local_in, .events = events_local & POLLIN, }, + { .fd = p->local_out, .events = events_local & POLLOUT, }, + }; + + r = ppoll(pollfd, 3, ts, NULL); + if (r < 0) + return log_error_errno(errno, "ppoll() failed: %m"); + + return 0; +} + +static int handle_policy_error(sd_bus_message *m, int r) { + if (r == -ESRCH || r == -ENXIO) + return synthetic_reply_method_errorf(m, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Name %s is currently not owned by anyone.", m->destination); + + return r; +} + +static int process_policy_unlocked(sd_bus *from, sd_bus *to, sd_bus_message *m, Policy *policy, const struct ucred *our_ucred, Set *owned_names) { + int r; + + assert(from); + assert(to); + assert(m); + + if (!policy) + return 0; + + /* + * dbus-1 distinguishes expected and non-expected replies by tracking + * method-calls and timeouts. By default, DENY rules are *NEVER* applied + * on expected replies, unless explicitly specified. But we dont track + * method-calls, thus, we cannot know whether a reply is expected. + * Fortunately, the kdbus forbids non-expected replies, so we can safely + * ignore any policy on those and let the kernel deal with it. + * + * TODO: To be correct, we should only ignore policy-tags that are + * applied on non-expected replies. However, so far we don't parse those + * tags so we let everything pass. I haven't seen a DENY policy tag on + * expected-replies, ever, so don't bother.. + */ + if (m->reply_cookie > 0) + return 0; + + if (from->is_kernel) { + uid_t sender_uid = UID_INVALID; + gid_t sender_gid = GID_INVALID; + char **sender_names = NULL; + + /* Driver messages are always OK */ + if (streq_ptr(m->sender, "org.freedesktop.DBus")) + return 0; + + /* The message came from the kernel, and is sent to our legacy client. */ + (void) sd_bus_creds_get_well_known_names(&m->creds, &sender_names); + + (void) sd_bus_creds_get_euid(&m->creds, &sender_uid); + (void) sd_bus_creds_get_egid(&m->creds, &sender_gid); + + if (sender_uid == UID_INVALID || sender_gid == GID_INVALID) { + _cleanup_bus_creds_unref_ sd_bus_creds *sender_creds = NULL; + + /* If the message came from another legacy + * client, then the message creds will be + * missing, simply because on legacy clients + * per-message creds were unknown. In this + * case, query the creds of the peer + * instead. */ + + r = bus_get_name_creds_kdbus(from, m->sender, SD_BUS_CREDS_EUID|SD_BUS_CREDS_EGID, true, &sender_creds); + if (r < 0) + return handle_policy_error(m, r); + + (void) sd_bus_creds_get_euid(sender_creds, &sender_uid); + (void) sd_bus_creds_get_egid(sender_creds, &sender_gid); + } + + /* First check whether the sender can send the message to our name */ + if (policy_check_send(policy, sender_uid, sender_gid, m->header->type, owned_names, NULL, m->path, m->interface, m->member, false, NULL) && + policy_check_recv(policy, our_ucred->uid, our_ucred->gid, m->header->type, NULL, sender_names, m->path, m->interface, m->member, false)) + return 0; + + /* Return an error back to the caller */ + if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL) + return synthetic_reply_method_errorf(m, SD_BUS_ERROR_ACCESS_DENIED, "Access prohibited by XML receiver policy."); + + /* Return 1, indicating that the message shall not be processed any further */ + return 1; + } + + if (to->is_kernel) { + _cleanup_bus_creds_unref_ sd_bus_creds *destination_creds = NULL; + uid_t destination_uid = UID_INVALID; + gid_t destination_gid = GID_INVALID; + const char *destination_unique = NULL; + char **destination_names = NULL; + char *n; + + /* Driver messages are always OK */ + if (streq_ptr(m->destination, "org.freedesktop.DBus")) + return 0; + + /* The message came from the legacy client, and is sent to kdbus. */ + if (m->destination) { + r = bus_get_name_creds_kdbus(to, m->destination, + SD_BUS_CREDS_WELL_KNOWN_NAMES|SD_BUS_CREDS_UNIQUE_NAME| + SD_BUS_CREDS_EUID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_PID, + true, &destination_creds); + if (r < 0) + return handle_policy_error(m, r); + + r = sd_bus_creds_get_unique_name(destination_creds, &destination_unique); + if (r < 0) + return handle_policy_error(m, r); + + (void) sd_bus_creds_get_well_known_names(destination_creds, &destination_names); + + (void) sd_bus_creds_get_euid(destination_creds, &destination_uid); + (void) sd_bus_creds_get_egid(destination_creds, &destination_gid); + } + + /* First check if we (the sender) can send to this name */ + if (policy_check_send(policy, our_ucred->uid, our_ucred->gid, m->header->type, NULL, destination_names, m->path, m->interface, m->member, true, &n)) { + if (n) { + /* If we made a receiver decision, then remember which + * name's policy we used, and to which unique ID it + * mapped when we made the decision. Then, let's pass + * this to the kernel when sending the message, so that + * it refuses the operation should the name and unique + * ID not map to each other anymore. */ + + r = free_and_strdup(&m->destination_ptr, n); + if (r < 0) + return r; + + r = bus_kernel_parse_unique_name(destination_unique, &m->verify_destination_id); + if (r < 0) + return r; + } + + if (sd_bus_message_is_signal(m, NULL, NULL)) { + /* If we forward a signal from dbus-1 to kdbus, + * we have no idea who the recipient is. + * Therefore, we cannot apply any dbus-1 + * receiver policies that match on receiver + * credentials. We know sd-bus always sets + * KDBUS_MSG_SIGNAL, so the kernel applies + * receiver policies to the message. Therefore, + * skip policy checks in this case. */ + return 0; + } else if (policy_check_recv(policy, destination_uid, destination_gid, m->header->type, owned_names, NULL, m->path, m->interface, m->member, true)) { + return 0; + } + } + + /* Return an error back to the caller */ + if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL) + return synthetic_reply_method_errorf(m, SD_BUS_ERROR_ACCESS_DENIED, "Access prohibited by XML sender policy."); + + /* Return 1, indicating that the message shall not be processed any further */ + return 1; + } + + return 0; +} + +static int process_policy(sd_bus *from, sd_bus *to, sd_bus_message *m, SharedPolicy *sp, const struct ucred *our_ucred, Set *owned_names) { + Policy *policy; + int r; + + assert(sp); + + policy = shared_policy_acquire(sp); + r = process_policy_unlocked(from, to, m, policy, our_ucred, owned_names); + shared_policy_release(sp, policy); + + return r; +} + +static int process_hello(Proxy *p, sd_bus_message *m) { + _cleanup_bus_message_unref_ sd_bus_message *n = NULL; + bool is_hello; + int r; + + assert(p); + assert(m); + + /* As reaction to hello we need to respond with two messages: + * the callback reply and the NameAcquired for the unique + * name, since hello is otherwise obsolete on kdbus. */ + + is_hello = + sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "Hello") && + streq_ptr(m->destination, "org.freedesktop.DBus"); + + if (!is_hello) { + if (p->got_hello) + return 0; + + return log_error_errno(EIO, "First packet isn't hello (it's %s.%s), aborting.", m->interface, m->member); + } + + if (p->got_hello) + return log_error_errno(EIO, "Got duplicate hello, aborting."); + + p->got_hello = true; + + if (!p->destination_bus->is_kernel) + return 0; + + r = sd_bus_message_new_method_return(m, &n); + if (r < 0) + return log_error_errno(r, "Failed to generate HELLO reply: %m"); + + r = sd_bus_message_append(n, "s", p->destination_bus->unique_name); + if (r < 0) + return log_error_errno(r, "Failed to append unique name to HELLO reply: %m"); + + r = bus_message_append_sender(n, "org.freedesktop.DBus"); + if (r < 0) + return log_error_errno(r, "Failed to append sender to HELLO reply: %m"); + + r = bus_seal_synthetic_message(p->local_bus, n); + if (r < 0) + return log_error_errno(r, "Failed to seal HELLO reply: %m"); + + r = sd_bus_send(p->local_bus, n, NULL); + if (r < 0) + return log_error_errno(r, "Failed to send HELLO reply: %m"); + + n = sd_bus_message_unref(n); + r = sd_bus_message_new_signal( + p->local_bus, + &n, + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "NameAcquired"); + if (r < 0) + return log_error_errno(r, "Failed to allocate initial NameAcquired message: %m"); + + r = sd_bus_message_append(n, "s", p->destination_bus->unique_name); + if (r < 0) + return log_error_errno(r, "Failed to append unique name to NameAcquired message: %m"); + + r = bus_message_append_sender(n, "org.freedesktop.DBus"); + if (r < 0) + return log_error_errno(r, "Failed to append sender to NameAcquired message: %m"); + + r = bus_seal_synthetic_message(p->local_bus, n); + if (r < 0) + return log_error_errno(r, "Failed to seal NameAcquired message: %m"); + + r = sd_bus_send(p->local_bus, n, NULL); + if (r < 0) + return log_error_errno(r, "Failed to send NameAcquired message: %m"); + + return 1; +} + +static int patch_sender(sd_bus *a, sd_bus_message *m) { + char **well_known = NULL; + sd_bus_creds *c; + int r; + + assert(a); + assert(m); + + if (!a->is_kernel) + return 0; + + /* We will change the sender of messages from the bus driver + * so that they originate from the bus driver. This is a + * speciality originating from dbus1, where the bus driver did + * not have a unique id, but only the well-known name. */ + + c = sd_bus_message_get_creds(m); + if (!c) + return 0; + + r = sd_bus_creds_get_well_known_names(c, &well_known); + if (r < 0) + return r; + + if (strv_contains(well_known, "org.freedesktop.DBus")) + m->sender = "org.freedesktop.DBus"; + + return 0; +} + +static int proxy_process_destination_to_local(Proxy *p) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + assert(p); + + r = sd_bus_process(p->destination_bus, &m); + if (r == -ECONNRESET || r == -ENOTCONN) /* Treat 'connection reset by peer' as clean exit condition */ + return r; + if (r < 0) { + log_error_errno(r, "Failed to process destination bus: %m"); + return r; + } + if (r == 0) + return 0; + if (!m) + return 1; + + /* We officially got EOF, let's quit */ + if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) + return -ECONNRESET; + + r = synthesize_name_acquired(p->destination_bus, p->local_bus, m); + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + if (r < 0) + return log_error_errno(r, "Failed to synthesize message: %m"); + + patch_sender(p->destination_bus, m); + + if (p->policy) { + r = process_policy(p->destination_bus, p->local_bus, m, p->policy, &p->local_creds, p->owned_names); + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + if (r < 0) + return log_error_errno(r, "Failed to process policy: %m"); + if (r > 0) + return 1; + } + + r = sd_bus_send(p->local_bus, m, NULL); + if (r < 0) { + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + + /* If the peer tries to send a reply and it is + * rejected with EPERM by the kernel, we ignore the + * error. This catches cases where the original + * method-call didn't had EXPECT_REPLY set, but the + * proxy-peer still sends a reply. This is allowed in + * dbus1, but not in kdbus. We don't want to track + * reply-windows in the proxy, so we simply ignore + * EPERM for all replies. The only downside is, that + * callers are no longer notified if their replies are + * dropped. However, this is equivalent to the + * caller's timeout to expire, so this should be + * acceptable. Nobody sane sends replies without a + * matching method-call, so nobody should care. */ + if (r == -EPERM && m->reply_cookie > 0) + return 1; + + /* Return the error to the client, if we can */ + synthetic_reply_method_errnof(m, r, "Failed to forward message we got from destination: %m"); + log_error_errno(r, + "Failed to forward message we got from destination: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m", + p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type), + strna(m->destination), strna(m->path), strna(m->interface), strna(m->member)); + return 1; + } + + return 1; +} + +static int proxy_process_local_to_destination(Proxy *p) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + assert(p); + + r = sd_bus_process(p->local_bus, &m); + if (r == -ECONNRESET || r == -ENOTCONN) /* Treat 'connection reset by peer' as clean exit condition */ + return r; + if (r < 0) { + log_error_errno(r, "Failed to process local bus: %m"); + return r; + } + if (r == 0) + return 0; + if (!m) + return 1; + + /* We officially got EOF, let's quit */ + if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) + return -ECONNRESET; + + r = process_hello(p, m); + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + if (r < 0) + return log_error_errno(r, "Failed to process HELLO: %m"); + if (r > 0) + return 1; + + r = bus_proxy_process_driver(p->destination_bus, p->local_bus, m, p->policy, &p->local_creds, p->owned_names); + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + if (r < 0) + return log_error_errno(r, "Failed to process driver calls: %m"); + if (r > 0) + return 1; + + for (;;) { + if (p->policy) { + r = process_policy(p->local_bus, p->destination_bus, m, p->policy, &p->local_creds, p->owned_names); + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + if (r < 0) + return log_error_errno(r, "Failed to process policy: %m"); + if (r > 0) + return 1; + } + + r = sd_bus_send(p->destination_bus, m, NULL); + if (r < 0) { + if (r == -ECONNRESET || r == -ENOTCONN) + return r; + + /* The name database changed since the policy check, hence let's check again */ + if (r == -EREMCHG) + continue; + + /* see above why EPERM is ignored for replies */ + if (r == -EPERM && m->reply_cookie > 0) + return 1; + + synthetic_reply_method_errnof(m, r, "Failed to forward message we got from local: %m"); + log_error_errno(r, + "Failed to forward message we got from local: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m", + p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type), + strna(m->destination), strna(m->path), strna(m->interface), strna(m->member)); + return 1; + } + + break; + } + + return 1; +} + +int proxy_run(Proxy *p) { + int r; + + assert(p); + + for (;;) { + bool busy = false; + + if (p->got_hello) { + /* Read messages from bus, to pass them on to our client */ + r = proxy_process_destination_to_local(p); + if (r == -ECONNRESET || r == -ENOTCONN) + return 0; + if (r < 0) + return r; + if (r > 0) + busy = true; + } + + /* Read messages from our client, to pass them on to the bus */ + r = proxy_process_local_to_destination(p); + if (r == -ECONNRESET || r == -ENOTCONN) + return 0; + if (r < 0) + return r; + if (r > 0) + busy = true; + + if (!busy) { + r = proxy_wait(p); + if (r == -ECONNRESET || r == -ENOTCONN) + return 0; + if (r < 0) + return r; + } + } + + return 0; +} diff --git a/src/bus-proxyd/proxy.h b/src/bus-proxyd/proxy.h new file mode 100644 index 000000000..913d47071 --- /dev/null +++ b/src/bus-proxyd/proxy.h @@ -0,0 +1,52 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 David Herrmann + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include "sd-bus.h" +#include "bus-xml-policy.h" +#include "util.h" + +typedef struct Proxy Proxy; + +struct Proxy { + sd_bus *local_bus; + struct ucred local_creds; + int local_in; + int local_out; + + sd_bus *destination_bus; + + Set *owned_names; + SharedPolicy *policy; + + bool got_hello : 1; +}; + +int proxy_new(Proxy **out, int in_fd, int out_fd, const char *dest); +Proxy *proxy_free(Proxy *p); + +int proxy_set_policy(Proxy *p, SharedPolicy *policy, char **configuration); +int proxy_hello_policy(Proxy *p, uid_t original_uid); +int proxy_run(Proxy *p); + +DEFINE_TRIVIAL_CLEANUP_FUNC(Proxy*, proxy_free); diff --git a/src/bus-proxyd/stdio-bridge.c b/src/bus-proxyd/stdio-bridge.c new file mode 100644 index 000000000..9fb3e9fc4 --- /dev/null +++ b/src/bus-proxyd/stdio-bridge.c @@ -0,0 +1,263 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + Copyright 2013 Daniel Mack + Copyright 2014 Kay Sievers + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "log.h" +#include "util.h" +#include "socket-util.h" +#include "sd-daemon.h" +#include "sd-bus.h" +#include "bus-internal.h" +#include "bus-message.h" +#include "bus-util.h" +#include "build.h" +#include "strv.h" +#include "def.h" +#include "capability.h" +#include "bus-control.h" +#include "smack-util.h" +#include "set.h" +#include "bus-xml-policy.h" +#include "driver.h" +#include "proxy.h" +#include "synthesize.h" + +static char *arg_address = NULL; +static char *arg_command_line_buffer = NULL; + +static int help(void) { + + printf("%s [OPTIONS...]\n\n" + "Connect STDIO to a given bus address.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --machine=MACHINE Connect to specified machine\n" + " --address=ADDRESS Connect to the bus specified by ADDRESS\n" + " (default: " DEFAULT_SYSTEM_BUS_ADDRESS ")\n", + program_invocation_short_name); + + return 0; +} + +static int parse_argv(int argc, char *argv[]) { + + enum { + ARG_VERSION = 0x100, + ARG_ADDRESS, + ARG_MACHINE, + }; + + static const struct option options[] = { + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, ARG_VERSION }, + { "address", required_argument, NULL, ARG_ADDRESS }, + { "machine", required_argument, NULL, ARG_MACHINE }, + {}, + }; + + int c; + + assert(argc >= 0); + assert(argv); + + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) + + switch (c) { + + case 'h': + help(); + return 0; + + case ARG_VERSION: + puts(PACKAGE_STRING); + puts(SYSTEMD_FEATURES); + return 0; + + case ARG_ADDRESS: { + char *a; + + a = strdup(optarg); + if (!a) + return log_oom(); + + free(arg_address); + arg_address = a; + break; + } + + case ARG_MACHINE: { + _cleanup_free_ char *e = NULL; + char *a; + + e = bus_address_escape(optarg); + if (!e) + return log_oom(); + +#ifdef ENABLE_KDBUS + a = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL); +#else + a = strjoin("x-machine-unix:machine=", e, NULL); +#endif + if (!a) + return log_oom(); + + free(arg_address); + arg_address = a; + + break; + } + + case '?': + return -EINVAL; + + default: + assert_not_reached("Unhandled option"); + } + + /* If the first command line argument is only "x" characters + * we'll write who we are talking to into it, so that "ps" is + * explanatory */ + arg_command_line_buffer = argv[optind]; + if (argc > optind + 1 || (arg_command_line_buffer && !in_charset(arg_command_line_buffer, "x"))) { + log_error("Too many arguments"); + return -EINVAL; + } + + if (!arg_address) { + arg_address = strdup(DEFAULT_SYSTEM_BUS_ADDRESS); + if (!arg_address) + return log_oom(); + } + + return 1; +} + +static int rename_service(sd_bus *a, sd_bus *b) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + _cleanup_free_ char *p = NULL, *name = NULL; + const char *comm; + char **cmdline; + uid_t uid; + pid_t pid; + int r; + + assert(a); + assert(b); + + r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM|SD_BUS_CREDS_AUGMENT, &creds); + if (r < 0) + return r; + + r = sd_bus_creds_get_euid(creds, &uid); + if (r < 0) + return r; + + r = sd_bus_creds_get_pid(creds, &pid); + if (r < 0) + return r; + + r = sd_bus_creds_get_cmdline(creds, &cmdline); + if (r < 0) + return r; + + r = sd_bus_creds_get_comm(creds, &comm); + if (r < 0) + return r; + + name = uid_to_name(uid); + if (!name) + return -ENOMEM; + + p = strv_join(cmdline, " "); + if (!p) + return -ENOMEM; + + /* The status string gets the full command line ... */ + sd_notifyf(false, + "STATUS=Processing requests from client PID "PID_FMT" (%s); UID "UID_FMT" (%s)", + pid, p, + uid, name); + + /* ... and the argv line only the short comm */ + if (arg_command_line_buffer) { + size_t m, w; + + m = strlen(arg_command_line_buffer); + w = snprintf(arg_command_line_buffer, m, + "[PID "PID_FMT"/%s; UID "UID_FMT"/%s]", + pid, comm, + uid, name); + + if (m > w) + memzero(arg_command_line_buffer + w, m - w); + } + + log_debug("Running on behalf of PID "PID_FMT" (%s), UID "UID_FMT" (%s), %s", + pid, p, + uid, name, + a->unique_name); + + return 0; +} + +int main(int argc, char *argv[]) { + _cleanup_(proxy_freep) Proxy *p = NULL; + int r; + + log_set_target(LOG_TARGET_JOURNAL_OR_KMSG); + log_parse_environment(); + log_open(); + + r = parse_argv(argc, argv); + if (r <= 0) + goto finish; + + r = proxy_new(&p, STDIN_FILENO, STDOUT_FILENO, arg_address); + if (r < 0) + goto finish; + + r = rename_service(p->destination_bus, p->local_bus); + if (r < 0) + log_debug_errno(r, "Failed to rename process: %m"); + + r = proxy_run(p); + +finish: + sd_notify(false, + "STOPPING=1\n" + "STATUS=Shutting down."); + + free(arg_address); + + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/src/bus-proxyd/synthesize.c b/src/bus-proxyd/synthesize.c new file mode 100644 index 000000000..e1b0fd353 --- /dev/null +++ b/src/bus-proxyd/synthesize.c @@ -0,0 +1,228 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + Copyright 2013 Daniel Mack + Copyright 2014 Kay Sievers + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include + +#include "log.h" +#include "util.h" +#include "sd-bus.h" +#include "bus-internal.h" +#include "bus-message.h" +#include "bus-util.h" +#include "strv.h" +#include "def.h" +#include "bus-control.h" +#include "synthesize.h" + +static int synthetic_driver_send(sd_bus *b, sd_bus_message *m) { + int r; + + assert(b); + assert(m); + + r = bus_message_append_sender(m, "org.freedesktop.DBus"); + if (r < 0) + return r; + + r = bus_seal_synthetic_message(b, m); + if (r < 0) + return r; + + return sd_bus_send(b, m, NULL); +} + +int synthetic_reply_method_error(sd_bus_message *call, const sd_bus_error *e) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + assert(call); + + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + + r = sd_bus_message_new_method_error(call, &m, e); + if (r < 0) + return r; + + return synthetic_driver_send(call->bus, m); +} + +int synthetic_reply_method_errorf(sd_bus_message *call, const char *name, const char *format, ...) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + va_list ap; + + va_start(ap, format); + bus_error_setfv(&error, name, format, ap); + va_end(ap); + + return synthetic_reply_method_error(call, &error); +} + +int synthetic_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *p) { + _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; + + assert(call); + + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + + if (sd_bus_error_is_set(p)) + return synthetic_reply_method_error(call, p); + + sd_bus_error_set_errno(&berror, error); + + return synthetic_reply_method_error(call, &berror); +} + +int synthetic_reply_method_errnof(sd_bus_message *call, int error, const char *format, ...) { + _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; + va_list ap; + + assert(call); + + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + + va_start(ap, format); + sd_bus_error_set_errnofv(&berror, error, format, ap); + va_end(ap); + + return synthetic_reply_method_error(call, &berror); +} + +int synthetic_reply_method_return(sd_bus_message *call, const char *types, ...) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + assert(call); + + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + + r = sd_bus_message_new_method_return(call, &m); + if (r < 0) + return r; + + if (!isempty(types)) { + va_list ap; + + va_start(ap, types); + r = bus_message_append_ap(m, types, ap); + va_end(ap); + if (r < 0) + return r; + } + + return synthetic_driver_send(call->bus, m); +} + +int synthetic_reply_method_return_strv(sd_bus_message *call, char **l) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + assert(call); + + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + + r = sd_bus_message_new_method_return(call, &m); + if (r < 0) + return synthetic_reply_method_errno(call, r, NULL); + + r = sd_bus_message_append_strv(m, l); + if (r < 0) + return synthetic_reply_method_errno(call, r, NULL); + + return synthetic_driver_send(call->bus, m); +} + +int synthesize_name_acquired(sd_bus *a, sd_bus *b, sd_bus_message *m) { + _cleanup_bus_message_unref_ sd_bus_message *n = NULL; + const char *name, *old_owner, *new_owner; + int r; + + assert(a); + assert(b); + assert(m); + + /* If we get NameOwnerChanged for our own name, we need to + * synthesize NameLost/NameAcquired, since socket clients need + * that, even though it is obsoleted on kdbus */ + + if (!a->is_kernel) + return 0; + + if (!sd_bus_message_is_signal(m, "org.freedesktop.DBus", "NameOwnerChanged") || + !streq_ptr(m->path, "/org/freedesktop/DBus") || + !streq_ptr(m->sender, "org.freedesktop.DBus")) + return 0; + + r = sd_bus_message_read(m, "sss", &name, &old_owner, &new_owner); + if (r < 0) + return r; + + r = sd_bus_message_rewind(m, true); + if (r < 0) + return r; + + if (streq(old_owner, a->unique_name)) { + + r = sd_bus_message_new_signal( + b, + &n, + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "NameLost"); + + } else if (streq(new_owner, a->unique_name)) { + + r = sd_bus_message_new_signal( + b, + &n, + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "NameAcquired"); + } else + return 0; + + if (r < 0) + return r; + + r = sd_bus_message_append(n, "s", name); + if (r < 0) + return r; + + r = bus_message_append_sender(n, "org.freedesktop.DBus"); + if (r < 0) + return r; + + r = bus_seal_synthetic_message(b, n); + if (r < 0) + return r; + + return sd_bus_send(b, n, NULL); +} diff --git a/src/bus-proxyd/synthesize.h b/src/bus-proxyd/synthesize.h new file mode 100644 index 000000000..a55f171cb --- /dev/null +++ b/src/bus-proxyd/synthesize.h @@ -0,0 +1,34 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "sd-bus.h" + +int synthetic_reply_method_return(sd_bus_message *call, const char *types, ...); +int synthetic_reply_method_return_strv(sd_bus_message *call, char **l); + +int synthetic_reply_method_error(sd_bus_message *call, const sd_bus_error *e); +int synthetic_reply_method_errorf(sd_bus_message *call, const char *name, const char *format, ...) _sd_printf_(3, 4); +int synthetic_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *p); +int synthetic_reply_method_errnof(sd_bus_message *call, int error, const char *format, ...) _sd_printf_(3, 4); + +int synthesize_name_acquired(sd_bus *a, sd_bus *b, sd_bus_message *m); diff --git a/src/bus-proxyd/test-bus-policy.c b/src/bus-proxyd/test-bus-xml-policy.c similarity index 55% rename from src/bus-proxyd/test-bus-policy.c rename to src/bus-proxyd/test-bus-xml-policy.c index 91ab33da4..421487e03 100644 --- a/src/bus-proxyd/test-bus-policy.c +++ b/src/bus-proxyd/test-bus-xml-policy.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -40,11 +40,9 @@ #include "strv.h" #include "def.h" #include "capability.h" +#include "bus-xml-policy.h" -#include - -static int test_policy_load(Policy *p, const char *name) -{ +static int test_policy_load(Policy *p, const char *name) { _cleanup_free_ char *path = NULL; int r = 0; @@ -52,17 +50,41 @@ static int test_policy_load(Policy *p, const char *name) assert_se(path); if (access(path, R_OK) == 0) - policy_load(p, STRV_MAKE(path)); + r = policy_load(p, STRV_MAKE(path)); else r = -ENOENT; return r; } +static int show_policy(const char *fn) { + Policy p = {}; + int r; + + r = policy_load(&p, STRV_MAKE(fn)); + if (r < 0) { + log_error_errno(r, "Failed to load policy %s: %m", fn); + return r; + } + + policy_dump(&p); + policy_free(&p); + + return 0; +} + int main(int argc, char *argv[]) { Policy p = {}; + printf("Showing session policy BEGIN\n"); + show_policy("/etc/dbus-1/session.conf"); + printf("Showing session policy END\n"); + + printf("Showing system policy BEGIN\n"); + show_policy("/etc/dbus-1/system.conf"); + printf("Showing system policy END\n"); + /* Ownership tests */ assert_se(test_policy_load(&p, "ownerships.conf") == 0); @@ -83,8 +105,8 @@ int main(int argc, char *argv[]) { /* Signaltest */ assert_se(test_policy_load(&p, "signals.conf") == 0); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_SIGNAL, "bli.bla.blubb", NULL, "/an/object/path", NULL) == true); - assert_se(policy_check_send(&p, 1, 0, SD_BUS_MESSAGE_SIGNAL, "bli.bla.blubb", NULL, "/an/object/path", NULL) == false); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_SIGNAL, "bli.bla.blubb", NULL, "/an/object/path", NULL) == true); + assert_se(policy_check_one_send(&p, 1, 0, SD_BUS_MESSAGE_SIGNAL, "bli.bla.blubb", NULL, "/an/object/path", NULL) == false); policy_free(&p); @@ -92,12 +114,12 @@ int main(int argc, char *argv[]) { assert_se(test_policy_load(&p, "methods.conf") == 0); policy_dump(&p); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "bli.bla.blubb", "Member") == false); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "bli.bla.blubb", "Member") == false); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int1", "Member") == true); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == true); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "bli.bla.blubb", "Member") == false); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "bli.bla.blubb", "Member") == false); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int1", "Member") == true); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == true); - assert_se(policy_check_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test3", "/an/object/path", "org.test.int3", "Member111") == true); + assert_se(policy_check_one_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test3", "/an/object/path", "org.test.int3", "Member111") == true); policy_free(&p); @@ -140,19 +162,19 @@ int main(int argc, char *argv[]) { assert_se(policy_check_own(&p, 0, 0, "org.foo.FooService") == true); assert_se(policy_check_own(&p, 0, 0, "org.foo.FooService2") == false); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == false); - assert_se(policy_check_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); - assert_se(policy_check_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); - assert_se(policy_check_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface2", "Member") == false); - assert_se(policy_check_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService2", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == false); + assert_se(policy_check_one_send(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); + assert_se(policy_check_one_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); + assert_se(policy_check_one_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface2", "Member") == false); + assert_se(policy_check_one_recv(&p, 0, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService2", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); assert_se(policy_check_own(&p, 100, 0, "org.foo.FooService") == false); assert_se(policy_check_own(&p, 100, 0, "org.foo.FooService2") == false); - assert_se(policy_check_send(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == false); - assert_se(policy_check_send(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); - assert_se(policy_check_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); - assert_se(policy_check_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface2", "Member") == false); - assert_se(policy_check_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService2", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); + assert_se(policy_check_one_send(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.test.int2", "Member") == false); + assert_se(policy_check_one_send(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.test.test1", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); + assert_se(policy_check_one_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == true); + assert_se(policy_check_one_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService", "/an/object/path", "org.foo.FooBroadcastInterface2", "Member") == false); + assert_se(policy_check_one_recv(&p, 100, 0, SD_BUS_MESSAGE_METHOD_CALL, "org.foo.FooService2", "/an/object/path", "org.foo.FooBroadcastInterface", "Member") == false); policy_free(&p); diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c index f400bccc0..579e06de5 100644 --- a/src/cgls/cgls.c +++ b/src/cgls/cgls.c @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - m = strappenda("/run/systemd/machines/", arg_machine); + m = strjoina("/run/systemd/machines/", arg_machine); r = parse_env_file(m, NEWLINE, "SCOPE", &scope, NULL); if (r < 0) { log_error_errno(r, "Failed to get machine path: %m"); diff --git a/src/compat-libs/linkwarning.h b/src/compat-libs/linkwarning.h index a2e9534a8..79ece9e7d 100644 --- a/src/compat-libs/linkwarning.h +++ b/src/compat-libs/linkwarning.h @@ -18,6 +18,8 @@ along with systemd; If not, see . ***/ +#pragma once + #define __make_section_unallocated(section_string) \ asm (".section " section_string "\n\t.previous"); diff --git a/src/console/consoled.h b/src/console/consoled.h index f8a3df448..b0db61040 100644 --- a/src/console/consoled.h +++ b/src/console/consoled.h @@ -26,7 +26,6 @@ #include #include #include "grdev.h" -#include "hashmap.h" #include "idev.h" #include "list.h" #include "macro.h" @@ -36,7 +35,6 @@ #include "sysview.h" #include "term.h" #include "unifont.h" -#include "util.h" typedef struct Manager Manager; typedef struct Session Session; diff --git a/src/core/automount.c b/src/core/automount.c index f79548713..9f6bd84b2 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -449,7 +449,9 @@ int automount_send_ready(Automount *a, int status) { static void automount_enter_waiting(Automount *a) { _cleanup_close_ int ioctl_fd = -1; int p[2] = { -1, -1 }; - char name[32], options[128]; + char name[sizeof("systemd-")-1 + DECIMAL_STR_MAX(pid_t) + 1]; + char options[sizeof("fd=,pgrp=,minproto=5,maxproto=5,direct")-1 + + DECIMAL_STR_MAX(int) + DECIMAL_STR_MAX(gid_t) + 1]; bool mounted = false; int r, dev_autofs_fd; struct stat st; @@ -477,12 +479,8 @@ static void automount_enter_waiting(Automount *a) { goto fail; } - snprintf(options, sizeof(options), "fd=%i,pgrp=%u,minproto=5,maxproto=5,direct", p[1], (unsigned) getpgrp()); - char_array_0(options); - - snprintf(name, sizeof(name), "systemd-%u", (unsigned) getpid()); - char_array_0(name); - + xsprintf(options, "fd=%i,pgrp="PID_FMT",minproto=5,maxproto=5,direct", p[1], getpgrp()); + xsprintf(name, "systemd-"PID_FMT, getpid()); if (mount(name, a->where, "autofs", 0, options) < 0) { r = -errno; goto fail; @@ -603,7 +601,7 @@ static int automount_start(Unit *u) { a->result = AUTOMOUNT_SUCCESS; automount_enter_waiting(a); - return 0; + return 1; } static int automount_stop(Unit *u) { @@ -613,7 +611,7 @@ static int automount_stop(Unit *u) { assert(a->state == AUTOMOUNT_WAITING || a->state == AUTOMOUNT_RUNNING); automount_enter_dead(a, AUTOMOUNT_SUCCESS); - return 0; + return 1; } static int automount_serialize(Unit *u, FILE *f, FDSet *fds) { @@ -758,7 +756,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo get_process_comm(packet.v5_packet.pid, &p); log_unit_info(UNIT(a)->id, - "Got automount request for %s, triggered by "PID_FMT" (%s)", + "Got automount request for %s, triggered by %"PRIu32" (%s)", a->where, packet.v5_packet.pid, strna(p)); } else log_unit_debug(UNIT(a)->id, "Got direct mount request on %s", a->where); @@ -807,6 +805,17 @@ static void automount_reset_failed(Unit *u) { a->result = AUTOMOUNT_SUCCESS; } +static bool automount_supported(Manager *m) { + static int supported = -1; + + assert(m); + + if (supported < 0) + supported = access("/dev/autofs", F_OK) >= 0; + + return supported; +} + static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = { [AUTOMOUNT_DEAD] = "dead", [AUTOMOUNT_WAITING] = "waiting", @@ -859,6 +868,7 @@ const UnitVTable automount_vtable = { .bus_vtable = bus_automount_vtable, .shutdown = automount_shutdown, + .supported = automount_supported, .status_message_formats = { .finished_start_job = { diff --git a/src/core/bus-endpoint.c b/src/core/bus-endpoint.c index aac540dde..0c4b3e7c8 100644 --- a/src/core/bus-endpoint.c +++ b/src/core/bus-endpoint.c @@ -19,10 +19,56 @@ #include +#include "kdbus.h" +#include "bus-kernel.h" +#include "bus-policy.h" #include "bus-endpoint.h" -int bus_endpoint_new(BusEndpoint **ep) -{ +int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep) { + + struct kdbus_cmd *update; + struct kdbus_item *n; + BusEndpointPolicy *po; + Iterator i; + size_t size; + int r; + + size = ALIGN8(offsetof(struct kdbus_cmd, items)); + + HASHMAP_FOREACH(po, ep->policy_hash, i) { + size += ALIGN8(offsetof(struct kdbus_item, str) + strlen(po->name) + 1); + size += ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access)); + } + + update = alloca0_align(size, 8); + update->size = size; + + n = update->items; + + HASHMAP_FOREACH(po, ep->policy_hash, i) { + n->type = KDBUS_ITEM_NAME; + n->size = offsetof(struct kdbus_item, str) + strlen(po->name) + 1; + strcpy(n->str, po->name); + n = KDBUS_ITEM_NEXT(n); + + n->type = KDBUS_ITEM_POLICY_ACCESS; + n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); + + n->policy_access.type = KDBUS_POLICY_ACCESS_USER; + n->policy_access.access = bus_kernel_translate_access(po->access); + n->policy_access.id = uid; + + n = KDBUS_ITEM_NEXT(n); + } + + r = ioctl(fd, KDBUS_CMD_ENDPOINT_UPDATE, update); + if (r < 0) + return -errno; + + return 0; +} + +int bus_endpoint_new(BusEndpoint **ep) { assert(ep); *ep = new0(BusEndpoint, 1); @@ -32,8 +78,7 @@ int bus_endpoint_new(BusEndpoint **ep) return 0; } -int bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess access) -{ +int bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess access) { _cleanup_free_ BusEndpointPolicy *po = NULL; _cleanup_free_ char *key = NULL; int r; @@ -80,8 +125,7 @@ int bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess a return 0; } -void bus_endpoint_free(BusEndpoint *endpoint) -{ +void bus_endpoint_free(BusEndpoint *endpoint) { if (!endpoint) return; diff --git a/src/core/bus-endpoint.h b/src/core/bus-endpoint.h index 2c5415f34..4a31f4c4b 100644 --- a/src/core/bus-endpoint.h +++ b/src/core/bus-endpoint.h @@ -24,8 +24,8 @@ typedef struct BusEndpoint BusEndpoint; typedef struct BusEndpointPolicy BusEndpointPolicy; -#include "bus-common.h" #include "hashmap.h" +#include "bus-policy.h" struct BusEndpointPolicy { char *name; @@ -40,3 +40,5 @@ int bus_endpoint_new(BusEndpoint **ep); void bus_endpoint_free(BusEndpoint *endpoint); int bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess access); + +int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep); diff --git a/src/core/bus-policy.c b/src/core/bus-policy.c new file mode 100644 index 000000000..710283dcd --- /dev/null +++ b/src/core/bus-policy.c @@ -0,0 +1,174 @@ +/*** + This file is part of systemd. + + Copyright 2014 Daniel Mack + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "kdbus.h" +#include "util.h" +#include "bus-kernel.h" +#include "bus-policy.h" + +int bus_kernel_translate_access(BusPolicyAccess access) { + assert(access >= 0); + assert(access < _BUS_POLICY_ACCESS_MAX); + + switch (access) { + + case BUS_POLICY_ACCESS_SEE: + return KDBUS_POLICY_SEE; + + case BUS_POLICY_ACCESS_TALK: + return KDBUS_POLICY_TALK; + + case BUS_POLICY_ACCESS_OWN: + return KDBUS_POLICY_OWN; + + default: + assert_not_reached("Unknown policy access"); + } +} + +int bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbus_item *item) { + int r; + + assert(policy); + assert(item); + + switch (policy->type) { + + case BUSNAME_POLICY_TYPE_USER: { + const char *user = policy->name; + uid_t uid; + + r = get_user_creds(&user, &uid, NULL, NULL, NULL); + if (r < 0) + return r; + + item->policy_access.type = KDBUS_POLICY_ACCESS_USER; + item->policy_access.id = uid; + break; + } + + case BUSNAME_POLICY_TYPE_GROUP: { + const char *group = policy->name; + gid_t gid; + + r = get_group_creds(&group, &gid); + if (r < 0) + return r; + + item->policy_access.type = KDBUS_POLICY_ACCESS_GROUP; + item->policy_access.id = gid; + break; + } + + default: + assert_not_reached("Unknown policy type"); + } + + item->policy_access.access = bus_kernel_translate_access(policy->access); + + return 0; +} + +int bus_kernel_make_starter( + int fd, + const char *name, + bool activating, + bool accept_fd, + BusNamePolicy *policy, + BusPolicyAccess world_policy) { + + struct kdbus_cmd_free cmd_free = { .size = sizeof(cmd_free) }; + struct kdbus_cmd_hello *hello; + struct kdbus_item *n; + size_t policy_cnt = 0; + BusNamePolicy *po; + size_t size; + int r; + + assert(fd >= 0); + assert(name); + + LIST_FOREACH(policy, po, policy) + policy_cnt++; + + if (world_policy >= 0) + policy_cnt++; + + size = offsetof(struct kdbus_cmd_hello, items) + + ALIGN8(offsetof(struct kdbus_item, str) + strlen(name) + 1) + + policy_cnt * ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access)); + + hello = alloca0_align(size, 8); + + n = hello->items; + strcpy(n->str, name); + n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1; + n->type = KDBUS_ITEM_NAME; + n = KDBUS_ITEM_NEXT(n); + + LIST_FOREACH(policy, po, policy) { + n->type = KDBUS_ITEM_POLICY_ACCESS; + n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); + + r = bus_kernel_translate_policy(po, n); + if (r < 0) + return r; + + n = KDBUS_ITEM_NEXT(n); + } + + if (world_policy >= 0) { + n->type = KDBUS_ITEM_POLICY_ACCESS; + n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); + n->policy_access.type = KDBUS_POLICY_ACCESS_WORLD; + n->policy_access.access = bus_kernel_translate_access(world_policy); + } + + hello->size = size; + hello->flags = + (activating ? KDBUS_HELLO_ACTIVATOR : KDBUS_HELLO_POLICY_HOLDER) | + (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0); + hello->pool_size = KDBUS_POOL_SIZE; + hello->attach_flags_send = _KDBUS_ATTACH_ANY; + hello->attach_flags_recv = _KDBUS_ATTACH_ANY; + + if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) + return -errno; + + /* not interested in any output values */ + cmd_free.offset = hello->offset; + (void) ioctl(fd, KDBUS_CMD_FREE, &cmd_free); + + /* The higher 32bit of the bus_flags fields are considered + * 'incompatible flags'. Refuse them all for now. */ + if (hello->bus_flags > 0xFFFFFFFFULL) + return -ENOTSUP; + + return fd; +} + +static const char* const bus_policy_access_table[_BUS_POLICY_ACCESS_MAX] = { + [BUS_POLICY_ACCESS_SEE] = "see", + [BUS_POLICY_ACCESS_TALK] = "talk", + [BUS_POLICY_ACCESS_OWN] = "own", +}; + +DEFINE_STRING_TABLE_LOOKUP(bus_policy_access, BusPolicyAccess); diff --git a/src/core/bus-policy.h b/src/core/bus-policy.h new file mode 100644 index 000000000..3b04f5457 --- /dev/null +++ b/src/core/bus-policy.h @@ -0,0 +1,66 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Daniel Mack + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "list.h" +#include "macro.h" +#include "kdbus.h" + +typedef struct BusNamePolicy BusNamePolicy; + +typedef enum BusPolicyAccess { + BUS_POLICY_ACCESS_SEE, + BUS_POLICY_ACCESS_TALK, + BUS_POLICY_ACCESS_OWN, + _BUS_POLICY_ACCESS_MAX, + _BUS_POLICY_ACCESS_INVALID = -1 +} BusPolicyAccess; + +typedef enum BusNamePolicyType { + BUSNAME_POLICY_TYPE_USER, + BUSNAME_POLICY_TYPE_GROUP, + _BUSNAME_POLICY_TYPE_MAX, + _BUSNAME_POLICY_TYPE_INVALID = -1 +} BusNamePolicyType; + +struct BusNamePolicy { + BusNamePolicyType type; + BusPolicyAccess access; + + char *name; + + LIST_FIELDS(BusNamePolicy, policy); +}; + +int bus_kernel_translate_access(BusPolicyAccess access); +int bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbus_item *item); + +const char* bus_policy_access_to_string(BusPolicyAccess i) _const_; +BusPolicyAccess bus_policy_access_from_string(const char *s) _pure_; + +int bus_kernel_make_starter( + int fd, + const char *name, + bool activating, + bool accept_fd, + BusNamePolicy *policy, + BusPolicyAccess world_policy); diff --git a/src/core/busname.c b/src/core/busname.c index 99641ec41..1d77292f9 100644 --- a/src/core/busname.c +++ b/src/core/busname.c @@ -26,9 +26,10 @@ #include "bus-internal.h" #include "bus-util.h" #include "service.h" +#include "kdbus.h" +#include "bus-policy.h" #include "dbus-busname.h" #include "busname.h" -#include "kdbus.h" static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = { [BUSNAME_DEAD] = UNIT_INACTIVE, @@ -204,7 +205,7 @@ static int busname_verify(BusName *n) { return -EINVAL; } - e = strappenda(n->name, ".busname"); + e = strjoina(n->name, ".busname"); if (!unit_has_name(UNIT(n), e)) { log_unit_error(UNIT(n)->id, "%s's Name= setting doesn't match unit name. Refusing.", UNIT(n)->id); return -EINVAL; @@ -614,7 +615,7 @@ static int busname_start(Unit *u) { n->result = BUSNAME_SUCCESS; busname_enter_making(n); - return 0; + return 1; } static int busname_stop(Unit *u) { @@ -637,7 +638,7 @@ static int busname_stop(Unit *u) { assert(IN_SET(n->state, BUSNAME_REGISTERED, BUSNAME_LISTENING, BUSNAME_RUNNING)); busname_enter_dead(n, BUSNAME_SUCCESS); - return 0; + return 1; } static int busname_serialize(Unit *u, FILE *f, FDSet *fds) { @@ -727,9 +728,12 @@ _pure_ static const char *busname_sub_state_to_string(Unit *u) { static int busname_peek_message(BusName *n) { struct kdbus_cmd_recv cmd_recv = { + .size = sizeof(cmd_recv), .flags = KDBUS_RECV_PEEK, }; - struct kdbus_cmd_free cmd_free = {}; + struct kdbus_cmd_free cmd_free = { + .size = sizeof(cmd_free), + }; const char *comm = NULL; struct kdbus_item *d; struct kdbus_msg *k; @@ -750,7 +754,7 @@ static int busname_peek_message(BusName *n) { if (log_get_max_level() < LOG_DEBUG) return 0; - r = ioctl(n->starter_fd, KDBUS_CMD_MSG_RECV, &cmd_recv); + r = ioctl(n->starter_fd, KDBUS_CMD_RECV, &cmd_recv); if (r < 0) { if (errno == EINTR || errno == EAGAIN) return 0; @@ -766,9 +770,9 @@ static int busname_peek_message(BusName *n) { * longer than necessary. */ ps = page_size(); - start = (cmd_recv.offset / ps) * ps; - delta = cmd_recv.offset - start; - sz = PAGE_ALIGN(delta + cmd_recv.msg_size); + start = (cmd_recv.msg.offset / ps) * ps; + delta = cmd_recv.msg.offset - start; + sz = PAGE_ALIGN(delta + cmd_recv.msg.msg_size); p = mmap(NULL, sz, PROT_READ, MAP_SHARED, n->starter_fd, start); if (p == MAP_FAILED) { @@ -800,7 +804,7 @@ finish: if (p) (void) munmap(p, sz); - cmd_free.offset = cmd_recv.offset; + cmd_free.offset = cmd_recv.msg.offset; if (ioctl(n->starter_fd, KDBUS_CMD_FREE, &cmd_free) < 0) log_unit_warning(UNIT(n)->id, "Failed to free peeked message, ignoring: %m"); @@ -970,6 +974,16 @@ static int busname_get_timeout(Unit *u, uint64_t *timeout) { return 1; } +static bool busname_supported(Manager *m) { + static int supported = -1; + assert(m); + + if (supported < 0) + supported = access("/sys/fs/kdbus", F_OK) >= 0; + + return supported; +} + static const char* const busname_state_table[_BUSNAME_STATE_MAX] = { [BUSNAME_DEAD] = "dead", [BUSNAME_MAKING] = "making", @@ -1031,6 +1045,8 @@ const UnitVTable busname_vtable = { .reset_failed = busname_reset_failed, + .supported = busname_supported, + .bus_interface = "org.freedesktop.systemd1.BusName", .bus_vtable = bus_busname_vtable, diff --git a/src/core/busname.h b/src/core/busname.h index c9b653d82..775822d8d 100644 --- a/src/core/busname.h +++ b/src/core/busname.h @@ -25,7 +25,6 @@ typedef struct BusName BusName; typedef struct BusNamePolicy BusNamePolicy; #include "unit.h" -#include "bus-common.h" typedef enum BusNameState { BUSNAME_DEAD, @@ -52,22 +51,6 @@ typedef enum BusNameResult { _BUSNAME_RESULT_INVALID = -1 } BusNameResult; -typedef enum BusNamePolicyType { - BUSNAME_POLICY_TYPE_USER, - BUSNAME_POLICY_TYPE_GROUP, - _BUSNAME_POLICY_TYPE_MAX, - _BUSNAME_POLICY_TYPE_INVALID = -1 -} BusNamePolicyType; - -struct BusNamePolicy { - BusNamePolicyType type; - BusPolicyAccess access; - - char *name; - - LIST_FIELDS(BusNamePolicy, policy); -}; - struct BusName { Unit meta; diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 35b862d5c..10fdcc998 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -200,7 +200,8 @@ static int whitelist_device(const char *path, const char *node, const char *acc) r = cg_set_attribute("devices", path, "devices.allow", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set devices.allow on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS, -EINVAL) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set devices.allow on %s: %m", path); return r; } @@ -270,7 +271,8 @@ static int whitelist_major(const char *path, const char *name, char type, const r = cg_set_attribute("devices", path, "devices.allow", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set devices.allow on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS, -EINVAL) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set devices.allow on %s: %m", path); } return 0; @@ -290,9 +292,16 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha if (mask == 0) return; - /* Some cgroup attributes are not support on the root cgroup, + /* Some cgroup attributes are not supported on the root cgroup, * hence silently ignore */ is_root = isempty(path) || path_equal(path, "/"); + if (is_root) + /* Make sure we don't try to display messages with an empty path. */ + path = "/"; + + /* We generally ignore errors caused by read-only mounted + * cgroup trees (assuming we are running in a container then), + * and missing cgroups, i.e. EROFS and ENOENT. */ if ((mask & CGROUP_CPU) && !is_root) { char buf[MAX(DECIMAL_STR_MAX(unsigned long), DECIMAL_STR_MAX(usec_t)) + 1]; @@ -302,12 +311,14 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha c->cpu_shares != (unsigned long) -1 ? c->cpu_shares : 1024); r = cg_set_attribute("cpu", path, "cpu.shares", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set cpu.shares on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set cpu.shares on %s: %m", path); sprintf(buf, USEC_FMT "\n", CGROUP_CPU_QUOTA_PERIOD_USEC); r = cg_set_attribute("cpu", path, "cpu.cfs_period_us", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set cpu.cfs_period_us on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set cpu.cfs_period_us on %s: %m", path); if (c->cpu_quota_per_sec_usec != USEC_INFINITY) { sprintf(buf, USEC_FMT "\n", c->cpu_quota_per_sec_usec * CGROUP_CPU_QUOTA_PERIOD_USEC / USEC_PER_SEC); @@ -315,7 +326,8 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha } else r = cg_set_attribute("cpu", path, "cpu.cfs_quota_us", "-1"); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set cpu.cfs_quota_us on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set cpu.cfs_quota_us on %s: %m", path); } if (mask & CGROUP_BLKIO) { @@ -330,7 +342,8 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha c->blockio_weight != (unsigned long) -1 ? c->blockio_weight : 1000); r = cg_set_attribute("blkio", path, "blkio.weight", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set blkio.weight on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set blkio.weight on %s: %m", path); /* FIXME: no way to reset this list */ LIST_FOREACH(device_weights, w, c->blockio_device_weights) { @@ -343,7 +356,8 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha sprintf(buf, "%u:%u %lu", major(dev), minor(dev), w->weight); r = cg_set_attribute("blkio", path, "blkio.weight_device", buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set blkio.weight_device on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set blkio.weight_device on %s: %m", path); } } @@ -361,11 +375,12 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha sprintf(buf, "%u:%u %" PRIu64 "\n", major(dev), minor(dev), b->bandwidth); r = cg_set_attribute("blkio", path, a, buf); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set %s on %s: %s", a, path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set %s on %s: %m", a, path); } } - if (mask & CGROUP_MEMORY) { + if ((mask & CGROUP_MEMORY) && !is_root) { if (c->memory_limit != (uint64_t) -1) { char buf[DECIMAL_STR_MAX(uint64_t) + 1]; @@ -375,18 +390,24 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha r = cg_set_attribute("memory", path, "memory.limit_in_bytes", "-1"); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to set memory.limit_in_bytes on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to set memory.limit_in_bytes on %s: %m", path); } if ((mask & CGROUP_DEVICE) && !is_root) { CGroupDeviceAllow *a; + /* Changing the devices list of a populated cgroup + * might result in EINVAL, hence ignore EINVAL + * here. */ + if (c->device_allow || c->device_policy != CGROUP_AUTO) r = cg_set_attribute("devices", path, "devices.deny", "a"); else r = cg_set_attribute("devices", path, "devices.allow", "a"); if (r < 0) - log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to reset devices.list on %s: %s", path, strerror(-r)); + log_full_errno(IN_SET(r, -ENOENT, -EROFS, -EINVAL) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to reset devices.list on %s: %m", path); if (c->device_policy == CGROUP_CLOSED || (c->device_policy == CGROUP_AUTO && c->device_allow)) { @@ -933,7 +954,7 @@ int manager_setup_cgroup(Manager *m) { if (m->pin_cgroupfs_fd < 0) return log_error_errno(errno, "Failed to open pin file: %m"); - /* 6. Always enable hierarchial support if it exists... */ + /* 6. Always enable hierarchical support if it exists... */ cg_set_attribute("memory", "/", "memory.use_hierarchy", "1"); } diff --git a/src/core/cgroup.h b/src/core/cgroup.h index 7150e5e7e..8fa851de3 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -21,7 +21,10 @@ along with systemd; If not, see . ***/ +#include + #include "list.h" +#include "time-util.h" typedef struct CGroupContext CGroupContext; typedef struct CGroupDeviceAllow CGroupDeviceAllow; diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c index db998345e..4a9df0601 100644 --- a/src/core/dbus-cgroup.c +++ b/src/core/dbus-cgroup.c @@ -574,7 +574,7 @@ int bus_cgroup_set_property( c->device_policy = p; u->cgroup_realized_mask &= ~CGROUP_DEVICE; - buf = strappenda("DevicePolicy=", policy); + buf = strjoina("DevicePolicy=", policy); unit_write_drop_in_private(u, mode, name, buf); } diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index bbcd6106a..a9f7971cd 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -31,11 +31,12 @@ #include "strv.h" #include "fileio.h" #include "execute.h" -#include "dbus-execute.h" #include "capability.h" #include "env-util.h" #include "af-list.h" #include "namespace.h" +#include "path-util.h" +#include "dbus-execute.h" #ifdef HAVE_SECCOMP #include "seccomp-util.h" @@ -845,6 +846,92 @@ int bus_exec_context_set_transient_property( return 1; + } else if (streq(name, "TTYPath")) { + const char *tty; + + r = sd_bus_message_read(message, "s", &tty); + if (r < 0) + return r; + + if (!path_is_absolute(tty)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "TTY device not absolute path"); + + if (mode != UNIT_CHECK) { + char *t; + + t = strdup(tty); + if (!t) + return -ENOMEM; + + free(c->tty_path); + c->tty_path = t; + + unit_write_drop_in_private_format(u, mode, name, "TTYPath=%s\n", tty); + } + + return 1; + + } else if (streq(name, "StandardInput")) { + const char *s; + ExecInput p; + + r = sd_bus_message_read(message, "s", &s); + if (r < 0) + return r; + + p = exec_input_from_string(s); + if (p < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid standard input name"); + + if (mode != UNIT_CHECK) { + c->std_input = p; + + unit_write_drop_in_private_format(u, mode, name, "StandardInput=%s\n", exec_input_to_string(p)); + } + + return 1; + + + } else if (streq(name, "StandardOutput")) { + const char *s; + ExecOutput p; + + r = sd_bus_message_read(message, "s", &s); + if (r < 0) + return r; + + p = exec_output_from_string(s); + if (p < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid standard output name"); + + if (mode != UNIT_CHECK) { + c->std_output = p; + + unit_write_drop_in_private_format(u, mode, name, "StandardOutput=%s\n", exec_output_to_string(p)); + } + + return 1; + + } else if (streq(name, "StandardError")) { + const char *s; + ExecOutput p; + + r = sd_bus_message_read(message, "s", &s); + if (r < 0) + return r; + + p = exec_output_from_string(s); + if (p < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid standard error name"); + + if (mode != UNIT_CHECK) { + c->std_error = p; + + unit_write_drop_in_private_format(u, mode, name, "StandardError=%s\n", exec_output_to_string(p)); + } + + return 1; + } else if (streq(name, "Environment")) { _cleanup_strv_free_ char **l = NULL; diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 6181ba824..8ba665dc3 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -407,7 +407,7 @@ static int method_get_unit_by_pid(sd_bus *bus, sd_bus_message *message, void *us u = manager_get_unit_by_pid(m, pid); if (!u) - return sd_bus_error_setf(error, BUS_ERROR_NO_UNIT_FOR_PID, "PID %u does not belong to any loaded unit.", pid); + return sd_bus_error_setf(error, BUS_ERROR_NO_UNIT_FOR_PID, "PID "PID_FMT" does not belong to any loaded unit.", pid); r = mac_selinux_unit_access_check(u, message, "status", error); if (r < 0) diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c index 5a881e824..6d4713bab 100644 --- a/src/core/dbus-service.c +++ b/src/core/dbus-service.c @@ -59,6 +59,7 @@ const sd_bus_vtable bus_service_vtable[] = { SD_BUS_PROPERTY("MainPID", "u", bus_property_get_pid, offsetof(Service, main_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Service, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("BusName", "s", NULL, offsetof(Service, bus_name), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("FileDescriptorStoreMax", "u", NULL, offsetof(Service, n_fd_store_max), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("StatusText", "s", NULL, offsetof(Service, status_text), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("StatusErrno", "i", NULL, offsetof(Service, status_errno), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Service, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), @@ -187,10 +188,8 @@ static int bus_service_set_transient_property( ExecCommand *c; size_t size = 0; - if (n == 0) { - exec_command_free_list(s->exec_command[SERVICE_EXEC_START]); - s->exec_command[SERVICE_EXEC_START] = NULL; - } + if (n == 0) + s->exec_command[SERVICE_EXEC_START] = exec_command_free_list(s->exec_command[SERVICE_EXEC_START]); f = open_memstream(&buf, &size); if (!f) diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index b96800993..625d21ab8 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -638,10 +638,46 @@ static int property_get_slice( return sd_bus_message_append(reply, "s", unit_slice_name(u)); } +static int property_get_current_memory( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + Unit *u = userdata; + uint64_t sz = (uint64_t) -1; + int r; + + assert(bus); + assert(reply); + assert(u); + + if (u->cgroup_path && + (u->cgroup_realized_mask & CGROUP_MEMORY)) { + _cleanup_free_ char *v = NULL; + + r = cg_get_attribute("memory", u->cgroup_path, "memory.usage_in_bytes", &v); + if (r < 0 && r != -ENOENT) + log_unit_warning_errno(u->id, r, "Couldn't read memory.usage_in_bytes attribute: %m"); + + if (v) { + r = safe_atou64(v, &sz); + if (r < 0) + log_unit_warning_errno(u->id, r, "Failed to parse memory.usage_in_bytes attribute: %m"); + } + } + + return sd_bus_message_append(reply, "t", sz); +} + const sd_bus_vtable bus_unit_cgroup_vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_PROPERTY("Slice", "s", property_get_slice, 0, 0), SD_BUS_PROPERTY("ControlGroup", "s", NULL, offsetof(Unit, cgroup_path), 0), + SD_BUS_PROPERTY("MemoryCurrent", "t", property_get_current_memory, 0, 0), SD_BUS_VTABLE_END }; @@ -862,6 +898,20 @@ static int bus_unit_set_transient_property( return 1; + } else if (streq(name, "DefaultDependencies")) { + int b; + + r = sd_bus_message_read(message, "b", &b); + if (r < 0) + return r; + + if (mode != UNIT_CHECK) { + u->default_dependencies = b; + unit_write_drop_in_format(u, mode, name, "[Unit]\nDefaultDependencies=%s\n", yes_no(b)); + } + + return 1; + } else if (streq(name, "Slice") && unit_get_cgroup_context(u)) { const char *s; diff --git a/src/core/device.c b/src/core/device.c index b254e45b3..d3deac393 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -382,7 +382,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) { * same /dev/disk/by-label/xxx link because they have * the same label. We want to make sure that the same * device that won the symlink wins in systemd, so we - * check the device node major/minor*/ + * check the device node major/minor */ if (stat(p, &st) >= 0) if ((!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode)) || st.st_rdev != udev_device_get_devnum(dev)) @@ -673,6 +673,19 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, return 0; } +static bool device_supported(Manager *m) { + static int read_only = -1; + assert(m); + + /* If /sys is read-only we don't support device units, and any + * attempts to start one should fail immediately. */ + + if (read_only < 0) + read_only = path_is_read_only_fs("/sys"); + + return read_only <= 0; +} + static const char* const device_state_table[_DEVICE_STATE_MAX] = { [DEVICE_DEAD] = "dead", [DEVICE_PLUGGED] = "plugged" @@ -708,6 +721,7 @@ const UnitVTable device_vtable = { .enumerate = device_enumerate, .shutdown = device_shutdown, + .supported = device_supported, .status_message_formats = { .starting_stopping = { diff --git a/src/core/execute.c b/src/core/execute.c index 5e4135e03..1815e3de2 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -37,11 +37,9 @@ #include #include #include -#include +#include #include #include -#include -#undef basename #ifdef HAVE_PAM #include @@ -84,7 +82,7 @@ #include "mkdir.h" #include "apparmor-util.h" #include "smack-util.h" -#include "bus-kernel.h" +#include "bus-endpoint.h" #include "label.h" #include "cap-list.h" @@ -130,7 +128,7 @@ static int shift_fds(int fds[], unsigned n_fds) { fds[i] = nfd; /* Hmm, the fd we wanted isn't free? Then - * let's remember that and try again from here*/ + * let's remember that and try again from here */ if (nfd != i+3 && restart_from < 0) restart_from = i; } @@ -219,12 +217,52 @@ static int open_null_as(int flags, int nfd) { return r; } -static int connect_logger_as(const ExecContext *context, ExecOutput output, const char *ident, const char *unit_id, int nfd) { - int fd, r; +static int connect_journal_socket(int fd, uid_t uid, gid_t gid) { union sockaddr_union sa = { .un.sun_family = AF_UNIX, .un.sun_path = "/run/systemd/journal/stdout", }; + uid_t olduid = UID_INVALID; + gid_t oldgid = GID_INVALID; + int r; + + if (gid != GID_INVALID) { + oldgid = getgid(); + + r = setegid(gid); + if (r < 0) + return -errno; + } + + if (uid != UID_INVALID) { + olduid = getuid(); + + r = seteuid(uid); + if (r < 0) { + r = -errno; + goto restore_gid; + } + } + + r = connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)); + if (r < 0) + r = -errno; + + /* If we fail to restore the uid or gid, things will likely + fail later on. This should only happen if an LSM interferes. */ + + if (uid != UID_INVALID) + (void) seteuid(olduid); + + restore_gid: + if (gid != GID_INVALID) + (void) setegid(oldgid); + + return r; +} + +static int connect_logger_as(const ExecContext *context, ExecOutput output, const char *ident, const char *unit_id, int nfd, uid_t uid, gid_t gid) { + int fd, r; assert(context); assert(output < _EXEC_OUTPUT_MAX); @@ -235,11 +273,9 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons if (fd < 0) return -errno; - r = connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)); - if (r < 0) { - safe_close(fd); - return -errno; - } + r = connect_journal_socket(fd, uid, gid); + if (r < 0) + return r; if (shutdown(fd, SHUT_RD) < 0) { safe_close(fd); @@ -358,7 +394,7 @@ static int setup_input(const ExecContext *context, int socket_fd, bool apply_tty } } -static int setup_output(const ExecContext *context, int fileno, int socket_fd, const char *ident, const char *unit_id, bool apply_tty_stdin) { +static int setup_output(const ExecContext *context, int fileno, int socket_fd, const char *ident, const char *unit_id, bool apply_tty_stdin, uid_t uid, gid_t gid) { ExecOutput o; ExecInput i; int r; @@ -425,10 +461,10 @@ static int setup_output(const ExecContext *context, int fileno, int socket_fd, c case EXEC_OUTPUT_KMSG_AND_CONSOLE: case EXEC_OUTPUT_JOURNAL: case EXEC_OUTPUT_JOURNAL_AND_CONSOLE: - r = connect_logger_as(context, o, ident, unit_id, fileno); + r = connect_logger_as(context, o, ident, unit_id, fileno, uid, gid); if (r < 0) { log_unit_struct(unit_id, - LOG_CRIT, + LOG_ERR, LOG_MESSAGE("Failed to connect %s of %s to the journal socket: %s", fileno == STDOUT_FILENO ? "stdout" : "stderr", unit_id, strerror(-r)), @@ -759,7 +795,7 @@ static int setup_pam( * daemon. We do things this way to ensure that the main PID * of the daemon is the one we initially fork()ed. */ - if (log_get_max_level() < LOG_PRI(LOG_DEBUG)) + if (log_get_max_level() < LOG_DEBUG) flags |= PAM_SILENT; pam_code = pam_start(name, user, &conv, &handle); @@ -1228,15 +1264,16 @@ static int build_environment( return 0; } -static int exec_child(ExecCommand *command, - const ExecContext *context, - const ExecParameters *params, - ExecRuntime *runtime, - char **argv, - int socket_fd, - int *fds, unsigned n_fds, - char **files_env, - int *error) { +static int exec_child( + ExecCommand *command, + const ExecContext *context, + const ExecParameters *params, + ExecRuntime *runtime, + char **argv, + int socket_fd, + int *fds, unsigned n_fds, + char **files_env, + int *exit_status) { _cleanup_strv_free_ char **our_env = NULL, **pam_env = NULL, **final_env = NULL, **final_argv = NULL; _cleanup_free_ char *mac_selinux_context_net = NULL; @@ -1245,12 +1282,12 @@ static int exec_child(ExecCommand *command, int dont_close[n_fds + 4]; uid_t uid = UID_INVALID; gid_t gid = GID_INVALID; - int i, err; + int i, r; assert(command); assert(context); assert(params); - assert(error); + assert(exit_status); rename_process_from_path(command->path); @@ -1265,10 +1302,10 @@ static int exec_child(ExecCommand *command, if (context->ignore_sigpipe) ignore_signals(SIGPIPE, -1); - err = reset_signal_mask(); - if (err < 0) { - *error = EXIT_SIGNAL_MASK; - return err; + r = reset_signal_mask(); + if (r < 0) { + *exit_status = EXIT_SIGNAL_MASK; + return r; } if (params->idle_pipe) @@ -1277,6 +1314,7 @@ static int exec_child(ExecCommand *command, /* Close sockets very early to make sure we don't * block init reexecution because it cannot bind its * sockets */ + log_forget_fds(); if (socket_fd >= 0) @@ -1294,15 +1332,15 @@ static int exec_child(ExecCommand *command, dont_close[n_dont_close++] = runtime->netns_storage_socket[1]; } - err = close_all_fds(dont_close, n_dont_close); - if (err < 0) { - *error = EXIT_FDS; - return err; + r = close_all_fds(dont_close, n_dont_close); + if (r < 0) { + *exit_status = EXIT_FDS; + return r; } if (!context->same_pgrp) if (setsid() < 0) { - *error = EXIT_SETSID; + *exit_status = EXIT_SETSID; return -errno; } @@ -1311,68 +1349,85 @@ static int exec_child(ExecCommand *command, if (params->confirm_spawn) { char response; - err = ask_for_confirmation(&response, argv); - if (err == -ETIMEDOUT) + r = ask_for_confirmation(&response, argv); + if (r == -ETIMEDOUT) write_confirm_message("Confirmation question timed out, assuming positive response.\n"); - else if (err < 0) - write_confirm_message("Couldn't ask confirmation question, assuming positive response: %s\n", strerror(-err)); + else if (r < 0) + write_confirm_message("Couldn't ask confirmation question, assuming positive response: %s\n", strerror(-r)); else if (response == 's') { write_confirm_message("Skipping execution.\n"); - *error = EXIT_CONFIRM; + *exit_status = EXIT_CONFIRM; return -ECANCELED; } else if (response == 'n') { write_confirm_message("Failing execution.\n"); - *error = 0; + *exit_status = 0; return 0; } } + if (context->user) { + username = context->user; + r = get_user_creds(&username, &uid, &gid, &home, &shell); + if (r < 0) { + *exit_status = EXIT_USER; + return r; + } + } + /* If a socket is connected to STDIN/STDOUT/STDERR, we * must sure to drop O_NONBLOCK */ if (socket_fd >= 0) fd_nonblock(socket_fd, false); - err = setup_input(context, socket_fd, params->apply_tty_stdin); - if (err < 0) { - *error = EXIT_STDIN; - return err; + r = setup_input(context, socket_fd, params->apply_tty_stdin); + if (r < 0) { + *exit_status = EXIT_STDIN; + return r; } - err = setup_output(context, STDOUT_FILENO, socket_fd, basename(command->path), params->unit_id, params->apply_tty_stdin); - if (err < 0) { - *error = EXIT_STDOUT; - return err; + r = setup_output(context, STDOUT_FILENO, socket_fd, basename(command->path), params->unit_id, params->apply_tty_stdin, uid, gid); + if (r < 0) { + *exit_status = EXIT_STDOUT; + return r; } - err = setup_output(context, STDERR_FILENO, socket_fd, basename(command->path), params->unit_id, params->apply_tty_stdin); - if (err < 0) { - *error = EXIT_STDERR; - return err; + r = setup_output(context, STDERR_FILENO, socket_fd, basename(command->path), params->unit_id, params->apply_tty_stdin, uid, gid); + if (r < 0) { + *exit_status = EXIT_STDERR; + return r; } if (params->cgroup_path) { - err = cg_attach_everywhere(params->cgroup_supported, params->cgroup_path, 0, NULL, NULL); - if (err < 0) { - *error = EXIT_CGROUP; - return err; + r = cg_attach_everywhere(params->cgroup_supported, params->cgroup_path, 0, NULL, NULL); + if (r < 0) { + *exit_status = EXIT_CGROUP; + return r; } } if (context->oom_score_adjust_set) { - char t[16]; + char t[DECIMAL_STR_MAX(context->oom_score_adjust)]; - snprintf(t, sizeof(t), "%i", context->oom_score_adjust); - char_array_0(t); + /* When we can't make this change due to EPERM, then + * let's silently skip over it. User namespaces + * prohibit write access to this file, and we + * shouldn't trip up over that. */ - if (write_string_file("/proc/self/oom_score_adj", t) < 0) { - *error = EXIT_OOM_ADJUST; + sprintf(t, "%i", context->oom_score_adjust); + r = write_string_file("/proc/self/oom_score_adj", t); + if (r == -EPERM || r == -EACCES) { + log_open(); + log_unit_debug_errno(params->unit_id, r, "Failed to adjust OOM setting, assuming containerized execution, ignoring: %m"); + log_close(); + } else if (r < 0) { + *exit_status = EXIT_OOM_ADJUST; return -errno; } } if (context->nice_set) if (setpriority(PRIO_PROCESS, 0, context->nice) < 0) { - *error = EXIT_NICE; + *exit_status = EXIT_NICE; return -errno; } @@ -1381,58 +1436,49 @@ static int exec_child(ExecCommand *command, .sched_priority = context->cpu_sched_priority, }; - err = sched_setscheduler(0, - context->cpu_sched_policy | - (context->cpu_sched_reset_on_fork ? - SCHED_RESET_ON_FORK : 0), - ¶m); - if (err < 0) { - *error = EXIT_SETSCHEDULER; + r = sched_setscheduler(0, + context->cpu_sched_policy | + (context->cpu_sched_reset_on_fork ? + SCHED_RESET_ON_FORK : 0), + ¶m); + if (r < 0) { + *exit_status = EXIT_SETSCHEDULER; return -errno; } } if (context->cpuset) if (sched_setaffinity(0, CPU_ALLOC_SIZE(context->cpuset_ncpus), context->cpuset) < 0) { - *error = EXIT_CPUAFFINITY; + *exit_status = EXIT_CPUAFFINITY; return -errno; } if (context->ioprio_set) if (ioprio_set(IOPRIO_WHO_PROCESS, 0, context->ioprio) < 0) { - *error = EXIT_IOPRIO; + *exit_status = EXIT_IOPRIO; return -errno; } if (context->timer_slack_nsec != NSEC_INFINITY) if (prctl(PR_SET_TIMERSLACK, context->timer_slack_nsec) < 0) { - *error = EXIT_TIMERSLACK; + *exit_status = EXIT_TIMERSLACK; return -errno; } if (context->personality != 0xffffffffUL) if (personality(context->personality) < 0) { - *error = EXIT_PERSONALITY; + *exit_status = EXIT_PERSONALITY; return -errno; } if (context->utmp_id) utmp_put_init_process(context->utmp_id, getpid(), getsid(0), context->tty_path); - if (context->user) { - username = context->user; - err = get_user_creds(&username, &uid, &gid, &home, &shell); - if (err < 0) { - *error = EXIT_USER; - return err; - } - - if (is_terminal_input(context->std_input)) { - err = chown_terminal(STDIN_FILENO, uid); - if (err < 0) { - *error = EXIT_STDIN; - return err; - } + if (context->user && is_terminal_input(context->std_input)) { + r = chown_terminal(STDIN_FILENO, uid); + if (r < 0) { + *exit_status = EXIT_STDIN; + return r; } } @@ -1440,10 +1486,10 @@ static int exec_child(ExecCommand *command, if (params->bus_endpoint_fd >= 0 && context->bus_endpoint) { uid_t ep_uid = (uid == UID_INVALID) ? 0 : uid; - err = bus_kernel_set_endpoint_policy(params->bus_endpoint_fd, ep_uid, context->bus_endpoint); - if (err < 0) { - *error = EXIT_BUS_ENDPOINT; - return err; + r = bus_kernel_set_endpoint_policy(params->bus_endpoint_fd, ep_uid, context->bus_endpoint); + if (r < 0) { + *exit_status = EXIT_BUS_ENDPOINT; + return r; } } #endif @@ -1452,17 +1498,17 @@ static int exec_child(ExecCommand *command, * (but only in systemd's own controller hierarchy!) to the * user of the new process. */ if (params->cgroup_path && context->user && params->cgroup_delegate) { - err = cg_set_task_access(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, 0644, uid, gid); - if (err < 0) { - *error = EXIT_CGROUP; - return err; + r = cg_set_task_access(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, 0644, uid, gid); + if (r < 0) { + *exit_status = EXIT_CGROUP; + return r; } - err = cg_set_group_access(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, 0755, uid, gid); - if (err < 0) { - *error = EXIT_CGROUP; - return err; + r = cg_set_group_access(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, 0755, uid, gid); + if (r < 0) { + *exit_status = EXIT_CGROUP; + return r; } } @@ -1474,23 +1520,23 @@ static int exec_child(ExecCommand *command, p = strjoin(params->runtime_prefix, "/", *rt, NULL); if (!p) { - *error = EXIT_RUNTIME_DIRECTORY; + *exit_status = EXIT_RUNTIME_DIRECTORY; return -ENOMEM; } - err = mkdir_safe(p, context->runtime_directory_mode, uid, gid); - if (err < 0) { - *error = EXIT_RUNTIME_DIRECTORY; - return err; + r = mkdir_safe_label(p, context->runtime_directory_mode, uid, gid); + if (r < 0) { + *exit_status = EXIT_RUNTIME_DIRECTORY; + return r; } } } if (params->apply_permissions) { - err = enforce_groups(context, username, gid); - if (err < 0) { - *error = EXIT_GROUP; - return err; + r = enforce_groups(context, username, gid); + if (r < 0) { + *exit_status = EXIT_GROUP; + return r; } } @@ -1498,19 +1544,19 @@ static int exec_child(ExecCommand *command, #ifdef HAVE_PAM if (params->apply_permissions && context->pam_name && username) { - err = setup_pam(context->pam_name, username, uid, context->tty_path, &pam_env, fds, n_fds); - if (err < 0) { - *error = EXIT_PAM; - return err; + r = setup_pam(context->pam_name, username, uid, context->tty_path, &pam_env, fds, n_fds); + if (r < 0) { + *exit_status = EXIT_PAM; + return r; } } #endif if (context->private_network && runtime && runtime->netns_storage_socket[0] >= 0) { - err = setup_netns(runtime->netns_storage_socket); - if (err < 0) { - *error = EXIT_NETWORK; - return err; + r = setup_netns(runtime->netns_storage_socket); + if (r < 0) { + *exit_status = EXIT_NETWORK; + return r; } } @@ -1534,12 +1580,12 @@ static int exec_child(ExecCommand *command, if (context->private_tmp && runtime) { if (runtime->tmp_dir) - tmp = strappenda(runtime->tmp_dir, "/tmp"); + tmp = strjoina(runtime->tmp_dir, "/tmp"); if (runtime->var_tmp_dir) - var = strappenda(runtime->var_tmp_dir, "/tmp"); + var = strjoina(runtime->var_tmp_dir, "/tmp"); } - err = setup_namespace( + r = setup_namespace( context->read_write_dirs, context->read_only_dirs, context->inaccessible_dirs, @@ -1551,47 +1597,54 @@ static int exec_child(ExecCommand *command, context->protect_system, context->mount_flags); - if (err == -EPERM) - log_unit_warning_errno(params->unit_id, err, "Failed to set up file system namespace due to lack of privileges. Execution sandbox will not be in effect: %m"); - else if (err < 0) { - *error = EXIT_NAMESPACE; - return err; + /* If we couldn't set up the namespace this is + * probably due to a missing capability. In this case, + * silently proceeed. */ + if (r == -EPERM || r == -EACCES) { + log_open(); + log_unit_debug_errno(params->unit_id, r, "Failed to set up namespace, assuming containerized execution, ignoring: %m"); + log_close(); + } else if (r < 0) { + *exit_status = EXIT_NAMESPACE; + return r; } } if (params->apply_chroot) { if (context->root_directory) if (chroot(context->root_directory) < 0) { - *error = EXIT_CHROOT; + *exit_status = EXIT_CHROOT; return -errno; } - if (chdir(context->working_directory ? context->working_directory : "/") < 0) { - *error = EXIT_CHDIR; + if (chdir(context->working_directory ?: "/") < 0 && + !context->working_directory_missing_ok) { + *exit_status = EXIT_CHDIR; return -errno; } } else { _cleanup_free_ char *d = NULL; if (asprintf(&d, "%s/%s", - context->root_directory ? context->root_directory : "", - context->working_directory ? context->working_directory : "") < 0) { - *error = EXIT_MEMORY; + context->root_directory ?: "", + context->working_directory ?: "") < 0) { + *exit_status = EXIT_MEMORY; return -ENOMEM; } - if (chdir(d) < 0) { - *error = EXIT_CHDIR; + if (chdir(d) < 0 && + !context->working_directory_missing_ok) { + *exit_status = EXIT_CHDIR; return -errno; } } #ifdef HAVE_SELINUX if (params->apply_permissions && mac_selinux_use() && params->selinux_context_net && socket_fd >= 0) { - err = mac_selinux_get_child_mls_label(socket_fd, command->path, context->selinux_context, &mac_selinux_context_net); - if (err < 0) { - *error = EXIT_SELINUX_CONTEXT; - return err; + r = mac_selinux_get_child_mls_label(socket_fd, command->path, context->selinux_context, &mac_selinux_context_net); + if (r < 0) { + *exit_status = EXIT_SELINUX_CONTEXT; + return r; } } #endif @@ -1602,14 +1655,14 @@ static int exec_child(ExecCommand *command, * and the netns fds we don't need anymore. The custom * endpoint fd was needed to upload the policy and can * now be closed as well. */ - err = close_all_fds(fds, n_fds); - if (err >= 0) - err = shift_fds(fds, n_fds); - if (err >= 0) - err = flags_fds(fds, n_fds, context->non_blocking); - if (err < 0) { - *error = EXIT_FDS; - return err; + r = close_all_fds(fds, n_fds); + if (r >= 0) + r = shift_fds(fds, n_fds); + if (r >= 0) + r = flags_fds(fds, n_fds, context->non_blocking); + if (r < 0) { + *exit_status = EXIT_FDS; + return r; } if (params->apply_permissions) { @@ -1619,34 +1672,34 @@ static int exec_child(ExecCommand *command, continue; if (setrlimit_closest(i, context->rlimit[i]) < 0) { - *error = EXIT_LIMITS; + *exit_status = EXIT_LIMITS; return -errno; } } if (context->capability_bounding_set_drop) { - err = capability_bounding_set_drop(context->capability_bounding_set_drop, false); - if (err < 0) { - *error = EXIT_CAPABILITIES; - return err; + r = capability_bounding_set_drop(context->capability_bounding_set_drop, false); + if (r < 0) { + *exit_status = EXIT_CAPABILITIES; + return r; } } #ifdef HAVE_SMACK if (context->smack_process_label) { - err = mac_smack_apply_pid(0, context->smack_process_label); - if (err < 0) { - *error = EXIT_SMACK_PROCESS_LABEL; - return err; + r = mac_smack_apply_pid(0, context->smack_process_label); + if (r < 0) { + *exit_status = EXIT_SMACK_PROCESS_LABEL; + return r; } } #endif if (context->user) { - err = enforce_user(context, uid); - if (err < 0) { - *error = EXIT_USER; - return err; + r = enforce_user(context, uid); + if (r < 0) { + *exit_status = EXIT_USER; + return r; } } @@ -1656,39 +1709,39 @@ static int exec_child(ExecCommand *command, * PR_SET_SECUREBITS unless necessary. */ if (prctl(PR_GET_SECUREBITS) != context->secure_bits) if (prctl(PR_SET_SECUREBITS, context->secure_bits) < 0) { - *error = EXIT_SECUREBITS; + *exit_status = EXIT_SECUREBITS; return -errno; } if (context->capabilities) if (cap_set_proc(context->capabilities) < 0) { - *error = EXIT_CAPABILITIES; + *exit_status = EXIT_CAPABILITIES; return -errno; } if (context->no_new_privileges) if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) { - *error = EXIT_NO_NEW_PRIVILEGES; + *exit_status = EXIT_NO_NEW_PRIVILEGES; return -errno; } #ifdef HAVE_SECCOMP if (context->address_families_whitelist || !set_isempty(context->address_families)) { - err = apply_address_families(context); - if (err < 0) { - *error = EXIT_ADDRESS_FAMILIES; - return err; + r = apply_address_families(context); + if (r < 0) { + *exit_status = EXIT_ADDRESS_FAMILIES; + return r; } } if (context->syscall_whitelist || !set_isempty(context->syscall_filter) || !set_isempty(context->syscall_archs)) { - err = apply_seccomp(context); - if (err < 0) { - *error = EXIT_SECCOMP; - return err; + r = apply_seccomp(context); + if (r < 0) { + *exit_status = EXIT_SECCOMP; + return r; } } #endif @@ -1698,10 +1751,10 @@ static int exec_child(ExecCommand *command, char *exec_context = mac_selinux_context_net ?: context->selinux_context; if (exec_context) { - err = setexeccon(exec_context); - if (err < 0) { - *error = EXIT_SELINUX_CONTEXT; - return err; + r = setexeccon(exec_context); + if (r < 0) { + *exit_status = EXIT_SELINUX_CONTEXT; + return r; } } } @@ -1709,19 +1762,19 @@ static int exec_child(ExecCommand *command, #ifdef HAVE_APPARMOR if (context->apparmor_profile && mac_apparmor_use()) { - err = aa_change_onexec(context->apparmor_profile); - if (err < 0 && !context->apparmor_profile_ignore) { - *error = EXIT_APPARMOR_PROFILE; + r = aa_change_onexec(context->apparmor_profile); + if (r < 0 && !context->apparmor_profile_ignore) { + *exit_status = EXIT_APPARMOR_PROFILE; return -errno; } } #endif } - err = build_environment(context, n_fds, params->watchdog_usec, home, username, shell, &our_env); - if (err < 0) { - *error = EXIT_MEMORY; - return err; + r = build_environment(context, n_fds, params->watchdog_usec, home, username, shell, &our_env); + if (r < 0) { + *exit_status = EXIT_MEMORY; + return r; } final_env = strv_env_merge(5, @@ -1732,19 +1785,19 @@ static int exec_child(ExecCommand *command, pam_env, NULL); if (!final_env) { - *error = EXIT_MEMORY; + *exit_status = EXIT_MEMORY; return -ENOMEM; } final_argv = replace_env_argv(argv, final_env); if (!final_argv) { - *error = EXIT_MEMORY; + *exit_status = EXIT_MEMORY; return -ENOMEM; } final_env = strv_env_clean(final_env); - if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) { + if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) { _cleanup_free_ char *line; line = exec_command_line(final_argv); @@ -1759,7 +1812,7 @@ static int exec_child(ExecCommand *command, } } execve(command->path, final_argv, final_env); - *error = EXIT_EXEC; + *exit_status = EXIT_EXEC; return -errno; } @@ -1771,10 +1824,10 @@ int exec_spawn(ExecCommand *command, _cleanup_strv_free_ char **files_env = NULL; int *fds = NULL; unsigned n_fds = 0; - char *line, **argv; - int socket_fd; + _cleanup_free_ char *line = NULL; + int socket_fd, r; + char **argv; pid_t pid; - int err; assert(command); assert(context); @@ -1786,8 +1839,10 @@ int exec_spawn(ExecCommand *command, context->std_output == EXEC_OUTPUT_SOCKET || context->std_error == EXEC_OUTPUT_SOCKET) { - if (params->n_fds != 1) + if (params->n_fds != 1) { + log_unit_error(params->unit_id, "Got more than one socket."); return -EINVAL; + } socket_fd = params->fds[0]; } else { @@ -1796,18 +1851,11 @@ int exec_spawn(ExecCommand *command, n_fds = params->n_fds; } - err = exec_context_load_environment(context, params->unit_id, &files_env); - if (err < 0) { - log_unit_struct(params->unit_id, - LOG_ERR, - LOG_MESSAGE("Failed to load environment files: %s", strerror(-err)), - LOG_ERRNO(-err), - NULL); - return err; - } + r = exec_context_load_environment(context, params->unit_id, &files_env); + if (r < 0) + return log_unit_error_errno(params->unit_id, r, "Failed to load environment files: %m"); argv = params->argv ?: command->argv; - line = exec_command_line(argv); if (!line) return log_oom(); @@ -1817,45 +1865,39 @@ int exec_spawn(ExecCommand *command, "EXECUTABLE=%s", command->path, LOG_MESSAGE("About to execute: %s", line), NULL); - free(line); - pid = fork(); if (pid < 0) - return -errno; + return log_unit_error_errno(params->unit_id, r, "Failed to fork: %m"); if (pid == 0) { - int r; - - err = exec_child(command, - context, - params, - runtime, - argv, - socket_fd, - fds, n_fds, - files_env, - &r); - if (r != 0) { + int exit_status; + + r = exec_child(command, + context, + params, + runtime, + argv, + socket_fd, + fds, n_fds, + files_env, + &exit_status); + if (r < 0) { log_open(); - log_struct(LOG_ERR, - LOG_MESSAGE_ID(SD_MESSAGE_SPAWN_FAILED), - "EXECUTABLE=%s", command->path, - LOG_MESSAGE("Failed at step %s spawning %s: %s", - exit_status_to_string(r, EXIT_STATUS_SYSTEMD), - command->path, strerror(-err)), - LOG_ERRNO(-err), - NULL); - log_close(); + log_unit_struct(params->unit_id, + LOG_ERR, + LOG_MESSAGE_ID(SD_MESSAGE_SPAWN_FAILED), + "EXECUTABLE=%s", command->path, + LOG_MESSAGE("Failed at step %s spawning %s: %s", + exit_status_to_string(exit_status, EXIT_STATUS_SYSTEMD), + command->path, strerror(-r)), + LOG_ERRNO(r), + NULL); } - _exit(r); + _exit(exit_status); } - log_unit_struct(params->unit_id, - LOG_DEBUG, - LOG_MESSAGE("Forked %s as "PID_FMT, - command->path, pid), - NULL); + log_unit_debug(params->unit_id, "Forked %s as "PID_FMT, command->path, pid); /* We add the new process to the cgroup both in the child (so * that we can be sure that no user code is ever executed @@ -1984,7 +2026,7 @@ int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_p /* We execute this synchronously, since we need to be * sure this is gone when we start the service * next. */ - rm_rf_dangerous(p, false, true, false); + rm_rf(p, false, true, false); } return 0; @@ -2007,7 +2049,7 @@ void exec_command_done_array(ExecCommand *c, unsigned n) { exec_command_done(c+i); } -void exec_command_free_list(ExecCommand *c) { +ExecCommand* exec_command_free_list(ExecCommand *c) { ExecCommand *i; while ((i = c)) { @@ -2015,15 +2057,26 @@ void exec_command_free_list(ExecCommand *c) { exec_command_done(i); free(i); } + + return NULL; } void exec_command_free_array(ExecCommand **c, unsigned n) { unsigned i; - for (i = 0; i < n; i++) { - exec_command_free_list(c[i]); - c[i] = NULL; - } + for (i = 0; i < n; i++) + c[i] = exec_command_free_list(c[i]); +} + +typedef struct InvalidEnvInfo { + const char *unit_id; + const char *path; +} InvalidEnvInfo; + +static void invalid_env(const char *p, void *userdata) { + InvalidEnvInfo *info = userdata; + + log_unit_error(info->unit_id, "Ignoring invalid environment assignment '%s': %s", p, info->path); } int exec_context_load_environment(const ExecContext *c, const char *unit_id, char ***l) { @@ -2082,8 +2135,14 @@ int exec_context_load_environment(const ExecContext *c, const char *unit_id, cha return k; } /* Log invalid environment variables with filename */ - if (p) - p = strv_env_clean_log(p, unit_id, pglob.gl_pathv[n]); + if (p) { + InvalidEnvInfo info = { + .unit_id = unit_id, + .path = pglob.gl_pathv[n] + }; + + p = strv_env_clean_with_callback(p, invalid_env, &info); + } if (r == NULL) r = p; @@ -2529,7 +2588,7 @@ void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix) { assert(f); prefix = strempty(prefix); - prefix2 = strappenda(prefix, "\t"); + prefix2 = strjoina(prefix, "\t"); cmd = exec_command_line(c->argv); fprintf(f, diff --git a/src/core/execute.h b/src/core/execute.h index 5ed750534..6e0c9faa7 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -99,6 +99,7 @@ struct ExecContext { struct rlimit *rlimit[_RLIMIT_MAX]; char *working_directory, *root_directory; + bool working_directory_missing_ok; mode_t umask; int oom_score_adjust; @@ -198,6 +199,7 @@ struct ExecContext { }; #include "cgroup.h" +#include "cgroup-util.h" struct ExecParameters { char **argv; @@ -228,7 +230,7 @@ int exec_spawn(ExecCommand *command, void exec_command_done(ExecCommand *c); void exec_command_done_array(ExecCommand *c, unsigned n); -void exec_command_free_list(ExecCommand *c); +ExecCommand* exec_command_free_list(ExecCommand *c); void exec_command_free_array(ExecCommand **c, unsigned n); char *exec_command_line(char **argv); diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c index 8e4fed17e..0e0d16a7c 100644 --- a/src/core/ima-setup.c +++ b/src/core/ima-setup.c @@ -66,7 +66,7 @@ int ima_setup(void) { return 0; } - r = copy_bytes(policyfd, imafd, -1); + r = copy_bytes(policyfd, imafd, (off_t) -1, false); if (r < 0) log_error_errno(r, "Failed to load the IMA custom policy file "IMA_POLICY_PATH": %m"); else diff --git a/src/core/job.c b/src/core/job.c index 78bc1083d..4740ff18c 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -96,11 +96,39 @@ void job_free(Job *j) { free(j); } +static void job_set_state(Job *j, JobState state) { + assert(j); + assert(state >= 0); + assert(state < _JOB_STATE_MAX); + + if (j->state == state) + return; + + j->state = state; + + if (!j->installed) + return; + + if (j->state == JOB_RUNNING) + j->unit->manager->n_running_jobs++; + else { + assert(j->state == JOB_WAITING); + assert(j->unit->manager->n_running_jobs > 0); + + j->unit->manager->n_running_jobs--; + + if (j->unit->manager->n_running_jobs <= 0) + j->unit->manager->jobs_in_progress_event_source = sd_event_source_unref(j->unit->manager->jobs_in_progress_event_source); + } +} + void job_uninstall(Job *j) { Job **pj; assert(j->installed); + job_set_state(j, JOB_WAITING); + pj = (j->type == JOB_NOP) ? &j->unit->nop_job : &j->unit->job; assert(*pj == j); @@ -155,6 +183,7 @@ Job* job_install(Job *j) { assert(!j->installed); assert(j->type < _JOB_TYPE_MAX_IN_TRANSACTION); + assert(j->state == JOB_WAITING); pj = (j->type == JOB_NOP) ? &j->unit->nop_job : &j->unit->job; uj = *pj; @@ -181,8 +210,8 @@ Job* job_install(Job *j) { log_unit_debug(uj->unit->id, "Merged into running job, re-running: %s/%s as %u", uj->unit->id, job_type_to_string(uj->type), (unsigned) uj->id); - uj->state = JOB_WAITING; - uj->manager->n_running_jobs--; + + job_set_state(uj, JOB_WAITING); return uj; } } @@ -191,6 +220,7 @@ Job* job_install(Job *j) { /* Install the job */ *pj = j; j->installed = true; + j->manager->n_installed_jobs ++; log_unit_debug(j->unit->id, "Installed new job %s/%s as %u", @@ -209,15 +239,17 @@ int job_install_deserialized(Job *j) { } pj = (j->type == JOB_NOP) ? &j->unit->nop_job : &j->unit->job; - if (*pj) { - log_unit_debug(j->unit->id, - "Unit %s already has a job installed. Not installing deserialized job.", - j->unit->id); + log_unit_debug(j->unit->id, "Unit %s already has a job installed. Not installing deserialized job.", j->unit->id); return -EEXIST; } + *pj = j; j->installed = true; + + if (j->state == JOB_RUNNING) + j->unit->manager->n_running_jobs++; + log_unit_debug(j->unit->id, "Reinstalled deserialized job %s/%s as %u", j->unit->id, job_type_to_string(j->type), (unsigned) j->id); @@ -484,8 +516,7 @@ int job_run_and_invalidate(Job *j) { if (!job_is_runnable(j)) return -EAGAIN; - j->state = JOB_RUNNING; - m->n_running_jobs++; + job_set_state(j, JOB_RUNNING); job_add_to_dbus_queue(j); /* While we execute this operation the job might go away (for @@ -547,10 +578,11 @@ int job_run_and_invalidate(Job *j) { r = job_finish_and_invalidate(j, JOB_INVALID, true); else if (r == -EPROTO) r = job_finish_and_invalidate(j, JOB_ASSERT, true); - else if (r == -EAGAIN) { - j->state = JOB_WAITING; - m->n_running_jobs--; - } else if (r < 0) + else if (r == -ENOTSUP) + r = job_finish_and_invalidate(j, JOB_UNSUPPORTED, true); + else if (r == -EAGAIN) + job_set_state(j, JOB_WAITING); + else if (r < 0) r = job_finish_and_invalidate(j, JOB_FAILED, true); } @@ -591,12 +623,16 @@ _pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobT if (t == JOB_START) { if (result == JOB_DONE) return "Started %s."; + else if (result == JOB_TIMEOUT) + return "Timed out starting %s."; else if (result == JOB_FAILED) return "Failed to start %s."; else if (result == JOB_DEPENDENCY) return "Dependency failed for %s."; - else if (result == JOB_TIMEOUT) - return "Timed out starting %s."; + else if (result == JOB_ASSERT) + return "Assertion failed for %s."; + else if (result == JOB_UNSUPPORTED) + return "Starting of %s not supported."; } else if (t == JOB_STOP || t == JOB_RESTART) { if (result == JOB_DONE) return "Stopped %s."; @@ -637,6 +673,11 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) { unit_status_printf(u, ANSI_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, format); break; + case JOB_TIMEOUT: + manager_flip_auto_status(u->manager, true); + unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON " TIME " ANSI_HIGHLIGHT_OFF, format); + break; + case JOB_FAILED: { bool quotes; @@ -655,14 +696,14 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) { unit_status_printf(u, ANSI_HIGHLIGHT_YELLOW_ON "DEPEND" ANSI_HIGHLIGHT_OFF, format); break; - case JOB_TIMEOUT: + case JOB_ASSERT: manager_flip_auto_status(u->manager, true); - unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON " TIME " ANSI_HIGHLIGHT_OFF, format); + unit_status_printf(u, ANSI_HIGHLIGHT_YELLOW_ON "ASSERT" ANSI_HIGHLIGHT_OFF, format); break; - case JOB_ASSERT: + case JOB_UNSUPPORTED: manager_flip_auto_status(u->manager, true); - unit_status_printf(u, ANSI_HIGHLIGHT_YELLOW_ON "ASSERT" ANSI_HIGHLIGHT_OFF, format); + unit_status_printf(u, ANSI_HIGHLIGHT_YELLOW_ON "UNSUPP" ANSI_HIGHLIGHT_OFF, format); break; default: @@ -723,7 +764,6 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) { DISABLE_WARNING_FORMAT_NONLITERAL; snprintf(buf, sizeof(buf), format, unit_description(u)); - char_array_0(buf); REENABLE_WARNING; if (t == JOB_START) { @@ -769,9 +809,6 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) { j->result = result; - if (j->state == JOB_RUNNING) - j->manager->n_running_jobs--; - log_unit_debug(u->id, "Job %s/%s finished, result=%s", u->id, job_type_to_string(t), job_result_to_string(result)); @@ -784,7 +821,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) { if (result == JOB_DONE && t == JOB_RESTART) { job_change_type(j, JOB_START); - j->state = JOB_WAITING; + job_set_state(j, JOB_WAITING); job_add_to_run_queue(j); @@ -1016,7 +1053,7 @@ int job_deserialize(Job *j, FILE *f, FDSet *fds) { if (s < 0) log_debug("Failed to parse job state %s", v); else - j->state = s; + job_set_state(j, s); } else if (streq(l, "job-override")) { int b; @@ -1200,6 +1237,7 @@ static const char* const job_result_table[_JOB_RESULT_MAX] = { [JOB_SKIPPED] = "skipped", [JOB_INVALID] = "invalid", [JOB_ASSERT] = "assert", + [JOB_UNSUPPORTED] = "unsupported", }; DEFINE_STRING_TABLE_LOOKUP(job_result, JobResult); diff --git a/src/core/job.h b/src/core/job.h index 223ff9cba..d967b68a3 100644 --- a/src/core/job.h +++ b/src/core/job.h @@ -96,12 +96,13 @@ enum JobMode { enum JobResult { JOB_DONE, /* Job completed successfully */ JOB_CANCELED, /* Job canceled by a conflicting job installation or by explicit cancel request */ - JOB_TIMEOUT, /* JobTimeout elapsed */ + JOB_TIMEOUT, /* Job timeout elapsed */ JOB_FAILED, /* Job failed */ JOB_DEPENDENCY, /* A required dependency job did not result in JOB_DONE */ JOB_SKIPPED, /* Negative result of JOB_VERIFY_ACTIVE */ JOB_INVALID, /* JOB_RELOAD of inactive unit */ JOB_ASSERT, /* Couldn't start a unit, because an assert didn't hold */ + JOB_UNSUPPORTED, /* Couldn't start a unit, because the unit type is not supported on the system */ _JOB_RESULT_MAX, _JOB_RESULT_INVALID = -1 }; diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c index 8afaf45fe..8be190040 100644 --- a/src/core/load-dropin.c +++ b/src/core/load-dropin.c @@ -31,137 +31,27 @@ #include "load-fragment.h" #include "conf-files.h" -static int iterate_dir( - Unit *u, - const char *path, +static int add_dependency_consumer( UnitDependency dependency, - char ***strv) { - - _cleanup_closedir_ DIR *d = NULL; + const char *entry, + const char* filepath, + void *arg) { + Unit *u = arg; int r; assert(u); - assert(path); - - /* The config directories are special, since the order of the - * drop-ins matters */ - if (dependency < 0) { - r = strv_extend(strv, path); - if (r < 0) - return log_oom(); - - return 0; - } - - d = opendir(path); - if (!d) { - if (errno == ENOENT) - return 0; - - log_error_errno(errno, "Failed to open directory %s: %m", path); - return -errno; - } - - for (;;) { - struct dirent *de; - _cleanup_free_ char *f = NULL; - - errno = 0; - de = readdir(d); - if (!de && errno != 0) - return log_error_errno(errno, "Failed to read directory %s: %m", path); - - if (!de) - break; - - if (ignore_file(de->d_name)) - continue; - f = strjoin(path, "/", de->d_name, NULL); - if (!f) - return log_oom(); - - r = unit_add_dependency_by_name(u, dependency, de->d_name, f, true); - if (r < 0) - log_error_errno(r, "Cannot add dependency %s to %s, ignoring: %m", de->d_name, u->id); - } + r = unit_add_dependency_by_name(u, dependency, entry, filepath, true); + if (r < 0) + log_error_errno(r, "Cannot add dependency %s to %s, ignoring: %m", entry, u->id); return 0; } -static int process_dir( - Unit *u, - const char *unit_path, - const char *name, - const char *suffix, - UnitDependency dependency, - char ***strv) { - - _cleanup_free_ char *path = NULL; - - assert(u); - assert(unit_path); - assert(name); - assert(suffix); - - path = strjoin(unit_path, "/", name, suffix, NULL); - if (!path) - return log_oom(); - - if (!u->manager->unit_path_cache || set_get(u->manager->unit_path_cache, path)) - iterate_dir(u, path, dependency, strv); - - if (u->instance) { - _cleanup_free_ char *template = NULL, *p = NULL; - /* Also try the template dir */ - - template = unit_name_template(name); - if (!template) - return log_oom(); - - p = strjoin(unit_path, "/", template, suffix, NULL); - if (!p) - return log_oom(); - - if (!u->manager->unit_path_cache || set_get(u->manager->unit_path_cache, p)) - iterate_dir(u, p, dependency, strv); - } - - return 0; -} - -char **unit_find_dropin_paths(Unit *u) { - _cleanup_strv_free_ char **strv = NULL; - char **configs = NULL; - Iterator i; - char *t; - int r; - - assert(u); - - SET_FOREACH(t, u->names, i) { - char **p; - - STRV_FOREACH(p, u->manager->lookup_paths.unit_path) - process_dir(u, *p, t, ".d", _UNIT_DEPENDENCY_INVALID, &strv); - } - - if (strv_isempty(strv)) - return NULL; - - r = conf_files_list_strv(&configs, ".conf", NULL, (const char**) strv); - if (r < 0) { - log_error_errno(r, "Failed to get list of configuration files: %m"); - strv_free(configs); - return NULL; - } - - return configs; -} - int unit_load_dropin(Unit *u) { Iterator i; char *t, **f; + int r; assert(u); @@ -171,13 +61,15 @@ int unit_load_dropin(Unit *u) { char **p; STRV_FOREACH(p, u->manager->lookup_paths.unit_path) { - process_dir(u, *p, t, ".wants", UNIT_WANTS, NULL); - process_dir(u, *p, t, ".requires", UNIT_REQUIRES, NULL); + unit_file_process_dir(u->manager->unit_path_cache, *p, t, ".wants", UNIT_WANTS, + add_dependency_consumer, u, NULL); + unit_file_process_dir(u->manager->unit_path_cache, *p, t, ".requires", UNIT_REQUIRES, + add_dependency_consumer, u, NULL); } } - u->dropin_paths = unit_find_dropin_paths(u); - if (!u->dropin_paths) + r = unit_find_dropin_paths(u, &u->dropin_paths); + if (r <= 0) return 0; STRV_FOREACH(f, u->dropin_paths) { diff --git a/src/core/load-dropin.h b/src/core/load-dropin.h index fd551179e..1e018c452 100644 --- a/src/core/load-dropin.h +++ b/src/core/load-dropin.h @@ -22,8 +22,15 @@ ***/ #include "unit.h" +#include "dropin.h" /* Read service data supplementary drop-in directories */ -char **unit_find_dropin_paths(Unit *u); +static inline int unit_find_dropin_paths(Unit *u, char ***paths) { + return unit_file_find_dropin_paths(u->manager->lookup_paths.unit_path, + u->manager->unit_path_cache, + u->names, + paths); +} + int unit_load_dropin(Unit *u); diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4 index e0ffaa605..53059845e 100644 --- a/src/core/load-fragment-gperf.gperf.m4 +++ b/src/core/load-fragment-gperf.gperf.m4 @@ -225,7 +225,8 @@ Service.RestartForceExitStatus, config_parse_set_status, 0, Service.SuccessExitStatus, config_parse_set_status, 0, offsetof(Service, success_status) Service.SysVStartPriority, config_parse_warn_compat, DISABLED_LEGACY, 0 Service.NonBlocking, config_parse_bool, 0, offsetof(Service, exec_context.non_blocking) -Service.BusName, config_parse_unit_string_printf, 0, offsetof(Service, bus_name) +Service.BusName, config_parse_bus_name, 0, offsetof(Service, bus_name) +Service.FileDescriptorStoreMax, config_parse_unsigned, 0, offsetof(Service, n_fd_store_max) Service.NotifyAccess, config_parse_notify_access, 0, offsetof(Service, notify_access) Service.Sockets, config_parse_service_sockets, 0, 0 m4_ifdef(`ENABLE_KDBUS', diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 259323bd5..90bf5634c 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -60,6 +60,7 @@ #include "errno-list.h" #include "af-list.h" #include "cap-list.h" +#include "bus-internal.h" #ifdef HAVE_SECCOMP #include "seccomp-util.h" @@ -142,19 +143,20 @@ int config_parse_unit_deps(const char *unit, return 0; } -int config_parse_unit_string_printf(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 config_parse_unit_string_printf( + 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) { - Unit *u = userdata; _cleanup_free_ char *k = NULL; + Unit *u = userdata; int r; assert(filename); @@ -163,12 +165,12 @@ int config_parse_unit_string_printf(const char *unit, assert(u); r = unit_full_printf(u, rvalue, &k); - if (r < 0) - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to resolve unit specifiers on %s, ignoring: %s", rvalue, strerror(-r)); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers on %s, ignoring: %m", rvalue); + return 0; + } - return config_parse_string(unit, filename, line, section, section_line, lvalue, ltype, - k ? k : rvalue, data, userdata); + return config_parse_string(unit, filename, line, section, section_line, lvalue, ltype, k, data, userdata); } int config_parse_unit_strv_printf(const char *unit, @@ -538,8 +540,7 @@ int config_parse_exec(const char *unit, if (isempty(rvalue)) { /* An empty assignment resets the list */ - exec_command_free_list(*e); - *e = NULL; + *e = exec_command_free_list(*e); return 0; } @@ -548,9 +549,9 @@ int config_parse_exec(const char *unit, * overriding of argv[0]. */ for (;;) { int i; - const char *word, *state; + const char *word, *state, *reason; size_t l; - bool honour_argv0 = false, ignore = false; + bool separate_argv0 = false, ignore = false; path = NULL; nce = NULL; @@ -561,28 +562,23 @@ int config_parse_exec(const char *unit, if (rvalue[0] == 0) break; - for (i = 0; i < 2; i++) { - if (rvalue[0] == '-' && !ignore) { - ignore = true; - rvalue ++; - } - - if (rvalue[0] == '@' && !honour_argv0) { - honour_argv0 = true; - rvalue ++; - } - } - - if (*rvalue != '/') { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Executable path is not absolute, ignoring: %s", rvalue); - return 0; - } - k = 0; FOREACH_WORD_QUOTED(word, l, rvalue, state) { - if (strneq(word, ";", MAX(l, 1U))) - goto found; + if (k == 0) { + for (i = 0; i < 2; i++) { + if (*word == '-' && !ignore) { + ignore = true; + word ++; + } + + if (*word == '@' && !separate_argv0) { + separate_argv0 = true; + word ++; + } + } + } else + if (strneq(word, ";", MAX(l, 1U))) + goto found; k++; } @@ -593,58 +589,70 @@ int config_parse_exec(const char *unit, } found: - n = new(char*, k + !honour_argv0); + /* If separate_argv0, we'll move first element to path variable */ + n = new(char*, MAX(k + !separate_argv0, 1u)); if (!n) return log_oom(); k = 0; FOREACH_WORD_QUOTED(word, l, rvalue, state) { - if (strneq(word, ";", MAX(l, 1U))) - break; - else if (strneq(word, "\\;", MAX(l, 1U))) - word ++; + char *c; + unsigned skip; - if (honour_argv0 && word == rvalue) { - assert(!path); + if (separate_argv0 ? path == NULL : k == 0) { + /* first word, very special */ + skip = separate_argv0 + ignore; - path = strndup(word, l); - if (!path) { - r = log_oom(); - goto fail; - } + /* skip special chars in the beginning */ + assert(skip < l); - if (!utf8_is_valid(path)) { - log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue); - r = 0; - goto fail; - } + } else if (strneq(word, ";", MAX(l, 1U))) + /* new commandline */ + break; - } else { - char *c; + else + skip = strneq(word, "\\;", MAX(l, 1U)); - c = n[k++] = cunescape_length(word, l); - if (!c) { - r = log_oom(); - goto fail; - } + c = cunescape_length(word + skip, l - skip); + if (!c) { + r = log_oom(); + goto fail; + } - if (!utf8_is_valid(c)) { - log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue); - r = 0; - goto fail; - } + if (!utf8_is_valid(c)) { + log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue); + r = 0; + goto fail; } + + /* where to stuff this? */ + if (separate_argv0 && path == NULL) + path = c; + else + n[k++] = c; } n[k] = NULL; - if (!n[0]) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Invalid command line, ignoring: %s", rvalue); - r = 0; - goto fail; - } + log_debug("path: %s", path ?: n[0]); + + if (!n[0]) + reason = "Empty executable name or zeroeth argument"; + else if (!string_is_safe(path ?: n[0])) + reason = "Executable path contains special characters"; + else if (!path_is_absolute(path ?: n[0])) + reason = "Executable path is not absolute"; + else if (endswith(path ?: n[0], "/")) + reason = "Executable path specifies a directory"; + else + goto ok; + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "%s, ignoring: %s", reason, rvalue); + r = 0; + goto fail; + +ok: if (!path) { path = strdup(n[0]); if (!path) { @@ -653,8 +661,6 @@ int config_parse_exec(const char *unit, } } - assert(path_is_absolute(path)); - nce = new0(ExecCommand, 1); if (!nce) { r = log_oom(); @@ -1562,16 +1568,17 @@ int config_parse_path_spec(const char *unit, return 0; } -int config_parse_socket_service(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 config_parse_socket_service( + 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) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; Socket *s = data; @@ -1586,21 +1593,18 @@ int config_parse_socket_service(const char *unit, r = unit_name_printf(UNIT(s), rvalue, &p); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to resolve specifiers, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %s", rvalue); return 0; } if (!endswith(p, ".service")) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Unit must be of type service, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Unit must be of type service, ignoring: %s", rvalue); return 0; } r = manager_load_unit(UNIT(s)->manager, p, NULL, &error, &x); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to load unit %s, ignoring: %s", rvalue, bus_error_message(&error, r)); + log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to load unit %s, ignoring: %s", rvalue, bus_error_message(&error, r)); return 0; } @@ -1609,21 +1613,22 @@ int config_parse_socket_service(const char *unit, return 0; } -int config_parse_service_sockets(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 config_parse_service_sockets( + 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) { Service *s = data; - int r; const char *word, *state; size_t l; + int r; assert(filename); assert(lvalue); @@ -1638,33 +1643,65 @@ int config_parse_service_sockets(const char *unit, return log_oom(); r = unit_name_printf(UNIT(s), t, &k); - if (r < 0) - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to resolve specifiers, ignoring: %s", strerror(-r)); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m"); + continue; + } - if (!endswith(k ?: t, ".socket")) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Unit must be of type socket, ignoring: %s", k ?: t); + if (!endswith(k, ".socket")) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Unit must be of type socket, ignoring: %s", k); continue; } - r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_WANTS, UNIT_AFTER, k ?: t, NULL, true); + r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_WANTS, UNIT_AFTER, k, NULL, true); if (r < 0) - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to add dependency on %s, ignoring: %s", - k ?: t, strerror(-r)); + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to add dependency on %s, ignoring: %m", k); - r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k ?: t, NULL, true); + r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k, NULL, true); if (r < 0) - return r; + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to add dependency on %s, ignoring: %m", k); } if (!isempty(state)) - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Trailing garbage, ignoring."); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Trailing garbage, ignoring."); return 0; } +int config_parse_bus_name( + 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) { + + _cleanup_free_ char *k = NULL; + Unit *u = userdata; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(u); + + r = unit_full_printf(u, rvalue, &k); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers on %s, ignoring: %m", rvalue); + return 0; + } + + if (!service_name_is_valid(k)) { + log_syntax(unit, LOG_ERR, filename, line, r, "Invalid bus name %s, ignoring.", k); + return 0; + } + + return config_parse_string(unit, filename, line, section, section_line, lvalue, ltype, k, data, userdata); +} + int config_parse_service_timeout(const char *unit, const char *filename, unsigned line, @@ -2041,8 +2078,7 @@ int config_parse_unit_condition_path( if (isempty(rvalue)) { /* Empty assignment resets the list */ - condition_free_list(*list); - *list = NULL; + *list = condition_free_list(*list); return 0; } @@ -2099,8 +2135,7 @@ int config_parse_unit_condition_string( if (isempty(rvalue)) { /* Empty assignment resets the list */ - condition_free_list(*list); - *list = NULL; + *list = condition_free_list(*list); return 0; } @@ -2149,8 +2184,7 @@ int config_parse_unit_condition_null( if (isempty(rvalue)) { /* Empty assignment resets the list */ - condition_free_list(*list); - *list = NULL; + *list = condition_free_list(*list); return 0; } @@ -2264,7 +2298,7 @@ int config_parse_documentation(const char *unit, for (a = b = u->documentation; a && *a; a++) { - if (is_valid_documentation_url(*a)) + if (documentation_url_is_valid(*a)) *(b++) = *a; else { log_syntax(unit, LOG_ERR, filename, line, EINVAL, @@ -3066,7 +3100,7 @@ int config_parse_runtime_directory( if (!n) return log_oom(); - if (!filename_is_safe(n)) { + if (!filename_is_valid(n)) { log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Runtime directory is not valid, ignoring assignment: %s", rvalue); continue; @@ -3116,6 +3150,7 @@ int config_parse_set_status( FOREACH_WORD(word, l, rvalue, state) { _cleanup_free_ char *temp; int val; + Set **set; temp = strndup(word, l); if (!temp) @@ -3128,21 +3163,23 @@ int config_parse_set_status( if (val <= 0) { log_syntax(unit, LOG_ERR, filename, line, -val, "Failed to parse value, ignoring: %s", word); - return 0; + continue; } + set = &status_set->signal; } else { if (val < 0 || val > 255) { log_syntax(unit, LOG_ERR, filename, line, ERANGE, "Value %d is outside range 0-255, ignoring", val); continue; } + set = &status_set->status; } - r = set_ensure_allocated(&status_set->status, NULL); + r = set_ensure_allocated(set, NULL); if (r < 0) return log_oom(); - r = set_put(status_set->status, INT_TO_PTR(val)); + r = set_put(*set, INT_TO_PTR(val)); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, -r, "Unable to store: %s", word); @@ -3586,7 +3623,7 @@ int unit_load_fragment(Unit *u) { return r; /* Try to find an alias we can load this with */ - if (u->load_state == UNIT_STUB) + if (u->load_state == UNIT_STUB) { SET_FOREACH(t, u->names, i) { if (t == u->id) @@ -3599,6 +3636,7 @@ int unit_load_fragment(Unit *u) { if (u->load_state != UNIT_STUB) break; } + } /* And now, try looking for it under the suggested (originally linked) path */ if (u->load_state == UNIT_STUB && u->fragment_path) { @@ -3628,7 +3666,7 @@ int unit_load_fragment(Unit *u) { if (r < 0) return r; - if (u->load_state == UNIT_STUB) + if (u->load_state == UNIT_STUB) { SET_FOREACH(t, u->names, i) { _cleanup_free_ char *z = NULL; @@ -3646,6 +3684,7 @@ int unit_load_fragment(Unit *u) { if (u->load_state != UNIT_STUB) break; } + } } return 0; diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h index 21e0871e8..ce10d03c3 100644 --- a/src/core/load-fragment.h +++ b/src/core/load-fragment.h @@ -103,6 +103,7 @@ int config_parse_no_new_privileges(const char *unit, const char *filename, unsig int config_parse_cpu_quota(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 config_parse_protect_home(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 config_parse_protect_system(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 config_parse_bus_name(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); /* gperf prototypes */ const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length); diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c index 98fc04dd2..67ce160c1 100644 --- a/src/core/loopback-setup.c +++ b/src/core/loopback-setup.c @@ -27,15 +27,13 @@ #include #include +#include "sd-rtnl.h" #include "util.h" #include "macro.h" -#include "loopback-setup.h" #include "socket-util.h" -#include "sd-rtnl.h" #include "rtnl-util.h" - -/* this is hardcoded in the kernel, so don't look it up */ -#define LOOPBACK_IFINDEX 1 +#include "missing.h" +#include "loopback-setup.h" static int start_loopback(sd_rtnl *rtnl) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; @@ -56,30 +54,24 @@ static int start_loopback(sd_rtnl *rtnl) { return 0; } -static int check_loopback(void) { +static bool check_loopback(sd_rtnl *rtnl) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; + unsigned flags; int r; - _cleanup_close_ int fd = -1; - union { - struct sockaddr sa; - struct sockaddr_in in; - } sa = { - .in.sin_family = AF_INET, - .in.sin_addr.s_addr = INADDR_LOOPBACK, - }; - - /* If we failed to set up the loop back device, check whether - * it might already be set up */ - - fd = socket(AF_INET, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); - if (fd < 0) - return -errno; - - if (bind(fd, &sa.sa, sizeof(sa.in)) >= 0) - r = 1; - else - r = errno == EADDRNOTAVAIL ? 0 : -errno; - - return r; + + r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, LOOPBACK_IFINDEX); + if (r < 0) + return false; + + r = sd_rtnl_call(rtnl, req, 0, &reply); + if (r < 0) + return false; + + r = sd_rtnl_message_link_get_flags(reply, &flags); + if (r < 0) + return false; + + return flags & IFF_UP; } int loopback_setup(void) { @@ -91,12 +83,17 @@ int loopback_setup(void) { return r; r = start_loopback(rtnl); - if (r == -EPERM) { - if (check_loopback() < 0) - return log_warning_errno(EPERM, "Failed to configure loopback device: %m"); - } else if (r < 0) - return log_warning_errno(r, "Failed to configure loopback device: %m"); + if (r < 0) { + + /* If we lack the permissions to configure the + * loopback device, but we find it to be already + * configured, let's exit cleanly, in order to + * supported unprivileged containers. */ + if (r == -EPERM && check_loopback(rtnl)) + return 0; + return log_warning_errno(r, "Failed to configure loopback device: %m"); + } return 0; } diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index d91a02cf1..d00a53246 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -73,7 +73,7 @@ static int generate(char id[34], const char *root) { if (isempty(root)) dbus_machine_id = "/var/lib/dbus/machine-id"; else - dbus_machine_id = strappenda(root, "/var/lib/dbus/machine-id"); + dbus_machine_id = strjoina(root, "/var/lib/dbus/machine-id"); /* First, try reading the D-Bus machine id, unless it is a symlink */ fd = open(dbus_machine_id, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); @@ -199,13 +199,13 @@ int machine_id_commit(const char *root) { else { char *x; - x = strappenda(root, "/etc/machine-id"); + x = strjoina(root, "/etc/machine-id"); etc_machine_id = path_kill_slashes(x); } r = path_is_mount_point(etc_machine_id, false); if (r < 0) - return log_error_errno(r, "Failed to determine wether %s is a mount point: %m", etc_machine_id); + return log_error_errno(r, "Failed to determine whether %s is a mount point: %m", etc_machine_id); if (r == 0) { log_debug("%s is is not a mount point. Nothing to do.", etc_machine_id); return 0; @@ -281,10 +281,10 @@ int machine_id_setup(const char *root) { } else { char *x; - x = strappenda(root, "/etc/machine-id"); + x = strjoina(root, "/etc/machine-id"); etc_machine_id = path_kill_slashes(x); - x = strappenda(root, "/run/machine-id"); + x = strjoina(root, "/run/machine-id"); run_machine_id = path_kill_slashes(x); } diff --git a/src/core/main.c b/src/core/main.c index 140f2195a..ba2de85bd 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -42,9 +42,7 @@ #include "sd-daemon.h" #include "sd-messages.h" #include "sd-bus.h" -#include "manager.h" #include "log.h" -#include "load-fragment.h" #include "fdset.h" #include "special.h" #include "conf-parser.h" @@ -64,9 +62,12 @@ #include "env-util.h" #include "clock-util.h" #include "fileio.h" -#include "dbus-manager.h" #include "bus-error.h" #include "bus-util.h" +#include "selinux-util.h" +#include "manager.h" +#include "dbus-manager.h" +#include "load-fragment.h" #include "mount-setup.h" #include "loopback-setup.h" @@ -142,7 +143,7 @@ noreturn static void crash(int sig) { /* We want to wait for the core process, hence let's enable SIGCHLD */ sigaction(SIGCHLD, &sa, NULL); - pid = fork(); + pid = raw_clone(SIGCHLD, NULL); if (pid < 0) log_emergency_errno(errno, "Caught <%s>, cannot fork for core dump: %m", signal_to_string(sig)); @@ -163,11 +164,11 @@ noreturn static void crash(int sig) { chdir("/"); /* Raise the signal again */ - raise(sig); + pid = raw_getpid(); + kill(pid, sig); /* raise() would kill the parent */ assert_not_reached("We shouldn't be here..."); _exit(1); - } else { siginfo_t status; int r; @@ -177,7 +178,13 @@ noreturn static void crash(int sig) { if (r < 0) log_emergency_errno(r, "Caught <%s>, waitpid() failed: %m", signal_to_string(sig)); else if (status.si_code != CLD_DUMPED) - log_emergency("Caught <%s>, core dump failed.", signal_to_string(sig)); + log_emergency("Caught <%s>, core dump failed (child "PID_FMT", code=%s, status=%i/%s).", + signal_to_string(sig), + pid, sigchld_code_to_string(status.si_code), + status.si_status, + strna(status.si_code == CLD_EXITED + ? exit_status_to_string(status.si_status, EXIT_STATUS_FULL) + : signal_to_string(status.si_status))); else log_emergency("Caught <%s>, dumped core as pid "PID_FMT".", signal_to_string(sig), pid); } @@ -199,18 +206,17 @@ noreturn static void crash(int sig) { /* Let the kernel reap children for us */ assert_se(sigaction(SIGCHLD, &sa, NULL) == 0); - pid = fork(); + pid = raw_clone(SIGCHLD, NULL); if (pid < 0) log_emergency_errno(errno, "Failed to fork off crash shell: %m"); else if (pid == 0) { make_console_stdio(); - execl("/bin/sh", "/bin/sh", NULL); + execle("/bin/sh", "/bin/sh", NULL, environ); - log_emergency_errno(errno, "execl() failed: %m"); + log_emergency_errno(errno, "execle() failed: %m"); _exit(1); - } - - log_info("Successfully spawned crash shell as pid "PID_FMT".", pid); + } else + log_info("Successfully spawned crash shell as PID "PID_FMT".", pid); } log_emergency("Freezing execution."); @@ -218,12 +224,17 @@ noreturn static void crash(int sig) { } static void install_crash_handler(void) { - struct sigaction sa = { + static const struct sigaction sa = { .sa_handler = crash, - .sa_flags = SA_NODEFER, + .sa_flags = SA_NODEFER, /* So that we can raise the signal again from the signal handler */ }; + int r; - sigaction_many(&sa, SIGNALS_CRASH_HANDLER, -1); + /* We ignore the return value here, since, we don't mind if we + * cannot set up a crash handler */ + r = sigaction_many(&sa, SIGNALS_CRASH_HANDLER, -1); + if (r < 0) + log_debug_errno(r, "I had trouble setting up the crash handler, ignoring: %m"); } static int console_setup(void) { @@ -356,8 +367,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { } else if (streq(key, "quiet") && !value) { - log_set_max_level(LOG_NOTICE); - if (arg_show_status == _SHOW_STATUS_UNSET) arg_show_status = SHOW_STATUS_AUTO; @@ -1098,7 +1107,7 @@ static void test_usr(void) { if (dir_is_empty("/usr") <= 0) return; - log_warning("/usr appears to be on its own filesytem and is not already mounted. This is not a supported setup. " + log_warning("/usr appears to be on its own filesystem and is not already mounted. This is not a supported setup. " "Some things will probably break (sometimes even silently) in mysterious ways. " "Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information."); } @@ -1106,7 +1115,7 @@ static void test_usr(void) { static int initialize_join_controllers(void) { /* By default, mount "cpu" + "cpuacct" together, and "net_cls" * + "net_prio". We'd like to add "cpuset" to the mix, but - * "cpuset" does't really work for groups with no initialized + * "cpuset" doesn't really work for groups with no initialized * attributes. */ arg_join_controllers = new(char**, 3); @@ -1206,11 +1215,11 @@ int main(int argc, char *argv[]) { FDSet *fds = NULL; bool reexecute = false; const char *shutdown_verb = NULL; - dual_timestamp initrd_timestamp = { 0ULL, 0ULL }; - dual_timestamp userspace_timestamp = { 0ULL, 0ULL }; - dual_timestamp kernel_timestamp = { 0ULL, 0ULL }; - dual_timestamp security_start_timestamp = { 0ULL, 0ULL }; - dual_timestamp security_finish_timestamp = { 0ULL, 0ULL }; + dual_timestamp initrd_timestamp = DUAL_TIMESTAMP_NULL; + dual_timestamp userspace_timestamp = DUAL_TIMESTAMP_NULL; + dual_timestamp kernel_timestamp = DUAL_TIMESTAMP_NULL; + dual_timestamp security_start_timestamp = DUAL_TIMESTAMP_NULL; + dual_timestamp security_finish_timestamp = DUAL_TIMESTAMP_NULL; static char systemd[] = "systemd"; bool skip_setup = false; unsigned j; @@ -1219,7 +1228,7 @@ int main(int argc, char *argv[]) { bool queue_default_job = false; bool empty_etc = false; char *switch_root_dir = NULL, *switch_root_init = NULL; - static struct rlimit saved_rlimit_nofile = { 0, 0 }; + struct rlimit saved_rlimit_nofile = RLIMIT_MAKE_CONST(0); const char *error_message = NULL; #ifdef HAVE_SYSV_COMPAT @@ -1543,7 +1552,7 @@ int main(int argc, char *argv[]) { * managers and installers to provision a couple of * files already. If the container manager wants to * provision the machine ID itself it should pass - * $container_uuid to PID 1.*/ + * $container_uuid to PID 1. */ empty_etc = access("/etc/machine-id", F_OK) < 0; if (empty_etc) @@ -1818,6 +1827,8 @@ int main(int argc, char *argv[]) { finish: pager_close(); + if (m) + arg_shutdown_watchdog = m->shutdown_watchdog; m = manager_free(m); for (j = 0; j < ELEMENTSOF(arg_default_rlimit); j++) { @@ -1870,7 +1881,7 @@ finish: args = newa(const char*, args_size); if (!switch_root_init) { - char sfd[16]; + char sfd[DECIMAL_STR_MAX(int) + 1]; /* First try to spawn ourselves with the right * path, and with full serialization. We do @@ -1880,8 +1891,7 @@ finish: assert(arg_serialization); assert(fds); - snprintf(sfd, sizeof(sfd), "%i", fileno(arg_serialization)); - char_array_0(sfd); + xsprintf(sfd, "%i", fileno(arg_serialization)); i = 0; args[i++] = SYSTEMD_BINARY_PATH; @@ -1982,7 +1992,7 @@ finish: assert(command_line[pos] == NULL); env_block = strv_copy(environ); - snprintf(log_level, sizeof(log_level), "%d", log_get_max_level()); + xsprintf(log_level, "%d", log_get_max_level()); switch (log_get_target()) { case LOG_TARGET_KMSG: @@ -2011,8 +2021,8 @@ finish: /* If we reboot let's set the shutdown * watchdog and tell the shutdown binary to * repeatedly ping it */ - watchdog_set_timeout(&arg_shutdown_watchdog); - watchdog_close(false); + r = watchdog_set_timeout(&arg_shutdown_watchdog); + watchdog_close(r < 0); /* Tell the binary how often to ping, ignore failure */ if (asprintf(&e, "WATCHDOG_USEC="USEC_FMT, arg_shutdown_watchdog) > 0) diff --git a/src/core/manager.c b/src/core/manager.c index 6382400af..4775219e4 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,6 +90,8 @@ static int manager_dispatch_time_change_fd(sd_event_source *source, int fd, uint static int manager_dispatch_idle_pipe_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata); static int manager_dispatch_jobs_in_progress(sd_event_source *source, usec_t usec, void *userdata); static int manager_dispatch_run_queue(sd_event_source *source, void *userdata); +static int manager_run_generators(Manager *m); +static void manager_undo_generators(Manager *m); static int manager_watch_jobs_in_progress(Manager *m) { usec_t next; @@ -162,6 +164,7 @@ static void manager_print_jobs_in_progress(Manager *m) { uint64_t x; assert(m); + assert(m->n_running_jobs > 0); manager_flip_auto_status(m, true); @@ -184,8 +187,7 @@ static void manager_print_jobs_in_progress(Manager *m) { m->jobs_in_progress_iteration++; if (m->n_running_jobs > 1) - if (asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs) < 0) - job_of_n = NULL; + asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs); format_timespan(time, sizeof(time), now(CLOCK_MONOTONIC) - j->begin_usec, 1*USEC_PER_SEC); if (job_get_timeout(j, &x) > 0) @@ -197,7 +199,6 @@ static void manager_print_jobs_in_progress(Manager *m) { job_type_to_string(j->type), unit_description(j->unit), time, limit); - } static int have_ask_password(void) { @@ -440,7 +441,7 @@ static int manager_setup_signals(Manager *m) { SIGRTMIN+26, /* systemd: set log target to journal-or-kmsg */ SIGRTMIN+27, /* systemd: set log target to console */ SIGRTMIN+28, /* systemd: set log target to kmsg */ - SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg (obsolete)*/ + SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg (obsolete) */ /* ... one free signal here SIGRTMIN+30 ... */ #endif @@ -548,6 +549,9 @@ int manager_new(SystemdRunningAs running_as, bool test_run, Manager **_m) { m->test_run = test_run; + /* Reboot immediately if the user hits C-A-D more often than 7x per 2s */ + RATELIMIT_INIT(m->ctrl_alt_del_ratelimit, 2 * USEC_PER_SEC, 7); + r = manager_default_environment(m); if (r < 0) goto fail; @@ -704,7 +708,7 @@ static int manager_setup_kdbus(Manager *m) { if (m->test_run || m->kdbus_fd >= 0) return 0; - if (getpid() == 1) + if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0) bus_kernel_fix_attach_mask(); m->kdbus_fd = bus_kernel_create_bus( @@ -946,20 +950,29 @@ Manager* manager_free(Manager *m) { } int manager_enumerate(Manager *m) { - int r = 0, q; + int r = 0; UnitType c; assert(m); /* Let's ask every type to load all units from disk/kernel * that it might know */ - for (c = 0; c < _UNIT_TYPE_MAX; c++) - if (unit_vtable[c]->enumerate) { - q = unit_vtable[c]->enumerate(m); - if (q < 0) - r = q; + for (c = 0; c < _UNIT_TYPE_MAX; c++) { + int q; + + if (unit_vtable[c]->supported && !unit_vtable[c]->supported(m)) { + log_info("Unit type .%s is not supported on this system.", unit_type_to_string(c)); + continue; } + if (!unit_vtable[c]->enumerate) + continue; + + q = unit_vtable[c]->enumerate(m); + if (q < 0) + r = q; + } + manager_dispatch_load_queue(m); return r; } @@ -1019,7 +1032,7 @@ static void manager_build_unit_path_cache(Manager *m) { while ((de = readdir(d))) { char *p; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; p = strjoin(streq(*i, "/") ? "" : *i, "/", de->d_name, NULL); @@ -1075,8 +1088,10 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { assert(m); dual_timestamp_get(&m->generators_start_timestamp); - manager_run_generators(m); + r = manager_run_generators(m); dual_timestamp_get(&m->generators_finish_timestamp); + if (r < 0) + return r; r = lookup_paths_init( &m->lookup_paths, m->running_as, true, @@ -1441,7 +1456,7 @@ static unsigned manager_dispatch_dbus_queue(Manager *m) { return n; } -static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, char *buf, size_t n) { +static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, char *buf, size_t n, FDSet *fds) { _cleanup_strv_free_ char **tags = NULL; assert(m); @@ -1458,12 +1473,13 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, char * log_unit_debug(u->id, "Got notification message for unit %s", u->id); if (UNIT_VTABLE(u)->notify_message) - UNIT_VTABLE(u)->notify_message(u, pid, tags); + UNIT_VTABLE(u)->notify_message(u, pid, tags, fds); } static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata) { Manager *m = userdata; ssize_t n; + int r; assert(m); assert(m->notify_fd == fd); @@ -1474,73 +1490,99 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t } for (;;) { - char buf[4096]; + _cleanup_fdset_free_ FDSet *fds = NULL; + char buf[NOTIFY_BUFFER_MAX+1]; struct iovec iovec = { .iov_base = buf, .iov_len = sizeof(buf)-1, }; - bool found = false; - union { struct cmsghdr cmsghdr; - uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; + uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + + CMSG_SPACE(sizeof(int) * NOTIFY_FD_MAX)]; } control = {}; - struct msghdr msghdr = { .msg_iov = &iovec, .msg_iovlen = 1, .msg_control = &control, .msg_controllen = sizeof(control), }; - struct ucred *ucred; + struct cmsghdr *cmsg; + struct ucred *ucred = NULL; + bool found = false; Unit *u1, *u2, *u3; + int *fd_array = NULL; + unsigned n_fds = 0; - n = recvmsg(m->notify_fd, &msghdr, MSG_DONTWAIT); - if (n <= 0) { - if (n == 0) - return -EIO; - + n = recvmsg(m->notify_fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC); + if (n < 0) { if (errno == EAGAIN || errno == EINTR) break; return -errno; } - if (msghdr.msg_controllen < CMSG_LEN(sizeof(struct ucred)) || - control.cmsghdr.cmsg_level != SOL_SOCKET || - control.cmsghdr.cmsg_type != SCM_CREDENTIALS || - control.cmsghdr.cmsg_len != CMSG_LEN(sizeof(struct ucred))) { - log_warning("Received notify message without credentials. Ignoring."); + for (cmsg = CMSG_FIRSTHDR(&msghdr); cmsg; cmsg = CMSG_NXTHDR(&msghdr, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { + + fd_array = (int*) CMSG_DATA(cmsg); + n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); + + } else if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDENTIALS && + cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) { + + ucred = (struct ucred*) CMSG_DATA(cmsg); + } + } + + if (n_fds > 0) { + assert(fd_array); + + r = fdset_new_array(&fds, fd_array, n_fds); + if (r < 0) { + close_many(fd_array, n_fds); + return log_oom(); + } + } + + if (!ucred || ucred->pid <= 0) { + log_warning("Received notify message without valid credentials. Ignoring."); continue; } - ucred = (struct ucred*) CMSG_DATA(&control.cmsghdr); + if ((size_t) n >= sizeof(buf)) { + log_warning("Received notify message exceeded maximum size. Ignoring."); + continue; + } - assert((size_t) n < sizeof(buf)); buf[n] = 0; /* Notify every unit that might be interested, but try * to avoid notifying the same one multiple times. */ u1 = manager_get_unit_by_pid(m, ucred->pid); if (u1) { - manager_invoke_notify_message(m, u1, ucred->pid, buf, n); + manager_invoke_notify_message(m, u1, ucred->pid, buf, n, fds); found = true; } u2 = hashmap_get(m->watch_pids1, LONG_TO_PTR(ucred->pid)); if (u2 && u2 != u1) { - manager_invoke_notify_message(m, u2, ucred->pid, buf, n); + manager_invoke_notify_message(m, u2, ucred->pid, buf, n, fds); found = true; } u3 = hashmap_get(m->watch_pids2, LONG_TO_PTR(ucred->pid)); if (u3 && u3 != u2 && u3 != u1) { - manager_invoke_notify_message(m, u3, ucred->pid, buf, n); + manager_invoke_notify_message(m, u3, ucred->pid, buf, n, fds); found = true; } if (!found) log_warning("Cannot find unit for notify message of PID "PID_FMT".", ucred->pid); + + if (fdset_size(fds) > 0) + log_warning("Got auxiliary fds with notification message, closing all."); } return 0; @@ -1682,7 +1724,19 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t case SIGINT: if (m->running_as == SYSTEMD_SYSTEM) { - manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY); + + /* If the user presses C-A-D more than + * 7 times within 2s, we reboot + * immediately. */ + + if (ratelimit_test(&m->ctrl_alt_del_ratelimit)) + manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY); + else { + log_notice("Ctrl-Alt-Del was pressed more than 7 times within 2s, rebooting immediately."); + status_printf(NULL, true, false, "Ctrl-Alt-Del was pressed more than 7 times within 2s, rebooting immediately."); + m->exit_code = MANAGER_REBOOT; + } + break; } @@ -2052,8 +2106,7 @@ void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success) { return; } - msg = strappenda("unit=", p); - + msg = strjoina("unit=", p); if (audit_log_user_comm_message(audit_fd, type, msg, "systemd", NULL, NULL, NULL, success) < 0) { if (errno == EPERM) /* We aren't allowed to send audit messages? @@ -2171,7 +2224,7 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) { m->n_reloading ++; - fprintf(f, "current-job-id=%i\n", m->current_job_id); + fprintf(f, "current-job-id=%"PRIu32"\n", m->current_job_id); fprintf(f, "taint-usr=%s\n", yes_no(m->taint_usr)); fprintf(f, "n-installed-jobs=%u\n", m->n_installed_jobs); fprintf(f, "n-failed-jobs=%u\n", m->n_failed_jobs); @@ -2477,7 +2530,9 @@ int manager_reload(Manager *m) { lookup_paths_free(&m->lookup_paths); /* Find new unit paths */ - manager_run_generators(m); + q = manager_run_generators(m); + if (q < 0 && r >= 0) + r = q; q = lookup_paths_init( &m->lookup_paths, m->running_as, true, @@ -2485,19 +2540,19 @@ int manager_reload(Manager *m) { m->generator_unit_path, m->generator_unit_path_early, m->generator_unit_path_late); - if (q < 0) + if (q < 0 && r >= 0) r = q; manager_build_unit_path_cache(m); /* First, enumerate what we can from all config files */ q = manager_enumerate(m); - if (q < 0) + if (q < 0 && r >= 0) r = q; /* Second, deserialize our stored data */ q = manager_deserialize(m, f, fds); - if (q < 0) + if (q < 0 && r >= 0) r = q; fclose(f); @@ -2505,12 +2560,12 @@ int manager_reload(Manager *m) { /* Re-register notify_fd as event source */ q = manager_setup_notify(m); - if (q < 0) + if (q < 0 && r >= 0) r = q; /* Third, fire things up! */ q = manager_coldplug(m); - if (q < 0) + if (q < 0 && r >= 0) r = q; assert(m->n_reloading > 0); @@ -2626,9 +2681,6 @@ void manager_check_finished(Manager *m) { assert(m); - if (m->n_running_jobs == 0) - m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source); - if (hashmap_size(m->jobs) > 0) { if (m->jobs_in_progress_event_source) @@ -2738,28 +2790,33 @@ static void trim_generator_dir(Manager *m, char **generator) { return; } -void manager_run_generators(Manager *m) { - _cleanup_closedir_ DIR *d = NULL; - const char *generator_path; +static int manager_run_generators(Manager *m) { + _cleanup_free_ char **paths = NULL; const char *argv[5]; + char **path; int r; assert(m); if (m->test_run) - return; + return 0; - generator_path = m->running_as == SYSTEMD_SYSTEM ? SYSTEM_GENERATOR_PATH : USER_GENERATOR_PATH; - d = opendir(generator_path); - if (!d) { - if (errno == ENOENT) - return; + paths = generator_paths(m->running_as); + if (!paths) + return log_oom(); - log_error_errno(errno, "Failed to enumerate generator directory %s: %m", - generator_path); - return; + /* Optimize by skipping the whole process by not creating output directories + * if no generators are found. */ + STRV_FOREACH(path, paths) { + r = access(*path, F_OK); + if (r == 0) + goto found; + if (errno != ENOENT) + log_warning_errno(errno, "Failed to open generator directory %s: %m", *path); } + return 0; + found: r = create_generator_dir(m, &m->generator_unit_path, "generator"); if (r < 0) goto finish; @@ -2779,12 +2836,13 @@ void manager_run_generators(Manager *m) { argv[4] = NULL; RUN_WITH_UMASK(0022) - execute_directory(generator_path, d, DEFAULT_TIMEOUT_USEC, (char**) argv); + execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, (char**) argv); finish: trim_generator_dir(m, &m->generator_unit_path); trim_generator_dir(m, &m->generator_unit_path_early); trim_generator_dir(m, &m->generator_unit_path_late); + return r; } static void remove_generator_dir(Manager *m, char **generator) { @@ -2801,7 +2859,7 @@ static void remove_generator_dir(Manager *m, char **generator) { *generator = NULL; } -void manager_undo_generators(Manager *m) { +static void manager_undo_generators(Manager *m) { assert(m); remove_generator_dir(m, &m->generator_unit_path); diff --git a/src/core/manager.h b/src/core/manager.h index ab75f902e..d3971f168 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -29,6 +29,10 @@ #include "sd-event.h" #include "fdset.h" #include "cgroup-util.h" +#include "hashmap.h" +#include "list.h" +#include "set.h" +#include "ratelimit.h" /* Enforce upper limit how many names we allow */ #define MANAGER_MAX_NAMES 131072 /* 128K */ @@ -68,9 +72,6 @@ typedef enum StatusType { #include "unit.h" #include "job.h" -#include "hashmap.h" -#include "list.h" -#include "set.h" #include "path-lookup.h" #include "execute.h" #include "unit-name.h" @@ -295,6 +296,9 @@ struct Manager { /* Used for processing polkit authorization responses */ Hashmap *polkit_registry; + + /* When the user hits C-A-D more than 7 times per 2s, reboot immediately... */ + RateLimit ctrl_alt_del_ratelimit; }; int manager_new(SystemdRunningAs running_as, bool test_run, Manager **m); @@ -349,9 +353,6 @@ bool manager_unit_inactive_or_pending(Manager *m, const char *name); void manager_check_finished(Manager *m); -void manager_run_generators(Manager *m); -void manager_undo_generators(Manager *m); - void manager_recheck_journal(Manager *m); void manager_set_show_status(Manager *m, ShowStatus mode); diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 342f5520c..521545e5c 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include "efivars.h" #include "smack-util.h" #include "def.h" +#include "cgroup-util.h" typedef enum MountMode { MNT_NONE = 0, @@ -120,12 +120,6 @@ static const MountPoint mount_table[] = { static const char ignore_paths[] = /* SELinux file systems */ "/sys/fs/selinux\0" - "/selinux\0" - /* Legacy cgroup mount points */ - "/dev/cgroup\0" - "/cgroup\0" - /* Legacy kernel file system */ - "/proc/bus/usb\0" /* Container bind mounts */ "/proc/sys\0" "/dev/console\0" @@ -227,49 +221,17 @@ int mount_setup_early(void) { int mount_cgroup_controllers(char ***join_controllers) { _cleanup_set_free_free_ Set *controllers = NULL; - _cleanup_fclose_ FILE *f; - char buf[LINE_MAX]; int r; /* Mount all available cgroup controllers that are built into the kernel. */ - f = fopen("/proc/cgroups", "re"); - if (!f) { - log_error_errno(errno, "Failed to enumerate cgroup controllers: %m"); - return 0; - } - controllers = set_new(&string_hash_ops); if (!controllers) return log_oom(); - /* Ignore the header line */ - (void) fgets(buf, sizeof(buf), f); - - for (;;) { - char *controller; - int enabled = 0; - - if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { - - if (feof(f)) - break; - - log_error("Failed to parse /proc/cgroups."); - return -EIO; - } - - if (!enabled) { - free(controller); - continue; - } - - r = set_consume(controllers, controller); - if (r < 0) { - log_error("Failed to add controller to set."); - return r; - } - } + r = cg_kernel_controllers(controllers); + if (r < 0) + return log_error_errno(r, "Failed to enumerate cgroup controllers: %m"); for (;;) { _cleanup_free_ char *options = NULL, *controller = NULL, *where = NULL; @@ -348,7 +310,7 @@ int mount_cgroup_controllers(char ***join_controllers) { /* Now that we mounted everything, let's make the tmpfs the * cgroup file systems are mounted into read-only. */ - mount("tmpfs", "/sys/fs/cgroup", "tmpfs", MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME|MS_RDONLY, "mode=755"); + (void) mount("tmpfs", "/sys/fs/cgroup", "tmpfs", MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME|MS_RDONLY, "mode=755"); return 0; } diff --git a/src/core/mount.c b/src/core/mount.c index e271d437c..f3977e62d 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -44,6 +44,9 @@ #include "bus-common-errors.h" #include "exit-status.h" #include "def.h" +#include "fstab-util.h" + +#define RETRY_UMOUNT_MAX 32 DEFINE_TRIVIAL_CLEANUP_FUNC(struct libmnt_table*, mnt_free_table); DEFINE_TRIVIAL_CLEANUP_FUNC(struct libmnt_iter*, mnt_free_iter); @@ -68,7 +71,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata); static bool mount_needs_network(const char *options, const char *fstype) { - if (mount_test_option(options, "_netdev")) + if (fstab_test_option(options, "_netdev\0")) return true; if (fstype && fstype_is_network(fstype)) @@ -86,16 +89,10 @@ static bool mount_is_network(const MountParameters *p) { static bool mount_is_bind(const MountParameters *p) { assert(p); - if (mount_test_option(p->options, "bind")) - return true; - - if (p->fstype && streq(p->fstype, "bind")) - return true; - - if (mount_test_option(p->options, "rbind")) + if (fstab_test_option(p->options, "bind\0" "rbind\0")) return true; - if (p->fstype && streq(p->fstype, "rbind")) + if (p->fstype && STR_IN_SET(p->fstype, "bind", "rbind")) return true; return false; @@ -104,7 +101,7 @@ static bool mount_is_bind(const MountParameters *p) { static bool mount_is_auto(const MountParameters *p) { assert(p); - return !mount_test_option(p->options, "noauto"); + return !fstab_test_option(p->options, "noauto\0"); } static bool needs_quota(const MountParameters *p) { @@ -116,11 +113,8 @@ static bool needs_quota(const MountParameters *p) { if (mount_is_bind(p)) return false; - return mount_test_option(p->options, "usrquota") || - mount_test_option(p->options, "grpquota") || - mount_test_option(p->options, "quota") || - mount_test_option(p->options, "usrjquota") || - mount_test_option(p->options, "grpjquota"); + return fstab_test_option(p->options, + "usrquota\0" "grpquota\0" "quota\0" "usrjquota\0" "grpjquota\0"); } static void mount_init(Unit *u) { @@ -306,7 +300,7 @@ static int mount_add_device_links(Mount *m) { assert(m); - p = get_mount_parameters_fragment(m); + p = get_mount_parameters(m); if (!p) return 0; @@ -367,7 +361,7 @@ static bool should_umount(Mount *m) { return false; p = get_mount_parameters(m); - if (p && mount_test_option(p->options, "x-initrd.mount") && + if (p && fstab_test_option(p->options, "x-initrd.mount\0") && !in_initrd()) return false; @@ -384,13 +378,20 @@ static int mount_add_default_dependencies(Mount *m) { if (UNIT(m)->manager->running_as != SYSTEMD_SYSTEM) return 0; - p = get_mount_parameters(m); - - if (!p) + /* We do not add any default dependencies to / and /usr, since + * they are guaranteed to stay mounted the whole time, since + * our system is on it. Also, don't bother with anything + * mounted below virtual file systems, it's also going to be + * virtual, and hence not worth the effort. */ + if (path_equal(m->where, "/") || + path_equal(m->where, "/usr") || + path_startswith(m->where, "/proc") || + path_startswith(m->where, "/sys") || + path_startswith(m->where, "/dev")) return 0; - if (path_equal(m->where, "/") || - path_equal(m->where, "/usr")) + p = get_mount_parameters(m); + if (!p) return 0; if (mount_is_network(p)) { @@ -867,20 +868,26 @@ static void mount_enter_unmounting(Mount *m) { assert(m); + /* Start counting our attempts */ + if (!IN_SET(m->state, + MOUNT_UNMOUNTING, + MOUNT_UNMOUNTING_SIGTERM, + MOUNT_UNMOUNTING_SIGKILL)) + m->n_retry_umount = 0; + m->control_command_id = MOUNT_EXEC_UNMOUNT; m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT; - if ((r = exec_command_set( - m->control_command, - "/bin/umount", - "-n", - m->where, - NULL)) < 0) + r = exec_command_set(m->control_command, "/bin/umount", m->where, NULL); + if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM) + r = exec_command_append(m->control_command, "-n", NULL); + if (r < 0) goto fail; mount_unwatch_control_pid(m); - if ((r = mount_spawn(m, m->control_command, &m->control_pid)) < 0) + r = mount_spawn(m, m->control_command, &m->control_pid); + if (r < 0) goto fail; mount_set_state(m, MOUNT_UNMOUNTING); @@ -916,17 +923,25 @@ static void mount_enter_mounting(Mount *m) { if (r < 0) goto fail; - if (m->from_fragment) - r = exec_command_set( - m->control_command, - "/bin/mount", - m->sloppy_options ? "-ns" : "-n", - m->parameters_fragment.what, - m->where, - "-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto", - m->parameters_fragment.options ? "-o" : NULL, m->parameters_fragment.options, - NULL); - else + if (m->from_fragment) { + _cleanup_free_ char *opts = NULL; + + r = fstab_filter_options(m->parameters_fragment.options, + "nofail\0" "noauto\0" "auto\0", NULL, NULL, &opts); + if (r < 0) + goto fail; + + r = exec_command_set(m->control_command, "/bin/mount", + m->parameters_fragment.what, m->where, NULL); + if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM) + r = exec_command_append(m->control_command, "-n", NULL); + if (r >= 0 && m->sloppy_options) + r = exec_command_append(m->control_command, "-s", NULL); + if (r >= 0 && m->parameters_fragment.fstype) + r = exec_command_append(m->control_command, "-t", m->parameters_fragment.fstype, NULL); + if (r >= 0 && !isempty(opts)) + r = exec_command_append(m->control_command, "-o", opts, NULL); + } else r = -ENOENT; if (r < 0) @@ -961,19 +976,19 @@ static void mount_enter_remounting(Mount *m) { const char *o; if (m->parameters_fragment.options) - o = strappenda("remount,", m->parameters_fragment.options); + o = strjoina("remount,", m->parameters_fragment.options); else o = "remount"; - r = exec_command_set( - m->control_command, - "/bin/mount", - m->sloppy_options ? "-ns" : "-n", - m->parameters_fragment.what, - m->where, - "-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto", - "-o", o, - NULL); + r = exec_command_set(m->control_command, "/bin/mount", + m->parameters_fragment.what, m->where, + "-o", o, NULL); + if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM) + r = exec_command_append(m->control_command, "-n", NULL); + if (r >= 0 && m->sloppy_options) + r = exec_command_append(m->control_command, "-s", NULL); + if (r >= 0 && m->parameters_fragment.fstype) + r = exec_command_append(m->control_command, "-t", m->parameters_fragment.fstype, NULL); } else r = -ENOENT; @@ -1022,7 +1037,7 @@ static int mount_start(Unit *u) { m->reload_result = MOUNT_SUCCESS; mount_enter_mounting(m); - return 0; + return 1; } static int mount_stop(Unit *u) { @@ -1046,7 +1061,7 @@ static int mount_stop(Unit *u) { m->state == MOUNT_REMOUNTING_SIGKILL); mount_enter_unmounting(m); - return 0; + return 1; } static int mount_reload(Unit *u) { @@ -1239,9 +1254,31 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { case MOUNT_UNMOUNTING_SIGKILL: case MOUNT_UNMOUNTING_SIGTERM: - if (f == MOUNT_SUCCESS) - mount_enter_dead(m, f); - else if (m->from_proc_self_mountinfo) + if (f == MOUNT_SUCCESS) { + + if (m->from_proc_self_mountinfo) { + + /* Still a mount point? If so, let's + * try again. Most likely there were + * multiple mount points stacked on + * top of each other. Note that due to + * the io event priority logic we can + * be sure the new mountinfo is loaded + * before we process the SIGCHLD for + * the mount command. */ + + if (m->n_retry_umount < RETRY_UMOUNT_MAX) { + log_unit_debug(u->id, "%s: mount still present, trying again.", u->id); + m->n_retry_umount++; + mount_enter_unmounting(m); + } else { + log_unit_debug(u->id, "%s: mount still present after %u attempts to unmount, giving up.", u->id, m->n_retry_umount); + mount_enter_mounted(m, f); + } + } else + mount_enter_dead(m, f); + + } else if (m->from_proc_self_mountinfo) mount_enter_mounted(m, f); else mount_enter_dead(m, f); @@ -1415,7 +1452,6 @@ static int mount_add_one( goto fail; } - if (m->running_as == SYSTEMD_SYSTEM) { const char* target; @@ -1670,11 +1706,11 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, * internal behaviour of libmount here. */ for (;;) { - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event); + union inotify_event_buffer buffer; struct inotify_event *e; ssize_t l; - l = read(fd, buffer, sizeof(buffer)); + l = read(fd, &buffer, sizeof(buffer)); if (l < 0) { if (errno == EAGAIN || errno == EINTR) break; diff --git a/src/core/mount.h b/src/core/mount.h index 2dcb663cb..d6987e6fa 100644 --- a/src/core/mount.h +++ b/src/core/mount.h @@ -112,6 +112,8 @@ struct Mount { pid_t control_pid; sd_event_source *timer_event_source; + + unsigned n_retry_umount; }; extern const UnitVTable mount_vtable; diff --git a/src/core/namespace.c b/src/core/namespace.c index 4c411096a..4fecd3236 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -35,7 +35,6 @@ #include "strv.h" #include "util.h" #include "path-util.h" -#include "namespace.h" #include "missing.h" #include "execute.h" #include "loopback-setup.h" @@ -43,6 +42,8 @@ #include "dev-setup.h" #include "def.h" #include "label.h" +#include "selinux-util.h" +#include "namespace.h" typedef enum MountMode { /* This is ordered by priority! */ @@ -156,24 +157,24 @@ static int mount_dev(BindMount *m) { if (!mkdtemp(temporary_mount)) return -errno; - dev = strappenda(temporary_mount, "/dev"); + dev = strjoina(temporary_mount, "/dev"); (void)mkdir(dev, 0755); if (mount("tmpfs", dev, "tmpfs", MS_NOSUID|MS_STRICTATIME, "mode=755") < 0) { r = -errno; goto fail; } - devpts = strappenda(temporary_mount, "/dev/pts"); + devpts = strjoina(temporary_mount, "/dev/pts"); (void)mkdir(devpts, 0755); if (mount("/dev/pts", devpts, NULL, MS_BIND, NULL) < 0) { r = -errno; goto fail; } - devptmx = strappenda(temporary_mount, "/dev/ptmx"); + devptmx = strjoina(temporary_mount, "/dev/ptmx"); symlink("pts/ptmx", devptmx); - devshm = strappenda(temporary_mount, "/dev/shm"); + devshm = strjoina(temporary_mount, "/dev/shm"); (void)mkdir(devshm, 01777); r = mount("/dev/shm", devshm, NULL, MS_BIND, NULL); if (r < 0) { @@ -181,15 +182,15 @@ static int mount_dev(BindMount *m) { goto fail; } - devmqueue = strappenda(temporary_mount, "/dev/mqueue"); + devmqueue = strjoina(temporary_mount, "/dev/mqueue"); (void)mkdir(devmqueue, 0755); mount("/dev/mqueue", devmqueue, NULL, MS_BIND, NULL); - devhugepages = strappenda(temporary_mount, "/dev/hugepages"); + devhugepages = strjoina(temporary_mount, "/dev/hugepages"); (void)mkdir(devhugepages, 0755); mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL); - devlog = strappenda(temporary_mount, "/dev/log"); + devlog = strjoina(temporary_mount, "/dev/log"); symlink("/run/systemd/journal/dev-log", devlog); NULSTR_FOREACH(d, devnodes) { @@ -279,7 +280,7 @@ static int mount_kdbus(BindMount *m) { if (!mkdtemp(temporary_mount)) return log_error_errno(errno, "Failed create temp dir: %m"); - root = strappenda(temporary_mount, "/kdbus"); + root = strjoina(temporary_mount, "/kdbus"); (void)mkdir(root, 0755); if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_STRICTATIME, "mode=777") < 0) { r = -errno; @@ -294,7 +295,7 @@ static int mount_kdbus(BindMount *m) { goto fail; } - busnode = strappenda(root, "/bus"); + busnode = strjoina(root, "/bus"); if (mknod(busnode, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) { log_error_errno(errno, "mknod() for %s failed: %m", busnode); r = -errno; @@ -421,7 +422,7 @@ int setup_namespace( bool private_dev, ProtectHome protect_home, ProtectSystem protect_system, - unsigned mount_flags) { + unsigned long mount_flags) { BindMount *m, *mounts = NULL; unsigned n; @@ -565,7 +566,7 @@ static int setup_one_tmp_dir(const char *id, const char *prefix, char **path) { RUN_WITH_UMASK(0000) { char *y; - y = strappenda(x, "/tmp"); + y = strjoina(x, "/tmp"); if (mkdir(y, 0777 | S_ISVTX) < 0) return -errno; @@ -593,7 +594,7 @@ int setup_tmp_dirs(const char *id, char **tmp_dir, char **var_tmp_dir) { if (r < 0) { char *t; - t = strappenda(a, "/tmp"); + t = strjoina(a, "/tmp"); rmdir(t); rmdir(a); diff --git a/src/core/namespace.h b/src/core/namespace.h index 1f9d0676b..42b92e780 100644 --- a/src/core/namespace.h +++ b/src/core/namespace.h @@ -50,7 +50,7 @@ int setup_namespace(char **read_write_dirs, bool private_dev, ProtectHome protect_home, ProtectSystem protect_system, - unsigned mount_flags); + unsigned long mount_flags); int setup_tmp_dirs(const char *id, char **tmp_dir, diff --git a/src/core/path.c b/src/core/path.c index 656ed6941..e5ea79fec 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -157,7 +157,7 @@ void path_spec_unwatch(PathSpec *s) { } int path_spec_fd_event(PathSpec *s, uint32_t revents) { - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event); + union inotify_event_buffer buffer; struct inotify_event *e; ssize_t l; int r = 0; @@ -167,7 +167,7 @@ int path_spec_fd_event(PathSpec *s, uint32_t revents) { return -EINVAL; } - l = read(s->inotify_fd, buffer, sizeof(buffer)); + l = read(s->inotify_fd, &buffer, sizeof(buffer)); if (l < 0) { if (errno == EAGAIN || errno == EINTR) return 0; @@ -572,7 +572,7 @@ static int path_start(Unit *u) { p->result = PATH_SUCCESS; path_enter_waiting(p, true, true); - return 0; + return 1; } static int path_stop(Unit *u) { @@ -582,7 +582,7 @@ static int path_stop(Unit *u) { assert(p->state == PATH_WAITING || p->state == PATH_RUNNING); path_enter_dead(p, PATH_SUCCESS); - return 0; + return 1; } static int path_serialize(Unit *u, FILE *f, FDSet *fds) { diff --git a/src/core/path.h b/src/core/path.h index d2e91d7d7..0d36aab96 100644 --- a/src/core/path.h +++ b/src/core/path.h @@ -22,6 +22,7 @@ ***/ typedef struct Path Path; +typedef struct PathSpec PathSpec; #include "unit.h" #include "mount.h" diff --git a/src/core/scope.c b/src/core/scope.c index e0da6e4db..b41db7872 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -295,7 +295,7 @@ static int scope_start(Unit *u) { s->result = SCOPE_SUCCESS; scope_set_state(s, SCOPE_RUNNING); - return 0; + return 1; } static int scope_stop(Unit *u) { @@ -311,7 +311,7 @@ static int scope_stop(Unit *u) { s->state == SCOPE_ABANDONED); scope_enter_signal(s, SCOPE_STOP_SIGTERM, SCOPE_SUCCESS); - return 0; + return 1; } static void scope_reset_failed(Unit *u) { diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index b45a4513e..18888747f 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -64,16 +64,16 @@ static int audit_callback( const struct audit_info *audit = auditdata; uid_t uid = 0, login_uid = 0; gid_t gid = 0; - char login_uid_buf[DECIMAL_STR_MAX(uid_t)] = "n/a"; - char uid_buf[DECIMAL_STR_MAX(uid_t)] = "n/a"; - char gid_buf[DECIMAL_STR_MAX(gid_t)] = "n/a"; + char login_uid_buf[DECIMAL_STR_MAX(uid_t) + 1] = "n/a"; + char uid_buf[DECIMAL_STR_MAX(uid_t) + 1] = "n/a"; + char gid_buf[DECIMAL_STR_MAX(gid_t) + 1] = "n/a"; if (sd_bus_creds_get_audit_login_uid(audit->creds, &login_uid) >= 0) - snprintf(login_uid_buf, sizeof(login_uid_buf), UID_FMT, login_uid); - if (sd_bus_creds_get_uid(audit->creds, &uid) >= 0) - snprintf(uid_buf, sizeof(uid_buf), UID_FMT, uid); - if (sd_bus_creds_get_gid(audit->creds, &gid) >= 0) - snprintf(gid_buf, sizeof(gid_buf), GID_FMT, gid); + xsprintf(login_uid_buf, UID_FMT, login_uid); + if (sd_bus_creds_get_euid(audit->creds, &uid) >= 0) + xsprintf(uid_buf, UID_FMT, uid); + if (sd_bus_creds_get_egid(audit->creds, &gid) >= 0) + xsprintf(gid_buf, GID_FMT, gid); snprintf(msgbuf, msgbufsize, "auid=%s uid=%s gid=%s%s%s%s%s%s%s", @@ -81,8 +81,6 @@ static int audit_callback( audit->path ? " path=\"" : "", strempty(audit->path), audit->path ? "\"" : "", audit->cmdline ? " cmdline=\"" : "", strempty(audit->cmdline), audit->cmdline ? "\"" : ""); - msgbuf[msgbufsize-1] = 0; - return 0; } @@ -203,7 +201,7 @@ int mac_selinux_generic_access_check( r = sd_bus_query_sender_creds( message, - SD_BUS_CREDS_PID|SD_BUS_CREDS_UID|SD_BUS_CREDS_GID| + SD_BUS_CREDS_PID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EGID| SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_AUDIT_LOGIN_UID| SD_BUS_CREDS_SELINUX_CONTEXT| SD_BUS_CREDS_AUGMENT /* get more bits from /proc */, diff --git a/src/core/service.c b/src/core/service.c index bfbe959ed..15e29be14 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -242,6 +242,42 @@ static void service_reset_watchdog(Service *s) { service_start_watchdog(s); } +static void service_fd_store_unlink(ServiceFDStore *fs) { + + if (!fs) + return; + + if (fs->service) { + assert(fs->service->n_fd_store > 0); + LIST_REMOVE(fd_store, fs->service->fd_store, fs); + fs->service->n_fd_store--; + } + + if (fs->event_source) { + sd_event_source_set_enabled(fs->event_source, SD_EVENT_OFF); + sd_event_source_unref(fs->event_source); + } + + safe_close(fs->fd); + free(fs); +} + +static void service_release_resources(Unit *u) { + Service *s = SERVICE(u); + + assert(s); + + if (!s->fd_store) + return; + + log_debug("Releasing all resources for %s", u->id); + + while (s->fd_store) + service_fd_store_unlink(s->fd_store); + + assert(s->n_fd_store == 0); +} + static void service_done(Unit *u) { Service *s = SERVICE(u); @@ -286,6 +322,90 @@ static void service_done(Unit *u) { service_stop_watchdog(s); s->timer_event_source = sd_event_source_unref(s->timer_event_source); + + service_release_resources(u); +} + +static int on_fd_store_io(sd_event_source *e, int fd, uint32_t revents, void *userdata) { + ServiceFDStore *fs = userdata; + + assert(e); + assert(fs); + + /* If we get either EPOLLHUP or EPOLLERR, it's time to remove this entry from the fd store */ + service_fd_store_unlink(fs); + return 0; +} + +static int service_add_fd_store(Service *s, int fd) { + ServiceFDStore *fs; + int r; + + assert(s); + assert(fd >= 0); + + if (s->n_fd_store >= s->n_fd_store_max) + return 0; + + LIST_FOREACH(fd_store, fs, s->fd_store) { + r = same_fd(fs->fd, fd); + if (r < 0) + return r; + if (r > 0) { + /* Already included */ + safe_close(fd); + return 1; + } + } + + fs = new0(ServiceFDStore, 1); + if (!fs) + return -ENOMEM; + + fs->fd = fd; + fs->service = s; + + r = sd_event_add_io(UNIT(s)->manager->event, &fs->event_source, fd, 0, on_fd_store_io, fs); + if (r < 0) { + free(fs); + return r; + } + + LIST_PREPEND(fd_store, s->fd_store, fs); + s->n_fd_store++; + + return 1; +} + +static int service_add_fd_store_set(Service *s, FDSet *fds) { + int r; + + assert(s); + + if (fdset_size(fds) <= 0) + return 0; + + while (s->n_fd_store < s->n_fd_store_max) { + _cleanup_close_ int fd = -1; + + fd = fdset_steal_first(fds); + if (fd < 0) + break; + + r = service_add_fd_store(s, fd); + if (r < 0) + return log_unit_error_errno(UNIT(s)->id, r, "%s: Couldn't add fd to fd store: %m", UNIT(s)->id); + + if (r > 0) { + log_unit_debug(UNIT(s)->id, "%s: added fd to fd store.", UNIT(s)->id); + fd = -1; + } + } + + if (fdset_size(fds) > 0) + log_unit_warning(UNIT(s)->id, "%s: tried to store more fds than FDStoreMax=%u allows, closing remaining.", UNIT(s)->id, s->n_fd_store_max); + + return 0; } static int service_arm_timer(Service *s, usec_t usec) { @@ -375,8 +495,7 @@ static int service_add_default_dependencies(Service *s) { return r; /* Second, activate normal shutdown */ - r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); - return r; + return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); } static void service_fix_output(Service *s) { @@ -397,6 +516,67 @@ static void service_fix_output(Service *s) { s->exec_context.std_output = UNIT(s)->manager->default_std_output; } +static int service_add_extras(Service *s) { + int r; + + assert(s); + + if (s->type == _SERVICE_TYPE_INVALID) { + /* Figure out a type automatically */ + if (s->bus_name) + s->type = SERVICE_DBUS; + else if (s->exec_command[SERVICE_EXEC_START]) + s->type = SERVICE_SIMPLE; + else + s->type = SERVICE_ONESHOT; + } + + /* Oneshot services have disabled start timeout by default */ + if (s->type == SERVICE_ONESHOT && !s->start_timeout_defined) + s->timeout_start_usec = 0; + + service_fix_output(s); + + r = unit_patch_contexts(UNIT(s)); + if (r < 0) + return r; + + r = unit_add_exec_dependencies(UNIT(s), &s->exec_context); + if (r < 0) + return r; + + r = unit_add_default_slice(UNIT(s), &s->cgroup_context); + if (r < 0) + return r; + + if (s->type == SERVICE_NOTIFY && s->notify_access == NOTIFY_NONE) + s->notify_access = NOTIFY_MAIN; + + if (s->watchdog_usec > 0 && s->notify_access == NOTIFY_NONE) + s->notify_access = NOTIFY_MAIN; + + if (s->bus_name) { + const char *n; + + r = unit_watch_bus_name(UNIT(s), s->bus_name); + if (r < 0) + return r; + + n = strjoina(s->bus_name, ".busname"); + r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true); + if (r < 0) + return r; + } + + if (UNIT(s)->default_dependencies) { + r = service_add_default_dependencies(s); + if (r < 0) + return r; + } + + return 0; +} + static int service_load(Unit *u) { Service *s = SERVICE(u); int r; @@ -421,52 +601,11 @@ static int service_load(Unit *u) { if (r < 0) return r; - if (s->type == _SERVICE_TYPE_INVALID) { - /* Figure out a type automatically */ - if (s->bus_name) - s->type = SERVICE_DBUS; - else if (s->exec_command[SERVICE_EXEC_START]) - s->type = SERVICE_SIMPLE; - else - s->type = SERVICE_ONESHOT; - } - - /* Oneshot services have disabled start timeout by default */ - if (s->type == SERVICE_ONESHOT && !s->start_timeout_defined) - s->timeout_start_usec = 0; - - service_fix_output(s); - - r = unit_patch_contexts(u); - if (r < 0) - return r; - - r = unit_add_exec_dependencies(u, &s->exec_context); + /* This is a new unit? Then let's add in some + * extras */ + r = service_add_extras(s); if (r < 0) return r; - - r = unit_add_default_slice(u, &s->cgroup_context); - if (r < 0) - return r; - - if (s->type == SERVICE_NOTIFY && s->notify_access == NOTIFY_NONE) - s->notify_access = NOTIFY_MAIN; - - if (s->watchdog_usec > 0 && s->notify_access == NOTIFY_NONE) - s->notify_access = NOTIFY_MAIN; - - if (s->bus_name) { - r = unit_watch_bus_name(u, s->bus_name); - if (r < 0) - return r; - } - - if (u->default_dependencies) { - r = service_add_default_dependencies(s); - if (r < 0) - - return r; - } } return service_verify(s); @@ -480,7 +619,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { assert(s); prefix = strempty(prefix); - prefix2 = strappenda(prefix, "\t"); + prefix2 = strjoina(prefix, "\t"); fprintf(f, "%sService State: %s\n" @@ -549,6 +688,14 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { if (s->status_text) fprintf(f, "%sStatus Text: %s\n", prefix, s->status_text); + + if (s->n_fd_store_max > 0) { + fprintf(f, + "%sFile Descriptor Store Max: %u\n" + "%sFile Descriptor Store Current: %u\n", + prefix, s->n_fd_store_max, + prefix, s->n_fd_store); + } } static int service_load_pid_file(Service *s, bool may_warn) { @@ -806,10 +953,10 @@ static int service_coldplug(Unit *u) { } static int service_collect_fds(Service *s, int **fds, unsigned *n_fds) { + _cleanup_free_ int *rfds = NULL; + unsigned rn_fds = 0; Iterator i; int r; - int *rfds = NULL; - unsigned rn_fds = 0; Unit *u; assert(s); @@ -831,10 +978,12 @@ static int service_collect_fds(Service *s, int **fds, unsigned *n_fds) { r = socket_collect_fds(sock, &cfds, &cn_fds); if (r < 0) - goto fail; + return r; - if (!cfds) + if (cn_fds <= 0) { + free(cfds); continue; + } if (!rfds) { rfds = cfds; @@ -842,32 +991,39 @@ static int service_collect_fds(Service *s, int **fds, unsigned *n_fds) { } else { int *t; - t = new(int, rn_fds+cn_fds); + t = realloc(rfds, (rn_fds + cn_fds) * sizeof(int)); if (!t) { free(cfds); - r = -ENOMEM; - goto fail; + return -ENOMEM; } - memcpy(t, rfds, rn_fds * sizeof(int)); - memcpy(t+rn_fds, cfds, cn_fds * sizeof(int)); - free(rfds); + memcpy(t + rn_fds, cfds, cn_fds * sizeof(int)); + rfds = t; + rn_fds += cn_fds; + free(cfds); - rfds = t; - rn_fds = rn_fds+cn_fds; } } + if (s->n_fd_store > 0) { + ServiceFDStore *fs; + int *t; + + t = realloc(rfds, (rn_fds + s->n_fd_store) * sizeof(int)); + if (!t) + return -ENOMEM; + + rfds = t; + LIST_FOREACH(fd_store, fs, s->fd_store) + rfds[rn_fds++] = fs->fd; + } + *fds = rfds; *n_fds = rn_fds; + rfds = NULL; return 0; - -fail: - free(rfds); - - return r; } static int service_spawn( @@ -967,7 +1123,7 @@ static int service_spawn( } if (is_control && UNIT(s)->cgroup_path) { - path = strappenda(UNIT(s)->cgroup_path, "/control"); + path = strjoina(UNIT(s)->cgroup_path, "/control"); cg_create(SYSTEMD_CGROUP_CONTROLLER, path); } else path = UNIT(s)->cgroup_path; @@ -1333,7 +1489,7 @@ static void service_kill_control_processes(Service *s) { if (!UNIT(s)->cgroup_path) return; - p = strappenda(UNIT(s)->cgroup_path, "/control"); + p = strjoina(UNIT(s)->cgroup_path, "/control"); cg_kill_recursive(SYSTEMD_CGROUP_CONTROLLER, p, SIGKILL, true, true, true, NULL); } @@ -1681,7 +1837,7 @@ static int service_start(Unit *u) { s->notify_state = NOTIFY_UNKNOWN; service_enter_start_pre(s); - return 0; + return 1; } static int service_stop(Unit *u) { @@ -1722,7 +1878,7 @@ static int service_stop(Unit *u) { s->state == SERVICE_EXITED); service_enter_stop(s, SERVICE_SUCCESS); - return 0; + return 1; } static int service_reload(Unit *u) { @@ -1746,6 +1902,7 @@ _pure_ static bool service_can_reload(Unit *u) { static int service_serialize(Unit *u, FILE *f, FDSet *fds) { Service *s = SERVICE(u); + ServiceFDStore *fs; assert(u); assert(f); @@ -1777,7 +1934,8 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) { if (s->socket_fd >= 0) { int copy; - if ((copy = fdset_put_dup(fds, s->socket_fd)) < 0) + copy = fdset_put_dup(fds, s->socket_fd); + if (copy < 0) return copy; unit_serialize_item_format(u, f, "socket-fd", "%i", copy); @@ -1786,12 +1944,23 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) { if (s->bus_endpoint_fd >= 0) { int copy; - if ((copy = fdset_put_dup(fds, s->bus_endpoint_fd)) < 0) + copy = fdset_put_dup(fds, s->bus_endpoint_fd); + if (copy < 0) return copy; unit_serialize_item_format(u, f, "endpoint-fd", "%i", copy); } + LIST_FOREACH(fd_store, fs, s->fd_store) { + int copy; + + copy = fdset_put_dup(fds, fs->fd); + if (copy < 0) + return copy; + + unit_serialize_item_format(u, f, "fd-store-fd", "%i", copy); + } + if (s->main_exec_status.pid > 0) { unit_serialize_item_format(u, f, "main-exec-status-pid", PID_FMT, s->main_exec_status.pid); @@ -1818,6 +1987,7 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) { static int service_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { Service *s = SERVICE(u); + int r; assert(u); assert(key); @@ -1913,6 +2083,19 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, safe_close(s->bus_endpoint_fd); s->bus_endpoint_fd = fdset_remove(fds, fd); } + } else if (streq(key, "fd-store-fd")) { + int fd; + + if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd)) + log_unit_debug(u->id, "Failed to parse fd-store-fd value %s", value); + else { + r = service_add_fd_store(s, fd); + if (r < 0) + log_unit_error_errno(u->id, r, "Failed to add fd to store: %m"); + else if (r > 0) + fdset_remove(fds, fd); + } + } else if (streq(key, "main-exec-status-pid")) { pid_t pid; @@ -2543,7 +2726,7 @@ static int service_dispatch_watchdog(sd_event_source *source, usec_t usec, void return 0; } -static void service_notify_message(Unit *u, pid_t pid, char **tags) { +static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds) { Service *s = SERVICE(u); _cleanup_free_ char *cc = NULL; bool notify_dbus = false; @@ -2675,6 +2858,12 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { service_reset_watchdog(s); } + /* Add the passed fds to the fd store */ + if (strv_find(tags, "FDSTORE=1")) { + log_unit_debug(u->id, "%s: got FDSTORE=1", u->id); + service_add_fd_store_set(s, fds); + } + /* Notify clients about changed status or main pid */ if (notify_dbus) unit_add_to_dbus_queue(u); @@ -2917,6 +3106,7 @@ const UnitVTable service_vtable = { .init = service_init, .done = service_done, .load = service_load, + .release_resources = service_release_resources, .coldplug = service_coldplug, diff --git a/src/core/service.h b/src/core/service.h index f6a78c403..dfeee6a68 100644 --- a/src/core/service.h +++ b/src/core/service.h @@ -22,6 +22,7 @@ ***/ typedef struct Service Service; +typedef struct ServiceFDStore ServiceFDStore; #include "unit.h" #include "path.h" @@ -115,6 +116,15 @@ typedef enum ServiceResult { _SERVICE_RESULT_INVALID = -1 } ServiceResult; +struct ServiceFDStore { + Service *service; + + int fd; + sd_event_source *event_source; + + LIST_FIELDS(ServiceFDStore, fd_store); +}; + struct Service { Unit meta; @@ -198,6 +208,10 @@ struct Service { NotifyAccess notify_access; NotifyState notify_state; + + ServiceFDStore *fd_store; + unsigned n_fd_store; + unsigned n_fd_store_max; }; extern const UnitVTable service_vtable; diff --git a/src/core/shutdown.c b/src/core/shutdown.c index def20f502..71f001ac1 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -49,6 +49,7 @@ #include "cgroup-util.h" #include "def.h" #include "switch-root.h" +#include "strv.h" #define FINALIZE_ATTEMPTS 50 @@ -144,7 +145,7 @@ static int switch_root_initramfs(void) { if (mount(NULL, "/run/initramfs", NULL, MS_PRIVATE, NULL) < 0) return log_error_errno(errno, "Failed to make /run/initramfs private mount: %m"); - /* switch_root with MS_BIND, because there might still be processes lurking around, which have open file desriptors. + /* switch_root with MS_BIND, because there might still be processes lurking around, which have open file descriptors. * /run/initramfs/shutdown will take care of these. * Also do not detach the old root, because /run/initramfs/shutdown needs to access it. */ @@ -159,6 +160,7 @@ int main(int argc, char *argv[]) { char *arguments[3]; unsigned retries; int cmd, r; + static const char* const dirs[] = {SYSTEM_SHUTDOWN_PATH, NULL}; log_parse_environment(); r = parse_argv(argc, argv); @@ -308,7 +310,7 @@ int main(int argc, char *argv[]) { arguments[0] = NULL; arguments[1] = arg_verb; arguments[2] = NULL; - execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments); + execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments); if (!in_container && !in_initrd() && access("/run/initramfs/shutdown", X_OK) == 0) { diff --git a/src/core/slice.c b/src/core/slice.c index a31e62937..ae9819d01 100644 --- a/src/core/slice.c +++ b/src/core/slice.c @@ -187,7 +187,7 @@ static int slice_start(Unit *u) { unit_realize_cgroup(u); slice_set_state(t, SLICE_ACTIVE); - return 0; + return 1; } static int slice_stop(Unit *u) { @@ -200,7 +200,7 @@ static int slice_stop(Unit *u) { * unit_notify() will do that for us anyway. */ slice_set_state(t, SLICE_DEAD); - return 0; + return 1; } static int slice_kill(Unit *u, KillWho who, int signo, sd_bus_error *error) { diff --git a/src/core/snapshot.c b/src/core/snapshot.c index 068a077f1..b70c3beb6 100644 --- a/src/core/snapshot.c +++ b/src/core/snapshot.c @@ -111,7 +111,7 @@ static int snapshot_start(Unit *u) { if (s->cleanup) unit_add_to_cleanup_queue(u); - return 0; + return 1; } static int snapshot_stop(Unit *u) { @@ -121,7 +121,7 @@ static int snapshot_stop(Unit *u) { assert(s->state == SNAPSHOT_ACTIVE); snapshot_set_state(s, SNAPSHOT_DEAD); - return 0; + return 1; } static int snapshot_serialize(Unit *u, FILE *f, FDSet *fds) { diff --git a/src/core/socket.c b/src/core/socket.c index 8fa55e0b0..48c43a288 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -48,6 +48,7 @@ #include "smack-util.h" #include "bus-util.h" #include "bus-error.h" +#include "selinux-util.h" #include "dbus-socket.h" #include "unit.h" #include "socket.h" @@ -265,7 +266,7 @@ static int socket_add_device_link(Socket *s) { if (!s->bind_to_device || streq(s->bind_to_device, "lo")) return 0; - t = strappenda("/sys/subsystem/net/devices/", s->bind_to_device); + t = strjoina("/sys/subsystem/net/devices/", s->bind_to_device); return unit_add_node_link(UNIT(s), t, false); } @@ -472,7 +473,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) { assert(f); prefix = strempty(prefix); - prefix2 = strappenda(prefix, "\t"); + prefix2 = strjoina(prefix, "\t"); fprintf(f, "%sSocket State: %s\n" @@ -1953,7 +1954,7 @@ static int socket_start(Unit *u) { s->result = SOCKET_SUCCESS; socket_enter_start_pre(s); - return 0; + return 1; } static int socket_stop(Unit *u) { @@ -1984,7 +1985,7 @@ static int socket_stop(Unit *u) { assert(s->state == SOCKET_LISTENING || s->state == SOCKET_RUNNING); socket_enter_stop_pre(s, SOCKET_SUCCESS); - return 0; + return 1; } static int socket_serialize(Unit *u, FILE *f, FDSet *fds) { @@ -2602,10 +2603,6 @@ static void socket_trigger_notify(Unit *u, Unit *other) { socket_notify_service_dead(s, se->result == SERVICE_FAILURE_START_LIMIT); if (se->state == SERVICE_DEAD || - se->state == SERVICE_STOP || - se->state == SERVICE_STOP_SIGTERM || - se->state == SERVICE_STOP_SIGKILL || - se->state == SERVICE_STOP_POST || se->state == SERVICE_FINAL_SIGTERM || se->state == SERVICE_FINAL_SIGKILL || se->state == SERVICE_AUTO_RESTART) diff --git a/src/core/swap.c b/src/core/swap.c index a6a23554c..6997921fd 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -41,6 +41,7 @@ #include "path-util.h" #include "virt.h" #include "udev-util.h" +#include "fstab-util.h" static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { [SWAP_DEAD] = UNIT_INACTIVE, @@ -472,6 +473,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool static void swap_set_state(Swap *s, SwapState state) { SwapState old_state; + Swap *other; assert(s); @@ -499,6 +501,15 @@ static void swap_set_state(Swap *s, SwapState state) { swap_state_to_string(state)); unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true); + + /* If there other units for the same device node have a job + queued it might be worth checking again if it is runnable + now. This is necessary, since swap_start() refuses + operation with EAGAIN if there's already another job for + the same device node queued. */ + LIST_FOREACH_OTHERS(same_devnode, other, s) + if (UNIT(other)->job) + job_add_to_run_queue(UNIT(other)->job); } static int swap_coldplug(Unit *u) { @@ -636,7 +647,6 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) { fail: s->timer_event_source = sd_event_source_unref(s->timer_event_source); - return r; } @@ -698,77 +708,10 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to kill processes: %s", UNIT(s)->id, strerror(-r)); - + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to kill processes: %m", UNIT(s)->id); swap_enter_dead(s, SWAP_FAILURE_RESOURCES); } -static int mount_find_pri(const char *options, int *ret) { - const char *opt; - char *end; - unsigned long r; - - assert(ret); - - if (!options) - return 0; - - opt = mount_test_option(options, "pri"); - if (!opt) - return 0; - - opt += strlen("pri"); - if (*opt != '=') - return -EINVAL; - - errno = 0; - r = strtoul(opt + 1, &end, 10); - if (errno > 0) - return -errno; - - if (end == opt + 1 || (*end != ',' && *end != 0)) - return -EINVAL; - - *ret = (int) r; - return 1; -} - -static int mount_find_discard(const char *options, char **ret) { - const char *opt; - char *ans; - size_t len; - - assert(ret); - - if (!options) - return 0; - - opt = mount_test_option(options, "discard"); - if (!opt) - return 0; - - opt += strlen("discard"); - if (*opt == ',' || *opt == '\0') - ans = strdup("all"); - else { - if (*opt != '=') - return -EINVAL; - - len = strcspn(opt + 1, ","); - if (len == 0) - return -EINVAL; - - ans = strndup(opt + 1, len); - } - - if (!ans) - return -ENOMEM; - - *ret = ans; - return 1; -} - static void swap_enter_activating(Swap *s) { _cleanup_free_ char *discard = NULL; int r, priority = -1; @@ -779,11 +722,12 @@ static void swap_enter_activating(Swap *s) { s->control_command = s->exec_command + SWAP_EXEC_ACTIVATE; if (s->from_fragment) { - mount_find_discard(s->parameters_fragment.options, &discard); + fstab_filter_options(s->parameters_fragment.options, "discard\0", + NULL, &discard, NULL); priority = s->parameters_fragment.priority; if (priority < 0) - mount_find_pri(s->parameters_fragment.options, &priority); + fstab_find_pri(s->parameters_fragment.options, &priority); } r = exec_command_set(s->control_command, "/sbin/swapon", NULL); @@ -805,7 +749,7 @@ static void swap_enter_activating(Swap *s) { if (streq(discard, "all")) discard_arg = "--discard"; else - discard_arg = strappenda("--discard=", discard); + discard_arg = strjoina("--discard=", discard); r = exec_command_append(s->control_command, discard_arg, NULL); if (r < 0) @@ -827,9 +771,7 @@ static void swap_enter_activating(Swap *s) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to run 'swapon' task: %s", - UNIT(s)->id, strerror(-r)); + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to run 'swapon' task: %m", UNIT(s)->id); swap_enter_dead(s, SWAP_FAILURE_RESOURCES); } @@ -859,14 +801,12 @@ static void swap_enter_deactivating(Swap *s) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to run 'swapoff' task: %s", - UNIT(s)->id, strerror(-r)); + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to run 'swapoff' task: %m", UNIT(s)->id); swap_enter_active(s, SWAP_FAILURE_RESOURCES); } static int swap_start(Unit *u) { - Swap *s = SWAP(u); + Swap *s = SWAP(u), *other; assert(s); @@ -888,9 +828,16 @@ static int swap_start(Unit *u) { if (detect_container(NULL) > 0) return -EPERM; + /* If there's a job for another swap unit for the same node + * running, then let's not dispatch this one for now, and wait + * until that other job has finished. */ + LIST_FOREACH_OTHERS(same_devnode, other, s) + if (UNIT(other)->job && UNIT(other)->job->state == JOB_RUNNING) + return -EAGAIN; + s->result = SWAP_SUCCESS; swap_enter_activating(s); - return 0; + return 1; } static int swap_stop(Unit *u) { @@ -913,7 +860,7 @@ static int swap_stop(Unit *u) { return -EPERM; swap_enter_deactivating(s); - return 0; + return 1; } static int swap_serialize(Unit *u, FILE *f, FDSet *fds) { @@ -1248,11 +1195,7 @@ static Unit *swap_following(Unit *u) { if (s->from_fragment) return NULL; - LIST_FOREACH_AFTER(same_devnode, other, s) - if (other->from_fragment) - return UNIT(other); - - LIST_FOREACH_BEFORE(same_devnode, other, s) + LIST_FOREACH_OTHERS(same_devnode, other, s) if (other->from_fragment) return UNIT(other); @@ -1294,13 +1237,7 @@ static int swap_following_set(Unit *u, Set **_set) { if (!set) return -ENOMEM; - LIST_FOREACH_AFTER(same_devnode, other, s) { - r = set_put(set, other); - if (r < 0) - goto fail; - } - - LIST_FOREACH_BEFORE(same_devnode, other, s) { + LIST_FOREACH_OTHERS(same_devnode, other, s) { r = set_put(set, other); if (r < 0) goto fail; @@ -1453,6 +1390,21 @@ static int swap_get_timeout(Unit *u, uint64_t *timeout) { return 1; } +static bool swap_supported(Manager *m) { + static int supported = -1; + + /* If swap support is not available in the kernel, or we are + * running in a container we don't support swap units, and any + * attempts to starting one should fail immediately. */ + + if (supported < 0) + supported = + access("/proc/swaps", F_OK) >= 0 && + detect_container(NULL) <= 0; + + return supported; +} + static const char* const swap_state_table[_SWAP_STATE_MAX] = { [SWAP_DEAD] = "dead", [SWAP_ACTIVATING] = "activating", @@ -1539,6 +1491,7 @@ const UnitVTable swap_vtable = { .enumerate = swap_enumerate, .shutdown = swap_shutdown, + .supported = swap_supported, .status_message_formats = { .starting_stopping = { diff --git a/src/core/target.c b/src/core/target.c index 68be22b38..33fb66bc3 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -137,7 +137,7 @@ static int target_start(Unit *u) { assert(t->state == TARGET_DEAD); target_set_state(t, TARGET_ACTIVE); - return 0; + return 1; } static int target_stop(Unit *u) { @@ -147,7 +147,7 @@ static int target_stop(Unit *u) { assert(t->state == TARGET_ACTIVE); target_set_state(t, TARGET_DEAD); - return 0; + return 1; } static int target_serialize(Unit *u, FILE *f, FDSet *fds) { diff --git a/src/core/timer.c b/src/core/timer.c index 309852aae..45744c7de 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -548,7 +548,7 @@ static int timer_start(Unit *u) { t->result = TIMER_SUCCESS; timer_enter_waiting(t, true); - return 0; + return 1; } static int timer_stop(Unit *u) { @@ -558,7 +558,7 @@ static int timer_stop(Unit *u) { assert(t->state == TIMER_WAITING || t->state == TIMER_RUNNING || t->state == TIMER_ELAPSED); timer_enter_dead(t, TIMER_SUCCESS); - return 0; + return 1; } static int timer_serialize(Unit *u, FILE *f, FDSet *fds) { diff --git a/src/core/umount.c b/src/core/umount.c index e38851dc1..dd7df194d 100644 --- a/src/core/umount.c +++ b/src/core/umount.c @@ -104,10 +104,16 @@ static int mount_points_list_get(MountPoint **head) { /* Ignore mount points we can't unmount because they * are API or because we are keeping them open (like - * /dev/console) */ + * /dev/console). Also, ignore all mounts below API + * file systems, since they are likely virtual too, + * and hence not worth spending time on. Also, in + * unprivileged containers we might lack the rights to + * unmount these things, hence don't bother. */ if (mount_point_is_api(p) || mount_point_ignore(p) || - path_equal(p, "/dev/console")) { + path_startswith(p, "/dev") || + path_startswith(p, "/sys") || + path_startswith(p, "/proc")) { free(p); continue; } diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index 62599d081..97135db55 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include "systemd/sd-id128.h" +#include "sd-id128.h" #include "unit.h" #include "specifier.h" #include "path-util.h" diff --git a/src/core/unit.c b/src/core/unit.c index fe0dfb208..ee8e607c2 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -278,21 +278,32 @@ int unit_set_description(Unit *u, const char *description) { } bool unit_check_gc(Unit *u) { + UnitActiveState state; assert(u); - if (UNIT_VTABLE(u)->no_gc) + if (u->job) return true; - if (u->no_gc) + if (u->nop_job) return true; - if (u->job) + state = unit_active_state(u); + + /* If the unit is inactive and failed and no job is queued for + * it, then release its runtime resources */ + if (UNIT_IS_INACTIVE_OR_FAILED(state) && + UNIT_VTABLE(u)->release_resources) + UNIT_VTABLE(u)->release_resources(u); + + /* But we keep the unit object around for longer when it is + * referenced or configured to not be gc'ed */ + if (state != UNIT_INACTIVE) return true; - if (u->nop_job) + if (UNIT_VTABLE(u)->no_gc) return true; - if (unit_active_state(u) != UNIT_INACTIVE) + if (u->no_gc) return true; if (u->refs) @@ -609,7 +620,7 @@ static int reserve_dependencies(Unit *u, Unit *other, UnitDependency d) { /* * If u does not have this dependency set allocated, there is no need - * to reserve anything. In that case other's set will be transfered + * to reserve anything. In that case other's set will be transferred * as a whole to u by complete_move(). */ if (!u->dependencies[d]) @@ -857,7 +868,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { assert(u->type >= 0); prefix = strempty(prefix); - prefix2 = strappenda(prefix, "\t"); + prefix2 = strjoina(prefix, "\t"); fprintf(f, "%s-> Unit %s:\n" @@ -1388,7 +1399,6 @@ static void unit_status_log_starting_stopping_reloading(Unit *u, JobType t) { DISABLE_WARNING_FORMAT_NONLITERAL; snprintf(buf, sizeof(buf), format, unit_description(u)); - char_array_0(buf); REENABLE_WARNING; mid = t == JOB_START ? SD_MESSAGE_UNIT_STARTING : @@ -1412,6 +1422,7 @@ static void unit_status_log_starting_stopping_reloading(Unit *u, JobType t) { int unit_start(Unit *u) { UnitActiveState state; Unit *following; + int r; assert(u); @@ -1450,8 +1461,8 @@ int unit_start(Unit *u) { return unit_start(following); } - unit_status_log_starting_stopping_reloading(u, JOB_START); - unit_status_print_starting_stopping(u, JOB_START); + if (UNIT_VTABLE(u)->supported && !UNIT_VTABLE(u)->supported(u->manager)) + return -ENOTSUP; /* If it is stopped, but we cannot start it, then fail */ if (!UNIT_VTABLE(u)->start) @@ -1465,7 +1476,14 @@ int unit_start(Unit *u) { unit_add_to_dbus_queue(u); - return UNIT_VTABLE(u)->start(u); + r = UNIT_VTABLE(u)->start(u); + if (r <= 0) + return r; + + /* Log if the start function actually did something */ + unit_status_log_starting_stopping_reloading(u, JOB_START); + unit_status_print_starting_stopping(u, JOB_START); + return r; } bool unit_can_start(Unit *u) { @@ -1489,6 +1507,7 @@ bool unit_can_isolate(Unit *u) { int unit_stop(Unit *u) { UnitActiveState state; Unit *following; + int r; assert(u); @@ -1496,21 +1515,24 @@ int unit_stop(Unit *u) { if (UNIT_IS_INACTIVE_OR_FAILED(state)) return -EALREADY; - if ((following = unit_following(u))) { - log_unit_debug(u->id, "Redirecting stop request from %s to %s.", - u->id, following->id); + following = unit_following(u); + if (following) { + log_unit_debug(u->id, "Redirecting stop request from %s to %s.", u->id, following->id); return unit_stop(following); } - unit_status_log_starting_stopping_reloading(u, JOB_STOP); - unit_status_print_starting_stopping(u, JOB_STOP); - if (!UNIT_VTABLE(u)->stop) return -EBADR; unit_add_to_dbus_queue(u); - return UNIT_VTABLE(u)->stop(u); + r = UNIT_VTABLE(u)->stop(u); + if (r <= 0) + return r; + + unit_status_log_starting_stopping_reloading(u, JOB_STOP); + unit_status_print_starting_stopping(u, JOB_STOP); + return r; } /* Errors: @@ -1521,6 +1543,7 @@ int unit_stop(Unit *u) { int unit_reload(Unit *u) { UnitActiveState state; Unit *following; + int r; assert(u); @@ -1535,22 +1558,24 @@ int unit_reload(Unit *u) { return -EALREADY; if (state != UNIT_ACTIVE) { - log_unit_warning(u->id, "Unit %s cannot be reloaded because it is inactive.", - u->id); + log_unit_warning(u->id, "Unit %s cannot be reloaded because it is inactive.", u->id); return -ENOEXEC; } following = unit_following(u); if (following) { - log_unit_debug(u->id, "Redirecting reload request from %s to %s.", - u->id, following->id); + log_unit_debug(u->id, "Redirecting reload request from %s to %s.", u->id, following->id); return unit_reload(following); } - unit_status_log_starting_stopping_reloading(u, JOB_RELOAD); - unit_add_to_dbus_queue(u); - return UNIT_VTABLE(u)->reload(u); + + r = UNIT_VTABLE(u)->reload(u); + if (r <= 0) + return r; + + unit_status_log_starting_stopping_reloading(u, JOB_RELOAD); + return r; } bool unit_can_reload(Unit *u) { @@ -1628,7 +1653,7 @@ static void unit_check_binds_to(Unit *u) { if (!stop) return; - log_unit_info(u->id, "Unit %s is bound to inactive service. Stopping, too.", u->id); + log_unit_info(u->id, "Unit %s is bound to inactive unit. Stopping, too.", u->id); /* A unit we need to run is gone. Sniff. Let's stop this. */ manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL); @@ -2673,7 +2698,9 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { if (streq(l, "job")) { if (v[0] == '\0') { /* new-style serialized job */ - Job *j = job_new_raw(u); + Job *j; + + j = job_new_raw(u); if (!j) return -ENOMEM; @@ -2695,12 +2722,11 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { job_free(j); return r; } - - if (j->state == JOB_RUNNING) - u->manager->n_running_jobs++; } else { /* legacy */ - JobType type = job_type_from_string(v); + JobType type; + + type = job_type_from_string(v); if (type < 0) log_debug("Failed to parse job type value %s", v); else @@ -2893,7 +2919,7 @@ bool unit_need_daemon_reload(Unit *u) { return true; } - t = unit_find_dropin_paths(u); + (void) unit_find_dropin_paths(u, &t); loaded_cnt = strv_length(t); current_cnt = strv_length(u->dropin_paths); @@ -3152,6 +3178,10 @@ int unit_patch_contexts(Unit *u) { r = get_home_dir(&ec->working_directory); if (r < 0) return r; + + /* Allow user services to run, even if the + * home directory is missing */ + ec->working_directory_missing_ok = true; } if (u->manager->running_as == SYSTEMD_USER && diff --git a/src/core/unit.h b/src/core/unit.h index 0e45229d7..291bc77a7 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -259,8 +259,8 @@ typedef enum UnitSetPropertiesMode { #include "automount.h" #include "swap.h" #include "timer.h" -#include "path.h" #include "slice.h" +#include "path.h" #include "scope.h" struct UnitVTable { @@ -284,7 +284,7 @@ struct UnitVTable { * that */ size_t exec_runtime_offset; - /* The name of the configuration file section with the private settings of this unit*/ + /* The name of the configuration file section with the private settings of this unit */ const char *private_section; /* Config file sections this unit type understands, separated @@ -345,6 +345,10 @@ struct UnitVTable { * way */ bool (*check_gc)(Unit *u); + /* When the unit is not running and no job for it queued we + * shall release its runtime resources */ + void (*release_resources)(Unit *u); + /* Return true when this unit is suitable for snapshotting */ bool (*check_snapshot)(Unit *u); @@ -359,7 +363,7 @@ struct UnitVTable { void (*notify_cgroup_empty)(Unit *u); /* Called whenever a process of this unit sends us a message */ - void (*notify_message)(Unit *u, pid_t pid, char **tags); + void (*notify_message)(Unit *u, pid_t pid, char **tags, FDSet *fds); /* Called whenever a name this Unit registered for comes or * goes away. */ @@ -396,6 +400,10 @@ struct UnitVTable { /* Type specific cleanups. */ void (*shutdown)(Manager *m); + /* If this function is set and return false all jobs for units + * of this type will immediately fail. */ + bool (*supported)(Manager *m); + /* The interface name */ const char *bus_interface; diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index 3a866f36f..05061c070 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -30,6 +30,7 @@ #include "log.h" #include "mkdir.h" #include "path-util.h" +#include "fstab-util.h" #include "strv.h" #include "unit-name.h" #include "util.h" @@ -50,35 +51,6 @@ static Hashmap *arg_disks = NULL; static char *arg_default_options = NULL; static char *arg_default_keyfile = NULL; -static bool has_option(const char *haystack, const char *needle) { - const char *f = haystack; - size_t l; - - assert(needle); - - if (!haystack) - return false; - - l = strlen(needle); - - while ((f = strstr(f, needle))) { - - if (f > haystack && f[-1] != ',') { - f++; - continue; - } - - if (f[l] != 0 && f[l] != ',') { - f++; - continue; - } - - return true; - } - - return false; -} - static int create_disk( const char *name, const char *device, @@ -95,10 +67,10 @@ static int create_disk( assert(name); assert(device); - noauto = has_option(options, "noauto"); - nofail = has_option(options, "nofail"); - tmp = has_option(options, "tmp"); - swap = has_option(options, "swap"); + noauto = fstab_test_yes_no_option(options, "noauto\0" "auto\0"); + nofail = fstab_test_yes_no_option(options, "nofail\0" "fail\0"); + tmp = fstab_test_option(options, "tmp\0"); + swap = fstab_test_option(options, "swap\0"); if (tmp && swap) { log_error("Device '%s' cannot be both 'tmp' and 'swap'. Ignoring.", name); @@ -211,7 +183,7 @@ static int create_disk( if (ferror(f)) return log_error_errno(errno, "Failed to write file %s: %m", p); - from = strappenda("../", n); + from = strjoina("../", n); if (!noauto) { diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 21b1260f1..3f613d9b6 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -43,6 +43,7 @@ static int arg_key_slot = CRYPT_ANY_SLOT; static unsigned arg_keyfile_size = 0; static unsigned arg_keyfile_offset = 0; static char *arg_hash = NULL; +static char *arg_header = NULL; static unsigned arg_tries = 3; static bool arg_readonly = false; static bool arg_verify = false; @@ -68,7 +69,7 @@ static int parse_one_option(const char *option) { assert(option); /* Handled outside of this tool */ - if (streq(option, "noauto") || streq(option, "nofail")) + if (STR_IN_SET(option, "noauto", "auto", "nofail", "fail")) return 0; if (startswith(option, "cipher=")) { @@ -136,6 +137,23 @@ static int parse_one_option(const char *option) { free(arg_hash); arg_hash = t; + } else if (startswith(option, "header=")) { + arg_type = CRYPT_LUKS1; + + if (!path_is_absolute(option+7)) { + log_error("Header path '%s' is not absolute, refusing.", option+7); + return -EINVAL; + } + + if (arg_header) { + log_error("Duplicate header= options, refusing."); + return -EINVAL; + } + + arg_header = strdup(option+7); + if (!arg_header) + return log_oom(); + } else if (startswith(option, "tries=")) { if (safe_atou(option+6, &arg_tries) < 0) { @@ -277,7 +295,7 @@ static int get_password(const char *name, usec_t until, bool accept_cached, char if (!escaped_name) return log_oom(); - id = strappenda("cryptsetup:", escaped_name); + id = strjoina("cryptsetup:", escaped_name); r = ask_password_auto(text, "drive-harddisk", id, until, accept_cached, passwords); if (r < 0) @@ -291,7 +309,7 @@ static int get_password(const char *name, usec_t until, bool accept_cached, char if (asprintf(&text, "Please enter passphrase for disk %s! (verification)", name) < 0) return log_oom(); - id = strappenda("cryptsetup-verification:", escaped_name); + id = strjoina("cryptsetup-verification:", escaped_name); r = ask_password_auto(text, "drive-harddisk", id, until, false, &passwords2); if (r < 0) @@ -375,6 +393,7 @@ static int attach_tcrypt(struct crypt_device *cd, static int attach_luks_or_plain(struct crypt_device *cd, const char *name, const char *key_file, + const char *data_device, char **passwords, uint32_t flags) { int r = 0; @@ -384,8 +403,16 @@ static int attach_luks_or_plain(struct crypt_device *cd, assert(name); assert(key_file || passwords); - if (!arg_type || streq(arg_type, CRYPT_LUKS1)) + if (!arg_type || streq(arg_type, CRYPT_LUKS1)) { r = crypt_load(cd, CRYPT_LUKS1, NULL); + if (r < 0) { + log_error("crypt_load() failed on device %s.\n", crypt_get_device_name(cd)); + return r; + } + + if (data_device) + r = crypt_set_data_device(cd, data_device); + } if ((!arg_type && r < 0) || streq_ptr(arg_type, CRYPT_PLAIN)) { struct crypt_params_plain params = {}; @@ -559,7 +586,12 @@ int main(int argc, char *argv[]) { } name = name_buffer ? name_buffer : argv[2]; - k = crypt_init(&cd, argv[3]); + if (arg_header) { + log_debug("LUKS header: %s", arg_header); + k = crypt_init(&cd, arg_header); + } else + k = crypt_init(&cd, argv[3]); + if (k) { log_error_errno(k, "crypt_init() failed: %m"); goto finish; @@ -592,7 +624,7 @@ int main(int argc, char *argv[]) { /* Ideally we'd do this on the open fd, but since this is just a * warning it's OK to do this in two steps. */ - if (stat(key_file, &st) >= 0 && (st.st_mode & 0005)) + if (stat(key_file, &st) >= 0 && S_ISREG(st.st_mode) && (st.st_mode & 0005)) log_warning("Key file %s is world-readable. This is not a good idea!", key_file); } @@ -610,7 +642,12 @@ int main(int argc, char *argv[]) { if (streq_ptr(arg_type, CRYPT_TCRYPT)) k = attach_tcrypt(cd, argv[2], key_file, passwords, flags); else - k = attach_luks_or_plain(cd, argv[2], key_file, passwords, flags); + k = attach_luks_or_plain(cd, + argv[2], + key_file, + arg_header ? argv[3] : NULL, + passwords, + flags); if (k >= 0) break; else if (k == -EAGAIN) { @@ -661,6 +698,7 @@ finish: free(arg_cipher); free(arg_hash); + free(arg_header); strv_free(arg_tcrypt_keyfiles); return r; diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c index 10a33efee..2e08af2df 100644 --- a/src/dbus1-generator/dbus1-generator.c +++ b/src/dbus1-generator/dbus1-generator.c @@ -155,6 +155,7 @@ static int add_dbus(const char *path, const char *fname, const char *type) { { "D-BUS Service", "Exec", config_parse_string, 0, &exec }, { "D-BUS Service", "User", config_parse_string, 0, &user }, { "D-BUS Service", "SystemdService", config_parse_string, 0, &service }, + { }, }; char *p; @@ -163,7 +164,7 @@ static int add_dbus(const char *path, const char *fname, const char *type) { assert(path); assert(fname); - p = strappenda(path, "/", fname); + p = strjoina(path, "/", fname); r = config_parse(NULL, p, NULL, "D-BUS Service\0", config_item_table_lookup, table, @@ -249,8 +250,8 @@ fail: static int link_busnames_target(const char *units) { const char *f, *t; - f = strappenda(units, "/" SPECIAL_BUSNAMES_TARGET); - t = strappenda(arg_dest, "/" SPECIAL_BASIC_TARGET ".wants/" SPECIAL_BUSNAMES_TARGET); + f = strjoina(units, "/" SPECIAL_BUSNAMES_TARGET); + t = strjoina(arg_dest, "/" SPECIAL_BASIC_TARGET ".wants/" SPECIAL_BUSNAMES_TARGET); mkdir_parents_label(t, 0755); if (symlink(f, t) < 0) @@ -262,19 +263,19 @@ static int link_busnames_target(const char *units) { static int link_compatibility(const char *units) { const char *f, *t; - f = strappenda(units, "/systemd-bus-proxyd.socket"); - t = strappenda(arg_dest, "/" SPECIAL_DBUS_SOCKET); + f = strjoina(units, "/systemd-bus-proxyd.socket"); + t = strjoina(arg_dest, "/" SPECIAL_DBUS_SOCKET); mkdir_parents_label(t, 0755); if (symlink(f, t) < 0) return log_error_errno(errno, "Failed to create symlink %s: %m", t); - f = strappenda(units, "/systemd-bus-proxyd.socket"); - t = strappenda(arg_dest, "/" SPECIAL_SOCKETS_TARGET ".wants/systemd-bus-proxyd.socket"); + f = strjoina(units, "/systemd-bus-proxyd.socket"); + t = strjoina(arg_dest, "/" SPECIAL_SOCKETS_TARGET ".wants/systemd-bus-proxyd.socket"); mkdir_parents_label(t, 0755); if (symlink(f, t) < 0) return log_error_errno(errno, "Failed to create symlink %s: %m", t); - t = strappenda(arg_dest, "/" SPECIAL_DBUS_SERVICE); + t = strjoina(arg_dest, "/" SPECIAL_DBUS_SERVICE); if (symlink("/dev/null", t) < 0) return log_error_errno(errno, "Failed to mask %s: %m", t); diff --git a/src/delta/delta.c b/src/delta/delta.c index a3a121fb0..de963f700 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -123,7 +123,7 @@ static int notify_override_redirected(const char *top, const char *bottom) { if (!(arg_flags & SHOW_REDIRECTED)) return 0; - printf("%s%s%s %s %s %s\n", + printf("%s%s%s %s %s %s\n", ansi_highlight(), "[REDIRECTED]", ansi_highlight_off(), top, draw_special_char(DRAW_ARROW), bottom); return 1; diff --git a/src/efi-boot-generator/efi-boot-generator.c b/src/efi-boot-generator/efi-boot-generator.c index 99a819fe3..b3ff3a8b7 100644 --- a/src/efi-boot-generator/efi-boot-generator.c +++ b/src/efi-boot-generator/efi-boot-generator.c @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - name = strappenda(arg_dest, "/boot.mount"); + name = strjoina(arg_dest, "/boot.mount"); f = fopen(name, "wxe"); if (!f) { log_error_errno(errno, "Failed to create mount unit file %s: %m", name); @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - name = strappenda(arg_dest, "/boot.automount"); + name = strjoina(arg_dest, "/boot.automount"); fclose(f); f = fopen(name, "wxe"); if (!f) { @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - name = strappenda(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/boot.automount"); + name = strjoina(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/boot.automount"); mkdir_parents(name, 0755); if (symlink("../boot.automount", name) < 0) { diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index d087ef35e..a765d6d21 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -50,7 +50,7 @@ static bool arg_copy_locale = false; static bool arg_copy_timezone = false; static bool arg_copy_root_password = false; -#define prefix_roota(p) (arg_root ? (const char*) strappenda(arg_root, p) : (const char*) p) +#define prefix_roota(p) (arg_root ? (const char*) strjoina(arg_root, p) : (const char*) p) static void clear_string(char *x) { @@ -256,7 +256,7 @@ static int process_locale(void) { if (arg_copy_locale && arg_root) { mkdir_parents(etc_localeconf, 0755); - r = copy_file("/etc/locale.conf", etc_localeconf, 0, 0644); + r = copy_file("/etc/locale.conf", etc_localeconf, 0, 0644, 0); if (r != -ENOENT) { if (r < 0) return log_error_errno(r, "Failed to copy %s: %m", etc_localeconf); @@ -271,9 +271,9 @@ static int process_locale(void) { return r; if (!isempty(arg_locale)) - locales[i++] = strappenda("LANG=", arg_locale); + locales[i++] = strjoina("LANG=", arg_locale); if (!isempty(arg_locale_messages) && !streq(arg_locale_messages, arg_locale)) - locales[i++] = strappenda("LC_MESSAGES=", arg_locale_messages); + locales[i++] = strjoina("LC_MESSAGES=", arg_locale_messages); if (i == 0) return 0; @@ -351,7 +351,7 @@ static int process_timezone(void) { if (isempty(arg_timezone)) return 0; - e = strappenda("../usr/share/zoneinfo/", arg_timezone); + e = strjoina("../usr/share/zoneinfo/", arg_timezone); mkdir_parents(etc_localtime, 0755); if (symlink(e, etc_localtime) < 0) @@ -460,8 +460,8 @@ static int prompt_root_password(void) { print_welcome(); putchar('\n'); - msg1 = strappenda(draw_special_char(DRAW_TRIANGULAR_BULLET), " Please enter a new root password (empty to skip): "); - msg2 = strappenda(draw_special_char(DRAW_TRIANGULAR_BULLET), " Please enter new root password again: "); + msg1 = strjoina(draw_special_char(DRAW_TRIANGULAR_BULLET), " Please enter a new root password (empty to skip): "); + msg2 = strjoina(draw_special_char(DRAW_TRIANGULAR_BULLET), " Please enter new root password again: "); for (;;) { _cleanup_free_ char *a = NULL, *b = NULL; @@ -631,7 +631,7 @@ static void help(void) { " --prompt-timezone Prompt the user for timezone\n" " --prompt-hostname Prompt the user for hostname\n" " --prompt-root-password Prompt the user for root password\n" - " --prompt Prompt for locale, timezone, hostname, root password\n" + " --prompt Prompt for all of the above\n" " --copy-locale Copy locale from host\n" " --copy-timezone Copy timezone from host\n" " --copy-root-password Copy root password from host\n" diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index 20b794094..78ceeb6fa 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) { const char *device, *type; bool root_directory; int progress_pipe[2] = { -1, -1 }; - char dash_c[2+10+1]; + char dash_c[sizeof("-C")-1 + DECIMAL_STR_MAX(int) + 1]; struct stat st; if (argc > 2) { @@ -336,8 +336,7 @@ int main(int argc, char *argv[]) { cmdline[i++] = "-f"; if (progress_pipe[1] >= 0) { - snprintf(dash_c, sizeof(dash_c), "-C%i", progress_pipe[1]); - char_array_0(dash_c); + xsprintf(dash_c, "-C%i", progress_pipe[1]); cmdline[i++] = dash_c; } diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 1f3459492..5662b5fde 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -29,6 +29,7 @@ #include "util.h" #include "unit-name.h" #include "path-util.h" +#include "fstab-util.h" #include "mount-setup.h" #include "special.h" #include "mkdir.h" @@ -47,33 +48,6 @@ static char *arg_usr_what = NULL; static char *arg_usr_fstype = NULL; static char *arg_usr_options = NULL; -static int mount_find_pri(struct mntent *me, int *ret) { - char *end, *opt; - unsigned long r; - - assert(me); - assert(ret); - - opt = hasmntopt(me, "pri"); - if (!opt) - return 0; - - opt += strlen("pri"); - if (*opt != '=') - return -EINVAL; - - errno = 0; - r = strtoul(opt + 1, &end, 10); - if (errno > 0) - return -errno; - - if (end == opt + 1 || (*end != ',' && *end != 0)) - return -EINVAL; - - *ret = (int) r; - return 1; -} - static int add_swap( const char *what, struct mntent *me, @@ -87,16 +61,19 @@ static int add_swap( assert(what); assert(me); + if (access("/proc/swaps", F_OK) < 0) { + log_info("Swap not supported, ignoring fstab swap entry for %s.", what); + return 0; + } + if (detect_container(NULL) > 0) { log_info("Running in a container, ignoring fstab swap entry for %s.", what); return 0; } - r = mount_find_pri(me, &pri); - if (r < 0) { - log_error("Failed to parse priority"); - return r; - } + r = fstab_find_pri(me->mnt_opts, &pri); + if (r < 0) + return log_error_errno(r, "Failed to parse priority: %m"); name = unit_name_from_path(what, ".swap"); if (!name) @@ -158,17 +135,15 @@ static int add_swap( static bool mount_is_network(struct mntent *me) { assert(me); - return - hasmntopt(me, "_netdev") || - fstype_is_network(me->mnt_type); + return fstab_test_option(me->mnt_opts, "_netdev\0") || + fstype_is_network(me->mnt_type); } static bool mount_in_initrd(struct mntent *me) { assert(me); - return - hasmntopt(me, "x-initrd.mount") || - streq(me->mnt_dir, "/usr"); + return fstab_test_option(me->mnt_opts, "x-initrd.mount\0") || + streq(me->mnt_dir, "/usr"); } static int add_mount( @@ -355,7 +330,7 @@ static int parse_fstab(bool initrd) { if (!what) return log_oom(); - if (detect_container(NULL) > 0 && is_device_path(what)) { + if (is_device_path(what) && path_is_read_only_fs("sys") > 0) { log_info("Running in a container, ignoring fstab device entry for %s.", what); continue; } @@ -367,8 +342,8 @@ static int parse_fstab(bool initrd) { if (is_path(where)) path_kill_slashes(where); - noauto = !!hasmntopt(me, "noauto"); - nofail = !!hasmntopt(me, "nofail"); + noauto = fstab_test_yes_no_option(me->mnt_opts, "noauto\0" "auto\0"); + nofail = fstab_test_yes_no_option(me->mnt_opts, "nofail\0" "fail\0"); log_debug("Found entry what=%s where=%s type=%s nofail=%s noauto=%s", what, where, me->mnt_type, yes_no(noauto), yes_no(nofail)); @@ -379,10 +354,9 @@ static int parse_fstab(bool initrd) { bool automount; const char *post; - automount = - hasmntopt(me, "comment=systemd.automount") || - hasmntopt(me, "x-systemd.automount"); - + automount = fstab_test_option(me->mnt_opts, + "comment=systemd.automount\0" + "x-systemd.automount\0"); if (initrd) post = SPECIAL_INITRD_FS_TARGET; else if (mount_in_initrd(me)) @@ -429,9 +403,8 @@ static int add_root_mount(void) { if (!arg_root_options) opts = arg_root_rw > 0 ? "rw" : "ro"; else if (arg_root_rw >= 0 || - (!mount_test_option(arg_root_options, "ro") && - !mount_test_option(arg_root_options, "rw"))) - opts = strappenda(arg_root_options, ",", arg_root_rw > 0 ? "rw" : "ro"); + !fstab_test_option(arg_root_options, "ro\0" "rw\0")) + opts = strjoina(arg_root_options, ",", arg_root_rw > 0 ? "rw" : "ro"); else opts = arg_root_options; @@ -487,9 +460,8 @@ static int add_usr_mount(void) { if (!arg_usr_options) opts = arg_root_rw > 0 ? "rw" : "ro"; - else if (!mount_test_option(arg_usr_options, "ro") && - !mount_test_option(arg_usr_options, "rw")) - opts = strappenda(arg_usr_options, ",", arg_root_rw > 0 ? "rw" : "ro"); + else if (!fstab_test_option(arg_usr_options, "ro\0" "rw\0")) + opts = strjoina(arg_usr_options, ",", arg_root_rw > 0 ? "rw" : "ro"); else opts = arg_usr_options; diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c index 931651e16..f8f5fb30c 100644 --- a/src/getty-generator/getty-generator.c +++ b/src/getty-generator/getty-generator.c @@ -41,8 +41,8 @@ static int add_symlink(const char *fservice, const char *tservice) { assert(fservice); assert(tservice); - from = strappenda(SYSTEM_DATA_UNIT_PATH "/", fservice); - to = strappenda(arg_dest, "/getty.target.wants/", tservice); + from = strjoina(SYSTEM_DATA_UNIT_PATH "/", fservice); + to = strjoina(arg_dest, "/getty.target.wants/", tservice); mkdir_parents_label(to, 0755); @@ -97,7 +97,7 @@ static int verify_tty(const char *name) { * friends. Let's check that and open the device and run * isatty() on it. */ - p = strappenda("/dev/", name); + p = strjoina("/dev/", name); /* O_NONBLOCK is essential here, to make sure we don't wait * for DCD */ @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) { NULSTR_FOREACH(j, virtualization_consoles) { char *p; - p = strappenda("/sys/class/tty/", j); + p = strjoina("/sys/class/tty/", j); if (access(p, F_OK) < 0) continue; diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 32e9b78a1..5c58b58f8 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -26,10 +26,6 @@ #include #include -#ifdef HAVE_LINUX_BTRFS_H -#include -#endif - #include "sd-id128.h" #include "libudev.h" #include "path-util.h" @@ -45,6 +41,7 @@ #include "fileio.h" #include "efivars.h" #include "blkid-util.h" +#include "btrfs-util.h" static const char *arg_dest = "/tmp"; static bool arg_enabled = true; @@ -150,7 +147,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi if (ferror(f)) return log_error_errno(errno, "Failed to write file %s: %m", p); - from = strappenda("../", n); + from = strjoina("../", n); to = strjoin(arg_dest, "/", d, ".wants/", n, NULL); if (!to) @@ -572,54 +569,6 @@ static int enumerate_partitions(dev_t devnum) { return r; } -static int get_btrfs_block_device(const char *path, dev_t *dev) { - struct btrfs_ioctl_fs_info_args fsi = {}; - _cleanup_close_ int fd = -1; - uint64_t id; - - assert(path); - assert(dev); - - fd = open(path, O_DIRECTORY|O_CLOEXEC); - if (fd < 0) - return -errno; - - if (ioctl(fd, BTRFS_IOC_FS_INFO, &fsi) < 0) - return -errno; - - /* We won't do this for btrfs RAID */ - if (fsi.num_devices != 1) - return 0; - - for (id = 1; id <= fsi.max_id; id++) { - struct btrfs_ioctl_dev_info_args di = { - .devid = id, - }; - struct stat st; - - if (ioctl(fd, BTRFS_IOC_DEV_INFO, &di) < 0) { - if (errno == ENODEV) - continue; - - return -errno; - } - - if (stat((char*) di.path, &st) < 0) - return -errno; - - if (!S_ISBLK(st.st_mode)) - return -ENODEV; - - if (major(st.st_rdev) == 0) - return -ENODEV; - - *dev = st.st_rdev; - return 1; - } - - return -ENODEV; -} - static int get_block_device(const char *path, dev_t *dev) { struct stat st; struct statfs sfs; @@ -639,7 +588,7 @@ static int get_block_device(const char *path, dev_t *dev) { return -errno; if (F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC)) - return get_btrfs_block_device(path, dev); + return btrfs_get_block_device(path, dev); return 0; } diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index b3ce8510b..de4ce7ede 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -405,7 +405,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 0b38cde16..7cd4a1d00 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "util.h" #include "strv.h" @@ -34,6 +33,7 @@ #include "label.h" #include "bus-util.h" #include "event-util.h" +#include "selinux-util.h" #define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:") @@ -276,7 +276,7 @@ static int context_update_kernel_hostname(Context *c) { if (hostname_is_useful(static_hn)) hn = static_hn; - /* ... the transient host name, (ie: DHCP) comes next ...*/ + /* ... the transient host name, (ie: DHCP) comes next ... */ else if (!isempty(c->data[PROP_HOSTNAME])) hn = c->data[PROP_HOSTNAME]; @@ -552,7 +552,7 @@ static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop /* The icon name might ultimately be used as file * name, so better be safe than sorry */ - if (prop == PROP_ICON_NAME && !filename_is_safe(name)) + if (prop == PROP_ICON_NAME && !filename_is_valid(name)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid icon name '%s'", name); if (prop == PROP_PRETTY_HOSTNAME && string_has_cc(name, NULL)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid pretty host name '%s'", name); diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c new file mode 100644 index 000000000..4539673ea --- /dev/null +++ b/src/hwdb/hwdb.c @@ -0,0 +1,740 @@ +/*** + This file is part of systemd. + + Copyright 2012 Kay Sievers + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include + +#include "util.h" +#include "strbuf.h" +#include "conf-files.h" +#include "strv.h" +#include "mkdir.h" +#include "fileio.h" +#include "verbs.h" +#include "build.h" + +#include "hwdb-internal.h" +#include "hwdb-util.h" + +/* + * Generic udev properties, key/value database based on modalias strings. + * Uses a Patricia/radix trie to index all matches for efficient lookup. + */ + +static const char *arg_hwdb_bin_dir = "/etc/udev"; +static const char *arg_root = ""; + +static const char * const conf_file_dirs[] = { + "/etc/udev/hwdb.d", + UDEVLIBEXECDIR "/hwdb.d", + NULL +}; + +/* in-memory trie objects */ +struct trie { + struct trie_node *root; + struct strbuf *strings; + + size_t nodes_count; + size_t children_count; + size_t values_count; +}; + +struct trie_node { + /* prefix, common part for all children of this node */ + size_t prefix_off; + + /* sorted array of pointers to children nodes */ + struct trie_child_entry *children; + uint8_t children_count; + + /* sorted array of key/value pairs */ + struct trie_value_entry *values; + size_t values_count; +}; + +/* children array item with char (0-255) index */ +struct trie_child_entry { + uint8_t c; + struct trie_node *child; +}; + +/* value array item with key/value pairs */ +struct trie_value_entry { + size_t key_off; + size_t value_off; +}; + +static int trie_children_cmp(const void *v1, const void *v2) { + const struct trie_child_entry *n1 = v1; + const struct trie_child_entry *n2 = v2; + + return n1->c - n2->c; +} + +static int node_add_child(struct trie *trie, struct trie_node *node, struct trie_node *node_child, uint8_t c) { + struct trie_child_entry *child; + + /* extend array, add new entry, sort for bisection */ + child = realloc(node->children, (node->children_count + 1) * sizeof(struct trie_child_entry)); + if (!child) + return -ENOMEM; + + node->children = child; + trie->children_count++; + node->children[node->children_count].c = c; + node->children[node->children_count].child = node_child; + node->children_count++; + qsort(node->children, node->children_count, sizeof(struct trie_child_entry), trie_children_cmp); + trie->nodes_count++; + + return 0; +} + +static struct trie_node *node_lookup(const struct trie_node *node, uint8_t c) { + struct trie_child_entry *child; + struct trie_child_entry search; + + search.c = c; + child = bsearch(&search, node->children, node->children_count, sizeof(struct trie_child_entry), trie_children_cmp); + if (child) + return child->child; + return NULL; +} + +static void trie_node_cleanup(struct trie_node *node) { + size_t i; + + for (i = 0; i < node->children_count; i++) + trie_node_cleanup(node->children[i].child); + free(node->children); + free(node->values); + free(node); +} + +static void trie_free(struct trie *trie) { + if (!trie) + return; + + if (trie->root) + trie_node_cleanup(trie->root); + + strbuf_cleanup(trie->strings); + free(trie); +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free); + +static int trie_values_cmp(const void *v1, const void *v2, void *arg) { + const struct trie_value_entry *val1 = v1; + const struct trie_value_entry *val2 = v2; + struct trie *trie = arg; + + return strcmp(trie->strings->buf + val1->key_off, + trie->strings->buf + val2->key_off); +} + +static int trie_node_add_value(struct trie *trie, struct trie_node *node, + const char *key, const char *value) { + ssize_t k, v; + struct trie_value_entry *val; + + k = strbuf_add_string(trie->strings, key, strlen(key)); + if (k < 0) + return k; + v = strbuf_add_string(trie->strings, value, strlen(value)); + if (v < 0) + return v; + + if (node->values_count) { + struct trie_value_entry search = { + .key_off = k, + .value_off = v, + }; + + val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie); + if (val) { + /* replace existing earlier key with new value */ + val->value_off = v; + return 0; + } + } + + /* extend array, add new entry, sort for bisection */ + val = realloc(node->values, (node->values_count + 1) * sizeof(struct trie_value_entry)); + if (!val) + return -ENOMEM; + trie->values_count++; + node->values = val; + node->values[node->values_count].key_off = k; + node->values[node->values_count].value_off = v; + node->values_count++; + qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie); + return 0; +} + +static int trie_insert(struct trie *trie, struct trie_node *node, const char *search, + const char *key, const char *value) { + size_t i = 0; + int err = 0; + + for (;;) { + size_t p; + uint8_t c; + struct trie_node *child; + + for (p = 0; (c = trie->strings->buf[node->prefix_off + p]); p++) { + _cleanup_free_ char *s = NULL; + ssize_t off; + _cleanup_free_ struct trie_node *new_child = NULL; + + if (c == search[i + p]) + continue; + + /* split node */ + new_child = new0(struct trie_node, 1); + if (!new_child) + return -ENOMEM; + + /* move values from parent to child */ + new_child->prefix_off = node->prefix_off + p+1; + new_child->children = node->children; + new_child->children_count = node->children_count; + new_child->values = node->values; + new_child->values_count = node->values_count; + + /* update parent; use strdup() because the source gets realloc()d */ + s = strndup(trie->strings->buf + node->prefix_off, p); + if (!s) + return -ENOMEM; + + off = strbuf_add_string(trie->strings, s, p); + if (off < 0) + return off; + + node->prefix_off = off; + node->children = NULL; + node->children_count = 0; + node->values = NULL; + node->values_count = 0; + err = node_add_child(trie, node, new_child, c); + if (err < 0) + return err; + + new_child = NULL; /* avoid cleanup */ + break; + } + i += p; + + c = search[i]; + if (c == '\0') + return trie_node_add_value(trie, node, key, value); + + child = node_lookup(node, c); + if (!child) { + ssize_t off; + + /* new child */ + child = new0(struct trie_node, 1); + if (!child) + return -ENOMEM; + + off = strbuf_add_string(trie->strings, search + i+1, strlen(search + i+1)); + if (off < 0) { + free(child); + return off; + } + + child->prefix_off = off; + err = node_add_child(trie, node, child, c); + if (err < 0) { + free(child); + return err; + } + + return trie_node_add_value(trie, child, key, value); + } + + node = child; + i++; + } +} + +struct trie_f { + FILE *f; + struct trie *trie; + uint64_t strings_off; + + uint64_t nodes_count; + uint64_t children_count; + uint64_t values_count; +}; + +/* calculate the storage space for the nodes, children arrays, value arrays */ +static void trie_store_nodes_size(struct trie_f *trie, struct trie_node *node) { + uint64_t i; + + for (i = 0; i < node->children_count; i++) + trie_store_nodes_size(trie, node->children[i].child); + + trie->strings_off += sizeof(struct trie_node_f); + for (i = 0; i < node->children_count; i++) + trie->strings_off += sizeof(struct trie_child_entry_f); + for (i = 0; i < node->values_count; i++) + trie->strings_off += sizeof(struct trie_value_entry_f); +} + +static int64_t trie_store_nodes(struct trie_f *trie, struct trie_node *node) { + uint64_t i; + struct trie_node_f n = { + .prefix_off = htole64(trie->strings_off + node->prefix_off), + .children_count = node->children_count, + .values_count = htole64(node->values_count), + }; + struct trie_child_entry_f *children = NULL; + int64_t node_off; + + if (node->children_count) { + children = new0(struct trie_child_entry_f, node->children_count); + if (!children) + return -ENOMEM; + } + + /* post-order recursion */ + for (i = 0; i < node->children_count; i++) { + int64_t child_off; + + child_off = trie_store_nodes(trie, node->children[i].child); + if (child_off < 0) { + free(children); + return child_off; + } + children[i].c = node->children[i].c; + children[i].child_off = htole64(child_off); + } + + /* write node */ + node_off = ftello(trie->f); + fwrite(&n, sizeof(struct trie_node_f), 1, trie->f); + trie->nodes_count++; + + /* append children array */ + if (node->children_count) { + fwrite(children, sizeof(struct trie_child_entry_f), node->children_count, trie->f); + trie->children_count += node->children_count; + free(children); + } + + /* append values array */ + for (i = 0; i < node->values_count; i++) { + struct trie_value_entry_f v = { + .key_off = htole64(trie->strings_off + node->values[i].key_off), + .value_off = htole64(trie->strings_off + node->values[i].value_off), + }; + + fwrite(&v, sizeof(struct trie_value_entry_f), 1, trie->f); + trie->values_count++; + } + + return node_off; +} + +static int trie_store(struct trie *trie, const char *filename) { + struct trie_f t = { + .trie = trie, + }; + _cleanup_free_ char *filename_tmp = NULL; + int64_t pos; + int64_t root_off; + int64_t size; + struct trie_header_f h = { + .signature = HWDB_SIG, + .tool_version = htole64(atoi(VERSION)), + .header_size = htole64(sizeof(struct trie_header_f)), + .node_size = htole64(sizeof(struct trie_node_f)), + .child_entry_size = htole64(sizeof(struct trie_child_entry_f)), + .value_entry_size = htole64(sizeof(struct trie_value_entry_f)), + }; + int err; + + /* calculate size of header, nodes, children entries, value entries */ + t.strings_off = sizeof(struct trie_header_f); + trie_store_nodes_size(&t, trie->root); + + err = fopen_temporary(filename , &t.f, &filename_tmp); + if (err < 0) + return err; + fchmod(fileno(t.f), 0444); + + /* write nodes */ + err = fseeko(t.f, sizeof(struct trie_header_f), SEEK_SET); + if (err < 0) { + fclose(t.f); + unlink_noerrno(filename_tmp); + return -errno; + } + root_off = trie_store_nodes(&t, trie->root); + h.nodes_root_off = htole64(root_off); + pos = ftello(t.f); + h.nodes_len = htole64(pos - sizeof(struct trie_header_f)); + + /* write string buffer */ + fwrite(trie->strings->buf, trie->strings->len, 1, t.f); + h.strings_len = htole64(trie->strings->len); + + /* write header */ + size = ftello(t.f); + h.file_size = htole64(size); + err = fseeko(t.f, 0, SEEK_SET); + if (err < 0) { + fclose(t.f); + unlink_noerrno(filename_tmp); + return -errno; + } + fwrite(&h, sizeof(struct trie_header_f), 1, t.f); + err = ferror(t.f); + if (err) + err = -errno; + fclose(t.f); + if (err < 0 || rename(filename_tmp, filename) < 0) { + unlink_noerrno(filename_tmp); + return err < 0 ? err : -errno; + } + + log_debug("=== trie on-disk ==="); + log_debug("size: %8"PRIi64" bytes", size); + log_debug("header: %8zu bytes", sizeof(struct trie_header_f)); + log_debug("nodes: %8"PRIu64" bytes (%8"PRIu64")", + t.nodes_count * sizeof(struct trie_node_f), t.nodes_count); + log_debug("child pointers: %8"PRIu64" bytes (%8"PRIu64")", + t.children_count * sizeof(struct trie_child_entry_f), t.children_count); + log_debug("value pointers: %8"PRIu64" bytes (%8"PRIu64")", + t.values_count * sizeof(struct trie_value_entry_f), t.values_count); + log_debug("string store: %8zu bytes", trie->strings->len); + log_debug("strings start: %8"PRIu64, t.strings_off); + + return 0; +} + +static int insert_data(struct trie *trie, char **match_list, char *line, const char *filename) { + char *value, **entry; + + value = strchr(line, '='); + if (!value) { + log_error("Error, key/value pair expected but got '%s' in '%s':", line, filename); + return -EINVAL; + } + + value[0] = '\0'; + value++; + + /* libudev requires properties to start with a space */ + while (isblank(line[0]) && isblank(line[1])) + line++; + + if (line[0] == '\0' || value[0] == '\0') { + log_error("Error, empty key or value '%s' in '%s':", line, filename); + return -EINVAL; + } + + STRV_FOREACH(entry, match_list) + trie_insert(trie, trie->root, *entry, line, value); + + return 0; +} + +static int import_file(struct trie *trie, const char *filename) { + enum { + HW_NONE, + HW_MATCH, + HW_DATA, + } state = HW_NONE; + _cleanup_fclose_ FILE *f = NULL; + char line[LINE_MAX]; + _cleanup_strv_free_ char **match_list = NULL; + char *match = NULL; + int r; + + f = fopen(filename, "re"); + if (!f) + return -errno; + + while (fgets(line, sizeof(line), f)) { + size_t len; + char *pos; + + /* comment line */ + if (line[0] == '#') + continue; + + /* strip trailing comment */ + pos = strchr(line, '#'); + if (pos) + pos[0] = '\0'; + + /* strip trailing whitespace */ + len = strlen(line); + while (len > 0 && isspace(line[len-1])) + len--; + line[len] = '\0'; + + switch (state) { + case HW_NONE: + if (len == 0) + break; + + if (line[0] == ' ') { + log_error("Error, MATCH expected but got '%s' in '%s':", line, filename); + break; + } + + /* start of record, first match */ + state = HW_MATCH; + + match = strdup(line); + if (!match) + return -ENOMEM; + + r = strv_consume(&match_list, match); + if (r < 0) + return r; + + break; + + case HW_MATCH: + if (len == 0) { + log_error("Error, DATA expected but got empty line in '%s':", filename); + state = HW_NONE; + strv_clear(match_list); + break; + } + + /* another match */ + if (line[0] != ' ') { + match = strdup(line); + if (!match) + return -ENOMEM; + + r = strv_consume(&match_list, match); + if (r < 0) + return r; + + break; + } + + /* first data */ + state = HW_DATA; + insert_data(trie, match_list, line, filename); + break; + + case HW_DATA: + /* end of record */ + if (len == 0) { + state = HW_NONE; + strv_clear(match_list); + break; + } + + if (line[0] != ' ') { + log_error("Error, DATA expected but got '%s' in '%s':", line, filename); + state = HW_NONE; + strv_clear(match_list); + break; + } + + insert_data(trie, match_list, line, filename); + break; + }; + } + + return 0; +} + +static int hwdb_query(int argc, char *argv[], void *userdata) { + _cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL; + const char *key, *value; + const char *modalias; + int r; + + assert(argc >= 2); + assert(argv); + + modalias = argv[1]; + + r = sd_hwdb_new(&hwdb); + if (r < 0) + return r; + + SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) + printf("%s=%s\n", key, value); + + return 0; +} + +static int hwdb_update(int argc, char *argv[], void *userdata) { + _cleanup_free_ char *hwdb_bin = NULL; + _cleanup_(trie_freep) struct trie *trie = NULL; + char **files, **f; + int r; + + trie = new0(struct trie, 1); + if (!trie) + return -ENOMEM; + + /* string store */ + trie->strings = strbuf_new(); + if (!trie->strings) + return -ENOMEM; + + /* index */ + trie->root = new0(struct trie_node, 1); + if (!trie->root) + return -ENOMEM; + + trie->nodes_count++; + + r = conf_files_list_strv(&files, ".hwdb", arg_root, conf_file_dirs); + if (r < 0) + return log_error_errno(r, "failed to enumerate hwdb files: %m"); + + STRV_FOREACH(f, files) { + log_debug("reading file '%s'", *f); + import_file(trie, *f); + } + strv_free(files); + + strbuf_complete(trie->strings); + + log_debug("=== trie in-memory ==="); + log_debug("nodes: %8zu bytes (%8zu)", + trie->nodes_count * sizeof(struct trie_node), trie->nodes_count); + log_debug("children arrays: %8zu bytes (%8zu)", + trie->children_count * sizeof(struct trie_child_entry), trie->children_count); + log_debug("values arrays: %8zu bytes (%8zu)", + trie->values_count * sizeof(struct trie_value_entry), trie->values_count); + log_debug("strings: %8zu bytes", + trie->strings->len); + log_debug("strings incoming: %8zu bytes (%8zu)", + trie->strings->in_len, trie->strings->in_count); + log_debug("strings dedup'ed: %8zu bytes (%8zu)", + trie->strings->dedup_len, trie->strings->dedup_count); + + hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin", NULL); + if (!hwdb_bin) + return -ENOMEM; + + mkdir_parents(hwdb_bin, 0755); + r = trie_store(trie, hwdb_bin); + if (r < 0) + return log_error_errno(r, "Failure writing database %s: %m", hwdb_bin); + + return 0; +} + +static void help(void) { + printf("Usage: %s OPTIONS COMMAND\n\n" + "Update or query the hardware database.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --usr Generate in " UDEVLIBEXECDIR " instead of /etc/udev\n" + " -r --root=PATH Alternative root path in the filesystem\n\n" + "Commands:\n" + " update Update the hwdb database\n" + " query MODALIAS Query database and print result\n", + program_invocation_short_name); +} + +static int parse_argv(int argc, char *argv[]) { + enum { + ARG_VERSION = 0x100, + ARG_USR, + }; + + static const struct option options[] = { + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, ARG_VERSION }, + { "usr", no_argument, NULL, ARG_USR }, + { "root", required_argument, NULL, 'r' }, + {} + }; + + int c; + + assert(argc >= 0); + assert(argv); + + while ((c = getopt_long(argc, argv, "ut:r:h", options, NULL)) >= 0) { + switch(c) { + + case 'h': + help(); + return 0; + + case ARG_VERSION: + puts(PACKAGE_STRING); + puts(SYSTEMD_FEATURES); + return 0; + + case ARG_USR: + arg_hwdb_bin_dir = UDEVLIBEXECDIR; + break; + + case 'r': + arg_root = optarg; + break; + + case '?': + return -EINVAL; + + default: + assert_not_reached("Unknown option"); + } + } + + return 1; +} + +static int hwdb_main(int argc, char *argv[]) { + const Verb verbs[] = { + { "update", 1, 1, 0, hwdb_update }, + { "query", 2, 2, 0, hwdb_query }, + {}, + }; + + return dispatch_verb(argc, argv, verbs, NULL); +} + +int main (int argc, char *argv[]) { + int r; + + log_parse_environment(); + log_open(); + + r = parse_argv(argc, argv); + if (r <= 0) + goto finish; + + r = hwdb_main(argc, argv); + +finish: + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/src/import/aufs-util.c b/src/import/aufs-util.c new file mode 100644 index 000000000..c1301cdb4 --- /dev/null +++ b/src/import/aufs-util.c @@ -0,0 +1,73 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "util.h" +#include "aufs-util.h" + +static int nftw_cb( + const char *fpath, + const struct stat *sb, + int flag, + struct FTW *ftwbuf) { + + const char *fn, *original; + char *p; + int r; + + fn = fpath + ftwbuf->base; + + /* We remove all whiteout files, and all whiteouts */ + + original = startswith(fn, ".wh."); + if (!original) + return FTW_CONTINUE; + + log_debug("Removing whiteout indicator %s.", fpath); + r = rm_rf_dangerous(fpath, false, true, false); + if (r < 0) + return FTW_STOP; + + if (!startswith(fn, ".wh..wh.")) { + + p = alloca(ftwbuf->base + strlen(original)); + strcpy(mempcpy(p, fpath, ftwbuf->base), original); + + log_debug("Removing deleted file %s.", p); + r = rm_rf_dangerous(p, false, true, false); + if (r < 0) + return FTW_STOP; + } + + return FTW_CONTINUE; +} + +int aufs_resolve(const char *path) { + int r; + + errno = 0; + r = nftw(path, nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL); + if (r == FTW_STOP) + return errno ? -errno : -EIO; + + return 0; +} diff --git a/src/import/aufs-util.h b/src/import/aufs-util.h new file mode 100644 index 000000000..712fb81ce --- /dev/null +++ b/src/import/aufs-util.h @@ -0,0 +1,24 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +int aufs_resolve(const char *path); diff --git a/src/import/curl-util.c b/src/import/curl-util.c new file mode 100644 index 000000000..d390cfb1f --- /dev/null +++ b/src/import/curl-util.c @@ -0,0 +1,449 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "curl-util.h" + +static void curl_glue_check_finished(CurlGlue *g) { + CURLMsg *msg; + int k = 0; + + assert(g); + + msg = curl_multi_info_read(g->curl, &k); + if (!msg) + return; + + if (msg->msg != CURLMSG_DONE) + return; + + if (g->on_finished) + g->on_finished(g, msg->easy_handle, msg->data.result); +} + +static int curl_glue_on_io(sd_event_source *s, int fd, uint32_t revents, void *userdata) { + CurlGlue *g = userdata; + int action, k = 0, translated_fd; + + assert(s); + assert(g); + + translated_fd = PTR_TO_INT(hashmap_get(g->translate_fds, INT_TO_PTR(fd+1))); + assert(translated_fd > 0); + translated_fd--; + + if ((revents & (EPOLLIN|EPOLLOUT)) == (EPOLLIN|EPOLLOUT)) + action = CURL_POLL_INOUT; + else if (revents & EPOLLIN) + action = CURL_POLL_IN; + else if (revents & EPOLLOUT) + action = CURL_POLL_OUT; + else + action = 0; + + if (curl_multi_socket_action(g->curl, translated_fd, action, &k) < 0) { + log_debug("Failed to propagate IO event."); + return -EINVAL; + } + + curl_glue_check_finished(g); + return 0; +} + +static int curl_glue_socket_callback(CURLM *curl, curl_socket_t s, int action, void *userdata, void *socketp) { + sd_event_source *io; + CurlGlue *g = userdata; + uint32_t events = 0; + int r; + + assert(curl); + assert(g); + + io = hashmap_get(g->ios, INT_TO_PTR(s+1)); + + if (action == CURL_POLL_REMOVE) { + if (io) { + int fd; + + fd = sd_event_source_get_io_fd(io); + assert(fd >= 0); + + sd_event_source_set_enabled(io, SD_EVENT_OFF); + sd_event_source_unref(io); + + hashmap_remove(g->ios, INT_TO_PTR(s+1)); + hashmap_remove(g->translate_fds, INT_TO_PTR(fd+1)); + + safe_close(fd); + } + + return 0; + } + + r = hashmap_ensure_allocated(&g->ios, &trivial_hash_ops); + if (r < 0) { + log_oom(); + return -1; + } + + r = hashmap_ensure_allocated(&g->translate_fds, &trivial_hash_ops); + if (r < 0) { + log_oom(); + return -1; + } + + if (action == CURL_POLL_IN) + events = EPOLLIN; + else if (action == CURL_POLL_OUT) + events = EPOLLOUT; + else if (action == CURL_POLL_INOUT) + events = EPOLLIN|EPOLLOUT; + + if (io) { + if (sd_event_source_set_io_events(io, events) < 0) + return -1; + + if (sd_event_source_set_enabled(io, SD_EVENT_ON) < 0) + return -1; + } else { + _cleanup_close_ int fd = -1; + + /* When curl needs to remove an fd from us it closes + * the fd first, and only then calls into us. This is + * nasty, since we cannot pass the fd on to epoll() + * anymore. Hence, duplicate the fds here, and keep a + * copy for epoll which we control after use. */ + + fd = fcntl(s, F_DUPFD_CLOEXEC, 3); + if (fd < 0) + return -1; + + if (sd_event_add_io(g->event, &io, fd, events, curl_glue_on_io, g) < 0) + return -1; + + sd_event_source_set_description(io, "curl-io"); + + r = hashmap_put(g->ios, INT_TO_PTR(s+1), io); + if (r < 0) { + log_oom(); + sd_event_source_unref(io); + return -1; + } + + r = hashmap_put(g->translate_fds, INT_TO_PTR(fd+1), INT_TO_PTR(s+1)); + if (r < 0) { + log_oom(); + hashmap_remove(g->ios, INT_TO_PTR(s+1)); + sd_event_source_unref(io); + return -1; + } + + fd = -1; + } + + return 0; +} + +static int curl_glue_on_timer(sd_event_source *s, uint64_t usec, void *userdata) { + CurlGlue *g = userdata; + int k = 0; + + assert(s); + assert(g); + + if (curl_multi_socket_action(g->curl, CURL_SOCKET_TIMEOUT, 0, &k) != CURLM_OK) { + log_debug("Failed to propagate timeout."); + return -EINVAL; + } + + curl_glue_check_finished(g); + return 0; +} + +static int curl_glue_timer_callback(CURLM *curl, long timeout_ms, void *userdata) { + CurlGlue *g = userdata; + usec_t usec; + + assert(curl); + assert(g); + + if (timeout_ms < 0) { + if (g->timer) { + if (sd_event_source_set_enabled(g->timer, SD_EVENT_OFF) < 0) + return -1; + } + + return 0; + } + + usec = now(clock_boottime_or_monotonic()) + (usec_t) timeout_ms * USEC_PER_MSEC + USEC_PER_MSEC - 1; + + if (g->timer) { + if (sd_event_source_set_time(g->timer, usec) < 0) + return -1; + + if (sd_event_source_set_enabled(g->timer, SD_EVENT_ONESHOT) < 0) + return -1; + } else { + if (sd_event_add_time(g->event, &g->timer, clock_boottime_or_monotonic(), usec, 0, curl_glue_on_timer, g) < 0) + return -1; + + sd_event_source_set_description(g->timer, "curl-timer"); + } + + return 0; +} + +CurlGlue *curl_glue_unref(CurlGlue *g) { + sd_event_source *io; + + if (!g) + return NULL; + + if (g->curl) + curl_multi_cleanup(g->curl); + + while ((io = hashmap_steal_first(g->ios))) { + int fd; + + fd = sd_event_source_get_io_fd(io); + assert(fd >= 0); + + hashmap_remove(g->translate_fds, INT_TO_PTR(fd+1)); + + safe_close(fd); + sd_event_source_unref(io); + } + + hashmap_free(g->ios); + + sd_event_source_unref(g->timer); + sd_event_unref(g->event); + free(g); + + return NULL; +} + +int curl_glue_new(CurlGlue **glue, sd_event *event) { + _cleanup_(curl_glue_unrefp) CurlGlue *g = NULL; + int r; + + g = new0(CurlGlue, 1); + if (!g) + return -ENOMEM; + + if (event) + g->event = sd_event_ref(event); + else { + r = sd_event_default(&g->event); + if (r < 0) + return r; + } + + g->curl = curl_multi_init(); + if (!g->curl) + return -ENOMEM; + + if (curl_multi_setopt(g->curl, CURLMOPT_SOCKETDATA, g) != CURLM_OK) + return -EINVAL; + + if (curl_multi_setopt(g->curl, CURLMOPT_SOCKETFUNCTION, curl_glue_socket_callback) != CURLM_OK) + return -EINVAL; + + if (curl_multi_setopt(g->curl, CURLMOPT_TIMERDATA, g) != CURLM_OK) + return -EINVAL; + + if (curl_multi_setopt(g->curl, CURLMOPT_TIMERFUNCTION, curl_glue_timer_callback) != CURLM_OK) + return -EINVAL; + + *glue = g; + g = NULL; + + return 0; +} + +int curl_glue_make(CURL **ret, const char *url, void *userdata) { + const char *useragent; + CURL *c; + int r; + + assert(ret); + assert(url); + + c = curl_easy_init(); + if (!c) + return -ENOMEM; + + /* curl_easy_setopt(c, CURLOPT_VERBOSE, 1L); */ + + if (curl_easy_setopt(c, CURLOPT_URL, url) != CURLE_OK) { + r = -EIO; + goto fail; + } + + if (curl_easy_setopt(c, CURLOPT_PRIVATE, userdata) != CURLE_OK) { + r = -EIO; + goto fail; + } + + useragent = strjoina(program_invocation_short_name, "/" PACKAGE_VERSION); + if (curl_easy_setopt(c, CURLOPT_USERAGENT, useragent) != CURLE_OK) { + r = -EIO; + goto fail; + } + + if (curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) { + r = -EIO; + goto fail; + } + + *ret = c; + return 0; + +fail: + curl_easy_cleanup(c); + return r; +} + +int curl_glue_add(CurlGlue *g, CURL *c) { + assert(g); + assert(c); + + if (curl_multi_add_handle(g->curl, c) != CURLM_OK) + return -EIO; + + return 0; +} + +void curl_glue_remove_and_free(CurlGlue *g, CURL *c) { + assert(g); + + if (!c) + return; + + if (g->curl) + curl_multi_remove_handle(g->curl, c); + + curl_easy_cleanup(c); +} + +struct curl_slist *curl_slist_new(const char *first, ...) { + struct curl_slist *l; + va_list ap; + + if (!first) + return NULL; + + l = curl_slist_append(NULL, first); + if (!l) + return NULL; + + va_start(ap, first); + + for (;;) { + struct curl_slist *n; + const char *i; + + i = va_arg(ap, const char*); + if (!i) + break; + + n = curl_slist_append(l, i); + if (!n) { + va_end(ap); + curl_slist_free_all(l); + return NULL; + } + + l = n; + } + + va_end(ap); + return l; +} + +int curl_header_strdup(const void *contents, size_t sz, const char *field, char **value) { + const char *p = contents; + size_t l; + char *s; + + l = strlen(field); + if (sz < l) + return 0; + + if (memcmp(p, field, l) != 0) + return 0; + + p += l; + sz -= l; + + if (memchr(p, 0, sz)) + return 0; + + /* Skip over preceeding whitespace */ + while (sz > 0 && strchr(WHITESPACE, p[0])) { + p++; + sz--; + } + + /* Truncate trailing whitespace*/ + while (sz > 0 && strchr(WHITESPACE, p[sz-1])) + sz--; + + s = strndup(p, sz); + if (!s) + return -ENOMEM; + + *value = s; + return 1; +} + +int curl_parse_http_time(const char *t, usec_t *ret) { + const char *e; + locale_t loc; + struct tm tm; + time_t v; + + assert(t); + assert(ret); + + loc = newlocale(LC_TIME_MASK, "C", (locale_t) 0); + if (loc == (locale_t) 0) + return -errno; + + /* RFC822 */ + e = strptime_l(t, "%a, %d %b %Y %H:%M:%S %Z", &tm, loc); + if (!e || *e != 0) + /* RFC 850 */ + e = strptime_l(t, "%A, %d-%b-%y %H:%M:%S %Z", &tm, loc); + if (!e || *e != 0) + /* ANSI C */ + e = strptime_l(t, "%a %b %d %H:%M:%S %Y", &tm, loc); + freelocale(loc); + if (!e || *e != 0) + return -EINVAL; + + v = timegm(&tm); + if (v == (time_t) -1) + return -EINVAL; + + *ret = (usec_t) v * USEC_PER_SEC; + return 0; +} diff --git a/src/import/curl-util.h b/src/import/curl-util.h new file mode 100644 index 000000000..c249069ff --- /dev/null +++ b/src/import/curl-util.h @@ -0,0 +1,57 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "hashmap.h" +#include "sd-event.h" + +typedef struct CurlGlue CurlGlue; + +struct CurlGlue { + sd_event *event; + CURLM *curl; + sd_event_source *timer; + Hashmap *ios; + Hashmap *translate_fds; + + void (*on_finished)(CurlGlue *g, CURL *curl, CURLcode code); + void *userdata; +}; + +int curl_glue_new(CurlGlue **glue, sd_event *event); +CurlGlue* curl_glue_unref(CurlGlue *glue); + +DEFINE_TRIVIAL_CLEANUP_FUNC(CurlGlue*, curl_glue_unref); + +int curl_glue_make(CURL **ret, const char *url, void *userdata); +int curl_glue_add(CurlGlue *g, CURL *c); +void curl_glue_remove_and_free(CurlGlue *g, CURL *c); + +struct curl_slist *curl_slist_new(const char *first, ...) _sentinel_; +int curl_header_strdup(const void *contents, size_t sz, const char *field, char **value); +int curl_parse_http_time(const char *t, usec_t *ret); + +DEFINE_TRIVIAL_CLEANUP_FUNC(CURL*, curl_easy_cleanup); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct curl_slist*, curl_slist_free_all); diff --git a/src/import/import-common.c b/src/import/import-common.c new file mode 100644 index 000000000..2acf380f9 --- /dev/null +++ b/src/import/import-common.c @@ -0,0 +1,530 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "util.h" +#include "strv.h" +#include "copy.h" +#include "btrfs-util.h" +#include "capability.h" +#include "import-job.h" +#include "import-common.h" + +#define FILENAME_ESCAPE "/.#\"\'" + +int import_find_old_etags(const char *url, const char *image_root, int dt, const char *prefix, const char *suffix, char ***etags) { + _cleanup_free_ char *escaped_url = NULL; + _cleanup_closedir_ DIR *d = NULL; + _cleanup_strv_free_ char **l = NULL; + struct dirent *de; + int r; + + assert(url); + assert(etags); + + if (!image_root) + image_root = "/var/lib/machines"; + + escaped_url = xescape(url, FILENAME_ESCAPE); + if (!escaped_url) + return -ENOMEM; + + d = opendir(image_root); + if (!d) { + if (errno == ENOENT) { + *etags = NULL; + return 0; + } + + return -errno; + } + + FOREACH_DIRENT_ALL(de, d, return -errno) { + const char *a, *b; + char *u; + + if (de->d_type != DT_UNKNOWN && + de->d_type != dt) + continue; + + if (prefix) { + a = startswith(de->d_name, prefix); + if (!a) + continue; + } else + a = de->d_name; + + a = startswith(a, escaped_url); + if (!a) + continue; + + a = startswith(a, "."); + if (!a) + continue; + + if (suffix) { + b = endswith(de->d_name, suffix); + if (!b) + continue; + } else + b = strchr(de->d_name, 0); + + if (a >= b) + continue; + + u = cunescape_length(a, b - a); + if (!u) + return -ENOMEM; + + if (!http_etag_is_valid(u)) { + free(u); + continue; + } + + r = strv_consume(&l, u); + if (r < 0) + return r; + } + + *etags = l; + l = NULL; + + return 0; +} + +int import_make_local_copy(const char *final, const char *image_root, const char *local, bool force_local) { + const char *p; + int r; + + assert(final); + assert(local); + + if (!image_root) + image_root = "/var/lib/machines"; + + p = strjoina(image_root, "/", local); + + if (force_local) { + (void) btrfs_subvol_remove(p); + (void) rm_rf_dangerous(p, false, true, false); + } + + r = btrfs_subvol_snapshot(final, p, false, false); + if (r == -ENOTTY) { + r = copy_tree(final, p, false); + if (r < 0) + return log_error_errno(r, "Failed to copy image: %m"); + } else if (r < 0) + return log_error_errno(r, "Failed to create local image: %m"); + + log_info("Created new local image '%s'.", local); + + return 0; +} + +int import_make_read_only_fd(int fd) { + int r; + + assert(fd >= 0); + + /* First, let's make this a read-only subvolume if it refers + * to a subvolume */ + r = btrfs_subvol_set_read_only_fd(fd, true); + if (r == -ENOTTY || r == -ENOTDIR || r == -EINVAL) { + struct stat st; + + /* This doesn't refer to a subvolume, or the file + * system isn't even btrfs. In that, case fall back to + * chmod()ing */ + + r = fstat(fd, &st); + if (r < 0) + return log_error_errno(errno, "Failed to stat temporary image: %m"); + + /* Drop "w" flag */ + if (fchmod(fd, st.st_mode & 07555) < 0) + return log_error_errno(errno, "Failed to chmod() final image: %m"); + + return 0; + + } else if (r < 0) + return log_error_errno(r, "Failed to make subvolume read-only: %m"); + + return 0; +} + +int import_make_read_only(const char *path) { + _cleanup_close_ int fd = 1; + + fd = open(path, O_RDONLY|O_NOCTTY|O_CLOEXEC); + if (fd < 0) + return log_error_errno(errno, "Failed to open %s: %m", path); + + return import_make_read_only_fd(fd); +} + +int import_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret) { + _cleanup_free_ char *escaped_url = NULL; + char *path; + + assert(url); + assert(ret); + + if (!image_root) + image_root = "/var/lib/machines"; + + escaped_url = xescape(url, FILENAME_ESCAPE); + if (!escaped_url) + return -ENOMEM; + + if (etag) { + _cleanup_free_ char *escaped_etag = NULL; + + escaped_etag = xescape(etag, FILENAME_ESCAPE); + if (!escaped_etag) + return -ENOMEM; + + path = strjoin(image_root, "/", strempty(prefix), escaped_url, ".", escaped_etag, strempty(suffix), NULL); + } else + path = strjoin(image_root, "/", strempty(prefix), escaped_url, strempty(suffix), NULL); + if (!path) + return -ENOMEM; + + *ret = path; + return 0; +} + +int import_make_verification_jobs( + ImportJob **ret_checksum_job, + ImportJob **ret_signature_job, + ImportVerify verify, + const char *url, + CurlGlue *glue, + ImportJobFinished on_finished, + void *userdata) { + + _cleanup_(import_job_unrefp) ImportJob *checksum_job = NULL, *signature_job = NULL; + int r; + + assert(ret_checksum_job); + assert(ret_signature_job); + assert(verify >= 0); + assert(verify < _IMPORT_VERIFY_MAX); + assert(url); + assert(glue); + + if (verify != IMPORT_VERIFY_NO) { + _cleanup_free_ char *checksum_url = NULL; + + /* Queue job for the SHA256SUMS file for the image */ + r = import_url_change_last_component(url, "SHA256SUMS", &checksum_url); + if (r < 0) + return r; + + r = import_job_new(&checksum_job, checksum_url, glue, userdata); + if (r < 0) + return r; + + checksum_job->on_finished = on_finished; + checksum_job->uncompressed_max = checksum_job->compressed_max = 1ULL * 1024ULL * 1024ULL; + } + + if (verify == IMPORT_VERIFY_SIGNATURE) { + _cleanup_free_ char *signature_url = NULL; + + /* Queue job for the SHA256SUMS.gpg file for the image. */ + r = import_url_change_last_component(url, "SHA256SUMS.gpg", &signature_url); + if (r < 0) + return r; + + r = import_job_new(&signature_job, signature_url, glue, userdata); + if (r < 0) + return r; + + signature_job->on_finished = on_finished; + signature_job->uncompressed_max = signature_job->compressed_max = 1ULL * 1024ULL * 1024ULL; + } + + *ret_checksum_job = checksum_job; + *ret_signature_job = signature_job; + + checksum_job = signature_job = NULL; + + return 0; +} + +int import_verify( + ImportJob *main_job, + ImportJob *checksum_job, + ImportJob *signature_job) { + + _cleanup_close_pair_ int gpg_pipe[2] = { -1, -1 }; + _cleanup_free_ char *fn = NULL; + _cleanup_close_ int sig_file = -1; + const char *p, *line; + char sig_file_path[] = "/tmp/sigXXXXXX"; + _cleanup_sigkill_wait_ pid_t pid = 0; + int r; + + assert(main_job); + assert(main_job->state == IMPORT_JOB_DONE); + + if (!checksum_job) + return 0; + + assert(main_job->calc_checksum); + assert(main_job->checksum); + assert(checksum_job->state == IMPORT_JOB_DONE); + + if (!checksum_job->payload || checksum_job->payload_size <= 0) { + log_error("Checksum is empty, cannot verify."); + return -EBADMSG; + } + + r = import_url_last_component(main_job->url, &fn); + if (r < 0) + return log_oom(); + + if (!filename_is_valid(fn)) { + log_error("Cannot verify checksum, could not determine valid server-side file name."); + return -EBADMSG; + } + + line = strjoina(main_job->checksum, " *", fn, "\n"); + + p = memmem(checksum_job->payload, + checksum_job->payload_size, + line, + strlen(line)); + + if (!p || (p != (char*) checksum_job->payload && p[-1] != '\n')) { + log_error("Checksum did not check out, payload has been tempered with."); + return -EBADMSG; + } + + log_info("SHA256 checksum of %s is valid.", main_job->url); + + if (!signature_job) + return 0; + + assert(signature_job->state == IMPORT_JOB_DONE); + + if (!signature_job->payload || signature_job->payload_size <= 0) { + log_error("Signature is empty, cannot verify."); + return -EBADMSG; + } + + r = pipe2(gpg_pipe, O_CLOEXEC); + if (r < 0) + return log_error_errno(errno, "Failed to create pipe for gpg: %m"); + + sig_file = mkostemp(sig_file_path, O_RDWR); + if (sig_file < 0) + return log_error_errno(errno, "Failed to create temporary file: %m"); + + r = loop_write(sig_file, signature_job->payload, signature_job->payload_size, false); + if (r < 0) { + log_error_errno(r, "Failed to write to temporary file: %m"); + goto finish; + } + + pid = fork(); + if (pid < 0) + return log_error_errno(errno, "Failed to fork off gpg: %m"); + if (pid == 0) { + const char *cmd[] = { + "gpg", + "--no-options", + "--no-default-keyring", + "--no-auto-key-locate", + "--no-auto-check-trustdb", + "--batch", + "--trust-model=always", + NULL, /* keyring to use */ + NULL, /* --verify */ + NULL, /* signature file */ + NULL, /* dash */ + NULL /* trailing NULL */ + }; + unsigned k = ELEMENTSOF(cmd) - 5; + int null_fd; + + /* Child */ + + reset_all_signal_handlers(); + reset_signal_mask(); + assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); + + gpg_pipe[1] = safe_close(gpg_pipe[1]); + + if (dup2(gpg_pipe[0], STDIN_FILENO) != STDIN_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (gpg_pipe[0] != STDIN_FILENO) + gpg_pipe[0] = safe_close(gpg_pipe[0]); + + null_fd = open("/dev/null", O_WRONLY|O_NOCTTY); + if (null_fd < 0) { + log_error_errno(errno, "Failed to open /dev/null: %m"); + _exit(EXIT_FAILURE); + } + + if (dup2(null_fd, STDOUT_FILENO) != STDOUT_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (null_fd != STDOUT_FILENO) + null_fd = safe_close(null_fd); + + /* We add the user keyring only to the command line + * arguments, if it's around since gpg fails + * otherwise. */ + if (access(USER_KEYRING_PATH, F_OK) >= 0) + cmd[k++] = "--keyring=" USER_KEYRING_PATH; + else + cmd[k++] = "--keyring=" VENDOR_KEYRING_PATH; + + cmd[k++] = "--verify"; + cmd[k++] = sig_file_path; + cmd[k++] = "-"; + cmd[k++] = NULL; + + fd_cloexec(STDIN_FILENO, false); + fd_cloexec(STDOUT_FILENO, false); + fd_cloexec(STDERR_FILENO, false); + + execvp("gpg", (char * const *) cmd); + log_error_errno(errno, "Failed to execute gpg: %m"); + _exit(EXIT_FAILURE); + } + + gpg_pipe[0] = safe_close(gpg_pipe[0]); + + r = loop_write(gpg_pipe[1], checksum_job->payload, checksum_job->payload_size, false); + if (r < 0) { + log_error_errno(r, "Failed to write to pipe: %m"); + goto finish; + } + + gpg_pipe[1] = safe_close(gpg_pipe[1]); + + r = wait_for_terminate_and_warn("gpg", pid, true); + pid = 0; + if (r < 0) + goto finish; + if (r > 0) { + log_error("Signature verification failed."); + r = -EBADMSG; + } else { + log_info("Signature verification succeeded."); + r = 0; + } + +finish: + if (sig_file >= 0) + unlink(sig_file_path); + + return r; +} + +int import_fork_tar(const char *path, pid_t *ret) { + _cleanup_close_pair_ int pipefd[2] = { -1, -1 }; + pid_t pid; + int r; + + assert(path); + assert(ret); + + if (pipe2(pipefd, O_CLOEXEC) < 0) + return log_error_errno(errno, "Failed to create pipe for tar: %m"); + + pid = fork(); + if (pid < 0) + return log_error_errno(errno, "Failed to fork off tar: %m"); + + if (pid == 0) { + int null_fd; + uint64_t retain = + (1ULL << CAP_CHOWN) | + (1ULL << CAP_FOWNER) | + (1ULL << CAP_FSETID) | + (1ULL << CAP_MKNOD) | + (1ULL << CAP_SETFCAP) | + (1ULL << CAP_DAC_OVERRIDE); + + /* Child */ + + reset_all_signal_handlers(); + reset_signal_mask(); + assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); + + pipefd[1] = safe_close(pipefd[1]); + + if (dup2(pipefd[0], STDIN_FILENO) != STDIN_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (pipefd[0] != STDIN_FILENO) + pipefd[0] = safe_close(pipefd[0]); + + null_fd = open("/dev/null", O_WRONLY|O_NOCTTY); + if (null_fd < 0) { + log_error_errno(errno, "Failed to open /dev/null: %m"); + _exit(EXIT_FAILURE); + } + + if (dup2(null_fd, STDOUT_FILENO) != STDOUT_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (null_fd != STDOUT_FILENO) + null_fd = safe_close(null_fd); + + fd_cloexec(STDIN_FILENO, false); + fd_cloexec(STDOUT_FILENO, false); + fd_cloexec(STDERR_FILENO, false); + + if (unshare(CLONE_NEWNET) < 0) + log_error_errno(errno, "Failed to lock tar into network namespace, ignoring: %m"); + + r = capability_bounding_set_drop(~retain, true); + if (r < 0) + log_error_errno(r, "Failed to drop capabilities, ignoring: %m"); + + execlp("tar", "tar", "--numeric-owner", "-C", path, "-px", NULL); + log_error_errno(errno, "Failed to execute tar: %m"); + _exit(EXIT_FAILURE); + } + + pipefd[0] = safe_close(pipefd[0]); + r = pipefd[1]; + pipefd[1] = -1; + + *ret = pid; + + return r; +} diff --git a/src/import/import-common.h b/src/import/import-common.h new file mode 100644 index 000000000..f6b4268fd --- /dev/null +++ b/src/import/import-common.h @@ -0,0 +1,41 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "import-job.h" +#include "import-util.h" + +int import_make_local_copy(const char *final, const char *root, const char *local, bool force_local); + +int import_find_old_etags(const char *url, const char *root, int dt, const char *prefix, const char *suffix, char ***etags); + +int import_make_read_only_fd(int fd); +int import_make_read_only(const char *path); + +int import_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret); + +int import_make_verification_jobs(ImportJob **ret_checksum_job, ImportJob **ret_signature_job, ImportVerify verify, const char *url, CurlGlue *glue, ImportJobFinished on_finished, void *userdata); +int import_verify(ImportJob *main_job, ImportJob *checksum_job, ImportJob *signature_job); + +int import_fork_tar(const char *path, pid_t *ret); diff --git a/src/import/import-dkr.c b/src/import/import-dkr.c new file mode 100644 index 000000000..fb72f6cee --- /dev/null +++ b/src/import/import-dkr.c @@ -0,0 +1,891 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "sd-daemon.h" +#include "json.h" +#include "strv.h" +#include "btrfs-util.h" +#include "utf8.h" +#include "mkdir.h" +#include "import-util.h" +#include "curl-util.h" +#include "aufs-util.h" +#include "import-job.h" +#include "import-common.h" +#include "import-dkr.h" + +typedef enum DkrProgress { + DKR_SEARCHING, + DKR_RESOLVING, + DKR_METADATA, + DKR_DOWNLOADING, + DKR_COPYING, +} DkrProgress; + +struct DkrImport { + sd_event *event; + CurlGlue *glue; + + char *index_url; + char *image_root; + + ImportJob *images_job; + ImportJob *tags_job; + ImportJob *ancestry_job; + ImportJob *json_job; + ImportJob *layer_job; + + char *name; + char *tag; + char *id; + + char *response_token; + char **response_registries; + + char **ancestry; + unsigned n_ancestry; + unsigned current_ancestry; + + DkrImportFinished on_finished; + void *userdata; + + char *local; + bool force_local; + + char *temp_path; + char *final_path; + + pid_t tar_pid; +}; + +#define PROTOCOL_PREFIX "https://" + +#define HEADER_TOKEN "X-Do" /* the HTTP header for the auth token */ "cker-Token:" +#define HEADER_REGISTRY "X-Do" /*the HTTP header for the registry */ "cker-Endpoints:" + +#define LAYERS_MAX 2048 + +static void dkr_import_job_on_finished(ImportJob *j); + +DkrImport* dkr_import_unref(DkrImport *i) { + if (!i) + return NULL; + + if (i->tar_pid > 1) { + (void) kill_and_sigcont(i->tar_pid, SIGKILL); + (void) wait_for_terminate(i->tar_pid, NULL); + } + + import_job_unref(i->images_job); + import_job_unref(i->tags_job); + import_job_unref(i->ancestry_job); + import_job_unref(i->json_job); + import_job_unref(i->layer_job); + + curl_glue_unref(i->glue); + sd_event_unref(i->event); + + if (i->temp_path) { + (void) btrfs_subvol_remove(i->temp_path); + (void) rm_rf_dangerous(i->temp_path, false, true, false); + free(i->temp_path); + } + + free(i->name); + free(i->tag); + free(i->id); + free(i->response_token); + free(i->response_registries); + strv_free(i->ancestry); + free(i->final_path); + free(i->index_url); + free(i->image_root); + free(i->local); + free(i); + + return NULL; +} + +int dkr_import_new( + DkrImport **ret, + sd_event *event, + const char *index_url, + const char *image_root, + DkrImportFinished on_finished, + void *userdata) { + + _cleanup_(dkr_import_unrefp) DkrImport *i = NULL; + char *e; + int r; + + assert(ret); + assert(index_url); + + if (!http_url_is_valid(index_url)) + return -EINVAL; + + i = new0(DkrImport, 1); + if (!i) + return -ENOMEM; + + i->on_finished = on_finished; + i->userdata = userdata; + + i->image_root = strdup(image_root ?: "/var/lib/machines"); + if (!i->image_root) + return -ENOMEM; + + i->index_url = strdup(index_url); + if (!i->index_url) + return -ENOMEM; + + e = endswith(i->index_url, "/"); + if (e) + *e = 0; + + if (event) + i->event = sd_event_ref(event); + else { + r = sd_event_default(&i->event); + if (r < 0) + return r; + } + + r = curl_glue_new(&i->glue, i->event); + if (r < 0) + return r; + + i->glue->on_finished = import_job_curl_on_finished; + i->glue->userdata = i; + + *ret = i; + i = NULL; + + return 0; +} + +static void dkr_import_report_progress(DkrImport *i, DkrProgress p) { + unsigned percent; + + assert(i); + + switch (p) { + + case DKR_SEARCHING: + percent = 0; + if (i->images_job) + percent += i->images_job->progress_percent * 5 / 100; + break; + + case DKR_RESOLVING: + percent = 5; + if (i->tags_job) + percent += i->tags_job->progress_percent * 5 / 100; + break; + + case DKR_METADATA: + percent = 10; + if (i->ancestry_job) + percent += i->ancestry_job->progress_percent * 5 / 100; + if (i->json_job) + percent += i->json_job->progress_percent * 5 / 100; + break; + + case DKR_DOWNLOADING: + percent = 20; + percent += 75 * i->current_ancestry / MAX(1U, i->n_ancestry); + if (i->layer_job) + percent += i->layer_job->progress_percent * 75 / MAX(1U, i->n_ancestry) / 100; + + break; + + case DKR_COPYING: + percent = 95; + break; + + default: + assert_not_reached("Unknown progress state"); + } + + sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent); + log_debug("Combined progress %u%%", percent); +} + +static int parse_id(const void *payload, size_t size, char **ret) { + _cleanup_free_ char *buf = NULL, *id = NULL, *other = NULL; + union json_value v = {}; + void *json_state = NULL; + const char *p; + int t; + + assert(payload); + assert(ret); + + if (size <= 0) + return -EBADMSG; + + if (memchr(payload, 0, size)) + return -EBADMSG; + + buf = strndup(payload, size); + if (!buf) + return -ENOMEM; + + p = buf; + t = json_tokenize(&p, &id, &v, &json_state, NULL); + if (t < 0) + return t; + if (t != JSON_STRING) + return -EBADMSG; + + t = json_tokenize(&p, &other, &v, &json_state, NULL); + if (t < 0) + return t; + if (t != JSON_END) + return -EBADMSG; + + if (!dkr_id_is_valid(id)) + return -EBADMSG; + + *ret = id; + id = NULL; + + return 0; +} + +static int parse_ancestry(const void *payload, size_t size, char ***ret) { + _cleanup_free_ char *buf = NULL; + void *json_state = NULL; + const char *p; + enum { + STATE_BEGIN, + STATE_ITEM, + STATE_COMMA, + STATE_END, + } state = STATE_BEGIN; + _cleanup_strv_free_ char **l = NULL; + size_t n = 0, allocated = 0; + + if (size <= 0) + return -EBADMSG; + + if (memchr(payload, 0, size)) + return -EBADMSG; + + buf = strndup(payload, size); + if (!buf) + return -ENOMEM; + + p = buf; + for (;;) { + _cleanup_free_ char *str; + union json_value v = {}; + int t; + + t = json_tokenize(&p, &str, &v, &json_state, NULL); + if (t < 0) + return t; + + switch (state) { + + case STATE_BEGIN: + if (t == JSON_ARRAY_OPEN) + state = STATE_ITEM; + else + return -EBADMSG; + + break; + + case STATE_ITEM: + if (t == JSON_STRING) { + if (!dkr_id_is_valid(str)) + return -EBADMSG; + + if (n+1 > LAYERS_MAX) + return -EFBIG; + + if (!GREEDY_REALLOC(l, allocated, n + 2)) + return -ENOMEM; + + l[n++] = str; + str = NULL; + l[n] = NULL; + + state = STATE_COMMA; + + } else if (t == JSON_ARRAY_CLOSE) + state = STATE_END; + else + return -EBADMSG; + + break; + + case STATE_COMMA: + if (t == JSON_COMMA) + state = STATE_ITEM; + else if (t == JSON_ARRAY_CLOSE) + state = STATE_END; + else + return -EBADMSG; + break; + + case STATE_END: + if (t == JSON_END) { + + if (strv_isempty(l)) + return -EBADMSG; + + if (!strv_is_uniq(l)) + return -EBADMSG; + + l = strv_reverse(l); + + *ret = l; + l = NULL; + return 0; + } else + return -EBADMSG; + } + + } +} + +static const char *dkr_import_current_layer(DkrImport *i) { + assert(i); + + if (strv_isempty(i->ancestry)) + return NULL; + + return i->ancestry[i->current_ancestry]; +} + +static const char *dkr_import_current_base_layer(DkrImport *i) { + assert(i); + + if (strv_isempty(i->ancestry)) + return NULL; + + if (i->current_ancestry <= 0) + return NULL; + + return i->ancestry[i->current_ancestry-1]; +} + +static int dkr_import_add_token(DkrImport *i, ImportJob *j) { + const char *t; + + assert(i); + assert(j); + + if (i->response_token) + t = strjoina("Authorization: Token ", i->response_token); + else + t = HEADER_TOKEN " true"; + + j->request_header = curl_slist_new("Accept: application/json", t, NULL); + if (!j->request_header) + return -ENOMEM; + + return 0; +} + +static bool dkr_import_is_done(DkrImport *i) { + assert(i); + assert(i->images_job); + + if (i->images_job->state != IMPORT_JOB_DONE) + return false; + + if (!i->tags_job || i->tags_job->state != IMPORT_JOB_DONE) + return false; + + if (!i->ancestry_job || i->ancestry_job->state != IMPORT_JOB_DONE) + return false; + + if (!i->json_job || i->json_job->state != IMPORT_JOB_DONE) + return false; + + if (i->layer_job && i->layer_job->state != IMPORT_JOB_DONE) + return false; + + if (dkr_import_current_layer(i)) + return false; + + return true; +} + +static int dkr_import_make_local_copy(DkrImport *i) { + int r; + + assert(i); + + if (!i->local) + return 0; + + if (!i->final_path) { + i->final_path = strjoin(i->image_root, "/.dkr-", i->id, NULL); + if (!i->final_path) + return log_oom(); + } + + r = import_make_local_copy(i->final_path, i->image_root, i->local, i->force_local); + if (r < 0) + return r; + + return 0; +} + +static int dkr_import_job_on_open_disk(ImportJob *j) { + const char *base; + DkrImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + assert(i->layer_job == j); + assert(i->final_path); + assert(!i->temp_path); + assert(i->tar_pid <= 0); + + r = tempfn_random(i->final_path, &i->temp_path); + if (r < 0) + return log_oom(); + + mkdir_parents_label(i->temp_path, 0700); + + base = dkr_import_current_base_layer(i); + if (base) { + const char *base_path; + + base_path = strjoina(i->image_root, "/.dkr-", base); + r = btrfs_subvol_snapshot(base_path, i->temp_path, false, true); + } else + r = btrfs_subvol_make(i->temp_path); + if (r < 0) + return log_error_errno(r, "Failed to make btrfs subvolume %s: %m", i->temp_path); + + j->disk_fd = import_fork_tar(i->temp_path, &i->tar_pid); + if (j->disk_fd < 0) + return j->disk_fd; + + return 0; +} + +static void dkr_import_job_on_progress(ImportJob *j) { + DkrImport *i; + + assert(j); + assert(j->userdata); + + i = j->userdata; + + dkr_import_report_progress( + i, + j == i->images_job ? DKR_SEARCHING : + j == i->tags_job ? DKR_RESOLVING : + j == i->ancestry_job || j == i->json_job ? DKR_METADATA : + DKR_DOWNLOADING); +} + +static int dkr_import_pull_layer(DkrImport *i) { + _cleanup_free_ char *path = NULL; + const char *url, *layer = NULL; + int r; + + assert(i); + assert(!i->layer_job); + assert(!i->temp_path); + assert(!i->final_path); + + for (;;) { + layer = dkr_import_current_layer(i); + if (!layer) + return 0; /* no more layers */ + + path = strjoin(i->image_root, "/.dkr-", layer, NULL); + if (!path) + return log_oom(); + + if (laccess(path, F_OK) < 0) { + if (errno == ENOENT) + break; + + return log_error_errno(errno, "Failed to check for container: %m"); + } + + log_info("Layer %s already exists, skipping.", layer); + + i->current_ancestry++; + + free(path); + path = NULL; + } + + log_info("Pulling layer %s...", layer); + + i->final_path = path; + path = NULL; + + url = strjoina(PROTOCOL_PREFIX, i->response_registries[0], "/v1/images/", layer, "/layer"); + r = import_job_new(&i->layer_job, url, i->glue, i); + if (r < 0) + return log_error_errno(r, "Failed to allocate layer job: %m"); + + r = dkr_import_add_token(i, i->layer_job); + if (r < 0) + return log_oom(); + + i->layer_job->on_finished = dkr_import_job_on_finished; + i->layer_job->on_open_disk = dkr_import_job_on_open_disk; + i->layer_job->on_progress = dkr_import_job_on_progress; + + r = import_job_begin(i->layer_job); + if (r < 0) + return log_error_errno(r, "Failed to start layer job: %m"); + + return 0; +} + +static void dkr_import_job_on_finished(ImportJob *j) { + DkrImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + if (j->error != 0) { + if (j == i->images_job) + log_error_errno(j->error, "Failed to retrieve images list. (Wrong index URL?)"); + else if (j == i->tags_job) + log_error_errno(j->error, "Failed to retrieve tags list."); + else if (j == i->ancestry_job) + log_error_errno(j->error, "Failed to retrieve ancestry list."); + else if (j == i->json_job) + log_error_errno(j->error, "Failed to retrieve json data."); + else + log_error_errno(j->error, "Failed to retrieve layer data."); + + r = j->error; + goto finish; + } + + if (i->images_job == j) { + const char *url; + + assert(!i->tags_job); + assert(!i->ancestry_job); + assert(!i->json_job); + assert(!i->layer_job); + + if (strv_isempty(i->response_registries)) { + r = -EBADMSG; + log_error("Didn't get registry information."); + goto finish; + } + + log_info("Index lookup succeeded, directed to registry %s.", i->response_registries[0]); + dkr_import_report_progress(i, DKR_RESOLVING); + + url = strjoina(PROTOCOL_PREFIX, i->response_registries[0], "/v1/repositories/", i->name, "/tags/", i->tag); + r = import_job_new(&i->tags_job, url, i->glue, i); + if (r < 0) { + log_error_errno(r, "Failed to allocate tags job: %m"); + goto finish; + } + + r = dkr_import_add_token(i, i->tags_job); + if (r < 0) { + log_oom(); + goto finish; + } + + i->tags_job->on_finished = dkr_import_job_on_finished; + i->tags_job->on_progress = dkr_import_job_on_progress; + + r = import_job_begin(i->tags_job); + if (r < 0) { + log_error_errno(r, "Failed to start tags job: %m"); + goto finish; + } + + } else if (i->tags_job == j) { + const char *url; + char *id = NULL; + + assert(!i->ancestry_job); + assert(!i->json_job); + assert(!i->layer_job); + + r = parse_id(j->payload, j->payload_size, &id); + if (r < 0) { + log_error_errno(r, "Failed to parse JSON id."); + goto finish; + } + + free(i->id); + i->id = id; + + log_info("Tag lookup succeeded, resolved to layer %s.", i->id); + dkr_import_report_progress(i, DKR_METADATA); + + url = strjoina(PROTOCOL_PREFIX, i->response_registries[0], "/v1/images/", i->id, "/ancestry"); + r = import_job_new(&i->ancestry_job, url, i->glue, i); + if (r < 0) { + log_error_errno(r, "Failed to allocate ancestry job: %m"); + goto finish; + } + + r = dkr_import_add_token(i, i->ancestry_job); + if (r < 0) { + log_oom(); + goto finish; + } + + i->ancestry_job->on_finished = dkr_import_job_on_finished; + i->ancestry_job->on_progress = dkr_import_job_on_progress; + + url = strjoina(PROTOCOL_PREFIX, i->response_registries[0], "/v1/images/", i->id, "/json"); + r = import_job_new(&i->json_job, url, i->glue, i); + if (r < 0) { + log_error_errno(r, "Failed to allocate json job: %m"); + goto finish; + } + + r = dkr_import_add_token(i, i->json_job); + if (r < 0) { + log_oom(); + goto finish; + } + + i->json_job->on_finished = dkr_import_job_on_finished; + i->json_job->on_progress = dkr_import_job_on_progress; + + r = import_job_begin(i->ancestry_job); + if (r < 0) { + log_error_errno(r, "Failed to start ancestry job: %m"); + goto finish; + } + + r = import_job_begin(i->json_job); + if (r < 0) { + log_error_errno(r, "Failed to start json job: %m"); + goto finish; + } + + } else if (i->ancestry_job == j) { + char **ancestry = NULL, **k; + unsigned n; + + assert(!i->layer_job); + + r = parse_ancestry(j->payload, j->payload_size, &ancestry); + if (r < 0) { + log_error_errno(r, "Failed to parse JSON id."); + goto finish; + } + + n = strv_length(ancestry); + if (n <= 0 || !streq(ancestry[n-1], i->id)) { + log_error("Ancestry doesn't end in main layer."); + strv_free(ancestry); + r = -EBADMSG; + goto finish; + } + + log_info("Ancestor lookup succeeded, requires layers:\n"); + STRV_FOREACH(k, ancestry) + log_info("\t%s", *k); + + strv_free(i->ancestry); + i->ancestry = ancestry; + i->n_ancestry = n; + i->current_ancestry = 0; + + dkr_import_report_progress(i, DKR_DOWNLOADING); + + r = dkr_import_pull_layer(i); + if (r < 0) + goto finish; + + } else if (i->layer_job == j) { + assert(i->temp_path); + assert(i->final_path); + + j->disk_fd = safe_close(j->disk_fd); + + if (i->tar_pid > 0) { + r = wait_for_terminate_and_warn("tar", i->tar_pid, true); + i->tar_pid = 0; + if (r < 0) + goto finish; + } + + r = aufs_resolve(i->temp_path); + if (r < 0) { + log_error_errno(r, "Failed to resolve aufs whiteouts: %m"); + goto finish; + } + + r = btrfs_subvol_set_read_only(i->temp_path, true); + if (r < 0) { + log_error_errno(r, "Failed to mark snapshot read-only: %m"); + goto finish; + } + + if (rename(i->temp_path, i->final_path) < 0) { + log_error_errno(errno, "Failed to rename snaphsot: %m"); + goto finish; + } + + log_info("Completed writing to layer %s.", i->final_path); + + i->layer_job = import_job_unref(i->layer_job); + free(i->temp_path); + i->temp_path = NULL; + free(i->final_path); + i->final_path = NULL; + + i->current_ancestry ++; + r = dkr_import_pull_layer(i); + if (r < 0) + goto finish; + + } else if (i->json_job != j) + assert_not_reached("Got finished event for unknown curl object"); + + if (!dkr_import_is_done(i)) + return; + + dkr_import_report_progress(i, DKR_COPYING); + + r = dkr_import_make_local_copy(i); + if (r < 0) + goto finish; + + r = 0; + +finish: + if (i->on_finished) + i->on_finished(i, r, i->userdata); + else + sd_event_exit(i->event, r); +} + +static int dkr_import_job_on_header(ImportJob *j, const char *header, size_t sz) { + _cleanup_free_ char *registry = NULL; + char *token; + DkrImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + + r = curl_header_strdup(header, sz, HEADER_TOKEN, &token); + if (r < 0) + return log_oom(); + if (r > 0) { + free(i->response_token); + i->response_token = token; + return 0; + } + + r = curl_header_strdup(header, sz, HEADER_REGISTRY, ®istry); + if (r < 0) + return log_oom(); + if (r > 0) { + char **l, **k; + + l = strv_split(registry, ","); + if (!l) + return log_oom(); + + STRV_FOREACH(k, l) { + if (!hostname_is_valid(*k)) { + log_error("Registry hostname is not valid."); + strv_free(l); + return -EBADMSG; + } + } + + strv_free(i->response_registries); + i->response_registries = l; + } + + return 0; +} + +int dkr_import_pull(DkrImport *i, const char *name, const char *tag, const char *local, bool force_local) { + const char *url; + int r; + + assert(i); + + if (!dkr_name_is_valid(name)) + return -EINVAL; + + if (tag && !dkr_tag_is_valid(tag)) + return -EINVAL; + + if (local && !machine_name_is_valid(local)) + return -EINVAL; + + if (i->images_job) + return -EBUSY; + + if (!tag) + tag = "latest"; + + r = free_and_strdup(&i->local, local); + if (r < 0) + return r; + i->force_local = force_local; + + r = free_and_strdup(&i->name, name); + if (r < 0) + return r; + r = free_and_strdup(&i->tag, tag); + if (r < 0) + return r; + + url = strjoina(i->index_url, "/v1/repositories/", name, "/images"); + + r = import_job_new(&i->images_job, url, i->glue, i); + if (r < 0) + return r; + + r = dkr_import_add_token(i, i->images_job); + if (r < 0) + return r; + + i->images_job->on_finished = dkr_import_job_on_finished; + i->images_job->on_header = dkr_import_job_on_header; + i->images_job->on_progress = dkr_import_job_on_progress; + + return import_job_begin(i->images_job); +} diff --git a/src/import/import-dkr.h b/src/import/import-dkr.h new file mode 100644 index 000000000..633c76796 --- /dev/null +++ b/src/import/import-dkr.h @@ -0,0 +1,36 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include "sd-event.h" +#include "util.h" + +typedef struct DkrImport DkrImport; + +typedef void (*DkrImportFinished)(DkrImport *import, int error, void *userdata); + +int dkr_import_new(DkrImport **import, sd_event *event, const char *index_url, const char *image_root, DkrImportFinished on_finished, void *userdata); +DkrImport* dkr_import_unref(DkrImport *import); + +DEFINE_TRIVIAL_CLEANUP_FUNC(DkrImport*, dkr_import_unref); + +int dkr_import_pull(DkrImport *import, const char *name, const char *tag, const char *local, bool force_local); diff --git a/src/import/import-job.c b/src/import/import-job.c new file mode 100644 index 000000000..809486500 --- /dev/null +++ b/src/import/import-job.c @@ -0,0 +1,733 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "strv.h" +#include "import-job.h" + +ImportJob* import_job_unref(ImportJob *j) { + if (!j) + return NULL; + + curl_glue_remove_and_free(j->glue, j->curl); + curl_slist_free_all(j->request_header); + + safe_close(j->disk_fd); + + if (j->compressed == IMPORT_JOB_XZ) + lzma_end(&j->xz); + else if (j->compressed == IMPORT_JOB_GZIP) + inflateEnd(&j->gzip); + else if (j->compressed == IMPORT_JOB_BZIP2) + BZ2_bzDecompressEnd(&j->bzip2); + + if (j->checksum_context) + gcry_md_close(j->checksum_context); + + free(j->url); + free(j->etag); + strv_free(j->old_etags); + free(j->payload); + free(j->checksum); + + free(j); + + return NULL; +} + +static void import_job_finish(ImportJob *j, int ret) { + assert(j); + + if (j->state == IMPORT_JOB_DONE || + j->state == IMPORT_JOB_FAILED) + return; + + if (ret == 0) { + j->state = IMPORT_JOB_DONE; + j->progress_percent = 100; + log_info("Download of %s complete.", j->url); + } else { + j->state = IMPORT_JOB_FAILED; + j->error = ret; + } + + if (j->on_finished) + j->on_finished(j); +} + +void import_job_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result) { + ImportJob *j = NULL; + CURLcode code; + long status; + int r; + + if (curl_easy_getinfo(curl, CURLINFO_PRIVATE, &j) != CURLE_OK) + return; + + if (!j || j->state == IMPORT_JOB_DONE || j->state == IMPORT_JOB_FAILED) + return; + + if (result != CURLE_OK) { + log_error("Transfer failed: %s", curl_easy_strerror(result)); + r = -EIO; + goto finish; + } + + code = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status); + if (code != CURLE_OK) { + log_error("Failed to retrieve response code: %s", curl_easy_strerror(code)); + r = -EIO; + goto finish; + } else if (status == 304) { + log_info("Image already downloaded. Skipping download."); + j->etag_exists = true; + r = 0; + goto finish; + } else if (status >= 300) { + log_error("HTTP request to %s failed with code %li.", j->url, status); + r = -EIO; + goto finish; + } else if (status < 200) { + log_error("HTTP request to %s finished with unexpected code %li.", j->url, status); + r = -EIO; + goto finish; + } + + if (j->state != IMPORT_JOB_RUNNING) { + log_error("Premature connection termination."); + r = -EIO; + goto finish; + } + + if (j->content_length != (uint64_t) -1 && + j->content_length != j->written_compressed) { + log_error("Download truncated."); + r = -EIO; + goto finish; + } + + if (j->checksum_context) { + uint8_t *k; + + k = gcry_md_read(j->checksum_context, GCRY_MD_SHA256); + if (!k) { + log_error("Failed to get checksum."); + r = -EIO; + goto finish; + } + + j->checksum = hexmem(k, gcry_md_get_algo_dlen(GCRY_MD_SHA256)); + if (!j->checksum) { + r = log_oom(); + goto finish; + } + + log_debug("SHA256 of %s is %s.", j->url, j->checksum); + } + + if (j->disk_fd >= 0 && j->allow_sparse) { + /* Make sure the file size is right, in case the file was + * sparse and we just seeked for the last part */ + + if (ftruncate(j->disk_fd, j->written_uncompressed) < 0) { + log_error_errno(errno, "Failed to truncate file: %m"); + r = -errno; + goto finish; + } + + if (j->etag) + (void) fsetxattr(j->disk_fd, "user.source_etag", j->etag, strlen(j->etag), 0); + if (j->url) + (void) fsetxattr(j->disk_fd, "user.source_url", j->url, strlen(j->url), 0); + + if (j->mtime != 0) { + struct timespec ut[2]; + + timespec_store(&ut[0], j->mtime); + ut[1] = ut[0]; + (void) futimens(j->disk_fd, ut); + + (void) fd_setcrtime(j->disk_fd, j->mtime); + } + } + + r = 0; + +finish: + import_job_finish(j, r); +} + +static int import_job_write_uncompressed(ImportJob *j, void *p, size_t sz) { + ssize_t n; + + assert(j); + assert(p); + + if (sz <= 0) + return 0; + + if (j->written_uncompressed + sz < j->written_uncompressed) { + log_error("File too large, overflow"); + return -EOVERFLOW; + } + + if (j->written_uncompressed + sz > j->uncompressed_max) { + log_error("File overly large, refusing"); + return -EFBIG; + } + + if (j->disk_fd >= 0) { + + if (j->allow_sparse) + n = sparse_write(j->disk_fd, p, sz, 64); + else + n = write(j->disk_fd, p, sz); + if (n < 0) { + log_error_errno(errno, "Failed to write file: %m"); + return -errno; + } + if ((size_t) n < sz) { + log_error("Short write"); + return -EIO; + } + } else { + + if (!GREEDY_REALLOC(j->payload, j->payload_allocated, j->payload_size + sz)) + return log_oom(); + + memcpy(j->payload + j->payload_size, p, sz); + j->payload_size += sz; + } + + j->written_uncompressed += sz; + + return 0; +} + +static int import_job_write_compressed(ImportJob *j, void *p, size_t sz) { + int r; + + assert(j); + assert(p); + + if (sz <= 0) + return 0; + + if (j->written_compressed + sz < j->written_compressed) { + log_error("File too large, overflow"); + return -EOVERFLOW; + } + + if (j->written_compressed + sz > j->compressed_max) { + log_error("File overly large, refusing."); + return -EFBIG; + } + + if (j->content_length != (uint64_t) -1 && + j->written_compressed + sz > j->content_length) { + log_error("Content length incorrect."); + return -EFBIG; + } + + if (j->checksum_context) + gcry_md_write(j->checksum_context, p, sz); + + switch (j->compressed) { + + case IMPORT_JOB_UNCOMPRESSED: + r = import_job_write_uncompressed(j, p, sz); + if (r < 0) + return r; + + break; + + case IMPORT_JOB_XZ: + j->xz.next_in = p; + j->xz.avail_in = sz; + + while (j->xz.avail_in > 0) { + uint8_t buffer[16 * 1024]; + lzma_ret lzr; + + j->xz.next_out = buffer; + j->xz.avail_out = sizeof(buffer); + + lzr = lzma_code(&j->xz, LZMA_RUN); + if (lzr != LZMA_OK && lzr != LZMA_STREAM_END) { + log_error("Decompression error."); + return -EIO; + } + + r = import_job_write_uncompressed(j, buffer, sizeof(buffer) - j->xz.avail_out); + if (r < 0) + return r; + } + + break; + + case IMPORT_JOB_GZIP: + j->gzip.next_in = p; + j->gzip.avail_in = sz; + + while (j->gzip.avail_in > 0) { + uint8_t buffer[16 * 1024]; + + j->gzip.next_out = buffer; + j->gzip.avail_out = sizeof(buffer); + + r = inflate(&j->gzip, Z_NO_FLUSH); + if (r != Z_OK && r != Z_STREAM_END) { + log_error("Decompression error."); + return -EIO; + } + + r = import_job_write_uncompressed(j, buffer, sizeof(buffer) - j->gzip.avail_out); + if (r < 0) + return r; + } + + break; + + case IMPORT_JOB_BZIP2: + j->bzip2.next_in = p; + j->bzip2.avail_in = sz; + + while (j->bzip2.avail_in > 0) { + uint8_t buffer[16 * 1024]; + + j->bzip2.next_out = (char*) buffer; + j->bzip2.avail_out = sizeof(buffer); + + r = BZ2_bzDecompress(&j->bzip2); + if (r != BZ_OK && r != BZ_STREAM_END) { + log_error("Decompression error."); + return -EIO; + } + + r = import_job_write_uncompressed(j, buffer, sizeof(buffer) - j->bzip2.avail_out); + if (r < 0) + return r; + } + + break; + + default: + assert_not_reached("Unknown compression"); + } + + j->written_compressed += sz; + + return 0; +} + +static int import_job_open_disk(ImportJob *j) { + int r; + + assert(j); + + if (j->on_open_disk) { + r = j->on_open_disk(j); + if (r < 0) + return r; + } + + if (j->disk_fd >= 0) { + /* Check if we can do sparse files */ + + if (lseek(j->disk_fd, SEEK_SET, 0) == 0) + j->allow_sparse = true; + else { + if (errno != ESPIPE) + return log_error_errno(errno, "Failed to seek on file descriptor: %m"); + + j->allow_sparse = false; + } + } + + if (j->calc_checksum) { + if (gcry_md_open(&j->checksum_context, GCRY_MD_SHA256, 0) != 0) { + log_error("Failed to initialize hash context."); + return -EIO; + } + } + + return 0; +} + +static int import_job_detect_compression(ImportJob *j) { + static const uint8_t xz_signature[] = { + 0xfd, '7', 'z', 'X', 'Z', 0x00 + }; + static const uint8_t gzip_signature[] = { + 0x1f, 0x8b + }; + static const uint8_t bzip2_signature[] = { + 'B', 'Z', 'h' + }; + + _cleanup_free_ uint8_t *stub = NULL; + size_t stub_size; + + int r; + + assert(j); + + if (j->payload_size < MAX3(sizeof(xz_signature), + sizeof(gzip_signature), + sizeof(bzip2_signature))) + return 0; + + if (memcmp(j->payload, xz_signature, sizeof(xz_signature)) == 0) + j->compressed = IMPORT_JOB_XZ; + else if (memcmp(j->payload, gzip_signature, sizeof(gzip_signature)) == 0) + j->compressed = IMPORT_JOB_GZIP; + else if (memcmp(j->payload, bzip2_signature, sizeof(bzip2_signature)) == 0) + j->compressed = IMPORT_JOB_BZIP2; + else + j->compressed = IMPORT_JOB_UNCOMPRESSED; + + log_debug("Stream is XZ compressed: %s", yes_no(j->compressed == IMPORT_JOB_XZ)); + log_debug("Stream is GZIP compressed: %s", yes_no(j->compressed == IMPORT_JOB_GZIP)); + log_debug("Stream is BZIP2 compressed: %s", yes_no(j->compressed == IMPORT_JOB_BZIP2)); + + if (j->compressed == IMPORT_JOB_XZ) { + lzma_ret xzr; + + xzr = lzma_stream_decoder(&j->xz, UINT64_MAX, LZMA_TELL_UNSUPPORTED_CHECK); + if (xzr != LZMA_OK) { + log_error("Failed to initialize XZ decoder."); + return -EIO; + } + } + if (j->compressed == IMPORT_JOB_GZIP) { + r = inflateInit2(&j->gzip, 15+16); + if (r != Z_OK) { + log_error("Failed to initialize gzip decoder."); + return -EIO; + } + } + if (j->compressed == IMPORT_JOB_BZIP2) { + r = BZ2_bzDecompressInit(&j->bzip2, 0, 0); + if (r != BZ_OK) { + log_error("Failed to initialize bzip2 decoder."); + return -EIO; + } + } + + r = import_job_open_disk(j); + if (r < 0) + return r; + + /* Now, take the payload we read so far, and decompress it */ + stub = j->payload; + stub_size = j->payload_size; + + j->payload = NULL; + j->payload_size = 0; + j->payload_allocated = 0; + + j->state = IMPORT_JOB_RUNNING; + + r = import_job_write_compressed(j, stub, stub_size); + if (r < 0) + return r; + + return 0; +} + +static size_t import_job_write_callback(void *contents, size_t size, size_t nmemb, void *userdata) { + ImportJob *j = userdata; + size_t sz = size * nmemb; + int r; + + assert(contents); + assert(j); + + switch (j->state) { + + case IMPORT_JOB_ANALYZING: + /* Let's first check what it actually is */ + + if (!GREEDY_REALLOC(j->payload, j->payload_allocated, j->payload_size + sz)) { + r = log_oom(); + goto fail; + } + + memcpy(j->payload + j->payload_size, contents, sz); + j->payload_size += sz; + + r = import_job_detect_compression(j); + if (r < 0) + goto fail; + + break; + + case IMPORT_JOB_RUNNING: + + r = import_job_write_compressed(j, contents, sz); + if (r < 0) + goto fail; + + break; + + case IMPORT_JOB_DONE: + case IMPORT_JOB_FAILED: + r = -ESTALE; + goto fail; + + default: + assert_not_reached("Impossible state."); + } + + return sz; + +fail: + import_job_finish(j, r); + return 0; +} + +static size_t import_job_header_callback(void *contents, size_t size, size_t nmemb, void *userdata) { + ImportJob *j = userdata; + size_t sz = size * nmemb; + _cleanup_free_ char *length = NULL, *last_modified = NULL; + char *etag; + int r; + + assert(contents); + assert(j); + + if (j->state == IMPORT_JOB_DONE || j->state == IMPORT_JOB_FAILED) { + r = -ESTALE; + goto fail; + } + + assert(j->state == IMPORT_JOB_ANALYZING); + + r = curl_header_strdup(contents, sz, "ETag:", &etag); + if (r < 0) { + log_oom(); + goto fail; + } + if (r > 0) { + free(j->etag); + j->etag = etag; + + if (strv_contains(j->old_etags, j->etag)) { + log_info("Image already downloaded. Skipping download."); + j->etag_exists = true; + import_job_finish(j, 0); + return sz; + } + + return sz; + } + + r = curl_header_strdup(contents, sz, "Content-Length:", &length); + if (r < 0) { + log_oom(); + goto fail; + } + if (r > 0) { + (void) safe_atou64(length, &j->content_length); + + if (j->content_length != (uint64_t) -1) { + char bytes[FORMAT_BYTES_MAX]; + + if (j->content_length > j->compressed_max) { + log_error("Content too large."); + r = -EFBIG; + goto fail; + } + + log_info("Downloading %s for %s.", format_bytes(bytes, sizeof(bytes), j->content_length), j->url); + } + + return sz; + } + + r = curl_header_strdup(contents, sz, "Last-Modified:", &last_modified); + if (r < 0) { + log_oom(); + goto fail; + } + if (r > 0) { + (void) curl_parse_http_time(last_modified, &j->mtime); + return sz; + } + + if (j->on_header) { + r = j->on_header(j, contents, sz); + if (r < 0) + goto fail; + } + + return sz; + +fail: + import_job_finish(j, r); + return 0; +} + +static int import_job_progress_callback(void *userdata, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { + ImportJob *j = userdata; + unsigned percent; + usec_t n; + + assert(j); + + if (dltotal <= 0) + return 0; + + percent = ((100 * dlnow) / dltotal); + n = now(CLOCK_MONOTONIC); + + if (n > j->last_status_usec + USEC_PER_SEC && + percent != j->progress_percent && + dlnow < dltotal) { + char buf[FORMAT_TIMESPAN_MAX]; + + if (n - j->start_usec > USEC_PER_SEC && dlnow > 0) { + char y[FORMAT_BYTES_MAX]; + usec_t left, done; + + done = n - j->start_usec; + left = (usec_t) (((double) done * (double) dltotal) / dlnow) - done; + + log_info("Got %u%% of %s. %s left at %s/s.", + percent, + j->url, + format_timespan(buf, sizeof(buf), left, USEC_PER_SEC), + format_bytes(y, sizeof(y), (uint64_t) ((double) dlnow / ((double) done / (double) USEC_PER_SEC)))); + } else + log_info("Got %u%% of %s.", percent, j->url); + + j->progress_percent = percent; + j->last_status_usec = n; + + if (j->on_progress) + j->on_progress(j); + } + + return 0; +} + +int import_job_new(ImportJob **ret, const char *url, CurlGlue *glue, void *userdata) { + _cleanup_(import_job_unrefp) ImportJob *j = NULL; + + assert(url); + assert(glue); + assert(ret); + + j = new0(ImportJob, 1); + if (!j) + return -ENOMEM; + + j->state = IMPORT_JOB_INIT; + j->disk_fd = -1; + j->userdata = userdata; + j->glue = glue; + j->content_length = (uint64_t) -1; + j->start_usec = now(CLOCK_MONOTONIC); + j->compressed_max = j->uncompressed_max = 8LLU * 1024LLU * 1024LLU * 1024LLU; /* 8GB */ + + j->url = strdup(url); + if (!j->url) + return -ENOMEM; + + *ret = j; + j = NULL; + + return 0; +} + +int import_job_begin(ImportJob *j) { + int r; + + assert(j); + + if (j->state != IMPORT_JOB_INIT) + return -EBUSY; + + r = curl_glue_make(&j->curl, j->url, j); + if (r < 0) + return r; + + if (!strv_isempty(j->old_etags)) { + _cleanup_free_ char *cc = NULL, *hdr = NULL; + + cc = strv_join(j->old_etags, ", "); + if (!cc) + return -ENOMEM; + + hdr = strappend("If-None-Match: ", cc); + if (!hdr) + return -ENOMEM; + + if (!j->request_header) { + j->request_header = curl_slist_new(hdr, NULL); + if (!j->request_header) + return -ENOMEM; + } else { + struct curl_slist *l; + + l = curl_slist_append(j->request_header, hdr); + if (!l) + return -ENOMEM; + + j->request_header = l; + } + } + + if (j->request_header) { + if (curl_easy_setopt(j->curl, CURLOPT_HTTPHEADER, j->request_header) != CURLE_OK) + return -EIO; + } + + if (curl_easy_setopt(j->curl, CURLOPT_WRITEFUNCTION, import_job_write_callback) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_WRITEDATA, j) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_HEADERFUNCTION, import_job_header_callback) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_HEADERDATA, j) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_XFERINFOFUNCTION, import_job_progress_callback) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_XFERINFODATA, j) != CURLE_OK) + return -EIO; + + if (curl_easy_setopt(j->curl, CURLOPT_NOPROGRESS, 0) != CURLE_OK) + return -EIO; + + r = curl_glue_add(j->glue, j->curl); + if (r < 0) + return r; + + j->state = IMPORT_JOB_ANALYZING; + + return 0; +} diff --git a/src/import/import-job.h b/src/import/import-job.h new file mode 100644 index 000000000..dcf89cb28 --- /dev/null +++ b/src/import/import-job.h @@ -0,0 +1,119 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include + +#include "macro.h" +#include "curl-util.h" + +typedef struct ImportJob ImportJob; + +typedef void (*ImportJobFinished)(ImportJob *job); +typedef int (*ImportJobOpenDisk)(ImportJob *job); +typedef int (*ImportJobHeader)(ImportJob *job, const char *header, size_t sz); +typedef void (*ImportJobProgress)(ImportJob *job); + +typedef enum ImportJobState { + IMPORT_JOB_INIT, + IMPORT_JOB_ANALYZING, /* Still reading into ->payload, to figure out what we have */ + IMPORT_JOB_RUNNING, /* Writing to destination */ + IMPORT_JOB_DONE, + IMPORT_JOB_FAILED, + _IMPORT_JOB_STATE_MAX, + _IMPORT_JOB_STATE_INVALID = -1, +} ImportJobState; + +#define IMPORT_JOB_STATE_IS_COMPLETE(j) (IN_SET((j)->state, IMPORT_JOB_DONE, IMPORT_JOB_FAILED)) + +typedef enum ImportJobCompression { + IMPORT_JOB_UNCOMPRESSED, + IMPORT_JOB_XZ, + IMPORT_JOB_GZIP, + IMPORT_JOB_BZIP2, + _IMPORT_JOB_COMPRESSION_MAX, + _IMPORT_JOB_COMPRESSION_INVALID = -1, +} ImportJobCompression; + +struct ImportJob { + ImportJobState state; + int error; + + char *url; + + void *userdata; + ImportJobFinished on_finished; + ImportJobOpenDisk on_open_disk; + ImportJobHeader on_header; + ImportJobProgress on_progress; + + CurlGlue *glue; + CURL *curl; + struct curl_slist *request_header; + + char *etag; + char **old_etags; + bool etag_exists; + + uint64_t content_length; + uint64_t written_compressed; + uint64_t written_uncompressed; + + uint64_t uncompressed_max; + uint64_t compressed_max; + + uint8_t *payload; + size_t payload_size; + size_t payload_allocated; + + int disk_fd; + + usec_t mtime; + + ImportJobCompression compressed; + lzma_stream xz; + z_stream gzip; + bz_stream bzip2; + + unsigned progress_percent; + usec_t start_usec; + usec_t last_status_usec; + + bool allow_sparse; + + bool calc_checksum; + gcry_md_hd_t checksum_context; + + char *checksum; +}; + +int import_job_new(ImportJob **job, const char *url, CurlGlue *glue, void *userdata); +ImportJob* import_job_unref(ImportJob *job); + +int import_job_begin(ImportJob *j); + +void import_job_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result); + +DEFINE_TRIVIAL_CLEANUP_FUNC(ImportJob*, import_job_unref); diff --git a/src/import/import-pubring.gpg b/src/import/import-pubring.gpg new file mode 100644 index 0000000000000000000000000000000000000000..be27776896f30f580b03ad79d733483f81c8d117 GIT binary patch literal 9551 zcmb7~Wl$YTyQMc9hX5OQcXxN!;10oIo9skOHiLVy6vh=yK}A1e0|RuSW}%44~W8|R2{x{W~hvPDlp zbCsPxk)GBqx6WR)7Dw|Xm<3texYI1Ud8nSwCW>plN|MgCROOMks$Qr$KhUk7*s3Or z=g6HIT+6E;)Ck^NwtEv!u3*a2PSkY*jEGHeSV*Zf@o{kh;!bh?_A%P-&00z|SIgCM ziTF*Jp5x)mjXYx5n_XG9oKq|9E=X~TCy0TKx=UxB@7e#nQ-6#>2Vh5@thdzbDm>bM)4 z(6B$^dk;+pZUPSPx!0?J^eiU!n^kRonOR5ikC|nf3ibPP{?E%@8bHv|D|u~BfCsynigr=8m6^a#47h1%4@7X z2c2hPU5tP9&HvHCt)vBj3ITwqXOS{Db8t2$Q8PDnus1Vy_9CHSW1}Szu=vlm$Ulpt zvxBv{sVkF%Ggv4R$ODBA0R)gi1OFBh5FZ5w5grZ}5(t9{2ZTpJgu((sLI8;%fY@IF z2=Jh#>F1c-%$iIsLzEB8gv-;)Fv0`0ocy#Yy10RLJik6GN#}Khsv62#P2b7MmqAJi zan-kYR(IB=ePrOB?Mcgmrsnon@0=0~@m-tHlpwhf#_T-*wuo@59sP&lQ>;mLx=qxR z^(rxe{DR_*Hzg-j|M$cC3KTh~d_T$V^yVn)@bo4oW@B<<`r z{@c3veGkLC>;soBw94)*&2@{uxf(}mm=Y4ld)ZYYs^HS}Qiwm{u zephfO0L+j8+?gAx)sQDLlZk;|^j^S08nJ+5f0JZRj1$e#VLb@z;-Bc@W*{BgK@)ez zkfMvR7CsvgB^$Lfk2WNhg=?i?;~?oLwGY4gX-juEhPGzZ(e%>@-%q(P&qCs)mRPAQ zgzB?wIN`M+PUI9tA|L6mE@R0<;$H<@D_957mZ}pb9lh5t2)1x5bn4vWj-XAqI5?UF zj+Bl=0^N~$jGhEKUtwsGkmQrE%PZWdY3n3GlVH6pA8f4aE>-6%+F8B^Q0l-nx~*Ih zp};VlI?|!xYwuNo-F9n8>&!KERH_UHnOgU!z)*bAZ&gMEq~^P`^$7IQ0}wLG167C= zTW)gmSU4=zKmcS5)ISCU0s(Sg)dyHS-S0Yv18f58iqQtpHaoSw@CqXREsxD-!tlIQp%W>t6@Y4sWj3^0RR$d|{!(1g_-5t1v-&f7 ziE;^n8vDTLXnE4GK7D5obrhPadUw>KZ6J&2^8|OJO>?MBv*R&J3>>kIeiz{e1|Zc( zDw@%iGK68WJLup(rf%3FB4PeX#b~$>+Hf6P&O zZG_~o@p)%a=7*JjoNgl-70ImI&%>q|7ZRtp?Q%W)MUL;{Yi{SL zbYH*`hre_vxFkD`uRO@WBx{glP+6GDI-RGCwx1iZyz>Jh>F9ViZRjH2j9OAQhA^|n zU2ABPtPa^{h2})k56%%Qby5PIJtw}-lAm5~dxL@m2eWn~4xnLA4S!j*Y@${>ttmL6 za)8I;f|Xyo8uV8IkkBANklqx;sVAp(z^d84Rj~SM_If7e5mBD`aF3v%izKAwdnsMlt?}WPd()J8+%MYQLI6v{l zxWKIGH%2t89V3B-84SL^^2C&al8wboY};OVZbylWngg{tS|(dT^I)`JJtKJ&4m5Hs z3&zQ1pK72`|B}{~YU7G{m|d{Nv-W|AQ!yc$oL9!Mk3>!1LK+8N`z34-PK-|4aia@p zQ#;T3a92l#vI;JG;hEz;K|C~nsLon31R|ie-ZA!x^2K?=3)|ZoD*&YLtj9gp=mb$0 zpk&FAa~UF^8T)8{@1*SvCMtwmh0CG@>|>k4Y*P%>R$-mO-S~pLQn%nITr+;+7gj{J z73RXvKx|U9Sti^z+!tJs+L#Gb_NI{yP~@)5tB6!&?;VvbU44x0c88%s6z^*)C-*@( zC@uW>sljd{5^JwZ4au>D)E9NU{AI^nQ$#16A)sHe#+xPH!|XlKTSQb95x zZ!Fi`3kA2b?G|BZu2oY!@L>g{~?#FVi z>=1Q!LUL#u2_%NX`72J~|BaJR|1~w*H$Z?Y?Jz^jxMK=6mT~g@gMt@6leH~8k^o5| zBNX@P+x*eE)`zCqaY@S`(JVg{N^O(bEn{;vE6Vy zdPoUV(#woH-8|uD)0F4kmg?4ZNpe-7U9knpGtEWCd6cM6&(rWF>=K&>(zNV}*_9PQ zhR6FneGA!N=w>rwb# z$_8=nSjhkKHoh$1?C{9gBSgG7vloNhrt~-lAbI6>qOmKhz2>)Z(kpFxueq$E)lS>| zVd|ota(bpfC*P3MKd9`6o=DH7G+%`TWo>p#Zb&RpxcX7xVd6K5D76RaI!`}S)-TQ9 z`Qw$Ra4AHrf$b!t)44Na88*Fo9bsSH57X zXN^V|Rr!(jI>^}^FM)%L?V@8%g4{?w-;vD2`D5SaPUB(RHkqwOwyU}Oy|#uR1ZR$= znf8fL)DjsqM32}u%&Ur<(943Vzf&XaKiJwj_!qV=5V3#vK0MV9?(YeB+_+j4?ebC! z5RlF*7%&f~3jI-e#{VY?Dx zkcT0z&+!To?3n37bR%r91)5E#cR`o|NP|ngO2*AX*o_1Tf_YQ&P~Cq%EfWIVBW}sx z04c`G1#WX@FMZgE?ywD4iD}@JlmMO?vl_P8(B0l|;XEAtJmuA%7_$UF;mvWXRF+&q z1S}=>mp1*Z3DgAVGfzv3jcW!IBb63?d!un#y;U)oeW-bxBOr&PAi#jj|J987u-~f zrq&Ob-n6#<$Vao>Llw^ceTrSl3rYP1{WaJSNZjX zAdk6MxJzVjq&y$ZhT#My(q*btLO5%)!+b z!|$h8;vuzfj<_KxZ?`G`&gFIyI7PJ?p~>A6yOwAeXC4grsB0cXD)U0s3QDxym*~9 z;Bm}Jz&kFzNmc^3B9g|g`=dG^eYuE~B!n{3NY=cy1N+C|IVn4ec(o3%n}p9kPln*r zQ-DDmG~8k_zd2_wEq@avi2u8SE8h03 zbjn@UBv8RGN85tasNS@BW*r0L$b;`6M&DcR`8(O{NZ%bd7-m+Vlv?wOv;0F(rZB>3 zEd|({^)aP07@_$xqCIc={@{mA_y74586vCAp)c_zy_Kb%BhS5-@7clYlf&C(Ng^Cq z^~5^OlZ!alo9t#Ds-Q0lvWMG2W=IrhNbQYwZ}jZG@|>N15q~Btkki&&eCQEzg@#JW z8f#vX2HYY5tzGfk9c_614!L@1`)gLW2s?uAr2=(T^<2@KuMz8QYrHp>Mw(>~EHb$z zWl6yI_0a0IxhUDAcaate8=y#NeqY=zZ;TTj?bJG#6dY53ArwNBHY&SE-2TZG7Y>_b zHyLwcB7ul1(x1$IWE#ldRRXO@H2A^O+@$X^(tZ#ICs1Ry;*rqbyqgP(U!4ZsN z>F&McB+#_0|L>{LFRTUG?VI?v52`f$nD(U%-e;6p1@R0#ZN_l0Xf|Vh<8oM`lq(3* zzxbjL#h=3lzAw4eGBb|iLcRYea7q21e51XtU*DJj@^OoO@+s7!2q5Pwmi&LWW!C>; zTmD-}|D6Gu+Wo=JDQaE4K1ccR?ky*N8&oHGfI?0lM~eu}Gz(nqm&Q@Q{$=vRb&ylA zk+3&!PQ&>-)TM5xWFp0$&@CUoaVT@8rh#06^OW&i{8rzzMb2IDSL_yBUpl;H!u-f% zl3dPTVg|pM#>h*G<9&{pv`MkGzT=0e0(<;SaovXze`(c95X!3VDPtJbq((cAKC@R~ z`sHUx3#mx$87uEUI~J65<(z?0GvbSc_}PjcN=S}0Kti1~xoN7mU=uqDcC(Nmesa)NeVJklQ(xcK4OMk#p< zX8%EDjh6;4iVtuR%Wtr*dhnF6-rsb$ToNntz;gC3DO0c7CY@m)#tMT)BQ!YbDMAca zs2+_AA}Xo{0#~~X z4>J{`So;w@B5jWLAD#&Pp~8w($eJs^W(q^$H6xdX;k2c`y`@N^Aj+DYVe8ZnLF*%k zSwKD5;HRw4#l}Gk^9F#CgIC0e*%n_O9Sk-vW?g28={ibd^r8#PVUK<@hn9y3TkhIA zkYtg~MJH0C6id5fEmKtBPCe}XA>AAtW+FJtA+gi0rQyvG)EkmXBURD=`Km^E2;xd5 zJV?C=@hnC|$GP!U{kJXut((8v@-Rw<{z!cA1x9VA?J@<7znKJ8d23UIT@ieS=bxUa zP8PU?gGgzNt>Ve%-~b#B&E{$5mblTrpbC4I-qDq|tP7%_b`GELW|vw%7#r_9t1BDm z^1de~<`}EC$ioTIRg;>*@~rhk6ijLoFlz|FecW6kGyF0%rOdNgm#WtzqY!zPY%hY) zs>4$bSaIR1X-Ss#uO;j+-!a9`9K5XRj@xZGrgL>zZYL(2L&89t`8}u&W9-`pP;^_r z0IY1upNo@^d~|{pa8kF8q)Dck#M?>u#mG6$Tk?=cCA;f70LN|Ye&t@$Z zYY3LVd||!a2t0+ZOIyd()!CiIDht@~S_2S`iVqbCYi&bDYsBM-1IaHXdd&C(RXo*{ z9zA?Ng!&K&a1ZX~$nvDZzbn^k?uhP)s3L+wQj3A-5NJh7;;6%AaM0K4(wgpZ zFEsv8rj49cwn^;Dh1YPmVS4qZj4boaDCAWyY%s3ZzzK7PxU&d643lR&C^ygixnrc`e@4aG(8qdvh;clIL0 zF3P?pyYY_*-QoClMU6qqhvk9{HKkNC3AFlt!JyG8ce+Xb{v$J`w`R%x7s;PZY`a+g z{u%X1dZ*~nQsCRF(Xt#*J2U$S%gTIHXF9KSuEBL+d1`RBpRrxV!*xV`W<~32 z_Kq^4B!L(jF}3<(qqLsh#&f;Tp{uiy?h~Xg_O(o$tfSNArBim|0`JqQ`R{=YA)MPA z8J)W1O12?UR67$xJJH=W3&>w)3A~C=+Z8Zb^^AQxg#2Vd8_@e~J!Pno=x-GlmP4@0 zqA`VU&LN^5@AsG3uN!`__iK^ctm=7sF*8yw-@ENi6Ty+@(by&a%z9JjvPJ1|4d+XK zs}>3RghwJ^5Aj`6LIVB*M@j9=igk`tV%@gzIIs%x! zC}6q@VdJltfBk+k-Ia?L(#q)7ksfbTO`l0x(T0Vv&?m3Q&ZJ6!69znelpl5k3}+OH z^v)N5dy-oQ$fsLmYxy0An8y_;q-tz>y>y*PJklVyujC4AaIeP@7hM@Cnb9P+ zG~%10i-nQB@uL+%-R{<dzy`4At825Tu$Fw3o#>=SpnNoX5N#2Ia`fskH_-NC?f-^F~~xfYdEQtx*m+4>voh zb*?w3oOp@M&2&!1If?#=z=qAF9EDg`FDyX>!dOTbn);Y+!cHG^**)>y3&b!}?^#$~ zv*V{02=7&^7Utw~c($)Di(2He>l#8R{jRg60o~is_USs|{WBU;pZTk0EC#+LRj6Si z!q1BfW_%9&#>AI8(?UX72{7Gc|MjW6ySgR1qeUWfRL@}Xs;P?fY;qSxCyK6FapG!s zC{>8X({5hkKnpXq&&iaCwvYpe&b5`nNDcbE;ZoB!aT;a zg6=D$uzVP+87#FrT^-}v!Bc~?0(#{aycHKDgrr0Rw`J?QIc(uDe;hL$I|jwh&Pxr( zV|Ak8CJyZ{jKiqs*}jomqO>S;_3dto6dBi|-2~`tdh({rWCOiFDc9mrZw?T$8iSNd zQ(*&?=D)xIH$RuC!(&Tre>mN&oc$kc71jL-&wu!ZeR=AalI;290wK^CK?iNRo~))nL=VcjyRQ#qHpQ{>E8h`b*rR%8 z9vM&=hAXItj}j48`)uSD2KE&Tgq`&JM3mKEFUiH5=H-t<+GaJ#l(cu)LQ3uYbpx`LiBfO?+pO&AT@ zl|jix@z=d9@-t8gr8>7x_jB;{Lg6SJ$eCg~IeKQ4ft60R7VAoWijg-mlA}lzRyP|<~>2|pQ7}fon6ZnbZkISHaYgyG=4~f6YaCBnF+&q6H zJ#rz!!MBC5+*Eu+OU^d2337YHHD8GuGw;@0YcujuEuGr%0b{aVa1Z_3Bct+Y5pftl z|1Ui$?Zc=-8ZkqdPXje!84l$KLR|SGVifWdiO*1khZg7^k+gzL_iy2FV_1D&1BBIx zSeQ>PrkTHE9~(`oQw!+`Vl;6Ioq`&K*&e#$5u01R zw(0QA1dyosslzW(3r>74P;2ej`4mcOE+#tb!~434YZ!n7@D|zFHrsC97^2j^a#j*k z=bZ=X@wV=t_Q`F@xqz!flAgxo8gc)3TmGNJs;KUN2dj}4is4E5!s?wBC?8r$u|mAA zs;nfE(d51M(YPt?ukTbX9&(0il@f+AjG3Bq_b0o)yB+s}4Qb+CA++QfA@Kfcc`L@{ z`$N}olKHWCqV)#L$9vn$41r57u9)>ykld8muh=I_48Nei6L!^G=f2Y&KYHf9FNOC= znGTLb;nuiTSzG}n5)MkJtkqACUJ3LdkhUw!X&zZ3Ric;G6?O}0IN0O6{RfSAgKaaM zsVN`09w?h(->4_ zhRpgIKSm5JYDhE~?dNqUBYuAB2vlG2pjlOpP$q-07J2}7UEO{7>kWkE9Z9fmP}}M^ z4xNxX4=;xLY@ay=wIdb~FAZO@ zK4iM)Av3SAd<_R9wMTxm-@Qb!#;I>5_tm?xHX}uA{p2oSuTBjH*p@7w`}gy!r*-h} zX;h7?(4|RYoHJ`OH)$!o?Tl+DX-K9oDK5(K6p)zhs`|m|-^y+NwH>)?TF$?0r(Nr_ zEbc?9hK^&>$gR6A^mRb8&y(IDfc_itmW9g8Yp;ZbBcg~KJrbYzIxVsN&{W{A-PK+b zHN%mM^+S`@QC-xcfIkH}3v*)`JN(WUwz(lA z46V5P%h|fV_h`IpiNus<)pF2);flfR5Ec8LO>g(jabNV$^J8NYBuj{p8rTkq2B<~5 zM!N+BuJc`vrqso87-}_Z3q#&Kc$FmW0rbEFapf`!Pp_y@`a7XbMFXZr*Mo38_u))Y zD_Bv@t)?TMQPR&T+28iy%D!vQH(b)kiy4wk=TJ9O$exxeBs6ZnJ#_Zc3PUOHZ-Y<$ zQM$n#LJWl$?ub-gDi1;9AUguj9iKMccin^R>WKHmT-<7h6N#o5yAwPXk_y40LQM!j zDjuAB;<4-7icL1l+v=t~bo04!>SADv0Iu*<_w{nDH1GaOldD#~g$@?cjRVy82UlYw zzg3Q#F9&K&>xpK@etwv?mJBp4DMSeCPugL0l;G56dNi>dGfVs4yo^rlE;Gt@%B3NA zUKmFZ!e~oKp3OnoI*Jk(eTFr^4|iChABfSM?M!DA@;_Kpvd|A=TJkb4 zMathlspw!+ALuEph`VA@( zD~#|4o37ActnIlOpW2he?F$9s93t(_s5EO^siIkAiGIC$82e-?Zbr)NkJXG}FqS=L zU$$Pq+mQKGw&FXzMn}k{Ta+OWZ8S9Os;O&{FneDW%x&~28>b(Q3>=Ny{mqi59gpd* zG{@Wf?dX;otoo24G8Lfw7tsK*7jFB6#eN+~etPv+^)wjPm0CZ+VY^nA52UH0upA>< zXs{WJF}1JIK-bSdOz3R4vcisUB7!s}9LT-t-IR=}%&GQ*q&ovkwBlgJFfkE~nMhws z01kvvQ%ut{QFbUz^UCt0+f!puC7``1kmfu+!48e7yt6_1)iXCuM|iMtuMB=AF^m#o z^$2TCj7B>oA(!8?bb;LymGla%PyvAtq0aKN|44-UKjRFfKzzu5rWXDd9vvn0e})>M zF%jV55TXAbX#o7K9=tEM3VzMLflSmW@0`27&9$)QtDxuv1h$ff%`Ab!P8Qh&eL!#j^WW(`NlSVW~Ei+xd1!#&z+-)9XM|*9f z^D1g(nIt4>wW|e%!dhfRub9_a2{o{Di1f>qS}AgUU_}3J3&@VT7VzdhjUc6T?{>CC z3{k)JORGR()<+3~==`&cU4+`)s}+Z3Q9FFb;sb4AfC6GXlD^BKKziY89@98_tJ)EH zP;#hB=u*CjTY*mH3Ajga3Qo#Dzp%w9Z+aFrFl8spJlSpwK-N=8@k>-f$S{826*hR@ z7~=b|9Ei9;rEfet72j&$mlIe{4x>(2@2#1>3?$RY`Y0&z#`O|cyW`Do>v!puypon*{T~7JH$0g-T6G&YLsZY9H}|vvj>7^qyCP({{>Bc;DrDH literal 0 HcmV?d00001 diff --git a/src/import/import-raw.c b/src/import/import-raw.c new file mode 100644 index 000000000..8d99f1085 --- /dev/null +++ b/src/import/import-raw.c @@ -0,0 +1,513 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include + +#include "sd-daemon.h" +#include "utf8.h" +#include "strv.h" +#include "copy.h" +#include "btrfs-util.h" +#include "util.h" +#include "macro.h" +#include "mkdir.h" +#include "import-util.h" +#include "curl-util.h" +#include "qcow2-util.h" +#include "import-job.h" +#include "import-common.h" +#include "import-raw.h" + +typedef enum RawProgress { + RAW_DOWNLOADING, + RAW_VERIFYING, + RAW_UNPACKING, + RAW_FINALIZING, + RAW_COPYING, +} RawProgress; + +struct RawImport { + sd_event *event; + CurlGlue *glue; + + char *image_root; + + ImportJob *raw_job; + ImportJob *checksum_job; + ImportJob *signature_job; + + RawImportFinished on_finished; + void *userdata; + + char *local; + bool force_local; + + char *temp_path; + char *final_path; + + ImportVerify verify; +}; + +RawImport* raw_import_unref(RawImport *i) { + if (!i) + return NULL; + + import_job_unref(i->raw_job); + import_job_unref(i->checksum_job); + import_job_unref(i->signature_job); + + curl_glue_unref(i->glue); + sd_event_unref(i->event); + + if (i->temp_path) { + (void) unlink(i->temp_path); + free(i->temp_path); + } + + free(i->final_path); + free(i->image_root); + free(i->local); + free(i); + + return NULL; +} + +int raw_import_new( + RawImport **ret, + sd_event *event, + const char *image_root, + RawImportFinished on_finished, + void *userdata) { + + _cleanup_(raw_import_unrefp) RawImport *i = NULL; + int r; + + assert(ret); + + i = new0(RawImport, 1); + if (!i) + return -ENOMEM; + + i->on_finished = on_finished; + i->userdata = userdata; + + i->image_root = strdup(image_root ?: "/var/lib/machines"); + if (!i->image_root) + return -ENOMEM; + + if (event) + i->event = sd_event_ref(event); + else { + r = sd_event_default(&i->event); + if (r < 0) + return r; + } + + r = curl_glue_new(&i->glue, i->event); + if (r < 0) + return r; + + i->glue->on_finished = import_job_curl_on_finished; + i->glue->userdata = i; + + *ret = i; + i = NULL; + + return 0; +} + +static void raw_import_report_progress(RawImport *i, RawProgress p) { + unsigned percent; + + assert(i); + + switch (p) { + + case RAW_DOWNLOADING: { + unsigned remain = 80; + + percent = 0; + + if (i->checksum_job) { + percent += i->checksum_job->progress_percent * 5 / 100; + remain -= 5; + } + + if (i->signature_job) { + percent += i->signature_job->progress_percent * 5 / 100; + remain -= 5; + } + + if (i->raw_job) + percent += i->raw_job->progress_percent * remain / 100; + break; + } + + case RAW_VERIFYING: + percent = 80; + break; + + case RAW_UNPACKING: + percent = 85; + break; + + case RAW_FINALIZING: + percent = 90; + break; + + case RAW_COPYING: + percent = 95; + break; + + default: + assert_not_reached("Unknown progress state"); + } + + sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent); + log_debug("Combined progress %u%%", percent); +} + +static int raw_import_maybe_convert_qcow2(RawImport *i) { + _cleanup_close_ int converted_fd = -1; + _cleanup_free_ char *t = NULL; + int r; + + assert(i); + assert(i->raw_job); + + r = qcow2_detect(i->raw_job->disk_fd); + if (r < 0) + return log_error_errno(r, "Failed to detect whether this is a QCOW2 image: %m"); + if (r == 0) + return 0; + + /* This is a QCOW2 image, let's convert it */ + r = tempfn_random(i->final_path, &t); + if (r < 0) + return log_oom(); + + converted_fd = open(t, O_RDWR|O_CREAT|O_EXCL|O_NOCTTY|O_CLOEXEC, 0644); + if (converted_fd < 0) + return log_error_errno(errno, "Failed to create %s: %m", t); + + r = chattr_fd(converted_fd, true, FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes on %s: %m", t); + + log_info("Unpacking QCOW2 file."); + + r = qcow2_convert(i->raw_job->disk_fd, converted_fd); + if (r < 0) { + unlink(t); + return log_error_errno(r, "Failed to convert qcow2 image: %m"); + } + + unlink(i->temp_path); + free(i->temp_path); + + i->temp_path = t; + t = NULL; + + safe_close(i->raw_job->disk_fd); + i->raw_job->disk_fd = converted_fd; + converted_fd = -1; + + return 1; +} + +static int raw_import_make_local_copy(RawImport *i) { + _cleanup_free_ char *tp = NULL; + _cleanup_close_ int dfd = -1; + const char *p; + int r; + + assert(i); + assert(i->raw_job); + + if (!i->local) + return 0; + + if (i->raw_job->etag_exists) { + /* We have downloaded this one previously, reopen it */ + + assert(i->raw_job->disk_fd < 0); + + if (!i->final_path) { + r = import_make_path(i->raw_job->url, i->raw_job->etag, i->image_root, ".raw-", ".raw", &i->final_path); + if (r < 0) + return log_oom(); + } + + i->raw_job->disk_fd = open(i->final_path, O_RDONLY|O_NOCTTY|O_CLOEXEC); + if (i->raw_job->disk_fd < 0) + return log_error_errno(errno, "Failed to open vendor image: %m"); + } else { + /* We freshly downloaded the image, use it */ + + assert(i->raw_job->disk_fd >= 0); + + if (lseek(i->raw_job->disk_fd, SEEK_SET, 0) == (off_t) -1) + return log_error_errno(errno, "Failed to seek to beginning of vendor image: %m"); + } + + p = strjoina(i->image_root, "/", i->local, ".raw"); + + if (i->force_local) { + (void) btrfs_subvol_remove(p); + (void) rm_rf_dangerous(p, false, true, false); + } + + r = tempfn_random(p, &tp); + if (r < 0) + return log_oom(); + + dfd = open(tp, O_WRONLY|O_CREAT|O_EXCL|O_NOCTTY|O_CLOEXEC, 0664); + if (dfd < 0) + return log_error_errno(errno, "Failed to create writable copy of image: %m"); + + /* Turn off COW writing. This should greatly improve + * performance on COW file systems like btrfs, since it + * reduces fragmentation caused by not allowing in-place + * writes. */ + r = chattr_fd(dfd, true, FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes on %s: %m", tp); + + r = copy_bytes(i->raw_job->disk_fd, dfd, (off_t) -1, true); + if (r < 0) { + unlink(tp); + return log_error_errno(r, "Failed to make writable copy of image: %m"); + } + + (void) copy_times(i->raw_job->disk_fd, dfd); + (void) copy_xattr(i->raw_job->disk_fd, dfd); + + dfd = safe_close(dfd); + + r = rename(tp, p); + if (r < 0) { + unlink(tp); + return log_error_errno(errno, "Failed to move writable image into place: %m"); + } + + log_info("Created new local image '%s'.", i->local); + return 0; +} + +static bool raw_import_is_done(RawImport *i) { + assert(i); + assert(i->raw_job); + + if (i->raw_job->state != IMPORT_JOB_DONE) + return false; + if (i->checksum_job && i->checksum_job->state != IMPORT_JOB_DONE) + return false; + if (i->signature_job && i->signature_job->state != IMPORT_JOB_DONE) + return false; + + return true; +} + +static void raw_import_job_on_finished(ImportJob *j) { + RawImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + if (j->error != 0) { + if (j == i->checksum_job) + log_error_errno(j->error, "Failed to retrieve SHA256 checksum, cannot verify. (Try --verify=no?)"); + else if (j == i->signature_job) + log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)"); + else + log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)"); + + r = j->error; + goto finish; + } + + /* This is invoked if either the download completed + * successfully, or the download was skipped because we + * already have the etag. In this case ->etag_exists is + * true. + * + * We only do something when we got all three files */ + + if (!raw_import_is_done(i)) + return; + + if (!i->raw_job->etag_exists) { + /* This is a new download, verify it, and move it into place */ + assert(i->raw_job->disk_fd >= 0); + + raw_import_report_progress(i, RAW_VERIFYING); + + r = import_verify(i->raw_job, i->checksum_job, i->signature_job); + if (r < 0) + goto finish; + + raw_import_report_progress(i, RAW_UNPACKING); + + r = raw_import_maybe_convert_qcow2(i); + if (r < 0) + goto finish; + + raw_import_report_progress(i, RAW_FINALIZING); + + r = import_make_read_only_fd(i->raw_job->disk_fd); + if (r < 0) + goto finish; + + r = rename(i->temp_path, i->final_path); + if (r < 0) { + r = log_error_errno(errno, "Failed to move RAW file into place: %m"); + goto finish; + } + + free(i->temp_path); + i->temp_path = NULL; + } + + raw_import_report_progress(i, RAW_COPYING); + + r = raw_import_make_local_copy(i); + if (r < 0) + goto finish; + + r = 0; + +finish: + if (i->on_finished) + i->on_finished(i, r, i->userdata); + else + sd_event_exit(i->event, r); +} + +static int raw_import_job_on_open_disk(ImportJob *j) { + RawImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + assert(i->raw_job == j); + assert(!i->final_path); + assert(!i->temp_path); + + r = import_make_path(j->url, j->etag, i->image_root, ".raw-", ".raw", &i->final_path); + if (r < 0) + return log_oom(); + + r = tempfn_random(i->final_path, &i->temp_path); + if (r <0) + return log_oom(); + + mkdir_parents_label(i->temp_path, 0700); + + j->disk_fd = open(i->temp_path, O_RDWR|O_CREAT|O_EXCL|O_NOCTTY|O_CLOEXEC, 0644); + if (j->disk_fd < 0) + return log_error_errno(errno, "Failed to create %s: %m", i->temp_path); + + r = chattr_fd(j->disk_fd, true, FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes on %s: %m", i->temp_path); + + return 0; +} + +static void raw_import_job_on_progress(ImportJob *j) { + RawImport *i; + + assert(j); + assert(j->userdata); + + i = j->userdata; + + raw_import_report_progress(i, RAW_DOWNLOADING); +} + +int raw_import_pull(RawImport *i, const char *url, const char *local, bool force_local, ImportVerify verify) { + int r; + + assert(i); + assert(verify < _IMPORT_VERIFY_MAX); + assert(verify >= 0); + + if (!http_url_is_valid(url)) + return -EINVAL; + + if (local && !machine_name_is_valid(local)) + return -EINVAL; + + if (i->raw_job) + return -EBUSY; + + r = free_and_strdup(&i->local, local); + if (r < 0) + return r; + i->force_local = force_local; + i->verify = verify; + + /* Queue job for the image itself */ + r = import_job_new(&i->raw_job, url, i->glue, i); + if (r < 0) + return r; + + i->raw_job->on_finished = raw_import_job_on_finished; + i->raw_job->on_open_disk = raw_import_job_on_open_disk; + i->raw_job->on_progress = raw_import_job_on_progress; + i->raw_job->calc_checksum = verify != IMPORT_VERIFY_NO; + + r = import_find_old_etags(url, i->image_root, DT_REG, ".raw-", ".raw", &i->raw_job->old_etags); + if (r < 0) + return r; + + r = import_make_verification_jobs(&i->checksum_job, &i->signature_job, verify, url, i->glue, raw_import_job_on_finished, i); + if (r < 0) + return r; + + r = import_job_begin(i->raw_job); + if (r < 0) + return r; + + if (i->checksum_job) { + i->checksum_job->on_progress = raw_import_job_on_progress; + + r = import_job_begin(i->checksum_job); + if (r < 0) + return r; + } + + if (i->signature_job) { + i->signature_job->on_progress = raw_import_job_on_progress; + + r = import_job_begin(i->signature_job); + if (r < 0) + return r; + } + + return 0; +} diff --git a/src/import/import-raw.h b/src/import/import-raw.h new file mode 100644 index 000000000..ae2c29991 --- /dev/null +++ b/src/import/import-raw.h @@ -0,0 +1,37 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "sd-event.h" +#include "macro.h" +#include "import-util.h" + +typedef struct RawImport RawImport; + +typedef void (*RawImportFinished)(RawImport *import, int error, void *userdata); + +int raw_import_new(RawImport **import, sd_event *event, const char *image_root, RawImportFinished on_finished, void *userdata); +RawImport* raw_import_unref(RawImport *import); + +DEFINE_TRIVIAL_CLEANUP_FUNC(RawImport*, raw_import_unref); + +int raw_import_pull(RawImport *import, const char *url, const char *local, bool force_local, ImportVerify verify); diff --git a/src/import/import-tar.c b/src/import/import-tar.c new file mode 100644 index 000000000..999aa8ab5 --- /dev/null +++ b/src/import/import-tar.c @@ -0,0 +1,410 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "sd-daemon.h" +#include "utf8.h" +#include "strv.h" +#include "copy.h" +#include "btrfs-util.h" +#include "util.h" +#include "macro.h" +#include "mkdir.h" +#include "import-util.h" +#include "curl-util.h" +#include "import-job.h" +#include "import-common.h" +#include "import-tar.h" + +typedef enum TarProgress { + TAR_DOWNLOADING, + TAR_VERIFYING, + TAR_FINALIZING, + TAR_COPYING, +} TarProgress; + +struct TarImport { + sd_event *event; + CurlGlue *glue; + + char *image_root; + + ImportJob *tar_job; + ImportJob *checksum_job; + ImportJob *signature_job; + + TarImportFinished on_finished; + void *userdata; + + char *local; + bool force_local; + + pid_t tar_pid; + + char *temp_path; + char *final_path; + + ImportVerify verify; +}; + +TarImport* tar_import_unref(TarImport *i) { + if (!i) + return NULL; + + if (i->tar_pid > 1) { + (void) kill_and_sigcont(i->tar_pid, SIGKILL); + (void) wait_for_terminate(i->tar_pid, NULL); + } + + import_job_unref(i->tar_job); + import_job_unref(i->checksum_job); + import_job_unref(i->signature_job); + + curl_glue_unref(i->glue); + sd_event_unref(i->event); + + if (i->temp_path) { + (void) btrfs_subvol_remove(i->temp_path); + (void) rm_rf_dangerous(i->temp_path, false, true, false); + free(i->temp_path); + } + + free(i->final_path); + free(i->image_root); + free(i->local); + free(i); + + return NULL; +} + +int tar_import_new( + TarImport **ret, + sd_event *event, + const char *image_root, + TarImportFinished on_finished, + void *userdata) { + + _cleanup_(tar_import_unrefp) TarImport *i = NULL; + int r; + + assert(ret); + assert(event); + + i = new0(TarImport, 1); + if (!i) + return -ENOMEM; + + i->on_finished = on_finished; + i->userdata = userdata; + + i->image_root = strdup(image_root ?: "/var/lib/machines"); + if (!i->image_root) + return -ENOMEM; + + if (event) + i->event = sd_event_ref(event); + else { + r = sd_event_default(&i->event); + if (r < 0) + return r; + } + + r = curl_glue_new(&i->glue, i->event); + if (r < 0) + return r; + + i->glue->on_finished = import_job_curl_on_finished; + i->glue->userdata = i; + + *ret = i; + i = NULL; + + return 0; +} + +static void tar_import_report_progress(TarImport *i, TarProgress p) { + unsigned percent; + + assert(i); + + switch (p) { + + case TAR_DOWNLOADING: { + unsigned remain = 85; + + percent = 0; + + if (i->checksum_job) { + percent += i->checksum_job->progress_percent * 5 / 100; + remain -= 5; + } + + if (i->signature_job) { + percent += i->signature_job->progress_percent * 5 / 100; + remain -= 5; + } + + if (i->tar_job) + percent += i->tar_job->progress_percent * remain / 100; + break; + } + + case TAR_VERIFYING: + percent = 85; + break; + + case TAR_FINALIZING: + percent = 90; + break; + + case TAR_COPYING: + percent = 95; + break; + + default: + assert_not_reached("Unknown progress state"); + } + + sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent); + log_debug("Combined progress %u%%", percent); +} + +static int tar_import_make_local_copy(TarImport *i) { + int r; + + assert(i); + assert(i->tar_job); + + if (!i->local) + return 0; + + if (!i->final_path) { + r = import_make_path(i->tar_job->url, i->tar_job->etag, i->image_root, ".tar-", NULL, &i->final_path); + if (r < 0) + return log_oom(); + } + + r = import_make_local_copy(i->final_path, i->image_root, i->local, i->force_local); + if (r < 0) + return r; + + return 0; +} + +static bool tar_import_is_done(TarImport *i) { + assert(i); + assert(i->tar_job); + + if (i->tar_job->state != IMPORT_JOB_DONE) + return false; + if (i->checksum_job && i->checksum_job->state != IMPORT_JOB_DONE) + return false; + if (i->signature_job && i->signature_job->state != IMPORT_JOB_DONE) + return false; + + return true; +} + +static void tar_import_job_on_finished(ImportJob *j) { + TarImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + if (j->error != 0) { + if (j == i->checksum_job) + log_error_errno(j->error, "Failed to retrieve SHA256 checksum, cannot verify. (Try --verify=no?)"); + else if (j == i->signature_job) + log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)"); + else + log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)"); + + r = j->error; + goto finish; + } + + /* This is invoked if either the download completed + * successfully, or the download was skipped because we + * already have the etag. */ + + if (!tar_import_is_done(i)) + return; + + j->disk_fd = safe_close(i->tar_job->disk_fd); + + if (i->tar_pid > 0) { + r = wait_for_terminate_and_warn("tar", i->tar_pid, true); + i->tar_pid = 0; + if (r < 0) + goto finish; + } + + if (!i->tar_job->etag_exists) { + /* This is a new download, verify it, and move it into place */ + + tar_import_report_progress(i, TAR_VERIFYING); + + r = import_verify(i->tar_job, i->checksum_job, i->signature_job); + if (r < 0) + goto finish; + + tar_import_report_progress(i, TAR_FINALIZING); + + r = import_make_read_only(i->temp_path); + if (r < 0) + goto finish; + + if (rename(i->temp_path, i->final_path) < 0) { + r = log_error_errno(errno, "Failed to rename to final image name: %m"); + goto finish; + } + + free(i->temp_path); + i->temp_path = NULL; + } + + tar_import_report_progress(i, TAR_COPYING); + + r = tar_import_make_local_copy(i); + if (r < 0) + goto finish; + + r = 0; + +finish: + if (i->on_finished) + i->on_finished(i, r, i->userdata); + else + sd_event_exit(i->event, r); +} + +static int tar_import_job_on_open_disk(ImportJob *j) { + _cleanup_close_pair_ int pipefd[2] = { -1 , -1 }; + TarImport *i; + int r; + + assert(j); + assert(j->userdata); + + i = j->userdata; + assert(i->tar_job == j); + assert(!i->final_path); + assert(!i->temp_path); + assert(i->tar_pid <= 0); + + r = import_make_path(j->url, j->etag, i->image_root, ".tar-", NULL, &i->final_path); + if (r < 0) + return log_oom(); + + r = tempfn_random(i->final_path, &i->temp_path); + if (r < 0) + return log_oom(); + + mkdir_parents_label(i->temp_path, 0700); + + r = btrfs_subvol_make(i->temp_path); + if (r == -ENOTTY) { + if (mkdir(i->temp_path, 0755) < 0) + return log_error_errno(errno, "Failed to create directory %s: %m", i->temp_path); + } else if (r < 0) + return log_error_errno(errno, "Failed to create subvolume %s: %m", i->temp_path); + + j->disk_fd = import_fork_tar(i->temp_path, &i->tar_pid); + if (j->disk_fd < 0) + return j->disk_fd; + + return 0; +} + +static void tar_import_job_on_progress(ImportJob *j) { + TarImport *i; + + assert(j); + assert(j->userdata); + + i = j->userdata; + + tar_import_report_progress(i, TAR_DOWNLOADING); +} + +int tar_import_pull(TarImport *i, const char *url, const char *local, bool force_local, ImportVerify verify) { + int r; + + assert(i); + + if (!http_url_is_valid(url)) + return -EINVAL; + + if (local && !machine_name_is_valid(local)) + return -EINVAL; + + if (i->tar_job) + return -EBUSY; + + r = free_and_strdup(&i->local, local); + if (r < 0) + return r; + i->force_local = force_local; + i->verify = verify; + + r = import_job_new(&i->tar_job, url, i->glue, i); + if (r < 0) + return r; + + i->tar_job->on_finished = tar_import_job_on_finished; + i->tar_job->on_open_disk = tar_import_job_on_open_disk; + i->tar_job->on_progress = tar_import_job_on_progress; + i->tar_job->calc_checksum = verify != IMPORT_VERIFY_NO; + + r = import_find_old_etags(url, i->image_root, DT_DIR, ".tar-", NULL, &i->tar_job->old_etags); + if (r < 0) + return r; + + r = import_make_verification_jobs(&i->checksum_job, &i->signature_job, verify, url, i->glue, tar_import_job_on_finished, i); + if (r < 0) + return r; + + r = import_job_begin(i->tar_job); + if (r < 0) + return r; + + if (i->checksum_job) { + i->checksum_job->on_progress = tar_import_job_on_progress; + + r = import_job_begin(i->checksum_job); + if (r < 0) + return r; + } + + if (i->signature_job) { + i->signature_job->on_progress = tar_import_job_on_progress; + + r = import_job_begin(i->signature_job); + if (r < 0) + return r; + } + + return 0; +} diff --git a/src/import/import-tar.h b/src/import/import-tar.h new file mode 100644 index 000000000..212f804d1 --- /dev/null +++ b/src/import/import-tar.h @@ -0,0 +1,37 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "sd-event.h" +#include "macro.h" +#include "import-util.h" + +typedef struct TarImport TarImport; + +typedef void (*TarImportFinished)(TarImport *import, int error, void *userdata); + +int tar_import_new(TarImport **import, sd_event *event, const char *image_root, TarImportFinished on_finished, void *userdata); +TarImport* tar_import_unref(TarImport *import); + +DEFINE_TRIVIAL_CLEANUP_FUNC(TarImport*, tar_import_unref); + +int tar_import_pull(TarImport *import, const char *url, const char *local, bool force_local, ImportVerify verify); diff --git a/src/import/importd.c b/src/import/importd.c new file mode 100644 index 000000000..1222bf3cd --- /dev/null +++ b/src/import/importd.c @@ -0,0 +1,1104 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "sd-bus.h" +#include "util.h" +#include "strv.h" +#include "bus-util.h" +#include "bus-common-errors.h" +#include "def.h" +#include "socket-util.h" +#include "mkdir.h" +#include "import-util.h" +#include "def.h" + +typedef struct Transfer Transfer; +typedef struct Manager Manager; + +typedef enum TransferType { + TRANSFER_TAR, + TRANSFER_RAW, + TRANSFER_DKR, + _TRANSFER_TYPE_MAX, + _TRANSFER_TYPE_INVALID = -1, +} TransferType; + +struct Transfer { + Manager *manager; + + uint32_t id; + char *object_path; + + TransferType type; + ImportVerify verify; + + char *remote; + char *local; + bool force_local; + + char *dkr_index_url; + + pid_t pid; + + int log_fd; + + char log_message[LINE_MAX]; + size_t log_message_size; + + sd_event_source *pid_event_source; + sd_event_source *log_event_source; + + unsigned n_canceled; + unsigned progress_percent; +}; + +struct Manager { + sd_event *event; + sd_bus *bus; + + uint32_t current_transfer_id; + Hashmap *transfers; + + Hashmap *polkit_registry; + + int notify_fd; + + sd_event_source *notify_event_source; +}; + +#define TRANSFERS_MAX 64 + +static const char* const transfer_type_table[_TRANSFER_TYPE_MAX] = { + [TRANSFER_TAR] = "tar", + [TRANSFER_RAW] = "raw", + [TRANSFER_DKR] = "dkr", +}; + +DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(transfer_type, TransferType); + +static Transfer *transfer_unref(Transfer *t) { + if (!t) + return NULL; + + if (t->manager) + hashmap_remove(t->manager->transfers, UINT32_TO_PTR(t->id)); + + sd_event_source_unref(t->pid_event_source); + sd_event_source_unref(t->log_event_source); + + free(t->remote); + free(t->local); + free(t->dkr_index_url); + free(t->object_path); + + if (t->pid > 0) { + (void) kill_and_sigcont(t->pid, SIGKILL); + (void) wait_for_terminate(t->pid, NULL); + } + + safe_close(t->log_fd); + + free(t); + return NULL; +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(Transfer*, transfer_unref); + +static int transfer_new(Manager *m, Transfer **ret) { + _cleanup_(transfer_unrefp) Transfer *t = NULL; + uint32_t id; + int r; + + assert(m); + assert(ret); + + if (hashmap_size(m->transfers) >= TRANSFERS_MAX) + return -E2BIG; + + r = hashmap_ensure_allocated(&m->transfers, &trivial_hash_ops); + if (r < 0) + return r; + + t = new0(Transfer, 1); + if (!t) + return -ENOMEM; + + t->type = _TRANSFER_TYPE_INVALID; + t->log_fd = -1; + + id = m->current_transfer_id + 1; + + if (asprintf(&t->object_path, "/org/freedesktop/import1/transfer/_%" PRIu32, id) < 0) + return -ENOMEM; + + r = hashmap_put(m->transfers, UINT32_TO_PTR(id), t); + if (r < 0) + return r; + + m->current_transfer_id = id; + + t->manager = m; + t->id = id; + + *ret = t; + t = NULL; + + return 0; +} + +static void transfer_send_log_line(Transfer *t, const char *line) { + int r, priority = LOG_INFO; + + assert(t); + assert(line); + + syslog_parse_priority(&line, &priority, true); + + log_full(priority, "(transfer%" PRIu32 ") %s", t->id, line); + + r = sd_bus_emit_signal( + t->manager->bus, + t->object_path, + "org.freedesktop.import1.Transfer", + "LogMessage", + "us", + priority, + line); + if (r < 0) + log_error_errno(r, "Cannot emit message: %m"); + } + +static void transfer_send_logs(Transfer *t, bool flush) { + assert(t); + + /* Try to send out all log messages, if we can. But if we + * can't we remove the messages from the buffer, but don't + * fail */ + + while (t->log_message_size > 0) { + _cleanup_free_ char *n = NULL; + char *e; + + if (t->log_message_size >= sizeof(t->log_message)) + e = t->log_message + sizeof(t->log_message); + else { + char *a, *b; + + a = memchr(t->log_message, 0, t->log_message_size); + b = memchr(t->log_message, '\n', t->log_message_size); + + if (a && b) + e = a < b ? a : b; + else if (a) + e = a; + else + e = b; + } + + if (!e) { + if (!flush) + return; + + e = t->log_message + t->log_message_size; + } + + n = strndup(t->log_message, e - t->log_message); + + /* Skip over NUL and newlines */ + while (e < t->log_message + t->log_message_size && (*e == 0 || *e == '\n')) + e++; + + memmove(t->log_message, e, t->log_message + sizeof(t->log_message) - e); + t->log_message_size -= e - t->log_message; + + if (!n) { + log_oom(); + continue; + } + + if (isempty(n)) + continue; + + transfer_send_log_line(t, n); + } +} + +static int transfer_finalize(Transfer *t, bool success) { + int r; + + assert(t); + + transfer_send_logs(t, true); + + r = sd_bus_emit_signal( + t->manager->bus, + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "TransferRemoved", + "uos", + t->id, + t->object_path, + success ? "done" : + t->n_canceled > 0 ? "canceled" : "failed"); + + if (r < 0) + log_error_errno(r, "Cannot emit message: %m"); + + transfer_unref(t); + return 0; +} + +static int transfer_cancel(Transfer *t) { + int r; + + assert(t); + + r = kill_and_sigcont(t->pid, t->n_canceled < 3 ? SIGTERM : SIGKILL); + if (r < 0) + return r; + + t->n_canceled++; + return 0; +} + +static int transfer_on_pid(sd_event_source *s, const siginfo_t *si, void *userdata) { + Transfer *t = userdata; + bool success = false; + + assert(s); + assert(t); + + if (si->si_code == CLD_EXITED) { + if (si->si_status != 0) + log_error("Import process failed with exit code %i.", si->si_status); + else { + log_debug("Import process succeeded."); + success = true; + } + + } else if (si->si_code == CLD_KILLED || + si->si_code == CLD_DUMPED) + + log_error("Import process terminated by signal %s.", signal_to_string(si->si_status)); + else + log_error("Import process failed due to unknown reason."); + + t->pid = 0; + + return transfer_finalize(t, success); +} + +static int transfer_on_log(sd_event_source *s, int fd, uint32_t revents, void *userdata) { + Transfer *t = userdata; + ssize_t l; + + assert(s); + assert(t); + + l = read(fd, t->log_message + t->log_message_size, sizeof(t->log_message) - t->log_message_size); + if (l <= 0) { + /* EOF/read error. We just close the pipe here, and + * close the watch, waiting for the SIGCHLD to arrive, + * before we do anything else. */ + + if (l < 0) + log_error_errno(errno, "Failed to read log message: %m"); + + t->log_event_source = sd_event_source_unref(t->log_event_source); + return 0; + } + + t->log_message_size += l; + + transfer_send_logs(t, false); + + return 0; +} + +static int transfer_start(Transfer *t) { + _cleanup_close_pair_ int pipefd[2] = { -1, -1 }; + int r; + + assert(t); + assert(t->pid <= 0); + + if (pipe2(pipefd, O_CLOEXEC) < 0) + return -errno; + + t->pid = fork(); + if (t->pid < 0) + return -errno; + if (t->pid == 0) { + const char *cmd[] = { + "systemd-pull", + transfer_type_to_string(t->type), + "--verify", + NULL, /* verify argument */ + NULL, /* maybe --force */ + NULL, /* maybe --dkr-index-url */ + NULL, /* the actual URL */ + NULL, /* remote */ + NULL, /* local */ + NULL + }; + int null_fd; + unsigned k = 3; + + /* Child */ + + reset_all_signal_handlers(); + reset_signal_mask(); + assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); + + pipefd[0] = safe_close(pipefd[0]); + + if (dup2(pipefd[1], STDOUT_FILENO) != STDOUT_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (dup2(pipefd[1], STDERR_FILENO) != STDERR_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (pipefd[1] != STDOUT_FILENO && pipefd[1] != STDERR_FILENO) + pipefd[1] = safe_close(pipefd[1]); + + null_fd = open("/dev/null", O_RDONLY|O_NOCTTY); + if (null_fd < 0) { + log_error_errno(errno, "Failed to open /dev/null: %m"); + _exit(EXIT_FAILURE); + } + + if (dup2(null_fd, STDIN_FILENO) != STDIN_FILENO) { + log_error_errno(errno, "Failed to dup2() fd: %m"); + _exit(EXIT_FAILURE); + } + + if (null_fd != STDIN_FILENO) + safe_close(null_fd); + + fd_cloexec(STDIN_FILENO, false); + fd_cloexec(STDOUT_FILENO, false); + fd_cloexec(STDERR_FILENO, false); + + setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1); + setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1); + + cmd[k++] = import_verify_to_string(t->verify); + if (t->force_local) + cmd[k++] = "--force"; + + if (t->dkr_index_url) { + cmd[k++] = "--dkr-index-url"; + cmd[k++] = t->dkr_index_url; + } + + cmd[k++] = t->remote; + if (t->local) + cmd[k++] = t->local; + cmd[k] = NULL; + + execv(SYSTEMD_PULL_PATH, (char * const *) cmd); + log_error_errno(errno, "Failed to execute import tool: %m"); + _exit(EXIT_FAILURE); + } + + pipefd[1] = safe_close(pipefd[1]); + t->log_fd = pipefd[0]; + pipefd[0] = -1; + + r = sd_event_add_child(t->manager->event, &t->pid_event_source, t->pid, WEXITED, transfer_on_pid, t); + if (r < 0) + return r; + + r = sd_event_add_io(t->manager->event, &t->log_event_source, t->log_fd, EPOLLIN, transfer_on_log, t); + if (r < 0) + return r; + + /* Make sure always process logging before SIGCHLD */ + r = sd_event_source_set_priority(t->log_event_source, SD_EVENT_PRIORITY_NORMAL -5); + if (r < 0) + return r; + + r = sd_bus_emit_signal( + t->manager->bus, + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "TransferNew", + "uo", + t->id, + t->object_path); + if (r < 0) + return r; + + return 0; +} + +static Manager *manager_unref(Manager *m) { + Transfer *t; + + if (!m) + return NULL; + + sd_event_source_unref(m->notify_event_source); + safe_close(m->notify_fd); + + while ((t = hashmap_first(m->transfers))) + transfer_unref(t); + + hashmap_free(m->transfers); + + bus_verify_polkit_async_registry_free(m->polkit_registry); + + sd_bus_close(m->bus); + sd_bus_unref(m->bus); + sd_event_unref(m->event); + + free(m); + return NULL; +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref); + +static int manager_on_notify(sd_event_source *s, int fd, uint32_t revents, void *userdata) { + + char buf[NOTIFY_BUFFER_MAX+1]; + struct iovec iovec = { + .iov_base = buf, + .iov_len = sizeof(buf)-1, + }; + union { + struct cmsghdr cmsghdr; + uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + + CMSG_SPACE(sizeof(int) * NOTIFY_FD_MAX)]; + } control = {}; + struct msghdr msghdr = { + .msg_iov = &iovec, + .msg_iovlen = 1, + .msg_control = &control, + .msg_controllen = sizeof(control), + }; + struct ucred *ucred = NULL; + Manager *m = userdata; + struct cmsghdr *cmsg; + unsigned percent; + char *p, *e; + Transfer *t; + Iterator i; + ssize_t n; + int r; + + n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC); + if (n < 0) { + if (errno == EAGAIN || errno == EINTR) + return 0; + + return -errno; + } + + for (cmsg = CMSG_FIRSTHDR(&msghdr); cmsg; cmsg = CMSG_NXTHDR(&msghdr, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { + close_many((int*) CMSG_DATA(cmsg), (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int)); + log_warning("Somebody sent us unexpected fds, ignoring."); + return 0; + } else if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDENTIALS && + cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) { + + ucred = (struct ucred*) CMSG_DATA(cmsg); + } + } + + if (msghdr.msg_flags & MSG_TRUNC) { + log_warning("Got overly long notification datagram, ignoring."); + return 0; + } + + if (!ucred || ucred->pid <= 0) { + log_warning("Got notification datagram lacking credential information, ignoring."); + return 0; + } + + HASHMAP_FOREACH(t, m->transfers, i) + if (ucred->pid == t->pid) + break; + + if (!t) { + log_warning("Got notification datagram from unexpected peer, ignoring."); + return 0; + } + + buf[n] = 0; + + p = startswith(buf, "X_IMPORT_PROGRESS="); + if (!p) { + p = strstr(buf, "\nX_IMPORT_PROGRESS="); + if (!p) + return 0; + + p += 19; + } + + e = strchrnul(p, '\n'); + *e = 0; + + r = safe_atou(p, &percent); + if (r < 0 || percent > 100) { + log_warning("Got invalid percent value, ignoring."); + return 0; + } + + t->progress_percent = percent; + + log_debug("Got percentage from client: %u%%", percent); + return 0; +} + +static int manager_new(Manager **ret) { + _cleanup_(manager_unrefp) Manager *m = NULL; + static const union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + .un.sun_path = "/run/systemd/import/notify", + }; + static const int one = 1; + int r; + + assert(ret); + + m = new0(Manager, 1); + if (!m) + return -ENOMEM; + + r = sd_event_default(&m->event); + if (r < 0) + return r; + + sd_event_set_watchdog(m->event, true); + + r = sd_bus_default_system(&m->bus); + if (r < 0) + return r; + + m->notify_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + if (m->notify_fd < 0) + return -errno; + + (void) mkdir_parents_label(sa.un.sun_path, 0755); + (void) unlink(sa.un.sun_path); + + if (bind(m->notify_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path)) < 0) + return -errno; + + if (setsockopt(m->notify_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) < 0) + return -errno; + + r = sd_event_add_io(m->event, &m->notify_event_source, m->notify_fd, EPOLLIN, manager_on_notify, m); + if (r < 0) + return r; + + *ret = m; + m = NULL; + + return 0; +} + +static Transfer *manager_find(Manager *m, TransferType type, const char *dkr_index_url, const char *remote) { + Transfer *t; + Iterator i; + + assert(m); + assert(type >= 0); + assert(type < _TRANSFER_TYPE_MAX); + + HASHMAP_FOREACH(t, m->transfers, i) { + + if (t->type == type && + streq_ptr(t->remote, remote) && + streq_ptr(t->dkr_index_url, dkr_index_url)) + return t; + } + + return NULL; +} + +static int method_pull_tar_or_raw(sd_bus *bus, sd_bus_message *msg, void *userdata, sd_bus_error *error) { + _cleanup_(transfer_unrefp) Transfer *t = NULL; + const char *remote, *local, *verify, *object; + Manager *m = userdata; + ImportVerify v; + TransferType type; + int force, r; + uint32_t id; + + assert(bus); + assert(msg); + assert(m); + + r = bus_verify_polkit_async( + msg, + CAP_SYS_ADMIN, + "org.freedesktop.import1.pull", + false, + &m->polkit_registry, + error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Will call us back */ + + r = sd_bus_message_read(msg, "sssb", &remote, &local, &verify, &force); + if (r < 0) + return r; + + if (!http_url_is_valid(remote)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "URL %s is invalid", remote); + + if (isempty(local)) + local = NULL; + else if (!machine_name_is_valid(local)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Local name %s is invalid", local); + + if (isempty(verify)) + v = IMPORT_VERIFY_SIGNATURE; + else + v = import_verify_from_string(verify); + if (v < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown verification mode %s", verify); + + type = streq_ptr(sd_bus_message_get_member(msg), "PullTar") ? TRANSFER_TAR : TRANSFER_RAW; + + if (manager_find(m, type, NULL, remote)) + return sd_bus_error_setf(error, BUS_ERROR_TRANSFER_IN_PROGRESS, "Transfer for %s already in progress.", remote); + + r = transfer_new(m, &t); + if (r < 0) + return r; + + t->type = type; + t->verify = v; + t->force_local = force; + + t->remote = strdup(remote); + if (!t->remote) + return -ENOMEM; + + t->local = strdup(local); + if (!t->local) + return -ENOMEM; + + r = transfer_start(t); + if (r < 0) + return r; + + object = t->object_path; + id = t->id; + t = NULL; + + return sd_bus_reply_method_return(msg, "uo", id, object); +} + +static int method_pull_dkr(sd_bus *bus, sd_bus_message *msg, void *userdata, sd_bus_error *error) { + _cleanup_(transfer_unrefp) Transfer *t = NULL; + const char *index_url, *remote, *tag, *local, *verify, *object; + Manager *m = userdata; + ImportVerify v; + int force, r; + uint32_t id; + + assert(bus); + assert(msg); + assert(m); + + r = bus_verify_polkit_async( + msg, + CAP_SYS_ADMIN, + "org.freedesktop.import1.pull", + false, + &m->polkit_registry, + error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Will call us back */ + + r = sd_bus_message_read(msg, "sssssb", &index_url, &remote, &tag, &local, &verify, &force); + if (r < 0) + return r; + + if (isempty(index_url)) + index_url = DEFAULT_DKR_INDEX_URL; + if (!index_url) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Index URL must be specified."); + if (!http_url_is_valid(index_url)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Index URL %s is invalid", index_url); + + if (!dkr_name_is_valid(remote)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Remote name %s is not valid", remote); + + if (isempty(tag)) + tag = "latest"; + else if (!dkr_tag_is_valid(tag)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Tag %s is not valid", tag); + + if (isempty(local)) + local = NULL; + else if (!machine_name_is_valid(local)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Local name %s is invalid", local); + + if (isempty(verify)) + v = IMPORT_VERIFY_SIGNATURE; + else + v = import_verify_from_string(verify); + if (v < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown verification mode %s", verify); + + if (v != IMPORT_VERIFY_NO) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "DKR does not support verification."); + + if (manager_find(m, TRANSFER_DKR, index_url, remote)) + return sd_bus_error_setf(error, BUS_ERROR_TRANSFER_IN_PROGRESS, "Transfer for %s already in progress.", remote); + + r = transfer_new(m, &t); + if (r < 0) + return r; + + t->type = TRANSFER_DKR; + t->verify = v; + t->force_local = force; + + t->dkr_index_url = strdup(index_url); + if (!t->dkr_index_url) + return -ENOMEM; + + t->remote = strjoin(remote, ":", tag, NULL); + if (!t->remote) + return -ENOMEM; + + t->local = strdup(local); + if (!t->local) + return -ENOMEM; + + r = transfer_start(t); + if (r < 0) + return r; + + object = t->object_path; + id = t->id; + t = NULL; + + return sd_bus_reply_method_return(msg, "uo", id, object); +} + +static int method_list_transfers(sd_bus *bus, sd_bus_message *msg, void *userdata, sd_bus_error *error) { + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + Manager *m = userdata; + Transfer *t; + Iterator i; + int r; + + assert(bus); + assert(msg); + assert(m); + + r = sd_bus_message_new_method_return(msg, &reply); + if (r < 0) + return r; + + r = sd_bus_message_open_container(reply, 'a', "(usssdo)"); + if (r < 0) + return r; + + HASHMAP_FOREACH(t, m->transfers, i) { + + r = sd_bus_message_append( + reply, + "(usssdo)", + t->id, + transfer_type_to_string(t->type), + t->remote, + t->local, + (double) t->progress_percent / 100.0, + t->object_path); + if (r < 0) + return r; + } + + r = sd_bus_message_close_container(reply); + if (r < 0) + return r; + + return sd_bus_send(bus, reply, NULL); +} + +static int method_cancel(sd_bus *bus, sd_bus_message *msg, void *userdata, sd_bus_error *error) { + Transfer *t = userdata; + int r; + + assert(bus); + assert(msg); + assert(t); + + r = bus_verify_polkit_async( + msg, + CAP_SYS_ADMIN, + "org.freedesktop.import1.pull", + false, + &t->manager->polkit_registry, + error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Will call us back */ + + r = transfer_cancel(t); + if (r < 0) + return r; + + return sd_bus_reply_method_return(msg, NULL); +} + +static int method_cancel_transfer(sd_bus *bus, sd_bus_message *msg, void *userdata, sd_bus_error *error) { + Manager *m = userdata; + Transfer *t; + uint32_t id; + int r; + + assert(bus); + assert(msg); + assert(m); + + r = bus_verify_polkit_async( + msg, + CAP_SYS_ADMIN, + "org.freedesktop.import1.pull", + false, + &m->polkit_registry, + error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Will call us back */ + + r = sd_bus_message_read(msg, "u", &id); + if (r < 0) + return r; + if (id <= 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid transfer id"); + + t = hashmap_get(m->transfers, UINT32_TO_PTR(id)); + if (!t) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_TRANSFER, "No transfer by id %" PRIu32, id); + + r = transfer_cancel(t); + if (r < 0) + return r; + + return sd_bus_reply_method_return(msg, NULL); +} + +static int property_get_progress( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + Transfer *t = userdata; + + assert(bus); + assert(reply); + assert(t); + + return sd_bus_message_append(reply, "d", (double) t->progress_percent / 100.0); +} + +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, transfer_type, TransferType); +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_verify, import_verify, ImportVerify); + +static const sd_bus_vtable transfer_vtable[] = { + SD_BUS_VTABLE_START(0), + SD_BUS_PROPERTY("Id", "u", NULL, offsetof(Transfer, id), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("Local", "s", NULL, offsetof(Transfer, local), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("Remote", "s", NULL, offsetof(Transfer, remote), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("Type", "s", property_get_type, offsetof(Transfer, type), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("Verify", "s", property_get_verify, offsetof(Transfer, verify), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("Progress", "d", property_get_progress, 0, 0), + SD_BUS_METHOD("Cancel", NULL, NULL, method_cancel, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_SIGNAL("LogMessage", "us", 0), + SD_BUS_VTABLE_END, +}; + +static const sd_bus_vtable manager_vtable[] = { + SD_BUS_VTABLE_START(0), + SD_BUS_METHOD("PullTar", "sssb", "uo", method_pull_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("PullRaw", "sssb", "uo", method_pull_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("PullDkr", "sssssb", "uo", method_pull_dkr, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("ListTransfers", NULL, "a(usssdo)", method_list_transfers, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("CancelTransfer", "u", NULL, method_cancel_transfer, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_SIGNAL("TransferNew", "uo", 0), + SD_BUS_SIGNAL("TransferRemoved", "uos", 0), + SD_BUS_VTABLE_END, +}; + +static int transfer_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { + Manager *m = userdata; + Transfer *t; + const char *p; + uint32_t id; + int r; + + assert(bus); + assert(path); + assert(interface); + assert(found); + assert(m); + + p = startswith(path, "/org/freedesktop/import1/transfer/_"); + if (!p) + return 0; + + r = safe_atou32(p, &id); + if (r < 0 || id == 0) + return 0; + + t = hashmap_get(m->transfers, UINT32_TO_PTR(id)); + if (!t) + return 0; + + *found = t; + return 1; +} + +static int transfer_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { + _cleanup_strv_free_ char **l = NULL; + Manager *m = userdata; + Transfer *t; + unsigned k = 0; + Iterator i; + + l = new0(char*, hashmap_size(m->transfers) + 1); + if (!l) + return -ENOMEM; + + HASHMAP_FOREACH(t, m->transfers, i) { + + l[k] = strdup(t->object_path); + if (!l[k]) + return -ENOMEM; + + k++; + } + + *nodes = l; + l = NULL; + + return 1; +} + +static int manager_add_bus_objects(Manager *m) { + int r; + + assert(m); + + r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/import1", "org.freedesktop.import1.Manager", manager_vtable, m); + if (r < 0) + return log_error_errno(r, "Failed to register object: %m"); + + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/import1/transfer", "org.freedesktop.import1.Transfer", transfer_vtable, transfer_object_find, m); + if (r < 0) + return log_error_errno(r, "Failed to register object: %m"); + + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/import1/transfer", transfer_node_enumerator, m); + if (r < 0) + return log_error_errno(r, "Failed to add transfer enumerator: %m"); + + r = sd_bus_request_name(m->bus, "org.freedesktop.import1", 0); + if (r < 0) + return log_error_errno(r, "Failed to register name: %m"); + + r = sd_bus_attach_event(m->bus, m->event, 0); + if (r < 0) + return log_error_errno(r, "Failed to attach bus to event loop: %m"); + + return 0; +} + +static bool manager_check_idle(void *userdata) { + Manager *m = userdata; + + return hashmap_isempty(m->transfers); +} + +static int manager_run(Manager *m) { + assert(m); + + return bus_event_loop_with_idle( + m->event, + m->bus, + "org.freedesktop.import1", + DEFAULT_EXIT_USEC, + manager_check_idle, + m); +} + +int main(int argc, char *argv[]) { + _cleanup_(manager_unrefp) Manager *m = NULL; + int r; + + log_set_target(LOG_TARGET_AUTO); + log_parse_environment(); + log_open(); + + umask(0022); + + if (argc != 1) { + log_error("This program takes no arguments."); + r = -EINVAL; + goto finish; + } + + assert_se(sigprocmask_many(SIG_BLOCK, SIGCHLD, -1) >= 0); + + r = manager_new(&m); + if (r < 0) { + log_error_errno(r, "Failed to allocate manager object: %m"); + goto finish; + } + + r = manager_add_bus_objects(m); + if (r < 0) + goto finish; + + r = manager_run(m); + if (r < 0) { + log_error_errno(r, "Failed to run event loop: %m"); + goto finish; + } + +finish: + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/src/import/org.freedesktop.import1.conf b/src/import/org.freedesktop.import1.conf new file mode 100644 index 000000000..ae36af422 --- /dev/null +++ b/src/import/org.freedesktop.import1.conf @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/import/org.freedesktop.import1.policy.in b/src/import/org.freedesktop.import1.policy.in new file mode 100644 index 000000000..1003f4644 --- /dev/null +++ b/src/import/org.freedesktop.import1.policy.in @@ -0,0 +1,29 @@ + + + + + + + + The systemd Project + http://www.freedesktop.org/wiki/Software/systemd + + + <_description>Download a VM or container image + <_message>Authentication is required to download a VM or container image + + auth_admin + auth_admin + auth_admin_keep + + + + diff --git a/src/import/org.freedesktop.import1.service b/src/import/org.freedesktop.import1.service new file mode 100644 index 000000000..8fc4c4788 --- /dev/null +++ b/src/import/org.freedesktop.import1.service @@ -0,0 +1,12 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# 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. + +[D-BUS Service] +Name=org.freedesktop.import1 +Exec=/bin/false +User=root +SystemdService=dbus-org.freedesktop.import1.service diff --git a/src/import/pull.c b/src/import/pull.c new file mode 100644 index 000000000..ee3ff6803 --- /dev/null +++ b/src/import/pull.c @@ -0,0 +1,440 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "sd-event.h" +#include "event-util.h" +#include "verbs.h" +#include "build.h" +#include "machine-image.h" +#include "import-tar.h" +#include "import-raw.h" +#include "import-dkr.h" +#include "import-util.h" + +static bool arg_force = false; +static const char *arg_image_root = "/var/lib/machines"; +static ImportVerify arg_verify = IMPORT_VERIFY_SIGNATURE; +static const char* arg_dkr_index_url = DEFAULT_DKR_INDEX_URL; + +static int interrupt_signal_handler(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { + log_notice("Transfer aborted."); + sd_event_exit(sd_event_source_get_event(s), EINTR); + return 0; +} + +static void on_tar_finished(TarImport *import, int error, void *userdata) { + sd_event *event = userdata; + assert(import); + + if (error == 0) + log_info("Operation completed successfully."); + + sd_event_exit(event, abs(error)); +} + +static int pull_tar(int argc, char *argv[], void *userdata) { + _cleanup_(tar_import_unrefp) TarImport *import = NULL; + _cleanup_event_unref_ sd_event *event = NULL; + const char *url, *local; + _cleanup_free_ char *l = NULL, *ll = NULL; + int r; + + url = argv[1]; + if (!http_url_is_valid(url)) { + log_error("URL '%s' is not valid.", url); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + r = import_url_last_component(url, &l); + if (r < 0) + return log_error_errno(r, "Failed get final component of URL: %m"); + + local = l; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + r = tar_strip_suffixes(local, &ll); + if (r < 0) + return log_oom(); + + local = ll; + + if (!machine_name_is_valid(local)) { + log_error("Local image name '%s' is not valid.", local); + return -EINVAL; + } + + if (!arg_force) { + r = image_find(local, NULL); + if (r < 0) + return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local); + else if (r > 0) { + log_error_errno(EEXIST, "Image '%s' already exists.", local); + return -EEXIST; + } + } + + log_info("Pulling '%s', saving as '%s'.", url, local); + } else + log_info("Pulling '%s'.", url); + + r = sd_event_default(&event); + if (r < 0) + return log_error_errno(r, "Failed to allocate event loop: %m"); + + assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0); + sd_event_add_signal(event, NULL, SIGTERM, interrupt_signal_handler, NULL); + sd_event_add_signal(event, NULL, SIGINT, interrupt_signal_handler, NULL); + + r = tar_import_new(&import, event, arg_image_root, on_tar_finished, event); + if (r < 0) + return log_error_errno(r, "Failed to allocate importer: %m"); + + r = tar_import_pull(import, url, local, arg_force, arg_verify); + if (r < 0) + return log_error_errno(r, "Failed to pull image: %m"); + + r = sd_event_loop(event); + if (r < 0) + return log_error_errno(r, "Failed to run event loop: %m"); + + log_info("Exiting."); + return -r; +} + +static void on_raw_finished(RawImport *import, int error, void *userdata) { + sd_event *event = userdata; + assert(import); + + if (error == 0) + log_info("Operation completed successfully."); + + sd_event_exit(event, abs(error)); +} + +static int pull_raw(int argc, char *argv[], void *userdata) { + _cleanup_(raw_import_unrefp) RawImport *import = NULL; + _cleanup_event_unref_ sd_event *event = NULL; + const char *url, *local; + _cleanup_free_ char *l = NULL, *ll = NULL; + int r; + + url = argv[1]; + if (!http_url_is_valid(url)) { + log_error("URL '%s' is not valid.", url); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + r = import_url_last_component(url, &l); + if (r < 0) + return log_error_errno(r, "Failed get final component of URL: %m"); + + local = l; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + r = raw_strip_suffixes(local, &ll); + if (r < 0) + return log_oom(); + + local = ll; + + if (!machine_name_is_valid(local)) { + log_error("Local image name '%s' is not valid.", local); + return -EINVAL; + } + + if (!arg_force) { + r = image_find(local, NULL); + if (r < 0) + return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local); + else if (r > 0) { + log_error_errno(EEXIST, "Image '%s' already exists.", local); + return -EEXIST; + } + } + + log_info("Pulling '%s', saving as '%s'.", url, local); + } else + log_info("Pulling '%s'.", url); + + r = sd_event_default(&event); + if (r < 0) + return log_error_errno(r, "Failed to allocate event loop: %m"); + + assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0); + sd_event_add_signal(event, NULL, SIGTERM, interrupt_signal_handler, NULL); + sd_event_add_signal(event, NULL, SIGINT, interrupt_signal_handler, NULL); + + r = raw_import_new(&import, event, arg_image_root, on_raw_finished, event); + if (r < 0) + return log_error_errno(r, "Failed to allocate importer: %m"); + + r = raw_import_pull(import, url, local, arg_force, arg_verify); + if (r < 0) + return log_error_errno(r, "Failed to pull image: %m"); + + r = sd_event_loop(event); + if (r < 0) + return log_error_errno(r, "Failed to run event loop: %m"); + + log_info("Exiting."); + return -r; +} + +static void on_dkr_finished(DkrImport *import, int error, void *userdata) { + sd_event *event = userdata; + assert(import); + + if (error == 0) + log_info("Operation completed successfully."); + + sd_event_exit(event, abs(error)); +} + +static int pull_dkr(int argc, char *argv[], void *userdata) { + _cleanup_(dkr_import_unrefp) DkrImport *import = NULL; + _cleanup_event_unref_ sd_event *event = NULL; + const char *name, *tag, *local; + int r; + + if (!arg_dkr_index_url) { + log_error("Please specify an index URL with --dkr-index-url="); + return -EINVAL; + } + + if (arg_verify != IMPORT_VERIFY_NO) { + log_error("Imports from dkr do not support image verification, please pass --verify=no."); + return -EINVAL; + } + + tag = strchr(argv[1], ':'); + if (tag) { + name = strndupa(argv[1], tag - argv[1]); + tag++; + } else { + name = argv[1]; + tag = "latest"; + } + + if (!dkr_name_is_valid(name)) { + log_error("Remote name '%s' is not valid.", name); + return -EINVAL; + } + + if (!dkr_tag_is_valid(tag)) { + log_error("Tag name '%s' is not valid.", tag); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + local = strchr(name, '/'); + if (local) + local++; + else + local = name; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + if (!machine_name_is_valid(local)) { + log_error("Local image name '%s' is not valid.", local); + return -EINVAL; + } + + if (!arg_force) { + r = image_find(local, NULL); + if (r < 0) + return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local); + else if (r > 0) { + log_error_errno(EEXIST, "Image '%s' already exists.", local); + return -EEXIST; + } + } + + log_info("Pulling '%s' with tag '%s', saving as '%s'.", name, tag, local); + } else + log_info("Pulling '%s' with tag '%s'.", name, tag); + + r = sd_event_default(&event); + if (r < 0) + return log_error_errno(r, "Failed to allocate event loop: %m"); + + assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0); + sd_event_add_signal(event, NULL, SIGTERM, interrupt_signal_handler, NULL); + sd_event_add_signal(event, NULL, SIGINT, interrupt_signal_handler, NULL); + + r = dkr_import_new(&import, event, arg_dkr_index_url, arg_image_root, on_dkr_finished, event); + if (r < 0) + return log_error_errno(r, "Failed to allocate importer: %m"); + + r = dkr_import_pull(import, name, tag, local, arg_force); + if (r < 0) + return log_error_errno(r, "Failed to pull image: %m"); + + r = sd_event_loop(event); + if (r < 0) + return log_error_errno(r, "Failed to run event loop: %m"); + + log_info("Exiting."); + return -r; +} + +static int help(int argc, char *argv[], void *userdata) { + + printf("%s [OPTIONS...] {COMMAND} ...\n\n" + "Import container or virtual machine image.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --force Force creation of image\n" + " --verify= Verify downloaded image, one of: 'no',\n" + " 'checksum', 'signature'.\n" + " --image-root= Image root directory\n" + " --dkr-index-url=URL Specify index URL to use for downloads\n\n" + "Commands:\n" + " tar URL [NAME] Download a TAR image\n" + " raw URL [NAME] Download a RAW image\n" + " dkr REMOTE [NAME] Download a DKR image\n", + program_invocation_short_name); + + return 0; +} + +static int parse_argv(int argc, char *argv[]) { + + enum { + ARG_VERSION = 0x100, + ARG_FORCE, + ARG_DKR_INDEX_URL, + ARG_IMAGE_ROOT, + ARG_VERIFY, + }; + + static const struct option options[] = { + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, ARG_VERSION }, + { "force", no_argument, NULL, ARG_FORCE }, + { "dkr-index-url", required_argument, NULL, ARG_DKR_INDEX_URL }, + { "image-root", required_argument, NULL, ARG_IMAGE_ROOT }, + { "verify", required_argument, NULL, ARG_VERIFY }, + {} + }; + + int c; + + assert(argc >= 0); + assert(argv); + + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) + + switch (c) { + + case 'h': + return help(0, NULL, NULL); + + case ARG_VERSION: + puts(PACKAGE_STRING); + puts(SYSTEMD_FEATURES); + return 0; + + case ARG_FORCE: + arg_force = true; + break; + + case ARG_DKR_INDEX_URL: + if (!http_url_is_valid(optarg)) { + log_error("Index URL is not valid: %s", optarg); + return -EINVAL; + } + + arg_dkr_index_url = optarg; + break; + + case ARG_IMAGE_ROOT: + arg_image_root = optarg; + break; + + case ARG_VERIFY: + arg_verify = import_verify_from_string(optarg); + if (arg_verify < 0) { + log_error("Invalid verification setting '%s'", optarg); + return -EINVAL; + } + + break; + + case '?': + return -EINVAL; + + default: + assert_not_reached("Unhandled option"); + } + + return 1; +} + +static int import_main(int argc, char *argv[]) { + + static const Verb verbs[] = { + { "help", VERB_ANY, VERB_ANY, 0, help }, + { "tar", 2, 3, 0, pull_tar }, + { "raw", 2, 3, 0, pull_raw }, + { "dkr", 2, 3, 0, pull_dkr }, + {} + }; + + return dispatch_verb(argc, argv, verbs, NULL); +} + +int main(int argc, char *argv[]) { + int r; + + setlocale(LC_ALL, ""); + log_parse_environment(); + log_open(); + + r = parse_argv(argc, argv); + if (r <= 0) + goto finish; + + r = import_main(argc, argv); + +finish: + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/src/import/qcow2-util.c b/src/import/qcow2-util.c new file mode 100644 index 000000000..9b0c23bb1 --- /dev/null +++ b/src/import/qcow2-util.c @@ -0,0 +1,353 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "util.h" +#include "sparse-endian.h" +#include "qcow2-util.h" +#include "btrfs-util.h" + +#define QCOW2_MAGIC 0x514649fb + +#define QCOW2_COPIED (1ULL << 63) +#define QCOW2_COMPRESSED (1ULL << 62) +#define QCOW2_ZERO (1ULL << 0) + +typedef struct _packed_ Header { + be32_t magic; + be32_t version; + + be64_t backing_file_offset; + be32_t backing_file_size; + + be32_t cluster_bits; + be64_t size; + be32_t crypt_method; + + be32_t l1_size; + be64_t l1_table_offset; + + be64_t refcount_table_offset; + be32_t refcount_table_clusters; + + be32_t nb_snapshots; + be64_t snapshots_offset; + + /* The remainder is only present on QCOW3 */ + be64_t incompatible_features; + be64_t compatible_features; + be64_t autoclear_features; + + be32_t refcount_order; + be32_t header_length; +} Header; + +#define HEADER_MAGIC(header) be32toh((header)->magic) +#define HEADER_VERSION(header) be32toh((header)->version) +#define HEADER_CLUSTER_BITS(header) be32toh((header)->cluster_bits) +#define HEADER_CLUSTER_SIZE(header) (1ULL << HEADER_CLUSTER_BITS(header)) +#define HEADER_L2_BITS(header) (HEADER_CLUSTER_BITS(header) - 3) +#define HEADER_SIZE(header) be64toh((header)->size) +#define HEADER_CRYPT_METHOD(header) be32toh((header)->crypt_method) +#define HEADER_L1_SIZE(header) be32toh((header)->l1_size) +#define HEADER_L2_SIZE(header) (HEADER_CLUSTER_SIZE(header)/sizeof(uint64_t)) +#define HEADER_L1_TABLE_OFFSET(header) be64toh((header)->l1_table_offset) + +static uint32_t HEADER_HEADER_LENGTH(const Header *h) { + if (HEADER_VERSION(h) < 3) + return offsetof(Header, incompatible_features); + + return be32toh(h->header_length); +} + +static int copy_cluster( + int sfd, uint64_t soffset, + int dfd, uint64_t doffset, + uint64_t cluster_size, + void *buffer) { + + ssize_t l; + int r; + + r = btrfs_clone_range(sfd, soffset, dfd, doffset, cluster_size); + if (r >= 0) + return r; + + l = pread(sfd, buffer, cluster_size, soffset); + if (l < 0) + return -errno; + if ((uint64_t) l != cluster_size) + return -EIO; + + l = pwrite(dfd, buffer, cluster_size, doffset); + if (l < 0) + return -errno; + if ((uint64_t) l != cluster_size) + return -EIO; + + return 0; +} + +static int decompress_cluster( + int sfd, uint64_t soffset, + int dfd, uint64_t doffset, + uint64_t compressed_size, + uint64_t cluster_size, + void *buffer1, + void *buffer2) { + + _cleanup_free_ void *large_buffer = NULL; + z_stream s = {}; + uint64_t sz; + ssize_t l; + int r; + + if (compressed_size > cluster_size) { + /* The usual cluster buffer doesn't suffice, let's + * allocate a larger one, temporarily */ + + large_buffer = malloc(compressed_size); + if (!large_buffer) + return -ENOMEM; + + buffer1 = large_buffer; + } + + l = pread(sfd, buffer1, compressed_size, soffset); + if (l < 0) + return -errno; + if ((uint64_t) l != compressed_size) + return -EIO; + + s.next_in = buffer1; + s.avail_in = compressed_size; + s.next_out = buffer2; + s.avail_out = cluster_size; + + r = inflateInit2(&s, -12); + if (r != Z_OK) + return -EIO; + + r = inflate(&s, Z_FINISH); + sz = (uint8_t*) s.next_out - (uint8_t*) buffer2; + inflateEnd(&s); + if (r != Z_STREAM_END || sz != cluster_size) + return -EIO; + + l = pwrite(dfd, buffer2, cluster_size, doffset); + if (l < 0) + return -errno; + if ((uint64_t) l != cluster_size) + return -EIO; + + return 0; +} + +static int normalize_offset( + const Header *header, + uint64_t p, + uint64_t *ret, + bool *compressed, + uint64_t *compressed_size) { + + uint64_t q; + + q = be64toh(p); + + if (q & QCOW2_COMPRESSED) { + uint64_t sz, csize_shift, csize_mask; + + if (!compressed) + return -ENOTSUP; + + csize_shift = 64 - 2 - (HEADER_CLUSTER_BITS(header) - 8); + csize_mask = (1ULL << (HEADER_CLUSTER_BITS(header) - 8)) - 1; + sz = (((q >> csize_shift) & csize_mask) + 1) * 512 - (q & 511); + q &= ((1ULL << csize_shift) - 1); + + if (compressed_size) + *compressed_size = sz; + + *compressed = true; + + } else { + if (compressed) { + *compressed = false; + *compressed_size = 0; + } + + if (q & QCOW2_ZERO) { + /* We make no distinction between zero blocks and holes */ + *ret = 0; + return 0; + } + + q &= ~QCOW2_COPIED; + } + + *ret = q; + return q > 0; /* returns positive if not a hole */ +} + +static int verify_header(const Header *header) { + assert(header); + + if (HEADER_MAGIC(header) != QCOW2_MAGIC) + return -EBADMSG; + + if (HEADER_VERSION(header) != 2 && + HEADER_VERSION(header) != 3) + return -ENOTSUP; + + if (HEADER_CRYPT_METHOD(header) != 0) + return -ENOTSUP; + + if (HEADER_CLUSTER_BITS(header) < 9) /* 512K */ + return -EBADMSG; + + if (HEADER_CLUSTER_BITS(header) > 21) /* 2MB */ + return -EBADMSG; + + if (HEADER_SIZE(header) % HEADER_CLUSTER_SIZE(header) != 0) + return -EBADMSG; + + if (HEADER_L1_SIZE(header) > 32*1024*1024) /* 32MB */ + return -EBADMSG; + + if (HEADER_VERSION(header) == 3) { + + if (header->incompatible_features != 0) + return -ENOTSUP; + + if (HEADER_HEADER_LENGTH(header) < sizeof(Header)) + return -EBADMSG; + } + + return 0; +} + +int qcow2_convert(int qcow2_fd, int raw_fd) { + _cleanup_free_ void *buffer1 = NULL, *buffer2 = NULL; + _cleanup_free_ be64_t *l1_table = NULL, *l2_table = NULL; + uint64_t sz, i; + Header header; + ssize_t l; + int r; + + l = pread(qcow2_fd, &header, sizeof(header), 0); + if (l < 0) + return -errno; + if (l != sizeof(header)) + return -EIO; + + r = verify_header(&header); + if (r < 0) + return r; + + l1_table = new(be64_t, HEADER_L1_SIZE(&header)); + if (!l1_table) + return -ENOMEM; + + l2_table = malloc(HEADER_CLUSTER_SIZE(&header)); + if (!l2_table) + return -ENOMEM; + + buffer1 = malloc(HEADER_CLUSTER_SIZE(&header)); + if (!buffer1) + return -ENOMEM; + + buffer2 = malloc(HEADER_CLUSTER_SIZE(&header)); + if (!buffer2) + return -ENOMEM; + + /* Empty the file if it exists, we rely on zero bits */ + if (ftruncate(raw_fd, 0) < 0) + return -errno; + + if (ftruncate(raw_fd, HEADER_SIZE(&header)) < 0) + return -errno; + + sz = sizeof(uint64_t) * HEADER_L1_SIZE(&header); + l = pread(qcow2_fd, l1_table, sz, HEADER_L1_TABLE_OFFSET(&header)); + if (l < 0) + return -errno; + if ((uint64_t) l != sz) + return -EIO; + + for (i = 0; i < HEADER_L1_SIZE(&header); i ++) { + uint64_t l2_begin, j; + + r = normalize_offset(&header, l1_table[i], &l2_begin, NULL, NULL); + if (r < 0) + return r; + if (r == 0) + continue; + + l = pread(qcow2_fd, l2_table, HEADER_CLUSTER_SIZE(&header), l2_begin); + if (l < 0) + return -errno; + if ((uint64_t) l != HEADER_CLUSTER_SIZE(&header)) + return -EIO; + + for (j = 0; j < HEADER_L2_SIZE(&header); j++) { + uint64_t data_begin, p, compressed_size; + bool compressed; + + p = ((i << HEADER_L2_BITS(&header)) + j) << HEADER_CLUSTER_BITS(&header); + + r = normalize_offset(&header, l2_table[j], &data_begin, &compressed, &compressed_size); + if (r < 0) + return r; + if (r == 0) + continue; + + if (compressed) + r = decompress_cluster( + qcow2_fd, data_begin, + raw_fd, p, + compressed_size, HEADER_CLUSTER_SIZE(&header), + buffer1, buffer2); + else + r = copy_cluster( + qcow2_fd, data_begin, + raw_fd, p, + HEADER_CLUSTER_SIZE(&header), buffer1); + if (r < 0) + return r; + } + } + + return 0; +} + +int qcow2_detect(int fd) { + be32_t id; + ssize_t l; + + l = pread(fd, &id, sizeof(id), 0); + if (l < 0) + return -errno; + if (l != sizeof(id)) + return -EIO; + + return htobe32(QCOW2_MAGIC) == id; +} diff --git a/src/import/qcow2-util.h b/src/import/qcow2-util.h new file mode 100644 index 000000000..be7fd1d0c --- /dev/null +++ b/src/import/qcow2-util.h @@ -0,0 +1,25 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +int qcow2_detect(int fd); +int qcow2_convert(int qcow2_fd, int raw_fd); diff --git a/src/import/test-qcow2.c b/src/import/test-qcow2.c new file mode 100644 index 000000000..9a6c3e8b3 --- /dev/null +++ b/src/import/test-qcow2.c @@ -0,0 +1,55 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "log.h" +#include "util.h" + +#include "qcow2-util.h" + +int main(int argc, char *argv[]) { + _cleanup_close_ int sfd = -1, dfd = -1; + int r; + + if (argc != 3) { + log_error("Needs two arguments."); + return EXIT_FAILURE; + } + + sfd = open(argv[1], O_RDONLY|O_CLOEXEC|O_NOCTTY); + if (sfd < 0) { + log_error_errno(errno, "Can't open source file: %m"); + return EXIT_FAILURE; + } + + dfd = open(argv[2], O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666); + if (dfd < 0) { + log_error_errno(errno, "Can't open destination file: %m"); + return EXIT_FAILURE; + } + + r = qcow2_convert(sfd, dfd); + if (r < 0) { + log_error_errno(r, "Failed to unpack: %m"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c index d7cd4ba29..7a6a383b3 100644 --- a/src/initctl/initctl.c +++ b/src/initctl/initctl.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 7a99430a6..576f7cae7 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -31,20 +31,21 @@ #include #endif -#include "log.h" -#include "util.h" #include "sd-journal.h" #include "sd-daemon.h" #include "sd-bus.h" +#include "log.h" +#include "util.h" #include "bus-util.h" #include "logs-show.h" #include "microhttpd-util.h" #include "build.h" #include "fileio.h" +#include "sigbus.h" -static char *key_pem = NULL; -static char *cert_pem = NULL; -static char *trust_pem = NULL; +static char *arg_key_pem = NULL; +static char *arg_cert_pem = NULL; +static char *arg_trust_pem = NULL; typedef struct RequestMeta { sd_journal *journal; @@ -833,7 +834,7 @@ static int request_handler( return MHD_YES; } - if (trust_pem) { + if (arg_trust_pem) { r = check_permissions(connection, &code, NULL); if (r < 0) return code; @@ -904,37 +905,37 @@ static int parse_argv(int argc, char *argv[]) { return 0; case ARG_KEY: - if (key_pem) { + if (arg_key_pem) { log_error("Key file specified twice"); return -EINVAL; } - r = read_full_file(optarg, &key_pem, NULL); + r = read_full_file(optarg, &arg_key_pem, NULL); if (r < 0) return log_error_errno(r, "Failed to read key file: %m"); - assert(key_pem); + assert(arg_key_pem); break; case ARG_CERT: - if (cert_pem) { + if (arg_cert_pem) { log_error("Certificate file specified twice"); return -EINVAL; } - r = read_full_file(optarg, &cert_pem, NULL); + r = read_full_file(optarg, &arg_cert_pem, NULL); if (r < 0) return log_error_errno(r, "Failed to read certificate file: %m"); - assert(cert_pem); + assert(arg_cert_pem); break; case ARG_TRUST: #ifdef HAVE_GNUTLS - if (trust_pem) { + if (arg_trust_pem) { log_error("CA certificate file specified twice"); return -EINVAL; } - r = read_full_file(optarg, &trust_pem, NULL); + r = read_full_file(optarg, &arg_trust_pem, NULL); if (r < 0) return log_error_errno(r, "Failed to read CA certificate file: %m"); - assert(trust_pem); + assert(arg_trust_pem); break; #else log_error("Option --trust is not available."); @@ -952,12 +953,12 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; } - if (!!key_pem != !!cert_pem) { + if (!!arg_key_pem != !!arg_cert_pem) { log_error("Certificate and key files must be specified together"); return -EINVAL; } - if (trust_pem && !key_pem) { + if (arg_trust_pem && !arg_key_pem) { log_error("CA certificate can only be used with certificate file"); return -EINVAL; } @@ -979,6 +980,8 @@ int main(int argc, char *argv[]) { if (r == 0) return EXIT_SUCCESS; + sigbus_install(); + #ifdef HAVE_GNUTLS gnutls_global_set_log_function(log_func_gnutls); log_reset_gnutls_level(); @@ -1008,18 +1011,18 @@ int main(int argc, char *argv[]) { if (n > 0) opts[opts_pos++] = (struct MHD_OptionItem) {MHD_OPTION_LISTEN_SOCKET, SD_LISTEN_FDS_START}; - if (key_pem) { - assert(cert_pem); + if (arg_key_pem) { + assert(arg_cert_pem); opts[opts_pos++] = (struct MHD_OptionItem) - {MHD_OPTION_HTTPS_MEM_KEY, 0, key_pem}; + {MHD_OPTION_HTTPS_MEM_KEY, 0, arg_key_pem}; opts[opts_pos++] = (struct MHD_OptionItem) - {MHD_OPTION_HTTPS_MEM_CERT, 0, cert_pem}; + {MHD_OPTION_HTTPS_MEM_CERT, 0, arg_cert_pem}; flags |= MHD_USE_SSL; } - if (trust_pem) { + if (arg_trust_pem) { assert(flags & MHD_USE_SSL); opts[opts_pos++] = (struct MHD_OptionItem) - {MHD_OPTION_HTTPS_MEM_TRUST, 0, trust_pem}; + {MHD_OPTION_HTTPS_MEM_TRUST, 0, arg_trust_pem}; } d = MHD_start_daemon(flags, 19531, diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c index 76407f711..d9dea8deb 100644 --- a/src/journal-remote/journal-remote-parse.c +++ b/src/journal-remote/journal-remote-parse.c @@ -37,7 +37,7 @@ void source_free(RemoteSource *source) { free(source->buf); iovw_free_contents(&source->iovw); - log_debug("Writer ref count %u", source->writer->n_ref); + log_debug("Writer ref count %i", source->writer->n_ref); writer_unref(source->writer); sd_event_source_unref(source->event); @@ -125,8 +125,8 @@ static int get_line(RemoteSource *source, char **line, size_t *size) { source->size - source->filled); if (n < 0) { if (errno != EAGAIN && errno != EWOULDBLOCK) - log_error_errno(errno, "read(%d, ..., %zd): %m", source->fd, - source->size - source->filled); + log_error_errno(errno, "read(%d, ..., %zu): %m", source->fd, + source->size - source->filled); return -errno; } else if (n == 0) return 0; @@ -186,8 +186,8 @@ static int fill_fixed_size(RemoteSource *source, void **data, size_t size) { source->size - source->filled); if (n < 0) { if (errno != EAGAIN && errno != EWOULDBLOCK) - log_error_errno(errno, "read(%d, ..., %zd): %m", source->fd, - source->size - source->filled); + log_error_errno(errno, "read(%d, ..., %zu): %m", source->fd, + source->size - source->filled); return -errno; } else if (n == 0) return 0; diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 6ec5ad2e7..8f32a9a98 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -406,7 +406,7 @@ static int add_source(RemoteServer *s, int fd, char* name, bool own_name) { static int add_raw_socket(RemoteServer *s, int fd) { int r; _cleanup_close_ int fd_ = fd; - char name[strlen("raw-socket-") + DECIMAL_STR_MAX(int)]; + char name[sizeof("raw-socket-")-1 + DECIMAL_STR_MAX(int) + 1]; assert(fd >= 0); @@ -416,7 +416,7 @@ static int add_raw_socket(RemoteServer *s, int fd) { if (r < 0) return r; - snprintf(name, sizeof(name), "raw-socket-%d", fd); + xsprintf(name, "raw-socket-%d", fd); r = sd_event_source_set_description(s->listen_event, name); if (r < 0) @@ -885,7 +885,7 @@ static int remoteserver_init(RemoteServer *s, if (arg_url) { const char *url, *hostname; - url = strappenda(arg_url, "/entries"); + url = strjoina(arg_url, "/entries"); if (arg_getter) { log_info("Spawning getter %s...", url); @@ -1021,7 +1021,7 @@ static int dispatch_raw_source_event(sd_event_source *event, if (remaining > 0) log_warning("Premature EOF. %zu bytes lost.", remaining); remove_source(s, source->fd); - log_info("%zd active sources remaining", s->active); + log_info("%zu active sources remaining", s->active); return 0; } else if (r == -E2BIG) { log_error("Entry too big, skipped"); @@ -1469,13 +1469,13 @@ static int setup_gnutls_logger(char **categories) { gnutls_global_set_log_function(log_func_gnutls); - if (categories) + if (categories) { STRV_FOREACH(cat, categories) { r = log_enable_gnutls_category(*cat); if (r < 0) return r; } - else + } else log_reset_gnutls_level(); } #endif diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index 942320cbf..5fd639a76 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -104,7 +104,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) { r = snprintf(buf + pos, size - pos, "_BOOT_ID=%s\n", sd_id128_to_string(boot_id, sid)); - if (r + pos> size) + if (r + pos > size) /* not enough space */ return pos; diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 62853b636..75bb434c0 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -26,13 +26,13 @@ #include #include "sd-daemon.h" - #include "log.h" #include "util.h" #include "build.h" #include "fileio.h" #include "mkdir.h" #include "conf-parser.h" +#include "sigbus.h" #include "journal-upload.h" #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-upload.pem" @@ -40,14 +40,10 @@ #define TRUST_FILE CERTIFICATE_ROOT "/ca/trusted.pem" #define DEFAULT_PORT 19532 -static const char* arg_url; - -static void close_fd_input(Uploader *u); - +static const char* arg_url = NULL; static const char *arg_key = NULL; static const char *arg_cert = NULL; static const char *arg_trust = NULL; - static const char *arg_directory = NULL; static char **arg_file = NULL; static const char *arg_cursor = NULL; @@ -58,6 +54,8 @@ static bool arg_merge = false; static int arg_follow = -1; static const char *arg_save_state = NULL; +static void close_fd_input(Uploader *u); + #define SERVER_ANSWER_KEEP 2048 #define STATE_FILE "/var/lib/systemd/journal-upload/state" @@ -238,8 +236,9 @@ int start_upload(Uploader *u, easy_setopt(curl, CURLOPT_HTTPHEADER, u->header, LOG_ERR, return -EXFULL); - /* enable verbose for easier tracing */ - easy_setopt(curl, CURLOPT_VERBOSE, 1L, LOG_WARNING, ); + if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) + /* enable verbose for easier tracing */ + easy_setopt(curl, CURLOPT_VERBOSE, 1L, LOG_WARNING, ); easy_setopt(curl, CURLOPT_USERAGENT, "systemd-journal-upload " PACKAGE_STRING, @@ -297,7 +296,7 @@ static size_t fd_input_callback(void *buf, size_t size, size_t nmemb, void *user return 0; r = read(u->input, buf, size * nmemb); - log_debug("%s: allowed %zu, read %zu", __func__, size*nmemb, r); + log_debug("%s: allowed %zu, read %zd", __func__, size*nmemb, r); if (r > 0) return r; @@ -506,15 +505,15 @@ static int perform_upload(Uploader *u) { } if (status >= 300) { - log_error("Upload to %s failed with code %lu: %s", + log_error("Upload to %s failed with code %ld: %s", u->url, status, strna(u->answer)); return -EIO; } else if (status < 200) { - log_error("Upload to %s finished with unexpected code %lu: %s", + log_error("Upload to %s finished with unexpected code %ld: %s", u->url, status, strna(u->answer)); return -EIO; } else - log_debug("Upload finished successfully with code %lu: %s", + log_debug("Upload finished successfully with code %ld: %s", status, strna(u->answer)); free(u->last_cursor); @@ -792,6 +791,8 @@ int main(int argc, char **argv) { if (r <= 0) goto finish; + sigbus_install(); + r = setup_uploader(&u, arg_url, arg_save_state); if (r < 0) goto cleanup; diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c index 277e12540..34d93379d 100644 --- a/src/journal-remote/microhttpd-util.c +++ b/src/journal-remote/microhttpd-util.c @@ -38,7 +38,7 @@ void microhttpd_logger(void *arg, const char *fmt, va_list ap) { char *f; - f = strappenda("microhttpd: ", fmt); + f = strjoina("microhttpd: ", fmt); DISABLE_WARNING_FORMAT_NONLITERAL; log_internalv(LOG_INFO, 0, NULL, 0, NULL, f, ap); diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 81a2e946e..f17023284 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "util.h" #include "log.h" diff --git a/src/journal/compress.c b/src/journal/compress.c index 9440fcd60..6923753f8 100644 --- a/src/journal/compress.c +++ b/src/journal/compress.c @@ -356,7 +356,7 @@ int compress_stream_xz(int fdf, int fdt, off_t max_bytes) { ret = lzma_easy_encoder(&s, LZMA_PRESET_DEFAULT, LZMA_CHECK_CRC64); if (ret != LZMA_OK) { - log_error("Failed to initialize XZ encoder: code %d", ret); + log_error("Failed to initialize XZ encoder: code %u", ret); return -EINVAL; } @@ -391,7 +391,7 @@ int compress_stream_xz(int fdf, int fdt, off_t max_bytes) { ret = lzma_code(&s, action); if (ret != LZMA_OK && ret != LZMA_STREAM_END) { - log_error("Compression failed: code %d", ret); + log_error("Compression failed: code %u", ret); return -EBADMSG; } @@ -512,7 +512,7 @@ int decompress_stream_xz(int fdf, int fdt, off_t max_bytes) { ret = lzma_stream_decoder(&s, UINT64_MAX, 0); if (ret != LZMA_OK) { - log_error("Failed to initialize XZ decoder: code %d", ret); + log_error("Failed to initialize XZ decoder: code %u", ret); return -ENOMEM; } @@ -538,7 +538,7 @@ int decompress_stream_xz(int fdf, int fdt, off_t max_bytes) { ret = lzma_code(&s, action); if (ret != LZMA_OK && ret != LZMA_STREAM_END) { - log_error("Decompression failed: code %d", ret); + log_error("Decompression failed: code %u", ret); return -EBADMSG; } diff --git a/src/journal/coredump.c b/src/journal/coredump.c index be45a684e..f7ba0191e 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -31,9 +31,8 @@ # include #endif -#include "systemd/sd-journal.h" -#include "systemd/sd-login.h" - +#include "sd-journal.h" +#include "sd-login.h" #include "log.h" #include "util.h" #include "fileio.h" @@ -42,19 +41,16 @@ #include "mkdir.h" #include "special.h" #include "cgroup-util.h" -#include "journald-native.h" #include "conf-parser.h" #include "copy.h" #include "stacktrace.h" #include "path-util.h" #include "compress.h" +#include "acl-util.h" +#include "capability.h" +#include "journald-native.h" #include "coredump-vacuum.h" -#ifdef HAVE_ACL -# include -# include "acl-util.h" -#endif - /* The maximum size up to which we process coredumps */ #define PROCESS_SIZE_MAX ((off_t) (2LLU*1024LLU*1024LLU*1024LLU)) @@ -306,9 +302,9 @@ static int save_external_coredump( if (r < 0) return log_error_errno(r, "Failed to determine coredump file name: %m"); - tmp = tempfn_random(fn); - if (!tmp) - return log_oom(); + r = tempfn_random(fn, &tmp); + if (r < 0) + return log_error_errno(r, "Failed to determine temporary file name: %m"); mkdir_p_label("/var/lib/systemd/coredump", 0755); @@ -316,7 +312,7 @@ static int save_external_coredump( if (fd < 0) return log_error_errno(errno, "Failed to create coredump file %s: %m", tmp); - r = copy_bytes(STDIN_FILENO, fd, arg_process_size_max); + r = copy_bytes(STDIN_FILENO, fd, arg_process_size_max, false); if (r == -EFBIG) { log_error("Coredump of %s (%s) is larger than configured processing limit, refusing.", info[INFO_PID], info[INFO_COMM]); goto fail; @@ -352,9 +348,9 @@ static int save_external_coredump( goto uncompressed; } - tmp_compressed = tempfn_random(fn_compressed); - if (!tmp_compressed) { - log_oom(); + r = tempfn_random(fn_compressed, &tmp_compressed); + if (r < 0) { + log_error_errno(r, "Failed to determine temporary file name for %s: %m", fn_compressed); goto uncompressed; } @@ -638,11 +634,11 @@ int main(int argc, char* argv[]) { goto finish; } - core_unit = strappenda("COREDUMP_UNIT=", t); + core_unit = strjoina("COREDUMP_UNIT=", t); free(t); } else if (cg_pid_get_user_unit(pid, &t) >= 0) { - core_unit = strappenda("COREDUMP_USER_UNIT=", t); + core_unit = strjoina("COREDUMP_USER_UNIT=", t); free(t); } @@ -654,20 +650,20 @@ int main(int argc, char* argv[]) { log_set_target(LOG_TARGET_JOURNAL_OR_KMSG); log_open(); - core_pid = strappenda("COREDUMP_PID=", info[INFO_PID]); + core_pid = strjoina("COREDUMP_PID=", info[INFO_PID]); IOVEC_SET_STRING(iovec[j++], core_pid); - core_uid = strappenda("COREDUMP_UID=", info[INFO_UID]); + core_uid = strjoina("COREDUMP_UID=", info[INFO_UID]); IOVEC_SET_STRING(iovec[j++], core_uid); - core_gid = strappenda("COREDUMP_GID=", info[INFO_GID]); + core_gid = strjoina("COREDUMP_GID=", info[INFO_GID]); IOVEC_SET_STRING(iovec[j++], core_gid); - core_signal = strappenda("COREDUMP_SIGNAL=", info[INFO_SIGNAL]); + core_signal = strjoina("COREDUMP_SIGNAL=", info[INFO_SIGNAL]); IOVEC_SET_STRING(iovec[j++], core_signal); if (sd_pid_get_session(pid, &t) >= 0) { - core_session = strappenda("COREDUMP_SESSION=", t); + core_session = strjoina("COREDUMP_SESSION=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_session); @@ -681,31 +677,31 @@ int main(int argc, char* argv[]) { } if (sd_pid_get_slice(pid, &t) >= 0) { - core_slice = strappenda("COREDUMP_SLICE=", t); + core_slice = strjoina("COREDUMP_SLICE=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_slice); } if (comm) { - core_comm = strappenda("COREDUMP_COMM=", comm); + core_comm = strjoina("COREDUMP_COMM=", comm); IOVEC_SET_STRING(iovec[j++], core_comm); } if (exe) { - core_exe = strappenda("COREDUMP_EXE=", exe); + core_exe = strjoina("COREDUMP_EXE=", exe); IOVEC_SET_STRING(iovec[j++], core_exe); } if (get_process_cmdline(pid, 0, false, &t) >= 0) { - core_cmdline = strappenda("COREDUMP_CMDLINE=", t); + core_cmdline = strjoina("COREDUMP_CMDLINE=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cmdline); } if (cg_pid_get_path_shifted(pid, NULL, &t) >= 0) { - core_cgroup = strappenda("COREDUMP_CGROUP=", t); + core_cgroup = strjoina("COREDUMP_CGROUP=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cgroup); @@ -756,14 +752,14 @@ int main(int argc, char* argv[]) { } if (get_process_cwd(pid, &t) >= 0) { - core_cwd = strappenda("COREDUMP_CWD=", t); + core_cwd = strjoina("COREDUMP_CWD=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cwd); } if (get_process_root(pid, &t) >= 0) { - core_root = strappenda("COREDUMP_ROOT=", t); + core_root = strjoina("COREDUMP_ROOT=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_root); @@ -803,7 +799,7 @@ int main(int argc, char* argv[]) { if (r == 0) { const char *coredump_filename; - coredump_filename = strappenda("COREDUMP_FILENAME=", filename); + coredump_filename = strjoina("COREDUMP_FILENAME=", filename); IOVEC_SET_STRING(iovec[j++], coredump_filename); } @@ -814,11 +810,12 @@ int main(int argc, char* argv[]) { * segfaulted process and allocate the coredump memory under * the user's uid. This also ensures that the credentials * journald will see are the ones of the coredumping user, - * thus making sure the user gets access to the core dump. */ - if (setresgid(gid, gid, gid) < 0 || - setresuid(uid, uid, uid) < 0) { - log_error_errno(errno, "Failed to drop privileges: %m"); - r = -errno; + * thus making sure the user gets access to the core + * dump. Let's also get rid of all capabilities, if we run as + * root, we won't need them anymore. */ + r = drop_privileges(uid, gid, 0); + if (r < 0) { + log_error_errno(r, "Failed to drop privileges: %m"); goto finish; } diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c index a6551ac44..afb39ad03 100644 --- a/src/journal/coredumpctl.c +++ b/src/journal/coredumpctl.c @@ -26,8 +26,7 @@ #include #include -#include "systemd/sd-journal.h" - +#include "sd-journal.h" #include "build.h" #include "set.h" #include "util.h" @@ -38,6 +37,7 @@ #include "journal-internal.h" #include "copy.h" #include "compress.h" +#include "sigbus.h" static enum { ACTION_NONE, @@ -50,8 +50,7 @@ static const char* arg_field = NULL; static int arg_no_pager = false; static int arg_no_legend = false; static int arg_one = false; - -static FILE* output = NULL; +static FILE* arg_output = NULL; static Set *new_matches(void) { Set *set; @@ -184,13 +183,13 @@ static int parse_argv(int argc, char *argv[], Set *matches) { break; case 'o': - if (output) { + if (arg_output) { log_error("cannot set output more than once"); return -EINVAL; } - output = fopen(optarg, "we"); - if (!output) + arg_output = fopen(optarg, "we"); + if (!arg_output) return log_error_errno(errno, "writing to '%s': %m", optarg); break; @@ -687,14 +686,14 @@ static int dump_core(sd_journal* j) { if (r < 0) return r; - print_info(output ? stdout : stderr, j, false); + print_info(arg_output ? stdout : stderr, j, false); - if (on_tty() && !output) { + if (on_tty() && !arg_output) { log_error("Refusing to dump core to tty."); return -ENOTTY; } - r = save_core(j, output ? fileno(output) : STDOUT_FILENO, NULL, NULL); + r = save_core(j, arg_output ? fileno(arg_output) : STDOUT_FILENO, NULL, NULL); if (r < 0) return log_error_errno(r, "Coredump retrieval failed: %m"); @@ -803,6 +802,8 @@ int main(int argc, char *argv[]) { if (arg_action == ACTION_NONE) goto end; + sigbus_install(); + r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); if (r < 0) { log_error_errno(r, "Failed to open journal: %m"); @@ -821,7 +822,7 @@ int main(int argc, char *argv[]) { } } - if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) { + if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) { _cleanup_free_ char *filter; filter = journal_make_match_string(j); @@ -853,8 +854,8 @@ int main(int argc, char *argv[]) { end: pager_close(); - if (output) - fclose(output); + if (arg_output) + fclose(arg_output); return r >= 0 ? r : EXIT_FAILURE; } diff --git a/src/journal/journal-authenticate.c b/src/journal/journal-authenticate.c index f9bd686c1..b3e2601c4 100644 --- a/src/journal/journal-authenticate.c +++ b/src/journal/journal-authenticate.c @@ -229,7 +229,7 @@ int journal_file_maybe_append_tag(JournalFile *f, uint64_t realtime) { return 0; } -int journal_file_hmac_put_object(JournalFile *f, int type, Object *o, uint64_t p) { +int journal_file_hmac_put_object(JournalFile *f, ObjectType type, Object *o, uint64_t p) { int r; assert(f); @@ -246,7 +246,7 @@ int journal_file_hmac_put_object(JournalFile *f, int type, Object *o, uint64_t p if (r < 0) return r; } else { - if (type >= 0 && o->object.type != type) + if (type > OBJECT_UNUSED && o->object.type != type) return -EBADMSG; } diff --git a/src/journal/journal-authenticate.h b/src/journal/journal-authenticate.h index 0aaf83672..565fe8432 100644 --- a/src/journal/journal-authenticate.h +++ b/src/journal/journal-authenticate.h @@ -33,7 +33,7 @@ int journal_file_append_first_tag(JournalFile *f); int journal_file_hmac_setup(JournalFile *f); int journal_file_hmac_start(JournalFile *f); int journal_file_hmac_put_header(JournalFile *f); -int journal_file_hmac_put_object(JournalFile *f, int type, Object *o, uint64_t p); +int journal_file_hmac_put_object(JournalFile *f, ObjectType type, Object *o, uint64_t p); int journal_file_fss_load(JournalFile *f); int journal_file_parse_verification_key(JournalFile *f, const char *key); diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h index e55fa196f..ab089cb96 100644 --- a/src/journal/journal-def.h +++ b/src/journal/journal-def.h @@ -52,8 +52,8 @@ typedef struct HashItem HashItem; typedef struct FSSHeader FSSHeader; /* Object types */ -enum { - OBJECT_UNUSED, +typedef enum ObjectType { + OBJECT_UNUSED, /* also serves as "any type" or "additional context" */ OBJECT_DATA, OBJECT_FIELD, OBJECT_ENTRY, @@ -62,7 +62,7 @@ enum { OBJECT_ENTRY_ARRAY, OBJECT_TAG, _OBJECT_TYPE_MAX -}; +} ObjectType; /* Object flags */ enum { diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index c5d2d1943..2845e05ce 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -26,8 +26,9 @@ #include #include #include -#include +#include +#include "btrfs-util.h" #include "journal-def.h" #include "journal-file.h" #include "journal-authenticate.h" @@ -68,6 +69,12 @@ /* How much to increase the journal file size at once each time we allocate something new. */ #define FILE_SIZE_INCREASE (8ULL*1024ULL*1024ULL) /* 8MB */ +/* Reread fstat() of the file for detecting deletions at least this often */ +#define LAST_STAT_REFRESH_USEC (5*USEC_PER_SEC) + +/* The mmap context to use for the header we pick as one above the last defined typed */ +#define CONTEXT_HEADER _OBJECT_TYPE_MAX + static int journal_file_set_online(JournalFile *f) { assert(f); @@ -77,6 +84,9 @@ static int journal_file_set_online(JournalFile *f) { if (!(f->fd >= 0 && f->header)) return -EINVAL; + if (mmap_cache_got_sigbus(f->mmap, f->fd)) + return -EIO; + switch(f->header->state) { case STATE_ONLINE: return 0; @@ -105,8 +115,14 @@ int journal_file_set_offline(JournalFile *f) { fsync(f->fd); + if (mmap_cache_got_sigbus(f->mmap, f->fd)) + return -EIO; + f->header->state = STATE_OFFLINE; + if (mmap_cache_got_sigbus(f->mmap, f->fd)) + return -EIO; + fsync(f->fd); return 0; @@ -121,14 +137,22 @@ void journal_file_close(JournalFile *f) { journal_file_append_tag(f); #endif - /* Sync everything to disk, before we mark the file offline */ + journal_file_set_offline(f); + if (f->mmap && f->fd >= 0) mmap_cache_close_fd(f->mmap, f->fd); - journal_file_set_offline(f); + if (f->fd >= 0 && f->defrag_on_close) { + + /* Be friendly to btrfs: turn COW back on again now, + * and defragment the file. We won't write to the file + * ever again, hence remove all fragmentation, and + * reenable all the good bits COW usually provides + * (such as data checksumming). */ - if (f->header) - munmap(f->header, PAGE_ALIGN(sizeof(Header))); + (void) chattr_fd(f->fd, false, FS_NOCOW_FL); + (void) btrfs_defrag_fd(f->fd); + } safe_close(f->fd); free(f->path); @@ -195,8 +219,8 @@ static int journal_file_init_header(JournalFile *f, JournalFile *template) { } static int journal_file_refresh_header(JournalFile *f) { - int r; sd_id128_t boot_id; + int r; assert(f); @@ -213,12 +237,12 @@ static int journal_file_refresh_header(JournalFile *f) { f->header->boot_id = boot_id; - journal_file_set_online(f); + r = journal_file_set_online(f); /* Sync the online state to disk */ fsync(f->fd); - return 0; + return r; } static int journal_file_verify_header(JournalFile *f) { @@ -299,7 +323,7 @@ static int journal_file_verify_header(JournalFile *f) { } else if (state == STATE_ARCHIVED) return -ESHUTDOWN; else if (state != STATE_OFFLINE) { - log_debug("Journal file %s has unknown state %u.", f->path, state); + log_debug("Journal file %s has unknown state %i.", f->path, state); return -EBUSY; } } @@ -312,6 +336,22 @@ static int journal_file_verify_header(JournalFile *f) { return 0; } +static int journal_file_fstat(JournalFile *f) { + assert(f); + assert(f->fd >= 0); + + if (fstat(f->fd, &f->last_stat) < 0) + return -errno; + + f->last_stat_usec = now(CLOCK_MONOTONIC); + + /* Refuse appending to files that are already deleted */ + if (f->last_stat.st_nlink <= 0) + return -EIDRM; + + return 0; +} + static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { uint64_t old_size, new_size; int r; @@ -322,6 +362,9 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) * for sure, since we always call posix_fallocate() * ourselves */ + if (mmap_cache_got_sigbus(f->mmap, f->fd)) + return -EIO; + old_size = le64toh(f->header->header_size) + le64toh(f->header->arena_size); @@ -330,8 +373,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) if (new_size < le64toh(f->header->header_size)) new_size = le64toh(f->header->header_size); - if (new_size <= old_size) - return 0; + if (new_size <= old_size) { + + /* We already pre-allocated enough space, but before + * we write to it, let's check with fstat() if the + * file got deleted, in order make sure we don't throw + * away the data immediately. Don't check fstat() for + * all writes though, but only once ever 10s. */ + + if (f->last_stat_usec + LAST_STAT_REFRESH_USEC > now(CLOCK_MONOTONIC)) + return 0; + + return journal_file_fstat(f); + } + + /* Allocate more space. */ if (f->metrics.max_size > 0 && new_size > f->metrics.max_size) return -E2BIG; @@ -366,15 +422,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) if (r != 0) return -r; - if (fstat(f->fd, &f->last_stat) < 0) - return -errno; - f->header->arena_size = htole64(new_size - le64toh(f->header->header_size)); - return 0; + return journal_file_fstat(f); } -static int journal_file_move_to(JournalFile *f, int context, bool keep_always, uint64_t offset, uint64_t size, void **ret) { +static unsigned type_to_context(ObjectType type) { + /* One context for each type, plus one catch-all for the rest */ + assert_cc(_OBJECT_TYPE_MAX <= MMAP_CACHE_MAX_CONTEXTS); + assert_cc(CONTEXT_HEADER < MMAP_CACHE_MAX_CONTEXTS); + return type > OBJECT_UNUSED && type < _OBJECT_TYPE_MAX ? type : 0; +} + +static int journal_file_move_to(JournalFile *f, ObjectType type, bool keep_always, uint64_t offset, uint64_t size, void **ret) { + int r; + assert(f); assert(ret); @@ -386,12 +448,15 @@ static int journal_file_move_to(JournalFile *f, int context, bool keep_always, u /* Hmm, out of range? Let's refresh the fstat() data * first, before we trust that check. */ - if (fstat(f->fd, &f->last_stat) < 0 || - offset + size > (uint64_t) f->last_stat.st_size) + r = journal_file_fstat(f); + if (r < 0) + return r; + + if (offset + size > (uint64_t) f->last_stat.st_size) return -EADDRNOTAVAIL; } - return mmap_cache_get(f->mmap, f->fd, f->prot, context, keep_always, offset, size, &f->last_stat, ret, NULL); + return mmap_cache_get(f->mmap, f->fd, f->prot, type_to_context(type), keep_always, offset, size, &f->last_stat, ret); } static uint64_t minimum_header_size(Object *o) { @@ -412,7 +477,7 @@ static uint64_t minimum_header_size(Object *o) { return table[o->object.type]; } -int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret) { +int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret) { int r; void *t; Object *o; @@ -425,7 +490,7 @@ int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Objec if (!VALID64(offset)) return -EFAULT; - r = journal_file_move_to(f, type_to_context(type), false, offset, sizeof(ObjectHeader), &t); + r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t); if (r < 0) return r; @@ -441,11 +506,11 @@ int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Objec if (s < minimum_header_size(o)) return -EBADMSG; - if (type > 0 && o->object.type != type) + if (type > OBJECT_UNUSED && o->object.type != type) return -EBADMSG; if (s > sizeof(ObjectHeader)) { - r = journal_file_move_to(f, o->object.type, false, offset, s, &t); + r = journal_file_move_to(f, type, false, offset, s, &t); if (r < 0) return r; @@ -482,14 +547,14 @@ static uint64_t journal_file_entry_seqnum(JournalFile *f, uint64_t *seqnum) { return r; } -int journal_file_append_object(JournalFile *f, int type, uint64_t size, Object **ret, uint64_t *offset) { +int journal_file_append_object(JournalFile *f, ObjectType type, uint64_t size, Object **ret, uint64_t *offset) { int r; uint64_t p; Object *tail, *o; void *t; assert(f); - assert(type > 0 && type < _OBJECT_TYPE_MAX); + assert(type > OBJECT_UNUSED && type < _OBJECT_TYPE_MAX); assert(size >= sizeof(ObjectHeader)); assert(offset); assert(ret); @@ -502,7 +567,7 @@ int journal_file_append_object(JournalFile *f, int type, uint64_t size, Object * if (p == 0) p = le64toh(f->header->header_size); else { - r = journal_file_move_to_object(f, -1, p, &tail); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &tail); if (r < 0) return r; @@ -641,7 +706,7 @@ static int journal_file_link_field( uint64_t offset, uint64_t hash) { - uint64_t p, h; + uint64_t p, h, m; int r; assert(f); @@ -651,11 +716,14 @@ static int journal_file_link_field( if (o->object.type != OBJECT_FIELD) return -EINVAL; - /* This might alter the window we are looking at */ + m = le64toh(f->header->field_hash_table_size) / sizeof(HashItem); + if (m <= 0) + return -EBADMSG; + /* This might alter the window we are looking at */ o->field.next_hash_offset = o->field.head_data_offset = 0; - h = hash % (le64toh(f->header->field_hash_table_size) / sizeof(HashItem)); + h = hash % m; p = le64toh(f->field_hash_table[h].tail_hash_offset); if (p == 0) f->field_hash_table[h].head_hash_offset = htole64(offset); @@ -681,7 +749,7 @@ static int journal_file_link_data( uint64_t offset, uint64_t hash) { - uint64_t p, h; + uint64_t p, h, m; int r; assert(f); @@ -691,13 +759,16 @@ static int journal_file_link_data( if (o->object.type != OBJECT_DATA) return -EINVAL; - /* This might alter the window we are looking at */ + m = le64toh(f->header->data_hash_table_size) / sizeof(HashItem); + if (m <= 0) + return -EBADMSG; + /* This might alter the window we are looking at */ o->data.next_hash_offset = o->data.next_field_offset = 0; o->data.entry_offset = o->data.entry_array_offset = 0; o->data.n_entries = 0; - h = hash % (le64toh(f->header->data_hash_table_size) / sizeof(HashItem)); + h = hash % m; p = le64toh(f->data_hash_table[h].tail_hash_offset); if (p == 0) /* Only entry in the hash table is easy */ @@ -726,7 +797,7 @@ int journal_file_find_field_object_with_hash( const void *field, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset) { - uint64_t p, osize, h; + uint64_t p, osize, h, m; int r; assert(f); @@ -734,10 +805,12 @@ int journal_file_find_field_object_with_hash( osize = offsetof(Object, field.payload) + size; - if (f->header->field_hash_table_size == 0) + m = le64toh(f->header->field_hash_table_size) / sizeof(HashItem); + + if (m <= 0) return -EBADMSG; - h = hash % (le64toh(f->header->field_hash_table_size) / sizeof(HashItem)); + h = hash % m; p = le64toh(f->field_hash_table[h].head_hash_offset); while (p > 0) { @@ -787,7 +860,7 @@ int journal_file_find_data_object_with_hash( const void *data, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset) { - uint64_t p, osize, h; + uint64_t p, osize, h, m; int r; assert(f); @@ -795,10 +868,11 @@ int journal_file_find_data_object_with_hash( osize = offsetof(Object, data.payload) + size; - if (f->header->data_hash_table_size == 0) + m = le64toh(f->header->data_hash_table_size) / sizeof(HashItem); + if (m <= 0) return -EBADMSG; - h = hash % (le64toh(f->header->data_hash_table_size) / sizeof(HashItem)); + h = hash % m; p = le64toh(f->data_hash_table[h].head_hash_offset); while (p > 0) { @@ -1352,6 +1426,14 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st r = journal_file_append_entry_internal(f, ts, xor_hash, items, n_iovec, seqnum, ret, offset); + /* If the memory mapping triggered a SIGBUS then we return an + * IO error and ignore the error code passed down to us, since + * it is very likely just an effect of a nullified replacement + * mapping page */ + + if (mmap_cache_got_sigbus(f->mmap, f->fd)) + r = -EIO; + journal_file_post_change(f); return r; @@ -1707,7 +1789,6 @@ found: return 1; } - static int generic_array_bisect_plus_one( JournalFile *f, uint64_t extra, @@ -1793,23 +1874,6 @@ _pure_ static int test_object_offset(JournalFile *f, uint64_t p, uint64_t needle return TEST_RIGHT; } -int journal_file_move_to_entry_by_offset( - JournalFile *f, - uint64_t p, - direction_t direction, - Object **ret, - uint64_t *offset) { - - return generic_array_bisect(f, - le64toh(f->header->entry_array_offset), - le64toh(f->header->n_entries), - p, - test_object_offset, - direction, - ret, offset, NULL); -} - - static int test_object_seqnum(JournalFile *f, uint64_t p, uint64_t needle) { Object *o; int r; @@ -1899,11 +1963,12 @@ static int test_object_monotonic(JournalFile *f, uint64_t p, uint64_t needle) { return TEST_RIGHT; } -static inline int find_data_object_by_boot_id( +static int find_data_object_by_boot_id( JournalFile *f, sd_id128_t boot_id, Object **o, uint64_t *b) { + char t[sizeof("_BOOT_ID=")-1 + 32 + 1] = "_BOOT_ID="; sd_id128_to_string(boot_id, t + 9); @@ -1939,9 +2004,82 @@ int journal_file_move_to_entry_by_monotonic( ret, offset, NULL); } +void journal_file_reset_location(JournalFile *f) { + f->location_type = LOCATION_HEAD; + f->current_offset = 0; + f->current_seqnum = 0; + f->current_realtime = 0; + f->current_monotonic = 0; + zero(f->current_boot_id); + f->current_xor_hash = 0; +} + +void journal_file_save_location(JournalFile *f, direction_t direction, Object *o, uint64_t offset) { + f->last_direction = direction; + f->location_type = LOCATION_SEEK; + f->current_offset = offset; + f->current_seqnum = le64toh(o->entry.seqnum); + f->current_realtime = le64toh(o->entry.realtime); + f->current_monotonic = le64toh(o->entry.monotonic); + f->current_boot_id = o->entry.boot_id; + f->current_xor_hash = le64toh(o->entry.xor_hash); +} + +int journal_file_compare_locations(JournalFile *af, JournalFile *bf) { + assert(af); + assert(bf); + assert(af->location_type == LOCATION_SEEK); + assert(bf->location_type == LOCATION_SEEK); + + /* If contents and timestamps match, these entries are + * identical, even if the seqnum does not match */ + if (sd_id128_equal(af->current_boot_id, bf->current_boot_id) && + af->current_monotonic == bf->current_monotonic && + af->current_realtime == bf->current_realtime && + af->current_xor_hash == bf->current_xor_hash) + return 0; + + if (sd_id128_equal(af->header->seqnum_id, bf->header->seqnum_id)) { + + /* If this is from the same seqnum source, compare + * seqnums */ + if (af->current_seqnum < bf->current_seqnum) + return -1; + if (af->current_seqnum > bf->current_seqnum) + return 1; + + /* Wow! This is weird, different data but the same + * seqnums? Something is borked, but let's make the + * best of it and compare by time. */ + } + + if (sd_id128_equal(af->current_boot_id, bf->current_boot_id)) { + + /* If the boot id matches, compare monotonic time */ + if (af->current_monotonic < bf->current_monotonic) + return -1; + if (af->current_monotonic > bf->current_monotonic) + return 1; + } + + /* Otherwise, compare UTC time */ + if (af->current_realtime < bf->current_realtime) + return -1; + if (af->current_realtime > bf->current_realtime) + return 1; + + /* Finally, compare by contents */ + if (af->current_xor_hash < bf->current_xor_hash) + return -1; + if (af->current_xor_hash > bf->current_xor_hash) + return 1; + + return 0; +} + int journal_file_next_entry( JournalFile *f, - Object *o, uint64_t p, + uint64_t p, direction_t direction, Object **ret, uint64_t *offset) { @@ -1949,18 +2087,14 @@ int journal_file_next_entry( int r; assert(f); - assert(p > 0 || !o); n = le64toh(f->header->n_entries); if (n <= 0) return 0; - if (!o) + if (p == 0) i = direction == DIRECTION_DOWN ? 0 : n - 1; else { - if (o->object.type != OBJECT_ENTRY) - return -EINVAL; - r = generic_array_bisect(f, le64toh(f->header->entry_array_offset), le64toh(f->header->n_entries), @@ -2006,55 +2140,6 @@ int journal_file_next_entry( return 1; } -int journal_file_skip_entry( - JournalFile *f, - Object *o, uint64_t p, - int64_t skip, - Object **ret, uint64_t *offset) { - - uint64_t i, n; - int r; - - assert(f); - assert(o); - assert(p > 0); - - if (o->object.type != OBJECT_ENTRY) - return -EINVAL; - - r = generic_array_bisect(f, - le64toh(f->header->entry_array_offset), - le64toh(f->header->n_entries), - p, - test_object_offset, - DIRECTION_DOWN, - NULL, NULL, - &i); - if (r <= 0) - return r; - - /* Calculate new index */ - if (skip < 0) { - if ((uint64_t) -skip >= i) - i = 0; - else - i = i - (uint64_t) -skip; - } else - i += (uint64_t) skip; - - n = le64toh(f->header->n_entries); - if (n <= 0) - return -EBADMSG; - - if (i >= n) - i = n-1; - - return generic_array_get(f, - le64toh(f->header->entry_array_offset), - i, - ret, offset); -} - int journal_file_next_entry_for_data( JournalFile *f, Object *o, uint64_t p, @@ -2289,7 +2374,7 @@ void journal_file_dump(JournalFile *f) { p = le64toh(f->header->header_size); while (p != 0) { - r = journal_file_move_to_object(f, -1, p, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o); if (r < 0) goto fail; @@ -2333,7 +2418,7 @@ void journal_file_dump(JournalFile *f) { break; default: - printf("Type: unknown (%u)\n", o->object.type); + printf("Type: unknown (%i)\n", o->object.type); break; } @@ -2449,9 +2534,10 @@ int journal_file_open( JournalFile *template, JournalFile **ret) { + bool newly_created = false; JournalFile *f; + void *h; int r; - bool newly_created = false; assert(fname); assert(ret); @@ -2511,13 +2597,22 @@ int journal_file_open( goto fail; } - if (fstat(f->fd, &f->last_stat) < 0) { - r = -errno; + r = journal_file_fstat(f); + if (r < 0) goto fail; - } if (f->last_stat.st_size == 0 && f->writable) { - uint64_t crtime; + + /* Before we write anything, turn off COW logic. Given + * our write pattern that is quite unfriendly to COW + * file systems this should greatly improve + * performance on COW file systems, such as btrfs, at + * the expense of data integrity features (which + * shouldn't be too bad, given that we do our own + * checksumming). */ + r = chattr_fd(f->fd, true, FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes: %m"); /* Let's attach the creation time to the journal file, * so that the vacuuming code knows the age of this @@ -2527,10 +2622,9 @@ int journal_file_open( * currently no usable API to query this, hence let's * emulate this via extended attributes. If extended * attributes are not supported we'll just skip this, - * and rely solely on mtime/atime/ctime of the file.*/ + * and rely solely on mtime/atime/ctime of the file. */ - crtime = htole64((uint64_t) now(CLOCK_REALTIME)); - fsetxattr(f->fd, "user.crtime_usec", &crtime, sizeof(crtime), XATTR_CREATE); + fd_setcrtime(f->fd, 0); #ifdef HAVE_GCRYPT /* Try to load the FSPRG state, and if we can't, then @@ -2546,10 +2640,9 @@ int journal_file_open( if (r < 0) goto fail; - if (fstat(f->fd, &f->last_stat) < 0) { - r = -errno; + r = journal_file_fstat(f); + if (r < 0) goto fail; - } newly_created = true; } @@ -2559,13 +2652,14 @@ int journal_file_open( goto fail; } - f->header = mmap(NULL, PAGE_ALIGN(sizeof(Header)), prot_from_flags(flags), MAP_SHARED, f->fd, 0); - if (f->header == MAP_FAILED) { - f->header = NULL; + r = mmap_cache_get(f->mmap, f->fd, f->prot, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h); + if (r < 0) { r = -errno; goto fail; } + f->header = h; + if (!newly_created) { r = journal_file_verify_header(f); if (r < 0) @@ -2622,10 +2716,18 @@ int journal_file_open( if (r < 0) goto fail; + if (mmap_cache_got_sigbus(f->mmap, f->fd)) { + r = -EIO; + goto fail; + } + *ret = f; return 0; fail: + if (f->fd >= 0 && mmap_cache_got_sigbus(f->mmap, f->fd)) + r = -EIO; + journal_file_close(f); return r; @@ -2657,12 +2759,20 @@ int journal_file_rotate(JournalFile **f, bool compress, bool seal) { if (r < 0) return -ENOMEM; + /* Try to rename the file to the archived version. If the file + * already was deleted, we'll get ENOENT, let's ignore that + * case. */ r = rename(old_file->path, p); - if (r < 0) + if (r < 0 && errno != ENOENT) return -errno; old_file->header->state = STATE_ARCHIVED; + /* Currently, btrfs is not very good with out write patterns + * and fragments heavily. Let's defrag our journal files when + * we archive them */ + old_file->defrag_on_close = true; + r = journal_file_open(old_file->path, old_file->flags, old_file->mode, compress, seal, NULL, old_file->mmap, old_file, &new_file); journal_file_close(old_file); @@ -2692,7 +2802,9 @@ int journal_file_open_reliably( r != -EHOSTDOWN && /* other machine */ r != -EPROTONOSUPPORT && /* incompatible feature */ r != -EBUSY && /* unclean shutdown */ - r != -ESHUTDOWN /* already archived */) + r != -ESHUTDOWN && /* already archived */ + r != -EIO && /* IO error, including SIGBUS on mmap */ + r != -EIDRM /* File has been deleted */) return r; if ((flags & O_ACCMODE) == O_RDONLY) @@ -2717,6 +2829,12 @@ int journal_file_open_reliably( if (r < 0) return -errno; + /* btrfs doesn't cope well with our write pattern and + * fragments heavily. Let's defrag all files we rotate */ + + (void) chattr_path(p, false, FS_NOCOW_FL); + (void) btrfs_defrag(p); + log_warning("File %s corrupted or uncleanly shut down, renaming and replacing.", fname); return journal_file_open(fname, flags, mode, compress, seal, @@ -2799,7 +2917,12 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6 return r; } - return journal_file_append_entry_internal(to, &ts, xor_hash, items, n, seqnum, ret, offset); + r = journal_file_append_entry_internal(to, &ts, xor_hash, items, n, seqnum, ret, offset); + + if (mmap_cache_got_sigbus(to->mmap, to->fd)) + return -EIO; + + return r; } void journal_default_metrics(JournalMetrics *m, int fd) { diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index 211e121d5..2526e14d6 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -27,11 +27,11 @@ #include #endif -#include "systemd/sd-id128.h" +#include "sd-id128.h" #include "sparse-endian.h" #include "journal-def.h" -#include "util.h" +#include "macro.h" #include "mmap-cache.h" #include "hashmap.h" @@ -48,6 +48,20 @@ typedef enum direction { DIRECTION_DOWN } direction_t; +typedef enum LocationType { + /* The first and last entries, resp. */ + LOCATION_HEAD, + LOCATION_TAIL, + + /* We already read the entry we currently point to, and the + * next one to read should probably not be this one again. */ + LOCATION_DISCRETE, + + /* We should seek to the precise location specified, and + * return it, as we haven't read it yet. */ + LOCATION_SEEK +} LocationType; + typedef struct JournalFile { int fd; @@ -59,19 +73,28 @@ typedef struct JournalFile { bool compress_xz:1; bool compress_lz4:1; bool seal:1; + bool defrag_on_close:1; bool tail_entry_monotonic_valid:1; direction_t last_direction; + LocationType location_type; + uint64_t last_n_entries; char *path; struct stat last_stat; + usec_t last_stat_usec; Header *header; HashItem *data_hash_table; HashItem *field_hash_table; uint64_t current_offset; + uint64_t current_seqnum; + uint64_t current_realtime; + uint64_t current_monotonic; + sd_id128_t current_boot_id; + uint64_t current_xor_hash; JournalMetrics metrics; MMapCache *mmap; @@ -160,13 +183,13 @@ static inline bool VALID_EPOCH(uint64_t u) { #define JOURNAL_HEADER_COMPRESSED_LZ4(h) \ (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED_LZ4)) -int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret); +int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret); uint64_t journal_file_entry_n_items(Object *o) _pure_; uint64_t journal_file_entry_array_n_items(Object *o) _pure_; uint64_t journal_file_hash_table_n_items(Object *o) _pure_; -int journal_file_append_object(JournalFile *f, int type, uint64_t size, Object **ret, uint64_t *offset); +int journal_file_append_object(JournalFile *f, ObjectType type, uint64_t size, Object **ret, uint64_t *offset); int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const struct iovec iovec[], unsigned n_iovec, uint64_t *seqno, Object **ret, uint64_t *offset); int journal_file_find_data_object(JournalFile *f, const void *data, uint64_t size, Object **ret, uint64_t *offset); @@ -175,12 +198,13 @@ int journal_file_find_data_object_with_hash(JournalFile *f, const void *data, ui int journal_file_find_field_object(JournalFile *f, const void *field, uint64_t size, Object **ret, uint64_t *offset); int journal_file_find_field_object_with_hash(JournalFile *f, const void *field, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset); -int journal_file_next_entry(JournalFile *f, Object *o, uint64_t p, direction_t direction, Object **ret, uint64_t *offset); -int journal_file_skip_entry(JournalFile *f, Object *o, uint64_t p, int64_t skip, Object **ret, uint64_t *offset); +void journal_file_reset_location(JournalFile *f); +void journal_file_save_location(JournalFile *f, direction_t direction, Object *o, uint64_t offset); +int journal_file_compare_locations(JournalFile *af, JournalFile *bf); +int journal_file_next_entry(JournalFile *f, uint64_t p, direction_t direction, Object **ret, uint64_t *offset); int journal_file_next_entry_for_data(JournalFile *f, Object *o, uint64_t p, uint64_t data_offset, direction_t direction, Object **ret, uint64_t *offset); -int journal_file_move_to_entry_by_offset(JournalFile *f, uint64_t seqnum, direction_t direction, Object **ret, uint64_t *offset); int journal_file_move_to_entry_by_seqnum(JournalFile *f, uint64_t seqnum, direction_t direction, Object **ret, uint64_t *offset); int journal_file_move_to_entry_by_realtime(JournalFile *f, uint64_t realtime, direction_t direction, Object **ret, uint64_t *offset); int journal_file_move_to_entry_by_monotonic(JournalFile *f, sd_id128_t boot_id, uint64_t monotonic, direction_t direction, Object **ret, uint64_t *offset); @@ -205,21 +229,3 @@ int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, usec_t * int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to); bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec); - - -static unsigned type_to_context(int type) { - /* One context for each type, plus one catch-all for the rest */ - return type > 0 && type < _OBJECT_TYPE_MAX ? type : 0; -} - -static inline int journal_file_object_keep(JournalFile *f, Object *o, uint64_t offset, void **release_cookie) { - unsigned context = type_to_context(o->object.type); - uint64_t s = le64toh(o->object.size); - - return mmap_cache_get(f->mmap, f->fd, f->prot, context, true, - offset, s, &f->last_stat, NULL, release_cookie); -} - -static inline int journal_file_object_release(JournalFile *f, void *release_cookie) { - return mmap_cache_release(f->mmap, f->fd, release_cookie); -} diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h index 70847db0b..b51ecdb60 100644 --- a/src/journal/journal-internal.h +++ b/src/journal/journal-internal.h @@ -32,6 +32,7 @@ #include "hashmap.h" #include "set.h" #include "journal-file.h" +#include "sd-journal.h" typedef struct Match Match; typedef struct Location Location; @@ -57,20 +58,6 @@ struct Match { LIST_HEAD(Match, matches); }; -typedef enum LocationType { - /* The first and last entries, resp. */ - LOCATION_HEAD, - LOCATION_TAIL, - - /* We already read the entry we currently point to, and the - * next one to read should probably not be this one again. */ - LOCATION_DISCRETE, - - /* We should seek to the precise location specified, and - * return it, as we haven't read it yet. */ - LOCATION_SEEK -} LocationType; - struct Location { LocationType type; diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index 56a96c55d..1e3a46350 100644 --- a/src/journal/journal-send.c +++ b/src/journal/journal-send.c @@ -90,18 +90,17 @@ _public_ int sd_journal_printv(int priority, const char *format, va_list ap) { /* FIXME: Instead of limiting things to LINE_MAX we could do a C99 variable-length array on the stack here in a loop. */ - char buffer[8 + LINE_MAX], p[11]; struct iovec iov[2]; + char buffer[8 + LINE_MAX], p[sizeof("PRIORITY=")-1 + DECIMAL_STR_MAX(int) + 1]; + struct iovec iov[2]; assert_return(priority >= 0, -EINVAL); assert_return(priority <= 7, -EINVAL); assert_return(format, -EINVAL); - snprintf(p, sizeof(p), "PRIORITY=%i", priority & LOG_PRIMASK); - char_array_0(p); + xsprintf(p, "PRIORITY=%i", priority & LOG_PRIMASK); memcpy(buffer, "MESSAGE=", 8); vsnprintf(buffer+8, sizeof(buffer) - 8, format, ap); - char_array_0(buffer); zero(iov); IOVEC_SET_STRING(iov[0], buffer); @@ -372,7 +371,7 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove errno = 0; j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k); if (errno == 0) { - char error[6 + 10 + 1]; /* for a 32bit value */ + char error[sizeof("ERRNO=")-1 + DECIMAL_STR_MAX(int) + 1]; if (j != buffer + 8 + k) memmove(buffer + 8 + k, j, strlen(j)+1); @@ -384,8 +383,7 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove memcpy(buffer + 8 + k - 2, ": ", 2); } - snprintf(error, sizeof(error), "ERRNO=%u", _saved_errno_); - char_array_0(error); + xsprintf(error, "ERRNO=%i", _saved_errno_); IOVEC_SET_STRING(iov[skip+0], "PRIORITY=3"); IOVEC_SET_STRING(iov[skip+1], buffer); @@ -474,7 +472,7 @@ _public_ int sd_journal_print_with_location(int priority, const char *file, cons } _public_ int sd_journal_printv_with_location(int priority, const char *file, const char *line, const char *func, const char *format, va_list ap) { - char buffer[8 + LINE_MAX], p[11]; + char buffer[8 + LINE_MAX], p[sizeof("PRIORITY=")-1 + DECIMAL_STR_MAX(int) + 1]; struct iovec iov[5]; char *f; @@ -482,12 +480,10 @@ _public_ int sd_journal_printv_with_location(int priority, const char *file, con assert_return(priority <= 7, -EINVAL); assert_return(format, -EINVAL); - snprintf(p, sizeof(p), "PRIORITY=%i", priority & LOG_PRIMASK); - char_array_0(p); + xsprintf(p, "PRIORITY=%i", priority & LOG_PRIMASK); memcpy(buffer, "MESSAGE=", 8); vsnprintf(buffer+8, sizeof(buffer) - 8, format, ap); - char_array_0(buffer); /* func is initialized from __func__ which is not a macro, but * a static const char[], hence cannot easily be prefixed with diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c index 497340984..832c327b3 100644 --- a/src/journal/journal-vacuum.c +++ b/src/journal/journal-vacuum.c @@ -75,9 +75,8 @@ static void patch_realtime( const struct stat *st, unsigned long long *realtime) { - usec_t x; - uint64_t crtime; _cleanup_free_ const char *path = NULL; + usec_t x, crtime; /* The timestamp was determined by the file name, but let's * see if the file might actually be older than the file name @@ -112,10 +111,8 @@ static void patch_realtime( if (!path) return; - if (getxattr(path, "user.crtime_usec", &crtime, sizeof(crtime)) == sizeof(crtime)) { - crtime = le64toh(crtime); - - if (crtime > 0 && crtime != (uint64_t) -1 && crtime < *realtime) + if (path_getcrtime(path, &crtime) >= 0) { + if (crtime < *realtime) *realtime = crtime; } } diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c index 7e3c974b3..b03335ef3 100644 --- a/src/journal/journal-verify.c +++ b/src/journal/journal-verify.c @@ -368,7 +368,7 @@ static int contains_uint64(MMapCache *m, int fd, uint64_t n, uint64_t p) { c = (a + b) / 2; - r = mmap_cache_get(m, fd, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z, NULL); + r = mmap_cache_get(m, fd, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z); if (r < 0) return r; @@ -427,7 +427,7 @@ static int entry_points_to_data( /* Check if this entry is also in main entry array. Since the * main entry array has already been verified we can rely on - * its consistency.*/ + * its consistency. */ i = 0; n = le64toh(f->header->n_entries); @@ -865,7 +865,7 @@ int journal_file_verify( if (show_progress) draw_progress(0x7FFF * p / le64toh(f->header->tail_object_offset), &last_usec); - r = journal_file_move_to_object(f, -1, p, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o); if (r < 0) { error(p, "invalid object"); goto fail; @@ -1085,11 +1085,11 @@ int journal_file_verify( q = last_tag; while (q <= p) { - r = journal_file_move_to_object(f, -1, q, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, q, &o); if (r < 0) goto fail; - r = journal_file_hmac_put_object(f, -1, o, q); + r = journal_file_hmac_put_object(f, OBJECT_UNUSED, o, q); if (r < 0) goto fail; @@ -1097,7 +1097,7 @@ int journal_file_verify( } /* Position might have changed, let's reposition things */ - r = journal_file_move_to_object(f, -1, p, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o); if (r < 0) goto fail; diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b2f6966fc..55c778633 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -37,23 +37,20 @@ #include #include -#ifdef HAVE_ACL -#include -#include "acl-util.h" -#endif - #include "sd-journal.h" #include "sd-bus.h" #include "log.h" #include "logs-show.h" #include "util.h" +#include "acl-util.h" #include "path-util.h" #include "fileio.h" #include "build.h" #include "pager.h" #include "strv.h" #include "set.h" +#include "sigbus.h" #include "journal-internal.h" #include "journal-def.h" #include "journal-verify.h" @@ -197,19 +194,19 @@ static void help(void) { " --system Show the system journal\n" " --user Show the user journal for the current user\n" " -M --machine=CONTAINER Operate on local container\n" - " --since=DATE Start showing entries on or newer than the specified date\n" - " --until=DATE Stop showing entries on or newer than the specified date\n" - " -c --cursor=CURSOR Start showing entries from the specified cursor\n" - " --after-cursor=CURSOR Start showing entries from after the specified cursor\n" + " --since=DATE Show entries not older than the specified date\n" + " --until=DATE Show entries not newer than the specified date\n" + " -c --cursor=CURSOR Show entries starting at the specified cursor\n" + " --after-cursor=CURSOR Show entries after the specified cursor\n" " --show-cursor Print the cursor after all the entries\n" - " -b --boot[=ID] Show data only from ID or, if unspecified, the current boot\n" + " -b --boot[=ID] Show current boot or the specified boot\n" " --list-boots Show terse information about recorded boots\n" " -k --dmesg Show kernel message log from the current boot\n" - " -u --unit=UNIT Show data only from the specified unit\n" - " --user-unit=UNIT Show data only from the specified user session unit\n" - " -t --identifier=STRING Show only messages with the specified syslog identifier\n" - " -p --priority=RANGE Show only messages within the specified priority range\n" - " -e --pager-end Immediately jump to end of the journal in the pager\n" + " -u --unit=UNIT Show logs from the specified unit\n" + " --user-unit=UNIT Show logs from the specified user unit\n" + " -t --identifier=STRING Show entries with the specified syslog identifier\n" + " -p --priority=RANGE Show entries with the specified priority\n" + " -e --pager-end Immediately jump to the end in the pager\n" " -f --follow Follow the journal\n" " -n --lines[=INTEGER] Number of journal entries to show\n" " --no-tail Show all lines, even in follow mode\n" @@ -230,7 +227,7 @@ static void help(void) { #ifdef HAVE_GCRYPT " --interval=TIME Time interval for changing the FSS sealing key\n" " --verify-key=KEY Specify FSS verification key\n" - " --force Force overriding of the FSS key pair with --setup-keys\n" + " --force Override of the FSS key pair with --setup-keys\n" #endif "\nCommands:\n" " -h --help Show this help text\n" @@ -238,11 +235,11 @@ static void help(void) { " -F --field=FIELD List all values that a specified field takes\n" " --new-id128 Generate a new 128-bit ID\n" " --disk-usage Show total disk usage of all journal files\n" - " --vacuum-size=BYTES Remove old journals until disk space drops below size\n" - " --vacuum-time=TIME Remove old journals until none left older than\n" + " --vacuum-size=BYTES Reduce disk usage below specified size\n" + " --vacuum-time=TIME Remove journal files older than specified date\n" " --flush Flush all journal data from /run into /var\n" " --header Show journal header information\n" - " --list-catalog Show message IDs of all entries in the message catalog\n" + " --list-catalog Show all message IDs in the catalog\n" " --dump-catalog Show entries in the message catalog\n" " --update-catalog Update the message catalog database\n" #ifdef HAVE_GCRYPT @@ -1272,7 +1269,7 @@ static int add_syslog_identifier(sd_journal *j) { STRV_FOREACH(i, arg_syslog_identifier) { char *u; - u = strappenda("SYSLOG_IDENTIFIER=", *i); + u = strjoina("SYSLOG_IDENTIFIER=", *i); r = sd_journal_add_match(j, u, 0); if (r < 0) return r; @@ -1293,7 +1290,7 @@ static int setup_keys(void) { size_t mpk_size, seed_size, state_size, i; uint8_t *mpk, *seed, *state; ssize_t l; - int fd = -1, r, attr = 0; + int fd = -1, r; sd_id128_t machine, boot; char *p = NULL, *k = NULL; struct FSSHeader h; @@ -1388,13 +1385,9 @@ static int setup_keys(void) { /* Enable secure remove, exclusion from dump, synchronous * writing and in-place updating */ - if (ioctl(fd, FS_IOC_GETFLAGS, &attr) < 0) - log_warning_errno(errno, "FS_IOC_GETFLAGS failed: %m"); - - attr |= FS_SECRM_FL|FS_NODUMP_FL|FS_SYNC_FL|FS_NOCOW_FL; - - if (ioctl(fd, FS_IOC_SETFLAGS, &attr) < 0) - log_warning_errno(errno, "FS_IOC_SETFLAGS failed: %m"); + r = chattr_fd(fd, true, FS_SECRM_FL|FS_NODUMP_FL|FS_SYNC_FL|FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes: %m"); zero(h); memcpy(h.signature, "KSHHRHLP", 8); @@ -1691,7 +1684,7 @@ static int flush_to_var(void) { break; if (errno != ENOENT) - return log_error_errno(errno, "Failed to check for existance of /run/systemd/journal/flushed: %m"); + return log_error_errno(errno, "Failed to check for existence of /run/systemd/journal/flushed: %m"); r = fd_wait_for_event(watch_fd, POLLIN, USEC_INFINITY); if (r < 0) @@ -1723,6 +1716,12 @@ int main(int argc, char *argv[]) { goto finish; signal(SIGWINCH, columns_lines_cache_reset); + sigbus_install(); + + /* Increase max number of open files to 16K if we can, we + * might needs this when browsing journal files, which might + * be split up into many files. */ + setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384)); if (arg_action == ACTION_NEW_ID128) { r = generate_new_id128(); @@ -1873,7 +1872,7 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) { + if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) { _cleanup_free_ char *filter; filter = journal_make_match_string(j); diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c index 69742fa59..c2f1545cc 100644 --- a/src/journal/journald-audit.c +++ b/src/journal/journald-audit.c @@ -206,7 +206,7 @@ static int map_generic_field(const char *prefix, const char **p, struct iovec ** return r; } -/* Kernel fields are those occuring in the audit string before +/* Kernel fields are those occurring in the audit string before * msg='. All of these fields are trusted, hence carry the "_" prefix. * We try to translate the fields we know into our native names. The * other's are generically mapped to _AUDIT_FIELD_XYZ= */ @@ -240,7 +240,7 @@ static const MapField map_fields_kernel[] = { {} }; -/* Userspace fields are thos occuring in the audit string after +/* Userspace fields are those occurring in the audit string after * msg='. All of these fields are untrusted, hence carry no "_" * prefix. We map the fields we don't know to AUDIT_FIELD_XYZ= */ static const MapField map_fields_userspace[] = { @@ -360,7 +360,7 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s if (!p) return; - if (sscanf(p, "(%" PRIi64 ".%" PRIi64 ":%" PRIi64 "):%n", + if (sscanf(p, "(%" PRIu64 ".%" PRIu64 ":%" PRIu64 "):%n", &seconds, &msec, &id, @@ -538,7 +538,7 @@ int server_open_audit(Server *s) { if (r < 0) return log_error_errno(errno, "Failed to set SO_PASSCRED on audit socket: %m"); - r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN, process_datagram, s); + r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN, server_process_datagram, s); if (r < 0) return log_error_errno(r, "Failed to add audit fd to event loop: %m"); diff --git a/src/journal/journald-console.c b/src/journal/journald-console.c index 4afa6ef9c..5363aaa4f 100644 --- a/src/journal/journald-console.c +++ b/src/journal/journald-console.c @@ -51,9 +51,9 @@ void server_forward_console( const struct ucred *ucred) { struct iovec iovec[5]; - char header_pid[16]; struct timespec ts; - char tbuf[4 + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; + char tbuf[sizeof("[] ")-1 + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; + char header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t)]; int n = 0, fd; _cleanup_free_ char *ident_buf = NULL; const char *tty; @@ -67,7 +67,7 @@ void server_forward_console( /* First: timestamp */ if (prefix_timestamp()) { assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); - snprintf(tbuf, sizeof(tbuf), "[%5"PRI_TIME".%06ld] ", + xsprintf(tbuf, "[%5"PRI_TIME".%06ld] ", ts.tv_sec, ts.tv_nsec / 1000); IOVEC_SET_STRING(iovec[n++], tbuf); @@ -80,8 +80,7 @@ void server_forward_console( identifier = ident_buf; } - snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", ucred->pid); - char_array_0(header_pid); + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); if (identifier) IOVEC_SET_STRING(iovec[n++], identifier); diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c index aca4571ec..c4216c404 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c @@ -40,7 +40,8 @@ void server_forward_kmsg( const struct ucred *ucred) { struct iovec iovec[5]; - char header_priority[6], header_pid[16]; + char header_priority[DECIMAL_STR_MAX(priority) + 3], + header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; int n = 0; char *ident_buf = NULL; @@ -60,8 +61,7 @@ void server_forward_kmsg( priority = syslog_fixup_facility(priority); /* First: priority field */ - snprintf(header_priority, sizeof(header_priority), "<%i>", priority); - char_array_0(header_priority); + xsprintf(header_priority, "<%i>", priority); IOVEC_SET_STRING(iovec[n++], header_priority); /* Second: identifier and PID */ @@ -71,8 +71,7 @@ void server_forward_kmsg( identifier = ident_buf; } - snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", ucred->pid); - char_array_0(header_pid); + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); if (identifier) IOVEC_SET_STRING(iovec[n++], identifier); diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index f98269625..851625de0 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -134,8 +134,8 @@ void server_process_native_message( /* A property follows */ - /* n received properties, +1 for _TRANSPORT */ - if (!GREEDY_REALLOC(iovec, m, n + 1 + N_IOVEC_META_FIELDS + !!object_pid * N_IOVEC_OBJECT_FIELDS)) { + /* n existing properties, 1 new, +1 for _TRANSPORT */ + if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + N_IOVEC_OBJECT_FIELDS)) { log_oom(); break; } @@ -350,7 +350,7 @@ void server_process_native_file( return; } - if (!filename_is_safe(e)) { + if (!filename_is_valid(e)) { log_error("Received file in subdirectory of allowed directories. Refusing."); return; } @@ -453,7 +453,7 @@ int server_open_native_socket(Server*s) { if (r < 0) return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); - r = sd_event_add_io(s->event, &s->native_event_source, s->native_fd, EPOLLIN, process_datagram, s); + r = sd_event_add_io(s->event, &s->native_event_source, s->native_fd, EPOLLIN, server_process_datagram, s); if (r < 0) return log_error_errno(r, "Failed to add native server fd to event loop: %m"); diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 80c973642..7ee8174ea 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -52,12 +52,7 @@ #include "journald-native.h" #include "journald-audit.h" #include "journald-server.h" - -#ifdef HAVE_ACL -#include -#include #include "acl-util.h" -#endif #ifdef HAVE_SELINUX #include @@ -297,8 +292,13 @@ static JournalFile* find_journal(Server *s, uid_t uid) { return f; } -static int do_rotate(Server *s, JournalFile **f, const char* name, - bool seal, uint32_t uid) { +static int do_rotate( + Server *s, + JournalFile **f, + const char* name, + bool seal, + uint32_t uid) { + int r; assert(s); @@ -308,13 +308,12 @@ static int do_rotate(Server *s, JournalFile **f, const char* name, r = journal_file_rotate(f, s->compress, seal); if (r < 0) if (*f) - log_error_errno(r, "Failed to rotate %s: %m", - (*f)->path); + log_error_errno(r, "Failed to rotate %s: %m", (*f)->path); else - log_error_errno(r, "Failed to create new %s journal: %m", - name); + log_error_errno(r, "Failed to create new %s journal: %m", name); else server_fix_perms(s, *f, uid); + return r; } @@ -366,15 +365,20 @@ void server_sync(Server *s) { s->sync_scheduled = false; } -static void do_vacuum(Server *s, char *ids, JournalFile *f, const char* path, - JournalMetrics *metrics) { - char *p; +static void do_vacuum( + Server *s, + const char *id, + JournalFile *f, + const char* path, + JournalMetrics *metrics) { + + const char *p; int r; if (!f) return; - p = strappenda(path, ids); + p = strjoina(path, id); r = journal_directory_vacuum(p, metrics->max_use, s->max_retention_usec, &s->oldest_file_usec, false); if (r < 0 && r != -ENOENT) log_error_errno(r, "Failed to vacuum %s: %m", p); @@ -446,18 +450,20 @@ static void server_cache_hostname(Server *s) { s->hostname_field = x; } -bool shall_try_append_again(JournalFile *f, int r) { +static bool shall_try_append_again(JournalFile *f, int r) { /* -E2BIG Hit configured limit -EFBIG Hit fs limit -EDQUOT Quota limit hit -ENOSPC Disk full + -EIO I/O error of some kind (mmap) -EHOSTDOWN Other machine -EBUSY Unclean shutdown -EPROTONOSUPPORT Unsupported feature -EBADMSG Corrupted -ENODATA Truncated - -ESHUTDOWN Already archived */ + -ESHUTDOWN Already archived + -EIDRM Journal file has been deleted */ if (r == -E2BIG || r == -EFBIG || r == -EDQUOT || r == -ENOSPC) log_debug("%s: Allocation limit reached, rotating.", f->path); @@ -469,6 +475,10 @@ bool shall_try_append_again(JournalFile *f, int r) { log_info("%s: Unsupported feature, rotating.", f->path); else if (r == -EBADMSG || r == -ENODATA || r == ESHUTDOWN) log_warning("%s: Journal file corrupted, rotating.", f->path); + else if (r == -EIO) + log_warning("%s: IO error, rotating.", f->path); + else if (r == -EIDRM) + log_warning("%s: Journal file has been deleted, rotating.", f->path); else return false; @@ -506,12 +516,7 @@ static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned } if (vacuumed || !shall_try_append_again(f, r)) { - size_t size = 0; - unsigned i; - for (i = 0; i < n; i++) - size += iovec[i].iov_len; - - log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, size); + log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); return; } @@ -524,14 +529,9 @@ static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned log_debug("Retrying write."); r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); - if (r < 0) { - size_t size = 0; - unsigned i; - for (i = 0; i < n; i++) - size += iovec[i].iov_len; - - log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, size); - } else + if (r < 0) + log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); + else server_schedule_sync(s, priority); } @@ -589,28 +589,28 @@ static void dispatch_message_real( r = get_process_comm(ucred->pid, &t); if (r >= 0) { - x = strappenda("_COMM=", t); + x = strjoina("_COMM=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } r = get_process_exe(ucred->pid, &t); if (r >= 0) { - x = strappenda("_EXE=", t); + x = strjoina("_EXE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } r = get_process_cmdline(ucred->pid, 0, false, &t); if (r >= 0) { - x = strappenda("_CMDLINE=", t); + x = strjoina("_CMDLINE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } r = get_process_capeff(ucred->pid, &t); if (r >= 0) { - x = strappenda("_CAP_EFFECTIVE=", t); + x = strjoina("_CAP_EFFECTIVE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } @@ -633,12 +633,12 @@ static void dispatch_message_real( if (r >= 0) { char *session = NULL; - x = strappenda("_SYSTEMD_CGROUP=", c); + x = strjoina("_SYSTEMD_CGROUP=", c); IOVEC_SET_STRING(iovec[n++], x); r = cg_path_get_session(c, &t); if (r >= 0) { - session = strappenda("_SYSTEMD_SESSION=", t); + session = strjoina("_SYSTEMD_SESSION=", t); free(t); IOVEC_SET_STRING(iovec[n++], session); } @@ -651,32 +651,32 @@ static void dispatch_message_real( } if (cg_path_get_unit(c, &t) >= 0) { - x = strappenda("_SYSTEMD_UNIT=", t); + x = strjoina("_SYSTEMD_UNIT=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } else if (unit_id && !session) { - x = strappenda("_SYSTEMD_UNIT=", unit_id); + x = strjoina("_SYSTEMD_UNIT=", unit_id); IOVEC_SET_STRING(iovec[n++], x); } if (cg_path_get_user_unit(c, &t) >= 0) { - x = strappenda("_SYSTEMD_USER_UNIT=", t); + x = strjoina("_SYSTEMD_USER_UNIT=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } else if (unit_id && session) { - x = strappenda("_SYSTEMD_USER_UNIT=", unit_id); + x = strjoina("_SYSTEMD_USER_UNIT=", unit_id); IOVEC_SET_STRING(iovec[n++], x); } if (cg_path_get_slice(c, &t) >= 0) { - x = strappenda("_SYSTEMD_SLICE=", t); + x = strjoina("_SYSTEMD_SLICE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } free(c); } else if (unit_id) { - x = strappenda("_SYSTEMD_UNIT=", unit_id); + x = strjoina("_SYSTEMD_UNIT=", unit_id); IOVEC_SET_STRING(iovec[n++], x); } @@ -691,7 +691,7 @@ static void dispatch_message_real( security_context_t con; if (getpidcon(ucred->pid, &con) >= 0) { - x = strappenda("_SELINUX_CONTEXT=", con); + x = strjoina("_SELINUX_CONTEXT=", con); freecon(con); IOVEC_SET_STRING(iovec[n++], x); @@ -717,21 +717,21 @@ static void dispatch_message_real( r = get_process_comm(object_pid, &t); if (r >= 0) { - x = strappenda("OBJECT_COMM=", t); + x = strjoina("OBJECT_COMM=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } r = get_process_exe(object_pid, &t); if (r >= 0) { - x = strappenda("OBJECT_EXE=", t); + x = strjoina("OBJECT_EXE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } r = get_process_cmdline(object_pid, 0, false, &t); if (r >= 0) { - x = strappenda("OBJECT_CMDLINE=", t); + x = strjoina("OBJECT_CMDLINE=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } @@ -752,12 +752,12 @@ static void dispatch_message_real( r = cg_pid_get_path_shifted(object_pid, s->cgroup_root, &c); if (r >= 0) { - x = strappenda("OBJECT_SYSTEMD_CGROUP=", c); + x = strjoina("OBJECT_SYSTEMD_CGROUP=", c); IOVEC_SET_STRING(iovec[n++], x); r = cg_path_get_session(c, &t); if (r >= 0) { - x = strappenda("OBJECT_SYSTEMD_SESSION=", t); + x = strjoina("OBJECT_SYSTEMD_SESSION=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } @@ -768,13 +768,13 @@ static void dispatch_message_real( } if (cg_path_get_unit(c, &t) >= 0) { - x = strappenda("OBJECT_SYSTEMD_UNIT=", t); + x = strjoina("OBJECT_SYSTEMD_UNIT=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } if (cg_path_get_user_unit(c, &t) >= 0) { - x = strappenda("OBJECT_SYSTEMD_USER_UNIT=", t); + x = strjoina("OBJECT_SYSTEMD_USER_UNIT=", t); free(t); IOVEC_SET_STRING(iovec[n++], x); } @@ -811,7 +811,7 @@ static void dispatch_message_real( * realuid is not root, in order not to accidentally * leak privileged information to the user that is * logged by a privileged process that is part of an - * unprivileged session.*/ + * unprivileged session. */ journal_uid = owner; else journal_uid = 0; @@ -837,12 +837,10 @@ void server_driver_message(Server *s, sd_id128_t message_id, const char *format, va_start(ap, format); vsnprintf(buffer + 8, sizeof(buffer) - 8, format, ap); va_end(ap); - char_array_0(buffer); IOVEC_SET_STRING(iovec[n++], buffer); if (!sd_id128_equal(message_id, SD_ID128_NULL)) { snprintf(mid, sizeof(mid), LOG_MESSAGE_ID(message_id)); - char_array_0(mid); IOVEC_SET_STRING(iovec[n++], mid); } @@ -946,10 +944,10 @@ static int system_journal_open(Server *s, bool flush_requested) { if (s->storage == STORAGE_PERSISTENT) (void) mkdir("/var/log/journal/", 0755); - fn = strappenda("/var/log/journal/", ids); + fn = strjoina("/var/log/journal/", ids); (void) mkdir(fn, 0755); - fn = strappenda(fn, "/system.journal"); + fn = strjoina(fn, "/system.journal"); r = journal_file_open_reliably(fn, O_RDWR|O_CREAT, 0640, s->compress, s->seal, &s->system_metrics, s->mmap, NULL, &s->system_journal); if (r >= 0) @@ -1103,7 +1101,7 @@ finish: return r; } -int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata) { +int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata) { Server *s = userdata; assert(s); @@ -1131,7 +1129,7 @@ int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userda * the SELinux people this will change and it * will probably be identical to NAME_MAX. For * now we use that, but this should be updated - * one day when the final limit is known.*/ + * one day when the final limit is known. */ uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + CMSG_SPACE(sizeof(struct timeval)) + CMSG_SPACE(sizeof(int)) + /* fd */ @@ -1158,7 +1156,7 @@ int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userda * don't rely on it. */ (void) ioctl(fd, SIOCINQ, &v); - /* Fix it up, if it is too small. We use the same fixed value as auditd here. Awful!*/ + /* Fix it up, if it is too small. We use the same fixed value as auditd here. Awful! */ m = PAGE_ALIGN(MAX3((size_t) v + 1, (size_t) LINE_MAX, ALIGN(sizeof(struct nlmsghdr)) + ALIGN((size_t) MAX_AUDIT_MESSAGE_LENGTH)) + 1); @@ -1457,6 +1455,7 @@ static int server_open_hostname(Server *s) { } int server_init(Server *s) { + _cleanup_fdset_free_ FDSet *fds = NULL; int n, r, fd; assert(s); @@ -1553,26 +1552,33 @@ int server_init(Server *s) { s->audit_fd = fd; } else { - log_warning("Unknown socket passed as file descriptor %d, ignoring.", fd); - /* Let's close the fd, better be safe than - sorry. The fd might reference some resource - that we really want to release if we don't - make use of it. */ + if (!fds) { + fds = fdset_new(); + if (!fds) + return log_oom(); + } - safe_close(fd); + r = fdset_put(fds, fd); + if (r < 0) + return log_oom(); } } - r = server_open_syslog_socket(s); + r = server_open_stdout_socket(s, fds); if (r < 0) return r; - r = server_open_native_socket(s); + if (fdset_size(fds) > 0) { + log_warning("%u unknown file descriptors passed, closing.", fdset_size(fds)); + fds = fdset_free(fds); + } + + r = server_open_syslog_socket(s); if (r < 0) return r; - r = server_open_stdout_socket(s); + r = server_open_native_socket(s); if (r < 0) return r; diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h index 9c7fa50a9..c96877c50 100644 --- a/src/journal/journald-server.h +++ b/src/journal/journald-server.h @@ -167,7 +167,6 @@ const char *split_mode_to_string(SplitMode s) _const_; SplitMode split_mode_from_string(const char *s) _pure_; void server_fix_perms(Server *s, JournalFile *f, uid_t uid); -bool shall_try_append_again(JournalFile *f, int r); int server_init(Server *s); void server_done(Server *s); void server_sync(Server *s); @@ -176,4 +175,4 @@ void server_rotate(Server *s); int server_schedule_sync(Server *s, int priority); int server_flush_to_var(Server *s); void server_maybe_append_tags(Server *s); -int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata); +int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata); diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c index be498d491..942a85780 100644 --- a/src/journal/journald-stream.c +++ b/src/journal/journald-stream.c @@ -28,8 +28,11 @@ #endif #include "sd-event.h" +#include "sd-daemon.h" #include "socket-util.h" #include "selinux-util.h" +#include "mkdir.h" +#include "fileio.h" #include "journald-server.h" #include "journald-stream.h" #include "journald-syslog.h" @@ -69,19 +72,158 @@ struct StdoutStream { bool forward_to_kmsg:1; bool forward_to_console:1; + bool fdstore:1; + char buffer[LINE_MAX+1]; size_t length; sd_event_source *event_source; + char *state_file; + LIST_FIELDS(StdoutStream, stdout_stream); }; +void stdout_stream_free(StdoutStream *s) { + if (!s) + return; + + if (s->server) { + assert(s->server->n_stdout_streams > 0); + s->server->n_stdout_streams --; + LIST_REMOVE(stdout_stream, s->server->stdout_streams, s); + } + + if (s->event_source) { + sd_event_source_set_enabled(s->event_source, SD_EVENT_OFF); + s->event_source = sd_event_source_unref(s->event_source); + } + + safe_close(s->fd); + +#ifdef HAVE_SELINUX + if (s->security_context) + freecon(s->security_context); +#endif + + free(s->identifier); + free(s->unit_id); + free(s->state_file); + + free(s); +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(StdoutStream*, stdout_stream_free); + +static void stdout_stream_destroy(StdoutStream *s) { + if (!s) + return; + + if (s->state_file) + unlink(s->state_file); + + stdout_stream_free(s); +} + +static int stdout_stream_save(StdoutStream *s) { + _cleanup_free_ char *temp_path = NULL; + _cleanup_fclose_ FILE *f = NULL; + int r; + + assert(s); + + if (s->state != STDOUT_STREAM_RUNNING) + return 0; + + if (!s->state_file) { + struct stat st; + + r = fstat(s->fd, &st); + if (r < 0) + return log_warning_errno(errno, "Failed to stat connected stream: %m"); + + /* We use device and inode numbers as identifier for the stream */ + if (asprintf(&s->state_file, "/run/systemd/journal/streams/%lu:%lu", (unsigned long) st.st_dev, (unsigned long) st.st_ino) < 0) + return log_oom(); + } + + mkdir_p("/run/systemd/journal/streams", 0755); + + r = fopen_temporary(s->state_file, &f, &temp_path); + if (r < 0) + goto finish; + + fprintf(f, + "# This is private data. Do not parse\n" + "PRIORITY=%i\n" + "LEVEL_PREFIX=%i\n" + "FORWARD_TO_SYSLOG=%i\n" + "FORWARD_TO_KMSG=%i\n" + "FORWARD_TO_CONSOLE=%i\n", + s->priority, + s->level_prefix, + s->forward_to_syslog, + s->forward_to_kmsg, + s->forward_to_console); + + if (!isempty(s->identifier)) { + _cleanup_free_ char *escaped; + + escaped = cescape(s->identifier); + if (!escaped) { + r = -ENOMEM; + goto finish; + } + + fprintf(f, "IDENTIFIER=%s\n", escaped); + } + + if (!isempty(s->unit_id)) { + _cleanup_free_ char *escaped; + + escaped = cescape(s->unit_id); + if (!escaped) { + r = -ENOMEM; + goto finish; + } + + fprintf(f, "UNIT=%s\n", escaped); + } + + r = fflush_and_check(f); + if (r < 0) + goto finish; + + if (rename(temp_path, s->state_file) < 0) { + r = -errno; + goto finish; + } + + free(temp_path); + temp_path = NULL; + + /* Store the connection fd in PID 1, so that we get it passed + * in again on next start */ + if (!s->fdstore) { + sd_pid_notify_with_fds(0, false, "FDSTORE=1", &s->fd, 1); + s->fdstore = true; + } + +finish: + if (temp_path) + unlink(temp_path); + + if (r < 0) + log_error_errno(r, "Failed to save stream data %s: %m", s->state_file); + + return r; +} + static int stdout_stream_log(StdoutStream *s, const char *p) { struct iovec iovec[N_IOVEC_META_FIELDS + 5]; int priority; char syslog_priority[] = "PRIORITY=\0"; - char syslog_facility[sizeof("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(priority)]; + char syslog_facility[sizeof("SYSLOG_FACILITY=")-1 + DECIMAL_STR_MAX(int) + 1]; _cleanup_free_ char *message = NULL, *syslog_identifier = NULL; unsigned n = 0; char *label = NULL; @@ -116,7 +258,7 @@ static int stdout_stream_log(StdoutStream *s, const char *p) { IOVEC_SET_STRING(iovec[n++], syslog_priority); if (priority & LOG_FACMASK) { - snprintf(syslog_facility, sizeof(syslog_facility), "SYSLOG_FACILITY=%i", LOG_FAC(priority)); + xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)); IOVEC_SET_STRING(iovec[n++], syslog_facility); } @@ -229,6 +371,9 @@ static int stdout_stream_line(StdoutStream *s, char *p) { s->forward_to_console = !!r; s->state = STDOUT_STREAM_RUNNING; + + /* Try to save the stream, so that journald can be restarted and we can recover */ + (void) stdout_stream_save(s); return 0; case STDOUT_STREAM_RUNNING: @@ -323,40 +468,63 @@ static int stdout_stream_process(sd_event_source *es, int fd, uint32_t revents, return 1; terminate: - stdout_stream_free(s); + stdout_stream_destroy(s); return 0; } -void stdout_stream_free(StdoutStream *s) { +static int stdout_stream_install(Server *s, int fd, StdoutStream **ret) { + _cleanup_(stdout_stream_freep) StdoutStream *stream = NULL; + int r; + assert(s); + assert(fd >= 0); - if (s->server) { - assert(s->server->n_stdout_streams > 0); - s->server->n_stdout_streams --; - LIST_REMOVE(stdout_stream, s->server->stdout_streams, s); - } + stream = new0(StdoutStream, 1); + if (!stream) + return log_oom(); - if (s->event_source) { - sd_event_source_set_enabled(s->event_source, SD_EVENT_OFF); - s->event_source = sd_event_source_unref(s->event_source); - } + stream->fd = -1; + stream->priority = LOG_INFO; - safe_close(s->fd); + r = getpeercred(fd, &stream->ucred); + if (r < 0) + return log_error_errno(r, "Failed to determine peer credentials: %m"); #ifdef HAVE_SELINUX - if (s->security_context) - freecon(s->security_context); + if (mac_selinux_use()) { + if (getpeercon(fd, &stream->security_context) < 0 && errno != ENOPROTOOPT) + log_error_errno(errno, "Failed to determine peer security context: %m"); + } #endif - free(s->identifier); - free(s->unit_id); - free(s); + (void) shutdown(fd, SHUT_WR); + + r = sd_event_add_io(s->event, &stream->event_source, fd, EPOLLIN, stdout_stream_process, stream); + if (r < 0) + return log_error_errno(r, "Failed to add stream to event loop: %m"); + + r = sd_event_source_set_priority(stream->event_source, SD_EVENT_PRIORITY_NORMAL+5); + if (r < 0) + return log_error_errno(r, "Failed to adjust stdout event source priority: %m"); + + stream->fd = fd; + + stream->server = s; + LIST_PREPEND(stdout_stream, s->stdout_streams, stream); + s->n_stdout_streams ++; + + if (ret) + *ret = stream; + + stream = NULL; + + return 0; } static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revents, void *userdata) { + _cleanup_close_ int fd = -1; Server *s = userdata; - StdoutStream *stream; - int fd, r; + int r; assert(s); @@ -376,60 +544,163 @@ static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revent if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { log_warning("Too many stdout streams, refusing connection."); - safe_close(fd); return 0; } - stream = new0(StdoutStream, 1); - if (!stream) { - safe_close(fd); - return log_oom(); + r = stdout_stream_install(s, fd, NULL); + if (r < 0) + return r; + + fd = -1; + return 0; +} + +static int stdout_stream_load(StdoutStream *stream, const char *fname) { + _cleanup_free_ char + *priority = NULL, + *level_prefix = NULL, + *forward_to_syslog = NULL, + *forward_to_kmsg = NULL, + *forward_to_console = NULL; + int r; + + assert(stream); + assert(fname); + + if (!stream->state_file) { + stream->state_file = strappend("/run/systemd/journal/streams/", fname); + if (!stream->state_file) + return log_oom(); } - stream->fd = fd; + r = parse_env_file(stream->state_file, NEWLINE, + "PRIORITY", &priority, + "LEVEL_PREFIX", &level_prefix, + "FORWARD_TO_SYSLOG", &forward_to_syslog, + "FORWARD_TO_KMSG", &forward_to_kmsg, + "FORWARD_TO_CONSOLE", &forward_to_console, + "IDENTIFIER", &stream->identifier, + "UNIT", &stream->unit_id, + NULL); + if (r < 0) + return log_error_errno(r, "Failed to read: %s", stream->state_file); - r = getpeercred(fd, &stream->ucred); - if (r < 0) { - log_error_errno(errno, "Failed to determine peer credentials: %m"); - goto fail; + if (priority) { + int p; + + p = log_level_from_string(priority); + if (p >= 0) + stream->priority = p; } -#ifdef HAVE_SELINUX - if (mac_selinux_use()) { - if (getpeercon(fd, &stream->security_context) < 0 && errno != ENOPROTOOPT) - log_error_errno(errno, "Failed to determine peer security context: %m"); + if (level_prefix) { + r = parse_boolean(level_prefix); + if (r >= 0) + stream->level_prefix = r; } -#endif - if (shutdown(fd, SHUT_WR) < 0) { - log_error_errno(errno, "Failed to shutdown writing side of socket: %m"); - goto fail; + if (forward_to_syslog) { + r = parse_boolean(forward_to_syslog); + if (r >= 0) + stream->forward_to_syslog = r; } - r = sd_event_add_io(s->event, &stream->event_source, fd, EPOLLIN, stdout_stream_process, stream); - if (r < 0) { - log_error_errno(r, "Failed to add stream to event loop: %m"); - goto fail; + if (forward_to_kmsg) { + r = parse_boolean(forward_to_kmsg); + if (r >= 0) + stream->forward_to_kmsg = r; } - r = sd_event_source_set_priority(stream->event_source, SD_EVENT_PRIORITY_NORMAL+5); - if (r < 0) { - log_error_errno(r, "Failed to adjust stdout event source priority: %m"); - goto fail; + if (forward_to_console) { + r = parse_boolean(forward_to_console); + if (r >= 0) + stream->forward_to_console = r; } - stream->server = s; - LIST_PREPEND(stdout_stream, s->stdout_streams, stream); - s->n_stdout_streams ++; + return 0; +} + +static int stdout_stream_restore(Server *s, const char *fname, int fd) { + StdoutStream *stream; + int r; + + assert(s); + assert(fname); + assert(fd >= 0); + + if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { + log_warning("Too many stdout streams, refusing restoring of stream."); + return -ENOBUFS; + } + + r = stdout_stream_install(s, fd, &stream); + if (r < 0) + return r; + + stream->state = STDOUT_STREAM_RUNNING; + stream->fdstore = true; + + /* Ignore all parsing errors */ + (void) stdout_stream_load(stream, fname); return 0; +} + +static int server_restore_streams(Server *s, FDSet *fds) { + _cleanup_closedir_ DIR *d = NULL; + struct dirent *de; + int r; + + d = opendir("/run/systemd/journal/streams"); + if (!d) { + if (errno == ENOENT) + return 0; + + return log_warning_errno(errno, "Failed to enumerate /run/systemd/journal/streams: %m"); + } + + FOREACH_DIRENT(de, d, goto fail) { + unsigned long st_dev, st_ino; + bool found = false; + Iterator i; + int fd; + + if (sscanf(de->d_name, "%lu:%lu", &st_dev, &st_ino) != 2) + continue; + + FDSET_FOREACH(fd, fds, i) { + struct stat st; + + if (fstat(fd, &st) < 0) + return log_error_errno(errno, "Failed to stat %s: %m", de->d_name); + + if (S_ISSOCK(st.st_mode) && st.st_dev == st_dev && st.st_ino == st_ino) { + found = true; + break; + } + } + + if (!found) { + /* No file descriptor? Then let's delete the state file */ + log_debug("Cannot restore stream file %s", de->d_name); + unlinkat(dirfd(d), de->d_name, 0); + continue; + } + + fdset_remove(fds, fd); + + r = stdout_stream_restore(s, de->d_name, fd); + if (r < 0) + safe_close(fd); + } -fail: - stdout_stream_free(stream); return 0; + +fail: + return log_error_errno(errno, "Failed to read streams directory: %m"); } -int server_open_stdout_socket(Server *s) { +int server_open_stdout_socket(Server *s, FDSet *fds) { int r; assert(s); @@ -465,5 +736,8 @@ int server_open_stdout_socket(Server *s) { if (r < 0) return log_error_errno(r, "Failed to adjust priority of stdout server event source: %m"); + /* Try to restore streams, but don't bother if this fails */ + (void) server_restore_streams(s, fds); + return 0; } diff --git a/src/journal/journald-stream.h b/src/journal/journald-stream.h index 8cad01296..94bf955d7 100644 --- a/src/journal/journald-stream.h +++ b/src/journal/journald-stream.h @@ -21,8 +21,9 @@ along with systemd; If not, see . ***/ +#include "fdset.h" #include "journald-server.h" -int server_open_stdout_socket(Server *s); +int server_open_stdout_socket(Server *s, FDSet *fds); void stdout_stream_free(StdoutStream *s); diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index cc44d4594..7d545ca31 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -85,12 +85,12 @@ static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned return; } - if (ucred && errno == ESRCH) { + if (ucred && (errno == ESRCH || errno == EPERM)) { struct ucred u; /* Hmm, presumably the sender process vanished - * by now, so let's fix it as good as we - * can, and retry */ + * by now, or we don't have CAP_SYS_AMDIN, so + * let's fix it as good as we can, and retry */ u = *ucred; u.pid = getpid(); @@ -124,7 +124,8 @@ static void forward_syslog_raw(Server *s, int priority, const char *buffer, cons void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv) { struct iovec iovec[5]; - char header_priority[6], header_time[64], header_pid[16]; + char header_priority[DECIMAL_STR_MAX(priority) + 3], header_time[64], + header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; int n = 0; time_t t; struct tm *tm; @@ -139,8 +140,7 @@ void server_forward_syslog(Server *s, int priority, const char *identifier, cons return; /* First: priority field */ - snprintf(header_priority, sizeof(header_priority), "<%i>", priority); - char_array_0(header_priority); + xsprintf(header_priority, "<%i>", priority); IOVEC_SET_STRING(iovec[n++], header_priority); /* Second: timestamp */ @@ -159,8 +159,7 @@ void server_forward_syslog(Server *s, int priority, const char *identifier, cons identifier = ident_buf; } - snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", ucred->pid); - char_array_0(header_pid); + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); if (identifier) IOVEC_SET_STRING(iovec[n++], identifier); @@ -238,46 +237,6 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) return e; } -void syslog_parse_priority(const char **p, int *priority, bool with_facility) { - int a = 0, b = 0, c = 0; - int k; - - assert(p); - assert(*p); - assert(priority); - - if ((*p)[0] != '<') - return; - - if (!strchr(*p, '>')) - return; - - if ((*p)[2] == '>') { - c = undecchar((*p)[1]); - k = 3; - } else if ((*p)[3] == '>') { - b = undecchar((*p)[1]); - c = undecchar((*p)[2]); - k = 4; - } else if ((*p)[4] == '>') { - a = undecchar((*p)[1]); - b = undecchar((*p)[2]); - c = undecchar((*p)[3]); - k = 5; - } else - return; - - if (a < 0 || b < 0 || c < 0 || - (!with_facility && (a || b || c > 7))) - return; - - if (with_facility) - *priority = a*100 + b*10 + c; - else - *priority = (*priority & LOG_FACMASK) | c; - *p += k; -} - static void syslog_skip_date(char **buf) { enum { LETTER, @@ -397,18 +356,18 @@ void server_process_syslog_message( } if (identifier) { - syslog_identifier = strappenda("SYSLOG_IDENTIFIER=", identifier); + syslog_identifier = strjoina("SYSLOG_IDENTIFIER=", identifier); if (syslog_identifier) IOVEC_SET_STRING(iovec[n++], syslog_identifier); } if (pid) { - syslog_pid = strappenda("SYSLOG_PID=", pid); + syslog_pid = strjoina("SYSLOG_PID=", pid); if (syslog_pid) IOVEC_SET_STRING(iovec[n++], syslog_pid); } - message = strappenda("MESSAGE=", buf); + message = strjoina("MESSAGE=", buf); if (message) IOVEC_SET_STRING(iovec[n++], message); @@ -457,7 +416,7 @@ int server_open_syslog_socket(Server *s) { if (r < 0) return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); - r = sd_event_add_io(s->event, &s->syslog_event_source, s->syslog_fd, EPOLLIN, process_datagram, s); + r = sd_event_add_io(s->event, &s->syslog_event_source, s->syslog_fd, EPOLLIN, server_process_datagram, s); if (r < 0) return log_error_errno(r, "Failed to add syslog server fd to event loop: %m"); diff --git a/src/journal/journald-syslog.h b/src/journal/journald-syslog.h index 25f89883f..3774ebdf0 100644 --- a/src/journal/journald-syslog.h +++ b/src/journal/journald-syslog.h @@ -25,7 +25,6 @@ int syslog_fixup_facility(int priority) _const_; -void syslog_parse_priority(const char **p, int *priority, bool with_facility); size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid); void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv); diff --git a/src/journal/journald.c b/src/journal/journald.c index 604c8617b..80f4634f6 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -33,6 +33,8 @@ #include "journald-kmsg.h" #include "journald-syslog.h" +#include "sigbus.h" + int main(int argc, char *argv[]) { Server server; int r; @@ -49,6 +51,8 @@ int main(int argc, char *argv[]) { umask(0022); + sigbus_install(); + r = server_init(&server); if (r < 0) goto finish; diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c index b7db6f1da..ab21cdc28 100644 --- a/src/journal/mmap-cache.c +++ b/src/journal/mmap-cache.c @@ -29,6 +29,7 @@ #include "log.h" #include "util.h" #include "macro.h" +#include "sigbus.h" #include "mmap-cache.h" typedef struct Window Window; @@ -38,7 +39,8 @@ typedef struct FileDescriptor FileDescriptor; struct Window { MMapCache *cache; - unsigned keep_always; + bool invalidated; + bool keep_always; bool in_unused; int prot; @@ -65,6 +67,7 @@ struct Context { struct FileDescriptor { MMapCache *cache; int fd; + bool sigbus; LIST_HEAD(Window, windows); }; @@ -76,14 +79,20 @@ struct MMapCache { Hashmap *fds; - Hashmap *contexts; + Context *contexts[MMAP_CACHE_MAX_CONTEXTS]; LIST_HEAD(Window, unused); Window *last_unused; }; #define WINDOWS_MIN 64 -#define WINDOW_SIZE (8ULL*1024ULL*1024ULL) + +#ifdef ENABLE_DEBUG_MMAP_CACHE +/* Tiny windows increase mmap activity and the chance of exposing unsafe use. */ +# define WINDOW_SIZE (page_size()) +#else +# define WINDOW_SIZE (8ULL*1024ULL*1024ULL) +#endif MMapCache* mmap_cache_new(void) { MMapCache *m; @@ -128,6 +137,21 @@ static void window_unlink(Window *w) { } } +static void window_invalidate(Window *w) { + assert(w); + + if (w->invalidated) + return; + + /* Replace the window with anonymous pages. This is useful + * when we hit a SIGBUS and want to make sure the file cannot + * trigger any further SIGBUS, possibly overrunning the sigbus + * queue. */ + + assert_se(mmap(w->ptr, w->size, w->prot, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0) == w->ptr); + w->invalidated = true; +} + static void window_free(Window *w) { assert(w); @@ -185,13 +209,19 @@ static void context_detach_window(Context *c) { c->window = NULL; LIST_REMOVE(by_window, w->contexts, c); - if (!w->contexts && w->keep_always == 0) { + if (!w->contexts && !w->keep_always) { /* Not used anymore? */ +#ifdef ENABLE_DEBUG_MMAP_CACHE + /* Unmap unused windows immediately to expose use-after-unmap + * by SIGSEGV. */ + window_free(w); +#else LIST_PREPEND(unused, c->cache->unused, w); if (!c->cache->last_unused) c->cache->last_unused = w; w->in_unused = true; +#endif } } @@ -219,18 +249,13 @@ static void context_attach_window(Context *c, Window *w) { static Context *context_add(MMapCache *m, unsigned id) { Context *c; - int r; assert(m); - c = hashmap_get(m->contexts, UINT_TO_PTR(id + 1)); + c = m->contexts[id]; if (c) return c; - r = hashmap_ensure_allocated(&m->contexts, NULL); - if (r < 0) - return NULL; - c = new0(Context, 1); if (!c) return NULL; @@ -238,11 +263,8 @@ static Context *context_add(MMapCache *m, unsigned id) { c->cache = m; c->id = id; - r = hashmap_put(m->contexts, UINT_TO_PTR(id + 1), c); - if (r < 0) { - free(c); - return NULL; - } + assert(!m->contexts[id]); + m->contexts[id] = c; return c; } @@ -252,8 +274,10 @@ static void context_free(Context *c) { context_detach_window(c); - if (c->cache) - assert_se(hashmap_remove(c->cache->contexts, UINT_TO_PTR(c->id + 1))); + if (c->cache) { + assert(c->cache->contexts[c->id] == c); + c->cache->contexts[c->id] = NULL; + } free(c); } @@ -302,15 +326,14 @@ static FileDescriptor* fd_add(MMapCache *m, int fd) { } static void mmap_cache_free(MMapCache *m) { - Context *c; FileDescriptor *f; + int i; assert(m); - while ((c = hashmap_first(m->contexts))) - context_free(c); - - hashmap_free(m->contexts); + for (i = 0; i < MMAP_CACHE_MAX_CONTEXTS; i++) + if (m->contexts[i]) + context_free(m->contexts[i]); while ((f = hashmap_first(m->fds))) fd_free(f); @@ -352,8 +375,7 @@ static int try_context( bool keep_always, uint64_t offset, size_t size, - void **ret, - void **release_cookie) { + void **ret) { Context *c; @@ -361,8 +383,9 @@ static int try_context( assert(m->n_ref > 0); assert(fd >= 0); assert(size > 0); + assert(ret); - c = hashmap_get(m->contexts, UINT_TO_PTR(context+1)); + c = m->contexts[context]; if (!c) return 0; @@ -378,12 +401,12 @@ static int try_context( return 0; } - c->window->keep_always += keep_always; + if (c->window->fd->sigbus) + return -EIO; - if (ret) - *ret = (uint8_t*) c->window->ptr + (offset - c->window->offset); - if (keep_always && release_cookie) - *release_cookie = c->window; + c->window->keep_always |= keep_always; + + *ret = (uint8_t*) c->window->ptr + (offset - c->window->offset); return 1; } @@ -395,8 +418,7 @@ static int find_mmap( bool keep_always, uint64_t offset, size_t size, - void **ret, - void **release_cookie) { + void **ret) { FileDescriptor *f; Window *w; @@ -413,6 +435,9 @@ static int find_mmap( assert(f->fd == fd); + if (f->sigbus) + return -EIO; + LIST_FOREACH(by_fd, w, f->windows) if (window_matches(w, fd, prot, offset, size)) break; @@ -427,10 +452,7 @@ static int find_mmap( context_attach_window(c, w); w->keep_always += keep_always; - if (ret) - *ret = (uint8_t*) w->ptr + (offset - w->offset); - if (keep_always && release_cookie) - *release_cookie = c->window; + *ret = (uint8_t*) w->ptr + (offset - w->offset); return 1; } @@ -443,8 +465,7 @@ static int add_mmap( uint64_t offset, size_t size, struct stat *st, - void **ret, - void **release_cookie) { + void **ret) { uint64_t woffset, wsize; Context *c; @@ -457,6 +478,7 @@ static int add_mmap( assert(m->n_ref > 0); assert(fd >= 0); assert(size > 0); + assert(ret); woffset = offset & ~((uint64_t) page_size() - 1ULL); wsize = size + (offset - woffset); @@ -526,10 +548,7 @@ static int add_mmap( c->window = w; LIST_PREPEND(by_window, w->contexts, c); - if (ret) - *ret = (uint8_t*) w->ptr + (offset - w->offset); - if (keep_always && release_cookie) - *release_cookie = c->window; + *ret = (uint8_t*) w->ptr + (offset - w->offset); return 1; outofmem: @@ -546,8 +565,7 @@ int mmap_cache_get( uint64_t offset, size_t size, struct stat *st, - void **ret, - void **release_cookie) { + void **ret) { int r; @@ -555,16 +573,18 @@ int mmap_cache_get( assert(m->n_ref > 0); assert(fd >= 0); assert(size > 0); + assert(ret); + assert(context < MMAP_CACHE_MAX_CONTEXTS); /* Check whether the current context is the right one already */ - r = try_context(m, fd, prot, context, keep_always, offset, size, ret, release_cookie); + r = try_context(m, fd, prot, context, keep_always, offset, size, ret); if (r != 0) { m->n_hit ++; return r; } /* Search for a matching mmap */ - r = find_mmap(m, fd, prot, context, keep_always, offset, size, ret, release_cookie); + r = find_mmap(m, fd, prot, context, keep_always, offset, size, ret); if (r != 0) { m->n_hit ++; return r; @@ -573,74 +593,114 @@ int mmap_cache_get( m->n_missed++; /* Create a new mmap */ - return add_mmap(m, fd, prot, context, keep_always, offset, size, st, ret, release_cookie); + return add_mmap(m, fd, prot, context, keep_always, offset, size, st, ret); } -int mmap_cache_release( - MMapCache *m, - int fd, - void *release_cookie) { +unsigned mmap_cache_get_hit(MMapCache *m) { + assert(m); - FileDescriptor *f; - Window *w; + return m->n_hit; +} +unsigned mmap_cache_get_missed(MMapCache *m) { assert(m); - assert(m->n_ref > 0); - assert(fd >= 0); - f = hashmap_get(m->fds, INT_TO_PTR(fd + 1)); - if (!f) - return -EBADF; + return m->n_missed; +} - assert(f->fd == fd); +static void mmap_cache_process_sigbus(MMapCache *m) { + bool found = false; + FileDescriptor *f; + Iterator i; + int r; - LIST_FOREACH(by_fd, w, f->windows) - if (w == release_cookie) + assert(m); + + /* Iterate through all triggered pages and mark their files as + * invalidated */ + for (;;) { + bool ours; + void *addr; + + r = sigbus_pop(&addr); + if (_likely_(r == 0)) break; + if (r < 0) { + log_error_errno(r, "SIGBUS handling failed: %m"); + abort(); + } + + ours = false; + HASHMAP_FOREACH(f, m->fds, i) { + Window *w; + + LIST_FOREACH(by_fd, w, f->windows) { + if ((uint8_t*) addr >= (uint8_t*) w->ptr && + (uint8_t*) addr < (uint8_t*) w->ptr + w->size) { + found = ours = f->sigbus = true; + break; + } + } + + if (ours) + break; + } + + /* Didn't find a matching window, give up */ + if (!ours) { + log_error("Unknown SIGBUS page, aborting."); + abort(); + } + } - if (!w) - return -ENOENT; + /* The list of triggered pages is now empty. Now, let's remap + * all windows of the triggered file to anonymous maps, so + * that no page of the file in question is triggered again, so + * that we can be sure not to hit the queue size limit. */ + if (_likely_(!found)) + return; + + HASHMAP_FOREACH(f, m->fds, i) { + Window *w; - if (w->keep_always == 0) - return -ENOLCK; + if (!f->sigbus) + continue; - w->keep_always -= 1; - return 0; + LIST_FOREACH(by_fd, w, f->windows) + window_invalidate(w); + } } -void mmap_cache_close_fd(MMapCache *m, int fd) { +bool mmap_cache_got_sigbus(MMapCache *m, int fd) { FileDescriptor *f; assert(m); assert(fd >= 0); + mmap_cache_process_sigbus(m); + f = hashmap_get(m->fds, INT_TO_PTR(fd + 1)); if (!f) - return; + return false; - fd_free(f); + return f->sigbus; } -void mmap_cache_close_context(MMapCache *m, unsigned context) { - Context *c; +void mmap_cache_close_fd(MMapCache *m, int fd) { + FileDescriptor *f; assert(m); + assert(fd >= 0); - c = hashmap_get(m->contexts, UINT_TO_PTR(context + 1)); - if (!c) - return; - - context_free(c); -} - -unsigned mmap_cache_get_hit(MMapCache *m) { - assert(m); + /* Make sure that any queued SIGBUS are first dispatched, so + * that we don't end up with a SIGBUS entry we cannot relate + * to any existing memory map */ - return m->n_hit; -} + mmap_cache_process_sigbus(m); -unsigned mmap_cache_get_missed(MMapCache *m) { - assert(m); + f = hashmap_get(m->fds, INT_TO_PTR(fd + 1)); + if (!f) + return; - return m->n_missed; + fd_free(f); } diff --git a/src/journal/mmap-cache.h b/src/journal/mmap-cache.h index 76e531624..a85c2b606 100644 --- a/src/journal/mmap-cache.h +++ b/src/journal/mmap-cache.h @@ -25,6 +25,9 @@ #include #include +/* One context per object type, plus one of the header, plus one "additional" one */ +#define MMAP_CACHE_MAX_CONTEXTS 9 + typedef struct MMapCache MMapCache; MMapCache* mmap_cache_new(void); @@ -40,14 +43,10 @@ int mmap_cache_get( uint64_t offset, size_t size, struct stat *st, - void **ret, - void **release_cookie); -int mmap_cache_release( - MMapCache *m, - int fd, - void *release_cookie); + void **ret); void mmap_cache_close_fd(MMapCache *m, int fd); -void mmap_cache_close_context(MMapCache *m, unsigned context); unsigned mmap_cache_get_hit(MMapCache *m); unsigned mmap_cache_get_missed(MMapCache *m); + +bool mmap_cache_got_sigbus(MMapCache *m, int fd); diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 23aad740d..94891cdf3 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -43,7 +43,7 @@ #include "replace-var.h" #include "fileio.h" -#define JOURNAL_FILES_MAX 1024 +#define JOURNAL_FILES_MAX 7168 #define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC) @@ -87,7 +87,7 @@ static void detach_location(sd_journal *j) { j->current_field = 0; ORDERED_HASHMAP_FOREACH(f, j->files, i) - f->current_offset = 0; + journal_file_reset_location(f); } static void reset_location(sd_journal *j) { @@ -114,20 +114,19 @@ static void init_location(Location *l, LocationType type, JournalFile *f, Object l->seqnum_set = l->realtime_set = l->monotonic_set = l->xor_hash_set = true; } -static void set_location(sd_journal *j, LocationType type, JournalFile *f, Object *o, - direction_t direction, uint64_t offset) { +static void set_location(sd_journal *j, JournalFile *f, Object *o) { assert(j); - assert(type == LOCATION_DISCRETE || type == LOCATION_SEEK); assert(f); assert(o); - init_location(&j->current_location, type, f, o); + init_location(&j->current_location, LOCATION_DISCRETE, f, o); j->current_file = f; j->current_field = 0; - f->last_direction = direction; - f->current_offset = offset; + /* Let f know its candidate entry was picked. */ + assert(f->location_type == LOCATION_SEEK); + f->location_type = LOCATION_DISCRETE; } static int match_is_valid(const void *data, size_t size) { @@ -413,185 +412,51 @@ _public_ void sd_journal_flush_matches(sd_journal *j) { detach_location(j); } -static int compare_entry_order(JournalFile *af, Object *_ao, - JournalFile *bf, uint64_t bp) { - - uint64_t a, b; - Object *ao, *bo; - int r; - - assert(af); - assert(bf); - assert(_ao); - - /* The mmap cache might invalidate the object from the first - * file if we look at the one from the second file. Hence - * temporarily copy the header of the first one, and look at - * that only. */ - ao = alloca(offsetof(EntryObject, items)); - memcpy(ao, _ao, offsetof(EntryObject, items)); - - r = journal_file_move_to_object(bf, OBJECT_ENTRY, bp, &bo); - if (r < 0) - return strcmp(af->path, bf->path); - - /* We operate on two different files here, hence we can access - * two objects at the same time, which we normally can't. - * - * If contents and timestamps match, these entries are - * identical, even if the seqnum does not match */ - - if (sd_id128_equal(ao->entry.boot_id, bo->entry.boot_id) && - ao->entry.monotonic == bo->entry.monotonic && - ao->entry.realtime == bo->entry.realtime && - ao->entry.xor_hash == bo->entry.xor_hash) - return 0; - - if (sd_id128_equal(af->header->seqnum_id, bf->header->seqnum_id)) { - - /* If this is from the same seqnum source, compare - * seqnums */ - a = le64toh(ao->entry.seqnum); - b = le64toh(bo->entry.seqnum); - - if (a < b) - return -1; - if (a > b) - return 1; - - /* Wow! This is weird, different data but the same - * seqnums? Something is borked, but let's make the - * best of it and compare by time. */ - } - - if (sd_id128_equal(ao->entry.boot_id, bo->entry.boot_id)) { - - /* If the boot id matches, compare monotonic time */ - a = le64toh(ao->entry.monotonic); - b = le64toh(bo->entry.monotonic); - - if (a < b) - return -1; - if (a > b) - return 1; - } - - /* Otherwise, compare UTC time */ - a = le64toh(ao->entry.realtime); - b = le64toh(bo->entry.realtime); - - if (a < b) - return -1; - if (a > b) - return 1; - - /* Finally, compare by contents */ - a = le64toh(ao->entry.xor_hash); - b = le64toh(bo->entry.xor_hash); - - if (a < b) - return -1; - if (a > b) - return 1; - - return 0; -} - -static bool whole_file_precedes_location(JournalFile *f, Location *l, direction_t direction) { - assert(f); - assert(l); - - if (l->type != LOCATION_DISCRETE && l->type != LOCATION_SEEK) - return false; - - if (l->seqnum_set && sd_id128_equal(l->seqnum_id, f->header->seqnum_id)) - return direction == DIRECTION_DOWN ? - l->seqnum > le64toh(f->header->tail_entry_seqnum) : - l->seqnum < le64toh(f->header->head_entry_seqnum); - - if (l->realtime_set) - return direction == DIRECTION_DOWN ? - l->realtime > le64toh(f->header->tail_entry_realtime) : - l->realtime < le64toh(f->header->head_entry_realtime); - - return false; -} - -static bool file_may_have_preceding_entry(JournalFile *f, JournalFile *of, uint64_t op, direction_t direction) { - Object *o; - int r; - +_pure_ static int compare_with_location(JournalFile *f, Location *l) { assert(f); - assert(of); - - r = journal_file_move_to_object(of, OBJECT_ENTRY, op, &o); - if (r < 0) - return true; - - if (sd_id128_equal(f->header->seqnum_id, of->header->seqnum_id)) - return direction == DIRECTION_DOWN ? - le64toh(o->entry.seqnum) >= le64toh(f->header->head_entry_seqnum) : - le64toh(o->entry.seqnum) <= le64toh(f->header->tail_entry_seqnum); - - return direction == DIRECTION_DOWN ? - le64toh(o->entry.realtime) >= le64toh(f->header->head_entry_realtime) : - le64toh(o->entry.realtime) <= le64toh(f->header->tail_entry_realtime); -} - -_pure_ static int compare_with_location(JournalFile *af, Object *ao, Location *l) { - uint64_t a; - - assert(af); - assert(ao); assert(l); + assert(f->location_type == LOCATION_SEEK); assert(l->type == LOCATION_DISCRETE || l->type == LOCATION_SEEK); if (l->monotonic_set && - sd_id128_equal(ao->entry.boot_id, l->boot_id) && + sd_id128_equal(f->current_boot_id, l->boot_id) && l->realtime_set && - le64toh(ao->entry.realtime) == l->realtime && + f->current_realtime == l->realtime && l->xor_hash_set && - le64toh(ao->entry.xor_hash) == l->xor_hash) + f->current_xor_hash == l->xor_hash) return 0; if (l->seqnum_set && - sd_id128_equal(af->header->seqnum_id, l->seqnum_id)) { + sd_id128_equal(f->header->seqnum_id, l->seqnum_id)) { - a = le64toh(ao->entry.seqnum); - - if (a < l->seqnum) + if (f->current_seqnum < l->seqnum) return -1; - if (a > l->seqnum) + if (f->current_seqnum > l->seqnum) return 1; } if (l->monotonic_set && - sd_id128_equal(ao->entry.boot_id, l->boot_id)) { - - a = le64toh(ao->entry.monotonic); + sd_id128_equal(f->current_boot_id, l->boot_id)) { - if (a < l->monotonic) + if (f->current_monotonic < l->monotonic) return -1; - if (a > l->monotonic) + if (f->current_monotonic > l->monotonic) return 1; } if (l->realtime_set) { - a = le64toh(ao->entry.realtime); - - if (a < l->realtime) + if (f->current_realtime < l->realtime) return -1; - if (a > l->realtime) + if (f->current_realtime > l->realtime) return 1; } if (l->xor_hash_set) { - a = le64toh(ao->entry.xor_hash); - if (a < l->xor_hash) + if (f->current_xor_hash < l->xor_hash) return -1; - if (a > l->xor_hash) + if (f->current_xor_hash > l->xor_hash) return 1; } @@ -807,9 +672,9 @@ static int find_location_with_matches( /* No matches is simple */ if (j->current_location.type == LOCATION_HEAD) - return journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, ret, offset); + return journal_file_next_entry(f, 0, DIRECTION_DOWN, ret, offset); if (j->current_location.type == LOCATION_TAIL) - return journal_file_next_entry(f, NULL, 0, DIRECTION_UP, ret, offset); + return journal_file_next_entry(f, 0, DIRECTION_UP, ret, offset); if (j->current_location.seqnum_set && sd_id128_equal(j->current_location.seqnum_id, f->header->seqnum_id)) return journal_file_move_to_entry_by_seqnum(f, j->current_location.seqnum, direction, ret, offset); if (j->current_location.monotonic_set) { @@ -820,7 +685,7 @@ static int find_location_with_matches( if (j->current_location.realtime_set) return journal_file_move_to_entry_by_realtime(f, j->current_location.realtime, direction, ret, offset); - return journal_file_next_entry(f, NULL, 0, direction, ret, offset); + return journal_file_next_entry(f, 0, direction, ret, offset); } else return find_location_for_match(j, j->level0, f, direction, ret, offset); } @@ -832,49 +697,55 @@ static int next_with_matches( Object **ret, uint64_t *offset) { - Object *c; - uint64_t cp; - assert(j); assert(f); assert(ret); assert(offset); - c = *ret; - cp = *offset; - /* No matches is easy. We simple advance the file * pointer by one. */ if (!j->level0) - return journal_file_next_entry(f, c, cp, direction, ret, offset); + return journal_file_next_entry(f, f->current_offset, direction, ret, offset); /* If we have a match then we look for the next matching entry * with an offset at least one step larger */ - return next_for_match(j, j->level0, f, direction == DIRECTION_DOWN ? cp+1 : cp-1, direction, ret, offset); + return next_for_match(j, j->level0, f, + direction == DIRECTION_DOWN ? f->current_offset + 1 + : f->current_offset - 1, + direction, ret, offset); } -static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direction, Object **ret, uint64_t *offset) { +static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direction) { Object *c; - uint64_t cp; + uint64_t cp, n_entries; int r; assert(j); assert(f); if (f->last_direction == direction && f->current_offset > 0) { - cp = f->current_offset; + /* If we hit EOF before, recheck if any new entries arrived. */ + n_entries = le64toh(f->header->n_entries); + if (f->location_type == LOCATION_TAIL && n_entries == f->last_n_entries) + return 0; + f->last_n_entries = n_entries; - r = journal_file_move_to_object(f, OBJECT_ENTRY, cp, &c); - if (r < 0) - return r; + /* LOCATION_SEEK here means we did the work in a previous + * iteration and the current location already points to a + * candidate entry. */ + if (f->location_type != LOCATION_SEEK) { + r = next_with_matches(j, f, direction, &c, &cp); + if (r <= 0) + return r; - r = next_with_matches(j, f, direction, &c, &cp); - if (r <= 0) - return r; + journal_file_save_location(f, direction, c, cp); + } } else { r = find_location_with_matches(j, f, direction, &c, &cp); if (r <= 0) return r; + + journal_file_save_location(f, direction, c, cp); } /* OK, we found the spot, now let's advance until an entry @@ -889,30 +760,25 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc if (j->current_location.type == LOCATION_DISCRETE) { int k; - k = compare_with_location(f, c, &j->current_location); + k = compare_with_location(f, &j->current_location); found = direction == DIRECTION_DOWN ? k > 0 : k < 0; } else found = true; - if (found) { - if (ret) - *ret = c; - if (offset) - *offset = cp; + if (found) return 1; - } r = next_with_matches(j, f, direction, &c, &cp); if (r <= 0) return r; + + journal_file_save_location(f, direction, c, cp); } } static int real_journal_next(sd_journal *j, direction_t direction) { JournalFile *f, *new_file = NULL; - uint64_t new_offset = 0; - uint64_t p = 0; Iterator i; Object *o; int r; @@ -923,44 +789,38 @@ static int real_journal_next(sd_journal *j, direction_t direction) { ORDERED_HASHMAP_FOREACH(f, j->files, i) { bool found; - if (whole_file_precedes_location(f, &j->current_location, direction)) - continue; - - if (new_file && !file_may_have_preceding_entry(f, new_file, new_offset, direction)) - continue; - - r = next_beyond_location(j, f, direction, &o, &p); + r = next_beyond_location(j, f, direction); if (r < 0) { log_debug_errno(r, "Can't iterate through %s, ignoring: %m", f->path); remove_file_real(j, f); continue; - } else if (r == 0) + } else if (r == 0) { + f->location_type = LOCATION_TAIL; continue; + } if (!new_file) found = true; else { int k; - k = compare_entry_order(f, o, new_file, new_offset); + k = journal_file_compare_locations(f, new_file); found = direction == DIRECTION_DOWN ? k < 0 : k > 0; } - if (found) { + if (found) new_file = f; - new_offset = p; - } } if (!new_file) return 0; - r = journal_file_move_to_object(new_file, OBJECT_ENTRY, new_offset, &o); + r = journal_file_move_to_object(new_file, OBJECT_ENTRY, new_file->current_offset, &o); if (r < 0) return r; - set_location(j, LOCATION_DISCRETE, new_file, o, direction, new_offset); + set_location(j, new_file, o); return 1; } @@ -1295,9 +1155,9 @@ static void check_network(sd_journal *j, int fd) { static bool file_has_type_prefix(const char *prefix, const char *filename) { const char *full, *tilded, *atted; - full = strappenda(prefix, ".journal"); - tilded = strappenda(full, "~"); - atted = strappenda(prefix, "@"); + full = strjoina(prefix, ".journal"); + tilded = strjoina(full, "~"); + atted = strjoina(prefix, "@"); return streq(filename, full) || streq(filename, tilded) || @@ -1318,8 +1178,7 @@ static bool file_type_wanted(int flags, const char *filename) { if (flags & SD_JOURNAL_CURRENT_USER) { char prefix[5 + DECIMAL_STR_MAX(uid_t) + 1]; - assert_se(snprintf(prefix, sizeof(prefix), "user-"UID_FMT, getuid()) - < (int) sizeof(prefix)); + xsprintf(prefix, "user-"UID_FMT, getuid()); if (file_has_type_prefix(prefix, filename)) return true; @@ -1540,7 +1399,7 @@ static int add_root_directory(sd_journal *j, const char *p) { return -EINVAL; if (j->prefix) - p = strappenda(j->prefix, p); + p = strjoina(j->prefix, p); d = opendir(p); if (!d) @@ -1784,7 +1643,7 @@ _public_ int sd_journal_open_container(sd_journal **ret, const char *machine, in assert_return((flags & ~(SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_SYSTEM)) == 0, -EINVAL); assert_return(machine_name_is_valid(machine), -EINVAL); - p = strappenda("/run/systemd/machines/", machine); + p = strjoina("/run/systemd/machines/", machine); r = parse_env_file(p, NEWLINE, "ROOT", &root, "CLASS", &class, NULL); if (r == -ENOENT) return -EHOSTDOWN; @@ -2328,11 +2187,11 @@ _public_ int sd_journal_process(sd_journal *j) { j->last_process_usec = now(CLOCK_MONOTONIC); for (;;) { - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event); + union inotify_event_buffer buffer; struct inotify_event *e; ssize_t l; - l = read(j->inotify_fd, buffer, sizeof(buffer)); + l = read(j->inotify_fd, &buffer, sizeof(buffer)); if (l < 0) { if (errno == EAGAIN || errno == EINTR) return got_something ? determine_change(j) : SD_JOURNAL_NOP; @@ -2563,7 +2422,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ size_t ol; bool found; int r; - void *release_cookie; /* Proceed to next data object in the field's linked list */ if (j->unique_offset == 0) { @@ -2589,10 +2447,10 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ continue; } - /* We do not use the type context here, but 0 instead, - * so that we can look at this data object at the same + /* We do not use OBJECT_DATA context here, but OBJECT_UNUSED + * instead, so that we can look at this data object at the same * time as one on another file */ - r = journal_file_move_to_object(j->unique_file, 0, j->unique_offset, &o); + r = journal_file_move_to_object(j->unique_file, OBJECT_UNUSED, j->unique_offset, &o); if (r < 0) return r; @@ -2604,10 +2462,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ return -EBADMSG; } - r = journal_file_object_keep(j->unique_file, o, j->unique_offset, &release_cookie); - if (r < 0) - return r; - r = return_data(j, j->unique_file, o, &odata, &ol); if (r < 0) return r; @@ -2652,10 +2506,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ found = true; } - r = journal_file_object_release(j->unique_file, release_cookie); - if (r < 0) - return r; - if (found) continue; diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c index b3bc3ec2f..c8e5b76c6 100644 --- a/src/journal/test-compress-benchmark.c +++ b/src/journal/test-compress-benchmark.c @@ -32,7 +32,7 @@ static char* make_buf(size_t count) { size_t i; buf = malloc(count); - assert(buf); + assert_se(buf); for (i = 0; i < count; i++) buf[i] = 'a' + i % ('z' - 'a' + 1); @@ -52,7 +52,7 @@ static void test_compress_decompress(const char* label, text = make_buf(MAX_SIZE); buf = calloc(MAX_SIZE + 1, 1); - assert(text && buf); + assert_se(text && buf); n = now(CLOCK_MONOTONIC); @@ -62,24 +62,24 @@ static void test_compress_decompress(const char* label, r = compress(text, i, buf, &j); /* assume compression must be successful except for small inputs */ - assert(r == 0 || (i < 2048 && r == -ENOBUFS)); + assert_se(r == 0 || (i < 2048 && r == -ENOBUFS)); /* check for overwrites */ - assert(buf[i] == 0); + assert_se(buf[i] == 0); if (r != 0) { skipped += i; continue; } - assert(j > 0); + assert_se(j > 0); if (j >= i) log_error("%s \"compressed\" %zu -> %zu", label, i, j); r = decompress(buf, j, &buf2, &buf2_allocated, &k, 0); - assert(r == 0); - assert(buf2_allocated >= k); - assert(k == i); + assert_se(r == 0); + assert_se(buf2_allocated >= k); + assert_se(k == i); - assert(memcmp(text, buf2, i) == 0); + assert_se(memcmp(text, buf2, i) == 0); total += i; compressed += j; diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c index 97577e827..ae41c0c4c 100644 --- a/src/journal/test-compress.c +++ b/src/journal/test-compress.c @@ -175,7 +175,7 @@ static void test_compress_stream(int compression, assert_se(lseek(dst, 0, SEEK_SET) == 0); r = decompress(dst, dst2, st.st_size); - assert(r == 0); + assert_se(r == 0); assert_se(asprintf(&cmd2, "diff %s %s", srcfile, pattern2) > 0); assert_se(system(cmd2) == 0); @@ -189,7 +189,7 @@ static void test_compress_stream(int compression, assert_se(lseek(dst, 0, SEEK_SET) == 0); assert_se(lseek(dst2, 0, SEEK_SET) == 0); r = decompress(dst, dst2, st.st_size - 1); - assert(r == -EFBIG); + assert_se(r == -EFBIG); assert_se(unlink(pattern) == 0); assert_se(unlink(pattern2) == 0); diff --git a/src/journal/test-journal-flush.c b/src/journal/test-journal-flush.c index 0ca24e0cb..914ca0b4d 100644 --- a/src/journal/test-journal-flush.c +++ b/src/journal/test-journal-flush.c @@ -22,6 +22,7 @@ #include #include "sd-journal.h" +#include "macro.h" #include "journal-file.h" #include "journal-internal.h" @@ -39,8 +40,6 @@ int main(int argc, char *argv[]) { r = journal_file_open(fn, O_CREAT|O_RDWR, 0644, false, false, NULL, NULL, NULL, &new_journal); assert_se(r >= 0); - unlink(fn); - r = sd_journal_open(&j, 0); assert_se(r >= 0); @@ -51,13 +50,13 @@ int main(int argc, char *argv[]) { JournalFile *f; f = j->current_file; - assert(f && f->current_offset > 0); + assert_se(f && f->current_offset > 0); r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o); - assert(r >= 0); + assert_se(r >= 0); r = journal_file_copy_entry(f, new_journal, o, f->current_offset, NULL, NULL, NULL); - assert(r >= 0); + assert_se(r >= 0); n++; if (n > 10000) @@ -68,6 +67,7 @@ int main(int argc, char *argv[]) { journal_file_close(new_journal); + unlink(fn); assert_se(rmdir(dn) == 0); return 0; diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c index 23a26c43f..3c706018e 100644 --- a/src/journal/test-journal-interleaving.c +++ b/src/journal/test-journal-interleaving.c @@ -212,43 +212,43 @@ static void test_sequence_numbers(void) { append_number(one, 1, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 1); + assert_se(seqnum == 1); append_number(one, 2, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 2); + assert_se(seqnum == 2); - assert(one->header->state == STATE_ONLINE); - assert(!sd_id128_equal(one->header->file_id, one->header->machine_id)); - assert(!sd_id128_equal(one->header->file_id, one->header->boot_id)); - assert(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); + assert_se(one->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(one->header->file_id, one->header->machine_id)); + assert_se(!sd_id128_equal(one->header->file_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); memcpy(&seqnum_id, &one->header->seqnum_id, sizeof(sd_id128_t)); assert_se(journal_file_open("two.journal", O_RDWR|O_CREAT, 0644, true, false, NULL, NULL, one, &two) == 0); - assert(two->header->state == STATE_ONLINE); - assert(!sd_id128_equal(two->header->file_id, one->header->file_id)); - assert(sd_id128_equal(one->header->machine_id, one->header->machine_id)); - assert(sd_id128_equal(one->header->boot_id, one->header->boot_id)); - assert(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); + assert_se(two->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(two->header->file_id, one->header->file_id)); + assert_se(sd_id128_equal(one->header->machine_id, one->header->machine_id)); + assert_se(sd_id128_equal(one->header->boot_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); append_number(two, 3, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 3); + assert_se(seqnum == 3); append_number(two, 4, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 4); + assert_se(seqnum == 4); test_close(two); append_number(one, 5, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 5); + assert_se(seqnum == 5); append_number(one, 6, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 6); + assert_se(seqnum == 6); test_close(one); @@ -258,11 +258,11 @@ static void test_sequence_numbers(void) { assert_se(journal_file_open("two.journal", O_RDWR, 0, true, false, NULL, NULL, NULL, &two) == 0); - assert(sd_id128_equal(two->header->seqnum_id, seqnum_id)); + assert_se(sd_id128_equal(two->header->seqnum_id, seqnum_id)); append_number(two, 7, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 5); + assert_se(seqnum == 5); /* So..., here we have the same seqnum in two files with the * same seqnum_id. */ diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c index 8ccd81344..3996e778e 100644 --- a/src/journal/test-journal-stream.c +++ b/src/journal/test-journal-stream.c @@ -28,13 +28,14 @@ #include "journal-internal.h" #include "util.h" #include "log.h" +#include "macro.h" #define N_ENTRIES 200 static void verify_contents(sd_journal *j, unsigned skip) { unsigned i; - assert(j); + assert_se(j); i = 0; SD_JOURNAL_FOREACH(j) { diff --git a/src/journal/test-journal.c b/src/journal/test-journal.c index ff9dc9e17..230d26596 100644 --- a/src/journal/test-journal.c +++ b/src/journal/test-journal.c @@ -66,27 +66,18 @@ static void test_non_empty(void) { #endif journal_file_dump(f); - assert_se(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1); + assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); assert_se(le64toh(o->entry.seqnum) == 1); - assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1); + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); assert_se(le64toh(o->entry.seqnum) == 2); - assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1); + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); assert_se(le64toh(o->entry.seqnum) == 3); - assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 0); + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 0); - assert_se(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_skip_entry(f, o, p, 2, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 3); - - assert_se(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1); + assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); assert_se(le64toh(o->entry.seqnum) == 1); assert_se(journal_file_find_data_object(f, test, strlen(test), NULL, &p) == 1); diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c index 1227b6231..3fcd77475 100644 --- a/src/journal/test-mmap-cache.c +++ b/src/journal/test-mmap-cache.c @@ -49,23 +49,23 @@ int main(int argc, char *argv[]) { assert_se(z >= 0); unlink(pz); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p); assert_se(r >= 0); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 1 == (uint8_t*) q); - r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 2 == (uint8_t*) q); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p); assert_se(r >= 0); - r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 1 == (uint8_t*) q); diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c new file mode 100644 index 000000000..419a45043 --- /dev/null +++ b/src/libsystemd-network/dhcp-identifier.c @@ -0,0 +1,100 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "sd-id128.h" +#include "libudev.h" +#include "udev-util.h" + +#include "virt.h" +#include "sparse-endian.h" +#include "siphash24.h" +#include "util.h" + +#include "dhcp6-protocol.h" +#include "dhcp-identifier.h" +#include "network-internal.h" + +#define SYSTEMD_PEN 43793 +#define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09) + +int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len) { + sd_id128_t machine_id; + int r; + + assert(duid); + assert(len); + + r = sd_id128_get_machine(&machine_id); + if (r < 0) + return r; + + duid->type = htobe16(DHCP6_DUID_EN); + duid->en.pen = htobe32(SYSTEMD_PEN); + *len = sizeof(duid->type) + sizeof(duid->en); + + /* a bit of snake-oil perhaps, but no need to expose the machine-id + directly */ + siphash24(duid->en.id, &machine_id, sizeof(machine_id), HASH_KEY.bytes); + + return 0; +} + + +int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t *_id) { + /* name is a pointer to memory in the udev_device struct, so must + have the same scope */ + _cleanup_udev_device_unref_ struct udev_device *device = NULL; + const char *name = NULL; + uint64_t id; + + if (detect_container(NULL) <= 0) { + /* not in a container, udev will be around */ + _cleanup_udev_unref_ struct udev *udev; + char ifindex_str[2 + DECIMAL_STR_MAX(int)]; + + udev = udev_new(); + if (!udev) + return -ENOMEM; + + sprintf(ifindex_str, "n%d", ifindex); + device = udev_device_new_from_device_id(udev, ifindex_str); + if (device) { + if (udev_device_get_is_initialized(device) <= 0) + /* not yet ready */ + return -EBUSY; + + name = net_get_name(device); + } + } + + if (name) + siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes); + else + /* fall back to MAC address if no predictable name available */ + siphash24((uint8_t*)&id, mac, mac_len, HASH_KEY.bytes); + + /* fold into 32 bits */ + *_id = (id & 0xffffffff) ^ (id >> 32); + + return 0; +} diff --git a/src/libsystemd-network/dhcp-identifier.h b/src/libsystemd-network/dhcp-identifier.h new file mode 100644 index 000000000..7f44d2549 --- /dev/null +++ b/src/libsystemd-network/dhcp-identifier.h @@ -0,0 +1,65 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright (C) 2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "macro.h" +#include "sparse-endian.h" +#include "sd-id128.h" + +/* RFC 3315 section 9.1: + * A DUID can be no more than 128 octets long (not including the type code). + */ +#define MAX_DUID_LEN 128 + +struct duid { + uint16_t type; + union { + struct { + /* DHCP6_DUID_LLT */ + uint16_t htype; + uint32_t time; + uint8_t haddr[0]; + } _packed_ llt; + struct { + /* DHCP6_DUID_EN */ + uint32_t pen; + uint8_t id[8]; + } _packed_ en; + struct { + /* DHCP6_DUID_LL */ + int16_t htype; + uint8_t haddr[0]; + } _packed_ ll; + struct { + /* DHCP6_DUID_UUID */ + sd_id128_t uuid; + } _packed_ uuid; + struct { + uint8_t data[MAX_DUID_LEN]; + } _packed_ raw; + }; +} _packed_; + +int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len); +int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t *_id); diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c index 29e9993f6..5f2d2cfbf 100644 --- a/src/libsystemd-network/dhcp-network.c +++ b/src/libsystemd-network/dhcp-network.c @@ -63,7 +63,7 @@ static int _bind_raw_socket(int ifindex, union sockaddr_union *link, BPF_STMT(BPF_LD + BPF_B + BPF_ABS, offsetof(DHCPPacket, dhcp.htype)), /* A <- DHCP header type */ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, arp_type, 1, 0), /* header type == arp_type ? */ BPF_STMT(BPF_RET + BPF_K, 0), /* ignore */ - BPF_STMT(BPF_LD + BPF_B + BPF_ABS, offsetof(DHCPPacket, dhcp.hlen)), /* A <- mac address length */ + BPF_STMT(BPF_LD + BPF_B + BPF_ABS, offsetof(DHCPPacket, dhcp.hlen)), /* A <- MAC address length */ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, dhcp_hlen, 1, 0), /* address length == dhcp_hlen ? */ BPF_STMT(BPF_RET + BPF_K, 0), /* ignore */ BPF_STMT(BPF_LD + BPF_W + BPF_ABS, offsetof(DHCPPacket, dhcp.xid)), /* A <- client identifier */ diff --git a/src/libsystemd-network/dhcp-server-internal.h b/src/libsystemd-network/dhcp-server-internal.h index eb7d6d44d..58750c441 100644 --- a/src/libsystemd-network/dhcp-server-internal.h +++ b/src/libsystemd-network/dhcp-server-internal.h @@ -20,6 +20,8 @@ along with systemd; If not, see . ***/ +#pragma once + #include "sd-event.h" #include "sd-dhcp-server.h" diff --git a/src/libsystemd-network/lldp-internal.c b/src/libsystemd-network/lldp-internal.c new file mode 100644 index 000000000..c6a989aac --- /dev/null +++ b/src/libsystemd-network/lldp-internal.c @@ -0,0 +1,533 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "lldp-internal.h" + +/* We store maximum 1K chassis entries */ +#define LLDP_MIB_MAX_CHASSIS 1024 + +/* Maximum Ports can be attached to any chassis */ +#define LLDP_MIB_MAX_PORT_PER_CHASSIS 32 + +int lldp_read_chassis_id(tlv_packet *tlv, + uint8_t *type, + uint16_t *length, + uint8_t **data) { + uint8_t subtype; + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_CHASSIS_ID); + if (r < 0) + goto out2; + + r = tlv_packet_read_u8(tlv, &subtype); + if (r < 0) + goto out1; + + switch (subtype) { + case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS: + + r = tlv_packet_read_bytes(tlv, data, length); + if (r < 0) + goto out1; + + break; + default: + r = -ENOTSUP; + break; + } + + *type = subtype; + + out1: + (void)lldp_tlv_packet_exit_container(tlv); + + out2: + return r; +} + +int lldp_read_port_id(tlv_packet *tlv, + uint8_t *type, + uint16_t *length, + uint8_t **data) { + uint8_t subtype; + char *s; + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_PORT_ID); + if (r < 0) + goto out2; + + r = tlv_packet_read_u8(tlv, &subtype); + if (r < 0) + goto out1; + + switch (subtype) { + case LLDP_PORT_SUBTYPE_PORT_COMPONENT: + case LLDP_PORT_SUBTYPE_INTERFACE_ALIAS: + case LLDP_PORT_SUBTYPE_INTERFACE_NAME: + case LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED: + + r = tlv_packet_read_string(tlv, &s, length); + if (r < 0) + goto out1; + + *data = (uint8_t *) s; + + break; + case LLDP_PORT_SUBTYPE_MAC_ADDRESS: + + r = tlv_packet_read_bytes(tlv, data, length); + if (r < 0) + goto out1; + + break; + default: + r = -ENOTSUP; + break; + } + + *type = subtype; + + out1: + (void)lldp_tlv_packet_exit_container(tlv); + + out2: + return r; +} + +int lldp_read_ttl(tlv_packet *tlv, uint16_t *ttl) { + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_TTL); + if (r < 0) + goto out; + + r = tlv_packet_read_u16(tlv, ttl); + + (void)lldp_tlv_packet_exit_container(tlv); + + out: + return r; +} + +int lldp_read_system_name(tlv_packet *tlv, + uint16_t *length, + char **data) { + char *s; + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_SYSTEM_NAME); + if (r < 0) + return r; + + r = tlv_packet_read_string(tlv, &s, length); + if (r < 0) + goto out; + + *data = (char *) s; + + out: + (void)lldp_tlv_packet_exit_container(tlv); + + return r; +} + +int lldp_read_system_description(tlv_packet *tlv, + uint16_t *length, + char **data) { + char *s; + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_SYSTEM_DESCRIPTION); + if (r < 0) + return r; + + r = tlv_packet_read_string(tlv, &s, length); + if (r < 0) + goto out; + + *data = (char *) s; + + out: + (void)lldp_tlv_packet_exit_container(tlv); + + return r; +} + +int lldp_read_port_description(tlv_packet *tlv, + uint16_t *length, + char **data) { + char *s; + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_PORT_DESCRIPTION); + if (r < 0) + return r; + + r = tlv_packet_read_string(tlv, &s, length); + if (r < 0) + goto out; + + *data = (char *) s; + + out: + (void)lldp_tlv_packet_exit_container(tlv); + + return r; +} + +int lldp_read_system_capability(tlv_packet *tlv, uint16_t *data) { + int r; + + assert_return(tlv, -EINVAL); + + r = lldp_tlv_packet_enter_container(tlv, LLDP_TYPE_SYSTEM_CAPABILITIES); + if (r < 0) + return r; + + r = tlv_packet_read_u16(tlv, data); + if (r < 0) + goto out; + + return 0; + out: + + (void)lldp_tlv_packet_exit_container(tlv); + + return r; +} + +/* 10.5.5.2.2 mibUpdateObjects () + * The mibUpdateObjects () procedure updates the MIB objects corresponding to + * the TLVs contained in the received LLDPDU for the LLDP remote system + * indicated by the LLDP remote systems update process defined in 10.3.5 */ + +int lldp_mib_update_objects(lldp_chassis *c, tlv_packet *tlv) { + lldp_neighbour_port *p; + uint16_t length, ttl; + uint8_t *data; + uint8_t type; + int r; + + assert_return(c, -EINVAL); + assert_return(tlv, -EINVAL); + + r = lldp_read_port_id(tlv, &type, &length, &data); + if (r < 0) + return r; + + /* Update the packet if we already have */ + LIST_FOREACH(port, p, c->ports) { + + if ((p->type == type && p->length == length && !memcmp(p->data, data, p->length))) { + + r = lldp_read_ttl(tlv, &ttl); + if (r < 0) + return r; + + p->until = ttl * USEC_PER_SEC + now(clock_boottime_or_monotonic()); + + tlv_packet_free(p->packet); + p->packet = tlv; + + prioq_reshuffle(p->c->by_expiry, p, &p->prioq_idx); + + return 0; + } + } + + return -1; +} + +int lldp_mib_remove_objects(lldp_chassis *c, tlv_packet *tlv) { + lldp_neighbour_port *p, *q; + uint8_t *data; + uint16_t length; + uint8_t type; + int r; + + assert_return(c, -EINVAL); + assert_return(tlv, -EINVAL); + + r = lldp_read_port_id(tlv, &type, &length, &data); + if (r < 0) + return r; + + LIST_FOREACH_SAFE(port, p, q, c->ports) { + + /* Find the port */ + if (p->type == type && p->length == length && !memcmp(p->data, data, p->length)) { + lldp_neighbour_port_remove_and_free(p); + break; + } + } + + return 0; +} + +int lldp_mib_add_objects(Prioq *by_expiry, + Hashmap *neighbour_mib, + tlv_packet *tlv) { + _cleanup_lldp_neighbour_port_free_ lldp_neighbour_port *p = NULL; + _cleanup_lldp_chassis_free_ lldp_chassis *c = NULL; + lldp_chassis_id chassis_id; + bool new_chassis = false; + uint8_t subtype, *data; + uint16_t ttl, length; + int r; + + assert_return(by_expiry, -EINVAL); + assert_return(neighbour_mib, -EINVAL); + assert_return(tlv, -EINVAL); + + r = lldp_read_chassis_id(tlv, &subtype, &length, &data); + if (r < 0) + goto drop; + + r = lldp_read_ttl(tlv, &ttl); + if (r < 0) + goto drop; + + /* Make hash key */ + chassis_id.type = subtype; + chassis_id.length = length; + chassis_id.data = data; + + /* Try to find the Chassis */ + c = hashmap_get(neighbour_mib, &chassis_id); + if (!c) { + + /* Don't create chassis if ttl 0 is received . Silently drop it */ + if (ttl == 0) { + log_lldp("TTL value 0 received. Skiping Chassis creation."); + goto drop; + } + + /* Admission Control: Can we store this packet ? */ + if (hashmap_size(neighbour_mib) >= LLDP_MIB_MAX_CHASSIS) { + + log_lldp("Exceeding number of chassie: %d. Dropping ...", + hashmap_size(neighbour_mib)); + goto drop; + } + + r = lldp_chassis_new(tlv, by_expiry, neighbour_mib, &c); + if (r < 0) + goto drop; + + new_chassis = true; + + r = hashmap_put(neighbour_mib, &c->chassis_id, c); + if (r < 0) + goto drop; + + } else { + + /* When the TTL field is set to zero, the receiving LLDP agent is notified all + * system information associated with the LLDP agent/port is to be deleted */ + if (ttl == 0) { + log_lldp("TTL value 0 received . Deleting associated Port ..."); + + lldp_mib_remove_objects(c, tlv); + + c = NULL; + goto drop; + } + + /* if we already have this port just update it */ + r = lldp_mib_update_objects(c, tlv); + if (r >= 0) { + c = NULL; + return r; + } + + /* Admission Control: Can this port attached to the existing chassis ? */ + if (REFCNT_GET(c->n_ref) >= LLDP_MIB_MAX_PORT_PER_CHASSIS) { + log_lldp("Port limit reached. Chassis has: %d ports. Dropping ...", + REFCNT_GET(c->n_ref)); + + c = NULL; + goto drop; + } + } + + /* This is a new port */ + r = lldp_neighbour_port_new(c, tlv, &p); + if (r < 0) + goto drop; + + r = prioq_put(c->by_expiry, p, &p->prioq_idx); + if (r < 0) + goto drop; + + /* Attach new port to chassis */ + LIST_PREPEND(port, c->ports, p); + REFCNT_INC(c->n_ref); + + p = NULL; + c = NULL; + + return 0; + + drop: + tlv_packet_free(tlv); + + if (new_chassis) + hashmap_remove(neighbour_mib, &c->chassis_id); + + return r; +} + +void lldp_neighbour_port_remove_and_free(lldp_neighbour_port *p) { + lldp_chassis *c; + + assert(p); + assert(p->c); + + c = p->c; + + prioq_remove(c->by_expiry, p, &p->prioq_idx); + + LIST_REMOVE(port, c->ports, p); + lldp_neighbour_port_free(p); + + /* Drop the Chassis if no port is attached */ + if (REFCNT_DEC(c->n_ref) <= 1) { + hashmap_remove(c->neighbour_mib, &c->chassis_id); + lldp_chassis_free(c); + } +} + +void lldp_neighbour_port_free(lldp_neighbour_port *p) { + + if(!p) + return; + + tlv_packet_free(p->packet); + + free(p->data); + free(p); +} + +int lldp_neighbour_port_new(lldp_chassis *c, + tlv_packet *tlv, + lldp_neighbour_port **ret) { + _cleanup_lldp_neighbour_port_free_ lldp_neighbour_port *p = NULL; + uint16_t length, ttl; + uint8_t *data; + uint8_t type; + int r; + + assert(tlv); + + r = lldp_read_port_id(tlv, &type, &length, &data); + if (r < 0) + return r; + + r = lldp_read_ttl(tlv, &ttl); + if (r < 0) + return r; + + p = new0(lldp_neighbour_port, 1); + if (!p) + return -ENOMEM; + + p->c = c; + p->type = type; + p->length = length; + p->packet = tlv; + p->prioq_idx = PRIOQ_IDX_NULL; + p->until = ttl * USEC_PER_SEC + now(clock_boottime_or_monotonic()); + + p->data = memdup(data, length); + if (!p->data) + return -ENOMEM; + + *ret = p; + p = NULL; + + return 0; +} + +void lldp_chassis_free(lldp_chassis *c) { + + if (!c) + return; + + if (REFCNT_GET(c->n_ref) > 1) + return; + + free(c->chassis_id.data); + free(c); +} + +int lldp_chassis_new(tlv_packet *tlv, + Prioq *by_expiry, + Hashmap *neighbour_mib, + lldp_chassis **ret) { + _cleanup_lldp_chassis_free_ lldp_chassis *c = NULL; + uint16_t length; + uint8_t *data; + uint8_t type; + int r; + + assert(tlv); + + r = lldp_read_chassis_id(tlv, &type, &length, &data); + if (r < 0) + return r; + + c = new0(lldp_chassis, 1); + if (!c) + return -ENOMEM; + + c->n_ref = REFCNT_INIT; + c->chassis_id.type = type; + c->chassis_id.length = length; + + c->chassis_id.data = memdup(data, length); + if (!c->chassis_id.data) + return -ENOMEM; + + LIST_HEAD_INIT(c->ports); + + c->by_expiry = by_expiry; + c->neighbour_mib = neighbour_mib; + + *ret = c; + c = NULL; + + return 0; +} diff --git a/src/libsystemd-network/lldp-internal.h b/src/libsystemd-network/lldp-internal.h new file mode 100644 index 000000000..8e09ee8f3 --- /dev/null +++ b/src/libsystemd-network/lldp-internal.h @@ -0,0 +1,99 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include "log.h" +#include "list.h" +#include "refcnt.h" +#include "lldp-tlv.h" +#include "prioq.h" + +typedef struct lldp_neighbour_port lldp_neighbour_port; +typedef struct lldp_chassis lldp_chassis; +typedef struct lldp_chassis_id lldp_chassis_id; +typedef struct lldp_agent_statistics lldp_agent_statistics; + +struct lldp_neighbour_port { + uint8_t type; + uint8_t *data; + + uint16_t length; + usec_t until; + + unsigned prioq_idx; + + lldp_chassis *c; + tlv_packet *packet; + + LIST_FIELDS(lldp_neighbour_port, port); +}; + +int lldp_neighbour_port_new(lldp_chassis *c, tlv_packet *tlv, lldp_neighbour_port **ret); +void lldp_neighbour_port_free(lldp_neighbour_port *p); +void lldp_neighbour_port_remove_and_free(lldp_neighbour_port *p); + +DEFINE_TRIVIAL_CLEANUP_FUNC(lldp_neighbour_port *, lldp_neighbour_port_free); +#define _cleanup_lldp_neighbour_port_free_ _cleanup_(lldp_neighbour_port_freep) + +struct lldp_chassis_id { + uint8_t type; + uint16_t length; + + uint8_t *data; +}; + +struct lldp_chassis { + RefCount n_ref; + + lldp_chassis_id chassis_id; + + Prioq *by_expiry; + Hashmap *neighbour_mib; + + LIST_HEAD(lldp_neighbour_port, ports); +}; + +int lldp_chassis_new(tlv_packet *tlv, + Prioq *by_expiry, + Hashmap *neighbour_mib, + lldp_chassis **ret); + +void lldp_chassis_free(lldp_chassis *c); + +DEFINE_TRIVIAL_CLEANUP_FUNC(lldp_chassis *, lldp_chassis_free); +#define _cleanup_lldp_chassis_free_ _cleanup_(lldp_chassis_freep) + +int lldp_mib_update_objects(lldp_chassis *c, tlv_packet *tlv); +int lldp_mib_add_objects(Prioq *by_expiry, Hashmap *neighbour_mib, tlv_packet *tlv); +int lldp_mib_remove_objects(lldp_chassis *c, tlv_packet *tlv); + +int lldp_read_chassis_id(tlv_packet *tlv, uint8_t *type, uint16_t *length, uint8_t **data); +int lldp_read_port_id(tlv_packet *tlv, uint8_t *type, uint16_t *length, uint8_t **data); +int lldp_read_ttl(tlv_packet *tlv, uint16_t *ttl); +int lldp_read_system_name(tlv_packet *tlv, uint16_t *length, char **data); +int lldp_read_system_description(tlv_packet *tlv, uint16_t *length, char **data); +int lldp_read_system_capability(tlv_packet *tlv, uint16_t *data); +int lldp_read_port_description(tlv_packet *tlv, uint16_t *length, char **data); + +int lldp_handle_packet(tlv_packet *m, uint16_t length); +#define log_lldp(fmt, ...) log_internal(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__) diff --git a/src/libsystemd-network/lldp-network.c b/src/libsystemd-network/lldp-network.c new file mode 100644 index 000000000..a2bc7d551 --- /dev/null +++ b/src/libsystemd-network/lldp-network.c @@ -0,0 +1,112 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "socket-util.h" +#include "lldp-tlv.h" +#include "lldp-network.h" +#include "lldp-internal.h" +#include "sd-lldp.h" + +int lldp_network_bind_raw_socket(int ifindex) { + typedef struct LLDPFrame { + struct ethhdr hdr; + uint8_t tlvs[0]; + } LLDPFrame; + + struct sock_filter filter[] = { + BPF_STMT(BPF_LD + BPF_W + BPF_ABS, offsetof(LLDPFrame, hdr.h_dest)), /* A <- 4 bytes of destination MAC */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x0180c200, 1, 0), /* A != 01:80:c2:00 */ + BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */ + BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(LLDPFrame, hdr.h_dest) + 4), /* A <- remaining 2 bytes of destination MAC */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x0000, 3, 0), /* A != 00:00 */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x0003, 2, 0), /* A != 00:03 */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x000e, 1, 0), /* A != 00:0e */ + BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */ + BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(LLDPFrame, hdr.h_proto)), /* A <- protocol */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_LLDP, 1, 0), /* A != ETHERTYPE_LLDP */ + BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */ + BPF_STMT(BPF_RET + BPF_K, (uint32_t) -1), /* accept packet */ + }; + + struct sock_fprog fprog = { + .len = ELEMENTSOF(filter), + .filter = filter + }; + + _cleanup_close_ int s = -1; + + union sockaddr_union saddrll = { + .ll.sll_family = AF_PACKET, + .ll.sll_ifindex = ifindex, + }; + + int r; + + assert(ifindex > 0); + + s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (s < 0) + return -errno; + + r = setsockopt(s, SOL_SOCKET, SO_ATTACH_FILTER, &fprog, sizeof(fprog)); + if (r < 0) + return -errno; + + r = bind(s, &saddrll.sa, sizeof(saddrll.ll)); + if (r < 0) + return -errno; + + r = s; + s = -1; + + return r; +} + +int lldp_receive_packet(sd_event_source *s, int fd, uint32_t revents, void *userdata) { + _cleanup_tlv_packet_free_ tlv_packet *packet = NULL; + tlv_packet *p; + uint16_t length; + int r; + + assert(fd); + assert(userdata); + + r = tlv_packet_new(&packet); + if (r < 0) + return r; + + length = read(fd, &packet->pdu, sizeof(packet->pdu)); + + /* Silently drop the packet */ + if ((size_t) length > ETHER_MAX_LEN) + return 0; + + packet->userdata = userdata; + + p = packet; + packet = NULL; + + return lldp_handle_packet(p, (uint16_t) length); +} diff --git a/src/libsystemd-network/lldp-network.h b/src/libsystemd-network/lldp-network.h new file mode 100644 index 000000000..b7f8d3bf8 --- /dev/null +++ b/src/libsystemd-network/lldp-network.h @@ -0,0 +1,28 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include "sd-event.h" + +int lldp_network_bind_raw_socket(int ifindex); +int lldp_receive_packet(sd_event_source *s, int fd, uint32_t revents, void *userdata); diff --git a/src/libsystemd-network/lldp-port.c b/src/libsystemd-network/lldp-port.c new file mode 100644 index 000000000..aa6a3b922 --- /dev/null +++ b/src/libsystemd-network/lldp-port.c @@ -0,0 +1,116 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "async.h" +#include "lldp-port.h" +#include "lldp-network.h" + +int lldp_port_start(lldp_port *p) { + int r; + + assert_return(p, -EINVAL); + + r = lldp_network_bind_raw_socket(p->ifindex); + if (r < 0) + return r; + + p->rawfd = r; + + r = sd_event_add_io(p->event, &p->lldp_port_rx, + p->rawfd, EPOLLIN, lldp_receive_packet, p); + if (r < 0) { + log_debug("Failed to allocate event source: %s", strerror(-r)); + return r; + } + + r = sd_event_source_set_priority(p->lldp_port_rx, p->event_priority); + if (r < 0) { + log_debug("Failed to set event priority: %s", strerror(-r)); + goto fail; + } + + r = sd_event_source_set_description(p->lldp_port_rx, "lldp-port-rx"); + if (r < 0) { + log_debug("Failed to set event name: %s", strerror(-r)); + goto fail; + } + + return 0; + +fail: + lldp_port_stop(p); + + return r; +} + +int lldp_port_stop(lldp_port *p) { + + assert_return(p, -EINVAL); + + p->rawfd = asynchronous_close(p->rawfd); + p->lldp_port_rx = sd_event_source_unref(p->lldp_port_rx); + + return 0; +} + +void lldp_port_free(lldp_port *p) { + if (!p) + return; + + lldp_port_stop(p); + + free(p->ifname); + free(p); +} + +int lldp_port_new(int ifindex, + const char *ifname, + const struct ether_addr *addr, + void *userdata, + lldp_port **ret) { + _cleanup_free_ lldp_port *p = NULL; + + assert_return(ifindex, -EINVAL); + assert_return(ifname, -EINVAL); + assert_return(addr, -EINVAL); + + p = new0(lldp_port, 1); + if (!p) + return -ENOMEM; + + p->rawfd = -1; + p->ifindex = ifindex; + + p->ifname = strdup(ifname); + if (!p->ifname) + return -ENOMEM; + + memcpy(&p->mac, addr, ETH_ALEN); + + p->userdata = userdata; + + *ret = p; + + p = NULL; + + return 0; +} diff --git a/src/libsystemd-network/lldp-port.h b/src/libsystemd-network/lldp-port.h new file mode 100644 index 000000000..b2d318009 --- /dev/null +++ b/src/libsystemd-network/lldp-port.h @@ -0,0 +1,63 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include + +#include "sd-event.h" +#include "sd-lldp.h" + +#include "util.h" + +typedef struct lldp_port lldp_port; + +struct lldp_port { + LLDPPortStatus status; + + int ifindex; + char *ifname; + + struct ether_addr mac; + + int rawfd; + + sd_event *event; + sd_event_source *lldp_port_rx; + + int event_priority; + + void *userdata; +}; + +int lldp_port_new(int ifindex, + const char *ifname, + const struct ether_addr *addr, + void *userdata, + lldp_port **ret); +void lldp_port_free(lldp_port *p); + +DEFINE_TRIVIAL_CLEANUP_FUNC(lldp_port*, lldp_port_free); +#define _cleanup_lldp_port_free_ _cleanup_(lldp_port_freep) + +int lldp_port_start(lldp_port *p); +int lldp_port_stop(lldp_port *p); diff --git a/src/libsystemd-network/lldp-tlv.c b/src/libsystemd-network/lldp-tlv.c new file mode 100644 index 000000000..e43d70d3c --- /dev/null +++ b/src/libsystemd-network/lldp-tlv.c @@ -0,0 +1,321 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "macro.h" +#include "lldp-tlv.h" + +int tlv_section_new(tlv_section **ret) { + tlv_section *s; + + s = new0(tlv_section, 1); + if (!s) + return -ENOMEM; + + *ret = s; + + return 0; +} + +void tlv_section_free(tlv_section *m) { + + if (!m) + return; + + free(m); +} + +int tlv_packet_new(tlv_packet **ret) { + tlv_packet *m; + + m = new0(tlv_packet, 1); + if (!m) + return -ENOMEM; + + LIST_HEAD_INIT(m->sections); + + *ret = m; + + return 0; +} + +void tlv_packet_free(tlv_packet *m) { + tlv_section *s, *n; + + if (!m) + return; + + LIST_FOREACH_SAFE(section, s, n, m->sections) + tlv_section_free(s); + + free(m); +} + +int tlv_packet_append_bytes(tlv_packet *m, const void *data, size_t data_length) { + uint8_t *p; + + assert_return(m, -EINVAL); + assert_return(data, -EINVAL); + assert_return(data_length, -EINVAL); + + if (m->length + data_length > ETHER_MAX_LEN) + return -ENOMEM; + + p = m->pdu + m->length; + memcpy(p, data, data_length); + m->length += data_length; + + return 0; +} + +int tlv_packet_append_u8(tlv_packet *m, uint8_t data) { + + assert_return(m, -EINVAL); + + return tlv_packet_append_bytes(m, &data, sizeof(uint8_t)); +} + +int tlv_packet_append_u16(tlv_packet *m, uint16_t data) { + uint16_t type; + + assert_return(m, -EINVAL); + + type = htons(data); + + return tlv_packet_append_bytes(m, &type, sizeof(uint16_t)); +} + +int tlv_packet_append_u32(tlv_packet *m, uint32_t data) { + uint32_t type; + + assert_return(m, -EINVAL); + + type = htonl(data); + + return tlv_packet_append_bytes(m, &type, sizeof(uint32_t)); +} + +int tlv_packet_append_string(tlv_packet *m, char *data, uint16_t size) { + + assert_return(m, -EINVAL); + + return tlv_packet_append_bytes(m, data, size); +} + +int lldp_tlv_packet_open_container(tlv_packet *m, uint16_t type) { + + assert_return(m, -EINVAL); + + m->container_pos = m->pdu + m->length; + + return tlv_packet_append_u16(m, type << 9); +} + +int lldp_tlv_packet_close_container(tlv_packet *m) { + uint16_t type; + + assert_return(m, -EINVAL); + assert_return(m->container_pos, -EINVAL); + + memcpy(&type, m->container_pos, sizeof(uint16_t)); + + type |= htons(((m->pdu + m->length) - (m->container_pos + 2)) & 0x01ff); + memcpy(m->container_pos, &type, sizeof(uint16_t)); + + return 0; +} + +static inline int tlv_packet_read_internal(tlv_section *m, void **data) { + + assert_return(m->read_pos, -EINVAL); + + *data = m->read_pos; + + return 0; +} + +int tlv_packet_read_u8(tlv_packet *m, uint8_t *data) { + void *val; + int r; + + assert_return(m, -EINVAL); + + r = tlv_packet_read_internal(m->container, &val); + if (r < 0) + return r; + + memcpy(data, val, sizeof(uint8_t)); + + m->container->read_pos ++; + + return 0; +} + +int tlv_packet_read_u16(tlv_packet *m, uint16_t *data) { + uint16_t t; + void *val; + int r; + + assert_return(m, -EINVAL); + + r = tlv_packet_read_internal(m->container, &val); + if (r < 0) + return r; + + memcpy(&t, val, sizeof(uint16_t)); + *data = ntohs(t); + + m->container->read_pos += 2; + + return 0; +} + +int tlv_packet_read_u32(tlv_packet *m, uint32_t *data) { + uint32_t t; + void *val; + int r; + + assert_return(m, -EINVAL); + + r = tlv_packet_read_internal(m->container, &val); + if (r < 0) + return r; + + memcpy(&t, val, sizeof(uint32_t)); + *data = ntohl(t); + + m->container->read_pos += 4; + + return r; +} + +int tlv_packet_read_string(tlv_packet *m, char **data, uint16_t *data_length) { + void *val; + int r; + + assert_return(m, -EINVAL); + + r = tlv_packet_read_internal(m->container, &val); + if (r < 0) + return r; + + *data = (char *) val; + *data_length = m->container->length; + + m->container->read_pos += m->container->length; + + return 0; +} + +int tlv_packet_read_bytes(tlv_packet *m, uint8_t **data, uint16_t *data_length) { + void *val; + int r; + + assert_return(m, -EINVAL); + + r = tlv_packet_read_internal(m->container, &val); + if (r < 0) + return r; + + *data = (uint8_t *) val; + *data_length = m->container->length; + + m->container->read_pos += m->container->length; + + return 0; +} + +/* parse raw TLV packet */ +int tlv_packet_parse_pdu(tlv_packet *m, uint16_t size) { + tlv_section *section, *tail; + uint16_t t, l; + uint8_t *p; + int r; + + assert_return(m, -EINVAL); + assert_return(size, -EINVAL); + + p = m->pdu; + + /* extract ethernet herader */ + memcpy(&m->mac, p, ETH_ALEN); + p += sizeof(struct ether_header); + + for (l = 0; l <= size; ) { + r = tlv_section_new(§ion); + if (r < 0) + return r; + + memcpy(&t, p, sizeof(uint16_t)); + + section->type = ntohs(t) >> 9; + section->length = ntohs(t) & 0x01ff; + + if (section->type == LLDP_TYPE_END || section->type >=_LLDP_TYPE_MAX) { + tlv_section_free(section); + break; + } + + p += 2; + section->data = p; + + LIST_FIND_TAIL(section, m->sections, tail); + LIST_INSERT_AFTER(section, m->sections, tail, section); + + p += section->length; + l += (section->length + 2); + } + + return 0; +} + +int lldp_tlv_packet_enter_container(tlv_packet *m, uint16_t type) { + tlv_section *s; + + assert_return(m, -EINVAL); + + LIST_FOREACH(section, s, m->sections) + if (s->type == type) + break; + if (!s) + return -1; + + m->container = s; + + m->container->read_pos = s->data; + if (!m->container->read_pos) { + m->container = 0; + return -1; + } + + return 0; +} + +int lldp_tlv_packet_exit_container(tlv_packet *m) { + assert_return(m, -EINVAL); + + m->container = 0; + + return 0; +} diff --git a/src/libsystemd-network/lldp-tlv.h b/src/libsystemd-network/lldp-tlv.h new file mode 100644 index 000000000..ce3334e11 --- /dev/null +++ b/src/libsystemd-network/lldp-tlv.h @@ -0,0 +1,87 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include + +#include "util.h" +#include "lldp.h" +#include "list.h" + +typedef struct tlv_packet tlv_packet; +typedef struct tlv_section tlv_section; + +struct tlv_section { + uint16_t type; + uint16_t length; + + uint8_t *read_pos; + uint8_t *data; + + LIST_FIELDS(tlv_section, section); +}; + +int tlv_section_new(tlv_section **ret); +void tlv_section_free(tlv_section *ret); + +struct tlv_packet { + uint16_t type; + uint16_t length; + usec_t ts; + + uint8_t *container_pos; + uint8_t pdu[ETHER_MAX_LEN]; + + void *userdata; + + struct ether_addr mac; + tlv_section *container; + + LIST_HEAD(tlv_section, sections); +}; + +int tlv_packet_new(tlv_packet **ret); +void tlv_packet_free(tlv_packet *m); + +DEFINE_TRIVIAL_CLEANUP_FUNC(tlv_packet*, tlv_packet_free); +#define _cleanup_tlv_packet_free_ _cleanup_(tlv_packet_freep) + +int lldp_tlv_packet_open_container(tlv_packet *m, uint16_t type); +int lldp_tlv_packet_close_container(tlv_packet *m); + +int tlv_packet_append_bytes(tlv_packet *m, const void *data, size_t data_length); +int tlv_packet_append_u8(tlv_packet *m, uint8_t data); +int tlv_packet_append_u16(tlv_packet *m, uint16_t data); +int tlv_packet_append_u32(tlv_packet *m, uint32_t data); +int tlv_packet_append_string(tlv_packet *m, char *data, uint16_t size); + +int lldp_tlv_packet_enter_container(tlv_packet *m, uint16_t type); +int lldp_tlv_packet_exit_container(tlv_packet *m); + +int tlv_packet_read_bytes(tlv_packet *m, uint8_t **data, uint16_t *data_length); +int tlv_packet_read_string(tlv_packet *m, char **data, uint16_t *data_length); +int tlv_packet_read_u8(tlv_packet *m, uint8_t *data); +int tlv_packet_read_u16(tlv_packet *m, uint16_t *data); +int tlv_packet_read_u32(tlv_packet *m, uint32_t *data); + +int tlv_packet_parse_pdu(tlv_packet *t, uint16_t size); diff --git a/src/libsystemd-network/lldp-util.h b/src/libsystemd-network/lldp-util.h new file mode 100644 index 000000000..112001e4b --- /dev/null +++ b/src/libsystemd-network/lldp-util.h @@ -0,0 +1,26 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +DEFINE_TRIVIAL_CLEANUP_FUNC(sd_lldp *, sd_lldp_free); +#define _cleanup_lldp_free_ _cleanup_(sd_lldp_freep) diff --git a/src/libsystemd-network/lldp.h b/src/libsystemd-network/lldp.h new file mode 100644 index 000000000..5e4b283e2 --- /dev/null +++ b/src/libsystemd-network/lldp.h @@ -0,0 +1,115 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#define LLDP_MULTICAST_ADDR { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } + +#define ETHERTYPE_LLDP 0x88cc + +/* IEEE 802.3AB Clause 9: TLV Types */ +typedef enum LLDPTypes { + LLDP_TYPE_END = 0, + LLDP_TYPE_CHASSIS_ID = 1, + LLDP_TYPE_PORT_ID = 2, + LLDP_TYPE_TTL = 3, + LLDP_TYPE_PORT_DESCRIPTION = 4, + LLDP_TYPE_SYSTEM_NAME = 5, + LLDP_TYPE_SYSTEM_DESCRIPTION = 6, + LLDP_TYPE_SYSTEM_CAPABILITIES = 7, + LLDP_TYPE_MGMT_ADDRESS = 8, + LLDP_TYPE_PRIVATE = 127, + _LLDP_TYPE_MAX, + _LLDP_TYPE_INVALID = -1, +} LLDPTypes; + +/* IEEE 802.3AB Clause 9.5.2: Chassis subtypes */ +typedef enum LLDPChassisSubtypes { + LLDP_CHASSIS_SUBTYPE_RESERVED = 0, + LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT = 1, + LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS = 2, + LLDP_CHASSIS_SUBTYPE_PORT_COMPONENT = 3, + LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS = 4, + LLDP_CHASSIS_SUBTYPE_NETWORK_ADDRESS = 5, + LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME = 6, + LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED = 7, + _LLDP_CHASSIS_SUBTYPE_MAX, + _LLDP_CHASSIS_SUBTYPE_INVALID = -1, +} LLDPChassisSubtypes; + +/* IEEE 802.3AB Clause 9.5.3: Port subtype */ +typedef enum LLDPPortSubtypes { + LLDP_PORT_SUBTYPE_RESERVED = 0, + LLDP_PORT_SUBTYPE_INTERFACE_ALIAS = 1, + LLDP_PORT_SUBTYPE_PORT_COMPONENT = 2, + LLDP_PORT_SUBTYPE_MAC_ADDRESS = 3, + LLDP_PORT_SUBTYPE_NETWORK = 4, + LLDP_PORT_SUBTYPE_INTERFACE_NAME = 5, + LLDP_PORT_SUBTYPE_AGENT_CIRCUIT_ID = 6, + LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED = 7, + _LLDP_PORT_SUBTYPE_MAX, + _LLDP_PORT_SUBTYPE_INVALID = -1 +} LLDPPortSubtypes; + +typedef enum LLDPSystemCapabilities { + LLDP_SYSTEM_CAPABILITIES_OTHER = 1 << 0, + LLDP_SYSTEM_CAPABILITIES_REPEATER = 1 << 1, + LLDP_SYSTEM_CAPABILITIES_BRIDGE = 1 << 2, + LLDP_SYSTEM_CAPABILITIES_WLAN_AP = 1 << 3, + LLDP_SYSTEM_CAPABILITIES_ROUTER = 1 << 4, + LLDP_SYSTEM_CAPABILITIES_PHONE = 1 << 5, + LLDP_SYSTEM_CAPABILITIES_DOCSIS = 1 << 6, + LLDP_SYSTEM_CAPABILITIES_STATION = 1 << 7, + LLDP_SYSTEM_CAPABILITIES_CVLAN = 1 << 8, + LLDP_SYSTEM_CAPABILITIES_SVLAN = 1 << 9, + LLDP_SYSTEM_CAPABILITIES_TPMR = 1 << 10, + _LLDP_SYSTEM_CAPABILITIES_MAX, + _LLDP_SYSTEM_CAPABILITIES_INVALID = -1, +} LLDPSystemCapabilities; + +typedef enum LLDPMedSubtype { + LLDP_MED_SUBTYPE_RESERVED = 0, + LLDP_MED_SUBTYPE_CAPABILITIES = 1, + LLDP_MED_SUBTYPE_NETWORK_POLICY = 2, + LLDP_MED_SUBTYPE_LOCATION_ID = 3, + LLDP_MED_SUBTYPE_EXTENDED_PVMDI = 4, + LLDP_MED_SUBTYPE_INV_HWREV = 5, + LLDP_MED_SUBTYPE_INV_FWREV = 6, + LLDP_MED_SUBTYPE_INV_SWREV = 7, + LLDP_MED_SUBTYPE_INV_SERIAL = 8, + LLDP_MED_SUBTYPE_INV_MANUFACTURER = 9, + LLDP_MED_SUBTYPE_INV_MODELNAME = 10, + LLDP_MED_SUBTYPE_INV_ASSETID = 11, + _LLDP_MED_SUBTYPE_MAX, + _LLDP_MED_SUBTYPE_INVALID = -1, +} LLDPMedSubtype; + +typedef enum LLDPMedCapability { + LLDP_MED_CAPABILITY_CAPAPILITIES = 1 << 0, + LLDP_MED_CAPABILITY_NETWORK_POLICY = 1 << 1, + LLDP_MED_CAPABILITY_LOCATION_ID = 1 << 2, + LLDP_MED_CAPABILITY_EXTENDED_PSE = 1 << 3, + LLDP_MED_CAPABILITY_EXTENDED_PD = 1 << 4, + LLDP_MED_CAPABILITY_INVENTORY = 1 << 5, + LLDP_MED_CAPABILITY_MAX, + LLDP_MED_CAPABILITY_INVALID = -1, +} LLDPMedCapability; diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index 6852a7129..b8e4e2171 100644 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "strv.h" #include "siphash24.h" @@ -83,10 +82,10 @@ int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8 } bool net_match_config(const struct ether_addr *match_mac, - const char *match_path, - const char *match_driver, - const char *match_type, - const char *match_name, + char * const *match_paths, + char * const *match_drivers, + char * const *match_types, + char * const *match_names, Condition *match_host, Condition *match_virt, Condition *match_kernel, @@ -113,21 +112,21 @@ bool net_match_config(const struct ether_addr *match_mac, if (match_mac && (!dev_mac || memcmp(match_mac, dev_mac, ETH_ALEN))) return false; - if (match_path && (!dev_path || fnmatch(match_path, dev_path, 0))) + if (!strv_isempty(match_paths) && + (!dev_path || !strv_fnmatch(match_paths, dev_path, 0))) return false; - if (match_driver) { - if (dev_parent_driver && !streq(match_driver, dev_parent_driver)) - return false; - else if (!streq_ptr(match_driver, dev_driver)) - return false; - } + if (!strv_isempty(match_drivers) && + (!dev_driver || !strv_fnmatch(match_drivers, dev_driver, 0))) + return false; - if (match_type && !streq_ptr(match_type, dev_type)) + if (!strv_isempty(match_types) && + (!dev_type || !strv_fnmatch_or_empty(match_types, dev_type, 0))) return false; - if (match_name && (!dev_name || fnmatch(match_name, dev_name, 0))) - return false; + if (!strv_isempty(match_names) && + (!dev_name || !strv_fnmatch_or_empty(match_names, dev_name, 0))) + return false; return true; } @@ -212,6 +211,49 @@ int config_parse_ifname(const char *unit, return 0; } +int config_parse_ifnames(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) { + + char ***sv = data; + const char *word, *state; + size_t l; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + FOREACH_WORD(word, l, rvalue, state) { + char *n; + + n = strndup(word, l); + if (!n) + return log_oom(); + + if (!ascii_is_valid(n) || strlen(n) >= IFNAMSIZ) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "Interface name is not ASCII clean or is too long, ignoring assignment: %s", rvalue); + free(n); + return 0; + } + + r = strv_consume(sv, n); + if (r < 0) + return log_oom(); + } + + return 0; +} + int config_parse_ifalias(const char *unit, const char *filename, unsigned line, @@ -224,7 +266,7 @@ int config_parse_ifalias(const char *unit, void *userdata) { char **s = data; - char *n; + _cleanup_free_ char *n = NULL; assert(filename); assert(lvalue); @@ -238,17 +280,15 @@ int config_parse_ifalias(const char *unit, if (!ascii_is_valid(n) || strlen(n) >= IFALIASZ) { log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Interface alias is not ASCII clean or is too long, ignoring assignment: %s", rvalue); - free(n); return 0; } free(*s); - if (*n) + if (*n) { *s = n; - else { - free(n); + n = NULL; + } else *s = NULL; - } return 0; } diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h index c64db2e79..e51717e91 100644 --- a/src/libsystemd-network/network-internal.h +++ b/src/libsystemd-network/network-internal.h @@ -29,10 +29,10 @@ #include "condition.h" bool net_match_config(const struct ether_addr *match_mac, - const char *match_path, - const char *match_driver, - const char *match_type, - const char *match_name, + char * const *match_path, + char * const *match_driver, + char * const *match_type, + char * const *match_name, Condition *match_host, Condition *match_virt, Condition *match_kernel, @@ -56,6 +56,10 @@ int config_parse_ifname(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 config_parse_ifnames(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 config_parse_ifalias(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); diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index b2b72befb..5f90617b9 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -36,9 +36,10 @@ #include "dhcp-protocol.h" #include "dhcp-internal.h" #include "dhcp-lease-internal.h" +#include "dhcp-identifier.h" #include "sd-dhcp-client.h" -#define MAX_CLIENT_ID_LEN 64 /* Arbitrary limit */ +#define MAX_CLIENT_ID_LEN (sizeof(uint32_t) + MAX_DUID_LEN) /* Arbitrary limit */ #define MAX_MAC_ADDR_LEN INFINIBAND_ALEN struct sd_dhcp_client { @@ -60,29 +61,31 @@ struct sd_dhcp_client { uint8_t mac_addr[MAX_MAC_ADDR_LEN]; size_t mac_addr_len; uint16_t arp_type; - union { - struct { - uint8_t type; /* 0: Generic (non-LL) (RFC 2132) */ - uint8_t data[MAX_CLIENT_ID_LEN]; - } _packed_ gen; - struct { - uint8_t type; /* 1: Ethernet Link-Layer (RFC 2132) */ - uint8_t haddr[ETH_ALEN]; - } _packed_ eth; - struct { - uint8_t type; /* 2 - 254: ARP/Link-Layer (RFC 2132) */ - uint8_t haddr[0]; - } _packed_ ll; - struct { - uint8_t type; /* 255: Node-specific (RFC 4361) */ - uint8_t iaid[4]; - uint8_t duid[MAX_CLIENT_ID_LEN - 4]; - } _packed_ ns; - struct { - uint8_t type; - uint8_t data[MAX_CLIENT_ID_LEN]; - } _packed_ raw; - } client_id; + struct { + uint8_t type; + union { + struct { + /* 0: Generic (non-LL) (RFC 2132) */ + uint8_t data[MAX_CLIENT_ID_LEN]; + } _packed_ gen; + struct { + /* 1: Ethernet Link-Layer (RFC 2132) */ + uint8_t haddr[ETH_ALEN]; + } _packed_ eth; + struct { + /* 2 - 254: ARP/Link-Layer (RFC 2132) */ + uint8_t haddr[0]; + } _packed_ ll; + struct { + /* 255: Node-specific (RFC 4361) */ + uint32_t iaid; + struct duid duid; + } _packed_ ns; + struct { + uint8_t data[MAX_CLIENT_ID_LEN]; + } _packed_ raw; + }; + } _packed_ client_id; size_t client_id_len; char *hostname; char *vendor_class_identifier; @@ -239,10 +242,9 @@ int sd_dhcp_client_get_client_id(sd_dhcp_client *client, uint8_t *type, *data = NULL; *data_len = 0; if (client->client_id_len) { - *type = client->client_id.raw.type; + *type = client->client_id.type; *data = client->client_id.raw.data; - *data_len = client->client_id_len - - sizeof (client->client_id.raw.type); + *data_len = client->client_id_len - sizeof(client->client_id.type); } return 0; @@ -270,8 +272,8 @@ int sd_dhcp_client_set_client_id(sd_dhcp_client *client, uint8_t type, break; } - if (client->client_id_len == data_len + sizeof (client->client_id.raw.type) && - client->client_id.raw.type == type && + if (client->client_id_len == data_len + sizeof(client->client_id.type) && + client->client_id.type == type && memcmp(&client->client_id.raw.data, data, data_len) == 0) return 0; @@ -282,9 +284,9 @@ int sd_dhcp_client_set_client_id(sd_dhcp_client *client, uint8_t type, client_stop(client, DHCP_EVENT_STOP); } - client->client_id.raw.type = type; + client->client_id.type = type; memcpy(&client->client_id.raw.data, data, data_len); - client->client_id_len = data_len + sizeof (client->client_id.raw.type); + client->client_id_len = data_len + sizeof (client->client_id.type); if (need_restart && client->state != DHCP_STATE_STOPPED) sd_dhcp_client_start(client); @@ -461,12 +463,21 @@ static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, if (client->arp_type == ARPHRD_ETHER) memcpy(&packet->dhcp.chaddr, &client->mac_addr, ETH_ALEN); - /* If no client identifier exists, construct one from an ethernet - address if present */ - if (client->client_id_len == 0 && client->arp_type == ARPHRD_ETHER) { - client->client_id.eth.type = ARPHRD_ETHER; - memcpy(&client->client_id.eth.haddr, &client->mac_addr, ETH_ALEN); - client->client_id_len = sizeof (client->client_id.eth); + /* If no client identifier exists, construct an RFC 4361-compliant one */ + if (client->client_id_len == 0) { + size_t duid_len; + + client->client_id.type = 255; + + r = dhcp_identifier_set_iaid(client->index, client->mac_addr, client->mac_addr_len, &client->client_id.ns.iaid); + if (r < 0) + return r; + + r = dhcp_identifier_set_duid_en(&client->client_id.ns.duid, &duid_len); + if (r < 0) + return r; + + client->client_id_len = sizeof(client->client_id.type) + sizeof(client->client_id.ns.iaid) + duid_len; } /* Some DHCP servers will refuse to issue an DHCP lease if the Client @@ -475,7 +486,7 @@ static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, r = dhcp_option_append(&packet->dhcp, optlen, &optoffset, 0, DHCP_OPTION_CLIENT_IDENTIFIER, client->client_id_len, - &client->client_id.raw); + &client->client_id); if (r < 0) return r; } @@ -500,7 +511,7 @@ static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, Note (from ConnMan): Some DHCP servers will send bigger DHCP packets than the defined default size unless the Maximum Messge Size option - is explicitely set + is explicitly set RFC3442 "Requirements to Avoid Sizing Constraints": Because a full routing table can be quite large, the standard 576 @@ -1031,7 +1042,7 @@ static int client_handle_offer(sd_dhcp_client *client, DHCPMessage *offer, if (client->client_id_len) { r = dhcp_lease_set_client_id(lease, - (uint8_t *) &client->client_id.raw, + (uint8_t *) &client->client_id, client->client_id_len); if (r < 0) return r; @@ -1098,7 +1109,7 @@ static int client_handle_ack(sd_dhcp_client *client, DHCPMessage *ack, if (client->client_id_len) { r = dhcp_lease_set_client_id(lease, - (uint8_t *) &client->client_id.raw, + (uint8_t *) &client->client_id, client->client_id_len); if (r < 0) return r; @@ -1382,8 +1393,10 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, client->last_addr = client->lease->address; r = client_set_lease_timeouts(client); - if (r < 0) + if (r < 0) { + log_dhcp_client(client, "could not set lease timeouts"); goto error; + } r = dhcp_network_bind_udp_socket(client->lease->address, DHCP_PORT_CLIENT); @@ -1611,7 +1624,7 @@ int sd_dhcp_client_start(sd_dhcp_client *client) { r = client_start(client); if (r >= 0) - log_dhcp_client(client, "STARTED on ifindex %u", client->index); + log_dhcp_client(client, "STARTED on ifindex %i", client->index); return r; } @@ -1670,7 +1683,7 @@ sd_dhcp_client *sd_dhcp_client_ref(sd_dhcp_client *client) { } sd_dhcp_client *sd_dhcp_client_unref(sd_dhcp_client *client) { - if (client && REFCNT_DEC(client->n_ref) <= 0) { + if (client && REFCNT_DEC(client->n_ref) == 0) { log_dhcp_client(client, "FREE"); client_initialize(client); diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index 22a4af683..34aa36c6e 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -193,7 +193,7 @@ sd_dhcp_lease *sd_dhcp_lease_ref(sd_dhcp_lease *lease) { } sd_dhcp_lease *sd_dhcp_lease_unref(sd_dhcp_lease *lease) { - if (lease && REFCNT_DEC(lease->n_ref) <= 0) { + if (lease && REFCNT_DEC(lease->n_ref) == 0) { free(lease->hostname); free(lease->domainname); free(lease->dns); @@ -497,11 +497,20 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, case DHCP_OPTION_DOMAIN_NAME: { _cleanup_free_ char *domainname = NULL; + char *e; r = lease_parse_string(option, len, &domainname); if (r < 0) return r; + /* Chop off trailing dot of domain name that some DHCP + * servers send us back. Internally we want to store + * host names without trailing dots and + * host_name_is_valid() doesn't accept them. */ + e = endswith(domainname, "."); + if (e) + *e = 0; + if (!hostname_is_valid(domainname) || is_localhost(domainname)) break; @@ -514,11 +523,16 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, case DHCP_OPTION_HOST_NAME: { _cleanup_free_ char *hostname = NULL; + char *e; r = lease_parse_string(option, len, &hostname); if (r < 0) return r; + e = endswith(hostname, "."); + if (e) + *e = 0; + if (!hostname_is_valid(hostname) || is_localhost(hostname)) break; diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 24fedd237..3f89f344d 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -597,7 +597,7 @@ static int ensure_sane_request(DHCPRequest *req, DHCPMessage *message) { req->message = message; - /* set client id based on mac address if client did not send an explicit + /* set client id based on MAC address if client did not send an explicit one */ if (!req->client_id.data) { uint8_t *data; diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 017371e83..a432bbfc4 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -26,8 +26,6 @@ #include "udev.h" #include "udev-util.h" -#include "virt.h" -#include "siphash24.h" #include "util.h" #include "refcnt.h" @@ -36,14 +34,7 @@ #include "dhcp6-protocol.h" #include "dhcp6-internal.h" #include "dhcp6-lease-internal.h" - -#define SYSTEMD_PEN 43793 -#define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09) - -/* RFC 3315 section 9.1: - * A DUID can be no more than 128 octets long (not including the type code). - */ -#define MAX_DUID_LEN 128 +#include "dhcp-identifier.h" #define MAX_MAC_ADDR_LEN INFINIBAND_ALEN @@ -73,32 +64,7 @@ struct sd_dhcp6_client { sd_event_source *timeout_resend_expire; sd_dhcp6_client_cb_t cb; void *userdata; - union { - struct { - uint16_t type; /* DHCP6_DUID_LLT */ - uint16_t htype; - uint32_t time; - uint8_t haddr[0]; - } _packed_ llt; - struct { - uint16_t type; /* DHCP6_DUID_EN */ - uint32_t pen; - uint8_t id[8]; - } _packed_ en; - struct { - uint16_t type; /* DHCP6_DUID_LL */ - uint16_t htype; - uint8_t haddr[0]; - } _packed_ ll; - struct { - uint16_t type; /* DHCP6_DUID_UUID */ - sd_id128_t uuid; - } _packed_ uuid; - struct { - uint16_t type; - uint8_t data[MAX_DUID_LEN]; - } _packed_ raw; - } duid; + struct duid duid; size_t duid_len; }; @@ -201,19 +167,19 @@ int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *du switch (type) { case DHCP6_DUID_LLT: - if (duid_len <= sizeof(client->duid.llt) - 2) + if (duid_len <= sizeof(client->duid.llt)) return -EINVAL; break; case DHCP6_DUID_EN: - if (duid_len != sizeof(client->duid.en) - 2) + if (duid_len != sizeof(client->duid.en)) return -EINVAL; break; case DHCP6_DUID_LL: - if (duid_len <= sizeof(client->duid.ll) - 2) + if (duid_len <= sizeof(client->duid.ll)) return -EINVAL; break; case DHCP6_DUID_UUID: - if (duid_len != sizeof(client->duid.uuid) - 2) + if (duid_len != sizeof(client->duid.uuid)) return -EINVAL; break; default: @@ -221,9 +187,9 @@ int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *du break; } - client->duid.raw.type = htobe16(type); + client->duid.type = htobe16(type); memcpy(&client->duid.raw.data, duid, duid_len); - client->duid_len = duid_len + 2; /* +2 for sizeof(type) */ + client->duid_len = duid_len + sizeof(client->duid.type); return 0; } @@ -657,47 +623,16 @@ error: } static int client_ensure_iaid(sd_dhcp6_client *client) { - /* name is a pointer to memory in the udev_device struct, so must - have the same scope */ - _cleanup_udev_device_unref_ struct udev_device *device = NULL; - const char *name = NULL; - uint64_t id; + int r; assert(client); if (client->ia_na.id) return 0; - if (detect_container(NULL) <= 0) { - /* not in a container, udev will be around */ - _cleanup_udev_unref_ struct udev *udev; - char ifindex_str[2 + DECIMAL_STR_MAX(int)]; - - udev = udev_new(); - if (!udev) - return -ENOMEM; - - sprintf(ifindex_str, "n%d", client->index); - device = udev_device_new_from_device_id(udev, ifindex_str); - if (!device) - return -errno; - - if (udev_device_get_is_initialized(device) <= 0) - /* not yet ready */ - return -EBUSY; - - name = net_get_name(device); - } - - if (name) - siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes); - else - /* fall back to mac address if no predictable name available */ - siphash24((uint8_t*)&id, &client->mac_addr, - client->mac_addr_len, HASH_KEY.bytes); - - /* fold into 32 bits */ - client->ia_na.id = (id & 0xffffffff) ^ (id >> 32); + r = dhcp_identifier_set_iaid(client->index, client->mac_addr, client->mac_addr_len, &client->ia_na.id); + if (r < 0) + return r; return 0; } @@ -1025,7 +960,6 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) assert_return(client->index > 0, -EINVAL); assert_return(client->state != state, -EINVAL); - log_dhcp6_client(client, "client state %d new state %d", client->state, state); client->timeout_resend_expire = sd_event_source_unref(client->timeout_resend_expire); client->timeout_resend = sd_event_source_unref(client->timeout_resend); @@ -1254,7 +1188,7 @@ sd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client) { } sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client) { - if (client && REFCNT_DEC(client->n_ref) <= 0) { + if (client && REFCNT_DEC(client->n_ref) == 0) { client_reset(client); sd_dhcp6_client_detach_event(client); @@ -1271,7 +1205,6 @@ sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client) { int sd_dhcp6_client_new(sd_dhcp6_client **ret) { _cleanup_dhcp6_client_unref_ sd_dhcp6_client *client = NULL; - sd_id128_t machine_id; int r; size_t t; @@ -1290,18 +1223,10 @@ int sd_dhcp6_client_new(sd_dhcp6_client **ret) client->fd = -1; /* initialize DUID */ - client->duid.en.type = htobe16(DHCP6_DUID_EN); - client->duid.en.pen = htobe32(SYSTEMD_PEN); - client->duid_len = sizeof(client->duid.en); - - r = sd_id128_get_machine(&machine_id); + r = dhcp_identifier_set_duid_en(&client->duid, &client->duid_len); if (r < 0) return r; - /* a bit of snake-oil perhaps, but no need to expose the machine-id - directly */ - siphash24(client->duid.en.id, &machine_id, sizeof(machine_id), HASH_KEY.bytes); - client->req_opts_len = ELEMENTSOF(default_req_opts); client->req_opts = new0(be16_t, client->req_opts_len); diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index 8960fac92..2442269a3 100644 --- a/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libsystemd-network/sd-dhcp6-lease.c @@ -146,10 +146,9 @@ int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid) { return 0; } -int sd_dhcp6_lease_get_next_address(sd_dhcp6_lease *lease, - struct in6_addr *addr, - uint32_t *lifetime_preferred, - uint32_t *lifetime_valid) { +int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease, struct in6_addr *addr, + uint32_t *lifetime_preferred, + uint32_t *lifetime_valid) { assert_return(lease, -EINVAL); assert_return(addr, -EINVAL); assert_return(lifetime_preferred, -EINVAL); @@ -169,22 +168,9 @@ int sd_dhcp6_lease_get_next_address(sd_dhcp6_lease *lease, return 0; } -int sd_dhcp6_lease_get_first_address(sd_dhcp6_lease *lease, - struct in6_addr *addr, - uint32_t *lifetime_preferred, - uint32_t *lifetime_valid) { - assert_return(lease, -EINVAL); - assert_return(addr, -EINVAL); - assert_return(lifetime_preferred, -EINVAL); - assert_return(lifetime_valid, -EINVAL); - - if (!lease->ia.addresses) - return -ENOMSG; - - lease->addr_iter = lease->ia.addresses; - - return sd_dhcp6_lease_get_next_address(lease, addr, lifetime_preferred, - lifetime_valid); +void sd_dhcp6_lease_reset_address_iter(sd_dhcp6_lease *lease) { + if (lease) + lease->addr_iter = lease->ia.addresses; } sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease) { @@ -195,7 +181,7 @@ sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease) { } sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease) { - if (lease && REFCNT_DEC(lease->n_ref) <= 0) { + if (lease && REFCNT_DEC(lease->n_ref) == 0) { free(lease->serverid); dhcp6_lease_free_ia(&lease->ia); diff --git a/src/libsystemd-network/sd-icmp6-nd.c b/src/libsystemd-network/sd-icmp6-nd.c index cb0615151..2f867e856 100644 --- a/src/libsystemd-network/sd-icmp6-nd.c +++ b/src/libsystemd-network/sd-icmp6-nd.c @@ -18,9 +18,11 @@ ***/ #include +#include #include #include #include +#include #include "socket-util.h" #include "refcnt.h" @@ -38,6 +40,22 @@ enum icmp6_nd_state { ICMP6_ROUTER_ADVERTISMENT_LISTEN = 11, }; +#define IP6_MIN_MTU (unsigned)1280 +#define ICMP6_ND_RECV_SIZE (IP6_MIN_MTU - sizeof(struct ip6_hdr)) +#define ICMP6_OPT_LEN_UNITS 8 + +typedef struct ICMP6Prefix ICMP6Prefix; + +struct ICMP6Prefix { + RefCount n_ref; + + LIST_FIELDS(ICMP6Prefix, prefixes); + + uint8_t len; + sd_event_source *timeout_valid; + struct in6_addr addr; +}; + struct sd_icmp6_nd { RefCount n_ref; @@ -46,6 +64,9 @@ struct sd_icmp6_nd { int event_priority; int index; struct ether_addr mac_addr; + uint32_t mtu; + ICMP6Prefix *expired_prefix; + LIST_HEAD(ICMP6Prefix, prefixes); int fd; sd_event_source *recv; sd_event_source *timeout; @@ -56,6 +77,35 @@ struct sd_icmp6_nd { #define log_icmp6_nd(p, fmt, ...) log_internal(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "ICMPv6 CLIENT: " fmt, ##__VA_ARGS__) +static ICMP6Prefix *icmp6_prefix_unref(ICMP6Prefix *prefix) { + if (prefix && REFCNT_DEC(prefix->n_ref) <= 0) { + prefix->timeout_valid = + sd_event_source_unref(prefix->timeout_valid); + + free(prefix); + } + + return NULL; +} + +static int icmp6_prefix_new(ICMP6Prefix **ret) { + _cleanup_free_ ICMP6Prefix *prefix = NULL; + + assert(ret); + + prefix = new0(ICMP6Prefix, 1); + if (!prefix) + return -ENOMEM; + + prefix->n_ref = REFCNT_INIT; + LIST_INIT(prefixes, prefix); + + *ret = prefix; + prefix = NULL; + + return 0; +} + static void icmp6_nd_notify(sd_icmp6_nd *nd, int event) { if (nd->callback) @@ -87,7 +137,7 @@ int sd_icmp6_nd_set_mac(sd_icmp6_nd *nd, const struct ether_addr *mac_addr) { if (mac_addr) memcpy(&nd->mac_addr, mac_addr, sizeof(nd->mac_addr)); else - memset(&nd->mac_addr, 0x00, sizeof(nd->mac_addr)); + zero(nd->mac_addr); return 0; @@ -145,11 +195,18 @@ static int icmp6_nd_init(sd_icmp6_nd *nd) { } sd_icmp6_nd *sd_icmp6_nd_unref(sd_icmp6_nd *nd) { - if (nd && REFCNT_DEC(nd->n_ref) <= 0) { + if (nd && REFCNT_DEC(nd->n_ref) == 0) { + ICMP6Prefix *prefix, *p; icmp6_nd_init(nd); sd_icmp6_nd_detach_event(nd); + LIST_FOREACH_SAFE(prefixes, prefix, p, nd->prefixes) { + LIST_REMOVE(prefixes, nd->prefixes, prefix); + + prefix = icmp6_prefix_unref(prefix); + } + free(nd); } @@ -173,50 +230,356 @@ int sd_icmp6_nd_new(sd_icmp6_nd **ret) { nd->index = -1; nd->fd = -1; + LIST_HEAD_INIT(nd->prefixes); + *ret = nd; nd = NULL; return 0; } +int sd_icmp6_ra_get_mtu(sd_icmp6_nd *nd, uint32_t *mtu) { + assert_return(nd, -EINVAL); + assert_return(mtu, -EINVAL); + + if (nd->mtu == 0) + return -ENOMSG; + + *mtu = nd->mtu; + + return 0; +} + +static int icmp6_ra_prefix_timeout(sd_event_source *s, uint64_t usec, + void *userdata) { + sd_icmp6_nd *nd = userdata; + ICMP6Prefix *prefix, *p; + + assert(nd); + + LIST_FOREACH_SAFE(prefixes, prefix, p, nd->prefixes) { + if (prefix->timeout_valid != s) + continue; + + log_icmp6_nd(nd, "Prefix expired "SD_ICMP6_ADDRESS_FORMAT_STR"/%d", + SD_ICMP6_ADDRESS_FORMAT_VAL(prefix->addr), + prefix->len); + + LIST_REMOVE(prefixes, nd->prefixes, prefix); + + nd->expired_prefix = prefix; + icmp6_nd_notify(nd, + ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED); + nd->expired_prefix = NULL; + + prefix = icmp6_prefix_unref(prefix); + + break; + } + + return 0; +} + +static int icmp6_ra_prefix_set_timeout(sd_icmp6_nd *nd, + ICMP6Prefix *prefix, + usec_t valid) { + usec_t time_now; + int r; + + assert_return(prefix, -EINVAL); + + r = sd_event_now(nd->event, clock_boottime_or_monotonic(), &time_now); + if (r < 0) + return r; + + prefix->timeout_valid = sd_event_source_unref(prefix->timeout_valid); + + r = sd_event_add_time(nd->event, &prefix->timeout_valid, + clock_boottime_or_monotonic(), time_now + valid, + USEC_PER_SEC, icmp6_ra_prefix_timeout, nd); + if (r < 0) + goto error; + + r = sd_event_source_set_priority(prefix->timeout_valid, + nd->event_priority); + if (r < 0) + goto error; + + r = sd_event_source_set_description(prefix->timeout_valid, + "icmp6-prefix-timeout"); + +error: + if (r < 0) + prefix->timeout_valid = + sd_event_source_unref(prefix->timeout_valid); + + return r; +} + +static int icmp6_prefix_match(const struct in6_addr *prefix, uint8_t prefixlen, + const struct in6_addr *addr, + uint8_t addr_prefixlen) { + uint8_t bytes, mask, len; + + assert_return(prefix, -EINVAL); + assert_return(addr, -EINVAL); + + len = MIN(prefixlen, addr_prefixlen); + + bytes = len / 8; + mask = 0xff << (8 - len % 8); + + if (memcmp(prefix, addr, bytes) != 0 || + (prefix->s6_addr[bytes] & mask) != (addr->s6_addr[bytes] & mask)) + return -EADDRNOTAVAIL; + + return 0; +} + +static int icmp6_ra_prefix_match(ICMP6Prefix *head, const struct in6_addr *addr, + uint8_t addr_len, ICMP6Prefix **result) { + ICMP6Prefix *prefix; + + LIST_FOREACH(prefixes, prefix, head) { + if (icmp6_prefix_match(&prefix->addr, prefix->len, addr, + addr_len) >= 0) { + *result = prefix; + return 0; + } + } + + return -EADDRNOTAVAIL; +} + +int sd_icmp6_prefix_match(struct in6_addr *prefix, uint8_t prefixlen, + struct in6_addr *addr) { + return icmp6_prefix_match(prefix, prefixlen, addr, + sizeof(addr->s6_addr) * 8); +} + +int sd_icmp6_ra_get_prefixlen(sd_icmp6_nd *nd, const struct in6_addr *addr, + uint8_t *prefixlen) { + int r; + ICMP6Prefix *prefix; + + assert_return(nd, -EINVAL); + assert_return(addr, -EINVAL); + assert_return(prefixlen, -EINVAL); + + r = icmp6_ra_prefix_match(nd->prefixes, addr, + sizeof(addr->s6_addr) * 8, &prefix); + if (r < 0) + return r; + + *prefixlen = prefix->len; + + return 0; +} + +int sd_icmp6_ra_get_expired_prefix(sd_icmp6_nd *nd, struct in6_addr **addr, + uint8_t *prefixlen) +{ + assert_return(nd, -EINVAL); + assert_return(addr, -EINVAL); + assert_return(prefixlen, -EINVAL); + + if (!nd->expired_prefix) + return -EADDRNOTAVAIL; + + *addr = &nd->expired_prefix->addr; + *prefixlen = nd->expired_prefix->len; + + return 0; +} + +static int icmp6_ra_prefix_update(sd_icmp6_nd *nd, ssize_t len, + const struct nd_opt_prefix_info *prefix_opt) { + int r; + ICMP6Prefix *prefix; + uint32_t lifetime; + char time_string[FORMAT_TIMESPAN_MAX]; + + assert_return(nd, -EINVAL); + assert_return(prefix_opt, -EINVAL); + + if (len < prefix_opt->nd_opt_pi_len) + return -ENOMSG; + + if (!(prefix_opt->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK)) + return 0; + + lifetime = be32toh(prefix_opt->nd_opt_pi_valid_time); + + r = icmp6_ra_prefix_match(nd->prefixes, + &prefix_opt->nd_opt_pi_prefix, + prefix_opt->nd_opt_pi_prefix_len, &prefix); + + if (r < 0 && r != -EADDRNOTAVAIL) + return r; + + /* if router advertisment prefix valid timeout is zero, the timeout + callback will be called immediately to clean up the prefix */ + + if (r == -EADDRNOTAVAIL) { + r = icmp6_prefix_new(&prefix); + if (r < 0) + return r; + + prefix->len = prefix_opt->nd_opt_pi_prefix_len; + + memcpy(&prefix->addr, &prefix_opt->nd_opt_pi_prefix, + sizeof(prefix->addr)); + + log_icmp6_nd(nd, "New prefix "SD_ICMP6_ADDRESS_FORMAT_STR"/%d lifetime %d expires in %s", + SD_ICMP6_ADDRESS_FORMAT_VAL(prefix->addr), + prefix->len, lifetime, + format_timespan(time_string, FORMAT_TIMESPAN_MAX, + lifetime * USEC_PER_SEC, 0)); + + LIST_PREPEND(prefixes, nd->prefixes, prefix); + + } else { + if (prefix->len != prefix_opt->nd_opt_pi_prefix_len) { + uint8_t prefixlen; + + prefixlen = MIN(prefix->len, prefix_opt->nd_opt_pi_prefix_len); + + log_icmp6_nd(nd, "Prefix length mismatch %d/%d using %d", + prefix->len, + prefix_opt->nd_opt_pi_prefix_len, + prefixlen); + + prefix->len = prefixlen; + } + + log_icmp6_nd(nd, "Update prefix "SD_ICMP6_ADDRESS_FORMAT_STR"/%d lifetime %d expires in %s", + SD_ICMP6_ADDRESS_FORMAT_VAL(prefix->addr), + prefix->len, lifetime, + format_timespan(time_string, FORMAT_TIMESPAN_MAX, + lifetime * USEC_PER_SEC, 0)); + } + + r = icmp6_ra_prefix_set_timeout(nd, prefix, lifetime * USEC_PER_SEC); + + return r; +} + +static int icmp6_ra_parse(sd_icmp6_nd *nd, struct nd_router_advert *ra, + ssize_t len) { + void *opt; + struct nd_opt_hdr *opt_hdr; + + assert_return(nd, -EINVAL); + assert_return(ra, -EINVAL); + + len -= sizeof(*ra); + if (len < ICMP6_OPT_LEN_UNITS) { + log_icmp6_nd(nd, "Router Advertisement below minimum length"); + + return -ENOMSG; + } + + opt = ra + 1; + opt_hdr = opt; + + while (len != 0 && len >= opt_hdr->nd_opt_len * ICMP6_OPT_LEN_UNITS) { + struct nd_opt_mtu *opt_mtu; + uint32_t mtu; + struct nd_opt_prefix_info *opt_prefix; + + if (opt_hdr->nd_opt_len == 0) + return -ENOMSG; + + switch (opt_hdr->nd_opt_type) { + case ND_OPT_MTU: + opt_mtu = opt; + + mtu = be32toh(opt_mtu->nd_opt_mtu_mtu); + + if (mtu != nd->mtu) { + nd->mtu = MAX(mtu, IP6_MIN_MTU); + + log_icmp6_nd(nd, "Router Advertisement link MTU %d using %d", + mtu, nd->mtu); + } + + break; + + case ND_OPT_PREFIX_INFORMATION: + opt_prefix = opt; + + icmp6_ra_prefix_update(nd, len, opt_prefix); + + break; + } + + len -= opt_hdr->nd_opt_len * ICMP6_OPT_LEN_UNITS; + opt = (void *)((char *)opt + + opt_hdr->nd_opt_len * ICMP6_OPT_LEN_UNITS); + opt_hdr = opt; + } + + if (len > 0) + log_icmp6_nd(nd, "Router Advertisement contains %zd bytes of trailing garbage", len); + + return 0; +} + static int icmp6_router_advertisment_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) { sd_icmp6_nd *nd = userdata; + int r, buflen = 0; ssize_t len; - struct nd_router_advert ra; + _cleanup_free_ struct nd_router_advert *ra = NULL; int event = ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE; assert(s); assert(nd); assert(nd->event); - /* only interested in Managed/Other flag */ - len = read(fd, &ra, sizeof(ra)); - if ((size_t)len < sizeof(ra)) + r = ioctl(fd, FIONREAD, &buflen); + if (r < 0 || buflen <= 0) + buflen = ICMP6_ND_RECV_SIZE; + + ra = malloc(buflen); + if (!ra) + return -ENOMEM; + + len = read(fd, ra, buflen); + if (len < 0) { + log_icmp6_nd(nd, "Could not receive message from UDP socket: %m"); return 0; + } - if (ra.nd_ra_type != ND_ROUTER_ADVERT) + if (ra->nd_ra_type != ND_ROUTER_ADVERT) return 0; - if (ra.nd_ra_code != 0) + if (ra->nd_ra_code != 0) return 0; nd->timeout = sd_event_source_unref(nd->timeout); nd->state = ICMP6_ROUTER_ADVERTISMENT_LISTEN; - if (ra.nd_ra_flags_reserved & ND_RA_FLAG_OTHER ) + if (ra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER ) event = ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER; - if (ra.nd_ra_flags_reserved & ND_RA_FLAG_MANAGED) + if (ra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED) event = ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED; log_icmp6_nd(nd, "Received Router Advertisement flags %s/%s", - (ra.nd_ra_flags_reserved & ND_RA_FLAG_MANAGED)? "MANAGED": - "none", - (ra.nd_ra_flags_reserved & ND_RA_FLAG_OTHER)? "OTHER": - "none"); + ra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED? "MANAGED": "none", + ra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER? "OTHER": "none"); + + if (event != ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE) { + r = icmp6_ra_parse(nd, ra, len); + if (r < 0) { + log_icmp6_nd(nd, "Could not parse Router Advertisement: %s", + strerror(-r)); + return 0; + } + } icmp6_nd_notify(nd, event); diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 8626d4afa..02f2f9e0a 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -605,7 +605,7 @@ sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll) { } sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll) { - if (ll && REFCNT_DEC(ll->n_ref) <= 0) { + if (ll && REFCNT_DEC(ll->n_ref) == 0) { ll->receive_message = sd_event_source_unref(ll->receive_message); ll->fd = safe_close(ll->fd); diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c new file mode 100644 index 000000000..19ef2ccdb --- /dev/null +++ b/src/libsystemd-network/sd-lldp.c @@ -0,0 +1,687 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "siphash24.h" +#include "hashmap.h" +#include "event-util.h" + +#include "lldp-tlv.h" +#include "lldp-port.h" +#include "sd-lldp.h" +#include "prioq.h" +#include "strv.h" +#include "lldp-internal.h" +#include "lldp-util.h" +#include "ether-addr-util.h" + +typedef enum LLDPAgentRXState { + LLDP_AGENT_RX_WAIT_PORT_OPERATIONAL = 4, + LLDP_AGENT_RX_DELETE_AGED_INFO, + LLDP_AGENT_RX_LLDP_INITIALIZE, + LLDP_AGENT_RX_WAIT_FOR_FRAME, + LLDP_AGENT_RX_RX_FRAME, + LLDP_AGENT_RX_DELETE_INFO, + LLDP_AGENT_RX_UPDATE_INFO, + _LLDP_AGENT_RX_STATE_MAX, + _LLDP_AGENT_RX_INVALID = -1, +} LLDPAgentRXState; + +/* Section 10.5.2.2 Reception counters */ +struct lldp_agent_statistics { + uint64_t stats_ageouts_total; + uint64_t stats_frames_discarded_total; + uint64_t stats_frames_in_errors_total; + uint64_t stats_frames_in_total; + uint64_t stats_tlvs_discarded_total; + uint64_t stats_tlvs_unrecognized_total; +}; + +struct sd_lldp { + lldp_port *port; + + Prioq *by_expiry; + Hashmap *neighbour_mib; + + sd_lldp_cb_t cb; + + void *userdata; + + LLDPAgentRXState rx_state; + lldp_agent_statistics statistics; +}; + +static unsigned long chassis_id_hash_func(const void *p, + const uint8_t hash_key[HASH_KEY_SIZE]) { + uint64_t u; + const lldp_chassis_id *id = p; + + assert(id); + + siphash24((uint8_t *) &u, id->data, id->length, hash_key); + + return (unsigned long) u; +} + +static int chassis_id_compare_func(const void *_a, const void *_b) { + const lldp_chassis_id *a, *b; + + a = _a; + b = _b; + + assert(!a->length || a->data); + assert(!b->length || b->data); + + if (a->type != b->type) + return -1; + + if (a->length != b->length) + return a->length < b->length ? -1 : 1; + + return memcmp(a->data, b->data, a->length); +} + +static const struct hash_ops chassis_id_hash_ops = { + .hash = chassis_id_hash_func, + .compare = chassis_id_compare_func +}; + +static void lldp_mib_delete_objects(sd_lldp *lldp); +static void lldp_set_state(sd_lldp *lldp, LLDPAgentRXState state); +static void lldp_run_state_machine(sd_lldp *ll); + +static int lldp_receive_frame(sd_lldp *lldp, tlv_packet *tlv) { + int r; + + assert(lldp); + assert(tlv); + + /* Remove expired packets */ + if (prioq_size(lldp->by_expiry) > 0) { + + lldp_set_state(lldp, LLDP_AGENT_RX_DELETE_INFO); + + lldp_mib_delete_objects(lldp); + } + + r = lldp_mib_add_objects(lldp->by_expiry, lldp->neighbour_mib, tlv); + if (r < 0) + goto out; + + lldp_set_state(lldp, LLDP_AGENT_RX_UPDATE_INFO); + + log_lldp("Packet added. MIB size: %d , PQ size: %d", + hashmap_size(lldp->neighbour_mib), + prioq_size(lldp->by_expiry)); + + lldp->statistics.stats_frames_in_total ++; + + return 0; + + out: + if (r < 0) + log_lldp("Receive frame failed: %s", strerror(-r)); + + lldp_set_state(lldp, LLDP_AGENT_RX_WAIT_FOR_FRAME); + + return 0; +} + +/* 10.3.2 LLDPDU validation: rxProcessFrame() */ +int lldp_handle_packet(tlv_packet *tlv, uint16_t length) { + uint16_t type, len, i, l, t; + bool chassis_id = false; + bool malformed = false; + bool port_id = false; + bool ttl = false; + bool end = false; + lldp_port *port; + uint8_t *p, *q; + sd_lldp *lldp; + int r; + + assert(tlv); + assert(length > 0); + + port = (lldp_port *) tlv->userdata; + lldp = (sd_lldp *) port->userdata; + + if (lldp->port->status == LLDP_PORT_STATUS_DISABLED) { + log_lldp("Port is disabled : %s . Dropping ...", + lldp->port->ifname); + goto out; + } + + lldp_set_state(lldp, LLDP_AGENT_RX_RX_FRAME); + + p = tlv->pdu; + p += sizeof(struct ether_header); + + for (i = 1, l = 0; l <= length; i++) { + + memcpy(&t, p, sizeof(uint16_t)); + + type = ntohs(t) >> 9; + len = ntohs(t) & 0x01ff; + + if (type == LLDP_TYPE_END) { + if (len != 0) { + log_lldp("TLV type end is not length 0. Length:%d received . Dropping ...", + len); + + malformed = true; + goto out; + } + + end = true; + + break; + } else if (type >=_LLDP_TYPE_MAX) { + log_lldp("TLV type not recognized %d . Dropping ...", + type); + + malformed = true; + goto out; + } + + /* skip type and lengh encoding */ + p += 2; + q = p; + + p += len; + l += (len + 2); + + if (i <= 3) { + if (i != type) { + log_lldp("TLV missing or out of order. Dropping ..."); + + malformed = true; + goto out; + } + } + + switch(type) { + case LLDP_TYPE_CHASSIS_ID: + + if (len < 2) { + log_lldp("Received malformed Chassis ID TLV len = %d. Dropping", + len); + + malformed = true; + goto out; + } + + if (chassis_id) { + log_lldp("Duplicate Chassis ID TLV found. Dropping ..."); + + malformed = true; + goto out; + } + + /* Look what subtype it has */ + if (*q == LLDP_CHASSIS_SUBTYPE_RESERVED || + *q > LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED) { + log_lldp("Unknown subtype: %d found in Chassis ID TLV . Dropping ...", + *q); + + malformed = true; + goto out; + + } + + chassis_id = true; + + break; + case LLDP_TYPE_PORT_ID: + + if (len < 2) { + log_lldp("Received malformed Port ID TLV len = %d. Dropping", + len); + + malformed = true; + goto out; + } + + if (port_id) { + log_lldp("Duplicate Port ID TLV found. Dropping ..."); + + malformed = true; + goto out; + } + + /* Look what subtype it has */ + if (*q == LLDP_PORT_SUBTYPE_RESERVED || + *q > LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED) { + log_lldp("Unknown subtype: %d found in Port ID TLV . Dropping ...", + *q); + + malformed = true; + goto out; + + } + + port_id = true; + + break; + case LLDP_TYPE_TTL: + + if(len != 2) { + log_lldp( + "Received invalid lenth: %d TTL TLV. Dropping ...", + len); + + malformed = true; + goto out; + } + + if (ttl) { + log_lldp("Duplicate TTL TLV found. Dropping ..."); + + malformed = true; + goto out; + } + + ttl = true; + + break; + default: + + if (len == 0) { + log_lldp("TLV type = %d's, length 0 received . Dropping ...", + type); + + malformed = true; + goto out; + } + break; + } + } + + if(!chassis_id || !port_id || !ttl || !end) { + log_lldp( "One or more mandotory TLV missing . Dropping ..."); + + malformed = true; + goto out; + + } + + r = tlv_packet_parse_pdu(tlv, length); + if (r < 0) { + log_lldp( "Failed to parse the TLV. Dropping ..."); + + malformed = true; + goto out; + } + + return lldp_receive_frame(lldp, tlv); + + out: + lldp_set_state(lldp, LLDP_AGENT_RX_WAIT_FOR_FRAME); + + if (malformed) { + lldp->statistics.stats_frames_discarded_total ++; + lldp->statistics.stats_frames_in_errors_total ++; + } + + tlv_packet_free(tlv); + + return 0; +} + +static int ttl_expiry_item_prioq_compare_func(const void *a, const void *b) { + const lldp_neighbour_port *p = a, *q = b; + + if (p->until < q->until) + return -1; + + if (p->until > q->until) + return 1; + + return 0; +} + +static void lldp_set_state(sd_lldp *lldp, LLDPAgentRXState state) { + + assert(lldp); + assert(state < _LLDP_AGENT_RX_STATE_MAX); + + lldp->rx_state = state; + + lldp_run_state_machine(lldp); +} + +static void lldp_run_state_machine(sd_lldp *lldp) { + + if (lldp->rx_state == LLDP_AGENT_RX_UPDATE_INFO) + if (lldp->cb) + lldp->cb(lldp, LLDP_AGENT_RX_UPDATE_INFO, lldp->userdata); +} + +/* 10.5.5.2.1 mibDeleteObjects () + * The mibDeleteObjects () procedure deletes all information in the LLDP remote + * systems MIB associated with the MSAP identifier if an LLDPDU is received with + * an rxTTL value of zero (see 10.3.2) or the timing counter rxInfoTTL expires. */ + +static void lldp_mib_delete_objects(sd_lldp *lldp) { + lldp_neighbour_port *p; + usec_t t = 0; + + /* Remove all entries that are past their TTL */ + for (;;) { + + if (prioq_size(lldp->by_expiry) <= 0) + break; + + p = prioq_peek(lldp->by_expiry); + if (!p) + break; + + if (t <= 0) + t = now(CLOCK_BOOTTIME); + + if (p->until > t) + break; + + lldp_neighbour_port_remove_and_free(p); + + lldp->statistics.stats_ageouts_total ++; + } +} + +static void lldp_mib_objects_flush(sd_lldp *lldp) { + lldp_neighbour_port *p, *q; + lldp_chassis *c; + + assert(lldp); + assert(lldp->neighbour_mib); + assert(lldp->by_expiry); + + /* Drop all packets */ + while ((c = hashmap_steal_first(lldp->neighbour_mib))) { + + LIST_FOREACH_SAFE(port, p, q, c->ports) { + lldp_neighbour_port_remove_and_free(p); + } + } + + assert(hashmap_size(lldp->neighbour_mib) == 0); + assert(prioq_size(lldp->by_expiry) == 0); +} + +int sd_lldp_save(sd_lldp *lldp, const char *lldp_file) { + _cleanup_free_ char *temp_path = NULL; + _cleanup_fclose_ FILE *f = NULL; + uint8_t *mac, *port_id, type; + lldp_neighbour_port *p; + uint16_t data = 0, length = 0; + char buf[LINE_MAX]; + lldp_chassis *c; + usec_t time; + Iterator i; + int r; + + assert(lldp); + assert(lldp_file); + + r = fopen_temporary(lldp_file, &f, &temp_path); + if (r < 0) + goto finish; + + fchmod(fileno(f), 0644); + + HASHMAP_FOREACH(c, lldp->neighbour_mib, i) { + LIST_FOREACH(port, p, c->ports) { + _cleanup_free_ char *s = NULL; + char *k, *t; + + r = lldp_read_chassis_id(p->packet, &type, &length, &mac); + if (r < 0) + continue; + + sprintf(buf, "'_Chassis=%02x:%02x:%02x:%02x:%02x:%02x' '_CType=%d' ", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], type); + + s = strdup(buf); + if (!s) + return -ENOMEM; + + r = lldp_read_port_id(p->packet, &type, &length, &port_id); + if (r < 0) + continue; + + if (type != LLDP_PORT_SUBTYPE_MAC_ADDRESS) { + k = strndup((char *) port_id, length -1); + if (!k) + return -ENOMEM; + + sprintf(buf, "'_Port=%s' '_PType=%d' ", k , type); + free(k); + } else { + mac = port_id; + sprintf(buf, "'_Port=%02x:%02x:%02x:%02x:%02x:%02x' '_PType=%d' ", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], type); + } + + k = strappend(s, buf); + if (!k) + return -ENOMEM; + + free(s); + s = k; + + time = now(CLOCK_BOOTTIME); + + /* Don't write expired packets */ + if (time - p->until <= 0) + continue; + + sprintf(buf, "'_TTL="USEC_FMT"' ", p->until); + + k = strappend(s, buf); + if (!k) + return -ENOMEM; + + free(s); + s = k; + + r = lldp_read_system_name(p->packet, &length, &k); + if (r < 0) + k = strappend(s, "'_NAME=N/A' "); + else { + t = strndup(k, length); + if (!t) + return -ENOMEM; + + k = strjoin(s, "'_NAME=", t, "' ", NULL); + free(t); + } + + if (!k) + return -ENOMEM; + + free(s); + s = k; + + (void)lldp_read_system_capability(p->packet, &data); + + sprintf(buf, "'_CAP=%x'", data); + + k = strappend(s, buf); + if (!k) + return -ENOMEM; + + free(s); + s = k; + + fprintf(f, "%s\n", s); + } + } + r = 0; + + fflush(f); + + if (ferror(f) || rename(temp_path, lldp_file) < 0) { + r = -errno; + unlink(lldp_file); + unlink(temp_path); + } + + finish: + if (r < 0) + log_error("Failed to save lldp data %s: %s", lldp_file, strerror(-r)); + + return r; +} + +int sd_lldp_start(sd_lldp *lldp) { + int r; + + assert_return(lldp, -EINVAL); + assert_return(lldp->port, -EINVAL); + + lldp->port->status = LLDP_PORT_STATUS_ENABLED; + + lldp_set_state(lldp, LLDP_AGENT_RX_LLDP_INITIALIZE); + + r = lldp_port_start(lldp->port); + if (r < 0) { + log_lldp("Failed to start Port : %s , %s", + lldp->port->ifname, + strerror(-r)); + + lldp_set_state(lldp, LLDP_AGENT_RX_WAIT_PORT_OPERATIONAL); + + return r; + } + + lldp_set_state(lldp, LLDP_AGENT_RX_WAIT_FOR_FRAME); + + return 0; +} + +int sd_lldp_stop(sd_lldp *lldp) { + int r; + + assert_return(lldp, -EINVAL); + assert_return(lldp->port, -EINVAL); + + lldp->port->status = LLDP_PORT_STATUS_DISABLED; + + r = lldp_port_stop(lldp->port); + if (r < 0) + return r; + + lldp_mib_objects_flush(lldp); + + return 0; +} + +int sd_lldp_attach_event(sd_lldp *lldp, sd_event *event, int priority) { + int r; + + assert_return(lldp, -EINVAL); + assert_return(!lldp->port->event, -EBUSY); + + if (event) + lldp->port->event = sd_event_ref(event); + else { + r = sd_event_default(&lldp->port->event); + if (r < 0) + return r; + } + + lldp->port->event_priority = priority; + + return 0; +} + +int sd_lldp_detach_event(sd_lldp *lldp) { + + assert_return(lldp, -EINVAL); + + lldp->port->event = sd_event_unref(lldp->port->event); + + return 0; +} + +int sd_lldp_set_callback(sd_lldp *lldp, sd_lldp_cb_t cb, void *userdata) { + assert_return(lldp, -EINVAL); + + lldp->cb = cb; + lldp->userdata = userdata; + + return 0; +} + +void sd_lldp_free(sd_lldp *lldp) { + + if (!lldp) + return; + + /* Drop all packets */ + lldp_mib_objects_flush(lldp); + + lldp_port_free(lldp->port); + + hashmap_free(lldp->neighbour_mib); + prioq_free(lldp->by_expiry); + + free(lldp); +} + +int sd_lldp_new(int ifindex, + const char *ifname, + const struct ether_addr *mac, + sd_lldp **ret) { + _cleanup_lldp_free_ sd_lldp *lldp = NULL; + int r; + + assert_return(ret, -EINVAL); + assert_return(ifindex > 0, -EINVAL); + assert_return(ifname, -EINVAL); + assert_return(mac, -EINVAL); + + lldp = new0(sd_lldp, 1); + if (!lldp) + return -ENOMEM; + + r = lldp_port_new(ifindex, ifname, mac, lldp, &lldp->port); + if (r < 0) + return r; + + lldp->neighbour_mib = hashmap_new(&chassis_id_hash_ops); + if (!lldp->neighbour_mib) + return -ENOMEM; + + r = prioq_ensure_allocated(&lldp->by_expiry, + ttl_expiry_item_prioq_compare_func); + if (r < 0) + return r; + + lldp->rx_state = LLDP_AGENT_RX_WAIT_PORT_OPERATIONAL; + + *ret = lldp; + lldp = NULL; + + return 0; +} diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 0515440e4..8e8864143 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -32,17 +32,16 @@ #include "sd-event.h" #include "event-util.h" +#include "dhcp-identifier.h" #include "dhcp-protocol.h" #include "dhcp-internal.h" #include "sd-dhcp-client.h" -static struct ether_addr mac_addr = { - .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'} -}; +static uint8_t mac_addr[] = {'A', 'B', 'C', '1', '2', '3'}; typedef int (*test_callback_recv_t)(size_t size, DHCPMessage *dhcp); -static bool verbose = false; +static bool verbose = true; static int test_fd[2]; static test_callback_recv_t callback_recv; static be32_t xid; @@ -136,10 +135,22 @@ static int check_options(uint8_t code, uint8_t len, const uint8_t *option, { switch(code) { case DHCP_OPTION_CLIENT_IDENTIFIER: - assert_se(len == 7); - assert_se(option[0] == 0x01); - assert_se(memcmp(&option[1], &mac_addr, ETH_ALEN) == 0); + { + uint32_t iaid; + struct duid duid; + size_t duid_len; + + assert_se(dhcp_identifier_set_duid_en(&duid, &duid_len) >= 0); + assert_se(dhcp_identifier_set_iaid(42, mac_addr, ETH_ALEN, &iaid) >= 0); + + assert_se(len == sizeof(uint8_t) + sizeof(uint32_t) + duid_len); + assert_se(len == 19); + assert_se(option[0] == 0xff); + + assert_se(memcmp(&option[1], &iaid, sizeof(iaid)) == 0); + assert_se(memcmp(&option[5], &duid, duid_len) == 0); break; + } default: break; @@ -185,8 +196,7 @@ int dhcp_network_send_raw_socket(int s, const union sockaddr_union *link, assert_se(ip_check == 0xffff); assert_se(discover->dhcp.xid); - assert_se(memcmp(discover->dhcp.chaddr, - &mac_addr.ether_addr_octet, 6) == 0); + assert_se(memcmp(discover->dhcp.chaddr, &mac_addr, ETH_ALEN) == 0); size = len - sizeof(struct iphdr) - sizeof(struct udphdr); @@ -208,7 +218,13 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, int dhcp_network_bind_udp_socket(be32_t address, uint16_t port) { - return 0; + int fd; + + fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0); + if (fd < 0) + return -errno; + + return fd; } int dhcp_network_send_udp_socket(int s, be32_t address, uint16_t port, @@ -246,10 +262,7 @@ static void test_discover_message(sd_event *e) assert_se(r >= 0); assert_se(sd_dhcp_client_set_index(client, 42) >= 0); - assert_se(sd_dhcp_client_set_mac(client, - (const uint8_t *) &mac_addr, - sizeof (mac_addr), - ARPHRD_ETHER) >= 0); + assert_se(sd_dhcp_client_set_mac(client, mac_addr, ETH_ALEN, ARPHRD_ETHER) >= 0); assert_se(sd_dhcp_client_set_request_option(client, 248) >= 0); @@ -404,8 +417,7 @@ static int test_addr_acq_recv_request(size_t size, DHCPMessage *request) { memcpy(&test_addr_acq_ack[26], &udp_check, sizeof(udp_check)); memcpy(&test_addr_acq_ack[32], &xid, sizeof(xid)); - memcpy(&test_addr_acq_ack[56], &mac_addr.ether_addr_octet, - ETHER_ADDR_LEN); + memcpy(&test_addr_acq_ack[56], &mac_addr, ETHER_ADDR_LEN); callback_recv = NULL; @@ -436,8 +448,7 @@ static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover) { memcpy(&test_addr_acq_offer[26], &udp_check, sizeof(udp_check)); memcpy(&test_addr_acq_offer[32], &xid, sizeof(xid)); - memcpy(&test_addr_acq_offer[56], &mac_addr.ether_addr_octet, - ETHER_ADDR_LEN); + memcpy(&test_addr_acq_offer[56], &mac_addr, ETHER_ADDR_LEN); callback_recv = test_addr_acq_recv_request; @@ -467,13 +478,9 @@ static void test_addr_acq(sd_event *e) { assert_se(r >= 0); assert_se(sd_dhcp_client_set_index(client, 42) >= 0); - assert_se(sd_dhcp_client_set_mac(client, - (const uint8_t *) &mac_addr, - sizeof (mac_addr), - ARPHRD_ETHER) >= 0); + assert_se(sd_dhcp_client_set_mac(client, mac_addr, ETH_ALEN, ARPHRD_ETHER) >= 0); - assert_se(sd_dhcp_client_set_callback(client, test_addr_acq_acquired, e) - >= 0); + assert_se(sd_dhcp_client_set_callback(client, test_addr_acq_acquired, e) >= 0); callback_recv = test_addr_acq_recv_discover; @@ -514,5 +521,12 @@ int main(int argc, char *argv[]) { test_discover_message(e); test_addr_acq(e); +#ifdef VALGRIND + /* Make sure the async_close thread has finished. + * valgrind would report some of the phread_* structures + * as not cleaned up properly. */ + sleep(1); +#endif + return 0; } diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c index eac3844f9..46c8c2706 100644 --- a/src/libsystemd-network/test-dhcp-option.c +++ b/src/libsystemd-network/test-dhcp-option.c @@ -344,7 +344,7 @@ static void test_option_set(void) for (i = 0; i < 9; i++) { if (verbose) - printf("%2d: 0x%02x(0x%02x) (options)\n", i, result->options[i], + printf("%2u: 0x%02x(0x%02x) (options)\n", i, result->options[i], options[i]); assert_se(result->options[i] == options[i]); } @@ -363,7 +363,7 @@ static void test_option_set(void) for (i = 0; i < pos - 8; i++) { if (verbose) - printf("%2d: 0x%02x(0x%02x) (sname)\n", i, result->sname[i], + printf("%2u: 0x%02x(0x%02x) (sname)\n", i, result->sname[i], options[i + 9]); assert_se(result->sname[i] == options[i + 9]); } diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index 75908391f..9386f31ce 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -286,26 +286,27 @@ static int test_advertise_option(sd_event *e) { assert_se(opt_clientid); - assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref, - <_valid) >= 0); + sd_dhcp6_lease_reset_address_iter(lease); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) >= 0); assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr))); assert_se(lt_pref == 150); assert_se(lt_valid == 180); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) == -ENOMSG); - assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref, - <_valid) >= 0); + sd_dhcp6_lease_reset_address_iter(lease); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) >= 0); assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr))); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); - assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref, - <_valid) >= 0); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) == -ENOMSG); + sd_dhcp6_lease_reset_address_iter(lease); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) >= 0); assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr))); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) == -ENOMSG); assert_se(dhcp6_lease_get_serverid(lease, &opt, &len) >= 0); assert_se(len == 14); @@ -439,14 +440,15 @@ static int test_client_verify_request(DHCP6Message *request, uint8_t *option, assert_se(found_clientid && found_iana && found_serverid && found_elapsed_time); - assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref, - <_valid) >= 0); + sd_dhcp6_lease_reset_address_iter(lease); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) >= 0); assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr))); assert_se(lt_pref == 150); assert_se(lt_valid == 180); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) == -ENOMSG); return 0; } @@ -587,11 +589,10 @@ static int test_client_verify_information_request(DHCP6Message *information_requ assert_se(r == -ENOMSG); assert_se(found_clientid && found_elapsed_time); - assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); + sd_dhcp6_lease_reset_address_iter(lease); - assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref, - <_valid) == -ENOMSG); + assert_se(sd_dhcp6_lease_get_address(lease, &addr, <_pref, + <_valid) == -ENOMSG); return 0; } diff --git a/src/libsystemd-network/test-icmp6-rs.c b/src/libsystemd-network/test-icmp6-rs.c index be64d334f..8ba21106a 100644 --- a/src/libsystemd-network/test-icmp6-rs.c +++ b/src/libsystemd-network/test-icmp6-rs.c @@ -34,6 +34,9 @@ static bool verbose = false; static sd_event_source *test_hangcheck; static int test_fd[2]; +typedef int (*send_ra_t)(uint8_t flags); +static send_ra_t send_ra_function; + static int test_rs_hangcheck(sd_event_source *s, uint64_t usec, void *userdata) { assert_se(false); @@ -50,6 +53,191 @@ int dhcp_network_icmp6_bind_router_solicitation(int index) { return test_fd[0]; } +static int send_ra_short_prefix(uint8_t flags) { + uint8_t advertisement[] = { + 0x86, 0x00, 0xbe, 0xd7, 0x40, 0xc0, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x03, 0x04, 0x34, 0xc0, 0x00, 0x00, 0x01, 0xf4, + 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + assert_se(write(test_fd[1], advertisement, sizeof(advertisement)) == + sizeof(advertisement)); + + return 0; +} + +static void test_short_prefix_cb(sd_icmp6_nd *nd, int event, void *userdata) { + sd_event *e = userdata; + struct { + struct in6_addr addr; + uint8_t prefixlen; + bool success; + } addrs[] = { + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 52, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0x0d, 0xad, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 64, false }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0x0b, 0x16, 0xd0, 0x0d, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 60, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x9d, 0xab, 0xcd, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 64, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xed, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } } }, + 52, true }, + }; + uint8_t prefixlen; + unsigned int i; + + for (i = 0; i < ELEMENTSOF(addrs); i++) { + printf(" %s prefix %02x%02x:%02x%02x:%02x%02x:%02x%02x", + __FUNCTION__, + addrs[i].addr.s6_addr[0], addrs[i].addr.s6_addr[1], + addrs[i].addr.s6_addr[2], addrs[i].addr.s6_addr[3], + addrs[i].addr.s6_addr[4], addrs[i].addr.s6_addr[5], + addrs[i].addr.s6_addr[6], addrs[i].addr.s6_addr[7]); + + if (addrs[i].success) { + assert_se(sd_icmp6_ra_get_prefixlen(nd, &addrs[i].addr, + &prefixlen) >= 0); + assert_se(addrs[i].prefixlen == prefixlen); + printf("/%d onlink\n", prefixlen); + } else { + assert_se(sd_icmp6_ra_get_prefixlen(nd, &addrs[i].addr, + &prefixlen) == -EADDRNOTAVAIL); + printf("/128 offlink\n"); + } + } + + sd_event_exit(e, 0); +} + +static int send_ra_prefixes(uint8_t flags) { + uint8_t advertisement[] = { + 0x86, 0x00, 0xbe, 0xd7, 0x40, 0xc0, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x3f, 0xc0, 0x00, 0x00, 0x01, 0xf4, + 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x40, 0x00, 0x00, 0x00, 0x02, 0x58, + 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0x0d, 0xad, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x3c, 0x80, 0x00, 0x00, 0x03, 0x84, + 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x01, 0x0d, 0xb8, 0x0b, 0x16, 0xd0, 0x0d, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x40, 0xc0, 0x00, 0x00, 0x03, 0x84, + 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x9d, 0xab, 0xcd, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x19, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, + 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, + 0x03, 0x6c, 0x61, 0x62, 0x05, 0x69, 0x6e, 0x74, + 0x72, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x78, 0x2b, 0xcb, 0xb3, 0x6d, 0x53 + }; + + assert_se(write(test_fd[1], advertisement, sizeof(advertisement)) == + sizeof(advertisement)); + + return 0; +} + +static void test_prefixes_cb(sd_icmp6_nd *nd, int event, void *userdata) { + sd_event *e = userdata; + struct { + struct in6_addr addr; + uint8_t prefixlen; + bool success; + } addrs[] = { + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 63, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0x0d, 0xad, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 64, false }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0x0b, 0x16, 0xd0, 0x0d, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 60, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x9d, 0xab, 0xcd, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 64, true }, + { { { { 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xed, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } } }, + 63, false }, + }; + uint8_t prefixlen; + unsigned int i; + + for (i = 0; i < ELEMENTSOF(addrs); i++) { + printf(" %s prefix %02x%02x:%02x%02x:%02x%02x:%02x%02x", + __FUNCTION__, + addrs[i].addr.s6_addr[0], addrs[i].addr.s6_addr[1], + addrs[i].addr.s6_addr[2], addrs[i].addr.s6_addr[3], + addrs[i].addr.s6_addr[4], addrs[i].addr.s6_addr[5], + addrs[i].addr.s6_addr[6], addrs[i].addr.s6_addr[7]); + + if (addrs[i].success) { + assert_se(sd_icmp6_ra_get_prefixlen(nd, &addrs[i].addr, + &prefixlen) >= 0); + assert_se(addrs[i].prefixlen == prefixlen); + printf("/%d onlink\n", prefixlen); + } else { + assert_se(sd_icmp6_ra_get_prefixlen(nd, &addrs[i].addr, + &prefixlen) == -EADDRNOTAVAIL); + printf("/128 offlink\n"); + } + } + + send_ra_function = send_ra_short_prefix; + assert_se(sd_icmp6_nd_set_callback(nd, test_short_prefix_cb, e) >= 0); + assert_se(sd_icmp6_nd_stop(nd) >= 0); + assert_se(sd_icmp6_router_solicitation_start(nd) >= 0); +} + +static void test_prefixes(void) { + sd_event *e; + sd_icmp6_nd *nd; + + if (verbose) + printf("* %s\n", __FUNCTION__); + + send_ra_function = send_ra_prefixes; + + assert_se(sd_event_new(&e) >= 0); + + assert_se(sd_icmp6_nd_new(&nd) >= 0); + assert_se(nd); + + assert_se(sd_icmp6_nd_attach_event(nd, e, 0) >= 0); + + assert_se(sd_icmp6_nd_set_index(nd, 42) >= 0); + assert_se(sd_icmp6_nd_set_mac(nd, &mac_addr) >= 0); + assert_se(sd_icmp6_nd_set_callback(nd, test_prefixes_cb, e) >= 0); + + assert_se(sd_icmp6_router_solicitation_start(nd) >= 0); + + sd_event_loop(e); + + nd = sd_icmp6_nd_unref(nd); + assert_se(!nd); + + close(test_fd[1]); + + sd_event_unref(e); +} + static int send_ra(uint8_t flags) { uint8_t advertisement[] = { 0x86, 0x00, 0xde, 0x83, 0x40, 0xc0, 0x00, 0xb4, @@ -79,7 +267,7 @@ static int send_ra(uint8_t flags) { } int dhcp_network_icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) { - return send_ra(0); + return send_ra_function(0); } static void test_rs_done(sd_icmp6_nd *nd, int event, void *userdata) { @@ -93,6 +281,8 @@ static void test_rs_done(sd_icmp6_nd *nd, int event, void *userdata) { { ND_RA_FLAG_OTHER, ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER }, { ND_RA_FLAG_MANAGED, ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED } }; + uint32_t mtu; + assert_se(nd); assert_se(event == flag_event[idx].event); @@ -101,19 +291,28 @@ static void test_rs_done(sd_icmp6_nd *nd, int event, void *userdata) { if (verbose) printf(" got event %d\n", event); - if (idx < 3) + if (idx < 3) { send_ra(flag_event[idx].flag); - else - sd_event_exit(e, 0); + return; + } + + assert_se(sd_icmp6_ra_get_mtu(nd, &mtu) == -ENOMSG); + + sd_event_exit(e, 0); } -static void test_rs(sd_event *e) { - usec_t time_now = now(clock_boottime_or_monotonic()); +static void test_rs(void) { + sd_event *e; sd_icmp6_nd *nd; + usec_t time_now = now(clock_boottime_or_monotonic()); if (verbose) printf("* %s\n", __FUNCTION__); + send_ra_function = send_ra; + + assert_se(sd_event_new(&e) >= 0); + assert_se(sd_icmp6_nd_new(&nd) >= 0); assert_se(nd); @@ -141,18 +340,18 @@ static void test_rs(sd_event *e) { assert_se(!nd); close(test_fd[1]); + + sd_event_unref(e); } int main(int argc, char *argv[]) { - sd_event *e; - - assert_se(sd_event_new(&e) >= 0); log_set_max_level(LOG_DEBUG); log_parse_environment(); log_open(); - test_rs(e); + test_rs(); + test_prefixes(); return 0; } diff --git a/src/libsystemd-network/test-lldp.c b/src/libsystemd-network/test-lldp.c new file mode 100644 index 000000000..ee74ebd41 --- /dev/null +++ b/src/libsystemd-network/test-lldp.c @@ -0,0 +1,236 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "macro.h" +#include "lldp.h" +#include "lldp-tlv.h" + +#define TEST_LLDP_PORT "em1" +#define TEST_LLDP_TYPE_SYSTEM_NAME "systemd-lldp" +#define TEST_LLDP_TYPE_SYSTEM_DESC "systemd-lldp-desc" + +static struct ether_addr mac_addr = { + .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'} +}; + +static int lldp_build_tlv_packet(tlv_packet **ret) { + _cleanup_tlv_packet_free_ tlv_packet *m = NULL; + const uint8_t lldp_dst[] = LLDP_MULTICAST_ADDR; + struct ether_header ether = { + .ether_type = htons(ETHERTYPE_LLDP), + }; + + /* Append ethernet header */ + memcpy(ðer.ether_dhost, lldp_dst, ETHER_ADDR_LEN); + memcpy(ðer.ether_shost, &mac_addr, ETHER_ADDR_LEN); + + assert_se(tlv_packet_new(&m) >= 0); + + assert_se(tlv_packet_append_bytes(m, ðer, sizeof(struct ether_header)) >= 0); + + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_CHASSIS_ID) >= 0); + + assert_se(tlv_packet_append_u8(m, LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS) >= 0); + assert_se(tlv_packet_append_bytes(m, &mac_addr, ETHER_ADDR_LEN) >= 0); + + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + /* port name */ + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_PORT_ID) >= 0); + + assert_se(tlv_packet_append_u8(m, LLDP_PORT_SUBTYPE_INTERFACE_NAME) >= 0); + assert_se(tlv_packet_append_bytes(m, TEST_LLDP_PORT, strlen(TEST_LLDP_PORT) + 1) >= 0); + + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + /* ttl */ + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_TTL) >= 0); + + assert_se(tlv_packet_append_u16(m, 170) >= 0); + + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + /* system name */ + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_SYSTEM_NAME) >= 0); + + assert_se(tlv_packet_append_bytes(m, TEST_LLDP_TYPE_SYSTEM_NAME, + strlen(TEST_LLDP_TYPE_SYSTEM_NAME)) >= 0); + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + /* system descrition */ + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_SYSTEM_DESCRIPTION) >= 0); + + assert_se(tlv_packet_append_bytes(m, TEST_LLDP_TYPE_SYSTEM_DESC, + strlen(TEST_LLDP_TYPE_SYSTEM_DESC)) >= 0); + + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + /* Mark end of packet */ + assert_se(lldp_tlv_packet_open_container(m, LLDP_TYPE_END) >= 0); + assert_se(lldp_tlv_packet_close_container(m) >= 0); + + *ret = m; + + m = NULL; + + return 0; +} + +static int lldp_parse_chassis_tlv(tlv_packet *m, uint8_t *type) { + uint8_t *p, subtype; + uint16_t length; + + assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_CHASSIS_ID) >= 0); + assert_se(tlv_packet_read_u8(m, &subtype) >= 0); + + switch (subtype) { + case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS: + + *type = LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS; + assert_se(tlv_packet_read_bytes(m, &p, &length) >= 0); + + assert_se(memcmp(p, &mac_addr.ether_addr_octet, ETHER_ADDR_LEN) == 0); + + break; + default: + assert_not_reached("Unhandled option"); + } + + assert_se(lldp_tlv_packet_exit_container(m) >= 0); + + return 0; +} + +static int lldp_parse_port_id_tlv(tlv_packet *m) { + _cleanup_free_ char *p = NULL; + char *str = NULL; + uint16_t length; + uint8_t subtype; + + assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_PORT_ID) >= 0); + + assert_se(tlv_packet_read_u8(m, &subtype) >= 0); + + switch (subtype) { + case LLDP_PORT_SUBTYPE_INTERFACE_NAME: + assert_se(tlv_packet_read_string(m, &str, &length) >= 0); + + p = strndup(str, length-1); + assert_se(p); + + assert_se(streq(p, TEST_LLDP_PORT) == 1); + break; + default: + assert_not_reached("Unhandled option"); + } + + assert_se(lldp_tlv_packet_exit_container(m) >= 0); + + return 0; +} + +static int lldp_parse_system_name_tlv(tlv_packet *m) { + _cleanup_free_ char *p = NULL; + char *str = NULL; + uint16_t length; + + assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_SYSTEM_NAME) >= 0); + assert_se(tlv_packet_read_string(m, &str, &length) >= 0); + + p = strndup(str, length); + assert_se(p); + + assert_se(streq(p, TEST_LLDP_TYPE_SYSTEM_NAME) == 1); + + assert_se(lldp_tlv_packet_exit_container(m) >= 0); + + return 1; +} + +static int lldp_parse_system_desc_tlv(tlv_packet *m) { + _cleanup_free_ char *p = NULL; + char *str = NULL; + uint16_t length; + + assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_SYSTEM_DESCRIPTION) >= 0); + assert_se(tlv_packet_read_string(m, &str, &length) >= 0); + + p = strndup(str, length); + assert_se(p); + + assert_se(streq(p, TEST_LLDP_TYPE_SYSTEM_DESC) == 1); + + assert_se(lldp_tlv_packet_exit_container(m) >= 0); + + return 0; +} + +static int lldp_parse_ttl_tlv(tlv_packet *m) { + uint16_t ttl; + + assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_TTL) >= 0); + assert_se(tlv_packet_read_u16(m, &ttl) >= 0); + + assert_se(ttl == 170); + + assert_se(lldp_tlv_packet_exit_container(m) >= 0); + + return 0; +} + +static int lldp_parse_tlv_packet(tlv_packet *m, int len) { + uint8_t subtype; + + assert_se(tlv_packet_parse_pdu(m, len) >= 0); + assert_se(lldp_parse_chassis_tlv(m, &subtype) >= 0); + assert_se(lldp_parse_port_id_tlv(m) >= 0); + assert_se(lldp_parse_system_name_tlv(m) >= 0); + assert_se(lldp_parse_ttl_tlv(m) >= 0); + assert_se(lldp_parse_system_desc_tlv(m) >= 0); + + return 0; +} + +int main(int argc, char *argv[]) { + _cleanup_tlv_packet_free_ tlv_packet *tlv = NULL; + + /* form a packet */ + lldp_build_tlv_packet(&tlv); + + /* parse the packet */ + tlv_packet_parse_pdu(tlv, tlv->length); + + /* verify */ + lldp_parse_tlv_packet(tlv, tlv->length); + + return 0; +} diff --git a/src/libsystemd-network/test-pppoe.c b/src/libsystemd-network/test-pppoe.c index 0d419aa17..dff83eaf6 100644 --- a/src/libsystemd-network/test-pppoe.c +++ b/src/libsystemd-network/test-pppoe.c @@ -139,8 +139,8 @@ static int test_pppoe_server(sd_event *e) { "-I", "pppoe-server", "-C", "Test-AC", "-S", "Service-Default", - "-S", "Service-First-Auxillary", - "-S", "Service-Second-Auxillary", + "-S", "Service-First-Auxiliary", + "-S", "Service-Second-Auxiliary", NULL); assert_not_reached("failed to execute pppoe-server. not installed?"); } diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c index 2df63537f..bc4d4c9e7 100644 --- a/src/libsystemd-terminal/grdev-drm.c +++ b/src/libsystemd-terminal/grdev-drm.c @@ -2060,7 +2060,7 @@ static void grdrm_card_configure(grdrm_card *card) { * headache to configure on dynamic demands. Therefore, we only * support it if configured statically beforehand. * - * * CRTCs are not created equal. Some might be much more poweful + * * CRTCs are not created equal. Some might be much more powerful * than others, including more advanced plane support. So far, our * CRTC selection is random. You need to supply static * configuration if you want special setups. So far, there is no diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c index db87ede76..3b3cf2737 100644 --- a/src/libsystemd-terminal/grdev.c +++ b/src/libsystemd-terminal/grdev.c @@ -708,7 +708,7 @@ void grdev_pipe_ready(grdev_pipe *pipe, bool running) { /* grdev_pipe_ready() is used by backends to notify about pipe state * changed. If a pipe is ready, it can be fully used by us (available, - * enabled and accessable). Backends can disable pipes at any time + * enabled and accessible). Backends can disable pipes at any time * (like for async revocation), but can only enable them from parent * context. Otherwise, we might call user-callbacks recursively. */ diff --git a/src/libsystemd-terminal/idev-keyboard.c b/src/libsystemd-terminal/idev-keyboard.c index def8ea5eb..6ee3d8150 100644 --- a/src/libsystemd-terminal/idev-keyboard.c +++ b/src/libsystemd-terminal/idev-keyboard.c @@ -631,7 +631,7 @@ idev_device *idev_find_keyboard(idev_session *s, const char *name) { assert_return(s, NULL); assert_return(name, NULL); - kname = strappenda("keyboard/", name); + kname = strjoina("keyboard/", name); return hashmap_get(s->device_map, kname); } @@ -793,7 +793,7 @@ int idev_keyboard_new(idev_device **out, idev_session *s, const char *name) { if (r < 0) return r; - kname = strappenda("keyboard/", name); + kname = strjoina("keyboard/", name); r = idev_device_add(d, kname); if (r < 0) return r; diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c index 78efc9d7c..63cd2a5ad 100644 --- a/src/libsystemd-terminal/subterm.c +++ b/src/libsystemd-terminal/subterm.c @@ -41,6 +41,7 @@ #include "sd-event.h" #include "term-internal.h" #include "util.h" +#include "utf8.h" typedef struct Output Output; typedef struct Terminal Terminal; @@ -160,16 +161,14 @@ static int output_write(Output *o, const void *buf, size_t size) { _printf_(3,0) static int output_vnprintf(Output *o, size_t max, const char *format, va_list args) { - char buf[4096]; + char buf[max]; int r; assert_return(o, -EINVAL); assert_return(format, -EINVAL); - assert_return(max <= sizeof(buf), -EINVAL); + assert_return(max <= 4096, -EINVAL); - r = vsnprintf(buf, max, format, args); - if (r > (ssize_t)max) - r = max; + r = MIN(vsnprintf(buf, max, format, args), (int) max); return output_write(o, buf, r); } @@ -459,7 +458,7 @@ static int output_draw_cell_fn(term_screen *screen, output_printf(o, " "); } else { for (k = 0; k < n_ch; ++k) { - ulen = term_utf8_encode(utf8, ch[k]); + ulen = utf8_encode_unichar(utf8, ch[k]); output_write(o, utf8, ulen); } } @@ -625,7 +624,7 @@ static int terminal_push_tmp(Terminal *t, uint32_t ucs4) { assert(t); - len = term_utf8_encode(buf, ucs4); + len = utf8_encode_unichar(buf, ucs4); if (len < 1) return 0; diff --git a/src/libsystemd-terminal/term-internal.h b/src/libsystemd-terminal/term-internal.h index 53713dd64..8c6a00188 100644 --- a/src/libsystemd-terminal/term-internal.h +++ b/src/libsystemd-terminal/term-internal.h @@ -472,7 +472,7 @@ enum { TERM_CMD_VPR, /* vertical-line-position-relative */ TERM_CMD_VT, /* vertical-tab */ TERM_CMD_XTERM_CLLHP, /* xterm-cursor-lower-left-hp-bugfix */ - TERM_CMD_XTERM_IHMT, /* xterm-initiate-highlight-mouse-tracking*/ + TERM_CMD_XTERM_IHMT, /* xterm-initiate-highlight-mouse-tracking */ TERM_CMD_XTERM_MLHP, /* xterm-memory-lock-hp-bugfix */ TERM_CMD_XTERM_MUHP, /* xterm-memory-unlock-hp-bugfix */ TERM_CMD_XTERM_RPM, /* xterm-restore-private-mode */ diff --git a/src/libsystemd-terminal/term-parser.c b/src/libsystemd-terminal/term-parser.c index d8206a46b..8dc1da2f9 100644 --- a/src/libsystemd-terminal/term-parser.c +++ b/src/libsystemd-terminal/term-parser.c @@ -151,49 +151,6 @@ void term_attr_to_argb32(const term_attr *attr, uint32_t *fg, uint32_t *bg, cons *bg = b; } -/** - * term_utf8_encode() - Encode single UCS-4 character as UTF-8 - * @out_utf8: output buffer of at least 4 bytes or NULL - * @g: UCS-4 character to encode - * - * This encodes a single UCS-4 character as UTF-8 and writes it into @out_utf8. - * The length of the character is returned. It is not zero-terminated! If the - * output buffer is NULL, only the length is returned. - * - * Returns: The length in bytes that the UTF-8 representation does or would - * occupy. - */ -size_t term_utf8_encode(char *out_utf8, uint32_t g) { - if (g < (1 << 7)) { - if (out_utf8) - out_utf8[0] = g & 0x7f; - return 1; - } else if (g < (1 << 11)) { - if (out_utf8) { - out_utf8[0] = 0xc0 | ((g >> 6) & 0x1f); - out_utf8[1] = 0x80 | (g & 0x3f); - } - return 2; - } else if (g < (1 << 16)) { - if (out_utf8) { - out_utf8[0] = 0xe0 | ((g >> 12) & 0x0f); - out_utf8[1] = 0x80 | ((g >> 6) & 0x3f); - out_utf8[2] = 0x80 | (g & 0x3f); - } - return 3; - } else if (g < (1 << 21)) { - if (out_utf8) { - out_utf8[0] = 0xf0 | ((g >> 18) & 0x07); - out_utf8[1] = 0x80 | ((g >> 12) & 0x3f); - out_utf8[2] = 0x80 | ((g >> 6) & 0x3f); - out_utf8[3] = 0x80 | (g & 0x3f); - } - return 4; - } else { - return 0; - } -} - /** * term_utf8_decode() - Try decoding the next UCS-4 character * @p: decoder object to operate on or NULL diff --git a/src/libsystemd-terminal/term-screen.c b/src/libsystemd-terminal/term-screen.c index 51d93765e..0e38ff41c 100644 --- a/src/libsystemd-terminal/term-screen.c +++ b/src/libsystemd-terminal/term-screen.c @@ -51,6 +51,7 @@ #include "macro.h" #include "term-internal.h" #include "util.h" +#include "utf8.h" int term_screen_new(term_screen **out, term_screen_write_fn write_fn, void *write_fn_data, term_screen_cmd_fn cmd_fn, void *cmd_fn_data) { _cleanup_(term_screen_unrefp) term_screen *screen = NULL; @@ -3184,7 +3185,7 @@ static int screen_TBC(term_screen *screen, const term_seq *seq) { break; case 3: if (screen->page->width > 0) - memset(screen->tabs, 0, (screen->page->width + 7) / 8); + memzero(screen->tabs, (screen->page->width + 7) / 8); break; } @@ -4107,7 +4108,7 @@ static char *screen_map_key(term_screen *screen, /* map unicode keys */ for (i = 0; i < n_syms; ++i) - p += term_utf8_encode(p, ucs4[i]); + p += utf8_encode_unichar(p, ucs4[i]); return p; } diff --git a/src/libsystemd-terminal/term.h b/src/libsystemd-terminal/term.h index eae6c6352..1a78a8118 100644 --- a/src/libsystemd-terminal/term.h +++ b/src/libsystemd-terminal/term.h @@ -112,7 +112,6 @@ struct term_utf8 { unsigned int valid : 1; }; -size_t term_utf8_encode(char *out_utf8, uint32_t g); size_t term_utf8_decode(term_utf8 *p, uint32_t **out_buf, char c); /* diff --git a/src/libsystemd-terminal/test-term-parser.c b/src/libsystemd-terminal/test-term-parser.c index e8d5dcfbf..e22614d06 100644 --- a/src/libsystemd-terminal/test-term-parser.c +++ b/src/libsystemd-terminal/test-term-parser.c @@ -30,6 +30,7 @@ #include "macro.h" #include "term-internal.h" #include "util.h" +#include "utf8.h" static void test_term_utf8_invalid(void) { term_utf8 p = { }; @@ -74,7 +75,7 @@ static void test_term_utf8_range(void) { /* Convert all ucs-4 chars to utf-8 and back */ for (i = 0; i < 0x10FFFF; ++i) { - ulen = term_utf8_encode(u8, i); + ulen = utf8_encode_unichar(u8, i); if (!ulen) continue; diff --git a/src/libsystemd-terminal/unifont-def.h b/src/libsystemd-terminal/unifont-def.h index 2b0b859eb..3847a2cf6 100644 --- a/src/libsystemd-terminal/unifont-def.h +++ b/src/libsystemd-terminal/unifont-def.h @@ -94,7 +94,7 @@ typedef struct unifont_glyph_header unifont_glyph_header; * +-----------------------------------+ * * * The first byte specifies the width of the glyph. If it is 0, the glyph - * must be treated as non-existant. + * must be treated as non-existent. * All glyphs are "8*n" pixels wide and "16" pixels high. The width-field * specifies the width multiplier "n". * * After the width field padding might be added. This depends on the global diff --git a/src/libsystemd-terminal/unifont-glyph-array.bin b/src/libsystemd-terminal/unifont-glyph-array.bin index 46f150c42be00db2250c1fee3946b5686d7e35ae..84aaab7c18d9c3b130d31e51f721fa54c3c9a6bc 100644 GIT binary patch delta 59194 zcmeHudw3hwweOzMye!MoNS19$maUPjL?(nFClpL@?6EvaoR9-1C$vx~anbD}1!EpPaEd>#BOMo;8NI@k=zH84& zmhG6HzwUoC>l;1xUVFXvZ}xkJW5d+g#1E*Exg6_6E_B|(^SS>vtGzbv;3;vibSP}$ zZ$j518O07h;Ei&n?dTe$pa{@v_2ot72j|!A=UIekWK&33{-{e$dqNonn z3J1Fuh}YoEU7orMB-1V9G%8#&9k$pqs-JaX`8mD}Q>*wYHOw-3W`um%B6BV6kIUVJ zSq+~tbGA&_BGXz~BAOL_StK6ZwY`&3>v>U4mAY{DA0f-Z`2!m(@#gs^j*TJ#3HS+z z=~8^f29sI6uc`K_AIen8GSm*#fjZO=N_|7WaUSg1_YAA17FpDk-K&ngAmG;$jD$xH zGY;H4zcHazR6wP^T6Hk|MA(NfzL^nScBGRp|4sgNAPK1w>%44c7Re}vLyw_Fb}n{jT_@`A=qQg?jk= zRciX>ddOzffj^nm%2#?Q{-FAbonjfNnl82PXH{zI|12nVATzQ62}s2D-E@^I{;osq z*u>ZsFi)o@#2_9~_|{*zFH=W;cYy6cJ;-@*?e9ahIYlGwtEuZO>N9`r zP&*&Z75fp^@_vj&?`5ETuks)O&F7^-hO$_0=(`vIJA<-jhZY z`91YMaNwZ$!A5cDlS=iTPbK`wHdesWuc2N#IIG&p3CS^v>i&}2{tt`#;y=u#3^*J? zO<;tG8*XE(lksb*eH5u^b@*m8ZW?0DYUjsJ+{95L-gkM(tH!cIO&B6AK~+oz4pa<4 z1)dr8)_?jTCW1P)nK3z0E&j@-RFy|W^-xWq25tsCCd2@H7~$sYshZ@X>#1Lsf`Mk< ztLNbl?qJ}-KVweL+ek$%0P{|2lXoD{MI+AZoy*+RcC4)_gla(^xoG^g05b=VEoT^f z%Y&?>HlN{=uCG(Cu=rbjl*Q4KZtMbOI&}gP5RPr40zaO&g`&Jf03Rz$xjMr@m7Ug3 zL}(*WIJvBc+Or5>_&62d8^Pp@kR>UOP@XVP#YzSl$%NN!r{`f`D6gSGWI?514d=J~CwcMlx^8X8jeHa@D`J_V>y*@EQlnzw)9E=G2RcfLt^ zDk)@&u`(y4m78$AoSWz6P zo9LSIKtK)!|Cv;YP z{DS4W{Sm^44?oXWo1I#d)rwjXetoCOpA2Esx38{(d=yQQ_Q;DI(1AdEOb9o)sS1~# z;nR{zPz5kpwcj{*+T=|-{%*Rz84v%(Wabf=wgwI1b&DuJ{2`Vezzs{NDtJ&W)F$lz z52hM-ETJr>HK>tfxN+CVj8$F#b*(SJv45ij+|^*<)ui_daBI*3Ao5d{JPgffKk@L@ zA&#WsSMG=QCCpl?B$NUw#utJ6(1WS#zV0sxqF?Bw`fsZs8YDr>1QrnDHAhe%5D5@I zeLmw$RxDtCe+>_ij4?42zA8cc%m}%{!S-OgD-1)0N-RD>S&~iLnNyNBh@fIzryy!$ z3TTd!U*6BWZXyj6>xJqH;?@gcJaPjEZR3SJu@-A}Ge4fJ}-bCsBDHLZ(J&O3r z8zJyFa613>guhB%%ayW2P)GG(uUnJu1kb_JNjuqkNN`PBLku7(^-u)t#aAq$ta$yc zCZdefL$UjD=0OUl93}_rA_#>J&5b)p7_hPEuUsS=?;!dB3Q(xzWWS5ie<|r}{te|?66CU6a3OPQVf7(u14g<-?><`N0IafuLq&(8Xi@7AzSn|T=x1If5$)O{Wvt7lUs z`4s5lpS<^c^)9(Q zqF*F`IG;URTI$rA1nt?vJ1$|}$|<;2gMI93+`f?&lOOl7-3*TPa27RScj53BsHM!?tU0;&9`+(i{nTj_=W8d z(9>_T)})wVyD3{6T8g3|Fp921>p-k84o-~R%X%oy1gZx=`8elO?{Bc;+MF_tE{df|oqOx*dhYzW!Jw9#NFGI39e0t+K~k+krU-%=q-rS+_kN$tT7O5(uj(D?}BcKDw1@Wr%>vyuNtk?*6IV zQ_@F?XgS`-=yov5hJm36hvFKo-5^gUD+8ksfj&ZO&lHmhw<8{a(PA3q+S!F^Xg8Ely<-Rp_vQ@QozJ3zK$ zGC9hu+AuWK51fgi!J!+#OG$8r`PB3}h7m>FACL6QlO)CKPKd%xEQmtgkzh~>$N_n@ zm5$H~9b`iPk}uji3d{i|5DeBGnN6UiNJm;Dk%$7c{J0!}|H^E9p%Xzy0foyodGhDV z^B)Q1`4rHqL_e1?bV3S(X%UUUZz(RtXH%?utOVLdHG!WiZ<6mgaaayWN*&0H&J3YU zCmMFG*uO1Nq!ou6WO^1p`>uxlS0(I4I<$3GzHjc@2J+a1JK;~XCi)V6hd!I+)ASSB zFx5{K7%v58mKbp8o0E(hPoA%2mwW$ti4}=^fj&!=BuWmI%*yxKuD<=CF7Z!I9!NY_ z9_RWMmyz(@`_Ek^`%Civ`oSCjA^)t3bw{=(zFCOk?DD|j8%b!kCAQ`* zEID-hYyx*T>|L>UTmQB=@D6Sp-ZngIm5}JbNE@;6StNc8hC9}uQk4!tMluznVFW@( zwYEZfl%$(t2tEZMevrt~>YMy1TrnsaV`2i3Ed_(r7|bK!n#pHN=_6*FCXYy*U7jhH zw<0Di($sz)BPf%Bh{9OjDY57fl!_6f3x;csf;yMS3!-}B+D0>yB+qeC3Di$GZs zt{%s1eD-Vu^y8o}L*x;O(a#as6^`kQ1+Qo4vuDFXhd>m+AMO%=C6q)9)05OpsYRx{S248qE#PIWnD*2rmdEZMQ~&x+60M59d#l#=hyQOrnmXuYzdNWmeA7MXKBCY3kmNYP!=jY~{) zrpJ?Ytl@yv-t2WeQ{1w^oFhTTdCo8+kD7f&Bq#)iL9t$|k|O@62+YGP$jk<=NdxIN zS{^0Ck=YF-iU~%Fh-sz$jHJQ3hy~D31O{OsG)c2OCM29wIV0ND+V79+CKd$(7gR~m zQLGSUN8S3*t&*swIudE^Z|#SHQ-IXTY*kV;FtWaNFL}7mMKy6GbV3^k_3I-#7#C^M zv`}j<@F`bV0$jnsw;x8o5n=mi9ERvHNQZGZjOP`Fq;A*p6lJ+Ko}V0c(_~an*kSmu zu`^1XuuJwoxKNInt)!*acjbUCEoFC&NE& zT48Es`tYJB*g8ks2{}%t420tS3Yi8>mh0a}-$QSsA(@mT$u`hOOwkE+_g=uciH>_l z?-|_|*+x_oUTsFhKyu_BNQC53<%q7jk_L}c&#`kI%j0>|`iV59;K^crf)oc)aVWX$ zNLyUmIDKrcN4{8IGZCasoAA(g_fJl+I(`n*BXF565NQQ8hbToe#tdsOL0u&*OR}{N z1umj~TZDK<{!NCZA1;{B!KEjUKxOAklZ?K}xtGf-D`ZASCV#|1d_T

`WU}bS!fB zXdI%_roi+C>fh-M3M2yC`tONAI?ys@X?|j;6(Au3inPV`0u|-$qWa#`_jq712 z3IKScll&yvaYXlj`)I*LKi&c9jcrQ2Ki+>g*m$?*P+j8OV9zv8flD)+Ck?C2+)c0) za1xW4*eLj{k*p~3I^1^wS7|4((a=Qjq{Q=8C6eBNn4=R^i5{UVj@%n4(2C&X1aE2l z9`H*i1vKSRrn{>rYvIw{Ws2PQM3%-CCP>_^yp#cd^C63CkBJ0}ZZK+_?9_B{$%XP- z+!bcJwmh~pZJD35RU-JYT?;Jn1R{bTfC)Kx4H(LkUe$%?A|C12E{(b1NPDp0^u2*) zM9C7dM~19}GNQaK=4;=kC96{%rHv z&7W+3fAczUv7iVKKF>OnJ;+Ouyx^eB(Ay}yVH@XrJ zz6L9{tKML(IQ<*8QXMWA$c>M^2>Z<=M`6M3&{1~H`PIIlrK@OM^*YLY9@unQ=OPrF>f;Ps2IUwmjQp+30oKHN6C{CM3FvQd%T^$+%> z&L%N3Ez`Rj4mC`e-oE?oUrkIzbJ1MOxGxKA!=JE?ti1tU0s8=Cb+HMphsDUf>bl3O zlgwxAKNw$%mCU;w?dCBi9A?_h1NM%RVfOL4tFKvoPwn+cO1fxn1r<%PX=}E&+nOO< z-PUnm7p%OUo_j<04Y^uaL@o68eA<_7?%8^1%j**leDcQI6Cb_*$@}kra@*6lTU(wb z_7wSCE?AO*?mc#U!oQ0efOUYul8%*Ed?+czy#gOZ3oafd(8^dwP35>pk21NpGfkqBq(T?ZG4SIG4C({A})QE(^R98ZSw$boBOY z&8HJU6B#;p^jV^eP%hUy-aD>y>l)7<8tw=v)(48k(6@aCN zbNC>QP=QN=GF@O-&--qVokl=p@Y>A|auO6JrytxllE_R?tSS*DU+M# zQ~2;rj1!BCEew8l6D`6H0$T!W-O(JlDd54BsS=;QlykEBnl=coGD||IWg^#Uk+gi* zIzC0A>7+4(RnxCph#T3VqagC&35m)qGZ84$4Y6v3eZW}0esJpmTcwU{;heNyxLsrD zCgN#?*R?YhqD;6Qng(r~oWwwPck9yycdK+u$-@XX6hAdyGZI;V*=KhQ za3VTkTwfrZewKHVy(xqmg)mIBr{~~f%P4b+0{f?HbE}X-HVP`te2N%kit(wPi!IJ# zT?Ej==%;8Q3QX382)wYr0K%d6V$XBc__`OkmKLH7Ay{2Pe2hmtV*X`}sVp#O07G4{ zc@9Bj$Yw^BT|i`K7Gw`vWhZFw#yB2G}i#%6t?f8 z$}4m?3W%_!DFioua}({hL4C#O1U(SV(F5>}TUS!$c%X_CqIovZO=$KwPlgP^_EtVD z;09P+yqGM5AlzN>oe#TDvcfMU`J}0Qq{QUIfY28wF;6n4GBQxySFFLpuPmrIM<9Wa z{^aCEo#_=$cpiyWX_l{e$e8!X}a;I7aoL$yNueZ?}=9;yuw#nMa zg{Sku{#n}B)za8P8chaSTD&c$Mqd{m`vdK~kqcWJYn$}KVXo2Y^;#SGu5(oha73Ub z;}V3zsTr+#wq>TPBLBd1uh^Vle$$o-1-#=Ss=STQk}(BTw??8MSa_`|n?*#1f-@zs zGe1c_+6ty?z;;?|AqdcXhJ|RBv>$Moz-{eDG7&3?79R-3@+jr8MSFpfrfH78Eyuyp z9KvYp&B?$j%W`M*W7LVrbK!JJNNyg7?Uo?4-GC}o5o7{POAn3h>u47o`Uyv2R2{c`*U(A=bW%==cZADXeGYsU(_A1$6 zB~9M|SBaNg#_|@3zetB^y`jdau%xLBVVq9B)O0>R1I^G3^1-GtRKqlRP;Q1K*wV4`D$k0lOAd z_gg-02C+mqsJIwDr|`jJ+rb|dK#Ih)9EAg+5|OU$2u4DDX1b*5`wUqL2`oa&;r6bCed7!L#*&+ z8XLo|4Xf4*%xs1#S_Q2s%-TpXxNTWeR%@MMd^=SOIo{R-H62aC#4ZarfTai0WP}g> zfvdqk{3GQq(|S^HjaU%H)a4W$)na)(@(Ih#*R_*q6$O*=l5V^$-IATifqKX{#dZpu zvk8&j3XnpQ2-(t>PEwb|nSy1y0D>w(3cJ$QunQh0nbrirc5tItKT4qWve4t|XA&A= z>Zu99{i*Ena^lyPg@o&fVN-81C@x$UX!OVcm2~h^zg-$bku?kGHHdBQuc zhFL_IHLI~0Lp5RFjnsLR3qScIx|&$R-=sA+0qk4Mdy@wj^H*B&!dJz)$@&%iM#`H5 zr3EVfu7r9|A^hk{{)U=f%?v$n4O$H}m@ffOFb-YLH$a;Wb3~x#T>an*@jg+N&bX4X z%lZ8@{$hv4YR@(ohHLsa!dH$v89h3@`q6c+0ueU98Ny-6JCs)$)>I^ z=NJ8A@|6pPlb2YUvw?(8&DrhG-z>mg0=GH&{LQ5gzhx!GZE0v3ax%UB2tKyjT8X{e z1atEK%Pn7jx-u7$BGTINh}4SU6D`lK6jlpuNjF{gA5|jiX-U`xVUU!KF)bPV!Vd*c z@|3&mP0kKtopK=7ia6LqNn3rHd-@h?|yMGu_O3l;6WIO zQIB$gWbM6WADW0`O{b-w=JxH~_snz0_dW8T{r~ywKMo{!yCx`ss;9+d_&a4kVXL9j zB3n4Y$t!e%q_jYK^5dbhhrj41k)Fsgva=)D-hRZ1LYcf(c-@$-B6;YYvbeRDK`mKn zdO!A6N9ZY>OsdDhtnY>B~N+dhs8%-7uC{DI zsLRrVDVvrr%$?^52y@Py=kSZ$4?I)}cUAJhL#{O!IZC93u3!C4kjiCPSCBcW5hcYJ zT&{9~Lyh2QGo1JPtIJ7Wa8q*GUtQ0v#6 z#x{fq<+M-ug|GUEtEpR|9atovE8ux1SFr`_f=(Y+O7K;*$B!4AJheD>v&WWvL-4Gd zi(MCbJY|yB4g?UHrC8LpVqK^W%5zg>Xd;OejheIuX*F`F>%Losr6sIj^TMhEX{A=9 z>!AY*0J7;RSWVpezA6`Ux2iB@PSb?{IBS7jK!@lARCGcv} zO0bea-PpE-ttt&eT=a!B5q~fT7AC&3$kV1B-^TAAb}zuGZ_^?kiLpX5v&eJQj0GOv zgbK3)7)V~-Spx5TWSTwURlZ`V^)Qh&rw3sjnns_JbNOUsU2Sc0MVPICKZ=PYn!3mV zPY)h@*u$7xnqpn z3B3wA`+ov{Z-6>w@RJvq%GL1$0=)jjAQyi5R;C7fb8dkpJ-r2g?-o-XRJj1<2>ycV z?Rocz*AZQWU3G5HVDJp@aTrpB z&vtWZGsN5hb1yFvRNumiGAI1&fl*KgFq&1^j8&24&sa5!|XSq4H2-*$YKhj?IcnabH+<3&v3-Bre7^6OU1z0wpwOBeJ z3hmI;LywGLbHNGuFv!BxC9tsor}o)3=oav;VSgRo{e8x4?$W|5=b4@J&==4gt;wIB zVY&%|W7{yN>_zlbc(gdg5>oe+R8(2OUX+NFkoQ7z<_}P0|N#I3=9|;Ffd?X zz`%fk0RsaD1`G@s7%(tkV8FnDfdK;p1_lfa7#J`xU|_(&fPn!60|o{R3>X+NFkoQ7 zz<_}P0|N#I3=9|;Ffd?Xz`%fk0RsaD1`G@s7%(tkV8FnDfdK;p1_lfa7#J`xU|_(& zfPn!60|o{R3>X+NFkoQ7z<_}P0|N#I3=9|;Ffd?Xz`%fk0RsaD1`G@s7%(tkV8FnD zfdK;p1_lfa7#J`xU|_(&fPn!60|o{R3>X+NFkoQ7z<_}P0|N#I3=9|;Ffd?Xz`%fk z0RsaD1`G@s7%(tkV8FnDfdK;p1_lfa7#J`xU|_(&fPn!60|o{R3>X+NFkoQ7z<_}P z0|N#I3=9|;Ffd?Xz`%fk0RsaD2LAtHKvctLN|NWDoa;V@UtC66)G%w|Wz>RDj#m9_ zfT7WN6dztjRY8uGwPm`jB)yL9vf47_*Ble2an3PCW7>cG$U@$N&4)u`@|I-i!7vUt z@*+O=e_01kJ3MCGzlfJW7Ng2mhIb$*5|N0h`?zxa;&Mj7cbyD5)W02Ys_CT+e&l4x zyz@TJsm^E3ID8pp!M9vYRbuh)Eb~wo#o)}zkifPh0lDzjEnF3Lz7ulbAFW|s>bKsp z;Ds$FFP3dQ!!xJ}F^Ey0^jG77cS2T7-^V#Xs8x-{tZD}@5@T3mj1#~4PRRYxr@Xn0 zA#zbYItt%{`sRW1GO!e=7exr+hId0X>H?NiW5WWgWvTX9c?B>7O=yKl@phCz_3G_> zc}1bP0}%>n6j5K^Q-Md{4LPWGyzWw}9M5AsW)o!M+usXS<4swUP}YJJAYzYDh}E|i zvX%H}3t1fcMMvAme#O7kH` zt*BM=RWO(;-pq6kK)*6fIL0;Wti0oh`l$&`Q5gp!i8`~i9jsT2TQ9!w-H;DIzM8e*Pu~x@c)g&2 z-I-7w-c9iqsFHwIeAF_wRV$$FO#cEZYHfK0 zDMss05xLae=_o2ctJDfI#d2*&BQlgx{}{wdry?Ly+i5#O)p00e5&z${_G|5PgZ{lA z%vxuE&)Sc(&pvy9&szJu`pHA_hnGJb-#j9%8vCV_@o`)JF8!~4Rrh=8sx2RtujrQ> zol2_Bm!^s{XU9&DHO3mZ+&j24olCDR%RM`xe9OpT8!|F>bovEFMQyS7 za+9AMsHPoDmTy@ws`7HRd}g9aZTlPSZ2DWOM!jC0t;&r)RH-f)mnqAQN);2JIXAd} zSt=I$LTpxUXsRxEb-JXeH8z=KK0lp^b;c60EkC^D>ZH20CRLJKa$mWs+7%zP<@0x6 zTT|2-D^`;(PBrAN>f5YNewa>gIkf)jc&_c4s@#cwRcrp=sx3<%eI}J#-nY1@J+>tG z(7Yk)(0`|k)&4t^jcW4?$x5~C?qoK%`H6bfeG`gQo=T*P&X1k1c2}o{T-2|>8BojELEGE@R#x;99Fw8OJs9@dbgkYkdBrd z!O`wHxrQUdRmWe73=9Vr;=tO+Q?*;3+?|f+5_@WL}zm8Z(Y(gvAC)cN^5~nV$BW8h6}h41pUZV$Sf0CU@9DX*2TtZr|BnhaWp+H9JL5mf`gP6k zUbG7Tx;jthx?jw0S$**8%Enl%^W>tQ`Q7tZ&ELAHr}HE<;O2MDKSsD%Y)kq3|4^=8 zJdmv@k0qBUmlrK>Ts}G08pD6;k=aE9Rpa+k=>IRJlDUi1W$1jx`B&rdTmN2NJUu?B z-_iL!bB@kGI)7*9Nww*wR84;6SK^PxIZaJ@v#3s8F+Exb!l?alGm zQflA5@e1{~Y+{gFbzQvb@zWQ_Y>kVB?kIg&Qc{2ZvKgQ7~ z0k2T=1}CPeL(`JU{KgOCKOUf79-P3z4Vi&z*R*&)b#;3@sruiM>94Mzo-9{yO-rWo z8;cXT(MFF;C-Xl)Epcs;`tzv7fMoZ)RSVS%RTv(=gif!Hj7n6iL`|YuJ$6}QpgQpR zM0s-Sysm}nlA6Tu+_85Ds(We@6-D#97ph0-$h0F2s#YJ+Iro1V=fFhe9nYVU$UlEZ zQJ;TMqgBx$^}Dl@Sv64=l@}eG*QMT5MZ?sXv-P1e^)-?XsG>@BM}1KZ!OGN6|4=ko zO(JRUABwUhm85zWZk^YoHva*gh4lO|Rdnx{)mQ&gRIaw~C~8oBj=;pC;$%a<@<`FD zR`u}WWT|@a3(4}t)_Lmr(Mj$H1J%c)lNHntzJLQ~FG&tmGrzzGzD@_a=m5?k#8Y(O zH|78v`Gk&)SPIC*GZ}KxnK*C@9k@pyc!&<{qyq=^fxqBDzGhVN^~=@i-$_;`bsg%9 zs?{0aN%mLG4MlbNiFYLbt1;KMxTNSCvD;|8&0oAB`NtyapCxL-Q^^YT<+13`M>Zv^ z)z5xhG=QW^_4rtH>WNR`*rku@V`b{UpG9LKwJg1JVK-l-$BL@>fSU3gk^nE)m;C*M zi7Hmr56;rIE8|<$=1s|A=3)VIUn_&uO9i|x@vW@B2}WcpOw{V`9BXyZS9-8xNo}O)v?w1 zU5$~pQcX^08`P_(rMBg^6{jm~N-S0%E5~neu77?=Zhu8_e%I$x&54Rxu}kn98XFb6 zSpU>*=fnr9+L5VS2ON!UiH*Up6=U_;_}vowUH<=$O#Q82zoyt={PxlSP3BMD zk-96c4t1rHeL7=!Bx53Qz8bPJH7LLN`>AX^_wc@SpIcF$cGNtU+w(wOZuJ*R)XBS$ zR+X>&KdCPaP#U&dMH({?l_pPRrfxWqPrSHklJ=2J&;mxzaLCzZ3^A* zoI*%7>@9tEnVR{Q!Q>Y`l=@x&%IQ01G%s($Z~ONWD-$!CFM3B^{9LNG+#aR08O_so zsMSxU23B;m?YOOdMf=M3JKG=npsi!_hidursoJs`$vYGGZf7$9t69&bvM_LGf{xzV zbf-2zNHW`w--_E3w?YM}@tPEJ7?l4$)J{>#k3h?Ulse$9(`AXIIEA8+6sw>`U zEUq1$!BtG)LhAqezgJ$|+>t@z-3qMjt0D-p=q3XOi`% zj&}WX_NhGhbsP@yTuwUv0hP+x=^S~@rEA*p>sT{m&BbdjU31mk#$Ezn);6@Q-tBqZ zo!js51?-H}xGj0-VcQwy-#ZUSGp6G8_KV`~JG`cHP33C(HLc!$Ut&#y^xOv;*J=BB zThajm0~99^@VV>V+CC0K76 z!yp-ITHVgS6|2oJnz62kwxMnHZjW#m8NiwMy>{vvKXBvvyVl>e0>71a-FesQyB>zN z{;uvD!;BMH5%g6C(Tp3mmA93* z#g^;LFeUfDVp+gWXK;BR)TB?$nu{9rxbo!{%gbExqPSt(u4#OR}Jt;ze=i9-3M{wLHbYy7Hmrlle!-mb}v>Gp?;| zOtvN35>vK!pmnAkrbp8v;;)iXe+fcVv?bU6#471#2n7X|qF{+?s=0eK$U*Fc$cvGZF%mqi@XLcm?Z&t$Q zjSf)Rk(hG04YQCbhxJja%k=H$A~j9st4Cd+qsh&==1zBYnl-+ovc0LjX>$AI_BMS% zf&Ka~&#yec60@rH?fB2;HtWWYruO#9E85%jOiOpID{e&JX>VUaIhqzc7ai_{b{xfp zOte={KODV;nQgVBhZeW5?C4mD$?6^3>Hi%a7hXft)q&-7xCw_>;BZq%$3<$=Q>ogD z9UaXp6ZY59JY|OjH{k^Q2;BL6s;*pPVF71!(4?7Xx53fmtfXqANwYP4m@Qm0laqe_GC8RZK9#Dg*wMC9Pi^S`GgeM#%P?^bOsu#)(UrJ8v2sO6 z$E<7Ebj7S>N7B}W%SSaFSb5X$9Euc z%bHGE$%Rj#RIhfYM)ajptwcFjtWfVgpQ=YGr*=>Y>DRTr1OGAJwBriQ`c|wEwJO)` zOULPlmR$CHDtj(3KnRPX&}ygm^#k2IG)A>GVZdp^7=53PJUL$U-gzoHbW$MnEOSU_j zP@V)v%*xZM2L3Ue@%Mkvlr(SeNH8yQVYV5C3Ows&ng6?pn~UGT|GG>j2a3}WtT zMTaoLE&k;tm6ueWzy5;t9qk?M`rIpS>}aQ9s(nRA`xSTy5H31+;aKPN!{{pQ80Hf6 zOe9@)_sP-s}^0gxC|K|{0!WxMcs>yz0S`l;j+c`ix+%m z#`TL(UsR;~GcsPcXaO>o_AWV9(=1rL>a%OSsAuWc#aq9<^@bjwv0A+|Rh3_|Gqp0_ z5W|1=vMgJ+w3~j*mN~5YqzCVW>bJI(<0Vp!TD>3dl`eb>+|B0SrmEC?-%0h&Jv^XT z_3TR3s?9H^%JbbXrY`%tA!ABf?q2xYi(c(~wR3gn1Cwr?v}V%UhFuLW_Wx~Wb&>k~ z7h4A9FZeJuDvnuE|3l^FO?OV)G3%YHKI}X(IXPwJ^c|o7qgq{6SCxPCe^UG7_qSz} zg9+7G+*o{J^Hs^tl5aoId1BJ>hWGlT-+&K$_^+vRQx$EoTVpfun-%LDE5kCVSY1*a zACymiocf<+!!yYr7jH@RsZ5>Lr=#I$?6m%)&u@OI^xB#M!*89iE!LK=O{C9{cRrJO zuK)9y{*{??`!8uY89TTC=!=?nm;PtNe@{G4DBG1Y+xj1xaO>h{zx`zAu76+kpC|w0 z=vzk@UU$p>B@*>PFh*k^A1VPZq&!<84WJs*$ip~bbEJ&r1Y zs}Rc{DoQU;Vn!d2jelm^j%holc8qwj>f+L?t1ce#;?xd0GX9x(%$kR^eEc&V9V^>E zSa;X@^tSZ2;zs&^--plq;j|s!nULR5oIak67ppyANesw8U7Ef)rFy2tiz_=1;di3* za3@~fbexSLBDfB7v{Itq;HB3?mRgMuO;RjU3hTLK{^5N zezww&-u;7x^ zp|Z|rmzB`rn#$`3fBVE=Prld6hBVw5`RhqK{?~(lbw+9`fZqQ}H-5`b;=iRQma6AR zrR$I*!H#>dH9<$~WjSgpzdiUH?;bm9f496lZ*abLWIFpp^`qVCa@D@JWw2VeJ6)2- zTd?jqtH6!7)bIhd=7D%^{)rvw)p7OFf%JgnROjgSMN7w zYE!EgZbjCcCS@AvgtFvToT1*@l^w`XRn(Tr8cU#I+0rm|*^AjMC6|%;9%KIh)@H!@ z?@sqqyJ|B-;;Yo3YcnnQQ(4D<#^Vnsr-;whnQQpkmtd`aKk}wQM{Uk#>eN@>gq?Tl zGDFmNUQU;&(rjk1`UxEyo5it9UQVB{visAO>Pb==vX>zLv_IXCtl%vWSs_(553-P% zgRGUCa12FTGYDm3vpWo^3`fi9RM;$215GpZPi|f0T5*?aMS69qE0UyER2z3?hw4^) z(}GmdD;i#2gjb?;9fqsfuViZpMpj+p8CYqu3%7{cU7N{jn@3(THj{X9u}C%4*@THb zCLxW^L$>K^QiGPLAM|AFID?|CH=sRtr}4_B$CNsS7p^zp4O?TTPG@k&ZfgfOC*CBg zw|8Z$buGTPTc30x_16I~hGr#W!y5IKE=lqUdulVaXtr-PW?IU*H}UO`;@&_#w2l*h zi9}tvBaOHST+He{C?;KZHDQnL0i|l*9%Om)0FK@5j%}f1z?G^uU25_*+h_RBY1@;n z(WhPJ6ZrK#C2$^(QUY7vWgw;Mzh8spGRkf6uWbpY{MwWtsqaZ=c`ZSXzL73Z%tNET zL5<4L-=@pyZQ&bfye)hkSN7y@)1^tY8jjblN9$V8mX1 zT7NZjZ~9vG(Qnfg>fiRF7zg*U?Z4~;sHPrwIquNX%nf+YiJyu;t1ncEnp>Y5WYTbJ zFT~r}_g&i0X1C~3M(uM_;_uBdvems1FL=GJOJ&;Dg*`HDy-({x3Fxh_%jW~1hF6RD zsYhH|`{gdbE}fq*-x^9o`&7`|MQ+v0@tj8^uDF`s-Ic0W#%JiY-BRvOk9;>XINqhY z|0&z3dd6o;GV{8SfMM@_oltf`e6ae~d6{Zh8+~48n3}hyC99r0FN1fLbGp>^6Eef{ zTgGQDDyxsh8jhD2R}@#=S$=1Eap#G~;-SSu?`*uYv3Sz)Sb4tj{LJ-nb-1*$UX?vr z)>l1qLFUpSOJcFu2@sN(iQii2{GV$1V&)5~{G0)&<(GdkvmtT+tV~kvpP6Y^m!GIQ zEr08*%+<+8qBBo}v&KpMTf+a^@V5;=`afJ98h7;FqZEee!GnbhlmNlkUZyj1)QyyzPx22%gwyw6@jJCW@r{tgcX{LN--^$|3;)at=#ZATe*FInT z$8$<1+}b=t|0dje$IfpS<6j^A>zm*C&3-@nojUi6B_$>IzJqyIV|i0!)3$n5etU6E ze$^LCZr)mRqAk`@-g&a4d@}q$I${?czpVJ0;_3OiMCnfkmc~ykD{m^VXzVT#u8(bqH|OiWU;05&W3o6|_Mdk?(YpTh^%I_dV*QBqjZbv{dBabC zS@LA;Dopf#m>+#l=}%LGj?=`jIvBRVoUMoP8&Ys^M4#Z<8!CQW1S~xB2zp1P+9)!a=}Tjrm)z9kBT})i|LzIk=;v^F%Dh<)!L@kDYV^+-&p6 zs?jCt)ki9;^H=`ofb$kNG&g?I_~Rv?bo}_vPnN_k`vjf*lO?ycebUz6-rU~MdMKZt zTlKX`)v*&xR(7oH5dV)?CGKchUzKlJUwy%U4Ou?yINX)s&{K5$gW>_l%i9K?C~vE3 z8+fw3?Xl0-&P>!!Khd0QIgw0ePP~J^jcuPl`MJtr z$A?$l@x%{m@NZ!Li67KnHny^E^x?A1q2k7|=q>0R%dc$(Clw6h@wCyO7$q$nO%I`jx zU*%Wg_4(0X$Zmi))EE>C&%CTEotW)U&%8Q1t4!gUmnCV6didAbQgvi(wo*NRZWjJ9 zzs?TKe>^4&Z^IWSW(W1d(`6oJ^b0Yg&mU~fwqK~)Zq5!$HT=8k3(fJz-~q`fa#GqirFQe zKeyoMV{{Z|_34+;p<@nceOc(}G;$Q6{ONhSa5^g1XLYth{Rq=&&WpW-w%$Jw6Woh# zM!9}B9BtQnOSZpuX8EQq?^z?Tgq?MBwp?8`0?SlFsN2o4Qtgz$Mkd{Y2Ha~C)Zc2d zgSFvd10f-`znV1=Mme)Zbd05c{${qG8m3h3{3fmn%2=uX`yhc6oOVn}v8a)0t{Sp^qu9NO^($Ac<&q;}# zIU_wEH`kn1s*RRSY~oUx#M3{QwB9DEm!0&1ld`lFV-vh6BPm#vanhP6(Nm7RjQU}+ zj|QInW*RO;FX8h1?n(FQxdeQ^(%6`?8AzflqwigQ7s%(`%6 z4+=5i-?J;#wn-VxuXdsDn?>Jnm2AV}hY)v+d@+lEgYa)K{tdyudi-m^zefBUnjiUM z(}(A%S22nX;M*T17VCUk>Qwd70|Q-&t2SintLHeKkywgg<*VMWO;s0L6KWHH10p~S zu=CYhlQK0Eq6UNmX@X~A^gmD!Ax^uUMvFA-7uklYC~zw}RTQ{xTuVb`2*mI_U+tcl zsu5K@S_s2PJzq7n2C&xgEzxW-Xu~Zw(h#eD874wd6ff zT>Y~JxGtUXo(5UN1% zXmgG(g>Uh~qjTU}{ArDb8z9-H$SjgBD&G!H)-!>b0v-AI7( z&nQ3-a9GRXDJm*E>#*QWa&#Uh!3fW_BV_(=x?-0trla*Rcl%r2H4i^p?j7* z#D9)JPswmY!%?)`h3-4ArAQP013}JQ=91q56$b zT?I8P0S(w_jmg5Spn<;og;-)NkLKebk>R#}KtSiVC&Bmm0FjZJJ zIogqFXj{DX{x1c+2-cF+oGMKoXcwiqcWAo@C_fnf&!wWb z4Ed5!rb=bLRDK|p=b(gr5<@@D_bXH4wkX>beQeUZ6+=)5bFM-l1{3D2gLd2mTx5QO z8P_77afx1Zvd|nRR)*G=`ObQ!*8=v^Z2%M*?3@^kAxA^CrZq@yg&MhMFpXj&JgD5N zo^0eoQfp~mT#l#*3vp;HqRMM!@O$;V)DrhJctY3|9?@N8qPEQw;}i&p=?i3(z8SLDyWeg!90=1WMxS= zg{S={R8JOKF^ji7ft6XW738L$OvoQ2ZAr>s&fnKjmt-?wXl5-0#|tX=Hqq`FW(yl z%|pftFJB?fEIPw%dwRq1nlr@J?<>d`myhzL%jf17^XEopAr#(3YfcJpa;WEkstD%D z7%AtgzYIwY^bJ?`W;92$h>olit^zJ>IGU6pXzzN=xV^beh34qZvRU7F+{r?mCj&)4 zowdK$;uS7q3UOUJ-^elsxbT@r6F5vo{#qv*rS(7oie@5eVSri%RHR9G`ldFINY(Iw z`^Iq7YvUt~@Hs17VukNm;SnpmWQF&wP}gEkpKOJHw8DK>_=OeThTt2z>>1n`M;G>h zzvZQ@^T=Sfqu8dXD>vYYgY~WiVqn9aaXom9j5)400yZE5{$xnr0) zaw&>w8mBsn$<8KRiej3^sfJp#>&uxDKM95LqMCTSAp68j-p)REd}osWp!WYHO%|BUD#~>ef&_2sIo! z1W6;W)~F3Zp0h)B8PowmBUr8m*FluLr#BqaH6gD4CqZu0LUlo?-XE&nPz$PLnHyOp zawsV1fRej$6;jOII5o=MxCF)AjaQkw@hWpSUS;matIXXvmGjW^W9E@uf@1E*tIXYa zmAMKX>y9rxPb2m%XZI59^;(^TGIF*X(*qg@#AkjDCyxF0;3~E7s z%%Mc`>*)>1uTdhv`b`BEF-73_Dq#&46aq0v;I}Mc4Y~_~m?kjK69Sp&3EE_lBzjzm zBBCd}R~DIB79PU>VMcCyqUnAUs?75^n{)+`8?Py%k67Y)qCo4}C$H%`B5*<=&8~>& z5f9I!g(y9@3Lc)V;AIMI(cCIPF~<|+s5u^T@RNhaL0A(lk**B-6mvb!iej$EtHkw) za~}&;;&{SK!6jf9Ls^3QL4lQNp}HVc?+?{(sF6Gz^CRcz{fn#ZYB`Z;JUdhtLsk4sQY^LUkM9a~ zVw%URO!Ih^X&$dK&Er+3dA!Ork5`%IaVnL-(LCXh%{)&CM8nV~HF(7%8fFv`Ga(MQ z5)(Zeg2x>*Jt5FCJz>sF^+bW1>Is3&^@Kq5DCT;85@gL}PY6VpVzMU$65Au{_J<+C zXj)busAq@jRiWAys+&UfH=%kGYB+3Z2UXRE7r3H8vl@EA!C5tmTL+vtZD*(+4b_^) z0Ne^SQWiYa7s5?HEDJMEVWV2cDZETfIfX#3*@WZEeNq9-x!6n2mW#7~7l^dx4ULSQ$5;S&b^Qjr;F6gIYIpP~yS zW}kw5E&CL%4VZokah86iwbG4KGDK zy6-rcz8kL}+A=U>VcHuhv}S3pf#a<;&V;%(Ea=_r0^geObiPGZ8@!o(X^7(*5QX6e zjlh`U3SnKiJ=N|uSv6+3LKNMbs^Nu}T30b9xIz%$mkWmq5c69B$njgpT56mvVz;zl55D!j(b!l8#s6fsocy@z_BB)i9oUPVMz z1hjK$_Z-!5mH-i770HiEkEgH9k9e!9pzNTOwD;?A*+C0o*30Nj0VDbCpDdCQ!jv2DI0?`WS=8r=|>K` z-AR9TQso3|X}pu>I_WM*LB%a6HF-=+4Lf%4D?p%L#QEH35vNa#+Q5u~5N}(=cMA}p zQ;6kpxxCy9f+;A6$hJmv!Tf-7*)!IZ^jif8ObwWHI?Et_S%9Et8p`47(sz<=tuvkU zRY<`VSj1OW(esX*=m`gX%}E~>oWu+gKbQ1nzo0E@mgXM%$)yoL0zymMo%Cl&8Pgq9 z^$ULNoe0^DtKS&fGL(yU*JNwrXHMGZq(r+-J>5x{I_bNRf_h`%BBz>dlQX90z1$0e zVn{tAJH_VE?xb%yX^oS92`S7AgO+jF_YX2+al!$R9eAQM6ryl~o6k}>!33qymSu3n zY=;P(h%HP*7OjfRFNnS=fFVdV0$T@Ir2JjP8bzidaNmibFbzQnYcLIIEdXH}vPgx~ z5F&EImca6bVjL)}#qz|U6O3`POuLJO5` z$Atl~I|U#bHv{!cCH}ak> zm8;H0o<)Bp3 zXA8Tdq%vD7%b)}~>e_BQOLY34LJW@r5>tPU$Zncc7D(lOsdPgL^47I2KU?GtriA;` zPRxW?(da_ckojBH@^K8}!-gnXg+a)}bT7Ytyntz#VYD3NEMiYN(B*LMIF z1`BgKUCkWF6GfJ97V?8a{*{oA2)TN^KX;;#uNCq=LjJjs4?wOIRd4}Tvs-GwZ@8*` z3cnFl&Ba&Yd~{w5kLeAy4GnFZ;FW(R7x56ob5(&EGQn4Ms*vYH4ys|D zb1rYGvG$*PmOKijee0Mb%W4UaptMW~s7Y_82ab~lK85iJPba4wb#KAxr=~o@(>3LR z(}UiIr4{HtTIv-9Plcx&&g0EAPkZzwVbUWC;|U93X&!8C`E;pPdk9D36La(mdJJxiaSw z;wibLyY65#=yD+(+1;%(a|ICYJ_7O} zAok|_m5`4Jxq7X~OoSZdib+3p5}0%spM7+K=5TxnqL6);V;7we*JW6d07o7=;blOi zi+yigUV{gD`yE2QPRMJ8 z{4C_qCdLXPX;6ORr09lLrP#|W05L_Q=SH?6t}MV{VnjYR;#o|4f;ppmrSfsX*%&`S z$;du76T5#!t~n7cbj@uc9xQ-#F&85sw1-$|1uH}lG2)uiZek$>!wP5^0l5c|U}nG( zOCVux8|SAF2MR!F5@uk=dk}3o7Fx3W3$`9}jkUA@h4!H#o$@n1epf@LDYVoBMx`gf z3~r2K&_L{NvbLB9qZm9WcssWV9&-d3i?6=i%M&5X2?z)n z_KKP9ufjb7{&OK8fNbujM+*5eAuoX(Ha5CHks`R5b^z!F!jy=I4Bi*LthoQ@ ztBdyf`T2E#*dDP~$j?F!3xKPQ0?^gA_>wpMxnqTVg^*VY`AH$aF60xCgS;?hqn_0! zmKqoCFT^l6A}|jCW6QQf$nOfd>VU^gfE?zF>q)$buz9z@KP}|_y`0NT=~M0kjXdbH zx=hGRAcxr+a^!$-+FiY1_+}QE!Ebr{9gvIg09XI`5P6V7xX%i|u)^CA{KSicqG&?a zg=ap#pl2x%6AAB93=86PMq(7BsHm+v?2Rp$-D^Uera@@;n(#RFCD`c2VI;(Hr!OcG zhebt!?9;{0-7ZCkMLE@!T!%%~^l`^^T$EE8hT+fbUgM4{_8W1ku?E<}tvYT_Hv>D4 z1Ssn`a@+Gd`c&h{bEGQ7nYgGMw$<@2DDJ|13bzs(u)ZVp@bhvh%&t_^s>NSwyLnAm zB=#PO;@Ep6#Boqmh_gXaK@~YBD#TgZ1y!W@Jlzx=5*6YM^FmGGaYVgPKuQ2*>IIWi zc$v}OHLlS;! zLfucy>65MSk5;(P3cs+z+YrPhG%-a%3wQ^NYSC@k10%#?$k6-2fT*&aheL`SOmRq& zS2?7}s~l3~RSqd~D&5iEHA5C<-Fb*_a5zOFMS8R7KmF9SM8%W#I#^+j6~1qUf3db&v)NQiY!3zIqh5M}V3oE=0!M7Sm{ zPUVdCs-N~HbH^3O<2aRJG!ux9?6l`ffby$<*;_as$Ke#m<9LTUAZms`t&JQC?jO#ou5Ysbhg|dSxSZT!N0&ajI<{rVX~rXCFuEggDC_ zP^6AaQ5>n`RgTp0Do5%#)wYU_)Nu)l9X6b5ilwOo+I+>ODE8QJDg!ZhV*UV|uLvOf zY=l6}0+~bzD#}h94yTjDI;Z^q9@G5(4c$H&yyvngUPNkAE$$&X5!WYEUh&(sK*(AM>r#P63 z4HCzpI-xyc8)#FH0LPI!Ar39Xd$I)ia-dEW#{+g)K917~aa}s!OMW8D$6-1l4&BLw z>4^GLluki?xqM-LiH-=zY)wbtBUW1iWq@tJD8w2)OBe6A6^=Y&57X9 zbtv#9Y)X#J3GI=!!mdN1IU&w0zVgg9EoVS)BY z(8VY$CxXL3M4OO?_2synz#fOa=%t2lW)8~j%U)m`nF4#^2odX^NRI3g!R=}FS#(iR8ggeW~n3Q!!66QcC% zBaVh~35w%!yvp%7UgdZkuW~$&S2-TXs~nHxRgTATsvg_XASNEiB`A)^@hZpTc$MRE zyvp%7UgdZkr*a$~k z9Z7DmSyL_MRKj9W@zp{PF_AdJiX~JgAH%yl-8{smzH;^OGl@UKD$hS55FX zCkXi(A>R#ofXvJJnIL8+rSsZffZ_WJZtD4#+9Jqm9$kSFkRY{#MP=~l5fAULcRiWaDA-b2%dA? z98U`H>q0(JaH4rbgjWmp!d}=GHBK`R{p7Nk2Y|8i4k5n_Ib$v+#pIar77;l{x)u_b z@b1ap!qYte?cjuo~jVs;{R#O#EFblmI&Y)=G&*$I3@#Oy=|=*YYU-+cVuxDS0*$^nD8u*c!uzX zEdDGLnqzI6&>U$5jRYqS-e|?2#w3qZsfWVV#F0EM!G`8o^CmRMswOnYswOnYswOnY zsyZ~sY9=(ts8j&vcqlZ-c0?1HBO&NL6qxgoTOsJM9BWjEd^|<4t4Z52*9tliCxnYHz9D`8^z_CrC!*9gNHvC5P2M)fG5MD3p;2UdF z2j55#I))CuvGwiY(3=p#ekQ)})N|mCwaI}uR^h-Kt8n0rRk}ZNwfTb=Iq1ehIOxVI z6m(Nz6uwI_eD5x+b@o*syN1~6#e-fyI#lucSI>bd`DX%<=1FbVqOq|1`sOSqLW$Lyhc>j)e3 zCeNiX`$1nv!ubw~v5ojW{dFXh;J%I|ftCTGuOrFh7*9??frL2j>;*+)|B@)s`B4Gl1w-?uM*^Cc@_RTl05&^)Jk~1 z^)SK5je@HN!>95v2@Np2V!wK1D@*)J*xk6MZd-ASGhauN1t*5ZeI3c-h-4|Y`I@gI z=`{0oB%|oBBN;`19my#A>qth?Uq{jkj~`;=U3f|xl>R!BQS{f5jH17eB+o}HxUVA_ zkp4PS2*Ui>d>zSv^w*J$qQ8!06#aE1qv)?A8AX2`Nh`MWJO|d_b}}gcbtHlGbP0X+ z!6fJ%cAZK?4GnPG8%E;H*OBaL=IcmSHD5=vD!aotqsn|8$)s`~dM3;}?0Ou#!+4c< z*!8OUI+D%9d>zTEyu+>so3A6;RP%KtQ35;}{MV5zjDvTa5h|#5w6b4EvN#If@m*4X z9Z9Dt{dFXx=&vIgMSmU1m|)vf1iU}suOk_d{yLIT^w*J$qQ8zLPsh}c<8k=wNCu_9 zjwDfdf>Jb&{=Ab(Q0%4?R8&Xf6g;xXO((pWHMJ6bcJQvb&Y)sH9j~&Vj#H`b$PQ&G z$j*EnNtB<rwr{bPV#bX;llmbqRvpGOLf<6)vdk7SLLtB&t_`twLSP3g}g z8D;91DD1!}`twLe(Vs^$ivB#3R(L$2v7cxg{ydU7u6=S`N%i#;J~=LheR84=NpFk_ zx(l&4?ld-tDVO^^lFgSl$qiwcS&7dhS)lnmlBfssO1<{WQwNs8)&F7JHaqNr};?O|sj1y$b&NxvVmU{LBK-L~R%2CKagZ`<^xGaNJLV*6`^sY!B)7~w+hGA1r3D=vk9(2 z{0In*-R`76JE^kKrjCac=7lFQNFi)>%T%LY8JKS?i6S{?n&1+UGtGc#(_%3jz4H27 zNYWfFWpM@cr?E_eT2_cNOIH2OB#UETnlM`oWtd5tPd`~4`_hCsTCkcc@1H~bZ6#Sc zTz6Wr>TfIQ1f{>NBvBY$~(#w#7j?Wi{{bbB7 zlx?v#+nw|+C#`YPFCm4Ns5a~kBW@w%408-$VLCYHAXSvfz})7v9;SI9e&J*? z(P2i^sXdBrE4wS4&e1r;ND$vuW>+{3a+}jSOO653+q`O+af%VP!p&*@*{A;QQczyE zc?;ZPD1Ma;sHOj0)KJYgtG8#_A6Xi=H?4$OzZi-P<>QLDAKo}ktJ9w54S=+=Kq~i3 zrCTb0fP(N%I!Bd0STw}$Ps>L5ZX-t$yFaZzdTKr=Xa(kT?EbX=>{GKj;o06%MqHRr zp>o2rL1NI%h)8MMVnpP?_eok4jxrYI_NVnF_Kq?ZL>vxYcuG?{k)hq6mQPjWC=Y9~)9p{|VS(q2t$^{I5fu=gGd@?lKdras zeP=w%?oaDc(tE~cY4@k~C^VV#p0OyqKdnch&DeWJR@3{>h#Gi82&1XB=k}*{1}z^n zLGP~3$LWJhyd|2}zy=8oWRTFn1qlsQ5buxWtve=26aqw$I0rnC(2fRL%>;5(7+0XSJC?0 z1dr0-6fi=<90;L^0iN4L9)Dni3Q+v&%xv_oJKs8>eE;1UXh#FB<^?h4w@QU}#dS5u z_mPCbt$}th(9-P^IV#X*2ih`d6q_x2pL5Ich41MFWgT-os(y;hby}b;2(MaK>RZYNz=ROzB)QN~3_R4Cj@S6`Y<+DS*EFqyJWI@XqP(vc|4nVgf3g}I${ z!-8o?EZ;hACtVNg@=iL|m~qmPd1B7wcGA_wC&DLuYSCwa+)lb0L~IXlRqOL(w#WL+ z*c{zXx*mtwBRlHoy=ApIi_I@X-qN!Oc0qj^^yi*q~aN}O=ju{gJruE(L- zysM7Ixt(-94h?5qb^PezcGC4QG#xwZ$l4lr9c$dU>sZye>ljrpXXf*}3A2+f8}~cu zYSp;wSR=+=M;bvxSr*96N&HT_uEe3cj;8VhwB>AL)#w+?+`LK`stI!2`yA^!{_fUrHPotmC8R_{2&nS5C)OQ8fK0J5M3 z743Fv&wiyB48PVFm?3BBtz~>s(O0y?jx{sC0D^9!{dFwlxdI5fh}%I|SJ>>Js}aEqo_S6o#%`W#F%JS0%qryG zxfXP!0EEXfe(Diyifcg=&n>iM-F6)49)Nt8p^bCx=?9P!RLDB+$c`~Cdf9ksOP)Kf zm6ie%+CdlbyXNW(p%DQcVs_2dirF<+D`wYR zRzz*huDKdxcFmO-zU}p{xf)}3&D9F~^VrL4cFol(X4hP;m|b&O5w$hD=4y;_>Op?= zMwCzyryi5yoO&b@10WHN`c0h$Y95DZEpO8DIONnLk7Lw11(6ft_(pKAENxE4sYe>* zo1p;6WKL)iqo#A}vG$BpkFe8681XqE4ke80u`1dS#;Hf(9HqmqG1eY&I-xzc zBQJ30$&5bLsYhlMIQ7_!tW%E!T3RP4k#Xt?al)y`8Z=Hl5*Il2Se$X{k+{IA$Ks4r zkHnc>W9|#eSLU301T=K&kqM_Jfr6{ZB#>sOgGR^t?AV;0y~az0=Lb$bvH--TVBXTp zwlSdrW`ZnFZ47YGRMdptMtuQM6N!QM6N!JRhy#oO%pMJN1Mh@6=;J+NsAV z+NsAV+NsAV+NsAV+Nnn?w)8w#)=oVJ<(+y2(sMZUUeqL5ryhyJDCwPgEY3LfSk*Z7 zSk*Z7Sk*Z7Sk*Z77?s9sE(?EtNR|a$4!v==rx~Xns~V>ss~V>ss~V>ss~V>ss~V>s zqnhWMcj~b)dGw7>hGbJz7=TsmCbVsmCbVsmCbVsYfe(>6lfrPCW*soqCL- zoqCL-oqFWymat)`9)r?OJrZRI8|~C%60B2?z(t&TEYLXhNFZ8--qS`NqO|#rzjVf_ z$67H?J<ajrM)Dr>`l~qtcqI^XE;GK3{Ih1kgu~v;!k5!FRkIV$~ zDDTu`amJ}f;+W>KPCXW9oO&boJd zigW5Q$CYvF5iq*)wAPDUdF|9Aak%o%smGe*4RTzctf3a`9&>XGKmk~PfMIQ4`$ z;nZXEHBLPehbvF{(v_!;ho~9Ue0J)QC|q}1v1+FtgVIht5`|&bI`x>t$~g516#I^t zAPK*EFit%Z#}gRi)ML#VrydCloO&$IIQ2-JcC|51Jr-x2dO{p&5u9=Ak+?3jR^cK@ zJM~DMp2)DfjybH1Q;$T^JjOWnSd?+O$rJZ_6(oQ`joz8AMBx$D} zlC)C~N!qE0q?g&L2a@ghfm075v{MgB+Np;m?bJh(cIqKXJM}I83mj zIL8QiToC4EYNQ+^L^#I?v0@n^RxBgLie-dYv5XKamJuR_$B!r@#3;)Mv0@n^RxBgr z&qpf=Mu2r)`BLJk>aggC)7LLP?! zPBKCo=NKWaIz~vVjuFzTV}!Ko7$H_^o)Tq*G|n+XT6K(&RvjaxRmTWv)iFX^b&QZ! z9V5i5p7i4}gNGnutmxsQVU7{*Vi_S)_|iof zAqH7Sh!x8Sv0@n^e>$cFKFmv3L0Lw~qwo+V7oM;JCd|v!o7$s*5n>CV=Qtsc zi*Q03=QtscLt_a}NW&Z_ypUGe%O|*b!(cCa=}oYgRUI#+tvFuD z6%y_{&dtY}x4~Yq@M=5G$lIgh3ARw%bDWXKb%mS}B{KM*Qqa0@>tqIOZqa0`CQDj+jMz)LZAMU$ya)g&h z3i&c2FA?&iLf!>AxD5n@Wb+!_;_Y_``8px574ox?Lz_IGb6k?HCV3aBD~GmZ`pwx& z4aQ6ohli=FhPI>=SRY)qAycoe7}`=?Vj%jSLTK1vN+#}zldT21mpCMhEmXOa1Z|`) z9@NHoEajA0tnqm9QvicKC~r8rEi66 zPXOV&2!UTiD3$0SPA%27aAXi-tegqrf*529E8@KvV_G2Ofw%>%Rm=P!!poJNh#ziN z3$m<_%$i7_g7Wn&R@kK3myZ}922qVDw9A#8Lc5$op_Xdi=3QSX(I0B1r1PZ?5WOK#lQFs$#Xs|V~ zzZevH6@Yx;)gZb)6mu1%i-;@VH=-ak0lAO6oZ@rTD?iK* z6rWGwQ9(MMoF+Po(8ihObk1wJ{2;+~vBVNXt>s3%rT$!Q!zz|pqJ8Q(=I<|%@)Ay3W@MLao$ z0-l^g@lH;ma3`lwv=b{fZ``^j*vVli)`@RT`&`GIc2Q(zU?H~gare^qsO^=t$<_j9 z20FgUWkTGBy#F!%0GANC#PDE=VC?q8&JHmeL18f&SQMEIVC&%kg2{l6Y4R5xF--vk zlL3xs(vtxMGjXc9!)dBy_Z)TwAvz-fp-D^}6W=DpV+84F6C1$fj1Y$rfY2&7ddY!^ z%7}nm=#m2wj}d^-E;eq-fr!HhKxi2owB*``f|ddh+Qx(|>HB|=DKp>yQXvk5&vczl zkMW38az!Bif-yV@NQJnI;B2%79=gOxxD&{qC4#Z6g~JeM;S^#loI-qsQ;4l_3UL)q z0aM{`AmS-F#dK|EDQNTHTGwDiQ82_*o0g(PP@JjfDWE32IodebwFT`P%!)k`H8ycb z&NzsOD29eTiZO8*kPsSU%ZO{waY)>oY0qHJ#irt-a|jZrf^Y~^akV-6h*K%>$Yn!; zM^2&Lg4wFMM`YlU1JQQDuC}yWuv2KWU{*}kEenCbBX>6K797FYz$1sD?SdKOi(z*Q z_ERz1FE{|YH~`_XXZ8#BmT1Rd22t;&z$14$Z5hld_FAG7kPnOP1lTT^ zlkG*|wG+i0IdimGa9{zw!Gs*STqxuyf}!P7*c-lUFnFL%J+q~S=6Cwf5A>hs^q=4B zKc!6X)~n`SxbkGP+?`}r&FYGAEw$E^?gEq($}w{s7yf4b=Ry7FSNhKp z{ik}oZd?85TK(r9{paWU&jI`?)tS23mf0n zrq=)0u)TOKjZUglhfL6yK>wMKKQ|M^(ejj=otJ-V z(wpg^UHuxB>tnHceHz8OMQVW63)CoRwTj z1yK-Mg_o@R1gJX-Lc35&f;#c)l{yl-?pbSEnv<)rUQ$;&>2@b=bkbfYeGI8Toxz?CMm4mPJ8!i7G)og&@67m7w}fk?gw6Vs*bL_<|@1&u?C_ z9uT1JC8h zve^OrMPuI@pe3y89M>{LJy07C0?3+P@Ke&e(InI!FZIVGX+mAWSwwFm34QsVm%`f6 zz_S>vb{5M{dh)3K_H32R8aryFlP-HXt%oJG#2tIoNxQ5hMzzIoxOc_}53(jZoOGR& z);j4~D_KLhMQMR*4WS~XyTXd-m+`hyuZ*VR@k>in{j}L=Q(j=CYwHNA@ z=!K$1CS53)c`%xY*)~?7I`K#}5tD7KJ@plt*b^~}`xvWEbGdAy8K3Q<^R{vPI6M$d zMm2f4Ii8cx*lkSPv+Zhg7gkSnwNdb;7NZ{BZLjUF26LJ0d9>68nMAp&!Htnb)Rfnh zlz3e<5jEwtBnqUSjV7X|yoS`JE!|^Ei&C8> z%-2j-9%5FE4)UOdpftY{@)03d|Js*$qLr;lRE~yYk?TDcV(xUaYP_5~(1BSXUi;Z9llqNo)6} z>y>#NK4+0O7t|EPS@|1cenZ~?mJbZ9$m8*X^@;?zd6@*{lD2 zj6bIL=~bXU7x0;XFH^Agb14ss6pWPoeV7S+BOE~rPOZLNPlWNulpPCHe&0NsTj(C0 z{&W530RE`t8@4e!d53 zw9-jWI_Y&Mop4g~erx4IC*9VQ3Wf|IUs(%nva+DZGJlsst99qFXY zoV3JAk2-0WlRk9P;J2)m4kumrP|7@t*1BWQx?}IyW7OMt4+VNaVu3$rr(dmUpSoh3 zqORPK!M2K4)j-^a{4)gA~c9?gnv1T3StNOSUennd4R06t} zr1kg~y-QK_nlu9RF7s7koB8!-!3R*CLC(sqK*OxG(|m}uuTMiHd(B6I)@xptp55j{ zpm&>>K=zvtfp!Jk7_X!dVi?WGPs~hJRif>3bIOegUq1Z{%x)-H}8-c z;xK+%S9+H~TV%?Tu`9h#WmkHyvMaq;*_Ga@Gz@TA%;pL%LE-(b%!6I&eJZ=sdzD@3 zy~?iiUS(H$uhP0YY&pBKzU{G~<=C0tokvC0_XT{>9}j@Ez7|(%cBsEwCd%Oqlq6a99IcWJiFg4==OB8qh*J0_@UD?MPMG?>=ag!0+CrXuo@> zQsW7~d)YrXVR2%2-W*TwHss=6Bf?_{>r`l%He)#g*vLk+ov!ueL zjLeuF@f}dHBfeMJ5#OnM|`I;5c6859$Et+y~q~l z{UKD@9p9PJ-(K-5yW=~RGLi21Ei@rOWKY4_5T_7!AJYi)AnkMtw}!x;torS|5p5m$z` zfCw9#=AH0Kk1V0soj)ibO*_fwE?hmZKYxg`{`^?fiHymizaV4c{302XLw{HgE}-gs z4AJ;5BSrrF5tyDpg)nyKcW3c9Nt$YSJg~<8{2{E1U<*SSJM@Pz-FTbRw0XbbhSb5~ zLH|yV2-HzflU#^P(wX5!l+Aan@Q4*&vcmgmIHNz4&Xjrc^(}$DX`#9xRPPVfZm5x~ zKo#Y0zQ|hxY*(WiwWcL4*n7Uy)*0@VJoZPf>BTjnE=BM4R%xGpLfBVQe5dj|EwVd6 zzt*G;zsX^jw}Ma&Yg(#(hD;T`fDDPS9oN!a&W7n4(i;pc*px|x!$NbC5*2(FjC90F z@LVv*COQfJ3+5PH7=&TVJKgrUel-#%8m{Sv4K0IA@dJ`c7Tm4{ z4Yg~-VrBAT-v-g*+PA?a!?{70(-KFzobYv!iIyxvIni{_k-LL5Y$zhC1{0g)jeq)@ z-rOC;g$g(!uBo}MOaiHU$%{e4B?A<|z0-q)OS*^Qs<|vvrDnXDE@QJ)Q1*8?V@*p& z-9(NHbh>tNU}=Xt#%>LKtg1h3oOVFiV1EX-aZP_?gG{pv106QkMz}E8%g0^}5+c1A zC^xdhUJMc>y%;Qry%;2j=^MD!U+($}J2He2>&Rfs!@dj>B7GTbR_x0lK|6&ng9WiK zg9PDXI9~<}VqXU8CFoJ`WuP}9aAcrA@M54p8}%RfFOUZ31^ar$doHl6QBEfCOmq#u zH-W>|bP38L(lM43$Q=55*8Jwbx-BqN@J z-4iT`-4i5;?plD}mX_E(L4u@vg0;l%2_cC2lb}rOo*+SZdNFrG?g`csyC+Bx9vjX* z!GhR5L4q)#JNE<&V)q0AvV4gdLD@fnu;!JP_fK%cIr$%u0XLizUEzjv>iq1Y5az)g zgdM`kM}hKCH<8}~OYEG$(hhfwy%P9X6}b_x#O??zT~mi!`quF+6?(vDR|HBh1^0AD zjXslI5%^4YMPP|t5m>s6oDEoFR|J;W6@evoMPTVehhy&pKE~b$EV1_iOYD8X5_=!8 z^vX7)OuB>$*m(!pK}av-2&cP*^jL7lEMdmaz~w%GH)$n1F#+U3=} zZGUng2$PvfFv;wEK*{z3V?N5x2U(pf`ya@3OheiKz@)Paf=tJa$}R{d{T^~Npmdb_ z=j-^kX3qmUWE%n#0pod4t21Ti1Bt*Sf)H<$^MNtO&Icsh_QKSh*zk2NgB3d=P@4LX z+!0t}-vgF9$d`a6b~#{atvkk^27K%tdyFm~IR?;C$n0QXWOgtxGCLR;nH>y_%nk-d zW(Nb3UB}h_UG%EoK-j?`gqW4PgRp~vfwO~wk=en($n0QXWOgth+2(3SQ;{n>7!btt z1Lt61t|R*x$aGvZ<6~elVIKpDz(q4Y1_r@C1|*wecpn4P#a|&egAjoAxY~9(yx(}D z$DRfR(4Gb?v8Mq^w&duca7W)~W+u2`>~$c`qWaeBfDY3r#$E?BikY%$uLHIGapRMV zg)@(XHW|;7g;*7B;D;Fe56rw0E(k_~7eaG?o&wU;)hx5g90~+K1cSQyalR!U)PH`Z z{~XbOsyFDTp#F2M{sTV)b1Ga7j0A6k=J-~Xcq84c`!)L;aO1GQ0ZZ&}ARB>~vfQ>f z_hoyozclOzj+RGicAv3qn;3({e09-Y)5MDX5jYq2M_`Hl5oCU7ba+X74Mw!jj* zEwIFH3nbZ`^ty>XVHv9ap*q4D(?90Fs`!YzpuFkdtaEoC8 zJ2r#>zA+qty&M?IUJfj=mjg>{$+v+e_HrNzz3}%>QE-}eaZnSVre}PYTW0BSt=6aM z?k=@Xu&b)Sad?x$~jzCd?JmtOQyvbCTWefYMgA`6x7B)8~OqwtLuYfSgVHuyg< zoGfw}HP=3dER+_v0DDU4e}Fg9=)H-b^RbOg6dr7o%#zCba%T{?oB zQcHF5?IIBo(pW%su~!1yHbwNo+k;JoA12}pXQNczW(zA{pUIT=lA$S#V@1v-}t9#{l}M--2(U{n`+Y2Eh$q4 zx&D*ajF*4t0QnYMS^4sxk=CwW`Hew*leCM)hJDc=*wrug5eG7m;Z#yy08-6NLvu;d z7bJ#*vk7B!rOogtI9umRX6OyS>tq6qw{OqUZc6HOalo7e5cYeYI`u8UhE9yi_K zabwn|+pz49bULpM<@t7PI96VKytL=CStE9BXfmM>U~*6K>3U&k(&^KeLAqTP;%k+z zcJ$@T0E7l$4|fTo4_^i#Tqs%!hm5|6gNYAGBvxr}u>9eG`$ykna!zi6Ad+Hxv=5d;|dlV>`0l zu7i_X~9M4fT7J3E4_FL3`+V~43<-HQ4Ll9?Uz0yC07c1*fI zW$QZV62PfV8AhPj@A`e;Pu@(EKi=nh&UK%2?sK2}zR$Uy--jKGr^wDHVZ?Zse=&SI zK0O+reiWaU-RzD2Mtpj2eEL{?`eJ;xkQr zf@R|QdkBJ|IUf6CR({j1Pi@by=x;JF_8RaeGsk1EfsV&zc0-lKeyhKl*P;JD``b19};If9Yi`B{sQiJNL3K zZRlVurFO>dVEl?M=jdSUHPOM?0UeA5_<=ZCth?bZ%5@-pi+eGbsa8z4Vk!1cVa98E z!+b}H_i&})DrytZ!!IAz8BUL4 zDd&Y1Ct?TmC>CJn>c5np(sQLVaW6J!Vh#oUh^08&eT-J+)-GL$YdJJN{FmH?T+Y#Z zxRztzVcx?mr{l1cOTXbb%#)_iuzcy4N0;d@`E?bCU@7+T=Q5o>!(J18hHDMD!0I!s z7g*eddoj0(eu2eP*sGG%gmKX%HDLfrO&DO|747@a?5`vwj6z9B7(fyd64=@KFOyh< z${%POb$9Ppw{xSRejQyQ`O~1bke~0(pZZAbS%LDSw7wb32<(psCZzP`}+Z=ZNPB~PP z3F_Am_}6&LANc{^@;~)2qzMN0(r3rQY4?K*bw8*SooKorT&Vj&EgtU&{h;xF(A$$a zSN3`fbwB8w(SC4&X6$^NzHyJ&50#?q2N!6<-Y9sy_$6vGkpngBSA6!tEXx$HbbMRwhfG#`$7KXAP z^m4U6=YDZvi2b0D5xWZyh=l=RyZ9FoyZCp({vu8naoH5I(y2|Mep^DU+vZKb7cXev z6zVtS_dwee>i6SKp&viq6zca=n?g(o-_4z)V>`Vm#Ds8;O$cmS`=$^RVoVut3Nb5u zgC_&{{=+&@Wmm{9_FW++gCDd~yB8+k+(s?vFNSiDdHM9N5K|y`h2994Gzi3{Qy_PR zUS4*Em;$+%)AH$EA*RHbG`%Za7|O2DYbv|Kg`w;USw6ih#4|$zcIl!+IkwF5U7-vw z19s^PWMN>yE(Z+Q<$wXZ957&)0GkPH+X8kuhXK1BFkqJh2JCXcfL#t4u*(4hb~#|c zE&+D&;@8Kw#cmrjK%#b45*8lvOW!?*_2OM7QMYQj|L|BVVd$<(@*f^6iSfHSNq=~( zBnI)Sq=WXu^KFP9N87bKilCE<-GKRo)0;WtNL1T1JcFCoj-WjHSZ zcBTC1M((|E@#}#M=j8`7oL4>2Uf`)1;(;ImxjKh0@XGmubEG#6=jAOhoRbWa~Q>|b0UhDa~Q?T z0i$?1U=%M0jN;{hQM?3r+faEtikEX3#cQ+-Xq#zVP~R=b1=Zgy{epV2zmUh9=>?iZ z*N4LNW*S%4H_G11)Mgrwdgpjkch$JrC3aV@r0lBk;LoivZuSbwu9|0?=FU02%dQ%a`+9WQ zRqN4HyK2k}iM}O$^GS@0vIioI#P^b~kOTV@Uwn(e!4T;(wZ zSGnz~aiPZ)%zxcgV~?=%6n{^+3V-+<_ieJh|N5R94{|RTGNW|)X_q}U``Y%@xS|qQ zOSm=={1Fyclv{3GOfSxM%bpsSbX<QFSmp@bS{eg&$xq{nPpl{l97Li>Ls{V>^tEWu$Y(!foGiZi&~^W|^2w?us*a zhY~YmS`vMKtQphtd)$O!COc^k;NvdQYIfA6$e5ND;t`4U@wo5uODYq+BoPmhk}-|n zs{?p%7!MM20FUq00X(1$1pDWCkhQwVm=>+ZmfAAHE06Bqt-gpe2A-sI&kD*8d*p%K zEASn6Ye=2HJJElIZAAKhk9qF<&2;SAbGm+ao?GxsJjG$G-oJ z6;KDr5dS*Jq69FfVRi_CiE!?b3P5?H28?*32b5F*$`eUog^yfhOp~&~Go}%E#xw%Y zm`30k(+E6cngBjOLJEL?lVtlO%QL1Cc*ZmW&zP3SV-!lpG?F}HS|vdW7@okjiZ(oB z8jtXdX#}1zjleUe5qQQl0p5Gv`PbgpjA_A44M5Wnvmi63CC_w#ufYS!hyA#^c_*Zs zcS5>(CxjlLnX0u7x_L*bJb+RYsBO^AJ9qMaS(JNOjx}DCgcBx1&TvgK=|Gc$zn)IBv&rtPuiA$(Y6gP{-{~!>E;vX-bQX zX)$b&LhwV{_$(u1TJYo{o*C1$Hu2id*)g+bW_y`A;)Wd^QlIUFkut5;kN3$#@6o(| zT7RTW6BsGe2s~vP!7cA8^U_nMvBXoR5qQcp0eqy$<6p#wHJYiG-)G9SpvfjToV4>C zM1vSjEj&>0v;KI-fH%5=E=Op(S8Z2*-5*tl-B|c&XS6AEvcDo;wc`$e1T0h`7}vrFvfcNSYS&`cBNBnlw#M7h*_xqW=BX zGMiRjP{36c+)=?FSMW#$Pgn3NfMi;V{fZjUZLM4To4hH?N#}|tm)_xJ7l$>UcsQWdu#Av6N( zMfPSRg<95Uo7~Qe6l%$nJ+94>7`nax?!4`5>lKk1BAeWYF_VJjDb#9R;JmnXW@FAa z@wx72U>ma0#w1dxMQv``fYp0e7b(<|hEI3ehAMfHLM?gxxn#T_iWF*K~~Uy@u47YEvpQb!Li8l}VLpOmvm05-BrvV#-XF zNS&z@Q)j9~3Qe78?&A=eDp8asi7?o>sx&de!*#u&7>=B2=v--%2!p+XVo!3$3S4TE z2!p+b#kHo+gUSLkPDZJS0$QDvX~PJES;`252^nE9q3BBGSVkDkQn4~ArHn9`rHn9` zkP!wGim}PMfHHfF##FDC_#%`>7-2Auqq)i2fUL%(CW-wK1%r60Pw}WWbsi%O=3$I5 zn2-?$6EebJLPi)2Xs6`DQ#~b*Fxa?NdWr&-o&rjp^3)T9C6S(@K&7XIl%5h&dP+#? zDIuk&fNTS+5&SB7`E|={82$XJtd^{l#tR>LPi)2C_PZ=2_d*8K3|j! z6rTc;2&o0Po<f|z1r*}FTz5>p^hBrX_kbI-;3b?dGs;v^ zpX8{kBMGyX(TJcmZiB|JSdposn&{SPUa=xmb)u}*#;@3E7RHS#Rei-mR+_3yR%-nf zd((IzRHBl|{dK}Kv|#jXU}(XF3@w=O_P?5~X~q*tJX5CTx7gF~6lNGGLp_J^b;BJ7t5hzeaKdgrl zOE3x;OK{XdJfj&M;0DoueU(UsDh~63VT=HYB^V{Nrzw!J1hbS1Rlw+$DO6FQ3ROVz zuymz0&Cc2_h7#;NEM85ZD%}^enyJ&|>+PO)npCTzK8-1ukZM&x=~Y#$qCjH`CZt-G zkZM&x)>71}D4@AbpR#-O)y9~D$)j48kZM&zF}o?(gKAZlQmslzwJIUis({kdP^SMp3eo0B=z; zP_qiirZJ@=reKta1y3DW#uUs_iEmJ9WlX^=WlX_@j47D#>-|{96wFe_6bvXGOcAR- z8yQn@%rhOU@)%Pvcmrb!CS**(gp4VekTC@VvM(WN)i$VUHJ;2Q*^Dx>Uz7|KwE}YV zF_S!|U=$2gwE~jos@7;GiLBL$wyhquOkHbCr18dxNMWlJWm_%6)@UY4Ouqg~9~e_GAZfa4l3;=Hy$W0btu|RU zbs80}P78&r&Qt~!4Bo(?f(a$4U}^jI4i9wrL7A0DVw+vToYTAQUTPuE^Ikv0A6vXwdX-MBd>Ln%Akh4N=!K5YT$>Gk(R!Yi%fHjLsl;^;TT& zLQso5FIBrb(bcZn9co=;nrdB@CQ8=~X~WHr&b?(R`Z@f8fB2k#_)GurclZ!zEK=2a zSt8XLK&gsRFWz3x`3x3O{b+G`8a{*A7VYT8MXG*uI6+-g+g@Ct>PM?UB~dWq6vY&( zUsRqSek!Ugk*WGz!`|8)qoOKNt45@w`z>BZkVLc^wI{ttoW9zgh*#@c-;1|YnUT{p z52b+s715?>SfkpC?^Kz2(>$tK2)OuisZJtmtgSPGeS;{`SmH_5S;dtqx+bnvorNKj z#s9Lxfd&06PBjo!a~ZoBvNzMD!d->Tq51v57n+Kvi# zSFj(TjSa4%m>xX=pR4HWvD1)5PHLpB?<@`8Qo-H|9<1O9KyMv4zIk2c?JN>ffACU5 z8ZU*w>Q7z|WYShb({;IgRMsA1@-(Uo>m3Vek{uI+rzx68HA$K%N2C596v=9|-hngL zh=uhI-LcAg2R>ON5*BRm%4+K!xMubDfsB_sXJx;{^l8MyW0K0!_VPZUu+*NWusNgB z^DJVXWOZWsG^!4RCXaD(!b+YfOjA61>2{uYYmImqHY!Z;*UI{+F!lan;LK$!-;xxV zIt@d|cqsL3sV@ah^`(T=mjcQQAoZp40-`Zg(CEkYhJ=)t0uV-`xyW4+xMd`12esvCJi@JWr z^A^I+H^!m4bK1Fo(>0<5$*cJT(w`6w=7IR@ermPnk!+K9M*bgGPqxQ2~M z6pt!N9K^|9&b>isW2hV{LRc%qFsTzS;}hPb6g zr4ptkfOw__kT5L)#5t|ii;Io6`#z=~@K^=UR4{vWsrRx9Zm-|~Kx3+E!RAi7a;x z_o%_ zok#Ixcmkt~C9=>4$so}#6!jk5_~6)poPT|s#9jB$PjT&t>6sWNDz4!0HoveVTg=t0A8zW(-_CNO zqt}D-%9zF_3TU!_;E)|!wS2og(qqWbrl>1Fn%x+jlT#ch1qeoZVwR76ZI0?nZ%%rT zr&8+`<&{PYc?B0Tt`UudI?d#jbN^MD&#bD++1X$46$@;qn_)OlFfdESiV(HN-n@cN^`(%KbUptX&6ul_@-7|PG2{EAg5l7yq3yFBqfiu91@EzhUn3Dgshy_xe0*ipgmznV?j z{#x>-3XTCxH%U{UY;xMMUp~q+nh`!RMz!c>mC73z|rYP7LGO$~MOuGcQF&iJrzNw< zn8U49;Yf0ksPvYn%L8dIK<@?Sf#w*A10=~vZvmr%r?(`$$cMa`;q;d%#16a+_6<*B zw#2(z>~WUc8)Nv??eX6KT7LX~e*85))`h(4Ct9WNj(%r~0`;U(K0l`5wZVwB*UxRR zTAl~RKCXLTe7qhX>tX}~5WUE5kHycYll*9Y{1HC-T$uTrGTb{V*j>SXfIi5&4@8ET zcqJb@4TnNV;cWfk_=4i@*Ni4{LHB|a;K2%x0Q6qqQbUiCOC3k7{M&N)RTbP(!5>%f zNCi(<@G3xS5^Fh%BX#F-+mEJ6R7Wc55J=I#N5zL8gL$1|n9-4*Ny=#86Fg5)Q0BF9cc;{9DoTYp^IxTS)<|5?mfbwxZp zSiup1SuGiU`i;4Z;ufX9mMr5AViSHU1rjr*jS|yH0+Wdcoj7bgrv81bfkAWEn#GgX zh=<+YfgW4q;}=s&I*)h9RF4=JXiUT{GDW2AN+q{#va*x@&cwOEfse95Q-qb)Km- z_cWf!G~%q)sFZ1#2Y7=-1&TpCgHF?r7oCQ-d>bSbQy#y#P}7eWp+=loADLO-J0M~Q zs+06IBVVsxfl4*7{lnuxJ22e#Wp&e(-V7hE;7|omRdBL`^FM4 z${m*`Dzz(gw+bHJtyVZ3PX4ztSnI!5z|IQpuHZfZaTAYA<=P5-ndm0YnRjA}g|9_1 zxd)zdaYc7LQkvXd!G3^oD^x04E5}a5qK?v7TfaW83+p@S3!JL5FMFq0PzKDSDp^OS zSXd8;f+FXYSC-yXKFs!t#F*igM*pTLk-)&Cnc^}^e?x*+rUt#KvJ!ez1?2063x%oH z81!dM#A0EJ_yzHk>O_p01^tQdHRw-3HjF{Dpg-~baD(_$1td*YQRCO2_)|4jsw#Cx z)1NAM>Q9xB{!|I+PnD4VR0-)%m5}~a0i~bpf%#KK!9ahig!HFMNPnt?^ruQlf2x3N z!}OLlaK(%QjRF*qV|E-$#%X4d*sydW)>xvu^cf@uF`b4bmibe~_v%j-(3)k~ozcW) z5TG$J{i&ja@rlcMF$hqWG6+yY2?CUlr=5>&#@f_gY0M8lUXrQu6L8onf?UsXc-RRxruQmnyU23M2v zJQw4azT{Tpm%YQeU#&d4RrUHXjldoDG#89i;BJ8O1VYfC(GcNQmtAYW zG~!1!;^7G-PD*_!=||O0FQNnWsUvPwoo9R9-Y&hU#yoCyJC9COorkF-{Todk@uBKG z+3I2!3m>XFb*6cE5J~iue!ldfYW2xN@=o24!8R6u>U;wb@vbz_Df^xggJ4PAX(G{z0r?95UgHIIn%t9SN$i!G=Txms?nv>RI?qna z{H7{Jx-Y2`onl^7h2pByO{eBISv}@6RY{TKY4h7TgfjeRkek}sgv}2sN) zro1cWFIBs8{9gB$a+2sw%dMtimpDbCkHZK2!vp@|+y3FF_+aO{D!ipi8`O&EEp<)( zcJZh_?KH62#O7CW25-JP1`E5!Q+tkLSA74J%F_>4dmgx2wWhIaSVSZ0N2^9eHz*%y zbC#+n!no0DaOf;^ma43DmU5CgOI6ZQbd1S`mpe(!dE#o^bvQ=a+@s3DkbP*t4i_Z9 zl(gPyrxYQ6UI~)9M%9|!bO*_X^Twj-POpqY6P=#CMRkm-bxE)AD{ASLxdR<((BlEELDV?GUFU6<`iW> zouUk=QjG)+d*TvhBz1|Zq@yM{U6mwtiK--ATIx-4Zt4(am8wIO0dWF&Qm>LghUG?KbQ*%9gvWkB4aW_98W>%<`n*J`-lKiq{6 z+DmnXvV+tW%7D5;8BkX!1L_K8KwY5>s4J8Ln^QD+Q7=DGkdSExdx!Hu~>+1DCMr`_uA3RM<1>IhY9!n#HiJLhxJ z9HA-;%a?G3@&?Tjs?*XD%4y~ZRcQxlg+s@0XNmL!uanBc@`a92zBZ8{&?5?#FHBD5 z6cK{pJydHE#pN;gM)KCo399n2h@%h$M{|4in+sGWVX#aEs;?1sfvP+VmxwLu+T@Lz z3smRvRnmFp0#$h!FlqODbb<2v%mu3QFl1DN@+8aws**5hRDzOZ?oVDZgF(kA4(9$; zsz@2AylTw-$tz)Wovg&%pK2u-Bv{Ls`;#9=6(|nlY9Ci{51t}OX9agE=TQYpXzov5 zYVJ=C&Hc%txj#8n_a{f@{$!A^X>{ODaewkzX3kHQg4rWK4?oRc1yi*W$`NmT*3hM0CDdz0t1EsD`m4cV6 zC7AYJsH0Qm97Rj&=;R!AbE+InE^~8ojygFRN0LqZP^gPjIoMsC%6y=MQ>Ac2sSZwF zr8+oO5+;T^IQjV=r+ZVU(5ffr&INRC@;d3<EPsm4o>x0TTF=al5^|79Ww8+P}R$KO!~tMQ_4zXaEGbdMI9Ws@={(N$sV-Ua zuG%B%yZ=fVRj5o7kSB=;VkGbKo>M33G&~c{NGHDc9q}{hCcT0*)8T4_7uR%?PITR*^@!5Rn5WW7Bqa74wHA)3b1ltM1tuRP=fK`@>anhA`D{W*ZL^JjCq#4tMWvKi6Hb|pC~aa zygp0brDc}9%YY{DGN8%33~2H$1Dd=`0iPeCx-k8fu{3#?0ZrazK$CaX<0-UQUM?eP z@~%#zMGupA8A+3O8PMci1~hq>0ZrazK$CYV@ZPJWQhT4ty9zT!6-j$y1)jXC^6-@O z2+GMr8gEHD;)hxCE{B%9%b_Lja%joB49Wu|1(w?&Ve&3xY4Wbh!W)#bN;?6X@w5|F zN2sY+mYDJMn^~on@wn(Qi-Q<)xOq ztJjbBNv~h5d9wch^V{O$poa{ayvx8X?Q;JjysQ`Do43YG=&DmT%0X)lTPO0?}%R$-BH=OWtLWr;GWM$-A5< zRy#SHG0&N{H??~Qd-%CpK(SuIrh-?r0#S;6Rwd0E*J}RR* zqDi?*t6`qg=g2hAcDcP-n&4LKj)Vwp45 ztW+{;){=Kw_4@Qd_ab?hw`<9}Do>U^)B7e(-c@a|$`WoQ5Z{ zc!FuvKBc)8PNliV#Aqh<=*1)^nS{yX&1dE{_Ptx-bXr>BI4$BAXKixpMLa+4bHp!B zmfU(CzgS6Thf`bRooDgm5F9Vap7PH#{2Ex5YYUPVOXXs?*;Yy`?D&YET{Fc0Nnk5ShHC6Q) z`vtIaVjgYig@!gfS)TbfR3KrGV|*YUl?oqg=$VFQZ?4SC8oIrq13=hy^)cb%(MTvo|_j1HQj;>Na8ZW0H3iWq`8~(H@pr$|N zv?ZXgoBsF(j2OtZ#WekKTEsxEv^4#3TEsw3+QBsaah93>804Z6Yo>^S%wq>L{;4Fa znIZMWyn#Fe4y8%8Y;`$XbC}0hLaQ)rZJQ2yE+1(;Zi8EFC#y*j>SX zfc6AH6SAR_IJJKCvD0wmp<6jyuhPgs*;ULHH3RZ$_D)eSP1Fj=DMzL#m?9DTSWnnu zA1jd9$A0h~S8Ft?=t8jsl9>PU{qP7#v7dOlf>#0BNVtB4kj8%WZU1bVW0pX{IRs8y zRiGPg3KZQqIYq*2*=&J=wDaxLHMucRknRI1r;LO=_RgL_Njo7o2dWd}n(<}h)>iC+ zVwCoS)9cawt6ctgL#jbgorP46I7fn{CP6;EE#9$SNQ-x@z~UV%uz1G`EZ(sKi+8NR z;vFlnc*hDX-mwCUcdWqT9V@VS#{{O}$c@nVKUc!ssGKB4D6Br}Zp7jpYo!+NSb@bm zR$%dt63~<(RDy+FQg{$V$Ris50>YOj{u* zs*Xb)DynoHXT$aVdpva(wH2xj@kWSWsk|k#73#!lE969qIpdboR>)~)D^%;llQV3E zoF;k>#L7yO^T5w-YAfVCvlS}5kaTEq<2=!HdVSqis8+DJs?$0Ys!nT2vr=`U%Q}r{ zwnDXGce83dvlXhmW-H`pXtqL?*KCEHXSPC>XAynWR>*m)!d9qIyRA?ySX=~ZV}U&# zciXfTs>d%b1NGyZtx&B%v=pp8P7~6nS3o7mHE*lHZG~!m%~r^HW-C;A%~r^HW-Fx7 zY=sQ${J-k{j9%><)K*+b3K>vap?W;k9kUfO zlG+M&QrZd`No|D;sI8CzwG}d;wn7HfR!D*OUNxNB`?M7*%+zq?S5_-PJ2O3ifY3cwXhX(n%N3f8W&nqZ%B#y z(^{>zLSCEM3Mm}aR>;fDR>&bE{zQd?*$P>yPE*lc)Kx3_tt4%QtOELZjfi-lq^*$i%vPwh8-mY< z@(>WkXH*>)SH)Jy>tl?c7)qTw%~r^XW-H{-Y=s<}t&l^r6>?~{LI&9gmQraeM77{g}fTG6{^)pufkTyd1fnAdDyfU zTOlW!txzRm0a|Q@v}90QAp>eF#4#at8 zD^z(Hm#`Ibn%N3f8s<&f3OUbgg({C~kDH%3&uoP{4`|FYTcOGm)yM2WBytG`6Au-$ z6{c%Bo4*#R)F4=s1_}#;EYlq!mp4l|qad>XkOj<>E9 z;_Trsub5dqy#F8ORxP=BIQRLvEi1R7;ng_)rpcbkn}>)0bY{!^51%{xpGei4FjyC} z$Db?>OxWXXlglPoO#Tk#+vcDA*IQQVxJlp6nk-t_$3*7@&#WW`bp`S1;NdHCV3C1(%+^ZB_|!(V)6 z>6$n4xQSd4mT#Z`$)B$ne)5Ky74z4>vSR*SGw19)fEJ{Ui*d0wfwzvsxUG$w_EwlO zA2&^|MB|^8t3UtCkF8y=$IC_0)`Y!nc=#XY)(;n4vUGNbURt@hH{rhwS6<=?+L8aa zVw(I1`83@0hfBB2pTA|rO1;WbrBwIq+<6;^C-%=STPZV2E}k^IWZ3idW$U-B#u-Yh z??u1l|7Y2|%cY&+qc6;DeVfji-tab@$TIl~*K9TBmVXki9QeImOV%#kHo18C@e6ZX zc#=9y7ju}-$3VS#*!O31>sRJ|@Y-bc@YWaSHor;c?M0IvlebR(2Zj@0KD2c6aP}{j zuKL`ERxEja{-&9=GV9J6zInyW`EvbccopQf+C2R3KR;{L@bZgu=Ph5sJLuA3^GkCV z4bT7iva{c~eX^Z%92aZ;++FL3`~P6+n&Bfa&8?e1=Py>w$cUUZJiKGcmX$a1q?T}y zmJM&cbm_(!xf?H?-;O!_`?D*CZ~oKe%jUnf. ***/ +#include +#include #include /* diff --git a/src/libsystemd/sd-bus/bus-common-errors.c b/src/libsystemd/sd-bus/bus-common-errors.c index 3dc00b5e4..eb60ca362 100644 --- a/src/libsystemd/sd-bus/bus-common-errors.c +++ b/src/libsystemd/sd-bus/bus-common-errors.c @@ -38,13 +38,14 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = { SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, EDEADLOCK), SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, EDEADLOCK), SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, EDEADLOCK), - SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, ENOSYS), + SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, EBADR), SD_BUS_ERROR_MAP(BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, EBADR), SD_BUS_ERROR_MAP(BUS_ERROR_NO_ISOLATION, EPERM), SD_BUS_ERROR_MAP(BUS_ERROR_SHUTTING_DOWN, ECANCELED), SD_BUS_ERROR_MAP(BUS_ERROR_SCOPE_NOT_RUNNING, EHOSTDOWN), SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_MACHINE, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_IMAGE, ENOENT), SD_BUS_ERROR_MAP(BUS_ERROR_NO_MACHINE_FOR_PID, ENXIO), SD_BUS_ERROR_MAP(BUS_ERROR_MACHINE_EXISTS, EEXIST), SD_BUS_ERROR_MAP(BUS_ERROR_NO_PRIVATE_NETWORKING, ENOSYS), @@ -59,7 +60,7 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = { SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_IS_TAKEN, EINVAL), SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_NOT_TAKEN, EINVAL), SD_BUS_ERROR_MAP(BUS_ERROR_OPERATION_IN_PROGRESS, EINPROGRESS), - SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, ENOSYS), + SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, ENOTSUP), SD_BUS_ERROR_MAP(BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, EALREADY), @@ -72,5 +73,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = { SD_BUS_ERROR_MAP(BUS_ERROR_CNAME_LOOP, EDEADLOCK), SD_BUS_ERROR_MAP(BUS_ERROR_ABORTED, ECANCELED), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_TRANSFER, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_TRANSFER_IN_PROGRESS, EBUSY), + SD_BUS_ERROR_MAP_END }; diff --git a/src/libsystemd/sd-bus/bus-common-errors.h b/src/libsystemd/sd-bus/bus-common-errors.h index 5b7f41ef1..e935833bc 100644 --- a/src/libsystemd/sd-bus/bus-common-errors.h +++ b/src/libsystemd/sd-bus/bus-common-errors.h @@ -43,6 +43,7 @@ #define BUS_ERROR_SCOPE_NOT_RUNNING "org.freedesktop.systemd1.ScopeNotRunning" #define BUS_ERROR_NO_SUCH_MACHINE "org.freedesktop.machine1.NoSuchMachine" +#define BUS_ERROR_NO_SUCH_IMAGE "org.freedesktop.machine1.NoSuchImage" #define BUS_ERROR_NO_MACHINE_FOR_PID "org.freedesktop.machine1.NoMachineForPID" #define BUS_ERROR_MACHINE_EXISTS "org.freedesktop.machine1.MachineExists" #define BUS_ERROR_NO_PRIVATE_NETWORKING "org.freedesktop.machine1.NoPrivateNetworking" @@ -71,4 +72,7 @@ #define BUS_ERROR_ABORTED "org.freedesktop.resolve1.Aborted" #define _BUS_ERROR_DNS "org.freedesktop.resolve1.DnsError." +#define BUS_ERROR_NO_SUCH_TRANSFER "org.freedesktop.import1.NoSuchTransfer" +#define BUS_ERROR_TRANSFER_IN_PROGRESS "org.freedesktop.import1.TransferInProgress" + BUS_ERROR_MAP_ELF_USE(bus_common_errors); diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c index dd4bf1512..d29b98a26 100644 --- a/src/libsystemd/sd-bus/bus-container.c +++ b/src/libsystemd/sd-bus/bus-container.c @@ -30,19 +30,22 @@ int bus_container_connect_socket(sd_bus *b) { _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1; - pid_t leader, child; + pid_t child; siginfo_t si; int r; assert(b); assert(b->input_fd < 0); assert(b->output_fd < 0); + assert(b->nspid > 0 || b->machine); - r = container_get_leader(b->machine, &leader); - if (r < 0) - return r; + if (b->nspid <= 0) { + r = container_get_leader(b->machine, &b->nspid); + if (r < 0) + return r; + } - r = namespace_open(leader, &pidnsfd, &mntnsfd, NULL, &rootfd); + r = namespace_open(b->nspid, &pidnsfd, &mntnsfd, NULL, &rootfd); if (r < 0) return r; @@ -127,7 +130,7 @@ int bus_container_connect_kernel(sd_bus *b) { .msg_controllen = sizeof(control), }; struct cmsghdr *cmsg; - pid_t leader, child; + pid_t child; siginfo_t si; int r; _cleanup_close_ int fd = -1; @@ -135,12 +138,15 @@ int bus_container_connect_kernel(sd_bus *b) { assert(b); assert(b->input_fd < 0); assert(b->output_fd < 0); + assert(b->nspid > 0 || b->machine); - r = container_get_leader(b->machine, &leader); - if (r < 0) - return r; + if (b->nspid <= 0) { + r = container_get_leader(b->machine, &b->nspid); + if (r < 0) + return r; + } - r = namespace_open(leader, &pidnsfd, &mntnsfd, NULL, &rootfd); + r = namespace_open(b->nspid, &pidnsfd, &mntnsfd, NULL, &rootfd); if (r < 0) return r; diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c index 813c97f65..06e5b4fd9 100644 --- a/src/libsystemd/sd-bus/bus-control.c +++ b/src/libsystemd/sd-bus/bus-control.c @@ -33,6 +33,7 @@ #include "bus-control.h" #include "bus-bloom.h" #include "bus-util.h" +#include "capability.h" #include "cgroup-util.h" _public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { @@ -51,7 +52,7 @@ _public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { } static int bus_request_name_kernel(sd_bus *bus, const char *name, uint64_t flags) { - struct kdbus_cmd_name *n; + struct kdbus_cmd *n; size_t size, l; int r; @@ -59,7 +60,7 @@ static int bus_request_name_kernel(sd_bus *bus, const char *name, uint64_t flags assert(name); l = strlen(name) + 1; - size = offsetof(struct kdbus_cmd_name, items) + KDBUS_ITEM_SIZE(l); + size = offsetof(struct kdbus_cmd, items) + KDBUS_ITEM_SIZE(l); n = alloca0_align(size, 8); n->size = size; n->flags = request_name_flags_to_kdbus(flags); @@ -136,6 +137,10 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags) assert_return(service_name_is_valid(name), -EINVAL); assert_return(name[0] != ':', -EINVAL); + /* Don't allow requesting the special driver and local names */ + if (STR_IN_SET(name, "org.freedesktop.DBus", "org.freedesktop.DBus.Local")) + return -EINVAL; + if (!BUS_IS_OPEN(bus->state)) return -ENOTCONN; @@ -146,7 +151,7 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags) } static int bus_release_name_kernel(sd_bus *bus, const char *name) { - struct kdbus_cmd_name *n; + struct kdbus_cmd *n; size_t size, l; int r; @@ -154,7 +159,7 @@ static int bus_release_name_kernel(sd_bus *bus, const char *name) { assert(name); l = strlen(name) + 1; - size = offsetof(struct kdbus_cmd_name, items) + KDBUS_ITEM_SIZE(l); + size = offsetof(struct kdbus_cmd, items) + KDBUS_ITEM_SIZE(l); n = alloca0_align(size, 8); n->size = size; @@ -214,6 +219,10 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) { assert_return(service_name_is_valid(name), -EINVAL); assert_return(name[0] != ':', -EINVAL); + /* Don't allow releasing the special driver and local names */ + if (STR_IN_SET(name, "org.freedesktop.DBus", "org.freedesktop.DBus.Local")) + return -EINVAL; + if (!BUS_IS_OPEN(bus->state)) return -ENOTCONN; @@ -224,31 +233,31 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) { } static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) { - struct kdbus_cmd_name_list cmd = {}; - struct kdbus_name_list *name_list; - struct kdbus_name_info *name; + struct kdbus_cmd_list cmd = { + .size = sizeof(cmd), + .flags = flags, + }; + struct kdbus_info *name_list, *name; uint64_t previous_id = 0; int r; /* Caller will free half-constructed list on failure... */ - cmd.flags = flags; - - r = ioctl(bus->input_fd, KDBUS_CMD_NAME_LIST, &cmd); + r = ioctl(bus->input_fd, KDBUS_CMD_LIST, &cmd); if (r < 0) return -errno; - name_list = (struct kdbus_name_list *) ((uint8_t *) bus->kdbus_buffer + cmd.offset); + name_list = (struct kdbus_info *) ((uint8_t *) bus->kdbus_buffer + cmd.offset); - KDBUS_ITEM_FOREACH(name, name_list, names) { + KDBUS_FOREACH(name, name_list, cmd.list_size) { struct kdbus_item *item; const char *entry_name = NULL; - if ((flags & KDBUS_NAME_LIST_UNIQUE) && name->owner_id != previous_id) { + if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id) { char *n; - if (asprintf(&n, ":1.%llu", (unsigned long long) name->owner_id) < 0) { + if (asprintf(&n, ":1.%llu", (unsigned long long) name->id) < 0) { r = -ENOMEM; goto fail; } @@ -257,7 +266,7 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) { if (r < 0) goto fail; - previous_id = name->owner_id; + previous_id = name->id; } KDBUS_ITEM_FOREACH(item, name, items) @@ -285,13 +294,13 @@ static int bus_list_names_kernel(sd_bus *bus, char ***acquired, char ***activata int r; if (acquired) { - r = kernel_get_list(bus, KDBUS_NAME_LIST_UNIQUE | KDBUS_NAME_LIST_NAMES, &x); + r = kernel_get_list(bus, KDBUS_LIST_UNIQUE | KDBUS_LIST_NAMES, &x); if (r < 0) return r; } if (activatable) { - r = kernel_get_list(bus, KDBUS_NAME_LIST_ACTIVATORS, &y); + r = kernel_get_list(bus, KDBUS_LIST_ACTIVATORS, &y); if (r < 0) return r; @@ -519,8 +528,11 @@ static int bus_populate_creds_from_items( SD_BUS_CREDS_INHERITABLE_CAPS | SD_BUS_CREDS_BOUNDING_CAPS) & mask; if (m) { - c->capability_size = item->size - offsetof(struct kdbus_item, caps.caps); - c->capability = memdup(item->caps.caps, c->capability_size); + if (item->caps.last_cap != cap_last_cap() || + item->size - offsetof(struct kdbus_item, caps.caps) < DIV_ROUND_UP(item->caps.last_cap, 32U) * 4 * 4) + return -EBADMSG; + + c->capability = memdup(item->caps.caps, item->size - offsetof(struct kdbus_item, caps.caps)); if (!c->capability) return -ENOMEM; @@ -609,6 +621,9 @@ int bus_get_name_creds_kdbus( uint64_t id; int r; + if (streq(name, "org.freedesktop.DBus")) + return -ENOTSUP; + r = bus_kernel_parse_unique_name(name, &id); if (r < 0) return r; @@ -625,11 +640,8 @@ int bus_get_name_creds_kdbus( memcpy(cmd->items[0].str, name, l); } - cmd->size = size; - cmd->flags = attach_flags_to_kdbus(mask); - - /* If augmentation is on, and the bus doesn't didn't allow us - * to get the bits we want, then ask for the PID/TID so that we + /* If augmentation is on, and the bus didn't provide us + * the bits we want, then ask for the PID/TID so that we * can read the rest from /proc. */ if ((mask & SD_BUS_CREDS_AUGMENT) && (mask & (SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID| @@ -639,7 +651,10 @@ int bus_get_name_creds_kdbus( SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS| SD_BUS_CREDS_SELINUX_CONTEXT| SD_BUS_CREDS_AUDIT_SESSION_ID|SD_BUS_CREDS_AUDIT_LOGIN_UID))) - cmd->flags |= KDBUS_ATTACH_PIDS; + mask |= SD_BUS_CREDS_PID; + + cmd->size = size; + cmd->flags = attach_flags_to_kdbus(mask); r = ioctl(bus->input_fd, KDBUS_CMD_CONN_INFO, cmd); if (r < 0) @@ -746,7 +761,7 @@ static int bus_get_name_creds_dbus1( if ((mask & SD_BUS_CREDS_PID) || ((mask & SD_BUS_CREDS_AUGMENT) && - (mask & (SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID| + (mask & (SD_BUS_CREDS_UID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID| SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID| SD_BUS_CREDS_COMM|SD_BUS_CREDS_EXE|SD_BUS_CREDS_CMDLINE| SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID| @@ -782,7 +797,7 @@ static int bus_get_name_creds_dbus1( reply = sd_bus_message_unref(reply); } - if (mask & SD_BUS_CREDS_UID) { + if (mask & SD_BUS_CREDS_EUID) { uint32_t u; r = sd_bus_call_method( @@ -802,8 +817,8 @@ static int bus_get_name_creds_dbus1( if (r < 0) return r; - c->uid = u; - c->mask |= SD_BUS_CREDS_UID; + c->euid = u; + c->mask |= SD_BUS_CREDS_EUID; reply = sd_bus_message_unref(reply); } @@ -866,6 +881,9 @@ _public_ int sd_bus_get_name_creds( assert_return(service_name_is_valid(name), -EINVAL); assert_return(bus->bus_client, -ENODATA); + if (streq(name, "org.freedesktop.DBus.Local")) + return -EINVAL; + if (!BUS_IS_OPEN(bus->state)) return -ENOTCONN; @@ -878,7 +896,7 @@ _public_ int sd_bus_get_name_creds( static int bus_get_owner_creds_kdbus(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) { _cleanup_bus_creds_unref_ sd_bus_creds *c = NULL; struct kdbus_cmd_info cmd = { - .size = sizeof(struct kdbus_cmd_info) + .size = sizeof(struct kdbus_cmd_info), }; struct kdbus_info *creator_info; pid_t pid = 0; @@ -888,8 +906,6 @@ static int bus_get_owner_creds_kdbus(sd_bus *bus, uint64_t mask, sd_bus_creds ** if (!c) return -ENOMEM; - cmd.flags = attach_flags_to_kdbus(mask); - /* If augmentation is on, and the bus doesn't didn't allow us * to get the bits we want, then ask for the PID/TID so that we * can read the rest from /proc. */ @@ -901,7 +917,9 @@ static int bus_get_owner_creds_kdbus(sd_bus *bus, uint64_t mask, sd_bus_creds ** SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS| SD_BUS_CREDS_SELINUX_CONTEXT| SD_BUS_CREDS_AUDIT_SESSION_ID|SD_BUS_CREDS_AUDIT_LOGIN_UID))) - cmd.flags |= KDBUS_ATTACH_PIDS; + mask |= SD_BUS_CREDS_PID; + + cmd.flags = attach_flags_to_kdbus(mask); r = ioctl(bus->input_fd, KDBUS_CMD_BUS_CREATOR_INFO, &cmd); if (r < 0) @@ -942,13 +960,13 @@ static int bus_get_owner_creds_dbus1(sd_bus *bus, uint64_t mask, sd_bus_creds ** } if (bus->ucred.uid != UID_INVALID) { - c->uid = bus->ucred.uid; - c->mask |= SD_BUS_CREDS_UID & mask; + c->euid = bus->ucred.uid; + c->mask |= SD_BUS_CREDS_EUID & mask; } if (bus->ucred.gid != GID_INVALID) { - c->gid = bus->ucred.gid; - c->mask |= SD_BUS_CREDS_GID & mask; + c->egid = bus->ucred.gid; + c->mask |= SD_BUS_CREDS_EGID & mask; } } @@ -1249,7 +1267,7 @@ int bus_add_match_internal_kernel( if (c->type - BUS_MATCH_ARG < 3) name_change_arg[c->type - BUS_MATCH_ARG] = c->value_str; - snprintf(buf, sizeof(buf), "arg%u", c->type - BUS_MATCH_ARG); + xsprintf(buf, "arg%i", c->type - BUS_MATCH_ARG); bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str); using_bloom = true; break; @@ -1258,7 +1276,7 @@ int bus_add_match_internal_kernel( case BUS_MATCH_ARG_PATH...BUS_MATCH_ARG_PATH_LAST: { char buf[sizeof("arg")-1 + 2 + sizeof("-slash-prefix")]; - snprintf(buf, sizeof(buf), "arg%u-slash-prefix", c->type - BUS_MATCH_ARG_PATH); + xsprintf(buf, "arg%i-slash-prefix", c->type - BUS_MATCH_ARG_PATH); bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str); using_bloom = true; break; @@ -1267,7 +1285,7 @@ int bus_add_match_internal_kernel( case BUS_MATCH_ARG_NAMESPACE...BUS_MATCH_ARG_NAMESPACE_LAST: { char buf[sizeof("arg")-1 + 2 + sizeof("-dot-prefix")]; - snprintf(buf, sizeof(buf), "arg%u-dot-prefix", c->type - BUS_MATCH_ARG_NAMESPACE); + xsprintf(buf, "arg%i-dot-prefix", c->type - BUS_MATCH_ARG_NAMESPACE); bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str); using_bloom = true; break; @@ -1340,7 +1358,7 @@ int bus_add_match_internal_kernel( #define internal_match(bus, m) \ ((bus)->hello_flags & KDBUS_HELLO_MONITOR \ - ? (isempty(m) ? "eavesdrop='true'" : strappenda((m), ",eavesdrop='true'")) \ + ? (isempty(m) ? "eavesdrop='true'" : strjoina((m), ",eavesdrop='true'")) \ : (m)) static int bus_add_match_internal_dbus1( @@ -1385,7 +1403,10 @@ int bus_remove_match_internal_kernel( sd_bus *bus, uint64_t cookie) { - struct kdbus_cmd_match m; + struct kdbus_cmd_match m = { + .size = offsetof(struct kdbus_cmd_match, items), + .cookie = cookie, + }; int r; assert(bus); @@ -1394,10 +1415,6 @@ int bus_remove_match_internal_kernel( if (bus->hello_flags & KDBUS_HELLO_MONITOR) return 0; - zero(m); - m.size = offsetof(struct kdbus_cmd_match, items); - m.cookie = cookie; - r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_REMOVE, &m); if (r < 0) return -errno; diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c index ae0f4fa21..a6317e978 100644 --- a/src/libsystemd/sd-bus/bus-convenience.c +++ b/src/libsystemd/sd-bus/bus-convenience.c @@ -234,7 +234,7 @@ _public_ int sd_bus_reply_method_errnof( return 0; va_start(ap, format); - bus_error_set_errnofv(&berror, error, format, ap); + sd_bus_error_set_errnofv(&berror, error, format, ap); va_end(ap); return sd_bus_reply_method_error(call, &berror); diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c index 9978ddfa3..ea8a619c5 100644 --- a/src/libsystemd/sd-bus/bus-creds.c +++ b/src/libsystemd/sd-bus/bus-creds.c @@ -20,8 +20,10 @@ ***/ #include +#include #include "util.h" +#include "capability.h" #include "cgroup-util.h" #include "fileio.h" #include "audit.h" @@ -218,7 +220,7 @@ _public_ int sd_bus_creds_get_gid(sd_bus_creds *c, gid_t *gid) { assert_return(c, -EINVAL); assert_return(gid, -EINVAL); - if (!(c->mask & SD_BUS_CREDS_UID)) + if (!(c->mask & SD_BUS_CREDS_GID)) return -ENODATA; *gid = c->gid; @@ -588,13 +590,14 @@ static int has_cap(sd_bus_creds *c, unsigned offset, int capability) { size_t sz; assert(c); + assert(capability >= 0); assert(c->capability); - sz = c->capability_size / 4; - if ((size_t) capability >= sz*8) + sz = DIV_ROUND_UP(cap_last_cap(), 32U); + if ((unsigned)capability > cap_last_cap()) return 0; - return !!(c->capability[offset * sz + (capability / 8)] & (1 << (capability % 8))); + return !!(c->capability[offset * sz + CAP_TO_INDEX(capability)] & CAP_TO_MASK(capability)); } _public_ int sd_bus_creds_has_effective_cap(sd_bus_creds *c, int capability) { @@ -638,37 +641,43 @@ _public_ int sd_bus_creds_has_bounding_cap(sd_bus_creds *c, int capability) { } static int parse_caps(sd_bus_creds *c, unsigned offset, const char *p) { - size_t sz; - unsigned i; + size_t sz, max; + unsigned i, j; assert(c); assert(p); + max = DIV_ROUND_UP(cap_last_cap(), 32U); p += strspn(p, WHITESPACE); sz = strlen(p); - if (sz % 2 != 0) + if (sz % 8 != 0) + return -EINVAL; + + sz /= 8; + if (sz > max) return -EINVAL; - sz /= 2; if (!c->capability) { - c->capability = new0(uint8_t, sz * 4); + c->capability = new0(uint32_t, max * 4); if (!c->capability) return -ENOMEM; - - c->capability_size = sz * 4; } for (i = 0; i < sz; i ++) { - int x, y; + uint32_t v = 0; + + for (j = 0; j < 8; ++j) { + int t; - x = unhexchar(p[i*2]); - y = unhexchar(p[i*2+1]); + t = unhexchar(*p++); + if (t < 0) + return -EINVAL; - if (x < 0 || y < 0) - return -EINVAL; + v = (v << 4) | t; + } - c->capability[offset * sz + (sz - i - 1)] = (uint8_t) x << 4 | (uint8_t) y; + c->capability[offset * max + (sz - i - 1)] = v; } return 0; @@ -1073,11 +1082,10 @@ int bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret) } if (c->mask & mask & (SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS)) { - n->capability = memdup(c->capability, c->capability_size); + n->capability = memdup(c->capability, DIV_ROUND_UP(cap_last_cap(), 32U) * 4 * 4); if (!n->capability) return -ENOMEM; - n->capability_size = c->capability_size; n->mask |= c->mask & mask & (SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS); } diff --git a/src/libsystemd/sd-bus/bus-creds.h b/src/libsystemd/sd-bus/bus-creds.h index 48453e2af..3b337efa3 100644 --- a/src/libsystemd/sd-bus/bus-creds.h +++ b/src/libsystemd/sd-bus/bus-creds.h @@ -60,8 +60,7 @@ struct sd_bus_creds { char *user_unit; char *slice; - uint8_t *capability; - size_t capability_size; + uint32_t *capability; uint32_t audit_session_id; uid_t audit_login_uid; diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c index 33d0ed2df..718163964 100644 --- a/src/libsystemd/sd-bus/bus-dump.c +++ b/src/libsystemd/sd-bus/bus-dump.c @@ -69,7 +69,7 @@ int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) { if (flags & BUS_MESSAGE_DUMP_WITH_HEADER) { fprintf(f, - "%s%s%s Type=%s%s%s Endian=%c Flags=%u Version=%u Priority=%lli", + "%s%s%s Type=%s%s%s Endian=%c Flags=%u Version=%u Priority=%"PRIi64, m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() : m->header->type == SD_BUS_MESSAGE_METHOD_RETURN ? ansi_highlight_green() : m->header->type != SD_BUS_MESSAGE_SIGNAL ? ansi_highlight() : "", draw_special_char(DRAW_TRIANGULAR_BULLET), ansi_highlight_off(), @@ -77,7 +77,7 @@ int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) { m->header->endian, m->header->flags, m->header->version, - (long long) m->priority); + m->priority); /* Display synthetic message serial number in a more readable * format than (uint32_t) -1 */ @@ -129,8 +129,15 @@ int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) { if (r < 0) return log_error_errno(r, "Failed to rewind: %m"); - if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) - fprintf(f, "%sMESSAGE \"%s\" {\n", indent(0, flags), strempty(m->root_container.signature)); + if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) { + _cleanup_free_ char *prefix = NULL; + + prefix = indent(0, flags); + if (!prefix) + return log_oom(); + + fprintf(f, "%sMESSAGE \"%s\" {\n", prefix, strempty(m->root_container.signature)); + } for (;;) { _cleanup_free_ char *prefix = NULL; @@ -259,8 +266,15 @@ int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) { } } - if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) - fprintf(f, "%s};\n\n", indent(0, flags)); + if (!(flags & BUS_MESSAGE_DUMP_SUBTREE_ONLY)) { + _cleanup_free_ char *prefix = NULL; + + prefix = indent(0, flags); + if (!prefix) + return log_oom(); + + fprintf(f, "%s};\n\n", prefix); + } return 0; } @@ -340,7 +354,7 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse) { color = ansi_highlight(); off = ansi_highlight_off(); - suffix = strappenda(off, "\n"); + suffix = strjoina(off, "\n"); } if (c->mask & SD_BUS_CREDS_PID) @@ -419,16 +433,16 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse) { if (c->mask & SD_BUS_CREDS_CGROUP) fprintf(f, "%sCGroup=%s%s%s", prefix, color, c->cgroup, suffix); - sd_bus_creds_get_unit(c, &u); + (void) sd_bus_creds_get_unit(c, &u); if (u) fprintf(f, "%sUnit=%s%s%s", prefix, color, u, suffix); - sd_bus_creds_get_user_unit(c, &uu); + (void) sd_bus_creds_get_user_unit(c, &uu); if (uu) fprintf(f, "%sUserUnit=%s%s%s", prefix, color, uu, suffix); - sd_bus_creds_get_slice(c, &sl); + (void) sd_bus_creds_get_slice(c, &sl); if (sl) fprintf(f, "%sSlice=%s%s%s", prefix, color, sl, suffix); - sd_bus_creds_get_session(c, &s); + (void) sd_bus_creds_get_session(c, &s); if (s) fprintf(f, "%sSession=%s%s%s", prefix, color, s, suffix); diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c index 2955d9dd2..3bf0c5d3e 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -265,7 +265,7 @@ int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, va_li return -ENOMEM; } - /* Of we hit OOM on formatting the pretty message, we ignore + /* If we hit OOM on formatting the pretty message, we ignore * this, since we at least managed to write the error name */ if (format) (void) vasprintf((char**) &e->message, format, ap); @@ -468,7 +468,7 @@ _public_ int sd_bus_error_set_errno(sd_bus_error *e, int error) { return -error; } -int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_list ap) { +_public_ int sd_bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_list ap) { PROTECT_ERRNO; int r; @@ -551,7 +551,7 @@ _public_ int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *for va_list ap; va_start(ap, format); - r = bus_error_set_errnofv(e, error, format, ap); + r = sd_bus_error_set_errnofv(e, error, format, ap); va_end(ap); return r; diff --git a/src/libsystemd/sd-bus/bus-gvariant.c b/src/libsystemd/sd-bus/bus-gvariant.c index dc4000992..02b95cd13 100644 --- a/src/libsystemd/sd-bus/bus-gvariant.c +++ b/src/libsystemd/sd-bus/bus-gvariant.c @@ -247,3 +247,63 @@ int bus_gvariant_is_fixed_size(const char *signature) { return true; } + +size_t bus_gvariant_determine_word_size(size_t sz, size_t extra) { + if (sz + extra <= 0xFF) + return 1; + else if (sz + extra*2 <= 0xFFFF) + return 2; + else if (sz + extra*4 <= 0xFFFFFFFF) + return 4; + else + return 8; +} + +size_t bus_gvariant_read_word_le(void *p, size_t sz) { + union { + uint16_t u16; + uint32_t u32; + uint64_t u64; + } x; + + assert(p); + + if (sz == 1) + return *(uint8_t*) p; + + memcpy(&x, p, sz); + + if (sz == 2) + return le16toh(x.u16); + else if (sz == 4) + return le32toh(x.u32); + else if (sz == 8) + return le64toh(x.u64); + + assert_not_reached("unknown word width"); +} + +void bus_gvariant_write_word_le(void *p, size_t sz, size_t value) { + union { + uint16_t u16; + uint32_t u32; + uint64_t u64; + } x; + + assert(p); + assert(sz == 8 || (value < (1ULL << (sz*8)))); + + if (sz == 1) { + *(uint8_t*) p = value; + return; + } else if (sz == 2) + x.u16 = htole16((uint16_t) value); + else if (sz == 4) + x.u32 = htole32((uint32_t) value); + else if (sz == 8) + x.u64 = htole64((uint64_t) value); + else + assert_not_reached("unknown word width"); + + memcpy(p, &x, sz); +} diff --git a/src/libsystemd/sd-bus/bus-gvariant.h b/src/libsystemd/sd-bus/bus-gvariant.h index b4bd2a50f..875d34b59 100644 --- a/src/libsystemd/sd-bus/bus-gvariant.h +++ b/src/libsystemd/sd-bus/bus-gvariant.h @@ -21,6 +21,12 @@ along with systemd; If not, see . ***/ +#include "macro.h" + int bus_gvariant_get_size(const char *signature) _pure_; int bus_gvariant_get_alignment(const char *signature) _pure_; int bus_gvariant_is_fixed_size(const char *signature) _pure_; + +size_t bus_gvariant_determine_word_size(size_t sz, size_t extra); +void bus_gvariant_write_word_le(void *p, size_t sz, size_t value); +size_t bus_gvariant_read_word_le(void *p, size_t sz); diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h index 977b3407b..e9f1a816a 100644 --- a/src/libsystemd/sd-bus/bus-internal.h +++ b/src/libsystemd/sd-bus/bus-internal.h @@ -31,6 +31,7 @@ #include "list.h" #include "util.h" #include "refcnt.h" +#include "socket-util.h" #include "sd-bus.h" #include "bus-error.h" @@ -244,6 +245,7 @@ struct sd_bus { char *kernel; char *machine; + pid_t nspid; sd_id128_t server_id; @@ -384,7 +386,7 @@ char *bus_address_escape(const char *v); int bus_set_address_system(sd_bus *bus); int bus_set_address_user(sd_bus *bus); int bus_set_address_system_remote(sd_bus *b, const char *host); -int bus_set_address_system_container(sd_bus *b, const char *machine); +int bus_set_address_system_machine(sd_bus *b, const char *machine); int bus_remove_match_by_string(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata); diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 752c63adb..e90ee449d 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -25,13 +25,19 @@ #include #include -#include #include #include +/* When we include libgen.h because we need dirname() we immediately + * undefine basename() since libgen.h defines it as a macro to the XDG + * version which is really broken. */ +#include +#undef basename + #include "util.h" #include "strv.h" #include "memfd-util.h" +#include "capability.h" #include "cgroup-util.h" #include "fileio.h" @@ -294,8 +300,9 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { memzero(m->kdbus, sz); m->kdbus->flags = - ((m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) ? 0 : KDBUS_MSG_FLAGS_EXPECT_REPLY) | - ((m->header->flags & BUS_MESSAGE_NO_AUTO_START) ? KDBUS_MSG_FLAGS_NO_AUTO_START : 0); + ((m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) ? 0 : KDBUS_MSG_EXPECT_REPLY) | + ((m->header->flags & BUS_MESSAGE_NO_AUTO_START) ? KDBUS_MSG_NO_AUTO_START : 0) | + ((m->header->type == SD_BUS_MESSAGE_SIGNAL) ? KDBUS_MSG_SIGNAL : 0); if (well_known) /* verify_destination_id will usually be 0, which makes the kernel driver only look @@ -307,7 +314,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { m->kdbus->dst_id = destination ? unique : KDBUS_DST_ID_BROADCAST; m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS; - m->kdbus->cookie = (uint64_t) m->header->serial; + m->kdbus->cookie = m->header->dbus2.cookie; m->kdbus->priority = m->priority; if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) @@ -355,7 +362,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { append_payload_vec(&d, part->data, part->size); } - if (m->kdbus->dst_id == KDBUS_DST_ID_BROADCAST) { + if (m->header->type == SD_BUS_MESSAGE_SIGNAL) { struct kdbus_bloom_filter *bloom; bloom = append_bloom(&d, m->bus->bloom_size); @@ -377,15 +384,6 @@ fail: return r; } -static void bus_message_set_sender_driver(sd_bus *bus, sd_bus_message *m) { - assert(bus); - assert(m); - - m->sender = m->creds.unique_name = (char*) "org.freedesktop.DBus"; - m->creds.well_known_names_driver = true; - m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask; -} - static void unset_memfds(struct sd_bus_message *m) { struct bus_body_part *part; unsigned i; @@ -398,14 +396,32 @@ static void unset_memfds(struct sd_bus_message *m) { part->memfd = -1; } +static void message_set_timestamp(sd_bus *bus, sd_bus_message *m, const struct kdbus_timestamp *ts) { + assert(bus); + assert(m); + + if (!ts) + return; + + if (!(bus->attach_flags & KDBUS_ATTACH_TIMESTAMP)) + return; + + m->realtime = ts->realtime_ns / NSEC_PER_USEC; + m->monotonic = ts->monotonic_ns / NSEC_PER_USEC; + m->seqnum = ts->seqnum; +} + static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { sd_bus_message *m = NULL; struct kdbus_item *d; unsigned n_fds = 0; _cleanup_free_ int *fds = NULL; - struct bus_header *h = NULL; - size_t total, n_bytes = 0, idx = 0; + struct bus_header *header = NULL; + void *footer = NULL; + size_t header_size = 0, footer_size = 0; + size_t n_bytes = 0, idx = 0; const char *destination = NULL, *seclabel = NULL; + bool last_was_memfd = false; int r; assert(bus); @@ -420,21 +436,24 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { switch (d->type) { case KDBUS_ITEM_PAYLOAD_OFF: - if (!h) { - h = (struct bus_header *)((uint8_t *)bus->kdbus_buffer + d->vec.offset); - - if (!bus_header_is_complete(h, d->vec.size)) - return -EBADMSG; + if (!header) { + header = (struct bus_header*)((uint8_t*) k + d->vec.offset); + header_size = d->vec.size; } + footer = (uint8_t*) k + d->vec.offset; + footer_size = d->vec.size; + n_bytes += d->vec.size; + last_was_memfd = false; break; case KDBUS_ITEM_PAYLOAD_MEMFD: - if (!h) + if (!header) /* memfd cannot be first part */ return -EBADMSG; n_bytes += d->memfd.size; + last_was_memfd = true; break; case KDBUS_ITEM_FDS: { @@ -458,23 +477,29 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { } } - if (!h) + if (last_was_memfd) /* memfd cannot be last part */ return -EBADMSG; - r = bus_header_message_size(h, &total); - if (r < 0) - return r; + if (!header) + return -EBADMSG; - if (n_bytes != total) + if (header_size < sizeof(struct bus_header)) return -EBADMSG; /* on kdbus we only speak native endian gvariant, never dbus1 * marshalling or reverse endian */ - if (h->version != 2 || - h->endian != BUS_NATIVE_ENDIAN) + if (header->version != 2 || + header->endian != BUS_NATIVE_ENDIAN) return -EPROTOTYPE; - r = bus_message_from_header(bus, h, sizeof(struct bus_header), fds, n_fds, NULL, seclabel, 0, &m); + r = bus_message_from_header( + bus, + header, header_size, + footer, footer_size, + n_bytes, + fds, n_fds, + NULL, + seclabel, 0, &m); if (r < 0) return r; @@ -513,11 +538,11 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { if (idx >= begin_body) { if (!part->is_zero) - part->data = (uint8_t *)bus->kdbus_buffer + d->vec.offset; + part->data = (uint8_t* )k + d->vec.offset; part->size = d->vec.size; } else { if (!part->is_zero) - part->data = (uint8_t *)bus->kdbus_buffer + d->vec.offset + (begin_body - idx); + part->data = (uint8_t*) k + d->vec.offset + (begin_body - idx); part->size = d->vec.size - (begin_body - idx); } @@ -554,10 +579,11 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { case KDBUS_ITEM_PIDS: /* The PID/TID might be missing, when the data - * is faked by some data bus proxy and it - * lacks that information about the real - * client since SO_PEERCRED is used for - * that. */ + * is faked by a bus proxy and it lacks that + * information about the real client (since + * SO_PEERCRED is used for that). Also kernel + * namespacing might make some of this data + * unavailable when untranslatable. */ if (d->pids.pid > 0) { m->creds.pid = (pid_t) d->pids.pid; @@ -573,7 +599,8 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { case KDBUS_ITEM_CREDS: - /* EUID/SUID/FSUID/EGID/SGID/FSGID might be missing too (see above). */ + /* EUID/SUID/FSUID/EGID/SGID/FSGID might be + * missing too (see above). */ if ((uid_t) d->creds.uid != UID_INVALID) { m->creds.uid = (uid_t) d->creds.uid; @@ -618,13 +645,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { break; case KDBUS_ITEM_TIMESTAMP: - - if (bus->attach_flags & KDBUS_ATTACH_TIMESTAMP) { - m->realtime = d->timestamp.realtime_ns / NSEC_PER_USEC; - m->monotonic = d->timestamp.monotonic_ns / NSEC_PER_USEC; - m->seqnum = d->timestamp.seqnum; - } - + message_set_timestamp(bus, m, &d->timestamp); break; case KDBUS_ITEM_PID_COMM: @@ -657,7 +678,6 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { goto fail; m->creds.cgroup_root = bus->cgroup_root; - break; case KDBUS_ITEM_AUDIT: @@ -673,8 +693,13 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { break; case KDBUS_ITEM_CAPS: - m->creds.capability = (uint8_t *) d->caps.caps; - m->creds.capability_size = d->size - offsetof(struct kdbus_item, caps.caps); + if (d->caps.last_cap != cap_last_cap() || + d->size - offsetof(struct kdbus_item, caps.caps) < DIV_ROUND_UP(d->caps.last_cap, 32U) * 4 * 4) { + r = -EBADMSG; + goto fail; + } + + m->creds.capability = d->caps.caps; m->creds.mask |= (SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS) & bus->creds_mask; break; @@ -744,7 +769,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { /* If we requested the list of well-known names to be appended * and the sender had none no item for it will be - * attached. However, this does *not* mean that we the kernel + * attached. However, this does *not* mean that the kernel * didn't want to provide this information to us. Hence, let's * explicitly mark this information as available if it was * requested. */ @@ -755,13 +780,13 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { goto fail; /* Refuse messages if kdbus and dbus1 cookie doesn't match up */ - if ((uint64_t) m->header->serial != k->cookie) { + if ((uint64_t) m->header->dbus2.cookie != k->cookie) { r = -EBADMSG; goto fail; } /* Refuse messages where the reply flag doesn't match up */ - if (!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) != !!(k->flags & KDBUS_MSG_FLAGS_EXPECT_REPLY)) { + if (!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) != !!(k->flags & KDBUS_MSG_EXPECT_REPLY)) { r = -EBADMSG; goto fail; } @@ -773,7 +798,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { } /* Refuse messages where the autostart flag doesn't match up */ - if (!(m->header->flags & BUS_MESSAGE_NO_AUTO_START) != !(k->flags & KDBUS_MSG_FLAGS_NO_AUTO_START)) { + if (!(m->header->flags & BUS_MESSAGE_NO_AUTO_START) != !(k->flags & KDBUS_MSG_NO_AUTO_START)) { r = -EBADMSG; goto fail; } @@ -815,7 +840,9 @@ fail: } int bus_kernel_take_fd(sd_bus *b) { + struct kdbus_bloom_parameter *bloom = NULL; struct kdbus_cmd_hello *hello; + struct kdbus_item_list *items; struct kdbus_item *item; _cleanup_free_ char *g = NULL; const char *name; @@ -928,23 +955,40 @@ int bus_kernel_take_fd(sd_bus *b) { b->kdbus_buffer = mmap(NULL, KDBUS_POOL_SIZE, PROT_READ, MAP_SHARED, b->input_fd, 0); if (b->kdbus_buffer == MAP_FAILED) { b->kdbus_buffer = NULL; - return -errno; + r = -errno; + goto fail; } } /* The higher 32bit of the bus_flags fields are considered * 'incompatible flags'. Refuse them all for now. */ - if (hello->bus_flags > 0xFFFFFFFFULL) - return -ENOTSUP; + if (hello->bus_flags > 0xFFFFFFFFULL) { + r = -ENOTSUP; + goto fail; + } - if (!bloom_validate_parameters((size_t) hello->bloom.size, (unsigned) hello->bloom.n_hash)) - return -ENOTSUP; + /* extract bloom parameters from items */ + items = (void*)((uint8_t*)b->kdbus_buffer + hello->offset); + KDBUS_ITEM_FOREACH(item, items, items) { + switch (item->type) { + case KDBUS_ITEM_BLOOM_PARAMETER: + bloom = &item->bloom_parameter; + break; + } + } - b->bloom_size = (size_t) hello->bloom.size; - b->bloom_n_hash = (unsigned) hello->bloom.n_hash; + if (!bloom || !bloom_validate_parameters((size_t) bloom->size, (unsigned) bloom->n_hash)) { + r = -ENOTSUP; + goto fail; + } + + b->bloom_size = (size_t) bloom->size; + b->bloom_n_hash = (unsigned) bloom->n_hash; - if (asprintf(&b->unique_name, ":1.%llu", (unsigned long long) hello->id) < 0) - return -ENOMEM; + if (asprintf(&b->unique_name, ":1.%llu", (unsigned long long) hello->id) < 0) { + r = -ENOMEM; + goto fail; + } b->unique_id = hello->id; @@ -957,7 +1001,13 @@ int bus_kernel_take_fd(sd_bus *b) { /* the kernel told us the UUID of the underlying bus */ memcpy(b->server_id.bytes, hello->id128, sizeof(b->server_id.bytes)); + /* free returned items */ + (void) bus_kernel_cmd_free(b, hello->offset); return bus_start_running(b); + +fail: + (void) bus_kernel_cmd_free(b, hello->offset); + return r; } int bus_kernel_connect(sd_bus *b) { @@ -980,7 +1030,7 @@ int bus_kernel_connect(sd_bus *b) { int bus_kernel_cmd_free(sd_bus *bus, uint64_t offset) { struct kdbus_cmd_free cmd = { - .flags = 0, + .size = sizeof(cmd), .offset = offset, }; int r; @@ -1012,6 +1062,7 @@ static void close_kdbus_msg(sd_bus *bus, struct kdbus_msg *k) { } int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call) { + struct kdbus_cmd_send cmd = { }; int r; assert(bus); @@ -1027,15 +1078,20 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call if (r < 0) return r; + cmd.size = sizeof(cmd); + cmd.msg_address = (uintptr_t)m->kdbus; + /* If this is a synchronous method call, then let's tell the * kernel, so that it can pass CPU time/scheduling to the * destination for the time, if it wants to. If we * synchronously wait for the result anyway, we won't need CPU * anyway. */ - if (hint_sync_call) - m->kdbus->flags |= KDBUS_MSG_FLAGS_EXPECT_REPLY|KDBUS_MSG_FLAGS_SYNC_REPLY; + if (hint_sync_call) { + m->kdbus->flags |= KDBUS_MSG_EXPECT_REPLY; + cmd.flags |= KDBUS_SEND_SYNC_REPLY; + } - r = ioctl(bus->output_fd, KDBUS_CMD_MSG_SEND, m->kdbus); + r = ioctl(bus->output_fd, KDBUS_CMD_SEND, &cmd); if (r < 0) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *reply; @@ -1085,7 +1141,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call } else if (hint_sync_call) { struct kdbus_msg *k; - k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + m->kdbus->offset_reply); + k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + cmd.reply.offset); assert(k); if (k->payload_type == KDBUS_PAYLOAD_DBUS) { @@ -1096,7 +1152,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call /* Anybody can send us invalid messages, let's just drop them. */ if (r == -EBADMSG || r == -EPROTOTYPE) - log_debug_errno(r, "Ignoring invalid message: %m"); + log_debug_errno(r, "Ignoring invalid synchronous reply: %m"); else return r; } @@ -1109,7 +1165,13 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call return 1; } -static int push_name_owner_changed(sd_bus *bus, const char *name, const char *old_owner, const char *new_owner) { +static int push_name_owner_changed( + sd_bus *bus, + const char *name, + const char *old_owner, + const char *new_owner, + const struct kdbus_timestamp *ts) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; @@ -1129,6 +1191,7 @@ static int push_name_owner_changed(sd_bus *bus, const char *name, const char *ol return r; bus_message_set_sender_driver(bus, m); + message_set_timestamp(bus, m, ts); r = bus_seal_synthetic_message(bus, m); if (r < 0) @@ -1140,7 +1203,12 @@ static int push_name_owner_changed(sd_bus *bus, const char *name, const char *ol return 1; } -static int translate_name_change(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item *d) { +static int translate_name_change( + sd_bus *bus, + const struct kdbus_msg *k, + const struct kdbus_item *d, + const struct kdbus_timestamp *ts) { + char new_owner[UNIQUE_NAME_MAX], old_owner[UNIQUE_NAME_MAX]; assert(bus); @@ -1161,10 +1229,15 @@ static int translate_name_change(sd_bus *bus, struct kdbus_msg *k, struct kdbus_ } else sprintf(new_owner, ":1.%llu", (unsigned long long) d->name_change.new_id.id); - return push_name_owner_changed(bus, d->name_change.name, old_owner, new_owner); + return push_name_owner_changed(bus, d->name_change.name, old_owner, new_owner, ts); } -static int translate_id_change(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item *d) { +static int translate_id_change( + sd_bus *bus, + const struct kdbus_msg *k, + const struct kdbus_item *d, + const struct kdbus_timestamp *ts) { + char owner[UNIQUE_NAME_MAX]; assert(bus); @@ -1176,10 +1249,16 @@ static int translate_id_change(sd_bus *bus, struct kdbus_msg *k, struct kdbus_it return push_name_owner_changed( bus, owner, d->type == KDBUS_ITEM_ID_ADD ? NULL : owner, - d->type == KDBUS_ITEM_ID_ADD ? owner : NULL); + d->type == KDBUS_ITEM_ID_ADD ? owner : NULL, + ts); } -static int translate_reply(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item *d) { +static int translate_reply( + sd_bus *bus, + const struct kdbus_msg *k, + const struct kdbus_item *d, + const struct kdbus_timestamp *ts) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; @@ -1197,7 +1276,7 @@ static int translate_reply(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item * if (r < 0) return r; - bus_message_set_sender_driver(bus, m); + message_set_timestamp(bus, m, ts); r = bus_seal_synthetic_message(bus, m); if (r < 0) @@ -1210,9 +1289,7 @@ static int translate_reply(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item * } static int bus_kernel_translate_message(sd_bus *bus, struct kdbus_msg *k) { - struct kdbus_item *d, *found = NULL; - - static int (* const translate[])(sd_bus *bus, struct kdbus_msg *k, struct kdbus_item *d) = { + static int (* const translate[])(sd_bus *bus, const struct kdbus_msg *k, const struct kdbus_item *d, const struct kdbus_timestamp *ts) = { [KDBUS_ITEM_NAME_ADD - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change, [KDBUS_ITEM_NAME_REMOVE - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change, [KDBUS_ITEM_NAME_CHANGE - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change, @@ -1224,11 +1301,17 @@ static int bus_kernel_translate_message(sd_bus *bus, struct kdbus_msg *k) { [KDBUS_ITEM_REPLY_DEAD - _KDBUS_ITEM_KERNEL_BASE] = translate_reply, }; + struct kdbus_item *d, *found = NULL; + struct kdbus_timestamp *ts = NULL; + assert(bus); assert(k); assert(k->payload_type == KDBUS_PAYLOAD_KERNEL); KDBUS_ITEM_FOREACH(d, k, items) { + if (d->type == KDBUS_ITEM_TIMESTAMP) + ts = &d->timestamp; + if (d->type >= _KDBUS_ITEM_KERNEL_BASE && d->type < _KDBUS_ITEM_KERNEL_BASE + ELEMENTSOF(translate)) { if (found) return -EBADMSG; @@ -1242,11 +1325,11 @@ static int bus_kernel_translate_message(sd_bus *bus, struct kdbus_msg *k) { return 0; } - return translate[found->type - _KDBUS_ITEM_KERNEL_BASE](bus, k, found); + return translate[found->type - _KDBUS_ITEM_KERNEL_BASE](bus, k, found, ts); } int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority) { - struct kdbus_cmd_recv recv = {}; + struct kdbus_cmd_recv recv = { .size = sizeof(recv) }; struct kdbus_msg *k; int r; @@ -1261,7 +1344,7 @@ int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority) { recv.priority = priority; } - r = ioctl(bus->input_fd, KDBUS_CMD_MSG_RECV, &recv); + r = ioctl(bus->input_fd, KDBUS_CMD_RECV, &recv); if (r < 0) { if (errno == EAGAIN) return 0; @@ -1274,7 +1357,7 @@ int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority) { return -errno; } - k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + recv.offset); + k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + recv.msg.offset); if (k->payload_type == KDBUS_PAYLOAD_DBUS) { r = bus_kernel_make_message(bus, k); @@ -1456,7 +1539,7 @@ uint64_t attach_flags_to_kdbus(uint64_t mask) { } int bus_kernel_create_bus(const char *name, bool world, char **s) { - struct kdbus_cmd_make *make; + struct kdbus_cmd *make; struct kdbus_item *n; size_t l; int fd; @@ -1469,13 +1552,14 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) { return -errno; l = strlen(name); - make = alloca0_align(offsetof(struct kdbus_cmd_make, items) + + make = alloca0_align(offsetof(struct kdbus_cmd, items) + ALIGN8(offsetof(struct kdbus_item, bloom_parameter) + sizeof(struct kdbus_bloom_parameter)) + ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)) + + ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)) + ALIGN8(offsetof(struct kdbus_item, str) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1), 8); - make->size = offsetof(struct kdbus_cmd_make, items); + make->size = offsetof(struct kdbus_cmd, items); /* Set the bloom parameters */ n = make->items; @@ -1498,6 +1582,13 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) { n->data64[0] = _KDBUS_ATTACH_ANY; make->size += ALIGN8(n->size); + /* Provide all metadata via bus-owner queries */ + n = KDBUS_ITEM_NEXT(n); + n->type = KDBUS_ITEM_ATTACH_FLAGS_SEND; + n->size = offsetof(struct kdbus_item, data64) + sizeof(uint64_t); + n->data64[0] = _KDBUS_ATTACH_ANY; + make->size += ALIGN8(n->size); + /* Set the a good name */ n = KDBUS_ITEM_NEXT(n); sprintf(n->str, UID_FMT "-%s", getuid(), name); @@ -1527,69 +1618,6 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) { return fd; } -static int bus_kernel_translate_access(BusPolicyAccess access) { - assert(access >= 0); - assert(access < _BUS_POLICY_ACCESS_MAX); - - switch (access) { - - case BUS_POLICY_ACCESS_SEE: - return KDBUS_POLICY_SEE; - - case BUS_POLICY_ACCESS_TALK: - return KDBUS_POLICY_TALK; - - case BUS_POLICY_ACCESS_OWN: - return KDBUS_POLICY_OWN; - - default: - assert_not_reached("Unknown policy access"); - } -} - -static int bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbus_item *item) { - int r; - - assert(policy); - assert(item); - - switch (policy->type) { - - case BUSNAME_POLICY_TYPE_USER: { - const char *user = policy->name; - uid_t uid; - - r = get_user_creds(&user, &uid, NULL, NULL, NULL); - if (r < 0) - return r; - - item->policy_access.type = KDBUS_POLICY_ACCESS_USER; - item->policy_access.id = uid; - break; - } - - case BUSNAME_POLICY_TYPE_GROUP: { - const char *group = policy->name; - gid_t gid; - - r = get_group_creds(&group, &gid); - if (r < 0) - return r; - - item->policy_access.type = KDBUS_POLICY_ACCESS_GROUP; - item->policy_access.id = gid; - break; - } - - default: - assert_not_reached("Unknown policy type"); - } - - item->policy_access.access = bus_kernel_translate_access(policy->access); - - return 0; -} - int bus_kernel_open_bus_fd(const char *bus, char **path) { char *p; int fd; @@ -1624,7 +1652,7 @@ int bus_kernel_open_bus_fd(const char *bus, char **path) { int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **ep_path) { _cleanup_free_ char *path = NULL; - struct kdbus_cmd_make *make; + struct kdbus_cmd *make; struct kdbus_item *n; const char *name; int fd; @@ -1633,10 +1661,10 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char * if (fd < 0) return fd; - make = alloca0_align(ALIGN8(offsetof(struct kdbus_cmd_make, items)) + + make = alloca0_align(ALIGN8(offsetof(struct kdbus_cmd, items)) + ALIGN8(offsetof(struct kdbus_item, str) + DECIMAL_STR_MAX(uid_t) + 1 + strlen(ep_name) + 1), 8); - make->size = ALIGN8(offsetof(struct kdbus_cmd_make, items)); + make->size = ALIGN8(offsetof(struct kdbus_cmd, items)); make->flags = KDBUS_MAKE_ACCESS_WORLD; n = make->items; @@ -1666,131 +1694,13 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char * return fd; } -int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep) { - - struct kdbus_cmd_update *update; - struct kdbus_item *n; - BusEndpointPolicy *po; - Iterator i; - size_t size; - int r; - - size = ALIGN8(offsetof(struct kdbus_cmd_update, items)); - - HASHMAP_FOREACH(po, ep->policy_hash, i) { - size += ALIGN8(offsetof(struct kdbus_item, str) + strlen(po->name) + 1); - size += ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access)); - } - - update = alloca0_align(size, 8); - update->size = size; - - n = update->items; - - HASHMAP_FOREACH(po, ep->policy_hash, i) { - n->type = KDBUS_ITEM_NAME; - n->size = offsetof(struct kdbus_item, str) + strlen(po->name) + 1; - strcpy(n->str, po->name); - n = KDBUS_ITEM_NEXT(n); - - n->type = KDBUS_ITEM_POLICY_ACCESS; - n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); - - n->policy_access.type = KDBUS_POLICY_ACCESS_USER; - n->policy_access.access = bus_kernel_translate_access(po->access); - n->policy_access.id = uid; - - n = KDBUS_ITEM_NEXT(n); - } - - r = ioctl(fd, KDBUS_CMD_ENDPOINT_UPDATE, update); - if (r < 0) - return -errno; - - return 0; -} - -int bus_kernel_make_starter( - int fd, - const char *name, - bool activating, - bool accept_fd, - BusNamePolicy *policy, - BusPolicyAccess world_policy) { - - struct kdbus_cmd_hello *hello; - struct kdbus_item *n; - size_t policy_cnt = 0; - BusNamePolicy *po; - size_t size; - int r; - - assert(fd >= 0); - assert(name); - - LIST_FOREACH(policy, po, policy) - policy_cnt++; - - if (world_policy >= 0) - policy_cnt++; - - size = offsetof(struct kdbus_cmd_hello, items) + - ALIGN8(offsetof(struct kdbus_item, str) + strlen(name) + 1) + - policy_cnt * ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access)); - - hello = alloca0_align(size, 8); - - n = hello->items; - strcpy(n->str, name); - n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1; - n->type = KDBUS_ITEM_NAME; - n = KDBUS_ITEM_NEXT(n); - - LIST_FOREACH(policy, po, policy) { - n->type = KDBUS_ITEM_POLICY_ACCESS; - n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); - - r = bus_kernel_translate_policy(po, n); - if (r < 0) - return r; - - n = KDBUS_ITEM_NEXT(n); - } - - if (world_policy >= 0) { - n->type = KDBUS_ITEM_POLICY_ACCESS; - n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access); - n->policy_access.type = KDBUS_POLICY_ACCESS_WORLD; - n->policy_access.access = bus_kernel_translate_access(world_policy); - } - - hello->size = size; - hello->flags = - (activating ? KDBUS_HELLO_ACTIVATOR : KDBUS_HELLO_POLICY_HOLDER) | - (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0); - hello->pool_size = KDBUS_POOL_SIZE; - hello->attach_flags_send = _KDBUS_ATTACH_ANY; - hello->attach_flags_recv = _KDBUS_ATTACH_ANY; - - if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) - return -errno; - - /* The higher 32bit of the bus_flags fields are considered - * 'incompatible flags'. Refuse them all for now. */ - if (hello->bus_flags > 0xFFFFFFFFULL) - return -ENOTSUP; - - if (!bloom_validate_parameters((size_t) hello->bloom.size, (unsigned) hello->bloom.n_hash)) - return -ENOTSUP; - - return fd; -} - int bus_kernel_try_close(sd_bus *bus) { + struct kdbus_cmd byebye = { .size = sizeof(byebye) }; + assert(bus); assert(bus->is_kernel); - if (ioctl(bus->input_fd, KDBUS_CMD_BYEBYE) < 0) + if (ioctl(bus->input_fd, KDBUS_CMD_BYEBYE, &byebye) < 0) return -errno; return 0; @@ -1798,25 +1708,26 @@ int bus_kernel_try_close(sd_bus *bus) { int bus_kernel_drop_one(int fd) { struct kdbus_cmd_recv recv = { - .flags = KDBUS_RECV_DROP + .size = sizeof(recv), + .flags = KDBUS_RECV_DROP, }; assert(fd >= 0); - if (ioctl(fd, KDBUS_CMD_MSG_RECV, &recv) < 0) + if (ioctl(fd, KDBUS_CMD_RECV, &recv) < 0) return -errno; return 0; } int bus_kernel_realize_attach_flags(sd_bus *bus) { - struct kdbus_cmd_update *update; + struct kdbus_cmd *update; struct kdbus_item *n; assert(bus); assert(bus->is_kernel); - update = alloca0_align(offsetof(struct kdbus_cmd_update, items) + + update = alloca0_align(offsetof(struct kdbus_cmd, items) + ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)), 8); @@ -1826,10 +1737,10 @@ int bus_kernel_realize_attach_flags(sd_bus *bus) { n->data64[0] = bus->attach_flags; update->size = - offsetof(struct kdbus_cmd_update, items) + + offsetof(struct kdbus_cmd, items) + ALIGN8(n->size); - if (ioctl(bus->input_fd, KDBUS_CMD_CONN_UPDATE, update) < 0) + if (ioctl(bus->input_fd, KDBUS_CMD_UPDATE, update) < 0) return -errno; return 0; @@ -1843,30 +1754,21 @@ int bus_kernel_fix_attach_mask(void) { /* By default we don't want any kdbus metadata fields to be * suppressed, hence we reset the kernel mask for it to - * (uint64_t) -1. This is overridable via a kernel command - * line option, however. */ + * (uint64_t) -1. If the module argument was overwritten by + * the kernel cmdline, we leave it as is. */ - r = get_proc_cmdline_key("systemd.kdbus_attach_flags_mask=", &mask); + r = get_proc_cmdline_key("kdbus.attach_flags_mask=", &mask); if (r < 0) return log_warning_errno(r, "Failed to read kernel command line: %m"); - if (mask) { - const char *p = mask; - - if (startswith(p, "0x")) - p += 2; - - if (sscanf(p, "%" PRIx64, &m) != 1) - log_warning("Couldn't parse systemd.kdbus_attach_flags_mask= kernel command line parameter."); + if (r == 0) { + sprintf(buf, "0x%" PRIx64 "\n", m); + r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf); + if (r < 0) + return log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to write kdbus attach mask: %m"); } - sprintf(buf, "0x%" PRIx64 "\n", m); - r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf); - if (r < 0) - return log_full_errno( - IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, - "Failed to write kdbus attach mask: %m"); - return 0; } diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h index 2152f62d1..b9f31ba79 100644 --- a/src/libsystemd/sd-bus/bus-kernel.h +++ b/src/libsystemd/sd-bus/bus-kernel.h @@ -23,8 +23,6 @@ #include -#include "busname.h" -#include "bus-endpoint.h" #include "sd-bus.h" #define KDBUS_ITEM_NEXT(item) \ @@ -35,6 +33,11 @@ ((uint8_t *)(part) < (uint8_t *)(head) + (head)->size) && \ ((uint8_t *) part >= (uint8_t *) head); \ part = KDBUS_ITEM_NEXT(part)) +#define KDBUS_FOREACH(iter, first, _size) \ + for (iter = (first); \ + ((uint8_t *)(iter) < (uint8_t *)(first) + (_size)) && \ + ((uint8_t *)(iter) >= (uint8_t *)(first)); \ + iter = (void*)(((uint8_t *)iter) + ALIGN8((iter)->size))) #define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) #define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) @@ -67,13 +70,10 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority); int bus_kernel_open_bus_fd(const char *bus, char **path); -int bus_kernel_make_starter(int fd, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy, BusPolicyAccess world_policy); int bus_kernel_create_bus(const char *name, bool world, char **s); int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path); -int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep); - int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated); void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated); diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c index 3a31aa0eb..162f0ab60 100644 --- a/src/libsystemd/sd-bus/bus-match.c +++ b/src/libsystemd/sd-bus/bus-match.c @@ -234,7 +234,7 @@ static bool value_node_same( /* Tests parameters against this value node, not doing prefix * magic and stuff, i.e. this one actually compares the match - * itself.*/ + * itself. */ assert(node); assert(node->type == BUS_MATCH_VALUE); diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 06d8d770f..295930303 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -65,9 +65,11 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) { /* If we can reuse the memfd, try that. For that it * can't be sealed yet. */ - if (!part->sealed) + if (!part->sealed) { + assert(part->memfd_offset == 0); + assert(part->data == part->mmap_begin); bus_kernel_push_memfd(m->bus, part->memfd, part->data, part->mapped, part->allocated); - else { + } else { if (part->mapped > 0) assert_se(munmap(part->mmap_begin, part->mapped) == 0); @@ -127,13 +129,8 @@ static void message_free(sd_bus_message *m) { message_reset_parts(m); - if (m->release_kdbus) { - struct kdbus_cmd_free cmd_free; - - cmd_free.flags = 0; - cmd_free.offset = (uint8_t *)m->kdbus - (uint8_t *)m->bus->kdbus_buffer; - (void) ioctl(m->bus->input_fd, KDBUS_CMD_FREE, &cmd_free); - } + if (m->release_kdbus) + bus_kernel_cmd_free(m->bus, (uint8_t *) m->kdbus - (uint8_t *) m->bus->kdbus_buffer); if (m->free_kdbus) free(m->kdbus); @@ -172,16 +169,17 @@ static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b if (m->poisoned) return NULL; - old_size = sizeof(struct bus_header) + m->header->fields_size; + old_size = sizeof(struct bus_header) + m->fields_size; start = ALIGN_TO(old_size, align); new_size = start + sz; + if (new_size < start || + new_size > (size_t) ((uint32_t) -1)) + goto poison; + if (old_size == new_size) return (uint8_t*) m->header + old_size; - if (new_size > (size_t) ((uint32_t) -1)) - goto poison; - if (m->free_header) { np = realloc(m->header, ALIGN8(new_size)); if (!np) @@ -204,7 +202,7 @@ static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b op = m->header; m->header = np; - m->header->fields_size = new_size - sizeof(struct bus_header); + m->fields_size = new_size - sizeof(struct bus_header); /* Adjust quick access pointers */ m->path = adjust_pointer(m->path, op, old_size, m->header); @@ -232,7 +230,7 @@ poison: static int message_append_field_string( sd_bus_message *m, - uint8_t h, + uint64_t h, char type, const char *s, const char **ret) { @@ -242,6 +240,10 @@ static int message_append_field_string( assert(m); + /* dbus1 only allows 8bit header field ids */ + if (h > 0xFF) + return -EINVAL; + /* dbus1 doesn't allow strings over 32bit, let's enforce this * globally, to not risk convertability */ l = strlen(s); @@ -252,13 +254,12 @@ static int message_append_field_string( if (BUS_MESSAGE_IS_GVARIANT(m)) { - /* (field id byte + 7x padding, ((string + NUL) + NUL + signature string 's') */ - p = message_extend_fields(m, 8, 1 + 7 + l + 1 + 1 + 1, true); + /* (field id 64bit, ((string + NUL) + NUL + signature string 's') */ + p = message_extend_fields(m, 8, 8 + l + 1 + 1 + 1, true); if (!p) return -ENOMEM; - p[0] = h; - memzero(p+1, 7); + *((uint64_t*) p) = h; memcpy(p+8, s, l); p[8+l] = 0; p[8+l+1] = 0; @@ -273,7 +274,7 @@ static int message_append_field_string( if (!p) return -ENOMEM; - p[0] = h; + p[0] = (uint8_t) h; p[1] = 1; p[2] = type; p[3] = 0; @@ -290,7 +291,7 @@ static int message_append_field_string( static int message_append_field_signature( sd_bus_message *m, - uint8_t h, + uint64_t h, const char *s, const char **ret) { @@ -299,7 +300,11 @@ static int message_append_field_signature( assert(m); - /* dbus1 doesn't allow signatures over 32bit, let's enforce + /* dbus1 only allows 8bit header field ids */ + if (h > 0xFF) + return -EINVAL; + + /* dbus1 doesn't allow signatures over 8bit, let's enforce * this globally, to not risk convertability */ l = strlen(s); if (l > 255) @@ -316,7 +321,7 @@ static int message_append_field_signature( if (!p) return -ENOMEM; - p[0] = h; + p[0] = (uint8_t) h; p[1] = 1; p[2] = SD_BUS_TYPE_SIGNATURE; p[3] = 0; @@ -330,20 +335,23 @@ static int message_append_field_signature( return 0; } -static int message_append_field_uint32(sd_bus_message *m, uint8_t h, uint32_t x) { +static int message_append_field_uint32(sd_bus_message *m, uint64_t h, uint32_t x) { uint8_t *p; assert(m); + /* dbus1 only allows 8bit header field ids */ + if (h > 0xFF) + return -EINVAL; + if (BUS_MESSAGE_IS_GVARIANT(m)) { - /* (field id byte + 7x padding + ((value + NUL + signature string 'u') */ + /* (field id 64bit + ((value + NUL + signature string 'u') */ - p = message_extend_fields(m, 8, 1 + 7 + 4 + 1 + 1, true); + p = message_extend_fields(m, 8, 8 + 4 + 1 + 1, true); if (!p) return -ENOMEM; - p[0] = h; - memzero(p+1, 7); + *((uint64_t*) p) = h; *((uint32_t*) (p + 8)) = x; p[12] = 0; p[13] = 'u'; @@ -353,9 +361,9 @@ static int message_append_field_uint32(sd_bus_message *m, uint8_t h, uint32_t x) if (!p) return -ENOMEM; - p[0] = h; + p[0] = (uint8_t) h; p[1] = 1; - p[2] = SD_BUS_TYPE_UINT32; + p[2] = 'u'; p[3] = 0; ((uint32_t*) p)[1] = x; @@ -364,10 +372,68 @@ static int message_append_field_uint32(sd_bus_message *m, uint8_t h, uint32_t x) return 0; } +static int message_append_field_uint64(sd_bus_message *m, uint64_t h, uint64_t x) { + uint8_t *p; + + assert(m); + + /* dbus1 only allows 8bit header field ids */ + if (h > 0xFF) + return -EINVAL; + + if (BUS_MESSAGE_IS_GVARIANT(m)) { + /* (field id 64bit + ((value + NUL + signature string 't') */ + + p = message_extend_fields(m, 8, 8 + 8 + 1 + 1, true); + if (!p) + return -ENOMEM; + + *((uint64_t*) p) = h; + *((uint64_t*) (p + 8)) = x; + p[16] = 0; + p[17] = 't'; + } else { + /* (field id byte + (signature length + signature 't' + NUL) + 4 byte padding + value) */ + p = message_extend_fields(m, 8, 4 + 4 + 8, false); + if (!p) + return -ENOMEM; + + p[0] = (uint8_t) h; + p[1] = 1; + p[2] = 't'; + p[3] = 0; + p[4] = 0; + p[5] = 0; + p[6] = 0; + p[7] = 0; + + ((uint64_t*) p)[1] = x; + } + + return 0; +} + +static int message_append_reply_cookie(sd_bus_message *m, uint64_t cookie) { + assert(m); + + if (BUS_MESSAGE_IS_GVARIANT(m)) + return message_append_field_uint64(m, BUS_MESSAGE_HEADER_REPLY_SERIAL, cookie); + else { + /* 64bit cookies are not supported on dbus1 */ + if (cookie > 0xffffffffUL) + return -ENOTSUP; + + return message_append_field_uint32(m, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) cookie); + } +} + int bus_message_from_header( sd_bus *bus, - void *buffer, - size_t length, + void *header, + size_t header_accessible, + void *footer, + size_t footer_accessible, + size_t message_size, int *fds, unsigned n_fds, const struct ucred *ucred, @@ -380,19 +446,22 @@ int bus_message_from_header( size_t a, label_sz; assert(bus); - assert(buffer || length <= 0); + assert(header || header_accessible <= 0); + assert(footer || footer_accessible <= 0); assert(fds || n_fds <= 0); assert(ret); - if (length < sizeof(struct bus_header)) + if (header_accessible < sizeof(struct bus_header)) return -EBADMSG; - h = buffer; - if (h->version != 1 && - h->version != 2) + if (header_accessible > message_size) + return -EBADMSG; + if (footer_accessible > message_size) return -EBADMSG; - if (h->serial == 0) + h = header; + if (h->version != 1 && + h->version != 2) return -EBADMSG; if (h->type == _SD_BUS_MESSAGE_TYPE_INVALID) @@ -402,6 +471,8 @@ int bus_message_from_header( h->endian != BUS_BIG_ENDIAN) return -EBADMSG; + /* Note that we are happy with unknown flags in the flags header! */ + a = ALIGN(sizeof(sd_bus_message)) + ALIGN(extra); if (label) { @@ -415,25 +486,66 @@ int bus_message_from_header( m->n_ref = 1; m->sealed = true; - m->header = h; + m->header = header; + m->header_accessible = header_accessible; + m->footer = footer; + m->footer_accessible = footer_accessible; + + if (BUS_MESSAGE_IS_GVARIANT(m)) { + size_t ws; + + if (h->dbus2.cookie == 0) + return -EBADMSG; + + /* dbus2 derives the sizes from the message size and + the offset table at the end, since it is formatted as + gvariant "yyyyuta{tv}v". Since the message itself is a + structure with precisely to variable sized entries, + there's only one offset in the table, which marks the + end of the fields array. */ + + ws = bus_gvariant_determine_word_size(message_size, 0); + if (footer_accessible < ws) + return -EBADMSG; + + m->fields_size = bus_gvariant_read_word_le((uint8_t*) footer + footer_accessible - ws, ws); + if (ALIGN8(m->fields_size) > message_size - ws) + return -EBADMSG; + if (m->fields_size < sizeof(struct bus_header)) + return -EBADMSG; + + m->fields_size -= sizeof(struct bus_header); + m->body_size = message_size - (sizeof(struct bus_header) + ALIGN8(m->fields_size)); + } else { + if (h->dbus1.serial == 0) + return -EBADMSG; + + /* dbus1 has the sizes in the header */ + m->fields_size = BUS_MESSAGE_BSWAP32(m, h->dbus1.fields_size); + m->body_size = BUS_MESSAGE_BSWAP32(m, h->dbus1.body_size); + + if (sizeof(struct bus_header) + ALIGN8(m->fields_size) + m->body_size != message_size) + return -EBADMSG; + } + m->fds = fds; m->n_fds = n_fds; if (ucred) { m->creds.pid = ucred->pid; - m->creds.uid = ucred->uid; - m->creds.gid = ucred->gid; + m->creds.euid = ucred->uid; + m->creds.egid = ucred->gid; /* Due to namespace translations some data might be * missing from this ucred record. */ if (m->creds.pid > 0) m->creds.mask |= SD_BUS_CREDS_PID; - if (m->creds.uid != UID_INVALID) - m->creds.mask |= SD_BUS_CREDS_UID; + if (m->creds.euid != UID_INVALID) + m->creds.mask |= SD_BUS_CREDS_EUID; - if (m->creds.gid != GID_INVALID) - m->creds.mask |= SD_BUS_CREDS_GID; + if (m->creds.egid != GID_INVALID) + m->creds.mask |= SD_BUS_CREDS_EGID; } if (label) { @@ -463,19 +575,21 @@ int bus_message_from_malloc( size_t sz; int r; - r = bus_message_from_header(bus, buffer, length, fds, n_fds, ucred, label, 0, &m); + r = bus_message_from_header( + bus, + buffer, length, /* in this case the initial bytes and the final bytes are the same */ + buffer, length, + length, + fds, n_fds, + ucred, label, + 0, &m); if (r < 0) return r; - if (length != BUS_MESSAGE_SIZE(m)) { - r = -EBADMSG; - goto fail; - } - - sz = length - sizeof(struct bus_header) - ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)); + sz = length - sizeof(struct bus_header) - ALIGN8(m->fields_size); if (sz > 0) { m->n_body_parts = 1; - m->body.data = (uint8_t*) buffer + sizeof(struct bus_header) + ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)); + m->body.data = (uint8_t*) buffer + sizeof(struct bus_header) + ALIGN8(m->fields_size); m->body.size = sz; m->body.sealed = true; m->body.memfd = -1; @@ -634,8 +748,10 @@ static int message_new_reply( t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; t->reply_cookie = BUS_MESSAGE_COOKIE(call); + if (t->reply_cookie == 0) + return -ENOTSUP; - r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); + r = message_append_reply_cookie(t, t->reply_cookie); if (r < 0) goto fail; @@ -745,12 +861,30 @@ _public_ int sd_bus_message_new_method_errnof( va_list ap; va_start(ap, format); - bus_error_set_errnofv(&berror, error, format, ap); + sd_bus_error_set_errnofv(&berror, error, format, ap); va_end(ap); return sd_bus_message_new_method_error(call, m, &berror); } +void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m) { + assert(bus); + assert(m); + + m->sender = m->creds.unique_name = (char*) "org.freedesktop.DBus.Local"; + m->creds.well_known_names_local = true; + m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask; +} + +void bus_message_set_sender_driver(sd_bus *bus, sd_bus_message *m) { + assert(bus); + assert(m); + + m->sender = m->creds.unique_name = (char*) "org.freedesktop.DBus"; + m->creds.well_known_names_driver = true; + m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask; +} + int bus_message_new_synthetic_error( sd_bus *bus, uint64_t cookie, @@ -771,7 +905,7 @@ int bus_message_new_synthetic_error( t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; t->reply_cookie = cookie; - r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); + r = message_append_reply_cookie(t, t->reply_cookie); if (r < 0) goto fail; @@ -793,6 +927,8 @@ int bus_message_new_synthetic_error( t->error._need_free = -1; + bus_message_set_sender_driver(bus, t); + *m = t; return 0; @@ -834,9 +970,14 @@ _public_ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) { } _public_ int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie) { + uint64_t c; + assert_return(m, -EINVAL); assert_return(cookie, -EINVAL); - assert_return(m->header->serial != 0, -ENODATA); + + c = BUS_MESSAGE_COOKIE(m); + if (c == 0) + return -ENODATA; *cookie = BUS_MESSAGE_COOKIE(m); return 0; @@ -845,7 +986,9 @@ _public_ int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie) { _public_ int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie) { assert_return(m, -EINVAL); assert_return(cookie, -EINVAL); - assert_return(m->reply_cookie != 0, -ENODATA); + + if (m->reply_cookie == 0) + return -ENODATA; *cookie = m->reply_cookie; return 0; @@ -950,9 +1093,11 @@ _public_ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m) { return &m->creds; } -_public_ int sd_bus_message_is_signal(sd_bus_message *m, - const char *interface, - const char *member) { +_public_ int sd_bus_message_is_signal( + sd_bus_message *m, + const char *interface, + const char *member) { + assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_SIGNAL) @@ -967,9 +1112,11 @@ _public_ int sd_bus_message_is_signal(sd_bus_message *m, return 1; } -_public_ int sd_bus_message_is_method_call(sd_bus_message *m, - const char *interface, - const char *member) { +_public_ int sd_bus_message_is_method_call( + sd_bus_message *m, + const char *interface, + const char *member) { + assert_return(m, -EINVAL); if (m->header->type != SD_BUS_MESSAGE_METHOD_CALL) @@ -1103,8 +1250,10 @@ static int part_make_space( if (m->poisoned) return -ENOMEM; - if (!part->data && part->memfd < 0) + if (!part->data && part->memfd < 0) { part->memfd = bus_kernel_pop_memfd(m->bus, &part->data, &part->mapped, &part->allocated); + part->mmap_begin = part->data; + } if (part->memfd >= 0) { @@ -1202,7 +1351,13 @@ static void message_extend_containers(sd_bus_message *m, size_t expand) { } } -static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, bool add_offset) { +static void *message_extend_body( + sd_bus_message *m, + size_t align, + size_t sz, + bool add_offset, + bool force_inline) { + size_t start_body, end_body, padding, added; void *p; int r; @@ -1214,14 +1369,15 @@ static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo if (m->poisoned) return NULL; - start_body = ALIGN_TO((size_t) m->header->body_size, align); + start_body = ALIGN_TO((size_t) m->body_size, align); end_body = start_body + sz; - padding = start_body - m->header->body_size; + padding = start_body - m->body_size; added = padding + sz; /* Check for 32bit overflows */ - if (end_body > (size_t) ((uint32_t) -1)) { + if (end_body > (size_t) ((uint32_t) -1) || + end_body < start_body) { m->poisoned = true; return NULL; } @@ -1233,7 +1389,8 @@ static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo add_new_part = m->n_body_parts <= 0 || m->body_end->sealed || - padding != ALIGN_TO(m->body_end->size, align) - m->body_end->size; + (padding != ALIGN_TO(m->body_end->size, align) - m->body_end->size) || + (force_inline && m->body_end->size > MEMFD_MIN_SIZE); /* if this must be an inlined extension, let's create a new part if the previous part is large enough to be inlined */ if (add_new_part) { if (padding > 0) { @@ -1282,7 +1439,7 @@ static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo /* Return something that is not NULL and is aligned */ p = (uint8_t *) NULL + align; - m->header->body_size = end_body; + m->body_size = end_body; message_extend_containers(m, added); if (add_offset) { @@ -1346,7 +1503,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void } else { char *e; - /* Maybe we can append to the signature? But only if this is the top-level container*/ + /* Maybe we can append to the signature? But only if this is the top-level container */ if (c->enclosing != 0) return -ENXIO; @@ -1408,7 +1565,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void assert(align > 0); assert(sz > 0); - a = message_extend_body(m, align, sz, true); + a = message_extend_body(m, align, sz, true, false); if (!a) return -ENOMEM; @@ -1477,7 +1634,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void assert(align > 0); assert(sz > 0); - a = message_extend_body(m, align, sz, false); + a = message_extend_body(m, align, sz, false, false); if (!a) return -ENOMEM; @@ -1539,7 +1696,7 @@ _public_ int sd_bus_message_append_string_space( } else { char *e; - /* Maybe we can append to the signature? But only if this is the top-level container*/ + /* Maybe we can append to the signature? But only if this is the top-level container */ if (c->enclosing != 0) return -ENXIO; @@ -1551,13 +1708,13 @@ _public_ int sd_bus_message_append_string_space( } if (BUS_MESSAGE_IS_GVARIANT(m)) { - a = message_extend_body(m, 1, size + 1, true); + a = message_extend_body(m, 1, size + 1, true, false); if (!a) return -ENOMEM; *s = a; } else { - a = message_extend_body(m, 4, 4 + size + 1, false); + a = message_extend_body(m, 4, 4 + size + 1, false, false); if (!a) return -ENOMEM; @@ -1662,14 +1819,14 @@ static int bus_message_open_array( return alignment; /* Add alignment padding and add to offset list */ - if (!message_extend_body(m, alignment, 0, false)) + if (!message_extend_body(m, alignment, 0, false, false)) return -ENOMEM; r = bus_gvariant_is_fixed_size(contents); if (r < 0) return r; - *begin = m->header->body_size; + *begin = m->body_size; *need_offsets = r == 0; } else { void *a, *op; @@ -1680,7 +1837,7 @@ static int bus_message_open_array( if (alignment < 0) return alignment; - a = message_extend_body(m, 4, 4, false); + a = message_extend_body(m, 4, 4, false, false); if (!a) return -ENOMEM; @@ -1689,7 +1846,7 @@ static int bus_message_open_array( os = m->body_end->size; /* Add alignment between size and first element */ - if (!message_extend_body(m, alignment, 0, false)) + if (!message_extend_body(m, alignment, 0, false, false)) return -ENOMEM; /* location of array size might have changed so let's readjust a */ @@ -1742,7 +1899,7 @@ static int bus_message_open_variant( if (BUS_MESSAGE_IS_GVARIANT(m)) { /* Variants are always aligned to 8 */ - if (!message_extend_body(m, 8, 0, false)) + if (!message_extend_body(m, 8, 0, false, false)) return -ENOMEM; } else { @@ -1750,7 +1907,7 @@ static int bus_message_open_variant( void *a; l = strlen(contents); - a = message_extend_body(m, 1, 1 + l + 1, false); + a = message_extend_body(m, 1, 1 + l + 1, false, false); if (!a) return -ENOMEM; @@ -1816,18 +1973,18 @@ static int bus_message_open_struct( if (alignment < 0) return alignment; - if (!message_extend_body(m, alignment, 0, false)) + if (!message_extend_body(m, alignment, 0, false, false)) return -ENOMEM; r = bus_gvariant_is_fixed_size(contents); if (r < 0) return r; - *begin = m->header->body_size; + *begin = m->body_size; *need_offsets = r == 0; } else { /* Align contents to 8 byte boundary */ - if (!message_extend_body(m, 8, 0, false)) + if (!message_extend_body(m, 8, 0, false, false)) return -ENOMEM; } @@ -1877,18 +2034,18 @@ static int bus_message_open_dict_entry( if (alignment < 0) return alignment; - if (!message_extend_body(m, alignment, 0, false)) + if (!message_extend_body(m, alignment, 0, false, false)) return -ENOMEM; r = bus_gvariant_is_fixed_size(contents); if (r < 0) return r; - *begin = m->header->body_size; + *begin = m->body_size; *need_offsets = r == 0; } else { /* Align contents to 8 byte boundary */ - if (!message_extend_body(m, 8, 0, false)) + if (!message_extend_body(m, 8, 0, false, false)) return -ENOMEM; } @@ -1929,7 +2086,7 @@ _public_ int sd_bus_message_open_container( /* Save old index in the parent container, in case we have to * abort this container */ c->saved_index = c->index; - before = m->header->body_size; + before = m->body_size; if (type == SD_BUS_TYPE_ARRAY) r = bus_message_open_array(m, c, contents, &array_size, &begin, &need_offsets); @@ -1962,66 +2119,6 @@ _public_ int sd_bus_message_open_container( return 0; } -static size_t determine_word_size(size_t sz, size_t extra) { - if (sz + extra <= 0xFF) - return 1; - else if (sz + extra*2 <= 0xFFFF) - return 2; - else if (sz + extra*4 <= 0xFFFFFFFF) - return 4; - else - return 8; -} - -static size_t read_word_le(void *p, size_t sz) { - union { - uint16_t u16; - uint32_t u32; - uint64_t u64; - } x; - - assert(p); - - if (sz == 1) - return *(uint8_t*) p; - - memcpy(&x, p, sz); - - if (sz == 2) - return le16toh(x.u16); - else if (sz == 4) - return le32toh(x.u32); - else if (sz == 8) - return le64toh(x.u64); - - assert_not_reached("unknown word width"); -} - -static void write_word_le(void *p, size_t sz, size_t value) { - union { - uint16_t u16; - uint32_t u32; - uint64_t u64; - } x; - - assert(p); - assert(sz == 8 || (value < (1ULL << (sz*8)))); - - if (sz == 1) { - *(uint8_t*) p = value; - return; - } else if (sz == 2) - x.u16 = htole16((uint16_t) value); - else if (sz == 4) - x.u32 = htole32((uint32_t) value); - else if (sz == 8) - x.u64 = htole64((uint64_t) value); - else - assert_not_reached("unknown word width"); - - memcpy(p, &x, sz); -} - static int bus_message_close_array(sd_bus_message *m, struct bus_container *c) { assert(m); @@ -2037,20 +2134,20 @@ static int bus_message_close_array(sd_bus_message *m, struct bus_container *c) { /* Variable-width arrays */ payload = c->n_offsets > 0 ? c->offsets[c->n_offsets-1] - c->begin : 0; - sz = determine_word_size(payload, c->n_offsets); + sz = bus_gvariant_determine_word_size(payload, c->n_offsets); - a = message_extend_body(m, 1, sz * c->n_offsets, true); + a = message_extend_body(m, 1, sz * c->n_offsets, true, false); if (!a) return -ENOMEM; for (i = 0; i < c->n_offsets; i++) - write_word_le(a + sz*i, sz, c->offsets[i] - c->begin); + bus_gvariant_write_word_le(a + sz*i, sz, c->offsets[i] - c->begin); } else { void *a; /* Fixed-width or empty arrays */ - a = message_extend_body(m, 1, 0, true); /* let's add offset to parent */ + a = message_extend_body(m, 1, 0, true, false); /* let's add offset to parent */ if (!a) return -ENOMEM; } @@ -2071,7 +2168,7 @@ static int bus_message_close_variant(sd_bus_message *m, struct bus_container *c) l = strlen(c->signature); - a = message_extend_body(m, 1, 1 + l, true); + a = message_extend_body(m, 1, 1 + l, true, false); if (!a) return -ENOMEM; @@ -2128,18 +2225,18 @@ static int bus_message_close_struct(sd_bus_message *m, struct bus_container *c, assert(c->need_offsets || n_variable == 0); if (n_variable <= 0) { - a = message_extend_body(m, 1, 0, add_offset); + a = message_extend_body(m, 1, 0, add_offset, false); if (!a) return -ENOMEM; } else { size_t sz; unsigned j; - assert(c->offsets[c->n_offsets-1] == m->header->body_size); + assert(c->offsets[c->n_offsets-1] == m->body_size); - sz = determine_word_size(m->header->body_size - c->begin, n_variable); + sz = bus_gvariant_determine_word_size(m->body_size - c->begin, n_variable); - a = message_extend_body(m, 1, sz * n_variable, add_offset); + a = message_extend_body(m, 1, sz * n_variable, add_offset, false); if (!a) return -ENOMEM; @@ -2168,7 +2265,7 @@ static int bus_message_close_struct(sd_bus_message *m, struct bus_container *c, k = n_variable - 1 - j; - write_word_le(a + k * sz, sz, c->offsets[i] - c->begin); + bus_gvariant_write_word_le(a + k * sz, sz, c->offsets[i] - c->begin); j++; } @@ -2325,8 +2422,7 @@ int bus_message_append_ap( } case SD_BUS_TYPE_INT64: - case SD_BUS_TYPE_UINT64: - case SD_BUS_TYPE_DOUBLE: { + case SD_BUS_TYPE_UINT64: { uint64_t x; x = va_arg(ap, uint64_t); @@ -2334,6 +2430,14 @@ int bus_message_append_ap( break; } + case SD_BUS_TYPE_DOUBLE: { + double x; + + x = va_arg(ap, double); + r = sd_bus_message_append_basic(m, *t, &x); + break; + } + case SD_BUS_TYPE_STRING: case SD_BUS_TYPE_OBJECT_PATH: case SD_BUS_TYPE_SIGNATURE: { @@ -2492,7 +2596,7 @@ _public_ int sd_bus_message_append_array_space( if (r < 0) return r; - a = message_extend_body(m, align, size, false); + a = message_extend_body(m, align, size, false, false); if (!a) return -ENOMEM; @@ -2621,7 +2725,7 @@ _public_ int sd_bus_message_append_array_memfd( if (r < 0) return r; - a = message_extend_body(m, align, 0, false); + a = message_extend_body(m, align, 0, false, false); if (!a) return -ENOMEM; @@ -2635,7 +2739,7 @@ _public_ int sd_bus_message_append_array_memfd( part->size = size; copy_fd = -1; - m->header->body_size += size; + m->body_size += size; message_extend_containers(m, size); return sd_bus_message_close_container(m); @@ -2693,7 +2797,7 @@ _public_ int sd_bus_message_append_string_memfd( } else { char *e; - /* Maybe we can append to the signature? But only if this is the top-level container*/ + /* Maybe we can append to the signature? But only if this is the top-level container */ if (c->enclosing != 0) return -ENXIO; @@ -2705,7 +2809,7 @@ _public_ int sd_bus_message_append_string_memfd( } if (!BUS_MESSAGE_IS_GVARIANT(m)) { - a = message_extend_body(m, 4, 4, false); + a = message_extend_body(m, 4, 4, false, false); if (!a) return -ENOMEM; @@ -2722,11 +2826,11 @@ _public_ int sd_bus_message_append_string_memfd( part->size = size; copy_fd = -1; - m->header->body_size += size; + m->body_size += size; message_extend_containers(m, size); if (BUS_MESSAGE_IS_GVARIANT(m)) { - r = message_add_offset(m, m->header->body_size); + r = message_add_offset(m, m->body_size); if (r < 0) { m->poisoned = true; return -ENOMEM; @@ -2761,34 +2865,66 @@ _public_ int sd_bus_message_append_strv(sd_bus_message *m, char **l) { } static int bus_message_close_header(sd_bus_message *m) { - uint8_t *a; - size_t sz, i; assert(m); - if (!BUS_MESSAGE_IS_GVARIANT(m)) - return 0; + /* The actual user data is finished now, we just complete the + variant and struct now (at least on gvariant). Remember + this position, so that during parsing we know where to to + put the outer container end. */ + m->user_body_size = m->body_size; - if (m->n_header_offsets < 1) - return 0; + if (BUS_MESSAGE_IS_GVARIANT(m)) { + const char *signature; + size_t sz, l; + void *d; - assert(m->header->fields_size == m->header_offsets[m->n_header_offsets-1]); + /* Add offset table to end of fields array */ + if (m->n_header_offsets >= 1) { + uint8_t *a; + unsigned i; - sz = determine_word_size(m->header->fields_size, m->n_header_offsets); + assert(m->fields_size == m->header_offsets[m->n_header_offsets-1]); - a = message_extend_fields(m, 1, sz * m->n_header_offsets, false); - if (!a) - return -ENOMEM; + sz = bus_gvariant_determine_word_size(m->fields_size, m->n_header_offsets); + a = message_extend_fields(m, 1, sz * m->n_header_offsets, false); + if (!a) + return -ENOMEM; + + for (i = 0; i < m->n_header_offsets; i++) + bus_gvariant_write_word_le(a + sz*i, sz, m->header_offsets[i]); + } + + /* Add gvariant NUL byte plus signature to the end of + * the body, followed by the final offset pointing to + * the end of the fields array */ + + signature = strempty(m->root_container.signature); + l = strlen(signature); + + sz = bus_gvariant_determine_word_size(sizeof(struct bus_header) + ALIGN8(m->fields_size) + m->body_size + 1 + l, 1); + d = message_extend_body(m, 1, 1 + l + sz, false, true); + if (!d) + return -ENOMEM; + + *(uint8_t*) d = 0; + memcpy((uint8_t*) d + 1, signature, l); - for (i = 0; i < m->n_header_offsets; i++) - write_word_le(a + sz*i, sz, m->header_offsets[i]); + bus_gvariant_write_word_le((uint8_t*) d + 1 + l, sz, sizeof(struct bus_header) + m->fields_size); + + m->footer = d; + m->footer_accessible = 1 + l + sz; + } else { + m->header->dbus1.fields_size = m->fields_size; + m->header->dbus1.body_size = m->body_size; + } return 0; } int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) { struct bus_body_part *part; - size_t l, a; + size_t a; unsigned i; int r; @@ -2803,6 +2939,10 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) { if (m->poisoned) return -ESTALE; + if (cookie > 0xffffffffULL && + !BUS_MESSAGE_IS_GVARIANT(m)) + return -ENOTSUP; + /* In vtables the return signature of method calls is listed, * let's check if they match if this is a response */ if (m->header->type == SD_BUS_MESSAGE_METHOD_RETURN && @@ -2815,8 +2955,9 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) { if (r < 0) return r; - /* If there's a non-trivial signature set, then add it in here */ - if (!isempty(m->root_container.signature)) { + /* If there's a non-trivial signature set, then add it in + * here, but only on dbus1 */ + if (!isempty(m->root_container.signature) && !BUS_MESSAGE_IS_GVARIANT(m)) { r = message_append_field_signature(m, BUS_MESSAGE_HEADER_SIGNATURE, m->root_container.signature, NULL); if (r < 0) return r; @@ -2832,24 +2973,30 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) { if (r < 0) return r; - m->header->serial = (uint32_t) cookie; + if (BUS_MESSAGE_IS_GVARIANT(m)) + m->header->dbus2.cookie = cookie; + else + m->header->dbus1.serial = (uint32_t) cookie; + m->timeout = m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED ? 0 : timeout; /* Add padding at the end of the fields part, since we know * the body needs to start at an 8 byte alignment. We made * sure we allocated enough space for this, so all we need to * do here is to zero it out. */ - l = BUS_MESSAGE_FIELDS_SIZE(m); - a = ALIGN8(l) - l; + a = ALIGN8(m->fields_size) - m->fields_size; if (a > 0) - memzero((uint8_t*) BUS_MESSAGE_FIELDS(m) + l, a); + memzero((uint8_t*) BUS_MESSAGE_FIELDS(m) + m->fields_size, a); /* If this is something we can send as memfd, then let's seal the memfd now. Note that we can send memfds as payload only for directed messages, and not for broadcasts. */ if (m->destination && m->bus->use_memfd) { MESSAGE_FOREACH_PART(part, i, m) - if (part->memfd >= 0 && !part->sealed && (part->size > MEMFD_MIN_SIZE || m->bus->use_memfd < 0)) { + if (part->memfd >= 0 && + !part->sealed && + (part->size > MEMFD_MIN_SIZE || m->bus->use_memfd < 0) && + part != m->body_end) { /* The last part may never be sent as memfd */ uint64_t sz; /* Try to seal it if that makes @@ -2869,7 +3016,7 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) { } } - m->root_container.end = BUS_MESSAGE_BODY_SIZE(m); + m->root_container.end = m->user_body_size; m->root_container.index = 0; m->root_container.offset_index = 0; m->root_container.item_size = m->root_container.n_offsets > 0 ? m->root_container.offsets[0] : 0; @@ -3155,7 +3302,7 @@ static int message_peek_body( padding = start - *rindex; end = start + nbytes; - if (end > BUS_MESSAGE_BODY_SIZE(m)) + if (end > m->user_body_size) return -EBADMSG; part = find_part(m, *rindex, padding, (void**) &q); @@ -3528,14 +3675,14 @@ static int bus_message_enter_array( unsigned i; /* gvariant: variable length array */ - sz = determine_word_size(c->item_size, 0); + sz = bus_gvariant_determine_word_size(c->item_size, 0); where = rindex + c->item_size - sz; r = message_peek_body(m, &where, 1, sz, &q); if (r < 0) return r; - framing = read_word_le(q, sz); + framing = bus_gvariant_read_word_le(q, sz); if (framing > c->item_size - sz) return -EBADMSG; if ((c->item_size - framing) % sz != 0) @@ -3555,7 +3702,7 @@ static int bus_message_enter_array( for (i = 0; i < *n_offsets; i++) { size_t x; - x = read_word_le((uint8_t*) q + i * sz, sz); + x = bus_gvariant_read_word_le((uint8_t*) q + i * sz, sz); if (x > c->item_size - sz) return -EBADMSG; if (x < p) @@ -3678,7 +3825,7 @@ static int build_struct_offsets( return 0; } - sz = determine_word_size(size, 0); + sz = bus_gvariant_determine_word_size(size, 0); if (sz <= 0) return -EBADMSG; @@ -3752,7 +3899,7 @@ static int build_struct_offsets( if (v > 0) { v--; - x = read_word_le((uint8_t*) q + v*sz, sz); + x = bus_gvariant_read_word_le((uint8_t*) q + v*sz, sz); if (x >= size) return -EBADMSG; if (m->rindex + x < previous) @@ -4633,10 +4780,12 @@ _public_ int sd_bus_message_skip(sd_bus_message *m, const char *types) { } } -_public_ int sd_bus_message_read_array(sd_bus_message *m, - char type, - const void **ptr, - size_t *size) { +_public_ int sd_bus_message_read_array( + sd_bus_message *m, + char type, + const void **ptr, + size_t *size) { + struct bus_container *c; void *p; size_t sz; @@ -4705,7 +4854,7 @@ static int message_peek_fields( assert(rindex); assert(align > 0); - return buffer_peek(BUS_MESSAGE_FIELDS(m), BUS_MESSAGE_FIELDS_SIZE(m), rindex, align, nbytes, ret); + return buffer_peek(BUS_MESSAGE_FIELDS(m), m->fields_size, rindex, align, nbytes, ret); } static int message_peek_field_uint32( @@ -4735,6 +4884,33 @@ static int message_peek_field_uint32( return 0; } +static int message_peek_field_uint64( + sd_bus_message *m, + size_t *ri, + size_t item_size, + uint64_t *ret) { + + int r; + void *q; + + assert(m); + assert(ri); + + if (BUS_MESSAGE_IS_GVARIANT(m) && item_size != 8) + return -EBADMSG; + + /* identical for gvariant and dbus1 */ + + r = message_peek_fields(m, ri, 8, 8, &q); + if (r < 0) + return r; + + if (ret) + *ret = BUS_MESSAGE_BSWAP64(m, *(uint64_t*) q); + + return 0; +} + static int message_peek_field_string( sd_bus_message *m, bool (*validate)(const char *p), @@ -4980,59 +5156,106 @@ int bus_message_parse_fields(sd_bus_message *m) { assert(m); if (BUS_MESSAGE_IS_GVARIANT(m)) { - void *q; + char *p; + + /* Read the signature from the end of the body variant first */ + sz = bus_gvariant_determine_word_size(BUS_MESSAGE_SIZE(m), 0); + if (m->footer_accessible < 1 + sz) + return -EBADMSG; + + p = (char*) m->footer + m->footer_accessible - (1 + sz); + for (;;) { + if (p < (char*) m->footer) + return -EBADMSG; + + if (*p == 0) { + char *c; - sz = determine_word_size(BUS_MESSAGE_FIELDS_SIZE(m), 0); + /* We found the beginning of the signature string, yay! */ + + c = strndup(p + 1, ((char*) m->footer + m->footer_accessible) - p - (1 + sz)); + if (!c) + return -ENOMEM; + + free(m->root_container.signature); + m->root_container.signature = c; + break; + } + + p--; + } + + /* Calculate the actual user body size, by removing + * the trailing variant signature and struct offset + * table */ + m->user_body_size = m->body_size - ((char*) m->footer + m->footer_accessible - p); + + /* Pull out the offset table for the fields array */ + sz = bus_gvariant_determine_word_size(m->fields_size, 0); if (sz > 0) { size_t framing; + void *q; - ri = BUS_MESSAGE_FIELDS_SIZE(m) - sz; + ri = m->fields_size - sz; r = message_peek_fields(m, &ri, 1, sz, &q); if (r < 0) return r; - framing = read_word_le(q, sz); - if (framing >= BUS_MESSAGE_FIELDS_SIZE(m) - sz) + framing = bus_gvariant_read_word_le(q, sz); + if (framing >= m->fields_size - sz) return -EBADMSG; - if ((BUS_MESSAGE_FIELDS_SIZE(m) - framing) % sz != 0) + if ((m->fields_size - framing) % sz != 0) return -EBADMSG; ri = framing; - r = message_peek_fields(m, &ri, 1, BUS_MESSAGE_FIELDS_SIZE(m) - framing, &offsets); + r = message_peek_fields(m, &ri, 1, m->fields_size - framing, &offsets); if (r < 0) return r; - n_offsets = (BUS_MESSAGE_FIELDS_SIZE(m) - framing) / sz; + n_offsets = (m->fields_size - framing) / sz; } - } + } else + m->user_body_size = m->body_size; ri = 0; - while (ri < BUS_MESSAGE_FIELDS_SIZE(m)) { + while (ri < m->fields_size) { _cleanup_free_ char *sig = NULL; const char *signature; - uint8_t *header; + uint64_t field_type; size_t item_size = (size_t) -1; if (BUS_MESSAGE_IS_GVARIANT(m)) { + uint64_t *u64; + if (i >= n_offsets) break; if (i == 0) ri = 0; else - ri = ALIGN_TO(read_word_le((uint8_t*) offsets + (i-1)*sz, sz), 8); - } + ri = ALIGN_TO(bus_gvariant_read_word_le((uint8_t*) offsets + (i-1)*sz, sz), 8); - r = message_peek_fields(m, &ri, 8, 1, (void**) &header); - if (r < 0) - return r; + r = message_peek_fields(m, &ri, 8, 8, (void**) &u64); + if (r < 0) + return r; + + field_type = BUS_MESSAGE_BSWAP64(m, *u64); + } else { + uint8_t *u8; + + r = message_peek_fields(m, &ri, 8, 1, (void**) &u8); + if (r < 0) + return r; + + field_type = *u8; + } if (BUS_MESSAGE_IS_GVARIANT(m)) { size_t where, end; char *b; void *q; - end = read_word_le((uint8_t*) offsets + i*sz, sz); + end = bus_gvariant_read_word_le((uint8_t*) offsets + i*sz, sz); if (end < ri) return -EBADMSG; @@ -5059,7 +5282,8 @@ int bus_message_parse_fields(sd_bus_message *m) { return r; } - switch (*header) { + switch (field_type) { + case _BUS_MESSAGE_HEADER_INVALID: return -EBADMSG; @@ -5143,6 +5367,9 @@ int bus_message_parse_fields(sd_bus_message *m) { const char *s; char *c; + if (BUS_MESSAGE_IS_GVARIANT(m)) /* only applies to dbus1 */ + return -EBADMSG; + if (m->root_container.signature) return -EBADMSG; @@ -5162,26 +5389,38 @@ int bus_message_parse_fields(sd_bus_message *m) { break; } - case BUS_MESSAGE_HEADER_REPLY_SERIAL: { - uint32_t serial; + case BUS_MESSAGE_HEADER_REPLY_SERIAL: if (m->reply_cookie != 0) return -EBADMSG; - if (!streq(signature, "u")) - return -EBADMSG; + if (BUS_MESSAGE_IS_GVARIANT(m)) { + /* 64bit on dbus2 */ - r = message_peek_field_uint32(m, &ri, item_size, &serial); - if (r < 0) - return r; + if (!streq(signature, "t")) + return -EBADMSG; + + r = message_peek_field_uint64(m, &ri, item_size, &m->reply_cookie); + if (r < 0) + return r; + } else { + /* 32bit on dbus1 */ + uint32_t serial; - m->reply_cookie = serial; + if (!streq(signature, "u")) + return -EBADMSG; + + r = message_peek_field_uint32(m, &ri, item_size, &serial); + if (r < 0) + return r; + + m->reply_cookie = serial; + } if (m->reply_cookie == 0) return -EBADMSG; break; - } case BUS_MESSAGE_HEADER_UNIX_FDS: if (unix_fds_set) @@ -5253,13 +5492,13 @@ int bus_message_parse_fields(sd_bus_message *m) { if (streq_ptr(m->sender, "org.freedesktop.DBus.Local")) return -EBADMSG; - m->root_container.end = BUS_MESSAGE_BODY_SIZE(m); + m->root_container.end = m->user_body_size; if (BUS_MESSAGE_IS_GVARIANT(m)) { r = build_struct_offsets( m, m->root_container.signature, - BUS_MESSAGE_BODY_SIZE(m), + m->user_body_size, &m->root_container.item_size, &m->root_container.offsets, &m->root_container.n_offsets); @@ -5413,40 +5652,6 @@ int bus_message_get_arg(sd_bus_message *m, unsigned i, const char **str, char ** return 0; } -bool bus_header_is_complete(struct bus_header *h, size_t size) { - size_t full; - - assert(h); - assert(size); - - if (size < sizeof(struct bus_header)) - return false; - - full = sizeof(struct bus_header) + - (h->endian == BUS_NATIVE_ENDIAN ? h->fields_size : bswap_32(h->fields_size)); - - return size >= full; -} - -int bus_header_message_size(struct bus_header *h, size_t *sum) { - size_t fs, bs; - - assert(h); - assert(sum); - - if (h->endian == BUS_NATIVE_ENDIAN) { - fs = h->fields_size; - bs = h->body_size; - } else if (h->endian == BUS_REVERSE_ENDIAN) { - fs = bswap_32(h->fields_size); - bs = bswap_32(h->body_size); - } else - return -EBADMSG; - - *sum = sizeof(struct bus_header) + ALIGN8(fs) + bs; - return 0; -} - _public_ int sd_bus_message_get_errno(sd_bus_message *m) { assert_return(m, EINVAL); @@ -5620,7 +5825,8 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) { return -ENOMEM; n->reply_cookie = (*m)->reply_cookie; - r = message_append_field_uint32(n, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) n->reply_cookie); + + r = message_append_reply_cookie(n, n->reply_cookie); if (r < 0) return r; diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h index 4dd280dcf..32955329b 100644 --- a/src/libsystemd/sd-bus/bus-message.h +++ b/src/libsystemd/sd-bus/bus-message.h @@ -99,7 +99,18 @@ struct sd_bus_message { bool release_kdbus:1; bool poisoned:1; + /* The first and last bytes of the message */ struct bus_header *header; + void *footer; + + /* How many bytes are accessible in the above pointers */ + size_t header_accessible; + size_t footer_accessible; + + size_t fields_size; + size_t body_size; + size_t user_body_size; + struct bus_body_part body; struct bus_body_part *body_end; unsigned n_body_parts; @@ -112,7 +123,7 @@ struct sd_bus_message { int *fds; struct bus_container root_container, *containers; - unsigned n_containers; + size_t n_containers; size_t containers_allocated; struct iovec *iovec; @@ -138,7 +149,9 @@ struct sd_bus_message { unsigned n_header_offsets; }; -#define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != BUS_NATIVE_ENDIAN) +static inline bool BUS_MESSAGE_NEED_BSWAP(sd_bus_message *m) { + return m->header->endian != BUS_NATIVE_ENDIAN; +} static inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) { return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u; @@ -153,29 +166,23 @@ static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) { } static inline uint64_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { - /* Note that we return the serial converted to a 64bit value here */ - return BUS_MESSAGE_BSWAP32(m, m->header->serial); -} + if (m->header->version == 2) + return BUS_MESSAGE_BSWAP64(m, m->header->dbus2.cookie); -static inline uint32_t BUS_MESSAGE_BODY_SIZE(sd_bus_message *m) { - return BUS_MESSAGE_BSWAP32(m, m->header->body_size); + return BUS_MESSAGE_BSWAP32(m, m->header->dbus1.serial); } -static inline uint32_t BUS_MESSAGE_FIELDS_SIZE(sd_bus_message *m) { - return BUS_MESSAGE_BSWAP32(m, m->header->fields_size); -} - -static inline uint32_t BUS_MESSAGE_SIZE(sd_bus_message *m) { +static inline size_t BUS_MESSAGE_SIZE(sd_bus_message *m) { return sizeof(struct bus_header) + - ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)) + - BUS_MESSAGE_BODY_SIZE(m); + ALIGN8(m->fields_size) + + m->body_size; } -static inline uint32_t BUS_MESSAGE_BODY_BEGIN(sd_bus_message *m) { +static inline size_t BUS_MESSAGE_BODY_BEGIN(sd_bus_message *m) { return sizeof(struct bus_header) + - ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)); + ALIGN8(m->fields_size); } static inline void* BUS_MESSAGE_FIELDS(sd_bus_message *m) { @@ -193,7 +200,10 @@ int bus_message_read_strv_extend(sd_bus_message *m, char ***l); int bus_message_from_header( sd_bus *bus, void *header, - size_t length, + size_t header_accessible, + void *footer, + size_t footer_accessible, + size_t message_size, int *fds, unsigned n_fds, const struct ucred *ucred, @@ -217,9 +227,6 @@ int bus_message_append_ap(sd_bus_message *m, const char *types, va_list ap); int bus_message_parse_fields(sd_bus_message *m); -bool bus_header_is_complete(struct bus_header *h, size_t size); -int bus_header_message_size(struct bus_header *h, size_t *sum); - struct bus_body_part *message_append_part(sd_bus_message *m); #define MESSAGE_FOREACH_PART(part, i, m) \ @@ -235,3 +242,6 @@ int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_bus_e int bus_message_remarshal(sd_bus *bus, sd_bus_message **m); int bus_message_append_sender(sd_bus_message *m, const char *sender); + +void bus_message_set_sender_driver(sd_bus *bus, sd_bus_message *m); +void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m); diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c index 6162d12c1..fc6c22328 100644 --- a/src/libsystemd/sd-bus/bus-objects.c +++ b/src/libsystemd/sd-bus/bus-objects.c @@ -19,8 +19,6 @@ along with systemd; If not, see . ***/ -#include - #include "strv.h" #include "set.h" #include "bus-internal.h" @@ -2113,6 +2111,375 @@ _public_ int sd_bus_emit_properties_changed( return sd_bus_emit_properties_changed_strv(bus, path, interface, names); } +static int object_added_append_all_prefix( + sd_bus *bus, + sd_bus_message *m, + Set *s, + const char *prefix, + const char *path, + bool require_fallback) { + + const char *previous_interface = NULL; + struct node_vtable *c; + struct node *n; + int r; + + assert(bus); + assert(m); + assert(s); + assert(prefix); + assert(path); + + n = hashmap_get(bus->nodes, prefix); + if (!n) + return 0; + + LIST_FOREACH(vtables, c, n->vtables) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + void *u = NULL; + + if (require_fallback && !c->is_fallback) + continue; + + r = node_vtable_get_userdata(bus, path, c, &u, &error); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + if (r == 0) + continue; + + if (!streq_ptr(c->interface, previous_interface)) { + /* If a child-node already handled this interface, we + * skip it on any of its parents. The child vtables + * always fully override any conflicting vtables of + * any parent node. */ + if (set_get(s, c->interface)) + continue; + + r = set_put(s, c->interface); + if (r < 0) + return r; + + if (previous_interface) { + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + } + + r = sd_bus_message_open_container(m, 'e', "sa{sv}"); + if (r < 0) + return r; + r = sd_bus_message_append(m, "s", c->interface); + if (r < 0) + return r; + r = sd_bus_message_open_container(m, 'a', "{sv}"); + if (r < 0) + return r; + + previous_interface = c->interface; + } + + r = vtable_append_all_properties(bus, m, path, c, u, &error); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + } + + if (previous_interface) { + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + } + + return 0; +} + +static int object_added_append_all(sd_bus *bus, sd_bus_message *m, const char *path) { + _cleanup_set_free_ Set *s = NULL; + char *prefix; + int r; + + assert(bus); + assert(m); + assert(path); + + /* + * This appends all interfaces registered on path @path. We first add + * the builtin interfaces, which are always available and handled by + * sd-bus. Then, we add all interfaces registered on the exact node, + * followed by all fallback interfaces registered on any parent prefix. + * + * If an interface is registered multiple times on the same node with + * different vtables, we merge all the properties across all vtables. + * However, if a child node has the same interface registered as one of + * its parent nodes has as fallback, we make the child overwrite the + * parent instead of extending it. Therefore, we keep a "Set" of all + * handled interfaces during parent traversal, so we skip interfaces on + * a parent that were overwritten by a child. + */ + + s = set_new(&string_hash_ops); + if (!s) + return -ENOMEM; + + r = sd_bus_message_append(m, "{sa{sv}}", "org.freedesktop.DBus.Peer", 0); + if (r < 0) + return r; + r = sd_bus_message_append(m, "{sa{sv}}", "org.freedesktop.DBus.Introspectable", 0); + if (r < 0) + return r; + r = sd_bus_message_append(m, "{sa{sv}}", "org.freedesktop.DBus.Properties", 0); + if (r < 0) + return r; + r = sd_bus_message_append(m, "{sa{sv}}", "org.freedesktop.DBus.ObjectManager", 0); + if (r < 0) + return r; + + r = object_added_append_all_prefix(bus, m, s, path, path, false); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + + prefix = alloca(strlen(path) + 1); + OBJECT_PATH_FOREACH_PREFIX(prefix, path) { + r = object_added_append_all_prefix(bus, m, s, prefix, path, true); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + } + + return 0; +} + +int sd_bus_emit_object_added(sd_bus *bus, const char *path) { + BUS_DONT_DESTROY(bus); + + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + /* + * This emits an InterfacesAdded signal on the given path, by iterating + * all registered vtables and fallback vtables on the path. All + * properties are queried and included in the signal. + * This call is equivalent to sd_bus_emit_interfaces_added() with an + * explicit list of registered interfaces. However, unlike + * interfaces_added(), this call can figure out the list of supported + * interfaces itself. Furthermore, it properly adds the builtin + * org.freedesktop.DBus.* interfaces. + */ + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + if (!BUS_IS_OPEN(bus->state)) + return -ENOTCONN; + + do { + bus->nodes_modified = false; + m = sd_bus_message_unref(m); + + r = sd_bus_message_new_signal(bus, &m, path, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded"); + if (r < 0) + return r; + + r = sd_bus_message_append_basic(m, 'o', path); + if (r < 0) + return r; + + r = sd_bus_message_open_container(m, 'a', "{sa{sv}}"); + if (r < 0) + return r; + + r = object_added_append_all(bus, m, path); + if (r < 0) + return r; + + if (bus->nodes_modified) + continue; + + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + + } while (bus->nodes_modified); + + return sd_bus_send(bus, m, NULL); +} + +static int object_removed_append_all_prefix( + sd_bus *bus, + sd_bus_message *m, + Set *s, + const char *prefix, + const char *path, + bool require_fallback) { + + const char *previous_interface = NULL; + struct node_vtable *c; + struct node *n; + int r; + + assert(bus); + assert(m); + assert(s); + assert(prefix); + assert(path); + + n = hashmap_get(bus->nodes, prefix); + if (!n) + return 0; + + LIST_FOREACH(vtables, c, n->vtables) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + void *u = NULL; + + if (require_fallback && !c->is_fallback) + continue; + if (streq_ptr(c->interface, previous_interface)) + continue; + + /* If a child-node already handled this interface, we + * skip it on any of its parents. The child vtables + * always fully override any conflicting vtables of + * any parent node. */ + if (set_get(s, c->interface)) + continue; + + r = node_vtable_get_userdata(bus, path, c, &u, &error); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + if (r == 0) + continue; + + r = set_put(s, c->interface); + if (r < 0) + return r; + + r = sd_bus_message_append(m, "s", c->interface); + if (r < 0) + return r; + + previous_interface = c->interface; + } + + return 0; +} + +static int object_removed_append_all(sd_bus *bus, sd_bus_message *m, const char *path) { + _cleanup_set_free_ Set *s = NULL; + char *prefix; + int r; + + assert(bus); + assert(m); + assert(path); + + /* see sd_bus_emit_object_added() for details */ + + s = set_new(&string_hash_ops); + if (!s) + return -ENOMEM; + + r = sd_bus_message_append(m, "s", "org.freedesktop.DBus.Peer"); + if (r < 0) + return r; + r = sd_bus_message_append(m, "s", "org.freedesktop.DBus.Introspectable"); + if (r < 0) + return r; + r = sd_bus_message_append(m, "s", "org.freedesktop.DBus.Properties"); + if (r < 0) + return r; + r = sd_bus_message_append(m, "s", "org.freedesktop.DBus.ObjectManager"); + if (r < 0) + return r; + + r = object_removed_append_all_prefix(bus, m, s, path, path, false); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + + prefix = alloca(strlen(path) + 1); + OBJECT_PATH_FOREACH_PREFIX(prefix, path) { + r = object_removed_append_all_prefix(bus, m, s, prefix, path, true); + if (r < 0) + return r; + if (bus->nodes_modified) + return 0; + } + + return 0; +} + +int sd_bus_emit_object_removed(sd_bus *bus, const char *path) { + BUS_DONT_DESTROY(bus); + + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + int r; + + /* + * This is like sd_bus_emit_object_added(), but emits an + * InterfacesRemoved signal on the given path. This only includes any + * registered interfaces but skips the properties. Note that this will + * call into the find() callbacks of any registered vtable. Therefore, + * you must call this function before destroying/unlinking your object. + * Otherwise, the list of interfaces will be incomplete. However, note + * that this will *NOT* call into any property callback. Therefore, the + * object might be in an "destructed" state, as long as we can find it. + */ + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + if (!BUS_IS_OPEN(bus->state)) + return -ENOTCONN; + + do { + bus->nodes_modified = false; + m = sd_bus_message_unref(m); + + r = sd_bus_message_new_signal(bus, &m, path, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved"); + if (r < 0) + return r; + + r = sd_bus_message_append_basic(m, 'o', path); + if (r < 0) + return r; + + r = sd_bus_message_open_container(m, 'a', "s"); + if (r < 0) + return r; + + r = object_removed_append_all(bus, m, path); + if (r < 0) + return r; + + if (bus->nodes_modified) + continue; + + r = sd_bus_message_close_container(m); + if (r < 0) + return r; + + } while (bus->nodes_modified); + + return sd_bus_send(bus, m, NULL); +} + static int interfaces_added_append_one_prefix( sd_bus *bus, sd_bus_message *m, diff --git a/src/libsystemd/sd-bus/bus-protocol.h b/src/libsystemd/sd-bus/bus-protocol.h index 6431dfbff..183af89a6 100644 --- a/src/libsystemd/sd-bus/bus-protocol.h +++ b/src/libsystemd/sd-bus/bus-protocol.h @@ -23,21 +23,38 @@ #include +#include "macro.h" + /* Packet header */ -struct bus_header { +struct _packed_ bus_header { + /* The first four fields are identical for dbus1, and dbus2 */ uint8_t endian; uint8_t type; uint8_t flags; uint8_t version; - uint32_t body_size; - - /* Note that what the bus spec calls "serial" we'll call - "cookie" instead, because we don't want to imply that the - cookie was in any way monotonically increasing. */ - uint32_t serial; - uint32_t fields_size; -} _packed_; + + union _packed_ { + /* dbus1: Used for SOCK_STREAM connections */ + struct _packed_ { + uint32_t body_size; + + /* Note that what the bus spec calls "serial" we'll call + "cookie" instead, because we don't want to imply that the + cookie was in any way monotonically increasing. */ + uint32_t serial; + uint32_t fields_size; + } dbus1; + + /* dbus2: Used for kdbus connections */ + struct _packed_ { + uint32_t _reserved; + uint64_t cookie; + } dbus2; + + /* Note that both header versions have the same size! */ + }; +}; /* Endianness */ diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index d02994e28..52883fa8c 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "util.h" @@ -359,8 +359,7 @@ static int bus_socket_auth_write_ok(sd_bus *b) { assert(b); - snprintf(t, sizeof(t), "OK " SD_ID128_FORMAT_STR "\r\n", SD_ID128_FORMAT_VAL(b->server_id)); - char_array_0(t); + xsprintf(t, "OK " SD_ID128_FORMAT_STR "\r\n", SD_ID128_FORMAT_VAL(b->server_id)); return bus_socket_auth_write(b, t); } @@ -644,12 +643,11 @@ static int bus_socket_start_auth_client(sd_bus *b) { l = 9; b->auth_buffer = hexmem("anonymous", l); } else { - char text[20 + 1]; /* enough space for a 64bit integer plus NUL */ + char text[DECIMAL_STR_MAX(uid_t) + 1]; auth_prefix = "\0AUTH EXTERNAL "; - snprintf(text, sizeof(text), UID_FMT, geteuid()); - char_array_0(text); + xsprintf(text, UID_FMT, geteuid()); l = strlen(text); b->auth_buffer = hexmem(text, l); diff --git a/src/libsystemd/sd-bus/bus-type.h b/src/libsystemd/sd-bus/bus-type.h index 581e8d584..0e507839c 100644 --- a/src/libsystemd/sd-bus/bus-type.h +++ b/src/libsystemd/sd-bus/bus-type.h @@ -23,6 +23,7 @@ #include +#include "macro.h" #include "sd-bus.h" #include "sd-bus-protocol.h" diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c index 0f1a89c8e..52d4ebe61 100644 --- a/src/libsystemd/sd-bus/bus-util.c +++ b/src/libsystemd/sd-bus/bus-util.c @@ -20,18 +20,17 @@ ***/ #include -#include - -#include "systemd/sd-daemon.h" +#include "sd-daemon.h" +#include "sd-event.h" #include "util.h" #include "strv.h" #include "macro.h" #include "def.h" #include "path-util.h" #include "missing.h" +#include "set.h" -#include "sd-event.h" #include "sd-bus.h" #include "bus-error.h" #include "bus-message.h" @@ -124,7 +123,7 @@ int bus_event_loop_with_idle( if (r < 0) return r; - if (r == 0 && !exiting) { + if (r == 0 && !exiting && idle) { r = sd_bus_try_close(bus); if (r == -EBUSY) @@ -1156,8 +1155,8 @@ int bus_open_transport(BusTransport transport, const char *host, bool user, sd_b r = sd_bus_open_system_remote(bus, host); break; - case BUS_TRANSPORT_CONTAINER: - r = sd_bus_open_system_container(bus, host); + case BUS_TRANSPORT_MACHINE: + r = sd_bus_open_system_machine(bus, host); break; default: @@ -1191,8 +1190,8 @@ int bus_open_transport_systemd(BusTransport transport, const char *host, bool us r = sd_bus_open_system_remote(bus, host); break; - case BUS_TRANSPORT_CONTAINER: - r = sd_bus_open_system_container(bus, host); + case BUS_TRANSPORT_MACHINE: + r = sd_bus_open_system_machine(bus, host); break; default: @@ -1372,8 +1371,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen if (STR_IN_SET(field, "CPUAccounting", "MemoryAccounting", "BlockIOAccounting", - "SendSIGHUP", "SendSIGKILL", - "WakeSystem")) { + "SendSIGHUP", "SendSIGKILL", "WakeSystem", "DefaultDependencies")) { r = parse_boolean(eq); if (r < 0) { @@ -1555,3 +1553,260 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen return 0; } + +typedef struct BusWaitForJobs { + sd_bus *bus; + Set *jobs; + + char *name; + char *result; + + sd_bus_slot *slot_job_removed; + sd_bus_slot *slot_disconnected; +} BusWaitForJobs; + +static int match_disconnected(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + assert(bus); + assert(m); + + log_error("Warning! D-Bus connection terminated."); + sd_bus_close(bus); + + return 0; +} + +static int match_job_removed(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + const char *path, *unit, *result; + BusWaitForJobs *d = userdata; + uint32_t id; + char *found; + int r; + + assert(bus); + assert(m); + assert(d); + + r = sd_bus_message_read(m, "uoss", &id, &path, &unit, &result); + if (r < 0) { + bus_log_parse_error(r); + return 0; + } + + found = set_remove(d->jobs, (char*) path); + if (!found) + return 0; + + free(found); + + if (!isempty(result)) + d->result = strdup(result); + + if (!isempty(unit)) + d->name = strdup(unit); + + return 0; +} + +void bus_wait_for_jobs_free(BusWaitForJobs *d) { + if (!d) + return; + + set_free_free(d->jobs); + + sd_bus_slot_unref(d->slot_disconnected); + sd_bus_slot_unref(d->slot_job_removed); + + sd_bus_unref(d->bus); + + free(d->name); + free(d->result); + + free(d); +} + +int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) { + _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *d = NULL; + int r; + + assert(bus); + assert(ret); + + d = new0(BusWaitForJobs, 1); + if (!d) + return -ENOMEM; + + d->bus = sd_bus_ref(bus); + + /* When we are a bus client we match by sender. Direct + * connections OTOH have no initialized sender field, and + * hence we ignore the sender then */ + r = sd_bus_add_match( + bus, + &d->slot_job_removed, + bus->bus_client ? + "type='signal'," + "sender='org.freedesktop.systemd1'," + "interface='org.freedesktop.systemd1.Manager'," + "member='JobRemoved'," + "path='/org/freedesktop/systemd1'" : + "type='signal'," + "interface='org.freedesktop.systemd1.Manager'," + "member='JobRemoved'," + "path='/org/freedesktop/systemd1'", + match_job_removed, d); + if (r < 0) + return r; + + r = sd_bus_add_match( + bus, + &d->slot_disconnected, + "type='signal'," + "sender='org.freedesktop.DBus.Local'," + "interface='org.freedesktop.DBus.Local'," + "member='Disconnected'", + match_disconnected, d); + if (r < 0) + return r; + + *ret = d; + d = NULL; + + return 0; +} + +static int bus_process_wait(sd_bus *bus) { + int r; + + for (;;) { + r = sd_bus_process(bus, NULL); + if (r < 0) + return r; + if (r > 0) + return 0; + + r = sd_bus_wait(bus, (uint64_t) -1); + if (r < 0) + return r; + } +} + +static int check_wait_response(BusWaitForJobs *d, bool quiet) { + int r = 0; + + assert(d->result); + + if (!quiet) { + if (streq(d->result, "canceled")) + log_error("Job for %s canceled.", strna(d->name)); + else if (streq(d->result, "timeout")) + log_error("Job for %s timed out.", strna(d->name)); + else if (streq(d->result, "dependency")) + log_error("A dependency job for %s failed. See 'journalctl -xe' for details.", strna(d->name)); + else if (streq(d->result, "invalid")) + log_error("Job for %s invalid.", strna(d->name)); + else if (streq(d->result, "assert")) + log_error("Assertion failed on job for %s.", strna(d->name)); + else if (streq(d->result, "unsupported")) + log_error("Operation on or unit type of %s not supported on this system.", strna(d->name)); + else if (!streq(d->result, "done") && !streq(d->result, "skipped")) { + if (d->name) { + bool quotes; + + quotes = chars_intersect(d->name, SHELL_NEED_QUOTES); + + log_error("Job for %s failed. See \"systemctl status %s%s%s\" and \"journalctl -xe\" for details.", + d->name, + quotes ? "'" : "", d->name, quotes ? "'" : ""); + } else + log_error("Job failed. See \"journalctl -xe\" for details."); + } + } + + if (streq(d->result, "canceled")) + r = -ECANCELED; + else if (streq(d->result, "timeout")) + r = -ETIME; + else if (streq(d->result, "dependency")) + r = -EIO; + else if (streq(d->result, "invalid")) + r = -ENOEXEC; + else if (streq(d->result, "assert")) + r = -EPROTO; + else if (streq(d->result, "unsupported")) + r = -ENOTSUP; + else if (!streq(d->result, "done") && !streq(d->result, "skipped")) + r = -EIO; + + return r; +} + +int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet) { + int r = 0; + + assert(d); + + while (!set_isempty(d->jobs)) { + int q; + + q = bus_process_wait(d->bus); + if (q < 0) + return log_error_errno(q, "Failed to wait for response: %m"); + + if (d->result) { + q = check_wait_response(d, quiet); + /* Return the first error as it is most likely to be + * meaningful. */ + if (q < 0 && r == 0) + r = q; + + errno = 0; + log_debug_errno(q, "Got result %s/%m for job %s", strna(d->result), strna(d->name)); + } + + free(d->name); + d->name = NULL; + + free(d->result); + d->result = NULL; + } + + return r; +} + +int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path) { + int r; + + assert(d); + + r = set_ensure_allocated(&d->jobs, &string_hash_ops); + if (r < 0) + return r; + + return set_put_strdup(d->jobs, path); +} + +int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet) { + const char *type, *path, *source; + int r; + + r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(sss)"); + if (r < 0) + return bus_log_parse_error(r); + + while ((r = sd_bus_message_read(m, "(sss)", &type, &path, &source)) > 0) { + if (!quiet) { + if (streq(type, "symlink")) + log_info("Created symlink from %s to %s.", path, source); + else + log_info("Removed symlink %s.", path); + } + } + if (r < 0) + return bus_log_parse_error(r); + + r = sd_bus_message_exit_container(m); + if (r < 0) + return bus_log_parse_error(r); + + return 0; +} diff --git a/src/libsystemd/sd-bus/bus-util.h b/src/libsystemd/sd-bus/bus-util.h index 696daa1f0..e8a97cef9 100644 --- a/src/libsystemd/sd-bus/bus-util.h +++ b/src/libsystemd/sd-bus/bus-util.h @@ -30,7 +30,7 @@ typedef enum BusTransport { BUS_TRANSPORT_LOCAL, BUS_TRANSPORT_REMOTE, - BUS_TRANSPORT_CONTAINER, + BUS_TRANSPORT_MACHINE, _BUS_TRANSPORT_MAX, _BUS_TRANSPORT_INVALID = -1 } BusTransport; @@ -201,3 +201,14 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_track*, sd_bus_track_unref); int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error); int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment); + +typedef struct BusWaitForJobs BusWaitForJobs; + +int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret); +void bus_wait_for_jobs_free(BusWaitForJobs *d); +int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path); +int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet); + +DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free); + +int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet); diff --git a/src/libsystemd/sd-bus/busctl-introspect.h b/src/libsystemd/sd-bus/busctl-introspect.h index 9bea43717..d6b4cf05a 100644 --- a/src/libsystemd/sd-bus/busctl-introspect.h +++ b/src/libsystemd/sd-bus/busctl-introspect.h @@ -22,6 +22,7 @@ ***/ #include +#include typedef struct XMLIntrospectOps { int (*on_path)(const char *path, void *userdata); diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c index dd6ae865b..d3c177201 100644 --- a/src/libsystemd/sd-bus/busctl.c +++ b/src/libsystemd/sd-bus/busctl.c @@ -28,6 +28,7 @@ #include "pager.h" #include "xml.h" #include "path-util.h" +#include "set.h" #include "sd-bus.h" #include "bus-message.h" @@ -159,7 +160,7 @@ static int list_bus_names(sd_bus *bus, char **argv) { r = sd_bus_get_name_creds( bus, *i, (arg_augment_creds ? SD_BUS_CREDS_AUGMENT : 0) | - SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_COMM| + SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_COMM| SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_SESSION| SD_BUS_CREDS_DESCRIPTION, &creds); if (r >= 0) { @@ -177,7 +178,7 @@ static int list_bus_names(sd_bus *bus, char **argv) { } else fputs(" - - ", stdout); - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r >= 0) { _cleanup_free_ char *u = NULL; @@ -255,8 +256,8 @@ static void print_subtree(const char *prefix, const char *path, char **l) { l++; } - vertical = strappenda(prefix, draw_special_char(DRAW_TREE_VERTICAL)); - space = strappenda(prefix, draw_special_char(DRAW_TREE_SPACE)); + vertical = strjoina(prefix, draw_special_char(DRAW_TREE_VERTICAL)); + space = strjoina(prefix, draw_special_char(DRAW_TREE_SPACE)); for (;;) { bool has_more = false; @@ -882,13 +883,19 @@ static int introspect(sd_bus *bus, char **argv) { int r; unsigned name_width, type_width, signature_width, result_width; Member **sorted = NULL; - unsigned k = 0, j; + unsigned k = 0, j, n_args; - if (strv_length(argv) != 3) { + n_args = strv_length(argv); + if (n_args < 3) { log_error("Requires service and object path argument."); return -EINVAL; } + if (n_args > 4) { + log_error("Too many arguments."); + return -EINVAL; + } + members = set_new(&member_hash_ops); if (!members) return log_oom(); @@ -917,6 +924,9 @@ static int introspect(sd_bus *bus, char **argv) { if (m->value) continue; + if (argv[3] && !streq(argv[3], m->interface)) + continue; + r = sd_bus_call_method(bus, argv[1], argv[2], "org.freedesktop.DBus.Properties", "GetAll", &error, &reply, "s", m->interface); if (r < 0) { log_error("%s", bus_error_message(&error, r)); @@ -994,6 +1004,10 @@ static int introspect(sd_bus *bus, char **argv) { sorted = newa(Member*, set_size(members)); SET_FOREACH(m, members, i) { + + if (argv[3] && !streq(argv[3], m->interface)) + continue; + if (m->interface) name_width = MAX(name_width, strlen(m->interface)); if (m->name) @@ -1013,7 +1027,6 @@ static int introspect(sd_bus *bus, char **argv) { if (result_width > 40) result_width = 40; - assert(k == set_size(members)); qsort(sorted, k, sizeof(Member*), member_compare_funcp); if (arg_legend) { @@ -1032,8 +1045,14 @@ static int introspect(sd_bus *bus, char **argv) { m = sorted[j]; + if (argv[3] && !streq(argv[3], m->interface)) + continue; + is_interface = streq(m->type, "interface"); + if (argv[3] && is_interface) + continue; + if (m->value) { ellipsized = ellipsize(m->value, result_width, 100); if (!ellipsized) @@ -1108,6 +1127,8 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL return log_error_errno(r, "Failed to add match: %m"); } + log_info("Monitoring bus message stream."); + for (;;) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL; @@ -1117,6 +1138,12 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL if (m) { dump(m, stdout); + + if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected") > 0) { + log_info("Connection terminated, exiting."); + return 0; + } + continue; } @@ -1685,7 +1712,7 @@ static int help(void) { " monitor [SERVICE...] Show bus traffic\n" " capture [SERVICE...] Capture bus traffic as pcap\n" " tree [SERVICE...] Show object tree of service\n" - " introspect SERVICE OBJECT\n" + " introspect SERVICE OBJECT [INTERFACE]\n" " call SERVICE OBJECT INTERFACE METHOD [SIGNATURE [ARGUMENT...]]\n" " Call a method\n" " get-property SERVICE OBJECT INTERFACE PROPERTY...\n" @@ -1835,7 +1862,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; @@ -2016,8 +2043,8 @@ int main(int argc, char *argv[]) { r = bus_set_address_system_remote(bus, arg_host); break; - case BUS_TRANSPORT_CONTAINER: - r = bus_set_address_system_container(bus, arg_host); + case BUS_TRANSPORT_MACHINE: + r = bus_set_address_system_machine(bus, arg_host); break; default: diff --git a/src/libsystemd/sd-bus/kdbus.h b/src/libsystemd/sd-bus/kdbus.h index e2262de6b..1cc475eb1 100644 --- a/src/libsystemd/sd-bus/kdbus.h +++ b/src/libsystemd/sd-bus/kdbus.h @@ -16,7 +16,7 @@ #define KDBUS_DST_ID_NAME (0) #define KDBUS_MATCH_ID_ANY (~0ULL) #define KDBUS_DST_ID_BROADCAST (~0ULL) -#define KDBUS_FLAG_KERNEL (1ULL << 63) +#define KDBUS_FLAG_NEGOTIATE (1ULL << 63) /** * struct kdbus_notify_id_change - name registry change message @@ -33,7 +33,7 @@ struct kdbus_notify_id_change { __u64 id; __u64 flags; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_notify_name_change - name registry change message @@ -53,7 +53,7 @@ struct kdbus_notify_name_change { struct kdbus_notify_id_change old_id; struct kdbus_notify_id_change new_id; char name[0]; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_creds - process credentials @@ -78,12 +78,13 @@ struct kdbus_creds { __u32 egid; __u32 sgid; __u32 fsgid; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_pids - process identifiers * @pid: Process ID * @tid: Thread ID + * @ppid: Parent process ID * * The PID and TID of a process. * @@ -93,7 +94,8 @@ struct kdbus_creds { struct kdbus_pids { __u64 pid; __u64 tid; -}; + __u64 ppid; +} __attribute__((__aligned__(8))); /** * struct kdbus_caps - process capabilities @@ -108,7 +110,7 @@ struct kdbus_pids { struct kdbus_caps { __u32 last_cap; __u32 caps[0]; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_audit - audit information @@ -121,7 +123,7 @@ struct kdbus_caps { struct kdbus_audit { __u32 sessionid; __u32 loginuid; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_timestamp @@ -136,7 +138,7 @@ struct kdbus_timestamp { __u64 seqnum; __u64 monotonic_ns; __u64 realtime_ns; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_vec - I/O vector for kdbus payload items @@ -154,7 +156,7 @@ struct kdbus_vec { __u64 address; __u64 offset; }; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_bloom_parameter - bus-wide bloom parameters @@ -164,7 +166,7 @@ struct kdbus_vec { struct kdbus_bloom_parameter { __u64 size; __u64 n_hash; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_bloom_filter - bloom filter containing n elements @@ -174,7 +176,7 @@ struct kdbus_bloom_parameter { struct kdbus_bloom_filter { __u64 generation; __u64 data[0]; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_memfd - a kdbus memfd @@ -191,7 +193,7 @@ struct kdbus_memfd { __u64 size; int fd; __u32 __pad; -}; +} __attribute__((__aligned__(8))); /** * struct kdbus_name - a registered well-known name with its flags @@ -204,6 +206,34 @@ struct kdbus_memfd { struct kdbus_name { __u64 flags; char name[0]; +} __attribute__((__aligned__(8))); + +/** + * enum kdbus_policy_access_type - permissions of a policy record + * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid + * @KDBUS_POLICY_ACCESS_USER: Grant access to a uid + * @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid + * @KDBUS_POLICY_ACCESS_WORLD: World-accessible + */ +enum kdbus_policy_access_type { + _KDBUS_POLICY_ACCESS_NULL, + KDBUS_POLICY_ACCESS_USER, + KDBUS_POLICY_ACCESS_GROUP, + KDBUS_POLICY_ACCESS_WORLD, +}; + +/** + * enum kdbus_policy_access_flags - mode flags + * @KDBUS_POLICY_OWN: Allow to own a well-known name + * Implies KDBUS_POLICY_TALK and KDBUS_POLICY_SEE + * @KDBUS_POLICY_TALK: Allow communication to a well-known name + * Implies KDBUS_POLICY_SEE + * @KDBUS_POLICY_SEE: Allow to see a well-known name + */ +enum kdbus_policy_type { + KDBUS_POLICY_SEE = 0, + KDBUS_POLICY_TALK, + KDBUS_POLICY_OWN, }; /** @@ -217,16 +247,59 @@ struct kdbus_policy_access { __u64 type; /* USER, GROUP, WORLD */ __u64 access; /* OWN, TALK, SEE */ __u64 id; /* uid, gid, 0 */ +} __attribute__((__aligned__(8))); + +/** + * enum kdbus_attach_flags - flags for metadata attachments + * @KDBUS_ATTACH_TIMESTAMP: Timestamp + * @KDBUS_ATTACH_CREDS: Credentials + * @KDBUS_ATTACH_PIDS: PIDs + * @KDBUS_ATTACH_AUXGROUPS: Auxiliary groups + * @KDBUS_ATTACH_NAMES: Well-known names + * @KDBUS_ATTACH_TID_COMM: The "comm" process identifier of the TID + * @KDBUS_ATTACH_PID_COMM: The "comm" process identifier of the PID + * @KDBUS_ATTACH_EXE: The path of the executable + * @KDBUS_ATTACH_CMDLINE: The process command line + * @KDBUS_ATTACH_CGROUP: The croup membership + * @KDBUS_ATTACH_CAPS: The process capabilities + * @KDBUS_ATTACH_SECLABEL: The security label + * @KDBUS_ATTACH_AUDIT: The audit IDs + * @KDBUS_ATTACH_CONN_DESCRIPTION: The human-readable connection name + * @_KDBUS_ATTACH_ALL: All of the above + * @_KDBUS_ATTACH_ANY: Wildcard match to enable any kind of + * metatdata. + */ +enum kdbus_attach_flags { + KDBUS_ATTACH_TIMESTAMP = 1ULL << 0, + KDBUS_ATTACH_CREDS = 1ULL << 1, + KDBUS_ATTACH_PIDS = 1ULL << 2, + KDBUS_ATTACH_AUXGROUPS = 1ULL << 3, + KDBUS_ATTACH_NAMES = 1ULL << 4, + KDBUS_ATTACH_TID_COMM = 1ULL << 5, + KDBUS_ATTACH_PID_COMM = 1ULL << 6, + KDBUS_ATTACH_EXE = 1ULL << 7, + KDBUS_ATTACH_CMDLINE = 1ULL << 8, + KDBUS_ATTACH_CGROUP = 1ULL << 9, + KDBUS_ATTACH_CAPS = 1ULL << 10, + KDBUS_ATTACH_SECLABEL = 1ULL << 11, + KDBUS_ATTACH_AUDIT = 1ULL << 12, + KDBUS_ATTACH_CONN_DESCRIPTION = 1ULL << 13, + _KDBUS_ATTACH_ALL = (1ULL << 14) - 1, + _KDBUS_ATTACH_ANY = ~0ULL }; /** * enum kdbus_item_type - item types to chain data in a list * @_KDBUS_ITEM_NULL: Uninitialized/invalid * @_KDBUS_ITEM_USER_BASE: Start of user items + * @KDBUS_ITEM_NEGOTIATE: Negotiate supported items * @KDBUS_ITEM_PAYLOAD_VEC: Vector to data * @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head * @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd * @KDBUS_ITEM_FDS: Attached file descriptors + * @KDBUS_ITEM_CANCEL_FD: FD used to cancel a synchronous + * operation by writing to it from + * userspace * @KDBUS_ITEM_BLOOM_PARAMETER: Bus-wide bloom parameters, used with * KDBUS_CMD_BUS_MAKE, carries a * struct kdbus_bloom_parameter @@ -286,10 +359,12 @@ struct kdbus_policy_access { enum kdbus_item_type { _KDBUS_ITEM_NULL, _KDBUS_ITEM_USER_BASE, - KDBUS_ITEM_PAYLOAD_VEC = _KDBUS_ITEM_USER_BASE, + KDBUS_ITEM_NEGOTIATE = _KDBUS_ITEM_USER_BASE, + KDBUS_ITEM_PAYLOAD_VEC, KDBUS_ITEM_PAYLOAD_OFF, KDBUS_ITEM_PAYLOAD_MEMFD, KDBUS_ITEM_FDS, + KDBUS_ITEM_CANCEL_FD, KDBUS_ITEM_BLOOM_PARAMETER, KDBUS_ITEM_BLOOM_FILTER, KDBUS_ITEM_BLOOM_MASK, @@ -379,38 +454,42 @@ struct kdbus_item { struct kdbus_notify_id_change id_change; struct kdbus_policy_access policy_access; }; -}; +} __attribute__((__aligned__(8))); + +/** + * struct kdbus_item_list - A list of items + * @size: The total size of the structure + * @items: Array of items + */ +struct kdbus_item_list { + __u64 size; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); /** * enum kdbus_msg_flags - type of message - * @KDBUS_MSG_FLAGS_EXPECT_REPLY: Expect a reply message, used for - * method calls. The userspace-supplied - * cookie identifies the message and the - * respective reply carries the cookie - * in cookie_reply - * @KDBUS_MSG_FLAGS_SYNC_REPLY: Wait for destination connection to - * reply to this message. The - * KDBUS_CMD_MSG_SEND ioctl() will block - * until the reply is received, and - * offset_reply in struct kdbus_msg will - * yield the offset in the sender's pool - * where the reply can be found. - * This flag is only valid if - * @KDBUS_MSG_FLAGS_EXPECT_REPLY is set as - * well. - * @KDBUS_MSG_FLAGS_NO_AUTO_START: Do not start a service, if the addressed - * name is not currently active + * @KDBUS_MSG_EXPECT_REPLY: Expect a reply message, used for + * method calls. The userspace-supplied + * cookie identifies the message and the + * respective reply carries the cookie + * in cookie_reply + * @KDBUS_MSG_NO_AUTO_START: Do not start a service, if the addressed + * name is not currently active + * @KDBUS_MSG_SIGNAL: Treat this message as signal */ enum kdbus_msg_flags { - KDBUS_MSG_FLAGS_EXPECT_REPLY = 1ULL << 0, - KDBUS_MSG_FLAGS_SYNC_REPLY = 1ULL << 1, - KDBUS_MSG_FLAGS_NO_AUTO_START = 1ULL << 2, + KDBUS_MSG_EXPECT_REPLY = 1ULL << 0, + KDBUS_MSG_NO_AUTO_START = 1ULL << 1, + KDBUS_MSG_SIGNAL = 1ULL << 2, }; /** * enum kdbus_payload_type - type of payload carried by message * @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus" + * + * Any payload-type is accepted. Common types will get added here once + * established. */ enum kdbus_payload_type { KDBUS_PAYLOAD_KERNEL, @@ -420,8 +499,7 @@ enum kdbus_payload_type { /** * struct kdbus_msg - the representation of a kdbus message * @size: Total size of the message - * @flags: Message flags (KDBUS_MSG_FLAGS_*), userspace → kernel - * @kernel_flags: Supported message flags, kernel → userspace + * @flags: Message flags (KDBUS_MSG_*), userspace → kernel * @priority: Message queue priority value * @dst_id: 64-bit ID of the destination connection * @src_id: 64-bit ID of the source connection @@ -436,15 +514,11 @@ enum kdbus_payload_type { * @cookie_reply: A reply to the requesting message with the same * cookie. The requesting connection can match its * request and the reply with this value - * @offset_reply: If KDBUS_MSG_FLAGS_EXPECT_REPLY, this field will - * contain the offset in the sender's pool where the - * reply is stored. * @items: A list of kdbus_items containing the message payload */ struct kdbus_msg { __u64 size; __u64 flags; - __u64 kernel_flags; __s64 priority; __u64 dst_id; __u64 src_id; @@ -453,10 +527,56 @@ struct kdbus_msg { union { __u64 timeout_ns; __u64 cookie_reply; - __u64 offset_reply; }; struct kdbus_item items[0]; -} __attribute__((aligned(8))); +} __attribute__((__aligned__(8))); + +/** + * struct kdbus_msg_info - returned message container + * @offset: Offset of kdbus_msg slice in pool + * @msg_size: Copy of the kdbus_msg.size field + * @return_flags: Command return flags, kernel → userspace + */ +struct kdbus_msg_info { + __u64 offset; + __u64 msg_size; + __u64 return_flags; +} __attribute__((__aligned__(8))); + +/** + * enum kdbus_send_flags - flags for sending messages + * @KDBUS_SEND_SYNC_REPLY: Wait for destination connection to + * reply to this message. The + * KDBUS_CMD_SEND ioctl() will block + * until the reply is received, and + * offset_reply in struct kdbus_msg will + * yield the offset in the sender's pool + * where the reply can be found. + * This flag is only valid if + * @KDBUS_MSG_EXPECT_REPLY is set as well. + */ +enum kdbus_send_flags { + KDBUS_SEND_SYNC_REPLY = 1ULL << 0, +}; + +/** + * struct kdbus_cmd_send - send message + * @size: Overall size of this structure + * @flags: Flags to change send behavior (KDBUS_SEND_*) + * @return_flags: Command return flags, kernel → userspace + * @msg_address: Storage address of the kdbus_msg to send + * @reply: Storage for message reply if KDBUS_SEND_SYNC_REPLY + * was given + * @items: Additional items for this command + */ +struct kdbus_cmd_send { + __u64 size; + __u64 flags; + __u64 return_flags; + __u64 msg_address; + struct kdbus_msg_info reply; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); /** * enum kdbus_recv_flags - flags for de-queuing messages @@ -477,93 +597,60 @@ enum kdbus_recv_flags { KDBUS_RECV_USE_PRIORITY = 1ULL << 2, }; +/** + * enum kdbus_recv_return_flags - return flags for message receive commands + * @KDBUS_RECV_RETURN_INCOMPLETE_FDS: One or more file descriptors could not + * be installed. These descriptors in + * KDBUS_ITEM_FDS will carry the value -1. + */ +enum kdbus_recv_return_flags { + KDBUS_RECV_RETURN_INCOMPLETE_FDS = 1ULL << 0, +}; + /** * struct kdbus_cmd_recv - struct to de-queue a buffered message + * @size: Overall size of this object * @flags: KDBUS_RECV_* flags, userspace → kernel - * @kernel_flags: Supported KDBUS_RECV_* flags, kernel → userspace + * @return_flags: Command return flags, kernel → userspace * @priority: Minimum priority of the messages to de-queue. Lowest * values have the highest priority. - * @offset: Returned offset in the pool where the message is - * stored. The user must use KDBUS_CMD_FREE to free - * the allocated memory. - * @dropped_msgs: In case the KDBUS_CMD_MSG_RECV ioctl returns + * @dropped_msgs: In case the KDBUS_CMD_RECV ioctl returns * -EOVERFLOW, this field will contain the number of * broadcast messages that have been lost since the * last call. - * @msg_size: Filled by the kernel with the actual message size. This - * is the full size of the slice placed at @offset. It - * includes the memory used for the kdbus_msg object, but - * also for all appended VECs. By using @msg_size and - * @offset, you can map a single message, instead of - * mapping the whole pool. + * @msg: Return storage for received message. + * @items: Additional items for this command. * - * This struct is used with the KDBUS_CMD_MSG_RECV ioctl. + * This struct is used with the KDBUS_CMD_RECV ioctl. */ struct kdbus_cmd_recv { + __u64 size; __u64 flags; - __u64 kernel_flags; + __u64 return_flags; __s64 priority; - union { - __u64 offset; - __u64 dropped_msgs; - }; - __u64 msg_size; -} __attribute__((aligned(8))); - -/** - * struct kdbus_cmd_cancel - struct to cancel a synchronously pending message - * @cookie: The cookie of the pending message - * @flags: Flags for the free command. Currently unused. - * - * This struct is used with the KDBUS_CMD_CANCEL ioctl. - */ -struct kdbus_cmd_cancel { - __u64 cookie; - __u64 flags; -} __attribute__((aligned(8))); + __u64 dropped_msgs; + struct kdbus_msg_info msg; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); /** * struct kdbus_cmd_free - struct to free a slice of memory in the pool + * @size: Overall size of this structure + * @flags: Flags for the free command, userspace → kernel + * @return_flags: Command return flags, kernel → userspace * @offset: The offset of the memory slice, as returned by other * ioctls - * @flags: Flags for the free command, userspace → kernel - * @kernel_flags: Supported flags of the free command, userspace → kernel + * @items: Additional items to modify the behavior * * This struct is used with the KDBUS_CMD_FREE ioctl. */ struct kdbus_cmd_free { - __u64 offset; + __u64 size; __u64 flags; - __u64 kernel_flags; -} __attribute__((aligned(8))); - -/** - * enum kdbus_policy_access_type - permissions of a policy record - * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid - * @KDBUS_POLICY_ACCESS_USER: Grant access to a uid - * @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid - * @KDBUS_POLICY_ACCESS_WORLD: World-accessible - */ -enum kdbus_policy_access_type { - _KDBUS_POLICY_ACCESS_NULL, - KDBUS_POLICY_ACCESS_USER, - KDBUS_POLICY_ACCESS_GROUP, - KDBUS_POLICY_ACCESS_WORLD, -}; - -/** - * enum kdbus_policy_access_flags - mode flags - * @KDBUS_POLICY_OWN: Allow to own a well-known name - * Implies KDBUS_POLICY_TALK and KDBUS_POLICY_SEE - * @KDBUS_POLICY_TALK: Allow communication to a well-known name - * Implies KDBUS_POLICY_SEE - * @KDBUS_POLICY_SEE: Allow to see a well-known name - */ -enum kdbus_policy_type { - KDBUS_POLICY_SEE = 0, - KDBUS_POLICY_TALK, - KDBUS_POLICY_OWN, -}; + __u64 return_flags; + __u64 offset; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); /** * enum kdbus_hello_flags - flags for struct kdbus_cmd_hello @@ -576,65 +663,23 @@ enum kdbus_policy_type { * policy entries for a name. The provided name * is not activated and not registered with the * name database, it only allows unprivileged - * connections to aquire a name, talk or discover + * connections to acquire a name, talk or discover * a service * @KDBUS_HELLO_MONITOR: Special-purpose connection to monitor * bus traffic - * @KDBUS_HELLO_UNPRIVILEGED: Don't treat this connection as privileged once - * the bus connection was established. */ enum kdbus_hello_flags { KDBUS_HELLO_ACCEPT_FD = 1ULL << 0, KDBUS_HELLO_ACTIVATOR = 1ULL << 1, KDBUS_HELLO_POLICY_HOLDER = 1ULL << 2, KDBUS_HELLO_MONITOR = 1ULL << 3, - KDBUS_HELLO_UNPRIVILEGED = 1ULL << 4, -}; - -/** - * enum kdbus_attach_flags - flags for metadata attachments - * @KDBUS_ATTACH_TIMESTAMP: Timestamp - * @KDBUS_ATTACH_CREDS: Credentials - * @KDBUS_ATTACH_PIDS: PIDs - * @KDBUS_ATTACH_AUXGROUPS: Auxiliary groups - * @KDBUS_ATTACH_NAMES: Well-known names - * @KDBUS_ATTACH_TID_COMM: The "comm" process identifier of the TID - * @KDBUS_ATTACH_PID_COMM: The "comm" process identifier of the PID - * @KDBUS_ATTACH_EXE: The path of the executable - * @KDBUS_ATTACH_CMDLINE: The process command line - * @KDBUS_ATTACH_CGROUP: The croup membership - * @KDBUS_ATTACH_CAPS: The process capabilities - * @KDBUS_ATTACH_SECLABEL: The security label - * @KDBUS_ATTACH_AUDIT: The audit IDs - * @KDBUS_ATTACH_CONN_DESCRIPTION: The human-readable connection name - * @_KDBUS_ATTACH_ALL: All of the above - * @_KDBUS_ATTACH_ANY: Wildcard match to enable any kind of - * metatdata. - */ -enum kdbus_attach_flags { - KDBUS_ATTACH_TIMESTAMP = 1ULL << 0, - KDBUS_ATTACH_CREDS = 1ULL << 1, - KDBUS_ATTACH_PIDS = 1ULL << 2, - KDBUS_ATTACH_AUXGROUPS = 1ULL << 3, - KDBUS_ATTACH_NAMES = 1ULL << 4, - KDBUS_ATTACH_TID_COMM = 1ULL << 5, - KDBUS_ATTACH_PID_COMM = 1ULL << 6, - KDBUS_ATTACH_EXE = 1ULL << 7, - KDBUS_ATTACH_CMDLINE = 1ULL << 8, - KDBUS_ATTACH_CGROUP = 1ULL << 9, - KDBUS_ATTACH_CAPS = 1ULL << 10, - KDBUS_ATTACH_SECLABEL = 1ULL << 11, - KDBUS_ATTACH_AUDIT = 1ULL << 12, - KDBUS_ATTACH_CONN_DESCRIPTION = 1ULL << 13, - _KDBUS_ATTACH_ALL = (1ULL << 14) - 1, - _KDBUS_ATTACH_ANY = ~0ULL }; /** * struct kdbus_cmd_hello - struct to say hello to kdbus * @size: The total size of the structure * @flags: Connection flags (KDBUS_HELLO_*), userspace → kernel - * @kernel_flags: Supported connection flags, kernel → userspace + * @return_flags: Command return flags, kernel → userspace * @attach_flags_send: Mask of metadata to attach to each message sent * off by this connection (KDBUS_ATTACH_*) * @attach_flags_recv: Mask of metadata to attach to each message receieved @@ -646,8 +691,10 @@ enum kdbus_attach_flags { * @id: The ID of this connection (kernel → userspace) * @pool_size: Size of the connection's buffer where the received * messages are placed - * @bloom: The bloom properties of the bus, specified - * by the bus creator (kernel → userspace) + * @offset: Pool offset where additional items of type + * kdbus_item_list are stored. They contain information + * about the bus and the newly created connection. + * @items_size: Copy of item_list.size stored in @offset. * @id128: Unique 128-bit ID of the bus (kernel → userspace) * @items: A list of items * @@ -656,147 +703,77 @@ enum kdbus_attach_flags { struct kdbus_cmd_hello { __u64 size; __u64 flags; - __u64 kernel_flags; + __u64 return_flags; __u64 attach_flags_send; __u64 attach_flags_recv; __u64 bus_flags; __u64 id; __u64 pool_size; - struct kdbus_bloom_parameter bloom; + __u64 offset; + __u64 items_size; __u8 id128[16]; struct kdbus_item items[0]; -} __attribute__((aligned(8))); - -/** - * enum kdbus_make_flags - Flags for KDBUS_CMD_{BUS,EP,NS}_MAKE - * @KDBUS_MAKE_ACCESS_GROUP: Make the bus or endpoint node group-accessible - * @KDBUS_MAKE_ACCESS_WORLD: Make the bus or endpoint node world-accessible - */ -enum kdbus_make_flags { - KDBUS_MAKE_ACCESS_GROUP = 1ULL << 0, - KDBUS_MAKE_ACCESS_WORLD = 1ULL << 1, -}; +} __attribute__((__aligned__(8))); /** - * struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain - * @size: The total size of the struct - * @flags: Properties for the bus/ep/domain to create, - * userspace → kernel - * @kernel_flags: Supported flags for the used command, kernel → userspace - * @items: Items describing details + * struct kdbus_info - connection information + * @size: total size of the struct + * @id: 64bit object ID + * @flags: object creation flags + * @items: list of items * - * This structure is used with the KDBUS_CMD_BUS_MAKE and - * KDBUS_CMD_ENDPOINT_MAKE ioctls. - */ -struct kdbus_cmd_make { - __u64 size; - __u64 flags; - __u64 kernel_flags; - struct kdbus_item items[0]; -} __attribute__((aligned(8))); - -/** - * enum kdbus_name_flags - properties of a well-known name - * @KDBUS_NAME_REPLACE_EXISTING: Try to replace name of other connections - * @KDBUS_NAME_ALLOW_REPLACEMENT: Allow the replacement of the name - * @KDBUS_NAME_QUEUE: Name should be queued if busy - * @KDBUS_NAME_IN_QUEUE: Name is queued - * @KDBUS_NAME_ACTIVATOR: Name is owned by a activator connection - */ -enum kdbus_name_flags { - KDBUS_NAME_REPLACE_EXISTING = 1ULL << 0, - KDBUS_NAME_ALLOW_REPLACEMENT = 1ULL << 1, - KDBUS_NAME_QUEUE = 1ULL << 2, - KDBUS_NAME_IN_QUEUE = 1ULL << 3, - KDBUS_NAME_ACTIVATOR = 1ULL << 4, -}; - -/** - * struct kdbus_cmd_name - struct to describe a well-known name - * @size: The total size of the struct - * @flags: Flags for a name entry (KDBUS_NAME_*), - * userspace → kernel, kernel → userspace - * @kernel_flags: Supported flags for a name entry, kernel → userspace - * @items: Item list, containing the well-known name as - * KDBUS_ITEM_NAME - * - * This structure is used with the KDBUS_CMD_NAME_ACQUIRE ioctl. + * Note that the user is responsible for freeing the allocated memory with + * the KDBUS_CMD_FREE ioctl. */ -struct kdbus_cmd_name { +struct kdbus_info { __u64 size; + __u64 id; __u64 flags; - __u64 kernel_flags; struct kdbus_item items[0]; -} __attribute__((aligned(8))); +} __attribute__((__aligned__(8))); /** - * struct kdbus_name_info - struct to describe a well-known name - * @size: The total size of the struct - * @conn_flags: The flags of the owning connection (KDBUS_HELLO_*) - * @owner_id: The current owner of the name - * @items: Item list, containing the well-known name as - * KDBUS_ITEM_OWNED_NAME - * - * This structure is used as return struct for the KDBUS_CMD_NAME_LIST ioctl. + * enum kdbus_list_flags - what to include into the returned list + * @KDBUS_LIST_UNIQUE: active connections + * @KDBUS_LIST_ACTIVATORS: activator connections + * @KDBUS_LIST_NAMES: known well-known names + * @KDBUS_LIST_QUEUED: queued-up names */ -struct kdbus_name_info { - __u64 size; - __u64 conn_flags; - __u64 owner_id; - struct kdbus_item items[0]; -} __attribute__((aligned(8))); - -/** - * enum kdbus_name_list_flags - what to include into the returned list - * @KDBUS_NAME_LIST_UNIQUE: All active connections - * @KDBUS_NAME_LIST_NAMES: All known well-known names - * @KDBUS_NAME_LIST_ACTIVATORS: All activator connections - * @KDBUS_NAME_LIST_QUEUED: All queued-up names - */ -enum kdbus_name_list_flags { - KDBUS_NAME_LIST_UNIQUE = 1ULL << 0, - KDBUS_NAME_LIST_NAMES = 1ULL << 1, - KDBUS_NAME_LIST_ACTIVATORS = 1ULL << 2, - KDBUS_NAME_LIST_QUEUED = 1ULL << 3, +enum kdbus_list_flags { + KDBUS_LIST_UNIQUE = 1ULL << 0, + KDBUS_LIST_NAMES = 1ULL << 1, + KDBUS_LIST_ACTIVATORS = 1ULL << 2, + KDBUS_LIST_QUEUED = 1ULL << 3, }; /** - * struct kdbus_cmd_name_list - request a list of name entries - * @flags: Flags for the query (KDBUS_NAME_LIST_*), - * userspace → kernel - * @kernel_flags: Supported flags for queries, kernel → userspace - * @offset: The returned offset in the caller's pool buffer. + * struct kdbus_cmd_list - list connections + * @size: overall size of this object + * @flags: flags for the query (KDBUS_LIST_*), userspace → kernel + * @return_flags: command return flags, kernel → userspace + * @offset: Offset in the caller's pool buffer where an array of + * kdbus_info objects is stored. * The user must use KDBUS_CMD_FREE to free the * allocated memory. - * @size: Output buffer to report size of data at @offset. + * @list_size: size of returned list in bytes + * @items: Items for the command. Reserved for future use. * - * This structure is used with the KDBUS_CMD_NAME_LIST ioctl. + * This structure is used with the KDBUS_CMD_LIST ioctl. */ -struct kdbus_cmd_name_list { +struct kdbus_cmd_list { + __u64 size; __u64 flags; - __u64 kernel_flags; + __u64 return_flags; __u64 offset; - __u64 size; -} __attribute__((aligned(8))); - -/** - * struct kdbus_name_list - information returned by KDBUS_CMD_NAME_LIST - * @size: The total size of the structure - * @names: A list of names - * - * Note that the user is responsible for freeing the allocated memory with - * the KDBUS_CMD_FREE ioctl. - */ -struct kdbus_name_list { - __u64 size; - struct kdbus_name_info names[0]; -}; + __u64 list_size; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); /** * struct kdbus_cmd_info - struct used for KDBUS_CMD_CONN_INFO ioctl * @size: The total size of the struct * @flags: KDBUS_ATTACH_* flags, userspace → kernel - * @kernel_flags: Supported KDBUS_ATTACH_* flags, kernel → userspace + * @return_flags: Command return flags, kernel → userspace * @id: The 64-bit ID of the connection. If set to zero, passing * @name is required. kdbus will look up the name to * determine the ID in this case. @@ -815,45 +792,12 @@ struct kdbus_name_list { struct kdbus_cmd_info { __u64 size; __u64 flags; - __u64 kernel_flags; + __u64 return_flags; __u64 id; __u64 offset; __u64 info_size; struct kdbus_item items[0]; -} __attribute__((aligned(8))); - -/** - * struct kdbus_info - information returned by KDBUS_CMD_*_INFO - * @size: The total size of the struct - * @id: The connection's or bus' 64-bit ID - * @flags: The connection's or bus' flags - * @items: A list of struct kdbus_item - * - * Note that the user is responsible for freeing the allocated memory with - * the KDBUS_CMD_FREE ioctl. - */ -struct kdbus_info { - __u64 size; - __u64 id; - __u64 flags; - struct kdbus_item items[0]; -}; - -/** - * struct kdbus_cmd_update - update flags of a connection - * @size: The total size of the struct - * @flags: Flags for the update command, userspace → kernel - * @kernel_flags: Supported flags for this command, kernel → userspace - * @items: A list of struct kdbus_item - * - * This struct is used with the KDBUS_CMD_CONN_UPDATE ioctl. - */ -struct kdbus_cmd_update { - __u64 size; - __u64 flags; - __u64 kernel_flags; - struct kdbus_item items[0]; -} __attribute__((aligned(8))); +} __attribute__((__aligned__(8))); /** * enum kdbus_cmd_match_flags - flags to control the KDBUS_CMD_MATCH_ADD ioctl @@ -868,11 +812,11 @@ enum kdbus_cmd_match_flags { /** * struct kdbus_cmd_match - struct to add or remove matches * @size: The total size of the struct - * @cookie: Userspace supplied cookie. When removing, the cookie - * identifies the match to remove * @flags: Flags for match command (KDBUS_MATCH_*), * userspace → kernel - * @kernel_flags: Supported flags of the used command, kernel → userspace + * @return_flags: Command return flags, kernel → userspace + * @cookie: Userspace supplied cookie. When removing, the cookie + * identifies the match to remove * @items: A list of items for additional information * * This structure is used with the KDBUS_CMD_MATCH_ADD and @@ -880,101 +824,150 @@ enum kdbus_cmd_match_flags { */ struct kdbus_cmd_match { __u64 size; + __u64 flags; + __u64 return_flags; __u64 cookie; + struct kdbus_item items[0]; +} __attribute__((__aligned__(8))); + +/** + * enum kdbus_make_flags - Flags for KDBUS_CMD_{BUS,ENDPOINT}_MAKE + * @KDBUS_MAKE_ACCESS_GROUP: Make the bus or endpoint node group-accessible + * @KDBUS_MAKE_ACCESS_WORLD: Make the bus or endpoint node world-accessible + */ +enum kdbus_make_flags { + KDBUS_MAKE_ACCESS_GROUP = 1ULL << 0, + KDBUS_MAKE_ACCESS_WORLD = 1ULL << 1, +}; + +/** + * enum kdbus_name_flags - flags for KDBUS_CMD_NAME_ACQUIRE + * @KDBUS_NAME_REPLACE_EXISTING: Try to replace name of other connections + * @KDBUS_NAME_ALLOW_REPLACEMENT: Allow the replacement of the name + * @KDBUS_NAME_QUEUE: Name should be queued if busy + * @KDBUS_NAME_IN_QUEUE: Name is queued + * @KDBUS_NAME_ACTIVATOR: Name is owned by a activator connection + */ +enum kdbus_name_flags { + KDBUS_NAME_REPLACE_EXISTING = 1ULL << 0, + KDBUS_NAME_ALLOW_REPLACEMENT = 1ULL << 1, + KDBUS_NAME_QUEUE = 1ULL << 2, + KDBUS_NAME_IN_QUEUE = 1ULL << 3, + KDBUS_NAME_ACTIVATOR = 1ULL << 4, +}; + +/** + * struct kdbus_cmd - generic ioctl payload + * @size: Overall size of this structure + * @flags: Flags for this ioctl, userspace → kernel + * @return_flags: Ioctl return flags, kernel → userspace + * @items: Additional items to modify the behavior + * + * This is a generic ioctl payload object. It's used by all ioctls that only + * take flags and items as input. + */ +struct kdbus_cmd { + __u64 size; __u64 flags; - __u64 kernel_flags; + __u64 return_flags; struct kdbus_item items[0]; -} __attribute__((aligned(8))); +} __attribute__((__aligned__(8))); /** * Ioctl API + * * KDBUS_CMD_BUS_MAKE: After opening the "control" node, this command * creates a new bus with the specified * name. The bus is immediately shut down and * cleaned up when the opened file descriptor is * closed. + * * KDBUS_CMD_ENDPOINT_MAKE: Creates a new named special endpoint to talk to * the bus. Such endpoints usually carry a more * restrictive policy and grant restricted access * to specific applications. + * KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used + * to update the policy. + * * KDBUS_CMD_HELLO: By opening the bus node, a connection is * created. After a HELLO the opened connection * becomes an active peer on the bus. + * KDBUS_CMD_UPDATE: Update the properties of a connection. Used to + * update the metadata subscription mask and + * policy. * KDBUS_CMD_BYEBYE: Disconnect a connection. If there are no * messages queued up in the connection's pool, * the call succeeds, and the handle is rendered * unusable. Otherwise, -EBUSY is returned without * any further side-effects. - * KDBUS_CMD_MSG_SEND: Send a message and pass data from userspace to - * the kernel. - * KDBUS_CMD_MSG_RECV: Receive a message from the kernel which is - * placed in the receiver's pool. - * KDBUS_CMD_MSG_CANCEL: Cancel a pending request of a message that - * blocks while waiting for a reply. The parameter - * denotes the cookie of the message in flight. * KDBUS_CMD_FREE: Release the allocated memory in the receiver's * pool. - * KDBUS_CMD_NAME_ACQUIRE: Request a well-known bus name to associate with - * the connection. Well-known names are used to - * address a peer on the bus. - * KDBUS_CMD_NAME_RELEASE: Release a well-known name the connection - * currently owns. - * KDBUS_CMD_NAME_LIST: Retrieve the list of all currently registered - * well-known and unique names. * KDBUS_CMD_CONN_INFO: Retrieve credentials and properties of the * initial creator of the connection. The data was * stored at registration time and does not * necessarily represent the connected process or * the actual state of the process. - * KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used to - * update the metadata subscription mask and - * policy. * KDBUS_CMD_BUS_CREATOR_INFO: Retrieve information of the creator of the bus * a connection is attached to. - * KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used - * to update the policy. - * KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should + * + * KDBUS_CMD_SEND: Send a message and pass data from userspace to + * the kernel. + * KDBUS_CMD_RECV: Receive a message from the kernel which is + * placed in the receiver's pool. + * + * KDBUS_CMD_NAME_ACQUIRE: Request a well-known bus name to associate with + * the connection. Well-known names are used to + * address a peer on the bus. + * KDBUS_CMD_NAME_RELEASE: Release a well-known name the connection + * currently owns. + * KDBUS_CMD_LIST: Retrieve the list of all currently registered + * well-known and unique names. + * + * KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should * be delivered to the connection. * KDBUS_CMD_MATCH_REMOVE: Remove a current match for broadcast messages. */ -#define KDBUS_CMD_BUS_MAKE _IOW(KDBUS_IOCTL_MAGIC, 0x00, \ - struct kdbus_cmd_make) -#define KDBUS_CMD_ENDPOINT_MAKE _IOW(KDBUS_IOCTL_MAGIC, 0x10, \ - struct kdbus_cmd_make) - -#define KDBUS_CMD_HELLO _IOWR(KDBUS_IOCTL_MAGIC, 0x20, \ - struct kdbus_cmd_hello) -#define KDBUS_CMD_BYEBYE _IO(KDBUS_IOCTL_MAGIC, 0x21) \ - -#define KDBUS_CMD_MSG_SEND _IOWR(KDBUS_IOCTL_MAGIC, 0x30, \ - struct kdbus_msg) -#define KDBUS_CMD_MSG_RECV _IOWR(KDBUS_IOCTL_MAGIC, 0x31, \ - struct kdbus_cmd_recv) -#define KDBUS_CMD_MSG_CANCEL _IOW(KDBUS_IOCTL_MAGIC, 0x32, \ - struct kdbus_cmd_cancel) -#define KDBUS_CMD_FREE _IOW(KDBUS_IOCTL_MAGIC, 0x33, \ - struct kdbus_cmd_free) - -#define KDBUS_CMD_NAME_ACQUIRE _IOWR(KDBUS_IOCTL_MAGIC, 0x40, \ - struct kdbus_cmd_name) -#define KDBUS_CMD_NAME_RELEASE _IOW(KDBUS_IOCTL_MAGIC, 0x41, \ - struct kdbus_cmd_name) -#define KDBUS_CMD_NAME_LIST _IOWR(KDBUS_IOCTL_MAGIC, 0x42, \ - struct kdbus_cmd_name_list) - -#define KDBUS_CMD_CONN_INFO _IOWR(KDBUS_IOCTL_MAGIC, 0x50, \ - struct kdbus_cmd_info) -#define KDBUS_CMD_CONN_UPDATE _IOW(KDBUS_IOCTL_MAGIC, 0x51, \ - struct kdbus_cmd_update) -#define KDBUS_CMD_BUS_CREATOR_INFO _IOWR(KDBUS_IOCTL_MAGIC, 0x52, \ - struct kdbus_cmd_info) - -#define KDBUS_CMD_ENDPOINT_UPDATE _IOW(KDBUS_IOCTL_MAGIC, 0x61, \ - struct kdbus_cmd_update) - -#define KDBUS_CMD_MATCH_ADD _IOW(KDBUS_IOCTL_MAGIC, 0x70, \ - struct kdbus_cmd_match) -#define KDBUS_CMD_MATCH_REMOVE _IOW(KDBUS_IOCTL_MAGIC, 0x71, \ - struct kdbus_cmd_match) +enum kdbus_ioctl_type { + /* bus owner (00-0f) */ + KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x00, + struct kdbus_cmd), + + /* endpoint owner (10-1f) */ + KDBUS_CMD_ENDPOINT_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10, + struct kdbus_cmd), + KDBUS_CMD_ENDPOINT_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x11, + struct kdbus_cmd), + + /* connection owner (80-ff) */ + KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x80, + struct kdbus_cmd_hello), + KDBUS_CMD_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x81, + struct kdbus_cmd), + KDBUS_CMD_BYEBYE = _IOW(KDBUS_IOCTL_MAGIC, 0x82, + struct kdbus_cmd), + KDBUS_CMD_FREE = _IOW(KDBUS_IOCTL_MAGIC, 0x83, + struct kdbus_cmd_free), + KDBUS_CMD_CONN_INFO = _IOR(KDBUS_IOCTL_MAGIC, 0x84, + struct kdbus_cmd_info), + KDBUS_CMD_BUS_CREATOR_INFO = _IOR(KDBUS_IOCTL_MAGIC, 0x85, + struct kdbus_cmd_info), + KDBUS_CMD_LIST = _IOR(KDBUS_IOCTL_MAGIC, 0x86, + struct kdbus_cmd_list), + + KDBUS_CMD_SEND = _IOW(KDBUS_IOCTL_MAGIC, 0x90, + struct kdbus_cmd_send), + KDBUS_CMD_RECV = _IOR(KDBUS_IOCTL_MAGIC, 0x91, + struct kdbus_cmd_recv), + + KDBUS_CMD_NAME_ACQUIRE = _IOW(KDBUS_IOCTL_MAGIC, 0xa0, + struct kdbus_cmd), + KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOCTL_MAGIC, 0xa1, + struct kdbus_cmd), + + KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0xb0, + struct kdbus_cmd_match), + KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOCTL_MAGIC, 0xb1, + struct kdbus_cmd_match), +}; #endif /* _KDBUS_UAPI_H_ */ diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index ef0b15185..cac9b6560 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -756,7 +756,7 @@ static int parse_kernel_address(sd_bus *b, const char **p, char **guid) { } static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) { - _cleanup_free_ char *machine = NULL; + _cleanup_free_ char *machine = NULL, *pid = NULL; int r; assert(b); @@ -777,18 +777,36 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) else if (r > 0) continue; + r = parse_address_key(p, "pid", &pid); + if (r < 0) + return r; + else if (r > 0) + continue; + skip_address_key(p); } - if (!machine) + if (!machine == !pid) return -EINVAL; - if (!machine_name_is_valid(machine)) - return -EINVAL; + if (machine) { + if (!machine_name_is_valid(machine)) + return -EINVAL; - free(b->machine); - b->machine = machine; - machine = NULL; + free(b->machine); + b->machine = machine; + machine = NULL; + } else { + free(b->machine); + b->machine = NULL; + } + + if (pid) { + r = parse_pid(pid, &b->nspid); + if (r < 0) + return r; + } else + b->nspid = 0; b->sockaddr.un.sun_family = AF_UNIX; strncpy(b->sockaddr.un.sun_path, "/var/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path)); @@ -798,7 +816,7 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) } static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid) { - _cleanup_free_ char *machine = NULL; + _cleanup_free_ char *machine = NULL, *pid = NULL; int r; assert(b); @@ -819,18 +837,36 @@ static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid else if (r > 0) continue; + r = parse_address_key(p, "pid", &pid); + if (r < 0) + return r; + else if (r > 0) + continue; + skip_address_key(p); } - if (!machine) + if (!machine == !pid) return -EINVAL; - if (!machine_name_is_valid(machine)) - return -EINVAL; + if (machine) { + if (!machine_name_is_valid(machine)) + return -EINVAL; - free(b->machine); - b->machine = machine; - machine = NULL; + free(b->machine); + b->machine = machine; + machine = NULL; + } else { + free(b->machine); + b->machine = NULL; + } + + if (pid) { + r = parse_pid(pid, &b->nspid); + if (r < 0) + return r; + } else + b->nspid = 0; free(b->kernel); b->kernel = strdup("/sys/fs/kdbus/0-system/bus"); @@ -854,6 +890,7 @@ static void bus_reset_parsed_address(sd_bus *b) { b->kernel = NULL; free(b->machine); b->machine = NULL; + b->nspid = 0; } static int bus_parse_next_address(sd_bus *b) { @@ -913,17 +950,17 @@ static int bus_parse_next_address(sd_bus *b) { return r; break; - } else if (startswith(a, "x-container-unix:")) { + } else if (startswith(a, "x-machine-unix:")) { - a += 17; + a += 15; r = parse_container_unix_address(b, &a, &guid); if (r < 0) return r; break; - } else if (startswith(a, "x-container-kernel:")) { + } else if (startswith(a, "x-machine-kernel:")) { - a += 19; + a += 17; r = parse_container_kernel_address(b, &a, &guid); if (r < 0) return r; @@ -958,9 +995,9 @@ static int bus_start_address(sd_bus *b) { if (b->exec_path) r = bus_socket_exec(b); - else if (b->machine && b->kernel) + else if ((b->nspid > 0 || b->machine) && b->kernel) r = bus_container_connect_kernel(b); - else if (b->machine && b->sockaddr.sa.sa_family != AF_UNSPEC) + else if ((b->nspid > 0 || b->machine) && b->sockaddr.sa.sa_family != AF_UNSPEC) r = bus_container_connect_socket(b); else if (b->kernel) r = bus_kernel_connect(b); @@ -1249,7 +1286,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) { if (!e) return -ENOMEM; - c = strappenda(",argv4=--machine=", m); + c = strjoina(",argv4=--machine=", m); } } @@ -1297,7 +1334,7 @@ fail: return r; } -int bus_set_address_system_container(sd_bus *b, const char *machine) { +int bus_set_address_system_machine(sd_bus *b, const char *machine) { _cleanup_free_ char *e = NULL; assert(b); @@ -1308,9 +1345,9 @@ int bus_set_address_system_container(sd_bus *b, const char *machine) { return -ENOMEM; #ifdef ENABLE_KDBUS - b->address = strjoin("x-container-kernel:machine=", e, ";x-container-unix:machine=", e, NULL); + b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL); #else - b->address = strjoin("x-container-unix:machine=", e, NULL); + b->address = strjoin("x-machine-unix:machine=", e, NULL); #endif if (!b->address) return -ENOMEM; @@ -1318,7 +1355,7 @@ int bus_set_address_system_container(sd_bus *b, const char *machine) { return 0; } -_public_ int sd_bus_open_system_container(sd_bus **ret, const char *machine) { +_public_ int sd_bus_open_system_machine(sd_bus **ret, const char *machine) { sd_bus *bus; int r; @@ -1330,7 +1367,7 @@ _public_ int sd_bus_open_system_container(sd_bus **ret, const char *machine) { if (r < 0) return r; - r = bus_set_address_system_container(bus, machine); + r = bus_set_address_system_machine(bus, machine); if (r < 0) goto fail; @@ -1491,6 +1528,16 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) { assert(b); assert(m); + /* Fake some timestamps, if they were requested, and not + * already initialized */ + if (b->attach_flags & KDBUS_ATTACH_TIMESTAMP) { + if (m->realtime <= 0) + m->realtime = now(CLOCK_REALTIME); + + if (m->monotonic <= 0) + m->monotonic = now(CLOCK_MONOTONIC); + } + /* The bus specification says the serial number cannot be 0, * hence let's fill something in for synthetic messages. Since * synthetic messages might have a fake sender and we don't @@ -1498,7 +1545,6 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) { * pick a fixed, artificial one. We use (uint32_t) -1 rather * than (uint64_t) -1 since dbus1 only had 32bit identifiers, * even though kdbus can do 64bit. */ - return bus_message_seal(m, 0xFFFFFFFFULL, 0); } @@ -1658,8 +1704,8 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie, /* If this is a reply and no reply was requested, then let's * suppress this, if we can */ - if (m->dont_send && !cookie) - return 1; + if (m->dont_send) + goto finish; if ((bus->state == BUS_RUNNING || bus->state == BUS_HELLO) && bus->wqueue_size <= 0) { size_t idx = 0; @@ -1672,7 +1718,9 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie, } return r; - } else if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) { + } + + if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) { /* Wasn't fully written. So let's remember how * much was written. Note that the first entry * of the wqueue array is always allocated so @@ -1682,6 +1730,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie, bus->wqueue_size = 1; bus->windex = idx; } + } else { /* Just append it to the queue. */ @@ -1694,6 +1743,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie, bus->wqueue[bus->wqueue_size ++] = sd_bus_message_ref(m); } +finish: if (cookie) *cookie = BUS_MESSAGE_COOKIE(m); @@ -2103,8 +2153,6 @@ static int process_timeout(sd_bus *bus) { if (r < 0) return r; - m->sender = "org.freedesktop.DBus"; - r = bus_seal_synthetic_message(bus, m); if (r < 0) return r; @@ -2202,6 +2250,11 @@ static int process_reply(sd_bus *bus, sd_bus_message *m) { if (r < 0) return r; + /* Copy over original timestamp */ + synthetic_reply->realtime = m->realtime; + synthetic_reply->monotonic = m->monotonic; + synthetic_reply->seqnum = m->seqnum; + r = bus_seal_synthetic_message(bus, synthetic_reply); if (r < 0) return r; @@ -2507,15 +2560,6 @@ null_message: return r; } -static void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m) { - assert(bus); - assert(m); - - m->sender = m->creds.unique_name = (char*) "org.freedesktop.DBus.Local"; - m->creds.well_known_names_local = true; - m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask; -} - static int process_closing(sd_bus *bus, sd_bus_message **ret) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL; struct reply_callback *c; @@ -2713,7 +2757,7 @@ static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) { if (need_more) /* The caller really needs some more data, he doesn't * care about what's already read, or any timeouts - * except its own.*/ + * except its own. */ e |= POLLIN; else { usec_t until; diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c index 06edd621e..8625ee6d8 100644 --- a/src/libsystemd/sd-bus/test-bus-chat.c +++ b/src/libsystemd/sd-bus/test-bus-chat.c @@ -19,7 +19,6 @@ along with systemd; If not, see . ***/ -#include #include #include #include @@ -44,7 +43,7 @@ static int match_callback(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus static int object_callback(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { int r; - assert(bus); + assert_se(bus); if (sd_bus_message_is_method_error(m, NULL)) return 0; @@ -68,7 +67,7 @@ static int server_init(sd_bus **_bus) { int r; const char *unique; - assert(_bus); + assert_se(_bus); r = sd_bus_open_user(&bus); if (r < 0) { @@ -299,7 +298,7 @@ static void* client1(void*p) { goto finish; } - assert(streq(hello, "hello")); + assert_se(streq(hello, "hello")); if (pipe2(pp, O_CLOEXEC|O_NONBLOCK) < 0) { log_error_errno(errno, "Failed to allocate pipe: %m"); diff --git a/src/libsystemd/sd-bus/test-bus-gvariant.c b/src/libsystemd/sd-bus/test-bus-gvariant.c index 56df5d0b4..992edacb2 100644 --- a/src/libsystemd/sd-bus/test-bus-gvariant.c +++ b/src/libsystemd/sd-bus/test-bus-gvariant.c @@ -24,6 +24,7 @@ #endif #include "util.h" +#include "macro.h" #include "sd-bus.h" #include "bus-gvariant.h" #include "bus-util.h" @@ -32,106 +33,106 @@ #include "bus-dump.h" static void test_bus_gvariant_is_fixed_size(void) { - assert(bus_gvariant_is_fixed_size("") > 0); - assert(bus_gvariant_is_fixed_size("()") > 0); - assert(bus_gvariant_is_fixed_size("y") > 0); - assert(bus_gvariant_is_fixed_size("u") > 0); - assert(bus_gvariant_is_fixed_size("b") > 0); - assert(bus_gvariant_is_fixed_size("n") > 0); - assert(bus_gvariant_is_fixed_size("q") > 0); - assert(bus_gvariant_is_fixed_size("i") > 0); - assert(bus_gvariant_is_fixed_size("t") > 0); - assert(bus_gvariant_is_fixed_size("d") > 0); - assert(bus_gvariant_is_fixed_size("s") == 0); - assert(bus_gvariant_is_fixed_size("o") == 0); - assert(bus_gvariant_is_fixed_size("g") == 0); - assert(bus_gvariant_is_fixed_size("h") > 0); - assert(bus_gvariant_is_fixed_size("ay") == 0); - assert(bus_gvariant_is_fixed_size("v") == 0); - assert(bus_gvariant_is_fixed_size("(u)") > 0); - assert(bus_gvariant_is_fixed_size("(uuuuy)") > 0); - assert(bus_gvariant_is_fixed_size("(uusuuy)") == 0); - assert(bus_gvariant_is_fixed_size("a{ss}") == 0); - assert(bus_gvariant_is_fixed_size("((u)yyy(b(iiii)))") > 0); - assert(bus_gvariant_is_fixed_size("((u)yyy(b(iiivi)))") == 0); + assert_se(bus_gvariant_is_fixed_size("") > 0); + assert_se(bus_gvariant_is_fixed_size("()") > 0); + assert_se(bus_gvariant_is_fixed_size("y") > 0); + assert_se(bus_gvariant_is_fixed_size("u") > 0); + assert_se(bus_gvariant_is_fixed_size("b") > 0); + assert_se(bus_gvariant_is_fixed_size("n") > 0); + assert_se(bus_gvariant_is_fixed_size("q") > 0); + assert_se(bus_gvariant_is_fixed_size("i") > 0); + assert_se(bus_gvariant_is_fixed_size("t") > 0); + assert_se(bus_gvariant_is_fixed_size("d") > 0); + assert_se(bus_gvariant_is_fixed_size("s") == 0); + assert_se(bus_gvariant_is_fixed_size("o") == 0); + assert_se(bus_gvariant_is_fixed_size("g") == 0); + assert_se(bus_gvariant_is_fixed_size("h") > 0); + assert_se(bus_gvariant_is_fixed_size("ay") == 0); + assert_se(bus_gvariant_is_fixed_size("v") == 0); + assert_se(bus_gvariant_is_fixed_size("(u)") > 0); + assert_se(bus_gvariant_is_fixed_size("(uuuuy)") > 0); + assert_se(bus_gvariant_is_fixed_size("(uusuuy)") == 0); + assert_se(bus_gvariant_is_fixed_size("a{ss}") == 0); + assert_se(bus_gvariant_is_fixed_size("((u)yyy(b(iiii)))") > 0); + assert_se(bus_gvariant_is_fixed_size("((u)yyy(b(iiivi)))") == 0); } static void test_bus_gvariant_get_size(void) { - assert(bus_gvariant_get_size("") == 0); - assert(bus_gvariant_get_size("()") == 0); - assert(bus_gvariant_get_size("y") == 1); - assert(bus_gvariant_get_size("u") == 4); - assert(bus_gvariant_get_size("b") == 1); - assert(bus_gvariant_get_size("n") == 2); - assert(bus_gvariant_get_size("q") == 2); - assert(bus_gvariant_get_size("i") == 4); - assert(bus_gvariant_get_size("t") == 8); - assert(bus_gvariant_get_size("d") == 8); - assert(bus_gvariant_get_size("s") < 0); - assert(bus_gvariant_get_size("o") < 0); - assert(bus_gvariant_get_size("g") < 0); - assert(bus_gvariant_get_size("h") == 4); - assert(bus_gvariant_get_size("ay") < 0); - assert(bus_gvariant_get_size("v") < 0); - assert(bus_gvariant_get_size("(u)") == 4); - assert(bus_gvariant_get_size("(uuuuy)") == 20); - assert(bus_gvariant_get_size("(uusuuy)") < 0); - assert(bus_gvariant_get_size("a{ss}") < 0); - assert(bus_gvariant_get_size("((u)yyy(b(iiii)))") == 28); - assert(bus_gvariant_get_size("((u)yyy(b(iiivi)))") < 0); - assert(bus_gvariant_get_size("((b)(t))") == 16); - assert(bus_gvariant_get_size("((b)(b)(t))") == 16); - assert(bus_gvariant_get_size("(bt)") == 16); - assert(bus_gvariant_get_size("((t)(b))") == 16); - assert(bus_gvariant_get_size("(tb)") == 16); - assert(bus_gvariant_get_size("((b)(b))") == 2); - assert(bus_gvariant_get_size("((t)(t))") == 16); + assert_se(bus_gvariant_get_size("") == 0); + assert_se(bus_gvariant_get_size("()") == 0); + assert_se(bus_gvariant_get_size("y") == 1); + assert_se(bus_gvariant_get_size("u") == 4); + assert_se(bus_gvariant_get_size("b") == 1); + assert_se(bus_gvariant_get_size("n") == 2); + assert_se(bus_gvariant_get_size("q") == 2); + assert_se(bus_gvariant_get_size("i") == 4); + assert_se(bus_gvariant_get_size("t") == 8); + assert_se(bus_gvariant_get_size("d") == 8); + assert_se(bus_gvariant_get_size("s") < 0); + assert_se(bus_gvariant_get_size("o") < 0); + assert_se(bus_gvariant_get_size("g") < 0); + assert_se(bus_gvariant_get_size("h") == 4); + assert_se(bus_gvariant_get_size("ay") < 0); + assert_se(bus_gvariant_get_size("v") < 0); + assert_se(bus_gvariant_get_size("(u)") == 4); + assert_se(bus_gvariant_get_size("(uuuuy)") == 20); + assert_se(bus_gvariant_get_size("(uusuuy)") < 0); + assert_se(bus_gvariant_get_size("a{ss}") < 0); + assert_se(bus_gvariant_get_size("((u)yyy(b(iiii)))") == 28); + assert_se(bus_gvariant_get_size("((u)yyy(b(iiivi)))") < 0); + assert_se(bus_gvariant_get_size("((b)(t))") == 16); + assert_se(bus_gvariant_get_size("((b)(b)(t))") == 16); + assert_se(bus_gvariant_get_size("(bt)") == 16); + assert_se(bus_gvariant_get_size("((t)(b))") == 16); + assert_se(bus_gvariant_get_size("(tb)") == 16); + assert_se(bus_gvariant_get_size("((b)(b))") == 2); + assert_se(bus_gvariant_get_size("((t)(t))") == 16); } static void test_bus_gvariant_get_alignment(void) { - assert(bus_gvariant_get_alignment("") == 1); - assert(bus_gvariant_get_alignment("()") == 1); - assert(bus_gvariant_get_alignment("y") == 1); - assert(bus_gvariant_get_alignment("b") == 1); - assert(bus_gvariant_get_alignment("u") == 4); - assert(bus_gvariant_get_alignment("s") == 1); - assert(bus_gvariant_get_alignment("o") == 1); - assert(bus_gvariant_get_alignment("g") == 1); - assert(bus_gvariant_get_alignment("v") == 8); - assert(bus_gvariant_get_alignment("h") == 4); - assert(bus_gvariant_get_alignment("i") == 4); - assert(bus_gvariant_get_alignment("t") == 8); - assert(bus_gvariant_get_alignment("x") == 8); - assert(bus_gvariant_get_alignment("q") == 2); - assert(bus_gvariant_get_alignment("n") == 2); - assert(bus_gvariant_get_alignment("d") == 8); - assert(bus_gvariant_get_alignment("ay") == 1); - assert(bus_gvariant_get_alignment("as") == 1); - assert(bus_gvariant_get_alignment("au") == 4); - assert(bus_gvariant_get_alignment("an") == 2); - assert(bus_gvariant_get_alignment("ans") == 2); - assert(bus_gvariant_get_alignment("ant") == 8); - assert(bus_gvariant_get_alignment("(ss)") == 1); - assert(bus_gvariant_get_alignment("(ssu)") == 4); - assert(bus_gvariant_get_alignment("a(ssu)") == 4); - assert(bus_gvariant_get_alignment("(u)") == 4); - assert(bus_gvariant_get_alignment("(uuuuy)") == 4); - assert(bus_gvariant_get_alignment("(uusuuy)") == 4); - assert(bus_gvariant_get_alignment("a{ss}") == 1); - assert(bus_gvariant_get_alignment("((u)yyy(b(iiii)))") == 4); - assert(bus_gvariant_get_alignment("((u)yyy(b(iiivi)))") == 8); - assert(bus_gvariant_get_alignment("((b)(t))") == 8); - assert(bus_gvariant_get_alignment("((b)(b)(t))") == 8); - assert(bus_gvariant_get_alignment("(bt)") == 8); - assert(bus_gvariant_get_alignment("((t)(b))") == 8); - assert(bus_gvariant_get_alignment("(tb)") == 8); - assert(bus_gvariant_get_alignment("((b)(b))") == 1); - assert(bus_gvariant_get_alignment("((t)(t))") == 8); + assert_se(bus_gvariant_get_alignment("") == 1); + assert_se(bus_gvariant_get_alignment("()") == 1); + assert_se(bus_gvariant_get_alignment("y") == 1); + assert_se(bus_gvariant_get_alignment("b") == 1); + assert_se(bus_gvariant_get_alignment("u") == 4); + assert_se(bus_gvariant_get_alignment("s") == 1); + assert_se(bus_gvariant_get_alignment("o") == 1); + assert_se(bus_gvariant_get_alignment("g") == 1); + assert_se(bus_gvariant_get_alignment("v") == 8); + assert_se(bus_gvariant_get_alignment("h") == 4); + assert_se(bus_gvariant_get_alignment("i") == 4); + assert_se(bus_gvariant_get_alignment("t") == 8); + assert_se(bus_gvariant_get_alignment("x") == 8); + assert_se(bus_gvariant_get_alignment("q") == 2); + assert_se(bus_gvariant_get_alignment("n") == 2); + assert_se(bus_gvariant_get_alignment("d") == 8); + assert_se(bus_gvariant_get_alignment("ay") == 1); + assert_se(bus_gvariant_get_alignment("as") == 1); + assert_se(bus_gvariant_get_alignment("au") == 4); + assert_se(bus_gvariant_get_alignment("an") == 2); + assert_se(bus_gvariant_get_alignment("ans") == 2); + assert_se(bus_gvariant_get_alignment("ant") == 8); + assert_se(bus_gvariant_get_alignment("(ss)") == 1); + assert_se(bus_gvariant_get_alignment("(ssu)") == 4); + assert_se(bus_gvariant_get_alignment("a(ssu)") == 4); + assert_se(bus_gvariant_get_alignment("(u)") == 4); + assert_se(bus_gvariant_get_alignment("(uuuuy)") == 4); + assert_se(bus_gvariant_get_alignment("(uusuuy)") == 4); + assert_se(bus_gvariant_get_alignment("a{ss}") == 1); + assert_se(bus_gvariant_get_alignment("((u)yyy(b(iiii)))") == 4); + assert_se(bus_gvariant_get_alignment("((u)yyy(b(iiivi)))") == 8); + assert_se(bus_gvariant_get_alignment("((b)(t))") == 8); + assert_se(bus_gvariant_get_alignment("((b)(b)(t))") == 8); + assert_se(bus_gvariant_get_alignment("(bt)") == 8); + assert_se(bus_gvariant_get_alignment("((t)(b))") == 8); + assert_se(bus_gvariant_get_alignment("(tb)") == 8); + assert_se(bus_gvariant_get_alignment("((b)(b))") == 1); + assert_se(bus_gvariant_get_alignment("((t)(t))") == 8); } static void test_marshal(void) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *n = NULL; - _cleanup_bus_unref_ sd_bus *bus = NULL; + _cleanup_bus_close_unref_ sd_bus *bus = NULL; _cleanup_free_ void *blob; size_t sz; int r; @@ -140,10 +141,12 @@ static void test_marshal(void) { if (r < 0) exit(EXIT_TEST_SKIP); - bus->message_version = 2; /* dirty hack to enable gvariant*/ + bus->message_version = 2; /* dirty hack to enable gvariant */ assert_se(sd_bus_message_new_method_call(bus, &m, "a.service.name", "/an/object/path/which/is/really/really/long/so/that/we/hit/the/eight/bit/boundary/by/quite/some/margin/to/test/this/stuff/that/it/really/works", "an.interface.name", "AMethodName") >= 0); + assert_cc(sizeof(struct bus_header) == 16); + assert_se(sd_bus_message_append(m, "a(usv)", 3, 4711, "first-string-parameter", "(st)", "X", (uint64_t) 1111, @@ -161,13 +164,15 @@ static void test_marshal(void) { g_type_init(); #endif - v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuuua(yv))"), m->header, sizeof(struct bus_header) + BUS_MESSAGE_FIELDS_SIZE(m), false, NULL, NULL); + v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuta{tv})"), m->header, sizeof(struct bus_header) + m->fields_size, false, NULL, NULL); + assert_se(g_variant_is_normal_form(v)); t = g_variant_print(v, TRUE); printf("%s\n", t); g_free(t); g_variant_unref(v); - v = g_variant_new_from_data(G_VARIANT_TYPE("(a(usv))"), m->body.data, BUS_MESSAGE_BODY_SIZE(m), false, NULL, NULL); + v = g_variant_new_from_data(G_VARIANT_TYPE("(a(usv))"), m->body.data, m->user_body_size, false, NULL, NULL); + assert_se(g_variant_is_normal_form(v)); t = g_variant_print(v, TRUE); printf("%s\n", t); g_free(t); @@ -179,6 +184,20 @@ static void test_marshal(void) { assert_se(bus_message_get_blob(m, &blob, &sz) >= 0); +#ifdef HAVE_GLIB + { + GVariant *v; + char *t; + + v = g_variant_new_from_data(G_VARIANT_TYPE("(yyyyuta{tv}v)"), blob, sz, false, NULL, NULL); + assert_se(g_variant_is_normal_form(v)); + t = g_variant_print(v, TRUE); + printf("%s\n", t); + g_free(t); + g_variant_unref(v); + } +#endif + assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, NULL, &n) >= 0); blob = NULL; diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c index 8cefc7a15..d95a03c22 100644 --- a/src/libsystemd/sd-bus/test-bus-marshal.c +++ b/src/libsystemd/sd-bus/test-bus-marshal.c @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef HAVE_GLIB #include @@ -94,6 +95,8 @@ int main(int argc, char *argv[]) { _cleanup_fclose_ FILE *ms = NULL; size_t first_size = 0, second_size = 0, third_size = 0; _cleanup_bus_unref_ sd_bus *bus = NULL; + double dbl; + uint64_t u64; r = sd_bus_default_system(&bus); if (r < 0) @@ -145,6 +148,9 @@ int main(int argc, char *argv[]) { r = sd_bus_message_append_array(m, 'u', NULL, 0); assert_se(r >= 0); + r = sd_bus_message_append(m, "a(stdo)", 1, "foo", 815ULL, 47.0, "/"); + assert_se(r >= 0); + r = bus_message_seal(m, 4711, 0); assert_se(r >= 0); @@ -268,6 +274,13 @@ int main(int argc, char *argv[]) { assert_se(r > 0); assert_se(sz == 0); + r = sd_bus_message_read(m, "a(stdo)", 1, &x, &u64, &dbl, &y); + assert_se(r > 0); + assert_se(streq(x, "foo")); + assert_se(u64 == 815ULL); + assert_se(fabs(dbl - 47.0) < 0.1); + assert_se(streq(y, "/")); + r = sd_bus_message_peek_type(m, NULL, NULL); assert_se(r == 0); diff --git a/src/libsystemd/sd-bus/test-bus-match.c b/src/libsystemd/sd-bus/test-bus-match.c index 713311703..76ca0b6bf 100644 --- a/src/libsystemd/sd-bus/test-bus-match.c +++ b/src/libsystemd/sd-bus/test-bus-match.c @@ -19,8 +19,6 @@ along with systemd; If not, see . ***/ -#include - #include "log.h" #include "util.h" #include "macro.h" @@ -34,7 +32,7 @@ static bool mask[32]; static int filter(sd_bus *b, sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { log_info("Ran %u", PTR_TO_UINT(userdata)); - assert(PTR_TO_UINT(userdata) < ELEMENTSOF(mask)); + assert_se(PTR_TO_UINT(userdata) < ELEMENTSOF(mask)); mask[PTR_TO_UINT(userdata)] = true; return 0; } diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c index 06b8904f1..acf67a52b 100644 --- a/src/libsystemd/sd-bus/test-bus-objects.c +++ b/src/libsystemd/sd-bus/test-bus-objects.c @@ -176,6 +176,28 @@ static int emit_interfaces_removed(sd_bus *bus, sd_bus_message *m, void *userdat return 1; } +static int emit_object_added(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + int r; + + assert_se(sd_bus_emit_object_added(bus, m->path) >= 0); + + r = sd_bus_reply_method_return(m, NULL); + assert_se(r >= 0); + + return 1; +} + +static int emit_object_removed(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + int r; + + assert_se(sd_bus_emit_object_removed(bus, m->path) >= 0); + + r = sd_bus_reply_method_return(m, NULL); + assert_se(r >= 0); + + return 1; +} + static const sd_bus_vtable vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_METHOD("AlterSomething", "s", "s", something_handler, 0), @@ -186,6 +208,8 @@ static const sd_bus_vtable vtable[] = { SD_BUS_METHOD("NoOperation", NULL, NULL, NULL, 0), SD_BUS_METHOD("EmitInterfacesAdded", NULL, NULL, emit_interfaces_added, 0), SD_BUS_METHOD("EmitInterfacesRemoved", NULL, NULL, emit_interfaces_removed, 0), + SD_BUS_METHOD("EmitObjectAdded", NULL, NULL, emit_object_added, 0), + SD_BUS_METHOD("EmitObjectRemoved", NULL, NULL, emit_object_removed, 0), SD_BUS_VTABLE_END }; @@ -456,6 +480,30 @@ static int client(struct context *c) { sd_bus_message_unref(reply); reply = NULL; + r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.systemd.test", "EmitObjectAdded", &error, NULL, ""); + assert_se(r >= 0); + + r = sd_bus_process(bus, &reply); + assert_se(r > 0); + + assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesAdded")); + bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER); + + sd_bus_message_unref(reply); + reply = NULL; + + r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.systemd.test", "EmitObjectRemoved", &error, NULL, ""); + assert_se(r >= 0); + + r = sd_bus_process(bus, &reply); + assert_se(r > 0); + + assert_se(sd_bus_message_is_signal(reply, "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved")); + bus_message_dump(reply, stdout, BUS_MESSAGE_DUMP_WITH_HEADER); + + sd_bus_message_unref(reply); + reply = NULL; + r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.systemd.test", "Exit", &error, NULL, ""); assert_se(r >= 0); diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index 1f2a53393..028c2a7a5 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -340,16 +340,28 @@ _public_ int sd_is_mq(int fd, const char *path) { return 1; } -_public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) { - union sockaddr_union sockaddr = {}; - _cleanup_close_ int fd = -1; - struct msghdr msghdr = {}; - struct iovec iovec = {}; - const char *e; +_public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char *state, const int *fds, unsigned n_fds) { + union sockaddr_union sockaddr = { + .sa.sa_family = AF_UNIX, + }; + struct iovec iovec = { + .iov_base = (char*) state, + }; + struct msghdr msghdr = { + .msg_iov = &iovec, + .msg_iovlen = 1, + .msg_name = &sockaddr, + }; union { struct cmsghdr cmsghdr; - uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; - } control = {}; + uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + + CMSG_SPACE(sizeof(int) * n_fds)]; + } control; + _cleanup_close_ int fd = -1; + struct cmsghdr *cmsg = NULL; + const char *e; + size_t controllen_without_ucred = 0; + bool try_without_ucred = false; int r; if (!state) { @@ -357,6 +369,11 @@ _public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) goto finish; } + if (n_fds > 0 && !fds) { + r = -EINVAL; + goto finish; + } + e = getenv("NOTIFY_SOCKET"); if (!e) return 0; @@ -373,42 +390,50 @@ _public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) goto finish; } - sockaddr.sa.sa_family = AF_UNIX; - strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); + iovec.iov_len = strlen(state); + strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); if (sockaddr.un.sun_path[0] == '@') sockaddr.un.sun_path[0] = 0; - iovec.iov_base = (char*) state; - iovec.iov_len = strlen(state); - - msghdr.msg_name = &sockaddr; msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); - if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) msghdr.msg_namelen = sizeof(struct sockaddr_un); - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; + if (n_fds > 0) { + msghdr.msg_control = &control; + msghdr.msg_controllen = CMSG_LEN(sizeof(int) * n_fds); + + cmsg = CMSG_FIRSTHDR(&msghdr); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int) * n_fds); + + memcpy(CMSG_DATA(cmsg), fds, sizeof(int) * n_fds); + } if (pid != 0 && pid != getpid()) { - struct cmsghdr *cmsg; - struct ucred ucred = {}; + struct ucred *ucred; + + try_without_ucred = true; + controllen_without_ucred = msghdr.msg_controllen; msghdr.msg_control = &control; - msghdr.msg_controllen = sizeof(control); + msghdr.msg_controllen += CMSG_LEN(sizeof(struct ucred)); + + if (cmsg) + cmsg = CMSG_NXTHDR(&msghdr, cmsg); + else + cmsg = CMSG_FIRSTHDR(&msghdr); - cmsg = CMSG_FIRSTHDR(&msghdr); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); - ucred.pid = pid; - ucred.uid = getuid(); - ucred.gid = getgid(); - - memcpy(CMSG_DATA(cmsg), &ucred, sizeof(struct ucred)); - msghdr.msg_controllen = cmsg->cmsg_len; + ucred = (struct ucred*) CMSG_DATA(cmsg); + ucred->pid = pid; + ucred->uid = getuid(); + ucred->gid = getgid(); } /* First try with fake ucred data, as requested */ @@ -417,10 +442,11 @@ _public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) goto finish; } - /* If that failed, try with our own instead */ - if (msghdr.msg_control) { - msghdr.msg_control = NULL; - msghdr.msg_controllen = 0; + /* If that failed, try with our own ucred instead */ + if (try_without_ucred) { + if (controllen_without_ucred <= 0) + msghdr.msg_control = NULL; + msghdr.msg_controllen = controllen_without_ucred; if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) >= 0) { r = 1; @@ -437,8 +463,12 @@ finish: return r; } +_public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) { + return sd_pid_notify_with_fds(pid, unset_environment, state, NULL, 0); +} + _public_ int sd_notify(int unset_environment, const char *state) { - return sd_pid_notify(0, unset_environment, state); + return sd_pid_notify_with_fds(0, unset_environment, state, NULL, 0); } _public_ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) { diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index f9fa54d2e..25089a033 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -891,6 +891,12 @@ static int event_setup_timer_fd( return 0; } +static int time_exit_callback(sd_event_source *s, uint64_t usec, void *userdata) { + assert(s); + + return sd_event_exit(sd_event_source_get_event(s), PTR_TO_INT(userdata)); +} + _public_ int sd_event_add_time( sd_event *e, sd_event_source **ret, @@ -908,10 +914,12 @@ _public_ int sd_event_add_time( assert_return(e, -EINVAL); assert_return(usec != (uint64_t) -1, -EINVAL); assert_return(accuracy != (uint64_t) -1, -EINVAL); - assert_return(callback, -EINVAL); assert_return(e->state != SD_EVENT_FINISHED, -ESTALE); assert_return(!event_pid_changed(e), -ECHILD); + if (!callback) + callback = time_exit_callback; + type = clock_to_event_source_type(clock); assert_return(type >= 0, -ENOTSUP); diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c index ffefb14b7..721700be7 100644 --- a/src/libsystemd/sd-event/test-event.c +++ b/src/libsystemd/sd-event/test-event.c @@ -22,6 +22,7 @@ #include "sd-event.h" #include "log.h" #include "util.h" +#include "macro.h" static int prepare_handler(sd_event_source *s, void *userdata) { log_info("preparing %c", PTR_TO_INT(userdata)); @@ -62,12 +63,12 @@ static int io_handler(sd_event_source *s, int fd, uint32_t revents, void *userda static int child_handler(sd_event_source *s, const siginfo_t *si, void *userdata) { - assert(s); - assert(si); + assert_se(s); + assert_se(si); log_info("got child on %c", PTR_TO_INT(userdata)); - assert(userdata == INT_TO_PTR('f')); + assert_se(userdata == INT_TO_PTR('f')); assert_se(sd_event_exit(sd_event_source_get_event(s), 0) >= 0); sd_event_source_unref(s); @@ -80,12 +81,12 @@ static int signal_handler(sd_event_source *s, const struct signalfd_siginfo *si, sigset_t ss; pid_t pid; - assert(s); - assert(si); + assert_se(s); + assert_se(si); log_info("got signal on %c", PTR_TO_INT(userdata)); - assert(userdata == INT_TO_PTR('e')); + assert_se(userdata == INT_TO_PTR('e')); assert_se(sigemptyset(&ss) >= 0); assert_se(sigaddset(&ss, SIGCHLD) >= 0); @@ -109,11 +110,11 @@ static int defer_handler(sd_event_source *s, void *userdata) { sd_event_source *p = NULL; sigset_t ss; - assert(s); + assert_se(s); log_info("got defer on %c", PTR_TO_INT(userdata)); - assert(userdata == INT_TO_PTR('d')); + assert_se(userdata == INT_TO_PTR('d')); assert_se(sigemptyset(&ss) >= 0); assert_se(sigaddset(&ss, SIGUSR1) >= 0); @@ -140,7 +141,7 @@ static int time_handler(sd_event_source *s, uint64_t usec, void *userdata) { assert_se(sd_event_add_defer(sd_event_source_get_event(s), &p, defer_handler, INT_TO_PTR('d')) >= 0); assert_se(sd_event_source_set_enabled(p, SD_EVENT_ONESHOT) >= 0); } else { - assert(!got_c); + assert_se(!got_c); got_c = true; } } else diff --git a/src/libudev/libudev-hwdb-def.h b/src/libsystemd/sd-hwdb/hwdb-internal.h similarity index 96% rename from src/libudev/libudev-hwdb-def.h rename to src/libsystemd/sd-hwdb/hwdb-internal.h index b76a13f3e..fedccdec7 100644 --- a/src/libudev/libudev-hwdb-def.h +++ b/src/libsystemd/sd-hwdb/hwdb-internal.h @@ -16,9 +16,7 @@ You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ - -#ifndef _LIBUDEV_HWDB_DEF_H_ -#define _LIBUDEV_HWDB_DEF_H_ +#pragma once #include "sparse-endian.h" @@ -70,5 +68,3 @@ struct trie_value_entry_f { le64_t key_off; le64_t value_off; } _packed_; - -#endif diff --git a/src/core/bus-common.h b/src/libsystemd/sd-hwdb/hwdb-util.h similarity index 65% rename from src/core/bus-common.h rename to src/libsystemd/sd-hwdb/hwdb-util.h index 209f870c7..ee020a294 100644 --- a/src/core/bus-common.h +++ b/src/libsystemd/sd-hwdb/hwdb-util.h @@ -2,12 +2,10 @@ #pragma once -#include "macro.h" - /*** This file is part of systemd. - Copyright 2014 Daniel Mack + Copyright 2014 Tom Gundersen systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -23,13 +21,11 @@ along with systemd; If not, see . ***/ -typedef enum BusPolicyAccess { - BUS_POLICY_ACCESS_SEE, - BUS_POLICY_ACCESS_TALK, - BUS_POLICY_ACCESS_OWN, - _BUS_POLICY_ACCESS_MAX, - _BUS_POLICY_ACCESS_INVALID = -1 -} BusPolicyAccess; +#include "util.h" + +#include "sd-hwdb.h" + +DEFINE_TRIVIAL_CLEANUP_FUNC(sd_hwdb*, sd_hwdb_unref); +#define _cleanup_hwdb_unref_ _cleanup_(sd_hwdb_unrefp) -const char* bus_policy_access_to_string(BusPolicyAccess i) _const_; -BusPolicyAccess bus_policy_access_from_string(const char *s) _pure_; +bool hwdb_validate(sd_hwdb *hwdb); diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c new file mode 100644 index 000000000..61c7b446b --- /dev/null +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -0,0 +1,471 @@ +/*** + This file is part of systemd. + + Copyright 2012 Kay Sievers + Copyright 2008 Alan Jenkins + Copyright 2014 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sd-hwdb.h" + +#include "hashmap.h" +#include "refcnt.h" + +#include "hwdb-util.h" +#include "hwdb-internal.h" + +struct sd_hwdb { + RefCount n_ref; + int refcount; + + FILE *f; + struct stat st; + union { + struct trie_header_f *head; + const char *map; + }; + + char *modalias; + + OrderedHashmap *properties; + Iterator properties_iterator; + bool properties_modified; +}; + +struct linebuf { + char bytes[LINE_MAX]; + size_t size; + size_t len; +}; + +static void linebuf_init(struct linebuf *buf) { + buf->size = 0; + buf->len = 0; +} + +static const char *linebuf_get(struct linebuf *buf) { + if (buf->len + 1 >= sizeof(buf->bytes)) + return NULL; + buf->bytes[buf->len] = '\0'; + return buf->bytes; +} + +static bool linebuf_add(struct linebuf *buf, const char *s, size_t len) { + if (buf->len + len >= sizeof(buf->bytes)) + return false; + memcpy(buf->bytes + buf->len, s, len); + buf->len += len; + return true; +} + +static bool linebuf_add_char(struct linebuf *buf, char c) +{ + if (buf->len + 1 >= sizeof(buf->bytes)) + return false; + buf->bytes[buf->len++] = c; + return true; +} + +static void linebuf_rem(struct linebuf *buf, size_t count) { + assert(buf->len >= count); + buf->len -= count; +} + +static void linebuf_rem_char(struct linebuf *buf) { + linebuf_rem(buf, 1); +} + +static const struct trie_child_entry_f *trie_node_children(sd_hwdb *hwdb, const struct trie_node_f *node) { + return (const struct trie_child_entry_f *)((const char *)node + le64toh(hwdb->head->node_size)); +} + +static const struct trie_value_entry_f *trie_node_values(sd_hwdb *hwdb, const struct trie_node_f *node) { + const char *base = (const char *)node; + + base += le64toh(hwdb->head->node_size); + base += node->children_count * le64toh(hwdb->head->child_entry_size); + return (const struct trie_value_entry_f *)base; +} + +static const struct trie_node_f *trie_node_from_off(sd_hwdb *hwdb, le64_t off) { + return (const struct trie_node_f *)(hwdb->map + le64toh(off)); +} + +static const char *trie_string(sd_hwdb *hwdb, le64_t off) { + return hwdb->map + le64toh(off); +} + +static int trie_children_cmp_f(const void *v1, const void *v2) { + const struct trie_child_entry_f *n1 = v1; + const struct trie_child_entry_f *n2 = v2; + + return n1->c - n2->c; +} + +static const struct trie_node_f *node_lookup_f(sd_hwdb *hwdb, const struct trie_node_f *node, uint8_t c) { + struct trie_child_entry_f *child; + struct trie_child_entry_f search; + + search.c = c; + child = bsearch(&search, trie_node_children(hwdb, node), node->children_count, + le64toh(hwdb->head->child_entry_size), trie_children_cmp_f); + if (child) + return trie_node_from_off(hwdb, child->child_off); + return NULL; +} + +static int hwdb_add_property(sd_hwdb *hwdb, const char *key, const char *value) { + int r; + + assert(hwdb); + assert(key); + assert(value); + + /* + * Silently ignore all properties which do not start with a + * space; future extensions might use additional prefixes. + */ + if (key[0] != ' ') + return 0; + + key++; + + r = ordered_hashmap_ensure_allocated(&hwdb->properties, &string_hash_ops); + if (r < 0) + return r; + + r = ordered_hashmap_replace(hwdb->properties, key, (char*)value); + if (r < 0) + return r; + + hwdb->properties_modified = true; + + return 0; +} + +static int trie_fnmatch_f(sd_hwdb *hwdb, const struct trie_node_f *node, size_t p, + struct linebuf *buf, const char *search) { + size_t len; + size_t i; + const char *prefix; + int err; + + prefix = trie_string(hwdb, node->prefix_off); + len = strlen(prefix + p); + linebuf_add(buf, prefix + p, len); + + for (i = 0; i < node->children_count; i++) { + const struct trie_child_entry_f *child = &trie_node_children(hwdb, node)[i]; + + linebuf_add_char(buf, child->c); + err = trie_fnmatch_f(hwdb, trie_node_from_off(hwdb, child->child_off), 0, buf, search); + if (err < 0) + return err; + linebuf_rem_char(buf); + } + + if (le64toh(node->values_count) && fnmatch(linebuf_get(buf), search, 0) == 0) + for (i = 0; i < le64toh(node->values_count); i++) { + err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off), + trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off)); + if (err < 0) + return err; + } + + linebuf_rem(buf, len); + return 0; +} + +static int trie_search_f(sd_hwdb *hwdb, const char *search) { + struct linebuf buf; + const struct trie_node_f *node; + size_t i = 0; + int err; + + linebuf_init(&buf); + + node = trie_node_from_off(hwdb, hwdb->head->nodes_root_off); + while (node) { + const struct trie_node_f *child; + size_t p = 0; + + if (node->prefix_off) { + uint8_t c; + + for (; (c = trie_string(hwdb, node->prefix_off)[p]); p++) { + if (c == '*' || c == '?' || c == '[') + return trie_fnmatch_f(hwdb, node, p, &buf, search + i + p); + if (c != search[i + p]) + return 0; + } + i += p; + } + + child = node_lookup_f(hwdb, node, '*'); + if (child) { + linebuf_add_char(&buf, '*'); + err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); + if (err < 0) + return err; + linebuf_rem_char(&buf); + } + + child = node_lookup_f(hwdb, node, '?'); + if (child) { + linebuf_add_char(&buf, '?'); + err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); + if (err < 0) + return err; + linebuf_rem_char(&buf); + } + + child = node_lookup_f(hwdb, node, '['); + if (child) { + linebuf_add_char(&buf, '['); + err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); + if (err < 0) + return err; + linebuf_rem_char(&buf); + } + + if (search[i] == '\0') { + size_t n; + + for (n = 0; n < le64toh(node->values_count); n++) { + err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[n].key_off), + trie_string(hwdb, trie_node_values(hwdb, node)[n].value_off)); + if (err < 0) + return err; + } + return 0; + } + + child = node_lookup_f(hwdb, node, search[i]); + node = child; + i++; + } + return 0; +} + +static const char hwdb_bin_paths[] = + "/etc/systemd/hwdb/hwdb.bin\0" + "/etc/udev/hwdb.bin\0" + "/usr/lib/systemd/hwdb/hwdb.bin\0" +#ifdef HAVE_SPLIT_USR + "/lib/systemd/hwdb/hwdb.bin\0" +#endif + UDEVLIBEXECDIR "/hwdb.bin\0"; + +_public_ int sd_hwdb_new(sd_hwdb **ret) { + _cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL; + const char *hwdb_bin_path; + const char sig[] = HWDB_SIG; + + assert_return(ret, -EINVAL); + + hwdb = new0(sd_hwdb, 1); + if (!hwdb) + return -ENOMEM; + + hwdb->n_ref = REFCNT_INIT; + + /* find hwdb.bin in hwdb_bin_paths */ + NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) { + hwdb->f = fopen(hwdb_bin_path, "re"); + if (hwdb->f) + break; + else if (errno == ENOENT) + continue; + else + return log_debug_errno(errno, "error reading %s: %m", hwdb_bin_path); + } + + if (!hwdb->f) { + log_debug("hwdb.bin does not exist, please run udevadm hwdb --update"); + return -ENOENT; + } + + if (fstat(fileno(hwdb->f), &hwdb->st) < 0 || + (size_t)hwdb->st.st_size < offsetof(struct trie_header_f, strings_len) + 8) + return log_debug_errno(errno, "error reading %s: %m", hwdb_bin_path); + + hwdb->map = mmap(0, hwdb->st.st_size, PROT_READ, MAP_SHARED, fileno(hwdb->f), 0); + if (hwdb->map == MAP_FAILED) + return log_debug_errno(errno, "error mapping %s: %m", hwdb_bin_path); + + if (memcmp(hwdb->map, sig, sizeof(hwdb->head->signature)) != 0 || + (size_t)hwdb->st.st_size != le64toh(hwdb->head->file_size)) { + log_debug("error recognizing the format of %s", hwdb_bin_path); + return -EINVAL;; + } + + log_debug("=== trie on-disk ==="); + log_debug("tool version: %"PRIu64, le64toh(hwdb->head->tool_version)); + log_debug("file size: %8"PRIi64" bytes", hwdb->st.st_size); + log_debug("header size %8"PRIu64" bytes", le64toh(hwdb->head->header_size)); + log_debug("strings %8"PRIu64" bytes", le64toh(hwdb->head->strings_len)); + log_debug("nodes %8"PRIu64" bytes", le64toh(hwdb->head->nodes_len)); + + *ret = hwdb; + hwdb = NULL; + + return 0; +} + +_public_ sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb) { + assert_return(hwdb, NULL); + + assert_se(REFCNT_INC(hwdb->n_ref) >= 2); + + return hwdb; +} + +_public_ sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb) { + if (hwdb && REFCNT_DEC(hwdb->n_ref) == 0) { + if (hwdb->map) + munmap((void *)hwdb->map, hwdb->st.st_size); + if (hwdb->f) + fclose(hwdb->f); + free(hwdb->modalias); + ordered_hashmap_free(hwdb->properties); + free(hwdb); + } + + return NULL; +} + +bool hwdb_validate(sd_hwdb *hwdb) { + bool found = false; + const char* p; + struct stat st; + + if (!hwdb) + return false; + if (!hwdb->f) + return false; + + /* if hwdb.bin doesn't exist anywhere, we need to update */ + NULSTR_FOREACH(p, hwdb_bin_paths) { + if (stat(p, &st) >= 0) { + found = true; + break; + } + } + if (!found) + return true; + + if (timespec_load(&hwdb->st.st_mtim) != timespec_load(&st.st_mtim)) + return true; + return false; +} + +static int properties_prepare(sd_hwdb *hwdb, const char *modalias) { + _cleanup_free_ char *mod = NULL; + int r; + + assert(hwdb); + assert(modalias); + + if (streq_ptr(modalias, hwdb->modalias)) + return 0; + + mod = strdup(modalias); + if (!mod) + return -ENOMEM; + + ordered_hashmap_clear(hwdb->properties); + + hwdb->properties_modified = true; + + r = trie_search_f(hwdb, modalias); + if (r < 0) + return r; + + free(hwdb->modalias); + hwdb->modalias = mod; + mod = NULL; + + return 0; +} + +_public_ int sd_hwdb_get(sd_hwdb *hwdb, const char *modalias, const char *key, const char **_value) { + const char *value; + int r; + + assert_return(hwdb, -EINVAL); + assert_return(hwdb->f, -EINVAL); + assert_return(modalias, -EINVAL); + assert_return(_value, -EINVAL); + + r = properties_prepare(hwdb, modalias); + if (r < 0) + return r; + + value = ordered_hashmap_get(hwdb->properties, key); + if (!value) + return -ENOENT; + + *_value = value; + + return 0; +} + +_public_ int sd_hwdb_seek(sd_hwdb *hwdb, const char *modalias) { + int r; + + assert_return(hwdb, -EINVAL); + assert_return(hwdb->f, -EINVAL); + assert_return(modalias, -EINVAL); + + r = properties_prepare(hwdb, modalias); + if (r < 0) + return r; + + hwdb->properties_modified = false; + hwdb->properties_iterator = ITERATOR_FIRST; + + return 0; +} + +_public_ int sd_hwdb_enumerate(sd_hwdb *hwdb, const char **key, const char **value) { + const void *k, *v; + + assert_return(hwdb, -EINVAL); + assert_return(key, -EINVAL); + assert_return(value, -EINVAL); + + if (hwdb->properties_modified) + return -EAGAIN; + + v = ordered_hashmap_iterate(hwdb->properties, &hwdb->properties_iterator, &k); + if (!k) + return 0; + + *key = k; + *value = v; + + return 1; +} diff --git a/src/libsystemd/sd-id128/sd-id128.c b/src/libsystemd/sd-id128/sd-id128.c index 233ffa070..c876f6e38 100644 --- a/src/libsystemd/sd-id128/sd-id128.c +++ b/src/libsystemd/sd-id128/sd-id128.c @@ -222,7 +222,7 @@ _public_ int sd_id128_randomize(sd_id128_t *ret) { /* Turn this into a valid v4 UUID, to be nice. Note that we * only guarantee this for newly generated UUIDs, not for - * pre-existing ones.*/ + * pre-existing ones. */ *ret = make_v4_uuid(t); return 0; diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index c72d23ed5..f71749f72 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "util.h" #include "cgroup-util.h" @@ -791,7 +791,7 @@ _public_ int sd_machine_get_class(const char *machine, char **class) { assert_return(machine_name_is_valid(machine), -EINVAL); assert_return(class, -EINVAL); - p = strappenda("/run/systemd/machines/", machine); + p = strjoina("/run/systemd/machines/", machine); r = parse_env_file(p, NEWLINE, "CLASS", &c, NULL); if (r < 0) return r; @@ -814,7 +814,7 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ifindices) { assert_return(machine_name_is_valid(machine), -EINVAL); assert_return(ifindices, -EINVAL); - p = strappenda("/run/systemd/machines/", machine); + p = strjoina("/run/systemd/machines/", machine); r = parse_env_file(p, NEWLINE, "NETIF", &netif, NULL); if (r < 0) return r; diff --git a/src/libsystemd/sd-login/test-login.c b/src/libsystemd/sd-login/test-login.c index 28f88a157..2802e8246 100644 --- a/src/libsystemd/sd-login/test-login.c +++ b/src/libsystemd/sd-login/test-login.c @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include +#include #include #include "systemd/sd-login.h" diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index d63e6f9df..c4713feb5 100644 --- a/src/libsystemd/sd-network/sd-network.c +++ b/src/libsystemd/sd-network/sd-network.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "util.h" @@ -192,6 +192,32 @@ _public_ int sd_network_link_get_llmnr(int ifindex, char **llmnr) { return 0; } +_public_ int sd_network_link_get_lldp(int ifindex, char **lldp) { + _cleanup_free_ char *s = NULL, *p = NULL; + size_t size; + int r; + + assert_return(ifindex > 0, -EINVAL); + assert_return(lldp, -EINVAL); + + if (asprintf(&p, "/run/systemd/netif/lldp/%d", ifindex) < 0) + return -ENOMEM; + + r = read_full_file(p, &s, &size); + if (r == -ENOENT) + return -ENODATA; + if (r < 0) + return r; + if (size <= 0) + return -ENODATA; + + *lldp = s; + s = NULL; + + return 0; +} + + static int network_get_link_strv(const char *key, int ifindex, char ***ret) { _cleanup_free_ char *p = NULL, *s = NULL; _cleanup_strv_free_ char **a = NULL; diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index fea695fcf..6448280c4 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "util.h" #include "list.h" diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c index a9dc9313a..d08e1b5a0 100644 --- a/src/libsystemd/sd-resolve/test-resolve.c +++ b/src/libsystemd/sd-resolve/test-resolve.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -40,7 +39,7 @@ static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata) { const struct addrinfo *i; - assert(q); + assert_se(q); if (ret != 0) { log_error("getaddrinfo error: %s %i", gai_strerror(ret), ret); @@ -60,7 +59,7 @@ static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrin } static int getnameinfo_handler(sd_resolve_query *q, int ret, const char *host, const char *serv, void *userdata) { - assert(q); + assert_se(q); if (ret != 0) { log_error("getnameinfo error: %s %i", gai_strerror(ret), ret); @@ -77,7 +76,7 @@ static int res_handler(sd_resolve_query *q, int ret, unsigned char *answer, void unsigned char *end = answer + ret; HEADER *head = (HEADER *) answer; char name[256]; - assert(q); + assert_se(q); if (ret < 0) { log_error("res_query() error: %s %i", strerror(errno), errno); @@ -96,7 +95,7 @@ static int res_handler(sd_resolve_query *q, int ret, unsigned char *answer, void /* Ignore the questions */ while (qdcount-- > 0 && (len = dn_expand(answer, end, pos, name, 255)) >= 0) { - assert(len >= 0); + assert_se(len >= 0); pos += len + QFIXEDSZ; } @@ -104,7 +103,7 @@ static int res_handler(sd_resolve_query *q, int ret, unsigned char *answer, void while (ancount-- > 0 && (len = dn_expand(answer, end, pos, name, 255)) >= 0) { /* Ignore the initial string */ uint16_t pref, weight, port; - assert(len >= 0); + assert_se(len >= 0); pos += len; /* Ignore type, ttl, class and dlen */ pos += 10; diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 165e84d7a..276591f31 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -43,7 +43,7 @@ static int message_new_empty(sd_rtnl *rtnl, sd_rtnl_message **ret) { assert_return(ret, -EINVAL); - /* Note that 'rtnl' is curretly unused, if we start using it internally + /* Note that 'rtnl' is currently unused, if we start using it internally we must take care to avoid problems due to mutual references between busses and their queued messages. See sd-bus. */ @@ -71,8 +71,6 @@ int message_new(sd_rtnl *rtnl, sd_rtnl_message **ret, uint16_t type) { if (r < 0) return r; - assert(nl_type->type == NLA_NESTED); - r = message_new_empty(rtnl, &m); if (r < 0) return r; @@ -220,6 +218,58 @@ int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret, return 0; } +int sd_rtnl_message_neigh_set_flags(sd_rtnl_message *m, uint8_t flags) { + struct ndmsg *ndm; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_neigh(m->hdr->nlmsg_type), -EINVAL); + + ndm = NLMSG_DATA(m->hdr); + ndm->ndm_flags |= flags; + + return 0; +} + +int sd_rtnl_message_neigh_set_state(sd_rtnl_message *m, uint16_t state) { + struct ndmsg *ndm; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_neigh(m->hdr->nlmsg_type), -EINVAL); + + ndm = NLMSG_DATA(m->hdr); + ndm->ndm_state |= state; + + return 0; +} + +int sd_rtnl_message_neigh_get_flags(sd_rtnl_message *m, uint8_t *flags) { + struct ndmsg *ndm; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_neigh(m->hdr->nlmsg_type), -EINVAL); + + ndm = NLMSG_DATA(m->hdr); + *flags = ndm->ndm_flags; + + return 0; +} + +int sd_rtnl_message_neigh_get_state(sd_rtnl_message *m, uint16_t *state) { + struct ndmsg *ndm; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_neigh(m->hdr->nlmsg_type), -EINVAL); + + ndm = NLMSG_DATA(m->hdr); + *state = ndm->ndm_state; + + return 0; +} + int sd_rtnl_message_neigh_get_family(sd_rtnl_message *m, int *family) { struct ndmsg *ndm; @@ -255,7 +305,9 @@ int sd_rtnl_message_new_neigh(sd_rtnl *rtnl, sd_rtnl_message **ret, uint16_t nlm int r; assert_return(rtnl_message_type_is_neigh(nlmsg_type), -EINVAL); - assert_return(ndm_family == AF_INET || ndm_family == AF_INET6, -EINVAL); + assert_return(ndm_family == AF_INET || + ndm_family == AF_INET6 || + ndm_family == PF_BRIDGE, -EINVAL); assert_return(ret, -EINVAL); r = message_new(rtnl, ret, nlmsg_type); @@ -532,7 +584,7 @@ sd_rtnl_message *sd_rtnl_message_ref(sd_rtnl_message *m) { } sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m) { - if (m && REFCNT_DEC(m->n_ref) <= 0) { + if (m && REFCNT_DEC(m->n_ref) == 0) { unsigned i; free(m->hdr); @@ -557,6 +609,49 @@ int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type) { return 0; } +int sd_rtnl_message_get_family(sd_rtnl_message *m, int *family) { + assert_return(m, -EINVAL); + assert_return(family, -EINVAL); + + assert(m->hdr); + + if (rtnl_message_type_is_link(m->hdr->nlmsg_type)) { + struct ifinfomsg *ifi; + + ifi = NLMSG_DATA(m->hdr); + + *family = ifi->ifi_family; + + return 0; + } else if (rtnl_message_type_is_route(m->hdr->nlmsg_type)) { + struct rtmsg *rtm; + + rtm = NLMSG_DATA(m->hdr); + + *family = rtm->rtm_family; + + return 0; + } else if (rtnl_message_type_is_neigh(m->hdr->nlmsg_type)) { + struct ndmsg *ndm; + + ndm = NLMSG_DATA(m->hdr); + + *family = ndm->ndm_family; + + return 0; + } else if (rtnl_message_type_is_addr(m->hdr->nlmsg_type)) { + struct ifaddrmsg *ifa; + + ifa = NLMSG_DATA(m->hdr); + + *family = ifa->ifa_family; + + return 0; + } + + return -ENOTSUP; +} + int sd_rtnl_message_is_broadcast(sd_rtnl_message *m) { assert_return(m, -EINVAL); @@ -846,16 +941,37 @@ int sd_rtnl_message_open_container(sd_rtnl_message *m, unsigned short type) { assert_return(m->n_containers < RTNL_CONTAINER_DEPTH, -ERANGE); r = message_attribute_has_type(m, type, NLA_NESTED); - if (r < 0) - return r; - else + if (r < 0) { + const NLTypeSystemUnion *type_system_union; + int family; + + r = message_attribute_has_type(m, type, NLA_UNION); + if (r < 0) + return r; + size = (size_t) r; + + r = sd_rtnl_message_get_family(m, &family); + if (r < 0) + return r; + + r = type_system_get_type_system_union(m->container_type_system[m->n_containers], &type_system_union, type); + if (r < 0) + return r; + + r = type_system_union_protocol_get_type_system(type_system_union, + &m->container_type_system[m->n_containers + 1], + family); + if (r < 0) + return r; + } else { size = (size_t)r; - r = type_system_get_type_system(m->container_type_system[m->n_containers], - &m->container_type_system[m->n_containers + 1], - type); - if (r < 0) - return r; + r = type_system_get_type_system(m->container_type_system[m->n_containers], + &m->container_type_system[m->n_containers + 1], + type); + if (r < 0) + return r; + } r = add_rtattr(m, type | NLA_F_NESTED, NULL, size); if (r < 0) @@ -1129,7 +1245,6 @@ int sd_rtnl_message_enter_container(sd_rtnl_message *m, unsigned short type) { return r; } else if (nl_type->type == NLA_UNION) { const NLTypeSystemUnion *type_system_union; - const char *key; r = type_system_get_type_system_union(m->container_type_system[m->n_containers], &type_system_union, @@ -1137,15 +1252,42 @@ int sd_rtnl_message_enter_container(sd_rtnl_message *m, unsigned short type) { if (r < 0) return r; - r = sd_rtnl_message_read_string(m, type_system_union->match, &key); - if (r < 0) - return r; + switch (type_system_union->match_type) { + case NL_MATCH_SIBLING: + { + const char *key; - r = type_system_union_get_type_system(type_system_union, - &type_system, - key); - if (r < 0) - return r; + r = sd_rtnl_message_read_string(m, type_system_union->match, &key); + if (r < 0) + return r; + + r = type_system_union_get_type_system(type_system_union, + &type_system, + key); + if (r < 0) + return r; + + break; + } + case NL_MATCH_PROTOCOL: + { + int family; + + r = sd_rtnl_message_get_family(m, &family); + if (r < 0) + return r; + + r = type_system_union_protocol_get_type_system(type_system_union, + &type_system, + family); + if (r < 0) + return r; + + break; + } + default: + assert_not_reached("sd-rtnl: invalid type system union type"); + } } else return -EINVAL; @@ -1294,11 +1436,11 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool /* no data */ if (errno == ENOBUFS) log_debug("rtnl: kernel receive buffer overrun"); + else if (errno == EAGAIN) + log_debug("rtnl: no data in socket"); - return (errno == EAGAIN) ? 0 : -errno; - } else if (r == 0) - /* connection was closed by the kernel */ - return -ECONNRESET; + return (errno == EAGAIN || errno == EINTR) ? 0 : -errno; + } for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && @@ -1307,8 +1449,10 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool struct ucred *ucred = (void *)CMSG_DATA(cmsg); /* from the kernel */ - if (ucred->uid == 0 && ucred->pid == 0) + if (ucred->pid == 0) auth = true; + else + log_debug("rtnl: ignoring message from PID "PID_FMT, ucred->pid); } else if (cmsg->cmsg_level == SOL_NETLINK && cmsg->cmsg_type == NETLINK_PKTINFO && cmsg->cmsg_len == CMSG_LEN(sizeof(struct nl_pktinfo))) { @@ -1319,9 +1463,17 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool } } - if (!auth) + if (!auth) { /* not from the kernel, ignore */ + if (peek) { + /* drop the message */ + r = recvmsg(fd, &msg, 0); + if (r < 0) + return (errno == EAGAIN || errno == EINTR) ? 0 : -errno; + } + return 0; + } if (group) *_group = group; @@ -1410,7 +1562,7 @@ int socket_read_message(sd_rtnl *rtnl) { r = type_system_get_type(NULL, &nl_type, new_msg->nlmsg_type); if (r < 0) { if (r == -ENOTSUP) - log_debug("sd-rtnl: ignored message with unknown type: %u", + log_debug("sd-rtnl: ignored message with unknown type: %i", new_msg->nlmsg_type); continue; diff --git a/src/libsystemd/sd-rtnl/rtnl-types.c b/src/libsystemd/sd-rtnl/rtnl-types.c index a1db2ab76..a4c71f378 100644 --- a/src/libsystemd/sd-rtnl/rtnl-types.c +++ b/src/libsystemd/sd-rtnl/rtnl-types.c @@ -31,6 +31,7 @@ #include #include +#include #include #include "macro.h" @@ -45,6 +46,9 @@ static const NLType rtnl_link_info_data_veth_types[VETH_INFO_MAX + 1] = { [VETH_INFO_PEER] = { .type = NLA_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) }, }; +static const NLType rtnl_link_info_data_ipvlan_types[IFLA_IPVLAN_MAX + 1] = { + [IFLA_IPVLAN_MODE] = { .type = NLA_U16 }, +}; static const NLType rtnl_link_info_data_macvlan_types[IFLA_MACVLAN_MAX + 1] = { [IFLA_MACVLAN_MODE] = { .type = NLA_U32 }, @@ -149,6 +153,17 @@ static const NLType rtnl_link_info_data_ipvti_types[IFLA_VTI_MAX + 1] = { [IFLA_VTI_REMOTE] = { .type = NLA_IN_ADDR }, }; +static const NLType rtnl_link_info_data_ip6tnl_types[IFLA_IPTUN_MAX + 1] = { + [IFLA_IPTUN_LINK] = { .type = NLA_U32 }, + [IFLA_IPTUN_LOCAL] = { .type = NLA_IN_ADDR }, + [IFLA_IPTUN_REMOTE] = { .type = NLA_IN_ADDR }, + [IFLA_IPTUN_TTL] = { .type = NLA_U8 }, + [IFLA_IPTUN_FLAGS] = { .type = NLA_U32 }, + [IFLA_IPTUN_PROTO] = { .type = NLA_U8 }, + [IFLA_IPTUN_ENCAP_LIMIT] = { .type = NLA_U8 }, + [IFLA_IPTUN_FLOWINFO] = { .type = NLA_U32}, +}; + /* these strings must match the .kind entries in the kernel */ static const char* const nl_union_link_info_data_table[_NL_UNION_LINK_INFO_DATA_MAX] = { [NL_UNION_LINK_INFO_DATA_BOND] = "bond", @@ -157,11 +172,16 @@ static const char* const nl_union_link_info_data_table[_NL_UNION_LINK_INFO_DATA_ [NL_UNION_LINK_INFO_DATA_VETH] = "veth", [NL_UNION_LINK_INFO_DATA_DUMMY] = "dummy", [NL_UNION_LINK_INFO_DATA_MACVLAN] = "macvlan", + [NL_UNION_LINK_INFO_DATA_IPVLAN] = "ipvlan", [NL_UNION_LINK_INFO_DATA_VXLAN] = "vxlan", [NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL] = "ipip", [NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL] = "gre", + [NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL] = "gretap", + [NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL] = "ip6gre", + [NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL] = "ip6gretap", [NL_UNION_LINK_INFO_DATA_SIT_TUNNEL] = "sit", [NL_UNION_LINK_INFO_DATA_VTI_TUNNEL] = "vti", + [NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL] = "ip6tnl", }; DEFINE_STRING_TABLE_LOOKUP(nl_union_link_info_data, NLUnionLinkInfoData); @@ -177,22 +197,34 @@ static const NLTypeSystem rtnl_link_info_data_type_systems[_NL_UNION_LINK_INFO_D .types = rtnl_link_info_data_veth_types }, [NL_UNION_LINK_INFO_DATA_MACVLAN] = { .max = ELEMENTSOF(rtnl_link_info_data_macvlan_types) - 1, .types = rtnl_link_info_data_macvlan_types }, + [NL_UNION_LINK_INFO_DATA_IPVLAN] = { .max = ELEMENTSOF(rtnl_link_info_data_ipvlan_types) - 1, + .types = rtnl_link_info_data_ipvlan_types }, [NL_UNION_LINK_INFO_DATA_VXLAN] = { .max = ELEMENTSOF(rtnl_link_info_data_vxlan_types) - 1, .types = rtnl_link_info_data_vxlan_types }, [NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_iptun_types) - 1, .types = rtnl_link_info_data_iptun_types }, [NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ipgre_types) - 1, .types = rtnl_link_info_data_ipgre_types }, + [NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ipgre_types) - 1, + .types = rtnl_link_info_data_ipgre_types }, + [NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ipgre_types) - 1, + .types = rtnl_link_info_data_ipgre_types }, + [NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ipgre_types) - 1, + .types = rtnl_link_info_data_ipgre_types }, [NL_UNION_LINK_INFO_DATA_SIT_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_iptun_types) - 1, .types = rtnl_link_info_data_iptun_types }, [NL_UNION_LINK_INFO_DATA_VTI_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ipvti_types) - 1, .types = rtnl_link_info_data_ipvti_types }, + [NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL] = { .max = ELEMENTSOF(rtnl_link_info_data_ip6tnl_types) - 1, + .types = rtnl_link_info_data_ip6tnl_types }, + }; static const NLTypeSystemUnion rtnl_link_info_data_type_system_union = { .num = _NL_UNION_LINK_INFO_DATA_MAX, .lookup = nl_union_link_info_data_from_string, .type_systems = rtnl_link_info_data_type_systems, + .match_type = NL_MATCH_SIBLING, .match = IFLA_INFO_KIND, }; @@ -211,7 +243,7 @@ static const NLTypeSystem rtnl_link_info_type_system = { .types = rtnl_link_info_types, }; -static const struct NLType rtnl_bridge_port_types[IFLA_BRPORT_MAX + 1] = { +static const struct NLType rtnl_prot_info_bridge_port_types[IFLA_BRPORT_MAX + 1] = { [IFLA_BRPORT_STATE] = { .type = NLA_U8 }, [IFLA_BRPORT_COST] = { .type = NLA_U32 }, [IFLA_BRPORT_PRIORITY] = { .type = NLA_U16 }, @@ -222,9 +254,42 @@ static const struct NLType rtnl_bridge_port_types[IFLA_BRPORT_MAX + 1] = { [IFLA_BRPORT_UNICAST_FLOOD] = { .type = NLA_U8 }, }; -static const NLTypeSystem rtnl_bridge_port_type_system = { - .max = ELEMENTSOF(rtnl_bridge_port_types) - 1, - .types = rtnl_bridge_port_types, +static const NLTypeSystem rtnl_prot_info_type_systems[AF_MAX] = { + [AF_BRIDGE] = { .max = ELEMENTSOF(rtnl_prot_info_bridge_port_types) - 1, + .types = rtnl_prot_info_bridge_port_types }, +}; + +static const NLTypeSystemUnion rtnl_prot_info_type_system_union = { + .num = AF_MAX, + .type_systems = rtnl_prot_info_type_systems, + .match_type = NL_MATCH_PROTOCOL, +}; + +static const struct NLType rtnl_af_spec_inet6_types[IFLA_INET6_MAX + 1] = { + [IFLA_INET6_FLAGS] = { .type = NLA_U32 }, +/* + IFLA_INET6_CONF, + IFLA_INET6_STATS, + IFLA_INET6_MCAST, + IFLA_INET6_CACHEINFO, + IFLA_INET6_ICMP6STATS, +*/ + [IFLA_INET6_TOKEN] = { .type = NLA_IN_ADDR }, + [IFLA_INET6_ADDR_GEN_MODE] = { .type = NLA_U8 }, +}; + +static const NLTypeSystem rtnl_af_spec_inet6_type_system = { + .max = ELEMENTSOF(rtnl_af_spec_inet6_types) - 1, + .types = rtnl_af_spec_inet6_types, +}; + +static const NLType rtnl_af_spec_types[AF_MAX + 1] = { + [AF_INET6] = { .type = NLA_NESTED, .type_system = &rtnl_af_spec_inet6_type_system }, +}; + +static const NLTypeSystem rtnl_af_spec_type_system = { + .max = ELEMENTSOF(rtnl_af_spec_types) - 1, + .types = rtnl_af_spec_types, }; static const NLType rtnl_link_types[IFLA_MAX + 1 ] = { @@ -242,9 +307,8 @@ static const NLType rtnl_link_types[IFLA_MAX + 1 ] = { [IFLA_MASTER] = { .type = NLA_U32 }, /* [IFLA_WIRELESS], - [IFLA_PROTINFO], */ - [IFLA_PROTINFO] = { .type = NLA_NESTED, .type_system = &rtnl_bridge_port_type_system }, + [IFLA_PROTINFO] = { .type = NLA_UNION, .type_system_union = &rtnl_prot_info_type_system_union }, [IFLA_TXQLEN] = { .type = NLA_U32 }, /* [IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) }, @@ -261,7 +325,9 @@ static const NLType rtnl_link_types[IFLA_MAX + 1 ] = { [IFLA_STATS64], [IFLA_VF_PORTS] = { .type = NLA_NESTED }, [IFLA_PORT_SELF] = { .type = NLA_NESTED }, - [IFLA_AF_SPEC] = { .type = NLA_NESTED }, +*/ + [IFLA_AF_SPEC] = { .type = NLA_NESTED, .type_system = &rtnl_af_spec_type_system }, +/* [IFLA_VF_PORTS], [IFLA_PORT_SELF], [IFLA_AF_SPEC], @@ -332,15 +398,12 @@ static const NLTypeSystem rtnl_route_type_system = { static const NLType rtnl_neigh_types[NDA_MAX + 1] = { [NDA_DST] = { .type = NLA_IN_ADDR }, [NDA_LLADDR] = { .type = NLA_ETHER_ADDR }, -/* - NDA_CACHEINFO, - NDA_PROBES, - NDA_VLAN, - NDA_PORT - NDA_VNI - NDA_IFINDEX - NDA_MASTER -*/ + [NDA_CACHEINFO] = { .type = NLA_CACHE_INFO, .size = sizeof(struct nda_cacheinfo) }, + [NDA_PROBES] = { .type = NLA_U32 }, + [NDA_VLAN] = { .type = NLA_U16 }, + [NDA_PORT] = { .type = NLA_U16 }, + [NDA_VNI] = { .type = NLA_U32 }, + [NDA_IFINDEX] = { .type = NLA_U32 }, }; static const NLTypeSystem rtnl_neigh_type_system = { @@ -435,6 +498,7 @@ int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union int type; assert(type_system_union); + assert_return(type_system_union->match_type == NL_MATCH_SIBLING, -EINVAL); assert(type_system_union->lookup); assert(type_system_union->type_systems); assert(ret); @@ -450,3 +514,25 @@ int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union return 0; } + +int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, uint16_t protocol) { + const NLTypeSystem *type_system; + + assert(type_system_union); + assert(type_system_union->type_systems); + assert(ret); + assert_return(type_system_union->match_type == NL_MATCH_PROTOCOL, -EINVAL); + assert_return(protocol < type_system_union->num, -EINVAL); + + if (protocol >= type_system_union->num) + return -ENOTSUP; + + type_system = &type_system_union->type_systems[protocol]; + + if (!type_system) + return -ENOTSUP; + + *ret = type_system; + + return 0; +} diff --git a/src/libsystemd/sd-rtnl/rtnl-types.h b/src/libsystemd/sd-rtnl/rtnl-types.h index 862174601..1ab944498 100644 --- a/src/libsystemd/sd-rtnl/rtnl-types.h +++ b/src/libsystemd/sd-rtnl/rtnl-types.h @@ -36,12 +36,18 @@ enum { NLA_UNION, }; +typedef enum NLMatchType { + NL_MATCH_SIBLING, + NL_MATCH_PROTOCOL, +} NLMatchType; + typedef struct NLTypeSystemUnion NLTypeSystemUnion; typedef struct NLTypeSystem NLTypeSystem; typedef struct NLType NLType; struct NLTypeSystemUnion { int num; + NLMatchType match_type; uint16_t match; int (*lookup)(const char *); const NLTypeSystem *type_systems; @@ -63,6 +69,7 @@ int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, ui int type_system_get_type_system(const NLTypeSystem *type_system, const NLTypeSystem **ret, uint16_t type); int type_system_get_type_system_union(const NLTypeSystem *type_system, const NLTypeSystemUnion **ret, uint16_t type); int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, const char *key); +int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, uint16_t protocol); typedef enum NLUnionLinkInfoData { NL_UNION_LINK_INFO_DATA_BOND, @@ -71,11 +78,16 @@ typedef enum NLUnionLinkInfoData { NL_UNION_LINK_INFO_DATA_VETH, NL_UNION_LINK_INFO_DATA_DUMMY, NL_UNION_LINK_INFO_DATA_MACVLAN, + NL_UNION_LINK_INFO_DATA_IPVLAN, NL_UNION_LINK_INFO_DATA_VXLAN, NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL, NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL, + NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL, + NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL, + NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL, NL_UNION_LINK_INFO_DATA_SIT_TUNNEL, NL_UNION_LINK_INFO_DATA_VTI_TUNNEL, + NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL, _NL_UNION_LINK_INFO_DATA_MAX, _NL_UNION_LINK_INFO_DATA_INVALID = -1 } NLUnionLinkInfoData; diff --git a/src/libsystemd/sd-rtnl/rtnl-util.c b/src/libsystemd/sd-rtnl/rtnl-util.c index 194a267b0..5666ea44c 100644 --- a/src/libsystemd/sd-rtnl/rtnl-util.c +++ b/src/libsystemd/sd-rtnl/rtnl-util.c @@ -107,12 +107,10 @@ int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_rtnl_message assert(error <= 0); - r = message_new(NULL, ret, NLMSG_SPACE(sizeof(struct nlmsgerr))); + r = message_new(NULL, ret, NLMSG_ERROR); if (r < 0) return r; - (*ret)->hdr->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr)); - (*ret)->hdr->nlmsg_type = NLMSG_ERROR; (*ret)->hdr->nlmsg_seq = serial; err = NLMSG_DATA((*ret)->hdr); diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c index abb011ea2..ae49c77e0 100644 --- a/src/libsystemd/sd-rtnl/sd-rtnl.c +++ b/src/libsystemd/sd-rtnl/sd-rtnl.c @@ -67,6 +67,31 @@ static int sd_rtnl_new(sd_rtnl **ret) { return 0; } +int sd_rtnl_new_from_netlink(sd_rtnl **ret, int fd) { + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + socklen_t addrlen; + int r; + + assert_return(ret, -EINVAL); + + r = sd_rtnl_new(&rtnl); + if (r < 0) + return r; + + addrlen = sizeof(rtnl->sockaddr); + + r = getsockname(fd, &rtnl->sockaddr.sa, &addrlen); + if (r < 0) + return -errno; + + rtnl->fd = fd; + + *ret = rtnl; + rtnl = NULL; + + return 0; +} + static bool rtnl_pid_changed(sd_rtnl *rtnl) { assert(rtnl); @@ -94,45 +119,42 @@ static int rtnl_compute_groups_ap(uint32_t *_groups, unsigned n_groups, va_list return 0; } -int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) { +static int rtnl_open_fd_ap(sd_rtnl **ret, int fd, unsigned n_groups, va_list ap) { _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; - va_list ap; socklen_t addrlen; int r, one = 1; assert_return(ret, -EINVAL); + assert_return(fd >= 0, -EINVAL); r = sd_rtnl_new(&rtnl); if (r < 0) return r; - rtnl->fd = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_ROUTE); - if (rtnl->fd < 0) - return -errno; - - r = setsockopt(rtnl->fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); + r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); if (r < 0) return -errno; - r = setsockopt(rtnl->fd, SOL_NETLINK, NETLINK_PKTINFO, &one, sizeof(one)); + r = setsockopt(fd, SOL_NETLINK, NETLINK_PKTINFO, &one, sizeof(one)); if (r < 0) return -errno; - va_start(ap, n_groups); r = rtnl_compute_groups_ap(&rtnl->sockaddr.nl.nl_groups, n_groups, ap); - va_end(ap); if (r < 0) return r; addrlen = sizeof(rtnl->sockaddr); - r = bind(rtnl->fd, &rtnl->sockaddr.sa, addrlen); - if (r < 0) + r = bind(fd, &rtnl->sockaddr.sa, addrlen); + /* ignore EINVAL to allow opening an already bound socket */ + if (r < 0 && errno != EINVAL) return -errno; - r = getsockname(rtnl->fd, &rtnl->sockaddr.sa, &addrlen); + r = getsockname(fd, &rtnl->sockaddr.sa, &addrlen); if (r < 0) - return r; + return -errno; + + rtnl->fd = fd; *ret = rtnl; rtnl = NULL; @@ -140,6 +162,37 @@ int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) { return 0; } +int sd_rtnl_open_fd(sd_rtnl **ret, int fd, unsigned n_groups, ...) { + va_list ap; + int r; + + va_start(ap, n_groups); + r = rtnl_open_fd_ap(ret, fd, n_groups, ap); + va_end(ap); + + return r; +} + +int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) { + va_list ap; + int fd, r; + + fd = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_ROUTE); + if (fd < 0) + return -errno; + + va_start(ap, n_groups); + r = rtnl_open_fd_ap(ret, fd, n_groups, ap); + va_end(ap); + + if (r < 0) { + safe_close(fd); + return r; + } + + return 0; +} + int sd_rtnl_inc_rcvbuf(const sd_rtnl *const rtnl, const int size) { return fd_inc_rcvbuf(rtnl->fd, size); } @@ -160,7 +213,7 @@ sd_rtnl *sd_rtnl_unref(sd_rtnl *rtnl) { assert_return(!rtnl_pid_changed(rtnl), NULL); - if (REFCNT_DEC(rtnl->n_ref) <= 0) { + if (REFCNT_DEC(rtnl->n_ref) == 0) { struct match_callback *f; unsigned i; @@ -352,9 +405,12 @@ static int process_timeout(sd_rtnl *rtnl) { hashmap_remove(rtnl->reply_callbacks, &c->serial); r = c->callback(rtnl, m, c->userdata); + if (r < 0) + log_debug_errno(r, "sd-rtnl: timedout callback failed: %m"); + free(c); - return r < 0 ? r : 1; + return 1; } static int process_reply(sd_rtnl *rtnl, sd_rtnl_message *m) { @@ -377,9 +433,12 @@ static int process_reply(sd_rtnl *rtnl, sd_rtnl_message *m) { prioq_remove(rtnl->reply_callbacks_prioq, c, &c->prioq_idx); r = c->callback(rtnl, m, c->userdata); + if (r < 0) + log_debug_errno(r, "sd-rtnl: callback failed: %m"); + free(c); - return r; + return 1; } static int process_match(sd_rtnl *rtnl, sd_rtnl_message *m) { @@ -397,12 +456,16 @@ static int process_match(sd_rtnl *rtnl, sd_rtnl_message *m) { LIST_FOREACH(match_callbacks, c, rtnl->match_callbacks) { if (type == c->type) { r = c->callback(rtnl, m, c->userdata); - if (r != 0) - return r; + if (r != 0) { + if (r < 0) + log_debug_errno(r, "sd-rtnl: match callback failed: %m"); + + break; + } } } - return 0; + return 1; } static int process_running(sd_rtnl *rtnl, sd_rtnl_message **ret) { @@ -489,7 +552,7 @@ static int rtnl_poll(sd_rtnl *rtnl, bool need_more, uint64_t timeout_usec) { if (need_more) /* Caller wants more data, and doesn't care about * what's been read or any other timeouts. */ - return e |= POLLIN; + e |= POLLIN; else { usec_t until; /* Caller wants to process if there is something to @@ -701,6 +764,8 @@ int sd_rtnl_call(sd_rtnl *rtnl, r = rtnl_poll(rtnl, true, left); if (r < 0) return r; + else if (r == 0) + return -ETIMEDOUT; r = dispatch_wqueue(rtnl); if (r < 0) diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c index 72d8fe227..02f7a8e38 100644 --- a/src/libsystemd/sd-rtnl/test-rtnl.c +++ b/src/libsystemd/sd-rtnl/test-rtnl.c @@ -31,8 +31,26 @@ #include "missing.h" #include "rtnl-internal.h" +static void test_message_link_bridge(sd_rtnl *rtnl) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *message = NULL; + uint32_t cost; + + assert_se(sd_rtnl_message_new_link(rtnl, &message, RTM_NEWLINK, 1) >= 0); + assert_se(sd_rtnl_message_link_set_family(message, PF_BRIDGE) >= 0); + assert_se(sd_rtnl_message_open_container(message, IFLA_PROTINFO) >= 0); + assert_se(sd_rtnl_message_append_u32(message, IFLA_BRPORT_COST, 10) >= 0); + assert_se(sd_rtnl_message_close_container(message) >= 0); + + assert_se(sd_rtnl_message_rewind(message) >= 0); + + assert_se(sd_rtnl_message_enter_container(message, IFLA_PROTINFO) >= 0); + assert_se(sd_rtnl_message_read_u32(message, IFLA_BRPORT_COST, &cost) >= 0); + assert_se(cost == 10); + assert_se(sd_rtnl_message_exit_container(message) >= 0); +} + static void test_link_configure(sd_rtnl *rtnl, int ifindex) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *message; + _cleanup_rtnl_message_unref_ sd_rtnl_message *message = NULL; const char *mac = "98:fe:94:3f:c6:18", *name = "test"; char buffer[ETHER_ADDR_TO_STRING_MAX]; unsigned int mtu = 1450, mtu_out; @@ -353,6 +371,13 @@ static void test_get_addresses(sd_rtnl *rtnl) { } } +static void test_message(void) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL; + + assert_se(rtnl_message_new_synthetic_error(-ETIMEDOUT, 1, &m) >= 0); + assert_se(sd_rtnl_message_get_errno(m) == -ETIMEDOUT); +} + int main(void) { sd_rtnl *rtnl; sd_rtnl_message *m; @@ -361,6 +386,8 @@ int main(void) { int if_loopback; uint16_t type; + test_message(); + test_match(); test_multiple(); @@ -385,6 +412,8 @@ int main(void) { test_get_addresses(rtnl); + test_message_link_bridge(rtnl); + assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_GETLINK, if_loopback) >= 0); assert_se(m); diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index 16ee1f4be..9863901a3 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -139,7 +139,7 @@ static int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex) char num[32]; udev_device->ifindex = ifindex; - snprintf(num, sizeof(num), "%u", ifindex); + snprintf(num, sizeof(num), "%d", ifindex); udev_device_add_property(udev_device, "IFINDEX", num); return 0; } @@ -161,7 +161,7 @@ _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device) return udev_device->devnum; } -int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) +static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) { char num[32]; @@ -258,7 +258,7 @@ static int udev_device_set_devtype(struct udev_device *udev_device, const char * return 0; } -int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem) +static int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem) { free(udev_device->subsystem); udev_device->subsystem = strdup(subsystem); @@ -392,6 +392,44 @@ static struct udev_list_entry *udev_device_add_property_from_string(struct udev_ return udev_device_add_property(udev_device, name, val); } +static int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath) +{ + const char *pos; + size_t len; + + free(udev_device->syspath); + udev_device->syspath = strdup(syspath); + if (udev_device->syspath == NULL) + return -ENOMEM; + udev_device->devpath = udev_device->syspath + strlen("/sys"); + udev_device_add_property(udev_device, "DEVPATH", udev_device->devpath); + + pos = strrchr(udev_device->syspath, '/'); + if (pos == NULL) + return -EINVAL; + udev_device->sysname = strdup(&pos[1]); + if (udev_device->sysname == NULL) + return -ENOMEM; + + /* some devices have '!' in their name, change that to '/' */ + len = 0; + while (udev_device->sysname[len] != '\0') { + if (udev_device->sysname[len] == '!') + udev_device->sysname[len] = '/'; + len++; + } + + /* trailing number */ + while (len > 0 && isdigit(udev_device->sysname[--len])) + udev_device->sysnum = &udev_device->sysname[len]; + + /* sysname is completely numeric */ + if (len == 0) + udev_device->sysnum = NULL; + + return 0; +} + /* * parse property string, and if needed, update internal values accordingly * @@ -637,7 +675,7 @@ void udev_device_set_info_loaded(struct udev_device *device) device->info_loaded = true; } -struct udev_device *udev_device_new(struct udev *udev) +static struct udev_device *udev_device_new(struct udev *udev) { struct udev_device *udev_device; @@ -1607,44 +1645,6 @@ _public_ struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_ return udev_list_get_entry(&udev_device->sysattr_list); } -int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath) -{ - const char *pos; - size_t len; - - free(udev_device->syspath); - udev_device->syspath = strdup(syspath); - if (udev_device->syspath == NULL) - return -ENOMEM; - udev_device->devpath = udev_device->syspath + strlen("/sys"); - udev_device_add_property(udev_device, "DEVPATH", udev_device->devpath); - - pos = strrchr(udev_device->syspath, '/'); - if (pos == NULL) - return -EINVAL; - udev_device->sysname = strdup(&pos[1]); - if (udev_device->sysname == NULL) - return -ENOMEM; - - /* some devices have '!' in their name, change that to '/' */ - len = 0; - while (udev_device->sysname[len] != '\0') { - if (udev_device->sysname[len] == '!') - udev_device->sysname[len] = '/'; - len++; - } - - /* trailing number */ - while (len > 0 && isdigit(udev_device->sysname[--len])) - udev_device->sysnum = &udev_device->sysname[len]; - - /* sysname is completely numeric */ - if (len == 0) - udev_device->sysnum = NULL; - - return 0; -} - static int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode) { free(udev_device->devnode); @@ -1686,7 +1686,7 @@ const char *udev_device_get_id_filename(struct udev_device *udev_device) udev_device->id_filename = NULL; } else if (udev_device_get_ifindex(udev_device) > 0) { /* use netdev ifindex -- n3 */ - if (asprintf(&udev_device->id_filename, "n%u", udev_device_get_ifindex(udev_device)) < 0) + if (asprintf(&udev_device->id_filename, "n%i", udev_device_get_ifindex(udev_device)) < 0) udev_device->id_filename = NULL; } else { /* @@ -1922,3 +1922,91 @@ void udev_device_set_db_persist(struct udev_device *udev_device) { udev_device->db_persist = true; } + +int udev_device_rename(struct udev_device *udev_device, const char *name) +{ + _cleanup_free_ char *dirname = NULL; + char *new_syspath; + int r; + + if (udev_device == NULL || name == NULL) + return -EINVAL; + + dirname = dirname_malloc(udev_device->syspath); + if (!dirname) + return -ENOMEM; + + new_syspath = strjoina(dirname, "/", name); + + r = udev_device_set_syspath(udev_device, new_syspath); + if (r < 0) + return r; + + return 0; +} + +struct udev_device *udev_device_shallow_clone(struct udev_device *old_device) +{ + struct udev_device *device; + + if (old_device == NULL) + return NULL; + + device = udev_device_new(old_device->udev); + if (!device) { + errno = ENOMEM; + + return NULL; + } + + udev_device_set_syspath(device, udev_device_get_syspath(old_device)); + udev_device_set_subsystem(device, udev_device_get_subsystem(old_device)); + udev_device_set_devnum(device, udev_device_get_devnum(old_device)); + + return device; +} + +struct udev_device *udev_device_new_from_nulstr(struct udev *udev, char *nulstr, ssize_t buflen) { + struct udev_device *device; + ssize_t bufpos = 0; + + if (nulstr == NULL || buflen <= 0) { + errno = EINVAL; + + return NULL; + } + + device = udev_device_new(udev); + if (!device) { + errno = ENOMEM; + + return NULL; + } + + udev_device_set_info_loaded(device); + + while (bufpos < buflen) { + char *key; + size_t keylen; + + key = nulstr + bufpos; + keylen = strlen(key); + if (keylen == 0) + break; + + bufpos += keylen + 1; + udev_device_add_property_from_string_parse(device, key); + } + + if (udev_device_add_property_from_string_parse_finish(device) < 0) { + log_debug("missing values, invalid device"); + + udev_device_unref(device); + + errno = EINVAL; + + return NULL; + } + + return device; +} diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index 05a685868..98951fb85 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -1,8 +1,7 @@ /*** This file is part of systemd. - Copyright 2012 Kay Sievers - Copyright 2008 Alan Jenkins + Copyright Tom Gundersen systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -18,18 +17,9 @@ along with systemd; If not, see . ***/ -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "libudev-private.h" -#include "libudev-hwdb-def.h" +#include "sd-hwdb.h" +#include "hwdb-util.h" /** * SECTION:libudev-hwdb @@ -47,220 +37,11 @@ struct udev_hwdb { struct udev *udev; int refcount; - FILE *f; - struct stat st; - union { - struct trie_header_f *head; - const char *map; - }; + sd_hwdb *hwdb; struct udev_list properties_list; }; -struct linebuf { - char bytes[LINE_MAX]; - size_t size; - size_t len; -}; - -static void linebuf_init(struct linebuf *buf) { - buf->size = 0; - buf->len = 0; -} - -static const char *linebuf_get(struct linebuf *buf) { - if (buf->len + 1 >= sizeof(buf->bytes)) - return NULL; - buf->bytes[buf->len] = '\0'; - return buf->bytes; -} - -static bool linebuf_add(struct linebuf *buf, const char *s, size_t len) { - if (buf->len + len >= sizeof(buf->bytes)) - return false; - memcpy(buf->bytes + buf->len, s, len); - buf->len += len; - return true; -} - -static bool linebuf_add_char(struct linebuf *buf, char c) -{ - if (buf->len + 1 >= sizeof(buf->bytes)) - return false; - buf->bytes[buf->len++] = c; - return true; -} - -static void linebuf_rem(struct linebuf *buf, size_t count) { - assert(buf->len >= count); - buf->len -= count; -} - -static void linebuf_rem_char(struct linebuf *buf) { - linebuf_rem(buf, 1); -} - -static const struct trie_child_entry_f *trie_node_children(struct udev_hwdb *hwdb, const struct trie_node_f *node) { - return (const struct trie_child_entry_f *)((const char *)node + le64toh(hwdb->head->node_size)); -} - -static const struct trie_value_entry_f *trie_node_values(struct udev_hwdb *hwdb, const struct trie_node_f *node) { - const char *base = (const char *)node; - - base += le64toh(hwdb->head->node_size); - base += node->children_count * le64toh(hwdb->head->child_entry_size); - return (const struct trie_value_entry_f *)base; -} - -static const struct trie_node_f *trie_node_from_off(struct udev_hwdb *hwdb, le64_t off) { - return (const struct trie_node_f *)(hwdb->map + le64toh(off)); -} - -static const char *trie_string(struct udev_hwdb *hwdb, le64_t off) { - return hwdb->map + le64toh(off); -} - -static int trie_children_cmp_f(const void *v1, const void *v2) { - const struct trie_child_entry_f *n1 = v1; - const struct trie_child_entry_f *n2 = v2; - - return n1->c - n2->c; -} - -static const struct trie_node_f *node_lookup_f(struct udev_hwdb *hwdb, const struct trie_node_f *node, uint8_t c) { - struct trie_child_entry_f *child; - struct trie_child_entry_f search; - - search.c = c; - child = bsearch(&search, trie_node_children(hwdb, node), node->children_count, - le64toh(hwdb->head->child_entry_size), trie_children_cmp_f); - if (child) - return trie_node_from_off(hwdb, child->child_off); - return NULL; -} - -static int hwdb_add_property(struct udev_hwdb *hwdb, const char *key, const char *value) { - /* - * Silently ignore all properties which do not start with a - * space; future extensions might use additional prefixes. - */ - if (key[0] != ' ') - return 0; - - if (udev_list_entry_add(&hwdb->properties_list, key+1, value) == NULL) - return -ENOMEM; - return 0; -} - -static int trie_fnmatch_f(struct udev_hwdb *hwdb, const struct trie_node_f *node, size_t p, - struct linebuf *buf, const char *search) { - size_t len; - size_t i; - const char *prefix; - int err; - - prefix = trie_string(hwdb, node->prefix_off); - len = strlen(prefix + p); - linebuf_add(buf, prefix + p, len); - - for (i = 0; i < node->children_count; i++) { - const struct trie_child_entry_f *child = &trie_node_children(hwdb, node)[i]; - - linebuf_add_char(buf, child->c); - err = trie_fnmatch_f(hwdb, trie_node_from_off(hwdb, child->child_off), 0, buf, search); - if (err < 0) - return err; - linebuf_rem_char(buf); - } - - if (le64toh(node->values_count) && fnmatch(linebuf_get(buf), search, 0) == 0) - for (i = 0; i < le64toh(node->values_count); i++) { - err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off), - trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off)); - if (err < 0) - return err; - } - - linebuf_rem(buf, len); - return 0; -} - -static int trie_search_f(struct udev_hwdb *hwdb, const char *search) { - struct linebuf buf; - const struct trie_node_f *node; - size_t i = 0; - int err; - - linebuf_init(&buf); - - node = trie_node_from_off(hwdb, hwdb->head->nodes_root_off); - while (node) { - const struct trie_node_f *child; - size_t p = 0; - - if (node->prefix_off) { - uint8_t c; - - for (; (c = trie_string(hwdb, node->prefix_off)[p]); p++) { - if (c == '*' || c == '?' || c == '[') - return trie_fnmatch_f(hwdb, node, p, &buf, search + i + p); - if (c != search[i + p]) - return 0; - } - i += p; - } - - child = node_lookup_f(hwdb, node, '*'); - if (child) { - linebuf_add_char(&buf, '*'); - err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); - if (err < 0) - return err; - linebuf_rem_char(&buf); - } - - child = node_lookup_f(hwdb, node, '?'); - if (child) { - linebuf_add_char(&buf, '?'); - err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); - if (err < 0) - return err; - linebuf_rem_char(&buf); - } - - child = node_lookup_f(hwdb, node, '['); - if (child) { - linebuf_add_char(&buf, '['); - err = trie_fnmatch_f(hwdb, child, 0, &buf, search + i); - if (err < 0) - return err; - linebuf_rem_char(&buf); - } - - if (search[i] == '\0') { - size_t n; - - for (n = 0; n < le64toh(node->values_count); n++) { - err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[n].key_off), - trie_string(hwdb, trie_node_values(hwdb, node)[n].value_off)); - if (err < 0) - return err; - } - return 0; - } - - child = node_lookup_f(hwdb, node, search[i]); - node = child; - i++; - } - return 0; -} - -static const char hwdb_bin_paths[] = - "/etc/udev/hwdb.bin\0" - UDEVLIBEXECDIR "/hwdb.bin\0"; - - /** * udev_hwdb_new: * @udev: udev library context @@ -270,64 +51,26 @@ static const char hwdb_bin_paths[] = * Returns: a hwdb context. **/ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) { + _cleanup_hwdb_unref_ sd_hwdb *hwdb_internal = NULL; struct udev_hwdb *hwdb; - const char *hwdb_bin_path; - const char sig[] = HWDB_SIG; - - hwdb = new0(struct udev_hwdb, 1); - if (!hwdb) - return NULL; - - hwdb->refcount = 1; - udev_list_init(udev, &hwdb->properties_list, true); + int r; - /* find hwdb.bin in hwdb_bin_paths */ - NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) { - hwdb->f = fopen(hwdb_bin_path, "re"); - if (hwdb->f) - break; - else if (errno == ENOENT) - continue; - else { - log_debug_errno(errno, "error reading %s: %m", hwdb_bin_path); - udev_hwdb_unref(hwdb); - return NULL; - } - } + assert_return(udev, NULL); - if (!hwdb->f) { - log_debug("hwdb.bin does not exist, please run udevadm hwdb --update"); - udev_hwdb_unref(hwdb); + r = sd_hwdb_new(&hwdb_internal); + if (r < 0) return NULL; - } - if (fstat(fileno(hwdb->f), &hwdb->st) < 0 || - (size_t)hwdb->st.st_size < offsetof(struct trie_header_f, strings_len) + 8) { - log_debug_errno(errno, "error reading %s: %m", hwdb_bin_path); - udev_hwdb_unref(hwdb); + hwdb = new0(struct udev_hwdb, 1); + if (!hwdb) return NULL; - } - hwdb->map = mmap(0, hwdb->st.st_size, PROT_READ, MAP_SHARED, fileno(hwdb->f), 0); - if (hwdb->map == MAP_FAILED) { - log_debug_errno(errno, "error mapping %s: %m", hwdb_bin_path); - udev_hwdb_unref(hwdb); - return NULL; - } + hwdb->refcount = 1; + hwdb->hwdb = hwdb_internal; + hwdb_internal = NULL; - if (memcmp(hwdb->map, sig, sizeof(hwdb->head->signature)) != 0 || - (size_t)hwdb->st.st_size != le64toh(hwdb->head->file_size)) { - log_debug("error recognizing the format of %s", hwdb_bin_path); - udev_hwdb_unref(hwdb); - return NULL; - } + udev_list_init(udev, &hwdb->properties_list, true); - log_debug("=== trie on-disk ==="); - log_debug("tool version: %"PRIu64, le64toh(hwdb->head->tool_version)); - log_debug("file size: %8"PRIu64" bytes", hwdb->st.st_size); - log_debug("header size %8"PRIu64" bytes", le64toh(hwdb->head->header_size)); - log_debug("strings %8"PRIu64" bytes", le64toh(hwdb->head->strings_len)); - log_debug("nodes %8"PRIu64" bytes", le64toh(hwdb->head->nodes_len)); return hwdb; } @@ -361,40 +104,12 @@ _public_ struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb) { hwdb->refcount--; if (hwdb->refcount > 0) return NULL; - if (hwdb->map) - munmap((void *)hwdb->map, hwdb->st.st_size); - if (hwdb->f) - fclose(hwdb->f); + sd_hwdb_unref(hwdb->hwdb); udev_list_cleanup(&hwdb->properties_list); free(hwdb); return NULL; } -bool udev_hwdb_validate(struct udev_hwdb *hwdb) { - bool found = false; - const char* p; - struct stat st; - - if (!hwdb) - return false; - if (!hwdb->f) - return false; - - /* if hwdb.bin doesn't exist anywhere, we need to update */ - NULSTR_FOREACH(p, hwdb_bin_paths) { - if (stat(p, &st) >= 0) { - found = true; - break; - } - } - if (!found) - return true; - - if (timespec_load(&hwdb->st.st_mtim) != timespec_load(&st.st_mtim)) - return true; - return false; -} - /** * udev_hwdb_get_properties_list_entry: * @hwdb: context @@ -409,18 +124,21 @@ bool udev_hwdb_validate(struct udev_hwdb *hwdb) { * Returns: a udev_list_entry. */ _public_ struct udev_list_entry *udev_hwdb_get_properties_list_entry(struct udev_hwdb *hwdb, const char *modalias, unsigned int flags) { - int err; + const char *key, *value; - if (!hwdb || !hwdb->f) { + if (!hwdb || !modalias) { errno = EINVAL; return NULL; } udev_list_cleanup(&hwdb->properties_list); - err = trie_search_f(hwdb, modalias); - if (err < 0) { - errno = -err; - return NULL; + + SD_HWDB_FOREACH_PROPERTY(hwdb->hwdb, modalias, key, value) { + if (udev_list_entry_add(&hwdb->properties_list, key, value) == NULL) { + errno = ENOMEM; + return NULL; + } } + return udev_list_get_entry(&hwdb->properties_list); } diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index e8d6b4a61..3f1fee7f7 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -109,10 +109,7 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev) /* we consider udev running when /dev is on devtmpfs */ static bool udev_has_devtmpfs(struct udev *udev) { - union file_handle_union h = { - .handle.handle_bytes = MAX_HANDLE_SZ - }; - + union file_handle_union h = FILE_HANDLE_INIT; _cleanup_fclose_ FILE *f = NULL; char line[LINE_MAX], *e; int mount_id; @@ -582,9 +579,13 @@ _public_ struct udev_device *udev_monitor_receive_device(struct udev_monitor *ud struct cmsghdr *cmsg; union sockaddr_union snl; struct ucred *cred; - char buf[8192]; + union { + struct udev_monitor_netlink_header nlh; + char raw[8192]; + } buf; ssize_t buflen; ssize_t bufpos; + bool is_initialized = false; retry: if (udev_monitor == NULL) @@ -606,7 +607,7 @@ retry: return NULL; } - if (buflen < 32 || (size_t)buflen >= sizeof(buf)) { + if (buflen < 32 || (smsg.msg_flags & MSG_TRUNC)) { log_debug("invalid message length"); return NULL; } @@ -620,8 +621,8 @@ retry: } } else if (snl.nl.nl_groups == UDEV_MONITOR_KERNEL) { if (snl.nl.nl_pid > 0) { - log_debug("multicast kernel netlink message from pid %d ignored", - snl.nl.nl_pid); + log_debug("multicast kernel netlink message from PID %"PRIu32" ignored", + snl.nl.nl_pid); return NULL; } } @@ -634,70 +635,46 @@ retry: cred = (struct ucred *)CMSG_DATA(cmsg); if (cred->uid != 0) { - log_debug("sender uid=%d, message ignored", cred->uid); + log_debug("sender uid="UID_FMT", message ignored", cred->uid); return NULL; } - udev_device = udev_device_new(udev_monitor->udev); - if (udev_device == NULL) - return NULL; - - if (memcmp(buf, "libudev", 8) == 0) { - struct udev_monitor_netlink_header *nlh; - + if (memcmp(buf.raw, "libudev", 8) == 0) { /* udev message needs proper version magic */ - nlh = (struct udev_monitor_netlink_header *) buf; - if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) { + if (buf.nlh.magic != htonl(UDEV_MONITOR_MAGIC)) { log_debug("unrecognized message signature (%x != %x)", - nlh->magic, htonl(UDEV_MONITOR_MAGIC)); - udev_device_unref(udev_device); + buf.nlh.magic, htonl(UDEV_MONITOR_MAGIC)); return NULL; } - if (nlh->properties_off+32 > (size_t)buflen) { - udev_device_unref(udev_device); + if (buf.nlh.properties_off+32 > (size_t)buflen) { return NULL; } - bufpos = nlh->properties_off; + bufpos = buf.nlh.properties_off; /* devices received from udev are always initialized */ - udev_device_set_is_initialized(udev_device); + is_initialized = true; } else { /* kernel message with header */ - bufpos = strlen(buf) + 1; + bufpos = strlen(buf.raw) + 1; if ((size_t)bufpos < sizeof("a@/d") || bufpos >= buflen) { log_debug("invalid message length"); - udev_device_unref(udev_device); return NULL; } /* check message header */ - if (strstr(buf, "@/") == NULL) { + if (strstr(buf.raw, "@/") == NULL) { log_debug("unrecognized message header"); - udev_device_unref(udev_device); return NULL; } } - udev_device_set_info_loaded(udev_device); - - while (bufpos < buflen) { - char *key; - size_t keylen; - - key = &buf[bufpos]; - keylen = strlen(key); - if (keylen == 0) - break; - bufpos += keylen + 1; - udev_device_add_property_from_string_parse(udev_device, key); - } - - if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { - log_debug("missing values, invalid device"); - udev_device_unref(udev_device); + udev_device = udev_device_new_from_nulstr(udev_monitor->udev, &buf.raw[bufpos], buflen - bufpos); + if (!udev_device) return NULL; - } + + if (is_initialized) + udev_device_set_is_initialized(udev_device); /* skip device, if it does not pass the current filter */ if (!passes_filter(udev_monitor, udev_device)) { diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index 64f132f91..96363040a 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -37,13 +37,12 @@ int udev_get_rules_path(struct udev *udev, char **path[], usec_t *ts_usec[]); /* libudev-device.c */ -struct udev_device *udev_device_new(struct udev *udev); +struct udev_device *udev_device_new_from_nulstr(struct udev *udev, char *nulstr, ssize_t buflen); +struct udev_device *udev_device_shallow_clone(struct udev_device *old_device); mode_t udev_device_get_devnode_mode(struct udev_device *udev_device); uid_t udev_device_get_devnode_uid(struct udev_device *udev_device); gid_t udev_device_get_devnode_gid(struct udev_device *udev_device); -int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem); -int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath); -int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); +int udev_device_rename(struct udev_device *udev_device, const char *new_name); int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink); void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value); @@ -133,9 +132,6 @@ void udev_queue_export_cleanup(struct udev_queue_export *udev_queue_export); int udev_queue_export_device_queued(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device); int udev_queue_export_device_finished(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device); -/* libudev-hwdb.c */ -bool udev_hwdb_validate(struct udev_hwdb *hwdb); - /* libudev-util.c */ #define UTIL_PATH_SIZE 1024 #define UTIL_NAME_SIZE 512 diff --git a/src/locale/kbd-model-map b/src/locale/kbd-model-map index f39d99117..8fa984f83 100644 --- a/src/locale/kbd-model-map +++ b/src/locale/kbd-model-map @@ -52,6 +52,7 @@ ro-cedilla ro pc105 cedilla terminate:ctrl_alt_bksp ie ie pc105 - terminate:ctrl_alt_bksp et ee pc105 - terminate:ctrl_alt_bksp sk-qwerty sk pc105 - terminate:ctrl_alt_bksp,qwerty +sk-qwertz sk pc105 - terminate:ctrl_alt_bksp fr-latin9 fr pc105 latin9 terminate:ctrl_alt_bksp fr_CH-latin1 ch pc105 fr terminate:ctrl_alt_bksp cf ca pc105 - terminate:ctrl_alt_bksp @@ -61,4 +62,7 @@ gr gr,us pc105 - terminate:ctrl_alt_bksp,grp:shifts_toggle,grp_led:scroll by by,us pc105 - terminate:ctrl_alt_bksp,grp:shifts_toggle,grp_led:scroll il il pc105 - terminate:ctrl_alt_bksp kazakh kz,us pc105 - terminate:ctrl_alt_bksp,grp:shifts_toggle,grp_led:scroll +lt.baltic lt pc105 - terminate:ctrl_alt_bksp +lt.l4 lt pc105 - terminate:ctrl_alt_bksp lt lt pc105 - terminate:ctrl_alt_bksp +khmer kh,us pc105 - terminate:ctrl_alt_bksp diff --git a/src/locale/language-fallback-map b/src/locale/language-fallback-map new file mode 100644 index 000000000..6aadda091 --- /dev/null +++ b/src/locale/language-fallback-map @@ -0,0 +1,9 @@ +csb_PL csb:pl +en_AU en_AU:en_GB +en_IE en_IE:en_GB +en_NZ en_NZ:en_GB +en_ZA en_ZA:en_GB +it_CH it_CH:it_IT +mai_IN mai:hi +nds_DE nds:de +szl_PL szl:pl diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 58b8984bc..41a88a828 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -497,10 +497,10 @@ static void help(void) { " status Show current locale settings\n" " set-locale LOCALE... Set system locale\n" " list-locales Show known locales\n" - " set-keymap MAP [MAP] Set virtual console keyboard mapping\n" + " set-keymap MAP [MAP] Set console and X11 keyboard mappings\n" " list-keymaps Show known virtual console keyboard mappings\n" " set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]\n" - " Set X11 keyboard mapping\n" + " Set X11 and console keyboard mappings\n" " list-x11-keymap-models Show known X11 keyboard mapping models\n" " list-x11-keymap-layouts Show known X11 keyboard mapping layouts\n" " list-x11-keymap-variants [LAYOUT]\n" @@ -565,7 +565,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; diff --git a/src/locale/localed.c b/src/locale/localed.c index 8d60d0ff1..d1c90d613 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "sd-bus.h" @@ -40,6 +39,7 @@ #include "bus-message.h" #include "event-util.h" #include "locale-util.h" +#include "selinux-util.h" #ifdef HAVE_XKBCOMMON #include @@ -512,7 +512,9 @@ static const char* strnulldash(const char *s) { return isempty(s) || streq(s, "-") ? NULL : s; } -static int read_next_mapping(FILE *f, unsigned *n, char ***a) { +static int read_next_mapping(const char* filename, + unsigned min_fields, unsigned max_fields, + FILE *f, unsigned *n, char ***a) { assert(f); assert(n); assert(a); @@ -521,6 +523,7 @@ static int read_next_mapping(FILE *f, unsigned *n, char ***a) { char line[LINE_MAX]; char *l, **b; int r; + size_t length; errno = 0; if (!fgets(line, sizeof(line), f)) { @@ -541,8 +544,9 @@ static int read_next_mapping(FILE *f, unsigned *n, char ***a) { if (r < 0) return r; - if (strv_length(b) < 5) { - log_error("Invalid line "SYSTEMD_KBD_MODEL_MAP":%u, ignoring.", *n); + length = strv_length(b); + if (length < min_fields || length > max_fields) { + log_error("Invalid line %s:%u, ignoring.", filename, *n); strv_free(b); continue; @@ -579,7 +583,7 @@ static int vconsole_convert_to_x11(Context *c, sd_bus *bus) { _cleanup_strv_free_ char **a = NULL; int r; - r = read_next_mapping(f, &n, &a); + r = read_next_mapping(SYSTEMD_KBD_MODEL_MAP, 5, UINT_MAX, f, &n, &a); if (r < 0) return r; if (r == 0) @@ -677,7 +681,7 @@ static int find_legacy_keymap(Context *c, char **new_keymap) { _cleanup_strv_free_ char **a = NULL; unsigned matching = 0; - r = read_next_mapping(f, &n, &a); + r = read_next_mapping(SYSTEMD_KBD_MODEL_MAP, 5, UINT_MAX, f, &n, &a); if (r < 0) return r; if (r == 0) @@ -752,6 +756,35 @@ static int find_legacy_keymap(Context *c, char **new_keymap) { return 0; } +static int find_language_fallback(const char *lang, char **language) { + _cleanup_fclose_ FILE *f = NULL; + unsigned n = 0; + + assert(language); + + f = fopen(SYSTEMD_LANGUAGE_FALLBACK_MAP, "re"); + if (!f) + return -errno; + + for (;;) { + _cleanup_strv_free_ char **a = NULL; + int r; + + r = read_next_mapping(SYSTEMD_LANGUAGE_FALLBACK_MAP, 2, 2, f, &n, &a); + if (r <= 0) + return r; + + if (streq(lang, a[0])) { + assert(strv_length(a) == 2); + *language = a[1]; + a[1] = NULL; + return 1; + } + } + + assert_not_reached("should not be here"); +} + static int x11_convert_to_vconsole(Context *c, sd_bus *bus) { bool modified = false; int r; @@ -841,9 +874,10 @@ static int method_set_locale(sd_bus *bus, sd_bus_message *m, void *userdata, sd_ Context *c = userdata; _cleanup_strv_free_ char **l = NULL; char **i; + const char *lang = NULL; int interactive; bool modified = false; - bool passed[_LOCALE_MAX] = {}; + bool have[_LOCALE_MAX] = {}; int p; int r; @@ -867,7 +901,10 @@ static int method_set_locale(sd_bus *bus, sd_bus_message *m, void *userdata, sd_ (*i)[k] == '=' && locale_is_valid((*i) + k + 1)) { valid = true; - passed[p] = true; + have[p] = true; + + if (p == LOCALE_LANG) + lang = (*i) + k + 1; if (!streq_ptr(*i + k + 1, c->locale[p])) modified = true; @@ -880,10 +917,31 @@ static int method_set_locale(sd_bus *bus, sd_bus_message *m, void *userdata, sd_ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid Locale data."); } + /* If LANG was specified, but not LANGUAGE, check if we should + * set it based on the language fallback table. */ + if (have[LOCALE_LANG] && !have[LOCALE_LANGUAGE]) { + _cleanup_free_ char *language = NULL; + + assert(lang); + + (void) find_language_fallback(lang, &language); + if (language) { + log_debug("Converted LANG=%s to LANGUAGE=%s", lang, language); + if (!streq_ptr(language, c->locale[LOCALE_LANGUAGE])) { + r = strv_extendf(&l, "LANGUAGE=%s", language); + if (r < 0) + return r; + + have[LOCALE_LANGUAGE] = true; + modified = true; + } + } + } + /* Check whether a variable is unset */ if (!modified) for (p = 0; p < _LOCALE_MAX; p++) - if (!isempty(c->locale[p]) && !passed[p]) { + if (!isempty(c->locale[p]) && !have[p]) { modified = true; break; } @@ -911,7 +969,7 @@ static int method_set_locale(sd_bus *bus, sd_bus_message *m, void *userdata, sd_ } for (p = 0; p < _LOCALE_MAX; p++) { - if (passed[p]) + if (have[p]) continue; free_and_replace(&c->locale[p], NULL); @@ -965,8 +1023,8 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata if (!streq_ptr(keymap, c->vc_keymap) || !streq_ptr(keymap_toggle, c->vc_keymap_toggle)) { - if ((keymap && (!filename_is_safe(keymap) || !string_is_safe(keymap))) || - (keymap_toggle && (!filename_is_safe(keymap_toggle) || !string_is_safe(keymap_toggle)))) + if ((keymap && (!filename_is_valid(keymap) || !string_is_safe(keymap))) || + (keymap_toggle && (!filename_is_valid(keymap_toggle) || !string_is_safe(keymap_toggle)))) return sd_bus_error_set_errnof(error, -EINVAL, "Received invalid keymap data"); r = bus_verify_polkit_async(m, CAP_SYS_ADMIN, "org.freedesktop.locale1.set-keyboard", interactive, &c->polkit_registry, error); @@ -1011,7 +1069,7 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char *format, va_list args) { const char *fmt; - fmt = strappenda("libxkbcommon: ", format); + fmt = strjoina("libxkbcommon: ", format); log_internalv(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, fmt, args); } diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 6505eb89c..b0eede9a3 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -37,9 +37,11 @@ #include "strv.h" #include "unit-name.h" #include "sysfs-show.h" +#include "logs-show.h" #include "cgroup-show.h" #include "cgroup-util.h" #include "spawn-polkit-agent.h" +#include "verbs.h" static char **arg_property = NULL; static bool arg_all = false; @@ -49,8 +51,10 @@ static bool arg_legend = true; static const char *arg_kill_who = NULL; static int arg_signal = SIGTERM; static BusTransport arg_transport = BUS_TRANSPORT_LOCAL; -static bool arg_ask_password = true; static char *arg_host = NULL; +static bool arg_ask_password = true; +static unsigned arg_lines = 10; +static OutputMode arg_output = OUTPUT_SHORT; static void pager_open_if_enabled(void) { @@ -73,14 +77,27 @@ static void polkit_agent_open_if_enabled(void) { polkit_agent_open(); } -static int list_sessions(sd_bus *bus, char **args, unsigned n) { +static OutputFlags get_output_flags(void) { + + return + arg_all * OUTPUT_SHOW_ALL | + arg_full * OUTPUT_FULL_WIDTH | + (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | + on_tty() * OUTPUT_COLOR; +} + +static int list_sessions(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; const char *id, *user, *seat, *object; + sd_bus *bus = userdata; unsigned k = 0; uint32_t uid; int r; + assert(bus); + assert(argv); + pager_open_if_enabled(); r = sd_bus_call_method( @@ -116,14 +133,18 @@ static int list_sessions(sd_bus *bus, char **args, unsigned n) { return 0; } -static int list_users(sd_bus *bus, char **args, unsigned n) { +static int list_users(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; const char *user, *object; + sd_bus *bus = userdata; unsigned k = 0; uint32_t uid; int r; + assert(bus); + assert(argv); + pager_open_if_enabled(); r = sd_bus_call_method( @@ -159,13 +180,17 @@ static int list_users(sd_bus *bus, char **args, unsigned n) { return 0; } -static int list_seats(sd_bus *bus, char **args, unsigned n) { +static int list_seats(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; const char *seat, *object; + sd_bus *bus = userdata; unsigned k = 0; int r; + assert(bus); + assert(argv); + pager_open_if_enabled(); r = sd_bus_call_method( @@ -206,7 +231,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_free_ char *path = NULL; const char *cgroup; - int r, output_flags; + int r; unsigned c; assert(bus); @@ -239,17 +264,13 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit if (cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup, false) != 0 && leader <= 0) return 0; - output_flags = - arg_all * OUTPUT_SHOW_ALL | - arg_full * OUTPUT_FULL_WIDTH; - c = columns(); if (c > 18) c -= 18; else c = 0; - show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t ", c, false, &leader, leader > 0, output_flags); + show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t ", c, false, &leader, leader > 0, get_output_flags()); return 0; } @@ -257,7 +278,7 @@ typedef struct SessionStatusInfo { const char *id; uid_t uid; const char *name; - usec_t timestamp; + struct dual_timestamp timestamp; unsigned int vtnr; const char *seat; const char *tty; @@ -277,7 +298,7 @@ typedef struct SessionStatusInfo { typedef struct UserStatusInfo { uid_t uid; const char *name; - usec_t timestamp; + struct dual_timestamp timestamp; const char *state; char **sessions; const char *display; @@ -357,24 +378,25 @@ static int prop_map_sessions_strv(sd_bus *bus, const char *member, sd_bus_messag static int print_session_status_info(sd_bus *bus, const char *path, bool *new_line) { static const struct bus_properties_map map[] = { - { "Id", "s", NULL, offsetof(SessionStatusInfo, id) }, - { "Name", "s", NULL, offsetof(SessionStatusInfo, name) }, - { "TTY", "s", NULL, offsetof(SessionStatusInfo, tty) }, - { "Display", "s", NULL, offsetof(SessionStatusInfo, display) }, - { "RemoteHost", "s", NULL, offsetof(SessionStatusInfo, remote_host) }, - { "RemoteUser", "s", NULL, offsetof(SessionStatusInfo, remote_user) }, - { "Service", "s", NULL, offsetof(SessionStatusInfo, service) }, - { "Desktop", "s", NULL, offsetof(SessionStatusInfo, desktop) }, - { "Type", "s", NULL, offsetof(SessionStatusInfo, type) }, - { "Class", "s", NULL, offsetof(SessionStatusInfo, class) }, - { "Scope", "s", NULL, offsetof(SessionStatusInfo, scope) }, - { "State", "s", NULL, offsetof(SessionStatusInfo, state) }, - { "VTNr", "u", NULL, offsetof(SessionStatusInfo, vtnr) }, - { "Leader", "u", NULL, offsetof(SessionStatusInfo, leader) }, - { "Remote", "b", NULL, offsetof(SessionStatusInfo, remote) }, - { "Timestamp", "t", NULL, offsetof(SessionStatusInfo, timestamp) }, - { "User", "(uo)", prop_map_first_of_struct, offsetof(SessionStatusInfo, uid) }, - { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, seat) }, + { "Id", "s", NULL, offsetof(SessionStatusInfo, id) }, + { "Name", "s", NULL, offsetof(SessionStatusInfo, name) }, + { "TTY", "s", NULL, offsetof(SessionStatusInfo, tty) }, + { "Display", "s", NULL, offsetof(SessionStatusInfo, display) }, + { "RemoteHost", "s", NULL, offsetof(SessionStatusInfo, remote_host) }, + { "RemoteUser", "s", NULL, offsetof(SessionStatusInfo, remote_user) }, + { "Service", "s", NULL, offsetof(SessionStatusInfo, service) }, + { "Desktop", "s", NULL, offsetof(SessionStatusInfo, desktop) }, + { "Type", "s", NULL, offsetof(SessionStatusInfo, type) }, + { "Class", "s", NULL, offsetof(SessionStatusInfo, class) }, + { "Scope", "s", NULL, offsetof(SessionStatusInfo, scope) }, + { "State", "s", NULL, offsetof(SessionStatusInfo, state) }, + { "VTNr", "u", NULL, offsetof(SessionStatusInfo, vtnr) }, + { "Leader", "u", NULL, offsetof(SessionStatusInfo, leader) }, + { "Remote", "b", NULL, offsetof(SessionStatusInfo, remote) }, + { "Timestamp", "t", NULL, offsetof(SessionStatusInfo, timestamp.realtime) }, + { "TimestampMonotonic", "t", NULL, offsetof(SessionStatusInfo, timestamp.monotonic) }, + { "User", "(uo)", prop_map_first_of_struct, offsetof(SessionStatusInfo, uid) }, + { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, seat) }, {} }; @@ -399,8 +421,8 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li else printf("%u\n", (unsigned) i.uid); - s1 = format_timestamp_relative(since1, sizeof(since1), i.timestamp); - s2 = format_timestamp(since2, sizeof(since2), i.timestamp); + s1 = format_timestamp_relative(since1, sizeof(since1), i.timestamp.realtime); + s2 = format_timestamp(since2, sizeof(since2), i.timestamp.realtime); if (s1) printf("\t Since: %s; %s\n", s2, s1); @@ -423,7 +445,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li printf("\t Seat: %s", i.seat); if (i.vtnr > 0) - printf("; vc%i", i.vtnr); + printf("; vc%u", i.vtnr); printf("\n"); } @@ -471,6 +493,22 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li if (i.scope) { printf("\t Unit: %s\n", i.scope); show_unit_cgroup(bus, "org.freedesktop.systemd1.Scope", i.scope, i.leader); + + if (arg_transport == BUS_TRANSPORT_LOCAL) { + + show_journal_by_unit( + stdout, + i.scope, + arg_output, + 0, + i.timestamp.monotonic, + arg_lines, + 0, + get_output_flags() | OUTPUT_BEGIN_NEWLINE, + SD_JOURNAL_LOCAL_ONLY, + true, + NULL); + } } return 0; @@ -479,13 +517,14 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li static int print_user_status_info(sd_bus *bus, const char *path, bool *new_line) { static const struct bus_properties_map map[] = { - { "Name", "s", NULL, offsetof(UserStatusInfo, name) }, - { "Slice", "s", NULL, offsetof(UserStatusInfo, slice) }, - { "State", "s", NULL, offsetof(UserStatusInfo, state) }, - { "UID", "u", NULL, offsetof(UserStatusInfo, uid) }, - { "Timestamp", "t", NULL, offsetof(UserStatusInfo, timestamp) }, - { "Display", "(so)", prop_map_first_of_struct, offsetof(UserStatusInfo, display) }, - { "Sessions", "a(so)", prop_map_sessions_strv, offsetof(UserStatusInfo, sessions) }, + { "Name", "s", NULL, offsetof(UserStatusInfo, name) }, + { "Slice", "s", NULL, offsetof(UserStatusInfo, slice) }, + { "State", "s", NULL, offsetof(UserStatusInfo, state) }, + { "UID", "u", NULL, offsetof(UserStatusInfo, uid) }, + { "Timestamp", "t", NULL, offsetof(UserStatusInfo, timestamp.realtime) }, + { "TimestampMonotonic", "t", NULL, offsetof(UserStatusInfo, timestamp.monotonic) }, + { "Display", "(so)", prop_map_first_of_struct, offsetof(UserStatusInfo, display) }, + { "Sessions", "a(so)", prop_map_sessions_strv, offsetof(UserStatusInfo, sessions) }, {} }; @@ -510,8 +549,8 @@ static int print_user_status_info(sd_bus *bus, const char *path, bool *new_line) else printf("%u\n", (unsigned) i.uid); - s1 = format_timestamp_relative(since1, sizeof(since1), i.timestamp); - s2 = format_timestamp(since2, sizeof(since2), i.timestamp); + s1 = format_timestamp_relative(since1, sizeof(since1), i.timestamp.realtime); + s2 = format_timestamp(since2, sizeof(since2), i.timestamp.realtime); if (s1) printf("\t Since: %s; %s\n", s2, s1); @@ -538,6 +577,19 @@ static int print_user_status_info(sd_bus *bus, const char *path, bool *new_line) if (i.slice) { printf("\t Unit: %s\n", i.slice); show_unit_cgroup(bus, "org.freedesktop.systemd1.Slice", i.slice, 0); + + show_journal_by_unit( + stdout, + i.slice, + arg_output, + 0, + i.timestamp.monotonic, + arg_lines, + 0, + get_output_flags() | OUTPUT_BEGIN_NEWLINE, + SD_JOURNAL_LOCAL_ONLY, + true, + NULL); } finish: @@ -620,25 +672,29 @@ static int show_properties(sd_bus *bus, const char *path, bool *new_line) { return r; } -static int show_session(sd_bus *bus, char **args, unsigned n) { +static int show_session(int argc, char *argv[], void *userdata) { bool properties, new_line = false; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; assert(bus); - assert(args); + assert(argv); - properties = !strstr(args[0], "status"); + properties = !strstr(argv[0], "status"); pager_open_if_enabled(); - if (properties && n <= 1) { + if (argc <= 1) { /* If not argument is specified inspect the manager * itself */ - return show_properties(bus, "/org/freedesktop/login1", &new_line); + if (properties) + return show_properties(bus, "/org/freedesktop/login1", &new_line); + + /* And in the pretty case, show data of the calling session */ + return print_session_status_info(bus, "/org/freedesktop/login1/session/self", &new_line); } - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message * reply = NULL; const char *path = NULL; @@ -650,7 +706,7 @@ static int show_session(sd_bus *bus, char **args, unsigned n) { "org.freedesktop.login1.Manager", "GetSession", &error, &reply, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Failed to get session: %s", bus_error_message(&error, r)); return r; @@ -672,33 +728,36 @@ static int show_session(sd_bus *bus, char **args, unsigned n) { return 0; } -static int show_user(sd_bus *bus, char **args, unsigned n) { +static int show_user(int argc, char *argv[], void *userdata) { bool properties, new_line = false; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; assert(bus); - assert(args); + assert(argv); - properties = !strstr(args[0], "status"); + properties = !strstr(argv[0], "status"); pager_open_if_enabled(); - if (properties && n <= 1) { + if (argc <= 1) { /* If not argument is specified inspect the manager * itself */ - return show_properties(bus, "/org/freedesktop/login1", &new_line); + if (properties) + return show_properties(bus, "/org/freedesktop/login1", &new_line); + + return print_user_status_info(bus, "/org/freedesktop/login1/user/self", &new_line); } - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message * reply = NULL; const char *path = NULL; uid_t uid; - r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL); + r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL); if (r < 0) - return log_error_errno(r, "Failed to look up user %s: %m", args[i]); + return log_error_errno(r, "Failed to look up user %s: %m", argv[i]); r = sd_bus_call_method( bus, @@ -729,25 +788,28 @@ static int show_user(sd_bus *bus, char **args, unsigned n) { return 0; } -static int show_seat(sd_bus *bus, char **args, unsigned n) { +static int show_seat(int argc, char *argv[], void *userdata) { bool properties, new_line = false; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; assert(bus); - assert(args); + assert(argv); - properties = !strstr(args[0], "status"); + properties = !strstr(argv[0], "status"); pager_open_if_enabled(); - if (properties && n <= 1) { + if (argc <= 1) { /* If not argument is specified inspect the manager * itself */ - return show_properties(bus, "/org/freedesktop/login1", &new_line); + if (properties) + return show_properties(bus, "/org/freedesktop/login1", &new_line); + + return print_seat_status_info(bus, "/org/freedesktop/login1/seat/self", &new_line); } - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message * reply = NULL; const char *path = NULL; @@ -759,7 +821,7 @@ static int show_seat(sd_bus *bus, char **args, unsigned n) { "org.freedesktop.login1.Manager", "GetSeat", &error, &reply, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Failed to get seat: %s", bus_error_message(&error, r)); return r; @@ -781,26 +843,43 @@ static int show_seat(sd_bus *bus, char **args, unsigned n) { return 0; } -static int activate(sd_bus *bus, char **args, unsigned n) { +static int activate(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + char *short_argv[3]; + int r, i; + + assert(bus); + assert(argv); + + polkit_agent_open_if_enabled(); - assert(args); + if (argc < 2) { + /* No argument? Let's convert this into the empty + * session name, which the calls will then resolve to + * the caller's session. */ - for (i = 1; i < n; i++) { + short_argv[0] = argv[0]; + short_argv[1] = (char*) ""; + short_argv[2] = NULL; + + argv = short_argv; + argc = 2; + } + + for (i = 1; i < argc; i++) { r = sd_bus_call_method ( bus, "org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", - streq(args[0], "lock-session") ? "LockSession" : - streq(args[0], "unlock-session") ? "UnlockSession" : - streq(args[0], "terminate-session") ? "TerminateSession" : + streq(argv[0], "lock-session") ? "LockSession" : + streq(argv[0], "unlock-session") ? "UnlockSession" : + streq(argv[0], "terminate-session") ? "TerminateSession" : "ActivateSession", &error, NULL, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Failed to issue method call: %s", bus_error_message(&error, -r)); return r; @@ -810,17 +889,20 @@ static int activate(sd_bus *bus, char **args, unsigned n) { return 0; } -static int kill_session(sd_bus *bus, char **args, unsigned n) { +static int kill_session(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; - assert(args); + assert(bus); + assert(argv); + + polkit_agent_open_if_enabled(); if (!arg_kill_who) arg_kill_who = "all"; - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { r = sd_bus_call_method ( bus, @@ -829,7 +911,7 @@ static int kill_session(sd_bus *bus, char **args, unsigned n) { "org.freedesktop.login1.Manager", "KillSession", &error, NULL, - "ssi", args[i], arg_kill_who, arg_signal); + "ssi", argv[i], arg_kill_who, arg_signal); if (r < 0) { log_error("Could not kill session: %s", bus_error_message(&error, -r)); return r; @@ -839,24 +921,38 @@ static int kill_session(sd_bus *bus, char **args, unsigned n) { return 0; } -static int enable_linger(sd_bus *bus, char **args, unsigned n) { +static int enable_linger(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; + sd_bus *bus = userdata; + char* short_argv[3]; bool b; - int r; + int r, i; - assert(args); + assert(bus); + assert(argv); polkit_agent_open_if_enabled(); - b = streq(args[0], "enable-linger"); + b = streq(argv[0], "enable-linger"); + + if (argc < 2) { + short_argv[0] = argv[0]; + short_argv[1] = (char*) ""; + short_argv[2] = NULL; + argv = short_argv; + argc = 2; + } - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { uid_t uid; - r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL); - if (r < 0) - return log_error_errno(r, "Failed to look up user %s: %m", args[i]); + if (isempty(argv[i])) + uid = UID_INVALID; + else { + r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL); + if (r < 0) + return log_error_errno(r, "Failed to look up user %s: %m", argv[i]); + } r = sd_bus_call_method ( bus, @@ -875,19 +971,22 @@ static int enable_linger(sd_bus *bus, char **args, unsigned n) { return 0; } -static int terminate_user(sd_bus *bus, char **args, unsigned n) { +static int terminate_user(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; - assert(args); + assert(bus); + assert(argv); - for (i = 1; i < n; i++) { + polkit_agent_open_if_enabled(); + + for (i = 1; i < argc; i++) { uid_t uid; - r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL); + r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL); if (r < 0) - return log_error_errno(r, "Failed to look up user %s: %m", args[i]); + return log_error_errno(r, "Failed to look up user %s: %m", argv[i]); r = sd_bus_call_method ( bus, @@ -906,22 +1005,25 @@ static int terminate_user(sd_bus *bus, char **args, unsigned n) { return 0; } -static int kill_user(sd_bus *bus, char **args, unsigned n) { +static int kill_user(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; - assert(args); + assert(bus); + assert(argv); + + polkit_agent_open_if_enabled(); if (!arg_kill_who) arg_kill_who = "all"; - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { uid_t uid; - r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL); + r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL); if (r < 0) - return log_error_errno(r, "Failed to look up user %s: %m", args[i]); + return log_error_errno(r, "Failed to look up user %s: %m", argv[i]); r = sd_bus_call_method ( bus, @@ -940,16 +1042,17 @@ static int kill_user(sd_bus *bus, char **args, unsigned n) { return 0; } -static int attach(sd_bus *bus, char **args, unsigned n) { +static int attach(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; - assert(args); + assert(bus); + assert(argv); polkit_agent_open_if_enabled(); - for (i = 2; i < n; i++) { + for (i = 2; i < argc; i++) { r = sd_bus_call_method ( bus, @@ -958,7 +1061,7 @@ static int attach(sd_bus *bus, char **args, unsigned n) { "org.freedesktop.login1.Manager", "AttachDevice", &error, NULL, - "ssb", args[1], args[i], true); + "ssb", argv[1], argv[i], true); if (r < 0) { log_error("Could not attach device: %s", bus_error_message(&error, -r)); @@ -969,11 +1072,13 @@ static int attach(sd_bus *bus, char **args, unsigned n) { return 0; } -static int flush_devices(sd_bus *bus, char **args, unsigned n) { +static int flush_devices(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; int r; - assert(args); + assert(bus); + assert(argv); polkit_agent_open_if_enabled(); @@ -991,18 +1096,22 @@ static int flush_devices(sd_bus *bus, char **args, unsigned n) { return r; } -static int lock_sessions(sd_bus *bus, char **args, unsigned n) { +static int lock_sessions(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; int r; - assert(args); + assert(bus); + assert(argv); - r = sd_bus_call_method ( + polkit_agent_open_if_enabled(); + + r = sd_bus_call_method( bus, "org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", - streq(args[0], "lock-sessions") ? "LockSessions" : "UnlockSessions", + streq(argv[0], "lock-sessions") ? "LockSessions" : "UnlockSessions", &error, NULL, NULL); if (r < 0) @@ -1011,23 +1120,26 @@ static int lock_sessions(sd_bus *bus, char **args, unsigned n) { return r; } -static int terminate_seat(sd_bus *bus, char **args, unsigned n) { +static int terminate_seat(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; - int r; + sd_bus *bus = userdata; + int r, i; - assert(args); + assert(bus); + assert(argv); + + polkit_agent_open_if_enabled(); - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { - r = sd_bus_call_method ( + r = sd_bus_call_method( bus, "org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "TerminateSeat", &error, NULL, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Could not terminate seat: %s", bus_error_message(&error, -r)); return r; @@ -1037,46 +1149,54 @@ static int terminate_seat(sd_bus *bus, char **args, unsigned n) { return 0; } -static void help(void) { +static int help(int argc, char *argv[], void *userdata) { + printf("%s [OPTIONS...] {COMMAND} ...\n\n" "Send control commands to or query the login manager.\n\n" - " -h --help Show this help\n" - " --version Show package version\n" - " --no-pager Do not pipe output into a pager\n" - " --no-legend Do not show the headers and footers\n" - " --no-ask-password Don't prompt for password\n" - " -H --host=[USER@]HOST Operate on remote host\n" - " -M --machine=CONTAINER Operate on local container\n" - " -p --property=NAME Show only properties by this name\n" - " -a --all Show all properties, including empty ones\n" - " -l --full Do not ellipsize output\n" - " --kill-who=WHO Who to send signal to\n" - " -s --signal=SIGNAL Which signal to send\n\n" - "Commands:\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --no-pager Do not pipe output into a pager\n" + " --no-legend Do not show the headers and footers\n" + " --no-ask-password Don't prompt for password\n" + " -H --host=[USER@]HOST Operate on remote host\n" + " -M --machine=CONTAINER Operate on local container\n" + " -p --property=NAME Show only properties by this name\n" + " -a --all Show all properties, including empty ones\n" + " -l --full Do not ellipsize output\n" + " --kill-who=WHO Who to send signal to\n" + " -s --signal=SIGNAL Which signal to send\n" + " -n --lines=INTEGER Number of journal entries to show\n" + " -o --output=STRING Change journal output mode (short, short-monotonic,\n" + " verbose, export, json, json-pretty, json-sse, cat)\n\n" + "Session Commands:\n" " list-sessions List sessions\n" - " session-status ID... Show session status\n" + " session-status [ID...] Show session status\n" " show-session [ID...] Show properties of sessions or the manager\n" - " activate ID Activate a session\n" - " lock-session ID... Screen lock one or more sessions\n" - " unlock-session ID... Screen unlock one or more sessions\n" + " activate [ID] Activate a session\n" + " lock-session [ID...] Screen lock one or more sessions\n" + " unlock-session [ID...] Screen unlock one or more sessions\n" " lock-sessions Screen lock all current sessions\n" " unlock-sessions Screen unlock all current sessions\n" " terminate-session ID... Terminate one or more sessions\n" - " kill-session ID... Send signal to processes of a session\n" + " kill-session ID... Send signal to processes of a session\n\n" + "User Commands:\n" " list-users List users\n" - " user-status USER... Show user status\n" + " user-status [USER...] Show user status\n" " show-user [USER...] Show properties of users or the manager\n" - " enable-linger USER... Enable linger state of one or more users\n" - " disable-linger USER... Disable linger state of one or more users\n" + " enable-linger [USER...] Enable linger state of one or more users\n" + " disable-linger [USER...] Disable linger state of one or more users\n" " terminate-user USER... Terminate all sessions of one or more users\n" - " kill-user USER... Send signal to processes of a user\n" + " kill-user USER... Send signal to processes of a user\n\n" + "Seat Commands:\n" " list-seats List seats\n" - " seat-status NAME... Show seat status\n" - " show-seat NAME... Show properties of one or more seats\n" + " seat-status [NAME...] Show seat status\n" + " show-seat [NAME...] Show properties of seats or the manager\n" " attach NAME DEVICE... Attach one or more devices to a seat\n" " flush-devices Flush all device associations\n" " terminate-seat NAME... Terminate all sessions on one or more seats\n" , program_invocation_short_name); + + return 0; } static int parse_argv(int argc, char *argv[]) { @@ -1102,6 +1222,8 @@ static int parse_argv(int argc, char *argv[]) { { "host", required_argument, NULL, 'H' }, { "machine", required_argument, NULL, 'M' }, { "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD }, + { "lines", required_argument, NULL, 'n' }, + { "output", required_argument, NULL, 'o' }, {} }; @@ -1110,12 +1232,12 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hp:als:H:M:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "hp:als:H:M:n:o:", options, NULL)) >= 0) switch (c) { case 'h': - help(); + help(0, NULL, NULL); return 0; case ARG_VERSION: @@ -1143,6 +1265,21 @@ static int parse_argv(int argc, char *argv[]) { arg_full = true; break; + case 'n': + if (safe_atou(optarg, &arg_lines) < 0) { + log_error("Failed to parse lines '%s'", optarg); + return -EINVAL; + } + break; + + case 'o': + arg_output = output_mode_from_string(optarg); + if (arg_output < 0) { + log_error("Unknown output '%s'.", optarg); + return -EINVAL; + } + break; + case ARG_NO_PAGER: arg_no_pager = true; break; @@ -1173,7 +1310,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; @@ -1187,101 +1324,37 @@ static int parse_argv(int argc, char *argv[]) { return 1; } -static int loginctl_main(sd_bus *bus, int argc, char *argv[]) { - - static const struct { - const char* verb; - const enum { - MORE, - LESS, - EQUAL - } argc_cmp; - const int argc; - int (* const dispatch)(sd_bus *bus, char **args, unsigned n); - } verbs[] = { - { "list-sessions", LESS, 1, list_sessions }, - { "session-status", MORE, 2, show_session }, - { "show-session", MORE, 1, show_session }, - { "activate", EQUAL, 2, activate }, - { "lock-session", MORE, 2, activate }, - { "unlock-session", MORE, 2, activate }, - { "lock-sessions", EQUAL, 1, lock_sessions }, - { "unlock-sessions", EQUAL, 1, lock_sessions }, - { "terminate-session", MORE, 2, activate }, - { "kill-session", MORE, 2, kill_session }, - { "list-users", EQUAL, 1, list_users }, - { "user-status", MORE, 2, show_user }, - { "show-user", MORE, 1, show_user }, - { "enable-linger", MORE, 2, enable_linger }, - { "disable-linger", MORE, 2, enable_linger }, - { "terminate-user", MORE, 2, terminate_user }, - { "kill-user", MORE, 2, kill_user }, - { "list-seats", EQUAL, 1, list_seats }, - { "seat-status", MORE, 2, show_seat }, - { "show-seat", MORE, 1, show_seat }, - { "attach", MORE, 3, attach }, - { "flush-devices", EQUAL, 1, flush_devices }, - { "terminate-seat", MORE, 2, terminate_seat }, +static int loginctl_main(int argc, char *argv[], sd_bus *bus) { + + static const Verb verbs[] = { + { "help", VERB_ANY, VERB_ANY, 0, help }, + { "list-sessions", VERB_ANY, 1, VERB_DEFAULT, list_sessions }, + { "session-status", VERB_ANY, VERB_ANY, 0, show_session }, + { "show-session", VERB_ANY, VERB_ANY, 0, show_session }, + { "activate", VERB_ANY, 2, 0, activate }, + { "lock-session", VERB_ANY, VERB_ANY, 0, activate }, + { "unlock-session", VERB_ANY, VERB_ANY, 0, activate }, + { "lock-sessions", VERB_ANY, 1, 0, lock_sessions }, + { "unlock-sessions", VERB_ANY, 1, 0, lock_sessions }, + { "terminate-session", 2, VERB_ANY, 0, activate }, + { "kill-session", 2, VERB_ANY, 0, kill_session }, + { "list-users", VERB_ANY, 1, 0, list_users }, + { "user-status", VERB_ANY, VERB_ANY, 0, show_user }, + { "show-user", VERB_ANY, VERB_ANY, 0, show_user }, + { "enable-linger", VERB_ANY, VERB_ANY, 0, enable_linger }, + { "disable-linger", VERB_ANY, VERB_ANY, 0, enable_linger }, + { "terminate-user", 2, VERB_ANY, 0, terminate_user }, + { "kill-user", 2, VERB_ANY, 0, kill_user }, + { "list-seats", VERB_ANY, 1, 0, list_seats }, + { "seat-status", VERB_ANY, VERB_ANY, 0, show_seat }, + { "show-seat", VERB_ANY, VERB_ANY, 0, show_seat }, + { "attach", 3, VERB_ANY, 0, attach }, + { "flush-devices", VERB_ANY, 1, 0, flush_devices }, + { "terminate-seat", 2, VERB_ANY, 0, terminate_seat }, + {} }; - int left; - unsigned i; - - assert(argc >= 0); - assert(argv); - - left = argc - optind; - - if (left <= 0) - /* Special rule: no arguments means "list-sessions" */ - i = 0; - else { - if (streq(argv[optind], "help")) { - help(); - return 0; - } - - for (i = 0; i < ELEMENTSOF(verbs); i++) - if (streq(argv[optind], verbs[i].verb)) - break; - - if (i >= ELEMENTSOF(verbs)) { - log_error("Unknown operation %s", argv[optind]); - return -EINVAL; - } - } - - switch (verbs[i].argc_cmp) { - - case EQUAL: - if (left != verbs[i].argc) { - log_error("Invalid number of arguments."); - return -EINVAL; - } - - break; - - case MORE: - if (left < verbs[i].argc) { - log_error("Too few arguments."); - return -EINVAL; - } - - break; - - case LESS: - if (left > verbs[i].argc) { - log_error("Too many arguments."); - return -EINVAL; - } - - break; - - default: - assert_not_reached("Unknown comparison operator."); - } - - return verbs[i].dispatch(bus, argv + optind, left); + return dispatch_verb(argc, argv, verbs, bus); } int main(int argc, char *argv[]) { @@ -1302,10 +1375,11 @@ int main(int argc, char *argv[]) { goto finish; } - r = loginctl_main(bus, argc, argv); + r = loginctl_main(argc, argv, bus); finish: pager_close(); + polkit_agent_close(); strv_free(arg_property); diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c index f7c6f3a4e..5856f9079 100644 --- a/src/login/logind-acl.c +++ b/src/login/logind-acl.c @@ -22,8 +22,6 @@ #include #include #include -#include -#include #include "util.h" #include "acl-util.h" diff --git a/src/login/logind-button.c b/src/login/logind-button.c index e22b106b3..d7211e66c 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -247,7 +247,7 @@ int button_open(Button *b) { b->fd = -1; } - p = strappenda("/dev/input/", b->name); + p = strjoina("/dev/input/", b->name); b->fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK); if (b->fd < 0) diff --git a/src/login/logind-core.c b/src/login/logind-core.c index 88694f9ba..a6ff5add9 100644 --- a/src/login/logind-core.c +++ b/src/login/logind-core.c @@ -101,7 +101,7 @@ int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User ** assert(m); assert(name); - u = hashmap_get(m->users, ULONG_TO_PTR((unsigned long) uid)); + u = hashmap_get(m->users, UID_TO_PTR(uid)); if (!u) { u = user_new(m, uid, gid, name); if (!u) diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 48395f6f9..8b0bafd49 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "sd-id128.h" #include "sd-messages.h" @@ -40,9 +39,95 @@ #include "audit.h" #include "bus-util.h" #include "bus-error.h" -#include "logind.h" #include "bus-common-errors.h" #include "udev-util.h" +#include "selinux-util.h" +#include "logind.h" + +int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + Session *session; + int r; + + assert(m); + assert(message); + assert(ret); + + if (isempty(name)) { + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_SESSION|SD_BUS_CREDS_AUGMENT, &creds); + if (r < 0) + return r; + + r = sd_bus_creds_get_session(creds, &name); + if (r < 0) + return r; + } + + session = hashmap_get(m->sessions, name); + if (!session) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + + *ret = session; + return 0; +} + +int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret) { + User *user; + int r; + + assert(m); + assert(message); + assert(ret); + + if (uid == UID_INVALID) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + + /* Note that we get the owner UID of the session, not the actual client UID here! */ + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_OWNER_UID|SD_BUS_CREDS_AUGMENT, &creds); + if (r < 0) + return r; + + r = sd_bus_creds_get_owner_uid(creds, &uid); + if (r < 0) + return r; + } + + user = hashmap_get(m->users, UID_TO_PTR(uid)); + if (!user) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user "UID_FMT" known or logged in", uid); + + *ret = user; + return 0; +} + +int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret) { + Seat *seat; + int r; + + assert(m); + assert(message); + assert(ret); + + if (isempty(name)) { + Session *session; + + r = manager_get_session_from_creds(m, message, NULL, error, &session); + if (r < 0) + return r; + + seat = session->seat; + + if (!seat) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "Session has no seat."); + } else { + seat = hashmap_get(m->seats, name); + if (!seat) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", name); + } + + *ret = seat; + return 0; +} static int property_get_idle_hint( sd_bus *bus, @@ -145,9 +230,9 @@ static int method_get_session(sd_bus *bus, sd_bus_message *message, void *userda if (r < 0) return r; - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; p = session_bus_path(session); if (!p) @@ -173,23 +258,18 @@ static int method_get_session_by_pid(sd_bus *bus, sd_bus_message *message, void if (r < 0) return r; - if (pid == 0) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds); + if (pid <= 0) { + r = manager_get_session_from_creds(m, message, NULL, error, &session); if (r < 0) return r; - - r = sd_bus_creds_get_pid(creds, &pid); + } else { + r = manager_get_session_by_pid(m, pid, &session); if (r < 0) return r; - } - r = manager_get_session_by_pid(m, pid, &session); - if (r < 0) - return r; - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SESSION_FOR_PID, "PID "PID_FMT" does not belong to any known session", pid); + if (!session) + return sd_bus_error_setf(error, BUS_ERROR_NO_SESSION_FOR_PID, "PID "PID_FMT" does not belong to any known session", pid); + } p = session_bus_path(session); if (!p) @@ -213,9 +293,9 @@ static int method_get_user(sd_bus *bus, sd_bus_message *message, void *userdata, if (r < 0) return r; - user = hashmap_get(m->users, ULONG_TO_PTR((unsigned long) uid)); - if (!user) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user "UID_FMT" known or logged in", uid); + r = manager_get_user_from_creds(m, message, uid, error, &user); + if (r < 0) + return r; p = user_bus_path(user); if (!p) @@ -241,24 +321,18 @@ static int method_get_user_by_pid(sd_bus *bus, sd_bus_message *message, void *us if (r < 0) return r; - if (pid == 0) { - _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; - - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds); + if (pid <= 0) { + r = manager_get_user_from_creds(m, message, UID_INVALID, error, &user); if (r < 0) return r; - - r = sd_bus_creds_get_pid(creds, &pid); + } else { + r = manager_get_user_by_pid(m, pid, &user); if (r < 0) return r; + if (!user) + return sd_bus_error_setf(error, BUS_ERROR_NO_USER_FOR_PID, "PID "PID_FMT" does not belong to any known or logged in user", pid); } - r = manager_get_user_by_pid(m, pid, &user); - if (r < 0) - return r; - if (!user) - return sd_bus_error_setf(error, BUS_ERROR_NO_USER_FOR_PID, "PID "PID_FMT" does not belong to any known or logged in user", pid); - p = user_bus_path(user); if (!p) return -ENOMEM; @@ -281,9 +355,9 @@ static int method_get_seat(sd_bus *bus, sd_bus_message *message, void *userdata, if (r < 0) return r; - seat = hashmap_get(m->seats, name); - if (!seat) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", name); + r = manager_get_seat_from_creds(m, message, name, error, &seat); + if (r < 0) + return r; p = seat_bus_path(seat); if (!p) @@ -570,8 +644,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) return r; - assert_cc(sizeof(uint32_t) == sizeof(pid_t)); - r = sd_bus_creds_get_pid(creds, (pid_t*) &leader); if (r < 0) return r; @@ -727,7 +799,7 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use /* Now, let's wait until the slice unit and stuff got * created. We send the reply back from - * session_send_create_reply().*/ + * session_send_create_reply(). */ return 1; @@ -755,9 +827,9 @@ static int method_release_session(sd_bus *bus, sd_bus_message *message, void *us if (r < 0) return r; - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; session_release(session); @@ -778,9 +850,9 @@ static int method_activate_session(sd_bus *bus, sd_bus_message *message, void *u if (r < 0) return r; - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; r = session_activate(session); if (r < 0) @@ -807,13 +879,13 @@ static int method_activate_session_on_seat(sd_bus *bus, sd_bus_message *message, if (r < 0) return r; - session = hashmap_get(m->sessions, session_name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", session_name); + r = manager_get_session_from_creds(m, message, session_name, error, &session); + if (r < 0) + return r; - seat = hashmap_get(m->seats, seat_name); - if (!seat) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", seat_name); + r = manager_get_seat_from_creds(m, message, seat_name, error, &seat); + if (r < 0) + return r; if (session->seat != seat) return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT, "Session %s not on seat %s", session_name, seat_name); @@ -839,9 +911,9 @@ static int method_lock_session(sd_bus *bus, sd_bus_message *message, void *userd if (r < 0) return r; - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; r = session_send_lock(session, streq(sd_bus_message_get_member(message), "LockSession")); if (r < 0) @@ -892,9 +964,9 @@ static int method_kill_session(sd_bus *bus, sd_bus_message *message, void *userd if (signo <= 0 || signo >= _NSIG) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid signal %i", signo); - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; r = session_kill(session, who, signo); if (r < 0) @@ -921,9 +993,9 @@ static int method_kill_user(sd_bus *bus, sd_bus_message *message, void *userdata if (signo <= 0 || signo >= _NSIG) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid signal %i", signo); - user = hashmap_get(m->users, ULONG_TO_PTR((unsigned long) uid)); - if (!user) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user "UID_FMT" known or logged in", uid); + r = manager_get_user_from_creds(m, message, uid, error, &user); + if (r < 0) + return r; r = user_kill(user, signo); if (r < 0) @@ -946,9 +1018,9 @@ static int method_terminate_session(sd_bus *bus, sd_bus_message *message, void * if (r < 0) return r; - session = hashmap_get(m->sessions, name); - if (!session) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name); + r = manager_get_session_from_creds(m, message, name, error, &session); + if (r < 0) + return r; r = session_stop(session, true); if (r < 0) @@ -971,9 +1043,9 @@ static int method_terminate_user(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) return r; - user = hashmap_get(m->users, ULONG_TO_PTR((unsigned long) uid)); - if (!user) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user "UID_FMT" known or logged in", uid); + r = manager_get_user_from_creds(m, message, uid, error, &user); + if (r < 0) + return r; r = user_stop(user, true); if (r < 0) @@ -996,9 +1068,9 @@ static int method_terminate_seat(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) return r; - seat = hashmap_get(m->seats, name); - if (!seat) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", name); + r = manager_get_seat_from_creds(m, message, name, error, &seat); + if (r < 0) + return r; r = seat_stop_sessions(seat, true); if (r < 0) @@ -1024,6 +1096,19 @@ static int method_set_user_linger(sd_bus *bus, sd_bus_message *message, void *us if (r < 0) return r; + if (uid == UID_INVALID) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + + /* Note that we get the owner UID of the session, not the actual client UID here! */ + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_OWNER_UID|SD_BUS_CREDS_AUGMENT, &creds); + if (r < 0) + return r; + + r = sd_bus_creds_get_owner_uid(creds, &uid); + if (r < 0) + return r; + } + errno = 0; pw = getpwuid(uid); if (!pw) @@ -1051,7 +1136,7 @@ static int method_set_user_linger(sd_bus *bus, sd_bus_message *message, void *us if (!cc) return -ENOMEM; - path = strappenda("/var/lib/systemd/linger/", cc); + path = strjoina("/var/lib/systemd/linger/", cc); if (b) { User *u; @@ -1069,7 +1154,7 @@ static int method_set_user_linger(sd_bus *bus, sd_bus_message *message, void *us if (r < 0 && errno != ENOENT) return -errno; - u = hashmap_get(m->users, ULONG_TO_PTR((unsigned long) uid)); + u = hashmap_get(m->users, UID_TO_PTR(uid)); if (u) user_add_to_gc_queue(u); } @@ -1518,11 +1603,11 @@ static int method_do_shutdown_or_sleep( return sd_bus_error_setf(error, BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, "Sleep verb not supported"); } - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_UID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID, &creds); if (r < 0) return r; - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r < 0) return r; @@ -1671,11 +1756,11 @@ static int method_can_shutdown_or_sleep( return sd_bus_reply_method_return(message, "s", "na"); } - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_UID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID, &creds); if (r < 0) return r; - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r < 0) return r; @@ -1850,11 +1935,11 @@ static int method_inhibit(sd_bus *bus, sd_bus_message *message, void *userdata, if (r == 0) return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID, &creds); if (r < 0) return r; - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r < 0) return r; @@ -2111,9 +2196,10 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat return 0; r = unit_name_from_dbus_path(path, &unit); + if (r == -EINVAL) /* not a unit */ + return 0; if (r < 0) - /* quietly ignore non-units paths */ - return r == -EINVAL ? 0 : r; + return r; session = hashmap_get(m->session_units, unit); if (session) diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c index ff87f0f74..50b0b8842 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -21,7 +21,6 @@ #include #include -#include #include "util.h" #include "bus-util.h" @@ -327,25 +326,22 @@ int seat_object_find(sd_bus *bus, const char *path, const char *interface, void _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; sd_bus_message *message; Session *session; - pid_t pid; + const char *name; message = sd_bus_get_current_message(bus); if (!message) return 0; - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_SESSION|SD_BUS_CREDS_AUGMENT, &creds); if (r < 0) return r; - r = sd_bus_creds_get_pid(creds, &pid); + r = sd_bus_creds_get_session(creds, &name); if (r < 0) return r; - r = manager_get_session_by_pid(m, pid, &session); - if (r <= 0) - return 0; - - if (!session->seat) + session = hashmap_get(m->sessions, name); + if (!session) return 0; seat = session->seat; @@ -362,10 +358,11 @@ int seat_object_find(sd_bus *bus, const char *path, const char *interface, void return -ENOMEM; seat = hashmap_get(m->seats, e); - if (!seat) - return 0; } + if (!seat) + return 0; + *found = seat; return 1; } @@ -384,6 +381,7 @@ char *seat_bus_path(Seat *s) { int seat_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; + sd_bus_message *message; Manager *m = userdata; Seat *seat; Iterator i; @@ -405,6 +403,26 @@ int seat_node_enumerator(sd_bus *bus, const char *path, void *userdata, char *** return r; } + message = sd_bus_get_current_message(bus); + if (message) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + const char *name; + Session *session; + + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_SESSION|SD_BUS_CREDS_AUGMENT, &creds); + if (r >= 0) { + r = sd_bus_creds_get_session(creds, &name); + if (r >= 0) { + session = hashmap_get(m->sessions, name); + if (session && session->seat) { + r = strv_extend(&l, "/org/freedesktop/login1/seat/self"); + if (r < 0) + return r; + } + } + } + } + *nodes = l; l = NULL; diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 8eb5e3ee0..126c5b84c 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -201,7 +201,7 @@ int seat_preallocate_vts(Seat *s) { q = vt_allocate(i); if (q < 0) { - log_error_errno(q, "Failed to preallocate VT %i: %m", i); + log_error_errno(q, "Failed to preallocate VT %u: %m", i); r = q; } } @@ -340,12 +340,24 @@ int seat_active_vt_changed(Seat *s, unsigned int vtnr) { log_debug("VT changed to %u", vtnr); + /* we might have earlier closing sessions on the same VT, so try to + * find a running one first */ LIST_FOREACH(sessions_by_seat, i, s->sessions) - if (i->vtnr == vtnr) { + if (i->vtnr == vtnr && !i->stopping) { new_active = i; break; } + if (!new_active) { + /* no running one? then we can't decide which one is the + * active one, let the first one win */ + LIST_FOREACH(sessions_by_seat, i, s->sessions) + if (i->vtnr == vtnr) { + new_active = i; + break; + } + } + r = seat_set_active(s, new_active); manager_spawn_autovt(s->manager, vtnr); diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index 8607d0326..4e7edef52 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -21,7 +21,6 @@ #include #include -#include #include "util.h" #include "strv.h" @@ -240,11 +239,11 @@ static int method_set_idle_hint(sd_bus *bus, sd_bus_message *message, void *user if (r < 0) return r; - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_UID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID, &creds); if (r < 0) return r; - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r < 0) return r; @@ -303,11 +302,11 @@ static int method_take_control(sd_bus *bus, sd_bus_message *message, void *userd if (r < 0) return r; - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_UID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_EUID, &creds); if (r < 0) return r; - r = sd_bus_creds_get_uid(creds, &uid); + r = sd_bus_creds_get_euid(creds, &uid); if (r < 0) return r; @@ -491,23 +490,21 @@ int session_object_find(sd_bus *bus, const char *path, const char *interface, vo if (streq(path, "/org/freedesktop/login1/session/self")) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; sd_bus_message *message; - pid_t pid; + const char *name; message = sd_bus_get_current_message(bus); if (!message) return 0; - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_SESSION|SD_BUS_CREDS_AUGMENT, &creds); if (r < 0) return r; - r = sd_bus_creds_get_pid(creds, &pid); + r = sd_bus_creds_get_session(creds, &name); if (r < 0) return r; - r = manager_get_session_by_pid(m, pid, &session); - if (r <= 0) - return 0; + session = hashmap_get(m->sessions, name); } else { _cleanup_free_ char *e = NULL; const char *p; @@ -521,10 +518,11 @@ int session_object_find(sd_bus *bus, const char *path, const char *interface, vo return -ENOMEM; session = hashmap_get(m->sessions, e); - if (!session) - return 0; } + if (!session) + return 0; + *found = session; return 1; } @@ -543,6 +541,7 @@ char *session_bus_path(Session *s) { int session_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; + sd_bus_message *message; Manager *m = userdata; Session *session; Iterator i; @@ -564,6 +563,25 @@ int session_node_enumerator(sd_bus *bus, const char *path, void *userdata, char return r; } + message = sd_bus_get_current_message(bus); + if (message) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + const char *name; + + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_SESSION|SD_BUS_CREDS_AUGMENT, &creds); + if (r >= 0) { + r = sd_bus_creds_get_session(creds, &name); + if (r >= 0) { + session = hashmap_get(m->sessions, name); + if (session) { + r = strv_extend(&l, "/org/freedesktop/login1/session/self"); + if (r < 0) + return r; + } + } + } + } + *nodes = l; l = NULL; diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index 932abb82f..c2de86225 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -107,7 +107,7 @@ static int sd_eviocrevoke(int fd) { assert(fd >= 0); - r = ioctl(fd, EVIOCREVOKE, 1); + r = ioctl(fd, EVIOCREVOKE, NULL); if (r < 0) { r = -errno; if (r == -EINVAL && !warned) { diff --git a/src/login/logind-session.c b/src/login/logind-session.c index ea1831dac..a02a537f7 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -301,6 +301,7 @@ int session_load(Session *s) { _cleanup_free_ char *remote = NULL, *seat = NULL, *vtnr = NULL, + *state = NULL, *pos = NULL, *leader = NULL, *type = NULL, @@ -327,6 +328,7 @@ int session_load(Session *s) { "SERVICE", &s->service, "DESKTOP", &s->desktop, "VTNR", &vtnr, + "STATE", &state, "POS", &pos, "LEADER", &leader, "TYPE", &type, @@ -355,7 +357,7 @@ int session_load(Session *s) { return r; } - user = hashmap_get(s->manager->users, ULONG_TO_PTR((unsigned long) u)); + user = hashmap_get(s->manager->users, UID_TO_PTR(u)); if (!user) { log_error("User of session %s not known.", s->id); return -ENOENT; @@ -415,13 +417,18 @@ int session_load(Session *s) { s->class = c; } + if (state && streq(state, "closing")) + s->stopping = true; + if (s->fifo_path) { int fd; /* If we open an unopened pipe for reading we will not get an EOF. to trigger an EOF we hence open it for - reading, but close it right-away which then will - trigger the EOF. */ + writing, but close it right away which then will + trigger the EOF. This will happen immediately if no + other process has the FIFO open for writing, i. e. + when the session died before logind (re)started. */ fd = session_create_fifo(s); safe_close(fd); diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c index 51793f6da..5cfaac0d4 100644 --- a/src/login/logind-user-dbus.c +++ b/src/login/logind-user-dbus.c @@ -21,7 +21,6 @@ #include #include -#include #include "strv.h" #include "bus-util.h" @@ -236,6 +235,7 @@ const sd_bus_vtable user_vtable[] = { int user_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { Manager *m = userdata; + uid_t uid; User *user; int r; @@ -248,39 +248,31 @@ int user_object_find(sd_bus *bus, const char *path, const char *interface, void if (streq(path, "/org/freedesktop/login1/user/self")) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; sd_bus_message *message; - pid_t pid; message = sd_bus_get_current_message(bus); if (!message) return 0; - r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds); + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_OWNER_UID|SD_BUS_CREDS_AUGMENT, &creds); if (r < 0) return r; - r = sd_bus_creds_get_pid(creds, &pid); - if (r < 0) - return r; - - r = manager_get_user_by_pid(m, pid, &user); - if (r <= 0) - return 0; + r = sd_bus_creds_get_owner_uid(creds, &uid); } else { - unsigned long lu; const char *p; p = startswith(path, "/org/freedesktop/login1/user/_"); if (!p) return 0; - r = safe_atolu(p, &lu); - if (r < 0) - return 0; - - user = hashmap_get(m->users, ULONG_TO_PTR(lu)); - if (!user) - return 0; + r = parse_uid(p, &uid); } + if (r < 0) + return 0; + + user = hashmap_get(m->users, UID_TO_PTR(uid)); + if (!user) + return 0; *found = user; return 1; @@ -299,6 +291,7 @@ char *user_bus_path(User *u) { int user_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; + sd_bus_message *message; Manager *m = userdata; User *user; Iterator i; @@ -320,6 +313,25 @@ int user_node_enumerator(sd_bus *bus, const char *path, void *userdata, char *** return r; } + message = sd_bus_get_current_message(bus); + if (message) { + _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; + uid_t uid; + + r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_OWNER_UID|SD_BUS_CREDS_AUGMENT, &creds); + if (r >= 0) { + r = sd_bus_creds_get_owner_uid(creds, &uid); + if (r >= 0) { + user = hashmap_get(m->users, UID_TO_PTR(uid)); + if (user) { + r = strv_extend(&l, "/org/freedesktop/login1/user/self"); + if (r < 0) + return r; + } + } + } + } + *nodes = l; l = NULL; diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 9ff130266..f4c4490e8 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -56,7 +56,7 @@ User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) { if (asprintf(&u->state_file, "/run/systemd/users/"UID_FMT, uid) < 0) goto fail; - if (hashmap_put(m->users, ULONG_TO_PTR((unsigned long) uid), u) < 0) + if (hashmap_put(m->users, UID_TO_PTR(uid), u) < 0) goto fail; u->manager = m; @@ -97,7 +97,7 @@ void user_free(User *u) { free(u->runtime_path); - hashmap_remove(u->manager->users, ULONG_TO_PTR((unsigned long) u->uid)); + hashmap_remove(u->manager->users, UID_TO_PTR(u->uid)); free(u->name); free(u->state_file); @@ -322,13 +322,12 @@ static int user_mkdir_runtime_path(User *u) { if (path_is_mount_point(p, false) <= 0) { _cleanup_free_ char *t = NULL; - mkdir(p, 0700); + (void) mkdir(p, 0700); if (mac_smack_use()) r = asprintf(&t, "mode=0700,smackfsroot=*,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size); else r = asprintf(&t, "mode=0700,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size); - if (r < 0) { r = log_oom(); goto fail; @@ -336,8 +335,20 @@ static int user_mkdir_runtime_path(User *u) { r = mount("tmpfs", p, "tmpfs", MS_NODEV|MS_NOSUID, t); if (r < 0) { - log_error_errno(r, "Failed to mount per-user tmpfs directory %s: %m", p); - goto fail; + if (errno != EPERM) { + r = log_error_errno(errno, "Failed to mount per-user tmpfs directory %s: %m", p); + goto fail; + } + + /* Lacking permissions, maybe + * CAP_SYS_ADMIN-less container? In this case, + * just use a normal directory. */ + + r = chmod_and_chown(p, 0700, u->uid, u->gid); + if (r < 0) { + log_error_errno(r, "Failed to change runtime directory ownership and mode: %m"); + goto fail; + } } } @@ -345,7 +356,12 @@ static int user_mkdir_runtime_path(User *u) { return 0; fail: - free(p); + if (p) { + /* Try to clean up, but ignore errors */ + (void) rmdir(p); + free(p); + } + u->runtime_path = NULL; return r; } @@ -510,7 +526,11 @@ static int user_remove_runtime_path(User *u) { if (r < 0) log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path); - if (umount2(u->runtime_path, MNT_DETACH) < 0) + /* Ignore cases where the directory isn't mounted, as that's + * quite possible, if we lacked the permissions to mount + * something */ + r = umount2(u->runtime_path, MNT_DETACH); + if (r < 0 && errno != EINVAL && errno != ENOENT) log_error_errno(errno, "Failed to unmount user runtime directory %s: %m", u->runtime_path); r = rm_rf(u->runtime_path, false, true, false); @@ -639,7 +659,7 @@ int user_check_linger_file(User *u) { if (!cc) return -ENOMEM; - p = strappenda("/var/lib/systemd/linger/", cc); + p = strjoina("/var/lib/systemd/linger/", cc); return access(p, F_OK) >= 0; } diff --git a/src/login/logind.h b/src/login/logind.h index 2f7657258..e0cb7d023 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -193,3 +193,7 @@ void manager_drop_busname(Manager *manager, const char *name); int manager_set_lid_switch_ignore(Manager *m, usec_t until); 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); diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in index b8e90f193..49094eedd 100644 --- a/src/login/org.freedesktop.login1.policy.in +++ b/src/login/org.freedesktop.login1.policy.in @@ -18,7 +18,7 @@ <_description>Allow applications to inhibit system shutdown - <_message>Authentication is required to allow an application to inhibit system shutdown. + <_message>Authentication is required for an application to inhibit system shutdown. no yes @@ -29,7 +29,7 @@ <_description>Allow applications to delay system shutdown - <_message>Authentication is required to allow an application to delay system shutdown. + <_message>Authentication is required for an application to delay system shutdown. yes yes @@ -40,7 +40,7 @@ <_description>Allow applications to inhibit system sleep - <_message>Authentication is required to allow an application to inhibit system sleep. + <_message>Authentication is required for an application to inhibit system sleep. no yes @@ -51,7 +51,7 @@ <_description>Allow applications to delay system sleep - <_message>Authentication is required to allow an application to delay system sleep. + <_message>Authentication is required for an application to delay system sleep. yes yes @@ -61,7 +61,7 @@ <_description>Allow applications to inhibit automatic system suspend - <_message>Authentication is required to allow an application to inhibit automatic system suspend. + <_message>Authentication is required for an application to inhibit automatic system suspend. yes yes @@ -71,7 +71,7 @@ <_description>Allow applications to inhibit system handling of the power key - <_message>Authentication is required to allow an application to inhibit system handling of the power key. + <_message>Authentication is required for an application to inhibit system handling of the power key. no yes @@ -82,7 +82,7 @@ <_description>Allow applications to inhibit system handling of the suspend key - <_message>Authentication is required to allow an application to inhibit system handling of the suspend key. + <_message>Authentication is required for an application to inhibit system handling of the suspend key. no yes @@ -93,7 +93,7 @@ <_description>Allow applications to inhibit system handling of the hibernate key - <_message>Authentication is required to allow an application to inhibit system handling of the hibernate key. + <_message>Authentication is required for an application to inhibit system handling of the hibernate key. no yes @@ -103,7 +103,7 @@ <_description>Allow applications to inhibit system handling of the lid switch - <_message>Authentication is required to allow an application to inhibit system handling of the lid switch. + <_message>Authentication is required for an application to inhibit system handling of the lid switch. no yes @@ -113,7 +113,7 @@ <_description>Allow non-logged-in users to run programs - <_message>Authentication is required to allow a non-logged-in user to run programs. + <_message>Authentication is required to run programs as a non-logged-in user. auth_admin_keep auth_admin_keep diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 111e2b7c4..d7a708fd0 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -345,7 +344,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( } if (seat && !streq(seat, "seat0") && vtnr != 0) { - pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %d for %s which is not seat0", vtnr, seat); + pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %"PRIu32" for %s which is not seat0", vtnr, seat); vtnr = 0; } @@ -368,7 +367,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( if (debug) pam_syslog(handle, LOG_DEBUG, "Asking logind to create session: " - "uid=%u pid=%u service=%s type=%s class=%s desktop=%s seat=%s vtnr=%u tty=%s display=%s remote=%s remote_user=%s remote_host=%s", + "uid="UID_FMT" pid="PID_FMT" service=%s type=%s class=%s desktop=%s seat=%s vtnr=%"PRIu32" tty=%s display=%s remote=%s remote_user=%s remote_host=%s", pw->pw_uid, getpid(), strempty(service), type, class, strempty(desktop), diff --git a/src/core/sysfs-show.h b/src/login/sysfs-show.h similarity index 100% rename from src/core/sysfs-show.h rename to src/login/sysfs-show.h diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c index 5379ffcaa..274687d20 100644 --- a/src/login/test-inhibit.c +++ b/src/login/test-inhibit.c @@ -73,7 +73,7 @@ static void print_inhibitors(sd_bus *bus) { assert_se(r >= 0); while ((r = sd_bus_message_read(reply, "(ssssuu)", &what, &who, &why, &mode, &uid, &pid)) > 0) { - printf("what=<%s> who=<%s> why=<%s> mode=<%s> uid=<"UID_FMT"> pid=<"PID_FMT">\n", + printf("what=<%s> who=<%s> why=<%s> mode=<%s> uid=<%"PRIu32"> pid=<%"PRIu32">\n", what, who, why, mode, uid, pid); n++; diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c new file mode 100644 index 000000000..f5c7d4d88 --- /dev/null +++ b/src/machine/image-dbus.c @@ -0,0 +1,267 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "bus-label.h" +#include "bus-common-errors.h" +#include "strv.h" +#include "bus-util.h" +#include "machine-image.h" +#include "image-dbus.h" + +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, image_type, ImageType); + +int bus_image_method_remove( + sd_bus *bus, + sd_bus_message *message, + void *userdata, + sd_bus_error *error) { + + Image *image = userdata; + int r; + + assert(bus); + assert(message); + assert(image); + + r = image_remove(image); + if (r < 0) + return r; + + return sd_bus_reply_method_return(message, NULL); +} + +int bus_image_method_rename( + sd_bus *bus, + sd_bus_message *message, + void *userdata, + sd_bus_error *error) { + + Image *image = userdata; + const char *new_name; + int r; + + assert(bus); + assert(message); + assert(image); + + r = sd_bus_message_read(message, "s", &new_name); + if (r < 0) + return r; + + if (!image_name_is_valid(new_name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", new_name); + + r = image_rename(image, new_name); + if (r < 0) + return r; + + return sd_bus_reply_method_return(message, NULL); +} + +int bus_image_method_clone( + sd_bus *bus, + sd_bus_message *message, + void *userdata, + sd_bus_error *error) { + + Image *image = userdata; + const char *new_name; + int r, read_only; + + assert(bus); + assert(message); + assert(image); + + r = sd_bus_message_read(message, "sb", &new_name, &read_only); + if (r < 0) + return r; + + if (!image_name_is_valid(new_name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", new_name); + + r = image_clone(image, new_name, read_only); + if (r < 0) + return r; + + return sd_bus_reply_method_return(message, NULL); +} + +int bus_image_method_mark_read_only( + sd_bus *bus, + sd_bus_message *message, + void *userdata, + sd_bus_error *error) { + + Image *image = userdata; + int r, read_only; + + assert(bus); + assert(message); + + r = sd_bus_message_read(message, "b", &read_only); + if (r < 0) + return r; + + r = image_read_only(image, read_only); + if (r < 0) + return r; + + return sd_bus_reply_method_return(message, NULL); +} + +const sd_bus_vtable image_vtable[] = { + SD_BUS_VTABLE_START(0), + SD_BUS_PROPERTY("Name", "s", NULL, offsetof(Image, name), 0), + SD_BUS_PROPERTY("Path", "s", NULL, offsetof(Image, path), 0), + SD_BUS_PROPERTY("Type", "s", property_get_type, offsetof(Image, type), 0), + SD_BUS_PROPERTY("ReadOnly", "b", bus_property_get_bool, offsetof(Image, read_only), 0), + SD_BUS_PROPERTY("CreationTimestamp", "t", NULL, offsetof(Image, crtime), 0), + SD_BUS_PROPERTY("ModificationTimestamp", "t", NULL, offsetof(Image, mtime), 0), + SD_BUS_PROPERTY("Usage", "t", NULL, offsetof(Image, usage), 0), + SD_BUS_PROPERTY("Limit", "t", NULL, offsetof(Image, limit), 0), + SD_BUS_PROPERTY("UsageExclusive", "t", NULL, offsetof(Image, usage_exclusive), 0), + SD_BUS_PROPERTY("LimitExclusive", "t", NULL, offsetof(Image, limit_exclusive), 0), + SD_BUS_METHOD("Remove", NULL, NULL, bus_image_method_remove, 0), + SD_BUS_METHOD("Rename", "s", NULL, bus_image_method_rename, 0), + SD_BUS_METHOD("Clone", "sb", NULL, bus_image_method_clone, 0), + SD_BUS_METHOD("MarkReadOnly", "b", NULL, bus_image_method_mark_read_only, 0), + SD_BUS_VTABLE_END +}; + +static int image_flush_cache(sd_event_source *s, void *userdata) { + Manager *m = userdata; + Image *i; + + assert(s); + assert(m); + + while ((i = hashmap_steal_first(m->image_cache))) + image_unref(i); + + return 0; +} + +int image_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { + _cleanup_free_ char *e = NULL; + Manager *m = userdata; + Image *image = NULL; + const char *p; + int r; + + assert(bus); + assert(path); + assert(interface); + assert(found); + + p = startswith(path, "/org/freedesktop/machine1/image/"); + if (!p) + return 0; + + e = bus_label_unescape(p); + if (!e) + return -ENOMEM; + + image = hashmap_get(m->image_cache, e); + if (image) { + *found = image; + return 1; + } + + r = hashmap_ensure_allocated(&m->image_cache, &string_hash_ops); + if (r < 0) + return r; + + if (!m->image_cache_defer_event) { + r = sd_event_add_defer(m->event, &m->image_cache_defer_event, image_flush_cache, m); + if (r < 0) + return r; + + r = sd_event_source_set_priority(m->image_cache_defer_event, SD_EVENT_PRIORITY_IDLE); + if (r < 0) + return r; + } + + r = sd_event_source_set_enabled(m->image_cache_defer_event, SD_EVENT_ONESHOT); + if (r < 0) + return r; + + r = image_find(e, &image); + if (r <= 0) + return r; + + r = hashmap_put(m->image_cache, image->name, image); + if (r < 0) { + image_unref(image); + return r; + } + + *found = image; + return 1; +} + +char *image_bus_path(const char *name) { + _cleanup_free_ char *e = NULL; + + assert(name); + + e = bus_label_escape(name); + if (!e) + return NULL; + + return strappend("/org/freedesktop/machine1/image/", e); +} + +int image_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { + _cleanup_(image_hashmap_freep) Hashmap *images = NULL; + _cleanup_strv_free_ char **l = NULL; + Image *image; + Iterator i; + int r; + + assert(bus); + assert(path); + assert(nodes); + + images = hashmap_new(&string_hash_ops); + if (!images) + return -ENOMEM; + + r = image_discover(images); + if (r < 0) + return r; + + HASHMAP_FOREACH(image, images, i) { + char *p; + + p = image_bus_path(image->name); + if (!p) + return -ENOMEM; + + r = strv_consume(&l, p); + if (r < 0) + return r; + } + + *nodes = l; + l = NULL; + + return 1; +} diff --git a/src/machine/image-dbus.h b/src/machine/image-dbus.h new file mode 100644 index 000000000..1b4364cbe --- /dev/null +++ b/src/machine/image-dbus.h @@ -0,0 +1,36 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "machined.h" + +extern const sd_bus_vtable image_vtable[]; + +char *image_bus_path(const char *name); + +int image_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); +int image_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); + +int bus_image_method_remove(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_image_method_rename(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_image_method_clone(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_image_method_mark_read_only(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 72ae6c653..b46f0a8da 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -21,7 +21,6 @@ #include #include -#include #include #include "bus-util.h" @@ -32,7 +31,10 @@ #include "fileio.h" #include "in-addr-util.h" #include "local-addresses.h" +#include "path-util.h" +#include "bus-internal.h" #include "machine.h" +#include "machine-dbus.h" static int property_get_id( sd_bus *bus, @@ -173,6 +175,9 @@ int bus_machine_method_get_addresses(sd_bus *bus, sd_bus_message *message, void assert(message); assert(m); + if (m->class != MACHINE_CONTAINER) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Requesting IP address data is only supported on container machines."); + r = readlink_malloc("/proc/self/ns/net", &us); if (r < 0) return sd_bus_error_set_errno(error, r); @@ -317,16 +322,19 @@ int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, void assert(message); assert(m); + if (m->class != MACHINE_CONTAINER) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Requesting OS release data is only supported on container machines."); + r = namespace_open(m->leader, NULL, &mntns_fd, NULL, &root_fd); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) < 0) - return sd_bus_error_set_errno(error, -errno); + return -errno; child = fork(); if (child < 0) - return sd_bus_error_set_errno(error, -errno); + return -errno; if (child == 0) { _cleanup_close_ int fd = -1; @@ -344,7 +352,7 @@ int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, void _exit(EXIT_FAILURE); } - r = copy_bytes(fd, pair[1], (off_t) -1); + r = copy_bytes(fd, pair[1], (off_t) -1, false); if (r < 0) _exit(EXIT_FAILURE); @@ -355,37 +363,157 @@ int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, void f = fdopen(pair[0], "re"); if (!f) - return sd_bus_error_set_errno(error, -errno); + return -errno; pair[0] = -1; r = load_env_file_pairs(f, "/etc/os-release", NULL, &l); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; r = wait_for_terminate(child, &si); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; if (si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS) - return sd_bus_error_set_errno(error, EIO); + return -EIO; r = sd_bus_message_new_method_return(message, &reply); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; r = sd_bus_message_open_container(reply, 'a', "{ss}"); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; STRV_FOREACH_PAIR(k, v, l) { r = sd_bus_message_append(reply, "{ss}", *k, *v); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; } r = sd_bus_message_close_container(reply); if (r < 0) - return sd_bus_error_set_errno(error, r); + return r; + + return sd_bus_send(bus, reply, NULL); +} + +int bus_machine_method_open_pty(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_free_ char *pty_name = NULL; + _cleanup_close_ int master = -1; + Machine *m = userdata; + int r; + + assert(bus); + assert(message); + assert(m); + + if (m->class != MACHINE_CONTAINER) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Opening pseudo TTYs is only supported on container machines."); + + master = openpt_in_namespace(m->leader, O_RDWR|O_NOCTTY|O_CLOEXEC); + if (master < 0) + return master; + + r = ptsname_malloc(master, &pty_name); + if (r < 0) + return r; + + r = sd_bus_message_new_method_return(message, &reply); + if (r < 0) + return r; + + r = sd_bus_message_append(reply, "hs", master, pty_name); + if (r < 0) + return r; + + return sd_bus_send(bus, reply, NULL); +} + +int bus_machine_method_open_login(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_free_ char *pty_name = NULL, *getty = NULL; + _cleanup_bus_unref_ sd_bus *container_bus = NULL; + _cleanup_close_ int master = -1; + Machine *m = userdata; + const char *p; + int r; + + if (m->class != MACHINE_CONTAINER) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Opening logins is only supported on container machines."); + + r = bus_verify_polkit_async( + message, + CAP_SYS_ADMIN, + "org.freedesktop.machine1.login", + false, + &m->manager->polkit_registry, + error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Will call us back */ + + master = openpt_in_namespace(m->leader, O_RDWR|O_NOCTTY|O_CLOEXEC); + if (master < 0) + return master; + + r = ptsname_malloc(master, &pty_name); + if (r < 0) + return r; + + p = path_startswith(pty_name, "/dev/pts/"); + if (!p) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "PTS name %s is invalid", pty_name); + + if (unlockpt(master) < 0) + return -errno; + + r = sd_bus_new(&container_bus); + if (r < 0) + return r; + +#ifdef ENABLE_KDBUS + asprintf(&container_bus->address, "x-machine-kernel:pid=" PID_FMT ";x-machine-unix:pid=" PID_FMT, m->leader, m->leader); +#else + asprintf(&container_bus->address, "x-machine-kernel:pid=" PID_FMT, m->leader); +#endif + if (!container_bus->address) + return -ENOMEM; + + container_bus->bus_client = true; + container_bus->trusted = false; + container_bus->is_system = true; + + r = sd_bus_start(container_bus); + if (r < 0) + return r; + + getty = strjoin("container-getty@", p, ".service", NULL); + if (!getty) + return -ENOMEM; + + r = sd_bus_call_method( + container_bus, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "StartUnit", + error, NULL, + "ss", getty, "replace"); + if (r < 0) + return r; + + container_bus = sd_bus_unref(container_bus); + + r = sd_bus_message_new_method_return(message, &reply); + if (r < 0) + return r; + + r = sd_bus_message_append(reply, "hs", master, pty_name); + if (r < 0) + return r; return sd_bus_send(bus, reply, NULL); } @@ -407,6 +535,8 @@ const sd_bus_vtable machine_vtable[] = { SD_BUS_METHOD("Kill", "si", NULL, bus_machine_method_kill, SD_BUS_VTABLE_CAPABILITY(CAP_KILL)), SD_BUS_METHOD("GetAddresses", NULL, "a(iay)", bus_machine_method_get_addresses, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetOSRelease", NULL, "a{ss}", bus_machine_method_get_os_release, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("OpenPTY", NULL, "hs", bus_machine_method_open_pty, 0), + SD_BUS_METHOD("OpenLogin", NULL, "hs", bus_machine_method_open_login, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_VTABLE_END }; diff --git a/src/machine/machine-dbus.h b/src/machine/machine-dbus.h new file mode 100644 index 000000000..601252722 --- /dev/null +++ b/src/machine/machine-dbus.h @@ -0,0 +1,41 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2013 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "sd-bus.h" +#include "machine.h" + +extern const sd_bus_vtable machine_vtable[]; + +char *machine_bus_path(Machine *s); +int machine_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); +int machine_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); + +int bus_machine_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_machine_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_machine_method_get_addresses(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_machine_method_open_pty(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_machine_method_open_login(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); + +int machine_send_signal(Machine *m, bool new_machine); +int machine_send_create_reply(Machine *m, sd_bus_error *error); diff --git a/src/machine/machine.c b/src/machine/machine.c index 0d84213ee..223eb0f36 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -32,9 +32,10 @@ #include "fileio.h" #include "special.h" #include "unit-name.h" -#include "machine.h" #include "bus-util.h" #include "bus-error.h" +#include "machine.h" +#include "machine-dbus.h" Machine* machine_new(Manager *manager, const char *name) { Machine *m; @@ -201,23 +202,25 @@ int machine_save(Machine *m) { goto finish; } + free(temp_path); + temp_path = NULL; + if (m->unit) { char *sl; /* Create a symlink from the unit name to the machine * name, so that we can quickly find the machine for * each given unit */ - sl = strappenda("/run/systemd/machines/unit:", m->unit); + sl = strjoina("/run/systemd/machines/unit:", m->unit); symlink(m->name, sl); } finish: - if (r < 0) { - if (temp_path) - unlink(temp_path); + if (temp_path) + unlink(temp_path); + if (r < 0) log_error_errno(r, "Failed to save machine data %s: %m", m->state_file); - } return r; } @@ -229,7 +232,7 @@ static void machine_unlink(Machine *m) { char *sl; - sl = strappenda("/run/systemd/machines/unit:", m->unit); + sl = strjoina("/run/systemd/machines/unit:", m->unit); unlink(sl); } @@ -337,7 +340,7 @@ static int machine_start_scope(Machine *m, sd_bus_message *properties, sd_bus_er if (!scope) return log_oom(); - description = strappenda(m->class == MACHINE_VM ? "Virtual Machine " : "Container ", m->name); + description = strjoina(m->class == MACHINE_VM ? "Virtual Machine " : "Container ", m->name); r = manager_start_scope(m->manager, scope, m->leader, SPECIAL_MACHINE_SLICE, description, properties, error, &job); if (r < 0) { @@ -405,12 +408,10 @@ static int machine_stop_scope(Machine *m) { if (!m->unit) return 0; - if (!m->registered) { - r = manager_stop_unit(m->manager, m->unit, &error, &job); - if (r < 0) { - log_error("Failed to stop machine scope: %s", bus_error_message(&error, r)); - return r; - } + r = manager_stop_unit(m->manager, m->unit, &error, &job); + if (r < 0) { + log_error("Failed to stop machine scope: %s", bus_error_message(&error, r)); + return r; } free(m->scope_job); diff --git a/src/machine/machine.h b/src/machine/machine.h index 5c6366554..4827ba332 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -72,7 +72,6 @@ struct Machine { bool in_gc_queue:1; bool started:1; - bool registered:1; sd_bus_message *create_message; @@ -94,20 +93,6 @@ int machine_kill(Machine *m, KillWho who, int signo); MachineState machine_get_state(Machine *u); -extern const sd_bus_vtable machine_vtable[]; - -char *machine_bus_path(Machine *s); -int machine_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); -int machine_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); - -int bus_machine_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_machine_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_machine_method_get_addresses(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); - -int machine_send_signal(Machine *m, bool new_machine); -int machine_send_create_reply(Machine *m, sd_bus_error *error); - const char* machine_class_to_string(MachineClass t) _const_; MachineClass machine_class_from_string(const char *s) _pure_; diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index f604263d8..9f8c68b18 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -30,21 +30,35 @@ #include #include #include +#include + +/* When we include libgen.h because we need dirname() we immediately + * undefine basename() since libgen.h defines it as a macro to the XDG + * version which is really broken. */ +#include +#undef basename #include "sd-bus.h" #include "log.h" #include "util.h" #include "macro.h" #include "pager.h" +#include "spawn-polkit-agent.h" #include "bus-util.h" #include "bus-error.h" #include "build.h" #include "strv.h" #include "unit-name.h" #include "cgroup-show.h" +#include "logs-show.h" #include "cgroup-util.h" #include "ptyfwd.h" #include "event-util.h" +#include "path-util.h" +#include "mkdir.h" +#include "copy.h" +#include "verbs.h" +#include "import-util.h" static char **arg_property = NULL; static bool arg_all = false; @@ -55,23 +69,71 @@ static const char *arg_kill_who = NULL; static int arg_signal = SIGTERM; static BusTransport arg_transport = BUS_TRANSPORT_LOCAL; static char *arg_host = NULL; +static bool arg_read_only = false; +static bool arg_mkdir = false; +static bool arg_quiet = false; +static bool arg_ask_password = true; +static unsigned arg_lines = 10; +static OutputMode arg_output = OUTPUT_SHORT; +static bool arg_force = false; +static ImportVerify arg_verify = IMPORT_VERIFY_SIGNATURE; +static const char* arg_dkr_index_url = NULL; static void pager_open_if_enabled(void) { - /* Cache result before we open the pager */ if (arg_no_pager) return; pager_open(false); } -static int list_machines(sd_bus *bus, char **args, unsigned n) { - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; +static void polkit_agent_open_if_enabled(void) { + + /* Open the polkit agent as a child process if necessary */ + + if (!arg_ask_password) + return; + + if (arg_transport != BUS_TRANSPORT_LOCAL) + return; + + polkit_agent_open(); +} + +static OutputFlags get_output_flags(void) { + return + arg_all * OUTPUT_SHOW_ALL | + arg_full * OUTPUT_FULL_WIDTH | + (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | + on_tty() * OUTPUT_COLOR | + !arg_quiet * OUTPUT_WARN_CUTOFF; +} + +typedef struct MachineInfo { + const char *name; + const char *class; + const char *service; +} MachineInfo; + +static int compare_machine_info(const void *a, const void *b) { + const MachineInfo *x = a, *y = b; + + return strcmp(x->name, y->name); +} + +static int list_machines(int argc, char *argv[], void *userdata) { + + size_t max_name = strlen("MACHINE"), max_class = strlen("CLASS"), max_service = strlen("SERVICE"); _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_free_ MachineInfo *machines = NULL; const char *name, *class, *service, *object; - unsigned k = 0; + size_t n_machines = 0, n_allocated = 0, j; + sd_bus *bus = userdata; int r; + assert(bus); + pager_open_if_enabled(); r = sd_bus_call_method( @@ -82,23 +144,160 @@ static int list_machines(sd_bus *bus, char **args, unsigned n) { "ListMachines", &error, &reply, - ""); + NULL); if (r < 0) { log_error("Could not get machines: %s", bus_error_message(&error, -r)); return r; } + r = sd_bus_message_enter_container(reply, 'a', "(ssso)"); + if (r < 0) + return bus_log_parse_error(r); + + while ((r = sd_bus_message_read(reply, "(ssso)", &name, &class, &service, &object)) > 0) { + size_t l; + + if (!GREEDY_REALLOC(machines, n_allocated, n_machines + 1)) + return log_oom(); + + machines[n_machines].name = name; + machines[n_machines].class = class; + machines[n_machines].service = service; + + l = strlen(name); + if (l > max_name) + max_name = l; + + l = strlen(class); + if (l > max_class) + max_class = l; + + l = strlen(service); + if (l > max_service) + max_service = l; + + n_machines ++; + } + if (r < 0) + return bus_log_parse_error(r); + + r = sd_bus_message_exit_container(reply); + if (r < 0) + return bus_log_parse_error(r); + + qsort_safe(machines, n_machines, sizeof(MachineInfo), compare_machine_info); + + if (arg_legend) + printf("%-*s %-*s %-*s\n", + (int) max_name, "MACHINE", + (int) max_class, "CLASS", + (int) max_service, "SERVICE"); + + for (j = 0; j < n_machines; j++) + printf("%-*s %-*s %-*s\n", + (int) max_name, machines[j].name, + (int) max_class, machines[j].class, + (int) max_service, machines[j].service); + if (arg_legend) - printf("%-32s %-9s %-16s\n", "MACHINE", "CONTAINER", "SERVICE"); + printf("\n%zu machines listed.\n", n_machines); + + return 0; +} + +typedef struct ImageInfo { + const char *name; + const char *type; + bool read_only; + usec_t crtime; + usec_t mtime; + uint64_t size; +} ImageInfo; + +static int compare_image_info(const void *a, const void *b) { + const ImageInfo *x = a, *y = b; + + return strcmp(x->name, y->name); +} + +static int list_images(int argc, char *argv[], void *userdata) { + + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + size_t max_name = strlen("NAME"), max_type = strlen("TYPE"), max_size = strlen("USAGE"), max_crtime = strlen("CREATED"), max_mtime = strlen("MODIFIED"); + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_free_ ImageInfo *images = NULL; + size_t n_images = 0, n_allocated = 0, j; + const char *name, *type, *object; + sd_bus *bus = userdata; + uint64_t crtime, mtime, size; + int read_only, r; + + assert(bus); + + pager_open_if_enabled(); + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "ListImages", + &error, + &reply, + ""); + if (r < 0) { + log_error("Could not get images: %s", bus_error_message(&error, -r)); + return r; + } - r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssso)"); + r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssbttto)"); if (r < 0) return bus_log_parse_error(r); - while ((r = sd_bus_message_read(reply, "(ssso)", &name, &class, &service, &object)) > 0) { - printf("%-32s %-9s %-16s\n", name, class, service); + while ((r = sd_bus_message_read(reply, "(ssbttto)", &name, &type, &read_only, &crtime, &mtime, &size, &object)) > 0) { + char buf[MAX(FORMAT_TIMESTAMP_MAX, FORMAT_BYTES_MAX)]; + size_t l; + + if (name[0] == '.' && !arg_all) + continue; + + if (!GREEDY_REALLOC(images, n_allocated, n_images + 1)) + return log_oom(); + + images[n_images].name = name; + images[n_images].type = type; + images[n_images].read_only = read_only; + images[n_images].crtime = crtime; + images[n_images].mtime = mtime; + images[n_images].size = size; + + l = strlen(name); + if (l > max_name) + max_name = l; + + l = strlen(type); + if (l > max_type) + max_type = l; + + if (crtime != 0) { + l = strlen(strna(format_timestamp(buf, sizeof(buf), crtime))); + if (l > max_crtime) + max_crtime = l; + } + + if (mtime != 0) { + l = strlen(strna(format_timestamp(buf, sizeof(buf), mtime))); + if (l > max_mtime) + max_mtime = l; + } + + if (size != (uint64_t) -1) { + l = strlen(strna(format_bytes(buf, sizeof(buf), size))); + if (l > max_size) + max_size = l; + } - k++; + n_images++; } if (r < 0) return bus_log_parse_error(r); @@ -107,8 +306,31 @@ static int list_machines(sd_bus *bus, char **args, unsigned n) { if (r < 0) return bus_log_parse_error(r); + qsort_safe(images, n_images, sizeof(ImageInfo), compare_image_info); + if (arg_legend) - printf("\n%u machines listed.\n", k); + printf("%-*s %-*s %-3s %-*s %-*s %-*s\n", + (int) max_name, "NAME", + (int) max_type, "TYPE", + "RO", + (int) max_size, "USAGE", + (int) max_crtime, "CREATED", + (int) max_mtime, "MODIFIED"); + + for (j = 0; j < n_images; j++) { + char crtime_buf[FORMAT_TIMESTAMP_MAX], mtime_buf[FORMAT_TIMESTAMP_MAX], size_buf[FORMAT_BYTES_MAX]; + + printf("%-*s %-*s %s%-3s%s %-*s %-*s %-*s\n", + (int) max_name, images[j].name, + (int) max_type, images[j].type, + images[j].read_only ? ansi_highlight_red() : "", yes_no(images[j].read_only), images[j].read_only ? ansi_highlight_off() : "", + (int) max_size, strna(format_bytes(size_buf, sizeof(size_buf), images[j].size)), + (int) max_crtime, strna(format_timestamp(crtime_buf, sizeof(crtime_buf), images[j].crtime)), + (int) max_mtime, strna(format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime))); + } + + if (arg_legend) + printf("\n%zu images listed.\n", n_images); return 0; } @@ -118,7 +340,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *unit, pid_t leader) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_free_ char *path = NULL; const char *cgroup; - int r, output_flags; + int r; unsigned c; assert(bus); @@ -155,17 +377,13 @@ static int show_unit_cgroup(sd_bus *bus, const char *unit, pid_t leader) { if (cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup, false) != 0 && leader <= 0) return 0; - output_flags = - arg_all * OUTPUT_SHOW_ALL | - arg_full * OUTPUT_FULL_WIDTH; - c = columns(); if (c > 18) c -= 18; else c = 0; - show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t ", c, false, &leader, leader > 0, output_flags); + show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t ", c, false, &leader, leader > 0, get_output_flags()); return 0; } @@ -280,7 +498,7 @@ typedef struct MachineStatusInfo { char *unit; char *root_directory; pid_t leader; - usec_t timestamp; + struct dual_timestamp timestamp; int *netif; unsigned n_netif; } MachineStatusInfo; @@ -290,6 +508,7 @@ static void print_machine_status_info(sd_bus *bus, MachineStatusInfo *i) { char since2[FORMAT_TIMESTAMP_MAX], *s2; int ifi = -1; + assert(bus); assert(i); fputs(strna(i->name), stdout); @@ -299,8 +518,8 @@ static void print_machine_status_info(sd_bus *bus, MachineStatusInfo *i) { else putchar('\n'); - s1 = format_timestamp_relative(since1, sizeof(since1), i->timestamp); - s2 = format_timestamp(since2, sizeof(since2), i->timestamp); + s1 = format_timestamp_relative(since1, sizeof(since1), i->timestamp.realtime); + s2 = format_timestamp(since2, sizeof(since2), i->timestamp.realtime); if (s1) printf("\t Since: %s; %s\n", s2, s1); @@ -364,6 +583,22 @@ static void print_machine_status_info(sd_bus *bus, MachineStatusInfo *i) { if (i->unit) { printf("\t Unit: %s\n", i->unit); show_unit_cgroup(bus, i->unit, i->leader); + + if (arg_transport == BUS_TRANSPORT_LOCAL) { + + show_journal_by_unit( + stdout, + i->unit, + arg_output, + 0, + i->timestamp.monotonic, + arg_lines, + 0, + get_output_flags() | OUTPUT_BEGIN_NEWLINE, + SD_JOURNAL_LOCAL_ONLY, + true, + NULL); + } } } @@ -388,24 +623,27 @@ static int map_netif(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_ return 0; } -static int show_info(const char *verb, sd_bus *bus, const char *path, bool *new_line) { +static int show_machine_info(const char *verb, sd_bus *bus, const char *path, bool *new_line) { static const struct bus_properties_map map[] = { - { "Name", "s", NULL, offsetof(MachineStatusInfo, name) }, - { "Class", "s", NULL, offsetof(MachineStatusInfo, class) }, - { "Service", "s", NULL, offsetof(MachineStatusInfo, service) }, - { "Unit", "s", NULL, offsetof(MachineStatusInfo, unit) }, - { "RootDirectory", "s", NULL, offsetof(MachineStatusInfo, root_directory) }, - { "Leader", "u", NULL, offsetof(MachineStatusInfo, leader) }, - { "Timestamp", "t", NULL, offsetof(MachineStatusInfo, timestamp) }, - { "Id", "ay", bus_map_id128, offsetof(MachineStatusInfo, id) }, - { "NetworkInterfaces", "ai", map_netif, 0 }, + { "Name", "s", NULL, offsetof(MachineStatusInfo, name) }, + { "Class", "s", NULL, offsetof(MachineStatusInfo, class) }, + { "Service", "s", NULL, offsetof(MachineStatusInfo, service) }, + { "Unit", "s", NULL, offsetof(MachineStatusInfo, unit) }, + { "RootDirectory", "s", NULL, offsetof(MachineStatusInfo, root_directory) }, + { "Leader", "u", NULL, offsetof(MachineStatusInfo, leader) }, + { "Timestamp", "t", NULL, offsetof(MachineStatusInfo, timestamp.realtime) }, + { "TimestampMonotonic", "t", NULL, offsetof(MachineStatusInfo, timestamp.monotonic) }, + { "Id", "ay", bus_map_id128, offsetof(MachineStatusInfo, id) }, + { "NetworkInterfaces", "ai", map_netif, 0 }, {} }; MachineStatusInfo info = {}; int r; + assert(verb); + assert(bus); assert(path); assert(new_line); @@ -433,9 +671,13 @@ static int show_info(const char *verb, sd_bus *bus, const char *path, bool *new_ return r; } -static int show_properties(sd_bus *bus, const char *path, bool *new_line) { +static int show_machine_properties(sd_bus *bus, const char *path, bool *new_line) { int r; + assert(bus); + assert(path); + assert(new_line); + if (*new_line) printf("\n"); @@ -448,30 +690,30 @@ static int show_properties(sd_bus *bus, const char *path, bool *new_line) { return r; } -static int show(sd_bus *bus, char **args, unsigned n) { - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; +static int show_machine(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - int r = 0; - unsigned i; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; bool properties, new_line = false; + sd_bus *bus = userdata; + int r = 0, i; assert(bus); - assert(args); - properties = !strstr(args[0], "status"); + properties = !strstr(argv[0], "status"); pager_open_if_enabled(); - if (properties && n <= 1) { + if (properties && argc <= 1) { /* If no argument is specified, inspect the manager * itself */ - r = show_properties(bus, "/org/freedesktop/machine1", &new_line); + r = show_machine_properties(bus, "/org/freedesktop/machine1", &new_line); if (r < 0) return r; } - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { const char *path = NULL; r = sd_bus_call_method( @@ -482,7 +724,7 @@ static int show(sd_bus *bus, char **args, unsigned n) { "GetMachine", &error, &reply, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Could not get path to machine: %s", bus_error_message(&error, -r)); return r; @@ -493,35 +735,222 @@ static int show(sd_bus *bus, char **args, unsigned n) { return bus_log_parse_error(r); if (properties) - r = show_properties(bus, path, &new_line); + r = show_machine_properties(bus, path, &new_line); else - r = show_info(args[0], bus, path, &new_line); + r = show_machine_info(argv[0], bus, path, &new_line); + } + + return r; +} + +typedef struct ImageStatusInfo { + char *name; + char *path; + char *type; + int read_only; + usec_t crtime; + usec_t mtime; + uint64_t usage; + uint64_t limit; + uint64_t usage_exclusive; + uint64_t limit_exclusive; +} ImageStatusInfo; + +static void print_image_status_info(sd_bus *bus, ImageStatusInfo *i) { + char ts_relative[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1; + char ts_absolute[FORMAT_TIMESTAMP_MAX], *s2; + char bs[FORMAT_BYTES_MAX], *s3; + char bs_exclusive[FORMAT_BYTES_MAX], *s4; + + assert(bus); + assert(i); + + if (i->name) { + fputs(i->name, stdout); + putchar('\n'); } + if (i->type) + printf("\t Type: %s\n", i->type); + + if (i->path) + printf("\t Path: %s\n", i->path); + + printf("\t RO: %s%s%s\n", + i->read_only ? ansi_highlight_red() : "", + i->read_only ? "read-only" : "writable", + i->read_only ? ansi_highlight_off() : ""); + + s1 = format_timestamp_relative(ts_relative, sizeof(ts_relative), i->crtime); + s2 = format_timestamp(ts_absolute, sizeof(ts_absolute), i->crtime); + if (s1 && s2) + printf("\t Created: %s; %s\n", s2, s1); + else if (s2) + printf("\t Created: %s\n", s2); + + s1 = format_timestamp_relative(ts_relative, sizeof(ts_relative), i->mtime); + s2 = format_timestamp(ts_absolute, sizeof(ts_absolute), i->mtime); + if (s1 && s2) + printf("\tModified: %s; %s\n", s2, s1); + else if (s2) + printf("\tModified: %s\n", s2); + + s3 = format_bytes(bs, sizeof(bs), i->usage); + s4 = i->usage_exclusive != i->usage ? format_bytes(bs_exclusive, sizeof(bs_exclusive), i->usage_exclusive) : NULL; + if (s3 && s4) + printf("\t Usage: %s (exclusive: %s)\n", s3, s4); + else if (s3) + printf("\t Usage: %s\n", s3); + + s3 = format_bytes(bs, sizeof(bs), i->limit); + s4 = i->limit_exclusive != i->limit ? format_bytes(bs_exclusive, sizeof(bs_exclusive), i->limit_exclusive) : NULL; + if (s3 && s4) + printf("\t Limit: %s (exclusive: %s)\n", s3, s4); + else if (s3) + printf("\t Limit: %s\n", s3); +} + +static int show_image_info(const char *verb, sd_bus *bus, const char *path, bool *new_line) { + + static const struct bus_properties_map map[] = { + { "Name", "s", NULL, offsetof(ImageStatusInfo, name) }, + { "Path", "s", NULL, offsetof(ImageStatusInfo, path) }, + { "Type", "s", NULL, offsetof(ImageStatusInfo, type) }, + { "ReadOnly", "b", NULL, offsetof(ImageStatusInfo, read_only) }, + { "CreationTimestamp", "t", NULL, offsetof(ImageStatusInfo, crtime) }, + { "ModificationTimestamp", "t", NULL, offsetof(ImageStatusInfo, mtime) }, + { "Usage", "t", NULL, offsetof(ImageStatusInfo, usage) }, + { "Limit", "t", NULL, offsetof(ImageStatusInfo, limit) }, + { "UsageExclusive", "t", NULL, offsetof(ImageStatusInfo, usage_exclusive) }, + { "LimitExclusive", "t", NULL, offsetof(ImageStatusInfo, limit_exclusive) }, + {} + }; + + ImageStatusInfo info = {}; + int r; + + assert(verb); + assert(bus); + assert(path); + assert(new_line); + + r = bus_map_all_properties(bus, + "org.freedesktop.machine1", + path, + map, + &info); + if (r < 0) + return log_error_errno(r, "Could not get properties: %m"); + + if (*new_line) + printf("\n"); + *new_line = true; + + print_image_status_info(bus, &info); + + free(info.name); + free(info.path); + free(info.type); + + return r; +} + +static int show_image_properties(sd_bus *bus, const char *path, bool *new_line) { + int r; + + assert(bus); + assert(path); + assert(new_line); + + if (*new_line) + printf("\n"); + + *new_line = true; + + r = bus_print_all_properties(bus, "org.freedesktop.machine1", path, arg_property, arg_all); + if (r < 0) + log_error_errno(r, "Could not get properties: %m"); + return r; } -static int kill_machine(sd_bus *bus, char **args, unsigned n) { +static int show_image(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + bool properties, new_line = false; + sd_bus *bus = userdata; + int r = 0, i; + + assert(bus); - assert(args); + properties = !strstr(argv[0], "status"); - if (!arg_kill_who) - arg_kill_who = "all"; + pager_open_if_enabled(); - for (i = 1; i < n; i++) { - int r; + if (properties && argc <= 1) { + + /* If no argument is specified, inspect the manager + * itself */ + r = show_image_properties(bus, "/org/freedesktop/machine1", &new_line); + if (r < 0) + return r; + } + + for (i = 1; i < argc; i++) { + const char *path = NULL; r = sd_bus_call_method( bus, "org.freedesktop.machine1", "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", - "KillMachine", + "GetImage", &error, - NULL, - "ssi", args[i], arg_kill_who, arg_signal); + &reply, + "s", argv[i]); + if (r < 0) { + log_error("Could not get path to image: %s", bus_error_message(&error, -r)); + return r; + } + + r = sd_bus_message_read(reply, "o", &path); + if (r < 0) + return bus_log_parse_error(r); + + if (properties) + r = show_image_properties(bus, path, &new_line); + else + r = show_image_info(argv[0], bus, path, &new_line); + } + + return r; +} + +static int kill_machine(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int i; + + assert(bus); + + polkit_agent_open_if_enabled(); + + if (!arg_kill_who) + arg_kill_who = "all"; + + for (i = 1; i < argc; i++) { + int r; + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "KillMachine", + &error, + NULL, + "ssi", argv[i], arg_kill_who, arg_signal); if (r < 0) { log_error("Could not kill machine: %s", bus_error_message(&error, -r)); return r; @@ -531,27 +960,30 @@ static int kill_machine(sd_bus *bus, char **args, unsigned n) { return 0; } -static int reboot_machine(sd_bus *bus, char **args, unsigned n) { +static int reboot_machine(int argc, char *argv[], void *userdata) { arg_kill_who = "leader"; arg_signal = SIGINT; /* sysvinit + systemd */ - return kill_machine(bus, args, n); + return kill_machine(argc, argv, userdata); } -static int poweroff_machine(sd_bus *bus, char **args, unsigned n) { +static int poweroff_machine(int argc, char *argv[], void *userdata) { arg_kill_who = "leader"; arg_signal = SIGRTMIN+4; /* only systemd */ - return kill_machine(bus, args, n); + return kill_machine(argc, argv, userdata); } -static int terminate_machine(sd_bus *bus, char **args, unsigned n) { +static int terminate_machine(int argc, char *argv[], void *userdata) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - unsigned i; + sd_bus *bus = userdata; + int i; + + assert(bus); - assert(args); + polkit_agent_open_if_enabled(); - for (i = 1; i < n; i++) { + for (i = 1; i < argc; i++) { int r; r = sd_bus_call_method( @@ -562,7 +994,7 @@ static int terminate_machine(sd_bus *bus, char **args, unsigned n) { "TerminateMachine", &error, NULL, - "s", args[i]); + "s", argv[i]); if (r < 0) { log_error("Could not terminate machine: %s", bus_error_message(&error, -r)); return r; @@ -572,111 +1004,811 @@ static int terminate_machine(sd_bus *bus, char **args, unsigned n) { return 0; } -static int openpt_in_namespace(pid_t pid, int flags) { - _cleanup_close_pair_ int pair[2] = { -1, -1 }; - _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1; - union { - struct cmsghdr cmsghdr; - uint8_t buf[CMSG_SPACE(sizeof(int))]; - } control = {}; - struct msghdr mh = { - .msg_control = &control, - .msg_controllen = sizeof(control), - }; - struct cmsghdr *cmsg; - int master = -1, r; - pid_t child; - siginfo_t si; +static int machine_get_leader(sd_bus *bus, const char *name, pid_t *ret) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *reply2 = NULL; + const char *object; + uint32_t leader; + int r; - r = namespace_open(pid, &pidnsfd, &mntnsfd, NULL, &rootfd); - if (r < 0) + assert(bus); + assert(name); + assert(ret); + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "GetMachine", + &error, + &reply, + "s", name); + if (r < 0) { + log_error("Could not get path to machine: %s", bus_error_message(&error, -r)); return r; + } - if (socketpair(AF_UNIX, SOCK_DGRAM, 0, pair) < 0) - return -errno; + r = sd_bus_message_read(reply, "o", &object); + if (r < 0) + return bus_log_parse_error(r); - child = fork(); - if (child < 0) - return -errno; + r = sd_bus_get_property( + bus, + "org.freedesktop.machine1", + object, + "org.freedesktop.machine1.Machine", + "Leader", + &error, + &reply2, + "u"); + if (r < 0) + return log_error_errno(r, "Failed to retrieve PID of leader: %m"); - if (child == 0) { - pair[0] = safe_close(pair[0]); + r = sd_bus_message_read(reply2, "u", &leader); + if (r < 0) + return bus_log_parse_error(r); - r = namespace_enter(pidnsfd, mntnsfd, -1, rootfd); - if (r < 0) - _exit(EXIT_FAILURE); + *ret = leader; + return 0; +} + +static int copy_files(int argc, char *argv[], void *userdata) { + char *dest, *host_path, *container_path, *host_dirname, *host_basename, *container_dirname, *container_basename, *t; + _cleanup_close_ int hostfd = -1; + sd_bus *bus = userdata; + pid_t child, leader; + bool copy_from; + siginfo_t si; + int r; + + assert(bus); + + copy_from = streq(argv[0], "copy-from"); + dest = argv[3] ?: argv[2]; + host_path = strdupa(copy_from ? dest : argv[2]); + container_path = strdupa(copy_from ? argv[2] : dest); + + if (!path_is_absolute(container_path)) { + log_error("Container path not absolute."); + return -EINVAL; + } + + t = strdupa(host_path); + host_basename = basename(t); + host_dirname = dirname(host_path); + + t = strdupa(container_path); + container_basename = basename(t); + container_dirname = dirname(container_path); + + r = machine_get_leader(bus, argv[1], &leader); + if (r < 0) + return r; + + hostfd = open(host_dirname, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_DIRECTORY); + if (r < 0) + return log_error_errno(errno, "Failed to open source directory: %m"); + + child = fork(); + if (child < 0) + return log_error_errno(errno, "Failed to fork(): %m"); + + if (child == 0) { + int containerfd; + const char *q; + int mntfd; + + q = procfs_file_alloca(leader, "ns/mnt"); + mntfd = open(q, O_RDONLY|O_NOCTTY|O_CLOEXEC); + if (mntfd < 0) { + log_error_errno(errno, "Failed to open mount namespace of leader: %m"); + _exit(EXIT_FAILURE); + } + + if (setns(mntfd, CLONE_NEWNS) < 0) { + log_error_errno(errno, "Failed to join namespace of leader: %m"); + _exit(EXIT_FAILURE); + } + + containerfd = open(container_dirname, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_DIRECTORY); + if (containerfd < 0) { + log_error_errno(errno, "Failed top open destination directory: %m"); + _exit(EXIT_FAILURE); + } + + if (copy_from) + r = copy_tree_at(containerfd, container_basename, hostfd, host_basename, true); + else + r = copy_tree_at(hostfd, host_basename, containerfd, container_basename, true); + if (r < 0) { + log_error_errno(errno, "Failed to copy tree: %m"); + _exit(EXIT_FAILURE); + } + + _exit(EXIT_SUCCESS); + } + + r = wait_for_terminate(child, &si); + if (r < 0) + return log_error_errno(r, "Failed to wait for client: %m"); + if (si.si_code != CLD_EXITED) { + log_error("Client died abnormally."); + return -EIO; + } + if (si.si_status != EXIT_SUCCESS) + return -EIO; + + return 0; +} + +static int bind_mount(int argc, char *argv[], void *userdata) { + char mount_slave[] = "/tmp/propagate.XXXXXX", *mount_tmp, *mount_outside, *p; + sd_bus *bus = userdata; + pid_t child, leader; + const char *dest; + siginfo_t si; + bool mount_slave_created = false, mount_slave_mounted = false, + mount_tmp_created = false, mount_tmp_mounted = false, + mount_outside_created = false, mount_outside_mounted = false; + int r; + + assert(bus); + + /* One day, when bind mounting /proc/self/fd/n works across + * namespace boundaries we should rework this logic to make + * use of it... */ + + dest = argv[3] ?: argv[2]; + if (!path_is_absolute(dest)) { + log_error("Destination path not absolute."); + return -EINVAL; + } + + p = strjoina("/run/systemd/nspawn/propagate/", argv[1], "/"); + if (access(p, F_OK) < 0) { + log_error("Container does not allow propagation of mount points."); + return -ENOTSUP; + } + + r = machine_get_leader(bus, argv[1], &leader); + if (r < 0) + return r; + + /* Our goal is to install a new bind mount into the container, + possibly read-only. This is irritatingly complex + unfortunately, currently. + + First, we start by creating a private playground in /tmp, + that we can mount MS_SLAVE. (Which is necessary, since + MS_MOUNT cannot be applied to mounts with MS_SHARED parent + mounts.) */ + + if (!mkdtemp(mount_slave)) + return log_error_errno(errno, "Failed to create playground: %m"); + + mount_slave_created = true; + + if (mount(mount_slave, mount_slave, NULL, MS_BIND, NULL) < 0) { + r = log_error_errno(errno, "Failed to make bind mount: %m"); + goto finish; + } + + mount_slave_mounted = true; + + if (mount(NULL, mount_slave, NULL, MS_SLAVE, NULL) < 0) { + r = log_error_errno(errno, "Failed to remount slave: %m"); + goto finish; + } + + /* Second, we mount the source directory to a directory inside + of our MS_SLAVE playground. */ + mount_tmp = strjoina(mount_slave, "/mount"); + if (mkdir(mount_tmp, 0700) < 0) { + r = log_error_errno(errno, "Failed to create temporary mount: %m"); + goto finish; + } + + mount_tmp_created = true; + + if (mount(argv[2], mount_tmp, NULL, MS_BIND, NULL) < 0) { + r = log_error_errno(errno, "Failed to overmount: %m"); + goto finish; + } + + mount_tmp_mounted = true; + + /* Third, we remount the new bind mount read-only if requested. */ + if (arg_read_only) + if (mount(NULL, mount_tmp, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) { + r = log_error_errno(errno, "Failed to mark read-only: %m"); + goto finish; + } + + /* Fourth, we move the new bind mount into the propagation + * directory. This way it will appear there read-only + * right-away. */ + + mount_outside = strjoina("/run/systemd/nspawn/propagate/", argv[1], "/XXXXXX"); + if (!mkdtemp(mount_outside)) { + r = log_error_errno(errno, "Cannot create propagation directory: %m"); + goto finish; + } + + mount_outside_created = true; + + if (mount(mount_tmp, mount_outside, NULL, MS_MOVE, NULL) < 0) { + r = log_error_errno(errno, "Failed to move: %m"); + goto finish; + } + + mount_outside_mounted = true; + mount_tmp_mounted = false; + + (void) rmdir(mount_tmp); + mount_tmp_created = false; + + (void) umount(mount_slave); + mount_slave_mounted = false; + + (void) rmdir(mount_slave); + mount_slave_created = false; + + child = fork(); + if (child < 0) { + r = log_error_errno(errno, "Failed to fork(): %m"); + goto finish; + } + + if (child == 0) { + const char *mount_inside; + int mntfd; + const char *q; + + q = procfs_file_alloca(leader, "ns/mnt"); + mntfd = open(q, O_RDONLY|O_NOCTTY|O_CLOEXEC); + if (mntfd < 0) { + log_error_errno(errno, "Failed to open mount namespace of leader: %m"); + _exit(EXIT_FAILURE); + } + + if (setns(mntfd, CLONE_NEWNS) < 0) { + log_error_errno(errno, "Failed to join namespace of leader: %m"); + _exit(EXIT_FAILURE); + } + + if (arg_mkdir) + mkdir_p(dest, 0755); + + /* Fifth, move the mount to the right place inside */ + mount_inside = strjoina("/run/systemd/nspawn/incoming/", basename(mount_outside)); + if (mount(mount_inside, dest, NULL, MS_MOVE, NULL) < 0) { + log_error_errno(errno, "Failed to mount: %m"); + _exit(EXIT_FAILURE); + } + + _exit(EXIT_SUCCESS); + } + + r = wait_for_terminate(child, &si); + if (r < 0) { + log_error_errno(r, "Failed to wait for client: %m"); + goto finish; + } + if (si.si_code != CLD_EXITED) { + log_error("Client died abnormally."); + r = -EIO; + goto finish; + } + if (si.si_status != EXIT_SUCCESS) { + r = -EIO; + goto finish; + } + + r = 0; + +finish: + if (mount_outside_mounted) + umount(mount_outside); + if (mount_outside_created) + rmdir(mount_outside); + + if (mount_tmp_mounted) + umount(mount_tmp); + if (mount_tmp_created) + umount(mount_tmp); + + if (mount_slave_mounted) + umount(mount_slave); + if (mount_slave_created) + umount(mount_slave); + + return r; +} + +static int on_machine_removed(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { + PTYForward ** forward = (PTYForward**) userdata; + int r; + + assert(bus); + assert(m); + assert(forward); + + if (*forward) { + /* If the forwarder is already initialized, tell it to + * exit on the next vhangup(), so that we still flush + * out what might be queued and exit then. */ + + r = pty_forward_set_ignore_vhangup(*forward, false); + if (r >= 0) + return 0; + + log_error_errno(r, "Failed to set ignore_vhangup flag: %m"); + } + + /* On error, or when the forwarder is not initialized yet, quit immediately */ + sd_event_exit(sd_bus_get_event(bus), EXIT_FAILURE); + return 0; +} + +static int login_machine(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; + _cleanup_bus_slot_unref_ sd_bus_slot *slot = NULL; + _cleanup_(pty_forward_freep) PTYForward *forward = NULL; + _cleanup_event_unref_ sd_event *event = NULL; + int master = -1, r, ret = 0; + sd_bus *bus = userdata; + const char *pty, *match; + char last_char = 0; + bool machine_died; + + assert(bus); + + if (arg_transport != BUS_TRANSPORT_LOCAL && + arg_transport != BUS_TRANSPORT_MACHINE) { + log_error("Login only supported on local machines."); + return -ENOTSUP; + } + + polkit_agent_open_if_enabled(); + + r = sd_event_default(&event); + if (r < 0) + return log_error_errno(r, "Failed to get event loop: %m"); + + r = sd_bus_attach_event(bus, event, 0); + if (r < 0) + return log_error_errno(r, "Failed to attach bus to event loop: %m"); + + match = strjoina("type='signal'," + "sender='org.freedesktop.machine1'," + "path='/org/freedesktop/machine1',", + "interface='org.freedesktop.machine1.Manager'," + "member='MachineRemoved'," + "arg0='", + argv[1], + "'"); + + r = sd_bus_add_match(bus, &slot, match, on_machine_removed, &forward); + if (r < 0) + return log_error_errno(r, "Failed to add machine removal match: %m"); + + r = sd_bus_message_new_method_call(bus, + &m, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "OpenMachineLogin"); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_append(m, "s", argv[1]); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_call(bus, m, 0, &error, &reply); + if (r < 0) { + log_error("Failed to get machine PTY: %s", bus_error_message(&error, -r)); + return r; + } + + r = sd_bus_message_read(reply, "hs", &master, &pty); + if (r < 0) + return bus_log_parse_error(r); + + sigprocmask_many(SIG_BLOCK, SIGWINCH, SIGTERM, SIGINT, -1); + + log_info("Connected to machine %s. Press ^] three times within 1s to exit session.", argv[1]); + + sd_event_add_signal(event, NULL, SIGINT, NULL, NULL); + sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL); + + r = pty_forward_new(event, master, true, &forward); + if (r < 0) + return log_error_errno(r, "Failed to create PTY forwarder: %m"); + + r = sd_event_loop(event); + if (r < 0) + return log_error_errno(r, "Failed to run event loop: %m"); + + pty_forward_get_last_char(forward, &last_char); + machine_died = pty_forward_get_ignore_vhangup(forward) == 0; + + forward = pty_forward_free(forward); + + if (last_char != '\n') + fputc('\n', stdout); + + if (machine_died) + log_info("Machine %s terminated.", argv[1]); + else + log_info("Connection to machine %s terminated.", argv[1]); + + sd_event_get_exit_code(event, &ret); + return ret; +} + +static int remove_image(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int r, i; + + assert(bus); + + polkit_agent_open_if_enabled(); + + for (i = 1; i < argc; i++) { + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "RemoveImage", + &error, + NULL, + "s", argv[i]); + if (r < 0) { + log_error("Could not remove image: %s", bus_error_message(&error, -r)); + return r; + } + } + + return 0; +} + +static int rename_image(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int r; + + polkit_agent_open_if_enabled(); + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "RenameImage", + &error, + NULL, + "ss", argv[1], argv[2]); + if (r < 0) { + log_error("Could not rename image: %s", bus_error_message(&error, -r)); + return r; + } + + return 0; +} + +static int clone_image(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int r; + + polkit_agent_open_if_enabled(); + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "CloneImage", + &error, + NULL, + "ssb", argv[1], argv[2], arg_read_only); + if (r < 0) { + log_error("Could not clone image: %s", bus_error_message(&error, -r)); + return r; + } + + return 0; +} + +static int read_only_image(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int b = true, r; + + if (argc > 2) { + b = parse_boolean(argv[2]); + if (b < 0) { + log_error("Failed to parse boolean argument: %s", argv[2]); + return -EINVAL; + } + } + + polkit_agent_open_if_enabled(); + + r = sd_bus_call_method( + bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "MarkImageReadOnly", + &error, + NULL, + "sb", argv[1], b); + if (r < 0) { + log_error("Could not mark image read-only: %s", bus_error_message(&error, -r)); + return r; + } + + return 0; +} + +static int start_machine(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *w = NULL; + sd_bus *bus = userdata; + int r, i; + + assert(bus); + + polkit_agent_open_if_enabled(); + + r = bus_wait_for_jobs_new(bus, &w); + if (r < 0) + return log_oom(); + + for (i = 1; i < argc; i++) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; + _cleanup_free_ char *e = NULL, *unit = NULL; + const char *object; + + if (!machine_name_is_valid(argv[i])) { + log_error("Invalid machine name %s.", argv[i]); + return -EINVAL; + } + + e = unit_name_escape(argv[i]); + if (!e) + return log_oom(); + + unit = unit_name_build("systemd-nspawn", e, ".service"); + if (!unit) + return log_oom(); + + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "StartUnit"); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_append(m, "ss", unit, "fail"); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_call(bus, m, 0, &error, &reply); + if (r < 0) { + log_error("Failed to start unit: %s", bus_error_message(&error, -r)); + return r; + } + + r = sd_bus_message_read(reply, "o", &object); + if (r < 0) + return bus_log_parse_error(r); + + r = bus_wait_for_jobs_add(w, object); + if (r < 0) + return log_oom(); + } + + r = bus_wait_for_jobs(w, arg_quiet); + if (r < 0) + return r; + + return 0; +} + +static int enable_machine(int argc, char *argv[], void *userdata) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + int carries_install_info = 0; + const char *method = NULL; + sd_bus *bus = userdata; + int r, i; + + assert(bus); + + polkit_agent_open_if_enabled(); + + method = streq(argv[0], "enable") ? "EnableUnitFiles" : "DisableUnitFiles"; + + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + method); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_open_container(m, 'a', "s"); + if (r < 0) + return bus_log_create_error(r); + + for (i = 1; i < argc; i++) { + _cleanup_free_ char *e = NULL, *unit = NULL; + + if (!machine_name_is_valid(argv[i])) { + log_error("Invalid machine name %s.", argv[i]); + return -EINVAL; + } + + e = unit_name_escape(argv[i]); + if (!e) + return log_oom(); + + unit = unit_name_build("systemd-nspawn", e, ".service"); + if (!unit) + return log_oom(); + + r = sd_bus_message_append(m, "s", unit); + if (r < 0) + return bus_log_create_error(r); + } + + r = sd_bus_message_close_container(m); + if (r < 0) + return bus_log_create_error(r); + + if (streq(argv[0], "enable")) + r = sd_bus_message_append(m, "bb", false, false); + else + r = sd_bus_message_append(m, "b", false); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_call(bus, m, 0, &error, &reply); + if (r < 0) { + log_error("Failed to enable or disable unit: %s", bus_error_message(&error, -r)); + return r; + } + + if (streq(argv[0], "enable")) { + r = sd_bus_message_read(reply, "b", carries_install_info); + if (r < 0) + return bus_log_parse_error(r); + } + + r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet); + if (r < 0) + return r; + + m = sd_bus_message_unref(m); + + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "Reload"); + if (r < 0) + return bus_log_create_error(r); - master = posix_openpt(flags); - if (master < 0) - _exit(EXIT_FAILURE); + r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); + if (r < 0) + return bus_log_create_error(r); - cmsg = CMSG_FIRSTHDR(&mh); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN(sizeof(int)); - memcpy(CMSG_DATA(cmsg), &master, sizeof(int)); + r = sd_bus_call(bus, m, 0, &error, NULL); + if (r < 0) { + log_error("Failed to reload daemon: %s", bus_error_message(&error, -r)); + return r; + } - mh.msg_controllen = cmsg->cmsg_len; + return 0; +} - if (sendmsg(pair[1], &mh, MSG_NOSIGNAL) < 0) - _exit(EXIT_FAILURE); +static int match_log_message(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + const char **our_path = userdata, *line; + unsigned priority; + int r; - _exit(EXIT_SUCCESS); + assert(bus); + assert(m); + assert(our_path); + + r = sd_bus_message_read(m, "us", &priority, &line); + if (r < 0) { + bus_log_parse_error(r); + return 0; } - pair[1] = safe_close(pair[1]); + if (!streq_ptr(*our_path, sd_bus_message_get_path(m))) + return 0; - r = wait_for_terminate(child, &si); - if (r < 0) - return r; - if (si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS) - return -EIO; + if (arg_quiet && LOG_PRI(priority) >= LOG_INFO) + return 0; - if (recvmsg(pair[0], &mh, MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) < 0) - return -errno; + log_full(priority, "%s", line); + return 0; +} - for (cmsg = CMSG_FIRSTHDR(&mh); cmsg; cmsg = CMSG_NXTHDR(&mh, cmsg)) - if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { - int *fds; - unsigned n_fds; +static int match_transfer_removed(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *error) { + const char **our_path = userdata, *path, *result; + uint32_t id; + int r; - fds = (int*) CMSG_DATA(cmsg); - n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); + assert(bus); + assert(m); + assert(our_path); - if (n_fds != 1) { - close_many(fds, n_fds); - return -EIO; - } + r = sd_bus_message_read(m, "uos", &id, &path, &result); + if (r < 0) { + bus_log_parse_error(r); + return 0; + } - master = fds[0]; - } + if (!streq_ptr(*our_path, path)) + return 0; - if (master < 0) - return -EIO; + sd_event_exit(sd_bus_get_event(bus), !streq_ptr(result, "done")); + return 0; +} + +static int transfer_signal_handler(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { + assert(s); + assert(si); - return master; + if (!arg_quiet) + log_info("Continuing download in the background. Use \"machinectl cancel-transfer %" PRIu32 "\" to abort transfer.", PTR_TO_UINT32(userdata)); + + sd_event_exit(sd_event_source_get_event(s), EINTR); + return 0; } -static int login_machine(sd_bus *bus, char **args, unsigned n) { - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *reply2 = NULL, *reply3 = NULL; +static int pull_image_common(sd_bus *bus, sd_bus_message *m) { + _cleanup_bus_slot_unref_ sd_bus_slot *slot_job_removed = NULL, *slot_log_message = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_bus_close_unref_ sd_bus *container_bus = NULL; - _cleanup_(pty_forward_freep) PTYForward *forward = NULL; - _cleanup_event_unref_ sd_event *event = NULL; - _cleanup_close_ int master = -1; - _cleanup_free_ char *getty = NULL; - const char *path, *pty, *p; - uint32_t leader; - sigset_t mask; - int r, ret = 0; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_event_unref_ sd_event* event = NULL; + const char *path = NULL; + uint32_t id; + int r; assert(bus); - assert(args); + assert(m); - if (arg_transport != BUS_TRANSPORT_LOCAL) { - log_error("Login only supported on local machines."); - return -ENOTSUP; - } + polkit_agent_open_if_enabled(); r = sd_event_default(&event); if (r < 0) @@ -686,130 +1818,459 @@ static int login_machine(sd_bus *bus, char **args, unsigned n) { if (r < 0) return log_error_errno(r, "Failed to attach bus to event loop: %m"); - r = sd_bus_call_method( + r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_add_match( bus, - "org.freedesktop.machine1", - "/org/freedesktop/machine1", - "org.freedesktop.machine1.Manager", - "GetMachine", - &error, - &reply, - "s", args[1]); + &slot_job_removed, + "type='signal'," + "sender='org.freedesktop.import1'," + "interface='org.freedesktop.import1.Manager'," + "member='TransferRemoved'," + "path='/org/freedesktop/import1'", + match_transfer_removed, &path); + if (r < 0) + return log_error_errno(r, "Failed to install match: %m"); + + r = sd_bus_add_match( + bus, + &slot_log_message, + "type='signal'," + "sender='org.freedesktop.import1'," + "interface='org.freedesktop.import1.Transfer'," + "member='LogMessage'", + match_log_message, &path); + if (r < 0) + return log_error_errno(r, "Failed to install match: %m"); + + r = sd_bus_call(bus, m, 0, &error, &reply); if (r < 0) { - log_error("Could not get path to machine: %s", bus_error_message(&error, -r)); + log_error("Failed pull image: %s", bus_error_message(&error, -r)); return r; } - r = sd_bus_message_read(reply, "o", &path); + r = sd_bus_message_read(reply, "uo", &id, &path); if (r < 0) return bus_log_parse_error(r); - r = sd_bus_get_property( + sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1); + + if (!arg_quiet) + log_info("Enqueued transfer job %u. Press C-c to continue download in background.", id); + + sd_event_add_signal(event, NULL, SIGINT, transfer_signal_handler, UINT32_TO_PTR(id)); + sd_event_add_signal(event, NULL, SIGTERM, transfer_signal_handler, UINT32_TO_PTR(id)); + + r = sd_event_loop(event); + if (r < 0) + return log_error_errno(r, "Failed to run event loop: %m"); + + return -r; +} + +static int pull_tar(int argc, char *argv[], void *userdata) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + _cleanup_free_ char *l = NULL, *ll = NULL; + const char *local, *remote; + sd_bus *bus = userdata; + int r; + + assert(bus); + + remote = argv[1]; + if (!http_url_is_valid(remote)) { + log_error("URL '%s' is not valid.", remote); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + r = import_url_last_component(remote, &l); + if (r < 0) + return log_error_errno(r, "Failed to get final component of URL: %m"); + + local = l; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + r = tar_strip_suffixes(local, &ll); + if (r < 0) + return log_error_errno(r, "Failed to strip tar suffixes: %m"); + + local = ll; + + if (!machine_name_is_valid(local)) { + log_error("Local name %s is not a suitable machine name.", local); + return -EINVAL; + } + } + + r = sd_bus_message_new_method_call( bus, - "org.freedesktop.machine1", - path, - "org.freedesktop.machine1.Machine", - "Leader", - &error, - &reply2, - "u"); + &m, + "org.freedesktop.import1", + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "PullTar"); if (r < 0) - return log_error_errno(r, "Failed to retrieve PID of leader: %m"); + return bus_log_create_error(r); + + r = sd_bus_message_append( + m, + "sssb", + remote, + local, + import_verify_to_string(arg_verify), + arg_force); + if (r < 0) + return bus_log_create_error(r); - r = sd_bus_message_read(reply2, "u", &leader); + return pull_image_common(bus, m); +} + +static int pull_raw(int argc, char *argv[], void *userdata) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + _cleanup_free_ char *l = NULL, *ll = NULL; + const char *local, *remote; + sd_bus *bus = userdata; + int r; + + assert(bus); + + remote = argv[1]; + if (!http_url_is_valid(remote)) { + log_error("URL '%s' is not valid.", remote); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + r = import_url_last_component(remote, &l); + if (r < 0) + return log_error_errno(r, "Failed to get final component of URL: %m"); + + local = l; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + r = raw_strip_suffixes(local, &ll); + if (r < 0) + return log_error_errno(r, "Failed to strip tar suffixes: %m"); + + local = ll; + + if (!machine_name_is_valid(local)) { + log_error("Local name %s is not a suitable machine name.", local); + return -EINVAL; + } + } + + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.import1", + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "PullRaw"); if (r < 0) - return bus_log_parse_error(r); + return bus_log_create_error(r); + + r = sd_bus_message_append( + m, + "sssb", + remote, + local, + import_verify_to_string(arg_verify), + arg_force); + if (r < 0) + return bus_log_create_error(r); + + return pull_image_common(bus, m); +} - master = openpt_in_namespace(leader, O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); - if (master < 0) - return log_error_errno(master, "Failed to acquire pseudo tty: %m"); +static int pull_dkr(int argc, char *argv[], void *userdata) { + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + const char *local, *remote, *tag; + sd_bus *bus = userdata; + int r; - pty = ptsname(master); - if (!pty) - return log_error_errno(errno, "Failed to get pty name: %m"); + if (arg_verify != IMPORT_VERIFY_NO) { + log_error("Imports from DKR do not support image verification, please pass --verify=no."); + return -EINVAL; + } - p = startswith(pty, "/dev/pts/"); - if (!p) { - log_error("Invalid pty name %s.", pty); - return -EIO; + remote = argv[1]; + tag = strchr(remote, ':'); + if (tag) { + remote = strndupa(remote, tag - remote); + tag++; + } + + if (!dkr_name_is_valid(remote)) { + log_error("DKR name '%s' is invalid.", remote); + return -EINVAL; + } + if (tag && !dkr_tag_is_valid(tag)) { + log_error("DKR tag '%s' is invalid.", remote); + return -EINVAL; + } + + if (argc >= 3) + local = argv[2]; + else { + local = strchr(remote, '/'); + if (local) + local++; + else + local = remote; + } + + if (isempty(local) || streq(local, "-")) + local = NULL; + + if (local) { + if (!machine_name_is_valid(local)) { + log_error("Local name %s is not a suitable machine name.", local); + return -EINVAL; + } } - r = sd_bus_open_system_container(&container_bus, args[1]); + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.import1", + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "PullDkr"); if (r < 0) - return log_error_errno(r, "Failed to get container bus: %m"); + return bus_log_create_error(r); + + r = sd_bus_message_append( + m, + "sssssb", + arg_dkr_index_url, + remote, + tag, + local, + import_verify_to_string(arg_verify), + arg_force); + if (r < 0) + return bus_log_create_error(r); - getty = strjoin("container-getty@", p, ".service", NULL); - if (!getty) - return log_oom(); + return pull_image_common(bus, m); +} + +typedef struct TransferInfo { + uint32_t id; + const char *type; + const char *remote; + const char *local; + double progress; +} TransferInfo; - if (unlockpt(master) < 0) - return log_error_errno(errno, "Failed to unlock tty: %m"); +static int compare_transfer_info(const void *a, const void *b) { + const TransferInfo *x = a, *y = b; - r = sd_bus_call_method(container_bus, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "StartUnit", - &error, &reply3, - "ss", getty, "replace"); + return strcmp(x->local, y->local); +} + +static int list_transfers(int argc, char *argv[], void *userdata) { + size_t max_type = strlen("TYPE"), max_local = strlen("LOCAL"), max_remote = strlen("REMOTE"); + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_free_ TransferInfo *transfers = NULL; + size_t n_transfers = 0, n_allocated = 0, j; + const char *type, *remote, *local, *object; + sd_bus *bus = userdata; + uint32_t id, max_id = 0; + double progress; + int r; + + pager_open_if_enabled(); + + r = sd_bus_call_method( + bus, + "org.freedesktop.import1", + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "ListTransfers", + &error, + &reply, + NULL); if (r < 0) { - log_error("Failed to start getty service: %s", bus_error_message(&error, r)); + log_error("Could not get transfers: %s", bus_error_message(&error, -r)); return r; } - container_bus = sd_bus_unref(container_bus); + r = sd_bus_message_enter_container(reply, 'a', "(usssdo)"); + if (r < 0) + return bus_log_parse_error(r); - assert_se(sigemptyset(&mask) == 0); - sigset_add_many(&mask, SIGWINCH, SIGTERM, SIGINT, -1); - assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); + while ((r = sd_bus_message_read(reply, "(usssdo)", &id, &type, &remote, &local, &progress, &object)) > 0) { + size_t l; - log_info("Connected to container %s. Press ^] three times within 1s to exit session.", args[1]); + if (!GREEDY_REALLOC(transfers, n_allocated, n_transfers + 1)) + return log_oom(); - sd_event_add_signal(event, NULL, SIGINT, NULL, NULL); - sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL); + transfers[n_transfers].id = id; + transfers[n_transfers].type = type; + transfers[n_transfers].remote = remote; + transfers[n_transfers].local = local; + transfers[n_transfers].progress = progress; - r = pty_forward_new(event, master, &forward); + l = strlen(type); + if (l > max_type) + max_type = l; + + l = strlen(remote); + if (l > max_remote) + max_remote = l; + + l = strlen(local); + if (l > max_local) + max_local = l; + + if (id > max_id) + max_id = id; + + n_transfers ++; + } if (r < 0) - return log_error_errno(r, "Failed to create PTY forwarder: %m"); + return bus_log_parse_error(r); - r = sd_event_loop(event); + r = sd_bus_message_exit_container(reply); if (r < 0) - return log_error_errno(r, "Failed to run event loop: %m"); + return bus_log_parse_error(r); - forward = pty_forward_free(forward); + qsort_safe(transfers, n_transfers, sizeof(TransferInfo), compare_transfer_info); - fputc('\n', stdout); + if (arg_legend) + printf("%-*s %-*s %-*s %-*s %-*s\n", + (int) MAX(2U, DECIMAL_STR_WIDTH(max_id)), "ID", + (int) 7, "PERCENT", + (int) max_type, "TYPE", + (int) max_local, "LOCAL", + (int) max_remote, "REMOTE"); + + for (j = 0; j < n_transfers; j++) + printf("%*" PRIu32 " %*u%% %-*s %-*s %-*s\n", + (int) MAX(2U, DECIMAL_STR_WIDTH(max_id)), transfers[j].id, + (int) 6, (unsigned) (transfers[j].progress * 100), + (int) max_type, transfers[j].type, + (int) max_local, transfers[j].local, + (int) max_remote, transfers[j].remote); - log_info("Connection to container %s terminated.", args[1]); + if (arg_legend) + printf("\n%zu transfers listed.\n", n_transfers); - sd_event_get_exit_code(event, &ret); - return ret; + return 0; +} + +static int cancel_transfer(int argc, char *argv[], void *userdata) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + sd_bus *bus = userdata; + int r, i; + + assert(bus); + + polkit_agent_open_if_enabled(); + + for (i = 1; i < argc; i++) { + uint32_t id; + + r = safe_atou32(argv[i], &id); + if (r < 0) + return log_error_errno(r, "Failed to parse transfer id: %s", argv[i]); + + r = sd_bus_call_method( + bus, + "org.freedesktop.import1", + "/org/freedesktop/import1", + "org.freedesktop.import1.Manager", + "CancelTransfer", + &error, + NULL, + "u", id); + if (r < 0) { + log_error("Could not cancel transfer: %s", bus_error_message(&error, -r)); + return r; + } + } + + return 0; } -static void help(void) { +static int help(int argc, char *argv[], void *userdata) { + printf("%s [OPTIONS...] {COMMAND} ...\n\n" - "Send control commands to or query the virtual machine and container registration manager.\n\n" - " -h --help Show this help\n" - " --version Show package version\n" - " --no-pager Do not pipe output into a pager\n" - " --no-legend Do not show the headers and footers\n" - " -H --host=[USER@]HOST Operate on remote host\n" - " -M --machine=CONTAINER Operate on local container\n" - " -p --property=NAME Show only properties by this name\n" - " -a --all Show all properties, including empty ones\n" - " -l --full Do not ellipsize output\n" - " --kill-who=WHO Who to send signal to\n" - " -s --signal=SIGNAL Which signal to send\n\n" - "Commands:\n" - " list List running VMs and containers\n" - " status NAME... Show VM/container status\n" - " show NAME... Show properties of one or more VMs/containers\n" - " login NAME Get a login prompt on a container\n" - " poweroff NAME... Power off one or more containers\n" - " reboot NAME... Reboot one or more containers\n" - " kill NAME... Send signal to processes of a VM/container\n" - " terminate NAME... Terminate one or more VMs/containers\n", - program_invocation_short_name); + "Send control commands to or query the virtual machine and container\n" + "registration manager.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --no-pager Do not pipe output into a pager\n" + " --no-legend Do not show the headers and footers\n" + " --no-ask-password Do not ask for system passwords\n" + " -H --host=[USER@]HOST Operate on remote host\n" + " -M --machine=CONTAINER Operate on local container\n" + " -p --property=NAME Show only properties by this name\n" + " -q --quiet Suppress output\n" + " -a --all Show all properties, including empty ones\n" + " -l --full Do not ellipsize output\n" + " --kill-who=WHO Who to send signal to\n" + " -s --signal=SIGNAL Which signal to send\n" + " --read-only Create read-only bind mount\n" + " --mkdir Create directory before bind mounting, if missing\n" + " -n --lines=INTEGER Number of journal entries to show\n" + " -o --output=STRING Change journal output mode (short,\n" + " short-monotonic, verbose, export, json,\n" + " json-pretty, json-sse, cat)\n" + " --verify=MODE Verification mode for downloaded images (no,\n" + " checksum, signature)\n" + " --force Download image even if already exists\n" + " --dkr-index-url=URL Specify the index URL to use for DKR image\n" + " downloads\n\n" + "Machine Commands:\n" + " list List running VMs and containers\n" + " status NAME... Show VM/container details\n" + " show NAME... Show properties of one or more VMs/containers\n" + " start NAME... Start container as a service\n" + " login NAME Get a login prompt on a container\n" + " enable NAME... Enable automatic container start at boot\n" + " disable NAME... Disable automatic container start at boot\n" + " poweroff NAME... Power off one or more containers\n" + " reboot NAME... Reboot one or more containers\n" + " terminate NAME... Terminate one or more VMs/containers\n" + " kill NAME... Send signal to processes of a VM/container\n" + " copy-to NAME PATH [PATH] Copy files from the host to a container\n" + " copy-from NAME PATH [PATH] Copy files from a container to the host\n" + " bind NAME PATH [PATH] Bind mount a path from the host into a container\n\n" + "Image Commands:\n" + " list-images Show available container and VM images\n" + " image-status NAME... Show image details\n" + " show-image NAME... Show properties of image\n" + " clone NAME NAME Clone an image\n" + " rename NAME NAME Rename an image\n" + " read-only NAME [BOOL] Mark or unmark image read-only\n" + " remove NAME... Remove an image\n\n" + "Image Transfer Commands:\n" + " pull-tar URL [NAME] Download a TAR container image\n" + " pull-raw URL [NAME] Download a RAW container or VM image\n" + " pull-dkr REMOTE [NAME] Download a DKR container image\n" + " list-transfers Show list of downloads in progress\n" + " cancel-transfer Cancel a download\n" + , program_invocation_short_name); + + return 0; } static int parse_argv(int argc, char *argv[]) { @@ -819,6 +2280,12 @@ static int parse_argv(int argc, char *argv[]) { ARG_NO_PAGER, ARG_NO_LEGEND, ARG_KILL_WHO, + ARG_READ_ONLY, + ARG_MKDIR, + ARG_NO_ASK_PASSWORD, + ARG_VERIFY, + ARG_FORCE, + ARG_DKR_INDEX_URL, }; static const struct option options[] = { @@ -833,6 +2300,15 @@ static int parse_argv(int argc, char *argv[]) { { "signal", required_argument, NULL, 's' }, { "host", required_argument, NULL, 'H' }, { "machine", required_argument, NULL, 'M' }, + { "read-only", no_argument, NULL, ARG_READ_ONLY }, + { "mkdir", no_argument, NULL, ARG_MKDIR }, + { "quiet", no_argument, NULL, 'q' }, + { "lines", required_argument, NULL, 'n' }, + { "output", required_argument, NULL, 'o' }, + { "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD }, + { "verify", required_argument, NULL, ARG_VERIFY }, + { "force", no_argument, NULL, ARG_FORCE }, + { "dkr-index-url", required_argument, NULL, ARG_DKR_INDEX_URL }, {} }; @@ -841,13 +2317,12 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hp:als:H:M:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "hp:als:H:M:qn:o:", options, NULL)) >= 0) switch (c) { case 'h': - help(); - return 0; + return help(0, NULL, NULL); case ARG_VERSION: puts(PACKAGE_STRING); @@ -873,6 +2348,21 @@ static int parse_argv(int argc, char *argv[]) { arg_full = true; break; + case 'n': + if (safe_atou(optarg, &arg_lines) < 0) { + log_error("Failed to parse lines '%s'", optarg); + return -EINVAL; + } + break; + + case 'o': + arg_output = output_mode_from_string(optarg); + if (arg_output < 0) { + log_error("Unknown output '%s'.", optarg); + return -EINVAL; + } + break; + case ARG_NO_PAGER: arg_no_pager = true; break; @@ -893,106 +2383,97 @@ static int parse_argv(int argc, char *argv[]) { } break; + case ARG_NO_ASK_PASSWORD: + arg_ask_password = false; + break; + case 'H': arg_transport = BUS_TRANSPORT_REMOTE; arg_host = optarg; break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; - case '?': - return -EINVAL; - - default: - assert_not_reached("Unhandled option"); - } - - return 1; -} - -static int machinectl_main(sd_bus *bus, int argc, char *argv[]) { - - static const struct { - const char* verb; - const enum { - MORE, - LESS, - EQUAL - } argc_cmp; - const int argc; - int (* const dispatch)(sd_bus *bus, char **args, unsigned n); - } verbs[] = { - { "list", LESS, 1, list_machines }, - { "status", MORE, 2, show }, - { "show", MORE, 1, show }, - { "terminate", MORE, 2, terminate_machine }, - { "reboot", MORE, 2, reboot_machine }, - { "poweroff", MORE, 2, poweroff_machine }, - { "kill", MORE, 2, kill_machine }, - { "login", MORE, 2, login_machine }, - }; - - int left; - unsigned i; - - assert(argc >= 0); - assert(argv); - - left = argc - optind; + case ARG_READ_ONLY: + arg_read_only = true; + break; - if (left <= 0) - /* Special rule: no arguments means "list" */ - i = 0; - else { - if (streq(argv[optind], "help")) { - help(); - return 0; - } + case ARG_MKDIR: + arg_mkdir = true; + break; - for (i = 0; i < ELEMENTSOF(verbs); i++) - if (streq(argv[optind], verbs[i].verb)) - break; + case 'q': + arg_quiet = true; + break; - if (i >= ELEMENTSOF(verbs)) { - log_error("Unknown operation %s", argv[optind]); - return -EINVAL; - } - } + case ARG_VERIFY: + arg_verify = import_verify_from_string(optarg); + if (arg_verify < 0) { + log_error("Failed to parse --verify= setting: %s", optarg); + return -EINVAL; + } + break; - switch (verbs[i].argc_cmp) { + case ARG_FORCE: + arg_force = true; + break; - case EQUAL: - if (left != verbs[i].argc) { - log_error("Invalid number of arguments."); - return -EINVAL; - } + case ARG_DKR_INDEX_URL: + if (!http_url_is_valid(optarg)) { + log_error("Index URL is invalid: %s", optarg); + return -EINVAL; + } - break; + arg_dkr_index_url = optarg; + break; - case MORE: - if (left < verbs[i].argc) { - log_error("Too few arguments."); + case '?': return -EINVAL; - } - - break; - case LESS: - if (left > verbs[i].argc) { - log_error("Too many arguments."); - return -EINVAL; + default: + assert_not_reached("Unhandled option"); } - break; + return 1; +} - default: - assert_not_reached("Unknown comparison operator."); - } +static int machinectl_main(int argc, char *argv[], sd_bus *bus) { + + static const Verb verbs[] = { + { "help", VERB_ANY, VERB_ANY, 0, help }, + { "list", VERB_ANY, 1, VERB_DEFAULT, list_machines }, + { "list-images", VERB_ANY, 1, 0, list_images }, + { "status", 2, VERB_ANY, 0, show_machine }, + { "image-status", 2, VERB_ANY, 0, show_image }, + { "show", VERB_ANY, VERB_ANY, 0, show_machine }, + { "show-image", VERB_ANY, VERB_ANY, 0, show_image }, + { "terminate", 2, VERB_ANY, 0, terminate_machine }, + { "reboot", 2, VERB_ANY, 0, reboot_machine }, + { "poweroff", 2, VERB_ANY, 0, poweroff_machine }, + { "kill", 2, VERB_ANY, 0, kill_machine }, + { "login", 2, 2, 0, login_machine }, + { "bind", 3, 4, 0, bind_mount }, + { "copy-to", 3, 4, 0, copy_files }, + { "copy-from", 3, 4, 0, copy_files }, + { "remove", 2, VERB_ANY, 0, remove_image }, + { "rename", 3, 3, 0, rename_image }, + { "clone", 3, 3, 0, clone_image }, + { "read-only", 2, 3, 0, read_only_image }, + { "start", 2, VERB_ANY, 0, start_machine }, + { "enable", 2, VERB_ANY, 0, enable_machine }, + { "disable", 2, VERB_ANY, 0, enable_machine }, + { "pull-tar", 2, 3, 0, pull_tar }, + { "pull-raw", 2, 3, 0, pull_raw }, + { "pull-dkr", 2, 3, 0, pull_dkr }, + { "list-transfers", VERB_ANY, 1, 0, list_transfers }, + { "cancel-transfer", 2, VERB_ANY, 0, cancel_transfer }, + {} + }; - return verbs[i].dispatch(bus, argv + optind, left); + return dispatch_verb(argc, argv, verbs, bus); } int main(int argc, char*argv[]) { @@ -1013,10 +2494,11 @@ int main(int argc, char*argv[]) { goto finish; } - r = machinectl_main(bus, argc, argv); + r = machinectl_main(argc, argv, bus); finish: pager_close(); + polkit_agent_close(); strv_free(arg_property); diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 0b57b3699..ac19695c9 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "sd-id128.h" #include "sd-messages.h" @@ -39,7 +38,10 @@ #include "bus-common-errors.h" #include "time-util.h" #include "cgroup-util.h" +#include "machine-image.h" +#include "image-dbus.h" #include "machined.h" +#include "machine-dbus.h" static int method_get_machine(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; @@ -67,6 +69,33 @@ static int method_get_machine(sd_bus *bus, sd_bus_message *message, void *userda return sd_bus_reply_method_return(message, "o", p); } +static int method_get_image(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_free_ char *p = NULL; + Manager *m = userdata; + const char *name; + int r; + + assert(bus); + assert(message); + assert(m); + + r = sd_bus_message_read(message, "s", &name); + if (r < 0) + return r; + + r = image_find(name, NULL); + if (r == 0) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", name); + if (r < 0) + return r; + + p = image_bus_path(name); + if (!p) + return -ENOMEM; + + return sd_bus_reply_method_return(message, "o", p); +} + static int method_get_machine_by_pid(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; @@ -325,8 +354,6 @@ static int method_register_machine_internal(sd_bus *bus, sd_bus_message *message goto fail; } - m->registered = true; - r = machine_start(m, NULL, error); if (r < 0) goto fail; @@ -436,11 +463,201 @@ static int method_get_machine_os_release(sd_bus *bus, sd_bus_message *message, v return bus_machine_method_get_os_release(bus, message, machine, error); } +static int method_list_images(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + _cleanup_(image_hashmap_freep) Hashmap *images = NULL; + Manager *m = userdata; + Image *image; + Iterator i; + int r; + + assert(bus); + assert(message); + assert(m); + + images = hashmap_new(&string_hash_ops); + if (!images) + return -ENOMEM; + + r = image_discover(images); + if (r < 0) + return r; + + r = sd_bus_message_new_method_return(message, &reply); + if (r < 0) + return r; + + r = sd_bus_message_open_container(reply, 'a', "(ssbttto)"); + if (r < 0) + return r; + + HASHMAP_FOREACH(image, images, i) { + _cleanup_free_ char *p = NULL; + + p = image_bus_path(image->name); + if (!p) + return -ENOMEM; + + r = sd_bus_message_append(reply, "(ssbttto)", + image->name, + image_type_to_string(image->type), + image->read_only, + image->crtime, + image->mtime, + image->usage, + p); + if (r < 0) + return r; + } + + r = sd_bus_message_close_container(reply); + if (r < 0) + return r; + + return sd_bus_send(bus, reply, NULL); +} + +static int method_open_machine_pty(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + Manager *m = userdata; + Machine *machine; + const char *name; + int r; + + assert(bus); + assert(message); + assert(m); + + r = sd_bus_message_read(message, "s", &name); + if (r < 0) + return sd_bus_error_set_errno(error, r); + + machine = hashmap_get(m->machines, name); + if (!machine) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name); + + return bus_machine_method_open_pty(bus, message, machine, error); +} + +static int method_open_machine_login(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + Manager *m = userdata; + Machine *machine; + const char *name; + int r; + + assert(bus); + assert(message); + assert(m); + + r = sd_bus_message_read(message, "s", &name); + if (r < 0) + return r; + + machine = hashmap_get(m->machines, name); + if (!machine) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name); + + return bus_machine_method_open_login(bus, message, machine, error); +} + +static int method_remove_image(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_(image_unrefp) Image* i = NULL; + const char *name; + int r; + + assert(bus); + assert(message); + + r = sd_bus_message_read(message, "s", &name); + if (r < 0) + return r; + + if (!image_name_is_valid(name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name); + + r = image_find(name, &i); + if (r < 0) + return r; + if (r == 0) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", name); + + return bus_image_method_remove(bus, message, i, error); +} + +static int method_rename_image(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_(image_unrefp) Image* i = NULL; + const char *old_name; + int r; + + assert(bus); + assert(message); + + r = sd_bus_message_read(message, "s", &old_name); + if (r < 0) + return r; + + if (!image_name_is_valid(old_name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", old_name); + + r = image_find(old_name, &i); + if (r < 0) + return r; + if (r == 0) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", old_name); + + return bus_image_method_rename(bus, message, i, error); +} + +static int method_clone_image(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_(image_unrefp) Image *i = NULL; + const char *old_name; + int r; + + assert(bus); + r = sd_bus_message_read(message, "s", &old_name); + if (r < 0) + return r; + + if (!image_name_is_valid(old_name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", old_name); + + r = image_find(old_name, &i); + if (r < 0) + return r; + if (r == 0) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", old_name); + + return bus_image_method_clone(bus, message, i, error); +} + +static int method_mark_image_read_only(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { + _cleanup_(image_unrefp) Image *i = NULL; + const char *name; + int r; + + assert(bus); + r = sd_bus_message_read(message, "s", &name); + if (r < 0) + return r; + + if (!image_name_is_valid(name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name); + + r = image_find(name, &i); + if (r < 0) + return r; + if (r == 0) + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", name); + + return bus_image_method_mark_read_only(bus, message, i, error); +} + const sd_bus_vtable manager_vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_METHOD("GetMachine", "s", "o", method_get_machine, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("GetImage", "s", "o", method_get_image, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetMachineByPID", "u", "o", method_get_machine_by_pid, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListMachines", NULL, "a(ssso)", method_list_machines, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("ListImages", NULL, "a(ssbttto)", method_list_images, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("CreateMachine", "sayssusa(sv)", "o", method_create_machine, 0), SD_BUS_METHOD("CreateMachineWithNetwork", "sayssusaia(sv)", "o", method_create_machine_with_network, 0), SD_BUS_METHOD("RegisterMachine", "sayssus", "o", method_register_machine, 0), @@ -449,6 +666,12 @@ const sd_bus_vtable manager_vtable[] = { SD_BUS_METHOD("TerminateMachine", "s", NULL, method_terminate_machine, SD_BUS_VTABLE_CAPABILITY(CAP_KILL)), SD_BUS_METHOD("GetMachineAddresses", "s", "a(iay)", method_get_machine_addresses, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetMachineOSRelease", "s", "a{ss}", method_get_machine_os_release, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("OpenMachinePTY", "s", "hs", method_open_machine_pty, 0), + SD_BUS_METHOD("OpenMachineLogin", "s", "hs", method_open_machine_login, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("RemoveImage", "s", NULL, method_remove_image, 0), + SD_BUS_METHOD("RenameImage", "ss", NULL, method_rename_image, 0), + SD_BUS_METHOD("CloneImage", "ssb", NULL, method_clone_image, 0), + SD_BUS_METHOD("MarkImageReadOnly", "sb", NULL, method_mark_image_read_only, 0), SD_BUS_SIGNAL("MachineNew", "so", 0), SD_BUS_SIGNAL("MachineRemoved", "so", 0), SD_BUS_VTABLE_END @@ -513,6 +736,8 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat return 0; r = unit_name_from_dbus_path(path, &unit); + if (r == -EINVAL) /* not for a unit */ + return 0; if (r < 0) return r; diff --git a/src/machine/machined.c b/src/machine/machined.c index ef59497fb..6877c2b31 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -27,15 +27,15 @@ #include #include "sd-daemon.h" - #include "strv.h" #include "conf-parser.h" #include "cgroup-util.h" #include "mkdir.h" #include "bus-util.h" #include "bus-error.h" -#include "machined.h" #include "label.h" +#include "machine-image.h" +#include "machined.h" Manager *manager_new(void) { Manager *m; @@ -67,6 +67,7 @@ Manager *manager_new(void) { void manager_free(Manager *m) { Machine *machine; + Image *i; assert(m); @@ -77,6 +78,15 @@ void manager_free(Manager *m) { hashmap_free(m->machine_units); hashmap_free(m->machine_leaders); + while ((i = hashmap_steal_first(m->image_cache))) + image_unref(i); + + hashmap_free(m->image_cache); + + sd_event_source_unref(m->image_cache_defer_event); + + bus_verify_polkit_async_registry_free(m->polkit_registry); + sd_bus_unref(m->bus); sd_event_unref(m->event); @@ -152,6 +162,14 @@ static int manager_connect_bus(Manager *m) { if (r < 0) return log_error_errno(r, "Failed to add machine enumerator: %m"); + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/machine1/image", "org.freedesktop.machine1.Image", image_vtable, image_object_find, m); + if (r < 0) + return log_error_errno(r, "Failed to add image object vtable: %m"); + + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/machine1/image", image_node_enumerator, m); + if (r < 0) + return log_error_errno(r, "Failed to add image enumerator: %m"); + r = sd_bus_add_match(m->bus, NULL, "type='signal'," diff --git a/src/machine/machined.h b/src/machine/machined.h index 2dba303df..df0cb82f8 100644 --- a/src/machine/machined.h +++ b/src/machine/machined.h @@ -33,6 +33,8 @@ typedef struct Manager Manager; #include "machine.h" +#include "machine-dbus.h" +#include "image-dbus.h" struct Manager { sd_event *event; @@ -42,6 +44,11 @@ struct Manager { Hashmap *machine_units; Hashmap *machine_leaders; + Hashmap *polkit_registry; + + Hashmap *image_cache; + sd_event_source *image_cache_defer_event; + LIST_HEAD(Machine, machine_gc_queue); }; diff --git a/src/machine/org.freedesktop.machine1.conf b/src/machine/org.freedesktop.machine1.conf index ac1aee855..37f84bd6f 100644 --- a/src/machine/org.freedesktop.machine1.conf +++ b/src/machine/org.freedesktop.machine1.conf @@ -40,6 +40,10 @@ send_interface="org.freedesktop.machine1.Manager" send_member="ListMachines"/> + + @@ -48,6 +52,10 @@ send_interface="org.freedesktop.machine1.Manager" send_member="GetMachineByPID"/> + + @@ -56,6 +64,10 @@ send_interface="org.freedesktop.machine1.Manager" send_member="GetMachineOSRelease"/> + + @@ -64,6 +76,10 @@ send_interface="org.freedesktop.machine1.Machine" send_member="GetOSRelease"/> + + diff --git a/src/machine/org.freedesktop.machine1.policy.in b/src/machine/org.freedesktop.machine1.policy.in new file mode 100644 index 000000000..43478a84d --- /dev/null +++ b/src/machine/org.freedesktop.machine1.policy.in @@ -0,0 +1,29 @@ + + + + + + + + The systemd Project + http://www.freedesktop.org/wiki/Software/systemd + + + <_description>Log into a local container + <_message>Authentication is required to log into a local container + + auth_admin + auth_admin + auth_admin_keep + + + + diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 815ea1698..aa83f32f5 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -21,20 +21,26 @@ #include #include +#include #include "sd-network.h" #include "sd-rtnl.h" +#include "sd-hwdb.h" #include "libudev.h" +#include "strv.h" #include "build.h" #include "util.h" #include "pager.h" +#include "lldp.h" #include "rtnl-util.h" #include "udev-util.h" +#include "hwdb-util.h" #include "arphrd-list.h" #include "local-addresses.h" #include "socket-util.h" #include "ether-addr-util.h" +#include "verbs.h" static bool arg_no_pager = false; static bool arg_legend = true; @@ -181,7 +187,7 @@ static void setup_state_to_color(const char *state, const char **on, const char *on = *off = ""; } -static int list_links(char **args, unsigned n) { +static int list_links(int argc, char *argv[], void *userdata) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; _cleanup_udev_unref_ struct udev *udev = NULL; _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; @@ -249,32 +255,45 @@ static int list_links(char **args, unsigned n) { } /* IEEE Organizationally Unique Identifier vendor string */ -static int ieee_oui(struct udev_hwdb *hwdb, struct ether_addr *mac, char **ret) { - struct udev_list_entry *entry; - char *description; - char str[strlen("OUI:XXYYXXYYXXYY") + 1]; +static int ieee_oui(sd_hwdb *hwdb, struct ether_addr *mac, char **ret) { + const char *description; + char modalias[strlen("OUI:XXYYXXYYXXYY") + 1], *desc; + int r; + + assert(ret); + + if (!hwdb) + return -EINVAL; + + if (!mac) + return -EINVAL; /* skip commonly misused 00:00:00 (Xerox) prefix */ if (memcmp(mac, "\0\0\0", 3) == 0) return -EINVAL; - snprintf(str, sizeof(str), "OUI:" ETHER_ADDR_FORMAT_STR, ETHER_ADDR_FORMAT_VAL(*mac)); + snprintf(modalias, sizeof(modalias), "OUI:" ETHER_ADDR_FORMAT_STR, ETHER_ADDR_FORMAT_VAL(*mac)); - udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, str, 0)) - if (strcmp(udev_list_entry_get_name(entry), "ID_OUI_FROM_DATABASE") == 0) { - description = strdup(udev_list_entry_get_value(entry)); - if (!description) - return -ENOMEM; + r = sd_hwdb_get(hwdb, modalias, "ID_OUI_FROM_DATABASE", &description); + if (r < 0) + return r; - *ret = description; - return 0; - } + desc = strdup(description); + if (!desc) + return -ENOMEM; - return -ENODATA; + *ret = desc; + + return 0; } -static int get_gateway_description(sd_rtnl *rtnl, struct udev_hwdb *hwdb, int ifindex, int family, - union in_addr_union *gateway, char **gateway_description) { +static int get_gateway_description( + sd_rtnl *rtnl, + sd_hwdb *hwdb, + int ifindex, + int family, + union in_addr_union *gateway, + char **gateway_description) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; sd_rtnl_message *m; int r; @@ -374,7 +393,11 @@ static int get_gateway_description(sd_rtnl *rtnl, struct udev_hwdb *hwdb, int if return -ENODATA; } -static int dump_gateways(sd_rtnl *rtnl, struct udev_hwdb *hwdb, const char *prefix, int ifindex) { +static int dump_gateways( + sd_rtnl *rtnl, + sd_hwdb *hwdb, + const char *prefix, + int ifindex) { _cleanup_free_ struct local_address *local = NULL; int r, n, i; @@ -389,26 +412,41 @@ static int dump_gateways(sd_rtnl *rtnl, struct udev_hwdb *hwdb, const char *pref if (r < 0) return r; - r = get_gateway_description(rtnl, hwdb, ifindex, local[i].family, &local[i].address, &description); + r = get_gateway_description(rtnl, hwdb, local[i].ifindex, local[i].family, &local[i].address, &description); if (r < 0) log_debug_errno(r, "Could not get description of gateway: %m"); + printf("%*s%s", + (int) strlen(prefix), + i == 0 ? prefix : "", + gateway); + if (description) - printf("%*s%s (%s)\n", - (int) strlen(prefix), - i == 0 ? prefix : "", - gateway, description); - else - printf("%*s%s\n", - (int) strlen(prefix), - i == 0 ? prefix : "", - gateway); + printf(" (%s)", description); + + /* Show interface name for the entry if we show + * entries for all interfaces */ + if (ifindex <= 0) { + char name[IF_NAMESIZE+1]; + + if (if_indextoname(local[i].ifindex, name)) { + fputs(" on ", stdout); + fputs(name, stdout); + } else + printf(" on %%%i", local[i].ifindex); + } + + fputc('\n', stdout); } return 0; } -static int dump_addresses(sd_rtnl *rtnl, const char *prefix, int ifindex) { +static int dump_addresses( + sd_rtnl *rtnl, + const char *prefix, + int ifindex) { + _cleanup_free_ struct local_address *local = NULL; int r, n, i; @@ -423,10 +461,22 @@ static int dump_addresses(sd_rtnl *rtnl, const char *prefix, int ifindex) { if (r < 0) return r; - printf("%*s%s\n", + printf("%*s%s", (int) strlen(prefix), i == 0 ? prefix : "", pretty); + + if (ifindex <= 0) { + char name[IF_NAMESIZE+1]; + + if (if_indextoname(local[i].ifindex, name)) { + fputs(" on ", stdout); + fputs(name, stdout); + } else + printf(" on %%%i", local[i].ifindex); + } + + fputc('\n', stdout); } return 0; @@ -443,12 +493,16 @@ static void dump_list(const char *prefix, char **l) { } } -static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { +static int link_status_one( + sd_rtnl *rtnl, + struct udev *udev, + sd_hwdb *hwdb, + const char *name) { + _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL; _cleanup_free_ char *setup_state = NULL, *operational_state = NULL; _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; _cleanup_udev_device_unref_ struct udev_device *d = NULL; - _cleanup_udev_hwdb_unref_ struct udev_hwdb *hwdb = NULL; char devid[2 + DECIMAL_STR_MAX(int)]; _cleanup_free_ char *t = NULL, *network = NULL; const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL; @@ -534,9 +588,6 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { sprintf(devid, "n%i", ifindex); d = udev_device_new_from_device_id(udev, devid); - - link_get_type_string(iftype, d, &t); - if (d) { link = udev_device_get_property_value(d, "ID_NET_LINK_FILE"); driver = udev_device_get_property_value(d, "ID_NET_DRIVER"); @@ -551,6 +602,8 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { model = udev_device_get_property_value(d, "ID_MODEL"); } + link_get_type_string(iftype, d, &t); + sd_network_link_get_network_file(ifindex, &network); printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name); @@ -575,18 +628,22 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { printf(" Model: %s\n", model); if (have_mac) { + _cleanup_free_ char *description = NULL; char ea[ETHER_ADDR_TO_STRING_MAX]; - printf(" HW Address: %s\n", ether_addr_to_string(&e, ea)); + + ieee_oui(hwdb, &e, &description); + + if (description) + printf(" HW Address: %s (%s)\n", ether_addr_to_string(&e, ea), description); + else + printf(" HW Address: %s\n", ether_addr_to_string(&e, ea)); } if (mtu > 0) printf(" MTU: %u\n", mtu); - hwdb = udev_hwdb_new(udev); - - dump_gateways(rtnl, hwdb, " Gateway: ", ifindex); - dump_addresses(rtnl, " Address: ", ifindex); + dump_gateways(rtnl, hwdb, " Gateway: ", ifindex); if (!strv_isempty(dns)) dump_list(" DNS: ", dns); @@ -598,7 +655,8 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { return 0; } -static int link_status(char **args, unsigned n) { +static int link_status(int argc, char *argv[], void *userdata) { + _cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL; _cleanup_udev_unref_ struct udev *udev = NULL; _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; char **name; @@ -612,29 +670,24 @@ static int link_status(char **args, unsigned n) { if (!udev) return log_error_errno(errno, "Failed to connect to udev: %m"); - if (n <= 1 && !arg_all) { + r = sd_hwdb_new(&hwdb); + if (r < 0) + log_debug_errno(r, "Failed to open hardware database: %m"); + + if (argc <= 1 && !arg_all) { _cleanup_free_ char *operational_state = NULL; _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL; - _cleanup_free_ struct local_address *addresses = NULL; const char *on_color_operational, *off_color_operational; - int i, c; sd_network_get_operational_state(&operational_state); operational_state_to_color(operational_state, &on_color_operational, &off_color_operational); - printf(" State: %s%s%s\n", on_color_operational, strna(operational_state), off_color_operational); - - c = local_addresses(rtnl, 0, AF_UNSPEC, &addresses); - for (i = 0; i < c; i++) { - _cleanup_free_ char *pretty = NULL; - - r = in_addr_to_string(addresses[i].family, &addresses[i].address, &pretty); - if (r < 0) - return log_oom(); + printf("%s%s%s State: %s%s%s\n", + on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, + on_color_operational, strna(operational_state), off_color_operational); - printf("%13s %s\n", - i > 0 ? "" : "Address:", pretty); - } + dump_addresses(rtnl, " Address: ", 0); + dump_gateways(rtnl, hwdb, " Gateway: ", 0); sd_network_get_dns(&dns); if (!strv_isempty(dns)) @@ -678,15 +731,278 @@ static int link_status(char **args, unsigned n) { if (i > 0) fputc('\n', stdout); - link_status_one(rtnl, udev, links[i].name); + link_status_one(rtnl, udev, hwdb, links[i].name); + } + } else { + STRV_FOREACH(name, argv + 1) { + if (name != argv + 1) + fputc('\n', stdout); + + link_status_one(rtnl, udev, hwdb, *name); } } - STRV_FOREACH(name, args + 1) { - if (name != args+1) - fputc('\n', stdout); + return 0; +} + +const char *lldp_system_capability_to_string(LLDPSystemCapabilities d) _const_; +LLDPSystemCapabilities lldp_system_capability_from_string(const char *d) _pure_; + +static const char* const lldp_system_capability_table[_LLDP_SYSTEM_CAPABILITIES_MAX + 1] = { + [LLDP_SYSTEM_CAPABILITIES_OTHER] = "O", + [LLDP_SYSTEM_CAPABILITIES_REPEATER] = "P", + [LLDP_SYSTEM_CAPABILITIES_BRIDGE] = "B", + [LLDP_SYSTEM_CAPABILITIES_WLAN_AP] = "W", + [LLDP_SYSTEM_CAPABILITIES_ROUTER] = "R", + [LLDP_SYSTEM_CAPABILITIES_PHONE] = "T", + [LLDP_SYSTEM_CAPABILITIES_DOCSIS] = "D", + [LLDP_SYSTEM_CAPABILITIES_STATION] = "A", + [LLDP_SYSTEM_CAPABILITIES_CVLAN] = "C", + [LLDP_SYSTEM_CAPABILITIES_SVLAN] = "S", + [LLDP_SYSTEM_CAPABILITIES_TPMR] = "M", + [_LLDP_SYSTEM_CAPABILITIES_MAX] = "N/A", +}; + +DEFINE_STRING_TABLE_LOOKUP(lldp_system_capability, LLDPSystemCapabilities); + +static char *lldp_system_caps(uint16_t cap) { + _cleanup_free_ char *s = NULL, *t = NULL; + char *capability; + + t = strdup("[ "); + if (!t) + return NULL; + + if (cap & LLDP_SYSTEM_CAPABILITIES_OTHER) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_OTHER), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_REPEATER) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_REPEATER), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_BRIDGE) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_BRIDGE), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_WLAN_AP) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_WLAN_AP), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_ROUTER) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_ROUTER), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_PHONE) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_PHONE), " ", NULL); + if (!s) + return NULL; - link_status_one(rtnl, udev, *name); + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_DOCSIS) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_DOCSIS), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_STATION) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_STATION), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_CVLAN) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_CVLAN), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_SVLAN) { + s = strjoin(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_SVLAN), " ", NULL); + if (!s) + return NULL; + + free(t); + t = s; + } + + if (cap & LLDP_SYSTEM_CAPABILITIES_TPMR) { + s = strappend(t, lldp_system_capability_to_string(LLDP_SYSTEM_CAPABILITIES_TPMR)); + if (!s) + return NULL; + + free(t); + } + + if (!s) { + s = strappend(t, lldp_system_capability_to_string(_LLDP_SYSTEM_CAPABILITIES_MAX)); + if (!s) + return NULL; + + free(t); + } + + t = strappend(s, "]"); + if (!t) + return NULL; + + free(s); + capability = t; + + s = NULL; + t = NULL; + + return capability; +} + +static int link_lldp_status(int argc, char *argv[], void *userdata) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + _cleanup_free_ LinkInfo *links = NULL; + const char *state, *word; + + double ttl = -1; + uint32_t capability; + int i, r, c, j; + size_t ll; + char **s; + + pager_open_if_enabled(); + + r = sd_rtnl_open(&rtnl, 0); + if (r < 0) + return log_error_errno(r, "Failed to connect to netlink: %m"); + + r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, 0); + if (r < 0) + return rtnl_log_create_error(r); + + r = sd_rtnl_message_request_dump(req, true); + if (r < 0) + return rtnl_log_create_error(r); + + r = sd_rtnl_call(rtnl, req, 0, &reply); + if (r < 0) + return log_error_errno(r, "Failed to enumerate links: %m"); + + c = decode_and_sort_links(reply, &links); + if (c < 0) + return rtnl_log_parse_error(c); + + if (arg_legend) + printf("%s %16s %24s %16s %16s\n", "Local Intf", "Device ID", "Port ID", "TTL", "Capability"); + + for (i = j = 0; i < c; i++) { + _cleanup_free_ char *chassis = NULL, *port = NULL, *cap = NULL, *lldp = NULL; + _cleanup_strv_free_ char **l = NULL; + + r = sd_network_link_get_lldp(links[i].ifindex, &lldp); + if (r < 0) + continue; + + l = strv_split_newlines(lldp); + if (!l) + return -ENOMEM; + + STRV_FOREACH(s, l) { + FOREACH_WORD_QUOTED(word, ll, *s, state) { + _cleanup_free_ char *t = NULL, *a = NULL, *b = NULL; + + t = strndup(word, ll); + if (!t) + return -ENOMEM; + + r = split_pair(t, "=", &a, &b); + if (r < 0) + continue; + + if (streq(a, "_Chassis")) { + chassis = strdup(b); + if (!chassis) + return -ENOMEM; + + } else if (streq(a, "_Port")) { + port = strdup(b); + if (!port) + return -ENOMEM; + + } else if (streq(a, "_TTL")) { + long long unsigned x; + usec_t time; + + r = safe_atollu(b, &x); + if (r < 0 || (usec_t) x != x) + return log_warning_errno(r < 0 ? r : ERANGE, + "Failed to parse TTL \"%s\": %m", b); + + time = now(CLOCK_BOOTTIME); + if (x < time) + continue; + + ttl = (double) (x - time) / USEC_PER_SEC; + + } else if (streq(a, "_CAP")) { + sscanf(b, "%x", &capability); + + cap = lldp_system_caps(capability); + } + + } + + if (ttl >= 0) { + printf("%10s %24s %16s %16f %16s\n", + links[i].name, + strna(chassis), strna(port), + ttl, cap); + j++; + } + } + } + + if (arg_legend) { + printf("\nCapability Codes:\n" + "(O) - Other, (P) - Repeater, (B) - Bridge , (W) - WLAN Access Point, (R) = Router,\n" + "(T) - Telephone, (D) - Data Over Cable Service Interface Specifications, (A) - Station,\n" + "(C) - Customer VLAN, (S) - Service VLAN, (M) - Two-port MAC Relay (TPMR)\n\n"); + + printf("Total entries displayed: %d\n", j); } return 0; @@ -702,7 +1018,8 @@ static void help(void) { " -a --all Show status for all links\n\n" "Commands:\n" " list List links\n" - " status LINK Show link status\n" + " status [LINK...] Show link status\n" + " lldp Show lldp information\n" , program_invocation_short_name); } @@ -765,79 +1082,14 @@ static int parse_argv(int argc, char *argv[]) { } static int networkctl_main(int argc, char *argv[]) { - - static const struct { - const char* verb; - const enum { - MORE, - LESS, - EQUAL - } argc_cmp; - const int argc; - int (* const dispatch)(char **args, unsigned n); - } verbs[] = { - { "list", LESS, 1, list_links }, - { "status", MORE, 1, link_status }, + const Verb verbs[] = { + { "list", VERB_ANY, 1, VERB_DEFAULT, list_links }, + { "status", 1, VERB_ANY, 0, link_status }, + { "lldp", VERB_ANY, 1, VERB_DEFAULT, link_lldp_status }, + {} }; - int left; - unsigned i; - - assert(argc >= 0); - assert(argv); - - left = argc - optind; - - if (left <= 0) - /* Special rule: no arguments means "list" */ - i = 0; - else { - if (streq(argv[optind], "help")) { - help(); - return 0; - } - - for (i = 0; i < ELEMENTSOF(verbs); i++) - if (streq(argv[optind], verbs[i].verb)) - break; - - if (i >= ELEMENTSOF(verbs)) { - log_error("Unknown operation %s", argv[optind]); - return -EINVAL; - } - } - - switch (verbs[i].argc_cmp) { - - case EQUAL: - if (left != verbs[i].argc) { - log_error("Invalid number of arguments."); - return -EINVAL; - } - - break; - - case MORE: - if (left < verbs[i].argc) { - log_error("Too few arguments."); - return -EINVAL; - } - - break; - - case LESS: - if (left > verbs[i].argc) { - log_error("Too many arguments."); - return -EINVAL; - } - - break; - - default: - assert_not_reached("Unknown comparison operator."); - } - - return verbs[i].dispatch(argv + optind, left); + return dispatch_verb(argc, argv, verbs, NULL); } int main(int argc, char* argv[]) { diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index a85e8fa21..47033acde 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -21,13 +21,13 @@ #include -#include "networkd.h" -#include "networkd-link.h" - #include "utf8.h" #include "util.h" #include "conf-parser.h" +#include "fw-util.h" #include "network-internal.h" +#include "networkd.h" +#include "networkd-link.h" static void address_init(Address *address) { assert(address); @@ -59,7 +59,7 @@ int address_new_static(Network *network, unsigned section, Address **ret) { address->network = network; - LIST_PREPEND(addresses, network->static_addresses, address); + LIST_APPEND(addresses, network->static_addresses, address); if (section) { address->section = section; @@ -103,6 +103,54 @@ void address_free(Address *address) { free(address); } +int address_establish(Address *address, Link *link) { + bool masq; + int r; + + assert(address); + assert(link); + + masq = link->network && + link->network->ip_masquerade && + address->family == AF_INET && + address->scope < RT_SCOPE_LINK; + + /* Add firewall entry if this is requested */ + if (address->ip_masquerade_done != masq) { + union in_addr_union masked = address->in_addr; + in_addr_mask(address->family, &masked, address->prefixlen); + + r = fw_add_masquerade(masq, AF_INET, 0, &masked, address->prefixlen, NULL, NULL, 0); + if (r < 0) + log_link_warning_errno(link, r, "Could not enable IP masquerading: %m"); + + address->ip_masquerade_done = masq; + } + + return 0; +} + +int address_release(Address *address, Link *link) { + int r; + + assert(address); + assert(link); + + /* Remove masquerading firewall entry if it was added */ + if (address->ip_masquerade_done) { + union in_addr_union masked = address->in_addr; + in_addr_mask(address->family, &masked, address->prefixlen); + + r = fw_add_masquerade(false, AF_INET, 0, &masked, address->prefixlen, NULL, NULL, 0); + if (r < 0) + log_link_warning_errno(link, r, "Failed to disable IP masquerading: %m"); + + address->ip_masquerade_done = false; + } + + return 0; +} + int address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; @@ -115,6 +163,8 @@ int address_drop(Address *address, Link *link, assert(link->manager); assert(link->manager->rtnl); + address_release(address, link); + r = sd_rtnl_message_new_addr(link->manager->rtnl, &req, RTM_DELADDR, link->ifindex, address->family); if (r < 0) @@ -227,7 +277,7 @@ static int address_acquire(Link *link, Address *original, Address **ret) { } if (original->family == AF_INET) { - /* Pick first address in range for ourselves ...*/ + /* Pick first address in range for ourselves ... */ in_addr.in.s_addr = in_addr.in.s_addr | htobe32(1); /* .. and use last as broadcast address */ @@ -333,6 +383,8 @@ int address_configure(Address *address, Link *link, link_ref(link); + address_establish(address, link); + return 0; } @@ -540,6 +592,10 @@ bool address_equal(Address *a1, Address *a2) { case AF_INET: if (a1->prefixlen != a2->prefixlen) return false; + else if (a1->prefixlen == 0) + /* make sure we don't try to shift by 32. + * See ISO/IEC 9899:TC3 § 6.5.7.3. */ + return true; else { uint32_t b1, b2; @@ -549,8 +605,7 @@ bool address_equal(Address *a1, Address *a2) { return (b1 >> (32 - a1->prefixlen)) == (b2 >> (32 - a1->prefixlen)); } - case AF_INET6: - { + case AF_INET6: { uint64_t *b1, *b2; b1 = (uint64_t*)&a1->in_addr.in6; @@ -558,6 +613,7 @@ bool address_equal(Address *a1, Address *a2) { return (((b1[0] ^ b2[0]) | (b1[1] ^ b2[1])) == 0UL); } + default: assert_not_reached("Invalid address family"); } diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 1c2edc5b8..c3d0e3d39 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -586,7 +586,7 @@ int dhcp4_configure(Link *link) { assert(link); assert(link->network); - assert(IN_SET(link->network->dhcp, DHCP_SUPPORT_BOTH, DHCP_SUPPORT_V4)); + assert(IN_SET(link->network->dhcp, ADDRESS_FAMILY_YES, ADDRESS_FAMILY_IPV4)); r = sd_dhcp_client_new(&link->dhcp_client); if (r < 0) diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index c31bd4ec3..bcfad4c03 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -28,7 +28,137 @@ #include "sd-icmp6-nd.h" #include "sd-dhcp6-client.h" +static int dhcp6_lease_information_acquired(sd_dhcp6_client *client, + Link *link) { + return 0; +} + +static int dhcp6_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, + void *userdata) { + _cleanup_link_unref_ Link *link = userdata; + int r; + + assert(link); + + r = sd_rtnl_message_get_errno(m); + if (r < 0 && r != -EEXIST) { + log_link_error(link, "Could not set DHCPv6 address: %s", + strerror(-r)); + + link_enter_failed(link); + + } else if (r >= 0) + link_rtnl_process_address(rtnl, m, link->manager); + + return 1; +} + +static int dhcp6_address_update(Link *link, struct in6_addr *ip6_addr, + uint8_t prefixlen, uint32_t lifetime_preferred, + uint32_t lifetime_valid) { + int r; + _cleanup_address_free_ Address *addr = NULL; + + r = address_new_dynamic(&addr); + if (r < 0) + return r; + + addr->family = AF_INET6; + memcpy(&addr->in_addr.in6, ip6_addr, sizeof(*ip6_addr)); + addr->prefixlen = prefixlen; + + addr->cinfo.ifa_prefered = lifetime_preferred; + addr->cinfo.ifa_valid = lifetime_valid; + + log_link_struct(link, LOG_INFO, "MESSAGE=%-*s: DHCPv6 address "SD_ICMP6_ADDRESS_FORMAT_STR"/%d timeout preferred %d valid %d", + IFNAMSIZ, + link->ifname, SD_ICMP6_ADDRESS_FORMAT_VAL(addr->in_addr.in6), + addr->prefixlen, lifetime_preferred, lifetime_valid, + NULL); + + r = address_update(addr, link, dhcp6_address_handler); + if (r < 0) + log_link_warning(link, "Could not assign DHCPv6 address: %s", + strerror(-r)); + + return r; +} + +static int dhcp6_prefix_expired(Link *link) { + int r; + sd_dhcp6_lease *lease; + struct in6_addr *expired_prefix, ip6_addr; + uint8_t expired_prefixlen; + uint32_t lifetime_preferred, lifetime_valid; + + r = sd_icmp6_ra_get_expired_prefix(link->icmp6_router_discovery, + &expired_prefix, &expired_prefixlen); + if (r < 0) + return r; + + r = sd_dhcp6_client_get_lease(link->dhcp6_client, &lease); + if (r < 0) + return r; + + sd_dhcp6_lease_reset_address_iter(lease); + + while (sd_dhcp6_lease_get_address(lease, &ip6_addr, + &lifetime_preferred, + &lifetime_valid) >= 0) { + + r = sd_icmp6_prefix_match(expired_prefix, expired_prefixlen, + &ip6_addr); + if (r >= 0) { + r = dhcp6_address_update(link, &ip6_addr, 128, + lifetime_preferred, + lifetime_valid); + + return r; + } + } + + return 0; +} + +static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link) { + int r; + sd_dhcp6_lease *lease; + struct in6_addr ip6_addr; + uint32_t lifetime_preferred, lifetime_valid; + uint8_t prefixlen; + + r = sd_dhcp6_client_get_lease(client, &lease); + if (r < 0) + return r; + + sd_dhcp6_lease_reset_address_iter(lease); + + while (sd_dhcp6_lease_get_address(lease, &ip6_addr, + &lifetime_preferred, + &lifetime_valid) >= 0) { + + r = sd_icmp6_ra_get_prefixlen(link->icmp6_router_discovery, + &ip6_addr, &prefixlen); + if (r < 0 && r != -EADDRNOTAVAIL) { + log_link_warning(link, "Could not get prefix information: %s", + strerror(-r)); + return r; + } + + if (r == -EADDRNOTAVAIL) + prefixlen = 128; + + r = dhcp6_address_update(link, &ip6_addr, prefixlen, + lifetime_preferred, lifetime_valid); + if (r < 0) + return r; + } + + return 0; +} + static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) { + int r; Link *link = userdata; assert(link); @@ -42,9 +172,23 @@ static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) { case DHCP6_EVENT_STOP: case DHCP6_EVENT_RESEND_EXPIRE: case DHCP6_EVENT_RETRANS_MAX: + log_link_debug(link, "DHCPv6 event %d", event); + break; + case DHCP6_EVENT_IP_ACQUIRE: + r = dhcp6_lease_address_acquired(client, link); + if (r < 0) { + link_enter_failed(link); + return; + } + + /* fall through */ case DHCP6_EVENT_INFORMATION_REQUEST: - log_link_debug(link, "DHCPv6 event %d", event); + r = dhcp6_lease_information_acquired(client, link); + if (r < 0) { + link_enter_failed(link); + return; + } break; @@ -72,7 +216,8 @@ static int dhcp6_configure(Link *link, int event) { r = sd_dhcp6_client_get_information_request(link->dhcp6_client, &information_request); if (r < 0) { - log_link_warning(link, "Could not get DHCPv6 Information request setting"); + log_link_warning(link, "Could not get DHCPv6 Information request setting: %s", + strerror(-r)); link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client); return r; @@ -84,7 +229,8 @@ static int dhcp6_configure(Link *link, int event) { r = sd_dhcp6_client_set_information_request(link->dhcp6_client, false); if (r < 0) { - log_link_warning(link, "Could not unset DHCPv6 Information request"); + log_link_warning(link, "Could not unset DHCPv6 Information request: %s", + strerror(-r)); link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client); return r; @@ -92,7 +238,8 @@ static int dhcp6_configure(Link *link, int event) { r = sd_dhcp6_client_start(link->dhcp6_client); if (r < 0) { - log_link_warning(link, "Could not restart DHCPv6 after enabling Information request"); + log_link_warning(link, "Could not restart DHCPv6 after enabling Information request: %s", + strerror(-r)); link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client); return r; @@ -166,6 +313,13 @@ static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) { case ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT: case ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER: case ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED: + dhcp6_configure(link, event); + + break; + + case ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED: + dhcp6_prefix_expired(link); + break; default: @@ -176,10 +330,9 @@ static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) { log_link_warning(link, "ICMPv6 unknown event: %d", event); - return; + break; } - dhcp6_configure(link, event); } int icmp6_configure(Link *link) { diff --git a/src/network/networkd-fdb.c b/src/network/networkd-fdb.c new file mode 100644 index 000000000..feab8d421 --- /dev/null +++ b/src/network/networkd-fdb.c @@ -0,0 +1,253 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Intel Corporation. All rights reserved. + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include + +#include "networkd.h" +#include "networkd-netdev.h" +#include "networkd-link.h" +#include "network-internal.h" +#include "path-util.h" +#include "conf-files.h" +#include "conf-parser.h" +#include "util.h" + +/* create a new FDB entry or get an existing one. */ +int fdb_entry_new_static(Network *const network, + const unsigned section, + FdbEntry **ret) { + _cleanup_fdbentry_free_ FdbEntry *fdb_entry = NULL; + struct ether_addr *mac_addr = NULL; + + assert(network); + + /* search entry in hashmap first. */ + if(section) { + fdb_entry = hashmap_get(network->fdb_entries_by_section, UINT_TO_PTR(section)); + if (fdb_entry) { + *ret = fdb_entry; + fdb_entry = NULL; + + return 0; + } + } + + /* allocate space for MAC address. */ + mac_addr = new0(struct ether_addr, 1); + if (!mac_addr) + return -ENOMEM; + + /* allocate space for and FDB entry. */ + fdb_entry = new0(FdbEntry, 1); + + if (!fdb_entry) { + /* free previously allocated space for mac_addr. */ + free(mac_addr); + return -ENOMEM; + } + + /* init FDB structure. */ + fdb_entry->network = network; + fdb_entry->mac_addr = mac_addr; + + LIST_PREPEND(static_fdb_entries, network->static_fdb_entries, fdb_entry); + + if (section) { + fdb_entry->section = section; + hashmap_put(network->fdb_entries_by_section, + UINT_TO_PTR(fdb_entry->section), fdb_entry); + } + + /* return allocated FDB structure. */ + *ret = fdb_entry; + fdb_entry = NULL; + + return 0; +} + +static int set_fdb_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) { + Link *link = userdata; + int r; + + assert(link); + + r = sd_rtnl_message_get_errno(m); + if (r < 0 && r != -EEXIST) + log_link_error(link, "Could not add FDB entry: %s", strerror(-r)); + + return 1; +} + +/* send a request to the kernel to add a FDB entry in its static MAC table. */ +int fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; + sd_rtnl *rtnl; + int r; + + assert(link); + assert(link->manager); + assert(fdb_entry); + + rtnl = link->manager->rtnl; + + /* create new RTM message */ + r = sd_rtnl_message_new_neigh(rtnl, &req, RTM_NEWNEIGH, link->ifindex, PF_BRIDGE); + if (r < 0) + return rtnl_log_create_error(r); + + /* only NTF_SELF flag supported. */ + r = sd_rtnl_message_neigh_set_flags(req, NTF_SELF); + if (r < 0) + return rtnl_log_create_error(r); + + /* only NUD_PERMANENT state supported. */ + r = sd_rtnl_message_neigh_set_state(req, NUD_NOARP | NUD_PERMANENT); + if (r < 0) + return rtnl_log_create_error(r); + + r = sd_rtnl_message_append_ether_addr(req, NDA_LLADDR, fdb_entry->mac_addr); + if (r < 0) + return rtnl_log_create_error(r); + + /* VLAN Id is optional. We'll add VLAN Id only if it's specified. */ + if (0 != fdb_entry->vlan_id) { + r = sd_rtnl_message_append_u16(req, NDA_VLAN, fdb_entry->vlan_id); + if (r < 0) + return rtnl_log_create_error(r); + } + + /* send message to the kernel to update its internal static MAC table. */ + r = sd_rtnl_call_async(rtnl, req, set_fdb_handler, link, 0, NULL); + if (r < 0) { + log_link_error(link, "Could not send rtnetlink message: %s", strerror(-r)); + return r; + } + + return 0; +} + +/* remove and FDB entry. */ +void fdb_entry_free(FdbEntry *fdb_entry) { + if(!fdb_entry) + return; + + if(fdb_entry->network) { + LIST_REMOVE(static_fdb_entries, fdb_entry->network->static_fdb_entries, + fdb_entry); + + if(fdb_entry->section) + hashmap_remove(fdb_entry->network->fdb_entries_by_section, + UINT_TO_PTR(fdb_entry->section)); + } + + free(fdb_entry->mac_addr); + + free(fdb_entry); +} + +/* parse the HW address from config files. */ +int config_parse_fdb_hwaddr(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) { + Network *network = userdata; + _cleanup_fdbentry_free_ FdbEntry *fdb_entry = NULL; + int r; + + assert(filename); + assert(section); + assert(lvalue); + assert(rvalue); + assert(data); + + r = fdb_entry_new_static(network, section_line, &fdb_entry); + if (r < 0) { + log_error("Failed to allocate a new FDB entry: %s", strerror(-r)); + return r; + } + + /* read in the MAC address for the FDB table. */ + r = sscanf(rvalue, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", + &fdb_entry->mac_addr->ether_addr_octet[0], + &fdb_entry->mac_addr->ether_addr_octet[1], + &fdb_entry->mac_addr->ether_addr_octet[2], + &fdb_entry->mac_addr->ether_addr_octet[3], + &fdb_entry->mac_addr->ether_addr_octet[4], + &fdb_entry->mac_addr->ether_addr_octet[5]); + + if (ETHER_ADDR_LEN != r) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "Not a valid MAC address, ignoring assignment: %s", rvalue); + return 0; + } + + fdb_entry = NULL; + + return 0; +} + +/* parse the VLAN Id from config files. */ +int config_parse_fdb_vlan_id(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) { + Network *network = userdata; + _cleanup_fdbentry_free_ FdbEntry *fdb_entry = NULL; + int r; + + assert(filename); + assert(section); + assert(lvalue); + assert(rvalue); + assert(data); + + r = fdb_entry_new_static(network, section_line, &fdb_entry); + if (r < 0) { + log_error("Failed to allocate a new FDB entry: %s", strerror(-r)); + return r; + } + + r = config_parse_unsigned(unit, filename, line, section, + section_line, lvalue, ltype, + rvalue, &fdb_entry->vlan_id, userdata); + if (r < 0) { + log_error("Failed to parse the unsigned integer: %s", strerror(-r)); + return r; + } + + fdb_entry = NULL; + + return 0; +} diff --git a/src/network/networkd-ipv4ll.c b/src/network/networkd-ipv4ll.c index 339bf4d19..8050801e1 100644 --- a/src/network/networkd-ipv4ll.c +++ b/src/network/networkd-ipv4ll.c @@ -209,7 +209,7 @@ int ipv4ll_configure(Link *link) { assert(link); assert(link->network); - assert(link->network->ipv4ll); + assert(IN_SET(link->network->link_local, ADDRESS_FAMILY_IPV4, ADDRESS_FAMILY_YES)); r = sd_ipv4ll_new(&link->ipv4ll); if (r < 0) diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c new file mode 100644 index 000000000..1a1524dfb --- /dev/null +++ b/src/network/networkd-link-bus.c @@ -0,0 +1,138 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "bus-util.h" +#include "strv.h" + +#include "networkd.h" +#include "networkd-link.h" + +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState); +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_administrative_state, link_state, LinkState); + +const sd_bus_vtable link_vtable[] = { + SD_BUS_VTABLE_START(0), + + SD_BUS_PROPERTY("OperationalState", "s", property_get_operational_state, offsetof(Link, operstate), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + SD_BUS_PROPERTY("AdministrativeState", "s", property_get_administrative_state, offsetof(Link, state), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + + SD_BUS_VTABLE_END +}; + +static char *link_bus_path(Link *link) { + _cleanup_free_ char *ifindex = NULL; + char *p; + int r; + + assert(link); + assert(link->ifindex > 0); + + if (asprintf(&ifindex, "%d", link->ifindex) < 0) + return NULL; + + r = sd_bus_path_encode("/org/freedesktop/network1/link", ifindex, &p); + if (r < 0) + return NULL; + + return p; +} + +int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { + _cleanup_strv_free_ char **l = NULL; + Manager *m = userdata; + Link *link; + Iterator i; + int r; + + assert(bus); + assert(path); + assert(m); + assert(nodes); + + HASHMAP_FOREACH(link, m->links, i) { + char *p; + + p = link_bus_path(link); + if (!p) + return -ENOMEM; + + r = strv_consume(&l, p); + if (r < 0) + return r; + } + + *nodes = l; + l = NULL; + + return 1; +} + +int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { + _cleanup_free_ char *identifier = NULL; + Manager *m = userdata; + Link *link; + int ifindex, r; + + assert(bus); + assert(path); + assert(interface); + assert(m); + assert(found); + + r = sd_bus_path_decode(path, "/org/freedesktop/network1/link", &identifier); + if (r < 0) + return 0; + + r = safe_atoi(identifier, &ifindex); + if (r < 0) + return 0; + + r = link_get(m, ifindex, &link); + if (r < 0) + return 0; + + *found = link; + + return 1; +} + +int link_send_changed(Link *link, const char *property, ...) { + _cleanup_free_ char *p = NULL; + char **l; + + assert(link); + assert(link->manager); + + if (!link->manager->bus) + return 0; /* replace with assert when we have kdbus */ + + l = strv_from_stdarg_alloca(property); + + p = link_bus_path(link); + if (!p) + return -ENOMEM; + + return sd_bus_emit_properties_changed_strv( + link->manager->bus, + p, + "org.freedesktop.network1.Link", + l); +} diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 08f724e12..f716e8231 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -23,39 +23,39 @@ #include #include -#include "networkd-link.h" -#include "networkd-netdev.h" -#include "libudev-private.h" -#include "udev-util.h" #include "util.h" #include "virt.h" +#include "fileio.h" #include "bus-util.h" +#include "udev-util.h" +#include "libudev-private.h" #include "network-internal.h" +#include "networkd-link.h" +#include "networkd-netdev.h" #include "conf-parser.h" - #include "dhcp-lease-internal.h" -static bool link_dhcp6_enabled(Link *link) { +bool link_dhcp6_enabled(Link *link) { if (link->flags & IFF_LOOPBACK) return false; if (!link->network) return false; - return IN_SET(link->network->dhcp, DHCP_SUPPORT_V6, DHCP_SUPPORT_BOTH); + return IN_SET(link->network->dhcp, ADDRESS_FAMILY_IPV6, ADDRESS_FAMILY_YES); } -static bool link_dhcp4_enabled(Link *link) { +bool link_dhcp4_enabled(Link *link) { if (link->flags & IFF_LOOPBACK) return false; if (!link->network) return false; - return IN_SET(link->network->dhcp, DHCP_SUPPORT_V4, DHCP_SUPPORT_BOTH); + return IN_SET(link->network->dhcp, ADDRESS_FAMILY_IPV4, ADDRESS_FAMILY_YES); } -static bool link_dhcp4_server_enabled(Link *link) { +bool link_dhcp4_server_enabled(Link *link) { if (link->flags & IFF_LOOPBACK) return false; @@ -65,14 +65,57 @@ static bool link_dhcp4_server_enabled(Link *link) { return link->network->dhcp_server; } -static bool link_ipv4ll_enabled(Link *link) { +bool link_ipv4ll_enabled(Link *link) { + if (link->flags & IFF_LOOPBACK) + return false; + + if (!link->network) + return false; + + return IN_SET(link->network->link_local, ADDRESS_FAMILY_IPV4, ADDRESS_FAMILY_YES); +} + +bool link_ipv6ll_enabled(Link *link) { + if (link->flags & IFF_LOOPBACK) + return false; + + if (!link->network) + return false; + + return IN_SET(link->network->link_local, ADDRESS_FAMILY_IPV6, ADDRESS_FAMILY_YES); +} + +bool link_lldp_enabled(Link *link) { + if (link->flags & IFF_LOOPBACK) + return false; + + if (!link->network) + return false; + + if (link->network->bridge) + return false; + + return link->network->lldp; +} + +static bool link_ipv4_forward_enabled(Link *link) { if (link->flags & IFF_LOOPBACK) return false; if (!link->network) return false; - return link->network->ipv4ll; + return IN_SET(link->network->ip_forward, ADDRESS_FAMILY_IPV4, ADDRESS_FAMILY_YES); +} + +static bool link_ipv6_forward_enabled(Link *link) { + if (link->flags & IFF_LOOPBACK) + return false; + + if (!link->network) + return false; + + return IN_SET(link->network->ip_forward, ADDRESS_FAMILY_IPV6, ADDRESS_FAMILY_YES); } #define FLAG_STRING(string, flag, old, new) \ @@ -206,6 +249,12 @@ static int link_new(Manager *manager, sd_rtnl_message *message, Link **ret) { if (r < 0) return -ENOMEM; + r = asprintf(&link->lldp_file, "/run/systemd/netif/lldp/%d", + link->ifindex); + if (r < 0) + return -ENOMEM; + + r = hashmap_ensure_allocated(&manager->links, NULL); if (r < 0) return r; @@ -240,12 +289,16 @@ static void link_free(Link *link) { address_free(address); } + sd_dhcp_server_unref(link->dhcp_server); sd_dhcp_client_unref(link->dhcp_client); sd_dhcp_lease_unref(link->dhcp_lease); - unlink(link->lease_file); free(link->lease_file); + sd_lldp_free(link->lldp); + + free(link->lldp_file); + sd_ipv4ll_unref(link->ipv4ll); sd_dhcp6_client_unref(link->dhcp6_client); sd_icmp6_nd_unref(link->icmp6_router_discovery); @@ -255,7 +308,6 @@ static void link_free(Link *link) { free(link->ifname); - unlink(link->state_file); free(link->state_file); udev_device_unref(link->udev_device); @@ -293,11 +345,24 @@ int link_get(Manager *m, int ifindex, Link **ret) { return 0; } +static void link_set_state(Link *link, LinkState state) { + assert(link); + + if (link->state == state) + return; + + link->state = state; + + link_send_changed(link, "AdministrativeState", NULL); + + return; +} + void link_drop(Link *link) { if (!link || link->state == LINK_STATE_LINGER) return; - link->state = LINK_STATE_LINGER; + link_set_state(link, LINK_STATE_LINGER); log_link_debug(link, "link removed"); @@ -311,7 +376,7 @@ static void link_enter_unmanaged(Link *link) { log_link_debug(link, "unmanaged"); - link->state = LINK_STATE_UNMANAGED; + link_set_state(link, LINK_STATE_UNMANAGED); link_save(link); } @@ -364,6 +429,16 @@ static int link_stop_clients(Link *link) { } } + if (link->lldp) { + + k = sd_lldp_stop(link->lldp); + if (k < 0) { + log_link_warning(link, "Could not stop LLDP : %s", + strerror(-r)); + r = k; + } + } + return r; } @@ -375,7 +450,7 @@ void link_enter_failed(Link *link) { log_link_warning(link, "failed"); - link->state = LINK_STATE_FAILED; + link_set_state(link, LINK_STATE_FAILED); link_stop_clients(link); @@ -388,7 +463,7 @@ static Address* link_find_dhcp_server_address(Link *link) { assert(link); assert(link->network); - /* The the first statically configured address if there is any */ + /* The first statically configured address if there is any */ LIST_FOREACH(addresses, address, link->network->static_addresses) { if (address->family != AF_INET) @@ -412,66 +487,13 @@ static Address* link_find_dhcp_server_address(Link *link) { } static int link_enter_configured(Link *link) { - int r; - assert(link); assert(link->network); assert(link->state == LINK_STATE_SETTING_ROUTES); - if (link_dhcp4_server_enabled(link) && - !sd_dhcp_server_is_running(link->dhcp_server)) { - struct in_addr pool_start; - Address *address; - - address = link_find_dhcp_server_address(link); - if (!address) { - log_link_warning(link, - "Failed to find suitable address for DHCPv4 server instance."); - link_enter_failed(link); - return 0; - } - - log_link_debug(link, "offering DHCPv4 leases"); - - r = sd_dhcp_server_set_address(link->dhcp_server, - &address->in_addr.in, - address->prefixlen); - if (r < 0) - return r; - - /* offer 32 addresses starting from the address following the server address */ - pool_start.s_addr = htobe32(be32toh(address->in_addr.in.s_addr) + 1); - r = sd_dhcp_server_set_lease_pool(link->dhcp_server, - &pool_start, 32); - if (r < 0) - return r; - - /* TODO: - r = sd_dhcp_server_set_router(link->dhcp_server, - &main_address->in_addr.in); - if (r < 0) - return r; - - r = sd_dhcp_server_set_prefixlen(link->dhcp_server, - main_address->prefixlen); - if (r < 0) - return r; - */ - - r = sd_dhcp_server_start(link->dhcp_server); - if (r < 0) { - log_link_warning(link, "could not start DHCPv4 server " - "instance: %s", strerror(-r)); - - link_enter_failed(link); - - return 0; - } - } - log_link_info(link, "link configured"); - link->state = LINK_STATE_CONFIGURED; + link_set_state(link, LINK_STATE_CONFIGURED); link_save(link); @@ -534,7 +556,7 @@ static int link_enter_set_routes(Link *link) { assert(link->network); assert(link->state == LINK_STATE_SETTING_ADDRESSES); - link->state = LINK_STATE_SETTING_ROUTES; + link_set_state(link, LINK_STATE_SETTING_ROUTES); LIST_FOREACH(routes, rt, link->network->static_routes) { r = route_configure(rt, link, &route_handler); @@ -615,14 +637,12 @@ static int link_enter_set_addresses(Link *link) { assert(link->network); assert(link->state != _LINK_STATE_INVALID); - link->state = LINK_STATE_SETTING_ADDRESSES; + link_set_state(link, LINK_STATE_SETTING_ADDRESSES); LIST_FOREACH(addresses, ad, link->network->static_addresses) { r = address_configure(ad, link, &address_handler); if (r < 0) { - log_link_warning(link, - "could not set addresses: %s", - strerror(-r)); + log_link_warning_errno(link, r, "Could not set addresses: %m"); link_enter_failed(link); return r; } @@ -630,6 +650,58 @@ static int link_enter_set_addresses(Link *link) { link->link_messages ++; } + /* now that we can figure out a default address for the dhcp server, + start it */ + if (link_dhcp4_server_enabled(link)) { + struct in_addr pool_start; + Address *address; + + address = link_find_dhcp_server_address(link); + if (!address) { + log_link_warning(link, + "Failed to find suitable address for DHCPv4 server instance."); + link_enter_failed(link); + return 0; + } + + r = sd_dhcp_server_set_address(link->dhcp_server, + &address->in_addr.in, + address->prefixlen); + if (r < 0) + return r; + + /* offer 32 addresses starting from the address following the server address */ + pool_start.s_addr = htobe32(be32toh(address->in_addr.in.s_addr) + 1); + r = sd_dhcp_server_set_lease_pool(link->dhcp_server, + &pool_start, 32); + if (r < 0) + return r; + + /* TODO: + r = sd_dhcp_server_set_router(link->dhcp_server, + &main_address->in_addr.in); + if (r < 0) + return r; + + r = sd_dhcp_server_set_prefixlen(link->dhcp_server, + main_address->prefixlen); + if (r < 0) + return r; + */ + + r = sd_dhcp_server_start(link->dhcp_server); + if (r < 0) { + log_link_warning(link, "could not start DHCPv4 server " + "instance: %s", strerror(-r)); + + link_enter_failed(link); + + return 0; + } + + log_link_debug(link, "offering DHCPv4 leases"); + } + if (link->link_messages == 0) { link_enter_set_routes(link); } else @@ -656,6 +728,21 @@ int link_address_drop_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) return 1; } +static int link_set_bridge_fdb(Link *const link) { + FdbEntry *fdb_entry; + int r = 0; + + LIST_FOREACH(static_fdb_entries, fdb_entry, link->network->static_fdb_entries) { + r = fdb_entry_configure(link, fdb_entry); + if(r < 0) { + log_link_error(link, "Failed to add MAC entry to static MAC table: %s", strerror(-r)); + break; + } + } + + return r; +} + static int link_set_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) { _cleanup_link_unref_ Link *link = userdata; int r; @@ -857,6 +944,23 @@ static int link_set_bridge(Link *link) { return r; } +static void lldp_handler(sd_lldp *lldp, int event, void *userdata) { + Link *link = userdata; + int r; + + assert(link); + assert(link->network); + assert(link->manager); + + if (event != UPDATE_INFO) + return; + + r = sd_lldp_save(link->lldp, link->lldp_file); + if (r < 0) + log_link_warning(link, "could not save LLDP"); + +} + static int link_acquire_conf(Link *link) { int r; @@ -904,6 +1008,18 @@ static int link_acquire_conf(Link *link) { } } + if (link_lldp_enabled(link)) { + assert(link->lldp); + + log_link_debug(link, "Starting LLDP"); + + r = sd_lldp_start(link->lldp); + if (r < 0) { + log_link_warning(link, "could not start LLDP "); + return r; + } + } + return 0; } @@ -942,6 +1058,7 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) { static int link_up(Link *link) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; + uint8_t ipv6ll_mode; int r; assert(link); @@ -981,6 +1098,45 @@ static int link_up(Link *link) { } } + r = sd_rtnl_message_open_container(req, IFLA_AF_SPEC); + if (r < 0) { + log_link_error(link, "Could not open IFLA_AF_SPEC container: %s", strerror(-r)); + return r; + } + + r = sd_rtnl_message_open_container(req, AF_INET6); + if (r < 0) { + log_link_error(link, "Could not open AF_INET6 container: %s", strerror(-r)); + return r; + } + + ipv6ll_mode = link_ipv6ll_enabled(link) ? IN6_ADDR_GEN_MODE_EUI64 : IN6_ADDR_GEN_MODE_NONE; + r = sd_rtnl_message_append_u8(req, IFLA_INET6_ADDR_GEN_MODE, ipv6ll_mode); + if (r < 0) { + log_link_error(link, "Could not append IFLA_INET6_ADDR_GEN_MODE: %s", strerror(-r)); + return r; + } + + if (!in_addr_is_null(AF_INET6, &link->network->ipv6_token)) { + r = sd_rtnl_message_append_in6_addr(req, IFLA_INET6_TOKEN, &link->network->ipv6_token.in6); + if (r < 0) { + log_link_error(link, "Could not append IFLA_INET6_TOKEN: %s", strerror(-r)); + return r; + } + } + + r = sd_rtnl_message_close_container(req); + if (r < 0) { + log_link_error(link, "Could not close AF_INET6 container: %s", strerror(-r)); + return r; + } + + r = sd_rtnl_message_close_container(req); + if (r < 0) { + log_link_error(link, "Could not close IFLA_AF_SPEC container: %s", strerror(-r)); + return r; + } + r = sd_rtnl_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL); if (r < 0) { @@ -1057,7 +1213,7 @@ static int link_enter_join_netdev(Link *link) { assert(link->network); assert(link->state == LINK_STATE_PENDING); - link->state = LINK_STATE_ENSLAVING; + link_set_state(link, LINK_STATE_ENSLAVING); link_save(link); @@ -1140,6 +1296,56 @@ static int link_enter_join_netdev(Link *link) { return 0; } +static int link_set_ipv4_forward(Link *link) { + const char *p = NULL; + bool b; + int r; + + b = link_ipv4_forward_enabled(link); + + p = strjoina("/proc/sys/net/ipv4/conf/", link->ifname, "/forwarding"); + r = write_string_file_no_create(p, one_zero(b)); + if (r < 0) + log_link_warning_errno(link, r, "Cannot configure IPv4 forwarding for interface %s: %m", link->ifname); + + if (b) { + _cleanup_free_ char *buf = NULL; + + /* If IP forwarding is turned on for this interface, + * then propagate this to the global setting. Given + * that turning this on has side-effects on other + * fields, we'll try to avoid doing this unless + * necessary, hence check the previous value + * first. Note that we never turn this option off + * again, since all interfaces we manage do not do + * forwarding anyway by default, and ownership rules + * of this control are so unclear. */ + + r = read_one_line_file("/proc/sys/net/ipv4/ip_forward", &buf); + if (r < 0) + log_link_warning_errno(link, r, "Cannot read /proc/sys/net/ipv4/ip_forward: %m"); + else if (!streq(buf, "1")) { + r = write_string_file_no_create("/proc/sys/net/ipv4/ip_forward", "1"); + if (r < 0) + log_link_warning_errno(link, r, "Cannot write /proc/sys/net/ipv4/ip_forward: %m"); + } + } + + return 0; +} + +static int link_set_ipv6_forward(Link *link) { + const char *p = NULL; + int r; + + p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/forwarding"); + r = write_string_file_no_create(p, one_zero(link_ipv6_forward_enabled(link))); + if (r < 0) + log_link_warning_errno(link, r, "Cannot configure IPv6 forwarding for interface: %m"); + + return 0; +} + static int link_configure(Link *link) { int r; @@ -1147,6 +1353,18 @@ static int link_configure(Link *link) { assert(link->network); assert(link->state == LINK_STATE_PENDING); + r = link_set_bridge_fdb(link); + if (r < 0) + return r; + + r = link_set_ipv4_forward(link); + if (r < 0) + return r; + + r = link_set_ipv6_forward(link); + if (r < 0) + return r; + if (link_ipv4ll_enabled(link)) { r = ipv4ll_configure(link); if (r < 0) @@ -1175,6 +1393,21 @@ static int link_configure(Link *link) { return r; } + if (link_lldp_enabled(link)) { + r = sd_lldp_new(link->ifindex, link->ifname, &link->mac, &link->lldp); + if (r < 0) + return r; + + r = sd_lldp_attach_event(link->lldp, NULL, 0); + if (r < 0) + return r; + + r = sd_lldp_set_callback(link->lldp, + lldp_handler, link); + if (r < 0) + return r; + } + if (link_has_carrier(link)) { r = link_acquire_conf(link); if (r < 0) @@ -1208,10 +1441,10 @@ static int link_initialized_and_synced(sd_rtnl *rtnl, sd_rtnl_message *m, return r; if (link->flags & IFF_LOOPBACK) { - if (network->ipv4ll) - log_link_debug(link, "ignoring IPv4LL for loopback link"); + if (network->link_local != ADDRESS_FAMILY_NO) + log_link_debug(link, "ignoring link-local autoconfiguration for loopback link"); - if (network->dhcp != DHCP_SUPPORT_NONE) + if (network->dhcp != ADDRESS_FAMILY_NO) log_link_debug(link, "ignoring DHCP clients for loopback link"); if (network->dhcp_server) @@ -1268,16 +1501,27 @@ int link_initialized(Link *link, struct udev_device *device) { return 0; } +static Address* link_get_equal_address(Link *link, Address *needle) { + Address *i; + + assert(link); + assert(needle); + + LIST_FOREACH(addresses, i, link->addresses) + if (address_equal(i, needle)) + return i; + + return NULL; +} + int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *userdata) { Manager *m = userdata; Link *link = NULL; uint16_t type; _cleanup_address_free_ Address *address = NULL; - Address *ad; - char buf[INET6_ADDRSTRLEN]; - char valid_buf[FORMAT_TIMESPAN_MAX]; + Address *existing; + char buf[INET6_ADDRSTRLEN], valid_buf[FORMAT_TIMESPAN_MAX]; const char *valid_str = NULL; - bool address_dropped = false; int r, ifindex; assert(rtnl); @@ -1308,7 +1552,10 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use } else { r = link_get(m, ifindex, &link); if (r < 0 || !link) { - log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex); + /* when enumerating we might be out of sync, but we will + * get the address again, so just ignore it */ + if (!m->enumerating) + log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex); return 0; } } @@ -1319,50 +1566,42 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use r = sd_rtnl_message_addr_get_family(message, &address->family); if (r < 0 || !IN_SET(address->family, AF_INET, AF_INET6)) { - log_link_warning(link, - "rtnl: received address with invalid family, ignoring"); + log_link_warning(link, "rtnl: received address with invalid family, ignoring"); return 0; } r = sd_rtnl_message_addr_get_prefixlen(message, &address->prefixlen); if (r < 0) { - log_link_warning(link, - "rtnl: received address with invalid prefixlen, ignoring"); + log_link_warning(link, "rtnl: received address with invalid prefixlen, ignoring"); return 0; } r = sd_rtnl_message_addr_get_scope(message, &address->scope); if (r < 0) { - log_link_warning(link, - "rtnl: received address with invalid scope, ignoring"); + log_link_warning(link, "rtnl: received address with invalid scope, ignoring"); return 0; } r = sd_rtnl_message_addr_get_flags(message, &address->flags); if (r < 0) { - log_link_warning(link, - "rtnl: received address with invalid flags, ignoring"); + log_link_warning(link, "rtnl: received address with invalid flags, ignoring"); return 0; } switch (address->family) { case AF_INET: - r = sd_rtnl_message_read_in_addr(message, IFA_LOCAL, - &address->in_addr.in); + r = sd_rtnl_message_read_in_addr(message, IFA_LOCAL, &address->in_addr.in); if (r < 0) { - log_link_warning(link, - "rtnl: received address without valid address, ignoring"); + log_link_warning(link, "rtnl: received address without valid address, ignoring"); return 0; } break; case AF_INET6: - r = sd_rtnl_message_read_in6_addr(message, IFA_ADDRESS, - &address->in_addr.in6); + r = sd_rtnl_message_read_in6_addr(message, IFA_ADDRESS, &address->in_addr.in6); if (r < 0) { - log_link_warning(link, - "rtnl: received address without valid address, ignoring"); + log_link_warning(link, "rtnl: received address without valid address, ignoring"); return 0; } @@ -1372,14 +1611,12 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use assert_not_reached("invalid address family"); } - if (!inet_ntop(address->family, &address->in_addr, buf, - INET6_ADDRSTRLEN)) { + if (!inet_ntop(address->family, &address->in_addr, buf, INET6_ADDRSTRLEN)) { log_link_warning(link, "could not print address"); return 0; } - r = sd_rtnl_message_read_cache_info(message, IFA_CACHEINFO, - &address->cinfo); + r = sd_rtnl_message_read_cache_info(message, IFA_CACHEINFO, &address->cinfo); if (r >= 0) { if (address->cinfo.ifa_valid == CACHE_INFO_INFINITY_LIFE_TIME) valid_str = "ever"; @@ -1389,43 +1626,40 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use USEC_PER_SEC); } - LIST_FOREACH(addresses, ad, link->addresses) { - if (address_equal(ad, address)) { - LIST_REMOVE(addresses, link->addresses, ad); + existing = link_get_equal_address(link, address); - address_free(ad); + switch (type) { + case RTM_NEWADDR: + if (existing) { + log_link_debug(link, "Updating address: %s/%u (valid for %s)", buf, address->prefixlen, valid_str); - address_dropped = true; - break; - } - } + existing->scope = address->scope; + existing->flags = address->flags; + existing->cinfo = address->cinfo; - switch (type) { - case RTM_NEWADDR: - if (!address_dropped) - log_link_debug(link, "added address: %s/%u (valid for %s)", - buf, address->prefixlen, valid_str); - else - log_link_debug(link, "updated address: %s/%u (valid for %s)", - buf, address->prefixlen, valid_str); + } else { + log_link_debug(link, "Adding address: %s/%u (valid for %s)", buf, address->prefixlen, valid_str); - LIST_PREPEND(addresses, link->addresses, address); - address = NULL; + LIST_PREPEND(addresses, link->addresses, address); + address_establish(address, link); - link_save(link); + address = NULL; + + link_save(link); + } break; + case RTM_DELADDR: - if (address_dropped) { - log_link_debug(link, "removed address: %s/%u (valid for %s)", - buf, address->prefixlen, valid_str); - link_save(link); + if (existing) { + log_link_debug(link, "Removing address: %s/%u (valid for %s)", buf, address->prefixlen, valid_str); + address_release(existing, link); + LIST_REMOVE(addresses, link->addresses, existing); + address_free(existing); } else - log_link_warning(link, - "removing non-existent address: %s/%u (valid for %s)", - buf, address->prefixlen, valid_str); + log_link_warning(link, "Removing non-existent address: %s/%u (valid for %s)", buf, address->prefixlen, valid_str); break; default: @@ -1485,6 +1719,57 @@ int link_add(Manager *m, sd_rtnl_message *message, Link **ret) { return 0; } +static int link_carrier_gained(Link *link) { + int r; + + assert(link); + + if (link->network) { + r = link_acquire_conf(link); + if (r < 0) { + link_enter_failed(link); + return r; + } + } + + return 0; +} + +static int link_carrier_lost(Link *link) { + int r; + + assert(link); + + r = link_stop_clients(link); + if (r < 0) { + link_enter_failed(link); + return r; + } + + return 0; +} + +int link_carrier_reset(Link *link) { + int r; + + assert(link); + + if (link_has_carrier(link)) { + r = link_carrier_lost(link); + if (r < 0) + return r; + + r = link_carrier_gained(link); + if (r < 0) + return r; + + log_link_info(link, "reset carrier"); + } + + return 0; +} + + int link_update(Link *link, sd_rtnl_message *m) { struct ether_addr mac; const char *ifname; @@ -1499,7 +1784,7 @@ int link_update(Link *link, sd_rtnl_message *m) { if (link->state == LINK_STATE_LINGER) { link_ref(link); log_link_info(link, "link readded"); - link->state = LINK_STATE_ENSLAVING; + link_set_state(link, LINK_STATE_ENSLAVING); } r = sd_rtnl_message_read_string(m, IFLA_IFNAME, &ifname); @@ -1602,32 +1887,27 @@ int link_update(Link *link, sd_rtnl_message *m) { if (carrier_gained) { log_link_info(link, "gained carrier"); - if (link->network) { - r = link_acquire_conf(link); - if (r < 0) { - link_enter_failed(link); - return r; - } - } + r = link_carrier_gained(link); + if (r < 0) + return r; } else if (carrier_lost) { log_link_info(link, "lost carrier"); - r = link_stop_clients(link); - if (r < 0) { - link_enter_failed(link); + r = link_carrier_lost(link); + if (r < 0) return r; - } + } return 0; } static void link_update_operstate(Link *link) { - + LinkOperationalState operstate; assert(link); if (link->kernel_operstate == IF_OPER_DORMANT) - link->operstate = LINK_OPERSTATE_DORMANT; + operstate = LINK_OPERSTATE_DORMANT; else if (link_has_carrier(link)) { Address *address; uint8_t scope = RT_SCOPE_NOWHERE; @@ -1643,17 +1923,22 @@ static void link_update_operstate(Link *link) { if (scope < RT_SCOPE_SITE) /* universally accessible addresses found */ - link->operstate = LINK_OPERSTATE_ROUTABLE; + operstate = LINK_OPERSTATE_ROUTABLE; else if (scope < RT_SCOPE_HOST) /* only link or site local addresses found */ - link->operstate = LINK_OPERSTATE_DEGRADED; + operstate = LINK_OPERSTATE_DEGRADED; else /* no useful addresses found */ - link->operstate = LINK_OPERSTATE_CARRIER; + operstate = LINK_OPERSTATE_CARRIER; } else if (link->flags & IFF_UP) - link->operstate = LINK_OPERSTATE_NO_CARRIER; + operstate = LINK_OPERSTATE_NO_CARRIER; else - link->operstate = LINK_OPERSTATE_OFF; + operstate = LINK_OPERSTATE_OFF; + + if (link->operstate != operstate) { + link->operstate = operstate; + link_send_changed(link, "OperationalState", NULL); + } } int link_save(Link *link) { @@ -1791,6 +2076,19 @@ int link_save(Link *link) { } else unlink(link->lease_file); + if (link->lldp) { + assert(link->network); + + r = sd_lldp_save(link->lldp, link->lldp_file); + if (r < 0) + goto fail; + + fprintf(f, + "LLDP_FILE=%s\n", + link->lldp_file); + } else + unlink(link->lldp_file); + r = fflush_and_check(f); if (r < 0) goto fail; diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index 05c34eef1..cec158e47 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -21,6 +21,8 @@ #pragma once +#include + #include "networkd.h" typedef enum LinkState { @@ -36,17 +38,6 @@ typedef enum LinkState { _LINK_STATE_INVALID = -1 } LinkState; -typedef enum LinkOperationalState { - LINK_OPERSTATE_OFF, - LINK_OPERSTATE_NO_CARRIER, - LINK_OPERSTATE_DORMANT, - LINK_OPERSTATE_CARRIER, - LINK_OPERSTATE_DEGRADED, - LINK_OPERSTATE_ROUTABLE, - _LINK_OPERSTATE_MAX, - _LINK_OPERSTATE_INVALID = -1 -} LinkOperationalState; - struct Link { Manager *manager; @@ -91,6 +82,9 @@ struct Link { sd_icmp6_nd *icmp6_router_discovery; sd_dhcp6_client *dhcp6_client; + + sd_lldp *lldp; + char *lldp_file; }; Link *link_unref(Link *link); @@ -112,6 +106,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use int link_save(Link *link); +int link_carrier_reset(Link *link); bool link_has_carrier(Link *link); int link_set_mtu(Link *link, uint32_t mtu); @@ -121,11 +116,21 @@ int ipv4ll_configure(Link *link); int dhcp4_configure(Link *link); int icmp6_configure(Link *link); +bool link_lldp_enabled(Link *link); +bool link_ipv4ll_enabled(Link *link); +bool link_ipv6ll_enabled(Link *link); +bool link_dhcp4_server_enabled(Link *link); +bool link_dhcp4_enabled(Link *link); +bool link_dhcp6_enabled(Link *link); + const char* link_state_to_string(LinkState s) _const_; LinkState link_state_from_string(const char *s) _pure_; -const char* link_operstate_to_string(LinkOperationalState s) _const_; -LinkOperationalState link_operstate_from_string(const char *s) _pure_; +extern const sd_bus_vtable link_vtable[]; + +int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); +int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); +int link_send_changed(Link *link, const char *property, ...) _sentinel_; DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref); #define _cleanup_link_unref_ _cleanup_(link_unrefp) @@ -149,8 +154,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref); #define log_link_struct(link, level, ...) log_struct(level, "INTERFACE=%s", link->ifname, __VA_ARGS__) -#define ADDRESS_FMT_VAL(address) \ - (address).s_addr & 0xFF, \ - ((address).s_addr >> 8) & 0xFF, \ - ((address).s_addr >> 16) & 0xFF, \ - (address).s_addr >> 24 +#define ADDRESS_FMT_VAL(address) \ + be32toh((address).s_addr) >> 24, \ + (be32toh((address).s_addr) >> 16) & 0xFFu, \ + (be32toh((address).s_addr) >> 8) & 0xFFu, \ + be32toh((address).s_addr) & 0xFFu diff --git a/src/network/networkd-manager-bus.c b/src/network/networkd-manager-bus.c new file mode 100644 index 000000000..b281f4fdb --- /dev/null +++ b/src/network/networkd-manager-bus.c @@ -0,0 +1,51 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "bus-util.h" + +#include "networkd.h" + +static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState); + +const sd_bus_vtable manager_vtable[] = { + SD_BUS_VTABLE_START(0), + + SD_BUS_PROPERTY("OperationalState", "s", property_get_operational_state, offsetof(Manager, operational_state), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + + SD_BUS_VTABLE_END +}; + +int manager_send_changed(Manager *manager, const char *property, ...) { + char **l; + + assert(manager); + + if (!manager->bus) + return 0; /* replace by assert when we have kdbus */ + + l = strv_from_stdarg_alloca(property); + + return sd_bus_emit_properties_changed_strv( + manager->bus, + "/org/freedesktop/network1", + "org.freedesktop.network1.Manager", + l); +} diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index fe9008a3d..ce97ac077 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -31,10 +31,13 @@ #include "libudev-private.h" #include "udev-util.h" #include "rtnl-util.h" +#include "bus-util.h" +#include "def.h" #include "mkdir.h" #include "virt.h" #include "sd-rtnl.h" +#include "sd-daemon.h" /* use 8 MB for receive socket kernel queue. */ #define RCVBUF_SIZE (8*1024*1024) @@ -75,126 +78,121 @@ static int setup_default_address_pool(Manager *m) { return 0; } -int manager_new(Manager **ret) { - _cleanup_manager_free_ Manager *m = NULL; - int r; +static int on_bus_retry(sd_event_source *s, usec_t usec, void *userdata) { + Manager *m = userdata; - m = new0(Manager, 1); - if (!m) - return -ENOMEM; + assert(s); + assert(m); - m->state_file = strdup("/run/systemd/netif/state"); - if (!m->state_file) - return -ENOMEM; + m->bus_retry_event_source = sd_event_source_unref(m->bus_retry_event_source); - r = sd_event_default(&m->event); - if (r < 0) - return r; + manager_connect_bus(m); - sd_event_set_watchdog(m->event, true); + return 0; +} - sd_event_add_signal(m->event, NULL, SIGTERM, NULL, NULL); - sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); +static int manager_reset_all(Manager *m) { + Link *link; + Iterator i; + int r; - r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, - RTNLGRP_IPV6_IFADDR); - if (r < 0) - return r; + assert(m); - r = sd_rtnl_inc_rcvbuf(m->rtnl, RCVBUF_SIZE); - if (r < 0) - return r; + HASHMAP_FOREACH(link, m->links, i) { + r = link_carrier_reset(link); + if (r < 0) + log_link_warning_errno(link, r, "could not reset carrier: %m"); + } - r = sd_bus_default_system(&m->bus); - if (r < 0 && r != -ENOENT) /* TODO: drop when we can rely on kdbus */ - return r; + return 0; +} - /* udev does not initialize devices inside containers, - * so we rely on them being already initialized before - * entering the container */ - if (detect_container(NULL) <= 0) { - m->udev = udev_new(); - if (!m->udev) - return -ENOMEM; - - m->udev_monitor = udev_monitor_new_from_netlink(m->udev, "udev"); - if (!m->udev_monitor) - return -ENOMEM; - } +static int match_prepare_for_sleep(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *ret_error) { + Manager *m = userdata; + int b, r; - m->netdevs = hashmap_new(&string_hash_ops); - if (!m->netdevs) - return -ENOMEM; + assert(bus); + assert(bus); - LIST_HEAD_INIT(m->networks); + r = sd_bus_message_read(message, "b", &b); + if (r < 0) { + log_debug_errno(r, "Failed to parse PrepareForSleep signal: %m"); + return 0; + } - r = setup_default_address_pool(m); - if (r < 0) - return r; + if (b) + return 0; - *ret = m; - m = NULL; + log_debug("Coming back from suspend, resetting all connections..."); + + manager_reset_all(m); return 0; } -void manager_free(Manager *m) { - Network *network; - NetDev *netdev; - Link *link; - AddressPool *pool; +int manager_connect_bus(Manager *m) { + int r; - if (!m) - return; + assert(m); - free(m->state_file); + r = sd_bus_default_system(&m->bus); + if (r == -ENOENT) { + /* We failed to connect? Yuck, we must be in early + * boot. Let's try in 5s again. As soon as we have + * kdbus we can stop doing this... */ - udev_monitor_unref(m->udev_monitor); - udev_unref(m->udev); - sd_bus_unref(m->bus); - sd_event_source_unref(m->udev_event_source); - sd_event_unref(m->event); + log_debug_errno(r, "Failed to connect to bus, trying again in 5s: %m"); - while ((link = hashmap_first(m->links))) - link_unref(link); - hashmap_free(m->links); + r = sd_event_add_time(m->event, &m->bus_retry_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 5*USEC_PER_SEC, 0, on_bus_retry, m); + if (r < 0) + return log_error_errno(r, "Failed to install bus reconnect time event: %m"); - while ((network = m->networks)) - network_free(network); + return 0; + } if (r < 0) + return r; - while ((netdev = hashmap_first(m->netdevs))) - netdev_unref(netdev); - hashmap_free(m->netdevs); + r = sd_bus_add_match(m->bus, &m->prepare_for_sleep_slot, + "type='signal'," + "sender='org.freedesktop.login1'," + "interface='org.freedesktop.login1.Manager'," + "member='PrepareForSleep'," + "path='/org/freedesktop/login1'", + match_prepare_for_sleep, + m); + if (r < 0) + return log_error_errno(r, "Failed to add match for PrepareForSleep: %m"); - while ((pool = m->address_pools)) - address_pool_free(pool); + r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/network1", "org.freedesktop.network1.Manager", manager_vtable, m); + if (r < 0) + return log_error_errno(r, "Failed to add manager object vtable: %m"); - sd_rtnl_unref(m->rtnl); + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/network1/link", "org.freedesktop.network1.Link", link_vtable, link_object_find, m); + if (r < 0) + return log_error_errno(r, "Failed to add link object vtable: %m"); - free(m); -} + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/network1/link", link_node_enumerator, m); + if (r < 0) + return log_error_errno(r, "Failed to add link enumerator: %m"); -int manager_load_config(Manager *m) { - int r; + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/network1/network", "org.freedesktop.network1.Network", network_vtable, network_object_find, m); + if (r < 0) + return log_error_errno(r, "Failed to add network object vtable: %m"); - /* update timestamp */ - paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, true); + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/network1/network", network_node_enumerator, m); + if (r < 0) + return log_error_errno(r, "Failed to add network enumerator: %m"); - r = netdev_load(m); + r = sd_bus_request_name(m->bus, "org.freedesktop.network1", 0); if (r < 0) - return r; + return log_error_errno(r, "Failed to register name: %m"); - r = network_load(m); + r = sd_bus_attach_event(m->bus, m->event, 0); if (r < 0) - return r; + return log_error_errno(r, "Failed to attach bus to event loop: %m"); return 0; } -bool manager_should_reload(Manager *m) { - return paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, false); -} - static int manager_udev_process_link(Manager *m, struct udev_device *device) { Link *link = NULL; int r, ifindex; @@ -224,6 +222,61 @@ static int manager_udev_process_link(Manager *m, struct udev_device *device) { return 0; } +static int manager_dispatch_link_udev(sd_event_source *source, int fd, uint32_t revents, void *userdata) { + Manager *m = userdata; + struct udev_monitor *monitor = m->udev_monitor; + _cleanup_udev_device_unref_ struct udev_device *device = NULL; + + device = udev_monitor_receive_device(monitor); + if (!device) + return -ENOMEM; + + manager_udev_process_link(m, device); + return 0; +} + +static int manager_connect_udev(Manager *m) { + int r; + + /* udev does not initialize devices inside containers, + * so we rely on them being already initialized before + * entering the container */ + if (detect_container(NULL) > 0) + return 0; + + m->udev = udev_new(); + if (!m->udev) + return -ENOMEM; + + m->udev_monitor = udev_monitor_new_from_netlink(m->udev, "udev"); + if (!m->udev_monitor) + return -ENOMEM; + + r = udev_monitor_filter_add_match_subsystem_devtype(m->udev_monitor, "net", NULL); + if (r < 0) + return log_error_errno(r, "Could not add udev monitor filter: %m"); + + r = udev_monitor_enable_receiving(m->udev_monitor); + if (r < 0) { + log_error("Could not enable udev monitor"); + return r; + } + + r = sd_event_add_io(m->event, + &m->udev_event_source, + udev_monitor_get_fd(m->udev_monitor), + EPOLLIN, manager_dispatch_link_udev, + m); + if (r < 0) + return r; + + r = sd_event_source_set_description(m->udev_event_source, "networkd-udev"); + if (r < 0) + return r; + + return 0; +} + static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, void *userdata) { Manager *m = userdata; Link *link = NULL; @@ -273,7 +326,7 @@ static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, vo /* link is new, so add it */ r = link_add(m, message, &link); if (r < 0) { - log_debug_errno(r, "could not add new link: %m"); + log_warning_errno(r, "could not add new link: %m"); return 0; } } @@ -282,7 +335,7 @@ static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, vo /* netdev exists, so make sure the ifindex matches */ r = netdev_set_ifindex(netdev, message); if (r < 0) { - log_debug_errno(r, "could not set ifindex on netdev: %m"); + log_warning_errno(r, "could not set ifindex on netdev: %m"); return 0; } } @@ -306,155 +359,284 @@ static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, vo return 1; } -int manager_rtnl_enumerate_links(Manager *m) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; - sd_rtnl_message *link; - int r; +static int systemd_netlink_fd(void) { + int n, fd, rtnl_fd = -EINVAL; + + n = sd_listen_fds(true); + if (n <= 0) + return -EINVAL; + + for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++) { + if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1) > 0) { + if (rtnl_fd >= 0) + return -EINVAL; + + rtnl_fd = fd; + } + } + + return rtnl_fd; +} + +static int manager_connect_rtnl(Manager *m) { + int fd, r; assert(m); - assert(m->rtnl); - r = sd_rtnl_message_new_link(m->rtnl, &req, RTM_GETLINK, 0); + fd = systemd_netlink_fd(); + if (fd < 0) + r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR); + else + r = sd_rtnl_open_fd(&m->rtnl, fd, 0); if (r < 0) return r; - r = sd_rtnl_message_request_dump(req, true); + r = sd_rtnl_inc_rcvbuf(m->rtnl, RCVBUF_SIZE); if (r < 0) return r; - r = sd_rtnl_call(m->rtnl, req, 0, &reply); + r = sd_rtnl_attach_event(m->rtnl, m->event, 0); if (r < 0) return r; - for (link = reply; link; link = sd_rtnl_message_next(link)) { - int k; + r = sd_rtnl_add_match(m->rtnl, RTM_NEWLINK, &manager_rtnl_process_link, m); + if (r < 0) + return r; - k = manager_rtnl_process_link(m->rtnl, link, m); - if (k < 0) - r = k; - } + r = sd_rtnl_add_match(m->rtnl, RTM_DELLINK, &manager_rtnl_process_link, m); + if (r < 0) + return r; - return r; + r = sd_rtnl_add_match(m->rtnl, RTM_NEWADDR, &link_rtnl_process_address, m); + if (r < 0) + return r; + + r = sd_rtnl_add_match(m->rtnl, RTM_DELADDR, &link_rtnl_process_address, m); + if (r < 0) + return r; + + return 0; } -int manager_rtnl_enumerate_addresses(Manager *m) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; - sd_rtnl_message *addr; +int manager_new(Manager **ret) { + _cleanup_manager_free_ Manager *m = NULL; int r; - assert(m); - assert(m->rtnl); + m = new0(Manager, 1); + if (!m) + return -ENOMEM; - r = sd_rtnl_message_new_addr(m->rtnl, &req, RTM_GETADDR, 0, 0); + m->state_file = strdup("/run/systemd/netif/state"); + if (!m->state_file) + return -ENOMEM; + + r = sd_event_default(&m->event); if (r < 0) return r; - r = sd_rtnl_message_request_dump(req, true); + sd_event_set_watchdog(m->event, true); + + sd_event_add_signal(m->event, NULL, SIGTERM, NULL, NULL); + sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); + + r = manager_connect_rtnl(m); if (r < 0) return r; - r = sd_rtnl_call(m->rtnl, req, 0, &reply); + r = manager_connect_udev(m); if (r < 0) return r; - for (addr = reply; addr; addr = sd_rtnl_message_next(addr)) { - int k; + m->netdevs = hashmap_new(&string_hash_ops); + if (!m->netdevs) + return -ENOMEM; - k = link_rtnl_process_address(m->rtnl, addr, m); - if (k < 0) - r = k; - } + LIST_HEAD_INIT(m->networks); - return r; + r = setup_default_address_pool(m); + if (r < 0) + return r; + + *ret = m; + m = NULL; + + return 0; } -static int manager_dispatch_link_udev(sd_event_source *source, int fd, uint32_t revents, void *userdata) { - Manager *m = userdata; - struct udev_monitor *monitor = m->udev_monitor; - _cleanup_udev_device_unref_ struct udev_device *device = NULL; +void manager_free(Manager *m) { + Network *network; + NetDev *netdev; + Link *link; + AddressPool *pool; - device = udev_monitor_receive_device(monitor); - if (!device) - return -ENOMEM; + if (!m) + return; - manager_udev_process_link(m, device); - return 0; + free(m->state_file); + + udev_monitor_unref(m->udev_monitor); + udev_unref(m->udev); + sd_bus_unref(m->bus); + sd_bus_slot_unref(m->prepare_for_sleep_slot); + sd_event_source_unref(m->udev_event_source); + sd_event_source_unref(m->bus_retry_event_source); + sd_event_unref(m->event); + + while ((link = hashmap_first(m->links))) + link_unref(link); + hashmap_free(m->links); + + while ((network = m->networks)) + network_free(network); + + hashmap_free(m->networks_by_name); + + while ((netdev = hashmap_first(m->netdevs))) + netdev_unref(netdev); + hashmap_free(m->netdevs); + + while ((pool = m->address_pools)) + address_pool_free(pool); + + sd_rtnl_unref(m->rtnl); + + free(m); } -int manager_udev_listen(Manager *m) { - int r; +static bool manager_check_idle(void *userdata) { + Manager *m = userdata; + Link *link; + Iterator i; - if (detect_container(NULL) > 0) - return 0; + assert(m); - assert(m->udev_monitor); + HASHMAP_FOREACH(link, m->links, i) { + /* we are not woken on udev activity, so let's just wait for the + * pending udev event */ + if (link->state == LINK_STATE_PENDING) + return false; - r = udev_monitor_filter_add_match_subsystem_devtype(m->udev_monitor, "net", NULL); - if (r < 0) - return log_error_errno(r, "Could not add udev monitor filter: %m"); + if (!link->network) + continue; - r = udev_monitor_enable_receiving(m->udev_monitor); - if (r < 0) { - log_error("Could not enable udev monitor"); - return r; + /* we are not woken on netork activity, so let's stay around */ + if (link_lldp_enabled(link) || + link_ipv4ll_enabled(link) || + link_dhcp4_server_enabled(link) || + link_dhcp4_enabled(link) || + link_dhcp6_enabled(link)) + return false; } - r = sd_event_add_io(m->event, - &m->udev_event_source, - udev_monitor_get_fd(m->udev_monitor), - EPOLLIN, manager_dispatch_link_udev, - m); + return true; +} + +int manager_run(Manager *m) { + assert(m); + + if (m->bus) + return bus_event_loop_with_idle( + m->event, + m->bus, + "org.freedesktop.network1", + DEFAULT_EXIT_USEC, + manager_check_idle, + m); + else + /* failed to connect to the bus, so we lose exit-on-idle logic, + this should not happen except if dbus is not around at all */ + return sd_event_loop(m->event); +} + +int manager_load_config(Manager *m) { + int r; + + /* update timestamp */ + paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, true); + + r = netdev_load(m); if (r < 0) return r; - r = sd_event_source_set_description(m->udev_event_source, "networkd-udev"); + r = network_load(m); if (r < 0) return r; return 0; } -int manager_rtnl_listen(Manager *m) { +bool manager_should_reload(Manager *m) { + return paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, false); +} + +int manager_rtnl_enumerate_links(Manager *m) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; + sd_rtnl_message *link; int r; assert(m); + assert(m->rtnl); - r = sd_rtnl_attach_event(m->rtnl, m->event, 0); + r = sd_rtnl_message_new_link(m->rtnl, &req, RTM_GETLINK, 0); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_NEWLINK, &manager_rtnl_process_link, m); + r = sd_rtnl_message_request_dump(req, true); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_DELLINK, &manager_rtnl_process_link, m); + r = sd_rtnl_call(m->rtnl, req, 0, &reply); if (r < 0) return r; - r = sd_rtnl_add_match(m->rtnl, RTM_NEWADDR, &link_rtnl_process_address, m); - if (r < 0) - return r; + for (link = reply; link; link = sd_rtnl_message_next(link)) { + int k; - r = sd_rtnl_add_match(m->rtnl, RTM_DELADDR, &link_rtnl_process_address, m); - if (r < 0) - return r; + m->enumerating = true; - return 0; + k = manager_rtnl_process_link(m->rtnl, link, m); + if (k < 0) + r = k; + + m->enumerating = false; + } + + return r; } -int manager_bus_listen(Manager *m) { +int manager_rtnl_enumerate_addresses(Manager *m) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL; + sd_rtnl_message *addr; int r; - assert(m->event); + assert(m); + assert(m->rtnl); - if (!m->bus) /* TODO: drop when we can rely on kdbus */ - return 0; + r = sd_rtnl_message_new_addr(m->rtnl, &req, RTM_GETADDR, 0, 0); + if (r < 0) + return r; - r = sd_bus_attach_event(m->bus, m->event, 0); + r = sd_rtnl_message_request_dump(req, true); if (r < 0) return r; - return 0; + r = sd_rtnl_call(m->rtnl, req, 0, &reply); + if (r < 0) + return r; + + for (addr = reply; addr; addr = sd_rtnl_message_next(addr)) { + int k; + + m->enumerating = true; + + k = link_rtnl_process_address(m->rtnl, addr, m); + if (k < 0) + r = k; + + m->enumerating = false; + } + + return r; } static int set_put_in_addr(Set *s, const struct in_addr *address) { @@ -626,6 +808,13 @@ int manager_save(Manager *m) { goto fail; } + if (m->operational_state != operstate) { + m->operational_state = operstate; + r = manager_send_changed(m, "OperationalState", NULL); + if (r < 0) + log_error_errno(r, "Could not emit changed OperationalState: %m"); + } + return 0; fail: @@ -654,3 +843,37 @@ int manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, uni return 0; } + +const char *address_family_boolean_to_string(AddressFamilyBoolean b) { + if (b == ADDRESS_FAMILY_YES || + b == ADDRESS_FAMILY_NO) + return yes_no(b == ADDRESS_FAMILY_YES); + + if (b == ADDRESS_FAMILY_IPV4) + return "ipv4"; + if (b == ADDRESS_FAMILY_IPV6) + return "ipv6"; + + return NULL; +} + +AddressFamilyBoolean address_family_boolean_from_string(const char *s) { + int r; + + /* Make this a true superset of a boolean */ + + r = parse_boolean(s); + if (r > 0) + return ADDRESS_FAMILY_YES; + if (r == 0) + return ADDRESS_FAMILY_NO; + + if (streq(s, "ipv4")) + return ADDRESS_FAMILY_IPV4; + if (streq(s, "ipv6")) + return ADDRESS_FAMILY_IPV6; + + return _ADDRESS_FAMILY_BOOLEAN_INVALID; +} + +DEFINE_CONFIG_PARSE_ENUM(config_parse_address_family_boolean, address_family_boolean, AddressFamilyBoolean, "Failed to parse option"); diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf index b311ebe4f..963c47c3e 100644 --- a/src/network/networkd-netdev-gperf.gperf +++ b/src/network/networkd-netdev-gperf.gperf @@ -29,11 +29,13 @@ NetDev.MTUBytes, config_parse_iec_size, 0, NetDev.MACAddress, config_parse_hwaddr, 0, offsetof(NetDev, mac) VLAN.Id, config_parse_uint64, 0, offsetof(VLan, id) MACVLAN.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode) +IPVLAN.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode) Tunnel.Local, config_parse_tunnel_address, 0, offsetof(Tunnel, local) Tunnel.Remote, config_parse_tunnel_address, 0, offsetof(Tunnel, remote) Tunnel.TOS, config_parse_unsigned, 0, offsetof(Tunnel, tos) Tunnel.TTL, config_parse_unsigned, 0, offsetof(Tunnel, ttl) Tunnel.DiscoverPathMTU, config_parse_bool, 0, offsetof(Tunnel, pmtudisc) +Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode) Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer) Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer) VXLAN.Id, config_parse_uint64, 0, offsetof(VxLan, id) diff --git a/src/network/networkd-netdev-ipvlan.c b/src/network/networkd-netdev-ipvlan.c new file mode 100644 index 000000000..9a7c280c6 --- /dev/null +++ b/src/network/networkd-netdev-ipvlan.c @@ -0,0 +1,75 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013-2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "networkd-netdev-ipvlan.h" +#include "network-internal.h" +#include "conf-parser.h" +#include "list.h" + +static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = { + [NETDEV_IPVLAN_MODE_L2] = "L2", + [NETDEV_IPVLAN_MODE_L3] = "L3", +}; + +DEFINE_STRING_TABLE_LOOKUP(ipvlan_mode, IPVlanMode); +DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_mode, ipvlan_mode, IPVlanMode, "Failed to parse ipvlan mode"); + +static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *req) { + IPVlan *m = IPVLAN(netdev); + int r; + + assert(netdev); + assert(m); + assert(link); + assert(netdev->ifname); + + if (m->mode != _NETDEV_IPVLAN_MODE_INVALID) { + r = sd_rtnl_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPVLAN_MODE attribute: %s", + strerror(-r)); + return r; + } + } + + return 0; +} + +static void ipvlan_init(NetDev *n) { + IPVlan *m = IPVLAN(n); + + assert(n); + assert(m); + + m->mode = _NETDEV_IPVLAN_MODE_INVALID; +} + +const NetDevVTable ipvlan_vtable = { + .object_size = sizeof(IPVlan), + .init = ipvlan_init, + .sections = "Match\0NetDev\0IPVLAN\0", + .fill_message_create = netdev_ipvlan_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, +}; diff --git a/src/network/networkd-netdev-ipvlan.h b/src/network/networkd-netdev-ipvlan.h new file mode 100644 index 000000000..408386f37 --- /dev/null +++ b/src/network/networkd-netdev-ipvlan.h @@ -0,0 +1,47 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014-2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +typedef struct IPVlan IPVlan; + +#include "missing.h" +#include "networkd-netdev.h" + +typedef enum IPVlanMode { + NETDEV_IPVLAN_MODE_L2 = IPVLAN_MODE_L2, + NETDEV_IPVLAN_MODE_L3 = IPVLAN_MODE_L3, + _NETDEV_IPVLAN_MODE_MAX, + _NETDEV_IPVLAN_MODE_INVALID = -1 +} IPVlanMode; + +struct IPVlan { + NetDev meta; + + IPVlanMode mode; +}; + +extern const NetDevVTable ipvlan_vtable; + +const char *ipvlan_mode_to_string(IPVlanMode d) _const_; +IPVlanMode ipvlan_mode_from_string(const char *d) _pure_; + +int config_parse_ipvlan_mode(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); diff --git a/src/network/networkd-netdev-tunnel.c b/src/network/networkd-netdev-tunnel.c index 31d34644e..e95082d11 100644 --- a/src/network/networkd-netdev-tunnel.c +++ b/src/network/networkd-netdev-tunnel.c @@ -3,7 +3,7 @@ /*** This file is part of systemd. - Copyright 2014 Susant Sahani + Copyright 2014 Susant Sahani systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -24,6 +24,7 @@ #include #include #include +#include #include "sd-rtnl.h" #include "networkd-netdev-tunnel.h" @@ -33,6 +34,17 @@ #include "missing.h" #include "conf-parser.h" +#define DEFAULT_TNL_HOP_LIMIT 64 + +static const char* const ip6tnl_mode_table[_NETDEV_IP6_TNL_MODE_MAX] = { + [NETDEV_IP6_TNL_MODE_IP6IP6] = "ip6ip6", + [NETDEV_IP6_TNL_MODE_IPIP6] = "ipip6", + [NETDEV_IP6_TNL_MODE_ANYIP6] = "any", +}; + +DEFINE_STRING_TABLE_LOOKUP(ip6tnl_mode, Ip6TnlMode); +DEFINE_CONFIG_PARSE_ENUM(config_parse_ip6tnl_mode, ip6tnl_mode, Ip6TnlMode, "Failed to parse ip6 tunnel Mode"); + static int netdev_ipip_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { Tunnel *t = IPIP(netdev); int r; @@ -140,14 +152,20 @@ static int netdev_sit_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_me } static int netdev_gre_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { - Tunnel *t = GRE(netdev); + Tunnel *t; int r; assert(netdev); - assert(link); - assert(m); + + if (netdev->kind == NETDEV_KIND_GRE) + t = GRE(netdev); + else + t = GRETAP(netdev); + assert(t); assert(t->family == AF_INET); + assert(link); + assert(m); r = sd_rtnl_message_append_u32(m, IFLA_GRE_LINK, link->ifindex); if (r < 0) { @@ -200,6 +218,57 @@ static int netdev_gre_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_me return r; } +static int netdev_ip6gre_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { + Tunnel *t; + int r; + + assert(netdev); + + if (netdev->kind == NETDEV_KIND_IP6GRE) + t = IP6GRE(netdev); + else + t = IP6GRETAP(netdev); + + assert(t); + assert(t->family == AF_INET6); + assert(link); + assert(m); + + r = sd_rtnl_message_append_u32(m, IFLA_GRE_LINK, link->ifindex); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_GRE_LINK attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_in6_addr(m, IFLA_GRE_LOCAL, &t->local.in6); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_GRE_LOCAL attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_in6_addr(m, IFLA_GRE_REMOTE, &t->remote.in6); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_GRE_REMOTE attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_u8(m, IFLA_GRE_TTL, t->ttl); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_GRE_TTL attribute: %s", + strerror(-r)); + return r; + } + + return r; +} + static int netdev_vti_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { Tunnel *t = VTI(netdev); int r; @@ -237,6 +306,73 @@ static int netdev_vti_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_me return r; } +static int netdev_ip6tnl_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { + Tunnel *t = IP6TNL(netdev); + uint8_t proto; + int r; + + assert(netdev); + assert(link); + assert(m); + assert(t); + assert(t->family == AF_INET6); + + r = sd_rtnl_message_append_u32(m, IFLA_IPTUN_LINK, link->ifindex); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPTUN_LINK attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_in6_addr(m, IFLA_IPTUN_LOCAL, &t->local.in6); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPTUN_LOCAL attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_in6_addr(m, IFLA_IPTUN_REMOTE, &t->remote.in6); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPTUN_REMOTE attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_u8(m, IFLA_IPTUN_TTL, t->ttl); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPTUN_TTL attribute: %s", + strerror(-r)); + return r; + } + + switch (t->ip6tnl_mode) { + case NETDEV_IP6_TNL_MODE_IP6IP6: + proto = IPPROTO_IPV6; + break; + case NETDEV_IP6_TNL_MODE_IPIP6: + proto = IPPROTO_IPIP; + break; + case NETDEV_IP6_TNL_MODE_ANYIP6: + default: + proto = 0; + break; + } + + r = sd_rtnl_message_append_u8(m, IFLA_IPTUN_PROTO, proto); + if (r < 0) { + log_netdev_error(netdev, + "Could not append IFLA_IPTUN_MODE attribute: %s", + strerror(-r)); + return r; + } + + return r; +} + static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { Tunnel *t = NULL; @@ -253,9 +389,21 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { case NETDEV_KIND_GRE: t = GRE(netdev); break; + case NETDEV_KIND_GRETAP: + t = GRETAP(netdev); + break; + case NETDEV_KIND_IP6GRE: + t = IP6GRE(netdev); + break; + case NETDEV_KIND_IP6GRETAP: + t = IP6GRETAP(netdev); + break; case NETDEV_KIND_VTI: t = VTI(netdev); break; + case NETDEV_KIND_IP6TNL: + t = IP6TNL(netdev); + break; default: assert_not_reached("Invalid tunnel kind"); } @@ -267,11 +415,18 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { return -EINVAL; } - if (t->family != AF_INET) { + if (t->family != AF_INET && t->family != AF_INET6) { log_warning("Tunnel with invalid address family configured in %s. Ignoring", filename); return -EINVAL; } + if (netdev->kind == NETDEV_KIND_IP6TNL) { + if (t->ip6tnl_mode == _NETDEV_IP6_TNL_MODE_INVALID) { + log_warning("IP6 Tunnel without mode configured in %s. Ignoring", filename); + return -EINVAL; + } + } + return 0; } @@ -339,14 +494,46 @@ static void vti_init(NetDev *n) { } static void gre_init(NetDev *n) { - Tunnel *t = GRE(n); + Tunnel *t; assert(n); + + if (n->kind == NETDEV_KIND_GRE) + t = GRE(n); + else + t = GRETAP(n); + assert(t); t->pmtudisc = true; } +static void ip6gre_init(NetDev *n) { + Tunnel *t; + + assert(n); + + if (n->kind == NETDEV_KIND_IP6GRE) + t = IP6GRE(n); + else + t = IP6GRETAP(n); + + assert(t); + + t->ttl = DEFAULT_TNL_HOP_LIMIT; +} + +static void ip6tnl_init(NetDev *n) { + Tunnel *t = IP6TNL(n); + + assert(n); + assert(t); + + t->ttl = DEFAULT_TNL_HOP_LIMIT; + t->encap_limit = IPV6_DEFAULT_TNL_ENCAP_LIMIT; + t->ip6tnl_mode = _NETDEV_IP6_TNL_MODE_INVALID; +} + const NetDevVTable ipip_vtable = { .object_size = sizeof(Tunnel), .init = ipip_init, @@ -382,3 +569,39 @@ const NetDevVTable gre_vtable = { .create_type = NETDEV_CREATE_STACKED, .config_verify = netdev_tunnel_verify, }; + +const NetDevVTable gretap_vtable = { + .object_size = sizeof(Tunnel), + .init = gre_init, + .sections = "Match\0NetDev\0Tunnel\0", + .fill_message_create = netdev_gre_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, + .config_verify = netdev_tunnel_verify, +}; + +const NetDevVTable ip6gre_vtable = { + .object_size = sizeof(Tunnel), + .init = ip6gre_init, + .sections = "Match\0NetDev\0Tunnel\0", + .fill_message_create = netdev_ip6gre_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, + .config_verify = netdev_tunnel_verify, +}; + +const NetDevVTable ip6gretap_vtable = { + .object_size = sizeof(Tunnel), + .init = ip6gre_init, + .sections = "Match\0NetDev\0Tunnel\0", + .fill_message_create = netdev_ip6gre_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, + .config_verify = netdev_tunnel_verify, +}; + +const NetDevVTable ip6tnl_vtable = { + .object_size = sizeof(Tunnel), + .init = ip6tnl_init, + .sections = "Match\0NetDev\0Tunnel\0", + .fill_message_create = netdev_ip6tnl_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, + .config_verify = netdev_tunnel_verify, +}; diff --git a/src/network/networkd-netdev-tunnel.h b/src/network/networkd-netdev-tunnel.h index 000a6460e..453d73c59 100644 --- a/src/network/networkd-netdev-tunnel.h +++ b/src/network/networkd-netdev-tunnel.h @@ -25,15 +25,30 @@ typedef struct Tunnel Tunnel; #include "networkd-netdev.h" +typedef enum Ip6TnlMode { + NETDEV_IP6_TNL_MODE_IP6IP6, + NETDEV_IP6_TNL_MODE_IPIP6, + NETDEV_IP6_TNL_MODE_ANYIP6, + _NETDEV_IP6_TNL_MODE_MAX, + _NETDEV_IP6_TNL_MODE_INVALID = -1, +} Ip6TnlMode; + struct Tunnel { NetDev meta; + uint8_t encap_limit; + int family; unsigned ttl; unsigned tos; + unsigned flags; + union in_addr_union local; union in_addr_union remote; + + Ip6TnlMode ip6tnl_mode; + bool pmtudisc; }; @@ -41,3 +56,16 @@ extern const NetDevVTable ipip_vtable; extern const NetDevVTable sit_vtable; extern const NetDevVTable vti_vtable; extern const NetDevVTable gre_vtable; +extern const NetDevVTable gretap_vtable; +extern const NetDevVTable ip6gre_vtable; +extern const NetDevVTable ip6gretap_vtable; +extern const NetDevVTable ip6tnl_vtable; + +const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_; +Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_; + +int config_parse_ip6tnl_mode(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); diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c index b75eab9cd..8119205dd 100644 --- a/src/network/networkd-netdev.c +++ b/src/network/networkd-netdev.c @@ -35,15 +35,20 @@ const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = { [NETDEV_KIND_BOND] = &bond_vtable, [NETDEV_KIND_VLAN] = &vlan_vtable, [NETDEV_KIND_MACVLAN] = &macvlan_vtable, + [NETDEV_KIND_IPVLAN] = &ipvlan_vtable, [NETDEV_KIND_VXLAN] = &vxlan_vtable, [NETDEV_KIND_IPIP] = &ipip_vtable, [NETDEV_KIND_GRE] = &gre_vtable, + [NETDEV_KIND_GRETAP] = &gretap_vtable, + [NETDEV_KIND_IP6GRE] = &ip6gre_vtable, + [NETDEV_KIND_IP6GRETAP] = &ip6gretap_vtable, [NETDEV_KIND_SIT] = &sit_vtable, [NETDEV_KIND_VTI] = &vti_vtable, [NETDEV_KIND_VETH] = &veth_vtable, [NETDEV_KIND_DUMMY] = &dummy_vtable, [NETDEV_KIND_TUN] = &tun_vtable, [NETDEV_KIND_TAP] = &tap_vtable, + [NETDEV_KIND_IP6TNL] = &ip6tnl_vtable, }; static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = { @@ -51,15 +56,20 @@ static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = { [NETDEV_KIND_BOND] = "bond", [NETDEV_KIND_VLAN] = "vlan", [NETDEV_KIND_MACVLAN] = "macvlan", + [NETDEV_KIND_IPVLAN] = "ipvlan", [NETDEV_KIND_VXLAN] = "vxlan", [NETDEV_KIND_IPIP] = "ipip", [NETDEV_KIND_GRE] = "gre", + [NETDEV_KIND_GRETAP] = "gretap", + [NETDEV_KIND_IP6GRE] = "ip6gre", + [NETDEV_KIND_IP6GRETAP] = "ip6gretap", [NETDEV_KIND_SIT] = "sit", [NETDEV_KIND_VETH] = "veth", [NETDEV_KIND_VTI] = "vti", [NETDEV_KIND_DUMMY] = "dummy", [NETDEV_KIND_TUN] = "tun", [NETDEV_KIND_TAP] = "tap", + [NETDEV_KIND_IP6TNL] = "ip6tnl", }; DEFINE_STRING_TABLE_LOOKUP(netdev_kind, NetDevKind); @@ -275,7 +285,7 @@ int netdev_enslave(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callbac if (r < 0) return r; } else { - /* the netdev is not yet read, save this request for when it is*/ + /* the netdev is not yet read, save this request for when it is */ netdev_join_callback *cb; cb = new0(netdev_join_callback, 1); diff --git a/src/network/networkd-netdev.h b/src/network/networkd-netdev.h index c1e05c21f..3756b1e5a 100644 --- a/src/network/networkd-netdev.h +++ b/src/network/networkd-netdev.h @@ -43,12 +43,17 @@ typedef enum NetDevKind { NETDEV_KIND_BOND, NETDEV_KIND_VLAN, NETDEV_KIND_MACVLAN, + NETDEV_KIND_IPVLAN, NETDEV_KIND_VXLAN, NETDEV_KIND_IPIP, NETDEV_KIND_GRE, + NETDEV_KIND_GRETAP, + NETDEV_KIND_IP6GRE, + NETDEV_KIND_IP6GRETAP, NETDEV_KIND_SIT, NETDEV_KIND_VETH, NETDEV_KIND_VTI, + NETDEV_KIND_IP6TNL, NETDEV_KIND_DUMMY, NETDEV_KIND_TUN, NETDEV_KIND_TAP, @@ -100,6 +105,7 @@ struct NetDev { #include "networkd-netdev-bond.h" #include "networkd-netdev-vlan.h" #include "networkd-netdev-macvlan.h" +#include "networkd-netdev-ipvlan.h" #include "networkd-netdev-vxlan.h" #include "networkd-netdev-veth.h" #include "networkd-netdev-tunnel.h" @@ -157,11 +163,16 @@ DEFINE_CAST(BRIDGE, Bridge); DEFINE_CAST(BOND, Bond); DEFINE_CAST(VLAN, VLan); DEFINE_CAST(MACVLAN, MacVlan); +DEFINE_CAST(IPVLAN, IPVlan); DEFINE_CAST(VXLAN, VxLan); DEFINE_CAST(IPIP, Tunnel); DEFINE_CAST(GRE, Tunnel); +DEFINE_CAST(GRETAP, Tunnel); +DEFINE_CAST(IP6GRE, Tunnel); +DEFINE_CAST(IP6GRETAP, Tunnel); DEFINE_CAST(SIT, Tunnel); DEFINE_CAST(VTI, Tunnel); +DEFINE_CAST(IP6TNL, Tunnel); DEFINE_CAST(VETH, Veth); DEFINE_CAST(DUMMY, Dummy); DEFINE_CAST(TUN, TunTap); diff --git a/src/network/networkd-network-bus.c b/src/network/networkd-network-bus.c new file mode 100644 index 000000000..36b40d32b --- /dev/null +++ b/src/network/networkd-network-bus.c @@ -0,0 +1,160 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "bus-util.h" +#include "bus-label.h" +#include "strv.h" + +#include "networkd.h" + +static int property_get_ether_addrs( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + Network *n = userdata; + const char *ether = NULL; + int r; + + assert(bus); + assert(reply); + assert(n); + + if (n->match_mac) + ether = ether_ntoa(n->match_mac); + + r = sd_bus_message_open_container(reply, 'a', "s"); + if (r < 0) + return r; + + if (ether) { + r = sd_bus_message_append(reply, "s", strempty(ether)); + if (r < 0) + return r; + } + + r = sd_bus_message_close_container(reply); + if (r < 0) + return r; + + return 1; +} + +const sd_bus_vtable network_vtable[] = { + SD_BUS_VTABLE_START(0), + + SD_BUS_PROPERTY("Description", "s", NULL, offsetof(Network, description), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("SourcePath", "s", NULL, offsetof(Network, filename), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchMAC", "as", property_get_ether_addrs, offsetof(Network, match_mac), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchPath", "as", NULL, offsetof(Network, match_path), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchDriver", "as", NULL, offsetof(Network, match_driver), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchType", "as", NULL, offsetof(Network, match_type), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchName", "as", NULL, offsetof(Network, match_name), SD_BUS_VTABLE_PROPERTY_CONST), + + SD_BUS_VTABLE_END +}; + +static char *network_bus_path(Network *network) { + _cleanup_free_ char *name = NULL; + char *networkname, *d, *path; + int r; + + assert(network); + assert(network->filename); + + name = strdup(network->filename); + if (!name) + return NULL; + + networkname = basename(name); + + d = strrchr(networkname, '.'); + if (!d) + return NULL; + + assert(streq(d, ".network")); + + *d = '\0'; + + r = sd_bus_path_encode("/org/freedesktop/network1/network", networkname, &path); + if (r < 0) + return NULL; + + return path; +} + +int network_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) { + _cleanup_strv_free_ char **l = NULL; + Manager *m = userdata; + Network *network; + int r; + + assert(bus); + assert(path); + assert(m); + assert(nodes); + + LIST_FOREACH(networks, network, m->networks) { + char *p; + + p = network_bus_path(network); + if (!p) + return -ENOMEM; + + r = strv_consume(&l, p); + if (r < 0) + return r; + } + + *nodes = l; + l = NULL; + + return 1; +} + +int network_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { + Manager *m = userdata; + Network *network; + _cleanup_free_ char *name = NULL; + int r; + + assert(bus); + assert(path); + assert(interface); + assert(m); + assert(found); + + r = sd_bus_path_decode(path, "/org/freedesktop/network1/network", &name); + if (r < 0) + return 0; + + r = network_get_by_name(m, name, &network); + if (r < 0) + return 0; + + *found = network; + + return 1; +} diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 640a3a20b..fc277df94 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -16,10 +16,10 @@ struct ConfigPerfItem; %includes %% Match.MACAddress, config_parse_hwaddr, 0, offsetof(Network, match_mac) -Match.Path, config_parse_string, 0, offsetof(Network, match_path) -Match.Driver, config_parse_string, 0, offsetof(Network, match_driver) -Match.Type, config_parse_string, 0, offsetof(Network, match_type) -Match.Name, config_parse_ifname, 0, offsetof(Network, match_name) +Match.Path, config_parse_strv, 0, offsetof(Network, match_path) +Match.Driver, config_parse_strv, 0, offsetof(Network, match_driver) +Match.Type, config_parse_strv, 0, offsetof(Network, match_type) +Match.Name, config_parse_ifnames, 0, offsetof(Network, match_name) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(Network, match_host) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(Network, match_virt) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(Network, match_kernel) @@ -31,18 +31,23 @@ Network.Bridge, config_parse_netdev, 0, Network.Bond, config_parse_netdev, 0, offsetof(Network, bond) Network.VLAN, config_parse_netdev, 0, 0 Network.MACVLAN, config_parse_netdev, 0, 0 +Network.IPVLAN, config_parse_netdev, 0, 0 Network.VXLAN, config_parse_netdev, 0, 0 Network.Tunnel, config_parse_tunnel, 0, 0 Network.DHCP, config_parse_dhcp, 0, offsetof(Network, dhcp) Network.DHCPServer, config_parse_bool, 0, offsetof(Network, dhcp_server) -Network.IPv4LL, config_parse_bool, 0, offsetof(Network, ipv4ll) +Network.LinkLocalAddressing, config_parse_address_family_boolean,0, offsetof(Network, link_local) Network.IPv4LLRoute, config_parse_bool, 0, offsetof(Network, ipv4ll_route) +Network.IPv6Token, config_parse_ipv6token, 0, offsetof(Network, ipv6_token) +Network.LLDP, config_parse_bool, 0, offsetof(Network, lldp) Network.Address, config_parse_address, 0, 0 Network.Gateway, config_parse_gateway, 0, 0 Network.Domains, config_parse_domains, 0, offsetof(Network, domains) Network.DNS, config_parse_strv, 0, offsetof(Network, dns) Network.LLMNR, config_parse_llmnr, 0, offsetof(Network, llmnr) Network.NTP, config_parse_strv, 0, offsetof(Network, ntp) +Network.IPForward, config_parse_address_family_boolean,0, offsetof(Network, ip_forward) +Network.IPMasquerade, config_parse_bool, 0, offsetof(Network, ip_masquerade) Address.Address, config_parse_address, 0, 0 Address.Peer, config_parse_address, 0, 0 Address.Broadcast, config_parse_broadcast, 0, 0 @@ -51,6 +56,7 @@ Route.Gateway, config_parse_gateway, 0, Route.Destination, config_parse_destination, 0, 0 Route.Source, config_parse_destination, 0, 0 Route.Metric, config_parse_route_priority, 0, 0 +Route.Scope, config_parse_route_scope, 0, 0 DHCP.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_dns) DHCP.UseMTU, config_parse_bool, 0, offsetof(Network, dhcp_mtu) DHCP.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp_hostname) @@ -62,7 +68,10 @@ DHCP.CriticalConnection, config_parse_bool, 0, DHCP.VendorClassIdentifier, config_parse_string, 0, offsetof(Network, dhcp_vendor_class_identifier) DHCP.RouteMetric, config_parse_unsigned, 0, offsetof(Network, dhcp_route_metric) Bridge.Cost, config_parse_unsigned, 0, offsetof(Network, cost) +BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0 +BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0 /* backwards compatibility: do not add new entries to this section */ +Network.IPv4LL, config_parse_ipv4ll, 0, offsetof(Network, link_local) DHCPv4.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_dns) DHCPv4.UseMTU, config_parse_bool, 0, offsetof(Network, dhcp_mtu) DHCPv4.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp_hostname) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index ef9e0a8c3..35ac064cf 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -22,18 +22,19 @@ #include #include -#include "networkd.h" -#include "networkd-netdev.h" -#include "networkd-link.h" -#include "network-internal.h" #include "path-util.h" #include "conf-files.h" #include "conf-parser.h" #include "util.h" +#include "networkd.h" +#include "networkd-netdev.h" +#include "networkd-link.h" +#include "network-internal.h" static int network_load_one(Manager *manager, const char *filename) { _cleanup_network_free_ Network *network = NULL; _cleanup_fclose_ FILE *file = NULL; + char *d; Route *route; Address *address; int r; @@ -62,6 +63,7 @@ static int network_load_one(Manager *manager, const char *filename) { LIST_HEAD_INIT(network->static_addresses); LIST_HEAD_INIT(network->static_routes); + LIST_HEAD_INIT(network->static_fdb_entries); network->stacked_netdevs = hashmap_new(&string_hash_ops); if (!network->stacked_netdevs) @@ -75,11 +77,27 @@ static int network_load_one(Manager *manager, const char *filename) { if (!network->routes_by_section) return log_oom(); + network->fdb_entries_by_section = hashmap_new(NULL); + if (!network->fdb_entries_by_section) + return log_oom(); + network->filename = strdup(filename); if (!network->filename) return log_oom(); - network->dhcp = DHCP_SUPPORT_NONE; + network->name = strdup(basename(filename)); + if (!network->name) + return log_oom(); + + d = strrchr(network->name, '.'); + if (!d) + return -EINVAL; + + assert(streq(d, ".network")); + + *d = '\0'; + + network->dhcp = ADDRESS_FAMILY_NO; network->dhcp_ntp = true; network->dhcp_dns = true; network->dhcp_hostname = true; @@ -89,6 +107,8 @@ static int network_load_one(Manager *manager, const char *filename) { network->llmnr = LLMNR_SUPPORT_YES; + network->link_local = ADDRESS_FAMILY_IPV6; + r = config_parse(NULL, filename, file, "Match\0" "Link\0" @@ -97,14 +117,27 @@ static int network_load_one(Manager *manager, const char *filename) { "Route\0" "DHCP\0" "DHCPv4\0" - "Bridge\0", + "Bridge\0" + "BridgeFDB\0", config_item_perf_lookup, network_network_gperf_lookup, false, false, true, network); if (r < 0) return r; + /* IPMasquerade=yes implies IPForward=yes */ + if (network->ip_masquerade) + network->ip_forward |= ADDRESS_FAMILY_IPV4; + LIST_PREPEND(networks, manager->networks, network); + r = hashmap_ensure_allocated(&manager->networks_by_name, &string_hash_ops); + if (r < 0) + return r; + + r = hashmap_put(manager->networks_by_name, network->name, network); + if (r < 0) + return r; + LIST_FOREACH(routes, route, network->static_routes) { if (!route->family) { log_warning("Route section without Gateway field configured in %s. " @@ -154,6 +187,7 @@ void network_free(Network *network) { NetDev *netdev; Route *route; Address *address; + FdbEntry *fdb_entry; Iterator i; if (!network) @@ -162,10 +196,10 @@ void network_free(Network *network) { free(network->filename); free(network->match_mac); - free(network->match_path); - free(network->match_driver); - free(network->match_type); - free(network->match_name); + strv_free(network->match_path); + strv_free(network->match_driver); + strv_free(network->match_type); + strv_free(network->match_name); free(network->description); free(network->dhcp_vendor_class_identifier); @@ -192,11 +226,22 @@ void network_free(Network *network) { while ((address = network->static_addresses)) address_free(address); + while ((fdb_entry = network->static_fdb_entries)) + fdb_entry_free(fdb_entry); + hashmap_free(network->addresses_by_section); hashmap_free(network->routes_by_section); + hashmap_free(network->fdb_entries_by_section); + + if (network->manager) { + if (network->manager->networks) + LIST_REMOVE(networks, network->manager->networks, network); + + if (network->manager->networks_by_name) + hashmap_remove(network->manager->networks_by_name, network->name); + } - if (network->manager && network->manager->networks) - LIST_REMOVE(networks, network->manager->networks, network); + free(network->name); condition_free_list(network->match_host); condition_free_list(network->match_virt); @@ -206,6 +251,22 @@ void network_free(Network *network) { free(network); } +int network_get_by_name(Manager *manager, const char *name, Network **ret) { + Network *network; + + assert(manager); + assert(name); + assert(ret); + + network = hashmap_get(manager->networks_by_name, name); + if (!network) + return -ENOENT; + + *ret = network; + + return 0; +} + int network_get(Manager *manager, struct udev_device *device, const char *ifname, const struct ether_addr *address, Network **ret) { @@ -347,6 +408,7 @@ int config_parse_netdev(const char *unit, break; case NETDEV_KIND_VLAN: case NETDEV_KIND_MACVLAN: + case NETDEV_KIND_IPVLAN: case NETDEV_KIND_VXLAN: r = hashmap_put(network->stacked_netdevs, netdev->ifname, netdev); if (r < 0) { @@ -436,7 +498,12 @@ int config_parse_tunnel(const char *unit, if (netdev->kind != NETDEV_KIND_IPIP && netdev->kind != NETDEV_KIND_SIT && netdev->kind != NETDEV_KIND_GRE && - netdev->kind != NETDEV_KIND_VTI) { + netdev->kind != NETDEV_KIND_GRETAP && + netdev->kind != NETDEV_KIND_IP6GRE && + netdev->kind != NETDEV_KIND_IP6GRETAP && + netdev->kind != NETDEV_KIND_VTI && + netdev->kind != NETDEV_KIND_IP6TNL + ) { log_syntax(unit, LOG_ERR, filename, line, EINVAL, "NetDev is not a tunnel, ignoring assignment: %s", rvalue); return 0; @@ -455,14 +522,36 @@ int config_parse_tunnel(const char *unit, return 0; } -static const char* const dhcp_support_table[_DHCP_SUPPORT_MAX] = { - [DHCP_SUPPORT_NONE] = "none", - [DHCP_SUPPORT_BOTH] = "both", - [DHCP_SUPPORT_V4] = "v4", - [DHCP_SUPPORT_V6] = "v6", -}; +int config_parse_ipv4ll( + 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) { -DEFINE_STRING_TABLE_LOOKUP(dhcp_support, DHCPSupport); + AddressFamilyBoolean *link_local = data; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + /* Note that this is mostly like + * config_parse_address_family_boolean(), except that it + * applies only to IPv4 */ + + if (parse_boolean(rvalue)) + *link_local |= ADDRESS_FAMILY_IPV4; + else + *link_local &= ~ADDRESS_FAMILY_IPV4; + + return 0; +} int config_parse_dhcp( const char* unit, @@ -476,34 +565,38 @@ int config_parse_dhcp( void *data, void *userdata) { - DHCPSupport *dhcp = data; - int k; + AddressFamilyBoolean *dhcp = data, s; assert(filename); assert(lvalue); assert(rvalue); assert(data); - /* Our enum shall be a superset of booleans, hence first try - * to parse as boolean, and then as enum */ - - k = parse_boolean(rvalue); - if (k > 0) - *dhcp = DHCP_SUPPORT_BOTH; - else if (k == 0) - *dhcp = DHCP_SUPPORT_NONE; - else { - DHCPSupport s; - - s = dhcp_support_from_string(rvalue); - if (s < 0){ - log_syntax(unit, LOG_ERR, filename, line, -s, "Failed to parse DHCP option, ignoring: %s", rvalue); + /* Note that this is mostly like + * config_parse_address_family_boolean(), except that it + * understands some old names for the enum values */ + + s = address_family_boolean_from_string(rvalue); + if (s < 0) { + + /* Previously, we had a slightly different enum here, + * support its values for compatbility. */ + + if (streq(rvalue, "none")) + s = ADDRESS_FAMILY_NO; + else if (streq(rvalue, "v4")) + s = ADDRESS_FAMILY_IPV4; + else if (streq(rvalue, "v6")) + s = ADDRESS_FAMILY_IPV6; + else if (streq(rvalue, "both")) + s = ADDRESS_FAMILY_YES; + else { + log_syntax(unit, LOG_ERR, filename, line, s, "Failed to parse DHCP option, ignoring: %s", rvalue); return 0; } - - *dhcp = s; } + *dhcp = s; return 0; } @@ -533,7 +626,7 @@ int config_parse_llmnr( assert(filename); assert(lvalue); assert(rvalue); - assert(data); + assert(llmnr); /* Our enum shall be a superset of booleans, hence first try * to parse as boolean, and then as enum */ @@ -557,3 +650,46 @@ int config_parse_llmnr( return 0; } + +int config_parse_ipv6token( + 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) { + + union in_addr_union buffer; + struct in6_addr *token = data; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(token); + + r = in_addr_from_string(AF_INET6, rvalue, &buffer); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to parse IPv6 token, ignoring: %s", rvalue); + return 0; + } + + r = in_addr_is_null(AF_INET6, &buffer); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, -r, "IPv6 token can not be the ANY address, ignoring: %s", rvalue); + return 0; + } + + if ((buffer.in6.s6_addr32[0] | buffer.in6.s6_addr32[1]) != 0) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "IPv6 token can not be longer than 64 bits, ignoring: %s", rvalue); + return 0; + } + + *token = buffer.in6; + + return 0; +} diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 590dd49df..c2d1ffca2 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -427,3 +427,44 @@ int config_parse_route_priority(const char *unit, return 0; } + +int config_parse_route_scope(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) { + Network *network = userdata; + _cleanup_route_free_ Route *n = NULL; + int r; + + assert(filename); + assert(section); + assert(lvalue); + assert(rvalue); + assert(data); + + r = route_new_static(network, section_line, &n); + if (r < 0) + return r; + + if (streq(rvalue, "host")) + n->scope = RT_SCOPE_HOST; + else if (streq(rvalue, "link")) + n->scope = RT_SCOPE_LINK; + else if (streq(rvalue, "global")) + n->scope = RT_SCOPE_UNIVERSE; + else { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "Unknown route scope: %s", rvalue); + return 0; + } + + n = NULL; + + return 0; +} diff --git a/src/network/networkd-wait-online-link.c b/src/network/networkd-wait-online-link.c index 268ab676c..e091b20ed 100644 --- a/src/network/networkd-wait-online-link.c +++ b/src/network/networkd-wait-online-link.c @@ -134,12 +134,3 @@ int link_update_monitor(Link *l) { return 0; } - -bool link_relevant(Link *l) { - assert(l); - - if (l->flags & IFF_LOOPBACK) - return false; - - return true; -} diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c index 3f2b96688..cafe110e5 100644 --- a/src/network/networkd-wait-online-manager.c +++ b/src/network/networkd-wait-online-manager.c @@ -21,6 +21,7 @@ #include #include +#include #include "rtnl-util.h" @@ -30,6 +31,23 @@ #include "networkd-wait-online.h" #include "util.h" +#include "time-util.h" + +bool manager_ignore_link(Manager *m, Link *link) { + char **ignore; + + assert(m); + assert(link); + + if (link->flags & IFF_LOOPBACK) + return true; + + STRV_FOREACH(ignore, m->ignore) + if (fnmatch(*ignore, link->ifname, 0) == 0) + return true; + + return false; +} bool manager_all_configured(Manager *m) { Iterator i; @@ -49,8 +67,8 @@ bool manager_all_configured(Manager *m) { /* wait for all links networkd manages to be in admin state 'configured' and at least one link to gain a carrier */ HASHMAP_FOREACH(l, m->links, i) { - if (!link_relevant(l)) { - log_info("ignore irrelevant link: %s", l->ifname); + if (manager_ignore_link(m, l)) { + log_info("ignoring: %s", l->ifname); continue; } @@ -159,7 +177,7 @@ static int manager_rtnl_listen(Manager *m) { assert(m); - /* First, subscibe to interfaces coming and going */ + /* First, subscribe to interfaces coming and going */ r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR); if (r < 0) return r; @@ -245,7 +263,7 @@ static int manager_network_monitor_listen(Manager *m) { return 0; } -int manager_new(Manager **ret, char **interfaces) { +int manager_new(Manager **ret, char **interfaces, char **ignore, usec_t timeout) { _cleanup_(manager_freep) Manager *m = NULL; int r; @@ -256,6 +274,7 @@ int manager_new(Manager **ret, char **interfaces) { return -ENOMEM; m->interfaces = interfaces; + m->ignore = ignore; r = sd_event_default(&m->event); if (r < 0) @@ -264,6 +283,16 @@ int manager_new(Manager **ret, char **interfaces) { sd_event_add_signal(m->event, NULL, SIGTERM, NULL, NULL); sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); + if (timeout > 0) { + usec_t usec; + + usec = now(clock_boottime_or_monotonic()) + timeout; + + r = sd_event_add_time(m->event, NULL, clock_boottime_or_monotonic(), usec, 0, NULL, INT_TO_PTR(-ETIMEDOUT)); + if (r < 0) + return r; + } + sd_event_set_watchdog(m->event, true); r = manager_network_monitor_listen(m); diff --git a/src/network/networkd-wait-online.c b/src/network/networkd-wait-online.c index 32a8d8530..f0ca6def8 100644 --- a/src/network/networkd-wait-online.c +++ b/src/network/networkd-wait-online.c @@ -28,7 +28,9 @@ #include "build.h" static bool arg_quiet = false; +static usec_t arg_timeout = 120 * USEC_PER_SEC; static char **arg_interfaces = NULL; +static char **arg_ignore = NULL; static void help(void) { printf("%s [OPTIONS...]\n\n" @@ -37,6 +39,8 @@ static void help(void) { " --version Print version string\n" " -q --quiet Do not show status information\n" " -i --interface=INTERFACE Block until at least these interfaces have appeared\n" + " --ignore=INTERFACE Don't take these interfaces into account\n" + " --timeout=SECS Maximum time to wait for network connectivity\n" , program_invocation_short_name); } @@ -44,6 +48,8 @@ static int parse_argv(int argc, char *argv[]) { enum { ARG_VERSION = 0x100, + ARG_IGNORE, + ARG_TIMEOUT, }; static const struct option options[] = { @@ -51,10 +57,12 @@ static int parse_argv(int argc, char *argv[]) { { "version", no_argument, NULL, ARG_VERSION }, { "quiet", no_argument, NULL, 'q' }, { "interface", required_argument, NULL, 'i' }, + { "ignore", required_argument, NULL, ARG_IGNORE }, + { "timeout", required_argument, NULL, ARG_TIMEOUT }, {} }; - int c; + int c, r; assert(argc >= 0); assert(argv); @@ -82,6 +90,19 @@ static int parse_argv(int argc, char *argv[]) { break; + case ARG_IGNORE: + if (strv_extend(&arg_ignore, optarg) < 0) + return log_oom(); + + break; + + case ARG_TIMEOUT: + r = parse_sec(optarg, &arg_timeout); + if (r < 0) + return r; + + break; + case '?': return -EINVAL; @@ -111,7 +132,7 @@ int main(int argc, char *argv[]) { assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0); - r = manager_new(&m, arg_interfaces); + r = manager_new(&m, arg_interfaces, arg_ignore, arg_timeout); if (r < 0) { log_error_errno(r, "Could not create manager: %m"); goto finish; @@ -133,7 +154,16 @@ int main(int argc, char *argv[]) { } finish: - sd_notify(false, "STATUS=All interfaces configured..."); + strv_free(arg_interfaces); + strv_free(arg_ignore); + + if (r >= 0) { + sd_notify(false, "STATUS=All interfaces configured..."); - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; + return EXIT_SUCCESS; + } else { + sd_notify(false, "STATUS=Failed waiting for network connectivity..."); + + return EXIT_FAILURE; + } } diff --git a/src/network/networkd-wait-online.h b/src/network/networkd-wait-online.h index c57f902e9..66b865cfe 100644 --- a/src/network/networkd-wait-online.h +++ b/src/network/networkd-wait-online.h @@ -28,11 +28,16 @@ #include "util.h" #include "hashmap.h" -typedef struct Manager { +typedef struct Manager Manager; + +#include "networkd-wait-online-link.h" + +struct Manager { Hashmap *links; Hashmap *links_by_name; char **interfaces; + char **ignore; sd_rtnl *rtnl; sd_event_source *rtnl_event_source; @@ -41,11 +46,12 @@ typedef struct Manager { sd_event_source *network_monitor_event_source; sd_event *event; -} Manager; +}; void manager_free(Manager *m); -int manager_new(Manager **ret, char **interfaces); +int manager_new(Manager **ret, char **interfaces, char **ignore, usec_t timeout); DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); bool manager_all_configured(Manager *m); +bool manager_ignore_link(Manager *m, Link *link); diff --git a/src/network/networkd.c b/src/network/networkd.c index 0b386d406..7319276c5 100644 --- a/src/network/networkd.c +++ b/src/network/networkd.c @@ -64,6 +64,12 @@ int main(int argc, char *argv[]) { if (r < 0) log_error_errno(r, "Could not create runtime directory 'leases': %m"); + r = mkdir_safe_label("/run/systemd/netif/lldp", 0755, uid, gid); + if (r < 0) + log_error("Could not create runtime directory 'lldp': %s", + strerror(-r)); + + r = drop_privileges(uid, gid, (1ULL << CAP_NET_ADMIN) | (1ULL << CAP_NET_BIND_SERVICE) | @@ -80,21 +86,9 @@ int main(int argc, char *argv[]) { goto out; } - r = manager_udev_listen(m); - if (r < 0) { - log_error_errno(r, "Could not connect to udev: %m"); - goto out; - } - - r = manager_rtnl_listen(m); - if (r < 0) { - log_error_errno(r, "Could not connect to rtnl: %m"); - goto out; - } - - r = manager_bus_listen(m); + r = manager_connect_bus(m); if (r < 0) { - log_error_errno(r, "Could not connect to system bus: %m"); + log_error_errno(r, "Could not connect to bus: %m"); goto out; } @@ -116,11 +110,13 @@ int main(int argc, char *argv[]) { goto out; } + log_info("Enumeration completed"); + sd_notify(false, "READY=1\n" "STATUS=Processing requests..."); - r = sd_event_loop(m->event); + r = manager_run(m); if (r < 0) { log_error_errno(r, "Event loop failed: %m"); goto out; diff --git a/src/network/networkd.h b/src/network/networkd.h index 4cdcd73c5..bdb2f20e2 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -32,6 +32,7 @@ #include "sd-icmp6-nd.h" #include "sd-dhcp6-client.h" #include "udev.h" +#include "sd-lldp.h" #include "rtnl-util.h" #include "hashmap.h" @@ -51,15 +52,17 @@ typedef struct Address Address; typedef struct Route Route; typedef struct Manager Manager; typedef struct AddressPool AddressPool; - -typedef enum DHCPSupport { - DHCP_SUPPORT_NONE, - DHCP_SUPPORT_BOTH, - DHCP_SUPPORT_V4, - DHCP_SUPPORT_V6, - _DHCP_SUPPORT_MAX, - _DHCP_SUPPORT_INVALID = -1, -} DHCPSupport; +typedef struct FdbEntry FdbEntry; + +typedef enum AddressFamilyBoolean { + /* This is a bitmask, though it usually doesn't feel that way! */ + ADDRESS_FAMILY_NO = 0, + ADDRESS_FAMILY_IPV4 = 1, + ADDRESS_FAMILY_IPV6 = 2, + ADDRESS_FAMILY_YES = 3, + _ADDRESS_FAMILY_BOOLEAN_MAX, + _ADDRESS_FAMILY_BOOLEAN_INVALID = -1, +} AddressFamilyBoolean; typedef enum LLMNRSupport { LLMNR_SUPPORT_NO, @@ -69,17 +72,38 @@ typedef enum LLMNRSupport { _LLMNR_SUPPORT_INVALID = -1, } LLMNRSupport; +typedef enum LinkOperationalState { + LINK_OPERSTATE_OFF, + LINK_OPERSTATE_NO_CARRIER, + LINK_OPERSTATE_DORMANT, + LINK_OPERSTATE_CARRIER, + LINK_OPERSTATE_DEGRADED, + LINK_OPERSTATE_ROUTABLE, + _LINK_OPERSTATE_MAX, + _LINK_OPERSTATE_INVALID = -1 +} LinkOperationalState; + +struct FdbEntry { + Network *network; + unsigned section; + + struct ether_addr *mac_addr; + uint16_t vlan_id; + + LIST_FIELDS(FdbEntry, static_fdb_entries); +}; + struct Network { Manager *manager; char *filename; + char *name; struct ether_addr *match_mac; - char *match_path; - char *match_driver; - char *match_type; - char *match_name; - char *dhcp_vendor_class_identifier; + char **match_path; + char **match_driver; + char **match_type; + char **match_name; Condition *match_host; Condition *match_virt; @@ -90,7 +114,8 @@ struct Network { NetDev *bridge; NetDev *bond; Hashmap *stacked_netdevs; - DHCPSupport dhcp; + AddressFamilyBoolean dhcp; + char *dhcp_vendor_class_identifier; bool dhcp_dns; bool dhcp_ntp; bool dhcp_mtu; @@ -101,21 +126,29 @@ struct Network { bool dhcp_critical; bool dhcp_routes; unsigned dhcp_route_metric; - bool ipv4ll; + AddressFamilyBoolean link_local; bool ipv4ll_route; + union in_addr_union ipv6_token; bool dhcp_server; unsigned cost; + AddressFamilyBoolean ip_forward; + bool ip_masquerade; + struct ether_addr *mac; unsigned mtu; + bool lldp; + LIST_HEAD(Address, static_addresses); LIST_HEAD(Route, static_routes); + LIST_HEAD(FdbEntry, static_fdb_entries); Hashmap *addresses_by_section; Hashmap *routes_by_section; + Hashmap *fdb_entries_by_section; bool wildcard_domain; char **domains, **dns, **ntp; @@ -141,6 +174,8 @@ struct Address { union in_addr_union in_addr; union in_addr_union in_addr_peer; + bool ip_masquerade_done; + LIST_FIELDS(Address, addresses); }; @@ -177,15 +212,21 @@ struct AddressPool { struct Manager { sd_rtnl *rtnl; sd_event *event; + sd_event_source *bus_retry_event_source; sd_bus *bus; + sd_bus_slot *prepare_for_sleep_slot; struct udev *udev; struct udev_monitor *udev_monitor; sd_event_source *udev_event_source; + bool enumerating; + char *state_file; + LinkOperationalState operational_state; Hashmap *links; Hashmap *netdevs; + Hashmap *networks_by_name; LIST_HEAD(Network, networks); LIST_HEAD(AddressPool, address_pools); @@ -196,19 +237,21 @@ extern const char* const network_dirs[]; /* Manager */ +extern const sd_bus_vtable manager_vtable[]; + int manager_new(Manager **ret); void manager_free(Manager *m); +int manager_connect_bus(Manager *m); +int manager_run(Manager *m); + int manager_load_config(Manager *m); bool manager_should_reload(Manager *m); int manager_rtnl_enumerate_links(Manager *m); int manager_rtnl_enumerate_addresses(Manager *m); -int manager_rtnl_listen(Manager *m); -int manager_udev_listen(Manager *m); -int manager_bus_listen(Manager *m); - +int manager_send_changed(Manager *m, const char *property, ...) _sentinel_; int manager_save(Manager *m); int manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found); @@ -225,6 +268,7 @@ void network_free(Network *network); DEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free); #define _cleanup_network_free_ _cleanup_(network_freep) +int network_get_by_name(Manager *manager, const char *name, Network **ret); int network_get(Manager *manager, struct udev_device *device, const char *ifname, const struct ether_addr *mac, Network **ret); @@ -278,6 +322,11 @@ int config_parse_vxlan_group_address(const char *unit, void *data, void *userdata); +extern const sd_bus_vtable network_vtable[]; + +int network_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); +int network_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); + /* gperf */ const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length); @@ -303,6 +352,10 @@ int config_parse_destination(const char *unit, const char *filename, unsigned li int config_parse_route_priority(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 config_parse_route_scope(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); /* Address */ int address_new_static(Network *network, unsigned section, Address **ret); int address_new_dynamic(Address **ret); @@ -310,6 +363,8 @@ void address_free(Address *address); int address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback); int address_update(Address *address, Link *link, sd_rtnl_message_handler_t callback); int address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback); +int address_establish(Address *address, Link *link); +int address_release(Address *address, Link *link); bool address_equal(Address *a1, Address *a2); DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free); @@ -327,15 +382,39 @@ int config_parse_label(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); -/* DHCP support */ +/* Forwarding database table. */ +int fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry); +void fdb_entry_free(FdbEntry *fdb_entry); +int fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret); + +DEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free); +#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep) + +int config_parse_fdb_hwaddr(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 config_parse_fdb_vlan_id(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); -const char* dhcp_support_to_string(DHCPSupport i) _const_; -DHCPSupport dhcp_support_from_string(const char *s) _pure_; +/* DHCP support */ int config_parse_dhcp(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); +/* IPv4LL support (legacy) */ + +int config_parse_ipv4ll(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); + +/* IPv6 support */ +int config_parse_ipv6token(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); + /* LLMNR support */ const char* llmnr_support_to_string(LLMNRSupport i) _const_; @@ -352,3 +431,13 @@ int address_pool_new_from_string(Manager *m, AddressPool **ret, int family, cons void address_pool_free(AddressPool *p); int address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found); + +const char *address_family_boolean_to_string(AddressFamilyBoolean b) _const_; +AddressFamilyBoolean address_family_boolean_from_string(const char *s) _const_; + +int config_parse_address_family_boolean(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); + +/* Opeartional State */ + +const char* link_operstate_to_string(LinkOperationalState s) _const_; +LinkOperationalState link_operstate_from_string(const char *s) _pure_; diff --git a/src/network/org.freedesktop.network1.conf b/src/network/org.freedesktop.network1.conf new file mode 100644 index 000000000..52dad3366 --- /dev/null +++ b/src/network/org.freedesktop.network1.conf @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/network/org.freedesktop.network1.service b/src/network/org.freedesktop.network1.service new file mode 100644 index 000000000..bea885fe5 --- /dev/null +++ b/src/network/org.freedesktop.network1.service @@ -0,0 +1,12 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# 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. + +[D-BUS Service] +Name=org.freedesktop.network1 +Exec=/bin/false +User=root +SystemdService=dbus-org.freedesktop.network1.service diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c index 4d55434f0..6709ab095 100644 --- a/src/network/test-network-tables.c +++ b/src/network/test-network-tables.c @@ -13,7 +13,7 @@ int main(int argc, char **argv) { test_table(bond_mode, NETDEV_BOND_MODE); /* test_table(link_state, LINK_STATE); -- not a reversible mapping */ test_table(link_operstate, LINK_OPERSTATE); - test_table(dhcp_support, DHCP_SUPPORT); + test_table(address_family_boolean, ADDRESS_FAMILY_BOOLEAN); test_table(netdev_kind, NETDEV_KIND); test_table(dhcp6_message_status, DHCP6_STATUS); test_table(duplex, DUP); @@ -21,6 +21,7 @@ int main(int argc, char **argv) { test_table(nl_union_link_info_data, NL_UNION_LINK_INFO_DATA); test_table_sparse(macvlan_mode, NETDEV_MACVLAN_MODE); + test_table_sparse(ipvlan_mode, NETDEV_IPVLAN_MODE); test_table_sparse(dhcp6_message_type, DHCP6_MESSAGE); return EXIT_SUCCESS; diff --git a/src/network/test-network.c b/src/network/test-network.c index ea9f93864..5909cc790 100644 --- a/src/network/test-network.c +++ b/src/network/test-network.c @@ -158,10 +158,9 @@ static void test_address_equality(void) { assert_se(address_equal(a1, a2)); assert_se(inet_pton(AF_INET, "192.168.3.9", &a1->in_addr.in)); - assert_se(!address_equal(a1, a2)); + assert_se(address_equal(a1, a2)); assert_se(inet_pton(AF_INET, "192.168.3.9", &a2->in_addr.in)); assert_se(address_equal(a1, a2)); - a1->prefixlen = 10; assert_se(!address_equal(a1, a2)); a2->prefixlen = 10; @@ -210,8 +209,6 @@ int main(void) { test_network_get(manager, loopback); - assert_se(manager_udev_listen(manager) >= 0); - assert_se(manager_rtnl_listen(manager) >= 0); assert_se(manager_rtnl_enumerate_links(manager) >= 0); udev_device_unref(loopback); diff --git a/src/notify/notify.c b/src/notify/notify.c index 5bf901ec6..f98075d51 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -42,12 +42,12 @@ static bool arg_booted = false; static void help(void) { printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n\n" "Notify the init system about service status updates.\n\n" - " -h --help Show this help\n" - " --version Show package version\n" - " --ready Inform the init system about service start-up completion\n" - " --pid[=PID] Set main pid of daemon\n" - " --status=TEXT Set status text\n" - " --booted Returns 0 if the system was booted up with systemd, non-zero otherwise\n", + " -h --help Show this help\n" + " --version Show package version\n" + " --ready Inform the init system about service start-up completion\n" + " --pid[=PID] Set main pid of daemon\n" + " --status=TEXT Set status text\n" + " --booted Check if the system was booted up with systemd\n", program_invocation_short_name); } diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 0466ddbff..fb672510b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,8 @@ #include #include #include +#include +#include #ifdef HAVE_SELINUX #include @@ -90,12 +91,26 @@ #include "base-filesystem.h" #include "barrier.h" #include "event-util.h" +#include "capability.h" #include "cap-list.h" +#include "btrfs-util.h" +#include "machine-image.h" +#include "list.h" +#include "in-addr-util.h" +#include "fw-util.h" +#include "local-addresses.h" #ifdef HAVE_SECCOMP #include "seccomp-util.h" #endif +typedef struct ExposePort { + int protocol; + uint16_t host_port; + uint16_t container_port; + LIST_FIELDS(struct ExposePort, ports); +} ExposePort; + typedef enum ContainerStatus { CONTAINER_TERMINATED, CONTAINER_REBOOTED @@ -115,6 +130,7 @@ typedef enum Volatile { } Volatile; static char *arg_directory = NULL; +static char *arg_template = NULL; static char *arg_user = NULL; static sd_id128_t arg_uuid = {}; static char *arg_machine = NULL; @@ -124,6 +140,7 @@ static const char *arg_slice = NULL; static bool arg_private_network = false; static bool arg_read_only = false; static bool arg_boot = false; +static bool arg_ephemeral = false; static LinkJournal arg_link_journal = LINK_AUTO; static bool arg_link_journal_try = false; static uint64_t arg_retain = @@ -163,11 +180,13 @@ static bool arg_register = true; static bool arg_keep_unit = false; static char **arg_network_interfaces = NULL; static char **arg_network_macvlan = NULL; +static char **arg_network_ipvlan = NULL; static bool arg_network_veth = false; static const char *arg_network_bridge = NULL; static unsigned long arg_personality = 0xffffffffLU; -static const char *arg_image = NULL; +static char *arg_image = NULL; static Volatile arg_volatile = VOLATILE_NO; +static ExposePort *arg_expose_ports = NULL; static void help(void) { printf("%s [OPTIONS...] [PATH] [ARGUMENTS...]\n\n" @@ -176,7 +195,11 @@ static void help(void) { " --version Print version string\n" " -q --quiet Do not show status information\n" " -D --directory=PATH Root directory for the container\n" - " -i --image=PATH File system device or image for the container\n" + " --template=PATH Initialize root directory from template directory,\n" + " if missing\n" + " -x --ephemeral Run container with snapshot of root directory, and\n" + " remove it after exit\n" + " -i --image=PATH File system device or disk image for the container\n" " -b --boot Boot up full system (i.e. invoke init)\n" " -u --user=USER Run the command under specified user or uid\n" " -M --machine=NAME Set the machine name for the container\n" @@ -189,12 +212,17 @@ static void help(void) { " --network-macvlan=INTERFACE\n" " Create a macvlan network interface based on an\n" " existing network interface to the container\n" - " --network-veth Add a virtual ethernet connection between host\n" + " --network-ipvlan=INTERFACE\n" + " Create a ipvlan network interface based on an\n" + " existing network interface to the container\n" + " -n --network-veth Add a virtual ethernet connection between host\n" " and container\n" " --network-bridge=INTERFACE\n" " Add a virtual ethernet connection between host\n" " and container and add it to an existing bridge on\n" " the host\n" + " -p --port=[PROTOCOL:]HOSTPORT[:CONTAINERPORT]\n" + " Expose a container IP port on the host\n" " -Z --selinux-context=SECLABEL\n" " Set the SELinux security context to be used by\n" " processes in the container\n" @@ -217,8 +245,29 @@ static void help(void) { " --register=BOOLEAN Register container as machine\n" " --keep-unit Do not register a scope for the machine, reuse\n" " the service unit nspawn is running in\n" - " --volatile[=MODE] Run the system in volatile mode\n", - program_invocation_short_name); + " --volatile[=MODE] Run the system in volatile mode\n" + , program_invocation_short_name); +} + +static int set_sanitized_path(char **b, const char *path) { + char *p; + + assert(b); + assert(path); + + p = canonicalize_file_name(path); + if (!p) { + if (errno != ENOENT) + return -errno; + + p = path_make_absolute_cwd(path); + if (!p) + return -ENOMEM; + } + + free(*b); + *b = path_kill_slashes(p); + return 0; } static int parse_argv(int argc, char *argv[]) { @@ -240,16 +289,19 @@ static int parse_argv(int argc, char *argv[]) { ARG_KEEP_UNIT, ARG_NETWORK_INTERFACE, ARG_NETWORK_MACVLAN, - ARG_NETWORK_VETH, + ARG_NETWORK_IPVLAN, ARG_NETWORK_BRIDGE, ARG_PERSONALITY, ARG_VOLATILE, + ARG_TEMPLATE, }; static const struct option options[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, ARG_VERSION }, { "directory", required_argument, NULL, 'D' }, + { "template", required_argument, NULL, ARG_TEMPLATE }, + { "ephemeral", no_argument, NULL, 'x' }, { "user", required_argument, NULL, 'u' }, { "private-network", no_argument, NULL, ARG_PRIVATE_NETWORK }, { "boot", no_argument, NULL, 'b' }, @@ -272,11 +324,13 @@ static int parse_argv(int argc, char *argv[]) { { "keep-unit", no_argument, NULL, ARG_KEEP_UNIT }, { "network-interface", required_argument, NULL, ARG_NETWORK_INTERFACE }, { "network-macvlan", required_argument, NULL, ARG_NETWORK_MACVLAN }, - { "network-veth", no_argument, NULL, ARG_NETWORK_VETH }, + { "network-ipvlan", required_argument, NULL, ARG_NETWORK_IPVLAN }, + { "network-veth", no_argument, NULL, 'n' }, { "network-bridge", required_argument, NULL, ARG_NETWORK_BRIDGE }, { "personality", required_argument, NULL, ARG_PERSONALITY }, { "image", required_argument, NULL, 'i' }, { "volatile", optional_argument, NULL, ARG_VOLATILE }, + { "port", required_argument, NULL, 'p' }, {} }; @@ -286,7 +340,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "+hD:u:bL:M:jS:Z:qi:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "+hD:u:bL:M:jS:Z:qi:xp:n", options, NULL)) >= 0) switch (c) { @@ -300,17 +354,28 @@ static int parse_argv(int argc, char *argv[]) { return 0; case 'D': - free(arg_directory); - arg_directory = canonicalize_file_name(optarg); - if (!arg_directory) { - log_error_errno(errno, "Invalid root directory: %m"); - return -ENOMEM; - } + r = set_sanitized_path(&arg_directory, optarg); + if (r < 0) + return log_error_errno(r, "Invalid root directory: %m"); + + break; + + case ARG_TEMPLATE: + r = set_sanitized_path(&arg_template, optarg); + if (r < 0) + return log_error_errno(r, "Invalid template directory: %m"); break; case 'i': - arg_image = optarg; + r = set_sanitized_path(&arg_image, optarg); + if (r < 0) + return log_error_errno(r, "Invalid image path: %m"); + + break; + + case 'x': + arg_ephemeral = true; break; case 'u': @@ -326,7 +391,7 @@ static int parse_argv(int argc, char *argv[]) { /* fall through */ - case ARG_NETWORK_VETH: + case 'n': arg_network_veth = true; arg_private_network = true; break; @@ -342,6 +407,13 @@ static int parse_argv(int argc, char *argv[]) { if (strv_extend(&arg_network_macvlan, optarg) < 0) return log_oom(); + arg_private_network = true; + break; + + case ARG_NETWORK_IPVLAN: + if (strv_extend(&arg_network_ipvlan, optarg) < 0) + return log_oom(); + /* fall through */ case ARG_PRIVATE_NETWORK: @@ -369,15 +441,13 @@ static int parse_argv(int argc, char *argv[]) { free(arg_machine); arg_machine = NULL; } else { - - if (!hostname_is_valid(optarg)) { + if (!machine_name_is_valid(optarg)) { log_error("Invalid machine name: %s", optarg); return -EINVAL; } - free(arg_machine); - arg_machine = strdup(optarg); - if (!arg_machine) + r = free_and_strdup(&arg_machine, optarg); + if (r < 0) return log_oom(); break; @@ -437,15 +507,19 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_LINK_JOURNAL: - if (streq(optarg, "auto")) + if (streq(optarg, "auto")) { arg_link_journal = LINK_AUTO; - else if (streq(optarg, "no")) + arg_link_journal_try = false; + } else if (streq(optarg, "no")) { arg_link_journal = LINK_NO; - else if (streq(optarg, "guest")) + arg_link_journal_try = false; + } else if (streq(optarg, "guest")) { arg_link_journal = LINK_GUEST; - else if (streq(optarg, "host")) + arg_link_journal_try = false; + } else if (streq(optarg, "host")) { arg_link_journal = LINK_HOST; - else if (streq(optarg, "try-guest")) { + arg_link_journal_try = false; + } else if (streq(optarg, "try-guest")) { arg_link_journal = LINK_GUEST; arg_link_journal_try = true; } else if (streq(optarg, "try-host")) { @@ -598,6 +672,65 @@ static int parse_argv(int argc, char *argv[]) { break; + case 'p': { + const char *split, *e; + uint16_t container_port, host_port; + int protocol; + ExposePort *p; + + if ((e = startswith(optarg, "tcp:"))) + protocol = IPPROTO_TCP; + else if ((e = startswith(optarg, "udp:"))) + protocol = IPPROTO_UDP; + else { + e = optarg; + protocol = IPPROTO_TCP; + } + + split = strchr(e, ':'); + if (split) { + char v[split - e + 1]; + + memcpy(v, e, split - e); + v[split - e] = 0; + + r = safe_atou16(v, &host_port); + if (r < 0 || host_port <= 0) { + log_error("Failed to parse host port: %s", optarg); + return -EINVAL; + } + + r = safe_atou16(split + 1, &container_port); + } else { + r = safe_atou16(e, &container_port); + host_port = container_port; + } + + if (r < 0 || container_port <= 0) { + log_error("Failed to parse host port: %s", optarg); + return -EINVAL; + } + + LIST_FOREACH(ports, p, arg_expose_ports) { + if (p->protocol == protocol && p->host_port == host_port) { + log_error("Duplicate port specification: %s", optarg); + return -EINVAL; + } + } + + p = new(ExposePort, 1); + if (!p) + return log_oom(); + + p->protocol = protocol; + p->host_port = host_port; + p->container_port = container_port; + + LIST_PREPEND(ports, arg_expose_ports, p); + + break; + } + case '?': return -EINVAL; @@ -623,11 +756,41 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; } + if (arg_template && arg_image) { + log_error("--template= and --image= may not be combined."); + return -EINVAL; + } + + if (arg_template && !(arg_directory || arg_machine)) { + log_error("--template= needs --directory= or --machine=."); + return -EINVAL; + } + + if (arg_ephemeral && arg_template) { + log_error("--ephemeral and --template= may not be combined."); + return -EINVAL; + } + + if (arg_ephemeral && arg_image) { + log_error("--ephemeral and --image= may not be combined."); + return -EINVAL; + } + + if (arg_ephemeral && !IN_SET(arg_link_journal, LINK_NO, LINK_AUTO)) { + log_error("--ephemeral and --link-journal= may not be combined."); + return -EINVAL; + } + if (arg_volatile != VOLATILE_NO && arg_read_only) { log_error("Cannot combine --read-only with --volatile. Note that --volatile already implies a read-only base hierarchy."); return -EINVAL; } + if (arg_expose_ports && !arg_private_network) { + log_error("Cannot use --port= without private networking."); + return -EINVAL; + } + arg_retain = (arg_retain | plus | (arg_private_network ? 1ULL << CAP_NET_ADMIN : 0)) & ~minus; return 1; @@ -653,6 +816,7 @@ static int mount_all(const char *dest) { { "devpts", "/dev/pts", "devpts","newinstance,ptmxmode=0666,mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, true }, { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true }, { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true }, + { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, true }, #ifdef HAVE_SELINUX { "/sys/fs/selinux", "/sys/fs/selinux", NULL, NULL, MS_BIND, false }, /* Bind mount first */ { NULL, "/sys/fs/selinux", NULL, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, false }, /* Then, make it r/o */ @@ -750,8 +914,12 @@ static int mount_binds(const char *dest, char **l, bool ro) { r = stat(where, &dest_st); if (r == 0) { - if ((source_st.st_mode & S_IFMT) != (dest_st.st_mode & S_IFMT)) { - log_error("The file types of %s and %s do not match. Refusing bind mount", *x, where); + if (S_ISDIR(source_st.st_mode) && !S_ISDIR(dest_st.st_mode)) { + log_error("Cannot bind mount directory %s on file %s.", *x, where); + return -EINVAL; + } + if (!S_ISDIR(source_st.st_mode) && S_ISDIR(dest_st.st_mode)) { + log_error("Cannot bind mount file %s on directory %s.", *x, where); return -EINVAL; } } else if (errno == ENOENT) { @@ -763,27 +931,18 @@ static int mount_binds(const char *dest, char **l, bool ro) { return -errno; } - /* Create the mount point, but be conservative -- refuse to create block - * and char devices. */ + /* Create the mount point. Any non-directory file can be + * mounted on any non-directory file (regular, fifo, socket, + * char, block). + */ if (S_ISDIR(source_st.st_mode)) { r = mkdir_label(where, 0755); if (r < 0 && errno != EEXIST) return log_error_errno(r, "Failed to create mount point %s: %m", where); - } else if (S_ISFIFO(source_st.st_mode)) { - r = mkfifo(where, 0644); - if (r < 0 && errno != EEXIST) - return log_error_errno(errno, "Failed to create mount point %s: %m", where); - } else if (S_ISSOCK(source_st.st_mode)) { - r = mknod(where, 0644 | S_IFSOCK, 0); - if (r < 0 && errno != EEXIST) - return log_error_errno(errno, "Failed to create mount point %s: %m", where); - } else if (S_ISREG(source_st.st_mode)) { + } else { r = touch(where); if (r < 0) return log_error_errno(r, "Failed to create mount point %s: %m", where); - } else { - log_error("Refusing to create mountpoint for file: %s", *x); - return -ENOTSUP; } if (mount(*x, where, "bind", MS_BIND, NULL) < 0) @@ -799,6 +958,120 @@ static int mount_binds(const char *dest, char **l, bool ro) { return 0; } +static int mount_cgroup_hierarchy(const char *dest, const char *controller, const char *hierarchy, bool read_only) { + char *to; + int r; + + to = strjoina(dest, "/sys/fs/cgroup/", hierarchy); + + r = path_is_mount_point(to, false); + if (r < 0) + return log_error_errno(r, "Failed to determine if %s is mounted already: %m", to); + if (r > 0) + return 0; + + mkdir_p(to, 0755); + + /* The superblock mount options of the mount point need to be + * identical to the hosts', and hence writable... */ + if (mount("cgroup", to, "cgroup", MS_NOSUID|MS_NOEXEC|MS_NODEV, controller) < 0) + return log_error_errno(errno, "Failed to mount to %s: %m", to); + + /* ... hence let's only make the bind mount read-only, not the + * superblock. */ + if (read_only) { + if (mount(NULL, to, NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, NULL) < 0) + return log_error_errno(errno, "Failed to remount %s read-only: %m", to); + } + return 1; +} + +static int mount_cgroup(const char *dest) { + _cleanup_set_free_free_ Set *controllers = NULL; + _cleanup_free_ char *own_cgroup_path = NULL; + const char *cgroup_root, *systemd_root, *systemd_own; + int r; + + controllers = set_new(&string_hash_ops); + if (!controllers) + return log_oom(); + + r = cg_kernel_controllers(controllers); + if (r < 0) + return log_error_errno(r, "Failed to determine cgroup controllers: %m"); + + r = cg_pid_get_path(NULL, 0, &own_cgroup_path); + if (r < 0) + return log_error_errno(r, "Failed to determine our own cgroup path: %m"); + + cgroup_root = strjoina(dest, "/sys/fs/cgroup"); + if (mount("tmpfs", cgroup_root, "tmpfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME, "mode=755") < 0) + return log_error_errno(errno, "Failed to mount tmpfs to /sys/fs/cgroup: %m"); + + for (;;) { + _cleanup_free_ char *controller = NULL, *origin = NULL, *combined = NULL; + + controller = set_steal_first(controllers); + if (!controller) + break; + + origin = strappend("/sys/fs/cgroup/", controller); + if (!origin) + return log_oom(); + + r = readlink_malloc(origin, &combined); + if (r == -EINVAL) { + /* Not a symbolic link, but directly a single cgroup hierarchy */ + + r = mount_cgroup_hierarchy(dest, controller, controller, true); + if (r < 0) + return r; + + } else if (r < 0) + return log_error_errno(r, "Failed to read link %s: %m", origin); + else { + _cleanup_free_ char *target = NULL; + + target = strjoin(dest, "/sys/fs/cgroup/", controller, NULL); + if (!target) + return log_oom(); + + /* A symbolic link, a combination of controllers in one hierarchy */ + + if (!filename_is_valid(combined)) { + log_warning("Ignoring invalid combined hierarchy %s.", combined); + continue; + } + + r = mount_cgroup_hierarchy(dest, combined, combined, true); + if (r < 0) + return r; + + if (symlink(combined, target) < 0) + return log_error_errno(errno, "Failed to create symlink for combined hierarchy: %m"); + } + } + + r = mount_cgroup_hierarchy(dest, "name=systemd,xattr", "systemd", false); + if (r < 0) + return r; + + /* Make our own cgroup a (writable) bind mount */ + systemd_own = strjoina(dest, "/sys/fs/cgroup/systemd", own_cgroup_path); + if (mount(systemd_own, systemd_own, NULL, MS_BIND, NULL) < 0) + return log_error_errno(errno, "Failed to turn %s into a bind mount: %m", own_cgroup_path); + + /* And then remount the systemd cgroup root read-only */ + systemd_root = strjoina(dest, "/sys/fs/cgroup/systemd"); + if (mount(NULL, systemd_root, NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, NULL) < 0) + return log_error_errno(errno, "Failed to mount cgroup root read-only: %m"); + + if (mount(NULL, cgroup_root, NULL, MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME|MS_RDONLY, "mode=755") < 0) + return log_error_errno(errno, "Failed to remount %s read-only: %m", cgroup_root); + + return 0; +} + static int mount_tmpfs(const char *dest) { char **i, **o; @@ -916,7 +1189,7 @@ static int setup_resolv_conf(const char *dest) { return 0; } - r = copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW, 0644); + r = copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW, 0644, 0); if (r < 0) { log_warning_errno(r, "Failed to copy /etc/resolv.conf to %s: %m", where); @@ -942,7 +1215,7 @@ static int setup_volatile_state(const char *directory) { if (r < 0) return log_error_errno(r, "Failed to remount %s read-only: %m", directory); - p = strappenda(directory, "/var"); + p = strjoina(directory, "/var"); r = mkdir(p, 0755); if (r < 0 && errno != EEXIST) return log_error_errno(errno, "Failed to create %s: %m", directory); @@ -978,8 +1251,8 @@ static int setup_volatile(const char *directory) { tmpfs_mounted = true; - f = strappenda(directory, "/usr"); - t = strappenda(template, "/usr"); + f = strjoina(directory, "/usr"); + t = strjoina(template, "/usr"); r = mkdir(t, 0755); if (r < 0 && errno != EEXIST) { @@ -1115,7 +1388,7 @@ static int copy_devnodes(const char *dest) { } if (mknod(to, st.st_mode, st.st_rdev) < 0) - return log_error_errno(errno, "mknod(%s) failed: %m", dest); + return log_error_errno(errno, "mknod(%s) failed: %m", to); } } @@ -1161,7 +1434,7 @@ static int setup_dev_console(const char *dest, const char *console) { * /dev/console. (Note that the major minor doesn't actually * matter here, since we mount it over anyway). */ - to = strappenda(dest, "/dev/console"); + to = strjoina(dest, "/dev/console"); if (mknod(to, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) return log_error_errno(errno, "mknod() for /dev/console failed: %m"); @@ -1173,8 +1446,8 @@ static int setup_dev_console(const char *dest, const char *console) { static int setup_kmsg(const char *dest, int kmsg_socket) { _cleanup_free_ char *from = NULL, *to = NULL; - int r, fd, k; _cleanup_umask_ mode_t u; + int r, fd, k; union { struct cmsghdr cmsghdr; uint8_t buf[CMSG_SPACE(sizeof(int))]; @@ -1225,7 +1498,7 @@ static int setup_kmsg(const char *dest, int kmsg_socket) { /* Store away the fd in the socket, so that it stays open as * long as we run the child */ - k = sendmsg(kmsg_socket, &mh, MSG_DONTWAIT|MSG_NOSIGNAL); + k = sendmsg(kmsg_socket, &mh, MSG_NOSIGNAL); safe_close(fd); if (k < 0) @@ -1236,6 +1509,198 @@ static int setup_kmsg(const char *dest, int kmsg_socket) { return 0; } +static int send_rtnl(int send_fd) { + union { + struct cmsghdr cmsghdr; + uint8_t buf[CMSG_SPACE(sizeof(int))]; + } control = {}; + struct msghdr mh = { + .msg_control = &control, + .msg_controllen = sizeof(control), + }; + struct cmsghdr *cmsg; + _cleanup_close_ int fd = -1; + ssize_t k; + + assert(send_fd >= 0); + + if (!arg_expose_ports) + return 0; + + fd = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_ROUTE); + if (fd < 0) + return log_error_errno(errno, "failed to allocate container netlink: %m"); + + cmsg = CMSG_FIRSTHDR(&mh); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cmsg), &fd, sizeof(int)); + + mh.msg_controllen = cmsg->cmsg_len; + + /* Store away the fd in the socket, so that it stays open as + * long as we run the child */ + k = sendmsg(send_fd, &mh, MSG_NOSIGNAL); + if (k < 0) + return log_error_errno(errno, "Failed to send netlink fd: %m"); + + return 0; +} + +static int flush_ports(union in_addr_union *exposed) { + ExposePort *p; + int r, af = AF_INET; + + assert(exposed); + + if (!arg_expose_ports) + return 0; + + if (in_addr_is_null(af, exposed)) + return 0; + + log_debug("Lost IP address."); + + LIST_FOREACH(ports, p, arg_expose_ports) { + r = fw_add_local_dnat(false, + af, + p->protocol, + NULL, + NULL, 0, + NULL, 0, + p->host_port, + exposed, + p->container_port, + NULL); + if (r < 0) + log_warning_errno(r, "Failed to modify firewall: %m"); + } + + *exposed = IN_ADDR_NULL; + return 0; +} + +static int expose_ports(sd_rtnl *rtnl, union in_addr_union *exposed) { + _cleanup_free_ struct local_address *addresses = NULL; + _cleanup_free_ char *pretty = NULL; + union in_addr_union new_exposed; + ExposePort *p; + bool add; + int af = AF_INET, r; + + assert(exposed); + + /* Invoked each time an address is added or removed inside the + * container */ + + if (!arg_expose_ports) + return 0; + + r = local_addresses(rtnl, 0, af, &addresses); + if (r < 0) + return log_error_errno(r, "Failed to enumerate local addresses: %m"); + + add = r > 0 && + addresses[0].family == af && + addresses[0].scope < RT_SCOPE_LINK; + + if (!add) + return flush_ports(exposed); + + new_exposed = addresses[0].address; + if (in_addr_equal(af, exposed, &new_exposed)) + return 0; + + in_addr_to_string(af, &new_exposed, &pretty); + log_debug("New container IP is %s.", strna(pretty)); + + LIST_FOREACH(ports, p, arg_expose_ports) { + + r = fw_add_local_dnat(true, + af, + p->protocol, + NULL, + NULL, 0, + NULL, 0, + p->host_port, + &new_exposed, + p->container_port, + in_addr_is_null(af, exposed) ? NULL : exposed); + if (r < 0) + log_warning_errno(r, "Failed to modify firewall: %m"); + } + + *exposed = new_exposed; + return 0; +} + +static int on_address_change(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) { + union in_addr_union *exposed = userdata; + + assert(rtnl); + assert(m); + assert(exposed); + + expose_ports(rtnl, exposed); + return 0; +} + +static int watch_rtnl(sd_event *event, int recv_fd, union in_addr_union *exposed, sd_rtnl **ret) { + union { + struct cmsghdr cmsghdr; + uint8_t buf[CMSG_SPACE(sizeof(int))]; + } control = {}; + struct msghdr mh = { + .msg_control = &control, + .msg_controllen = sizeof(control), + }; + struct cmsghdr *cmsg; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + int fd, r; + ssize_t k; + + assert(event); + assert(recv_fd >= 0); + assert(ret); + + if (!arg_expose_ports) + return 0; + + k = recvmsg(recv_fd, &mh, MSG_NOSIGNAL); + if (k < 0) + return log_error_errno(errno, "Failed to recv netlink fd: %m"); + + cmsg = CMSG_FIRSTHDR(&mh); + assert(cmsg->cmsg_level == SOL_SOCKET); + assert(cmsg->cmsg_type == SCM_RIGHTS); + assert(cmsg->cmsg_len == CMSG_LEN(sizeof(int))); + memcpy(&fd, CMSG_DATA(cmsg), sizeof(int)); + + r = sd_rtnl_open_fd(&rtnl, fd, 1, RTNLGRP_IPV4_IFADDR); + if (r < 0) { + safe_close(fd); + return log_error_errno(r, "Failed to create rtnl object: %m"); + } + + r = sd_rtnl_add_match(rtnl, RTM_NEWADDR, on_address_change, exposed); + if (r < 0) + return log_error_errno(r, "Failed to subscribe to RTM_NEWADDR messages: %m"); + + r = sd_rtnl_add_match(rtnl, RTM_DELADDR, on_address_change, exposed); + if (r < 0) + return log_error_errno(r, "Failed to subscribe to RTM_DELADDR messages: %m"); + + r = sd_rtnl_attach_event(rtnl, event, 0); + if (r < 0) + return log_error_errno(r, "Failed to add to even loop: %m"); + + *ret = rtnl; + rtnl = NULL; + + return 0; +} + static int setup_hostname(void) { if (arg_share_system) @@ -1253,6 +1718,10 @@ static int setup_journal(const char *directory) { char *id; int r; + /* Don't link journals in ephemeral mode */ + if (arg_ephemeral) + return 0; + p = strappend(directory, "/etc/machine-id"); if (!p) return log_oom(); @@ -1281,8 +1750,7 @@ static int setup_journal(const char *directory) { "Host and machine ids are equal (%s): refusing to link journals", id); if (arg_link_journal == LINK_AUTO) return 0; - return - -EEXIST; + return -EEXIST; } if (arg_link_journal == LINK_NO) @@ -1930,24 +2398,108 @@ static int setup_macvlan(pid_t pid) { return 0; } -static int setup_seccomp(void) { +static int setup_ipvlan(pid_t pid) { + _cleanup_udev_unref_ struct udev *udev = NULL; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + char **i; + int r; -#ifdef HAVE_SECCOMP - static const int blacklist[] = { - SCMP_SYS(kexec_load), - SCMP_SYS(open_by_handle_at), - SCMP_SYS(init_module), - SCMP_SYS(finit_module), - SCMP_SYS(delete_module), - SCMP_SYS(iopl), - SCMP_SYS(ioperm), - SCMP_SYS(swapon), - SCMP_SYS(swapoff), - }; + if (!arg_private_network) + return 0; - scmp_filter_ctx seccomp; - unsigned i; - int r; + if (strv_isempty(arg_network_ipvlan)) + return 0; + + r = sd_rtnl_open(&rtnl, 0); + if (r < 0) + return log_error_errno(r, "Failed to connect to netlink: %m"); + + udev = udev_new(); + if (!udev) { + log_error("Failed to connect to udev."); + return -ENOMEM; + } + + STRV_FOREACH(i, arg_network_ipvlan) { + _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL; + _cleanup_free_ char *n = NULL; + int ifi; + + ifi = parse_interface(udev, *i); + if (ifi < 0) + return ifi; + + r = sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0); + if (r < 0) + return log_error_errno(r, "Failed to allocate netlink message: %m"); + + r = sd_rtnl_message_append_u32(m, IFLA_LINK, ifi); + if (r < 0) + return log_error_errno(r, "Failed to add netlink interface index: %m"); + + n = strappend("iv-", *i); + if (!n) + return log_oom(); + + strshorten(n, IFNAMSIZ-1); + + r = sd_rtnl_message_append_string(m, IFLA_IFNAME, n); + if (r < 0) + return log_error_errno(r, "Failed to add netlink interface name: %m"); + + r = sd_rtnl_message_append_u32(m, IFLA_NET_NS_PID, pid); + if (r < 0) + return log_error_errno(r, "Failed to add netlink namespace field: %m"); + + r = sd_rtnl_message_open_container(m, IFLA_LINKINFO); + if (r < 0) + return log_error_errno(r, "Failed to open netlink container: %m"); + + r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "ipvlan"); + if (r < 0) + return log_error_errno(r, "Failed to open netlink container: %m"); + + r = sd_rtnl_message_append_u16(m, IFLA_IPVLAN_MODE, IPVLAN_MODE_L2); + if (r < 0) + return log_error_errno(r, "Failed to add ipvlan mode: %m"); + + r = sd_rtnl_message_close_container(m); + if (r < 0) + return log_error_errno(r, "Failed to close netlink container: %m"); + + r = sd_rtnl_message_close_container(m); + if (r < 0) + return log_error_errno(r, "Failed to close netlink container: %m"); + + r = sd_rtnl_call(rtnl, m, 0, NULL); + if (r < 0) + return log_error_errno(r, "Failed to add new ipvlan interfaces: %m"); + } + + return 0; +} + +static int setup_seccomp(void) { + +#ifdef HAVE_SECCOMP + static const int blacklist[] = { + SCMP_SYS(kexec_load), + SCMP_SYS(open_by_handle_at), + SCMP_SYS(iopl), + SCMP_SYS(ioperm), + SCMP_SYS(swapon), + SCMP_SYS(swapoff), + }; + + static const int kmod_blacklist[] = { + SCMP_SYS(init_module), + SCMP_SYS(finit_module), + SCMP_SYS(delete_module), + }; + + scmp_filter_ctx seccomp; + unsigned i; + int r; seccomp = seccomp_init(SCMP_ACT_ALLOW); if (!seccomp) @@ -1969,6 +2521,20 @@ static int setup_seccomp(void) { } } + /* If the CAP_SYS_MODULE capability is not requested then + * we'll block the kmod syscalls too */ + if (!(arg_retain & (1ULL << CAP_SYS_MODULE))) { + for (i = 0; i < ELEMENTSOF(kmod_blacklist); i++) { + r = seccomp_rule_add(seccomp, SCMP_ACT_ERRNO(EPERM), kmod_blacklist[i], 0); + if (r == -EFAULT) + continue; /* unknown syscall */ + if (r < 0) { + log_error_errno(r, "Failed to block syscall: %m"); + goto finish; + } + } + } + /* Audit is broken in containers, much of the userspace audit hookup will fail if running inside a container. We don't @@ -2010,6 +2576,27 @@ finish: } +static int setup_propagate(const char *root) { + const char *p, *q; + + (void) mkdir_p("/run/systemd/nspawn/", 0755); + (void) mkdir_p("/run/systemd/nspawn/propagate", 0600); + p = strjoina("/run/systemd/nspawn/propagate/", arg_machine); + (void) mkdir_p(p, 0600); + + q = strjoina(root, "/run/systemd/nspawn/incoming"); + mkdir_parents(q, 0755); + mkdir_p(q, 0600); + + if (mount(p, q, NULL, MS_BIND, NULL) < 0) + return log_error_errno(errno, "Failed to install propagation bind mount."); + + if (mount(NULL, q, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) + return log_error_errno(errno, "Failed to make propagation mount read-only"); + + return 0; +} + static int setup_image(char **device_path, int *loop_nr) { struct loop_info64 info = { .lo_flags = LO_FLAGS_AUTOCLEAR|LO_FLAGS_PARTSCAN @@ -2021,6 +2608,7 @@ static int setup_image(char **device_path, int *loop_nr) { assert(device_path); assert(loop_nr); + assert(arg_image); fd = open(arg_image, O_CLOEXEC|(arg_read_only ? O_RDONLY : O_RDWR)|O_NONBLOCK|O_NOCTTY); if (fd < 0) @@ -2086,6 +2674,13 @@ static int setup_image(char **device_path, int *loop_nr) { return r; } +#define PARTITION_TABLE_BLURB \ + "Note that the disk image needs to either contain only a single MBR partition of\n" \ + "type 0x83 that is marked bootable, or a sinlge GPT partition of type" \ + "0FC63DAF-8483-4772-8E79-3D69D8477DE4 or follow\n" \ + " http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/\n" \ + "to be bootable with systemd-nspawn." + static int dissect_image( int fd, char **root_device, bool *root_device_rw, @@ -2101,17 +2696,18 @@ static int dissect_image( #ifdef GPT_ROOT_SECONDARY int secondary_root_nr = -1; #endif - - _cleanup_free_ char *home = NULL, *root = NULL, *secondary_root = NULL, *srv = NULL; + _cleanup_free_ char *home = NULL, *root = NULL, *secondary_root = NULL, *srv = NULL, *generic = NULL; _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL; _cleanup_udev_device_unref_ struct udev_device *d = NULL; _cleanup_blkid_free_probe_ blkid_probe b = NULL; _cleanup_udev_unref_ struct udev *udev = NULL; struct udev_list_entry *first, *item; - bool home_rw = true, root_rw = true, secondary_root_rw = true, srv_rw = true; + bool home_rw = true, root_rw = true, secondary_root_rw = true, srv_rw = true, generic_rw = true; + bool is_gpt, is_mbr, multiple_generic = false; const char *pttype = NULL; blkid_partlist pl; struct stat st; + unsigned i; int r; assert(fd >= 0); @@ -2119,6 +2715,7 @@ static int dissect_image( assert(home_device); assert(srv_device); assert(secondary); + assert(arg_image); b = blkid_new_probe(); if (!b) @@ -2140,8 +2737,9 @@ static int dissect_image( errno = 0; r = blkid_do_safeprobe(b); if (r == -2 || r == 1) { - log_error("Failed to identify any partition table on %s.\n" - "Note that the disk image needs to follow http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ to be supported by systemd-nspawn.", arg_image); + log_error("Failed to identify any partition table on\n" + " %s\n" + PARTITION_TABLE_BLURB, arg_image); return -EINVAL; } else if (r != 0) { if (errno == 0) @@ -2151,9 +2749,14 @@ static int dissect_image( } blkid_probe_lookup_value(b, "PTTYPE", &pttype, NULL); - if (!streq_ptr(pttype, "gpt")) { - log_error("Image %s does not carry a GUID Partition Table.\n" - "Note that the disk image needs to follow http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ to be supported by systemd-nspawn.", arg_image); + + is_gpt = streq_ptr(pttype, "gpt"); + is_mbr = streq_ptr(pttype, "dos"); + + if (!is_gpt && !is_mbr) { + log_error("No GPT or MBR partition table discovered on\n" + " %s\n" + PARTITION_TABLE_BLURB, arg_image); return -EINVAL; } @@ -2178,24 +2781,83 @@ static int dissect_image( if (!d) return log_oom(); - e = udev_enumerate_new(udev); - if (!e) - return log_oom(); + for (i = 0;; i++) { + int n, m; - r = udev_enumerate_add_match_parent(e, d); - if (r < 0) - return log_oom(); + if (i >= 10) { + log_error("Kernel partitions never appeared."); + return -ENXIO; + } - r = udev_enumerate_scan_devices(e); - if (r < 0) - return log_error_errno(r, "Failed to scan for partition devices of %s: %m", arg_image); + e = udev_enumerate_new(udev); + if (!e) + return log_oom(); + + r = udev_enumerate_add_match_parent(e, d); + if (r < 0) + return log_oom(); + + r = udev_enumerate_scan_devices(e); + if (r < 0) + return log_error_errno(r, "Failed to scan for partition devices of %s: %m", arg_image); + + /* Count the partitions enumerated by the kernel */ + n = 0; + first = udev_enumerate_get_list_entry(e); + udev_list_entry_foreach(item, first) + n++; + + /* Count the partitions enumerated by blkid */ + m = blkid_partlist_numof_partitions(pl); + if (n == m + 1) + break; + if (n > m + 1) { + log_error("blkid and kernel partition list do not match."); + return -EIO; + } + if (n < m + 1) { + unsigned j; + + /* The kernel has probed fewer partitions than + * blkid? Maybe the kernel prober is still + * running or it got EBUSY because udev + * already opened the device. Let's reprobe + * the device, which is a synchronous call + * that waits until probing is complete. */ + + for (j = 0; j < 20; j++) { + + r = ioctl(fd, BLKRRPART, 0); + if (r < 0) + r = -errno; + if (r >= 0 || r != -EBUSY) + break; + + /* If something else has the device + * open, such as an udev rule, the + * ioctl will return EBUSY. Since + * there's no way to wait until it + * isn't busy anymore, let's just wait + * a bit, and try again. + * + * This is really something they + * should fix in the kernel! */ + + usleep(50 * USEC_PER_MSEC); + } + + if (r < 0) + return log_error_errno(r, "Failed to reread partition table: %m"); + } + + e = udev_enumerate_unref(e); + } first = udev_enumerate_get_list_entry(e); udev_list_entry_foreach(item, first) { _cleanup_udev_device_unref_ struct udev_device *q; - const char *stype, *node; + const char *node; unsigned long long flags; - sd_id128_t type_id; blkid_partition pp; dev_t qn; int nr; @@ -2226,82 +2888,110 @@ static int dissect_image( continue; flags = blkid_partition_get_flags(pp); - if (flags & GPT_FLAG_NO_AUTO) - continue; nr = blkid_partition_get_partno(pp); if (nr < 0) continue; - stype = blkid_partition_get_type_string(pp); - if (!stype) - continue; + if (is_gpt) { + sd_id128_t type_id; + const char *stype; - if (sd_id128_from_string(stype, &type_id) < 0) - continue; + if (flags & GPT_FLAG_NO_AUTO) + continue; - if (sd_id128_equal(type_id, GPT_HOME)) { + stype = blkid_partition_get_type_string(pp); + if (!stype) + continue; - if (home && nr >= home_nr) + if (sd_id128_from_string(stype, &type_id) < 0) continue; - home_nr = nr; - home_rw = !(flags & GPT_FLAG_READ_ONLY); + if (sd_id128_equal(type_id, GPT_HOME)) { - free(home); - home = strdup(node); - if (!home) - return log_oom(); - } else if (sd_id128_equal(type_id, GPT_SRV)) { + if (home && nr >= home_nr) + continue; - if (srv && nr >= srv_nr) - continue; + home_nr = nr; + home_rw = !(flags & GPT_FLAG_READ_ONLY); - srv_nr = nr; - srv_rw = !(flags & GPT_FLAG_READ_ONLY); + r = free_and_strdup(&home, node); + if (r < 0) + return log_oom(); - free(srv); - srv = strdup(node); - if (!srv) - return log_oom(); - } + } else if (sd_id128_equal(type_id, GPT_SRV)) { + + if (srv && nr >= srv_nr) + continue; + + srv_nr = nr; + srv_rw = !(flags & GPT_FLAG_READ_ONLY); + + r = free_and_strdup(&srv, node); + if (r < 0) + return log_oom(); + } #ifdef GPT_ROOT_NATIVE - else if (sd_id128_equal(type_id, GPT_ROOT_NATIVE)) { + else if (sd_id128_equal(type_id, GPT_ROOT_NATIVE)) { - if (root && nr >= root_nr) - continue; + if (root && nr >= root_nr) + continue; - root_nr = nr; - root_rw = !(flags & GPT_FLAG_READ_ONLY); + root_nr = nr; + root_rw = !(flags & GPT_FLAG_READ_ONLY); - free(root); - root = strdup(node); - if (!root) - return log_oom(); - } + r = free_and_strdup(&root, node); + if (r < 0) + return log_oom(); + } #endif #ifdef GPT_ROOT_SECONDARY - else if (sd_id128_equal(type_id, GPT_ROOT_SECONDARY)) { + else if (sd_id128_equal(type_id, GPT_ROOT_SECONDARY)) { + + if (secondary_root && nr >= secondary_root_nr) + continue; + + secondary_root_nr = nr; + secondary_root_rw = !(flags & GPT_FLAG_READ_ONLY); - if (secondary_root && nr >= secondary_root_nr) + r = free_and_strdup(&secondary_root, node); + if (r < 0) + return log_oom(); + } +#endif + else if (sd_id128_equal(type_id, GPT_LINUX_GENERIC)) { + + if (generic) + multiple_generic = true; + else { + generic_rw = !(flags & GPT_FLAG_READ_ONLY); + + r = free_and_strdup(&generic, node); + if (r < 0) + return log_oom(); + } + } + + } else if (is_mbr) { + int type; + + if (flags != 0x80) /* Bootable flag */ continue; - secondary_root_nr = nr; - secondary_root_rw = !(flags & GPT_FLAG_READ_ONLY); + type = blkid_partition_get_type(pp); + if (type != 0x83) /* Linux partition */ + continue; + if (generic) + multiple_generic = true; + else { + generic_rw = true; - free(secondary_root); - secondary_root = strdup(node); - if (!secondary_root) - return log_oom(); + r = free_and_strdup(&root, node); + if (r < 0) + return log_oom(); + } } -#endif - } - - if (!root && !secondary_root) { - log_error("Failed to identify root partition in disk image %s.\n" - "Note that the disk image needs to follow http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ to be supported by systemd-nspawn.", arg_image); - return -EINVAL; } if (root) { @@ -2316,6 +3006,31 @@ static int dissect_image( *root_device_rw = secondary_root_rw; *secondary = true; + } else if (generic) { + + /* There were no partitions with precise meanings + * around, but we found generic partitions. In this + * case, if there's only one, we can go ahead and boot + * it, otherwise we bail out, because we really cannot + * make any sense of it. */ + + if (multiple_generic) { + log_error("Identified multiple bootable Linux partitions on\n" + " %s\n" + PARTITION_TABLE_BLURB, arg_image); + return -EINVAL; + } + + *root_device = generic; + generic = NULL; + + *root_device_rw = generic_rw; + *secondary = false; + } else { + log_error("Failed to identify root partition in disk image\n" + " %s\n" + PARTITION_TABLE_BLURB, arg_image); + return -EINVAL; } if (home) { @@ -2352,7 +3067,7 @@ static int mount_device(const char *what, const char *where, const char *directo rw = false; if (directory) - p = strappenda(where, directory); + p = strjoina(where, directory); else p = where; @@ -2443,7 +3158,7 @@ static void loop_remove(int nr, int *image_fd) { if (image_fd && *image_fd >= 0) { r = ioctl(*image_fd, LOOP_CLR_FD); if (r < 0) - log_warning_errno(errno, "Failed to close loop image: %m"); + log_debug_errno(errno, "Failed to close loop image: %m"); *image_fd = safe_close(*image_fd); } @@ -2455,7 +3170,7 @@ static void loop_remove(int nr, int *image_fd) { r = ioctl(control, LOOP_CTL_REMOVE, nr); if (r < 0) - log_warning_errno(errno, "Failed to remove loop %d: %m", nr); + log_debug_errno(errno, "Failed to remove loop %d: %m", nr); } static int spawn_getent(const char *database, const char *key, pid_t *rpid) { @@ -2786,78 +3501,116 @@ static int on_orderly_shutdown(sd_event_source *s, const struct signalfd_siginfo return 0; } -int main(int argc, char *argv[]) { - - _cleanup_free_ char *device_path = NULL, *root_device = NULL, *home_device = NULL, *srv_device = NULL; - bool root_device_rw = true, home_device_rw = true, srv_device_rw = true; - _cleanup_close_ int master = -1, image_fd = -1; - _cleanup_close_pair_ int kmsg_socket_pair[2] = { -1, -1 }; - _cleanup_fdset_free_ FDSet *fds = NULL; - int r = EXIT_FAILURE, k, n_fd_passed, loop_nr = -1; - const char *console = NULL; - char veth_name[IFNAMSIZ]; - bool secondary = false; - sigset_t mask, mask_chld; - pid_t pid = 0; +static int determine_names(void) { + int r; - log_parse_environment(); - log_open(); + if (!arg_image && !arg_directory) { + if (arg_machine) { + _cleanup_(image_unrefp) Image *i = NULL; - k = parse_argv(argc, argv); - if (k < 0) - goto finish; - else if (k == 0) { - r = EXIT_SUCCESS; - goto finish; - } + r = image_find(arg_machine, &i); + if (r < 0) + return log_error_errno(r, "Failed to find image for machine '%s': %m", arg_machine); + else if (r == 0) { + log_error("No image for machine '%s': %m", arg_machine); + return -ENOENT; + } - if (!arg_image) { - if (arg_directory) { - char *p; + if (i->type == IMAGE_RAW) + r = set_sanitized_path(&arg_image, i->path); + else + r = set_sanitized_path(&arg_directory, i->path); + if (r < 0) + return log_error_errno(r, "Invalid image directory: %m"); - p = path_make_absolute_cwd(arg_directory); - free(arg_directory); - arg_directory = p; + arg_read_only = arg_read_only || i->read_only; } else arg_directory = get_current_dir_name(); - if (!arg_directory) { - log_error("Failed to determine path, please use -D."); - goto finish; + if (!arg_directory && !arg_machine) { + log_error("Failed to determine path, please use -D or -i."); + return -EINVAL; } - path_kill_slashes(arg_directory); } if (!arg_machine) { - arg_machine = strdup(basename(arg_image ? arg_image : arg_directory)); - if (!arg_machine) { - log_oom(); - goto finish; - } + if (arg_directory && path_equal(arg_directory, "/")) + arg_machine = gethostname_malloc(); + else + arg_machine = strdup(basename(arg_image ?: arg_directory)); + + if (!arg_machine) + return log_oom(); hostname_cleanup(arg_machine, false); - if (isempty(arg_machine)) { + if (!machine_name_is_valid(arg_machine)) { log_error("Failed to determine machine name automatically, please use -M."); - goto finish; + return -EINVAL; + } + + if (arg_ephemeral) { + char *b; + + /* Add a random suffix when this is an + * ephemeral machine, so that we can run many + * instances at once without manually having + * to specify -M each time. */ + + if (asprintf(&b, "%s-%016" PRIx64, arg_machine, random_u64()) < 0) + return log_oom(); + + free(arg_machine); + arg_machine = b; } } + return 0; +} + +int main(int argc, char *argv[]) { + + _cleanup_free_ char *device_path = NULL, *root_device = NULL, *home_device = NULL, *srv_device = NULL, *console = NULL; + bool root_device_rw = true, home_device_rw = true, srv_device_rw = true; + _cleanup_close_ int master = -1, image_fd = -1; + _cleanup_fdset_free_ FDSet *fds = NULL; + int r, n_fd_passed, loop_nr = -1; + char veth_name[IFNAMSIZ]; + bool secondary = false, remove_subvol = false; + sigset_t mask, mask_chld; + pid_t pid = 0; + int ret = EXIT_SUCCESS; + union in_addr_union exposed = {}; + _cleanup_release_lock_file_ LockFile tree_global_lock = LOCK_FILE_INIT, tree_local_lock = LOCK_FILE_INIT; + + log_parse_environment(); + log_open(); + + r = parse_argv(argc, argv); + if (r <= 0) + goto finish; + + r = determine_names(); + if (r < 0) + goto finish; + if (geteuid() != 0) { log_error("Need to be root."); + r = -EPERM; goto finish; } if (sd_booted() <= 0) { log_error("Not running on a systemd system."); + r = -EINVAL; goto finish; } log_close(); n_fd_passed = sd_listen_fds(false); if (n_fd_passed > 0) { - k = fdset_new_listen_fds(&fds, false); - if (k < 0) { - log_error_errno(k, "Failed to collect file descriptors: %m"); + r = fdset_new_listen_fds(&fds, false); + if (r < 0) { + log_error_errno(r, "Failed to collect file descriptors: %m"); goto finish; } } @@ -2865,30 +3618,115 @@ int main(int argc, char *argv[]) { log_open(); if (arg_directory) { - if (path_equal(arg_directory, "/")) { - log_error("Spawning container on root directory not supported."); + assert(!arg_image); + + if (path_equal(arg_directory, "/") && !arg_ephemeral) { + log_error("Spawning container on root directory is not supported. Consider using --ephemeral."); + r = -EINVAL; goto finish; } + if (arg_ephemeral) { + char *np; + + /* If the specified path is a mount point we + * generate the new snapshot immediately + * inside it under a random name. However if + * the specified is not a mount point we + * create the new snapshot in the parent + * directory, just next to it. */ + r = path_is_mount_point(arg_directory, false); + if (r < 0) { + log_error_errno(r, "Failed to determine whether directory %s is mount point: %m", arg_directory); + goto finish; + } + if (r > 0) + r = tempfn_random_child(arg_directory, &np); + else + r = tempfn_random(arg_directory, &np); + if (r < 0) { + log_error_errno(r, "Failed to generate name for snapshot: %m"); + goto finish; + } + + r = image_path_lock(np, (arg_read_only ? LOCK_SH : LOCK_EX) | LOCK_NB, &tree_global_lock, &tree_local_lock); + if (r < 0) { + log_error_errno(r, "Failed to lock %s: %m", np); + goto finish; + } + + r = btrfs_subvol_snapshot(arg_directory, np, arg_read_only, true); + if (r < 0) { + free(np); + log_error_errno(r, "Failed to create snapshot %s from %s: %m", np, arg_directory); + goto finish; + } + + free(arg_directory); + arg_directory = np; + + remove_subvol = true; + + } else { + r = image_path_lock(arg_directory, (arg_read_only ? LOCK_SH : LOCK_EX) | LOCK_NB, &tree_global_lock, &tree_local_lock); + if (r == -EBUSY) { + log_error_errno(r, "Directory tree %s is currently busy.", arg_directory); + goto finish; + } + if (r < 0) { + log_error_errno(r, "Failed to lock %s: %m", arg_directory); + return r; + } + + if (arg_template) { + r = btrfs_subvol_snapshot(arg_template, arg_directory, arg_read_only, true); + if (r == -EEXIST) { + if (!arg_quiet) + log_info("Directory %s already exists, not populating from template %s.", arg_directory, arg_template); + } else if (r < 0) { + log_error_errno(r, "Couldn't create snapshot %s from %s: %m", arg_directory, arg_template); + goto finish; + } else { + if (!arg_quiet) + log_info("Populated %s from template %s.", arg_directory, arg_template); + } + } + } + if (arg_boot) { if (path_is_os_tree(arg_directory) <= 0) { log_error("Directory %s doesn't look like an OS root directory (os-release file is missing). Refusing.", arg_directory); + r = -EINVAL; goto finish; } } else { const char *p; - p = strappenda(arg_directory, + p = strjoina(arg_directory, argc > optind && path_is_absolute(argv[optind]) ? argv[optind] : "/usr/bin/"); if (access(p, F_OK) < 0) { log_error("Directory %s lacks the binary to execute or doesn't look like a binary tree. Refusing.", arg_directory); + r = -EINVAL; goto finish; - } } + } else { char template[] = "/tmp/nspawn-root-XXXXXX"; + assert(arg_image); + assert(!arg_template); + + r = image_path_lock(arg_image, (arg_read_only ? LOCK_SH : LOCK_EX) | LOCK_NB, &tree_global_lock, &tree_local_lock); + if (r == -EBUSY) { + r = log_error_errno(r, "Disk image %s is currently busy.", arg_image); + goto finish; + } + if (r < 0) { + r = log_error_errno(r, "Failed to create image lock: %m"); + goto finish; + } + if (!mkdtemp(template)) { log_error_errno(errno, "Failed to create temporary directory: %m"); r = -errno; @@ -2918,34 +3756,25 @@ int main(int argc, char *argv[]) { master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); if (master < 0) { - log_error_errno(errno, "Failed to acquire pseudo tty: %m"); + r = log_error_errno(errno, "Failed to acquire pseudo tty: %m"); goto finish; } - console = ptsname(master); - if (!console) { - log_error_errno(errno, "Failed to determine tty name: %m"); + r = ptsname_malloc(master, &console); + if (r < 0) { + r = log_error_errno(r, "Failed to determine tty name: %m"); goto finish; } if (!arg_quiet) log_info("Spawning container %s on %s.\nPress ^] three times within 1s to kill container.", - arg_machine, arg_image ? arg_image : arg_directory); + arg_machine, arg_image ?: arg_directory); if (unlockpt(master) < 0) { - log_error_errno(errno, "Failed to unlock tty: %m"); - goto finish; - } - - if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, kmsg_socket_pair) < 0) { - log_error_errno(errno, "Failed to create kmsg socket pair: %m"); + r = log_error_errno(errno, "Failed to unlock tty: %m"); goto finish; } - sd_notify(false, - "READY=1\n" - "STATUS=Container running."); - assert_se(sigemptyset(&mask) == 0); sigset_add_many(&mask, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, -1); assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); @@ -2954,6 +3783,7 @@ int main(int argc, char *argv[]) { assert_se(sigaddset(&mask_chld, SIGCHLD) == 0); for (;;) { + _cleanup_close_pair_ int kmsg_socket_pair[2] = { -1, -1 }, rtnl_socket_pair[2] = { -1, -1 }; ContainerStatus container_status; _cleanup_(barrier_destroy) Barrier barrier = BARRIER_NULL; struct sigaction sa = { @@ -2967,31 +3797,40 @@ int main(int argc, char *argv[]) { goto finish; } + if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, kmsg_socket_pair) < 0) { + r = log_error_errno(errno, "Failed to create kmsg socket pair: %m"); + goto finish; + } + + if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, rtnl_socket_pair) < 0) { + r = log_error_errno(errno, "Failed to create rtnl socket pair: %m"); + goto finish; + } + /* Child can be killed before execv(), so handle SIGCHLD * in order to interrupt parent's blocking calls and * give it a chance to call wait() and terminate. */ r = sigprocmask(SIG_UNBLOCK, &mask_chld, NULL); if (r < 0) { - log_error_errno(errno, "Failed to change the signal mask: %m"); + r = log_error_errno(errno, "Failed to change the signal mask: %m"); goto finish; } r = sigaction(SIGCHLD, &sa, NULL); if (r < 0) { - log_error_errno(errno, "Failed to install SIGCHLD handler: %m"); + r = log_error_errno(errno, "Failed to install SIGCHLD handler: %m"); goto finish; } - pid = syscall(__NR_clone, SIGCHLD|CLONE_NEWNS| - (arg_share_system ? 0 : CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWUTS)| - (arg_private_network ? CLONE_NEWNET : 0), NULL); + pid = raw_clone(SIGCHLD|CLONE_NEWNS| + (arg_share_system ? 0 : CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWUTS)| + (arg_private_network ? CLONE_NEWNET : 0), NULL); if (pid < 0) { if (errno == EINVAL) - log_error_errno(errno, "clone() failed, do you have namespace support enabled in your kernel? (You need UTS, IPC, PID and NET namespacing built in): %m"); + r = log_error_errno(errno, "clone() failed, do you have namespace support enabled in your kernel? (You need UTS, IPC, PID and NET namespacing built in): %m"); else - log_error_errno(errno, "clone() failed: %m"); + r = log_error_errno(errno, "clone() failed: %m"); - r = pid; goto finish; } @@ -3026,18 +3865,19 @@ int main(int argc, char *argv[]) { close_nointr(STDERR_FILENO); kmsg_socket_pair[0] = safe_close(kmsg_socket_pair[0]); + rtnl_socket_pair[0] = safe_close(rtnl_socket_pair[0]); reset_all_signal_handlers(); reset_signal_mask(); - k = open_terminal(console, O_RDWR); - if (k != STDIN_FILENO) { - if (k >= 0) { - safe_close(k); - k = -EINVAL; + r = open_terminal(console, O_RDWR); + if (r != STDIN_FILENO) { + if (r >= 0) { + safe_close(r); + r = -EINVAL; } - log_error_errno(k, "Failed to open console: %m"); + log_error_errno(r, "Failed to open console: %m"); _exit(EXIT_FAILURE); } @@ -3092,9 +3932,9 @@ int main(int argc, char *argv[]) { _exit(EXIT_FAILURE); if (arg_read_only) { - k = bind_remount_recursive(arg_directory, true); - if (k < 0) { - log_error_errno(k, "Failed to make tree read-only: %m"); + r = bind_remount_recursive(arg_directory, true); + if (r < 0) { + log_error_errno(r, "Failed to make tree read-only: %m"); _exit(EXIT_FAILURE); } } @@ -3110,6 +3950,9 @@ int main(int argc, char *argv[]) { dev_setup(arg_directory); + if (setup_propagate(arg_directory) < 0) + _exit(EXIT_FAILURE); + if (setup_seccomp() < 0) _exit(EXIT_FAILURE); @@ -3118,9 +3961,17 @@ int main(int argc, char *argv[]) { if (setup_kmsg(arg_directory, kmsg_socket_pair[1]) < 0) _exit(EXIT_FAILURE); - kmsg_socket_pair[1] = safe_close(kmsg_socket_pair[1]); + if (send_rtnl(rtnl_socket_pair[1]) < 0) + _exit(EXIT_FAILURE); + rtnl_socket_pair[1] = safe_close(rtnl_socket_pair[1]); + + /* Tell the parent that we are ready, and that + * it can cgroupify us to that we lack access + * to certain devices and resources. */ + (void) barrier_place(&barrier); + if (setup_boot_id(arg_directory) < 0) _exit(EXIT_FAILURE); @@ -3142,10 +3993,12 @@ int main(int argc, char *argv[]) { if (mount_tmpfs(arg_directory) < 0) _exit(EXIT_FAILURE); - /* Tell the parent that we are ready, and that - * it can cgroupify us to that we lack access - * to certain devices and resources. */ - (void)barrier_place(&barrier); + /* Wait until we are cgroup-ified, so that we + * can mount the right cgroup path writable */ + (void) barrier_sync_next(&barrier); + + if (mount_cgroup(arg_directory) < 0) + _exit(EXIT_FAILURE); if (chdir(arg_directory) < 0) { log_error_errno(errno, "chdir(%s) failed: %m", arg_directory); @@ -3198,9 +4051,9 @@ int main(int argc, char *argv[]) { } if (fdset_size(fds) > 0) { - k = fdset_cloexec(fds, false); - if (k < 0) { - log_error("Failed to unset O_CLOEXEC for file descriptors."); + r = fdset_cloexec(fds, false); + if (r < 0) { + log_error_errno(r, "Failed to unset O_CLOEXEC for file descriptors."); _exit(EXIT_FAILURE); } @@ -3284,10 +4137,13 @@ int main(int argc, char *argv[]) { fdset_free(fds); fds = NULL; - /* wait for child-setup to be done */ - if (barrier_place_and_sync(&barrier)) { - _cleanup_event_unref_ sd_event *event = NULL; - _cleanup_(pty_forward_freep) PTYForward *forward = NULL; + kmsg_socket_pair[1] = safe_close(kmsg_socket_pair[1]); + rtnl_socket_pair[1] = safe_close(rtnl_socket_pair[1]); + + /* Wait for the most basic Child-setup to be done, + * before we add hardware to it, and place it in a + * cgroup. */ + if (barrier_sync_next(&barrier)) { int ifi = 0; r = move_network_interfaces(pid); @@ -3306,6 +4162,10 @@ int main(int argc, char *argv[]) { if (r < 0) goto finish; + r = setup_ipvlan(pid); + if (r < 0) + goto finish; + r = register_machine(pid, ifi); if (r < 0) goto finish; @@ -3324,44 +4184,71 @@ int main(int argc, char *argv[]) { /* Notify the child that the parent is ready with all * its setup, and that the child can now hand over * control to the code to run inside the container. */ - (void)barrier_place(&barrier); + (void) barrier_place(&barrier); - r = sd_event_new(&event); - if (r < 0) { - log_error_errno(r, "Failed to get default event source: %m"); - goto finish; - } + /* And wait that the child is completely ready now. */ + if (barrier_place_and_sync(&barrier)) { + _cleanup_event_unref_ sd_event *event = NULL; + _cleanup_(pty_forward_freep) PTYForward *forward = NULL; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + char last_char = 0; - if (arg_boot) { - /* Try to kill the init system on SIGINT or SIGTERM */ - sd_event_add_signal(event, NULL, SIGINT, on_orderly_shutdown, UINT32_TO_PTR(pid)); - sd_event_add_signal(event, NULL, SIGTERM, on_orderly_shutdown, UINT32_TO_PTR(pid)); - } else { - /* Immediately exit */ - sd_event_add_signal(event, NULL, SIGINT, NULL, NULL); - sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL); - } + sd_notifyf(false, + "READY=1\n" + "STATUS=Container running.\n" + "X_NSPAWN_LEADER_PID=" PID_FMT, pid); - /* simply exit on sigchld */ - sd_event_add_signal(event, NULL, SIGCHLD, NULL, NULL); + r = sd_event_new(&event); + if (r < 0) { + log_error_errno(r, "Failed to get default event source: %m"); + goto finish; + } - r = pty_forward_new(event, master, &forward); - if (r < 0) { - log_error_errno(r, "Failed to create PTY forwarder: %m"); - goto finish; - } + if (arg_boot) { + /* Try to kill the init system on SIGINT or SIGTERM */ + sd_event_add_signal(event, NULL, SIGINT, on_orderly_shutdown, UINT32_TO_PTR(pid)); + sd_event_add_signal(event, NULL, SIGTERM, on_orderly_shutdown, UINT32_TO_PTR(pid)); + } else { + /* Immediately exit */ + sd_event_add_signal(event, NULL, SIGINT, NULL, NULL); + sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL); + } - r = sd_event_loop(event); - if (r < 0) - return log_error_errno(r, "Failed to run event loop: %m"); + /* simply exit on sigchld */ + sd_event_add_signal(event, NULL, SIGCHLD, NULL, NULL); + + if (arg_expose_ports) { + r = watch_rtnl(event, rtnl_socket_pair[0], &exposed, &rtnl); + if (r < 0) + goto finish; - forward = pty_forward_free(forward); + (void) expose_ports(rtnl, &exposed); + } - if (!arg_quiet) - putc('\n', stdout); + rtnl_socket_pair[0] = safe_close(rtnl_socket_pair[0]); - /* Kill if it is not dead yet anyway */ - terminate_machine(pid); + r = pty_forward_new(event, master, true, &forward); + if (r < 0) { + log_error_errno(r, "Failed to create PTY forwarder: %m"); + goto finish; + } + + r = sd_event_loop(event); + if (r < 0) { + log_error_errno(r, "Failed to run event loop: %m"); + goto finish; + } + + pty_forward_get_last_char(forward, &last_char); + + forward = pty_forward_free(forward); + + if (!arg_quiet && last_char != '\n') + putc('\n', stdout); + + /* Kill if it is not dead yet anyway */ + terminate_machine(pid); + } } /* Normally redundant, but better safe than sorry */ @@ -3370,16 +4257,17 @@ int main(int argc, char *argv[]) { r = wait_for_container(pid, &container_status); pid = 0; - if (r < 0) { + if (r < 0) /* We failed to wait for the container, or the * container exited abnormally */ - r = EXIT_FAILURE; - break; - } else if (r > 0 || container_status == CONTAINER_TERMINATED) + goto finish; + else if (r > 0 || container_status == CONTAINER_TERMINATED){ /* The container exited with a non-zero * status, or with zero status and no reboot * was requested. */ + ret = r; break; + } /* CONTAINER_REBOOTED, loop again */ @@ -3394,9 +4282,12 @@ int main(int argc, char *argv[]) { * restart. This is necessary since we might * have cgroup parameters set we want to have * flushed out. */ - r = 133; + ret = 133; + r = 0; break; } + + flush_ports(&exposed); } finish: @@ -3409,15 +4300,41 @@ finish: if (pid > 0) kill(pid, SIGKILL); + if (remove_subvol && arg_directory) { + int k; + + k = btrfs_subvol_remove(arg_directory); + if (k < 0) + log_warning_errno(k, "Cannot remove subvolume '%s', ignoring: %m", arg_directory); + } + + if (arg_machine) { + const char *p; + + p = strjoina("/run/systemd/nspawn/propagate/", arg_machine); + (void) rm_rf(p, false, true, false); + } + free(arg_directory); + free(arg_template); + free(arg_image); free(arg_machine); free(arg_user); strv_free(arg_setenv); strv_free(arg_network_interfaces); strv_free(arg_network_macvlan); + strv_free(arg_network_ipvlan); strv_free(arg_bind); strv_free(arg_bind_ro); strv_free(arg_tmpfs); - return r; + flush_ports(&exposed); + + while (arg_expose_ports) { + ExposePort *p = arg_expose_ports; + LIST_REMOVE(ports, arg_expose_ports, p); + free(p); + } + + return r < 0 ? EXIT_FAILURE : ret; } diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c index aa92cc96e..a939bb267 100644 --- a/src/nss-myhostname/nss-myhostname.c +++ b/src/nss-myhostname/nss-myhostname.c @@ -38,7 +38,7 @@ /* We use 127.0.0.2 as IPv4 address. This has the advantage over * 127.0.0.1 that it can be translated back to the local hostname. For * IPv6 we use ::1 which unfortunately will not translate back to the - * hostname but instead something like "localhost6" or so. */ + * hostname but instead something like "localhost" or so. */ #define LOCALADDRESS_IPV4 (htonl(0x7F000002)) #define LOCALADDRESS_IPV6 &in6addr_loopback @@ -47,6 +47,13 @@ NSS_GETHOSTBYNAME_PROTOTYPES(myhostname); NSS_GETHOSTBYADDR_PROTOTYPES(myhostname); +static bool is_gateway(const char *hostname) { + assert(hostname); + + return streq(hostname, "gateway") || + streq(hostname, "gateway."); +} + enum nss_status _nss_myhostname_gethostbyname4_r( const char *name, struct gaih_addrtuple **pat, @@ -78,7 +85,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r( canonical = "localhost"; local_address_ipv4 = htonl(INADDR_LOOPBACK); - } else if (streq(name, "gateway")) { + } else if (is_gateway(name)) { n_addresses = local_gateways(NULL, 0, AF_UNSPEC, &addresses); if (n_addresses <= 0) { @@ -348,7 +355,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r( canonical = "localhost"; local_address_ipv4 = htonl(INADDR_LOOPBACK); - } else if (streq(name, "gateway")) { + } else if (is_gateway(name)) { n_addresses = local_gateways(NULL, 0, af, &addresses); if (n_addresses <= 0) { @@ -408,6 +415,7 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( _cleanup_free_ char *hn = NULL; int n_addresses = 0; struct local_address *a; + bool additional_from_hostname = false; unsigned n; assert(addr); @@ -429,7 +437,6 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( } if (af == AF_INET) { - if ((*(uint32_t*) addr) == LOCALADDRESS_IPV4) goto found; @@ -443,10 +450,10 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( assert(af == AF_INET6); if (memcmp(addr, LOCALADDRESS_IPV6, 16) == 0) { - additional = "localhost"; + canonical = "localhost"; + additional_from_hostname = true; goto found; } - } n_addresses = local_addresses(NULL, 0, AF_UNSPEC, &addresses); @@ -455,18 +462,8 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( if (af != a->family) continue; - if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) { - - hn = gethostname_malloc(); - if (!hn) { - *errnop = ENOMEM; - *h_errnop = NO_RECOVERY; - return NSS_STATUS_TRYAGAIN; - } - - canonical = hn; + if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) goto found; - } } } @@ -480,7 +477,6 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( continue; if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) { - canonical = "gateway"; goto found; } @@ -493,6 +489,20 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r( return NSS_STATUS_NOTFOUND; found: + if (!canonical || (!additional && additional_from_hostname)) { + hn = gethostname_malloc(); + if (!hn) { + *errnop = ENOMEM; + *h_errnop = NO_RECOVERY; + return NSS_STATUS_TRYAGAIN; + } + + if (!canonical) + canonical = hn; + + if (!additional && additional_from_hostname) + additional = hn; + } return fill_in_hostent( canonical, additional, @@ -504,7 +514,6 @@ found: errnop, h_errnop, ttlp, NULL); - } NSS_GETHOSTBYNAME_FALLBACKS(myhostname); diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index 06c123960..ce1bd195d 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -38,6 +38,7 @@ int main(int argc, char *argv[]) { ssize_t k; int r; FILE *f; + bool cleanup_seed_file = true; if (argc != 2) { log_error("This program requires one argument."); @@ -90,6 +91,7 @@ int main(int argc, char *argv[]) { r = -errno; goto finish; } + cleanup_seed_file = false; } random_fd = open("/dev/urandom", O_RDWR|O_CLOEXEC|O_NOCTTY, 0600); @@ -140,20 +142,22 @@ int main(int argc, char *argv[]) { goto finish; } - /* This is just a safety measure. Given that we are root and - * most likely created the file ourselves the mode and owner - * should be correct anyway. */ - fchmod(seed_fd, 0600); - fchown(seed_fd, 0, 0); + if (cleanup_seed_file) { + /* This is just a safety measure. Given that we are root and + * most likely created the file ourselves the mode and owner + * should be correct anyway. */ + fchmod(seed_fd, 0600); + fchown(seed_fd, 0, 0); - k = loop_read(random_fd, buf, buf_size, false); - if (k <= 0) { - log_error("Failed to read new seed from /dev/urandom: %s", r < 0 ? strerror(-r) : "EOF"); - r = k == 0 ? -EIO : (int) k; - } else { - r = loop_write(seed_fd, buf, (size_t) k, false); - if (r < 0) - log_error_errno(r, "Failed to write new random seed file: %m"); + k = loop_read(random_fd, buf, buf_size, false); + if (k <= 0) { + log_error("Failed to read new seed from /dev/urandom: %s", r < 0 ? strerror(-r) : "EOF"); + r = k == 0 ? -EIO : (int) k; + } else { + r = loop_write(seed_fd, buf, (size_t) k, false); + if (r < 0) + log_error_errno(r, "Failed to write new random seed file: %m"); + } } finish: diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c index 54683b6f4..abf5f525d 100644 --- a/src/reply-password/reply-password.c +++ b/src/reply-password/reply-password.c @@ -20,7 +20,7 @@ ***/ #include -#include +#include #include #include #include diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 8161b5321..03c84786d 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -76,7 +76,7 @@ static int reply_query_state(DnsQuery *q) { rc = p; } - n = strappenda(_BUS_ERROR_DNS, rc); + n = strjoina(_BUS_ERROR_DNS, rc); sd_bus_error_setf(&error, n, "Could not resolve '%s', server or network returned error %s", name, rc); } diff --git a/src/resolve/resolved-dns-domain.h b/src/resolve/resolved-dns-domain.h index 0888a7846..36f27ea03 100644 --- a/src/resolve/resolved-dns-domain.h +++ b/src/resolve/resolved-dns-domain.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#pragma once + #include #include "hashmap.h" diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index cf5b6189c..21756f566 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -934,7 +934,7 @@ int dns_packet_read_name(DnsPacket *p, char **_ret, if (after_rindex == 0) after_rindex = p->rindex; - /* Jumps are limited to a "prior occurence" (RFC-1035 4.1.4) */ + /* Jumps are limited to a "prior occurrence" (RFC-1035 4.1.4) */ jump_barrier = ptr; p->rindex = ptr; } else { diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index a43359f8c..abdb2e073 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -529,7 +529,7 @@ void dns_scope_process_query(DnsScope *s, DnsStream *stream, DnsPacket *p) { if (p->ipproto == IPPROTO_UDP) { /* Don't accept UDP queries directed to anything but * the LLMNR multicast addresses. See RFC 4795, - * section 2.5.*/ + * section 2.5. */ if (p->family == AF_INET && !in_addr_equal(AF_INET, &p->destination, (union in_addr_union*) &LLMNR_MULTICAST_IPV4_ADDRESS)) return; diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 059447978..b5ad70161 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "rtnl-util.h" @@ -196,7 +196,7 @@ static int manager_rtnl_listen(Manager *m) { assert(m); - /* First, subscibe to interfaces coming and going */ + /* First, subscribe to interfaces coming and going */ r = sd_rtnl_open(&m->rtnl, 3, RTNLGRP_LINK, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR); if (r < 0) return r; @@ -667,6 +667,16 @@ int manager_read_resolv_conf(Manager *m) { if (s->marked) dns_server_free(s); + /* Whenever /etc/resolv.conf changes, start using the first + * DNS server of it. This is useful to deal with broken + * network managing implementations (like NetworkManager), + * that when connecting to a VPN place both the VPN DNS + * servers and the local ones in /etc/resolv.conf. Without + * resetting the DNS server to use back to the first entry we + * will continue to use the local one thus being unable to + * resolve VPN domains. */ + manager_set_dns_server(m, m->dns_servers); + return 0; clear: diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c index c0ab947c0..ce15a8011 100644 --- a/src/resolve/resolved.c +++ b/src/resolve/resolved.c @@ -24,6 +24,7 @@ #include "mkdir.h" #include "label.h" #include "capability.h" +#include "selinux-util.h" #include "resolved-manager.h" #include "resolved-conf.h" diff --git a/src/resolve/test-dns-domain.c b/src/resolve/test-dns-domain.c index dfe2a44ea..ebc8d98fc 100644 --- a/src/resolve/test-dns-domain.c +++ b/src/resolve/test-dns-domain.c @@ -20,6 +20,7 @@ ***/ #include "log.h" +#include "macro.h" #include "resolved-dns-domain.h" static void test_dns_label_unescape_one(const char *what, const char *expect, size_t buffer_sz, int ret) { @@ -55,7 +56,7 @@ static void test_dns_label_escape_one(const char *what, size_t l, const char *ex int r; r = dns_label_escape(what, l, &t); - assert(r == ret); + assert_se(r == ret); if (r < 0) return; diff --git a/src/run/run.c b/src/run/run.c index 7a8022391..0661b3bee 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -23,7 +23,9 @@ #include #include "sd-bus.h" +#include "sd-event.h" #include "bus-util.h" +#include "event-util.h" #include "strv.h" #include "build.h" #include "unit-name.h" @@ -31,6 +33,7 @@ #include "path-util.h" #include "bus-error.h" #include "calendarspec.h" +#include "ptyfwd.h" static bool arg_scope = false; static bool arg_remain_after_exit = false; @@ -48,6 +51,7 @@ static int arg_nice = 0; static bool arg_nice_set = false; static char **arg_environment = NULL; static char **arg_property = NULL; +static bool arg_pty = false; static usec_t arg_on_active = 0; static usec_t arg_on_boot = 0; static usec_t arg_on_startup = 0; @@ -55,6 +59,7 @@ static usec_t arg_on_unit_active = 0; static usec_t arg_on_unit_inactive = 0; static char *arg_on_calendar = NULL; static char **arg_timer_property = NULL; +static bool arg_quiet = false; static void help(void) { printf("%s [OPTIONS...] {COMMAND} [ARGS...]\n\n" @@ -77,13 +82,15 @@ static void help(void) { " --uid=USER Run as system user\n" " --gid=GROUP Run as system group\n" " --nice=NICE Nice level\n" - " --setenv=NAME=VALUE Set environment\n\n" + " --setenv=NAME=VALUE Set environment\n" + " -t --pty Run service on pseudo tty\n" + " -q --quiet Suppress information messages during runtime\n\n" "Timer options:\n\n" - " --on-active=SEC Run after seconds\n" - " --on-boot=SEC Run after seconds from machine was booted up\n" - " --on-startup=SEC Run after seconds from systemd was first started\n" - " --on-unit-active=SEC Run after seconds from the last activation\n" - " --on-unit-inactive=SEC Run after seconds from the last deactivation\n" + " --on-active=SECONDS Run after SECONDS delay\n" + " --on-boot=SECONDS Run SECONDS after machine was booted up\n" + " --on-startup=SECONDS Run SECONDS after systemd activation\n" + " --on-unit-active=SECONDS Run SECONDS after the last activation\n" + " --on-unit-inactive=SECONDS Run SECONDS after the last deactivation\n" " --on-calendar=SPEC Realtime timer\n" " --timer-property=NAME=VALUE Set timer unit property\n", program_invocation_short_name); @@ -109,6 +116,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_SERVICE_TYPE, ARG_NICE, ARG_SETENV, + ARG_TTY, ARG_ON_ACTIVE, ARG_ON_BOOT, ARG_ON_STARTUP, @@ -137,6 +145,8 @@ static int parse_argv(int argc, char *argv[]) { { "nice", required_argument, NULL, ARG_NICE }, { "setenv", required_argument, NULL, ARG_SETENV }, { "property", required_argument, NULL, 'p' }, + { "tty", no_argument, NULL, 't' }, + { "quiet", no_argument, NULL, 'q' }, { "on-active", required_argument, NULL, ARG_ON_ACTIVE }, { "on-boot", required_argument, NULL, ARG_ON_BOOT }, { "on-startup", required_argument, NULL, ARG_ON_STARTUP }, @@ -153,7 +163,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "+hrH:M:p:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "+hrH:M:p:tq", options, NULL)) >= 0) switch (c) { @@ -204,7 +214,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; @@ -244,6 +254,14 @@ static int parse_argv(int argc, char *argv[]) { break; + case 't': + arg_pty = true; + break; + + case 'q': + arg_quiet = true; + break; + case ARG_ON_ACTIVE: r = parse_sec(optarg, &arg_on_active); @@ -339,6 +357,11 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; } + if (arg_pty && (with_timer() || arg_scope)) { + log_error("--pty is not compatible in timer or --scope mode."); + return -EINVAL; + } + if (arg_scope && with_timer()) { log_error("Timer options are not supported in --scope mode."); return -EINVAL; @@ -352,11 +375,15 @@ static int parse_argv(int argc, char *argv[]) { return 1; } -static int transient_unit_set_properties(sd_bus_message *m, UnitType t) { +static int transient_unit_set_properties(sd_bus_message *m, char **properties) { char **i; int r; - STRV_FOREACH(i, t == UNIT_TIMER ? arg_timer_property : arg_property) { + r = sd_bus_message_append(m, "(sv)", "Description", "s", arg_description); + if (r < 0) + return r; + + STRV_FOREACH(i, properties) { r = sd_bus_message_open_container(m, 'r', "sv"); if (r < 0) return r; @@ -373,9 +400,12 @@ static int transient_unit_set_properties(sd_bus_message *m, UnitType t) { return r; } - r = sd_bus_message_append(m, "(sv)", "Description", "s", arg_description); - if (r < 0) - return r; + return 0; +} + +static int transient_cgroup_set_properties(sd_bus_message *m) { + int r; + assert(m); if (!isempty(arg_slice)) { _cleanup_free_ char *slice; @@ -389,21 +419,32 @@ static int transient_unit_set_properties(sd_bus_message *m, UnitType t) { return r; } - if (arg_send_sighup && t != UNIT_TIMER) { - r = sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", arg_send_sighup); - if (r < 0) - return r; - } - return 0; } -static int transient_service_set_properties(sd_bus_message *m, char **argv) { +static int transient_kill_set_properties(sd_bus_message *m) { + assert(m); + + if (arg_send_sighup) + return sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", arg_send_sighup); + else + return 0; +} + +static int transient_service_set_properties(sd_bus_message *m, char **argv, const char *pty_path) { int r; assert(m); - r = transient_unit_set_properties(m, UNIT_SERVICE); + r = transient_unit_set_properties(m, arg_property); + if (r < 0) + return r; + + r = transient_kill_set_properties(m); + if (r < 0) + return r; + + r = transient_cgroup_set_properties(m); if (r < 0) return r; @@ -437,6 +478,31 @@ static int transient_service_set_properties(sd_bus_message *m, char **argv) { return r; } + if (pty_path) { + const char *e; + + r = sd_bus_message_append(m, + "(sv)(sv)(sv)(sv)", + "StandardInput", "s", "tty", + "StandardOutput", "s", "tty", + "StandardError", "s", "tty", + "TTYPath", "s", pty_path); + if (r < 0) + return r; + + e = getenv("TERM"); + if (e) { + char *n; + + n = strjoina("TERM=", e); + r = sd_bus_message_append(m, + "(sv)", + "Environment", "as", 1, n); + if (r < 0) + return r; + } + } + if (!strv_isempty(arg_environment)) { r = sd_bus_message_open_container(m, 'r', "sv"); if (r < 0) @@ -517,12 +583,32 @@ static int transient_service_set_properties(sd_bus_message *m, char **argv) { return 0; } +static int transient_scope_set_properties(sd_bus_message *m) { + int r; + + assert(m); + + r = transient_unit_set_properties(m, arg_property); + if (r < 0) + return r; + + r = transient_kill_set_properties(m); + if (r < 0) + return r; + + r = sd_bus_message_append(m, "(sv)", "PIDs", "au", 1, (uint32_t) getpid()); + if (r < 0) + return r; + + return 0; +} + static int transient_timer_set_properties(sd_bus_message *m) { int r; assert(m); - r = transient_unit_set_properties(m, UNIT_TIMER); + r = transient_unit_set_properties(m, arg_timer_property); if (r < 0) return r; @@ -565,34 +651,70 @@ static int transient_timer_set_properties(sd_bus_message *m) { return 0; } -static int transient_scope_set_properties(sd_bus_message *m) { - int r; - - assert(m); - - r = transient_unit_set_properties(m, UNIT_SCOPE); - if (r < 0) - return r; - - r = sd_bus_message_append(m, "(sv)", "PIDs", "au", 1, (uint32_t) getpid()); - if (r < 0) - return r; - - return 0; -} - static int start_transient_service( sd_bus *bus, - char **argv, - sd_bus_error *error) { + char **argv) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - _cleanup_free_ char *service = NULL; + _cleanup_free_ char *service = NULL, *pty_path = NULL; + _cleanup_close_ int master = -1; int r; assert(bus); assert(argv); + if (arg_pty) { + + if (arg_transport == BUS_TRANSPORT_LOCAL) { + master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); + if (master < 0) + return log_error_errno(errno, "Failed to acquire pseudo tty: %m"); + + r = ptsname_malloc(master, &pty_path); + if (r < 0) + return log_error_errno(r, "Failed to determine tty name: %m"); + + } else if (arg_transport == BUS_TRANSPORT_MACHINE) { + _cleanup_bus_unref_ sd_bus *system_bus = NULL; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; + const char *s; + + r = sd_bus_open_system(&system_bus); + if (r < 0) + log_error_errno(r, "Failed to connect to system bus: %m"); + + r = sd_bus_call_method(system_bus, + "org.freedesktop.machine1", + "/org/freedesktop/machine1", + "org.freedesktop.machine1.Manager", + "OpenMachinePTY", + &error, + &reply, + "s", arg_host); + if (r < 0) { + log_error("Failed to get machine PTY: %s", bus_error_message(&error, -r)); + return r; + } + + r = sd_bus_message_read(reply, "hs", &master, &s); + if (r < 0) + return bus_log_parse_error(r); + + master = fcntl(master, F_DUPFD_CLOEXEC, 3); + if (master < 0) + return log_error_errno(errno, "Failed to duplicate master fd: %m"); + + pty_path = strdup(s); + if (!pty_path) + return log_oom(); + } else + assert_not_reached("Can't allocate tty via ssh"); + + if (unlockpt(master) < 0) + return log_error_errno(errno, "Failed to unlock tty: %m"); + } + if (arg_unit) { service = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".service"); if (!service) @@ -610,17 +732,17 @@ static int start_transient_service( if (r < 0) return bus_log_create_error(r); - /* name and mode */ + /* Name and mode */ r = sd_bus_message_append(m, "ss", service, "fail"); if (r < 0) return bus_log_create_error(r); - /* properties */ + /* Properties */ r = sd_bus_message_open_container(m, 'a', "(sv)"); if (r < 0) return bus_log_create_error(r); - r = transient_service_set_properties(m, argv); + r = transient_service_set_properties(m, argv, pty_path); if (r < 0) return bus_log_create_error(r); @@ -628,150 +750,66 @@ static int start_transient_service( if (r < 0) return bus_log_create_error(r); - /* aux */ + /* Auxiliary units */ r = sd_bus_message_append(m, "a(sa(sv))", 0); if (r < 0) return bus_log_create_error(r); - /* send dbus */ - r = sd_bus_call(bus, m, 0, error, NULL); - if (r < 0) - return bus_log_create_error(r); - - log_info("Running as unit %s.", service); - - return 0; -} - -static int start_transient_timer( - sd_bus *bus, - char **argv, - sd_bus_error *error) { - - _cleanup_bus_message_unref_ sd_bus_message *m = NULL; - _cleanup_free_ char *timer = NULL, *service = NULL; - int r; - - assert(bus); - assert(argv); - - if (arg_unit) { - switch(unit_name_to_type(arg_unit)) { - case UNIT_SERVICE: - service = strdup(arg_unit); - timer = unit_name_change_suffix(service, ".timer"); - if (!timer) - return log_oom(); - break; - - case UNIT_TIMER: - timer = strdup(arg_unit); - service = unit_name_change_suffix(timer, ".service"); - if (!service) - return log_oom(); - break; - - default: - service = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".service"); - if (!service) - return log_oom(); - - timer = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".timer"); - if (!timer) - return log_oom(); - - break; - } - } else if ((asprintf(&service, "run-"PID_FMT".service", getpid()) < 0) || - (asprintf(&timer, "run-"PID_FMT".timer", getpid()) < 0)) - return log_oom(); - - r = sd_bus_message_new_method_call( - bus, - &m, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "StartTransientUnit"); - if (r < 0) - return bus_log_create_error(r); - - /* name and mode */ - r = sd_bus_message_append(m, "ss", timer, "fail"); - if (r < 0) - return bus_log_create_error(r); - - /* properties */ - r = sd_bus_message_open_container(m, 'a', "(sv)"); - if (r < 0) - return bus_log_create_error(r); - - r = transient_timer_set_properties(m); - if (r < 0) - return bus_log_create_error(r); + r = sd_bus_call(bus, m, 0, &error, NULL); + if (r < 0) { + log_error("Failed to start transient service unit: %s", bus_error_message(&error, -r)); + return r; + } - r = sd_bus_message_close_container(m); - if (r < 0) - return bus_log_create_error(r); + if (master >= 0) { + _cleanup_(pty_forward_freep) PTYForward *forward = NULL; + _cleanup_event_unref_ sd_event *event = NULL; + sigset_t mask; + char last_char = 0; - if (argv[0]) { - r = sd_bus_message_open_container(m, 'a', "(sa(sv))"); + r = sd_event_default(&event); if (r < 0) - return bus_log_create_error(r); + return log_error_errno(r, "Failed to get event loop: %m"); - r = sd_bus_message_open_container(m, 'r', "sa(sv)"); - if (r < 0) - return bus_log_create_error(r); + assert_se(sigemptyset(&mask) == 0); + sigset_add_many(&mask, SIGWINCH, SIGTERM, SIGINT, -1); + assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); - r = sd_bus_message_append(m, "s", service); - if (r < 0) - return bus_log_create_error(r); + sd_event_add_signal(event, NULL, SIGINT, NULL, NULL); + sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL); - r = sd_bus_message_open_container(m, 'a', "(sv)"); - if (r < 0) - return bus_log_create_error(r); + if (!arg_quiet) + log_info("Running as unit %s.\nPress ^] three times within 1s to disconnect TTY.", service); - r = transient_service_set_properties(m, argv); + r = pty_forward_new(event, master, false, &forward); if (r < 0) - return bus_log_create_error(r); + return log_error_errno(r, "Failed to create PTY forwarder: %m"); - r = sd_bus_message_close_container(m); + r = sd_event_loop(event); if (r < 0) - return bus_log_create_error(r); + return log_error_errno(r, "Failed to run event loop: %m"); - r = sd_bus_message_close_container(m); - if (r < 0) - return bus_log_create_error(r); + pty_forward_get_last_char(forward, &last_char); - r = sd_bus_message_close_container(m); - if (r < 0) - return bus_log_create_error(r); - } else { - r = sd_bus_message_append(m, "a(sa(sv))", 0); - if (r < 0) - return bus_log_create_error(r); - } + forward = pty_forward_free(forward); - /* send dbus */ - r = sd_bus_call(bus, m, 0, error, NULL); - if (r < 0) - return bus_log_create_error(r); + if (!arg_quiet && last_char != '\n') + fputc('\n', stdout); - log_info("Running as unit %s.", timer); - if (argv[0]) - log_info("Will run as unit %s.", service); + } else if (!arg_quiet) + log_info("Running as unit %s.", service); return 0; } static int start_transient_scope( sd_bus *bus, - char **argv, - sd_bus_error *error) { + char **argv) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_strv_free_ char **env = NULL, **user_env = NULL; _cleanup_bus_message_unref_ sd_bus_message *m = NULL; _cleanup_free_ char *scope = NULL; - _cleanup_strv_free_ char **env = NULL, **user_env = NULL; int r; assert(bus); @@ -785,21 +823,21 @@ static int start_transient_scope( return log_oom(); r = sd_bus_message_new_method_call( - bus, - &m, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "StartTransientUnit"); + bus, + &m, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "StartTransientUnit"); if (r < 0) return bus_log_create_error(r); - /* name and mode */ + /* Name and Mode */ r = sd_bus_message_append(m, "ss", scope, "fail"); if (r < 0) return bus_log_create_error(r); - /* properties */ + /* Properties */ r = sd_bus_message_open_container(m, 'a', "(sv)"); if (r < 0) return bus_log_create_error(r); @@ -812,15 +850,16 @@ static int start_transient_scope( if (r < 0) return bus_log_create_error(r); - /* aux */ + /* Auxiliary units */ r = sd_bus_message_append(m, "a(sa(sv))", 0); if (r < 0) return bus_log_create_error(r); - /* send dbus */ - r = sd_bus_call(bus, m, 0, error, NULL); - if (r < 0) - return bus_log_create_error(r); + r = sd_bus_call(bus, m, 0, &error, NULL); + if (r < 0) { + log_error("Failed to start transient scope unit: %s", bus_error_message(&error, -r)); + return r; + } if (arg_nice_set) { if (setpriority(PRIO_PROCESS, 0, arg_nice) < 0) @@ -876,15 +915,140 @@ static int start_transient_scope( if (!env) return log_oom(); - log_info("Running as unit %s.", scope); + if (!arg_quiet) + log_info("Running as unit %s.", scope); execvpe(argv[0], argv, env); - log_error_errno(errno, "Failed to execute: %m"); - return -errno; + + return log_error_errno(errno, "Failed to execute: %m"); } -int main(int argc, char* argv[]) { +static int start_transient_timer( + sd_bus *bus, + char **argv) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_message_unref_ sd_bus_message *m = NULL; + _cleanup_free_ char *timer = NULL, *service = NULL; + int r; + + assert(bus); + assert(argv); + + if (arg_unit) { + switch(unit_name_to_type(arg_unit)) { + + case UNIT_SERVICE: + service = strdup(arg_unit); + if (!service) + return log_oom(); + + timer = unit_name_change_suffix(service, ".timer"); + if (!timer) + return log_oom(); + break; + + case UNIT_TIMER: + timer = strdup(arg_unit); + if (!timer) + return log_oom(); + + service = unit_name_change_suffix(timer, ".service"); + if (!service) + return log_oom(); + break; + + default: + service = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".service"); + if (!service) + return log_oom(); + + timer = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".timer"); + if (!timer) + return log_oom(); + + break; + } + } else if ((asprintf(&service, "run-"PID_FMT".service", getpid()) < 0) || + (asprintf(&timer, "run-"PID_FMT".timer", getpid()) < 0)) + return log_oom(); + + r = sd_bus_message_new_method_call( + bus, + &m, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "StartTransientUnit"); + if (r < 0) + return bus_log_create_error(r); + + /* Name and Mode */ + r = sd_bus_message_append(m, "ss", timer, "fail"); + if (r < 0) + return bus_log_create_error(r); + + /* Properties */ + r = sd_bus_message_open_container(m, 'a', "(sv)"); + if (r < 0) + return bus_log_create_error(r); + + r = transient_timer_set_properties(m); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_close_container(m); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_open_container(m, 'a', "(sa(sv))"); + if (r < 0) + return bus_log_create_error(r); + + if (argv[0]) { + r = sd_bus_message_open_container(m, 'r', "sa(sv)"); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_append(m, "s", service); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_open_container(m, 'a', "(sv)"); + if (r < 0) + return bus_log_create_error(r); + + r = transient_service_set_properties(m, argv, NULL); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_close_container(m); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_message_close_container(m); + if (r < 0) + return bus_log_create_error(r); + } + + r = sd_bus_message_close_container(m); + if (r < 0) + return bus_log_create_error(r); + + r = sd_bus_call(bus, m, 0, &error, NULL); + if (r < 0) { + log_error("Failed to start transient timer unit: %s", bus_error_message(&error, -r)); + return r; + } + + log_info("Running as unit %s.", timer); + if (argv[0]) + log_info("Will run as unit %s.", service); + + return 0; +} + +int main(int argc, char* argv[]) { _cleanup_bus_close_unref_ sd_bus *bus = NULL; _cleanup_free_ char *description = NULL, *command = NULL; int r; @@ -934,11 +1098,11 @@ int main(int argc, char* argv[]) { } if (arg_scope) - r = start_transient_scope(bus, argv + optind, &error); + r = start_transient_scope(bus, argv + optind); else if (with_timer()) - r = start_transient_timer(bus, argv + optind, &error); + r = start_transient_timer(bus, argv + optind); else - r = start_transient_service(bus, argv + optind, &error); + r = start_transient_service(bus, argv + optind); finish: strv_free(arg_environment); diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c index c93f58a73..a4ff1ab87 100644 --- a/src/shared/acl-util.c +++ b/src/shared/acl-util.c @@ -20,8 +20,6 @@ ***/ #include -#include -#include #include #include @@ -31,14 +29,14 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) { acl_entry_t i; - int found; + int r; assert(acl); assert(entry); - for (found = acl_get_entry(acl, ACL_FIRST_ENTRY, &i); - found > 0; - found = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) { + for (r = acl_get_entry(acl, ACL_FIRST_ENTRY, &i); + r > 0; + r = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) { acl_tag_t tag; uid_t *u; @@ -62,8 +60,7 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) { return 1; } } - - if (found < 0) + if (r < 0) return -errno; return 0; @@ -71,14 +68,13 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) { int calc_acl_mask_if_needed(acl_t *acl_p) { acl_entry_t i; - int found; + int r; assert(acl_p); - for (found = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i); - found > 0; - found = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) { - + for (r = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i); + r > 0; + r = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) { acl_tag_t tag; if (acl_get_tag_type(i, &tag) < 0) @@ -86,14 +82,80 @@ int calc_acl_mask_if_needed(acl_t *acl_p) { if (tag == ACL_MASK) return 0; + if (IN_SET(tag, ACL_USER, ACL_GROUP)) + goto calc; } - - if (found < 0) + if (r < 0) return -errno; + return 0; +calc: if (acl_calc_mask(acl_p) < 0) return -errno; + return 1; +} + +int add_base_acls_if_needed(acl_t *acl_p, const char *path) { + acl_entry_t i; + int r; + bool have_user_obj = false, have_group_obj = false, have_other = false; + struct stat st; + _cleanup_(acl_freep) acl_t basic = NULL; + + assert(acl_p); + + for (r = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i); + r > 0; + r = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) { + acl_tag_t tag; + + if (acl_get_tag_type(i, &tag) < 0) + return -errno; + + if (tag == ACL_USER_OBJ) + have_user_obj = true; + else if (tag == ACL_GROUP_OBJ) + have_group_obj = true; + else if (tag == ACL_OTHER) + have_other = true; + if (have_user_obj && have_group_obj && have_other) + return 0; + } + if (r < 0) + return -errno; + r = stat(path, &st); + if (r < 0) + return -errno; + + basic = acl_from_mode(st.st_mode); + if (!basic) + return -errno; + + for (r = acl_get_entry(basic, ACL_FIRST_ENTRY, &i); + r > 0; + r = acl_get_entry(basic, ACL_NEXT_ENTRY, &i)) { + acl_tag_t tag; + acl_entry_t dst; + + if (acl_get_tag_type(i, &tag) < 0) + return -errno; + + if ((tag == ACL_USER_OBJ && have_user_obj) || + (tag == ACL_GROUP_OBJ && have_group_obj) || + (tag == ACL_OTHER && have_other)) + continue; + + r = acl_create_entry(acl_p, &dst); + if (r < 0) + return -errno; + + r = acl_copy_entry(dst, i); + if (r < 0) + return -errno; + } + if (r < 0) + return -errno; return 0; } @@ -151,3 +213,100 @@ int search_acl_groups(char*** dst, const char* path, bool* belong) { return 0; } + +int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask) { + _cleanup_free_ char **a = NULL, **d = NULL; /* strings are not be freed */ + _cleanup_strv_free_ char **split; + char **entry; + int r = -EINVAL; + _cleanup_(acl_freep) acl_t a_acl = NULL, d_acl = NULL; + + split = strv_split(text, ","); + if (!split) + return log_oom(); + + STRV_FOREACH(entry, split) { + char *p; + + p = startswith(*entry, "default:"); + if (!p) + p = startswith(*entry, "d:"); + + if (p) + r = strv_push(&d, p); + else + r = strv_push(&a, *entry); + } + if (r < 0) + return r; + + if (!strv_isempty(a)) { + _cleanup_free_ char *join; + + join = strv_join(a, ","); + if (!join) + return -ENOMEM; + + a_acl = acl_from_text(join); + if (!a_acl) + return -EINVAL; + + if (want_mask) { + r = calc_acl_mask_if_needed(&a_acl); + if (r < 0) + return r; + } + } + + if (!strv_isempty(d)) { + _cleanup_free_ char *join; + + join = strv_join(d, ","); + if (!join) + return -ENOMEM; + + d_acl = acl_from_text(join); + if (!d_acl) + return -EINVAL; + + if (want_mask) { + r = calc_acl_mask_if_needed(&d_acl); + if (r < 0) + return r; + } + } + + *acl_access = a_acl; + *acl_default = d_acl; + a_acl = d_acl = NULL; + return 0; +} + +int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl) { + _cleanup_(acl_freep) acl_t old; + acl_entry_t i; + int r; + + old = acl_get_file(path, type); + if (!old) + return -errno; + + for (r = acl_get_entry(new, ACL_FIRST_ENTRY, &i); + r > 0; + r = acl_get_entry(new, ACL_NEXT_ENTRY, &i)) { + + acl_entry_t j; + + if (acl_create_entry(&old, &j) < 0) + return -errno; + + if (acl_copy_entry(j, i) < 0) + return -errno; + } + if (r < 0) + return -errno; + + *acl = old; + old = NULL; + return 0; +} diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h index a753ad14f..90e88ffa2 100644 --- a/src/shared/acl-util.h +++ b/src/shared/acl-util.h @@ -21,16 +21,25 @@ along with systemd; If not, see . ***/ +#ifdef HAVE_ACL + #include +#include +#include + +#include "macro.h" int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry); int calc_acl_mask_if_needed(acl_t *acl_p); +int add_base_acls_if_needed(acl_t *acl_p, const char *path); int search_acl_groups(char*** dst, const char* path, bool* belong); +int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask); +int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl); -static inline void acl_freep(acl_t *acl) { - - if (!*acl) - return; +/* acl_free takes multiple argument types. + * Multiple cleanup functions are necessary. */ +DEFINE_TRIVIAL_CLEANUP_FUNC(acl_t, acl_free); +#define acl_free_charp acl_free +DEFINE_TRIVIAL_CLEANUP_FUNC(char*, acl_free_charp); - acl_free(*acl); -} +#endif diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index d6589a67f..0a61dafc5 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/shared/async.c b/src/shared/async.c index 115901e63..7725e6d7d 100644 --- a/src/shared/async.c +++ b/src/shared/async.c @@ -41,24 +41,18 @@ int asynchronous_job(void* (*func)(void *p), void *arg) { * only in long running processes. */ r = pthread_attr_init(&a); - if (r != 0) + if (r > 0) return -r; r = pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED); - if (r != 0) { - r = -r; + if (r > 0) goto finish; - } r = pthread_create(&t, &a, func, arg); - if (r != 0) { - r = -r; - goto finish; - } finish: pthread_attr_destroy(&a); - return r; + return -r; } static void *sync_thread(void *p) { diff --git a/src/shared/btrfs-ctree.h b/src/shared/btrfs-ctree.h new file mode 100644 index 000000000..8b6f1ab4f --- /dev/null +++ b/src/shared/btrfs-ctree.h @@ -0,0 +1,92 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +#include "macro.h" +#include "sparse-endian.h" + +/* Stolen from btrfs' ctree.h */ + +struct btrfs_timespec { + le64_t sec; + le32_t nsec; +} _packed_; + +struct btrfs_disk_key { + le64_t objectid; + uint8_t type; + le64_t offset; +} _packed_; + +struct btrfs_inode_item { + le64_t generation; + le64_t transid; + le64_t size; + le64_t nbytes; + le64_t block_group; + le32_t nlink; + le32_t uid; + le32_t gid; + le32_t mode; + le64_t rdev; + le64_t flags; + le64_t sequence; + le64_t reserved[4]; + struct btrfs_timespec atime; + struct btrfs_timespec ctime; + struct btrfs_timespec mtime; + struct btrfs_timespec otime; +} _packed_; + +struct btrfs_root_item { + struct btrfs_inode_item inode; + le64_t generation; + le64_t root_dirid; + le64_t bytenr; + le64_t byte_limit; + le64_t bytes_used; + le64_t last_snapshot; + le64_t flags; + le32_t refs; + struct btrfs_disk_key drop_progress; + uint8_t drop_level; + uint8_t level; + le64_t generation_v2; + uint8_t uuid[BTRFS_UUID_SIZE]; + uint8_t parent_uuid[BTRFS_UUID_SIZE]; + uint8_t received_uuid[BTRFS_UUID_SIZE]; + le64_t ctransid; + le64_t otransid; + le64_t stransid; + le64_t rtransid; + struct btrfs_timespec ctime; + struct btrfs_timespec otime; + struct btrfs_timespec stime; + struct btrfs_timespec rtime; + le64_t reserved[8]; +} _packed_; + +#define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0) + +struct btrfs_qgroup_info_item { + le64_t generation; + le64_t rfer; + le64_t rfer_cmpr; + le64_t excl; + le64_t excl_cmpr; +} _packed_; + +#define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0) +#define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1) +#define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2) +#define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3) +#define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4) +#define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5) + +struct btrfs_qgroup_limit_item { + le64_t flags; + le64_t max_rfer; + le64_t max_excl; + le64_t rsv_rfer; + le64_t rsv_excl; +} _packed_; diff --git a/src/shared/btrfs-util.c b/src/shared/btrfs-util.c new file mode 100644 index 000000000..b34ac8b15 --- /dev/null +++ b/src/shared/btrfs-util.c @@ -0,0 +1,649 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include + +#ifdef HAVE_LINUX_BTRFS_H +#include +#endif + +#include "missing.h" +#include "util.h" +#include "path-util.h" +#include "macro.h" +#include "strv.h" +#include "copy.h" +#include "selinux-util.h" +#include "smack-util.h" +#include "btrfs-ctree.h" +#include "btrfs-util.h" + +static int validate_subvolume_name(const char *name) { + + if (!filename_is_valid(name)) + return -EINVAL; + + if (strlen(name) > BTRFS_SUBVOL_NAME_MAX) + return -E2BIG; + + return 0; +} + +static int open_parent(const char *path, int flags) { + _cleanup_free_ char *parent = NULL; + int r, fd; + + assert(path); + + r = path_get_parent(path, &parent); + if (r < 0) + return r; + + fd = open(parent, flags); + if (fd < 0) + return -errno; + + return fd; +} + +static int extract_subvolume_name(const char *path, const char **subvolume) { + const char *fn; + int r; + + assert(path); + assert(subvolume); + + fn = basename(path); + + r = validate_subvolume_name(fn); + if (r < 0) + return r; + + *subvolume = fn; + return 0; +} + +int btrfs_is_snapshot(int fd) { + struct stat st; + struct statfs sfs; + + /* On btrfs subvolumes always have the inode 256 */ + + if (fstat(fd, &st) < 0) + return -errno; + + if (!S_ISDIR(st.st_mode) || st.st_ino != 256) + return 0; + + if (fstatfs(fd, &sfs) < 0) + return -errno; + + return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC); +} + +int btrfs_subvol_snapshot(const char *old_path, const char *new_path, bool read_only, bool fallback_copy) { + struct btrfs_ioctl_vol_args_v2 args = { + .flags = read_only ? BTRFS_SUBVOL_RDONLY : 0, + }; + _cleanup_close_ int old_fd = -1, new_fd = -1; + const char *subvolume; + int r; + + assert(old_path); + + old_fd = open(old_path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (old_fd < 0) + return -errno; + + r = btrfs_is_snapshot(old_fd); + if (r < 0) + return r; + if (r == 0) { + + if (fallback_copy) { + r = btrfs_subvol_make(new_path); + if (r < 0) + return r; + + r = copy_directory_fd(old_fd, new_path, true); + if (r < 0) { + btrfs_subvol_remove(new_path); + return r; + } + + if (read_only) { + r = btrfs_subvol_set_read_only(new_path, true); + if (r < 0) { + btrfs_subvol_remove(new_path); + return r; + } + } + + return 0; + } + + return -EISDIR; + } + + r = extract_subvolume_name(new_path, &subvolume); + if (r < 0) + return r; + + new_fd = open_parent(new_path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (new_fd < 0) + return new_fd; + + strncpy(args.name, subvolume, sizeof(args.name)-1); + args.fd = old_fd; + + if (ioctl(new_fd, BTRFS_IOC_SNAP_CREATE_V2, &args) < 0) + return -errno; + + return 0; +} + +int btrfs_subvol_make(const char *path) { + struct btrfs_ioctl_vol_args args = {}; + _cleanup_close_ int fd = -1; + const char *subvolume; + int r; + + assert(path); + + r = extract_subvolume_name(path, &subvolume); + if (r < 0) + return r; + + fd = open_parent(path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (fd < 0) + return fd; + + strncpy(args.name, subvolume, sizeof(args.name)-1); + + if (ioctl(fd, BTRFS_IOC_SUBVOL_CREATE, &args) < 0) + return -errno; + + return 0; +} + +int btrfs_subvol_make_label(const char *path) { + int r; + + assert(path); + + r = mac_selinux_create_file_prepare(path, S_IFDIR); + if (r < 0) + return r; + + r = btrfs_subvol_make(path); + mac_selinux_create_file_clear(); + + if (r < 0) + return r; + + return mac_smack_fix(path, false, false); +} + +int btrfs_subvol_remove(const char *path) { + struct btrfs_ioctl_vol_args args = {}; + _cleanup_close_ int fd = -1; + const char *subvolume; + int r; + + assert(path); + + r = extract_subvolume_name(path, &subvolume); + if (r < 0) + return r; + + fd = open_parent(path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (fd < 0) + return fd; + + strncpy(args.name, subvolume, sizeof(args.name)-1); + + if (ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args) < 0) + return -errno; + + return 0; +} + +int btrfs_subvol_set_read_only_fd(int fd, bool b) { + uint64_t flags, nflags; + struct stat st; + + assert(fd >= 0); + + if (fstat(fd, &st) < 0) + return -errno; + + if (!S_ISDIR(st.st_mode) || st.st_ino != 256) + return -EINVAL; + + if (ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags) < 0) + return -errno; + + if (b) + nflags = flags | BTRFS_SUBVOL_RDONLY; + else + nflags = flags & ~BTRFS_SUBVOL_RDONLY; + + if (flags == nflags) + return 0; + + if (ioctl(fd, BTRFS_IOC_SUBVOL_SETFLAGS, &nflags) < 0) + return -errno; + + return 0; +} + +int btrfs_subvol_set_read_only(const char *path, bool b) { + _cleanup_close_ int fd = -1; + + fd = open(path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (fd < 0) + return -errno; + + return btrfs_subvol_set_read_only_fd(fd, b); +} + +int btrfs_subvol_get_read_only_fd(int fd) { + uint64_t flags; + + if (ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags) < 0) + return -errno; + + return !!(flags & BTRFS_SUBVOL_RDONLY); +} + +int btrfs_reflink(int infd, int outfd) { + int r; + + assert(infd >= 0); + assert(outfd >= 0); + + r = ioctl(outfd, BTRFS_IOC_CLONE, infd); + if (r < 0) + return -errno; + + return 0; +} + +int btrfs_clone_range(int infd, uint64_t in_offset, int outfd, uint64_t out_offset, uint64_t sz) { + struct btrfs_ioctl_clone_range_args args = { + .src_fd = infd, + .src_offset = in_offset, + .src_length = sz, + .dest_offset = out_offset, + }; + int r; + + assert(infd >= 0); + assert(outfd >= 0); + assert(sz > 0); + + r = ioctl(outfd, BTRFS_IOC_CLONE_RANGE, &args); + if (r < 0) + return -errno; + + return 0; +} + +int btrfs_get_block_device(const char *path, dev_t *dev) { + struct btrfs_ioctl_fs_info_args fsi = {}; + _cleanup_close_ int fd = -1; + uint64_t id; + + assert(path); + assert(dev); + + fd = open(path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY); + if (fd < 0) + return -errno; + + if (ioctl(fd, BTRFS_IOC_FS_INFO, &fsi) < 0) + return -errno; + + /* We won't do this for btrfs RAID */ + if (fsi.num_devices != 1) + return 0; + + for (id = 1; id <= fsi.max_id; id++) { + struct btrfs_ioctl_dev_info_args di = { + .devid = id, + }; + struct stat st; + + if (ioctl(fd, BTRFS_IOC_DEV_INFO, &di) < 0) { + if (errno == ENODEV) + continue; + + return -errno; + } + + if (stat((char*) di.path, &st) < 0) + return -errno; + + if (!S_ISBLK(st.st_mode)) + return -ENODEV; + + if (major(st.st_rdev) == 0) + return -ENODEV; + + *dev = st.st_rdev; + return 1; + } + + return -ENODEV; +} + +int btrfs_subvol_get_id_fd(int fd, uint64_t *ret) { + struct btrfs_ioctl_ino_lookup_args args = { + .objectid = BTRFS_FIRST_FREE_OBJECTID + }; + + assert(fd >= 0); + assert(ret); + + if (ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args) < 0) + return -errno; + + *ret = args.treeid; + return 0; +} + +static bool btrfs_ioctl_search_args_inc(struct btrfs_ioctl_search_args *args) { + assert(args); + + /* the objectid, type, offset together make up the btrfs key, + * which is considered a single 136byte integer when + * comparing. This call increases the counter by one, dealing + * with the overflow between the overflows */ + + if (args->key.min_offset < (uint64_t) -1) { + args->key.min_offset++; + return true; + } + + if (args->key.min_type < (uint8_t) -1) { + args->key.min_type++; + args->key.min_offset = 0; + return true; + } + + if (args->key.min_objectid < (uint64_t) -1) { + args->key.min_objectid++; + args->key.min_offset = 0; + args->key.min_type = 0; + return true; + } + + return 0; +} + +static void btrfs_ioctl_search_args_set(struct btrfs_ioctl_search_args *args, const struct btrfs_ioctl_search_header *h) { + assert(args); + assert(h); + + args->key.min_objectid = h->objectid; + args->key.min_type = h->type; + args->key.min_offset = h->offset; +} + +static int btrfs_ioctl_search_args_compare(const struct btrfs_ioctl_search_args *args) { + assert(args); + + /* Compare min and max */ + + if (args->key.min_objectid < args->key.max_objectid) + return -1; + if (args->key.min_objectid > args->key.max_objectid) + return 1; + + if (args->key.min_type < args->key.max_type) + return -1; + if (args->key.min_type > args->key.max_type) + return 1; + + if (args->key.min_offset < args->key.max_offset) + return -1; + if (args->key.min_offset > args->key.max_offset) + return 1; + + return 0; +} + +#define FOREACH_BTRFS_IOCTL_SEARCH_HEADER(i, sh, args) \ + for ((i) = 0, \ + (sh) = (const struct btrfs_ioctl_search_header*) (args).buf; \ + (i) < (args).key.nr_items; \ + (i)++, \ + (sh) = (const struct btrfs_ioctl_search_header*) ((uint8_t*) (sh) + sizeof(struct btrfs_ioctl_search_header) + (sh)->len)) + +#define BTRFS_IOCTL_SEARCH_HEADER_BODY(sh) \ + ((void*) ((uint8_t*) sh + sizeof(struct btrfs_ioctl_search_header))) + +int btrfs_subvol_get_info_fd(int fd, BtrfsSubvolInfo *ret) { + struct btrfs_ioctl_search_args args = { + /* Tree of tree roots */ + .key.tree_id = BTRFS_ROOT_TREE_OBJECTID, + + /* Look precisely for the subvolume items */ + .key.min_type = BTRFS_ROOT_ITEM_KEY, + .key.max_type = BTRFS_ROOT_ITEM_KEY, + + .key.min_offset = 0, + .key.max_offset = (uint64_t) -1, + + /* No restrictions on the other components */ + .key.min_transid = 0, + .key.max_transid = (uint64_t) -1, + }; + + uint64_t subvol_id; + bool found = false; + int r; + + assert(fd >= 0); + assert(ret); + + r = btrfs_subvol_get_id_fd(fd, &subvol_id); + if (r < 0) + return r; + + args.key.min_objectid = args.key.max_objectid = subvol_id; + + while (btrfs_ioctl_search_args_compare(&args) <= 0) { + const struct btrfs_ioctl_search_header *sh; + unsigned i; + + args.key.nr_items = 256; + if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0) + return -errno; + + if (args.key.nr_items <= 0) + break; + + FOREACH_BTRFS_IOCTL_SEARCH_HEADER(i, sh, args) { + + const struct btrfs_root_item *ri; + + /* Make sure we start the next search at least from this entry */ + btrfs_ioctl_search_args_set(&args, sh); + + if (sh->objectid != subvol_id) + continue; + if (sh->type != BTRFS_ROOT_ITEM_KEY) + continue; + + /* Older versions of the struct lacked the otime setting */ + if (sh->len < offsetof(struct btrfs_root_item, otime) + sizeof(struct btrfs_timespec)) + continue; + + ri = BTRFS_IOCTL_SEARCH_HEADER_BODY(sh); + + ret->otime = (usec_t) le64toh(ri->otime.sec) * USEC_PER_SEC + + (usec_t) le32toh(ri->otime.nsec) / NSEC_PER_USEC; + + ret->subvol_id = subvol_id; + ret->read_only = !!(le64toh(ri->flags) & BTRFS_ROOT_SUBVOL_RDONLY); + + assert_cc(sizeof(ri->uuid) == sizeof(ret->uuid)); + memcpy(&ret->uuid, ri->uuid, sizeof(ret->uuid)); + memcpy(&ret->parent_uuid, ri->parent_uuid, sizeof(ret->parent_uuid)); + + found = true; + goto finish; + } + + /* Increase search key by one, to read the next item, if we can. */ + if (!btrfs_ioctl_search_args_inc(&args)) + break; + } + +finish: + if (!found) + return -ENODATA; + + return 0; +} + +int btrfs_subvol_get_quota_fd(int fd, BtrfsQuotaInfo *ret) { + + struct btrfs_ioctl_search_args args = { + /* Tree of quota items */ + .key.tree_id = BTRFS_QUOTA_TREE_OBJECTID, + + /* The object ID is always 0 */ + .key.min_objectid = 0, + .key.max_objectid = 0, + + /* Look precisely for the quota items */ + .key.min_type = BTRFS_QGROUP_STATUS_KEY, + .key.max_type = BTRFS_QGROUP_LIMIT_KEY, + + /* No restrictions on the other components */ + .key.min_transid = 0, + .key.max_transid = (uint64_t) -1, + }; + + uint64_t subvol_id; + bool found_info = false, found_limit = false; + int r; + + assert(fd >= 0); + assert(ret); + + r = btrfs_subvol_get_id_fd(fd, &subvol_id); + if (r < 0) + return r; + + args.key.min_offset = args.key.max_offset = subvol_id; + + while (btrfs_ioctl_search_args_compare(&args) <= 0) { + const struct btrfs_ioctl_search_header *sh; + unsigned i; + + args.key.nr_items = 256; + if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0) + return -errno; + + if (args.key.nr_items <= 0) + break; + + FOREACH_BTRFS_IOCTL_SEARCH_HEADER(i, sh, args) { + + /* Make sure we start the next search at least from this entry */ + btrfs_ioctl_search_args_set(&args, sh); + + if (sh->objectid != 0) + continue; + if (sh->offset != subvol_id) + continue; + + if (sh->type == BTRFS_QGROUP_INFO_KEY) { + const struct btrfs_qgroup_info_item *qii = BTRFS_IOCTL_SEARCH_HEADER_BODY(sh); + + ret->referred = le64toh(qii->rfer); + ret->exclusive = le64toh(qii->excl); + + found_info = true; + + } else if (sh->type == BTRFS_QGROUP_LIMIT_KEY) { + const struct btrfs_qgroup_limit_item *qli = BTRFS_IOCTL_SEARCH_HEADER_BODY(sh); + + ret->referred_max = le64toh(qli->max_rfer); + ret->exclusive_max = le64toh(qli->max_excl); + + if (ret->referred_max == 0) + ret->referred_max = (uint64_t) -1; + if (ret->exclusive_max == 0) + ret->exclusive_max = (uint64_t) -1; + + found_limit = true; + } + + if (found_info && found_limit) + goto finish; + } + + /* Increase search key by one, to read the next item, if we can. */ + if (!btrfs_ioctl_search_args_inc(&args)) + break; + } + +finish: + if (!found_limit && !found_info) + return -ENODATA; + + if (!found_info) { + ret->referred = (uint64_t) -1; + ret->exclusive = (uint64_t) -1; + } + + if (!found_limit) { + ret->referred_max = (uint64_t) -1; + ret->exclusive_max = (uint64_t) -1; + } + + return 0; +} + +int btrfs_defrag_fd(int fd) { + assert(fd >= 0); + + if (ioctl(fd, BTRFS_IOC_DEFRAG, NULL) < 0) + return -errno; + + return 0; +} + +int btrfs_defrag(const char *p) { + _cleanup_close_ int fd = -1; + + fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); + if (fd < 0) + return -errno; + + return btrfs_defrag_fd(fd); +} diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h new file mode 100644 index 000000000..1b9c142e5 --- /dev/null +++ b/src/shared/btrfs-util.h @@ -0,0 +1,66 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include +#include + +#include "time-util.h" + +typedef struct BtrfsSubvolInfo { + uint64_t subvol_id; + usec_t otime; + + sd_id128_t uuid; + sd_id128_t parent_uuid; + + bool read_only; +} BtrfsSubvolInfo; + +typedef struct BtrfsQuotaInfo { + uint64_t referred; + uint64_t exclusive; + uint64_t referred_max; + uint64_t exclusive_max; +} BtrfsQuotaInfo; + +int btrfs_is_snapshot(int fd); + +int btrfs_subvol_make(const char *path); +int btrfs_subvol_make_label(const char *path); +int btrfs_subvol_remove(const char *path); +int btrfs_subvol_snapshot(const char *old_path, const char *new_path, bool read_only, bool fallback_copy); + +int btrfs_subvol_set_read_only_fd(int fd, bool b); +int btrfs_subvol_set_read_only(const char *path, bool b); +int btrfs_subvol_get_read_only_fd(int fd); +int btrfs_subvol_get_id_fd(int fd, uint64_t *ret); +int btrfs_subvol_get_info_fd(int fd, BtrfsSubvolInfo *info); +int btrfs_subvol_get_quota_fd(int fd, BtrfsQuotaInfo *quota); + +int btrfs_reflink(int infd, int outfd); +int btrfs_clone_range(int infd, uint64_t in_offset, int ofd, uint64_t out_offset, uint64_t sz); + +int btrfs_get_block_device(const char *path, dev_t *dev); + +int btrfs_defrag_fd(int fd); +int btrfs_defrag(const char *p); diff --git a/src/core/build.h b/src/shared/build.h similarity index 100% rename from src/core/build.h rename to src/shared/build.h diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 19ae8a323..2fde3e107 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -24,7 +24,7 @@ #include "calendarspec.h" -#define BITS_WEEKDAYS 127 +#define BITS_WEEKDAYS 127 static void free_chain(CalendarComponent *c) { CalendarComponent *n; diff --git a/src/shared/cap-list.c b/src/shared/cap-list.c index 56d1488f4..8033e8c7b 100644 --- a/src/shared/cap-list.c +++ b/src/shared/cap-list.c @@ -60,3 +60,7 @@ int capability_from_name(const char *name) { return sc->id; } + +int capability_list_length(void) { + return (int) ELEMENTSOF(capability_names); +} diff --git a/src/shared/cap-list.h b/src/shared/cap-list.h index c699e466a..9824fad70 100644 --- a/src/shared/cap-list.h +++ b/src/shared/cap-list.h @@ -23,3 +23,4 @@ const char *capability_to_name(int id); int capability_from_name(const char *name); +int capability_list_length(void); diff --git a/src/shared/capability.c b/src/shared/capability.c index 65d7e038a..915ceb9d9 100644 --- a/src/shared/capability.c +++ b/src/shared/capability.c @@ -54,11 +54,25 @@ int have_effective_cap(int value) { unsigned long cap_last_cap(void) { static thread_local unsigned long saved; static thread_local bool valid = false; + _cleanup_free_ char *content = NULL; unsigned long p; + int r; if (valid) return saved; + /* available since linux-3.2 */ + r = read_one_line_file("/proc/sys/kernel/cap_last_cap", &content); + if (r >= 0) { + r = safe_atolu(content, &p); + if (r >= 0) { + saved = p; + valid = true; + return p; + } + } + + /* fall back to syscall-probing for pre linux-3.2 */ p = (unsigned long) CAP_LAST_CAP; if (prctl(PR_CAPBSET_READ, p) < 0) { @@ -216,8 +230,8 @@ int capability_bounding_set_drop_usermode(uint64_t drop) { } int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) { - _cleanup_cap_free_ cap_t d = NULL; + unsigned i, j = 0; int r; /* Unfortunately we cannot leave privilege dropping to PID 1 @@ -233,6 +247,7 @@ int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) { if (setgroups(0, NULL) < 0) return log_error_errno(errno, "Failed to drop auxiliary groups list: %m"); + /* Ensure we keep the permitted caps across the setresuid() */ if (prctl(PR_SET_KEEPCAPS, 1) < 0) return log_error_errno(errno, "Failed to enable keep capabilities flag: %m"); @@ -243,31 +258,37 @@ int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) { if (prctl(PR_SET_KEEPCAPS, 0) < 0) return log_error_errno(errno, "Failed to disable keep capabilities flag: %m"); + /* Drop all caps from the bounding set, except the ones we want */ r = capability_bounding_set_drop(~keep_capabilities, true); if (r < 0) return log_error_errno(r, "Failed to drop capabilities: %m"); + /* Now upgrade the permitted caps we still kept to effective caps */ d = cap_init(); if (!d) return log_oom(); if (keep_capabilities) { - cap_value_t bits[sizeof(keep_capabilities)*8]; - unsigned i, j = 0; + cap_value_t bits[u64log2(keep_capabilities) + 1]; - for (i = 0; i < sizeof(keep_capabilities)*8; i++) + for (i = 0; i < ELEMENTSOF(bits); i++) if (keep_capabilities & (1ULL << i)) bits[j++] = i; + /* use enough bits */ + assert(i == 64 || (keep_capabilities >> i) == 0); + /* don't use too many bits */ + assert(keep_capabilities & (1ULL << (i - 1))); + if (cap_set_flag(d, CAP_EFFECTIVE, j, bits, CAP_SET) < 0 || cap_set_flag(d, CAP_PERMITTED, j, bits, CAP_SET) < 0) { log_error_errno(errno, "Failed to enable capabilities bits: %m"); return -errno; } - } - if (cap_set_proc(d) < 0) - return log_error_errno(errno, "Failed to increase capabilities: %m"); + if (cap_set_proc(d) < 0) + return log_error_errno(errno, "Failed to increase capabilities: %m"); + } return 0; } diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index c862ee91f..cbd94e86d 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -40,30 +40,22 @@ static int compare(const void *a, const void *b) { return 0; } -static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsigned n_columns, bool extra, bool more, bool kernel_threads, OutputFlags flags) { - unsigned i, m, pid_width; - pid_t biggest = 0; +static void show_pid_array(pid_t pids[], unsigned n_pids, const char *prefix, unsigned n_columns, bool extra, bool more, bool kernel_threads, OutputFlags flags) { + unsigned i, j, pid_width; - /* Filter duplicates */ - m = 0; - for (i = 0; i < n_pids; i++) { - unsigned j; - - if (pids[i] > biggest) - biggest = pids[i]; + if (n_pids == 0) + return; - for (j = i+1; j < n_pids; j++) - if (pids[i] == pids[j]) - break; + qsort(pids, n_pids, sizeof(pid_t), compare); - if (j >= n_pids) - pids[m++] = pids[i]; + /* Filter duplicates */ + for (j = 0, i = 1; i < n_pids; i++) { + if (pids[i] == pids[j]) + continue; + pids[++j] = pids[i]; } - n_pids = m; - pid_width = DECIMAL_STR_WIDTH(biggest); - - /* And sort */ - qsort_safe(pids, n_pids, sizeof(pid_t), compare); + n_pids = j + 1; + pid_width = DECIMAL_STR_WIDTH(pids[j]); if (flags & OUTPUT_FULL_WIDTH) n_columns = 0; @@ -83,10 +75,7 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi else printf("%s%s", prefix, draw_special_char(((more || i < n_pids-1) ? DRAW_TREE_BRANCH : DRAW_TREE_RIGHT))); - printf("%*lu %s\n", - pid_width, - (unsigned long) pids[i], - strna(t)); + printf("%*"PID_PRI" %s\n", pid_width, pids[i], strna(t)); } } @@ -104,7 +93,7 @@ static int show_cgroup_one_by_path(const char *path, const char *prefix, unsigne if (r < 0) return r; - fn = strappenda(p, "/cgroup.procs"); + fn = strjoina(p, "/cgroup.procs"); f = fopen(fn, "re"); if (!f) return -errno; @@ -114,17 +103,8 @@ static int show_cgroup_one_by_path(const char *path, const char *prefix, unsigne if (!kernel_threads && is_kernel_thread(pid) > 0) continue; - if (n >= n_allocated) { - pid_t *npids; - - n_allocated = MAX(16U, n*2U); - - npids = realloc(pids, sizeof(pid_t) * n_allocated); - if (!npids) - return -ENOMEM; - - pids = npids; - } + if (!GREEDY_REALLOC(pids, n_allocated, n + 1)) + return -ENOMEM; assert(n < n_allocated); pids[n++] = pid; @@ -133,8 +113,7 @@ static int show_cgroup_one_by_path(const char *path, const char *prefix, unsigne if (r < 0) return r; - if (n > 0) - show_pid_array(pids, n, prefix, n_columns, false, more, kernel_threads, flags); + show_pid_array(pids, n, prefix, n_columns, false, more, kernel_threads, flags); return 0; } diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index 1bcba0188..dfd8689b7 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -502,14 +502,16 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch } static int check_hierarchy(const char *p) { - char *cc; + const char *cc; assert(p); + if (!filename_is_valid(p)) + return 0; + /* Check if this controller actually really exists */ - cc = alloca(strlen("/sys/fs/cgroup/") + strlen(p) + 1); - strcpy(stpcpy(cc, "/sys/fs/cgroup/"), p); - if (access(cc, F_OK) < 0) + cc = strjoina("/sys/fs/cgroup/", p); + if (laccess(cc, F_OK) < 0) return -errno; return 0; @@ -1249,17 +1251,15 @@ int cg_path_get_user_unit(const char *path, char **unit) { /* Skip slices, if there are any */ e = skip_slices(path); - /* Skip the session scope... */ + /* Skip the session scope or user manager... */ t = skip_session(e); - if (t) - /* ... and skip more slices if there's one */ - e = skip_slices(t); - else { - /* ... or require a user manager unit to be there */ - e = skip_user_manager(e); - if (!e) - return -ENOENT; - } + if (!t) + t = skip_user_manager(e); + if (!t) + return -ENOENT; + + /* ... and skip more slices if there are any */ + e = skip_slices(t); return cg_path_decode_unit(e, unit); } @@ -1590,6 +1590,17 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri return write_string_file_no_create(p, value); } +int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) { + _cleanup_free_ char *p = NULL; + int r; + + r = cg_get_path(controller, path, attribute, &p); + if (r < 0) + return r; + + return read_one_line_file(p, ret); +} + static const char mask_names[] = "cpu\0" "cpuacct\0" @@ -1732,3 +1743,54 @@ CGroupControllerMask cg_mask_supported(void) { return mask; } + +int cg_kernel_controllers(Set *controllers) { + _cleanup_fclose_ FILE *f = NULL; + char buf[LINE_MAX]; + int r; + + assert(controllers); + + f = fopen("/proc/cgroups", "re"); + if (!f) { + if (errno == ENOENT) + return 0; + return -errno; + } + + /* Ignore the header line */ + (void) fgets(buf, sizeof(buf), f); + + for (;;) { + char *controller; + int enabled = 0; + + errno = 0; + if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { + + if (feof(f)) + break; + + if (ferror(f) && errno) + return -errno; + + return -EBADMSG; + } + + if (!enabled) { + free(controller); + continue; + } + + if (!filename_is_valid(controller)) { + free(controller); + return -EBADMSG; + } + + r = set_consume(controllers, controller); + if (r < 0) + return r; + } + + return 0; +} diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h index 5e1e445c3..96a3d3baf 100644 --- a/src/shared/cgroup-util.h +++ b/src/shared/cgroup-util.h @@ -85,6 +85,7 @@ int cg_attach_fallback(const char *controller, const char *path, pid_t pid); int cg_create_and_attach(const char *controller, const char *path, pid_t pid); int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value); +int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret); int cg_set_group_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid); int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid); @@ -132,3 +133,5 @@ int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, cons int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bool delete_root); CGroupControllerMask cg_mask_supported(void); + +int cg_kernel_controllers(Set *controllers); diff --git a/src/shared/clock-util.c b/src/shared/clock-util.c index fc49393c7..96684681a 100644 --- a/src/shared/clock-util.c +++ b/src/shared/clock-util.c @@ -121,7 +121,7 @@ int clock_set_timezone(int *min) { minutesdelta = tm->tm_gmtoff / 60; tz.tz_minuteswest = -minutesdelta; - tz.tz_dsttime = 0; /* DST_NONE*/ + tz.tz_dsttime = 0; /* DST_NONE */ /* * If the RTC does not run in UTC but in local time, the very first @@ -141,7 +141,7 @@ int clock_reset_timewarp(void) { struct timezone tz; tz.tz_minuteswest = 0; - tz.tz_dsttime = 0; /* DST_NONE*/ + tz.tz_dsttime = 0; /* DST_NONE */ /* * The very first call to settimeofday() does time warp magic. Do a diff --git a/src/shared/clock-util.h b/src/shared/clock-util.h index 7ed371a95..198a7b275 100644 --- a/src/shared/clock-util.h +++ b/src/shared/clock-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see . ***/ +#include "util.h" + int clock_is_localtime(void); int clock_set_timezone(int *min); int clock_reset_timewarp(void); diff --git a/src/shared/condition.c b/src/shared/condition.c index dcbf9a7e8..da7560f05 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -31,7 +31,6 @@ #include "virt.h" #include "path-util.h" #include "fileio.h" -#include "unit.h" #include "architecture.h" #include "smack-util.h" #include "apparmor-util.h" @@ -73,11 +72,13 @@ void condition_free(Condition *c) { free(c); } -void condition_free_list(Condition *first) { +Condition* condition_free_list(Condition *first) { Condition *c, *n; LIST_FOREACH_SAFE(conditions, c, n, first) condition_free(c); + + return NULL; } static int condition_test_kernel_command_line(Condition *c) { @@ -287,7 +288,7 @@ static int condition_test_needs_update(Condition *c) { if (!path_is_absolute(c->parameter)) return true; - p = strappenda(c->parameter, "/.updated"); + p = strjoina(c->parameter, "/.updated"); if (lstat(p, &other) < 0) return true; diff --git a/src/shared/condition.h b/src/shared/condition.h index 28d1d94ff..0780e7812 100644 --- a/src/shared/condition.h +++ b/src/shared/condition.h @@ -79,7 +79,7 @@ typedef struct Condition { Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate); void condition_free(Condition *c); -void condition_free_list(Condition *c); +Condition* condition_free_list(Condition *c); int condition_test(Condition *c); diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c index 51f4e0105..db4937db8 100644 --- a/src/shared/conf-files.c +++ b/src/shared/conf-files.c @@ -44,7 +44,7 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char assert(path); assert(suffix); - dirpath = strappenda(root ? root : "", path); + dirpath = strjoina(root ? root : "", path); dir = opendir(dirpath); if (!dir) { diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 5fe983a84..0b1af6c57 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -61,7 +61,7 @@ int log_syntax_internal( if (unit) r = log_struct_internal(level, - error > 0 ? error : EINVAL, + error, file, line, func, getpid() == 1 ? "UNIT=%s" : "USER_UNIT=%s", unit, LOG_MESSAGE_ID(SD_MESSAGE_CONFIG_ERROR), @@ -71,7 +71,7 @@ int log_syntax_internal( NULL); else r = log_struct_internal(level, - error > 0 ? error : EINVAL, + error, file, line, func, LOG_MESSAGE_ID(SD_MESSAGE_CONFIG_ERROR), "CONFIG_FILE=%s", config_file, @@ -823,8 +823,7 @@ int config_parse_log_facility( x = log_facility_unshifted_from_string(rvalue); if (x < 0) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Failed to parse log facility, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse log facility, ignoring: %s", rvalue); return 0; } @@ -855,8 +854,7 @@ int config_parse_log_level( x = log_level_from_string(rvalue); if (x < 0) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Failed to parse log level, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse log level, ignoring: %s", rvalue); return 0; } diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h index 2507a4444..7a2f855f9 100644 --- a/src/shared/conf-parser.h +++ b/src/shared/conf-parser.h @@ -136,11 +136,12 @@ int log_syntax_internal( config_file, config_line, \ error, __VA_ARGS__) -#define log_invalid_utf8(unit, level, config_file, config_line, error, rvalue) { \ - _cleanup_free_ char *__p = utf8_escape_invalid(rvalue); \ - log_syntax(unit, level, config_file, config_line, error, \ - "String is not UTF-8 clean, ignoring assignment: %s", __p); \ - } +#define log_invalid_utf8(unit, level, config_file, config_line, error, rvalue) \ + do { \ + _cleanup_free_ char *_p = utf8_escape_invalid(rvalue); \ + log_syntax(unit, level, config_file, config_line, error, \ + "String is not UTF-8 clean, ignoring assignment: %s", strna(_p)); \ + } while(false) #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ int function(const char *unit, \ diff --git a/src/shared/copy.c b/src/shared/copy.c index b8b1ba186..0239a5806 100644 --- a/src/shared/copy.c +++ b/src/shared/copy.c @@ -20,18 +20,30 @@ ***/ #include +#include #include "util.h" +#include "btrfs-util.h" #include "copy.h" -int copy_bytes(int fdf, int fdt, off_t max_bytes) { +#define COPY_BUFFER_SIZE (16*1024) + +int copy_bytes(int fdf, int fdt, off_t max_bytes, bool try_reflink) { bool try_sendfile = true; + int r; assert(fdf >= 0); assert(fdt >= 0); + /* Try btrfs reflinks first. */ + if (try_reflink && max_bytes == (off_t) -1) { + r = btrfs_reflink(fdf, fdt); + if (r >= 0) + return r; + } + for (;;) { - size_t m = PIPE_BUF; + size_t m = COPY_BUFFER_SIZE; ssize_t n; if (max_bytes != (off_t) -1) { @@ -63,7 +75,6 @@ int copy_bytes(int fdf, int fdt, off_t max_bytes) { /* As a fallback just copy bits by hand */ { char buf[m]; - int r; n = read(fdf, buf, m); if (n < 0) @@ -71,10 +82,9 @@ int copy_bytes(int fdf, int fdt, off_t max_bytes) { if (n == 0) /* EOF */ break; - r = loop_write(fdt, buf, n, false); + r = loop_write(fdt, buf, (size_t) n, false); if (r < 0) return r; - } next: @@ -110,6 +120,7 @@ static int fd_copy_symlink(int df, const char *from, const struct stat *st, int static int fd_copy_regular(int df, const char *from, const struct stat *st, int dt, const char *to) { _cleanup_close_ int fdf = -1, fdt = -1; + struct timespec ts[2]; int r, q; assert(from); @@ -124,7 +135,7 @@ static int fd_copy_regular(int df, const char *from, const struct stat *st, int if (fdt < 0) return -errno; - r = copy_bytes(fdf, fdt, (off_t) -1); + r = copy_bytes(fdf, fdt, (off_t) -1, true); if (r < 0) { unlinkat(dt, to, 0); return r; @@ -136,6 +147,12 @@ static int fd_copy_regular(int df, const char *from, const struct stat *st, int if (fchmod(fdt, st->st_mode & 07777) < 0) r = -errno; + ts[0] = st->st_atim; + ts[1] = st->st_mtim; + (void) futimens(fdt, ts); + + (void) copy_xattr(fdf, fdt); + q = close(fdt); fdt = -1; @@ -187,20 +204,28 @@ static int fd_copy_node(int df, const char *from, const struct stat *st, int dt, return r; } -static int fd_copy_directory(int df, const char *from, const struct stat *st, int dt, const char *to, dev_t original_device, bool merge) { +static int fd_copy_directory( + int df, + const char *from, + const struct stat *st, + int dt, + const char *to, + dev_t original_device, + bool merge) { + _cleanup_close_ int fdf = -1, fdt = -1; _cleanup_closedir_ DIR *d = NULL; struct dirent *de; bool created; int r; - assert(from); assert(st); assert(to); - fdf = openat(df, from, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); - if (fdf < 0) - return -errno; + if (from) + fdf = openat(df, from, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); + else + fdf = fcntl(df, F_DUPFD_CLOEXEC, 3); d = fdopendir(fdf); if (!d) @@ -222,11 +247,19 @@ static int fd_copy_directory(int df, const char *from, const struct stat *st, in r = 0; if (created) { + struct timespec ut[2] = { + st->st_atim, + st->st_mtim + }; + if (fchown(fdt, st->st_uid, st->st_gid) < 0) r = -errno; if (fchmod(fdt, st->st_mode & 07777) < 0) r = -errno; + + (void) futimens(fdt, ut); + (void) copy_xattr(dirfd(d), fdt); } FOREACH_DIRENT(de, d, return -errno) { @@ -264,31 +297,52 @@ static int fd_copy_directory(int df, const char *from, const struct stat *st, in return r; } -int copy_tree(const char *from, const char *to, bool merge) { +int copy_tree_at(int fdf, const char *from, int fdt, const char *to, bool merge) { struct stat st; assert(from); assert(to); - if (lstat(from, &st) < 0) + if (fstatat(fdf, from, &st, AT_SYMLINK_NOFOLLOW) < 0) return -errno; if (S_ISREG(st.st_mode)) - return fd_copy_regular(AT_FDCWD, from, &st, AT_FDCWD, to); + return fd_copy_regular(fdf, from, &st, fdt, to); else if (S_ISDIR(st.st_mode)) - return fd_copy_directory(AT_FDCWD, from, &st, AT_FDCWD, to, st.st_dev, merge); + return fd_copy_directory(fdf, from, &st, fdt, to, st.st_dev, merge); else if (S_ISLNK(st.st_mode)) - return fd_copy_symlink(AT_FDCWD, from, &st, AT_FDCWD, to); + return fd_copy_symlink(fdf, from, &st, fdt, to); else if (S_ISFIFO(st.st_mode)) - return fd_copy_fifo(AT_FDCWD, from, &st, AT_FDCWD, to); + return fd_copy_fifo(fdf, from, &st, fdt, to); else if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode)) - return fd_copy_node(AT_FDCWD, from, &st, AT_FDCWD, to); + return fd_copy_node(fdf, from, &st, fdt, to); else return -ENOTSUP; } -int copy_file_fd(const char *from, int fdt) { +int copy_tree(const char *from, const char *to, bool merge) { + return copy_tree_at(AT_FDCWD, from, AT_FDCWD, to, merge); +} + +int copy_directory_fd(int dirfd, const char *to, bool merge) { + + struct stat st; + + assert(dirfd >= 0); + assert(to); + + if (fstat(dirfd, &st) < 0) + return -errno; + + if (!S_ISDIR(st.st_mode)) + return -ENOTDIR; + + return fd_copy_directory(dirfd, NULL, &st, AT_FDCWD, to, st.st_dev, merge); +} + +int copy_file_fd(const char *from, int fdt, bool try_reflink) { _cleanup_close_ int fdf = -1; + int r; assert(from); assert(fdt >= 0); @@ -297,20 +351,30 @@ int copy_file_fd(const char *from, int fdt) { if (fdf < 0) return -errno; - return copy_bytes(fdf, fdt, (off_t) -1); + r = copy_bytes(fdf, fdt, (off_t) -1, try_reflink); + + (void) copy_times(fdf, fdt); + (void) copy_xattr(fdf, fdt); + + return r; } -int copy_file(const char *from, const char *to, int flags, mode_t mode) { +int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned chattr_flags) { int fdt, r; assert(from); assert(to); - fdt = open(to, flags|O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, mode); - if (fdt < 0) - return -errno; + RUN_WITH_UMASK(0000) { + fdt = open(to, flags|O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, mode); + if (fdt < 0) + return -errno; + } - r = copy_file_fd(from, fdt); + if (chattr_flags != 0) + (void) chattr_fd(fdt, true, chattr_flags); + + r = copy_file_fd(from, fdt, true); if (r < 0) { close(fdt); unlink(to); @@ -324,3 +388,114 @@ int copy_file(const char *from, const char *to, int flags, mode_t mode) { return 0; } + +int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace, unsigned chattr_flags) { + _cleanup_free_ char *t; + int r; + + assert(from); + assert(to); + + r = tempfn_random(to, &t); + if (r < 0) + return r; + + r = copy_file(from, t, O_NOFOLLOW|O_EXCL, mode, chattr_flags); + if (r < 0) + return r; + + if (renameat2(AT_FDCWD, t, AT_FDCWD, to, replace ? 0 : RENAME_NOREPLACE) < 0) { + unlink_noerrno(t); + return -errno; + } + + return 0; +} + +int copy_times(int fdf, int fdt) { + struct timespec ut[2]; + struct stat st; + usec_t crtime; + + assert(fdf >= 0); + assert(fdt >= 0); + + if (fstat(fdf, &st) < 0) + return -errno; + + ut[0] = st.st_atim; + ut[1] = st.st_mtim; + + if (futimens(fdt, ut) < 0) + return -errno; + + if (fd_getcrtime(fdf, &crtime) >= 0) + (void) fd_setcrtime(fdt, crtime); + + return 0; +} + +int copy_xattr(int fdf, int fdt) { + _cleanup_free_ char *bufa = NULL, *bufb = NULL; + size_t sza = 100, szb = 100; + ssize_t n; + int ret = 0; + const char *p; + + for (;;) { + bufa = malloc(sza); + if (!bufa) + return -ENOMEM; + + n = flistxattr(fdf, bufa, sza); + if (n == 0) + return 0; + if (n > 0) + break; + if (errno != ERANGE) + return -errno; + + sza *= 2; + + free(bufa); + bufa = NULL; + } + + p = bufa; + while (n > 0) { + size_t l; + + l = strlen(p); + assert(l < (size_t) n); + + if (startswith(p, "user.")) { + ssize_t m; + + if (!bufb) { + bufb = malloc(szb); + if (!bufb) + return -ENOMEM; + } + + m = fgetxattr(fdf, p, bufb, szb); + if (m < 0) { + if (errno == ERANGE) { + szb *= 2; + free(bufb); + bufb = NULL; + continue; + } + + return -errno; + } + + if (fsetxattr(fdt, p, bufb, m, 0) < 0) + ret = -errno; + } + + p += l + 1; + n -= l + 1; + } + + return ret; +} diff --git a/src/shared/copy.h b/src/shared/copy.h index 62932112a..8de0cfba3 100644 --- a/src/shared/copy.h +++ b/src/shared/copy.h @@ -24,7 +24,12 @@ #include #include -int copy_file_fd(const char *from, int to); -int copy_file(const char *from, const char *to, int flags, mode_t mode); +int copy_file_fd(const char *from, int to, bool try_reflink); +int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned chattr_flags); +int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace, unsigned chattr_flags); int copy_tree(const char *from, const char *to, bool merge); -int copy_bytes(int fdf, int fdt, off_t max_bytes); +int copy_tree_at(int fdf, const char *from, int fdt, const char *to, bool merge); +int copy_directory_fd(int dirfd, const char *to, bool merge); +int copy_bytes(int fdf, int fdt, off_t max_bytes, bool try_reflink); +int copy_times(int fdf, int fdt); +int copy_xattr(int fdf, int fdt); diff --git a/src/shared/def.h b/src/shared/def.h index 96c45a6b7..a3d9fcf38 100644 --- a/src/shared/def.h +++ b/src/shared/def.h @@ -81,3 +81,6 @@ #ifndef TTY_GID #define TTY_GID 5 #endif + +#define NOTIFY_FD_MAX 768 +#define NOTIFY_BUFFER_MAX PIPE_BUF diff --git a/src/shared/dropin.c b/src/shared/dropin.c index ac09be984..d1baad619 100644 --- a/src/shared/dropin.c +++ b/src/shared/dropin.c @@ -21,8 +21,10 @@ #include "dropin.h" #include "util.h" +#include "strv.h" #include "mkdir.h" #include "fileio-label.h" +#include "conf-files.h" int drop_in_file(const char *dir, const char *unit, unsigned level, const char *name, char **_p, char **_q) { @@ -43,7 +45,7 @@ int drop_in_file(const char *dir, const char *unit, unsigned level, if (!b) return -ENOMEM; - if (!filename_is_safe(b)) + if (!filename_is_valid(b)) return -EINVAL; p = strjoin(dir, "/", unit, ".d", NULL); @@ -100,3 +102,137 @@ int write_drop_in_format(const char *dir, const char *unit, unsigned level, return write_drop_in(dir, unit, level, name, p); } + +static int iterate_dir( + const char *path, + UnitDependency dependency, + dependency_consumer_t consumer, + void *arg, + char ***strv) { + + _cleanup_closedir_ DIR *d = NULL; + int r; + + assert(path); + + /* The config directories are special, since the order of the + * drop-ins matters */ + if (dependency < 0) { + r = strv_extend(strv, path); + if (r < 0) + return log_oom(); + + return 0; + } + + assert(consumer); + + d = opendir(path); + if (!d) { + if (errno == ENOENT) + return 0; + + log_error_errno(errno, "Failed to open directory %s: %m", path); + return -errno; + } + + for (;;) { + struct dirent *de; + _cleanup_free_ char *f = NULL; + + errno = 0; + de = readdir(d); + if (!de && errno != 0) + return log_error_errno(errno, "Failed to read directory %s: %m", path); + + if (!de) + break; + + if (hidden_file(de->d_name)) + continue; + + f = strjoin(path, "/", de->d_name, NULL); + if (!f) + return log_oom(); + + r = consumer(dependency, de->d_name, f, arg); + if (r < 0) + return r; + } + + return 0; +} + +int unit_file_process_dir( + Set * unit_path_cache, + const char *unit_path, + const char *name, + const char *suffix, + UnitDependency dependency, + dependency_consumer_t consumer, + void *arg, + char ***strv) { + + _cleanup_free_ char *path = NULL; + + assert(unit_path); + assert(name); + assert(suffix); + + path = strjoin(unit_path, "/", name, suffix, NULL); + if (!path) + return log_oom(); + + if (!unit_path_cache || set_get(unit_path_cache, path)) + iterate_dir(path, dependency, consumer, arg, strv); + + if (unit_name_is_instance(name)) { + _cleanup_free_ char *template = NULL, *p = NULL; + /* Also try the template dir */ + + template = unit_name_template(name); + if (!template) + return log_oom(); + + p = strjoin(unit_path, "/", template, suffix, NULL); + if (!p) + return log_oom(); + + if (!unit_path_cache || set_get(unit_path_cache, p)) + iterate_dir(p, dependency, consumer, arg, strv); + } + + return 0; +} + +int unit_file_find_dropin_paths( + char **lookup_path, + Set *unit_path_cache, + Set *names, + char ***paths) { + + _cleanup_strv_free_ char **strv = NULL, **ans = NULL; + Iterator i; + char *t; + int r; + + assert(paths); + + SET_FOREACH(t, names, i) { + char **p; + + STRV_FOREACH(p, lookup_path) + unit_file_process_dir(unit_path_cache, *p, t, ".d", _UNIT_DEPENDENCY_INVALID, NULL, NULL, &strv); + } + + if (strv_isempty(strv)) + return 0; + + r = conf_files_list_strv(&ans, ".conf", NULL, (const char**) strv); + if (r < 0) + return log_warning_errno(r, "Failed to get list of configuration files: %m"); + + *paths = ans; + ans = NULL; + return 1; +} diff --git a/src/shared/dropin.h b/src/shared/dropin.h index 9c9742d0e..d4531fca2 100644 --- a/src/shared/dropin.h +++ b/src/shared/dropin.h @@ -22,6 +22,8 @@ ***/ #include "macro.h" +#include "set.h" +#include "unit-name.h" int drop_in_file(const char *dir, const char *unit, unsigned level, const char *name, char **_p, char **_q); @@ -31,3 +33,30 @@ int write_drop_in(const char *dir, const char *unit, unsigned level, int write_drop_in_format(const char *dir, const char *unit, unsigned level, const char *name, const char *format, ...) _printf_(5, 6); + +/** + * This callback will be called for each directory entry @entry, + * with @filepath being the full path to the entry. + * + * If return value is negative, loop will be aborted. + */ +typedef int (*dependency_consumer_t)(UnitDependency dependency, + const char *entry, + const char* filepath, + void *arg); + +int unit_file_process_dir( + Set * unit_path_cache, + const char *unit_path, + const char *name, + const char *suffix, + UnitDependency dependency, + dependency_consumer_t consumer, + void *arg, + char ***strv); + +int unit_file_find_dropin_paths( + char **lookup_path, + Set *unit_path_cache, + Set *names, + char ***paths); diff --git a/src/shared/env-util.c b/src/shared/env-util.c index fbdc73dd2..038246d21 100644 --- a/src/shared/env-util.c +++ b/src/shared/env-util.c @@ -28,7 +28,6 @@ #include "util.h" #include "env-util.h" #include "def.h" -#include "unit.h" #define VALID_CHARS_ENV_NAME \ DIGITS LETTERS \ @@ -415,7 +414,7 @@ char *strv_env_get(char **l, const char *name) { return strv_env_get_n(l, name, strlen(name)); } -char **strv_env_clean_log(char **e, const char *unit_id, const char *message) { +char **strv_env_clean_with_callback(char **e, void (*invalid_callback)(const char *p, void *userdata), void *userdata) { char **p, **q; int k = 0; @@ -424,8 +423,8 @@ char **strv_env_clean_log(char **e, const char *unit_id, const char *message) { bool duplicate = false; if (!env_assignment_is_valid(*p)) { - if (message) - log_unit_error(unit_id, "Ignoring invalid environment '%s': %s", *p, message); + if (invalid_callback) + invalid_callback(*p, userdata); free(*p); continue; } @@ -450,7 +449,3 @@ char **strv_env_clean_log(char **e, const char *unit_id, const char *message) { return e; } - -char **strv_env_clean(char **e) { - return strv_env_clean_log(e, NULL, NULL); -} diff --git a/src/shared/env-util.h b/src/shared/env-util.h index 3c6f9d743..618441a65 100644 --- a/src/shared/env-util.h +++ b/src/shared/env-util.h @@ -24,13 +24,15 @@ #include #include +#include "macro.h" + bool env_name_is_valid(const char *e); bool env_value_is_valid(const char *e); bool env_assignment_is_valid(const char *e); bool strv_env_is_valid(char **e); -char **strv_env_clean(char **l); -char **strv_env_clean_log(char **e, const char *unit_id, const char *message); +#define strv_env_clean(l) strv_env_clean_with_callback(l, NULL, NULL) +char **strv_env_clean_with_callback(char **l, void (*invalid_callback)(const char *p, void *userdata), void *userdata); bool strv_env_name_or_assignment_is_valid(char **l); diff --git a/src/shared/fdset.c b/src/shared/fdset.c index 37cbd8526..9e35ce5ce 100644 --- a/src/shared/fdset.c +++ b/src/shared/fdset.c @@ -41,7 +41,31 @@ FDSet *fdset_new(void) { return MAKE_FDSET(set_new(NULL)); } -void fdset_free(FDSet *s) { +int fdset_new_array(FDSet **ret, int *fds, unsigned n_fds) { + unsigned i; + FDSet *s; + int r; + + assert(ret); + + s = fdset_new(); + if (!s) + return -ENOMEM; + + for (i = 0; i < n_fds; i++) { + + r = fdset_put(s, fds[i]); + if (r < 0) { + set_free(MAKE_SET(s)); + return r; + } + } + + *ret = s; + return 0; +} + +FDSet* fdset_free(FDSet *s) { void *p; while ((p = set_steal_first(MAKE_SET(s)))) { @@ -61,6 +85,7 @@ void fdset_free(FDSet *s) { } set_free(MAKE_SET(s)); + return NULL; } int fdset_put(FDSet *s, int fd) { @@ -70,6 +95,19 @@ int fdset_put(FDSet *s, int fd) { return set_put(MAKE_SET(s), FD_TO_PTR(fd)); } +int fdset_consume(FDSet *s, int fd) { + int r; + + assert(s); + assert(fd >= 0); + + r = fdset_put(s, fd); + if (r <= 0) + safe_close(fd); + + return r; +} + int fdset_put_dup(FDSet *s, int fd) { int copy, r; @@ -127,7 +165,7 @@ int fdset_new_fill(FDSet **_s) { while ((de = readdir(d))) { int fd = -1; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; r = safe_atoi(de->d_name, &fd); @@ -223,6 +261,10 @@ unsigned fdset_size(FDSet *fds) { return set_size(MAKE_SET(fds)); } +bool fdset_isempty(FDSet *fds) { + return set_isempty(MAKE_SET(fds)); +} + int fdset_iterate(FDSet *s, Iterator *i) { void *p; @@ -232,3 +274,13 @@ int fdset_iterate(FDSet *s, Iterator *i) { return PTR_TO_FD(p); } + +int fdset_steal_first(FDSet *fds) { + void *p; + + p = set_steal_first(MAKE_SET(fds)); + if (!p) + return -ENOENT; + + return PTR_TO_FD(p); +} diff --git a/src/shared/fdset.h b/src/shared/fdset.h index 907acd76d..c3c5e5228 100644 --- a/src/shared/fdset.h +++ b/src/shared/fdset.h @@ -27,25 +27,30 @@ typedef struct FDSet FDSet; FDSet* fdset_new(void); -void fdset_free(FDSet *s); +FDSet* fdset_free(FDSet *s); int fdset_put(FDSet *s, int fd); int fdset_put_dup(FDSet *s, int fd); +int fdset_consume(FDSet *s, int fd); bool fdset_contains(FDSet *s, int fd); int fdset_remove(FDSet *s, int fd); -int fdset_new_fill(FDSet **_s); -int fdset_new_listen_fds(FDSet **_s, bool unset); +int fdset_new_array(FDSet **ret, int *fds, unsigned n_fds); +int fdset_new_fill(FDSet **ret); +int fdset_new_listen_fds(FDSet **ret, bool unset); int fdset_cloexec(FDSet *fds, bool b); int fdset_close_others(FDSet *fds); unsigned fdset_size(FDSet *fds); +bool fdset_isempty(FDSet *fds); int fdset_iterate(FDSet *s, Iterator *i); +int fdset_steal_first(FDSet *fds); + #define FDSET_FOREACH(fd, fds, i) \ for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i))) diff --git a/src/shared/fileio-label.c b/src/shared/fileio-label.c index 294c9e6ba..5fd69e058 100644 --- a/src/shared/fileio-label.c +++ b/src/shared/fileio-label.c @@ -23,9 +23,10 @@ #include #include -#include "fileio-label.h" -#include "label.h" #include "util.h" +#include "selinux-util.h" +#include "label.h" +#include "fileio-label.h" int write_string_file_atomic_label(const char *fn, const char *line) { int r; diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c new file mode 100644 index 000000000..cf317e17b --- /dev/null +++ b/src/shared/fstab-util.c @@ -0,0 +1,150 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "fstab-util.h" +#include "strv.h" +#include "util.h" + +int fstab_filter_options(const char *opts, const char *names, + const char **namefound, char **value, char **filtered) { + const char *name, *n = NULL, *x; + _cleanup_strv_free_ char **stor = NULL; + _cleanup_free_ char *v = NULL, **strv = NULL; + + assert(names && *names); + + if (!opts) + goto answer; + + /* If !value and !filtered, this function is not allowed to fail. */ + + if (!filtered) { + const char *word, *state; + size_t l; + + FOREACH_WORD_SEPARATOR(word, l, opts, ",", state) + NULSTR_FOREACH(name, names) { + if (l < strlen(name)) + continue; + if (!strneq(word, name, strlen(name))) + continue; + + /* we know that the string is NUL + * terminated, so *x is valid */ + x = word + strlen(name); + if (IN_SET(*x, '\0', '=', ',')) { + n = name; + if (value) { + free(v); + if (IN_SET(*x, '\0', ',')) + v = NULL; + else { + assert(*x == '='); + x++; + v = strndup(x, l - strlen(name) - 1); + if (!v) + return -ENOMEM; + } + } + } + } + } else { + char **t, **s; + + stor = strv_split(opts, ","); + if (!stor) + return -ENOMEM; + strv = memdup(stor, sizeof(char*) * (strv_length(stor) + 1)); + if (!strv) + return -ENOMEM; + + for (s = t = strv; *s; s++) { + NULSTR_FOREACH(name, names) { + x = startswith(*s, name); + if (x && IN_SET(*x, '\0', '=')) + goto found; + } + + *t = *s; + t++; + continue; + found: + /* Keep the last occurence found */ + n = name; + if (value) { + free(v); + if (*x == '\0') + v = NULL; + else { + assert(*x == '='); + x++; + v = strdup(x); + if (!v) + return -ENOMEM; + } + } + } + *t = NULL; + } + +answer: + if (namefound) + *namefound = n; + if (filtered) { + char *f; + + f = strv_join(strv, ","); + if (!f) + return -ENOMEM; + + *filtered = f; + } + if (value) { + *value = v; + v = NULL; + } + + return !!n; +} + +int fstab_find_pri(const char *options, int *ret) { + _cleanup_free_ char *opt = NULL; + int r; + unsigned pri; + + assert(ret); + + r = fstab_filter_options(options, "pri\0", NULL, &opt, NULL); + if (r < 0) + return r; + if (r == 0 || !opt) + return 0; + + r = safe_atou(opt, &pri); + if (r < 0) + return r; + + if ((int) pri < 0) + return -ERANGE; + + *ret = (int) pri; + return 1; +} diff --git a/src/shared/fstab-util.h b/src/shared/fstab-util.h new file mode 100644 index 000000000..9f6b32eaf --- /dev/null +++ b/src/shared/fstab-util.h @@ -0,0 +1,48 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include "macro.h" + +int fstab_filter_options(const char *opts, const char *names, + const char **namefound, char **value, char **filtered); + +static inline bool fstab_test_option(const char *opts, const char *names) { + return !!fstab_filter_options(opts, names, NULL, NULL, NULL); +} + +int fstab_find_pri(const char *options, int *ret); + +static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) { + int r; + const char *opt; + + /* If first name given is last, return 1. + * If second name given is last or neither is found, return 0. */ + + r = fstab_filter_options(opts, yes_no, &opt, NULL, NULL); + assert(r >= 0); + + return opt == yes_no; +} diff --git a/src/shared/fw-util.c b/src/shared/fw-util.c new file mode 100644 index 000000000..ceb1ae508 --- /dev/null +++ b/src/shared/fw-util.c @@ -0,0 +1,344 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "fw-util.h" + +DEFINE_TRIVIAL_CLEANUP_FUNC(struct xtc_handle*, iptc_free); + +static int entry_fill_basics( + struct ipt_entry *entry, + int protocol, + const char *in_interface, + const union in_addr_union *source, + unsigned source_prefixlen, + const char *out_interface, + const union in_addr_union *destination, + unsigned destination_prefixlen) { + + assert(entry); + + if (out_interface && strlen(out_interface) >= IFNAMSIZ) + return -EINVAL; + + if (in_interface && strlen(in_interface) >= IFNAMSIZ) + return -EINVAL; + + entry->ip.proto = protocol; + + if (in_interface) { + strcpy(entry->ip.iniface, in_interface); + memset(entry->ip.iniface_mask, 0xFF, strlen(in_interface)+1); + } + if (source) { + entry->ip.src = source->in; + in_addr_prefixlen_to_netmask(&entry->ip.smsk, source_prefixlen); + } + + if (out_interface) { + strcpy(entry->ip.outiface, out_interface); + memset(entry->ip.outiface_mask, 0xFF, strlen(out_interface)+1); + } + if (destination) { + entry->ip.dst = destination->in; + in_addr_prefixlen_to_netmask(&entry->ip.dmsk, destination_prefixlen); + } + + return 0; +} + +int fw_add_masquerade( + bool add, + int af, + int protocol, + const union in_addr_union *source, + unsigned source_prefixlen, + const char *out_interface, + const union in_addr_union *destination, + unsigned destination_prefixlen) { + + _cleanup_(iptc_freep) struct xtc_handle *h = NULL; + struct ipt_entry *entry, *mask; + struct ipt_entry_target *t; + size_t sz; + struct nf_nat_ipv4_multi_range_compat *mr; + int r; + + if (af != AF_INET) + return -ENOTSUP; + + if (protocol != 0 && protocol != IPPROTO_TCP && protocol != IPPROTO_UDP) + return -ENOTSUP; + + h = iptc_init("nat"); + if (!h) + return -errno; + + sz = XT_ALIGN(sizeof(struct ipt_entry)) + + XT_ALIGN(sizeof(struct ipt_entry_target)) + + XT_ALIGN(sizeof(struct nf_nat_ipv4_multi_range_compat)); + + /* Put together the entry we want to add or remove */ + entry = alloca0(sz); + entry->next_offset = sz; + entry->target_offset = XT_ALIGN(sizeof(struct ipt_entry)); + r = entry_fill_basics(entry, protocol, NULL, source, source_prefixlen, out_interface, destination, destination_prefixlen); + if (r < 0) + return r; + + /* Fill in target part */ + t = ipt_get_target(entry); + t->u.target_size = + XT_ALIGN(sizeof(struct ipt_entry_target)) + + XT_ALIGN(sizeof(struct nf_nat_ipv4_multi_range_compat)); + strncpy(t->u.user.name, "MASQUERADE", sizeof(t->u.user.name)); + mr = (struct nf_nat_ipv4_multi_range_compat*) t->data; + mr->rangesize = 1; + + /* Create a search mask entry */ + mask = alloca(sz); + memset(mask, 0xFF, sz); + + if (add) { + if (iptc_check_entry("POSTROUTING", entry, (unsigned char*) mask, h)) + return 0; + if (errno != ENOENT) /* if other error than not existing yet, fail */ + return -errno; + + if (!iptc_insert_entry("POSTROUTING", entry, 0, h)) + return -errno; + } else { + if (!iptc_delete_entry("POSTROUTING", entry, (unsigned char*) mask, h)) { + if (errno == ENOENT) /* if it's already gone, all is good! */ + return 0; + + return -errno; + } + } + + if (!iptc_commit(h)) + return -errno; + + return 0; +} + +int fw_add_local_dnat( + bool add, + int af, + int protocol, + const char *in_interface, + const union in_addr_union *source, + unsigned source_prefixlen, + const union in_addr_union *destination, + unsigned destination_prefixlen, + uint16_t local_port, + const union in_addr_union *remote, + uint16_t remote_port, + const union in_addr_union *previous_remote) { + + + _cleanup_(iptc_freep) struct xtc_handle *h = NULL; + struct ipt_entry *entry, *mask; + struct ipt_entry_target *t; + struct ipt_entry_match *m; + struct xt_addrtype_info_v1 *at; + struct nf_nat_ipv4_multi_range_compat *mr; + size_t sz, msz; + int r; + + assert(add || !previous_remote); + + if (af != AF_INET) + return -ENOTSUP; + + if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP) + return -ENOTSUP; + + if (local_port <= 0) + return -EINVAL; + + if (remote_port <= 0) + return -EINVAL; + + h = iptc_init("nat"); + if (!h) + return -errno; + + sz = XT_ALIGN(sizeof(struct ipt_entry)) + + XT_ALIGN(sizeof(struct ipt_entry_match)) + + XT_ALIGN(sizeof(struct xt_addrtype_info_v1)) + + XT_ALIGN(sizeof(struct ipt_entry_target)) + + XT_ALIGN(sizeof(struct nf_nat_ipv4_multi_range_compat)); + + if (protocol == IPPROTO_TCP) + msz = XT_ALIGN(sizeof(struct ipt_entry_match)) + + XT_ALIGN(sizeof(struct xt_tcp)); + else + msz = XT_ALIGN(sizeof(struct ipt_entry_match)) + + XT_ALIGN(sizeof(struct xt_udp)); + + sz += msz; + + /* Fill in basic part */ + entry = alloca0(sz); + entry->next_offset = sz; + entry->target_offset = + XT_ALIGN(sizeof(struct ipt_entry)) + + XT_ALIGN(sizeof(struct ipt_entry_match)) + + XT_ALIGN(sizeof(struct xt_addrtype_info_v1)) + + msz; + r = entry_fill_basics(entry, protocol, in_interface, source, source_prefixlen, NULL, destination, destination_prefixlen); + if (r < 0) + return r; + + /* Fill in first match */ + m = (struct ipt_entry_match*) ((uint8_t*) entry + XT_ALIGN(sizeof(struct ipt_entry))); + m->u.match_size = msz; + if (protocol == IPPROTO_TCP) { + struct xt_tcp *tcp; + + strncpy(m->u.user.name, "tcp", sizeof(m->u.user.name)); + tcp = (struct xt_tcp*) m->data; + tcp->dpts[0] = tcp->dpts[1] = local_port; + tcp->spts[0] = 0; + tcp->spts[1] = 0xFFFF; + + } else { + struct xt_udp *udp; + + strncpy(m->u.user.name, "udp", sizeof(m->u.user.name)); + udp = (struct xt_udp*) m->data; + udp->dpts[0] = udp->dpts[1] = local_port; + udp->spts[0] = 0; + udp->spts[1] = 0xFFFF; + } + + /* Fill in second match */ + m = (struct ipt_entry_match*) ((uint8_t*) entry + XT_ALIGN(sizeof(struct ipt_entry)) + msz); + m->u.match_size = + XT_ALIGN(sizeof(struct ipt_entry_match)) + + XT_ALIGN(sizeof(struct xt_addrtype_info_v1)); + strncpy(m->u.user.name, "addrtype", sizeof(m->u.user.name)); + m->u.user.revision = 1; + at = (struct xt_addrtype_info_v1*) m->data; + at->dest = XT_ADDRTYPE_LOCAL; + + /* Fill in target part */ + t = ipt_get_target(entry); + t->u.target_size = + XT_ALIGN(sizeof(struct ipt_entry_target)) + + XT_ALIGN(sizeof(struct nf_nat_ipv4_multi_range_compat)); + strncpy(t->u.user.name, "DNAT", sizeof(t->u.user.name)); + mr = (struct nf_nat_ipv4_multi_range_compat*) t->data; + mr->rangesize = 1; + mr->range[0].flags = NF_NAT_RANGE_PROTO_SPECIFIED|NF_NAT_RANGE_MAP_IPS; + mr->range[0].min_ip = mr->range[0].max_ip = remote->in.s_addr; + if (protocol == IPPROTO_TCP) + mr->range[0].min.tcp.port = mr->range[0].max.tcp.port = htons(remote_port); + else + mr->range[0].min.udp.port = mr->range[0].max.udp.port = htons(remote_port); + + mask = alloca0(sz); + memset(mask, 0xFF, sz); + + if (add) { + /* Add the PREROUTING rule, if it is missing so far */ + if (!iptc_check_entry("PREROUTING", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -EINVAL; + + if (!iptc_insert_entry("PREROUTING", entry, 0, h)) + return -errno; + } + + /* If a previous remote is set, remove its entry */ + if (previous_remote && previous_remote->in.s_addr != remote->in.s_addr) { + mr->range[0].min_ip = mr->range[0].max_ip = previous_remote->in.s_addr; + + if (!iptc_delete_entry("PREROUTING", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -errno; + } + + mr->range[0].min_ip = mr->range[0].max_ip = remote->in.s_addr; + } + + /* Add the OUTPUT rule, if it is missing so far */ + if (!in_interface) { + + /* Don't apply onto loopback addresses */ + if (!destination) { + entry->ip.dst.s_addr = htobe32(0x7F000000); + entry->ip.dmsk.s_addr = htobe32(0xFF000000); + entry->ip.invflags = IPT_INV_DSTIP; + } + + if (!iptc_check_entry("OUTPUT", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -errno; + + if (!iptc_insert_entry("OUTPUT", entry, 0, h)) + return -errno; + } + + /* If a previous remote is set, remove its entry */ + if (previous_remote && previous_remote->in.s_addr != remote->in.s_addr) { + mr->range[0].min_ip = mr->range[0].max_ip = previous_remote->in.s_addr; + + if (!iptc_delete_entry("OUTPUT", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -errno; + } + } + } + } else { + if (!iptc_delete_entry("PREROUTING", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -errno; + } + + if (!in_interface) { + if (!destination) { + entry->ip.dst.s_addr = htobe32(0x7F000000); + entry->ip.dmsk.s_addr = htobe32(0xFF000000); + entry->ip.invflags = IPT_INV_DSTIP; + } + + if (!iptc_delete_entry("OUTPUT", entry, (unsigned char*) mask, h)) { + if (errno != ENOENT) + return -errno; + } + } + } + + if (!iptc_commit(h)) + return -errno; + + return 0; +} diff --git a/src/shared/fw-util.h b/src/shared/fw-util.h new file mode 100644 index 000000000..698cc43da --- /dev/null +++ b/src/shared/fw-util.h @@ -0,0 +1,82 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "in-addr-util.h" + +#ifdef HAVE_LIBIPTC + +int fw_add_masquerade( + bool add, + int af, + int protocol, + const union in_addr_union *source, + unsigned source_prefixlen, + const char *out_interface, + const union in_addr_union *destination, + unsigned destination_prefixlen); + +int fw_add_local_dnat( + bool add, + int af, + int protocol, + const char *in_interface, + const union in_addr_union *source, + unsigned source_prefixlen, + const union in_addr_union *destination, + unsigned destination_prefixlen, + uint16_t local_port, + const union in_addr_union *remote, + uint16_t remote_port, + const union in_addr_union *previous_remote); + +#else + +static inline int fw_add_masquerade( + bool add, + int af, + int protocol, + const union in_addr_union *source, + unsigned source_prefixlen, + const char *out_interface, + const union in_addr_union *destination, + unsigned destination_prefixlen) { + return -ENOTSUP; +} + +static inline int fw_add_local_dnat( + bool add, + int af, + int protocol, + const char *in_interface, + const union in_addr_union *source, + unsigned source_prefixlen, + const union in_addr_union *destination, + unsigned destination_prefixlen, + uint16_t local_port, + const union in_addr_union *remote, + uint16_t remote_port, + const union in_addr_union *previous_remote) { + return -ENOTSUP; +} + +#endif diff --git a/src/shared/generator.c b/src/shared/generator.c index 465e5f6cc..7f16d5cbe 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -28,6 +28,7 @@ #include "unit-name.h" #include "generator.h" #include "path-util.h" +#include "fstab-util.h" #include "dropin.h" int generator_write_fsck_deps( @@ -61,7 +62,7 @@ int generator_write_fsck_deps( if (streq(where, "/")) { char *lnk; - lnk = strappenda(dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service"); + lnk = strjoina(dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service"); mkdir_parents(lnk, 0755); if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-fsck-root.service", lnk) < 0) @@ -92,42 +93,16 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher * endless device timeouts for devices that show up only after * user input, like crypto devices. */ - _cleanup_free_ char *node = NULL, *unit = NULL, *t = NULL; - char *start, *timeout; + _cleanup_free_ char *node = NULL, *unit = NULL, *timeout = NULL; usec_t u; int r; - size_t len; - - if ((start = mount_test_option(opts, "comment=systemd.device-timeout"))) - timeout = start + 31; - else if ((start = mount_test_option(opts, "x-systemd.device-timeout"))) - timeout = start + 25; - else { - if (filtered) { - *filtered = strdup(opts ?: ""); - if (!*filtered) - return log_oom(); - } - return 0; - } - - len = strcspn(timeout, ",;" WHITESPACE); - t = strndup(timeout, len); - if (!t) - return -ENOMEM; - - if (filtered) { - char *prefix, *postfix; + r = fstab_filter_options(opts, "comment=systemd.device-timeout\0" "x-systemd.device-timeout\0", + NULL, &timeout, filtered); + if (r <= 0) + return r; - prefix = strndupa(opts, start - opts - (start != opts)); - postfix = timeout + len + (start == opts && timeout[len] != '\0'); - *filtered = strjoin(prefix, *postfix ? postfix : NULL, NULL); - if (!*filtered) - return log_oom(); - } - - r = parse_sec(t, &u); + r = parse_sec(timeout, &u); if (r < 0) { log_warning("Failed to parse timeout for %s, ignoring: %s", where, timeout); @@ -140,7 +115,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher unit = unit_name_from_path(node, ".device"); if (!unit) - return -ENOMEM; + return log_oom(); return write_drop_in_format(dir, unit, 50, "device-timeout", "# Automatically generated by %s\n\n" diff --git a/src/shared/gpt.h b/src/shared/gpt.h index ef3444f6e..add1df420 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#pragma once + #include #include "sd-id128.h" @@ -57,3 +59,5 @@ * just because we saw no point in defining any other values here. */ #define GPT_FLAG_READ_ONLY (1ULL << 60) #define GPT_FLAG_NO_AUTO (1ULL << 63) + +#define GPT_LINUX_GENERIC SD_ID128_MAKE(0f,c6,3d,af,84,83,47,72,8e,79,3d,69,d8,47,7d,e4) diff --git a/src/shared/gunicode.h b/src/shared/gunicode.h index a4b2934a4..e70818fdd 100644 --- a/src/shared/gunicode.h +++ b/src/shared/gunicode.h @@ -4,6 +4,8 @@ * Copyright 2000, 2005 Red Hat, Inc. */ +#pragma once + #include #include #include diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 5b329e085..e63ba4bb5 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -137,7 +137,7 @@ typedef uint8_t dib_raw_t; #define DIB_FREE UINT_MAX -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP struct hashmap_debug_info { LIST_FIELDS(struct hashmap_debug_info, debug_list); unsigned max_entries; /* high watermark of n_entries */ @@ -158,9 +158,9 @@ static LIST_HEAD(struct hashmap_debug_info, hashmap_debug_list); #define HASHMAP_DEBUG_FIELDS struct hashmap_debug_info debug; -#else /* !ENABLE_HASHMAP_DEBUG */ +#else /* !ENABLE_DEBUG_HASHMAP */ #define HASHMAP_DEBUG_FIELDS -#endif /* ENABLE_HASHMAP_DEBUG */ +#endif /* ENABLE_DEBUG_HASHMAP */ enum HashmapType { HASHMAP_TYPE_PLAIN, @@ -482,7 +482,7 @@ static unsigned skip_free_buckets(HashmapBase *h, unsigned idx) { } static void bucket_mark_free(HashmapBase *h, unsigned idx) { - memset(bucket_at(h, idx), 0, hashmap_type_info[h->type].entry_size); + memzero(bucket_at(h, idx), hashmap_type_info[h->type].entry_size); bucket_set_dib(h, idx, DIB_FREE); } @@ -552,7 +552,7 @@ static void base_remove_entry(HashmapBase *h, unsigned idx) { dibs = dib_raw_ptr(h); assert(dibs[idx] != DIB_RAW_FREE); -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP h->debug.rem_count++; h->debug.last_rem_idx = idx; #endif @@ -631,7 +631,7 @@ static unsigned hashmap_iterate_in_insertion_order(OrderedHashmap *h, Iterator * assert(e->p.b.key == i->next_key); } -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP i->prev_idx = idx; #endif @@ -688,7 +688,7 @@ static unsigned hashmap_iterate_in_internal_order(HashmapBase *h, Iterator *i) { } idx = i->idx; -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP i->prev_idx = idx; #endif @@ -711,7 +711,7 @@ static unsigned hashmap_iterate_entry(HashmapBase *h, Iterator *i) { return IDX_NIL; } -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP if (i->idx == IDX_FIRST) { i->put_count = h->debug.put_count; i->rem_count = h->debug.rem_count; @@ -799,7 +799,7 @@ static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enu shared_hash_key_initialized= true; } -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP LIST_PREPEND(debug_list, hashmap_debug_list, &h->debug); h->debug.func = func; h->debug.file = file; @@ -854,7 +854,7 @@ static void hashmap_free_no_clear(HashmapBase *h) { assert(!h->has_indirect); assert(!h->n_direct_entries); -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP LIST_REMOVE(debug_list, hashmap_debug_list, &h->debug); #endif @@ -961,7 +961,7 @@ static bool hashmap_put_robin_hood(HashmapBase *h, unsigned idx, dib_raw_t raw_dib, *dibs; unsigned dib, distance; -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP h->debug.put_count++; #endif @@ -1055,7 +1055,7 @@ static int hashmap_base_put_boldly(HashmapBase *h, unsigned idx, assert_se(hashmap_put_robin_hood(h, idx, swap) == false); n_entries_inc(h); -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP h->debug.max_entries = MAX(h->debug.max_entries, n_entries(h)); #endif @@ -1066,7 +1066,7 @@ static int hashmap_base_put_boldly(HashmapBase *h, unsigned idx, /* * Returns 0 if resize is not needed. - * 1 if succesfully resized. + * 1 if successfully resized. * -ENOMEM on allocation failure. */ static int resize_buckets(HashmapBase *h, unsigned entries_add) { @@ -1154,7 +1154,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) { } /* Zero the area of newly added entries (including the old DIB area) */ - memset(bucket_at(h, old_n_buckets), 0, + memzero(bucket_at(h, old_n_buckets), (n_buckets(h) - old_n_buckets) * hi->entry_size); /* The upper half of the new DIB array needs initialization */ @@ -1182,7 +1182,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) { new_dibs[idx] = DIB_RAW_FREE; bucket_move_entry(h, &swap, idx, IDX_PUT); /* bucket_move_entry does not clear the source */ - memset(bucket_at(h, idx), 0, hi->entry_size); + memzero(bucket_at(h, idx), hi->entry_size); do { /* @@ -1283,7 +1283,7 @@ int hashmap_replace(Hashmap *h, const void *key, void *value) { idx = bucket_scan(h, hash, key); if (idx != IDX_NIL) { e = plain_bucket_at(h, idx); -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP /* Although the key is equal, the key pointer may have changed, * and this would break our assumption for iterating. So count * this operation as incompatible with iteration. */ diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h index 9c6e0cab1..894f67939 100644 --- a/src/shared/hashmap.h +++ b/src/shared/hashmap.h @@ -32,7 +32,7 @@ * will be treated as empty hashmap for all read operations. That way it is not * necessary to instantiate an object for each Hashmap use. * - * If ENABLE_HASHMAP_DEBUG is defined (by configuring with --enable-hashmap-debug), + * If ENABLE_DEBUG_HASHMAP is defined (by configuring with --enable-debug=hashmap), * the implemention will: * - store extra data for debugging and statistics (see tools/gdb-sd_dump_hashmaps.py) * - perform extra checks for invalid use of iterators @@ -43,7 +43,7 @@ /* The base type for all hashmap and set types. Many functions in the * implementation take (HashmapBase*) parameters and are run-time polymorphic, * though the API is not meant to be polymorphic (do not call functions - * prefixed with two underscores directly). */ + * internal_*() directly). */ typedef struct HashmapBase HashmapBase; /* Specific hashmap/set types */ @@ -57,7 +57,7 @@ typedef struct Set Set; /* Stores just keys */ typedef struct { unsigned idx; /* index of an entry to be iterated next */ const void *next_key; /* expected value of that entry's key pointer */ -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP unsigned put_count; /* hashmap's put_count recorded at start of iteration */ unsigned rem_count; /* hashmap's rem_count in previous iteration */ unsigned prev_idx; /* idx in previous iteration */ @@ -129,7 +129,7 @@ extern const struct hash_ops devt_hash_ops = { (Hashmap*)(h), \ (void)0) -#ifdef ENABLE_HASHMAP_DEBUG +#ifdef ENABLE_DEBUG_HASHMAP # define HASHMAP_DEBUG_PARAMS , const char *func, const char *file, int line # define HASHMAP_DEBUG_SRC_ARGS , __func__, __FILE__, __LINE__ # define HASHMAP_DEBUG_PASS_ARGS , func, file, line diff --git a/src/shared/import-util.c b/src/shared/import-util.c new file mode 100644 index 000000000..660d92ac5 --- /dev/null +++ b/src/shared/import-util.c @@ -0,0 +1,182 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "util.h" +#include "import-util.h" + +int import_url_last_component(const char *url, char **ret) { + const char *e, *p; + char *s; + + e = strchrnul(url, '?'); + + while (e > url && e[-1] == '/') + e--; + + p = e; + while (p > url && p[-1] != '/') + p--; + + if (e <= p) + return -EINVAL; + + s = strndup(p, e - p); + if (!s) + return -ENOMEM; + + *ret = s; + return 0; +} + + +int import_url_change_last_component(const char *url, const char *suffix, char **ret) { + const char *e; + char *s; + + assert(url); + assert(ret); + + e = strchrnul(url, '?'); + + while (e > url && e[-1] == '/') + e--; + + while (e > url && e[-1] != '/') + e--; + + if (e <= url) + return -EINVAL; + + s = new(char, (e - url) + strlen(suffix) + 1); + if (!s) + return -ENOMEM; + + strcpy(mempcpy(s, url, e - url), suffix); + *ret = s; + return 0; +} + +static const char* const import_verify_table[_IMPORT_VERIFY_MAX] = { + [IMPORT_VERIFY_NO] = "no", + [IMPORT_VERIFY_CHECKSUM] = "checksum", + [IMPORT_VERIFY_SIGNATURE] = "signature", +}; + +DEFINE_STRING_TABLE_LOOKUP(import_verify, ImportVerify); + +int tar_strip_suffixes(const char *name, char **ret) { + const char *e; + char *s; + + e = endswith(name, ".tar"); + if (!e) + e = endswith(name, ".tar.xz"); + if (!e) + e = endswith(name, ".tar.gz"); + if (!e) + e = endswith(name, ".tar.bz2"); + if (!e) + e = endswith(name, ".tgz"); + if (!e) + e = strchr(name, 0); + + if (e <= name) + return -EINVAL; + + s = strndup(name, e - name); + if (!s) + return -ENOMEM; + + *ret = s; + return 0; +} + +int raw_strip_suffixes(const char *p, char **ret) { + + static const char suffixes[] = + ".xz\0" + ".gz\0" + ".bz2\0" + ".raw\0" + ".qcow2\0" + ".img\0" + ".bin\0"; + + _cleanup_free_ char *q = NULL; + + q = strdup(p); + if (!q) + return -ENOMEM; + + for (;;) { + const char *sfx; + bool changed = false; + + NULSTR_FOREACH(sfx, suffixes) { + char *e; + + e = endswith(q, sfx); + if (e) { + *e = 0; + changed = true; + } + } + + if (!changed) + break; + } + + *ret = q; + q = NULL; + + return 0; +} + +bool dkr_name_is_valid(const char *name) { + const char *slash, *p; + + if (isempty(name)) + return false; + + slash = strchr(name, '/'); + if (!slash) + return false; + + if (!filename_is_valid(slash + 1)) + return false; + + p = strndupa(name, slash - name); + if (!filename_is_valid(p)) + return false; + + return true; +} + +bool dkr_id_is_valid(const char *id) { + + if (!filename_is_valid(id)) + return false; + + if (!in_charset(id, "0123456789abcdef")) + return false; + + return true; +} diff --git a/src/shared/import-util.h b/src/shared/import-util.h new file mode 100644 index 000000000..ff155b0ff --- /dev/null +++ b/src/shared/import-util.h @@ -0,0 +1,47 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "macro.h" + +typedef enum ImportVerify { + IMPORT_VERIFY_NO, + IMPORT_VERIFY_CHECKSUM, + IMPORT_VERIFY_SIGNATURE, + _IMPORT_VERIFY_MAX, + _IMPORT_VERIFY_INVALID = -1, +} ImportVerify; + +int import_url_last_component(const char *url, char **ret); +int import_url_change_last_component(const char *url, const char *suffix, char **ret); + +const char* import_verify_to_string(ImportVerify v) _const_; +ImportVerify import_verify_from_string(const char *s) _pure_; + +int tar_strip_suffixes(const char *name, char **ret); +int raw_strip_suffixes(const char *name, char **ret); + +bool dkr_name_is_valid(const char *name); +bool dkr_id_is_valid(const char *id); +#define dkr_tag_is_valid(tag) filename_is_valid(tag) diff --git a/src/shared/in-addr-util.c b/src/shared/in-addr-util.c index 9dc9ec82b..d88864b59 100644 --- a/src/shared/in-addr-util.c +++ b/src/shared/in-addr-util.c @@ -243,12 +243,25 @@ int in_addr_from_string_auto(const char *s, int *family, union in_addr_union *re return -EINVAL; } -unsigned in_addr_netmask_to_prefixlen(const struct in_addr *addr) { +unsigned char in_addr_netmask_to_prefixlen(const struct in_addr *addr) { assert(addr); return 32 - u32ctz(be32toh(addr->s_addr)); } +struct in_addr* in_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char prefixlen) { + assert(addr); + assert(prefixlen <= 32); + + /* Shifting beyond 32 is not defined, handle this specially. */ + if (prefixlen == 0) + addr->s_addr = 0; + else + addr->s_addr = htobe32((0xffffffff << (32 - prefixlen)) & 0xffffffff); + + return addr; +} + int in_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen) { uint8_t msb_octet = *(uint8_t*) addr; @@ -284,9 +297,42 @@ int in_addr_default_subnet_mask(const struct in_addr *addr, struct in_addr *mask if (r < 0) return r; - assert(prefixlen > 0 && prefixlen < 32); + in_addr_prefixlen_to_netmask(mask, prefixlen); + return 0; +} + +int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen) { + assert(addr); - mask->s_addr = htobe32((0xffffffff << (32 - prefixlen)) & 0xffffffff); + if (family == AF_INET) { + struct in_addr mask; - return 0; + if (!in_addr_prefixlen_to_netmask(&mask, prefixlen)) + return -EINVAL; + + addr->in.s_addr &= mask.s_addr; + return 0; + } + + if (family == AF_INET6) { + unsigned i; + + for (i = 0; i < 16; i++) { + uint8_t mask; + + if (prefixlen >= 8) { + mask = 0xFF; + prefixlen -= 8; + } else { + mask = 0xFF << (8 - prefixlen); + prefixlen = 0; + } + + addr->in6.s6_addr[i] &= mask; + } + + return 0; + } + + return -EAFNOSUPPORT; } diff --git a/src/shared/in-addr-util.h b/src/shared/in-addr-util.h index 8da030ceb..51af08868 100644 --- a/src/shared/in-addr-util.h +++ b/src/shared/in-addr-util.h @@ -39,11 +39,15 @@ int in_addr_prefix_next(int family, union in_addr_union *u, unsigned prefixlen); int in_addr_to_string(int family, const union in_addr_union *u, char **ret); int in_addr_from_string(int family, const char *s, union in_addr_union *ret); int in_addr_from_string_auto(const char *s, int *family, union in_addr_union *ret); -unsigned in_addr_netmask_to_prefixlen(const struct in_addr *addr); +unsigned char in_addr_netmask_to_prefixlen(const struct in_addr *addr); +struct in_addr* in_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char prefixlen); int in_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen); int in_addr_default_subnet_mask(const struct in_addr *addr, struct in_addr *mask); +int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen); static inline size_t FAMILY_ADDRESS_SIZE(int family) { assert(family == AF_INET || family == AF_INET6); return family == AF_INET6 ? 16 : 4; } + +#define IN_ADDR_NULL ((union in_addr_union) {}) diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c index 1ee1243f4..d853f1777 100644 --- a/src/shared/install-printf.c +++ b/src/shared/install-printf.c @@ -103,7 +103,7 @@ static int specifier_user_name(char specifier, void *data, void *userdata, char if (r < 0) return r; - if (asprintf(&printed, "%d", uid) < 0) + if (asprintf(&printed, UID_FMT, uid) < 0) return -ENOMEM; break; }} diff --git a/src/shared/install.c b/src/shared/install.c index efbe61e87..65f1c245c 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -58,22 +58,6 @@ static int in_search_path(const char *path, char **search) { return strv_contains(search, parent); } -static int lookup_paths_init_from_scope(LookupPaths *paths, - UnitFileScope scope, - const char *root_dir) { - assert(paths); - assert(scope >= 0); - assert(scope < _UNIT_FILE_SCOPE_MAX); - - zero(*paths); - - return lookup_paths_init(paths, - scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER, - scope == UNIT_FILE_USER, - root_dir, - NULL, NULL, NULL); -} - static int get_config_path(UnitFileScope scope, bool runtime, const char *root_dir, char **ret) { char *p = NULL; int r; @@ -240,7 +224,7 @@ static int remove_marked_symlinks_fd( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; dirent_ensure_type(d, de); @@ -415,7 +399,7 @@ static int find_symlinks_fd( if (!de) return r; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; dirent_ensure_type(d, de); @@ -1064,7 +1048,7 @@ static int unit_file_load( assert(path); if (!isempty(root_dir)) - path = strappenda(root_dir, "/", path); + path = strjoina(root_dir, "/", path); if (!load) { r = access(path, F_OK) ? -errno : 0; @@ -1746,7 +1730,7 @@ int unit_file_set_default( if (r < 0) return r; - path = strappenda(config_path, "/" SPECIAL_DEFAULT_TARGET); + path = strjoina(config_path, "/" SPECIAL_DEFAULT_TARGET); r = create_symlink(i->path, path, force, changes, n_changes); if (r < 0) @@ -2094,7 +2078,7 @@ int unit_file_preset_all( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (!unit_name_is_valid(de->d_name, TEMPLATE_VALID)) @@ -2206,7 +2190,7 @@ int unit_file_get_list( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (!unit_name_is_valid(de->d_name, TEMPLATE_VALID)) diff --git a/src/shared/json.c b/src/shared/json.c new file mode 100644 index 000000000..bb3d26f0e --- /dev/null +++ b/src/shared/json.c @@ -0,0 +1,446 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "macro.h" +#include "log.h" +#include "util.h" +#include "utf8.h" +#include "json.h" + +enum { + STATE_NULL, + STATE_VALUE, + STATE_VALUE_POST, +}; + +static void inc_lines(unsigned *line, const char *s, size_t n) { + const char *p = s; + + if (!line) + return; + + for (;;) { + const char *f; + + f = memchr(p, '\n', n); + if (!f) + return; + + n -= (f - p) + 1; + p = f + 1; + (*line)++; + } +} + +static int unhex_ucs2(const char *c, uint16_t *ret) { + int aa, bb, cc, dd; + uint16_t x; + + assert(c); + assert(ret); + + aa = unhexchar(c[0]); + if (aa < 0) + return -EINVAL; + + bb = unhexchar(c[1]); + if (bb < 0) + return -EINVAL; + + cc = unhexchar(c[2]); + if (cc < 0) + return -EINVAL; + + dd = unhexchar(c[3]); + if (dd < 0) + return -EINVAL; + + x = ((uint16_t) aa << 12) | + ((uint16_t) bb << 8) | + ((uint16_t) cc << 4) | + ((uint16_t) dd); + + if (x <= 0) + return -EINVAL; + + *ret = x; + + return 0; +} + +static int json_parse_string(const char **p, char **ret) { + _cleanup_free_ char *s = NULL; + size_t n = 0, allocated = 0; + const char *c; + + assert(p); + assert(*p); + assert(ret); + + c = *p; + + if (*c != '"') + return -EINVAL; + + c++; + + for (;;) { + int len; + + /* Check for EOF */ + if (*c == 0) + return -EINVAL; + + /* Check for control characters 0x00..0x1f */ + if (*c > 0 && *c < ' ') + return -EINVAL; + + /* Check for control character 0x7f */ + if (*c == 0x7f) + return -EINVAL; + + if (*c == '"') { + if (!s) { + s = strdup(""); + if (!s) + return -ENOMEM; + } else + s[n] = 0; + + *p = c + 1; + + *ret = s; + s = NULL; + return JSON_STRING; + } + + if (*c == '\\') { + char ch = 0; + c++; + + if (*c == 0) + return -EINVAL; + + if (IN_SET(*c, '"', '\\', '/')) + ch = *c; + else if (*c == 'b') + ch = '\b'; + else if (*c == 'f') + ch = '\f'; + else if (*c == 'n') + ch = '\n'; + else if (*c == 'r') + ch = '\r'; + else if (*c == 't') + ch = '\t'; + else if (*c == 'u') { + uint16_t x; + int r; + + r = unhex_ucs2(c + 1, &x); + if (r < 0) + return r; + + c += 5; + + if (!GREEDY_REALLOC(s, allocated, n + 4)) + return -ENOMEM; + + if (!utf16_is_surrogate(x)) + n += utf8_encode_unichar(s + n, x); + else if (utf16_is_trailing_surrogate(x)) + return -EINVAL; + else { + uint16_t y; + + if (c[0] != '\\' || c[1] != 'u') + return -EINVAL; + + r = unhex_ucs2(c + 2, &y); + if (r < 0) + return r; + + c += 6; + + if (!utf16_is_trailing_surrogate(y)) + return -EINVAL; + + n += utf8_encode_unichar(s + n, utf16_surrogate_pair_to_unichar(x, y)); + } + + continue; + } else + return -EINVAL; + + if (!GREEDY_REALLOC(s, allocated, n + 2)) + return -ENOMEM; + + s[n++] = ch; + c ++; + continue; + } + + len = utf8_encoded_valid_unichar(c); + if (len < 0) + return len; + + if (!GREEDY_REALLOC(s, allocated, n + len + 1)) + return -ENOMEM; + + memcpy(s + n, c, len); + n += len; + c += len; + } +} + +static int json_parse_number(const char **p, union json_value *ret) { + bool negative = false, exponent_negative = false, is_double = false; + double x = 0.0, y = 0.0, exponent = 0.0, shift = 1.0; + intmax_t i = 0; + const char *c; + + assert(p); + assert(*p); + assert(ret); + + c = *p; + + if (*c == '-') { + negative = true; + c++; + } + + if (*c == '0') + c++; + else { + if (!strchr("123456789", *c) || *c == 0) + return -EINVAL; + + do { + if (!is_double) { + int64_t t; + + t = 10 * i + (*c - '0'); + if (t < i) /* overflow */ + is_double = false; + else + i = t; + } + + x = 10.0 * x + (*c - '0'); + c++; + } while (strchr("0123456789", *c) && *c != 0); + } + + if (*c == '.') { + is_double = true; + c++; + + if (!strchr("0123456789", *c) || *c == 0) + return -EINVAL; + + do { + y = 10.0 * y + (*c - '0'); + shift = 10.0 * shift; + c++; + } while (strchr("0123456789", *c) && *c != 0); + } + + if (*c == 'e' || *c == 'E') { + is_double = true; + c++; + + if (*c == '-') { + exponent_negative = true; + c++; + } else if (*c == '+') + c++; + + if (!strchr("0123456789", *c) || *c == 0) + return -EINVAL; + + do { + exponent = 10.0 * exponent + (*c - '0'); + c++; + } while (strchr("0123456789", *c) && *c != 0); + } + + if (*c != 0) + return -EINVAL; + + *p = c; + + if (is_double) { + ret->real = ((negative ? -1.0 : 1.0) * (x + (y / shift))) * exp10((exponent_negative ? -1.0 : 1.0) * exponent); + return JSON_REAL; + } else { + ret->integer = negative ? -i : i; + return JSON_INTEGER; + } +} + +int json_tokenize( + const char **p, + char **ret_string, + union json_value *ret_value, + void **state, + unsigned *line) { + + const char *c; + int t; + int r; + + assert(p); + assert(*p); + assert(ret_string); + assert(ret_value); + assert(state); + + t = PTR_TO_INT(*state); + c = *p; + + if (t == STATE_NULL) { + if (line) + *line = 1; + t = STATE_VALUE; + } + + for (;;) { + const char *b; + + b = c + strspn(c, WHITESPACE); + if (*b == 0) + return JSON_END; + + inc_lines(line, c, b - c); + c = b; + + switch (t) { + + case STATE_VALUE: + + if (*c == '{') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE); + return JSON_OBJECT_OPEN; + + } else if (*c == '}') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_OBJECT_CLOSE; + + } else if (*c == '[') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE); + return JSON_ARRAY_OPEN; + + } else if (*c == ']') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_ARRAY_CLOSE; + + } else if (*c == '"') { + r = json_parse_string(&c, ret_string); + if (r < 0) + return r; + + *ret_value = JSON_VALUE_NULL; + *p = c; + *state = INT_TO_PTR(STATE_VALUE_POST); + return r; + + } else if (strchr("-0123456789", *c)) { + r = json_parse_number(&c, ret_value); + if (r < 0) + return r; + + *ret_string = NULL; + *p = c; + *state = INT_TO_PTR(STATE_VALUE_POST); + return r; + + } else if (startswith(c, "true")) { + *ret_string = NULL; + ret_value->boolean = true; + *p = c + 4; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_BOOLEAN; + + } else if (startswith(c, "false")) { + *ret_string = NULL; + ret_value->boolean = false; + *p = c + 5; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_BOOLEAN; + + } else if (startswith(c, "null")) { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 4; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_NULL; + + } else + return -EINVAL; + + case STATE_VALUE_POST: + + if (*c == ':') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE); + return JSON_COLON; + } else if (*c == ',') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE); + return JSON_COMMA; + } else if (*c == '}') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_OBJECT_CLOSE; + } else if (*c == ']') { + *ret_string = NULL; + *ret_value = JSON_VALUE_NULL; + *p = c + 1; + *state = INT_TO_PTR(STATE_VALUE_POST); + return JSON_ARRAY_CLOSE; + } else + return -EINVAL; + } + + } +} diff --git a/src/shared/json.h b/src/shared/json.h new file mode 100644 index 000000000..a8457132e --- /dev/null +++ b/src/shared/json.h @@ -0,0 +1,50 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +enum { + JSON_END, + JSON_COLON, + JSON_COMMA, + JSON_OBJECT_OPEN, + JSON_OBJECT_CLOSE, + JSON_ARRAY_OPEN, + JSON_ARRAY_CLOSE, + JSON_STRING, + JSON_REAL, + JSON_INTEGER, + JSON_BOOLEAN, + JSON_NULL, +}; + +union json_value { + bool boolean; + double real; + intmax_t integer; +}; + +#define JSON_VALUE_NULL ((union json_value) {}) + +int json_tokenize(const char **p, char **ret_string, union json_value *ret_value, void **state, unsigned *line); diff --git a/src/shared/label.c b/src/shared/label.c index 0af41afa7..82f10b21b 100644 --- a/src/shared/label.c +++ b/src/shared/label.c @@ -19,8 +19,10 @@ along with systemd; If not, see . ***/ -#include "label.h" +#include "selinux-util.h" +#include "smack-util.h" #include "util.h" +#include "label.h" int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) { int r, q; diff --git a/src/shared/label.h b/src/shared/label.h index 3428a8bb7..8070bcb02 100644 --- a/src/shared/label.h +++ b/src/shared/label.h @@ -21,8 +21,8 @@ along with systemd; If not, see . ***/ -#include "selinux-util.h" -#include "smack-util.h" +#include +#include int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs); diff --git a/src/shared/list.h b/src/shared/list.h index c020f7e93..2939216ad 100644 --- a/src/shared/list.h +++ b/src/shared/list.h @@ -55,6 +55,14 @@ *_head = _item; \ } while(false) +/* Append an item to the list */ +#define LIST_APPEND(name,head,item) \ + do { \ + typeof(*(head)) *_tail; \ + LIST_FIND_TAIL(name,head,_tail); \ + LIST_INSERT_AFTER(name,head,_tail,item); \ + } while(false) + /* Remove an item from the list */ #define LIST_REMOVE(name,head,item) \ do { \ @@ -130,6 +138,18 @@ #define LIST_FOREACH_AFTER(name,i,p) \ for ((i) = (p)->name##_next; (i); (i) = (i)->name##_next) +/* Iterate through all the members of the list p is included in, but skip over p */ +#define LIST_FOREACH_OTHERS(name,i,p) \ + for (({ \ + (i) = (p); \ + while ((i) && (i)->name##_prev) \ + (i) = (i)->name##_prev; \ + if ((i) == (p)) \ + (i) = (p)->name##_next; \ + }); \ + (i); \ + (i) = (i)->name##_next == (p) ? (p)->name##_next : (i)->name##_next) + /* Loop starting from p->next until p->prev. p can be adjusted meanwhile. */ #define LIST_LOOP_BUT_ONE(name,i,head,p) \ diff --git a/src/shared/locale-util.c b/src/shared/locale-util.c index 9addb05f0..61db9a812 100644 --- a/src/shared/locale-util.c +++ b/src/shared/locale-util.c @@ -195,7 +195,7 @@ bool locale_is_valid(const char *name) { if (!utf8_is_valid(name)) return false; - if (!filename_is_safe(name)) + if (!filename_is_valid(name)) return false; if (!string_is_safe(name)) diff --git a/src/shared/log.c b/src/shared/log.c index af1a932c8..646a1d638 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -314,19 +314,23 @@ static int write_to_console( const char *object, const char *buffer) { - char location[64]; - struct iovec iovec[5] = {}; + char location[64], prefix[1 + DECIMAL_STR_MAX(int) + 2]; + struct iovec iovec[6] = {}; unsigned n = 0; bool highlight; if (console_fd < 0) return 0; + if (log_target == LOG_TARGET_CONSOLE_PREFIXED) { + sprintf(prefix, "<%i>", level); + IOVEC_SET_STRING(iovec[n++], prefix); + } + highlight = LOG_PRI(level) <= LOG_ERR && show_color; if (show_location) { - snprintf(location, sizeof(location), "(%s:%u) ", file, line); - char_array_0(location); + snprintf(location, sizeof(location), "(%s:%i) ", file, line); IOVEC_SET_STRING(iovec[n++], location); } @@ -370,7 +374,9 @@ static int write_to_syslog( const char *object, const char *buffer) { - char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_time[64], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4]; + char header_priority[2 + DECIMAL_STR_MAX(int) + 1], + header_time[64], + header_pid[4 + DECIMAL_STR_MAX(pid_t) + 1]; struct iovec iovec[5] = {}; struct msghdr msghdr = { .msg_iov = iovec, @@ -382,8 +388,7 @@ static int write_to_syslog( if (syslog_fd < 0) return 0; - snprintf(header_priority, sizeof(header_priority), "<%i>", level); - char_array_0(header_priority); + xsprintf(header_priority, "<%i>", level); t = (time_t) (now(CLOCK_REALTIME) / USEC_PER_SEC); tm = localtime(&t); @@ -393,8 +398,7 @@ static int write_to_syslog( if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0) return -EINVAL; - snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", getpid()); - char_array_0(header_pid); + xsprintf(header_pid, "["PID_FMT"]: ", getpid()); IOVEC_SET_STRING(iovec[0], header_priority); IOVEC_SET_STRING(iovec[1], header_time); @@ -433,17 +437,15 @@ static int write_to_kmsg( const char *object, const char *buffer) { - char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4]; + char header_priority[2 + DECIMAL_STR_MAX(int) + 1], + header_pid[4 + DECIMAL_STR_MAX(pid_t) + 1]; struct iovec iovec[5] = {}; if (kmsg_fd < 0) return 0; - snprintf(header_priority, sizeof(header_priority), "<%i>", level); - char_array_0(header_priority); - - snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", getpid()); - char_array_0(header_pid); + xsprintf(header_priority, "<%i>", level); + xsprintf(header_pid, "["PID_FMT"]: ", getpid()); IOVEC_SET_STRING(iovec[0], header_priority); IOVEC_SET_STRING(iovec[1], program_invocation_short_name); @@ -492,7 +494,6 @@ static int log_do_header( isempty(object) ? "" : object, isempty(object) ? "" : "\n", program_invocation_short_name); - header[size - 1] = '\0'; return 0; } @@ -654,7 +655,6 @@ int log_internalv( errno = error; vsnprintf(buffer, sizeof(buffer), format, ap); - char_array_0(buffer); return log_dispatch(level, error, file, line, func, NULL, NULL, buffer); } @@ -702,7 +702,6 @@ int log_object_internalv( errno = error; vsnprintf(buffer, sizeof(buffer), format, ap); - char_array_0(buffer); return log_dispatch(level, error, file, line, func, object_field, object, buffer); } @@ -744,7 +743,6 @@ static void log_assert( snprintf(buffer, sizeof(buffer), format, text, file, line, func); REENABLE_WARNING; - char_array_0(buffer); log_abort_msg = buffer; log_dispatch(level, 0, file, line, func, NULL, NULL, buffer); @@ -870,7 +868,6 @@ int log_struct_internal( va_copy(aq, ap); vsnprintf(buf, sizeof(buf), format, aq); va_end(aq); - char_array_0(buf); if (startswith(buf, "MESSAGE=")) { found = true; @@ -917,7 +914,9 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { * The systemd.log_xyz= settings are parsed by all tools, and * so is "debug". * - * However, "quiet" is only parsed by PID 1! + * However, "quiet" is only parsed by PID 1, and only turns of + * status output to /dev/console, but does not alter the log + * level. */ if (streq(key, "debug") && !value) @@ -950,7 +949,11 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { void log_parse_environment(void) { const char *e; - (void) parse_proc_cmdline(parse_proc_cmdline_item); + if (get_ctty_devnr(0, NULL) < 0) + /* Only try to read the command line in daemons. + We assume that anything that has a controlling + tty is user stuff. */ + (void) parse_proc_cmdline(parse_proc_cmdline_item); e = secure_getenv("SYSTEMD_LOG_TARGET"); if (e && log_set_target_from_string(e) < 0) @@ -1016,7 +1019,8 @@ int log_show_location_from_string(const char *e) { } bool log_on_console(void) { - if (log_target == LOG_TARGET_CONSOLE) + if (log_target == LOG_TARGET_CONSOLE || + log_target == LOG_TARGET_CONSOLE_PREFIXED) return true; return syslog_fd < 0 && kmsg_fd < 0 && journal_fd < 0; @@ -1024,6 +1028,7 @@ bool log_on_console(void) { static const char *const log_target_table[_LOG_TARGET_MAX] = { [LOG_TARGET_CONSOLE] = "console", + [LOG_TARGET_CONSOLE_PREFIXED] = "console-prefixed", [LOG_TARGET_KMSG] = "kmsg", [LOG_TARGET_JOURNAL] = "journal", [LOG_TARGET_JOURNAL_OR_KMSG] = "journal-or-kmsg", @@ -1043,7 +1048,7 @@ void log_received_signal(int level, const struct signalfd_siginfo *si) { get_process_comm(si->ssi_pid, &p); log_full(level, - "Received SIG%s from PID "PID_FMT" (%s).", + "Received SIG%s from PID %"PRIu32" (%s).", signal_to_string(si->ssi_signo), si->ssi_pid, strna(p)); } else diff --git a/src/shared/log.h b/src/shared/log.h index 2b6971f24..2889e1e77 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -34,6 +34,7 @@ typedef enum LogTarget{ LOG_TARGET_CONSOLE, + LOG_TARGET_CONSOLE_PREFIXED, LOG_TARGET_KMSG, LOG_TARGET_JOURNAL, LOG_TARGET_JOURNAL_OR_KMSG, @@ -158,7 +159,7 @@ void log_assert_failed_return( #define log_full_errno(level, error, ...) \ ({ \ int _l = (level), _e = (error); \ - (log_get_max_level() >= _l) \ + (log_get_max_level() >= LOG_PRI(_l)) \ ? log_internal(_l, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ : -abs(_e); \ }) diff --git a/src/shared/login-shared.h b/src/shared/login-shared.h index b2787c9c6..a79f20c1b 100644 --- a/src/shared/login-shared.h +++ b/src/shared/login-shared.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#pragma once + #include bool session_id_valid(const char *id); diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 98972eda3..c2495056d 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -1033,10 +1033,10 @@ int add_matches_for_unit(sd_journal *j, const char *unit) { assert(j); assert(unit); - m1 = strappenda("_SYSTEMD_UNIT=", unit); - m2 = strappenda("COREDUMP_UNIT=", unit); - m3 = strappenda("UNIT=", unit); - m4 = strappenda("OBJECT_SYSTEMD_UNIT=", unit); + m1 = strjoina("_SYSTEMD_UNIT=", unit); + m2 = strjoina("COREDUMP_UNIT=", unit); + m3 = strjoina("UNIT=", unit); + m4 = strjoina("OBJECT_SYSTEMD_UNIT=", unit); (void)( /* Look for messages from the service itself */ @@ -1080,10 +1080,10 @@ int add_matches_for_user_unit(sd_journal *j, const char *unit, uid_t uid) { assert(j); assert(unit); - m1 = strappenda("_SYSTEMD_USER_UNIT=", unit); - m2 = strappenda("USER_UNIT=", unit); - m3 = strappenda("COREDUMP_USER_UNIT=", unit); - m4 = strappenda("OBJECT_SYSTEMD_USER_UNIT=", unit); + m1 = strjoina("_SYSTEMD_USER_UNIT=", unit); + m2 = strjoina("USER_UNIT=", unit); + m3 = strjoina("COREDUMP_USER_UNIT=", unit); + m4 = strjoina("OBJECT_SYSTEMD_USER_UNIT=", unit); sprintf(muid, "_UID="UID_FMT, uid); (void) ( @@ -1234,12 +1234,12 @@ int show_journal_by_unit( unsigned how_many, uid_t uid, OutputFlags flags, - bool system, + int journal_open_flags, + bool system_unit, bool *ellipsized) { _cleanup_journal_close_ sd_journal*j = NULL; int r; - int jflags = SD_JOURNAL_LOCAL_ONLY | system * SD_JOURNAL_SYSTEM; assert(mode >= 0); assert(mode < _OUTPUT_MODE_MAX); @@ -1248,7 +1248,7 @@ int show_journal_by_unit( if (how_many <= 0) return 0; - r = sd_journal_open(&j, jflags); + r = sd_journal_open(&j, journal_open_flags); if (r < 0) return r; @@ -1256,14 +1256,14 @@ int show_journal_by_unit( if (r < 0) return r; - if (system) + if (system_unit) r = add_matches_for_unit(j, unit); else r = add_matches_for_user_unit(j, unit, uid); if (r < 0) return r; - if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) { + if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) { _cleanup_free_ char *filter; filter = journal_make_match_string(j); diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h index 187ee595f..8d9641e8a 100644 --- a/src/shared/logs-show.h +++ b/src/shared/logs-show.h @@ -25,7 +25,7 @@ #include #include -#include "systemd/sd-journal.h" +#include "sd-journal.h" #include "util.h" #include "output-mode.h" @@ -58,7 +58,8 @@ int show_journal_by_unit( unsigned how_many, uid_t uid, OutputFlags flags, - bool system, + int journal_open_flags, + bool system_unit, bool *ellipsized); void json_escape( diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c new file mode 100644 index 000000000..8d61507e8 --- /dev/null +++ b/src/shared/machine-image.c @@ -0,0 +1,660 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include +#include + +#include "strv.h" +#include "utf8.h" +#include "btrfs-util.h" +#include "path-util.h" +#include "copy.h" +#include "mkdir.h" +#include "machine-image.h" + +static const char image_search_path[] = + "/var/lib/machines\0" + "/var/lib/container\0" + "/usr/local/lib/machines\0" + "/usr/lib/machines\0"; + +Image *image_unref(Image *i) { + if (!i) + return NULL; + + free(i->name); + free(i->path); + free(i); + return NULL; +} + +static int image_new( + ImageType t, + const char *pretty, + const char *path, + const char *filename, + bool read_only, + usec_t crtime, + usec_t mtime, + Image **ret) { + + _cleanup_(image_unrefp) Image *i = NULL; + + assert(t >= 0); + assert(t < _IMAGE_TYPE_MAX); + assert(pretty); + assert(filename); + assert(ret); + + i = new0(Image, 1); + if (!i) + return -ENOMEM; + + i->type = t; + i->read_only = read_only; + i->crtime = crtime; + i->mtime = mtime; + i->usage = i->usage_exclusive = (uint64_t) -1; + i->limit = i->limit_exclusive = (uint64_t) -1; + + i->name = strdup(pretty); + if (!i->name) + return -ENOMEM; + + if (path) + i->path = strjoin(path, "/", filename, NULL); + else + i->path = strdup(filename); + + if (!i->path) + return -ENOMEM; + + path_kill_slashes(i->path); + + *ret = i; + i = NULL; + + return 0; +} + +static int image_make( + const char *pretty, + int dfd, + const char *path, + const char *filename, + Image **ret) { + + struct stat st; + bool read_only; + int r; + + assert(filename); + + /* We explicitly *do* follow symlinks here, since we want to + * allow symlinking trees into /var/lib/machines/, and treat + * them normally. */ + + if (fstatat(dfd, filename, &st, 0) < 0) + return -errno; + + read_only = + (path && path_startswith(path, "/usr")) || + (faccessat(dfd, filename, W_OK, AT_EACCESS) < 0 && errno == EROFS); + + if (S_ISDIR(st.st_mode)) { + _cleanup_close_ int fd = -1; + unsigned file_attr = 0; + + if (!ret) + return 1; + + if (!pretty) + pretty = filename; + + fd = openat(dfd, filename, O_CLOEXEC|O_NOCTTY|O_DIRECTORY); + if (fd < 0) + return -errno; + + /* btrfs subvolumes have inode 256 */ + if (st.st_ino == 256) { + struct statfs sfs; + + if (fstatfs(fd, &sfs) < 0) + return -errno; + + if (F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC)) { + BtrfsSubvolInfo info; + BtrfsQuotaInfo quota; + + /* It's a btrfs subvolume */ + + r = btrfs_subvol_get_info_fd(fd, &info); + if (r < 0) + return r; + + r = image_new(IMAGE_SUBVOLUME, + pretty, + path, + filename, + info.read_only || read_only, + info.otime, + 0, + ret); + if (r < 0) + return r; + + r = btrfs_subvol_get_quota_fd(fd, "a); + if (r >= 0) { + (*ret)->usage = quota.referred; + (*ret)->usage_exclusive = quota.exclusive; + + (*ret)->limit = quota.referred_max; + (*ret)->limit_exclusive = quota.exclusive_max; + } + + return 1; + } + } + + /* If the IMMUTABLE bit is set, we consider the + * directory read-only. Since the ioctl is not + * supported everywhere we ignore failures. */ + (void) read_attr_fd(fd, &file_attr); + + /* It's just a normal directory. */ + r = image_new(IMAGE_DIRECTORY, + pretty, + path, + filename, + read_only || (file_attr & FS_IMMUTABLE_FL), + 0, + 0, + ret); + if (r < 0) + return r; + + return 1; + + } else if (S_ISREG(st.st_mode) && endswith(filename, ".raw")) { + usec_t crtime = 0; + + /* It's a RAW disk image */ + + if (!ret) + return 1; + + fd_getcrtime_at(dfd, filename, &crtime, 0); + + if (!pretty) + pretty = strndupa(filename, strlen(filename) - 4); + + r = image_new(IMAGE_RAW, + pretty, + path, + filename, + !(st.st_mode & 0222) || read_only, + crtime, + timespec_load(&st.st_mtim), + ret); + if (r < 0) + return r; + + (*ret)->usage = (*ret)->usage_exclusive = st.st_blocks * 512; + (*ret)->limit = (*ret)->limit_exclusive = st.st_size; + + return 1; + } + + return 0; +} + +int image_find(const char *name, Image **ret) { + const char *path; + int r; + + assert(name); + + /* There are no images with invalid names */ + if (!image_name_is_valid(name)) + return 0; + + NULSTR_FOREACH(path, image_search_path) { + _cleanup_closedir_ DIR *d = NULL; + + d = opendir(path); + if (!d) { + if (errno == ENOENT) + continue; + + return -errno; + } + + r = image_make(NULL, dirfd(d), path, name, ret); + if (r == 0 || r == -ENOENT) { + _cleanup_free_ char *raw = NULL; + + raw = strappend(name, ".raw"); + if (!raw) + return -ENOMEM; + + r = image_make(NULL, dirfd(d), path, raw, ret); + if (r == 0 || r == -ENOENT) + continue; + } + if (r < 0) + return r; + + return 1; + } + + if (streq(name, ".host")) + return image_make(".host", AT_FDCWD, NULL, "/", ret); + + return 0; +}; + +int image_discover(Hashmap *h) { + const char *path; + int r; + + assert(h); + + NULSTR_FOREACH(path, image_search_path) { + _cleanup_closedir_ DIR *d = NULL; + struct dirent *de; + + d = opendir(path); + if (!d) { + if (errno == ENOENT) + continue; + + return -errno; + } + + FOREACH_DIRENT_ALL(de, d, return -errno) { + _cleanup_(image_unrefp) Image *image = NULL; + + if (!image_name_is_valid(de->d_name)) + continue; + + if (hashmap_contains(h, de->d_name)) + continue; + + r = image_make(NULL, dirfd(d), path, de->d_name, &image); + if (r == 0 || r == -ENOENT) + continue; + if (r < 0) + return r; + + r = hashmap_put(h, image->name, image); + if (r < 0) + return r; + + image = NULL; + } + } + + if (!hashmap_contains(h, ".host")) { + _cleanup_(image_unrefp) Image *image = NULL; + + r = image_make(".host", AT_FDCWD, NULL, "/", &image); + if (r < 0) + return r; + + r = hashmap_put(h, image->name, image); + if (r < 0) + return r; + + image = NULL; + + } + + return 0; +} + +void image_hashmap_free(Hashmap *map) { + Image *i; + + while ((i = hashmap_steal_first(map))) + image_unref(i); + + hashmap_free(map); +} + +int image_remove(Image *i) { + _cleanup_release_lock_file_ LockFile global_lock = LOCK_FILE_INIT, local_lock = LOCK_FILE_INIT; + int r; + + assert(i); + + if (path_equal(i->path, "/") || + path_startswith(i->path, "/usr")) + return -EROFS; + + /* Make sure we don't interfere with a running nspawn */ + r = image_path_lock(i->path, LOCK_EX|LOCK_NB, &global_lock, &local_lock); + if (r < 0) + return r; + + switch (i->type) { + + case IMAGE_SUBVOLUME: + return btrfs_subvol_remove(i->path); + + case IMAGE_DIRECTORY: + /* Allow deletion of read-only directories */ + (void) chattr_path(i->path, false, FS_IMMUTABLE_FL); + + /* fall through */ + + case IMAGE_RAW: + return rm_rf_dangerous(i->path, false, true, false); + + default: + return -ENOTSUP; + } +} + +int image_rename(Image *i, const char *new_name) { + _cleanup_release_lock_file_ LockFile global_lock = LOCK_FILE_INIT, local_lock = LOCK_FILE_INIT, name_lock = LOCK_FILE_INIT; + _cleanup_free_ char *new_path = NULL, *nn = NULL; + unsigned file_attr = 0; + int r; + + assert(i); + + if (!image_name_is_valid(new_name)) + return -EINVAL; + + if (path_equal(i->path, "/") || + path_startswith(i->path, "/usr")) + return -EROFS; + + /* Make sure we don't interfere with a running nspawn */ + r = image_path_lock(i->path, LOCK_EX|LOCK_NB, &global_lock, &local_lock); + if (r < 0) + return r; + + /* Make sure nobody takes the new name, between the time we + * checked it is currently unused in all search paths, and the + * time we take possesion of it */ + r = image_name_lock(new_name, LOCK_EX|LOCK_NB, &name_lock); + if (r < 0) + return r; + + r = image_find(new_name, NULL); + if (r < 0) + return r; + if (r > 0) + return -EEXIST; + + switch (i->type) { + + case IMAGE_DIRECTORY: + /* Turn of the immutable bit while we rename the image, so that we can rename it */ + (void) read_attr_path(i->path, &file_attr); + + if (file_attr & FS_IMMUTABLE_FL) + (void) chattr_path(i->path, false, FS_IMMUTABLE_FL); + + /* fall through */ + + case IMAGE_SUBVOLUME: + new_path = file_in_same_dir(i->path, new_name); + break; + + case IMAGE_RAW: { + const char *fn; + + fn = strjoina(new_name, ".raw"); + new_path = file_in_same_dir(i->path, fn); + break; + } + + default: + return -ENOTSUP; + } + + if (!new_path) + return -ENOMEM; + + nn = strdup(new_name); + if (!nn) + return -ENOMEM; + + if (renameat2(AT_FDCWD, i->path, AT_FDCWD, new_path, RENAME_NOREPLACE) < 0) + return -errno; + + /* Restore the immutable bit, if it was set before */ + if (file_attr & FS_IMMUTABLE_FL) + (void) chattr_path(new_path, true, FS_IMMUTABLE_FL); + + free(i->path); + i->path = new_path; + new_path = NULL; + + free(i->name); + i->name = nn; + nn = NULL; + + return 0; +} + +int image_clone(Image *i, const char *new_name, bool read_only) { + _cleanup_release_lock_file_ LockFile name_lock = LOCK_FILE_INIT; + const char *new_path; + int r; + + assert(i); + + if (!image_name_is_valid(new_name)) + return -EINVAL; + + /* Make sure nobody takes the new name, between the time we + * checked it is currently unused in all search paths, and the + * time we take possesion of it */ + r = image_name_lock(new_name, LOCK_EX|LOCK_NB, &name_lock); + if (r < 0) + return r; + + r = image_find(new_name, NULL); + if (r < 0) + return r; + if (r > 0) + return -EEXIST; + + switch (i->type) { + + case IMAGE_SUBVOLUME: + case IMAGE_DIRECTORY: + new_path = strjoina("/var/lib/machines/", new_name); + + r = btrfs_subvol_snapshot(i->path, new_path, read_only, true); + break; + + case IMAGE_RAW: + new_path = strjoina("/var/lib/machines/", new_name, ".raw"); + + r = copy_file_atomic(i->path, new_path, read_only ? 0444 : 0644, false, FS_NOCOW_FL); + break; + + default: + return -ENOTSUP; + } + + if (r < 0) + return r; + + return 0; +} + +int image_read_only(Image *i, bool b) { + _cleanup_release_lock_file_ LockFile global_lock = LOCK_FILE_INIT, local_lock = LOCK_FILE_INIT; + int r; + assert(i); + + if (path_equal(i->path, "/") || + path_startswith(i->path, "/usr")) + return -EROFS; + + /* Make sure we don't interfere with a running nspawn */ + r = image_path_lock(i->path, LOCK_EX|LOCK_NB, &global_lock, &local_lock); + if (r < 0) + return r; + + switch (i->type) { + + case IMAGE_SUBVOLUME: + r = btrfs_subvol_set_read_only(i->path, b); + if (r < 0) + return r; + + break; + + case IMAGE_DIRECTORY: + /* For simple directory trees we cannot use the access + mode of the top-level directory, since it has an + effect on the container itself. However, we can + use the "immutable" flag, to at least make the + top-level directory read-only. It's not as good as + a read-only subvolume, but at least something, and + we can read the value back.*/ + + r = chattr_path(i->path, b, FS_IMMUTABLE_FL); + if (r < 0) + return r; + + break; + + case IMAGE_RAW: { + struct stat st; + + if (stat(i->path, &st) < 0) + return -errno; + + if (chmod(i->path, (st.st_mode & 0444) | (b ? 0000 : 0200)) < 0) + return -errno; + + /* If the images is now read-only, it's a good time to + * defrag it, given that no write patterns will + * fragment it again. */ + if (b) + (void) btrfs_defrag(i->path); + break; + } + + default: + return -ENOTSUP; + } + + return 0; +} + +int image_path_lock(const char *path, int operation, LockFile *global, LockFile *local) { + _cleanup_free_ char *p = NULL; + LockFile t = LOCK_FILE_INIT; + struct stat st; + int r; + + assert(path); + assert(global); + assert(local); + + /* Locks an image path. This actually creates two locks: one + * "local" one, next to the image path itself, which might be + * shared via NFS. And another "global" one, in /run, that + * uses the device/inode number. This has the benefit that we + * can even lock a tree that is a mount point, correctly. */ + + if (path_equal(path, "/")) + return -EBUSY; + + if (!path_is_absolute(path)) + return -EINVAL; + + if (stat(path, &st) >= 0) { + if (asprintf(&p, "/run/systemd/nspawn/locks/inode-%lu:%lu", (unsigned long) st.st_dev, (unsigned long) st.st_ino) < 0) + return -ENOMEM; + } + + r = make_lock_file_for(path, operation, &t); + if (r < 0) + return r; + + if (p) { + mkdir_p("/run/systemd/nspawn/locks", 0600); + + r = make_lock_file(p, operation, global); + if (r < 0) { + release_lock_file(&t); + return r; + } + } + + *local = t; + return 0; +} + +int image_name_lock(const char *name, int operation, LockFile *ret) { + const char *p; + + assert(name); + assert(ret); + + /* Locks an image name, regardless of the precise path used. */ + + if (!image_name_is_valid(name)) + return -EINVAL; + + if (streq(name, ".host")) + return -EBUSY; + + mkdir_p("/run/systemd/nspawn/locks", 0600); + p = strjoina("/run/systemd/nspawn/locks/name-", name); + + return make_lock_file(p, operation, ret); +} + +bool image_name_is_valid(const char *s) { + if (!filename_is_valid(s)) + return false; + + if (string_has_cc(s, NULL)) + return false; + + if (!utf8_is_valid(s)) + return false; + + /* Temporary files for atomically creating new files */ + if (startswith(s, ".#")) + return false; + + return true; +} + +static const char* const image_type_table[_IMAGE_TYPE_MAX] = { + [IMAGE_DIRECTORY] = "directory", + [IMAGE_SUBVOLUME] = "subvolume", + [IMAGE_RAW] = "raw", +}; + +DEFINE_STRING_TABLE_LOOKUP(image_type, ImageType); diff --git a/src/shared/machine-image.h b/src/shared/machine-image.h new file mode 100644 index 000000000..75fa5f453 --- /dev/null +++ b/src/shared/machine-image.h @@ -0,0 +1,70 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "time-util.h" +#include "hashmap.h" + +typedef enum ImageType { + IMAGE_DIRECTORY, + IMAGE_SUBVOLUME, + IMAGE_RAW, + _IMAGE_TYPE_MAX, + _IMAGE_TYPE_INVALID = -1 +} ImageType; + +typedef struct Image { + ImageType type; + char *name; + char *path; + bool read_only; + + usec_t crtime; + usec_t mtime; + + uint64_t usage; + uint64_t usage_exclusive; + uint64_t limit; + uint64_t limit_exclusive; +} Image; + +Image *image_unref(Image *i); +void image_hashmap_free(Hashmap *map); + +DEFINE_TRIVIAL_CLEANUP_FUNC(Image*, image_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, image_hashmap_free); + +int image_find(const char *name, Image **ret); +int image_discover(Hashmap *map); + +int image_remove(Image *i); +int image_rename(Image *i, const char *new_name); +int image_clone(Image *i, const char *new_name, bool read_only); +int image_read_only(Image *i, bool b); + +const char* image_type_to_string(ImageType t) _const_; +ImageType image_type_from_string(const char *s) _pure_; + +bool image_name_is_valid(const char *s) _pure_; + +int image_path_lock(const char *path, int operation, LockFile *global, LockFile *local); +int image_name_lock(const char *name, int operation, LockFile *ret); diff --git a/src/shared/macro.h b/src/shared/macro.h index 548294e47..7f89951d6 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -67,6 +67,10 @@ _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Wshadow\"") +#define DISABLE_WARNING_INCOMPATIBLE_POINTER_TYPES \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wincompatible-pointer-types\"") + #define REENABLE_WARNING \ _Pragma("GCC diagnostic pop") @@ -197,6 +201,17 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { UNIQ_T(X,xq); \ }) +/* [(x + y - 1) / y] suffers from an integer overflow, even though the + * computation should be possible in the given type. Therefore, we use + * [x / y + !!(x % y)]. Note that on "Real CPUs" a division returns both the + * quotient and the remainder, so both should be equally fast. */ +#define DIV_ROUND_UP(_x, _y) \ + __extension__ ({ \ + const typeof(_x) __x = (_x); \ + const typeof(_y) __y = (_y); \ + (__x / __y + !!(__x % __y)); \ + }) + #define assert_se(expr) \ do { \ if (_unlikely_(!(expr))) \ @@ -227,7 +242,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { #else #define assert_cc(expr) \ DISABLE_WARNING_DECLARATION_AFTER_STATEMENT; \ - struct CONCATENATE(_assert_struct_, __LINE__) { \ + struct CONCATENATE(_assert_struct_, __COUNTER__) { \ char x[(expr) ? 0 : -1]; \ }; \ REENABLE_WARNING @@ -264,6 +279,14 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { #define PTR_TO_SIZE(p) ((size_t) ((uintptr_t) (p))) #define SIZE_TO_PTR(u) ((void *) ((uintptr_t) (u))) +/* The following macros add 1 when converting things, since UID 0 is a + * valid UID, while the pointer NULL is special */ +#define PTR_TO_UID(p) ((uid_t) (((uintptr_t) (p))-1)) +#define UID_TO_PTR(u) ((void*) (((uintptr_t) (u))+1)) + +#define PTR_TO_GID(p) ((gid_t) (((uintptr_t) (p))-1)) +#define GID_TO_PTR(u) ((void*) (((uintptr_t) (u))+1)) + #define memzero(x,l) (memset((x), 0, (l))) #define zero(x) (memzero(&(x), sizeof(x))) @@ -360,7 +383,8 @@ do { \ /* Returns the number of chars needed to format variables of the * specified type as a decimal string. Adds in extra space for a - * negative '-' prefix. */ + * negative '-' prefix (hence works correctly on signed + * types). Includes space for the trailing NUL. */ #define DECIMAL_STR_MAX(type) \ (2+(sizeof(type) <= 1 ? 3 : \ sizeof(type) <= 2 ? 5 : \ @@ -427,4 +451,11 @@ do { \ #define GID_INVALID ((gid_t) -1) #define MODE_INVALID ((mode_t) -1) +#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \ + static inline void func##p(type *p) { \ + if (*p) \ + func(*p); \ + } \ + struct __useless_struct_to_allow_trailing_semicolon__ + #include "log.h" diff --git a/src/shared/missing.h b/src/shared/missing.h index 478988c8a..b33a70cb2 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -40,12 +40,16 @@ #include #endif -#include "macro.h" - #ifdef ARCH_MIPS #include #endif +#ifdef HAVE_LINUX_BTRFS_H +#include +#endif + +#include "macro.h" + #ifndef RLIMIT_RTTIME #define RLIMIT_RTTIME 15 #endif @@ -75,6 +79,12 @@ #define F_SEAL_WRITE 0x0008 /* prevent writes */ #endif +#ifndef F_OFD_GETLK +#define F_OFD_GETLK 36 +#define F_OFD_SETLK 37 +#define F_OFD_SETLKW 38 +#endif + #ifndef MFD_ALLOW_SEALING #define MFD_ALLOW_SEALING 0x0002U #endif @@ -126,6 +136,8 @@ static inline int pivot_root(const char *new_root, const char *put_old) { # define __NR_memfd_create 319 # elif defined __arm__ # define __NR_memfd_create 385 +# elif defined __aarch64__ +# define __NR_memfd_create 279 # elif defined _MIPS_SIM # if _MIPS_SIM == _MIPS_SIM_ABI32 # define __NR_memfd_create 4354 @@ -155,14 +167,18 @@ static inline int memfd_create(const char *name, unsigned int flags) { # define __NR_getrandom 318 # elif defined(__i386__) # define __NR_getrandom 355 -# elif defined(__arm__) || defined(__aarch64__) +# elif defined(__arm__) # define __NR_getrandom 384 +# elif defined(__aarch64__) +# define __NR_getrandom 278 # elif defined(__ia64__) # define __NR_getrandom 1339 # elif defined(__m68k__) # define __NR_getrandom 352 # elif defined(__s390x__) # define __NR_getrandom 349 +# elif defined(__powerpc__) +# define __NR_getrandom 359 # else # warning "__NR_getrandom unknown for your architecture" # define __NR_getrandom 0xffffffff @@ -246,6 +262,34 @@ struct btrfs_ioctl_fs_info_args { struct btrfs_ioctl_vol_args) #endif +#ifndef BTRFS_FIRST_FREE_OBJECTID +#define BTRFS_FIRST_FREE_OBJECTID 256 +#endif + +#ifndef BTRFS_ROOT_TREE_OBJECTID +#define BTRFS_ROOT_TREE_OBJECTID 1 +#endif + +#ifndef BTRFS_QUOTA_TREE_OBJECTID +#define BTRFS_QUOTA_TREE_OBJECTID 8ULL +#endif + +#ifndef BTRFS_ROOT_ITEM_KEY +#define BTRFS_ROOT_ITEM_KEY 132 +#endif + +#ifndef BTRFS_QGROUP_STATUS_KEY +#define BTRFS_QGROUP_STATUS_KEY 240 +#endif + +#ifndef BTRFS_QGROUP_INFO_KEY +#define BTRFS_QGROUP_INFO_KEY 242 +#endif + +#ifndef BTRFS_QGROUP_LIMIT_KEY +#define BTRFS_QGROUP_LIMIT_KEY 244 +#endif + #ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E #endif @@ -394,6 +438,24 @@ static inline int setns(int fd, int nstype) { #define LOOP_CTL_GET_FREE 0x4C82 #endif +#if !HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE +#define IFLA_INET6_UNSPEC 0 +#define IFLA_INET6_FLAGS 1 +#define IFLA_INET6_CONF 2 +#define IFLA_INET6_STATS 3 +#define IFLA_INET6_MCAST 4 +#define IFLA_INET6_CACHEINFO 5 +#define IFLA_INET6_ICMP6STATS 6 +#define IFLA_INET6_TOKEN 7 +#define IFLA_INET6_ADDR_GEN_MODE 8 +#define __IFLA_INET6_MAX 9 + +#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) + +#define IN6_ADDR_GEN_MODE_EUI64 0 +#define IN6_ADDR_GEN_MODE_NONE 1 +#endif + #if !HAVE_DECL_IFLA_MACVLAN_FLAGS #define IFLA_MACVLAN_UNSPEC 0 #define IFLA_MACVLAN_MODE 1 @@ -403,6 +465,18 @@ static inline int setns(int fd, int nstype) { #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1) #endif +#if !HAVE_DECL_IFLA_IPVLAN_MODE +#define IFLA_IPVLAN_UNSPEC 0 +#define IFLA_IPVLAN_MODE 1 +#define __IFLA_IPVLAN_MAX 2 + +#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1) + +#define IPVLAN_MODE_L2 0 +#define IPVLAN_MODE_L3 1 +#define IPVLAN_MAX 2 +#endif + #if !HAVE_DECL_IFLA_VTI_REMOTE #define IFLA_VTI_UNSPEC 0 #define IFLA_VTI_LINK 1 @@ -631,3 +705,61 @@ static inline int setns(int fd, int nstype) { #ifndef CAP_AUDIT_READ #define CAP_AUDIT_READ 37 #endif + +static inline int raw_clone(unsigned long flags, void *child_stack) { +#if defined(__s390__) || defined(__CRIS__) + /* On s390 and cris the order of the first and second arguments + * of the raw clone() system call is reversed. */ + return (int) syscall(__NR_clone, child_stack, flags); +#else + return (int) syscall(__NR_clone, flags, child_stack); +#endif +} + +static inline pid_t raw_getpid(void) { + return (pid_t) syscall(__NR_getpid); +} + +#if !HAVE_DECL_RENAMEAT2 + +#ifndef __NR_renameat2 +# if defined __x86_64__ +# define __NR_renameat2 316 +# elif defined __arm__ +# define __NR_renameat2 382 +# elif defined _MIPS_SIM +# if _MIPS_SIM == _MIPS_SIM_ABI32 +# define __NR_renameat2 4351 +# endif +# if _MIPS_SIM == _MIPS_SIM_NABI32 +# define __NR_renameat2 6315 +# endif +# if _MIPS_SIM == _MIPS_SIM_ABI64 +# define __NR_renameat2 5311 +# endif +# elif defined __i386__ +# define __NR_renameat2 353 +# else +# warning "__NR_renameat2 unknown for your architecture" +# define __NR_renameat2 0xffffffff +# endif +#endif + +static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) { + return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags); +} +#endif + +#ifndef RENAME_NOREPLACE +#define RENAME_NOREPLACE (1 << 0) +#endif + +#if !HAVE_DECL_KCMP +static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) { + return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); +} +#endif + +#ifndef KCMP_FILE +#define KCMP_FILE 0 +#endif diff --git a/src/shared/pager.c b/src/shared/pager.c index a9f2b7e4f..8635d9a60 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -91,7 +91,7 @@ int pager_open(bool jump_to_end) { if (!less_opts) less_opts = "FRSXMK"; if (jump_to_end) - less_opts = strappenda(less_opts, " +G"); + less_opts = strjoina(less_opts, " +G"); setenv("LESS", less_opts, 1); /* Make sure the pager goes away when the parent dies */ diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index 8f75a8e83..291a2f405 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -78,6 +78,33 @@ int user_runtime_dir(char **runtime_dir) { return 0; } +static int user_data_home_dir(char **dir, const char *suffix) { + const char *e; + char *res; + + /* We don't treat /etc/xdg/systemd here as the spec + * suggests because we assume that that is a link to + * /etc/systemd/ anyway. */ + + e = getenv("XDG_DATA_HOME"); + if (e) + res = strappend(e, suffix); + else { + const char *home; + + home = getenv("HOME"); + if (home) + res = strjoin(home, "/.local/share", suffix, NULL); + else + return 0; + } + if (!res) + return -ENOMEM; + + *dir = res; + return 0; +} + static char** user_dirs( const char *generator, const char *generator_early, @@ -100,10 +127,12 @@ static char** user_dirs( NULL }; - const char *home, *e; + const char *e; _cleanup_free_ char *config_home = NULL, *runtime_dir = NULL, *data_home = NULL; _cleanup_strv_free_ char **config_dirs = NULL, **data_dirs = NULL; - char **r = NULL; + _cleanup_free_ char **res = NULL; + char **tmp; + int r; /* Implement the mechanisms defined in * @@ -115,33 +144,21 @@ static char** user_dirs( */ if (user_config_home(&config_home) < 0) - goto fail; + return NULL; if (user_runtime_dir(&runtime_dir) < 0) - goto fail; - - home = getenv("HOME"); + return NULL; e = getenv("XDG_CONFIG_DIRS"); if (e) { config_dirs = strv_split(e, ":"); if (!config_dirs) - goto fail; + return NULL; } - /* We don't treat /etc/xdg/systemd here as the spec - * suggests because we assume that that is a link to - * /etc/systemd/ anyway. */ - - e = getenv("XDG_DATA_HOME"); - if (e) { - if (asprintf(&data_home, "%s/systemd/user", e) < 0) - goto fail; - - } else if (home) { - if (asprintf(&data_home, "%s/.local/share/systemd/user", home) < 0) - goto fail; - } + r = user_data_home_dir(&data_home, "/systemd/user"); + if (r < 0) + return NULL; e = getenv("XDG_DATA_DIRS"); if (e) @@ -151,58 +168,71 @@ static char** user_dirs( "/usr/share", NULL); if (!data_dirs) - goto fail; + return NULL; /* Now merge everything we found. */ if (generator_early) - if (strv_extend(&r, generator_early) < 0) - goto fail; + if (strv_extend(&res, generator_early) < 0) + return NULL; if (config_home) - if (strv_extend(&r, config_home) < 0) - goto fail; + if (strv_extend(&res, config_home) < 0) + return NULL; if (!strv_isempty(config_dirs)) - if (strv_extend_strv_concat(&r, config_dirs, "/systemd/user") < 0) - goto fail; + if (strv_extend_strv_concat(&res, config_dirs, "/systemd/user") < 0) + return NULL; - if (strv_extend_strv(&r, (char**) config_unit_paths) < 0) - goto fail; + if (strv_extend_strv(&res, (char**) config_unit_paths) < 0) + return NULL; if (runtime_dir) - if (strv_extend(&r, runtime_dir) < 0) - goto fail; + if (strv_extend(&res, runtime_dir) < 0) + return NULL; - if (strv_extend(&r, runtime_unit_path) < 0) - goto fail; + if (strv_extend(&res, runtime_unit_path) < 0) + return NULL; if (generator) - if (strv_extend(&r, generator) < 0) - goto fail; + if (strv_extend(&res, generator) < 0) + return NULL; if (data_home) - if (strv_extend(&r, data_home) < 0) - goto fail; + if (strv_extend(&res, data_home) < 0) + return NULL; if (!strv_isempty(data_dirs)) - if (strv_extend_strv_concat(&r, data_dirs, "/systemd/user") < 0) - goto fail; + if (strv_extend_strv_concat(&res, data_dirs, "/systemd/user") < 0) + return NULL; - if (strv_extend_strv(&r, (char**) data_unit_paths) < 0) - goto fail; + if (strv_extend_strv(&res, (char**) data_unit_paths) < 0) + return NULL; if (generator_late) - if (strv_extend(&r, generator_late) < 0) - goto fail; + if (strv_extend(&res, generator_late) < 0) + return NULL; - if (!path_strv_make_absolute_cwd(r)) - goto fail; + if (!path_strv_make_absolute_cwd(res)) + return NULL; - return r; + tmp = res; + res = NULL; + return tmp; +} -fail: - strv_free(r); - return NULL; +char **generator_paths(SystemdRunningAs running_as) { + if (running_as == SYSTEMD_USER) + return strv_new("/run/systemd/user-generators", + "/etc/systemd/user-generators", + "/usr/local/lib/systemd/user-generators", + USER_GENERATOR_PATH, + NULL); + else + return strv_new("/run/systemd/system-generators", + "/etc/systemd/system-generators", + "/usr/local/lib/systemd/system-generators", + SYSTEM_GENERATOR_PATH, + NULL); } int lookup_paths_init( @@ -398,3 +428,19 @@ void lookup_paths_free(LookupPaths *p) { p->sysvinit_path = p->sysvrcnd_path = NULL; #endif } + +int lookup_paths_init_from_scope(LookupPaths *paths, + UnitFileScope scope, + const char *root_dir) { + assert(paths); + assert(scope >= 0); + assert(scope < _UNIT_FILE_SCOPE_MAX); + + zero(*paths); + + return lookup_paths_init(paths, + scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER, + scope == UNIT_FILE_USER, + root_dir, + NULL, NULL, NULL); +} diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h index b8a0aace8..2ec888da8 100644 --- a/src/shared/path-lookup.h +++ b/src/shared/path-lookup.h @@ -22,6 +22,7 @@ ***/ #include "macro.h" +#include "install.h" typedef struct LookupPaths { char **unit_path; @@ -41,6 +42,8 @@ typedef enum SystemdRunningAs { int user_config_home(char **config_home); int user_runtime_dir(char **runtime_dir); +char **generator_paths(SystemdRunningAs running_as); + int lookup_paths_init(LookupPaths *p, SystemdRunningAs running_as, bool personal, @@ -49,5 +52,8 @@ int lookup_paths_init(LookupPaths *p, const char *generator_early, const char *generator_late); void lookup_paths_free(LookupPaths *p); +int lookup_paths_init_from_scope(LookupPaths *paths, + UnitFileScope scope, + const char *root_dir); #define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free) diff --git a/src/shared/path-util.c b/src/shared/path-util.c index be03695cf..b9db7f104 100644 --- a/src/shared/path-util.c +++ b/src/shared/path-util.c @@ -129,7 +129,7 @@ char *path_make_absolute_cwd(const char *p) { if (!cwd) return NULL; - return path_make_absolute(p, cwd); + return strjoin(cwd, "/", p, NULL); } int path_make_relative(const char *from_dir, const char *to_path, char **_r) { @@ -306,6 +306,7 @@ char **path_strv_resolve(char **l, const char *prefix) { } else { /* canonicalized path goes outside of * prefix, keep the original path instead */ + free(u); u = orig; orig = NULL; } @@ -439,28 +440,26 @@ char* path_join(const char *root, const char *path, const char *rest) { assert(path); if (!isempty(root)) - return strjoin(root, "/", + return strjoin(root, endswith(root, "/") ? "" : "/", path[0] == '/' ? path+1 : path, - rest ? "/" : NULL, + rest ? (endswith(path, "/") ? "" : "/") : NULL, rest && rest[0] == '/' ? rest+1 : rest, NULL); else return strjoin(path, - rest ? "/" : NULL, + rest ? (endswith(path, "/") ? "" : "/") : NULL, rest && rest[0] == '/' ? rest+1 : rest, NULL); } int path_is_mount_point(const char *t, bool allow_symlink) { - union file_handle_union h = { - .handle.handle_bytes = MAX_HANDLE_SZ - }; - - int mount_id, mount_id_parent; + union file_handle_union h = FILE_HANDLE_INIT; + int mount_id = -1, mount_id_parent = -1; _cleanup_free_ char *parent = NULL; struct stat a, b; int r; + bool nosupp = false; /* We are not actually interested in the file handles, but * name_to_handle_at() also passes us the mount ID, hence use @@ -471,16 +470,19 @@ int path_is_mount_point(const char *t, bool allow_symlink) { r = name_to_handle_at(AT_FDCWD, t, &h.handle, &mount_id, allow_symlink ? AT_SYMLINK_FOLLOW : 0); if (r < 0) { - if (IN_SET(errno, ENOSYS, EOPNOTSUPP)) + if (errno == ENOSYS) + /* This kernel does not support name_to_handle_at() + * fall back to the traditional stat() logic. */ + goto fallback; + else if (errno == EOPNOTSUPP) /* This kernel or file system does not support * name_to_handle_at(), hence fallback to the * traditional stat() logic */ - goto fallback; - - if (errno == ENOENT) + nosupp = true; + else if (errno == ENOENT) return 0; - - return -errno; + else + return -errno; } r = path_get_parent(t, &parent); @@ -488,18 +490,23 @@ int path_is_mount_point(const char *t, bool allow_symlink) { return r; h.handle.handle_bytes = MAX_HANDLE_SZ; - r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, 0); - if (r < 0) { - /* The parent can't do name_to_handle_at() but the - * directory we are interested in can? If so, it must - * be a mount point */ + r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, AT_SYMLINK_FOLLOW); + if (r < 0) if (errno == EOPNOTSUPP) - return 1; - - return -errno; - } - - return mount_id != mount_id_parent; + if (nosupp) + /* Neither parent nor child do name_to_handle_at()? + We have no choice but to fall back. */ + goto fallback; + else + /* The parent can't do name_to_handle_at() but + * the directory we are interested in can? + * Or the other way around? + * If so, it must be a mount point. */ + return 1; + else + return -errno; + else + return mount_id != mount_id_parent; fallback: if (allow_symlink) @@ -514,11 +521,14 @@ fallback: return -errno; } + free(parent); + parent = NULL; + r = path_get_parent(t, &parent); if (r < 0) return r; - r = lstat(parent, &b); + r = stat(parent, &b); if (r < 0) return -errno; @@ -550,14 +560,14 @@ int path_is_os_tree(const char *path) { int r; /* We use /usr/lib/os-release as flag file if something is an OS */ - p = strappenda(path, "/usr/lib/os-release"); + p = strjoina(path, "/usr/lib/os-release"); r = access(p, F_OK); if (r >= 0) return 1; /* Also check for the old location in /etc, just in case. */ - p = strappenda(path, "/etc/os-release"); + p = strjoina(path, "/etc/os-release"); r = access(p, F_OK); return r >= 0; @@ -655,7 +665,7 @@ int fsck_exists(const char *fstype) { const char *checker; int r; - checker = strappenda("fsck.", fstype); + checker = strjoina("fsck.", fstype); r = find_binary(checker, true, &p); if (r < 0) diff --git a/src/shared/pty.c b/src/shared/pty.c index 52a426c0e..fbe6295ea 100644 --- a/src/shared/pty.c +++ b/src/shared/pty.c @@ -194,13 +194,13 @@ int pty_get_fd(Pty *pty) { } int pty_make_child(Pty *pty) { - char slave_name[1024]; + _cleanup_free_ char *slave_name = NULL; int r, fd; assert_return(pty, -EINVAL); assert_return(pty_is_unknown(pty), -EALREADY); - r = ptsname_r(pty->fd, slave_name, sizeof(slave_name)); + r = ptsname_malloc(pty->fd, &slave_name); if (r < 0) return -errno; @@ -550,16 +550,15 @@ int pty_signal(Pty *pty, int sig) { } int pty_resize(Pty *pty, unsigned short term_width, unsigned short term_height) { - struct winsize ws; + struct winsize ws = { + .ws_col = term_width, + .ws_row = term_height, + }; assert_return(pty, -EINVAL); assert_return(pty_is_open(pty), -ENODEV); assert_return(pty_is_parent(pty), -ENODEV); - zero(ws); - ws.ws_col = term_width; - ws.ws_row = term_height; - /* * This will send SIGWINCH to the pty slave foreground process group. * We will also get one, but we don't need it. diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c index 085d374ed..31274a141 100644 --- a/src/shared/ptyfwd.c +++ b/src/shared/ptyfwd.c @@ -53,6 +53,12 @@ struct PTYForward { bool master_writable:1; bool master_hangup:1; + /* Continue reading after hangup? */ + bool ignore_vhangup:1; + + bool last_char_set:1; + char last_char; + char in_buffer[LINE_MAX], out_buffer[LINE_MAX]; size_t in_buffer_full, out_buffer_full; @@ -166,14 +172,15 @@ static int shovel(PTYForward *f) { if (k < 0) { /* Note that EIO on the master device - * might be cause by vhangup() or + * might be caused by vhangup() or * temporary closing of everything on * the other side, we treat it like - * EAGAIN here and try again. */ + * EAGAIN here and try again, unless + * ignore_vhangup is off. */ - if (errno == EAGAIN || errno == EIO) + if (errno == EAGAIN || (errno == EIO && f->ignore_vhangup)) f->master_readable = false; - else if (errno == EPIPE || errno == ECONNRESET) { + else if (errno == EPIPE || errno == ECONNRESET || errno == EIO) { f->master_readable = f->master_writable = false; f->master_hangup = true; @@ -203,6 +210,12 @@ static int shovel(PTYForward *f) { } } else { + + if (k > 0) { + f->last_char = f->out_buffer[k-1]; + f->last_char_set = true; + } + assert(f->out_buffer_full >= (size_t) k); memmove(f->out_buffer, f->out_buffer + k, f->out_buffer_full - k); f->out_buffer_full -= k; @@ -280,12 +293,12 @@ static int on_sigwinch_event(sd_event_source *e, const struct signalfd_siginfo * /* The window size changed, let's forward that. */ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0) - (void)ioctl(f->master, TIOCSWINSZ, &ws); + (void) ioctl(f->master, TIOCSWINSZ, &ws); return 0; } -int pty_forward_new(sd_event *event, int master, PTYForward **ret) { +int pty_forward_new(sd_event *event, int master, bool ignore_vhangup, PTYForward **ret) { _cleanup_(pty_forward_freep) PTYForward *f = NULL; struct winsize ws; int r; @@ -294,6 +307,8 @@ int pty_forward_new(sd_event *event, int master, PTYForward **ret) { if (!f) return -ENOMEM; + f->ignore_vhangup = ignore_vhangup; + if (event) f->event = sd_event_ref(event); else { @@ -358,6 +373,8 @@ int pty_forward_new(sd_event *event, int master, PTYForward **ret) { return r; r = sd_event_add_signal(f->event, &f->sigwinch_event_source, SIGWINCH, on_sigwinch_event, f); + if (r < 0) + return r; *ret = f; f = NULL; @@ -388,3 +405,43 @@ PTYForward *pty_forward_free(PTYForward *f) { return NULL; } + +int pty_forward_get_last_char(PTYForward *f, char *ch) { + assert(f); + assert(ch); + + if (!f->last_char_set) + return -ENXIO; + + *ch = f->last_char; + return 0; +} + +int pty_forward_set_ignore_vhangup(PTYForward *f, bool ignore_vhangup) { + int r; + + assert(f); + + if (f->ignore_vhangup == ignore_vhangup) + return 0; + + f->ignore_vhangup = ignore_vhangup; + if (!f->ignore_vhangup) { + + /* We shall now react to vhangup()s? Let's check + * immediately if we might be in one */ + + f->master_readable = true; + r = shovel(f); + if (r < 0) + return r; + } + + return 0; +} + +int pty_forward_get_ignore_vhangup(PTYForward *f) { + assert(f); + + return f->ignore_vhangup; +} diff --git a/src/shared/ptyfwd.h b/src/shared/ptyfwd.h index 5a612fd59..d3e229bd7 100644 --- a/src/shared/ptyfwd.h +++ b/src/shared/ptyfwd.h @@ -23,12 +23,19 @@ #include #include +#include +#include "util.h" #include "sd-event.h" typedef struct PTYForward PTYForward; -int pty_forward_new(sd_event *event, int master, PTYForward **f); +int pty_forward_new(sd_event *event, int master, bool ignore_vhangup, PTYForward **f); PTYForward *pty_forward_free(PTYForward *f); +int pty_forward_get_last_char(PTYForward *f, char *ch); + +int pty_forward_set_ignore_vhangup(PTYForward *f, bool ignore_vhangup); +int pty_forward_get_ignore_vhangup(PTYForward *f); + DEFINE_TRIVIAL_CLEANUP_FUNC(PTYForward*, pty_forward_free); diff --git a/src/shared/seccomp-util.h b/src/shared/seccomp-util.h index 9a51a85b4..60d97154e 100644 --- a/src/shared/seccomp-util.h +++ b/src/shared/seccomp-util.h @@ -21,6 +21,7 @@ along with systemd; If not, see . ***/ +#include const char* seccomp_arch_to_string(uint32_t c); int seccomp_arch_from_string(const char *n, uint32_t *ret); diff --git a/src/shared/set.h b/src/shared/set.h index 4605ecd2c..2b49e2f28 100644 --- a/src/shared/set.h +++ b/src/shared/set.h @@ -22,7 +22,7 @@ ***/ #include "hashmap.h" -#include "util.h" +#include "macro.h" Set *internal_set_new(const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS); #define set_new(ops) internal_set_new(ops HASHMAP_DEBUG_SRC_ARGS) diff --git a/src/shared/sigbus.c b/src/shared/sigbus.c new file mode 100644 index 000000000..0108603fe --- /dev/null +++ b/src/shared/sigbus.c @@ -0,0 +1,152 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "macro.h" +#include "util.h" +#include "sigbus.h" + +#define SIGBUS_QUEUE_MAX 64 + +static struct sigaction old_sigaction; +static unsigned n_installed = 0; + +/* We maintain a fixed size list of page addresses that triggered a + SIGBUS. We access with list with atomic operations, so that we + don't have to deal with locks between signal handler and main + programs in possibly multiple threads. */ + +static void* volatile sigbus_queue[SIGBUS_QUEUE_MAX]; +static volatile sig_atomic_t n_sigbus_queue = 0; + +static void sigbus_push(void *addr) { + unsigned u; + + assert(addr); + + /* Find a free place, increase the number of entries and leave, if we can */ + for (u = 0; u < SIGBUS_QUEUE_MAX; u++) + if (__sync_bool_compare_and_swap(&sigbus_queue[u], NULL, addr)) { + __sync_fetch_and_add(&n_sigbus_queue, 1); + return; + } + + /* If we can't, make sure the queue size is out of bounds, to + * mark it as overflow */ + for (;;) { + unsigned c; + + __sync_synchronize(); + c = n_sigbus_queue; + + if (c > SIGBUS_QUEUE_MAX) /* already overflow */ + return; + + if (__sync_bool_compare_and_swap(&n_sigbus_queue, c, c + SIGBUS_QUEUE_MAX)) + return; + } +} + +int sigbus_pop(void **ret) { + assert(ret); + + for (;;) { + unsigned u, c; + + __sync_synchronize(); + c = n_sigbus_queue; + + if (_likely_(c == 0)) + return 0; + + if (_unlikely_(c >= SIGBUS_QUEUE_MAX)) + return -EOVERFLOW; + + for (u = 0; u < SIGBUS_QUEUE_MAX; u++) { + void *addr; + + addr = sigbus_queue[u]; + if (!addr) + continue; + + if (__sync_bool_compare_and_swap(&sigbus_queue[u], addr, NULL)) { + __sync_fetch_and_sub(&n_sigbus_queue, 1); + *ret = addr; + return 1; + } + } + } +} + +static void sigbus_handler(int sn, siginfo_t *si, void *data) { + unsigned long ul; + void *aligned; + + assert(sn == SIGBUS); + assert(si); + + if (si->si_code != BUS_ADRERR || !si->si_addr) { + assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0); + raise(SIGBUS); + return; + } + + ul = (unsigned long) si->si_addr; + ul = ul / page_size(); + ul = ul * page_size(); + aligned = (void*) ul; + + /* Let's remember which address failed */ + sigbus_push(aligned); + + /* Replace mapping with an anonymous page, so that the + * execution can continue, however with a zeroed out page */ + assert_se(mmap(aligned, page_size(), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0) == aligned); +} + +void sigbus_install(void) { + struct sigaction sa = { + .sa_sigaction = sigbus_handler, + .sa_flags = SA_SIGINFO, + }; + + n_installed++; + + if (n_installed == 1) + assert_se(sigaction(SIGBUS, &sa, &old_sigaction) == 0); + + return; +} + +void sigbus_reset(void) { + + if (n_installed <= 0) + return; + + n_installed--; + + if (n_installed == 0) + assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0); + + return; +} diff --git a/src/shared/sigbus.h b/src/shared/sigbus.h new file mode 100644 index 000000000..23edc6d9c --- /dev/null +++ b/src/shared/sigbus.h @@ -0,0 +1,27 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +void sigbus_install(void); +void sigbus_reset(void); + +int sigbus_pop(void **ret); diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index ae14c6bd4..1064fd5cb 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -167,7 +167,7 @@ int can_sleep_disk(char **types) { static int hibernation_partition_size(size_t *size, size_t *used) { _cleanup_fclose_ FILE *f; - int i; + unsigned i; assert(size); assert(used); @@ -190,8 +190,8 @@ static int hibernation_partition_size(size_t *size, size_t *used) { k = fscanf(f, "%ms " /* device/file */ "%ms " /* type of swap */ - "%zd " /* swap size */ - "%zd " /* used */ + "%zu " /* swap size */ + "%zu " /* used */ "%*i\n", /* priority */ &dev, &type, &size_field, &used_field); if (k != 4) { diff --git a/src/shared/sleep-config.h b/src/shared/sleep-config.h index 51d2dec7b..5eda18ee3 100644 --- a/src/shared/sleep-config.h +++ b/src/shared/sleep-config.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#pragma once + int parse_sleep_config(const char *verb, char ***modes, char ***states); int can_sleep(const char *verb); diff --git a/src/shared/socket-label.c b/src/shared/socket-label.c index b1ef19f26..6806c5115 100644 --- a/src/shared/socket-label.c +++ b/src/shared/socket-label.c @@ -35,9 +35,10 @@ #include "macro.h" #include "util.h" #include "mkdir.h" -#include "socket-util.h" #include "missing.h" #include "label.h" +#include "selinux-util.h" +#include "socket-util.h" int socket_address_listen( const SocketAddress *a, diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c index e7419b5ee..8f259a8f3 100644 --- a/src/shared/spawn-polkit-agent.c +++ b/src/shared/spawn-polkit-agent.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "log.h" #include "util.h" @@ -39,7 +39,7 @@ static pid_t agent_pid = 0; int polkit_agent_open(void) { int r; int pipe_fd[2]; - char notify_fd[10 + 1]; + char notify_fd[DECIMAL_STR_MAX(int) + 1]; if (agent_pid > 0) return 0; @@ -52,8 +52,7 @@ int polkit_agent_open(void) { if (pipe2(pipe_fd, 0) < 0) return -errno; - snprintf(notify_fd, sizeof(notify_fd), "%i", pipe_fd[1]); - char_array_0(notify_fd); + xsprintf(notify_fd, "%i", pipe_fd[1]); r = fork_agent(&agent_pid, &pipe_fd[1], 1, diff --git a/src/shared/strv.c b/src/shared/strv.c index fdb658c0a..e27ac6815 100644 --- a/src/shared/strv.c +++ b/src/shared/strv.c @@ -69,7 +69,7 @@ char *strv_find_startswith(char **l, const char *name) { return NULL; } -void strv_free(char **l) { +void strv_clear(char **l) { char **k; if (!l) @@ -78,6 +78,11 @@ void strv_free(char **l) { for (k = l; *k; k++) free(*k); + *l = NULL; +} + +void strv_free(char **l) { + strv_clear(l); free(l); } @@ -519,6 +524,16 @@ char **strv_uniq(char **l) { return l; } +bool strv_is_uniq(char **l) { + char **i; + + STRV_FOREACH(i, l) + if (strv_find(i+1, *i)) + return false; + + return true; +} + char **strv_remove(char **l, const char *s) { char **f, **t; @@ -659,3 +674,31 @@ int strv_extendf(char ***l, const char *format, ...) { return strv_consume(l, x); } + +char **strv_reverse(char **l) { + unsigned n, i; + + n = strv_length(l); + if (n <= 1) + return l; + + for (i = 0; i < n / 2; i++) { + char *t; + + t = l[i]; + l[i] = l[n-1-i]; + l[n-1-i] = t; + } + + return l; +} + +bool strv_fnmatch(char* const* patterns, const char *s, int flags) { + char* const* p; + + STRV_FOREACH(p, patterns) + if (fnmatch(*p, s, 0) == 0) + return true; + + return false; +} diff --git a/src/shared/strv.h b/src/shared/strv.h index 2c0280b71..518c4c2aa 100644 --- a/src/shared/strv.h +++ b/src/shared/strv.h @@ -23,6 +23,7 @@ #include #include +#include #include "util.h" @@ -34,6 +35,8 @@ void strv_free(char **l); DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free); #define _cleanup_strv_free_ _cleanup_(strv_freep) +void strv_clear(char **l); + char **strv_copy(char * const *l); unsigned strv_length(char * const *l) _pure_; @@ -50,6 +53,7 @@ int strv_consume_prepend(char ***l, char *value); char **strv_remove(char **l, const char *s); char **strv_uniq(char **l); +bool strv_is_uniq(char **l); bool strv_equal(char **a, char **b); @@ -139,3 +143,13 @@ void strv_print(char **l); _l ++; \ _l[0]; \ })) + +char **strv_reverse(char **l); + +bool strv_fnmatch(char* const* patterns, const char *s, int flags); + +static inline bool strv_fnmatch_or_empty(char* const* patterns, const char *s, int flags) { + assert(s); + return strv_isempty(patterns) || + strv_fnmatch(patterns, s, flags); +} diff --git a/src/shared/switch-root.c b/src/shared/switch-root.c index ca3875628..813641ad4 100644 --- a/src/shared/switch-root.c +++ b/src/shared/switch-root.c @@ -51,7 +51,7 @@ int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, if (path_equal(new_root, "/")) return 0; - temporary_old_root = strappenda(new_root, oldroot); + temporary_old_root = strjoina(new_root, oldroot); mkdir_p_label(temporary_old_root, 0755); old_root_remove = in_initrd(); @@ -72,7 +72,6 @@ int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, struct stat sb; snprintf(new_mount, sizeof(new_mount), "%s%s", new_root, i); - char_array_0(new_mount); mkdir_p_label(new_mount, 0755); diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c index 926d22b94..1ce6f721b 100644 --- a/src/shared/time-dst.c +++ b/src/shared/time-dst.c @@ -183,7 +183,8 @@ read_again: return -EINVAL; } - transitions = malloc0(total_size + tzspec_len); + /* leave space for additional zone_names zero terminator */ + transitions = malloc0(total_size + tzspec_len + 1); if (transitions == NULL) return -EINVAL; diff --git a/src/shared/time-util.c b/src/shared/time-util.c index d3404afd5..947ac1fcf 100644 --- a/src/shared/time-util.c +++ b/src/shared/time-util.c @@ -965,7 +965,7 @@ bool timezone_is_valid(const char *name) { if (slash) return false; - t = strappenda("/usr/share/zoneinfo/", name); + t = strjoina("/usr/share/zoneinfo/", name); if (stat(t, &st) < 0) return false; diff --git a/src/shared/time-util.h b/src/shared/time-util.h index b55a660bb..fca8a4db9 100644 --- a/src/shared/time-util.h +++ b/src/shared/time-util.h @@ -67,7 +67,7 @@ typedef struct dual_timestamp { #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1) -#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0, 0 }) +#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0ULL, 0ULL }) usec_t now(clockid_t clock); @@ -107,3 +107,5 @@ int get_timezones(char ***l); bool timezone_is_valid(const char *name); clockid_t clock_boottime_or_monotonic(void); + +#define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0) diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index 5e0e1a96e..5f09ce181 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -27,7 +27,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_unref); -DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_hwdb*, udev_hwdb_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_rules*, udev_rules_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl*, udev_ctrl_unref); @@ -36,7 +35,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_monitor*, udev_monitor_unref); #define _cleanup_udev_unref_ _cleanup_(udev_unrefp) #define _cleanup_udev_device_unref_ _cleanup_(udev_device_unrefp) #define _cleanup_udev_enumerate_unref_ _cleanup_(udev_enumerate_unrefp) -#define _cleanup_udev_hwdb_unref_ _cleanup_(udev_hwdb_unrefp) #define _cleanup_udev_event_unref_ _cleanup_(udev_event_unrefp) #define _cleanup_udev_rules_unref_ _cleanup_(udev_rules_unrefp) #define _cleanup_udev_ctrl_unref_ _cleanup_(udev_ctrl_unrefp) diff --git a/src/shared/uid-range.h b/src/shared/uid-range.h index d3dac8df6..45335e939 100644 --- a/src/shared/uid-range.h +++ b/src/shared/uid-range.h @@ -21,6 +21,7 @@ along with systemd; If not, see . ***/ +#include #include typedef struct UidRange { diff --git a/src/shared/utf8.c b/src/shared/utf8.c index 4469a7375..013c110f0 100644 --- a/src/shared/utf8.c +++ b/src/shared/utf8.c @@ -263,39 +263,91 @@ char *ascii_is_valid(const char *str) { return (char*) str; } +/** + * utf8_encode_unichar() - Encode single UCS-4 character as UTF-8 + * @out_utf8: output buffer of at least 4 bytes or NULL + * @g: UCS-4 character to encode + * + * This encodes a single UCS-4 character as UTF-8 and writes it into @out_utf8. + * The length of the character is returned. It is not zero-terminated! If the + * output buffer is NULL, only the length is returned. + * + * Returns: The length in bytes that the UTF-8 representation does or would + * occupy. + */ +size_t utf8_encode_unichar(char *out_utf8, uint32_t g) { + if (g < (1 << 7)) { + if (out_utf8) + out_utf8[0] = g & 0x7f; + return 1; + } else if (g < (1 << 11)) { + if (out_utf8) { + out_utf8[0] = 0xc0 | ((g >> 6) & 0x1f); + out_utf8[1] = 0x80 | (g & 0x3f); + } + return 2; + } else if (g < (1 << 16)) { + if (out_utf8) { + out_utf8[0] = 0xe0 | ((g >> 12) & 0x0f); + out_utf8[1] = 0x80 | ((g >> 6) & 0x3f); + out_utf8[2] = 0x80 | (g & 0x3f); + } + return 3; + } else if (g < (1 << 21)) { + if (out_utf8) { + out_utf8[0] = 0xf0 | ((g >> 18) & 0x07); + out_utf8[1] = 0x80 | ((g >> 12) & 0x3f); + out_utf8[2] = 0x80 | ((g >> 6) & 0x3f); + out_utf8[3] = 0x80 | (g & 0x3f); + } + return 4; + } else { + return 0; + } +} + char *utf16_to_utf8(const void *s, size_t length) { - char *r; const uint8_t *f; - uint8_t *t; + char *r, *t; - r = new(char, (length*3+1)/2 + 1); + r = new(char, (length * 4 + 1) / 2 + 1); if (!r) return NULL; - t = (uint8_t*) r; + f = s; + t = r; - for (f = s; f < (const uint8_t*) s + length; f += 2) { - uint16_t c; + while (f < (const uint8_t*) s + length) { + uint16_t w1, w2; - c = (f[1] << 8) | f[0]; + /* see RFC 2781 section 2.2 */ - if (c == 0) { - *t = 0; - return r; - } else if (c < 0x80) { - *(t++) = (uint8_t) c; - } else if (c < 0x800) { - *(t++) = (uint8_t) (0xc0 | (c >> 6)); - *(t++) = (uint8_t) (0x80 | (c & 0x3f)); - } else { - *(t++) = (uint8_t) (0xe0 | (c >> 12)); - *(t++) = (uint8_t) (0x80 | ((c >> 6) & 0x3f)); - *(t++) = (uint8_t) (0x80 | (c & 0x3f)); + w1 = f[1] << 8 | f[0]; + f += 2; + + if (!utf16_is_surrogate(w1)) { + t += utf8_encode_unichar(t, w1); + + continue; } + + if (utf16_is_trailing_surrogate(w1)) + continue; + else if (f >= (const uint8_t*) s + length) + break; + + w2 = f[1] << 8 | f[0]; + f += 2; + + if (!utf16_is_trailing_surrogate(w2)) { + f -= 2; + continue; + } + + t += utf8_encode_unichar(t, utf16_surrogate_pair_to_unichar(w1, w2)); } *t = 0; - return r; } diff --git a/src/shared/utf8.h b/src/shared/utf8.h index 59abee50a..77f663438 100644 --- a/src/shared/utf8.h +++ b/src/shared/utf8.h @@ -36,7 +36,20 @@ bool utf8_is_printable_newline(const char* str, size_t length, bool newline) _pu char *utf8_escape_invalid(const char *s); char *utf8_escape_non_printable(const char *str); +size_t utf8_encode_unichar(char *out_utf8, uint32_t g); char *utf16_to_utf8(const void *s, size_t length); int utf8_encoded_valid_unichar(const char *str); int utf8_encoded_to_unichar(const char *str); + +static inline bool utf16_is_surrogate(uint16_t c) { + return (0xd800 <= c && c <= 0xdfff); +} + +static inline bool utf16_is_trailing_surrogate(uint16_t c) { + return (0xdc00 <= c && c <= 0xdfff); +} + +static inline uint32_t utf16_surrogate_pair_to_unichar(uint16_t lead, uint16_t trail) { + return ((lead - 0xd800) << 10) + (trail - 0xdc00) + 0x10000; +} diff --git a/src/shared/util.c b/src/shared/util.c index 26a4f72b4..ba035caed 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -39,8 +39,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -60,6 +59,14 @@ #include #include #include +#include +#include +#include +#include + +/* When we include libgen.h because we need dirname() we immediately + * undefine basename() since libgen.h defines it as a macro to the XDG + * version which is really broken. */ #include #undef basename @@ -85,6 +92,7 @@ #include "gunicode.h" #include "virt.h" #include "def.h" +#include "sparse-endian.h" int saved_argc = 0; char **saved_argv = NULL; @@ -503,25 +511,31 @@ int safe_atolli(const char *s, long long int *ret_lli) { int safe_atod(const char *s, double *ret_d) { char *x = NULL; double d = 0; + locale_t loc; assert(s); assert(ret_d); - RUN_WITH_LOCALE(LC_NUMERIC_MASK, "C") { - errno = 0; - d = strtod(s, &x); - } + loc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0); + if (loc == (locale_t) 0) + return -errno; - if (!x || x == s || *x || errno) + errno = 0; + d = strtod_l(s, &x, loc); + + if (!x || x == s || *x || errno) { + freelocale(loc); return errno ? -errno : -EINVAL; + } + freelocale(loc); *ret_d = (double) d; return 0; } static size_t strcspn_escaped(const char *s, const char *reject) { bool escaped = false; - size_t n; + int n; for (n=0; s[n]; n++) { if (escaped) @@ -531,6 +545,7 @@ static size_t strcspn_escaped(const char *s, const char *reject) { else if (strchr(reject, s[n])) break; } + /* if s ends in \, return index of previous char */ return n - escaped; } @@ -558,7 +573,7 @@ const char* split(const char **state, size_t *l, const char *separator, bool quo *l = strcspn_escaped(current + 1, quotechars); if (current[*l + 1] == '\0' || (current[*l + 2] && !strchr(separator, current[*l + 2]))) { - /* right quote missing or garbage at the end*/ + /* right quote missing or garbage at the end */ *state = current; return NULL; } @@ -566,6 +581,11 @@ const char* split(const char **state, size_t *l, const char *separator, bool quo *state = current++ + *l + 2; } else if (quoted) { *l = strcspn_escaped(current, separator); + if (current[*l] && !strchr(separator, current[*l])) { + /* unfinished escape */ + *state = current; + return NULL; + } *state = current + *l; } else { *l = strcspn(current, separator); @@ -1145,7 +1165,7 @@ char *delete_chars(char *s, const char *bad) { } char *file_in_same_dir(const char *path, const char *filename) { - char *e, *r; + char *e, *ret; size_t k; assert(path); @@ -1158,17 +1178,17 @@ char *file_in_same_dir(const char *path, const char *filename) { if (path_is_absolute(filename)) return strdup(filename); - if (!(e = strrchr(path, '/'))) + e = strrchr(path, '/'); + if (!e) return strdup(filename); k = strlen(filename); - if (!(r = new(char, e-path+1+k+1))) + ret = new(char, (e + 1 - path) + k + 1); + if (!ret) return NULL; - memcpy(r, path, e-path+1); - memcpy(r+(e-path)+1, filename, k+1); - - return r; + memcpy(mempcpy(ret, path, e + 1 - path), filename, k + 1); + return ret; } int rmdir_parents(const char *path, const char *stop) { @@ -1343,12 +1363,19 @@ char *cunescape_length_with_prefix(const char *s, size_t length, const char *pre memcpy(r, prefix, pl); for (f = s, t = r + pl; f < s + length; f++) { + size_t remaining = s + length - f; + assert(remaining > 0); - if (*f != '\\') { + if (*f != '\\') { /* a literal literal */ *(t++) = *f; continue; } + if (--remaining == 0) { /* copy trailing backslash verbatim */ + *(t++) = *f; + break; + } + f++; switch (*f) { @@ -1391,10 +1418,12 @@ char *cunescape_length_with_prefix(const char *s, size_t length, const char *pre case 'x': { /* hexadecimal encoding */ - int a, b; + int a = -1, b = -1; - a = unhexchar(f[1]); - b = unhexchar(f[2]); + if (remaining >= 2) { + a = unhexchar(f[1]); + b = unhexchar(f[2]); + } if (a < 0 || b < 0 || (a == 0 && b == 0)) { /* Invalid escape code, let's take it literal then */ @@ -1417,11 +1446,13 @@ char *cunescape_length_with_prefix(const char *s, size_t length, const char *pre case '6': case '7': { /* octal encoding */ - int a, b, c; + int a = -1, b = -1, c = -1; - a = unoctchar(f[0]); - b = unoctchar(f[1]); - c = unoctchar(f[2]); + if (remaining >= 3) { + a = unoctchar(f[0]); + b = unoctchar(f[1]); + c = unoctchar(f[2]); + } if (a < 0 || b < 0 || c < 0 || (a == 0 && b == 0 && c == 0)) { /* Invalid escape code, let's take it literal then */ @@ -1435,11 +1466,6 @@ char *cunescape_length_with_prefix(const char *s, size_t length, const char *pre break; } - case 0: - /* premature end of string.*/ - *(t++) = '\\'; - goto finish; - default: /* Invalid escape code, let's take it literal then */ *(t++) = '\\'; @@ -1448,7 +1474,6 @@ char *cunescape_length_with_prefix(const char *s, size_t length, const char *pre } } -finish: *t = 0; return r; } @@ -1504,7 +1529,7 @@ char *ascii_strlower(char *t) { return t; } -_pure_ static bool ignore_file_allow_backup(const char *filename) { +_pure_ static bool hidden_file_allow_backup(const char *filename) { assert(filename); return @@ -1518,16 +1543,20 @@ _pure_ static bool ignore_file_allow_backup(const char *filename) { endswith(filename, ".dpkg-old") || endswith(filename, ".dpkg-new") || endswith(filename, ".dpkg-tmp") || + endswith(filename, ".dpkg-dist") || + endswith(filename, ".dpkg-bak") || + endswith(filename, ".dpkg-backup") || + endswith(filename, ".dpkg-remove") || endswith(filename, ".swp"); } -bool ignore_file(const char *filename) { +bool hidden_file(const char *filename) { assert(filename); if (endswith(filename, "~")) return true; - return ignore_file_allow_backup(filename); + return hidden_file_allow_backup(filename); } int fd_nonblock(int fd, bool nonblock) { @@ -1621,7 +1650,7 @@ int close_all_fds(const int except[], unsigned n_except) { while ((de = readdir(d))) { int fd = -1; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (safe_atoi(de->d_name, &fd) < 0) @@ -2100,7 +2129,7 @@ int acquire_terminal( assert(notify >= 0); for (;;) { - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event); + union inotify_event_buffer buffer; struct inotify_event *e; ssize_t l; @@ -2123,7 +2152,7 @@ int acquire_terminal( } } - l = read(notify, buffer, sizeof(buffer)); + l = read(notify, &buffer, sizeof(buffer)); if (l < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -2268,21 +2297,25 @@ ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) { ssize_t k; k = read(fd, p, nbytes); - if (k < 0 && errno == EINTR) - continue; + if (k < 0) { + if (errno == EINTR) + continue; - if (k < 0 && errno == EAGAIN && do_poll) { + if (errno == EAGAIN && do_poll) { - /* We knowingly ignore any return value here, - * and expect that any error/EOF is reported - * via read() */ + /* We knowingly ignore any return value here, + * and expect that any error/EOF is reported + * via read() */ - fd_wait_for_event(fd, POLLIN, USEC_INFINITY); - continue; + fd_wait_for_event(fd, POLLIN, USEC_INFINITY); + continue; + } + + return n > 0 ? n : -errno; } - if (k <= 0) - return n > 0 ? n : (k < 0 ? -errno : 0); + if (k == 0) + return n; p += k; nbytes -= k; @@ -2294,7 +2327,6 @@ ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) { int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) { const uint8_t *p = buf; - ssize_t n = 0; assert(fd >= 0); assert(buf); @@ -2305,26 +2337,27 @@ int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) { ssize_t k; k = write(fd, p, nbytes); - if (k < 0 && errno == EINTR) - continue; + if (k < 0) { + if (errno == EINTR) + continue; - if (k < 0 && errno == EAGAIN && do_poll) { + if (errno == EAGAIN && do_poll) { + /* We knowingly ignore any return value here, + * and expect that any error/EOF is reported + * via write() */ - /* We knowingly ignore any return value here, - * and expect that any error/EOF is reported - * via write() */ + fd_wait_for_event(fd, POLLOUT, USEC_INFINITY); + continue; + } - fd_wait_for_event(fd, POLLOUT, USEC_INFINITY); - continue; + return -errno; } - if (k <= 0) - /* We were not done yet, and a write error occured. */ - return errno ? -errno : -EIO; + if (k == 0) /* Can't really happen */ + return -EIO; p += k; nbytes -= k; - n += k; } return 0; @@ -2464,9 +2497,9 @@ int make_stdio(int fd) { assert(fd >= 0); - r = dup3(fd, STDIN_FILENO, 0); - s = dup3(fd, STDOUT_FILENO, 0); - t = dup3(fd, STDERR_FILENO, 0); + r = dup2(fd, STDIN_FILENO); + s = dup2(fd, STDOUT_FILENO); + t = dup2(fd, STDERR_FILENO); if (fd >= 3) safe_close(fd); @@ -2474,7 +2507,11 @@ int make_stdio(int fd) { if (r < 0 || s < 0 || t < 0) return -errno; - /* We rely here that the new fd has O_CLOEXEC not set */ + /* Explicitly unset O_CLOEXEC, since if fd was < 3, then + * dup2() was a NOP and the bit hence possibly set. */ + fd_cloexec(STDIN_FILENO, false); + fd_cloexec(STDOUT_FILENO, false); + fd_cloexec(STDERR_FILENO, false); return 0; } @@ -2517,7 +2554,7 @@ int dir_is_empty(const char *path) { if (!de) return 1; - if (!ignore_file(de->d_name)) + if (!hidden_file(de->d_name)) return 0; } } @@ -2771,23 +2808,36 @@ char *getusername_malloc(void) { return lookup_uid(getuid()); } -int getttyname_malloc(int fd, char **r) { - char path[PATH_MAX], *c; - int k; +int getttyname_malloc(int fd, char **ret) { + size_t l = 100; + int r; - assert(r); + assert(fd >= 0); + assert(ret); - k = ttyname_r(fd, path, sizeof(path)); - if (k > 0) - return -k; + for (;;) { + char path[l]; - char_array_0(path); + r = ttyname_r(fd, path, sizeof(path)); + if (r == 0) { + const char *p; + char *c; - c = strdup(startswith(path, "/dev/") ? path + 5 : path); - if (!c) - return -ENOMEM; + p = startswith(path, "/dev/"); + c = strdup(p ?: path); + if (!c) + return -ENOMEM; + + *ret = c; + return 0; + } + + if (r != ERANGE) + return -r; + + l *= 2; + } - *r = c; return 0; } @@ -3055,7 +3105,7 @@ static int rm_rf_internal(const char *path, bool only_dirs, bool delete_root, bo fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME); if (fd < 0) { - if (errno != ENOTDIR) + if (errno != ENOTDIR && errno != ELOOP) return -errno; if (!dangerous) { @@ -3428,7 +3478,7 @@ unsigned columns(void) { c = 80; cached_columns = c; - return c; + return cached_columns; } int fd_lines(int fd) { @@ -3445,7 +3495,7 @@ int fd_lines(int fd) { unsigned lines(void) { const char *e; - unsigned l; + int l; if (_likely_(cached_lines > 0)) return cached_lines; @@ -3453,7 +3503,7 @@ unsigned lines(void) { l = 0; e = getenv("LINES"); if (e) - (void) safe_atou(e, &l); + (void) safe_atoi(e, &l); if (l <= 0) l = fd_lines(STDOUT_FILENO); @@ -3662,7 +3712,7 @@ char *unquote(const char *s, const char* quotes) { /* This is rather stupid, simply removes the heading and * trailing quotes if there is one. Doesn't care about * escaping or anything. We should make this smarter one - * day...*/ + * day... */ l = strlen(s); if (l < 2) @@ -3976,13 +4026,13 @@ bool tty_is_vc_resolve(const char *tty) { const char *default_term_for_tty(const char *tty) { assert(tty); - return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt102"; + return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220"; } bool dirent_is_file(const struct dirent *de) { assert(de); - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) return false; if (de->d_type != DT_REG && @@ -4001,70 +4051,72 @@ bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) { de->d_type != DT_UNKNOWN) return false; - if (ignore_file_allow_backup(de->d_name)) + if (hidden_file_allow_backup(de->d_name)) return false; return endswith(de->d_name, suffix); } -void execute_directory(const char *directory, DIR *d, usec_t timeout, char *argv[]) { - pid_t executor_pid; - int r; - - assert(directory); +static int do_execute(char **directories, usec_t timeout, char *argv[]) { + _cleanup_hashmap_free_free_ Hashmap *pids = NULL; + _cleanup_set_free_free_ Set *seen = NULL; + char **directory; - /* Executes all binaries in a directory in parallel and waits - * for them to finish. Optionally a timeout is applied. */ + /* We fork this all off from a child process so that we can + * somewhat cleanly make use of SIGALRM to set a time limit */ - executor_pid = fork(); - if (executor_pid < 0) { - log_error_errno(errno, "Failed to fork: %m"); - return; + reset_all_signal_handlers(); + reset_signal_mask(); - } else if (executor_pid == 0) { - _cleanup_hashmap_free_free_ Hashmap *pids = NULL; - _cleanup_closedir_ DIR *_d = NULL; - struct dirent *de; + assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); - /* We fork this all off from a child process so that - * we can somewhat cleanly make use of SIGALRM to set - * a time limit */ + pids = hashmap_new(NULL); + if (!pids) + return log_oom(); - reset_all_signal_handlers(); - reset_signal_mask(); + seen = set_new(&string_hash_ops); + if (!seen) + return log_oom(); - assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); + STRV_FOREACH(directory, directories) { + _cleanup_closedir_ DIR *d; + struct dirent *de; + d = opendir(*directory); if (!d) { - d = _d = opendir(directory); - if (!d) { - if (errno == ENOENT) - _exit(EXIT_SUCCESS); - - log_error_errno(errno, "Failed to enumerate directory %s: %m", directory); - _exit(EXIT_FAILURE); - } - } + if (errno == ENOENT) + continue; - pids = hashmap_new(NULL); - if (!pids) { - log_oom(); - _exit(EXIT_FAILURE); + return log_error_errno(errno, "Failed to open directory %s: %m", *directory); } FOREACH_DIRENT(de, d, break) { _cleanup_free_ char *path = NULL; pid_t pid; + int r; if (!dirent_is_file(de)) continue; - path = strjoin(directory, "/", de->d_name, NULL); - if (!path) { - log_oom(); - _exit(EXIT_FAILURE); + if (set_contains(seen, de->d_name)) { + log_debug("%1$s/%2$s skipped (%2$s was already seen).", *directory, de->d_name); + continue; } + r = set_put_strdup(seen, de->d_name); + if (r < 0) + return log_oom(); + + path = strjoin(*directory, "/", de->d_name, NULL); + if (!path) + return log_oom(); + + if (null_or_empty_path(path)) { + log_debug("%s is empty (a mask).", path); + continue; + } else + log_debug("%s will be executed.", path); + pid = fork(); if (pid < 0) { log_error_errno(errno, "Failed to fork: %m"); @@ -4082,45 +4134,68 @@ void execute_directory(const char *directory, DIR *d, usec_t timeout, char *argv argv[0] = path; execv(path, argv); - log_error_errno(errno, "Failed to execute %s: %m", path); - _exit(EXIT_FAILURE); + return log_error_errno(errno, "Failed to execute %s: %m", path); } log_debug("Spawned %s as " PID_FMT ".", path, pid); r = hashmap_put(pids, UINT_TO_PTR(pid), path); - if (r < 0) { - log_oom(); - _exit(EXIT_FAILURE); - } - + if (r < 0) + return log_oom(); path = NULL; } + } - /* Abort execution of this process after the - * timout. We simply rely on SIGALRM as default action - * terminating the process, and turn on alarm(). */ + /* Abort execution of this process after the timout. We simply + * rely on SIGALRM as default action terminating the process, + * and turn on alarm(). */ - if (timeout != USEC_INFINITY) - alarm((timeout + USEC_PER_SEC - 1) / USEC_PER_SEC); + if (timeout != USEC_INFINITY) + alarm((timeout + USEC_PER_SEC - 1) / USEC_PER_SEC); - while (!hashmap_isempty(pids)) { - _cleanup_free_ char *path = NULL; - pid_t pid; + while (!hashmap_isempty(pids)) { + _cleanup_free_ char *path = NULL; + pid_t pid; - pid = PTR_TO_UINT(hashmap_first_key(pids)); - assert(pid > 0); + pid = PTR_TO_UINT(hashmap_first_key(pids)); + assert(pid > 0); - path = hashmap_remove(pids, UINT_TO_PTR(pid)); - assert(path); + path = hashmap_remove(pids, UINT_TO_PTR(pid)); + assert(path); - wait_for_terminate_and_warn(path, pid, true); - } + wait_for_terminate_and_warn(path, pid, true); + } - _exit(EXIT_SUCCESS); + return 0; +} + +void execute_directories(const char* const* directories, usec_t timeout, char *argv[]) { + pid_t executor_pid; + int r; + char *name; + char **dirs = (char**) directories; + + assert(!strv_isempty(dirs)); + + name = basename(dirs[0]); + assert(!isempty(name)); + + /* Executes all binaries in the directories in parallel and waits + * for them to finish. Optionally a timeout is applied. If a file + * with the same name exists in more than one directory, the + * earliest one wins. */ + + executor_pid = fork(); + if (executor_pid < 0) { + log_error_errno(errno, "Failed to fork: %m"); + return; + + } else if (executor_pid == 0) { + r = do_execute(dirs, timeout, argv); + _exit(r < 0 ? EXIT_FAILURE : EXIT_SUCCESS); } - wait_for_terminate_and_warn(directory, executor_pid, true); + wait_for_terminate_and_warn(name, executor_pid, true); } int kill_and_sigcont(pid_t pid, int sig) { @@ -4177,6 +4252,11 @@ bool hostname_is_valid(const char *s) { if (isempty(s)) return false; + /* Doesn't accept empty hostnames, hostnames with trailing or + * leading dots, and hostnames with multiple dots in a + * sequence. Also ensures that the length stays below + * HOST_NAME_MAX. */ + for (p = s, dot = true; *p; p++) { if (*p == '.') { if (dot) @@ -4284,15 +4364,15 @@ int fd_wait_for_event(int fd, int event, usec_t t) { int fopen_temporary(const char *path, FILE **_f, char **_temp_path) { FILE *f; char *t; - int fd; + int r, fd; assert(path); assert(_f); assert(_temp_path); - t = tempfn_xxxxxx(path); - if (!t) - return -ENOMEM; + r = tempfn_xxxxxx(path, &t); + if (r < 0) + return r; fd = mkostemp_safe(t, O_WRONLY|O_CLOEXEC); if (fd < 0) { @@ -4403,13 +4483,14 @@ int vt_disallocate(const char *name) { int symlink_atomic(const char *from, const char *to) { _cleanup_free_ char *t = NULL; + int r; assert(from); assert(to); - t = tempfn_random(to); - if (!t) - return -ENOMEM; + r = tempfn_random(to, &t); + if (r < 0) + return r; if (symlink(from, t) < 0) return -errno; @@ -4424,12 +4505,13 @@ int symlink_atomic(const char *from, const char *to) { int mknod_atomic(const char *path, mode_t mode, dev_t dev) { _cleanup_free_ char *t = NULL; + int r; assert(path); - t = tempfn_random(path); - if (!t) - return -ENOMEM; + r = tempfn_random(path, &t); + if (r < 0) + return r; if (mknod(t, mode, dev) < 0) return -errno; @@ -4444,12 +4526,13 @@ int mknod_atomic(const char *path, mode_t mode, dev_t dev) { int mkfifo_atomic(const char *path, mode_t mode) { _cleanup_free_ char *t = NULL; + int r; assert(path); - t = tempfn_random(path); - if (!t) - return -ENOMEM; + r = tempfn_random(path, &t); + if (r < 0) + return r; if (mkfifo(t, mode) < 0) return -errno; @@ -5136,6 +5219,9 @@ char *format_bytes(char *buf, size_t l, off_t t) { { "K", 1024ULL }, }; + if (t == (off_t) -1) + return NULL; + for (i = 0; i < ELEMENTSOF(table); i++) { if (t >= table[i].factor) { @@ -5385,25 +5471,56 @@ int getenv_for_pid(pid_t pid, const char *field, char **_value) { return r; } -bool is_valid_documentation_url(const char *url) { - assert(url); +bool http_etag_is_valid(const char *etag) { + if (isempty(etag)) + return false; - if (startswith(url, "http://") && url[7]) - return true; + if (!endswith(etag, "\"")) + return false; - if (startswith(url, "https://") && url[8]) - return true; + if (!startswith(etag, "\"") && !startswith(etag, "W/\"")) + return false; - if (startswith(url, "file:") && url[5]) - return true; + return true; +} - if (startswith(url, "info:") && url[5]) - return true; +bool http_url_is_valid(const char *url) { + const char *p; + + if (isempty(url)) + return false; + + p = startswith(url, "http://"); + if (!p) + p = startswith(url, "https://"); + if (!p) + return false; + + if (isempty(p)) + return false; + + return ascii_is_valid(p); +} - if (startswith(url, "man:") && url[4]) +bool documentation_url_is_valid(const char *url) { + const char *p; + + if (isempty(url)) + return false; + + if (http_url_is_valid(url)) return true; - return false; + p = startswith(url, "file:/"); + if (!p) + p = startswith(url, "info:"); + if (!p) + p = startswith(url, "man:"); + + if (isempty(p)) + return false; + + return ascii_is_valid(p); } bool in_initrd(void) { @@ -5561,7 +5678,7 @@ int get_shell(char **_s) { return 0; } -bool filename_is_safe(const char *p) { +bool filename_is_valid(const char *p) { if (isempty(p)) return false; @@ -5892,7 +6009,7 @@ int on_ac_power(void) { if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; device = openat(dirfd(d), de->d_name, O_DIRECTORY|O_RDONLY|O_CLOEXEC|O_NOCTTY); @@ -6339,7 +6456,7 @@ int container_get_leader(const char *machine, pid_t *pid) { assert(machine); assert(pid); - p = strappenda("/run/systemd/machines/", machine); + p = strjoina("/run/systemd/machines/", machine); r = parse_env_file(p, NEWLINE, "LEADER", &s, "CLASS", &class, NULL); if (r == -ENOENT) return -EHOSTDOWN; @@ -6578,7 +6695,7 @@ int open_tmpfile(const char *path, int flags) { #endif /* Fall back to unguessable name + unlinking */ - p = strappenda(path, "/systemd-tmp-XXXXXX"); + p = strjoina(path, "/systemd-tmp-XXXXXX"); fd = mkostemp_safe(p, flags); if (fd < 0) @@ -6666,23 +6783,6 @@ uint64_t physical_memory(void) { return (uint64_t) mem * (uint64_t) page_size(); } -char* mount_test_option(const char *haystack, const char *needle) { - - struct mntent me = { - .mnt_opts = (char*) haystack - }; - - assert(needle); - - /* Like glibc's hasmntopt(), but works on a string, not a - * struct mntent */ - - if (!haystack) - return NULL; - - return hasmntopt(&me, needle); -} - void hexdump(FILE *f, const void *p, size_t s) { const uint8_t *b = p; unsigned n = 0; @@ -6807,6 +6907,15 @@ int umount_recursive(const char *prefix, int flags) { return r ? r : n; } +static int get_mount_flags(const char *path, unsigned long *flags) { + struct statvfs buf; + + if (statvfs(path, &buf) < 0) + return -errno; + *flags = buf.f_flag; + return 0; +} + int bind_remount_recursive(const char *prefix, bool ro) { _cleanup_set_free_free_ Set *done = NULL; _cleanup_free_ char *cleaned = NULL; @@ -6841,6 +6950,7 @@ int bind_remount_recursive(const char *prefix, bool ro) { _cleanup_set_free_free_ Set *todo = NULL; bool top_autofs = false; char *x; + unsigned long orig_flags; todo = set_new(&string_hash_ops); if (!todo) @@ -6918,7 +7028,11 @@ int bind_remount_recursive(const char *prefix, bool ro) { if (mount(cleaned, cleaned, NULL, MS_BIND|MS_REC, NULL) < 0) return -errno; - if (mount(NULL, prefix, NULL, MS_BIND|MS_REMOUNT|(ro ? MS_RDONLY : 0), NULL) < 0) + orig_flags = 0; + (void) get_mount_flags(cleaned, &orig_flags); + orig_flags &= ~MS_RDONLY; + + if (mount(NULL, prefix, NULL, orig_flags|MS_BIND|MS_REMOUNT|(ro ? MS_RDONLY : 0), NULL) < 0) return -errno; x = strdup(cleaned); @@ -6938,7 +7052,14 @@ int bind_remount_recursive(const char *prefix, bool ro) { if (r < 0) return r; - if (mount(NULL, x, NULL, MS_BIND|MS_REMOUNT|(ro ? MS_RDONLY : 0), NULL) < 0) { + /* Try to reuse the original flag set, but + * don't care for errors, in case of + * obstructed mounts */ + orig_flags = 0; + (void) get_mount_flags(x, &orig_flags); + orig_flags &= ~MS_RDONLY; + + if (mount(NULL, x, NULL, orig_flags|MS_BIND|MS_REMOUNT|(ro ? MS_RDONLY : 0), NULL) < 0) { /* Deal with mount points that are * obstructed by a later mount */ @@ -6963,42 +7084,61 @@ int fflush_and_check(FILE *f) { return 0; } -char *tempfn_xxxxxx(const char *p) { +int tempfn_xxxxxx(const char *p, char **ret) { const char *fn; char *t; - size_t k; assert(p); + assert(ret); - t = new(char, strlen(p) + 1 + 6 + 1); - if (!t) - return NULL; + /* + * Turns this: + * /foo/bar/waldo + * + * Into this: + * /foo/bar/.#waldoXXXXXX + */ fn = basename(p); - k = fn - p; + if (!filename_is_valid(fn)) + return -EINVAL; + + t = new(char, strlen(p) + 2 + 6 + 1); + if (!t) + return -ENOMEM; - strcpy(stpcpy(stpcpy(mempcpy(t, p, k), "."), fn), "XXXXXX"); + strcpy(stpcpy(stpcpy(mempcpy(t, p, fn - p), ".#"), fn), "XXXXXX"); - return t; + *ret = path_kill_slashes(t); + return 0; } -char *tempfn_random(const char *p) { +int tempfn_random(const char *p, char **ret) { const char *fn; char *t, *x; uint64_t u; - size_t k; unsigned i; assert(p); + assert(ret); - t = new(char, strlen(p) + 1 + 16 + 1); - if (!t) - return NULL; + /* + * Turns this: + * /foo/bar/waldo + * + * Into this: + * /foo/bar/.#waldobaa2a261115984a9 + */ fn = basename(p); - k = fn - p; + if (!filename_is_valid(fn)) + return -EINVAL; - x = stpcpy(stpcpy(mempcpy(t, p, k), "."), fn); + t = new(char, strlen(p) + 2 + 16 + 1); + if (!t) + return -ENOMEM; + + x = stpcpy(stpcpy(mempcpy(t, p, fn - p), ".#"), fn); u = random_u64(); for (i = 0; i < 16; i++) { @@ -7008,7 +7148,40 @@ char *tempfn_random(const char *p) { *x = 0; - return t; + *ret = path_kill_slashes(t); + return 0; +} + +int tempfn_random_child(const char *p, char **ret) { + char *t, *x; + uint64_t u; + unsigned i; + + assert(p); + assert(ret); + + /* Turns this: + * /foo/bar/waldo + * Into this: + * /foo/bar/waldo/.#3c2b6219aa75d7d0 + */ + + t = new(char, strlen(p) + 3 + 16 + 1); + if (!t) + return -ENOMEM; + + x = stpcpy(stpcpy(t, p), "/.#"); + + u = random_u64(); + for (i = 0; i < 16; i++) { + *(x++) = hexchar(u & 0xF); + u >>= 4; + } + + *x = 0; + + *ret = path_kill_slashes(t); + return 0; } /* make sure the hostname is not "localhost" */ @@ -7051,7 +7224,7 @@ int take_password_lock(const char *root) { * awfully racy, and thus we just won't do them. */ if (root) - path = strappenda(root, "/etc/.pwd.lock"); + path = strjoina(root, "/etc/.pwd.lock"); else path = "/etc/.pwd.lock"; @@ -7347,3 +7520,585 @@ int sethostname_idempotent(const char *s) { return 1; } + +int ptsname_malloc(int fd, char **ret) { + size_t l = 100; + + assert(fd >= 0); + assert(ret); + + for (;;) { + char *c; + + c = new(char, l); + if (!c) + return -ENOMEM; + + if (ptsname_r(fd, c, l) == 0) { + *ret = c; + return 0; + } + if (errno != ERANGE) { + free(c); + return -errno; + } + + free(c); + l *= 2; + } +} + +int openpt_in_namespace(pid_t pid, int flags) { + _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1; + _cleanup_close_pair_ int pair[2] = { -1, -1 }; + union { + struct cmsghdr cmsghdr; + uint8_t buf[CMSG_SPACE(sizeof(int))]; + } control = {}; + struct msghdr mh = { + .msg_control = &control, + .msg_controllen = sizeof(control), + }; + struct cmsghdr *cmsg; + siginfo_t si; + pid_t child; + int r; + + assert(pid > 0); + + r = namespace_open(pid, &pidnsfd, &mntnsfd, NULL, &rootfd); + if (r < 0) + return r; + + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, pair) < 0) + return -errno; + + child = fork(); + if (child < 0) + return -errno; + + if (child == 0) { + int master; + + pair[0] = safe_close(pair[0]); + + r = namespace_enter(pidnsfd, mntnsfd, -1, rootfd); + if (r < 0) + _exit(EXIT_FAILURE); + + master = posix_openpt(flags); + if (master < 0) + _exit(EXIT_FAILURE); + + cmsg = CMSG_FIRSTHDR(&mh); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cmsg), &master, sizeof(int)); + + mh.msg_controllen = cmsg->cmsg_len; + + if (sendmsg(pair[1], &mh, MSG_NOSIGNAL) < 0) + _exit(EXIT_FAILURE); + + _exit(EXIT_SUCCESS); + } + + pair[1] = safe_close(pair[1]); + + r = wait_for_terminate(child, &si); + if (r < 0) + return r; + if (si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS) + return -EIO; + + if (recvmsg(pair[0], &mh, MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) < 0) + return -errno; + + for (cmsg = CMSG_FIRSTHDR(&mh); cmsg; cmsg = CMSG_NXTHDR(&mh, cmsg)) + if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { + int *fds; + unsigned n_fds; + + fds = (int*) CMSG_DATA(cmsg); + n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); + + if (n_fds != 1) { + close_many(fds, n_fds); + return -EIO; + } + + return fds[0]; + } + + return -EIO; +} + +ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) { + _cleanup_close_ int fd = -1; + ssize_t l; + + /* The kernel doesn't have a fgetxattrat() command, hence let's emulate one */ + + fd = openat(dirfd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOATIME|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0)); + if (fd < 0) + return -errno; + + l = fgetxattr(fd, attribute, value, size); + if (l < 0) + return -errno; + + return l; +} + +static int parse_crtime(le64_t le, usec_t *usec) { + uint64_t u; + + assert(usec); + + u = le64toh(le); + if (u == 0 || u == (uint64_t) -1) + return -EIO; + + *usec = (usec_t) u; + return 0; +} + +int fd_getcrtime(int fd, usec_t *usec) { + le64_t le; + ssize_t n; + + assert(fd >= 0); + assert(usec); + + /* Until Linux gets a real concept of birthtime/creation time, + * let's fake one with xattrs */ + + n = fgetxattr(fd, "user.crtime_usec", &le, sizeof(le)); + if (n < 0) + return -errno; + if (n != sizeof(le)) + return -EIO; + + return parse_crtime(le, usec); +} + +int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags) { + le64_t le; + ssize_t n; + + n = fgetxattrat_fake(dirfd, name, "user.crtime_usec", &le, sizeof(le), flags); + if (n < 0) + return -errno; + if (n != sizeof(le)) + return -EIO; + + return parse_crtime(le, usec); +} + +int path_getcrtime(const char *p, usec_t *usec) { + le64_t le; + ssize_t n; + + assert(p); + assert(usec); + + n = getxattr(p, "user.crtime_usec", &le, sizeof(le)); + if (n < 0) + return -errno; + if (n != sizeof(le)) + return -EIO; + + return parse_crtime(le, usec); +} + +int fd_setcrtime(int fd, usec_t usec) { + le64_t le; + + assert(fd >= 0); + + if (usec <= 0) + usec = now(CLOCK_REALTIME); + + le = htole64((uint64_t) usec); + if (fsetxattr(fd, "user.crtime_usec", &le, sizeof(le), 0) < 0) + return -errno; + + return 0; +} + +int same_fd(int a, int b) { + struct stat sta, stb; + pid_t pid; + int r, fa, fb; + + assert(a >= 0); + assert(b >= 0); + + /* Compares two file descriptors. Note that semantics are + * quite different depending on whether we have kcmp() or we + * don't. If we have kcmp() this will only return true for + * dup()ed file descriptors, but not otherwise. If we don't + * have kcmp() this will also return true for two fds of the same + * file, created by separate open() calls. Since we use this + * call mostly for filtering out duplicates in the fd store + * this difference hopefully doesn't matter too much. */ + + if (a == b) + return true; + + /* Try to use kcmp() if we have it. */ + pid = getpid(); + r = kcmp(pid, pid, KCMP_FILE, a, b); + if (r == 0) + return true; + if (r > 0) + return false; + if (errno != ENOSYS) + return -errno; + + /* We don't have kcmp(), use fstat() instead. */ + if (fstat(a, &sta) < 0) + return -errno; + + if (fstat(b, &stb) < 0) + return -errno; + + if ((sta.st_mode & S_IFMT) != (stb.st_mode & S_IFMT)) + return false; + + /* We consider all device fds different, since two device fds + * might refer to quite different device contexts even though + * they share the same inode and backing dev_t. */ + + if (S_ISCHR(sta.st_mode) || S_ISBLK(sta.st_mode)) + return false; + + if (sta.st_dev != stb.st_dev || sta.st_ino != stb.st_ino) + return false; + + /* The fds refer to the same inode on disk, let's also check + * if they have the same fd flags. This is useful to + * distuingish the read and write side of a pipe created with + * pipe(). */ + fa = fcntl(a, F_GETFL); + if (fa < 0) + return -errno; + + fb = fcntl(b, F_GETFL); + if (fb < 0) + return -errno; + + return fa == fb; +} + +int chattr_fd(int fd, bool b, unsigned mask) { + unsigned old_attr, new_attr; + + assert(fd >= 0); + + if (mask == 0) + return 0; + + if (ioctl(fd, FS_IOC_GETFLAGS, &old_attr) < 0) + return -errno; + + if (b) + new_attr = old_attr | mask; + else + new_attr = old_attr & ~mask; + + if (new_attr == old_attr) + return 0; + + if (ioctl(fd, FS_IOC_SETFLAGS, &new_attr) < 0) + return -errno; + + return 0; +} + +int chattr_path(const char *p, bool b, unsigned mask) { + _cleanup_close_ int fd = -1; + + assert(p); + + if (mask == 0) + return 0; + + fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); + if (fd < 0) + return -errno; + + return chattr_fd(fd, b, mask); +} + +int read_attr_fd(int fd, unsigned *ret) { + assert(fd >= 0); + + if (ioctl(fd, FS_IOC_GETFLAGS, ret) < 0) + return -errno; + + return 0; +} + +int read_attr_path(const char *p, unsigned *ret) { + _cleanup_close_ int fd = -1; + + assert(p); + assert(ret); + + fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); + if (fd < 0) + return -errno; + + return read_attr_fd(fd, ret); +} + +int make_lock_file(const char *p, int operation, LockFile *ret) { + _cleanup_close_ int fd = -1; + _cleanup_free_ char *t = NULL; + int r; + + /* + * We use UNPOSIX locks if they are available. They have nice + * semantics, and are mostly compatible with NFS. However, + * they are only available on new kernels. When we detect we + * are running on an older kernel, then we fall back to good + * old BSD locks. They also have nice semantics, but are + * slightly problematic on NFS, where they are upgraded to + * POSIX locks, even though locally they are orthogonal to + * POSIX locks. + */ + + t = strdup(p); + if (!t) + return -ENOMEM; + + for (;;) { + struct flock fl = { + .l_type = (operation & ~LOCK_NB) == LOCK_EX ? F_WRLCK : F_RDLCK, + .l_whence = SEEK_SET, + }; + struct stat st; + + fd = open(p, O_CREAT|O_RDWR|O_NOFOLLOW|O_CLOEXEC|O_NOCTTY, 0600); + if (fd < 0) + return -errno; + + r = fcntl(fd, (operation & LOCK_NB) ? F_OFD_SETLK : F_OFD_SETLKW, &fl); + if (r < 0) { + + /* If the kernel is too old, use good old BSD locks */ + if (errno == EINVAL) + r = flock(fd, operation); + + if (r < 0) + return errno == EAGAIN ? -EBUSY : -errno; + } + + /* If we acquired the lock, let's check if the file + * still exists in the file system. If not, then the + * previous exclusive owner removed it and then closed + * it. In such a case our acquired lock is worthless, + * hence try again. */ + + r = fstat(fd, &st); + if (r < 0) + return -errno; + if (st.st_nlink > 0) + break; + + fd = safe_close(fd); + } + + ret->path = t; + ret->fd = fd; + ret->operation = operation; + + fd = -1; + t = NULL; + + return r; +} + +int make_lock_file_for(const char *p, int operation, LockFile *ret) { + const char *fn; + char *t; + + assert(p); + assert(ret); + + fn = basename(p); + if (!filename_is_valid(fn)) + return -EINVAL; + + t = newa(char, strlen(p) + 2 + 4 + 1); + stpcpy(stpcpy(stpcpy(mempcpy(t, p, fn - p), ".#"), fn), ".lck"); + + return make_lock_file(t, operation, ret); +} + +void release_lock_file(LockFile *f) { + int r; + + if (!f) + return; + + if (f->path) { + + /* If we are the exclusive owner we can safely delete + * the lock file itself. If we are not the exclusive + * owner, we can try becoming it. */ + + if (f->fd >= 0 && + (f->operation & ~LOCK_NB) == LOCK_SH) { + static const struct flock fl = { + .l_type = F_WRLCK, + .l_whence = SEEK_SET, + }; + + r = fcntl(f->fd, F_OFD_SETLK, &fl); + if (r < 0 && errno == EINVAL) + r = flock(f->fd, LOCK_EX|LOCK_NB); + + if (r >= 0) + f->operation = LOCK_EX|LOCK_NB; + } + + if ((f->operation & ~LOCK_NB) == LOCK_EX) + unlink_noerrno(f->path); + + free(f->path); + f->path = NULL; + } + + f->fd = safe_close(f->fd); + f->operation = 0; +} + +static size_t nul_length(const uint8_t *p, size_t sz) { + size_t n = 0; + + while (sz > 0) { + if (*p != 0) + break; + + n++; + p++; + sz--; + } + + return n; +} + +ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) { + const uint8_t *q, *w, *e; + ssize_t l; + + q = w = p; + e = q + sz; + while (q < e) { + size_t n; + + n = nul_length(q, e - q); + + /* If there are more than the specified run length of + * NUL bytes, or if this is the beginning or the end + * of the buffer, then seek instead of write */ + if ((n > run_length) || + (n > 0 && q == p) || + (n > 0 && q + n >= e)) { + if (q > w) { + l = write(fd, w, q - w); + if (l < 0) + return -errno; + if (l != q -w) + return -EIO; + } + + if (lseek(fd, n, SEEK_CUR) == (off_t) -1) + return -errno; + + q += n; + w = q; + } else if (n > 0) + q += n; + else + q ++; + } + + if (q > w) { + l = write(fd, w, q - w); + if (l < 0) + return -errno; + if (l != q - w) + return -EIO; + } + + return q - (const uint8_t*) p; +} + +void sigkill_wait(pid_t *pid) { + if (!pid) + return; + if (*pid <= 1) + return; + + if (kill(*pid, SIGKILL) > 0) + (void) wait_for_terminate(*pid, NULL); +} + +int syslog_parse_priority(const char **p, int *priority, bool with_facility) { + int a = 0, b = 0, c = 0; + int k; + + assert(p); + assert(*p); + assert(priority); + + if ((*p)[0] != '<') + return 0; + + if (!strchr(*p, '>')) + return 0; + + if ((*p)[2] == '>') { + c = undecchar((*p)[1]); + k = 3; + } else if ((*p)[3] == '>') { + b = undecchar((*p)[1]); + c = undecchar((*p)[2]); + k = 4; + } else if ((*p)[4] == '>') { + a = undecchar((*p)[1]); + b = undecchar((*p)[2]); + c = undecchar((*p)[3]); + k = 5; + } else + return 0; + + if (a < 0 || b < 0 || c < 0 || + (!with_facility && (a || b || c > 7))) + return 0; + + if (with_facility) + *priority = a*100 + b*10 + c; + else + *priority = (*priority & LOG_FACMASK) | c; + + *p += k; + return 1; +} + +ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) { + size_t i; + + if (!key) + return -1; + + for (i = 0; i < len; ++i) + if (streq_ptr(table[i], key)) + return (ssize_t)i; + + return -1; +} diff --git a/src/shared/util.h b/src/shared/util.h index 73bd9012f..a83b58822 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -42,14 +42,16 @@ #include #include #include +#include #if SIZEOF_PID_T == 4 -# define PID_FMT "%" PRIu32 +# define PID_PRI PRIi32 #elif SIZEOF_PID_T == 2 -# define PID_FMT "%" PRIu16 +# define PID_PRI PRIi16 #else # error Unknown pid_t size #endif +#define PID_FMT "%" PID_PRI #if SIZEOF_UID_T == 4 # define UID_FMT "%" PRIu32 @@ -68,7 +70,7 @@ #endif #if SIZEOF_TIME_T == 8 -# define PRI_TIME PRIu64 +# define PRI_TIME PRIi64 #elif SIZEOF_TIME_T == 4 # define PRI_TIME PRIu32 #else @@ -142,6 +144,10 @@ static inline const char* true_false(bool b) { return b ? "true" : "false"; } +static inline const char* one_zero(bool b) { + return b ? "1" : "0"; +} + static inline const char* strempty(const char *s) { return s ? s : ""; } @@ -317,7 +323,7 @@ char *ascii_strlower(char *path); bool dirent_is_file(const struct dirent *de) _pure_; bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_; -bool ignore_file(const char *filename) _pure_; +bool hidden_file(const char *filename) _pure_; bool chars_intersect(const char *a, const char *b) _pure_; @@ -342,26 +348,29 @@ static inline uint32_t random_u32(void) { } /* For basic lookup tables with strictly enumerated entries */ -#define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ +#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \ scope const char *name##_to_string(type i) { \ if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \ return NULL; \ return name##_table[i]; \ - } \ - scope type name##_from_string(const char *s) { \ - type i; \ - if (!s) \ - return (type) -1; \ - for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \ - if (name##_table[i] && \ - streq(name##_table[i], s)) \ - return i; \ - return (type) -1; \ - } \ + } + +ssize_t string_table_lookup(const char * const *table, size_t len, const char *key); + +#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \ + scope inline type name##_from_string(const char *s) { \ + return (type)string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \ + } + +#define _DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ + _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \ + _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \ struct __useless_struct_to_allow_trailing_semicolon__ -#define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,) -#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,static) +#define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,) +#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,static) +#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,static) +#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,static) /* For string conversions where numbers are also acceptable */ #define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \ @@ -375,7 +384,7 @@ static inline uint32_t random_u32(void) { if (!s) \ return log_oom(); \ } else { \ - r = asprintf(&s, "%u", i); \ + r = asprintf(&s, "%i", i); \ if (r < 0) \ return log_oom(); \ } \ @@ -467,6 +476,8 @@ cpu_set_t* cpu_set_malloc(unsigned *ncpus); int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) _printf_(4,0); int status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...) _printf_(4,5); +#define xsprintf(buf, fmt, ...) assert_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf)) + int fd_columns(int fd); unsigned columns(void); int fd_lines(int fd); @@ -533,7 +544,7 @@ bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); const char *default_term_for_tty(const char *tty); -void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]); +void execute_directories(const char* const* directories, usec_t timeout, char *argv[]); int kill_and_sigcont(pid_t pid, int sig); @@ -646,7 +657,10 @@ int setrlimit_closest(int resource, const struct rlimit *rlim); int getenv_for_pid(pid_t pid, const char *field, char **_value); -bool is_valid_documentation_url(const char *url) _pure_; +bool http_url_is_valid(const char *url) _pure_; +bool documentation_url_is_valid(const char *url) _pure_; + +bool http_etag_is_valid(const char *etag); bool in_initrd(void); @@ -659,13 +673,6 @@ static inline void freep(void *p) { free(*(void**) p); } -#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \ - static inline void func##p(type *p) { \ - if (*p) \ - func(*p); \ - } \ - struct __useless_struct_to_allow_trailing_semicolon__ - static inline void closep(int *fd) { safe_close(*fd); } @@ -714,7 +721,7 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_ return memdup(p, a * b); } -bool filename_is_safe(const char *p) _pure_; +bool filename_is_valid(const char *p) _pure_; bool path_is_safe(const char *p) _pure_; bool string_is_safe(const char *p) _pure_; bool string_has_cc(const char *p, const char *ok) _pure_; @@ -771,10 +778,19 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *root on_error; \ } \ break; \ - } else if (ignore_file((de)->d_name)) \ + } else if (hidden_file((de)->d_name)) \ continue; \ else +#define FOREACH_DIRENT_ALL(de, d, on_error) \ + for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d)) \ + if (!de) { \ + if (errno > 0) { \ + on_error; \ + } \ + break; \ + } else + static inline void *mempset(void *s, int c, size_t n) { memset(s, c, n); return (uint8_t*)s + n; @@ -839,7 +855,7 @@ static inline unsigned u32ctz(uint32_t n) { #endif } -static inline int log2i(int x) { +static inline unsigned log2i(int x) { assert(x > 0); return __SIZEOF_INT__ * 8 - __builtin_clz(x) - 1; @@ -883,6 +899,7 @@ int unlink_noerrno(const char *path); (void *) memset(_new_, 0, _len_); \ }) +/* It's not clear what alignment glibc/gcc alloca() guarantee, hence provide a guaranteed safe version */ #define alloca_align(size, align) \ ({ \ void *_ptr_; \ @@ -899,19 +916,19 @@ int unlink_noerrno(const char *path); (void*)memset(_new_, 0, _size_); \ }) -#define strappenda(a, ...) \ - ({ \ - int _len = strlen(a); \ - unsigned _i; \ - char *_d_, *_p_; \ - const char *_appendees_[] = { __VA_ARGS__ }; \ - for (_i = 0; _i < ELEMENTSOF(_appendees_); _i++) \ - _len += strlen(_appendees_[_i]); \ - _d_ = alloca(_len + 1); \ - _p_ = stpcpy(_d_, a); \ - for (_i = 0; _i < ELEMENTSOF(_appendees_); _i++) \ - _p_ = stpcpy(_p_, _appendees_[_i]); \ - _d_; \ +#define strjoina(a, ...) \ + ({ \ + const char *_appendees_[] = { a, __VA_ARGS__ }; \ + char *_d_, *_p_; \ + int _len_ = 0; \ + unsigned _i_; \ + for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \ + _len_ += strlen(_appendees_[_i_]); \ + _p_ = _d_ = alloca(_len_ + 1); \ + for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \ + _p_ = stpcpy(_p_, _appendees_[_i_]); \ + *_p_ = 0; \ + _d_; \ }) #define procfs_file_alloca(pid, field) \ @@ -927,32 +944,6 @@ int unlink_noerrno(const char *path); _r_; \ }) -struct _locale_struct_ { - locale_t saved_locale; - locale_t new_locale; - bool quit; -}; - -static inline void _reset_locale_(struct _locale_struct_ *s) { - PROTECT_ERRNO; - if (s->saved_locale != (locale_t) 0) - uselocale(s->saved_locale); - if (s->new_locale != (locale_t) 0) - freelocale(s->new_locale); -} - -#define RUN_WITH_LOCALE(mask, loc) \ - for (_cleanup_(_reset_locale_) struct _locale_struct_ _saved_locale_ = { (locale_t) 0, (locale_t) 0, false }; \ - ({ \ - if (!_saved_locale_.quit) { \ - PROTECT_ERRNO; \ - _saved_locale_.new_locale = newlocale((mask), (loc), (locale_t) 0); \ - if (_saved_locale_.new_locale != (locale_t) 0) \ - _saved_locale_.saved_locale = uselocale(_saved_locale_.new_locale); \ - } \ - !_saved_locale_.quit; }) ; \ - _saved_locale_.quit = true) - bool id128_is_valid(const char *s) _pure_; int split_pair(const char *s, const char *sep, char **l, char **r); @@ -998,14 +989,13 @@ const char *personality_to_string(unsigned long); uint64_t physical_memory(void); -char* mount_test_option(const char *haystack, const char *needle); - void hexdump(FILE *f, const void *p, size_t s); union file_handle_union { struct file_handle handle; char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ]; }; +#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ } int update_reboot_param_file(const char *param); @@ -1015,8 +1005,9 @@ int bind_remount_recursive(const char *prefix, bool ro); int fflush_and_check(FILE *f); -char *tempfn_xxxxxx(const char *p); -char *tempfn_random(const char *p); +int tempfn_xxxxxx(const char *p, char **ret); +int tempfn_random(const char *p, char **ret); +int tempfn_random_child(const char *p, char **ret); bool is_localhost(const char *hostname); @@ -1035,6 +1026,55 @@ int sethostname_idempotent(const char *s); #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) #define FOREACH_INOTIFY_EVENT(e, buffer, sz) \ - for ((e) = (struct inotify_event*) (buffer); \ - (uint8_t*) (e) < (uint8_t*) (buffer) + (sz); \ + for ((e) = &buffer.ev; \ + (uint8_t*) (e) < (uint8_t*) (buffer.raw) + (sz); \ (e) = (struct inotify_event*) ((uint8_t*) (e) + sizeof(struct inotify_event) + (e)->len)) + +union inotify_event_buffer { + struct inotify_event ev; + uint8_t raw[INOTIFY_EVENT_MAX]; +}; + +#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW) + +int ptsname_malloc(int fd, char **ret); + +int openpt_in_namespace(pid_t pid, int flags); + +ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags); + +int fd_setcrtime(int fd, usec_t usec); +int fd_getcrtime(int fd, usec_t *usec); +int path_getcrtime(const char *p, usec_t *usec); +int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags); + +int same_fd(int a, int b); + +int chattr_fd(int fd, bool b, unsigned mask); +int chattr_path(const char *p, bool b, unsigned mask); + +int read_attr_fd(int fd, unsigned *ret); +int read_attr_path(const char *p, unsigned *ret); + +typedef struct LockFile { + char *path; + int fd; + int operation; +} LockFile; + +int make_lock_file(const char *p, int operation, LockFile *ret); +int make_lock_file_for(const char *p, int operation, LockFile *ret); +void release_lock_file(LockFile *f); + +#define _cleanup_release_lock_file_ _cleanup_(release_lock_file) + +#define LOCK_FILE_INIT { .fd = -1, .path = NULL } + +#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim }) + +ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length); + +void sigkill_wait(pid_t *pid); +#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait) + +int syslog_parse_priority(const char **p, int *priority, bool with_facility); diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c index 31f13ec80..bdb962af3 100644 --- a/src/shared/utmp-wtmp.c +++ b/src/shared/utmp-wtmp.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "macro.h" #include "path-util.h" diff --git a/src/shared/verbs.c b/src/shared/verbs.c new file mode 100644 index 000000000..c7beccc2d --- /dev/null +++ b/src/shared/verbs.c @@ -0,0 +1,90 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "util.h" +#include "verbs.h" + +int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { + const Verb *verb; + const char *name; + unsigned i; + int left; + + assert(verbs); + assert(verbs[0].dispatch); + assert(argc >= 0); + assert(argv); + assert(argc >= optind); + + left = argc - optind; + name = argv[optind]; + + for (i = 0;; i++) { + bool found; + + /* At the end of the list? */ + if (!verbs[i].dispatch) { + if (name) + log_error("Unknown operation %s.", name); + else + log_error("Requires operation parameter."); + return -EINVAL; + } + + if (name) + found = streq(name, verbs[i].verb); + else + found = !!(verbs[i].flags & VERB_DEFAULT); + + if (found) { + verb = &verbs[i]; + break; + } + } + + assert(verb); + + if (!name) + left = 1; + + if (verb->min_args != VERB_ANY && + (unsigned) left < verb->min_args) { + log_error("Too few arguments."); + return -EINVAL; + } + + if (verb->max_args != VERB_ANY && + (unsigned) left > verb->max_args) { + log_error("Too many arguments."); + return -EINVAL; + } + + if (name) + return verb->dispatch(left, argv + optind, userdata); + else { + char* fake[2] = { + (char*) verb->verb, + NULL + }; + + return verb->dispatch(1, fake, userdata); + } +} diff --git a/src/shared/verbs.h b/src/shared/verbs.h new file mode 100644 index 000000000..d59e4d59b --- /dev/null +++ b/src/shared/verbs.h @@ -0,0 +1,34 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#define VERB_ANY ((unsigned) -1) +#define VERB_DEFAULT 1 + +typedef struct { + const char *verb; + unsigned min_args, max_args; + unsigned flags; + int (* const dispatch)(int argc, char *argv[], void *userdata); +} Verb; + +int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata); diff --git a/src/shared/virt.c b/src/shared/virt.c index f10baab40..7c1381f4b 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -101,6 +101,22 @@ static int detect_vm_cpuid(const char **_id) { return 0; } +static int detect_vm_devicetree(const char **_id) { +#if defined(__powerpc__) || defined(__powerpc64__) + _cleanup_free_ char *hvtype = NULL; + int r; + + r = read_one_line_file("/sys/firmware/devicetree/base/hypervisor/compatible", &hvtype); + if (r >= 0) { + if (streq(hvtype, "linux,kvm")) { + *_id = "kvm"; + return 1; + } + } +#endif + return 0; +} + static int detect_vm_dmi(const char **_id) { /* Both CPUID and DMI are x86 specific interfaces... */ @@ -204,6 +220,10 @@ int detect_vm(const char **id) { if (r != 0) goto finish; + r = detect_vm_devicetree(&_id); + if (r != 0) + goto finish; + if (_id) { /* "other" */ r = 1; diff --git a/src/shared/xml.h b/src/shared/xml.h index af71709c3..b256b0ba1 100644 --- a/src/shared/xml.h +++ b/src/shared/xml.h @@ -28,7 +28,7 @@ enum { XML_TAG_CLOSE, XML_TAG_CLOSE_EMPTY, XML_ATTRIBUTE_NAME, - XML_ATTRIBUTE_VALUE + XML_ATTRIBUTE_VALUE, }; int xml_tokenize(const char **p, char **name, void **state, unsigned *line); diff --git a/src/shutdownd/shutdownd.c b/src/shutdownd/shutdownd.c index 826efbfea..701882b96 100644 --- a/src/shutdownd/shutdownd.c +++ b/src/shutdownd/shutdownd.c @@ -20,7 +20,7 @@ ***/ #include -#include +#include #include #include #include diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 56b963a72..cc1ffa63f 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -92,6 +92,7 @@ static int execute(char **modes, char **states) { arg_verb, NULL }; + static const char* const dirs[] = {SYSTEM_SLEEP_PATH, NULL}; int r; _cleanup_fclose_ FILE *f = NULL; @@ -107,7 +108,7 @@ static int execute(char **modes, char **states) { if (r < 0) return r; - execute_directory(SYSTEM_SLEEP_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments); + execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments); log_struct(LOG_INFO, LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START), @@ -126,7 +127,7 @@ static int execute(char **modes, char **states) { NULL); arguments[1] = (char*) "post"; - execute_directory(SYSTEM_SLEEP_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments); + execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments); return r; } diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 973e67e3c..275a5b74a 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -78,22 +78,6 @@ static int apply_sysctl(const char *property, const char *value) { n = stpcpy(p, "/proc/sys/"); strcpy(n, property); - if (!strv_isempty(arg_prefixes)) { - char **i; - bool good = false; - - STRV_FOREACH(i, arg_prefixes) - if (path_startswith(p, *i)) { - good = true; - break; - } - - if (!good) { - log_debug("Skipping %s", p); - return 0; - } - } - k = write_string_file(p, value); if (k < 0) { log_full(k == -ENOENT ? LOG_DEBUG : LOG_WARNING, @@ -173,6 +157,20 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno p = normalize_sysctl(strstrip(p)); value = strstrip(value); + if (!strv_isempty(arg_prefixes)) { + char **i, *t; + STRV_FOREACH(i, arg_prefixes) { + t = path_startswith(*i, "/proc/sys/"); + if (t == NULL) + t = *i; + if (path_startswith(p, t)) + goto found; + } + /* not found */ + continue; + } + +found: existing = hashmap_get2(sysctl_options, p, &v); if (existing) { if (streq(value, existing)) diff --git a/src/system-update-generator/system-update-generator.c b/src/system-update-generator/system-update-generator.c index 464ee22b2..ad34ef136 100644 --- a/src/system-update-generator/system-update-generator.c +++ b/src/system-update-generator/system-update-generator.c @@ -37,7 +37,7 @@ static const char *arg_dest = "/tmp"; static int generate_symlink(void) { const char *p = NULL; - if (access("/system-update", F_OK) < 0) { + if (laccess("/system-update", F_OK) < 0) { if (errno == ENOENT) return 0; @@ -45,7 +45,7 @@ static int generate_symlink(void) { return -EINVAL; } - p = strappenda(arg_dest, "/default.target"); + p = strjoina(arg_dest, "/default.target"); if (symlink(SYSTEM_DATA_UNIT_PATH "/system-update.target", p) < 0) return log_error_errno(errno, "Failed to create symlink %s: %m", p); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index b1441ad86..21cb898b9 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "sd-daemon.h" #include "sd-shutdown.h" @@ -74,6 +73,7 @@ #include "bus-error.h" #include "bus-common-errors.h" #include "mkdir.h" +#include "dropin.h" static char **arg_types = NULL; static char **arg_states = NULL; @@ -175,7 +175,6 @@ static void ask_password_agent_open_if_enabled(void) { ask_password_agent_open(); } -#ifdef HAVE_LOGIND static void polkit_agent_open_if_enabled(void) { /* Open the polkit agent as a child process if necessary */ @@ -191,7 +190,15 @@ static void polkit_agent_open_if_enabled(void) { polkit_agent_open(); } -#endif + +static OutputFlags get_output_flags(void) { + return + arg_all * OUTPUT_SHOW_ALL | + arg_full * OUTPUT_FULL_WIDTH | + (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | + on_tty() * OUTPUT_COLOR | + !arg_quiet * OUTPUT_WARN_CUTOFF; +} static int translate_bus_error_to_exit_status(int r, const sd_bus_error *error) { assert(error); @@ -303,16 +310,9 @@ static int compare_unit_info(const void *a, const void *b) { } static bool output_show_unit(const UnitInfo *u, char **patterns) { - if (!strv_isempty(patterns)) { - char **pattern; - - STRV_FOREACH(pattern, patterns) - if (fnmatch(*pattern, u->id, FNM_NOESCAPE) == 0) - goto next; + if (!strv_fnmatch_or_empty(patterns, u->id, FNM_NOESCAPE)) return false; - } -next: if (arg_types) { const char *dot; @@ -426,14 +426,12 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) { n_shown++; - if (STR_IN_SET(u->load_state, "error", "not-found", "masked")) { + if (STR_IN_SET(u->load_state, "error", "not-found", "masked") && !arg_plain) { on_loaded = ansi_highlight_red(); on_circle = ansi_highlight_yellow(); off_loaded = off_circle = ansi_highlight_off(); circle = true; - } - - if (streq(u->active_state, "failed")) { + } else if (streq(u->active_state, "failed") && !arg_plain) { on_circle = on_active = ansi_highlight_red(); off_circle = off_active = ansi_highlight_off(); circle = true; @@ -621,7 +619,7 @@ static int get_unit_list_recursive( _cleanup_bus_close_unref_ sd_bus *container = NULL; int k; - r = sd_bus_open_system_container(&container, *i); + r = sd_bus_open_system_machine(&container, *i); if (r < 0) { log_error_errno(r, "Failed to connect to container %s: %m", *i); continue; @@ -752,7 +750,7 @@ struct socket_info { /* Note: triggered is a list here, although it almost certainly * will always be one unit. Nevertheless, dbus API allows for multiple - * values, so let's follow that.*/ + * values, so let's follow that. */ char** triggered; /* The strv above is shared. free is set only in the first one. */ @@ -1249,16 +1247,9 @@ static int compare_unit_file_list(const void *a, const void *b) { } static bool output_show_unit_file(const UnitFileList *u, char **patterns) { - if (!strv_isempty(patterns)) { - char **pattern; - - STRV_FOREACH(pattern, patterns) - if (fnmatch(*pattern, basename(u->path), FNM_NOESCAPE) == 0) - goto next; + if (!strv_fnmatch_or_empty(patterns, basename(u->path), FNM_NOESCAPE)) return false; - } -next: if (!strv_isempty(arg_types)) { const char *dot; @@ -1270,10 +1261,9 @@ next: return false; } - if (!strv_isempty(arg_states)) { - if (!strv_find(arg_states, unit_file_state_to_string(u->state))) - return false; - } + if (!strv_isempty(arg_states) && + !strv_find(arg_states, unit_file_state_to_string(u->state))) + return false; return true; } @@ -1606,8 +1596,6 @@ static int list_dependencies_one( qsort_safe(deps, strv_length(deps), sizeof (char*), list_dependencies_compare); STRV_FOREACH(c, deps) { - int state; - if (strv_contains(*units, *c)) { if (!arg_plain) { r = list_dependencies_print("...", level + 1, (branches << 1) | (c[1] == NULL ? 0 : 1), 1); @@ -1617,11 +1605,16 @@ static int list_dependencies_one( continue; } - state = check_one_unit(bus, *c, "activating\0active\0reloading\0", true); - if (state > 0) - printf("%s%s%s ", ansi_highlight_green(), draw_special_char(DRAW_BLACK_CIRCLE), ansi_highlight_off()); - else - printf("%s%s%s ", ansi_highlight_red(), draw_special_char(DRAW_BLACK_CIRCLE), ansi_highlight_off()); + if (arg_plain) + printf(" "); + else { + int state; + const char *on; + + state = check_one_unit(bus, *c, "activating\0active\0reloading\0", true); + on = state > 0 ? ansi_highlight_green() : ansi_highlight_red(); + printf("%s%s%s ", on, draw_special_char(DRAW_BLACK_CIRCLE), ansi_highlight_off()); + } r = list_dependencies_print(*c, level, branches, c[1] == NULL); if (r < 0) @@ -1712,7 +1705,7 @@ static int get_machine_properties(sd_bus *bus, struct machine_info *mi) { assert(mi); if (!bus) { - r = sd_bus_open_system_container(&container, mi->name); + r = sd_bus_open_system_machine(&container, mi->name); if (r < 0) return r; @@ -1727,18 +1720,7 @@ static int get_machine_properties(sd_bus *bus, struct machine_info *mi) { } static bool output_show_machine(const char *name, char **patterns) { - char **i; - - assert(name); - - if (strv_isempty(patterns)) - return true; - - STRV_FOREACH(i, patterns) - if (fnmatch(*i, name, FNM_NOESCAPE) == 0) - return true; - - return false; + return strv_fnmatch_or_empty(patterns, name, FNM_NOESCAPE); } static int get_machine_list( @@ -1817,7 +1799,7 @@ static void output_machines_list(struct machine_info *machine_infos, unsigned n) failedlen = MAX(failedlen, DECIMAL_STR_WIDTH(m->n_failed_units)); jobslen = MAX(jobslen, DECIMAL_STR_WIDTH(m->n_jobs)); - if (!arg_no_legend && !streq_ptr(m->state, "running")) + if (!arg_plain && !streq_ptr(m->state, "running")) circle_len = 2; } @@ -1950,32 +1932,6 @@ static void dump_unit_file_changes(const UnitFileChange *changes, unsigned n_cha } } -static int deserialize_and_dump_unit_file_changes(sd_bus_message *m) { - const char *type, *path, *source; - int r; - - r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(sss)"); - if (r < 0) - return bus_log_parse_error(r); - - while ((r = sd_bus_message_read(m, "(sss)", &type, &path, &source)) > 0) { - if (!arg_quiet) { - if (streq(type, "symlink")) - log_info("Created symlink from %s to %s.", path, source); - else - log_info("Removed symlink %s.", path); - } - } - if (r < 0) - return bus_log_parse_error(r); - - r = sd_bus_message_exit_container(m); - if (r < 0) - return bus_log_parse_error(r); - - return 0; -} - static int set_default(sd_bus *bus, char **args) { _cleanup_free_ char *unit = NULL; UnitFileChange *changes = NULL; @@ -2023,7 +1979,7 @@ static int set_default(sd_bus *bus, char **args) { return r; } - r = deserialize_and_dump_unit_file_changes(reply); + r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet); if (r < 0) return r; @@ -2053,10 +2009,12 @@ static void output_jobs_list(const struct job_info* jobs, unsigned n, bool skipp assert(n == 0 || jobs); if (n == 0) { - on = ansi_highlight_green(); - off = ansi_highlight_off(); + if (!arg_no_legend) { + on = ansi_highlight_green(); + off = ansi_highlight_off(); - printf("%sNo jobs %s.%s\n", on, skipped ? "listed" : "running", off); + printf("%sNo jobs %s.%s\n", on, skipped ? "listed" : "running", off); + } return; } @@ -2115,17 +2073,7 @@ static void output_jobs_list(const struct job_info* jobs, unsigned n, bool skipp } static bool output_show_job(struct job_info *job, char **patterns) { - char **pattern; - - assert(job); - - if (strv_isempty(patterns)) - return true; - - STRV_FOREACH(pattern, patterns) - if (fnmatch(*pattern, job->name, FNM_NOESCAPE) == 0) - return true; - return false; + return strv_fnmatch_or_empty(patterns, job->name, FNM_NOESCAPE); } static int list_jobs(sd_bus *bus, char **args) { @@ -2270,182 +2218,175 @@ static int need_daemon_reload(sd_bus *bus, const char *unit) { return b; } -typedef struct WaitData { - Set *set; - - char *name; - char *result; -} WaitData; - -static int wait_filter(sd_bus *bus, sd_bus_message *m, void *data, sd_bus_error *error) { - WaitData *d = data; - - assert(bus); - assert(m); - assert(d); - - log_debug("Got D-Bus request: %s.%s() on %s", - sd_bus_message_get_interface(m), - sd_bus_message_get_member(m), - sd_bus_message_get_path(m)); - - if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) { - log_error("Warning! D-Bus connection terminated."); - sd_bus_close(bus); - } else if (sd_bus_message_is_signal(m, "org.freedesktop.systemd1.Manager", "JobRemoved")) { - uint32_t id; - const char *path, *result, *unit; - char *ret; - int r; - - r = sd_bus_message_read(m, "uoss", &id, &path, &unit, &result); - if (r >= 0) { - ret = set_remove(d->set, (char*) path); - if (!ret) - return 0; - - free(ret); - - if (!isempty(result)) - d->result = strdup(result); +static void warn_unit_file_changed(const char *name) { + log_warning("%sWarning:%s %s changed on disk. Run 'systemctl%s daemon-reload' to reload units.", + ansi_highlight_red(), + ansi_highlight_off(), + name, + arg_scope == UNIT_FILE_SYSTEM ? "" : " --user"); +} - if (!isempty(unit)) - d->name = strdup(unit); +static int unit_file_find_path(LookupPaths *lp, const char *unit_name, char **unit_path) { + char **p; - return 0; - } -#ifndef NOLEGACY - r = sd_bus_message_read(m, "uos", &id, &path, &result); - if (r >= 0) { - ret = set_remove(d->set, (char*) path); - if (!ret) - return 0; + assert(lp); + assert(unit_name); + assert(unit_path); - free(ret); + STRV_FOREACH(p, lp->unit_path) { + _cleanup_free_ char *path; - if (*result) - d->result = strdup(result); + path = path_join(arg_root, *p, unit_name); + if (!path) + return log_oom(); - return 0; + if (access(path, F_OK) == 0) { + *unit_path = path; + path = NULL; + return 1; } -#endif - - bus_log_parse_error(r); } return 0; } -static int enable_wait_for_jobs(sd_bus *bus) { +static int unit_find_paths(sd_bus *bus, + const char *unit_name, + bool avoid_bus_cache, + LookupPaths *lp, + char **fragment_path, + char ***dropin_paths) { + + _cleanup_free_ char *path = NULL; + _cleanup_strv_free_ char **dropins = NULL; int r; - assert(bus); + /** + * Finds where the unit is defined on disk. Returns 0 if the unit + * is not found. Returns 1 if it is found, and sets + * - the path to the unit in *path, if it exists on disk, + * - and a strv of existing drop-ins in *dropins, + * if the arg is not NULL and any dropins were found. + */ - r = sd_bus_add_match( - bus, - NULL, - "type='signal'," - "sender='org.freedesktop.systemd1'," - "interface='org.freedesktop.systemd1.Manager'," - "member='JobRemoved'," - "path='/org/freedesktop/systemd1'", - NULL, NULL); - if (r < 0) { - log_error("Failed to add match"); - return -EIO; - } + assert(unit_name); + assert(fragment_path); + assert(lp); - /* This is slightly dirty, since we don't undo the match registrations. */ - return 0; -} + if (!avoid_bus_cache && !unit_name_is_template(unit_name)) { + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_bus_message_unref_ sd_bus_message *unit_load_error = NULL; + _cleanup_free_ char *unit = NULL; + char *unit_load_error_name, *unit_load_error_message; -static int bus_process_wait(sd_bus *bus) { - int r; + unit = unit_dbus_path_from_name(unit_name); + if (!unit) + return log_oom(); - for (;;) { - r = sd_bus_process(bus, NULL); - if (r < 0) - return r; - if (r > 0) - return 0; - r = sd_bus_wait(bus, (uint64_t) -1); - if (r < 0) - return r; - } -} + if (need_daemon_reload(bus, unit_name) > 0) + warn_unit_file_changed(unit_name); -static int check_wait_response(WaitData *d) { - int r = 0; + r = sd_bus_get_property( + bus, + "org.freedesktop.systemd1", + unit, + "org.freedesktop.systemd1.Unit", + "LoadError", + &error, + &unit_load_error, + "(ss)"); + if (r < 0) + return log_error_errno(r, "Failed to get LoadError: %s", bus_error_message(&error, r)); - assert(d->result); + r = sd_bus_message_read( + unit_load_error, + "(ss)", + &unit_load_error_name, + &unit_load_error_message); + if (r < 0) + return bus_log_parse_error(r); - if (!arg_quiet) { - if (streq(d->result, "timeout")) - log_error("Job for %s timed out.", strna(d->name)); - else if (streq(d->result, "canceled")) - log_error("Job for %s canceled.", strna(d->name)); - else if (streq(d->result, "dependency")) - log_error("A dependency job for %s failed. See 'journalctl -xe' for details.", strna(d->name)); - else if (!streq(d->result, "done") && !streq(d->result, "skipped")) { - if (d->name) { - bool quotes; + if (!isempty(unit_load_error_name)) { + log_error("Unit %s is not loaded: %s", unit_name, unit_load_error_message); + return 0; + } - quotes = chars_intersect(d->name, SHELL_NEED_QUOTES); + r = sd_bus_get_property_string( + bus, + "org.freedesktop.systemd1", + unit, + "org.freedesktop.systemd1.Unit", + "FragmentPath", + &error, + &path); + if (r < 0) + return log_error_errno(r, "Failed to get FragmentPath: %s", bus_error_message(&error, r)); - log_error("Job for %s failed. See \"systemctl status %s%s%s\" and \"journalctl -xe\" for details.", - d->name, - quotes ? "'" : "", d->name, quotes ? "'" : ""); - } else - log_error("Job failed. See \"journalctl -xe\" for details."); + if (dropin_paths) { + r = sd_bus_get_property_strv( + bus, + "org.freedesktop.systemd1", + unit, + "org.freedesktop.systemd1.Unit", + "DropInPaths", + &error, + &dropins); + if (r < 0) + return log_error_errno(r, "Failed to get DropInPaths: %s", bus_error_message(&error, r)); } - } + } else { + _cleanup_set_free_ Set *names; - if (streq(d->result, "timeout")) - r = -ETIME; - else if (streq(d->result, "canceled")) - r = -ECANCELED; - else if (streq(d->result, "dependency")) - r = -EIO; - else if (!streq(d->result, "done") && !streq(d->result, "skipped")) - r = -EIO; + names = set_new(NULL); + if (!names) + return -ENOMEM; - return r; -} + r = set_put(names, unit_name); + if (r < 0) + return r; -static int wait_for_jobs(sd_bus *bus, Set *s) { - _cleanup_bus_slot_unref_ sd_bus_slot *slot = NULL; - WaitData d = { .set = s }; - int r = 0, q; + r = unit_file_find_path(lp, unit_name, &path); + if (r < 0) + return r; - assert(bus); - assert(s); + if (r == 0) { + _cleanup_free_ char *template; - q = sd_bus_add_filter(bus, &slot, wait_filter, &d); - if (q < 0) - return log_oom(); + template = unit_name_template(unit_name); + if (!template) + return log_oom(); - while (!set_isempty(s)) { - q = bus_process_wait(bus); - if (q < 0) - return log_error_errno(q, "Failed to wait for response: %m"); + if (!streq(template, unit_name)) { + r = unit_file_find_path(lp, template, &path); + if (r < 0) + return r; + } + } - if (d.result) { - q = check_wait_response(&d); - /* Return the first error as it is most likely to be - * meaningful. */ - if (q < 0 && r == 0) - r = q; - log_debug("Got result %s/%s for job %s", - strna(d.result), strerror(-q), strna(d.name)); + if (dropin_paths) { + r = unit_file_find_dropin_paths(lp->unit_path, NULL, names, &dropins); + if (r < 0) + return r; } + } + + r = 0; - free(d.name); - d.name = NULL; + if (!isempty(path)) { + *fragment_path = path; + path = NULL; + r = 1; + } - free(d.result); - d.result = NULL; + if (dropin_paths && !strv_isempty(dropins)) { + *dropin_paths = dropins; + dropins = NULL; + r = 1; } + if (r == 0) + log_error("No files found for %s.", unit_name); + return r; } @@ -2613,7 +2554,7 @@ static int start_unit_one( const char *name, const char *mode, sd_bus_error *error, - Set *s) { + BusWaitForJobs *w) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; const char *path; @@ -2664,18 +2605,11 @@ static int start_unit_one( return bus_log_parse_error(r); if (need_daemon_reload(bus, name) > 0) - log_warning("Warning: Unit file of %s changed on disk, 'systemctl%s daemon-reload' recommended.", - name, arg_scope == UNIT_FILE_SYSTEM ? "" : " --user"); - - if (s) { - char *p; - - p = strdup(path); - if (!p) - return log_oom(); + warn_unit_file_changed(name); - log_debug("Adding %s to the set", p); - r = set_consume(s, p); + if (w) { + log_debug("Adding %s to the set", path); + r = bus_wait_for_jobs_add(w, path); if (r < 0) return log_oom(); } @@ -2713,6 +2647,9 @@ static int expand_names(sd_bus *bus, char **names, const char* suffix, char ***r _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_free_ UnitInfo *unit_infos = NULL; + if (!bus) + return log_error_errno(ENOTSUP, "Unit name globbing without bus is not implemented."); + r = get_unit_list(bus, NULL, globs, &unit_infos, 0, &reply); if (r < 0) return r; @@ -2761,15 +2698,16 @@ static enum action verb_to_action(const char *verb) { } static int start_unit(sd_bus *bus, char **args) { - _cleanup_set_free_free_ Set *s = NULL; - _cleanup_strv_free_ char **names = NULL; + _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *w = NULL; const char *method, *mode, *one_name, *suffix = NULL; + _cleanup_strv_free_ char **names = NULL; char **name; int r = 0; assert(bus); ask_password_agent_open_if_enabled(); + polkit_agent_open_if_enabled(); if (arg_action == ACTION_SYSTEMCTL) { enum action action; @@ -2802,20 +2740,16 @@ static int start_unit(sd_bus *bus, char **args) { } if (!arg_no_block) { - r = enable_wait_for_jobs(bus); + r = bus_wait_for_jobs_new(bus, &w); if (r < 0) return log_error_errno(r, "Could not watch jobs: %m"); - - s = set_new(&string_hash_ops); - if (!s) - return log_oom(); } STRV_FOREACH(name, names) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; int q; - q = start_unit_one(bus, method, *name, mode, &error, s); + q = start_unit_one(bus, method, *name, mode, &error, w); if (r >= 0 && q < 0) r = translate_bus_error_to_exit_status(q, &error); } @@ -2823,7 +2757,7 @@ static int start_unit(sd_bus *bus, char **args) { if (!arg_no_block) { int q; - q = wait_for_jobs(bus, s); + q = bus_wait_for_jobs(w, arg_quiet); if (q < 0) return q; @@ -3021,6 +2955,12 @@ static int start_special(sd_bus *bus, char **args) { return -EPERM; } + if (a == ACTION_REBOOT && args[1]) { + r = update_reboot_param_file(args[1]); + if (r < 0) + return r; + } + if (arg_force >= 2 && (a == ACTION_HALT || a == ACTION_POWEROFF || @@ -3043,7 +2983,7 @@ static int start_special(sd_bus *bus, char **args) { a == ACTION_HIBERNATE || a == ACTION_HYBRID_SLEEP)) { r = reboot_with_logind(bus, a); - if (r >= 0) + if (r >= 0 || IN_SET(r, -ENOTSUP, -EINPROGRESS)) return r; } @@ -3097,6 +3037,8 @@ static int kill_unit(sd_bus *bus, char **args) { assert(bus); assert(args); + polkit_agent_open_if_enabled(); + if (!arg_kill_who) arg_kill_who = "all"; @@ -3288,6 +3230,10 @@ typedef struct UnitStatusInfo { /* Swap */ const char *what; + /* CGroup */ + uint64_t memory_current; + uint64_t memory_limit; + LIST_HEAD(ExecStatusInfo, exec); } UnitStatusInfo; @@ -3301,12 +3247,6 @@ static void print_status_info( char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1; char since2[FORMAT_TIMESTAMP_MAX], *s2; const char *path; - int flags = - arg_all * OUTPUT_SHOW_ALL | - (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | - on_tty() * OUTPUT_COLOR | - !arg_quiet * OUTPUT_WARN_CUTOFF | - arg_full * OUTPUT_FULL_WIDTH; char **t, **t2; assert(i); @@ -3469,7 +3409,7 @@ static void print_status_info( continue; argv = strv_join(p->argv, " "); - printf(" Process: %u %s=%s ", p->pid, p->name, strna(argv)); + printf(" Process: "PID_FMT" %s=%s ", p->pid, p->name, strna(argv)); good = is_clean_exit_lsb(p->code, p->status, NULL); if (!good) { @@ -3552,14 +3492,25 @@ static void print_status_info( if (i->status_errno > 0) printf(" Error: %i (%s)\n", i->status_errno, strerror(i->status_errno)); + if (i->memory_current != (uint64_t) -1) { + char buf[FORMAT_BYTES_MAX]; + + printf(" Memory: %s", format_bytes(buf, sizeof(buf), i->memory_current)); + + if (i->memory_limit != (uint64_t) -1) + printf(" (limit: %s)\n", format_bytes(buf, sizeof(buf), i->memory_limit)); + else + printf("\n"); + } + if (i->control_group && (i->main_pid > 0 || i->control_pid > 0 || - ((arg_transport != BUS_TRANSPORT_LOCAL && arg_transport != BUS_TRANSPORT_CONTAINER) || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0))) { + ((arg_transport != BUS_TRANSPORT_LOCAL && arg_transport != BUS_TRANSPORT_MACHINE) || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0))) { unsigned c; printf(" CGroup: %s\n", i->control_group); - if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_CONTAINER) { + if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_MACHINE) { unsigned k = 0; pid_t extra[2]; static const char prefix[] = " "; @@ -3576,28 +3527,27 @@ static void print_status_info( if (i->control_pid > 0) extra[k++] = i->control_pid; - show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, i->control_group, prefix, c, false, extra, k, flags); + show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, i->control_group, prefix, c, false, extra, k, get_output_flags()); } } if (i->id && arg_transport == BUS_TRANSPORT_LOCAL) { - show_journal_by_unit(stdout, - i->id, - arg_output, - 0, - i->inactive_exit_timestamp_monotonic, - arg_lines, - getuid(), - flags | OUTPUT_BEGIN_NEWLINE, - arg_scope == UNIT_FILE_SYSTEM, - ellipsized); + show_journal_by_unit( + stdout, + i->id, + arg_output, + 0, + i->inactive_exit_timestamp_monotonic, + arg_lines, + getuid(), + get_output_flags() | OUTPUT_BEGIN_NEWLINE, + SD_JOURNAL_LOCAL_ONLY, + arg_scope == UNIT_FILE_SYSTEM, + ellipsized); } if (i->need_daemon_reload) - printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %sdaemon-reload' recommended.\n", - ansi_highlight_red(), - ansi_highlight_off(), - arg_scope == UNIT_FILE_SYSTEM ? "" : "--user "); + warn_unit_file_changed(i->id); } static void show_unit_help(UnitStatusInfo *i) { @@ -3767,6 +3717,10 @@ static int status_property(const char *name, sd_bus_message *m, UnitStatusInfo * i->condition_timestamp = (usec_t) u; else if (streq(name, "AssertTimestamp")) i->assert_timestamp = (usec_t) u; + else if (streq(name, "MemoryCurrent")) + i->memory_current = u; + else if (streq(name, "MemoryLimit")) + i->memory_limit = u; break; } @@ -4237,7 +4191,10 @@ static int show_one( _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - UnitStatusInfo info = {}; + UnitStatusInfo info = { + .memory_current = (uint64_t) -1, + .memory_limit = (uint64_t) -1, + }; ExecStatusInfo *p; int r; @@ -4363,7 +4320,7 @@ static int get_unit_dbus_path_by_pid( &reply, "u", pid); if (r < 0) { - log_error("Failed to get unit for PID "PID_FMT": %s", pid, bus_error_message(&error, r)); + log_error("Failed to get unit for PID %"PRIu32": %s", pid, bus_error_message(&error, r)); return r; } @@ -4456,14 +4413,7 @@ static int show_system_status(sd_bus *bus) { format_timestamp_relative(since1, sizeof(since1), mi.timestamp)); printf(" CGroup: %s\n", mi.control_group ?: "/"); - if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_CONTAINER) { - int flags = - arg_all * OUTPUT_SHOW_ALL | - (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | - on_tty() * OUTPUT_COLOR | - !arg_quiet * OUTPUT_WARN_CUTOFF | - arg_full * OUTPUT_FULL_WIDTH; - + if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_MACHINE) { static const char prefix[] = " "; unsigned c; @@ -4473,7 +4423,7 @@ static int show_system_status(sd_bus *bus) { else c = 0; - show_cgroup(SYSTEMD_CGROUP_CONTROLLER, strempty(mi.control_group), prefix, c, false, flags); + show_cgroup(SYSTEMD_CGROUP_CONTROLLER, strempty(mi.control_group), prefix, c, false, get_output_flags()); } free(mi.state); @@ -4574,74 +4524,86 @@ static int show(sd_bus *bus, char **args) { return ret; } +static int init_home_and_lookup_paths(char **user_home, char **user_runtime, LookupPaths *lp) { + int r; + + assert(user_home); + assert(user_runtime); + assert(lp); + + if (arg_scope == UNIT_FILE_USER) { + r = user_config_home(user_home); + if (r < 0) + return log_error_errno(r, "Failed to query XDG_CONFIG_HOME: %m"); + else if (r == 0) + return log_error_errno(ENOTDIR, "Cannot find units: $XDG_CONFIG_HOME and $HOME are not set."); + + r = user_runtime_dir(user_runtime); + if (r < 0) + return log_error_errno(r, "Failed to query XDG_CONFIG_HOME: %m"); + else if (r == 0) + return log_error_errno(ENOTDIR, "Cannot find units: $XDG_RUNTIME_DIR is not set."); + } + + r = lookup_paths_init_from_scope(lp, arg_scope, arg_root); + if (r < 0) + return log_error_errno(r, "Failed to query unit lookup paths: %m"); + + return 0; +} + static int cat(sd_bus *bus, char **args) { + _cleanup_free_ char *user_home = NULL; + _cleanup_free_ char *user_runtime = NULL; + _cleanup_lookup_paths_free_ LookupPaths lp = {}; _cleanup_strv_free_ char **names = NULL; char **name; - bool first = true; + bool first = true, avoid_bus_cache; int r = 0; - assert(bus); assert(args); + if (arg_transport != BUS_TRANSPORT_LOCAL) { + log_error("Cannot remotely cat units"); + return -EINVAL; + } + + r = init_home_and_lookup_paths(&user_home, &user_runtime, &lp); + if (r < 0) + return r; + r = expand_names(bus, args + 1, NULL, &names); if (r < 0) - log_error_errno(r, "Failed to expand names: %m"); + return log_error_errno(r, "Failed to expand names: %m"); + + avoid_bus_cache = !bus || avoid_bus(); pager_open_if_enabled(); STRV_FOREACH(name, names) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + _cleanup_free_ char *fragment_path = NULL; _cleanup_strv_free_ char **dropin_paths = NULL; - _cleanup_free_ char *fragment_path = NULL, *unit = NULL; char **path; - unit = unit_dbus_path_from_name(*name); - if (!unit) - return log_oom(); - - if (need_daemon_reload(bus, *name) > 0) - log_warning("Unit file of %s changed on disk. Run 'systemctl%s daemon-reload'.", - *name, arg_scope == UNIT_FILE_SYSTEM ? "" : " --user"); - - r = sd_bus_get_property_string( - bus, - "org.freedesktop.systemd1", - unit, - "org.freedesktop.systemd1.Unit", - "FragmentPath", - &error, - &fragment_path); - if (r < 0) { - log_warning("Failed to get FragmentPath: %s", bus_error_message(&error, r)); - continue; - } - - r = sd_bus_get_property_strv( - bus, - "org.freedesktop.systemd1", - unit, - "org.freedesktop.systemd1.Unit", - "DropInPaths", - &error, - &dropin_paths); - if (r < 0) { - log_warning("Failed to get DropInPaths: %s", bus_error_message(&error, r)); - continue; - } + r = unit_find_paths(bus, *name, avoid_bus_cache, &lp, &fragment_path, &dropin_paths); + if (r < 0) + return r; + else if (r == 0) + return -ENOENT; if (first) first = false; else puts(""); - if (!isempty(fragment_path)) { + if (fragment_path) { printf("%s# %s%s\n", ansi_highlight_blue(), fragment_path, ansi_highlight_off()); fflush(stdout); - r = copy_file_fd(fragment_path, STDOUT_FILENO); + r = copy_file_fd(fragment_path, STDOUT_FILENO, false); if (r < 0) { log_warning_errno(r, "Failed to cat %s: %m", fragment_path); continue; @@ -4656,7 +4618,7 @@ static int cat(sd_bus *bus, char **args) { ansi_highlight_off()); fflush(stdout); - r = copy_file_fd(*path, STDOUT_FILENO); + r = copy_file_fd(*path, STDOUT_FILENO, false); if (r < 0) { log_warning_errno(r, "Failed to cat %s: %m", *path); continue; @@ -4674,6 +4636,8 @@ static int set_property(sd_bus *bus, char **args) { char **i; int r; + polkit_agent_open_if_enabled(); + r = sd_bus_message_new_method_call( bus, &m, @@ -4734,6 +4698,8 @@ static int snapshot(sd_bus *bus, char **args) { const char *path; int r; + polkit_agent_open_if_enabled(); + if (strv_length(args) > 1) n = unit_name_mangle_with_suffix(args[1], MANGLE_NOGLOB, ".snapshot"); else @@ -4796,6 +4762,8 @@ static int delete_snapshot(sd_bus *bus, char **args) { assert(args); + polkit_agent_open_if_enabled(); + r = expand_names(bus, args + 1, ".snapshot", &names); if (r < 0) log_error_errno(r, "Failed to expand names: %m"); @@ -4839,6 +4807,8 @@ static int daemon_reload(sd_bus *bus, char **args) { const char *method; int r; + polkit_agent_open_if_enabled(); + if (arg_action == ACTION_RELOAD) method = "Reload"; else if (arg_action == ACTION_REEXEC) @@ -4897,6 +4867,8 @@ static int reset_failed(sd_bus *bus, char **args) { if (strv_length(args) <= 1) return daemon_reload(bus, args); + polkit_agent_open_if_enabled(); + r = expand_names(bus, args + 1, NULL, &names); if (r < 0) log_error_errno(r, "Failed to expand names: %m"); @@ -5004,8 +4976,8 @@ static int switch_root(sd_bus *bus, char **args) { if (init) { const char *root_systemd_path = NULL, *root_init_path = NULL; - root_systemd_path = strappenda(root, "/" SYSTEMD_BINARY_PATH); - root_init_path = strappenda(root, "/", init); + root_systemd_path = strjoina(root, "/" SYSTEMD_BINARY_PATH); + root_init_path = strjoina(root, "/", init); /* If the passed init is actually the same as the * systemd binary, then let's suppress it. */ @@ -5255,8 +5227,10 @@ static int enable_sysv_units(const char *verb, char **args) { return -EPROTO; /* Remove this entry, so that we don't try enabling it as native unit */ - assert(f > 0 && streq(args[f-1], name)); - assert_se(strv_remove(args + f - 1, name)); + assert(f > 0); + f--; + assert(args[f] == name); + strv_remove(args, name); } #endif @@ -5356,6 +5330,8 @@ static int enable_unit(sd_bus *bus, char **args) { bool send_force = true, send_preset_mode = false; const char *method; + polkit_agent_open_if_enabled(); + if (streq(verb, "enable")) { method = "EnableUnitFiles"; expect_carries_install_info = true; @@ -5430,7 +5406,7 @@ static int enable_unit(sd_bus *bus, char **args) { return bus_log_parse_error(r); } - r = deserialize_and_dump_unit_file_changes(reply); + r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet); if (r < 0) return r; @@ -5501,6 +5477,8 @@ static int add_dependency(sd_bus *bus, char **args) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + polkit_agent_open_if_enabled(); + r = sd_bus_message_new_method_call( bus, &m, @@ -5529,7 +5507,7 @@ static int add_dependency(sd_bus *bus, char **args) { return r; } - r = deserialize_and_dump_unit_file_changes(reply); + r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet); if (r < 0) return r; @@ -5564,6 +5542,8 @@ static int preset_all(sd_bus *bus, char **args) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; + polkit_agent_open_if_enabled(); + r = sd_bus_message_new_method_call( bus, &m, @@ -5593,7 +5573,7 @@ static int preset_all(sd_bus *bus, char **args) { return r; } - r = deserialize_and_dump_unit_file_changes(reply); + r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet); if (r < 0) return r; @@ -5704,60 +5684,35 @@ static int is_system_running(sd_bus *bus, char **args) { return streq(state, "running") ? EXIT_SUCCESS : EXIT_FAILURE; } -static int unit_file_find_path(LookupPaths *lp, const char *unit_name, char **unit_path) { - char **p; - - assert(lp); - assert(unit_name); - assert(unit_path); - - STRV_FOREACH(p, lp->unit_path) { - char *path; - - path = path_join(arg_root, *p, unit_name); - if (!path) - return log_oom(); - - if (access(path, F_OK) == 0) { - *unit_path = path; - return 1; - } - - free(path); - } - - return 0; -} - static int create_edit_temp_file(const char *new_path, const char *original_path, char **ret_tmp_fn) { - int r; char *t; + int r; assert(new_path); assert(original_path); assert(ret_tmp_fn); - t = tempfn_random(new_path); - if (!t) - return log_oom(); + r = tempfn_random(new_path, &t); + if (r < 0) + return log_error_errno(r, "Failed to determine temporary filename for \"%s\": %m", new_path); r = mkdir_parents(new_path, 0755); if (r < 0) { - log_error_errno(r, "Failed to create directories for %s: %m", new_path); + log_error_errno(r, "Failed to create directories for \"%s\": %m", new_path); free(t); return r; } - r = copy_file(original_path, t, 0, 0644); + r = copy_file(original_path, t, 0, 0644, 0); if (r == -ENOENT) { r = touch(t); if (r < 0) { - log_error_errno(r, "Failed to create temporary file %s: %m", t); + log_error_errno(r, "Failed to create temporary file \"%s\": %m", t); free(t); return r; } } else if (r < 0) { - log_error_errno(r, "Failed to copy %s to %s: %m", original_path, t); + log_error_errno(r, "Failed to copy \"%s\" to \"%s\": %m", original_path, t); free(t); return r; } @@ -5767,41 +5722,58 @@ static int create_edit_temp_file(const char *new_path, const char *original_path return 0; } -static int get_drop_in_to_edit(const char *unit_name, const char *user_home, const char *user_runtime, char **ret_path) { - char *tmp_new_path; - char *tmp; - - assert(unit_name); - assert(ret_path); +static int get_file_to_edit(const char *name, const char *user_home, const char *user_runtime, char **ret_path) { + _cleanup_free_ char *path = NULL, *path2 = NULL, *run = NULL; switch (arg_scope) { case UNIT_FILE_SYSTEM: - tmp = strappenda(arg_runtime ? "/run/systemd/system/" : SYSTEM_CONFIG_UNIT_PATH "/", unit_name, ".d/override.conf"); + path = path_join(arg_root, SYSTEM_CONFIG_UNIT_PATH, name); + if (arg_runtime) + run = path_join(arg_root, "/run/systemd/system/", name); break; case UNIT_FILE_GLOBAL: - tmp = strappenda(arg_runtime ? "/run/systemd/user/" : USER_CONFIG_UNIT_PATH "/", unit_name, ".d/override.conf"); + path = path_join(arg_root, USER_CONFIG_UNIT_PATH, name); + if (arg_runtime) + run = path_join(arg_root, "/run/systemd/user/", name); break; case UNIT_FILE_USER: assert(user_home); assert(user_runtime); - tmp = strappenda(arg_runtime ? user_runtime : user_home, "/", unit_name, ".d/override.conf"); + path = path_join(arg_root, user_home, name); + if (arg_runtime) { + path2 = path_join(arg_root, USER_CONFIG_UNIT_PATH, name); + if (!path2) + return log_oom(); + run = path_join(arg_root, user_runtime, name); + } break; default: assert_not_reached("Invalid scope"); } - - tmp_new_path = path_join(arg_root, tmp, NULL); - if (!tmp_new_path) + if (!path || (arg_runtime && !run)) return log_oom(); - *ret_path = tmp_new_path; + if (arg_runtime) { + if (access(path, F_OK) >= 0) + return log_error_errno(EEXIST, "Refusing to create \"%s\" because it would be overriden by \"%s\" anyway.", + run, path); + if (path2 && access(path2, F_OK) >= 0) + return log_error_errno(EEXIST, "Refusing to create \"%s\" because it would be overriden by \"%s\" anyway.", + run, path2); + *ret_path = run; + run = NULL; + } else { + *ret_path = path; + path = NULL; + } return 0; } -static int unit_file_create_drop_in(const char *unit_name, const char *user_home, const char *user_runtime, char **ret_new_path, char **ret_tmp_path) { - char *tmp_new_path; + +static int unit_file_create_dropin(const char *unit_name, const char *user_home, const char *user_runtime, char **ret_new_path, char **ret_tmp_path) { + char *tmp_new_path, *ending; char *tmp_tmp_path; int r; @@ -5809,7 +5781,8 @@ static int unit_file_create_drop_in(const char *unit_name, const char *user_home assert(ret_new_path); assert(ret_tmp_path); - r = get_drop_in_to_edit(unit_name, user_home, user_runtime, &tmp_new_path); + ending = strjoina(unit_name, ".d/override.conf"); + r = get_file_to_edit(ending, user_home, user_runtime, &tmp_new_path); if (r < 0) return r; @@ -5825,91 +5798,6 @@ static int unit_file_create_drop_in(const char *unit_name, const char *user_home return 0; } -static bool unit_is_editable(const char *unit_name, const char *fragment_path, const char *user_home) { - bool editable = true; - const char *invalid_path; - - assert(unit_name); - - if (!arg_runtime) - return true; - - switch (arg_scope) { - case UNIT_FILE_SYSTEM: - if (path_startswith(fragment_path, "/etc/systemd/system")) { - editable = false; - invalid_path = "/etc/systemd/system"; - } else if (path_startswith(fragment_path, SYSTEM_CONFIG_UNIT_PATH)) { - editable = false; - invalid_path = SYSTEM_CONFIG_UNIT_PATH; - } - break; - case UNIT_FILE_GLOBAL: - if (path_startswith(fragment_path, "/etc/systemd/user")) { - editable = false; - invalid_path = "/etc/systemd/user"; - } else if (path_startswith(fragment_path, USER_CONFIG_UNIT_PATH)) { - editable = false; - invalid_path = USER_CONFIG_UNIT_PATH; - } - break; - case UNIT_FILE_USER: - assert(user_home); - - if (path_startswith(fragment_path, "/etc/systemd/user")) { - editable = false; - invalid_path = "/etc/systemd/user"; - } else if (path_startswith(fragment_path, USER_CONFIG_UNIT_PATH)) { - editable = false; - invalid_path = USER_CONFIG_UNIT_PATH; - } else if (path_startswith(fragment_path, user_home)) { - editable = false; - invalid_path = user_home; - } - break; - default: - assert_not_reached("Invalid scope"); - } - - if (!editable) - log_error("%s ignored: cannot temporarily edit units from %s", unit_name, invalid_path); - - return editable; -} - -static int get_copy_to_edit(const char *unit_name, const char *fragment_path, const char *user_home, const char *user_runtime, char **ret_path) { - char *tmp_new_path; - - assert(unit_name); - assert(ret_path); - - if (!unit_is_editable(unit_name, fragment_path, user_home)) - return -EINVAL; - - switch (arg_scope) { - case UNIT_FILE_SYSTEM: - tmp_new_path = path_join(arg_root, arg_runtime ? "/run/systemd/system/" : SYSTEM_CONFIG_UNIT_PATH, unit_name); - break; - case UNIT_FILE_GLOBAL: - tmp_new_path = path_join(arg_root, arg_runtime ? "/run/systemd/user/" : USER_CONFIG_UNIT_PATH, unit_name); - break; - case UNIT_FILE_USER: - assert(user_home); - assert(user_runtime); - - tmp_new_path = path_join(arg_root, arg_runtime ? user_runtime : user_home, unit_name); - break; - default: - assert_not_reached("Invalid scope"); - } - if (!tmp_new_path) - return log_oom(); - - *ret_path = tmp_new_path; - - return 0; -} - static int unit_file_create_copy(const char *unit_name, const char *fragment_path, const char *user_home, @@ -5925,14 +5813,14 @@ static int unit_file_create_copy(const char *unit_name, assert(ret_new_path); assert(ret_tmp_path); - r = get_copy_to_edit(unit_name, fragment_path, user_home, user_runtime, &tmp_new_path); + r = get_file_to_edit(unit_name, user_home, user_runtime, &tmp_new_path); if (r < 0) return r; if (!path_equal(fragment_path, tmp_new_path) && access(tmp_new_path, F_OK) == 0) { char response; - r = ask_char(&response, "yn", "%s already exists, are you sure to overwrite it with %s? [(y)es, (n)o] ", tmp_new_path, fragment_path); + r = ask_char(&response, "yn", "\"%s\" already exists. Overwrite with \"%s\"? [(y)es, (n)o] ", tmp_new_path, fragment_path); if (r < 0) { free(tmp_new_path); return r; @@ -5946,7 +5834,7 @@ static int unit_file_create_copy(const char *unit_name, r = create_edit_temp_file(tmp_new_path, fragment_path, &tmp_tmp_path); if (r < 0) { - log_error_errno(r, "Failed to create temporary file for %s: %m", tmp_new_path); + log_error_errno(r, "Failed to create temporary file for \"%s\": %m", tmp_new_path); free(tmp_new_path); return r; } @@ -6015,7 +5903,7 @@ static int run_editor(char **paths) { } } - log_error("Cannot edit unit(s): No editor available. Please set either SYSTEMD_EDITOR or EDITOR or VISUAL environment variable"); + log_error("Cannot edit unit(s), no editor available. Please set either $SYSTEMD_EDITOR or $EDITOR or $VISUAL."); _exit(EXIT_FAILURE); } @@ -6029,124 +5917,45 @@ static int run_editor(char **paths) { static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) { _cleanup_free_ char *user_home = NULL; _cleanup_free_ char *user_runtime = NULL; + _cleanup_lookup_paths_free_ LookupPaths lp = {}; + bool avoid_bus_cache; char **name; int r; assert(names); assert(paths); - if (arg_scope == UNIT_FILE_USER) { - r = user_config_home(&user_home); - if (r < 0) - return log_oom(); - else if (r == 0) { - log_error("Cannot edit units for the user instance: home directory unknown"); - return -1; - } + r = init_home_and_lookup_paths(&user_home, &user_runtime, &lp); + if (r < 0) + return r; - r = user_runtime_dir(&user_runtime); - if (r < 0) - return log_oom(); - else if (r == 0) { - log_error("Cannot edit units for the user instance: runtime directory unknown"); - return -1; - } - } + avoid_bus_cache = !bus || avoid_bus(); - if (!bus || avoid_bus()) { - _cleanup_lookup_paths_free_ LookupPaths lp = {}; + STRV_FOREACH(name, names) { + _cleanup_free_ char *path = NULL; + char *new_path, *tmp_path; - /* If there is no bus, we try to find the units by testing each available directory - * according to the scope. - */ - r = lookup_paths_init(&lp, - arg_scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER, - arg_scope == UNIT_FILE_USER, - arg_root, - NULL, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Failed get lookup paths: %m"); + r = unit_find_paths(bus, *name, avoid_bus_cache, &lp, &path, NULL); + if (r < 0) return r; + else if (r == 0) + return -ENOENT; + else if (!path) { + // FIXME: support units with path==NULL (no FragmentPath) + log_error("No fragment exists for %s.", *name); + return -ENOENT; } - STRV_FOREACH(name, names) { - _cleanup_free_ char *path = NULL; - char *new_path, *tmp_path; - - r = unit_file_find_path(&lp, *name, &path); - if (r < 0) - return r; - if (r == 0) { - log_warning("%s ignored: not found", *name); - continue; - } - - if (arg_full) - r = unit_file_create_copy(*name, path, user_home, user_runtime, &new_path, &tmp_path); - else - r = unit_file_create_drop_in(*name, user_home, user_runtime, &new_path, &tmp_path); - - if (r < 0) - continue; - - r = strv_push(paths, new_path); - if (r < 0) - return log_oom(); - - r = strv_push(paths, tmp_path); - if (r < 0) - return log_oom(); - } - } else { - STRV_FOREACH(name, names) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_free_ char *fragment_path = NULL; - _cleanup_free_ char *unit = NULL; - char *new_path, *tmp_path; - - unit = unit_dbus_path_from_name(*name); - if (!unit) - return log_oom(); - - if (need_daemon_reload(bus, *name) > 0) { - log_warning("%s ignored: unit file changed on disk. Run 'systemctl%s daemon-reload'.", - *name, arg_scope == UNIT_FILE_SYSTEM ? "" : " --user"); - continue; - } - - r = sd_bus_get_property_string( - bus, - "org.freedesktop.systemd1", - unit, - "org.freedesktop.systemd1.Unit", - "FragmentPath", - &error, - &fragment_path); - if (r < 0) { - log_warning("Failed to get FragmentPath: %s", bus_error_message(&error, r)); - continue; - } - - if (isempty(fragment_path)) { - log_warning("%s ignored: not found", *name); - continue; - } - - if (arg_full) - r = unit_file_create_copy(*name, fragment_path, user_home, user_runtime, &new_path, &tmp_path); - else - r = unit_file_create_drop_in(*name, user_home, user_runtime, &new_path, &tmp_path); - if (r < 0) - continue; - - r = strv_push(paths, new_path); - if (r < 0) - return log_oom(); + if (arg_full) + r = unit_file_create_copy(*name, path, user_home, user_runtime, &new_path, &tmp_path); + else + r = unit_file_create_dropin(*name, user_home, user_runtime, &new_path, &tmp_path); + if (r < 0) + return r; - r = strv_push(paths, tmp_path); - if (r < 0) - return log_oom(); - } + r = strv_push_pair(paths, new_path, tmp_path); + if (r < 0) + return log_oom(); } return 0; @@ -6161,7 +5970,7 @@ static int edit(sd_bus *bus, char **args) { assert(args); if (!on_tty()) { - log_error("Cannot edit units if we are not on a tty"); + log_error("Cannot edit units if not on a tty"); return -EINVAL; } @@ -6174,19 +5983,12 @@ static int edit(sd_bus *bus, char **args) { if (r < 0) return log_error_errno(r, "Failed to expand names: %m"); - if (!names) { - log_error("No unit name found by expanding names"); - return -ENOENT; - } - r = find_paths_to_edit(bus, names, &paths); if (r < 0) return r; - if (strv_isempty(paths)) { - log_error("Cannot find any units to edit"); + if (strv_isempty(paths)) return -ENOENT; - } r = run_editor(paths); if (r < 0) @@ -6197,12 +5999,12 @@ static int edit(sd_bus *bus, char **args) { * It's useful if the user wants to cancel its modification */ if (null_or_empty_path(*tmp)) { - log_warning("Edition of %s canceled: temporary file empty", *original); + log_warning("Editing \"%s\" canceled: temporary file is empty", *original); continue; } r = rename(*tmp, *original); if (r < 0) { - r = log_error_errno(errno, "Failed to rename %s to %s: %m", *tmp, *original); + r = log_error_errno(errno, "Failed to rename \"%s\" to \"%s\": %m", *tmp, *original); goto end; } } @@ -6231,8 +6033,8 @@ static void systemctl_help(void) { " Operate on remote host\n" " -M --machine=CONTAINER\n" " Operate on local container\n" - " -t --type=TYPE List only units of a particular type\n" - " --state=STATE List only units with particular LOAD or SUB or ACTIVE state\n" + " -t --type=TYPE List units of a particular type\n" + " --state=STATE List units with particular LOAD or SUB or ACTIVE state\n" " -p --property=NAME Show only properties by this name\n" " -a --all Show all loaded units/properties, including dead/empty\n" " ones. To list all units installed on the system, use\n" @@ -6250,8 +6052,7 @@ static void systemctl_help(void) { " -q --quiet Suppress output\n" " --no-block Do not wait until operation finished\n" " --no-wall Don't send wall message before halt/power-off/reboot\n" - " --no-reload When enabling/disabling unit files, don't reload daemon\n" - " configuration\n" + " --no-reload Don't reload daemon after en-/dis-abling unit files\n" " --no-legend Do not print a legend (column headers and hints)\n" " --no-pager Do not pipe output into a pager\n" " --no-ask-password\n" @@ -6260,12 +6061,12 @@ static void systemctl_help(void) { " --runtime Enable unit files only temporarily until next reboot\n" " -f --force When enabling unit files, override existing symlinks\n" " When shutting down, execute action immediately\n" - " --preset-mode= Specifies whether fully apply presets, or only enable,\n" - " or only disable\n" + " --preset-mode= Apply only enable, only disable, or all presets\n" " --root=PATH Enable unit files in the specified root directory\n" " -n --lines=INTEGER Number of journal entries to show\n" - " -o --output=STRING Change journal output mode (short, short-monotonic,\n" - " verbose, export, json, json-pretty, json-sse, cat)\n" + " -o --output=STRING Change journal output mode (short, short-iso,\n" + " short-precise, short-monotonic, verbose,\n" + " export, json, json-pretty, json-sse, cat)\n" " --plain Print unit dependencies as a list instead of a tree\n\n" "Unit Commands:\n" " list-units [PATTERN...] List loaded units\n" @@ -6304,7 +6105,7 @@ static void systemctl_help(void) { " based on preset configuration\n" " preset-all Enable/disable all unit files based on\n" " preset configuration\n" - " is-enabled NAME... Check whether unit files are enabled\n\n" + " is-enabled NAME... Check whether unit files are enabled\n" " mask NAME... Mask one or more units\n" " unmask NAME... Unmask one or more units\n" " link PATH... Link one or more units files into\n" @@ -6313,10 +6114,9 @@ static void systemctl_help(void) { " on specified one or more units\n" " add-requires TARGET NAME... Add 'Requires' dependency for the target\n" " on specified one or more units\n" - " get-default Get the name of the default target\n" - " set-default NAME Set the default target\n" " edit NAME... Edit one or more unit files\n" - "\n" + " get-default Get the name of the default target\n" + " set-default NAME Set the default target\n\n" "Machine Commands:\n" " list-machines [PATTERN...] List local containers and host\n\n" "Job Commands:\n" @@ -6329,7 +6129,7 @@ static void systemctl_help(void) { " show-environment Dump environment\n" " set-environment NAME=VALUE... Set one or more environment variables\n" " unset-environment NAME... Unset one or more environment variables\n" - " import-environment NAME... Import all, one or more environment variables\n\n" + " import-environment [NAME...] Import all or some environment variables\n\n" "Manager Lifecycle Commands:\n" " daemon-reload Reload systemd manager configuration\n" " daemon-reexec Reexecute systemd manager\n\n" @@ -6697,7 +6497,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; @@ -6941,7 +6741,7 @@ static int shutdown_parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "HPrhkt:afFc", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "HPrhkKt:afFc", options, NULL)) >= 0) switch (c) { case ARG_HELP: @@ -6982,6 +6782,8 @@ static int shutdown_parse_argv(int argc, char *argv[]) { case 't': case 'a': + case 'f': + case 'F': /* Compatibility nops */ break; @@ -7284,7 +7086,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) { { "check", MORE, 2, check_unit_active }, { "is-failed", MORE, 2, check_unit_failed }, { "show", MORE, 1, show }, - { "cat", MORE, 2, cat }, + { "cat", MORE, 2, cat, NOBUS }, { "status", MORE, 1, show }, { "help", MORE, 2, show }, { "snapshot", LESS, 2, snapshot }, @@ -7297,7 +7099,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) { { "import-environment", MORE, 1, import_environment}, { "halt", EQUAL, 1, start_special, FORCE }, { "poweroff", EQUAL, 1, start_special, FORCE }, - { "reboot", EQUAL, 1, start_special, FORCE }, + { "reboot", MORE, 1, start_special, FORCE }, { "kexec", EQUAL, 1, start_special }, { "suspend", EQUAL, 1, start_special }, { "hibernate", EQUAL, 1, start_special }, @@ -7651,6 +7453,11 @@ int main(int argc, char*argv[]) { goto finish; } + /* Increase max number of open files to 16K if we can, we + * might needs this when browsing journal files, which might + * be split up into many files. */ + setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384)); + if (!avoid_bus()) r = bus_open_transport_systemd(arg_transport, arg_host, arg_scope != UNIT_FILE_SYSTEM, &bus); diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h index c27537f86..ca2d83e0e 100644 --- a/src/systemd/sd-bus.h +++ b/src/systemd/sd-bus.h @@ -23,6 +23,7 @@ ***/ #include +#include #include #include @@ -117,7 +118,7 @@ int sd_bus_open(sd_bus **ret); int sd_bus_open_user(sd_bus **ret); int sd_bus_open_system(sd_bus **ret); int sd_bus_open_system_remote(sd_bus **ret, const char *host); -int sd_bus_open_system_container(sd_bus **ret, const char *machine); +int sd_bus_open_system_machine(sd_bus **ret, const char *machine); int sd_bus_new(sd_bus **ret); @@ -310,6 +311,8 @@ int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface, con int sd_bus_emit_properties_changed_strv(sd_bus *bus, const char *path, const char *interface, char **names); int sd_bus_emit_properties_changed(sd_bus *bus, const char *path, const char *interface, const char *name, ...) _sd_sentinel_; +int sd_bus_emit_object_added(sd_bus *bus, const char *path); +int sd_bus_emit_object_removed(sd_bus *bus, const char *path); int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces); int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char *interface, ...) _sd_sentinel_; int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char **interfaces); @@ -368,6 +371,7 @@ int sd_bus_error_setf(sd_bus_error *e, const char *name, const char *format, ... int sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *message); int sd_bus_error_set_errno(sd_bus_error *e, int error); int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *format, ...) _sd_printf_(3, 4); +int sd_bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_list ap) _sd_printf_(3,0); int sd_bus_error_get_errno(const sd_bus_error *e); int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e); int sd_bus_error_is_set(const sd_bus_error *e); diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h index 351b4e59c..b878b4d8a 100644 --- a/src/systemd/sd-daemon.h +++ b/src/systemd/sd-daemon.h @@ -190,6 +190,12 @@ int sd_is_mq(int fd, const char *path); timestamps to detect failed services. Also see sd_watchdog_enabled() below. + FDSTORE=1 Store the file descriptors passed along with the + message in the per-service file descriptor store, + and pass them to the main process again on next + invocation. This variable is only supported with + sd_pid_notify_with_fds(). + Daemons can choose to send additional variables. However, it is recommended to prefix variable names not listed above with X_. @@ -242,6 +248,13 @@ int sd_pid_notify(pid_t pid, int unset_environment, const char *state); */ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) _sd_printf_(3,4); +/* + Similar to sd_pid_notify(), but also passes the specified fd array + to the service manager for storage. This is particularly useful for + FDSTORE=1 messages. +*/ +int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char *state, const int *fds, unsigned n_fds); + /* Returns > 0 if the system was booted with systemd. Returns < 0 on error. Returns 0 if the system was not booted with systemd. Note diff --git a/src/systemd/sd-dhcp6-lease.h b/src/systemd/sd-dhcp6-lease.h index 1126f1ac2..716d7678f 100644 --- a/src/systemd/sd-dhcp6-lease.h +++ b/src/systemd/sd-dhcp6-lease.h @@ -27,14 +27,11 @@ typedef struct sd_dhcp6_lease sd_dhcp6_lease; -int sd_dhcp6_lease_get_first_address(sd_dhcp6_lease *lease, - struct in6_addr *addr, - uint32_t *lifetime_preferred, - uint32_t *lifetime_valid); -int sd_dhcp6_lease_get_next_address(sd_dhcp6_lease *lease, - struct in6_addr *addr, - uint32_t *lifetime_preferred, - uint32_t *lifetime_valid); +void sd_dhcp6_lease_reset_address_iter(sd_dhcp6_lease *lease); +int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease, + struct in6_addr *addr, + uint32_t *lifetime_preferred, + uint32_t *lifetime_valid); sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease); sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease); diff --git a/src/systemd/sd-hwdb.h b/src/systemd/sd-hwdb.h new file mode 100644 index 000000000..3c44b981d --- /dev/null +++ b/src/systemd/sd-hwdb.h @@ -0,0 +1,47 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#ifndef foosdhwdbhfoo +#define foosdhwdbhfoo + +/*** + This file is part of systemd. + + Copyright 2008-2012 Kay Sievers + Copyright 2014 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "_sd-common.h" + +_SD_BEGIN_DECLARATIONS; + +typedef struct sd_hwdb sd_hwdb; + +sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb); +sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb); + +int sd_hwdb_new(sd_hwdb **ret); + +int sd_hwdb_get(sd_hwdb *hwdb, const char *modalias, const char *key, const char **value); + +int sd_hwdb_seek(sd_hwdb *hwdb, const char *modalias); +int sd_hwdb_enumerate(sd_hwdb *hwdb, const char **key, const char **value); + +/* the inverse condition avoids ambiguity of danling 'else' after the macro */ +#define SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) \ + if (sd_hwdb_seek(hwdb, modalias) < 0) { } \ + else while (sd_hwdb_enumerate(hwdb, &(key), &(value)) > 0) + +#endif diff --git a/src/systemd/sd-icmp6-nd.h b/src/systemd/sd-icmp6-nd.h index 73f91aad1..79b407470 100644 --- a/src/systemd/sd-icmp6-nd.h +++ b/src/systemd/sd-icmp6-nd.h @@ -27,10 +27,11 @@ #include "sd-event.h" enum { - ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE = 0, - ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT = 1, - ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER = 2, - ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED = 3, + ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE = 0, + ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT = 1, + ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER = 2, + ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED = 3, + ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED = 4, }; typedef struct sd_icmp6_nd sd_icmp6_nd; @@ -51,7 +52,28 @@ sd_icmp6_nd *sd_icmp6_nd_ref(sd_icmp6_nd *nd); sd_icmp6_nd *sd_icmp6_nd_unref(sd_icmp6_nd *nd); int sd_icmp6_nd_new(sd_icmp6_nd **ret); +int sd_icmp6_prefix_match(struct in6_addr *prefix, uint8_t prefixlen, + struct in6_addr *addr); + +int sd_icmp6_ra_get_mtu(sd_icmp6_nd *nd, uint32_t *mtu); +int sd_icmp6_ra_get_prefixlen(sd_icmp6_nd *nd, const struct in6_addr *addr, + uint8_t *prefixlen); +int sd_icmp6_ra_get_expired_prefix(sd_icmp6_nd *nd, struct in6_addr **addr, + uint8_t *prefixlen); + int sd_icmp6_nd_stop(sd_icmp6_nd *nd); int sd_icmp6_router_solicitation_start(sd_icmp6_nd *nd); +#define SD_ICMP6_ADDRESS_FORMAT_STR "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" + +#define SD_ICMP6_ADDRESS_FORMAT_VAL(address) \ + be16toh((address).s6_addr16[0]), \ + be16toh((address).s6_addr16[1]), \ + be16toh((address).s6_addr16[2]), \ + be16toh((address).s6_addr16[3]), \ + be16toh((address).s6_addr16[4]), \ + be16toh((address).s6_addr16[5]), \ + be16toh((address).s6_addr16[6]), \ + be16toh((address).s6_addr16[7]) + #endif diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h index 4fdbf3ab4..48fd87671 100644 --- a/src/systemd/sd-id128.h +++ b/src/systemd/sd-id128.h @@ -60,7 +60,7 @@ int sd_id128_get_boot(sd_id128_t *ret); /* Note that SD_ID128_FORMAT_VAL will evaluate the passed argument 16 * times. It is hence not a good idea to call this macro with an - * expensive function as paramater or an expression with side + * expensive function as parameter or an expression with side * effects */ #define SD_ID128_FORMAT_STR "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h index eb2437235..00237a215 100644 --- a/src/systemd/sd-journal.h +++ b/src/systemd/sd-journal.h @@ -138,13 +138,15 @@ int sd_journal_reliable_fd(sd_journal *j); int sd_journal_get_catalog(sd_journal *j, char **text); int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **text); +/* the inverse condition avoids ambiguity of danling 'else' after the macro */ #define SD_JOURNAL_FOREACH(j) \ - if (sd_journal_seek_head(j) >= 0) \ - while (sd_journal_next(j) > 0) + if (sd_journal_seek_head(j) < 0) { } \ + else while (sd_journal_next(j) > 0) +/* the inverse condition avoids ambiguity of danling 'else' after the macro */ #define SD_JOURNAL_FOREACH_BACKWARDS(j) \ - if (sd_journal_seek_tail(j) >= 0) \ - while (sd_journal_previous(j) > 0) + if (sd_journal_seek_tail(j) < 0) { } \ + else while (sd_journal_previous(j) > 0) #define SD_JOURNAL_FOREACH_DATA(j, data, l) \ for (sd_journal_restart_data(j); sd_journal_enumerate_data((j), &(data), &(l)) > 0; ) diff --git a/src/systemd/sd-lldp.h b/src/systemd/sd-lldp.h new file mode 100644 index 000000000..700146aba --- /dev/null +++ b/src/systemd/sd-lldp.h @@ -0,0 +1,53 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright (C) 2014 Tom Gundersen + Copyright (C) 2014 Susant Sahani + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#pragma once + +#include "sd-event.h" + +typedef struct sd_lldp sd_lldp; + +typedef void (*sd_lldp_cb_t)(sd_lldp *lldp, int event, void *userdata); + +enum { + UPDATE_INFO = 10, +}; + +typedef enum LLDPPortStatus { + LLDP_PORT_STATUS_NONE, + LLDP_PORT_STATUS_ENABLED, + LLDP_PORT_STATUS_DISABLED, + _LLDP_PORT_STATUS_MAX, + _LLDP_PORT_STATUS_INVALID = -1, +} LLDPPortStatus; + +int sd_lldp_new(int ifindex, const char *ifname, const struct ether_addr *mac, sd_lldp **ret); +void sd_lldp_free(sd_lldp *lldp); + +int sd_lldp_start(sd_lldp *lldp); +int sd_lldp_stop(sd_lldp *lldp); + +int sd_lldp_attach_event(sd_lldp *lldp, sd_event *event, int priority); +int sd_lldp_detach_event(sd_lldp *lldp); + +int sd_lldp_set_callback(sd_lldp *lldp, sd_lldp_cb_t cb, void *userdata); +int sd_lldp_save(sd_lldp *lldp, const char *file); diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index 64b882724..24c859506 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -119,7 +119,7 @@ int sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions); /* Return seats of user is on. If require_active is true, this will look for * active seats only. Returns the number of seats. - * If seats is NULL, this will just return the number of seats.*/ + * If seats is NULL, this will just return the number of seats. */ int sd_uid_get_seats(uid_t uid, int require_active, char ***seats); /* Return 1 if the session is active. */ diff --git a/src/systemd/sd-network.h b/src/systemd/sd-network.h index bb6994093..027730d11 100644 --- a/src/systemd/sd-network.h +++ b/src/systemd/sd-network.h @@ -111,6 +111,8 @@ int sd_network_link_get_ntp(int ifindex, char ***addr); */ int sd_network_link_get_llmnr(int ifindex, char **llmnr); +int sd_network_link_get_lldp(int ifindex, char **lldp); + /* Get the DNS domain names for a given link. */ int sd_network_link_get_domains(int ifindex, char ***domains); diff --git a/src/systemd/sd-rtnl.h b/src/systemd/sd-rtnl.h index b05f83ce4..be318e58a 100644 --- a/src/systemd/sd-rtnl.h +++ b/src/systemd/sd-rtnl.h @@ -41,7 +41,9 @@ typedef struct sd_rtnl_message sd_rtnl_message; typedef int (*sd_rtnl_message_handler_t)(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata); /* bus */ +int sd_rtnl_new_from_netlink(sd_rtnl **nl, int fd); int sd_rtnl_open(sd_rtnl **nl, unsigned n_groups, ...); +int sd_rtnl_open_fd(sd_rtnl **nl, int fd, unsigned n_groups, ...); int sd_rtnl_inc_rcvbuf(const sd_rtnl *const rtnl, const int size); sd_rtnl *sd_rtnl_ref(sd_rtnl *nl); @@ -86,6 +88,8 @@ int sd_rtnl_message_get_errno(sd_rtnl_message *m); int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type); int sd_rtnl_message_is_broadcast(sd_rtnl_message *m); +int sd_rtnl_message_get_family(sd_rtnl_message *m, int *family); + int sd_rtnl_message_addr_set_prefixlen(sd_rtnl_message *m, unsigned char prefixlen); int sd_rtnl_message_addr_set_scope(sd_rtnl_message *m, unsigned char scope); int sd_rtnl_message_addr_set_flags(sd_rtnl_message *m, unsigned char flags); @@ -109,8 +113,12 @@ int sd_rtnl_message_route_get_family(sd_rtnl_message *m, int *family); int sd_rtnl_message_route_get_dst_prefixlen(sd_rtnl_message *m, unsigned char *dst_len); int sd_rtnl_message_route_get_src_prefixlen(sd_rtnl_message *m, unsigned char *src_len); +int sd_rtnl_message_neigh_set_flags(sd_rtnl_message *m, uint8_t flags); +int sd_rtnl_message_neigh_set_state(sd_rtnl_message *m, uint16_t state); int sd_rtnl_message_neigh_get_family(sd_rtnl_message *m, int *family); int sd_rtnl_message_neigh_get_ifindex(sd_rtnl_message *m, int *family); +int sd_rtnl_message_neigh_get_state(sd_rtnl_message *m, uint16_t *state); +int sd_rtnl_message_neigh_get_flags(sd_rtnl_message *m, uint8_t *flags); int sd_rtnl_message_append_string(sd_rtnl_message *m, unsigned short type, const char *data); int sd_rtnl_message_append_u8(sd_rtnl_message *m, unsigned short type, uint8_t data); diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 647eb577a..e47bcb4dc 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -39,6 +39,7 @@ #include "label.h" #include "fileio-label.h" #include "uid-range.h" +#include "selinux-util.h" typedef enum ItemType { ADD_USER = 'u', @@ -80,13 +81,7 @@ static uid_t search_uid = UID_INVALID; static UidRange *uid_range = NULL; static unsigned n_uid_range = 0; -#define UID_TO_PTR(u) (ULONG_TO_PTR(u+1)) -#define PTR_TO_UID(u) ((uid_t) (PTR_TO_ULONG(u)-1)) - -#define GID_TO_PTR(g) (ULONG_TO_PTR(g+1)) -#define PTR_TO_GID(g) ((gid_t) (PTR_TO_ULONG(g)-1)) - -#define fix_root(x) (arg_root ? strappenda(arg_root, x) : x) +#define fix_root(x) (arg_root ? strjoina(arg_root, x) : x) static int load_user_database(void) { _cleanup_fclose_ FILE *f = NULL; @@ -215,14 +210,14 @@ static int make_backup(const char *target, const char *x) { if (r < 0) return r; - r = copy_bytes(src, fileno(dst), (off_t) -1); + r = copy_bytes(src, fileno(dst), (off_t) -1, true); if (r < 0) goto fail; /* Don't fail on chmod() or chown(). If it stays owned by us * and/or unreadable by others, then it isn't too bad... */ - backup = strappenda(x, "-"); + backup = strjoina(x, "-"); /* Copy over the access mask */ if (fchmod(fileno(dst), st.st_mode & 07777) < 0) diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index 45c8b4ea0..6e39b449e 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -112,6 +112,27 @@ static int add_symlink(const char *service, const char *where) { return 1; } +static int add_alias(const char *service, const char *alias) { + _cleanup_free_ char *link = NULL; + int r; + + assert(service); + assert(alias); + + link = strjoin(arg_dest, "/", alias, NULL); + if (!link) + return log_oom(); + + r = symlink(service, link); + if (r < 0) { + if (errno == EEXIST) + return 0; + return -errno; + } + + return 1; +} + static int generate_unit_file(SysvStub *s) { char **p; _cleanup_fclose_ FILE *f = NULL; @@ -142,6 +163,14 @@ static int generate_unit_file(SysvStub *s) { if (!unit) return log_oom(); + /* We might already have a symlink with the same name from a Provides:, + * or from backup files like /etc/init.d/foo.bak. Real scripts always win, + * so remove an existing link */ + if (is_symlink(unit)) { + log_warning("Overwriting existing symlink %s with real service", unit); + (void) unlink(unit); + } + f = fopen(unit, "wxe"); if (!f) return log_error_errno(errno, "Failed to create unit file %s: %m", unit); @@ -239,9 +268,9 @@ static int sysv_translate_facility(const char *name, const char *filename, char "time", SPECIAL_TIME_SYNC_TARGET, }; - unsigned i; - char *r; + char *filename_no_sh, *e, *r; const char *n; + unsigned i; assert(name); assert(_r); @@ -263,6 +292,14 @@ static int sysv_translate_facility(const char *name, const char *filename, char goto finish; } + /* strip ".sh" suffix from file name for comparison */ + filename_no_sh = strdupa(filename); + e = endswith(filename_no_sh, ".sh"); + if (e) { + *e = '\0'; + filename = filename_no_sh; + } + /* If we don't know this name, fallback heuristics to figure * out whether something is a target or a service alias. */ @@ -272,13 +309,12 @@ static int sysv_translate_facility(const char *name, const char *filename, char /* Facilities starting with $ are most likely targets */ r = unit_name_build(n, NULL, ".target"); - } else if (filename && streq(name, filename)) + } else if (streq_ptr(n, filename)) /* Names equaling the file name of the services are redundant */ return 0; else /* Everything else we assume to be normal service names */ r = sysv_translate_name(n); - if (!r) return -ENOMEM; @@ -309,6 +345,8 @@ static int load_sysv(SysvStub *s) { if (!f) return errno == ENOENT ? 0 : -errno; + log_debug("Loading SysV script %s", s->path); + while (!feof(f)) { char l[LINE_MAX], *t; @@ -450,14 +488,15 @@ static int load_sysv(SysvStub *s) { return -ENOMEM; r = sysv_translate_facility(n, basename(s->path), &m); - if (r < 0) return r; - if (r == 0) continue; - if (unit_name_to_type(m) != UNIT_SERVICE) { + if (unit_name_to_type(m) == UNIT_SERVICE) { + log_debug("Adding Provides: alias '%s' for '%s'", m, s->name); + r = add_alias(s->name, m); + } else { /* NB: SysV targets * which are provided * by a service are @@ -699,24 +738,25 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { } while ((de = readdir(d))) { - SysvStub *service; - struct stat st; _cleanup_free_ char *fpath = NULL, *name = NULL; + _cleanup_free_ SysvStub *service = NULL; + struct stat st; int r; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; - fpath = strjoin(*path, "/", de->d_name, NULL); - if (!fpath) - return log_oom(); - - if (stat(fpath, &st) < 0) + if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { + log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name); continue; + } if (!(st.st_mode & S_IXUSR)) continue; + if (!S_ISREG(st.st_mode)) + continue; + name = sysv_translate_name(de->d_name); if (!name) return log_oom(); @@ -724,6 +764,15 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { if (hashmap_contains(all_services, name)) continue; + fpath = strjoin(*path, "/", de->d_name, NULL); + if (!fpath) + return log_oom(); + + if (unit_file_get_state(UNIT_FILE_SYSTEM, NULL, name) >= 0) { + log_debug("Native unit for %s already exists, skipping", name); + continue; + } + service = new0(SysvStub, 1); if (!service) return log_oom(); @@ -737,6 +786,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { return log_oom(); name = fpath = NULL; + service = NULL; } } @@ -777,7 +827,7 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { while ((de = readdir(d))) { int a, b; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (de->d_name[0] != 'S' && de->d_name[0] != 'K') @@ -807,7 +857,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { service = hashmap_get(all_services, name); if (!service){ - log_warning("Could not find init script for %s", name); + log_debug("Ignoring %s symlink in %s, not generating %s.", + de->d_name, rcnd_table[i].path, name); continue; } @@ -919,7 +970,9 @@ int main(int argc, char *argv[]) { q = load_sysv(service); if (q < 0) continue; + } + HASHMAP_FOREACH(service, all_services, j) { q = fix_order(service, all_services); if (q < 0) continue; diff --git a/src/test/test-async.c b/src/test/test-async.c index 401e68551..abd36d693 100644 --- a/src/test/test-async.c +++ b/src/test/test-async.c @@ -38,7 +38,9 @@ int main(int argc, char *argv[]) { fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); asynchronous_close(fd); + assert_se(asynchronous_job(async_func, NULL) >= 0); + assert_se(asynchronous_sync() >= 0); sleep(1); diff --git a/src/test/test-btrfs.c b/src/test/test-btrfs.c new file mode 100644 index 000000000..150a32ad6 --- /dev/null +++ b/src/test/test-btrfs.c @@ -0,0 +1,106 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "log.h" +#include "fileio.h" +#include "util.h" +#include "btrfs-util.h" + +int main(int argc, char *argv[]) { + int r; + int fd; + + fd = open("/", O_RDONLY|O_CLOEXEC|O_DIRECTORY); + if (fd < 0) + log_error_errno(errno, "Failed to open root directory: %m"); + else { + BtrfsSubvolInfo info; + BtrfsQuotaInfo quota; + char ts[FORMAT_TIMESTAMP_MAX], bs[FORMAT_BYTES_MAX]; + + r = btrfs_subvol_get_info_fd(fd, &info); + if (r < 0) + log_error_errno(r, "Failed to get subvolume info: %m"); + else { + log_info("otime: %s", format_timestamp(ts, sizeof(ts), info.otime)); + log_info("read-only (search): %s", yes_no(info.read_only)); + } + + r = btrfs_subvol_get_quota_fd(fd, "a); + if (r < 0) + log_error_errno(r, "Failed to get quota info: %m"); + else { + log_info("referred: %s", strna(format_bytes(bs, sizeof(bs), quota.referred))); + log_info("exclusive: %s", strna(format_bytes(bs, sizeof(bs), quota.exclusive))); + log_info("referred_max: %s", strna(format_bytes(bs, sizeof(bs), quota.referred_max))); + log_info("exclusive_max: %s", strna(format_bytes(bs, sizeof(bs), quota.exclusive_max))); + } + + r = btrfs_subvol_get_read_only_fd(fd); + if (r < 0) + log_error_errno(r, "Failed to get read only flag: %m"); + else + log_info("read-only (ioctl): %s", yes_no(r)); + + safe_close(fd); + } + + r = btrfs_subvol_make("/xxxtest"); + if (r < 0) + log_error_errno(r, "Failed to make subvolume: %m"); + + r = write_string_file("/xxxtest/afile", "ljsadhfljasdkfhlkjdsfha"); + if (r < 0) + log_error_errno(r, "Failed to write file: %m"); + + r = btrfs_subvol_snapshot("/xxxtest", "/xxxtest2", false, false); + if (r < 0) + log_error_errno(r, "Failed to make snapshot: %m"); + + r = btrfs_subvol_snapshot("/xxxtest", "/xxxtest3", true, false); + if (r < 0) + log_error_errno(r, "Failed to make snapshot: %m"); + + r = btrfs_subvol_remove("/xxxtest"); + if (r < 0) + log_error_errno(r, "Failed to remove subvolume: %m"); + + r = btrfs_subvol_remove("/xxxtest2"); + if (r < 0) + log_error_errno(r, "Failed to remove subvolume: %m"); + + r = btrfs_subvol_remove("/xxxtest3"); + if (r < 0) + log_error_errno(r, "Failed to remove subvolume: %m"); + + r = btrfs_subvol_snapshot("/etc", "/etc2", true, true); + if (r < 0) + log_error_errno(r, "Failed to make snapshot: %m"); + + r = btrfs_subvol_remove("/etc2"); + if (r < 0) + log_error_errno(r, "Failed to remove subvolume: %m"); + + return 0; +} diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c index dfa9a063c..632d62ff8 100644 --- a/src/test/test-cap-list.c +++ b/src/test/test-cap-list.c @@ -19,17 +19,21 @@ along with systemd; If not, see . ***/ +#include "util.h" #include "log.h" +#include "fileio.h" #include "cap-list.h" #include "capability.h" +#include -int main(int argc, char *argv[]) { +/* verify the capability parser */ +static void test_cap_list(void) { int i; assert_se(!capability_to_name(-1)); - assert_se(!capability_to_name(cap_last_cap()+1)); + assert_se(!capability_to_name(capability_list_length())); - for (i = 0; i <= (int) cap_last_cap(); i++) { + for (i = 0; i < capability_list_length(); i++) { const char *n; assert_se(n = capability_to_name(i)); @@ -39,9 +43,69 @@ int main(int argc, char *argv[]) { assert_se(capability_from_name("asdfbsd") == -EINVAL); assert_se(capability_from_name("CAP_AUDIT_READ") == CAP_AUDIT_READ); + assert_se(capability_from_name("cap_audit_read") == CAP_AUDIT_READ); + assert_se(capability_from_name("cAp_aUdIt_rEAd") == CAP_AUDIT_READ); assert_se(capability_from_name("0") == 0); assert_se(capability_from_name("15") == 15); assert_se(capability_from_name("-1") == -EINVAL); + for (i = 0; i < capability_list_length(); i++) { + _cleanup_cap_free_charp_ char *a = NULL; + const char *b; + unsigned u; + + assert_se(a = cap_to_name(i)); + + /* quit the loop as soon as libcap starts returning + * numeric ids, formatted as strings */ + if (safe_atou(a, &u) >= 0) + break; + + assert_se(b = capability_to_name(i)); + + printf("%s vs. %s\n", a, b); + + assert_se(strcasecmp(a, b) == 0); + } +} + +/* verify cap_last_cap() against /proc/sys/kernel/cap_last_cap */ +static void test_last_cap_file(void) { + _cleanup_free_ char *content = NULL; + unsigned long val = 0; + int r; + + r = read_one_line_file("/proc/sys/kernel/cap_last_cap", &content); + assert_se(r >= 0); + + r = safe_atolu(content, &val); + assert_se(r >= 0); + assert_se(val != 0); + assert_se(val == cap_last_cap()); +} + +/* verify cap_last_cap() against syscall probing */ +static void test_last_cap_probe(void) { + unsigned long p = (unsigned long)CAP_LAST_CAP; + + if (prctl(PR_CAPBSET_READ, p) < 0) { + for (p--; p > 0; p --) + if (prctl(PR_CAPBSET_READ, p) >= 0) + break; + } else { + for (;; p++) + if (prctl(PR_CAPBSET_READ, p+1) < 0) + break; + } + + assert_se(p != 0); + assert_se(p == cap_last_cap()); +} + +int main(int argc, char *argv[]) { + test_cap_list(); + test_last_cap_file(); + test_last_cap_probe(); + return 0; } diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 58eb74427..67eeeb56b 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -93,6 +93,7 @@ static void test_path_get_user_unit(void) { check_p_g_u_u("/meh.service", -ENOENT, NULL); check_p_g_u_u("/session-3.scope/_cpu.service", 0, "cpu.service"); check_p_g_u_u("/user.slice/user-1000.slice/user@1000.service/server.service", 0, "server.service"); + check_p_g_u_u("/user.slice/user-1000.slice/user@1000.service/foobar.slice/foobar@pie.service", 0, "foobar@pie.service"); check_p_g_u_u("/user.slice/user-1000.slice/user@.service/server.service", -ENOENT, NULL); } diff --git a/src/test/test-condition.c b/src/test/test-condition.c index 349c6470c..88147c8e0 100644 --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@ -23,8 +23,13 @@ #include "log.h" #include "architecture.h" #include "sd-id128.h" +#include "selinux-util.h" +#include "audit.h" +#include "ima-util.h" +#include "apparmor-util.h" +#include "smack-util.h" -static void test_condition_test_path_exists(void) { +static void test_condition_test_path(void) { Condition *condition; condition = condition_new(CONDITION_PATH_EXISTS, "/bin/sh", false, false); @@ -82,6 +87,14 @@ static void test_condition_test_path_exists(void) { condition = condition_new(CONDITION_PATH_IS_MOUNT_POINT, "/bin", false, false); assert_se(!condition_test(condition)); condition_free(condition); + + condition = condition_new(CONDITION_PATH_IS_READ_WRITE, "/tmp", false, false); + assert_se(condition_test(condition)); + condition_free(condition); + + condition = condition_new(CONDITION_PATH_IS_SYMBOLIC_LINK, "/dev/stdout", false, false); + assert_se(condition_test(condition)); + condition_free(condition); } static void test_condition_test_ac_power(void) { @@ -179,16 +192,46 @@ static void test_condition_test_null(void) { condition_free(condition); } +static void test_condition_test_security(void) { + Condition *condition; + + condition = condition_new(CONDITION_SECURITY, "garbage oifdsjfoidsjoj", false, false); + assert_se(!condition_test(condition)); + condition_free(condition); + + condition = condition_new(CONDITION_SECURITY, "selinux", false, true); + assert_se(condition_test(condition) != mac_selinux_use()); + condition_free(condition); + + condition = condition_new(CONDITION_SECURITY, "ima", false, false); + assert_se(condition_test(condition) == use_ima()); + condition_free(condition); + + condition = condition_new(CONDITION_SECURITY, "apparmor", false, false); + assert_se(condition_test(condition) == mac_apparmor_use()); + condition_free(condition); + + condition = condition_new(CONDITION_SECURITY, "smack", false, false); + assert_se(condition_test(condition) == mac_smack_use()); + condition_free(condition); + + condition = condition_new(CONDITION_SECURITY, "audit", false, false); + assert_se(condition_test(condition) == use_audit()); + condition_free(condition); +} + + int main(int argc, char *argv[]) { log_parse_environment(); log_open(); - test_condition_test_path_exists(); + test_condition_test_path(); test_condition_test_ac_power(); test_condition_test_host(); test_condition_test_architecture(); test_condition_test_kernel_command_line(); test_condition_test_null(); + test_condition_test_security(); return 0; } diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c index 71cfc022d..894c7f742 100644 --- a/src/test/test-conf-files.c +++ b/src/test/test-conf-files.c @@ -59,12 +59,12 @@ static void test_conf_files_list(bool use_root) { search_2 = "/dir2"; } else { root_dir = NULL; - search_1 = strappenda(tmp_dir, "/dir1"); - search_2 = strappenda(tmp_dir, "/dir2"); + search_1 = strjoina(tmp_dir, "/dir1"); + search_2 = strjoina(tmp_dir, "/dir2"); } - expect_a = strappenda(tmp_dir, "/dir1/a.conf"); - expect_b = strappenda(tmp_dir, "/dir2/b.conf"); + expect_a = strjoina(tmp_dir, "/dir1/a.conf"); + expect_b = strjoina(tmp_dir, "/dir2/b.conf"); assert_se(conf_files_list(&found_files, ".conf", root_dir, search_1, search_2, NULL) == 0); strv_print(found_files); diff --git a/src/test/test-copy.c b/src/test/test-copy.c index d2cad08cb..5c96f6100 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -44,7 +44,7 @@ static void test_copy_file(void) { assert_se(write_string_file(fn, "foo bar bar bar foo") == 0); - assert_se(copy_file(fn, fn_copy, 0, 0644) == 0); + assert_se(copy_file(fn, fn_copy, 0, 0644, 0) == 0); assert_se(read_full_file(fn_copy, &buf, &sz) == 0); assert_se(streq(buf, "foo bar bar bar foo\n")); @@ -67,8 +67,8 @@ static void test_copy_file_fd(void) { assert_se(out_fd >= 0); assert_se(write_string_file(in_fn, text) == 0); - assert_se(copy_file_fd("/a/file/which/does/not/exist/i/guess", out_fd) < 0); - assert_se(copy_file_fd(in_fn, out_fd) >= 0); + assert_se(copy_file_fd("/a/file/which/does/not/exist/i/guess", out_fd, true) < 0); + assert_se(copy_file_fd(in_fn, out_fd, true) >= 0); assert_se(lseek(out_fd, SEEK_SET, 0) == 0); assert_se(read(out_fd, buf, sizeof(buf)) == sizeof(text) - 1); @@ -90,15 +90,15 @@ static void test_copy_tree(void) { rm_rf_dangerous(original_dir, false, true, false); STRV_FOREACH(p, files) { - char *f = strappenda(original_dir, *p); + char *f = strjoina(original_dir, *p); assert_se(mkdir_parents(f, 0755) >= 0); assert_se(write_string_file(f, "file") == 0); } STRV_FOREACH_PAIR(link, p, links) { - char *f = strappenda(original_dir, *p); - char *l = strappenda(original_dir, *link); + char *f = strjoina(original_dir, *p); + char *l = strjoina(original_dir, *link); assert_se(mkdir_parents(l, 0755) >= 0); assert_se(symlink(f, l) == 0); @@ -109,7 +109,7 @@ static void test_copy_tree(void) { STRV_FOREACH(p, files) { _cleanup_free_ char *buf = NULL; size_t sz = 0; - char *f = strappenda(copy_dir, *p); + char *f = strjoina(copy_dir, *p); assert_se(access(f, F_OK) == 0); assert_se(read_full_file(f, &buf, &sz) == 0); @@ -118,8 +118,8 @@ static void test_copy_tree(void) { STRV_FOREACH_PAIR(link, p, links) { _cleanup_free_ char *target = NULL; - char *f = strappenda(original_dir, *p); - char *l = strappenda(copy_dir, *link); + char *f = strjoina(original_dir, *p); + char *l = strjoina(copy_dir, *link); assert_se(readlink_and_canonicalize(l, &target) == 0); assert_se(path_equal(f, target)); diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 60466f0d3..91ccaf72b 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -132,6 +132,11 @@ static void test_exec_environment(Manager *m) { test(m, "exec-environment-empty.service", 0, CLD_EXITED); } +static void test_exec_umask(Manager *m) { + test(m, "exec-umask-default.service", 0, CLD_EXITED); + test(m, "exec-umask-0177.service", 0, CLD_EXITED); +} + int main(int argc, char *argv[]) { test_function_t tests[] = { test_exec_workingdirectory, @@ -144,6 +149,7 @@ int main(int argc, char *argv[]) { test_exec_user, test_exec_group, test_exec_environment, + test_exec_umask, NULL, }; test_function_t *test = NULL; diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index cdf1973ea..63e4a19b7 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -90,7 +90,7 @@ static void test_parse_env_file(void) { assert_se(streq_ptr(a[9], "ten=")); assert_se(a[10] == NULL); - strv_env_clean_log(a, NULL, "test"); + strv_env_clean(a); k = 0; STRV_FOREACH(i, b) { diff --git a/src/test/test-fstab-util.c b/src/test/test-fstab-util.c new file mode 100644 index 000000000..50e5dee0a --- /dev/null +++ b/src/test/test-fstab-util.c @@ -0,0 +1,138 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "fstab-util.h" +#include "util.h" +#include "log.h" + +/* +int fstab_filter_options(const char *opts, const char *names, + const char **namefound, char **value, char **filtered); +*/ + +static void do_fstab_filter_options(const char *opts, + const char *remove, + int r_expected, + const char *name_expected, + const char *value_expected, + const char *filtered_expected) { + + int r; + const char *name; + _cleanup_free_ char *value, *filtered; + + r = fstab_filter_options(opts, remove, &name, &value, &filtered); + log_info("\"%s\" → %d, \"%s\", \"%s\", \"%s\", expected %d, \"%s\", \"%s\", \"%s\"", + opts, r, name, value, filtered, + r_expected, name_expected, value_expected, filtered_expected ?: opts); + assert_se(r == r_expected); + assert_se(streq_ptr(name, name_expected)); + assert_se(streq_ptr(value, value_expected)); + assert_se(streq_ptr(filtered, filtered_expected ?: opts)); + + /* also test the malloc-less mode */ + r = fstab_filter_options(opts, remove, &name, NULL, NULL); + log_info("\"%s\" → %d, \"%s\", expected %d, \"%s\"", + opts, r, name, + r_expected, name_expected); + assert_se(r == r_expected); + assert_se(streq_ptr(name, name_expected)); +} + +static void test_fstab_filter_options(void) { + do_fstab_filter_options("opt=0", "opt\0x-opt\0", 1, "opt", "0", ""); + do_fstab_filter_options("opt=0", "x-opt\0opt\0", 1, "opt", "0", ""); + do_fstab_filter_options("opt", "opt\0x-opt\0", 1, "opt", NULL, ""); + do_fstab_filter_options("opt", "x-opt\0opt\0", 1, "opt", NULL, ""); + do_fstab_filter_options("x-opt", "x-opt\0opt\0", 1, "x-opt", NULL, ""); + + do_fstab_filter_options("opt=0,other", "opt\0x-opt\0", 1, "opt", "0", "other"); + do_fstab_filter_options("opt=0,other", "x-opt\0opt\0", 1, "opt", "0", "other"); + do_fstab_filter_options("opt,other", "opt\0x-opt\0", 1, "opt", NULL, "other"); + do_fstab_filter_options("opt,other", "x-opt\0opt\0", 1, "opt", NULL, "other"); + do_fstab_filter_options("x-opt,other", "opt\0x-opt\0", 1, "x-opt", NULL, "other"); + + do_fstab_filter_options("opto=0,other", "opt\0x-opt\0", 0, NULL, NULL, NULL); + do_fstab_filter_options("opto,other", "opt\0x-opt\0", 0, NULL, NULL, NULL); + do_fstab_filter_options("x-opto,other", "opt\0x-opt\0", 0, NULL, NULL, NULL); + + do_fstab_filter_options("first,opt=0", "opt\0x-opt\0", 1, "opt", "0", "first"); + do_fstab_filter_options("first=1,opt=0", "opt\0x-opt\0", 1, "opt", "0", "first=1"); + do_fstab_filter_options("first,opt=", "opt\0x-opt\0", 1, "opt", "", "first"); + do_fstab_filter_options("first=1,opt", "opt\0x-opt\0", 1, "opt", NULL, "first=1"); + do_fstab_filter_options("first=1,x-opt", "opt\0x-opt\0", 1, "x-opt", NULL, "first=1"); + + do_fstab_filter_options("first,opt=0,last=1", "opt\0x-opt\0", 1, "opt", "0", "first,last=1"); + do_fstab_filter_options("first=1,opt=0,last=2", "x-opt\0opt\0", 1, "opt", "0", "first=1,last=2"); + do_fstab_filter_options("first,opt,last", "opt\0", 1, "opt", NULL, "first,last"); + do_fstab_filter_options("first=1,opt,last", "x-opt\0opt\0", 1, "opt", NULL, "first=1,last"); + do_fstab_filter_options("first=,opt,last", "opt\0noopt\0", 1, "opt", NULL, "first=,last"); + + /* check repeated options */ + do_fstab_filter_options("first,opt=0,noopt=1,last=1", "opt\0noopt\0", 1, "noopt", "1", "first,last=1"); + do_fstab_filter_options("first=1,opt=0,last=2,opt=1", "opt\0", 1, "opt", "1", "first=1,last=2"); + do_fstab_filter_options("x-opt=0,x-opt=1", "opt\0x-opt\0", 1, "x-opt", "1", ""); + do_fstab_filter_options("opt=0,x-opt=1", "opt\0x-opt\0", 1, "x-opt", "1", ""); + + /* check that semicolons are not misinterpreted */ + do_fstab_filter_options("opt=0;", "opt\0", 1, "opt", "0;", ""); + do_fstab_filter_options("opt;=0", "x-opt\0opt\0noopt\0x-noopt\0", 0, NULL, NULL, NULL); + do_fstab_filter_options("opt;", "opt\0x-opt\0", 0, NULL, NULL, NULL); + + /* check that spaces are not misinterpreted */ + do_fstab_filter_options("opt=0 ", "opt\0", 1, "opt", "0 ", ""); + do_fstab_filter_options("opt =0", "x-opt\0opt\0noopt\0x-noopt\0", 0, NULL, NULL, NULL); + do_fstab_filter_options(" opt ", "opt\0x-opt\0", 0, NULL, NULL, NULL); + + /* check function will NULL args */ + do_fstab_filter_options(NULL, "opt\0", 0, NULL, NULL, ""); + do_fstab_filter_options("", "opt\0", 0, NULL, NULL, ""); +} + +static void test_fstab_find_pri(void) { + int pri = -1; + + assert_se(fstab_find_pri("pri", &pri) == 0); + assert_se(pri == -1); + + assert_se(fstab_find_pri("pri=11", &pri) == 1); + assert_se(pri == 11); + + assert_se(fstab_find_pri("opt,pri=12,opt", &pri) == 1); + assert_se(pri == 12); + + assert_se(fstab_find_pri("opt,opt,pri=12,pri=13", &pri) == 1); + assert_se(pri == 13); +} + +static void test_fstab_yes_no_option(void) { + assert_se(fstab_test_yes_no_option("nofail,fail,nofail", "nofail\0fail\0") == true); + assert_se(fstab_test_yes_no_option("nofail,nofail,fail", "nofail\0fail\0") == false); + assert_se(fstab_test_yes_no_option("abc,cde,afail", "nofail\0fail\0") == false); + assert_se(fstab_test_yes_no_option("nofail,fail=0,nofail=0", "nofail\0fail\0") == true); + assert_se(fstab_test_yes_no_option("nofail,nofail=0,fail=0", "nofail\0fail\0") == false); +} + +int main(void) { + test_fstab_filter_options(); + test_fstab_find_pri(); + test_fstab_yes_no_option(); +} diff --git a/src/test/test-fw-util.c b/src/test/test-fw-util.c new file mode 100644 index 000000000..ab891aa0c --- /dev/null +++ b/src/test/test-fw-util.c @@ -0,0 +1,60 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2015 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "log.h" +#include "fw-util.h" + +#define MAKE_IN_ADDR_UNION(a,b,c,d) (union in_addr_union) { .in.s_addr = htobe32((uint32_t) (a) << 24 | (uint32_t) (b) << 16 | (uint32_t) (c) << 8 | (uint32_t) (d))} + +int main(int argc, char *argv[]) { + int r; + log_set_max_level(LOG_DEBUG); + + r = fw_add_masquerade(true, AF_INET, 0, NULL, 0, "foobar", NULL, 0); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_masquerade(true, AF_INET, 0, NULL, 0, "foobar", NULL, 0); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_masquerade(false, AF_INET, 0, NULL, 0, "foobar", NULL, 0); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, &MAKE_IN_ADDR_UNION(1, 2, 3, 4)); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + r = fw_add_local_dnat(false, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, NULL); + if (r < 0) + log_error_errno(r, "Failed to modify firewall: %m"); + + return 0; +} diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 6f0910aae..84b508f87 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -245,6 +245,8 @@ static void test_hashmap_put(void) { Hashmap *m = NULL; int valid_hashmap_put; void *val1 = (void*) "val 1"; + void *val2 = (void*) "val 2"; + _cleanup_free_ char* key1 = NULL; assert_se(hashmap_ensure_allocated(&m, &string_hash_ops) >= 0); assert_se(m); @@ -252,7 +254,10 @@ static void test_hashmap_put(void) { valid_hashmap_put = hashmap_put(m, "key 1", val1); assert_se(valid_hashmap_put == 1); assert_se(hashmap_put(m, "key 1", val1) == 0); - assert_se(hashmap_put(m, "key 1", (void *)"val 2") == -EEXIST); + assert_se(hashmap_put(m, "key 1", val2) == -EEXIST); + key1 = strdup("key 1"); + assert_se(hashmap_put(m, key1, val1) == 0); + assert_se(hashmap_put(m, key1, val2) == -EEXIST); hashmap_free(m); } diff --git a/src/test/test-json.c b/src/test/test-json.c new file mode 100644 index 000000000..b09131891 --- /dev/null +++ b/src/test/test-json.c @@ -0,0 +1,107 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "log.h" +#include "util.h" +#include "json.h" + +static void test_one(const char *data, ...) { + void *state = NULL; + va_list ap; + + va_start(ap, data); + + for (;;) { + _cleanup_free_ char *str = NULL; + union json_value v = {}; + int t, tt; + + t = json_tokenize(&data, &str, &v, &state, NULL); + tt = va_arg(ap, int); + + assert_se(t == tt); + + if (t == JSON_END || t < 0) + break; + + else if (t == JSON_STRING) { + const char *nn; + + nn = va_arg(ap, const char *); + assert_se(streq_ptr(nn, str)); + + } else if (t == JSON_REAL) { + double d; + + d = va_arg(ap, double); + assert_se(fabs(d - v.real) < 0.001); + + } else if (t == JSON_INTEGER) { + intmax_t i; + + i = va_arg(ap, intmax_t); + assert_se(i == v.integer); + + } else if (t == JSON_BOOLEAN) { + bool b; + + b = va_arg(ap, int); + assert_se(b == v.boolean); + } + } + + va_end(ap); +} + +int main(int argc, char *argv[]) { + + test_one("x", -EINVAL); + test_one("", JSON_END); + test_one(" ", JSON_END); + test_one("0", JSON_INTEGER, (intmax_t) 0, JSON_END); + test_one("1234", JSON_INTEGER, (intmax_t) 1234, JSON_END); + test_one("3.141", JSON_REAL, 3.141, JSON_END); + test_one("0.0", JSON_REAL, 0.0, JSON_END); + test_one("7e3", JSON_REAL, 7e3, JSON_END); + test_one("-7e-3", JSON_REAL, -7e-3, JSON_END); + test_one("true", JSON_BOOLEAN, true, JSON_END); + test_one("false", JSON_BOOLEAN, false, JSON_END); + test_one("null", JSON_NULL, JSON_END); + test_one("{}", JSON_OBJECT_OPEN, JSON_OBJECT_CLOSE, JSON_END); + test_one("\t {\n} \n", JSON_OBJECT_OPEN, JSON_OBJECT_CLOSE, JSON_END); + test_one("[]", JSON_ARRAY_OPEN, JSON_ARRAY_CLOSE, JSON_END); + test_one("\t [] \n\n", JSON_ARRAY_OPEN, JSON_ARRAY_CLOSE, JSON_END); + test_one("\"\"", JSON_STRING, "", JSON_END); + test_one("\"foo\"", JSON_STRING, "foo", JSON_END); + test_one("\"foo\\nfoo\"", JSON_STRING, "foo\nfoo", JSON_END); + test_one("{\"foo\" : \"bar\"}", JSON_OBJECT_OPEN, JSON_STRING, "foo", JSON_COLON, JSON_STRING, "bar", JSON_OBJECT_CLOSE, JSON_END); + test_one("{\"foo\" : [true, false]}", JSON_OBJECT_OPEN, JSON_STRING, "foo", JSON_COLON, JSON_ARRAY_OPEN, JSON_BOOLEAN, true, JSON_COMMA, JSON_BOOLEAN, false, JSON_ARRAY_CLOSE, JSON_OBJECT_CLOSE, JSON_END); + test_one("\"\xef\xbf\xbd\"", JSON_STRING, "\xef\xbf\xbd", JSON_END); + test_one("\"\\ufffd\"", JSON_STRING, "\xef\xbf\xbd", JSON_END); + test_one("\"\\uf\"", -EINVAL); + test_one("\"\\ud800a\"", -EINVAL); + test_one("\"\\udc00\\udc00\"", -EINVAL); + test_one("\"\\ud801\\udc37\"", JSON_STRING, "\xf0\x90\x90\xb7", JSON_END); + + return 0; +} diff --git a/src/test/test-list.c b/src/test/test-list.c index fa52ad1db..f6da1a705 100644 --- a/src/test/test-list.c +++ b/src/test/test-list.c @@ -38,6 +38,27 @@ int main(int argc, const char *argv[]) { LIST_PREPEND(item, head, &items[i]); } + i = 0; + LIST_FOREACH_OTHERS(item, cursor, &items[2]) { + i++; + assert_se(cursor != &items[2]); + } + assert_se(i == ELEMENTSOF(items)-1); + + i = 0; + LIST_FOREACH_OTHERS(item, cursor, &items[0]) { + i++; + assert_se(cursor != &items[0]); + } + assert_se(i == ELEMENTSOF(items)-1); + + i = 0; + LIST_FOREACH_OTHERS(item, cursor, &items[3]) { + i++; + assert_se(cursor != &items[3]); + } + assert_se(i == ELEMENTSOF(items)-1); + assert_se(!LIST_JUST_US(item, head)); assert_se(items[0].item_next == NULL); @@ -105,5 +126,29 @@ int main(int argc, const char *argv[]) { LIST_REMOVE(item, head, &items[3]); assert_se(LIST_JUST_US(item, &items[3])); + assert_se(head == NULL); + + for (i = 0; i < ELEMENTSOF(items); i++) { + assert_se(LIST_JUST_US(item, &items[i])); + LIST_APPEND(item, head, &items[i]); + } + + assert_se(!LIST_JUST_US(item, head)); + + assert_se(items[0].item_next == &items[1]); + assert_se(items[1].item_next == &items[2]); + assert_se(items[2].item_next == &items[3]); + assert_se(items[3].item_next == NULL); + + assert_se(items[0].item_prev == NULL); + assert_se(items[1].item_prev == &items[0]); + assert_se(items[2].item_prev == &items[1]); + assert_se(items[3].item_prev == &items[2]); + + for (i = 0; i < ELEMENTSOF(items); i++) + LIST_REMOVE(item, head, &items[i]); + + assert_se(head == NULL); + return 0; } diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c index ab330ac84..75fe053b6 100644 --- a/src/test/test-loopback.c +++ b/src/test/test-loopback.c @@ -25,11 +25,15 @@ #include #include "loopback-setup.h" +#include "log.h" #include "util.h" int main(int argc, char* argv[]) { int r; + log_open(); + log_parse_environment(); + if ((r = loopback_setup()) < 0) fprintf(stderr, "loopback: %s\n", strerror(-r)); diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c index e74fd0c88..2397db5ff 100644 --- a/src/test/test-namespace.c +++ b/src/test/test-namespace.c @@ -19,7 +19,6 @@ along with systemd; If not, see . ***/ -#include #include #include "namespace.h" @@ -43,8 +42,8 @@ static void test_tmpdir(const char *id, const char *A, const char *B) { assert_se((x.st_mode & 01777) == 0700); assert_se((y.st_mode & 01777) == 0700); - c = strappenda(a, "/tmp"); - d = strappenda(b, "/tmp"); + c = strjoina(a, "/tmp"); + d = strjoina(b, "/tmp"); assert_se(stat(c, &x) >= 0); assert_se(stat(d, &y) >= 0); diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c new file mode 100644 index 000000000..38e5c93df --- /dev/null +++ b/src/test/test-path-lookup.c @@ -0,0 +1,74 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include +#include + +#include "path-lookup.h" +#include "log.h" +#include "strv.h" + +static void test_paths(SystemdRunningAs running_as, bool personal) { + char template[] = "/tmp/test-path-lookup.XXXXXXX"; + + _cleanup_lookup_paths_free_ LookupPaths lp = {}; + char *exists, *not; + + assert_se(mkdtemp(template)); + exists = strjoina(template, "/exists"); + assert_se(mkdir(exists, 0755) == 0); + not = strjoina(template, "/not"); + + assert_se(lookup_paths_init(&lp, running_as, personal, NULL, exists, not, not) == 0); + + assert_se(!strv_isempty(lp.unit_path)); + assert_se(strv_contains(lp.unit_path, exists)); + assert_se(strv_contains(lp.unit_path, not)); + + assert_se(rm_rf_dangerous(template, false, true, false) >= 0); +} + +static void print_generator_paths(SystemdRunningAs running_as) { + _cleanup_strv_free_ char **paths; + char **dir; + + log_info("Generators dirs (%s):", running_as == SYSTEMD_SYSTEM ? "system" : "user"); + + paths = generator_paths(running_as); + STRV_FOREACH(dir, paths) + log_info(" %s", *dir); +} + +int main(int argc, char **argv) { + log_set_max_level(LOG_DEBUG); + log_parse_environment(); + log_open(); + + test_paths(SYSTEMD_SYSTEM, false); + test_paths(SYSTEMD_SYSTEM, true); + test_paths(SYSTEMD_USER, false); + test_paths(SYSTEMD_USER, true); + + print_generator_paths(SYSTEMD_SYSTEM); + print_generator_paths(SYSTEMD_USER); + + return EXIT_SUCCESS; +} diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 58b456a29..11aa52aae 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -176,13 +176,13 @@ static void test_path_join(void) { test_join("/root", "/a/b", "/c", "/root/a/b/c"); test_join("/root", "a/b", "c", "/root/a/b/c"); test_join("/root", "/a/b", "c", "/root/a/b/c"); - test_join("/root", "/", "c", "/root//c"); + test_join("/root", "/", "c", "/root/c"); test_join("/root", "/", NULL, "/root/"); test_join(NULL, "/a/b", "/c", "/a/b/c"); test_join(NULL, "a/b", "c", "a/b/c"); test_join(NULL, "/a/b", "c", "/a/b/c"); - test_join(NULL, "/", "c", "//c"); + test_join(NULL, "/", "c", "/c"); test_join(NULL, "/", NULL, "/"); } diff --git a/src/test/test-path.c b/src/test/test-path.c index 18fcb575e..4f9f5c134 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -47,7 +47,7 @@ static int setup_test(Manager **m) { assert_se(manager_startup(tmp, NULL, NULL) >= 0); STRV_FOREACH(test_path, tests_path) { - rm_rf_dangerous(strappenda("/tmp/test-path_", *test_path), false, true, false); + rm_rf_dangerous(strjoina("/tmp/test-path_", *test_path), false, true, false); } *m = tmp; @@ -81,7 +81,7 @@ static void check_stop_unlink(Manager *m, Unit *unit, const char *test_path, con service = SERVICE(service_unit); ts = now(CLOCK_MONOTONIC); - /* We proces events until the service related to the path has been successfully started */ + /* We process events until the service related to the path has been successfully started */ while(service->result != SERVICE_SUCCESS || service->state != SERVICE_START) { usec_t n; int r; @@ -201,7 +201,7 @@ static void test_path_directorynotempty(Manager *m) { assert_se(access(test_path, F_OK) < 0); assert_se(mkdir_p(test_path, 0755) >= 0); - assert_se(touch(strappenda(test_path, "test_file")) >= 0); + assert_se(touch(strjoina(test_path, "test_file")) >= 0); check_stop_unlink(m, unit, test_path, NULL); } @@ -248,10 +248,6 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); - /* It is needed otherwise cgroup creation fails */ - if (getuid() != 0) - return EXIT_TEST_SKIP; - assert_se(set_unit_path(TEST_DIR ":") >= 0); for (test = tests; test && *test; test++) { diff --git a/src/test/test-pty.c b/src/test/test-pty.c index ed23e9f0f..cab569a9d 100644 --- a/src/test/test-pty.c +++ b/src/test/test-pty.c @@ -100,7 +100,7 @@ static void test_pty(void) { Pty *pty; rcvsiz = 0; - memset(rcvbuf, 0, sizeof(rcvbuf)); + zero(rcvbuf); assert_se(sd_event_default(&event) >= 0); diff --git a/src/test/test-ring.c b/src/test/test-ring.c index 5e4efdbde..a9dd01ca0 100644 --- a/src/test/test-ring.c +++ b/src/test/test-ring.c @@ -36,7 +36,7 @@ static void test_ring(void) { struct iovec vec[2]; int s; - memset(&r, 0, sizeof(r)); + zero(r); l = ring_peek(&r, vec); assert_se(l == 0); diff --git a/src/test/test-sigbus.c b/src/test/test-sigbus.c new file mode 100644 index 000000000..f5bae65be --- /dev/null +++ b/src/test/test-sigbus.c @@ -0,0 +1,62 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include + +#include "util.h" +#include "sigbus.h" + +int main(int argc, char *argv[]) { + _cleanup_close_ int fd = -1; + char template[] = "/tmp/sigbus-test-XXXXXX"; + void *addr = NULL; + uint8_t *p; + + sigbus_install(); + + assert_se(sigbus_pop(&addr) == 0); + + assert_se((fd = mkostemp(template, O_RDWR|O_CREAT|O_EXCL)) >= 0); + assert_se(unlink(template) >= 0); + assert_se(fallocate(fd, 0, 0, page_size() * 8) >= 0); + + p = mmap(NULL, page_size() * 16, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + assert_se(p != MAP_FAILED); + + assert_se(sigbus_pop(&addr) == 0); + + p[0] = 0xFF; + assert_se(sigbus_pop(&addr) == 0); + + p[page_size()] = 0xFF; + assert_se(sigbus_pop(&addr) == 0); + + p[page_size()*8] = 0xFF; + p[page_size()*8+1] = 0xFF; + p[page_size()*10] = 0xFF; + assert_se(sigbus_pop(&addr) > 0); + assert_se(addr == p + page_size() * 8); + assert_se(sigbus_pop(&addr) > 0); + assert_se(addr == p + page_size() * 10); + assert_se(sigbus_pop(&addr) == 0); + + sigbus_reset(); +} diff --git a/src/test/test-strbuf.c b/src/test/test-strbuf.c index 43cb92b74..4ec648ae6 100644 --- a/src/test/test-strbuf.c +++ b/src/test/test-strbuf.c @@ -48,7 +48,7 @@ static void test_strbuf(void) { /* check the content of the buffer directly */ l = strv_parse_nulstr(sb->buf, sb->len); - assert_se(streq(l[0], "")); /* root*/ + assert_se(streq(l[0], "")); /* root */ assert_se(streq(l[1], "waldo")); assert_se(streq(l[2], "foo")); assert_se(streq(l[3], "bar")); diff --git a/src/test/test-strv.c b/src/test/test-strv.c index 674c1b53f..5ae929c3f 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -175,7 +175,7 @@ static void test_strv_quote_unquote(const char* const *split, const char *quoted } } -static void test_strv_unquote(const char *quoted, const char **list) { +static void test_strv_unquote(const char *quoted, char **list) { _cleanup_strv_free_ char **s; _cleanup_free_ char *j; unsigned i = 0; @@ -470,6 +470,78 @@ static void test_strv_push(void) { assert_se(streq_ptr(a[3], NULL)); } +static void test_strv_equal(void) { + _cleanup_strv_free_ char **a = NULL; + _cleanup_strv_free_ char **b = NULL; + _cleanup_strv_free_ char **c = NULL; + + a = strv_new("one", "two", "three", NULL); + assert_se(a); + b = strv_new("one", "two", "three", NULL); + assert_se(a); + c = strv_new("one", "two", "three", "four", NULL); + assert_se(a); + + assert_se(strv_equal(a, a)); + assert_se(strv_equal(a, b)); + assert_se(strv_equal(NULL, NULL)); + + assert_se(!strv_equal(a, c)); + assert_se(!strv_equal(b, c)); + assert_se(!strv_equal(b, NULL)); +} + +static void test_strv_is_uniq(void) { + _cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL, **d = NULL; + + a = strv_new(NULL, NULL); + assert_se(a); + assert_se(strv_is_uniq(a)); + + b = strv_new("foo", NULL); + assert_se(b); + assert_se(strv_is_uniq(b)); + + c = strv_new("foo", "bar", NULL); + assert_se(c); + assert_se(strv_is_uniq(c)); + + d = strv_new("foo", "bar", "waldo", "bar", "piep", NULL); + assert_se(d); + assert_se(!strv_is_uniq(d)); +} + +static void test_strv_reverse(void) { + _cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL, **d = NULL; + + a = strv_new(NULL, NULL); + assert_se(a); + + strv_reverse(a); + assert_se(strv_isempty(a)); + + b = strv_new("foo", NULL); + assert_se(b); + strv_reverse(b); + assert_se(streq_ptr(b[0], "foo")); + assert_se(streq_ptr(b[1], NULL)); + + c = strv_new("foo", "bar", NULL); + assert_se(c); + strv_reverse(c); + assert_se(streq_ptr(c[0], "bar")); + assert_se(streq_ptr(c[1], "foo")); + assert_se(streq_ptr(c[2], NULL)); + + d = strv_new("foo", "bar", "waldo", NULL); + assert_se(d); + strv_reverse(d); + assert_se(streq_ptr(d[0], "waldo")); + assert_se(streq_ptr(d[1], "bar")); + assert_se(streq_ptr(d[2], "foo")); + assert_se(streq_ptr(d[3], NULL)); +} + int main(int argc, char *argv[]) { test_specifier_printf(); test_strv_foreach(); @@ -486,18 +558,22 @@ int main(int argc, char *argv[]) { test_strv_quote_unquote(input_table_quotes, QUOTES_STRING); test_strv_quote_unquote(input_table_spaces, SPACES_STRING); - test_strv_unquote(" foo=bar \"waldo\" zzz ", (const char*[]) { "foo=bar", "waldo", "zzz", NULL }); - test_strv_unquote("", (const char*[]) { NULL }); - test_strv_unquote(" ", (const char*[]) { NULL }); - test_strv_unquote(" ", (const char*[]) { NULL }); - test_strv_unquote(" x", (const char*[]) { "x", NULL }); - test_strv_unquote("x ", (const char*[]) { "x", NULL }); - test_strv_unquote(" x ", (const char*[]) { "x", NULL }); - test_strv_unquote(" \"x\" ", (const char*[]) { "x", NULL }); - test_strv_unquote(" 'x' ", (const char*[]) { "x", NULL }); - test_strv_unquote(" 'x\"' ", (const char*[]) { "x\"", NULL }); - test_strv_unquote(" \"x'\" ", (const char*[]) { "x'", NULL }); - test_strv_unquote("a '--b=c \"d e\"'", (const char*[]) { "a", "--b=c \"d e\"", NULL }); + test_strv_unquote(" foo=bar \"waldo\" zzz ", STRV_MAKE("foo=bar", "waldo", "zzz")); + test_strv_unquote("", STRV_MAKE_EMPTY); + test_strv_unquote(" ", STRV_MAKE_EMPTY); + test_strv_unquote(" ", STRV_MAKE_EMPTY); + test_strv_unquote(" x", STRV_MAKE("x")); + test_strv_unquote("x ", STRV_MAKE("x")); + test_strv_unquote(" x ", STRV_MAKE("x")); + test_strv_unquote(" \"x\" ", STRV_MAKE("x")); + test_strv_unquote(" 'x' ", STRV_MAKE("x")); + test_strv_unquote(" 'x\"' ", STRV_MAKE("x\"")); + test_strv_unquote(" \"x'\" ", STRV_MAKE("x'")); + test_strv_unquote("a '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\"")); + + /* trailing backslashes */ + test_strv_unquote(" x\\\\", STRV_MAKE("x\\")); + test_invalid_unquote(" x\\"); test_invalid_unquote("a --b='c \"d e\"''"); test_invalid_unquote("a --b='c \"d e\" '\""); @@ -519,6 +595,9 @@ int main(int argc, char *argv[]) { test_strv_from_stdarg_alloca(); test_strv_push_prepend(); test_strv_push(); + test_strv_equal(); + test_strv_is_uniq(); + test_strv_reverse(); return 0; } diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c index cb2309210..a7c8e1267 100644 --- a/src/test/test-strxcpyx.c +++ b/src/test/test-strxcpyx.c @@ -48,7 +48,7 @@ static void test_strpcpyf(void) { size_t space_left; space_left = sizeof(target); - space_left = strpcpyf(&s, space_left, "space left: %zd. ", space_left); + space_left = strpcpyf(&s, space_left, "space left: %zu. ", space_left); space_left = strpcpyf(&s, space_left, "foo%s", "bar"); assert_se(streq(target, "space left: 25. foobar")); diff --git a/src/test/test-tables.c b/src/test/test-tables.c index 97d5609ad..bda224bec 100644 --- a/src/test/test-tables.c +++ b/src/test/test-tables.c @@ -46,7 +46,8 @@ #include "util.h" #include "architecture.h" #include "link-config.h" -#include "bus-policy.h" +#include "bus-xml-policy.h" +#include "busname.h" #include "journald-server.h" #include "locale-util.h" diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c index 84050c6fa..4b72c4a8f 100644 --- a/src/test/test-tmpfiles.c +++ b/src/test/test-tmpfiles.c @@ -30,7 +30,7 @@ int main(int argc, char** argv) { const char *p = argv[1] ?: "/tmp"; - char *pattern = strappenda(p, "/systemd-test-XXXXXX"); + char *pattern = strjoina(p, "/systemd-test-XXXXXX"); _cleanup_close_ int fd, fd2; _cleanup_free_ char *cmd, *cmd2; diff --git a/src/test/test-udev.c b/src/test/test-udev.c index f2283ec7a..b57d275ef 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -32,6 +32,7 @@ #include #include "missing.h" +#include "selinux-util.h" #include "udev.h" #include "udev-util.h" diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c index f31a1bbc9..e517f571d 100644 --- a/src/test/test-unit-file.c +++ b/src/test/test-unit-file.c @@ -71,89 +71,117 @@ static void check_execcommand(ExecCommand *c, const char* path, const char* argv0, const char* argv1, + const char* argv2, bool ignore) { + size_t n; + assert_se(c); - log_info("%s %s %s %s", - c->path, c->argv[0], c->argv[1], c->argv[2]); + log_info("expect: \"%s\" [\"%s\" \"%s\" \"%s\"]", + path, argv0 ?: path, argv1, argv2); + n = strv_length(c->argv); + log_info("actual: \"%s\" [\"%s\" \"%s\" \"%s\"]", + c->path, c->argv[0], n > 0 ? c->argv[1] : NULL, n > 1 ? c->argv[2] : NULL); assert_se(streq(c->path, path)); - assert_se(streq(c->argv[0], argv0)); - assert_se(streq(c->argv[1], argv1)); - assert_se(c->argv[2] == NULL); + assert_se(streq(c->argv[0], argv0 ?: path)); + if (n > 0) + assert_se(streq_ptr(c->argv[1], argv1)); + if (n > 1) + assert_se(streq_ptr(c->argv[2], argv2)); assert_se(c->ignore == ignore); } static void test_config_parse_exec(void) { - /* int config_parse_exec( */ - /* const char *filename, */ - /* unsigned line, */ - /* const char *section, */ - /* unsigned section_line, */ - /* const char *lvalue, */ - /* int ltype, */ - /* const char *rvalue, */ - /* void *data, */ - /* void *userdata) */ + /* int config_parse_exec( + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) */ int r; ExecCommand *c = NULL, *c1; + const char *ccc; - /* basic test */ + log_info("/* basic test */"); r = config_parse_exec(NULL, "fake", 1, "section", 1, "LValue", 0, "/RValue r1", &c, NULL); assert_se(r >= 0); - check_execcommand(c, "/RValue", "/RValue", "r1", false); + check_execcommand(c, "/RValue", "/RValue", "r1", NULL, false); r = config_parse_exec(NULL, "fake", 2, "section", 1, - "LValue", 0, "/RValue///slashes/// r1", + "LValue", 0, "/RValue///slashes r1///", &c, NULL); - /* test slashes */ + + log_info("/* test slashes */"); assert_se(r >= 0); c1 = c->command_next; - check_execcommand(c1, "/RValue/slashes", "/RValue///slashes///", - "r1", false); + check_execcommand(c1, "/RValue/slashes", "/RValue///slashes", "r1///", NULL, false); - /* honour_argv0 */ + log_info("/* trailing slash */"); + r = config_parse_exec(NULL, "fake", 4, "section", 1, + "LValue", 0, "/RValue/ argv0 r1", + &c, NULL); + assert_se(r == 0); + assert_se(c1->command_next == NULL); + + log_info("/* honour_argv0 */"); r = config_parse_exec(NULL, "fake", 3, "section", 1, - "LValue", 0, "@/RValue///slashes2/// argv0 r1", + "LValue", 0, "@/RValue///slashes2 ///argv0 r1", &c, NULL); assert_se(r >= 0); c1 = c1->command_next; - check_execcommand(c1, "/RValue/slashes2", "argv0", "r1", false); + check_execcommand(c1, "/RValue/slashes2", "///argv0", "r1", NULL, false); + + log_info("/* honour_argv0, no args */"); + r = config_parse_exec(NULL, "fake", 3, "section", 1, + "LValue", 0, "@/RValue", + &c, NULL); + assert_se(r == 0); + assert_se(c1->command_next == NULL); - /* ignore && honour_argv0 */ + log_info("/* no command, check for bad memory access */"); + r = config_parse_exec(NULL, "fake", 3, "section", 1, + "LValue", 0, " ", + &c, NULL); + assert_se(r == 0); + assert_se(c1->command_next == NULL); + + log_info("/* ignore && honour_argv0 */"); r = config_parse_exec(NULL, "fake", 4, "section", 1, - "LValue", 0, "-@/RValue///slashes3/// argv0a r1", + "LValue", 0, "-@/RValue///slashes3 argv0a r1", &c, NULL); assert_se(r >= 0); c1 = c1->command_next; - check_execcommand(c1, - "/RValue/slashes3", "argv0a", "r1", true); + check_execcommand(c1, "/RValue/slashes3", "argv0a", "r1", NULL, true); - /* ignore && honour_argv0 */ + log_info("/* ignore && honour_argv0 */"); r = config_parse_exec(NULL, "fake", 4, "section", 1, - "LValue", 0, "@-/RValue///slashes4/// argv0b r1", + "LValue", 0, "@-/RValue///slashes4 argv0b r1", &c, NULL); assert_se(r >= 0); c1 = c1->command_next; - check_execcommand(c1, - "/RValue/slashes4", "argv0b", "r1", true); + check_execcommand(c1, "/RValue/slashes4", "argv0b", "r1", NULL, true); - /* ignore && ignore */ + log_info("/* ignore && ignore */"); r = config_parse_exec(NULL, "fake", 4, "section", 1, "LValue", 0, "--/RValue argv0 r1", &c, NULL); assert_se(r == 0); assert_se(c1->command_next == NULL); - /* ignore && ignore */ + log_info("/* ignore && ignore (2) */"); r = config_parse_exec(NULL, "fake", 4, "section", 1, "LValue", 0, "-@-/RValue argv0 r1", &c, NULL); assert_se(r == 0); assert_se(c1->command_next == NULL); - /* semicolon */ + log_info("/* semicolon */"); r = config_parse_exec(NULL, "fake", 5, "section", 1, "LValue", 0, "-@/RValue argv0 r1 ; " @@ -161,34 +189,119 @@ static void test_config_parse_exec(void) { &c, NULL); assert_se(r >= 0); c1 = c1->command_next; + check_execcommand(c1, "/RValue", "argv0", "r1", NULL, true); + + c1 = c1->command_next; + check_execcommand(c1, "/goo/goo", NULL, "boo", NULL, false); + + log_info("/* trailing semicolon */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "-@/RValue argv0 r1 ; ", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; + check_execcommand(c1, "/RValue", "argv0", "r1", NULL, true); + + assert_se(c1->command_next == NULL); + + log_info("/* escaped semicolon */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "/bin/find \\;", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; + check_execcommand(c1, "/bin/find", NULL, ";", NULL, false); + + log_info("/* escaped semicolon with following arg */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "/sbin/find \\; x", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; check_execcommand(c1, - "/RValue", "argv0", "r1", true); + "/sbin/find", NULL, ";", "x", false); + log_info("/* spaces in the filename */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "\"/PATH WITH SPACES/daemon\" -1 -2", + &c, NULL); + assert_se(r >= 0); c1 = c1->command_next; check_execcommand(c1, - "/goo/goo", "/goo/goo", "boo", false); + "/PATH WITH SPACES/daemon", NULL, "-1", "-2", false); - /* trailing semicolon */ + log_info("/* spaces in the filename, no args */"); r = config_parse_exec(NULL, "fake", 5, "section", 1, "LValue", 0, - "-@/RValue argv0 r1 ; ", + "\"/PATH WITH SPACES/daemon -1 -2\"", &c, NULL); assert_se(r >= 0); c1 = c1->command_next; check_execcommand(c1, - "/RValue", "argv0", "r1", true); + "/PATH WITH SPACES/daemon -1 -2", NULL, NULL, NULL, false); - assert_se(c1->command_next == NULL); + log_info("/* spaces in the filename, everything quoted */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "\"/PATH WITH SPACES/daemon\" \"-1\" '-2'", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; + check_execcommand(c1, + "/PATH WITH SPACES/daemon", NULL, "-1", "-2", false); - /* escaped semicolon */ + log_info("/* escaped spaces in the filename */"); r = config_parse_exec(NULL, "fake", 5, "section", 1, "LValue", 0, - "/usr/bin/find \\;", + "\"/PATH\\sWITH\\sSPACES/daemon\" '-1 -2'", &c, NULL); assert_se(r >= 0); c1 = c1->command_next; check_execcommand(c1, - "/usr/bin/find", "/usr/bin/find", ";", false); + "/PATH WITH SPACES/daemon", NULL, "-1 -2", NULL, false); + + log_info("/* escaped spaces in the filename (2) */"); + r = config_parse_exec(NULL, "fake", 5, "section", 1, + "LValue", 0, + "\"/PATH\\x20WITH\\x20SPACES/daemon\" \"-1 -2\"", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; + check_execcommand(c1, + "/PATH WITH SPACES/daemon", NULL, "-1 -2", NULL, false); + + for (ccc = "abfnrtv\\\'\"x"; *ccc; ccc++) { + /* \\x is an incomplete hexadecimal sequence, invalid because of the slash */ + char path[] = "/path\\X"; + path[sizeof(path) - 2] = *ccc; + + log_info("/* invalid character: \\%c */", *ccc); + r = config_parse_exec(NULL, "fake", 4, "section", 1, + "LValue", 0, path, + &c, NULL); + assert_se(r == 0); + assert_se(c1->command_next == NULL); + } + + log_info("/* valid character: \\s */"); + r = config_parse_exec(NULL, "fake", 4, "section", 1, + "LValue", 0, "/path\\s", + &c, NULL); + assert_se(r >= 0); + c1 = c1->command_next; + check_execcommand(c1, "/path ", NULL, NULL, NULL, false); + + log_info("/* trailing backslash: \\ */"); + /* backslash is invalid */ + r = config_parse_exec(NULL, "fake", 4, "section", 1, + "LValue", 0, "/path\\", + &c, NULL); + assert_se(r == 0); + assert_se(c1->command_next == NULL); exec_command_free_list(c); } diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index ab6c488cf..5c7f8b40f 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -159,6 +159,7 @@ static int test_unit_printf(void) { /* normal unit */ expect(u, "%n", "blah.service"); + expect(u, "%f", "/blah"); expect(u, "%N", "blah"); expect(u, "%p", "blah"); expect(u, "%P", "blah"); @@ -178,6 +179,7 @@ static int test_unit_printf(void) { expect(u2, "%n", "blah@foo-foo.service"); expect(u2, "%N", "blah@foo-foo"); + expect(u2, "%f", "/foo/foo"); expect(u2, "%p", "blah"); expect(u2, "%P", "blah"); expect(u2, "%i", "foo-foo"); @@ -191,6 +193,7 @@ static int test_unit_printf(void) { expect(u2, "%t", "/run/user/*"); manager_free(m); +#undef expect return 0; } @@ -260,6 +263,7 @@ static void test_unit_name_is_instance(void) { assert_se(unit_name_is_instance("a-c_c01Aj@b05Dii_-oioi.service")); assert_se(!unit_name_is_instance("a.service")); + assert_se(!unit_name_is_instance("a@.service")); assert_se(!unit_name_is_instance("junk")); assert_se(!unit_name_is_instance("")); } @@ -291,6 +295,11 @@ static void test_unit_name_to_instance(void) { assert_se(streq(instance, "bar")); free(instance); + r = unit_name_to_instance("foo@.service", &instance); + assert_se(r >= 0); + assert_se(streq(instance, "")); + free(instance); + r = unit_name_to_instance("fo0-stUff_b@b.e", &instance); assert_se(r >= 0); assert_se(streq(instance, "b")); @@ -302,6 +311,9 @@ static void test_unit_name_to_instance(void) { r = unit_name_to_instance("fooj@unk", &instance); assert_se(r < 0); + + r = unit_name_to_instance("foo@", &instance); + assert_se(r < 0); } static void test_unit_name_escape(void) { @@ -312,6 +324,29 @@ static void test_unit_name_escape(void) { assert_se(streq(r, "ab\\x2b\\x2dc.a-bc\\x40foo.service")); } +static void test_unit_name_template(void) { +#define expect(name, expected) \ + { \ + _cleanup_free_ char *f = NULL; \ + f = unit_name_template(name); \ + assert_se(f); \ + printf("got: %s, expected: %s\n", f, expected); \ + assert_se(streq(f, expected)); \ + } + expect("foo@bar.service", "foo@.service") + expect("foo.mount", "foo.mount") +#undef expect +} + +static void test_unit_name_is_template(void) { + assert_se(unit_name_is_template("foo@.service")); + assert_se(unit_name_is_template("bar@.path")); + + assert_se(!unit_name_is_template("bar@i.mount")); + assert_se(!unit_name_is_template("bar@foobbbb.service")); + assert_se(!unit_name_is_template("barfoo.service")); +} + int main(int argc, char* argv[]) { int rc = 0; test_replacements(); @@ -324,6 +359,8 @@ int main(int argc, char* argv[]) { test_build_subslice(); test_unit_name_to_instance(); test_unit_name_escape(); + test_unit_name_template(); + test_unit_name_is_template(); return rc; } diff --git a/src/test/test-utf8.c b/src/test/test-utf8.c index 3399f2ba9..befa38575 100644 --- a/src/test/test-utf8.c +++ b/src/test/test-utf8.c @@ -93,6 +93,18 @@ static void test_utf8_escaping_printable(void) { assert_se(utf8_is_valid(p6)); } +static void test_utf16_to_utf8(void) { + char *a = NULL; + const uint16_t utf16[] = { 'a', 0xd800, 'b', 0xdc00, 'c', 0xd801, 0xdc37 }; + const char utf8[] = { 'a', 'b', 'c', 0xf0, 0x90, 0x90, 0xb7, 0 }; + + a = utf16_to_utf8(utf16, 14); + assert_se(a); + assert_se(streq(a, utf8)); + + free(a); +} + int main(int argc, char *argv[]) { test_utf8_is_valid(); test_utf8_is_printable(); @@ -100,6 +112,7 @@ int main(int argc, char *argv[]) { test_utf8_encoded_valid_unichar(); test_utf8_escaping(); test_utf8_escaping_printable(); + test_utf16_to_utf8(); return 0; } diff --git a/src/test/test-util.c b/src/test/test-util.c index fe54586ee..9515a8cbf 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -145,6 +145,39 @@ static void test_alloca(void) { assert_se(!memcmp(t, zero, 997)); } +static void test_div_round_up(void) { + int div; + + /* basic tests */ + assert_se(DIV_ROUND_UP(0, 8) == 0); + assert_se(DIV_ROUND_UP(1, 8) == 1); + assert_se(DIV_ROUND_UP(8, 8) == 1); + assert_se(DIV_ROUND_UP(12, 8) == 2); + assert_se(DIV_ROUND_UP(16, 8) == 2); + + /* test multiple evaluation */ + div = 0; + assert_se(DIV_ROUND_UP(div++, 8) == 0 && div == 1); + assert_se(DIV_ROUND_UP(++div, 8) == 1 && div == 2); + assert_se(DIV_ROUND_UP(8, div++) == 4 && div == 3); + assert_se(DIV_ROUND_UP(8, ++div) == 2 && div == 4); + + /* overflow test with exact division */ + assert_se(sizeof(0U) == 4); + assert_se(0xfffffffaU % 10U == 0U); + assert_se(0xfffffffaU / 10U == 429496729U); + assert_se(DIV_ROUND_UP(0xfffffffaU, 10U) == 429496729U); + assert_se((0xfffffffaU + 10U - 1U) / 10U == 0U); + assert_se(0xfffffffaU / 10U + !!(0xfffffffaU % 10U) == 429496729U); + + /* overflow test with rounded division */ + assert_se(0xfffffffdU % 10U == 3U); + assert_se(0xfffffffdU / 10U == 429496729U); + assert_se(DIV_ROUND_UP(0xfffffffdU, 10U) == 429496730U); + assert_se((0xfffffffdU + 10U - 1U) / 10U == 0U); + assert_se(0xfffffffdU / 10U + !!(0xfffffffdU % 10U) == 429496730U); +} + static void test_first_word(void) { assert_se(first_word("Hello", "")); assert_se(first_word("Hello", "Hello")); @@ -383,8 +416,24 @@ static void test_cescape(void) { static void test_cunescape(void) { _cleanup_free_ char *unescaped; - assert_se(unescaped = cunescape("abc\\\\\\\"\\b\\f\\a\\n\\r\\t\\v\\003\\177\\234\\313\\000\\x00")); - assert_se(streq(unescaped, "abc\\\"\b\f\a\n\r\t\v\003\177\234\313\\000\\x00")); + unescaped = cunescape("abc\\\\\\\"\\b\\f\\a\\n\\r\\t\\v\\003\\177\\234\\313\\000\\x00"); + assert_se(streq_ptr(unescaped, "abc\\\"\b\f\a\n\r\t\v\003\177\234\313\\000\\x00")); + + /* incomplete sequences */ + unescaped = cunescape("\\x0"); + assert_se(streq_ptr(unescaped, "\\x0")); + + unescaped = cunescape("\\x"); + assert_se(streq_ptr(unescaped, "\\x")); + + unescaped = cunescape("\\"); + assert_se(streq_ptr(unescaped, "\\")); + + unescaped = cunescape("\\11"); + assert_se(streq_ptr(unescaped, "\\11")); + + unescaped = cunescape("\\1"); + assert_se(streq_ptr(unescaped, "\\1")); } static void test_foreach_word(void) { @@ -406,28 +455,12 @@ static void test_foreach_word(void) { assert_se(strneq(expected[i++], word, l)); } -static void test_foreach_word_quoted(void) { +static void check(const char *test, char** expected, bool trailing) { const char *word, *state; size_t l; int i = 0; - const char test[] = "test a b c 'd' e '' '' hhh '' '' \"a b c\""; - const char * const expected[] = { - "test", - "a", - "b", - "c", - "d", - "e", - "", - "", - "hhh", - "", - "", - "a b c", - NULL - }; - printf("<%s>\n", test); + printf("<<<%s>>>\n", test); FOREACH_WORD_QUOTED(word, l, test, state) { _cleanup_free_ char *t = NULL; @@ -435,7 +468,34 @@ static void test_foreach_word_quoted(void) { assert_se(strneq(expected[i++], word, l)); printf("<%s>\n", t); } - assert_se(isempty(state)); + printf("<<<%s>>>\n", state); + assert_se(expected[i] == NULL); + assert_se(isempty(state) == !trailing); +} + +static void test_foreach_word_quoted(void) { + check("test a b c 'd' e '' '' hhh '' '' \"a b c\"", + STRV_MAKE("test", + "a", + "b", + "c", + "d", + "e", + "", + "", + "hhh", + "", + "", + "a b c"), + false); + + check("test \"xxx", + STRV_MAKE("test"), + true); + + check("test\\", + STRV_MAKE_EMPTY, + true); } static void test_default_term_for_tty(void) { @@ -543,7 +603,7 @@ static void test_get_process_comm(void) { r = get_process_environ(me, &env); assert_se(r >= 0 || r == -EACCES); - log_info("self strlen(environ): '%zd'", strlen(env)); + log_info("self strlen(environ): '%zu'", strlen(env)); if (!detect_container(NULL)) assert_se(get_ctty_devnr(1, &h) == -ENOENT); @@ -802,24 +862,24 @@ static void test_foreach_string(void) { assert_se(streq(x, "zzz")); } -static void test_filename_is_safe(void) { +static void test_filename_is_valid(void) { char foo[FILENAME_MAX+2]; int i; - assert_se(!filename_is_safe("")); - assert_se(!filename_is_safe("/bar/foo")); - assert_se(!filename_is_safe("/")); - assert_se(!filename_is_safe(".")); - assert_se(!filename_is_safe("..")); + assert_se(!filename_is_valid("")); + assert_se(!filename_is_valid("/bar/foo")); + assert_se(!filename_is_valid("/")); + assert_se(!filename_is_valid(".")); + assert_se(!filename_is_valid("..")); for (i=0; i= 0); - assert_se(write_string_file(name, "#!/bin/sh\necho 'Executing '$0\ntouch /tmp/test-execute_directory/it_works") == 0); - assert_se(write_string_file(name2, "#!/bin/sh\necho 'Executing '$0\ntouch /tmp/test-execute_directory/it_works2") == 0); + char template_lo[] = "/tmp/test-readlink_and_make_absolute-lo.XXXXXXX"; + char template_hi[] = "/tmp/test-readlink_and_make_absolute-hi.XXXXXXX"; + const char * dirs[] = {template_hi, template_lo, NULL}; + const char *name, *name2, *name3, *overridden, *override, *masked, *mask; + + assert_se(mkdtemp(template_lo)); + assert_se(mkdtemp(template_hi)); + + name = strjoina(template_lo, "/script"); + name2 = strjoina(template_hi, "/script2"); + name3 = strjoina(template_lo, "/useless"); + overridden = strjoina(template_lo, "/overridden"); + override = strjoina(template_hi, "/overridden"); + masked = strjoina(template_lo, "/masked"); + mask = strjoina(template_hi, "/masked"); + + assert_se(write_string_file(name, "#!/bin/sh\necho 'Executing '$0\ntouch $(dirname $0)/it_works") == 0); + assert_se(write_string_file(name2, "#!/bin/sh\necho 'Executing '$0\ntouch $(dirname $0)/it_works2") == 0); + assert_se(write_string_file(overridden, "#!/bin/sh\necho 'Executing '$0\ntouch $(dirname $0)/failed") == 0); + assert_se(write_string_file(override, "#!/bin/sh\necho 'Executing '$0") == 0); + assert_se(write_string_file(masked, "#!/bin/sh\necho 'Executing '$0\ntouch $(dirname $0)/failed") == 0); + assert_se(symlink("/dev/null", mask) == 0); assert_se(chmod(name, 0755) == 0); assert_se(chmod(name2, 0755) == 0); + assert_se(chmod(overridden, 0755) == 0); + assert_se(chmod(override, 0755) == 0); + assert_se(chmod(masked, 0755) == 0); assert_se(touch(name3) >= 0); - execute_directory(tempdir, NULL, DEFAULT_TIMEOUT_USEC, NULL); - assert_se(access("/tmp/test-execute_directory/it_works", F_OK) >= 0); - assert_se(access("/tmp/test-execute_directory/it_works2", F_OK) >= 0); + execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL); + + assert_se(chdir(template_lo) == 0); + assert_se(access("it_works", F_OK) >= 0); + assert_se(access("failed", F_OK) < 0); - rm_rf_dangerous(tempdir, false, true, false); + assert_se(chdir(template_hi) == 0); + assert_se(access("it_works2", F_OK) >= 0); + assert_se(access("failed", F_OK) < 0); + + rm_rf_dangerous(template_lo, false, true, false); + rm_rf_dangerous(template_hi, false, true, false); } static void test_unquote_first_word(void) { @@ -1312,6 +1408,110 @@ static void test_parse_proc_cmdline(void) { assert_se(parse_proc_cmdline(parse_item) >= 0); } +static void test_raw_clone(void) { + pid_t parent, pid, pid2; + + parent = getpid(); + log_info("before clone: getpid()→"PID_FMT, parent); + assert_se(raw_getpid() == parent); + + pid = raw_clone(0, NULL); + assert_se(pid >= 0); + + pid2 = raw_getpid(); + log_info("raw_clone: "PID_FMT" getpid()→"PID_FMT" raw_getpid()→"PID_FMT, + pid, getpid(), pid2); + if (pid == 0) { + assert_se(pid2 != parent); + _exit(EXIT_SUCCESS); + } else { + int status; + + assert_se(pid2 == parent); + waitpid(pid, &status, __WCLONE); + assert_se(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS); + } +} + +static void test_same_fd(void) { + _cleanup_close_pair_ int p[2] = { -1, -1 }; + _cleanup_close_ int a = -1, b = -1, c = -1; + + assert_se(pipe2(p, O_CLOEXEC) >= 0); + assert_se((a = dup(p[0])) >= 0); + assert_se((b = open("/dev/null", O_RDONLY|O_CLOEXEC)) >= 0); + assert_se((c = dup(a)) >= 0); + + assert_se(same_fd(p[0], p[0]) > 0); + assert_se(same_fd(p[1], p[1]) > 0); + assert_se(same_fd(a, a) > 0); + assert_se(same_fd(b, b) > 0); + + assert_se(same_fd(a, p[0]) > 0); + assert_se(same_fd(p[0], a) > 0); + assert_se(same_fd(c, p[0]) > 0); + assert_se(same_fd(p[0], c) > 0); + assert_se(same_fd(a, c) > 0); + assert_se(same_fd(c, a) > 0); + + assert_se(same_fd(p[0], p[1]) == 0); + assert_se(same_fd(p[1], p[0]) == 0); + assert_se(same_fd(p[0], b) == 0); + assert_se(same_fd(b, p[0]) == 0); + assert_se(same_fd(p[1], a) == 0); + assert_se(same_fd(a, p[1]) == 0); + assert_se(same_fd(p[1], b) == 0); + assert_se(same_fd(b, p[1]) == 0); + + assert_se(same_fd(a, b) == 0); + assert_se(same_fd(b, a) == 0); +} + +static void test_uid_ptr(void) { + + assert_se(UID_TO_PTR(0) != NULL); + assert_se(UID_TO_PTR(1000) != NULL); + + assert_se(PTR_TO_UID(UID_TO_PTR(0)) == 0); + assert_se(PTR_TO_UID(UID_TO_PTR(1000)) == 1000); +} + +static void test_sparse_write_one(int fd, const char *buffer, size_t n) { + char check[n]; + + assert_se(lseek(fd, 0, SEEK_SET) == 0); + assert_se(ftruncate(fd, 0) >= 0); + assert_se(sparse_write(fd, buffer, n, 4) == (ssize_t) n); + + assert_se(lseek(fd, 0, SEEK_CUR) == (off_t) n); + assert_se(ftruncate(fd, n) >= 0); + + assert_se(lseek(fd, 0, SEEK_SET) == 0); + assert_se(read(fd, check, n) == (ssize_t) n); + + assert_se(memcmp(buffer, check, n) == 0); +} + +static void test_sparse_write(void) { + const char test_a[] = "test"; + const char test_b[] = "\0\0\0\0test\0\0\0\0"; + const char test_c[] = "\0\0test\0\0\0\0"; + const char test_d[] = "\0\0test\0\0\0test\0\0\0\0test\0\0\0\0\0test\0\0\0test\0\0\0\0test\0\0\0\0\0\0\0\0"; + const char test_e[] = "test\0\0\0\0test"; + _cleanup_close_ int fd = -1; + char fn[] = "/tmp/sparseXXXXXX"; + + fd = mkostemp(fn, O_CLOEXEC); + assert_se(fd >= 0); + unlink(fn); + + test_sparse_write_one(fd, test_a, sizeof(test_a)); + test_sparse_write_one(fd, test_b, sizeof(test_b)); + test_sparse_write_one(fd, test_c, sizeof(test_c)); + test_sparse_write_one(fd, test_d, sizeof(test_d)); + test_sparse_write_one(fd, test_e, sizeof(test_e)); +} + int main(int argc, char *argv[]) { log_parse_environment(); log_open(); @@ -1321,6 +1521,7 @@ int main(int argc, char *argv[]) { test_max(); test_container_of(); test_alloca(); + test_div_round_up(); test_first_word(); test_close_many(); test_parse_boolean(); @@ -1360,7 +1561,7 @@ int main(int argc, char *argv[]) { test_hexdump(); test_log2i(); test_foreach_string(); - test_filename_is_safe(); + test_filename_is_valid(); test_string_has_cc(); test_ascii_strlower(); test_files_same(); @@ -1373,7 +1574,7 @@ int main(int argc, char *argv[]) { test_read_one_char(); test_ignore_signals(); test_strshorten(); - test_strappenda(); + test_strjoina(); test_is_symlink(); test_pid_is_unwaited(); test_pid_is_alive(); @@ -1384,6 +1585,10 @@ int main(int argc, char *argv[]) { test_unquote_first_word(); test_unquote_many_words(); test_parse_proc_cmdline(); + test_raw_clone(); + test_same_fd(); + test_uid_ptr(); + test_sparse_write(); return 0; } diff --git a/src/test/test-verbs.c b/src/test/test-verbs.c new file mode 100644 index 000000000..0fcdd9e78 --- /dev/null +++ b/src/test/test-verbs.c @@ -0,0 +1,78 @@ +/*** + This file is part of systemd. + + Copyright 2014 systemd developers + + systemd is free software; you can redistribute it and/or modify it + 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 . +***/ + +#include "macro.h" +#include "strv.h" +#include "verbs.h" + +static int noop_dispatcher(int argc, char *argv[], void *userdata) { + return 0; +} + +#define test_dispatch_one(argv, verbs, expected) \ + optind = 0; \ + assert_se(dispatch_verb(strv_length(argv), argv, verbs, NULL) == expected); + +static void test_verbs(void) { + static const Verb verbs[] = { + { "help", VERB_ANY, VERB_ANY, 0, noop_dispatcher }, + { "list-images", VERB_ANY, 1, 0, noop_dispatcher }, + { "list", VERB_ANY, 2, VERB_DEFAULT, noop_dispatcher }, + { "status", 2, VERB_ANY, 0, noop_dispatcher }, + { "show", VERB_ANY, VERB_ANY, 0, noop_dispatcher }, + { "terminate", 2, VERB_ANY, 0, noop_dispatcher }, + { "login", 2, 2, 0, noop_dispatcher }, + { "copy-to", 3, 4, 0, noop_dispatcher }, + {} + }; + + /* not found */ + test_dispatch_one(STRV_MAKE("command-not-found"), verbs, -EINVAL); + + /* found */ + test_dispatch_one(STRV_MAKE("show"), verbs, 0); + + /* found, too few args */ + test_dispatch_one(STRV_MAKE("copy-to", "foo"), verbs, -EINVAL); + + /* found, meets min args */ + test_dispatch_one(STRV_MAKE("status", "foo", "bar"), verbs, 0); + + /* found, too many args */ + test_dispatch_one(STRV_MAKE("copy-to", "foo", "bar", "baz", "quux", "qaax"), verbs, -EINVAL); + + /* no verb, but a default is set */ + test_dispatch_one(STRV_MAKE_EMPTY, verbs, 0); +} + +static void test_verbs_no_default(void) { + static const Verb verbs[] = { + { "help", VERB_ANY, VERB_ANY, 0, noop_dispatcher }, + {}, + }; + + test_dispatch_one(STRV_MAKE(NULL), verbs, -EINVAL); +} + +int main(int argc, char *argv[]) { + test_verbs(); + test_verbs_no_default(); + + return 0; +} diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 49196ca79..4d8988673 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -123,15 +123,11 @@ static void print_status_info(const StatusInfo *i) { fprintf(stderr, "Warning: Could not get time from timedated and not operating locally.\n\n"); if (have_time) { - zero(tm); - assert_se(strftime(a, sizeof(a), "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm)) > 0); - char_array_0(a); - printf(" Local time: %s\n", a); - - zero(tm); - assert_se(strftime(a, sizeof(a), "%a %Y-%m-%d %H:%M:%S UTC", gmtime_r(&sec, &tm)) > 0); - char_array_0(a); - printf(" Universal time: %s\n", a); + xstrftime(a, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm)); + printf(" Local time: %.*s\n", (int) sizeof(a), a); + + xstrftime(a, "%a %Y-%m-%d %H:%M:%S UTC", gmtime_r(&sec, &tm)); + printf(" Universal time: %.*s\n", (int) sizeof(a), a); } else { printf(" Local time: %s\n", "n/a"); printf(" Universal time: %s\n", "n/a"); @@ -141,24 +137,19 @@ static void print_status_info(const StatusInfo *i) { time_t rtc_sec; rtc_sec = (time_t)(i->rtc_time / USEC_PER_SEC); - zero(tm); - assert_se(strftime(a, sizeof(a), "%a %Y-%m-%d %H:%M:%S", gmtime_r(&rtc_sec, &tm)) > 0); - char_array_0(a); - printf(" RTC time: %s\n", a); + xstrftime(a, "%a %Y-%m-%d %H:%M:%S", gmtime_r(&rtc_sec, &tm)); + printf(" RTC time: %.*s\n", (int) sizeof(a), a); } else printf(" RTC time: %s\n", "n/a"); - if (have_time) { - zero(tm); - assert_se(strftime(a, sizeof(a), "%Z, %z", localtime_r(&sec, &tm)) > 0); - char_array_0(a); - } + if (have_time) + xstrftime(a, "%Z, %z", localtime_r(&sec, &tm)); - printf(" Time zone: %s (%s)\n" + printf(" Time zone: %s (%.*s)\n" " NTP enabled: %s\n" "NTP synchronized: %s\n" " RTC in local TZ: %s\n", - strna(i->timezone), have_time ? a : "n/a", + strna(i->timezone), (int) sizeof(a), have_time ? a : "n/a", i->ntp_capable ? yes_no(i->ntp_enabled) : "n/a", yes_no(i->ntp_synced), yes_no(i->rtc_local)); @@ -173,30 +164,26 @@ static void print_status_info(const StatusInfo *i) { printf(" DST active: %s\n", yes_no(is_dstc)); t = tc - 1; - zero(tm); - assert_se(strftime(a, sizeof(a), "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&t, &tm)) > 0); - char_array_0(a); + xstrftime(a, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&t, &tm)); - zero(tm); - assert_se(strftime(b, sizeof(b), "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&tc, &tm)) > 0); - char_array_0(b); + xstrftime(b, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&tc, &tm)); printf(" Last DST change: DST %s at\n" - " %s\n" - " %s\n", - is_dstc ? "began" : "ended", a, b); + " %.*s\n" + " %.*s\n", + is_dstc ? "began" : "ended", + (int) sizeof(a), a, + (int) sizeof(b), b); t = tn - 1; - zero(tm); - assert_se(strftime(a, sizeof(a), "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&t, &tm)) > 0); - char_array_0(a); - - zero(tm); - assert_se(strftime(b, sizeof(b), "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&tn, &tm)) > 0); - char_array_0(b); + xstrftime(a, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&t, &tm)); + xstrftime(b, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&tn, &tm)); printf(" Next DST change: DST %s (the clock jumps %s) at\n" - " %s\n" - " %s\n", - is_dstn ? "begins" : "ends", jump_str(dn, s, sizeof(s)), a, b); + " %.*s\n" + " %.*s\n", + is_dstn ? "begins" : "ends", + jump_str(dn, s, sizeof(s)), + (int) sizeof(a), a, + (int) sizeof(b), b); } } else printf(" DST active: %s\n", yes_no(is_dstc)); @@ -436,7 +423,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index bf567a162..753c3d1d6 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "sd-id128.h" #include "sd-messages.h" @@ -41,6 +40,7 @@ #include "bus-error.h" #include "bus-common-errors.h" #include "event-util.h" +#include "selinux-util.h" #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n" #define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n" diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index ef5854d07..73ac7eecb 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -98,7 +98,7 @@ * "NTP timestamps are represented as a 64-bit unsigned fixed-point number, * in seconds relative to 0h on 1 January 1900." */ -#define OFFSET_1900_1970 2208988800UL +#define OFFSET_1900_1970 UINT64_C(2208988800) #define RETRY_USEC (30*USEC_PER_SEC) #define RATELIMIT_INTERVAL_USEC (10*USEC_PER_SEC) @@ -147,10 +147,6 @@ static double ts_to_d(const struct timespec *ts) { return ts->tv_sec + (1.0e-9 * ts->tv_nsec); } -static double square(double d) { - return d * d; -} - static int manager_timeout(sd_event_source *source, usec_t usec, void *userdata) { _cleanup_free_ char *pretty = NULL; Manager *m = userdata; @@ -289,7 +285,7 @@ static int manager_clock_watch(sd_event_source *source, int fd, uint32_t revents } /* resync */ - log_info("System time changed. Resyncing."); + log_debug("System time changed. Resyncing."); m->poll_resync = true; return manager_send_request(m); @@ -428,7 +424,7 @@ static bool manager_sample_spike_detection(Manager *m, double offset, double del j = 0; for (i = 0; i < ELEMENTSOF(m->samples); i++) - j += square(m->samples[i].offset - m->samples[idx_min].offset); + j += pow(m->samples[i].offset - m->samples[idx_min].offset, 2); m->samples_jitter = sqrt(j / (ELEMENTSOF(m->samples) - 1)); /* ignore samples when resyncing */ @@ -529,7 +525,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re return manager_connect(m); } - if (iov.iov_len < sizeof(struct ntp_msg)) { + /* Too short or too long packet? */ + if (iov.iov_len < sizeof(struct ntp_msg) || (msghdr.msg_flags & MSG_TRUNC)) { log_warning("Invalid response from server. Disconnecting."); return manager_connect(m); } @@ -679,9 +676,9 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re log_error_errno(errno, "Failed to call clock_adjtime(): %m"); } - log_info("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+ippm%s", - m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_ppm, - spike ? " (ignored)" : ""); + log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+ippm%s", + m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_ppm, + spike ? " (ignored)" : ""); r = manager_arm_timer(m, m->poll_interval_usec); if (r < 0) @@ -743,7 +740,7 @@ static int manager_begin(Manager *m) { m->poll_interval_usec = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC; server_address_pretty(m->current_server_address, &pretty); - log_info("Using NTP server %s (%s).", strna(pretty), m->current_server_name->string); + log_debug("Using NTP server %s (%s).", strna(pretty), m->current_server_name->string); sd_notifyf(false, "STATUS=Using Time Server %s (%s).", strna(pretty), m->current_server_name->string); r = manager_clock_watch_setup(m); diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index f7e089fc0..2a73dac03 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -113,6 +113,10 @@ int main(int argc, char *argv[]) { if (r < 0) goto finish; + /* We need one process for ourselves, plus one thread for the asynchronous resolver */ + if (setrlimit(RLIMIT_NPROC, &RLIMIT_MAKE_CONST(2)) < 0) + log_warning_errno(errno, "Failed to lower RLIMIT_NPROC to 2: %m"); + assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0); r = manager_new(&m); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index d40bd96f1..c948d4d21 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -4,6 +4,7 @@ This file is part of systemd. Copyright 2010 Lennart Poettering, Kay Sievers + Copyright 2015 Zbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -23,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -34,11 +34,11 @@ #include #include #include -#include -#include #include #include -#include +#include +#include +#include #include #include "log.h" @@ -55,6 +55,9 @@ #include "specifier.h" #include "build.h" #include "copy.h" +#include "selinux-util.h" +#include "btrfs-util.h" +#include "acl-util.h" /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates * them in the file system. This is intended to be used to create @@ -67,14 +70,18 @@ typedef enum ItemType { TRUNCATE_FILE = 'F', CREATE_DIRECTORY = 'd', TRUNCATE_DIRECTORY = 'D', + CREATE_SUBVOLUME = 'v', CREATE_FIFO = 'p', CREATE_SYMLINK = 'L', CREATE_CHAR_DEVICE = 'c', CREATE_BLOCK_DEVICE = 'b', COPY_FILES = 'C', - SET_XATTR = 't', /* These ones take globs */ + SET_XATTR = 't', + RECURSIVE_SET_XATTR = 'T', + SET_ACL = 'a', + RECURSIVE_SET_ACL = 'A', WRITE_FILE = 'w', IGNORE_PATH = 'x', IGNORE_DIRECTORY_PATH = 'X', @@ -91,6 +98,10 @@ typedef struct Item { char *path; char *argument; char **xattrs; +#ifdef HAVE_ACL + acl_t acl_access; + acl_t acl_default; +#endif uid_t uid; gid_t gid; mode_t mode; @@ -111,6 +122,12 @@ typedef struct Item { bool done:1; } Item; +typedef struct ItemArray { + Item *items; + size_t count; + size_t size; +} ItemArray; + static bool arg_create = false; static bool arg_clean = false; static bool arg_remove = false; @@ -136,16 +153,47 @@ static bool needs_glob(ItemType t) { RECURSIVE_REMOVE_PATH, ADJUST_MODE, RELABEL_PATH, - RECURSIVE_RELABEL_PATH); + RECURSIVE_RELABEL_PATH, + SET_XATTR, + RECURSIVE_SET_XATTR, + SET_ACL, + RECURSIVE_SET_ACL); +} + +static bool takes_ownership(ItemType t) { + return IN_SET(t, + CREATE_FILE, + TRUNCATE_FILE, + CREATE_DIRECTORY, + TRUNCATE_DIRECTORY, + CREATE_SUBVOLUME, + CREATE_FIFO, + CREATE_SYMLINK, + CREATE_CHAR_DEVICE, + CREATE_BLOCK_DEVICE, + COPY_FILES, + + WRITE_FILE, + IGNORE_PATH, + IGNORE_DIRECTORY_PATH, + REMOVE_PATH, + RECURSIVE_REMOVE_PATH); } static struct Item* find_glob(Hashmap *h, const char *match) { - Item *j; + ItemArray *j; Iterator i; - HASHMAP_FOREACH(j, h, i) - if (fnmatch(j->path, match, FNM_PATHNAME|FNM_PERIOD) == 0) - return j; + HASHMAP_FOREACH(j, h, i) { + unsigned n; + + for (n = 0; n < j->count; n++) { + Item *item = j->items + n; + + if (fnmatch(item->path, match, FNM_PATHNAME|FNM_PERIOD) == 0) + return item; + } + } return NULL; } @@ -228,10 +276,7 @@ static bool unix_socket_alive(const char *fn) { static int dir_is_mount_point(DIR *d, const char *subdir) { - union file_handle_union h = { - .handle.handle_bytes = MAX_HANDLE_SZ - }; - + union file_handle_union h = FILE_HANDLE_INIT; int mount_id_parent, mount_id; int r_p, r; @@ -263,6 +308,28 @@ static int dir_is_mount_point(DIR *d, const char *subdir) { return r; } +static DIR* xopendirat_nomod(int dirfd, const char *path) { + DIR *dir; + + dir = xopendirat(dirfd, path, O_NOFOLLOW|O_NOATIME); + if (!dir) { + log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", + dirfd == AT_FDCWD ? "" : "sub", path); + if (errno == EPERM) { + dir = xopendirat(dirfd, path, O_NOFOLLOW); + if (!dir) + log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", + dirfd == AT_FDCWD ? "" : "sub", path); + } + } + + return dir; +} + +static DIR* opendir_nomod(const char *path) { + return xopendirat_nomod(AT_FDCWD, path); +} + static int dir_cleanup( Item *i, const char *p, @@ -284,8 +351,7 @@ static int dir_cleanup( usec_t age; _cleanup_free_ char *sub_path = NULL; - if (streq(dent->d_name, ".") || - streq(dent->d_name, "..")) + if (STR_IN_SET(dent->d_name, ".", "..")) continue; if (fstatat(dirfd(d), dent->d_name, &s, AT_SYMLINK_NOFOLLOW) < 0) { @@ -302,18 +368,25 @@ static int dir_cleanup( } /* Stay on the same filesystem */ - if (s.st_dev != rootdev) + if (s.st_dev != rootdev) { + log_debug("Ignoring \"%s/%s\": different filesystem.", p, dent->d_name); continue; + } /* Try to detect bind mounts of the same filesystem instance; they * do not differ in device major/minors. This type of query is not * supported on all kernels or filesystem types though. */ - if (S_ISDIR(s.st_mode) && dir_is_mount_point(d, dent->d_name) > 0) + if (S_ISDIR(s.st_mode) && dir_is_mount_point(d, dent->d_name) > 0) { + log_debug("Ignoring \"%s/%s\": different mount of the same filesystem.", + p, dent->d_name); continue; + } /* Do not delete read-only files owned by root */ - if (s.st_uid == 0 && !(s.st_mode & S_IWUSR)) + if (s.st_uid == 0 && !(s.st_mode & S_IWUSR)) { + log_debug("Ignoring \"%s/%s\": read-only and owner by root.", p, dent->d_name); continue; + } sub_path = strjoin(p, "/", dent->d_name, NULL); if (!sub_path) { @@ -322,31 +395,35 @@ static int dir_cleanup( } /* Is there an item configured for this path? */ - if (hashmap_get(items, sub_path)) + if (hashmap_get(items, sub_path)) { + log_debug("Ignoring \"%s\": a separate entry exists.", sub_path); continue; + } - if (find_glob(globs, sub_path)) + if (find_glob(globs, sub_path)) { + log_debug("Ignoring \"%s\": a separate glob exists.", sub_path); continue; + } if (S_ISDIR(s.st_mode)) { if (mountpoint && streq(dent->d_name, "lost+found") && - s.st_uid == 0) + s.st_uid == 0) { + log_debug("Ignoring \"%s\".", sub_path); continue; + } if (maxdepth <= 0) - log_warning("Reached max depth on %s.", sub_path); + log_warning("Reached max depth on \"%s\".", sub_path); else { _cleanup_closedir_ DIR *sub_dir; int q; - sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW|O_NOATIME); + sub_dir = xopendirat_nomod(dirfd(d), dent->d_name); if (!sub_dir) { - if (errno != ENOENT) { - log_error_errno(errno, "opendir(%s/%s) failed: %m", p, dent->d_name); - r = -errno; - } + if (errno != ENOENT) + r = log_error_errno(errno, "opendir(%s) failed: %m", sub_path); continue; } @@ -363,83 +440,128 @@ static int dir_cleanup( * bit already has a meaning for directories, * so we don't want to overload that. */ - if (keep_this_level) + if (keep_this_level) { + log_debug("Keeping \"%s\".", sub_path); continue; + } /* Ignore ctime, we change it when deleting */ - age = MAX(timespec_load(&s.st_mtim), - timespec_load(&s.st_atim)); - if (age >= cutoff) + age = timespec_load(&s.st_mtim); + if (age >= cutoff) { + char a[FORMAT_TIMESTAMP_MAX]; + /* Follows spelling in stat(1). */ + log_debug("Directory \"%s\": modify time %s is too new.", + sub_path, + format_timestamp_us(a, sizeof(a), age)); continue; + } - if (i->type != IGNORE_DIRECTORY_PATH || !streq(dent->d_name, p)) { - log_debug("rmdir '%s'", sub_path); + age = timespec_load(&s.st_atim); + if (age >= cutoff) { + char a[FORMAT_TIMESTAMP_MAX]; + log_debug("Directory \"%s\": access time %s is too new.", + sub_path, + format_timestamp_us(a, sizeof(a), age)); + continue; + } - if (unlinkat(dirfd(d), dent->d_name, AT_REMOVEDIR) < 0) { - if (errno != ENOENT && errno != ENOTEMPTY) { - log_error_errno(errno, "rmdir(%s): %m", sub_path); - r = -errno; - } + log_debug("Removing directory \"%s\".", sub_path); + if (unlinkat(dirfd(d), dent->d_name, AT_REMOVEDIR) < 0) + if (errno != ENOENT && errno != ENOTEMPTY) { + log_error_errno(errno, "rmdir(%s): %m", sub_path); + r = -errno; } - } } else { /* Skip files for which the sticky bit is * set. These are semantics we define, and are * unknown elsewhere. See XDG_RUNTIME_DIR * specification for details. */ - if (s.st_mode & S_ISVTX) + if (s.st_mode & S_ISVTX) { + log_debug("Skipping \"%s\": sticky bit set.", sub_path); continue; + } - if (mountpoint && S_ISREG(s.st_mode)) { - if (streq(dent->d_name, ".journal") && - s.st_uid == 0) - continue; - - if (streq(dent->d_name, "aquota.user") || - streq(dent->d_name, "aquota.group")) + if (mountpoint && S_ISREG(s.st_mode)) + if ((streq(dent->d_name, ".journal") && s.st_uid == 0) || + streq(dent->d_name, "aquota.user") || + streq(dent->d_name, "aquota.group")) { + log_debug("Skipping \"%s\".", sub_path); continue; - } + } /* Ignore sockets that are listed in /proc/net/unix */ - if (S_ISSOCK(s.st_mode) && unix_socket_alive(sub_path)) + if (S_ISSOCK(s.st_mode) && unix_socket_alive(sub_path)) { + log_debug("Skipping \"%s\": live socket.", sub_path); continue; + } /* Ignore device nodes */ - if (S_ISCHR(s.st_mode) || S_ISBLK(s.st_mode)) + if (S_ISCHR(s.st_mode) || S_ISBLK(s.st_mode)) { + log_debug("Skipping \"%s\": a device.", sub_path); continue; + } /* Keep files on this level around if this is * requested */ - if (keep_this_level) + if (keep_this_level) { + log_debug("Keeping \"%s\".", sub_path); continue; + } - age = MAX3(timespec_load(&s.st_mtim), - timespec_load(&s.st_atim), - timespec_load(&s.st_ctim)); - - if (age >= cutoff) + age = timespec_load(&s.st_mtim); + if (age >= cutoff) { + char a[FORMAT_TIMESTAMP_MAX]; + /* Follows spelling in stat(1). */ + log_debug("File \"%s\": modify time %s is too new.", + sub_path, + format_timestamp_us(a, sizeof(a), age)); continue; + } - log_debug("unlink '%s'", sub_path); + age = timespec_load(&s.st_atim); + if (age >= cutoff) { + char a[FORMAT_TIMESTAMP_MAX]; + log_debug("File \"%s\": access time %s is too new.", + sub_path, + format_timestamp_us(a, sizeof(a), age)); + continue; + } - if (unlinkat(dirfd(d), dent->d_name, 0) < 0) { - if (errno != ENOENT) { - log_error_errno(errno, "unlink(%s): %m", sub_path); - r = -errno; - } + age = timespec_load(&s.st_ctim); + if (age >= cutoff) { + char a[FORMAT_TIMESTAMP_MAX]; + log_debug("File \"%s\": change time %s is too new.", + sub_path, + format_timestamp_us(a, sizeof(a), age)); + continue; } + log_debug("unlink \"%s\"", sub_path); + + if (unlinkat(dirfd(d), dent->d_name, 0) < 0) + if (errno != ENOENT) + r = log_error_errno(errno, "unlink(%s): %m", sub_path); + deleted = true; } } finish: if (deleted) { + usec_t age1, age2; + char a[FORMAT_TIMESTAMP_MAX], b[FORMAT_TIMESTAMP_MAX]; + /* Restore original directory timestamps */ times[0] = ds->st_atim; times[1] = ds->st_mtim; + age1 = timespec_load(&ds->st_atim); + age2 = timespec_load(&ds->st_mtim); + log_debug("Restoring access and modification time on \"%s\": %s, %s", + p, + format_timestamp_us(a, sizeof(a), age1), + format_timestamp_us(b, sizeof(b), age2)); if (futimens(dirfd(d), times) < 0) log_error_errno(errno, "utimensat(%s): %m", p); } @@ -447,7 +569,7 @@ finish: return r; } -static int item_set_perms(Item *i, const char *path) { +static int path_set_perms(Item *i, const char *path) { struct stat st; bool st_valid; @@ -471,21 +593,27 @@ static int item_set_perms(Item *i, const char *path) { m &= ~07000; /* remove sticky/sgid/suid bit, unless directory */ } - if (!st_valid || m != (st.st_mode & 07777)) { + if (st_valid && m == (st.st_mode & 07777)) + log_debug("\"%s\" has right mode %o", path, st.st_mode); + else { + log_debug("chmod \"%s\" to mode %o", path, m); if (chmod(path, m) < 0) return log_error_errno(errno, "chmod(%s) failed: %m", path); } } - if ((!st_valid || (i->uid != st.st_uid || i->gid != st.st_gid)) && - (i->uid_set || i->gid_set)) + if ((!st_valid || i->uid != st.st_uid || i->gid != st.st_gid) && + (i->uid_set || i->gid_set)) { + log_debug("chown \"%s\" to "UID_FMT"."GID_FMT, + path, + i->uid_set ? i->uid : UID_INVALID, + i->gid_set ? i->gid : GID_INVALID); if (chown(path, i->uid_set ? i->uid : UID_INVALID, - i->gid_set ? i->gid : GID_INVALID) < 0) { + i->gid_set ? i->gid : GID_INVALID) < 0) - log_error_errno(errno, "chown(%s) failed: %m", path); - return -errno; - } + return log_error_errno(errno, "chown(%s) failed: %m", path); + } return label_fix(path, false, false); } @@ -496,61 +624,144 @@ static int get_xattrs_from_arg(Item *i) { int r; assert(i); + assert(i->argument); - if (!i->argument) { - log_error("%s: Argument can't be empty!", i->path); - return -EBADMSG; - } p = i->argument; while ((r = unquote_first_word(&p, &xattr, false)) > 0) { - _cleanup_free_ char *tmp = NULL, *name = NULL, *value = NULL; + _cleanup_free_ char *tmp = NULL, *name = NULL, + *value = NULL, *value2 = NULL, *_xattr = xattr; + r = split_pair(xattr, "=", &name, &value); if (r < 0) { log_warning("Illegal xattr found: \"%s\" - ignoring.", xattr); - free(xattr); continue; } - free(xattr); - if (streq(name, "") || streq(value, "")) { - log_warning("Malformed xattr found: \"%s=%s\" - ignoring.", name, value); + + if (strempty(name) || strempty(value)) { + log_warning("Malformed xattr found: \"%s\" - ignoring.", xattr); continue; } + tmp = unquote(value, "\""); if (!tmp) return log_oom(); - free(value); - value = cunescape(tmp); - if (!value) + + value2 = cunescape(tmp); + if (!value2) return log_oom(); - if (strv_consume_pair(&i->xattrs, name, value) < 0) + + if (strv_push_pair(&i->xattrs, name, value2) < 0) return log_oom(); - name = value = NULL; + name = value2 = NULL; } return r; } -static int item_set_xattrs(Item *i, const char *path) { +static int path_set_xattrs(Item *i, const char *path) { char **name, **value; assert(i); assert(path); - if (strv_isempty(i->xattrs)) - return 0; - STRV_FOREACH_PAIR(name, value, i->xattrs) { int n; + n = strlen(*value); + log_debug("\"%s\": setting xattr \"%s=%s\"", path, *name, *value); if (lsetxattr(path, *name, *value, n, 0) < 0) { - log_error("Setting extended attribute %s=%s on %s failed: %m", *name, *value, path); + log_error("Setting extended attribute %s=%s on %s failed: %m", + *name, *value, path); return -errno; } } return 0; } +static int get_acls_from_arg(Item *item) { +#ifdef HAVE_ACL + int r; + + assert(item); + + /* If force (= modify) is set, we will not modify the acl + * afterwards, so the mask can be added now if necessary. */ + r = parse_acl(item->argument, &item->acl_access, &item->acl_default, !item->force); + if (r < 0) + log_warning_errno(errno, "Failed to parse ACL \"%s\": %m. Ignoring", + item->argument); +#else + log_warning_errno(ENOSYS, "ACLs are not supported. Ignoring"); +#endif + + return 0; +} + +#ifdef HAVE_ACL +static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modify) { + _cleanup_(acl_freep) acl_t dup = NULL; + int r; + _cleanup_(acl_free_charpp) char *t = NULL; + + if (modify) { + r = acls_for_file(path, type, acl, &dup); + if (r < 0) + return r; + + r = calc_acl_mask_if_needed(&dup); + if (r < 0) + return r; + } else { + dup = acl_dup(acl); + if (!dup) + return -errno; + + /* the mask was already added earlier if needed */ + } + + r = add_base_acls_if_needed(&dup, path); + if (r < 0) + return r; + + t = acl_to_any_text(dup, NULL, ',', TEXT_ABBREVIATE); + log_debug("\"%s\": setting %s ACL \"%s\"", path, + type == ACL_TYPE_ACCESS ? "access" : "default", + strna(t)); + + r = acl_set_file(path, type, dup); + if (r < 0) + return log_error_errno(-errno, + "Setting %s ACL \"%s\" on %s failed: %m", + type == ACL_TYPE_ACCESS ? "access" : "default", + strna(t), path); + return 0; +} +#endif + +static int path_set_acls(Item *item, const char *path) { +#ifdef HAVE_ACL + int r; + + assert(item); + assert(path); + + if (item->acl_access) { + r = path_set_acl(path, ACL_TYPE_ACCESS, item->acl_access, item->force); + if (r < 0) + return r; + } + + if (item->acl_default) { + r = path_set_acl(path, ACL_TYPE_DEFAULT, item->acl_default, item->force); + if (r < 0) + return r; + } +#endif + + return 0; +} + static int write_one_file(Item *i, const char *path) { _cleanup_close_ int fd = -1; int flags, r = 0; @@ -569,8 +780,10 @@ static int write_one_file(Item *i, const char *path) { } if (fd < 0) { - if (i->type == WRITE_FILE && errno == ENOENT) + if (i->type == WRITE_FILE && errno == ENOENT) { + log_debug_errno(errno, "Not writing \"%s\": %m", path); return 0; + } log_error_errno(errno, "Failed to create file %s: %m", path); return -errno; @@ -578,21 +791,19 @@ static int write_one_file(Item *i, const char *path) { if (i->argument) { _cleanup_free_ char *unescaped; - ssize_t n; - size_t l; + + log_debug("%s to \"%s\".", + i->type == CREATE_FILE ? "Appending" : "Writing", path); unescaped = cunescape(i->argument); if (!unescaped) return log_oom(); - l = strlen(unescaped); - n = write(fd, unescaped, l); - - if (n < 0 || (size_t) n < l) { - log_error("Failed to write file %s: %s", path, n < 0 ? strerror(-n) : "Short write"); - return n < 0 ? n : -EIO; - } - } + r = loop_write(fd, unescaped, strlen(unescaped), false); + if (r < 0) + return log_error_errno(r, "Failed to write file \"%s\": %m", path); + } else + log_debug("\"%s\" has been created.", path); fd = safe_close(fd); @@ -604,18 +815,16 @@ static int write_one_file(Item *i, const char *path) { return -EEXIST; } - r = item_set_perms(i, path); - if (r < 0) - return r; - - r = item_set_xattrs(i, i->path); + r = path_set_perms(i, path); if (r < 0) return r; return 0; } -static int item_set_perms_children(Item *i, const char *path) { +typedef int (*action_t)(Item *, const char *); + +static int item_do_children(Item *i, const char *path, action_t action) { _cleanup_closedir_ DIR *d; int r = 0; @@ -625,7 +834,7 @@ static int item_set_perms_children(Item *i, const char *path) { /* This returns the first error we run into, but nevertheless * tries to go on */ - d = opendir(path); + d = opendir_nomod(path); if (!d) return errno == ENOENT || errno == ENOTDIR ? 0 : -errno; @@ -643,19 +852,19 @@ static int item_set_perms_children(Item *i, const char *path) { break; } - if (streq(de->d_name, ".") || streq(de->d_name, "..")) + if (STR_IN_SET(de->d_name, ".", "..")) continue; p = strjoin(path, "/", de->d_name, NULL); if (!p) return -ENOMEM; - q = item_set_perms(i, p); + q = action(i, p); if (q < 0 && q != -ENOENT && r == 0) r = q; if (IN_SET(de->d_type, DT_UNKNOWN, DT_DIR)) { - q = item_set_perms_children(i, p); + q = item_do_children(i, p, action); if (q < 0 && r == 0) r = q; } @@ -664,53 +873,62 @@ static int item_set_perms_children(Item *i, const char *path) { return r; } -static int item_set_perms_recursive(Item *i, const char *path) { - int r, q; - - assert(i); - assert(path); - - r = item_set_perms(i, path); - if (r < 0) - return r; - - q = item_set_perms_children(i, path); - if (q < 0 && r == 0) - r = q; - - return r; -} - -static int glob_item(Item *i, int (*action)(Item *, const char *)) { - _cleanup_globfree_ glob_t g = {}; +static int glob_item(Item *i, action_t action, bool recursive) { + _cleanup_globfree_ glob_t g = { + .gl_closedir = (void (*)(void *)) closedir, + .gl_readdir = (struct dirent *(*)(void *)) readdir, + .gl_opendir = (void *(*)(const char *)) opendir_nomod, + .gl_lstat = lstat, + .gl_stat = stat, + }; int r = 0, k; char **fn; errno = 0; - k = glob(i->path, GLOB_NOSORT|GLOB_BRACE, NULL, &g); - if (k != 0 && k != GLOB_NOMATCH) { - if (errno == 0) - errno = EIO; - - log_error_errno(errno, "glob(%s) failed: %m", i->path); - return -errno; - } + k = glob(i->path, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g); + if (k != 0 && k != GLOB_NOMATCH) + return log_error_errno(errno ?: EIO, "glob(%s) failed: %m", i->path); STRV_FOREACH(fn, g.gl_pathv) { k = action(i, *fn); if (k < 0 && r == 0) r = k; + + if (recursive) { + k = item_do_children(i, *fn, action); + if (k < 0 && r == 0) + r = k; + } } return r; } +typedef enum { + CREATION_NORMAL, + CREATION_EXISTING, + CREATION_FORCE, + _CREATION_MODE_MAX, + _CREATION_MODE_INVALID = -1 +} CreationMode; + +static const char *creation_mode_verb_table[_CREATION_MODE_MAX] = { + [CREATION_NORMAL] = "Created", + [CREATION_EXISTING] = "Found existing", + [CREATION_FORCE] = "Created replacement", +}; + +DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(creation_mode_verb, CreationMode); + static int create_item(Item *i) { struct stat st; int r = 0; + CreationMode creation; assert(i); + log_debug("Running create action for entry %c %s", (char) i->type, i->path); + switch (i->type) { case IGNORE_PATH: @@ -727,6 +945,7 @@ static int create_item(Item *i) { break; case COPY_FILES: + log_debug("Copying tree \"%s\" to \"%s\".", i->argument, i->path); r = copy_tree(i->argument, i->path, false); if (r < 0) { struct stat a, b; @@ -746,45 +965,56 @@ static int create_item(Item *i) { } } - r = item_set_perms(i, i->path); + r = path_set_perms(i, i->path); if (r < 0) return r; break; case WRITE_FILE: - r = glob_item(i, write_one_file); + r = glob_item(i, write_one_file, false); if (r < 0) return r; break; - case TRUNCATE_DIRECTORY: case CREATE_DIRECTORY: + case TRUNCATE_DIRECTORY: + case CREATE_SUBVOLUME: - RUN_WITH_UMASK(0000) { + RUN_WITH_UMASK(0000) mkdir_parents_label(i->path, 0755); - r = mkdir_label(i->path, i->mode); - } + + if (i->type == CREATE_SUBVOLUME) + RUN_WITH_UMASK((~i->mode) & 0777) { + r = btrfs_subvol_make(i->path); + log_debug_errno(r, "Creating subvolume \"%s\": %m", i->path); + } + else + r = 0; + + if (IN_SET(i->type, CREATE_DIRECTORY, TRUNCATE_DIRECTORY) || r == -ENOTTY) + RUN_WITH_UMASK(0000) + r = mkdir_label(i->path, i->mode); if (r < 0) { if (r != -EEXIST) - return log_error_errno(r, "Failed to create directory %s: %m", i->path); + return log_error_errno(r, "Failed to create directory or subvolume \"%s\": %m", i->path); if (stat(i->path, &st) < 0) return log_error_errno(errno, "stat(%s) failed: %m", i->path); if (!S_ISDIR(st.st_mode)) { - log_debug("%s already exists and is not a directory.", i->path); + log_debug("\"%s\" already exists and is not a directory.", i->path); return 0; } - } - r = item_set_perms(i, i->path); - if (r < 0) - return r; + creation = CREATION_EXISTING; + } else + creation = CREATION_NORMAL; + log_debug("%s directory \"%s\".", creation_mode_verb_to_string(creation), i->path); - r = item_set_xattrs(i, i->path); + r = path_set_perms(i, i->path); if (r < 0) return r; @@ -817,18 +1047,18 @@ static int create_item(Item *i) { if (r < 0) return log_error_errno(r, "Failed to create fifo %s: %m", i->path); + creation = CREATION_FORCE; } else { log_debug("%s is not a fifo.", i->path); return 0; } - } - } + } else + creation = CREATION_EXISTING; + } else + creation = CREATION_NORMAL; + log_debug("%s fifo \"%s\".", creation_mode_verb_to_string(creation), i->path); - r = item_set_perms(i, i->path); - if (r < 0) - return r; - - r = item_set_xattrs(i, i->path); + r = path_set_perms(i, i->path); if (r < 0) return r; @@ -856,16 +1086,16 @@ static int create_item(Item *i) { if (r < 0) return log_error_errno(r, "symlink(%s, %s) failed: %m", i->argument, i->path); + creation = CREATION_FORCE; } else { - log_debug("%s is not a symlink or does not point to the correct path.", i->path); + log_debug("\"%s\" is not a symlink or does not point to the correct path.", i->path); return 0; } - } - } - - r = item_set_xattrs(i, i->path); - if (r < 0) - return r; + } else + creation = CREATION_EXISTING; + } else + creation = CREATION_NORMAL; + log_debug("%s symlink \"%s\".", creation_mode_verb_to_string(creation), i->path); break; @@ -915,19 +1145,22 @@ static int create_item(Item *i) { } if (r < 0) - return log_error_errno(r, "Failed to create device node %s: %m", i->path); + return log_error_errno(r, "Failed to create device node \"%s\": %m", i->path); + creation = CREATION_FORCE; } else { log_debug("%s is not a device node.", i->path); return 0; } - } - } - - r = item_set_perms(i, i->path); - if (r < 0) - return r; - - r = item_set_xattrs(i, i->path); + } else + creation = CREATION_EXISTING; + } else + creation = CREATION_NORMAL; + log_debug("%s %s device node \"%s\" %u:%u.", + creation_mode_verb_to_string(creation), + i->type == CREATE_BLOCK_DEVICE ? "block" : "char", + i->path, major(i->mode), minor(i->mode)); + + r = path_set_perms(i, i->path); if (r < 0) return r; @@ -936,21 +1169,37 @@ static int create_item(Item *i) { case ADJUST_MODE: case RELABEL_PATH: - - r = glob_item(i, item_set_perms); + r = glob_item(i, path_set_perms, false); if (r < 0) return r; break; case RECURSIVE_RELABEL_PATH: - - r = glob_item(i, item_set_perms_recursive); + r = glob_item(i, path_set_perms, true); if (r < 0) return r; break; case SET_XATTR: - r = item_set_xattrs(i, i->path); + r = glob_item(i, path_set_xattrs, false); + if (r < 0) + return r; + break; + + case RECURSIVE_SET_XATTR: + r = glob_item(i, path_set_xattrs, true); + if (r < 0) + return r; + break; + + case SET_ACL: + r = glob_item(i, path_set_acls, false); + if (r < 0) + return r; + break; + + case RECURSIVE_SET_ACL: + r = glob_item(i, path_set_acls, true); if (r < 0) return r; break; @@ -968,26 +1217,9 @@ static int remove_item_instance(Item *i, const char *instance) { switch (i->type) { - case CREATE_FILE: - case TRUNCATE_FILE: - case CREATE_DIRECTORY: - case CREATE_FIFO: - case CREATE_SYMLINK: - case CREATE_BLOCK_DEVICE: - case CREATE_CHAR_DEVICE: - case IGNORE_PATH: - case IGNORE_DIRECTORY_PATH: - case ADJUST_MODE: - case RELABEL_PATH: - case RECURSIVE_RELABEL_PATH: - case WRITE_FILE: - case COPY_FILES: - case SET_XATTR: - break; - case REMOVE_PATH: if (remove(instance) < 0 && errno != ENOENT) - return log_error_errno(errno, "remove(%s): %m", instance); + return log_error_errno(errno, "rm(%s): %m", instance); break; @@ -995,11 +1227,15 @@ static int remove_item_instance(Item *i, const char *instance) { case RECURSIVE_REMOVE_PATH: /* FIXME: we probably should use dir_cleanup() here * instead of rm_rf() so that 'x' is honoured. */ + log_debug("rm -rf \"%s\"", instance); r = rm_rf_dangerous(instance, false, i->type == RECURSIVE_REMOVE_PATH, false); if (r < 0 && r != -ENOENT) return log_error_errno(r, "rm_rf(%s): %m", instance); break; + + default: + assert_not_reached("wut?"); } return 0; @@ -1010,11 +1246,14 @@ static int remove_item(Item *i) { assert(i); + log_debug("Running remove action for entry %c %s", (char) i->type, i->path); + switch (i->type) { case CREATE_FILE: case TRUNCATE_FILE: case CREATE_DIRECTORY: + case CREATE_SUBVOLUME: case CREATE_FIFO: case CREATE_SYMLINK: case CREATE_CHAR_DEVICE: @@ -1027,12 +1266,15 @@ static int remove_item(Item *i) { case WRITE_FILE: case COPY_FILES: case SET_XATTR: + case RECURSIVE_SET_XATTR: + case SET_ACL: + case RECURSIVE_SET_ACL: break; case REMOVE_PATH: case TRUNCATE_DIRECTORY: case RECURSIVE_REMOVE_PATH: - r = glob_item(i, remove_item_instance); + r = glob_item(i, remove_item_instance, false); break; } @@ -1043,8 +1285,8 @@ static int clean_item_instance(Item *i, const char* instance) { _cleanup_closedir_ DIR *d = NULL; struct stat s, ps; bool mountpoint; - int r; usec_t cutoff, n; + char timestamp[FORMAT_TIMESTAMP_MAX]; assert(i); @@ -1057,12 +1299,14 @@ static int clean_item_instance(Item *i, const char* instance) { cutoff = n - i->age; - d = opendir(instance); + d = opendir_nomod(instance); if (!d) { - if (errno == ENOENT || errno == ENOTDIR) + if (errno == ENOENT || errno == ENOTDIR) { + log_debug_errno(errno, "Directory \"%s\": %m", instance); return 0; + } - log_error_errno(errno, "Failed to open directory %s: %m", i->path); + log_error_errno(errno, "Failed to open directory %s: %m", instance); return -errno; } @@ -1080,9 +1324,13 @@ static int clean_item_instance(Item *i, const char* instance) { mountpoint = s.st_dev != ps.st_dev || (s.st_dev == ps.st_dev && s.st_ino == ps.st_ino); - r = dir_cleanup(i, instance, d, &s, cutoff, s.st_dev, mountpoint, - MAX_DEPTH, i->keep_first_level); - return r; + log_debug("Cleanup threshold for %s \"%s\" is %s", + mountpoint ? "mount point" : "directory", + instance, + format_timestamp_us(timestamp, sizeof(timestamp), cutoff)); + + return dir_cleanup(i, instance, d, &s, cutoff, s.st_dev, mountpoint, + MAX_DEPTH, i->keep_first_level); } static int clean_item(Item *i) { @@ -1090,15 +1338,18 @@ static int clean_item(Item *i) { assert(i); + log_debug("Running clean action for entry %c %s", (char) i->type, i->path); + switch (i->type) { case CREATE_DIRECTORY: + case CREATE_SUBVOLUME: case TRUNCATE_DIRECTORY: case IGNORE_PATH: case COPY_FILES: clean_item_instance(i, i->path); break; case IGNORE_DIRECTORY_PATH: - r = glob_item(i, clean_item_instance); + r = glob_item(i, clean_item_instance, false); break; default: break; @@ -1107,8 +1358,10 @@ static int clean_item(Item *i) { return r; } +static int process_item_array(ItemArray *array); + static int process_item(Item *i) { - int r, q, p; + int r, q, p, t = 0; _cleanup_free_ char *prefix = NULL; assert(i); @@ -1123,77 +1376,93 @@ static int process_item(Item *i) { return log_oom(); PATH_FOREACH_PREFIX(prefix, i->path) { - Item *j; + ItemArray *j; j = hashmap_get(items, prefix); - if (j) - process_item(j); + if (j) { + int s; + + s = process_item_array(j); + if (s < 0 && t == 0) + t = s; + } } r = arg_create ? create_item(i) : 0; q = arg_remove ? remove_item(i) : 0; p = arg_clean ? clean_item(i) : 0; - if (r < 0) - return r; + return t < 0 ? t : + r < 0 ? r : + q < 0 ? q : + p; +} - if (q < 0) - return q; +static int process_item_array(ItemArray *array) { + unsigned n; + int r = 0, k; - return p; -} + assert(array); -static void item_free(Item *i) { + for (n = 0; n < array->count; n++) { + k = process_item(array->items + n); + if (k < 0 && r == 0) + r = k; + } - if (!i) - return; + return r; +} +static void item_free_contents(Item *i) { + assert(i); free(i->path); free(i->argument); strv_free(i->xattrs); - free(i); + +#ifdef HAVE_ACL + acl_free(i->acl_access); + acl_free(i->acl_default); +#endif } -DEFINE_TRIVIAL_CLEANUP_FUNC(Item*, item_free); +static void item_array_free(ItemArray *a) { + unsigned n; + + if (!a) + return; -static bool item_equal(Item *a, Item *b) { + for (n = 0; n < a->count; n++) + item_free_contents(a->items + n); + free(a->items); + free(a); +} + +static bool item_compatible(Item *a, Item *b) { assert(a); assert(b); + assert(streq(a->path, b->path)); - if (!streq_ptr(a->path, b->path)) - return false; + if (takes_ownership(a->type) && takes_ownership(b->type)) + /* check if the items are the same */ + return streq_ptr(a->argument, b->argument) && - if (a->type != b->type) - return false; + a->uid_set == b->uid_set && + a->uid == b->uid && - if (a->uid_set != b->uid_set || - (a->uid_set && a->uid != b->uid)) - return false; + a->gid_set == b->gid_set && + a->gid == b->gid && - if (a->gid_set != b->gid_set || - (a->gid_set && a->gid != b->gid)) - return false; + a->mode_set == b->mode_set && + a->mode == b->mode && - if (a->mode_set != b->mode_set || - (a->mode_set && a->mode != b->mode)) - return false; + a->age_set == b->age_set && + a->age == b->age && - if (a->age_set != b->age_set || - (a->age_set && a->age != b->age)) - return false; + a->mask_perms == b->mask_perms && - if ((a->type == CREATE_FILE || - a->type == TRUNCATE_FILE || - a->type == WRITE_FILE || - a->type == CREATE_SYMLINK || - a->type == COPY_FILES) && - !streq_ptr(a->argument, b->argument)) - return false; + a->keep_first_level == b->keep_first_level && - if ((a->type == CREATE_CHAR_DEVICE || - a->type == CREATE_BLOCK_DEVICE) && - a->major_minor != b->major_minor) - return false; + a->major_minor == b->major_minor; return true; } @@ -1202,16 +1471,25 @@ static bool should_include_path(const char *path) { char **prefix; STRV_FOREACH(prefix, arg_exclude_prefixes) - if (path_startswith(path, *prefix)) + if (path_startswith(path, *prefix)) { + log_debug("Entry \"%s\" matches exclude prefix \"%s\", skipping.", + path, *prefix); return false; + } STRV_FOREACH(prefix, arg_include_prefixes) - if (path_startswith(path, *prefix)) + if (path_startswith(path, *prefix)) { + log_debug("Entry \"%s\" matches include prefix \"%s\".", path, *prefix); return true; + } /* no matches, so we should include this path only if we * have no whitelist at all */ - return strv_length(arg_include_prefixes) == 0; + if (strv_length(arg_include_prefixes) == 0) + return true; + + log_debug("Entry \"%s\" does not match any include prefix, skipping.", path); + return false; } static int parse_line(const char *fname, unsigned line, const char *buffer) { @@ -1225,11 +1503,11 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { }; _cleanup_free_ char *action = NULL, *mode = NULL, *user = NULL, *group = NULL, *age = NULL, *path = NULL; - _cleanup_(item_freep) Item *i = NULL; - Item *existing; - char type; + _cleanup_(item_free_contents) Item i = {}; + ItemArray *existing; Hashmap *h; - int r, n = -1; + int r, c = -1, pos; + bool force = false, boot = false; assert(fname); assert(line >= 1); @@ -1243,7 +1521,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { &user, &group, &age, - &n); + &c); if (r < 2) { log_error("[%s:%u] Syntax error.", fname, line); return -EIO; @@ -1254,42 +1532,48 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { return -EINVAL; } - if (strlen(action) > 1 && !in_charset(action+1, "!+")) { - log_error("[%s:%u] Unknown modifiers in command '%s'", fname, line, action); - return -EINVAL; + for (pos = 1; action[pos]; pos++) { + if (action[pos] == '!' && !boot) + boot = true; + else if (action[pos] == '+' && !force) + force = true; + else { + log_error("[%s:%u] Unknown modifiers in command '%s'", + fname, line, action); + return -EINVAL; + } } - if (strchr(action+1, '!') && !arg_boot) + if (boot && !arg_boot) { + log_debug("Ignoring entry %s \"%s\" because --boot is not specified.", + action, path); return 0; + } - type = action[0]; - - i = new0(Item, 1); - if (!i) - return log_oom(); - - i->force = !!strchr(action+1, '+'); + i.type = action[0]; + i.force = force; - r = specifier_printf(path, specifier_table, NULL, &i->path); + r = specifier_printf(path, specifier_table, NULL, &i.path); if (r < 0) { log_error("[%s:%u] Failed to replace specifiers: %s", fname, line, path); return r; } - if (n >= 0) { - n += strspn(buffer+n, WHITESPACE); - if (buffer[n] != 0 && (buffer[n] != '-' || buffer[n+1] != 0)) { - i->argument = unquote(buffer+n, "\""); - if (!i->argument) + if (c >= 0) { + c += strspn(buffer+c, WHITESPACE); + if (buffer[c] != 0 && (buffer[c] != '-' || buffer[c+1] != 0)) { + i.argument = unquote(buffer+c, "\""); + if (!i.argument) return log_oom(); } } - switch (type) { + switch (i.type) { case CREATE_FILE: case TRUNCATE_FILE: case CREATE_DIRECTORY: + case CREATE_SUBVOLUME: case TRUNCATE_DIRECTORY: case CREATE_FIFO: case IGNORE_PATH: @@ -1302,113 +1586,121 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { break; case CREATE_SYMLINK: - if (!i->argument) { - i->argument = strappend("/usr/share/factory", i->path); - if (!i->argument) + if (!i.argument) { + i.argument = strappend("/usr/share/factory/", i.path); + if (!i.argument) return log_oom(); } break; case WRITE_FILE: - if (!i->argument) { + if (!i.argument) { log_error("[%s:%u] Write file requires argument.", fname, line); return -EBADMSG; } break; case COPY_FILES: - if (!i->argument) { - i->argument = strappend("/usr/share/factory", i->path); - if (!i->argument) + if (!i.argument) { + i.argument = strappend("/usr/share/factory/", i.path); + if (!i.argument) return log_oom(); - } - - if (!path_is_absolute(i->argument)) { + } else if (!path_is_absolute(i.argument)) { log_error("[%s:%u] Source path is not absolute.", fname, line); return -EBADMSG; } - path_kill_slashes(i->argument); + path_kill_slashes(i.argument); break; case CREATE_CHAR_DEVICE: case CREATE_BLOCK_DEVICE: { unsigned major, minor; - if (!i->argument) { + if (!i.argument) { log_error("[%s:%u] Device file requires argument.", fname, line); return -EBADMSG; } - if (sscanf(i->argument, "%u:%u", &major, &minor) != 2) { - log_error("[%s:%u] Can't parse device file major/minor '%s'.", fname, line, i->argument); + if (sscanf(i.argument, "%u:%u", &major, &minor) != 2) { + log_error("[%s:%u] Can't parse device file major/minor '%s'.", fname, line, i.argument); return -EBADMSG; } - i->major_minor = makedev(major, minor); + i.major_minor = makedev(major, minor); break; } case SET_XATTR: - if (!i->argument) { + case RECURSIVE_SET_XATTR: + if (!i.argument) { log_error("[%s:%u] Set extended attribute requires argument.", fname, line); return -EBADMSG; } - r = get_xattrs_from_arg(i); + r = get_xattrs_from_arg(&i); + if (r < 0) + return r; + break; + + case SET_ACL: + case RECURSIVE_SET_ACL: + if (!i.argument) { + log_error("[%s:%u] Set ACLs requires argument.", fname, line); + return -EBADMSG; + } + r = get_acls_from_arg(&i); if (r < 0) return r; break; default: - log_error("[%s:%u] Unknown command type '%c'.", fname, line, type); + log_error("[%s:%u] Unknown command type '%c'.", fname, line, (char) i.type); return -EBADMSG; } - i->type = type; - - if (!path_is_absolute(i->path)) { - log_error("[%s:%u] Path '%s' not absolute.", fname, line, i->path); + if (!path_is_absolute(i.path)) { + log_error("[%s:%u] Path '%s' not absolute.", fname, line, i.path); return -EBADMSG; } - path_kill_slashes(i->path); + path_kill_slashes(i.path); - if (!should_include_path(i->path)) + if (!should_include_path(i.path)) return 0; if (arg_root) { char *p; - p = strappend(arg_root, i->path); + p = strappend(arg_root, i.path); if (!p) return log_oom(); - free(i->path); - i->path = p; + free(i.path); + i.path = p; } if (user && !streq(user, "-")) { const char *u = user; - r = get_user_creds(&u, &i->uid, NULL, NULL, NULL); + r = get_user_creds(&u, &i.uid, NULL, NULL, NULL); if (r < 0) { log_error("[%s:%u] Unknown user '%s'.", fname, line, user); return r; } - i->uid_set = true; + i.uid_set = true; } if (group && !streq(group, "-")) { const char *g = group; - r = get_group_creds(&g, &i->gid); + r = get_group_creds(&g, &i.gid); if (r < 0) { log_error("[%s:%u] Unknown group '%s'.", fname, line, group); return r; } - i->gid_set = true; + i.gid_set = true; } if (mode && !streq(mode, "-")) { @@ -1416,7 +1708,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { unsigned m; if (*mm == '~') { - i->mask_perms = true; + i.mask_perms = true; mm++; } @@ -1425,64 +1717,51 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { return -ENOENT; } - i->mode = m; - i->mode_set = true; + i.mode = m; + i.mode_set = true; } else - i->mode = - i->type == CREATE_DIRECTORY || - i->type == TRUNCATE_DIRECTORY ? 0755 : 0644; + i.mode = IN_SET(i.type, CREATE_DIRECTORY, CREATE_SUBVOLUME, TRUNCATE_DIRECTORY) + ? 0755 : 0644; if (age && !streq(age, "-")) { const char *a = age; if (*a == '~') { - i->keep_first_level = true; + i.keep_first_level = true; a++; } - if (parse_sec(a, &i->age) < 0) { + if (parse_sec(a, &i.age) < 0) { log_error("[%s:%u] Invalid age '%s'.", fname, line, age); return -EBADMSG; } - i->age_set = true; + i.age_set = true; } - h = needs_glob(i->type) ? globs : items; + h = needs_glob(i.type) ? globs : items; - existing = hashmap_get(h, i->path); + existing = hashmap_get(h, i.path); if (existing) { - if (i->type == SET_XATTR) { - r = strv_extend_strv(&existing->xattrs, i->xattrs); - if (r < 0) - return log_oom(); - return 0; - } else if (existing->type == SET_XATTR) { - r = strv_extend_strv(&i->xattrs, existing->xattrs); - if (r < 0) - return log_oom(); - r = hashmap_replace(h, i->path, i); - if (r < 0) { - log_error("Failed to replace item for %s.", i->path); - return r; - } - item_free(existing); - } else { - /* Two identical items are fine */ - if (!item_equal(existing, i)) - log_warning("Two or more conflicting lines for %s configured, ignoring.", i->path); - return 0; + unsigned n; + + for (n = 0; n < existing->count; n++) { + if (!item_compatible(existing->items + n, &i)) + log_warning("[%s:%u] Duplicate line for path \"%s\", ignoring.", + fname, line, i.path); } } else { - r = hashmap_put(h, i->path, i); - if (r < 0) { - log_error("Failed to insert item %s: %s", i->path, strerror(-r)); - return r; - } + existing = new0(ItemArray, 1); + r = hashmap_put(h, i.path, existing); + if (r < 0) + return log_oom(); } - i = NULL; /* avoid cleanup */ + if (!GREEDY_REALLOC(existing->items, existing->size, existing->count + 1)) + return log_oom(); + memcpy(existing->items + existing->count++, &i, sizeof(i)); + zero(i); return 0; } @@ -1495,8 +1774,8 @@ static void help(void) { " --clean Clean up marked directories\n" " --remove Remove marked files/directories\n" " --boot Execute actions only safe at boot\n" - " --prefix=PATH Only apply rules that apply to paths with the specified prefix\n" - " --exclude-prefix=PATH Ignore rules that apply to paths with the specified prefix\n" + " --prefix=PATH Only apply rules with the specified prefix\n" + " --exclude-prefix=PATH Ignore rules with the specified prefix\n" " --root=PATH Operate on an alternate filesystem root\n", program_invocation_short_name); } @@ -1607,11 +1886,14 @@ static int read_config_file(const char *fn, bool ignore_enoent) { r = search_and_fopen_nulstr(fn, "re", arg_root, conf_file_dirs, &f); if (r < 0) { - if (ignore_enoent && r == -ENOENT) + if (ignore_enoent && r == -ENOENT) { + log_debug_errno(r, "Failed to open \"%s\": %m", fn); return 0; + } return log_error_errno(r, "Failed to open '%s', ignoring: %m", fn); } + log_debug("Reading config file \"%s\".", fn); FOREACH_LINE(line, f, break) { char *l; @@ -1637,7 +1919,7 @@ static int read_config_file(const char *fn, bool ignore_enoent) { continue; HASHMAP_FOREACH(j, items, iter) { - if (j->type != CREATE_DIRECTORY && j->type != TRUNCATE_DIRECTORY) + if (j->type != CREATE_DIRECTORY && j->type != TRUNCATE_DIRECTORY && j->type != CREATE_SUBVOLUME) continue; if (path_equal(j->path, i->path)) { @@ -1667,7 +1949,7 @@ static int read_config_file(const char *fn, bool ignore_enoent) { int main(int argc, char *argv[]) { int r, k; - Item *i; + ItemArray *a; Iterator iterator; r = parse_argv(argc, argv); @@ -1718,18 +2000,24 @@ int main(int argc, char *argv[]) { } } - HASHMAP_FOREACH(i, globs, iterator) - process_item(i); + HASHMAP_FOREACH(a, globs, iterator) { + k = process_item_array(a); + if (k < 0 && r == 0) + r = k; + } - HASHMAP_FOREACH(i, items, iterator) - process_item(i); + HASHMAP_FOREACH(a, items, iterator) { + k = process_item_array(a); + if (k < 0 && r == 0) + r = k; + } finish: - while ((i = hashmap_steal_first(items))) - item_free(i); + while ((a = hashmap_steal_first(items))) + item_array_free(a); - while ((i = hashmap_steal_first(globs))) - item_free(i); + while ((a = hashmap_steal_first(globs))) + item_array_free(a); hashmap_free(items); hashmap_free(globs); diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 5fc27f9ae..47093b850 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -385,7 +385,7 @@ static bool wall_tty_match(const char *path) { _cleanup_free_ char *p = NULL; if (!path_is_absolute(path)) - path = strappenda("/dev/", path); + path = strjoina("/dev/", path); r = lstat(path, &st); if (r < 0) @@ -438,7 +438,7 @@ static int show_passwords(void) { if (de->d_type != DT_REG) continue; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (!startswith(de->d_name, "ask.")) diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c index dd4b7dc8a..0f1b3c6ec 100644 --- a/src/udev/accelerometer/accelerometer.c +++ b/src/udev/accelerometer/accelerometer.c @@ -195,11 +195,13 @@ static void test_orientation(struct udev *udev, puts(text); } -static void help(void) -{ - printf("Usage: accelerometer [options] \n" - " --debug debug to stderr\n" - " --help print this help text\n\n"); +static void help(void) { + + printf("%s [options] \n\n" + "Accelerometer device identification.\n\n" + " -h --help Print this message\n" + " -d --debug Debug to stderr\n" + , program_invocation_short_name); } int main (int argc, char** argv) @@ -229,7 +231,7 @@ int main (int argc, char** argv) while (1) { int option; - option = getopt_long(argc, argv, "dxh", options, NULL); + option = getopt_long(argc, argv, "dh", options, NULL); if (option == -1) break; diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c index 89628c929..9e4f674a9 100644 --- a/src/udev/ata_id/ata_id.c +++ b/src/udev/ata_id/ata_id.c @@ -34,15 +34,12 @@ #include #include #include -#include #include -#include -#include #include -#include #include "libudev.h" #include "libudev-private.h" +#include "udev-util.h" #include "log.h" #define COMMAND_TIMEOUT_MSEC (30 * 1000) @@ -407,19 +404,21 @@ out: int main(int argc, char *argv[]) { - struct udev *udev; + _cleanup_udev_unref_ struct udev *udev = NULL; struct hd_driveid id; - uint8_t identify[512]; - uint16_t *identify_words; + union { + uint8_t byte[512]; + uint16_t wyde[256]; + uint64_t octa[64]; + } identify; char model[41]; char model_enc[256]; char serial[21]; char revision[9]; const char *node = NULL; int export = 0; - int fd; + _cleanup_close_ int fd = -1; uint16_t word; - int rc = 0; int is_packet_device = 0; static const struct option options[] = { { "export", no_argument, NULL, 'x' }, @@ -432,7 +431,7 @@ int main(int argc, char *argv[]) udev = udev_new(); if (udev == NULL) - goto exit; + return 0; while (1) { int option; @@ -447,59 +446,55 @@ int main(int argc, char *argv[]) break; case 'h': printf("Usage: ata_id [--export] [--help] \n" - " --export print values as environment keys\n" - " --help print this help text\n\n"); - goto exit; + " -x,--export print values as environment keys\n" + " -h,--help print this help text\n\n"); + return 0; } } node = argv[optind]; if (node == NULL) { log_error("no node specified"); - rc = 1; - goto exit; + return 1; } fd = open(node, O_RDONLY|O_NONBLOCK|O_CLOEXEC); if (fd < 0) { log_error("unable to open '%s'", node); - rc = 1; - goto exit; + return 1; } - if (disk_identify(udev, fd, identify, &is_packet_device) == 0) { + if (disk_identify(udev, fd, identify.byte, &is_packet_device) == 0) { /* * fix up only the fields from the IDENTIFY data that we are going to * use and copy it into the hd_driveid struct for convenience */ - disk_identify_fixup_string(identify, 10, 20); /* serial */ - disk_identify_fixup_string(identify, 23, 8); /* fwrev */ - disk_identify_fixup_string(identify, 27, 40); /* model */ - disk_identify_fixup_uint16(identify, 0); /* configuration */ - disk_identify_fixup_uint16(identify, 75); /* queue depth */ - disk_identify_fixup_uint16(identify, 75); /* SATA capabilities */ - disk_identify_fixup_uint16(identify, 82); /* command set supported */ - disk_identify_fixup_uint16(identify, 83); /* command set supported */ - disk_identify_fixup_uint16(identify, 84); /* command set supported */ - disk_identify_fixup_uint16(identify, 85); /* command set supported */ - disk_identify_fixup_uint16(identify, 86); /* command set supported */ - disk_identify_fixup_uint16(identify, 87); /* command set supported */ - disk_identify_fixup_uint16(identify, 89); /* time required for SECURITY ERASE UNIT */ - disk_identify_fixup_uint16(identify, 90); /* time required for enhanced SECURITY ERASE UNIT */ - disk_identify_fixup_uint16(identify, 91); /* current APM values */ - disk_identify_fixup_uint16(identify, 94); /* current AAM value */ - disk_identify_fixup_uint16(identify, 128); /* device lock function */ - disk_identify_fixup_uint16(identify, 217); /* nominal media rotation rate */ - memcpy(&id, identify, sizeof id); + disk_identify_fixup_string(identify.byte, 10, 20); /* serial */ + disk_identify_fixup_string(identify.byte, 23, 8); /* fwrev */ + disk_identify_fixup_string(identify.byte, 27, 40); /* model */ + disk_identify_fixup_uint16(identify.byte, 0); /* configuration */ + disk_identify_fixup_uint16(identify.byte, 75); /* queue depth */ + disk_identify_fixup_uint16(identify.byte, 75); /* SATA capabilities */ + disk_identify_fixup_uint16(identify.byte, 82); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 83); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 84); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 85); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 86); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 87); /* command set supported */ + disk_identify_fixup_uint16(identify.byte, 89); /* time required for SECURITY ERASE UNIT */ + disk_identify_fixup_uint16(identify.byte, 90); /* time required for enhanced SECURITY ERASE UNIT */ + disk_identify_fixup_uint16(identify.byte, 91); /* current APM values */ + disk_identify_fixup_uint16(identify.byte, 94); /* current AAM value */ + disk_identify_fixup_uint16(identify.byte, 128); /* device lock function */ + disk_identify_fixup_uint16(identify.byte, 217); /* nominal media rotation rate */ + memcpy(&id, identify.byte, sizeof id); } else { /* If this fails, then try HDIO_GET_IDENTITY */ if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) { log_debug_errno(errno, "HDIO_GET_IDENTITY failed for '%s': %m", node); - rc = 2; - goto close; + return 2; } } - identify_words = (uint16_t *) identify; memcpy (model, id.model, 40); model[40] = '\0'; @@ -549,8 +544,8 @@ int main(int argc, char *argv[]) } if (id.command_set_1 & (1<<5)) { - printf ("ID_ATA_WRITE_CACHE=1\n"); - printf ("ID_ATA_WRITE_CACHE_ENABLED=%d\n", (id.cfs_enable_1 & (1<<5)) ? 1 : 0); + printf("ID_ATA_WRITE_CACHE=1\n"); + printf("ID_ATA_WRITE_CACHE_ENABLED=%d\n", (id.cfs_enable_1 & (1<<5)) ? 1 : 0); } if (id.command_set_1 & (1<<10)) { printf("ID_ATA_FEATURE_SET_HPA=1\n"); @@ -613,7 +608,8 @@ int main(int argc, char *argv[]) * the device does not claim compliance with the Serial ATA specification and words * 76 through 79 are not valid and shall be ignored. */ - word = *((uint16_t *) identify + 76); + + word = identify.wyde[76]; if (word != 0x0000 && word != 0xffff) { printf("ID_ATA_SATA=1\n"); /* @@ -630,54 +626,34 @@ int main(int argc, char *argv[]) } /* Word 217 indicates the nominal media rotation rate of the device */ - word = *((uint16_t *) identify + 217); - if (word != 0x0000) { - if (word == 0x0001) { - printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */ - } else if (word >= 0x0401 && word <= 0xfffe) { - printf ("ID_ATA_ROTATION_RATE_RPM=%d\n", word); - } - } + word = identify.wyde[217]; + if (word == 0x0001) + printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */ + else if (word >= 0x0401 && word <= 0xfffe) + printf ("ID_ATA_ROTATION_RATE_RPM=%d\n", word); /* * Words 108-111 contain a mandatory World Wide Name (WWN) in the NAA IEEE Registered identifier * format. Word 108 bits (15:12) shall contain 5h, indicating that the naming authority is IEEE. * All other values are reserved. */ - word = *((uint16_t *) identify + 108); - if ((word & 0xf000) == 0x5000) { - uint64_t wwwn; - - wwwn = *((uint16_t *) identify + 108); - wwwn <<= 16; - wwwn |= *((uint16_t *) identify + 109); - wwwn <<= 16; - wwwn |= *((uint16_t *) identify + 110); - wwwn <<= 16; - wwwn |= *((uint16_t *) identify + 111); - printf("ID_WWN=0x%llx\n", (unsigned long long int) wwwn); - /* ATA devices have no vendor extension */ - printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn); - } + word = identify.wyde[108]; + if ((word & 0xf000) == 0x5000) + printf("ID_WWN=0x%1$"PRIu64"x\n" + "ID_WWN_WITH_EXTENSION=0x%1$"PRIu64"x\n", + identify.octa[108/4]); /* from Linux's include/linux/ata.h */ - if (identify_words[0] == 0x848a || identify_words[0] == 0x844a) { + if (identify.wyde[0] == 0x848a || + identify.wyde[0] == 0x844a || + (identify.wyde[83] & 0xc004) == 0x4004) printf("ID_ATA_CFA=1\n"); - } else { - if ((identify_words[83] & 0xc004) == 0x4004) { - printf("ID_ATA_CFA=1\n"); - } - } } else { if (serial[0] != '\0') printf("%s_%s\n", model, serial); else printf("%s\n", model); } -close: - close(fd); -exit: - udev_unref(udev); - log_close(); - return rc; + + return 0; } diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index 48ceb657e..6052f6abd 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -891,11 +891,11 @@ int main(int argc, char *argv[]) break; case 'h': printf("Usage: cdrom_id [options] \n" - " --lock-media lock the media (to enable eject request events)\n" - " --unlock-media unlock the media\n" - " --eject-media eject the media\n" - " --debug debug to stderr\n" - " --help print this help text\n\n"); + " -l,--lock-media lock the media (to enable eject request events)\n" + " -u,--unlock-media unlock the media\n" + " -e,--eject-media eject the media\n" + " -d,--debug debug to stderr\n" + " -h,--help print this help text\n\n"); goto exit; default: rc = 1; @@ -1063,17 +1063,17 @@ work: if (cd_media_state != NULL) printf("ID_CDROM_MEDIA_STATE=%s\n", cd_media_state); if (cd_media_session_next > 0) - printf("ID_CDROM_MEDIA_SESSION_NEXT=%d\n", cd_media_session_next); + printf("ID_CDROM_MEDIA_SESSION_NEXT=%u\n", cd_media_session_next); if (cd_media_session_count > 0) - printf("ID_CDROM_MEDIA_SESSION_COUNT=%d\n", cd_media_session_count); + printf("ID_CDROM_MEDIA_SESSION_COUNT=%u\n", cd_media_session_count); if (cd_media_session_count > 1 && cd_media_session_last_offset > 0) printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset); if (cd_media_track_count > 0) - printf("ID_CDROM_MEDIA_TRACK_COUNT=%d\n", cd_media_track_count); + printf("ID_CDROM_MEDIA_TRACK_COUNT=%u\n", cd_media_track_count); if (cd_media_track_count_audio > 0) - printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%d\n", cd_media_track_count_audio); + printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%u\n", cd_media_track_count_audio); if (cd_media_track_count_data > 0) - printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%d\n", cd_media_track_count_data); + printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%u\n", cd_media_track_count_data); exit: if (fd >= 0) close(fd); diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c index 90df360eb..4bb6edbef 100644 --- a/src/udev/collect/collect.c +++ b/src/udev/collect/collect.c @@ -68,15 +68,19 @@ noreturn static void sig_alrm(int signo) static void usage(void) { - printf("usage: collect [--add|--remove] [--debug] \n" - "\n" + printf("%s [options] \n\n" + "Collect variables across events.\n\n" + " -h --help Print this message\n" + " -a --add Add ID to the list \n" + " -r --remove Remove ID from the list \n" + " -d --debug Debug to stderr\n\n" " Adds ID to the list governed by .\n" " must be part of the list .\n" " If all IDs given by are listed (ie collect has been\n" " invoked for each ID in ) collect returns 0, the\n" " number of missing IDs otherwise.\n" - " On error a negative number is returned.\n" - "\n"); + " On error a negative number is returned.\n\n" + , program_invocation_short_name); } /* @@ -153,7 +157,7 @@ static int checkout(int fd) if (!ptr && word < (buf + len)) { bufsize = bufsize << 1; if (debug) - fprintf(stderr, "ID overflow, restarting with size %zi\n", bufsize); + fprintf(stderr, "ID overflow, restarting with size %zu\n", bufsize); free(buf); lseek(fd, 0, SEEK_SET); goto restart; diff --git a/src/udev/mtd_probe/mtd_probe.h b/src/udev/mtd_probe/mtd_probe.h index 2a37ede57..d99be9add 100644 --- a/src/udev/mtd_probe/mtd_probe.h +++ b/src/udev/mtd_probe/mtd_probe.h @@ -17,6 +17,8 @@ * Boston, MA 02110-1301 USA */ +#pragma once + #include /* Full oob structure as written on the flash */ diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index 191ab68fa..b25e4b334 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -17,10 +17,10 @@ struct ConfigPerfItem; %includes %% Match.MACAddress, config_parse_hwaddr, 0, offsetof(link_config, match_mac) -Match.OriginalName, config_parse_ifname, 0, offsetof(link_config, match_name) -Match.Path, config_parse_string, 0, offsetof(link_config, match_path) -Match.Driver, config_parse_string, 0, offsetof(link_config, match_driver) -Match.Type, config_parse_string, 0, offsetof(link_config, match_type) +Match.OriginalName, config_parse_ifnames, 0, offsetof(link_config, match_name) +Match.Path, config_parse_strv, 0, offsetof(link_config, match_path) +Match.Driver, config_parse_strv, 0, offsetof(link_config, match_driver) +Match.Type, config_parse_strv, 0, offsetof(link_config, match_type) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(link_config, match_host) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(link_config, match_virt) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, match_kernel) diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index bf24f6a7f..8b3dc45d4 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -63,49 +63,41 @@ static const char* const link_dirs[] = { #endif NULL}; -DEFINE_TRIVIAL_CLEANUP_FUNC(link_config_ctx*, link_config_ctx_free); -#define _cleanup_link_config_ctx_free_ _cleanup_(link_config_ctx_freep) - -int link_config_ctx_new(link_config_ctx **ret) { - _cleanup_link_config_ctx_free_ link_config_ctx *ctx = NULL; - - if (!ret) - return -EINVAL; - - ctx = new0(link_config_ctx, 1); - if (!ctx) - return -ENOMEM; - - LIST_HEAD_INIT(ctx->links); - - ctx->ethtool_fd = -1; - - ctx->enable_name_policy = true; - - *ret = ctx; - ctx = NULL; +static void link_config_free(link_config *link) { + if (!link) + return; - return 0; + free(link->filename); + + free(link->match_mac); + free(link->match_path); + free(link->match_driver); + free(link->match_type); + free(link->match_name); + free(link->match_host); + free(link->match_virt); + free(link->match_kernel); + free(link->match_arch); + + free(link->description); + free(link->mac); + free(link->name_policy); + free(link->name); + free(link->alias); + + free(link); } +DEFINE_TRIVIAL_CLEANUP_FUNC(link_config*, link_config_free); + static void link_configs_free(link_config_ctx *ctx) { link_config *link, *link_next; if (!ctx) return; - LIST_FOREACH_SAFE(links, link, link_next, ctx->links) { - free(link->filename); - free(link->name); - free(link->match_path); - free(link->match_driver); - free(link->match_type); - free(link->description); - free(link->alias); - free(link->name_policy); - - free(link); - } + LIST_FOREACH_SAFE(links, link, link_next, ctx->links) + link_config_free(link); } void link_config_ctx_free(link_config_ctx *ctx) { @@ -123,8 +115,32 @@ void link_config_ctx_free(link_config_ctx *ctx) { return; } +DEFINE_TRIVIAL_CLEANUP_FUNC(link_config_ctx*, link_config_ctx_free); + +int link_config_ctx_new(link_config_ctx **ret) { + _cleanup_(link_config_ctx_freep) link_config_ctx *ctx = NULL; + + if (!ret) + return -EINVAL; + + ctx = new0(link_config_ctx, 1); + if (!ctx) + return -ENOMEM; + + LIST_HEAD_INIT(ctx->links); + + ctx->ethtool_fd = -1; + + ctx->enable_name_policy = true; + + *ret = ctx; + ctx = NULL; + + return 0; +} + static int load_link(link_config_ctx *ctx, const char *filename) { - _cleanup_free_ link_config *link = NULL; + _cleanup_(link_config_freep) link_config *link = NULL; _cleanup_fclose_ FILE *file = NULL; int r; @@ -422,9 +438,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, case MACPOLICY_PERSISTENT: if (mac_is_random(device)) { r = get_mac(device, false, &generated_mac); - if (r == -ENOENT) + if (r == -ENOENT) { + log_warning_errno(r, "Could not generate persistent MAC address for %s: %m", old_name); break; - else if (r < 0) + } else if (r < 0) return r; mac = &generated_mac; } @@ -432,9 +449,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, case MACPOLICY_RANDOM: if (!mac_is_random(device)) { r = get_mac(device, true, &generated_mac); - if (r == -ENOENT) + if (r == -ENOENT) { + log_warning_errno(r, "Could not generate random MAC address for %s: %m", old_name); break; - else if (r < 0) + } else if (r < 0) return r; mac = &generated_mac; } diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index 688f83614..cb434d1ae 100644 --- a/src/udev/net/link-config.h +++ b/src/udev/net/link-config.h @@ -52,10 +52,10 @@ struct link_config { char *filename; struct ether_addr *match_mac; - char *match_path; - char *match_driver; - char *match_type; - char *match_name; + char **match_path; + char **match_driver; + char **match_type; + char **match_name; Condition *match_host; Condition *match_virt; Condition *match_kernel; diff --git a/src/udev/scsi_id/scsi.h b/src/udev/scsi_id/scsi.h index c423cac57..3f99ae772 100644 --- a/src/udev/scsi_id/scsi.h +++ b/src/udev/scsi_id/scsi.h @@ -10,6 +10,8 @@ * Free Software Foundation version 2 of the License. */ +#pragma once + #include struct scsi_ioctl_command { diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index 27adb09d1..a1b8e75fa 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -304,18 +304,20 @@ static int get_file_options(struct udev *udev, } static void help(void) { - printf("Usage: scsi_id [OPTION...] DEVICE\n" - " -d,--device= device node for SG_IO commands\n" - " -f,--config= location of config file\n" - " -p,--page=0x80|0x83|pre-spc3-83 SCSI page (0x80, 0x83, pre-spc3-83)\n" - " -s,--sg-version=3|4 use SGv3 or SGv4\n" - " -b,--blacklisted treat device as blacklisted\n" - " -g,--whitelisted treat device as whitelisted\n" - " -u,--replace-whitespace replace all whitespace by underscores\n" - " -v,--verbose verbose logging\n" - " --version print version\n" - " -x,--export print values as environment keys\n" - " -h,--help print this help text\n\n"); + printf("Usage: %s [OPTION...] DEVICE\n\n" + "SCSI device identification.\n\n" + " -h --help Print this message\n" + " --version Print version of the program\n\n" + " -d --device= Device node for SG_IO commands\n" + " -f --config= Location of config file\n" + " -p --page=0x80|0x83|pre-spc3-83 SCSI page (0x80, 0x83, pre-spc3-83)\n" + " -s --sg-version=3|4 Use SGv3 or SGv4\n" + " -b --blacklisted Treat device as blacklisted\n" + " -g --whitelisted Treat device as whitelisted\n" + " -u --replace-whitespace Replace all whitespace by underscores\n" + " -v --verbose Verbose logging\n" + " -x --export Print values as environment keys\n" + , program_invocation_short_name); } @@ -606,7 +608,7 @@ int main(int argc, char **argv) exit(1); if (!dev_specified) { - log_error("no device specified"); + log_error("No device specified."); retval = 1; goto exit; } diff --git a/src/udev/scsi_id/scsi_id.h b/src/udev/scsi_id/scsi_id.h index 648b5ce42..141b116a8 100644 --- a/src/udev/scsi_id/scsi_id.h +++ b/src/udev/scsi_id/scsi_id.h @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +#pragma once + #define MAX_PATH_LEN 512 /* diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index 810f27d1d..03e3dc286 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -221,6 +221,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t blkid_probe pr; const char *data; const char *name; + const char *prtype = NULL; int nvals; int i; int err = 0; @@ -256,7 +257,8 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE | - BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION); + BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION | + BLKID_SUBLKS_BADCSUM); if (noraid) blkid_probe_filter_superblocks_usage(pr, BLKID_FLTR_NOTIN, BLKID_USAGE_RAID); @@ -271,13 +273,22 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t if (err < 0) goto out; - log_debug("probe %s %sraid offset=%"PRIu64, + log_debug("probe %s %sraid offset=%"PRIi64, udev_device_get_devnode(dev), noraid ? "no" : "", offset); err = probe_superblocks(pr); if (err < 0) goto out; + if (blkid_probe_has_value(pr, "SBBADCSUM")) { + if (!blkid_probe_lookup_value(pr, "TYPE", &prtype, NULL)) + log_warning("incorrect %s checksum on %s", + prtype, udev_device_get_devnode(dev)); + else + log_warning("incorrect checksum on %s", + udev_device_get_devnode(dev)); + goto out; + } /* If we are a partition then our parent passed on the root * partition UUID to us */ @@ -314,6 +325,6 @@ out: const struct udev_builtin udev_builtin_blkid = { .name = "blkid", .cmd = builtin_blkid, - .help = "filesystem and partition probing", + .help = "Filesystem and partition probing", .run_once = true, }; diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c index 2e2112fd9..3643596a7 100644 --- a/src/udev/udev-builtin-btrfs.c +++ b/src/udev/udev-builtin-btrfs.c @@ -24,6 +24,7 @@ #include #include #include + #ifdef HAVE_LINUX_BTRFS_H #include #endif @@ -32,7 +33,7 @@ #include "udev.h" static int builtin_btrfs(struct udev_device *dev, int argc, char *argv[], bool test) { - struct btrfs_ioctl_vol_args args; + struct btrfs_ioctl_vol_args args = {}; _cleanup_close_ int fd = -1; int err; @@ -48,7 +49,7 @@ static int builtin_btrfs(struct udev_device *dev, int argc, char *argv[], bool t if (err < 0) return EXIT_FAILURE; - udev_builtin_add_property(dev, test, "ID_BTRFS_READY", err == 0 ? "1" : "0"); + udev_builtin_add_property(dev, test, "ID_BTRFS_READY", one_zero(err == 0)); return EXIT_SUCCESS; } diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c index 695a31a12..95476648f 100644 --- a/src/udev/udev-builtin-hwdb.c +++ b/src/udev/udev-builtin-hwdb.c @@ -27,36 +27,34 @@ #include #include "udev.h" +#include "sd-hwdb.h" -static struct udev_hwdb *hwdb; +#include "hwdb-util.h" + +static sd_hwdb *hwdb; int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, const char *modalias, const char *filter, bool test) { - struct udev_list_entry *list; - struct udev_list_entry *entry; + _cleanup_free_ const char *lookup = NULL; + const char *key, *value; int n = 0; if (!hwdb) return -ENOENT; if (prefix) { - _cleanup_free_ const char *lookup; - lookup = strjoin(prefix, modalias, NULL); if (!lookup) return -ENOMEM; - list = udev_hwdb_get_properties_list_entry(hwdb, lookup, 0); - } else - list = udev_hwdb_get_properties_list_entry(hwdb, modalias, 0); + modalias = lookup; + } - udev_list_entry_foreach(entry, list) { - if (filter && fnmatch(filter, udev_list_entry_get_name(entry), FNM_NOESCAPE) != 0) + SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) { + if (filter && fnmatch(filter, key, FNM_NOESCAPE) != 0) continue; - if (udev_builtin_add_property(dev, test, - udev_list_entry_get_name(entry), - udev_list_entry_get_value(entry)) < 0) + if (udev_builtin_add_property(dev, test, key, value) < 0) return -ENOMEM; n++; } @@ -190,22 +188,26 @@ static int builtin_hwdb(struct udev_device *dev, int argc, char *argv[], bool te /* called at udev startup and reload */ static int builtin_hwdb_init(struct udev *udev) { + int r; + if (hwdb) return 0; - hwdb = udev_hwdb_new(udev); - if (!hwdb) - return -ENOMEM; + + r = sd_hwdb_new(&hwdb); + if (r < 0) + return r; + return 0; } /* called on udev shutdown and reload request */ static void builtin_hwdb_exit(struct udev *udev) { - hwdb = udev_hwdb_unref(hwdb); + hwdb = sd_hwdb_unref(hwdb); } /* called every couple of seconds during event activity; 'true' if config has changed */ static bool builtin_hwdb_validate(struct udev *udev) { - return udev_hwdb_validate(hwdb); + return hwdb_validate(hwdb); } const struct udev_builtin udev_builtin_hwdb = { @@ -214,5 +216,5 @@ const struct udev_builtin udev_builtin_hwdb = { .init = builtin_hwdb_init, .exit = builtin_hwdb_exit, .validate = builtin_hwdb_validate, - .help = "hardware database", + .help = "Hardware database", }; diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index 1a1121ef9..46f1c539d 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -1,9 +1,11 @@ /* - * compose persistent device path + * expose input properties via udev * * Copyright (C) 2009 Martin Pitt * Portions Copyright (C) 2004 David Zeuthen, * Copyright (C) 2011 Kay Sievers + * Copyright (C) 2014 Carlos Garnacho + * Copyright (C) 2014 David Herrmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +31,7 @@ #include #include "udev.h" +#include "util.h" /* we must use this kernel-compatible implementation */ #define BITS_PER_LONG (sizeof(unsigned long) * 8) @@ -38,6 +41,34 @@ #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) +static inline int abs_size_mm(const struct input_absinfo *absinfo) { + /* Resolution is defined to be in units/mm for ABS_X/Y */ + return (absinfo->maximum - absinfo->minimum) / absinfo->resolution; +} + +static void extract_info(struct udev_device *dev, const char *devpath, bool test) { + char width[DECIMAL_STR_MAX(int)], height[DECIMAL_STR_MAX(int)]; + struct input_absinfo xabsinfo = {}, yabsinfo = {}; + _cleanup_close_ int fd = -1; + + fd = open(devpath, O_RDONLY|O_CLOEXEC); + if (fd < 0) + return; + + if (ioctl(fd, EVIOCGABS(ABS_X), &xabsinfo) < 0 || + ioctl(fd, EVIOCGABS(ABS_Y), &yabsinfo) < 0) + return; + + if (xabsinfo.resolution <= 0 || yabsinfo.resolution <= 0) + return; + + snprintf(width, sizeof(width), "%d", abs_size_mm(&xabsinfo)); + snprintf(height, sizeof(height), "%d", abs_size_mm(&yabsinfo)); + + udev_builtin_add_property(dev, test, "ID_INPUT_WIDTH_MM", width); + udev_builtin_add_property(dev, test, "ID_INPUT_HEIGHT_MM", height); +} + /* * Read a capability attribute and return bitmask. * @param dev udev_device @@ -48,12 +79,17 @@ static void get_cap_mask(struct udev_device *dev, struct udev_device *pdev, const char* attr, unsigned long *bitmask, size_t bitmask_size, bool test) { + const char *v; char text[4096]; unsigned i; char* word; unsigned long val; - snprintf(text, sizeof(text), "%s", udev_device_get_sysattr_value(pdev, attr)); + v = udev_device_get_sysattr_value(pdev, attr); + if (!v) + v = ""; + + snprintf(text, sizeof(text), "%s", v); log_debug("%s raw kernel attribute: %s", attr, text); memzero(bitmask, bitmask_size); @@ -75,7 +111,7 @@ static void get_cap_mask(struct udev_device *dev, if (test) { /* printf pattern with the right unsigned long number of hex chars */ - snprintf(text, sizeof(text), " bit %%4u: %%0%zilX\n", 2 * sizeof(unsigned long)); + snprintf(text, sizeof(text), " bit %%4u: %%0%zulX\n", 2 * sizeof(unsigned long)); log_debug("%s decoded bit map:", attr); val = bitmask_size / sizeof (unsigned long); /* skip over leading zeros */ @@ -196,6 +232,7 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo unsigned long bitmask_abs[NBITS(ABS_MAX)]; unsigned long bitmask_key[NBITS(KEY_MAX)]; unsigned long bitmask_rel[NBITS(REL_MAX)]; + const char *sysname, *devnode; /* walk up the parental chain until we find the real input device; the * argument is very likely a subdevice of this, like eventN */ @@ -203,24 +240,28 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo while (pdev != NULL && udev_device_get_sysattr_value(pdev, "capabilities/ev") == NULL) pdev = udev_device_get_parent_with_subsystem_devtype(pdev, "input", NULL); - /* not an "input" class device */ - if (pdev == NULL) - return EXIT_SUCCESS; - - /* Use this as a flag that input devices were detected, so that this - * program doesn't need to be called more than once per device */ - udev_builtin_add_property(dev, test, "ID_INPUT", "1"); - get_cap_mask(dev, pdev, "capabilities/ev", bitmask_ev, sizeof(bitmask_ev), test); - get_cap_mask(dev, pdev, "capabilities/abs", bitmask_abs, sizeof(bitmask_abs), test); - get_cap_mask(dev, pdev, "capabilities/rel", bitmask_rel, sizeof(bitmask_rel), test); - get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test); - test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel, test); - test_key(dev, bitmask_ev, bitmask_key, test); + if (pdev) { + /* Use this as a flag that input devices were detected, so that this + * program doesn't need to be called more than once per device */ + udev_builtin_add_property(dev, test, "ID_INPUT", "1"); + get_cap_mask(dev, pdev, "capabilities/ev", bitmask_ev, sizeof(bitmask_ev), test); + get_cap_mask(dev, pdev, "capabilities/abs", bitmask_abs, sizeof(bitmask_abs), test); + get_cap_mask(dev, pdev, "capabilities/rel", bitmask_rel, sizeof(bitmask_rel), test); + get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test); + test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel, test); + test_key(dev, bitmask_ev, bitmask_key, test); + } + + devnode = udev_device_get_devnode(dev); + sysname = udev_device_get_sysname(dev); + if (devnode && sysname && startswith(sysname, "event")) + extract_info(dev, devnode, test); + return EXIT_SUCCESS; } const struct udev_builtin udev_builtin_input_id = { .name = "input_id", .cmd = builtin_input_id, - .help = "input device properties", + .help = "Input device properties", }; diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c index 273b27ddc..d8ee4cbb6 100644 --- a/src/udev/udev-builtin-keyboard.c +++ b/src/udev/udev-builtin-keyboard.c @@ -28,17 +28,17 @@ #include "udev.h" -static const struct key *keyboard_lookup_key(const char *str, unsigned int len); +static const struct key *keyboard_lookup_key(const char *str, unsigned len); #include "keyboard-keys-from-name.h" #include "keyboard-keys-to-name.h" -static int install_force_release(struct udev_device *dev, const unsigned int *release, unsigned int release_count) { +static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) { struct udev_device *atkbd; const char *cur; char codes[4096]; char *s; size_t l; - unsigned int i; + unsigned i; int ret; atkbd = udev_device_get_parent_with_subsystem_devtype(dev, "serio", NULL); @@ -57,7 +57,7 @@ static int install_force_release(struct udev_device *dev, const unsigned int *re /* append new codes */ for (i = 0; i < release_count; i++) - l = strpcpyf(&s, l, ",%d", release[i]); + l = strpcpyf(&s, l, ",%u", release[i]); log_debug("keyboard: updating force-release list with '%s'", codes); ret = udev_device_set_sysattr_value(atkbd, "force_release", codes); @@ -69,16 +69,16 @@ static int install_force_release(struct udev_device *dev, const unsigned int *re static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], bool test) { struct udev_list_entry *entry; struct { - unsigned int scan; - unsigned int key; + unsigned scan; + unsigned key; } map[1024]; - unsigned int map_count = 0; - unsigned int release[1024]; - unsigned int release_count = 0; + unsigned map_count = 0; + unsigned release[1024]; + unsigned release_count = 0; udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev)) { const char *key; - unsigned int scancode, keycode_num; + unsigned scancode, keycode_num; char *endptr; const char *keycode; const struct key *k; @@ -130,7 +130,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo if (map_count > 0 || release_count > 0) { const char *node; int fd; - unsigned int i; + unsigned i; node = udev_device_get_devnode(dev); if (!node) { @@ -165,5 +165,5 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo const struct udev_builtin udev_builtin_keyboard = { .name = "keyboard", .cmd = builtin_keyboard, - .help = "keyboard scan code to key mapping", + .help = "Keyboard scan code to key mapping", }; diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c index 0949d9fad..ad2829e50 100644 --- a/src/udev/udev-builtin-kmod.c +++ b/src/udev/udev-builtin-kmod.c @@ -122,6 +122,6 @@ const struct udev_builtin udev_builtin_kmod = { .init = builtin_kmod_init, .exit = builtin_kmod_exit, .validate = builtin_kmod_validate, - .help = "kernel module loader", + .help = "Kernel module loader", .run_once = false, }; diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 3e2c8f8a6..37ff1b800 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -153,7 +153,7 @@ static bool is_pci_multifunction(struct udev_device *dev) { const char *filename; uint8_t config[64]; - filename = strappenda(udev_device_get_syspath(dev), "/config"); + filename = strjoina(udev_device_get_syspath(dev), "/config"); f = fopen(filename, "re"); if (!f) return false; @@ -191,12 +191,12 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) { s = names->pci_path; l = sizeof(names->pci_path); if (domain > 0) - l = strpcpyf(&s, l, "P%d", domain); - l = strpcpyf(&s, l, "p%ds%d", bus, slot); + l = strpcpyf(&s, l, "P%u", domain); + l = strpcpyf(&s, l, "p%us%u", bus, slot); if (func > 0 || is_pci_multifunction(names->pcidev)) - l = strpcpyf(&s, l, "f%d", func); + l = strpcpyf(&s, l, "f%u", func); if (dev_port > 0) - l = strpcpyf(&s, l, "d%d", dev_port); + l = strpcpyf(&s, l, "d%u", dev_port); if (l == 0) names->pci_path[0] = '\0'; @@ -307,7 +307,7 @@ static int names_usb(struct udev_device *dev, struct netnames *names) { s[0] = '\0'; interf = s+1; - /* prefix every port number in the chain with "u"*/ + /* prefix every port number in the chain with "u" */ s = ports; while ((s = strchr(s, '.'))) s[0] = 'u'; @@ -562,5 +562,5 @@ out: const struct udev_builtin udev_builtin_net_id = { .name = "net_id", .cmd = builtin_net_id, - .help = "network device properties", + .help = "Network device properties", }; diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c index 87d10bf78..d4589470f 100644 --- a/src/udev/udev-builtin-net_setup_link.c +++ b/src/udev/udev-builtin-net_setup_link.c @@ -27,7 +27,7 @@ static link_config_ctx *ctx = NULL; static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv, bool test) { _cleanup_free_ char *driver = NULL; - const char *name; + const char *name = NULL; link_config *link; int r; @@ -103,6 +103,6 @@ const struct udev_builtin udev_builtin_net_setup_link = { .init = builtin_net_setup_link_init, .exit = builtin_net_setup_link_exit, .validate = builtin_net_setup_link_validate, - .help = "configure network link", + .help = "Configure network link", .run_once = false, }; diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index d540ba839..b6749aab7 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -703,6 +703,6 @@ out: const struct udev_builtin udev_builtin_path_id = { .name = "path_id", .cmd = builtin_path_id, - .help = "compose persistent device path", + .help = "Compose persistent device path", .run_once = true, }; diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c index 591915435..b78c09b91 100644 --- a/src/udev/udev-builtin-uaccess.c +++ b/src/udev/udev-builtin-uaccess.c @@ -89,5 +89,5 @@ finish: const struct udev_builtin udev_builtin_uaccess = { .name = "uaccess", .cmd = builtin_uaccess, - .help = "manage device node user ACL", + .help = "Manage device node user ACL", }; diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c index 06d419158..ab0d96e37 100644 --- a/src/udev/udev-builtin-usb_id.c +++ b/src/udev/udev-builtin-usb_id.c @@ -471,6 +471,6 @@ fallback: const struct udev_builtin udev_builtin_usb_id = { .name = "usb_id", .cmd = builtin_usb_id, - .help = "usb device properties", + .help = "USB device properties", .run_once = true, }; diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c index 3bcbd6e82..1950ec23a 100644 --- a/src/udev/udev-builtin.c +++ b/src/udev/udev-builtin.c @@ -88,7 +88,7 @@ void udev_builtin_list(struct udev *udev) { unsigned int i; for (i = 0; i < ELEMENTSOF(builtins); i++) - fprintf(stderr, " %-12s %s\n", builtins[i]->name, builtins[i]->help); + fprintf(stderr, " %-14s %s\n", builtins[i]->name, builtins[i]->help); } const char *udev_builtin_name(enum udev_builtin_cmd cmd) { diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index 9cece4a85..7b5ef6b2a 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -198,7 +198,7 @@ struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl) { goto err; } if (ucred.uid > 0) { - log_error("sender uid=%i, message ignored", ucred.uid); + log_error("sender uid="UID_FMT", message ignored", ucred.uid); goto err; } @@ -386,7 +386,7 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) { } if (cred->uid != 0) { - log_error("sender uid=%i, message ignored", cred->uid); + log_error("sender uid="UID_FMT", message ignored", cred->uid); goto err; } diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 6b184303d..bc115f112 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -218,14 +218,14 @@ subst: case SUBST_MAJOR: { char num[UTIL_PATH_SIZE]; - sprintf(num, "%d", major(udev_device_get_devnum(dev))); + sprintf(num, "%u", major(udev_device_get_devnum(dev))); l = strpcpy(&s, l, num); break; } case SUBST_MINOR: { char num[UTIL_PATH_SIZE]; - sprintf(num, "%d", minor(udev_device_get_devnum(dev))); + sprintf(num, "%u", minor(udev_device_get_devnum(dev))); l = strpcpy(&s, l, num); break; } @@ -509,7 +509,7 @@ static void spawn_read(struct udev_event *event, memcpy(&result[respos], buf, count); respos += count; } else { - log_error("'%s' ressize %zd too short", cmd, ressize); + log_error("'%s' ressize %zu too short", cmd, ressize); } } @@ -580,7 +580,7 @@ static int spawn_wait(struct udev_event *event, goto out; } if (fdcount == 0) { - log_warning("slow: '%s' [%u]", cmd, pid); + log_warning("slow: '%s' ["PID_FMT"]", cmd, pid); fdcount = poll(pfd, 1, timeout); if (fdcount < 0) { @@ -591,7 +591,7 @@ static int spawn_wait(struct udev_event *event, goto out; } if (fdcount == 0) { - log_error("timeout: killing '%s' [%u]", cmd, pid); + log_error("timeout: killing '%s' ["PID_FMT"]", cmd, pid); kill(pid, SIGKILL); } } @@ -613,20 +613,20 @@ static int spawn_wait(struct udev_event *event, if (waitpid(pid, &status, WNOHANG) < 0) break; if (WIFEXITED(status)) { - log_debug("'%s' [%u] exit with return code %i", cmd, pid, WEXITSTATUS(status)); + log_debug("'%s' ["PID_FMT"] exit with return code %i", cmd, pid, WEXITSTATUS(status)); if (WEXITSTATUS(status) != 0) err = -1; } else if (WIFSIGNALED(status)) { - log_error("'%s' [%u] terminated by signal %i (%s)", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status))); + log_error("'%s' ["PID_FMT"] terminated by signal %i (%s)", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status))); err = -1; } else if (WIFSTOPPED(status)) { - log_error("'%s' [%u] stopped", cmd, pid); + log_error("'%s' ["PID_FMT"] stopped", cmd, pid); err = -1; } else if (WIFCONTINUED(status)) { - log_error("'%s' [%u] continued", cmd, pid); + log_error("'%s' ["PID_FMT"] continued", cmd, pid); err = -1; } else { - log_error("'%s' [%u] exit with status 0x%04x", cmd, pid, status); + log_error("'%s' ["PID_FMT"] exit with status 0x%04x", cmd, pid, status); err = -1; } pid = 0; @@ -809,11 +809,8 @@ void udev_event_execute_rules(struct udev_event *event, if (major(udev_device_get_devnum(dev)) != 0) udev_node_remove(dev); } else { - event->dev_db = udev_device_new(event->udev); + event->dev_db = udev_device_shallow_clone(dev); if (event->dev_db != NULL) { - udev_device_set_syspath(event->dev_db, udev_device_get_syspath(dev)); - udev_device_set_subsystem(event->dev_db, udev_device_get_subsystem(dev)); - udev_device_set_devnum(event->dev_db, udev_device_get_devnum(dev)); udev_device_read_db(event->dev_db, NULL); udev_device_set_info_loaded(event->dev_db); @@ -833,7 +830,7 @@ void udev_event_execute_rules(struct udev_event *event, key = udev_list_entry_get_name(entry); value = udev_list_entry_get_value(entry); - property = udev_device_add_property(event->dev, key, value); + property = udev_device_add_property(dev, key, value); udev_list_entry_set_num(property, true); } } @@ -846,23 +843,25 @@ void udev_event_execute_rules(struct udev_event *event, /* rename a new network interface, if needed */ if (udev_device_get_ifindex(dev) > 0 && streq(udev_device_get_action(dev), "add") && event->name != NULL && !streq(event->name, udev_device_get_sysname(dev))) { - char syspath[UTIL_PATH_SIZE]; - char *pos; int r; r = rename_netif(event); - if (r >= 0) { - /* remember old name */ - udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); + if (r < 0) + log_warning_errno(r, "could not rename interface '%d' from '%s' to '%s': %m", udev_device_get_ifindex(dev), + udev_device_get_sysname(dev), event->name); + else { + const char *interface_old; - /* now change the devpath, because the kernel device name has changed */ - strscpy(syspath, sizeof(syspath), udev_device_get_syspath(dev)); - pos = strrchr(syspath, '/'); - if (pos != NULL) { - pos++; - strscpy(pos, sizeof(syspath) - (pos - syspath), event->name); - udev_device_set_syspath(event->dev, syspath); - udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); + /* remember old name */ + interface_old = udev_device_get_sysname(dev); + + r = udev_device_rename(dev, event->name); + if (r < 0) + log_warning_errno(r, "renamed interface '%d' from '%s' to '%s', but could not update udev_device: %m", + udev_device_get_ifindex(dev), udev_device_get_sysname(dev), event->name); + else { + udev_device_add_property(dev, "INTERFACE_OLD", interface_old); + udev_device_add_property(dev, "INTERFACE", event->name); log_debug("changed devpath to '%s'", udev_device_get_devpath(dev)); } } diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index c30a428ea..793b48469 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -31,6 +31,7 @@ #include "udev.h" #include "smack-util.h" +#include "selinux-util.h" static int node_symlink(struct udev_device *dev, const char *node, const char *slink) { struct stat stats; @@ -340,7 +341,7 @@ void udev_node_add(struct udev_device *dev, bool apply, char filename[UTIL_PATH_SIZE]; struct udev_list_entry *list_entry; - log_debug("handling device node '%s', devnum=%s, mode=%#o, uid=%d, gid=%d", + log_debug("handling device node '%s', devnum=%s, mode=%#o, uid="UID_FMT", gid="GID_FMT, udev_device_get_devnode(dev), udev_device_get_id_filename(dev), mode, uid, gid); if (node_permissions_apply(dev, apply, mode, uid, gid, seclabel_list) < 0) diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c index 6e3bc2ae9..6af7163d4 100644 --- a/src/udev/udevadm-control.c +++ b/src/udev/udevadm-control.c @@ -29,16 +29,19 @@ #include "udev-util.h" static void print_help(void) { - printf("Usage: udevadm control COMMAND\n" - " -e,--exit instruct the daemon to cleanup and exit\n" - " -l,--log-priority=LEVEL set the udev log level for the daemon\n" - " -s,--stop-exec-queue do not execute events, queue only\n" - " -S,--start-exec-queue execute events, flush queue\n" - " -R,--reload reload rules and databases\n" - " -p,--property=KEY=VALUE set a global property for all events\n" - " -m,--children-max=N maximum number of children\n" - " --timeout=SECONDS maximum time to block for a reply\n" - " -h,--help print this help text\n\n"); + printf("%s control COMMAND\n\n" + "Control the udev daemon.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -e --exit Instruct the daemon to cleanup and exit\n" + " -l --log-priority=LEVEL Set the udev log level for the daemon\n" + " -s --stop-exec-queue Do not execute events, queue only\n" + " -S --start-exec-queue Execute events, flush queue\n" + " -R --reload Reload rules and databases\n" + " -p --property=KEY=VALUE Set a global property for all events\n" + " -m --children-max=N Maximum number of children\n" + " --timeout=SECONDS Maximum time to block for a reply\n" + , program_invocation_short_name); } static int adm_control(struct udev *udev, int argc, char *argv[]) { @@ -161,5 +164,5 @@ static int adm_control(struct udev *udev, int argc, char *argv[]) { const struct udevadm_cmd udevadm_control = { .name = "control", .cmd = adm_control, - .help = "control the udev daemon", + .help = "Control the udev daemon", }; diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c index a5870d1ce..d65e40c01 100644 --- a/src/udev/udevadm-hwdb.c +++ b/src/udev/udevadm-hwdb.c @@ -28,7 +28,8 @@ #include "conf-files.h" #include "udev.h" -#include "libudev-hwdb-def.h" +#include "hwdb-internal.h" +#include "hwdb-util.h" /* * Generic udev properties, key/value database based on modalias strings. @@ -400,7 +401,7 @@ static int trie_store(struct trie *trie, const char *filename) { } log_debug("=== trie on-disk ==="); - log_debug("size: %8"PRIu64" bytes", size); + log_debug("size: %8"PRIi64" bytes", size); log_debug("header: %8zu bytes", sizeof(struct trie_header_f)); log_debug("nodes: %8"PRIu64" bytes (%8"PRIu64")", t.nodes_count * sizeof(struct trie_node_f), t.nodes_count); @@ -662,14 +663,15 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) { } if (test) { - struct udev_hwdb *hwdb = udev_hwdb_new(udev); + _cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL; + int r; - if (hwdb) { - struct udev_list_entry *entry; + r = sd_hwdb_new(&hwdb); + if (r >= 0) { + const char *key, *value; - udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, test, 0)) - printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry)); - udev_hwdb_unref(hwdb); + SD_HWDB_FOREACH_PROPERTY(hwdb, test, key, value) + printf("%s=%s\n", key, value); } } out: @@ -685,5 +687,4 @@ out: const struct udevadm_cmd udevadm_hwdb = { .name = "hwdb", .cmd = adm_hwdb, - .help = "maintain the hardware database index", }; diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index a56f15954..0bab01a23 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -162,12 +162,12 @@ static int stat_device(const char *name, bool export, const char *prefix) { if (export) { if (prefix == NULL) prefix = "INFO_"; - printf("%sMAJOR=%d\n" - "%sMINOR=%d\n", + printf("%sMAJOR=%u\n" + "%sMINOR=%u\n", prefix, major(statbuf.st_dev), prefix, minor(statbuf.st_dev)); } else - printf("%d:%d\n", major(statbuf.st_dev), minor(statbuf.st_dev)); + printf("%u:%u\n", major(statbuf.st_dev), minor(statbuf.st_dev)); return 0; } @@ -258,6 +258,31 @@ static void cleanup_db(struct udev *udev) { } } +static void help(void) { + + printf("%s info [OPTIONS] [DEVPATH|FILE]\n\n" + "Query sysfs or the udev database.\n\n" + " -h --help Print this message\n" + " --version Print version of the program\n" + " -q --query=TYPE Query device information:\n" + " name Name of device node\n" + " symlink Pointing to node\n" + " path sysfs device path\n" + " property The device properties\n" + " all All values\n" + " -p --path=SYSPATH sysfs device path used for query or attribute walk\n" + " -n --name=NAME Node or symlink name used for query or attribute walk\n" + " -r --root Prepend dev directory to path names\n" + " -a --attribute-walk Print all key matches walking along the chain\n" + " of parent devices\n" + " -d --device-id-of-file=FILE Print major:minor of device containing this file\n" + " -x --export Export key/value pairs\n" + " -P --export-prefix Export the key name with a prefix\n" + " -e --export-db Export the content of the udev database\n" + " -c --cleanup-db Clean up the udev database\n" + , program_invocation_short_name); +} + static int uinfo(struct udev *udev, int argc, char *argv[]) { _cleanup_udev_device_unref_ struct udev_device *device = NULL; bool root = 0; @@ -283,27 +308,6 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) { {} }; - static const char *usage = - "Usage: udevadm info [OPTIONS] [DEVPATH|FILE]\n" - " -q,--query=TYPE query device information:\n" - " name name of device node\n" - " symlink pointing to node\n" - " path sys device path\n" - " property the device properties\n" - " all all values\n" - " -p,--path=SYSPATH sys device path used for query or attribute walk\n" - " -n,--name=NAME node or symlink name used for query or attribute walk\n" - " -r,--root prepend dev directory to path names\n" - " -a,--attribute-walk print all key matches walking along the chain\n" - " of parent devices\n" - " -d,--device-id-of-file=FILE print major:minor of device containing this file\n" - " -x,--export export key/value pairs\n" - " -P,--export-prefix export the key name with a prefix\n" - " -e,--export-db export the content of the udev database\n" - " -c,--cleanup-db cleanup the udev database\n" - " --version print version of the program\n" - " -h,--help print this message\n"; - enum action_type { ACTION_QUERY, ACTION_ATTRIBUTE_WALK, @@ -388,7 +392,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) { printf("%s\n", VERSION); return 0; case 'h': - printf("%s\n", usage); + help(); return 0; default: return 1; @@ -398,7 +402,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) { case ACTION_QUERY: if (!device) { if (!argv[optind]) { - fprintf(stderr, "%s\n", usage); + help(); return 2; } device = find_device(udev, argv[optind], NULL); @@ -489,5 +493,5 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) { const struct udevadm_cmd udevadm_info = { .name = "info", .cmd = uinfo, - .help = "query sysfs or the udev database", + .help = "Query sysfs or the udev database", }; diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c index 1a5f516dd..15ded0933 100644 --- a/src/udev/udevadm-monitor.c +++ b/src/udev/udevadm-monitor.c @@ -64,13 +64,16 @@ static void print_device(struct udev_device *device, const char *source, int pro } static void help(void) { - printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n" - " -p,--property print the event properties\n" - " -k,--kernel print kernel uevents\n" - " -u,--udev print udev events\n" - " -s,--subsystem-match=SUBSYSTEM[/DEVTYPE] filter events by subsystem\n" - " -t,--tag-match=TAG filter events by tag\n" - " -h,--help\n\n"); + printf("%s monitor [--property] [--kernel] [--udev] [--help]\n\n" + "Listen to kernel and udev events.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -p --property Print the event properties\n" + " -k --kernel Print kernel uevents\n" + " -u --udev Print udev events\n" + " -s --subsystem-match=SUBSYSTEM[/DEVTYPE] Filter events by subsystem\n" + " -t --tag-match=TAG Filter events by tag\n" + , program_invocation_short_name); } static int adm_monitor(struct udev *udev, int argc, char *argv[]) { @@ -276,5 +279,5 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[]) { const struct udevadm_cmd udevadm_monitor = { .name = "monitor", .cmd = adm_monitor, - .help = "listen to kernel and udev events", + .help = "Listen to kernel and udev events", }; diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index ddcf1ddf9..fff5de7a8 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -37,20 +37,23 @@ #include "util.h" static void help(void) { - printf("Usage: udevadm settle OPTIONS\n" - " -t,--timeout= maximum time to wait for events\n" - " -E,--exit-if-exists= stop waiting if file exists\n" - " -h,--help\n\n"); + printf("%s settle OPTIONS\n\n" + "Wait for pending udev events.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -t --timeout=SECONDS Maximum time to wait for events\n" + " -E --exit-if-exists=FILE Stop waiting if file exists\n" + , program_invocation_short_name); } static int adm_settle(struct udev *udev, int argc, char *argv[]) { static const struct option options[] = { - { "seq-start", required_argument, NULL, '\0' }, /* removed */ - { "seq-end", required_argument, NULL, '\0' }, /* removed */ { "timeout", required_argument, NULL, 't' }, { "exit-if-exists", required_argument, NULL, 'E' }, - { "quiet", no_argument, NULL, 'q' }, /* removed */ { "help", no_argument, NULL, 'h' }, + { "seq-start", required_argument, NULL, 's' }, /* removed */ + { "seq-end", required_argument, NULL, 'e' }, /* removed */ + { "quiet", no_argument, NULL, 'q' }, /* removed */ {} }; const char *exists = NULL; @@ -60,8 +63,9 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { struct udev_queue *queue; int rc = EXIT_FAILURE; - while ((c = getopt_long(argc, argv, "s:e:t:E:qh", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "t:E:hs:e:q", options, NULL)) >= 0) { switch (c) { + case 't': { int r; @@ -73,14 +77,24 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { }; break; } + case 'E': exists = optarg; break; + case 'h': help(); return EXIT_SUCCESS; + + case 's': + case 'e': + case 'q': + log_info("Option -%c no longer supported.", c); + return EXIT_FAILURE; + case '?': return EXIT_FAILURE; + default: assert_not_reached("Unknown argument"); } @@ -145,5 +159,5 @@ out: const struct udevadm_cmd udevadm_settle = { .name = "settle", .cmd = adm_settle, - .help = "wait for pending udev events", + .help = "Wait for pending udev events", }; diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c index a300e1e9d..baaeca935 100644 --- a/src/udev/udevadm-test-builtin.c +++ b/src/udev/udevadm-test-builtin.c @@ -27,17 +27,21 @@ #include #include #include -#include +#include #include #include #include "udev.h" static void help(struct udev *udev) { - fprintf(stderr, "\n"); - fprintf(stderr, "Usage: udevadm builtin [--help] COMMAND SYSPATH\n"); + printf("%s builtin [--help] COMMAND SYSPATH\n\n" + "Test a built-in command.\n\n" + " -h --help Print this message\n" + " --version Print version of the program\n\n" + "Commands:\n" + , program_invocation_short_name); + udev_builtin_list(udev); - fprintf(stderr, "\n"); } static int adm_builtin(struct udev *udev, int argc, char *argv[]) { @@ -112,6 +116,6 @@ out: const struct udevadm_cmd udevadm_test_builtin = { .name = "test-builtin", .cmd = adm_builtin, - .help = "test a built-in command", + .help = "Test a built-in command", .debug = true, }; diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index d9d61b42d..4922b5b6a 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -31,6 +31,17 @@ #include "udev.h" #include "udev-util.h" +static void help(void) { + + printf("%s test OPTIONS \n\n" + "Test an event run.\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -a --action=ACTION Set action string\n" + " -N --resolve-names=early|late|never When to resolve names\n" + , program_invocation_short_name); +} + static int adm_test(struct udev *udev, int argc, char *argv[]) { int resolve_names = 1; char filename[UTIL_PATH_SIZE]; @@ -71,11 +82,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) { } break; case 'h': - printf("Usage: udevadm test OPTIONS \n" - " -a,--action=ACTION set action string\n" - " -N,--resolve-names=early|late|never when to resolve names\n" - " -h,--help print this help string\n" - "\n"); + help(); exit(EXIT_SUCCESS); case '?': exit(EXIT_FAILURE); @@ -161,6 +168,6 @@ out: const struct udevadm_cmd udevadm_test = { .name = "test", .cmd = adm_test, - .help = "test an event run", + .help = "Test an event run", .debug = true, }; diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 4308466b8..4dc756a28 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -73,23 +73,26 @@ static const char *keyval(const char *str, const char **val, char *buf, size_t s } static void help(void) { - printf("Usage: udevadm trigger OPTIONS\n" - " -v,--verbose print the list of devices while running\n" - " -n,--dry-run do not actually trigger the events\n" - " -t,--type= type of events to trigger\n" - " devices sys devices (default)\n" - " subsystems sys subsystems and drivers\n" - " -c,--action= event action value, default is \"change\"\n" - " -s,--subsystem-match= trigger devices from a matching subsystem\n" - " -S,--subsystem-nomatch= exclude devices from a matching subsystem\n" - " -a,--attr-match=]> trigger devices with a matching attribute\n" - " -A,--attr-nomatch=]> exclude devices with a matching attribute\n" - " -p,--property-match== trigger devices with a matching property\n" - " -g,--tag-match== trigger devices with a matching property\n" - " -y,--sysname-match= trigger devices with this /sys path\n" - " --name-match= trigger devices with this /dev name\n" - " -b,--parent-match= trigger devices with that parent device\n" - " -h,--help\n\n"); + printf("%s trigger OPTIONS\n\n" + "Request events from the kernel.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " -v --verbose Print the list of devices while running\n" + " -n --dry-run Do not actually trigger the events\n" + " -t --type= Type of events to trigger\n" + " devices sysfs devices (default)\n" + " subsystems sysfs subsystems and drivers\n" + " -c --action=ACTION Event action value, default is \"change\"\n" + " -s --subsystem-match=SUBSYSTEM Trigger devices from a matching subsystem\n" + " -S --subsystem-nomatch=SUBSYSTEM Exclude devices from a matching subsystem\n" + " -a --attr-match=FILE[=VALUE] Trigger devices with a matching attribute\n" + " -A --attr-nomatch=FILE[=VALUE] Exclude devices with a matching attribute\n" + " -p --property-match=KEY=VALUE Trigger devices with a matching property\n" + " -g --tag-match=KEY=VALUE Trigger devices with a matching property\n" + " -y --sysname-match=NAME Trigger devices with this /sys path\n" + " --name-match=NAME Trigger devices with this /dev name\n" + " -b --parent-match=NAME Trigger devices with that parent device\n" + , program_invocation_short_name); } static int adm_trigger(struct udev *udev, int argc, char *argv[]) { @@ -245,5 +248,5 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) { const struct udevadm_cmd udevadm_trigger = { .name = "trigger", .cmd = adm_trigger, - .help = "request events from the kernel", + .help = "Request events from the kernel", }; diff --git a/src/udev/udevadm-util.c b/src/udev/udevadm-util.c index 37e80c31d..3f0e45e26 100644 --- a/src/udev/udevadm-util.c +++ b/src/udev/udevadm-util.c @@ -25,7 +25,7 @@ struct udev_device *find_device(struct udev *udev, assert(id); if (prefix && !startswith(id, prefix)) - id = strappenda(prefix, id); + id = strjoina(prefix, id); if (startswith(id, "/dev/")) { struct stat statbuf; diff --git a/src/udev/udevadm-util.h b/src/udev/udevadm-util.h index dba651fdd..37e4fe836 100644 --- a/src/udev/udevadm-util.h +++ b/src/udev/udevadm-util.h @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +#pragma once + #include "udev.h" struct udev_device *find_device(struct udev *udev, diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c index d9bd69742..56cd0cd4e 100644 --- a/src/udev/udevadm.c +++ b/src/udev/udevadm.c @@ -24,6 +24,7 @@ #include #include +#include "selinux-util.h" #include "udev.h" static int adm_version(struct udev *udev, int argc, char *argv[]) { @@ -59,11 +60,14 @@ static const struct udevadm_cmd *udevadm_cmds[] = { static int adm_help(struct udev *udev, int argc, char *argv[]) { unsigned int i; - fprintf(stderr, "Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n"); + printf("%s [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n\n" + "Send control commands or test the device manager.\n\n" + "Commands:\n" + , program_invocation_short_name); + for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) if (udevadm_cmds[i]->help != NULL) - printf(" %-12s %s\n", udevadm_cmds[i]->name, udevadm_cmds[i]->help); - fprintf(stderr, "\n"); + printf(" %-12s %s\n", udevadm_cmds[i]->name, udevadm_cmds[i]->help); return 0; } diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 8bec03e77..99d4c8983 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -39,20 +39,21 @@ #include #include #include -#include +#include #include #include #include #include #include -#include "udev.h" -#include "udev-util.h" -#include "rtnl-util.h" #include "sd-daemon.h" +#include "rtnl-util.h" #include "cgroup-util.h" #include "dev-setup.h" #include "fileio.h" +#include "selinux-util.h" +#include "udev.h" +#include "udev-util.h" static struct udev_rules *rules; static struct udev_ctrl *udev_ctrl; @@ -157,7 +158,7 @@ static void worker_unref(struct worker *worker) { worker->refcount--; if (worker->refcount > 0) return; - log_debug("worker [%u] cleaned up", worker->pid); + log_debug("worker ["PID_FMT"] cleaned up", worker->pid); worker_cleanup(worker); } @@ -413,7 +414,7 @@ out: event->state = EVENT_RUNNING; udev_list_node_append(&worker->node, &worker_list); children++; - log_debug("seq %llu forked new worker [%u]", udev_device_get_seqnum(event->dev), pid); + log_debug("seq %llu forked new worker ["PID_FMT"]", udev_device_get_seqnum(event->dev), pid); break; } } @@ -430,7 +431,8 @@ static void event_run(struct event *event) { count = udev_monitor_send_device(monitor, worker->monitor, event->dev); if (count < 0) { - log_error_errno(errno, "worker [%u] did not accept message %zi (%m), kill it", worker->pid, count); + log_error_errno(errno, "worker ["PID_FMT"] did not accept message %zi (%m), kill it", + worker->pid, count); kill(worker->pid, SIGKILL); worker->state = WORKER_KILLED; continue; @@ -816,11 +818,11 @@ static int synthesize_change(struct udev_device *dev) { } static int handle_inotify(struct udev *udev) { - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event); + union inotify_event_buffer buffer; struct inotify_event *e; ssize_t l; - l = read(fd_inotify, buffer, sizeof(buffer)); + l = read(fd_inotify, &buffer, sizeof(buffer)); if (l < 0) { if (errno == EAGAIN || errno == EINTR) return 0; @@ -868,26 +870,26 @@ static void handle_signal(struct udev *udev, int signo) { if (worker->pid != pid) continue; - log_debug("worker [%u] exit", pid); + log_debug("worker ["PID_FMT"] exit", pid); if (WIFEXITED(status)) { if (WEXITSTATUS(status) != 0) - log_error("worker [%u] exit with return code %i", + log_error("worker ["PID_FMT"] exit with return code %i", pid, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { - log_error("worker [%u] terminated by signal %i (%s)", + log_error("worker ["PID_FMT"] terminated by signal %i (%s)", pid, WTERMSIG(status), strsignal(WTERMSIG(status))); } else if (WIFSTOPPED(status)) { - log_error("worker [%u] stopped", pid); + log_error("worker ["PID_FMT"] stopped", pid); } else if (WIFCONTINUED(status)) { - log_error("worker [%u] continued", pid); + log_error("worker ["PID_FMT"] continued", pid); } else { - log_error("worker [%u] exit with status 0x%04x", pid, status); + log_error("worker ["PID_FMT"] exit with status 0x%04x", pid, status); } if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { if (worker->event) { - log_error("worker [%u] failed while handling '%s'", + log_error("worker ["PID_FMT"] failed while handling '%s'", pid, worker->event->devpath); worker->event->exitcode = -32; event_queue_delete(worker->event); @@ -1003,14 +1005,15 @@ static void kernel_cmdline_options(struct udev *udev) { static void help(void) { printf("%s [OPTIONS...]\n\n" "Manages devices.\n\n" - " --daemon\n" - " --debug\n" - " --children-max=\n" - " --exec-delay=\n" - " --event-timeout=\n" - " --resolve-names=early|late|never\n" - " --version\n" - " --help\n" + " -h --help Print this message\n" + " --version Print version of the program\n" + " --daemon Detach and run in the background\n" + " --debug Enable debug output\n" + " --children-max=INT Set maximum number of workers\n" + " --exec-delay=SECONDS Seconds to wait before executing RUN=\n" + " --event-timeout=SECONDS Seconds to wait before terminating an event\n" + " --resolve-names=early|late|never\n" + " When to resolve users and groups\n" , program_invocation_short_name); } @@ -1407,7 +1410,7 @@ int main(int argc, char *argv[]) { if ((ts - worker->event_start_usec) > arg_event_timeout_warn_usec) { if ((ts - worker->event_start_usec) > arg_event_timeout_usec) { - log_error("worker [%u] %s timeout; kill it", worker->pid, worker->event->devpath); + log_error("worker ["PID_FMT"] %s timeout; kill it", worker->pid, worker->event->devpath); kill(worker->pid, SIGKILL); worker->state = WORKER_KILLED; @@ -1418,7 +1421,7 @@ int main(int argc, char *argv[]) { event_queue_delete(worker->event); worker->event = NULL; } else if (!worker->event_warned) { - log_warning("worker [%u] %s is taking a long time", worker->pid, worker->event->devpath); + log_warning("worker ["PID_FMT"] %s is taking a long time", worker->pid, worker->event->devpath); worker->event_warned = true; } } diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c index d5463b27e..0ebe43463 100644 --- a/src/udev/v4l_id/v4l_id.c +++ b/src/udev/v4l_id/v4l_id.c @@ -26,17 +26,18 @@ #include #include -int main (int argc, char *argv[]) -{ +#include "util.h" + +int main(int argc, char *argv[]) { static const struct option options[] = { { "help", no_argument, NULL, 'h' }, {} }; - int fd; + _cleanup_close_ int fd = -1; char *device; struct v4l2_capability v2cap; - while (1) { + for (;;) { int option; option = getopt_long(argc, argv, "h", options, NULL); @@ -45,7 +46,10 @@ int main (int argc, char *argv[]) switch (option) { case 'h': - printf("Usage: v4l_id [--help] \n\n"); + printf("%s [-h,--help] \n\n" + "Video4Linux device identification.\n\n" + " -h Print this message\n" + , program_invocation_short_name); return 0; default: return 1; @@ -55,11 +59,11 @@ int main (int argc, char *argv[]) if (device == NULL) return 2; - fd = open (device, O_RDONLY); + fd = open(device, O_RDONLY); if (fd < 0) return 3; - if (ioctl (fd, VIDIOC_QUERYCAP, &v2cap) == 0) { + if (ioctl(fd, VIDIOC_QUERYCAP, &v2cap) == 0) { printf("ID_V4L_VERSION=2\n"); printf("ID_V4L_PRODUCT=%s\n", v2cap.card); printf("ID_V4L_CAPABILITIES=:"); @@ -78,6 +82,5 @@ int main (int argc, char *argv[]) printf("\n"); } - close (fd); return 0; } diff --git a/src/update-done/update-done.c b/src/update-done/update-done.c index a910808d0..561963e5e 100644 --- a/src/update-done/update-done.c +++ b/src/update-done/update-done.c @@ -21,6 +21,7 @@ #include "util.h" #include "label.h" +#include "selinux-util.h" #define MESSAGE \ "This file was created by systemd-update-done. Its only \n" \ diff --git a/system-preset/90-systemd.preset b/system-preset/90-systemd.preset index ada9dbbf4..ee1b864bc 100644 --- a/system-preset/90-systemd.preset +++ b/system-preset/90-systemd.preset @@ -9,6 +9,8 @@ # generally follow a default-off policy. enable remote-fs.target +enable machines.target + enable getty@.service enable systemd-timesyncd.service enable systemd-networkd.service diff --git a/test-libsystemd-sym.c b/test-libsystemd-sym.c index 33839f068..b2a93f558 100644 --- a/test-libsystemd-sym.c +++ b/test-libsystemd-sym.c @@ -125,6 +125,7 @@ sd_pid_notify, sd_pid_notifyf, sd_machine_get_ifindices, sd_session_get_desktop, +sd_pid_notify_with_fds, sd_bus_default, sd_bus_default_user, sd_bus_default_system, @@ -132,7 +133,7 @@ sd_bus_open, sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, -sd_bus_open_system_container, +sd_bus_open_system_machine, sd_bus_new, sd_bus_set_address, sd_bus_set_fd, @@ -308,6 +309,7 @@ sd_bus_error_setf, sd_bus_error_set_const, sd_bus_error_set_errno, sd_bus_error_set_errnof, +sd_bus_error_set_errnofv, sd_bus_error_get_errno, sd_bus_error_copy, sd_bus_error_is_set, @@ -338,6 +340,9 @@ sd_event_add_signal, sd_event_add_child, sd_event_add_defer, sd_event_add_exit, +sd_event_wait, +sd_event_prepare, +sd_event_dispatch, sd_event_run, sd_event_loop, sd_event_exit, diff --git a/test/end.service b/test/end.service.in similarity index 57% rename from test/end.service rename to test/end.service.in index 0f04dfeb2..4857ffe02 100644 --- a/test/end.service +++ b/test/end.service.in @@ -3,4 +3,4 @@ Description=End the test After=testsuite.service [Service] -ExecStart=/usr/bin/systemctl poweroff --no-block +ExecStart=@SYSTEMCTL@ poweroff --no-block diff --git a/test/exec-umask-0177.service b/test/exec-umask-0177.service new file mode 100644 index 000000000..af9295888 --- /dev/null +++ b/test/exec-umask-0177.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for UMask + +[Service] +ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "600")' +UMask=0177 +PrivateTmp=yes diff --git a/test/exec-umask-default.service b/test/exec-umask-default.service new file mode 100644 index 000000000..41e20a60a --- /dev/null +++ b/test/exec-umask-default.service @@ -0,0 +1,6 @@ +[Unit] +Description=Test for UMask default + +[Service] +ExecStart=/bin/sh -c 'touch /tmp/test-exec-umask; s=$(stat -c %a /tmp/test-exec-umask); echo $s; exit $(test $s = "644")' +PrivateTmp=yes diff --git a/test/rule-syntax-check.py b/test/rule-syntax-check.py old mode 100755 new mode 100644 index ce4f5c75a..80bbe65be --- a/test/rule-syntax-check.py +++ b/test/rule-syntax-check.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # Simple udev rules syntax checker # # (C) 2010 Canonical Ltd. @@ -19,10 +18,20 @@ import re import sys +import os +from glob import glob -if len(sys.argv) < 2: - print >> sys.stderr, 'Usage: %s [...]' % sys.argv[0] - sys.exit(2) +if len(sys.argv) > 1: + # explicit rule file list + rules_files = sys.argv[1:] +else: + # take them from the build dir + root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + rules_dir = os.path.join(os.environ.get('top_srcdir', root_dir), 'rules') + if not os.path.isdir(rules_dir): + sys.stderr.write('No rules files given, and %s does not exist, aborting' % rules_dir) + sys.exit(2) + rules_files = glob(os.path.join(rules_dir, '*.rules')) no_args_tests = re.compile('(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$') args_tests = re.compile('(ATTRS?|ENV|TEST){([a-zA-Z0-9/_.*%-]+)}\s*(?:=|!)=\s*"([^"]*)"$') @@ -31,7 +40,7 @@ args_assign = re.compile('(ATTR|ENV|IMPORT|RUN){([a-zA-Z0-9/_.*%-]+)}\s*(=|\+=)\ result = 0 buffer = '' -for path in sys.argv[1:]: +for path in rules_files: lineno = 0 for line in open(path): lineno += 1 @@ -55,8 +64,8 @@ for path in sys.argv[1:]: no_args_assign.match(clause) or args_assign.match(clause)): print('Invalid line %s:%i: %s' % (path, lineno, line)) - print(' clause:', clause) - print() + print(' clause: %s' % clause) + print('') result = 1 break diff --git a/test/rules-test.sh b/test/rules-test.sh deleted file mode 100755 index 47d42cb3f..000000000 --- a/test/rules-test.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Call the udev rule syntax checker on all rules that we ship -# -# (C) 2010 Canonical Ltd. -# Author: Martin Pitt -# -# systemd is free software; you can redistribute it and/or modify it -# 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 . - -[ -n "$srcdir" ] || srcdir=`dirname $0`/.. - -# skip if we don't have python -type python >/dev/null 2>&1 || { - echo "$0: No python installed, skipping udev rule syntax check" - exit 0 -} - -$srcdir/test/rule-syntax-check.py `find $srcdir/rules -name '*.rules'` diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py new file mode 100644 index 000000000..09f5c0176 --- /dev/null +++ b/test/sysv-generator-test.py @@ -0,0 +1,384 @@ +# systemd-sysv-generator integration test +# +# (C) 2015 Canonical Ltd. +# Author: Martin Pitt +# +# systemd is free software; you can redistribute it and/or modify it +# 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 . + +import unittest +import sys +import os +import subprocess +import tempfile +import shutil +from glob import glob + +try: + from configparser import RawConfigParser +except ImportError: + # python 2 + from ConfigParser import RawConfigParser + +sysv_generator = os.path.join(os.environ.get('builddir', '.'), 'systemd-sysv-generator') + + +class SysvGeneratorTest(unittest.TestCase): + def setUp(self): + self.workdir = tempfile.mkdtemp(prefix='sysv-gen-test.') + self.init_d_dir = os.path.join(self.workdir, 'init.d') + os.mkdir(self.init_d_dir) + self.rcnd_dir = self.workdir + self.unit_dir = os.path.join(self.workdir, 'systemd') + os.mkdir(self.unit_dir) + self.out_dir = os.path.join(self.workdir, 'output') + os.mkdir(self.out_dir) + + def tearDown(self): + shutil.rmtree(self.workdir) + + # + # Helper methods + # + + def run_generator(self, expect_error=False): + '''Run sysv-generator. + + Fail if stderr contains any "Fail", unless expect_error is True. + Return (stderr, filename -> ConfigParser) pair with ouput to stderr and + parsed generated units. + ''' + env = os.environ.copy() + env['SYSTEMD_LOG_LEVEL'] = 'debug' + env['SYSTEMD_SYSVINIT_PATH'] = self.init_d_dir + env['SYSTEMD_SYSVRCND_PATH'] = self.rcnd_dir + env['SYSTEMD_UNIT_PATH'] = self.unit_dir + gen = subprocess.Popen( + [sysv_generator, 'ignored', 'ignored', self.out_dir], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, env=env) + (out, err) = gen.communicate() + if not expect_error: + self.assertFalse('Fail' in err, err) + self.assertEqual(gen.returncode, 0, err) + + results = {} + for service in glob(self.out_dir + '/*.service'): + if os.path.islink(service): + continue + cp = RawConfigParser() + cp.optionxform = lambda o: o # don't lower-case option names + with open(service) as f: + cp.readfp(f) + results[os.path.basename(service)] = cp + + return (err, results) + + def add_sysv(self, fname, keys, enable=False, prio=1): + '''Create a SysV init script with the given keys in the LSB header + + There are sensible default values for all fields. + If enable is True, links will be created in the rcN.d dirs. In that + case, the priority can be given with "prio" (default to 1). + + Return path of generated script. + ''' + name_without_sh = fname.endswith('.sh') and fname[:-3] or fname + keys.setdefault('Provides', name_without_sh) + keys.setdefault('Required-Start', '$local_fs') + keys.setdefault('Required-Stop', keys['Required-Start']) + keys.setdefault('Default-Start', '2 3 4 5') + keys.setdefault('Default-Stop', '0 1 6') + keys.setdefault('Short-Description', 'test %s service' % + name_without_sh) + keys.setdefault('Description', 'long description for test %s service' % + name_without_sh) + script = os.path.join(self.init_d_dir, fname) + with open(script, 'w') as f: + f.write('#!/bin/init-d-interpreter\n### BEGIN INIT INFO\n') + for k, v in keys.items(): + if v is not None: + f.write('#%20s %s\n' % (k + ':', v)) + f.write('### END INIT INFO\ncode --goes here\n') + os.chmod(script, 0o755) + + if enable: + def make_link(prefix, runlevel): + d = os.path.join(self.rcnd_dir, 'rc%s.d' % runlevel) + if not os.path.isdir(d): + os.mkdir(d) + os.symlink('../init.d/' + fname, os.path.join(d, prefix + fname)) + + for rl in keys['Default-Start'].split(): + make_link('S%02i' % prio, rl) + for rl in keys['Default-Stop'].split(): + make_link('K%02i' % (99 - prio), rl) + + return script + + def assert_enabled(self, unit, runlevels): + '''assert that a unit is enabled in precisely the given runlevels''' + + all_runlevels = [2, 3, 4, 5] + + # should be enabled + for runlevel in all_runlevels: + link = os.path.join(self.out_dir, 'runlevel%i.target.wants' % runlevel, unit) + if runlevel in runlevels: + target = os.readlink(link) + self.assertTrue(os.path.exists(target)) + self.assertEqual(os.path.basename(target), unit) + else: + self.assertFalse(os.path.exists(link), + '%s unexpectedly exists' % link) + + # + # test cases + # + + def test_nothing(self): + '''no input files''' + + results = self.run_generator()[1] + self.assertEqual(results, {}) + self.assertEqual(os.listdir(self.out_dir), []) + + def test_simple_disabled(self): + '''simple service without dependencies, disabled''' + + self.add_sysv('foo', {}, enable=False) + err, results = self.run_generator() + self.assertEqual(len(results), 1) + + # no enablement links or other stuff + self.assertEqual(os.listdir(self.out_dir), ['foo.service']) + + s = results['foo.service'] + self.assertEqual(s.sections(), ['Unit', 'Service']) + self.assertEqual(s.get('Unit', 'Description'), 'LSB: test foo service') + # $local_fs does not need translation, don't expect any dependency + # fields here + self.assertEqual(set(s.options('Unit')), + set(['Documentation', 'SourcePath', 'Description'])) + + self.assertEqual(s.get('Service', 'Type'), 'forking') + init_script = os.path.join(self.init_d_dir, 'foo') + self.assertEqual(s.get('Service', 'ExecStart'), + '%s start' % init_script) + self.assertEqual(s.get('Service', 'ExecStop'), + '%s stop' % init_script) + + def test_simple_enabled_all(self): + '''simple service without dependencies, enabled in all runlevels''' + + self.add_sysv('foo', {}, enable=True) + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + self.assert_enabled('foo.service', [2, 3, 4, 5]) + + def test_simple_enabled_some(self): + '''simple service without dependencies, enabled in some runlevels''' + + self.add_sysv('foo', {'Default-Start': '2 4'}, enable=True) + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + self.assert_enabled('foo.service', [2, 4]) + + def test_lsb_macro_dep_single(self): + '''single LSB macro dependency: $network''' + + self.add_sysv('foo', {'Required-Start': '$network'}) + s = self.run_generator()[1]['foo.service'] + self.assertEqual(set(s.options('Unit')), + set(['Documentation', 'SourcePath', 'Description', 'After', 'Wants'])) + self.assertEqual(s.get('Unit', 'After'), 'network-online.target') + self.assertEqual(s.get('Unit', 'Wants'), 'network-online.target') + + def test_lsb_macro_dep_multi(self): + '''multiple LSB macro dependencies''' + + self.add_sysv('foo', {'Required-Start': '$named $portmap'}) + s = self.run_generator()[1]['foo.service'] + self.assertEqual(set(s.options('Unit')), + set(['Documentation', 'SourcePath', 'Description', 'After'])) + self.assertEqual(s.get('Unit', 'After'), 'nss-lookup.target rpcbind.target') + + def test_lsb_deps(self): + '''LSB header dependencies to other services''' + + # also give symlink priorities here; they should be ignored + self.add_sysv('foo', {'Required-Start': 'must1 must2', + 'Should-Start': 'may1 ne_may2'}, + enable=True, prio=40) + self.add_sysv('must1', {}, enable=True, prio=10) + self.add_sysv('must2', {}, enable=True, prio=15) + self.add_sysv('may1', {}, enable=True, prio=20) + # do not create ne_may2 + err, results = self.run_generator() + self.assertEqual(sorted(results), + ['foo.service', 'may1.service', 'must1.service', 'must2.service']) + + # foo should depend on all of them + self.assertEqual(sorted(results['foo.service'].get('Unit', 'After').split()), + ['may1.service', 'must1.service', 'must2.service', 'ne_may2.service']) + + # other services should not depend on each other + self.assertFalse(results['must1.service'].has_option('Unit', 'After')) + self.assertFalse(results['must2.service'].has_option('Unit', 'After')) + self.assertFalse(results['may1.service'].has_option('Unit', 'After')) + + def test_symlink_prio_deps(self): + '''script without LSB headers use rcN.d priority''' + + # create two init.d scripts without LSB header and enable them with + # startup priorities + for prio, name in [(10, 'provider'), (15, 'consumer')]: + with open(os.path.join(self.init_d_dir, name), 'w') as f: + f.write('#!/bin/init-d-interpreter\ncode --goes here\n') + os.fchmod(f.fileno(), 0o755) + + d = os.path.join(self.rcnd_dir, 'rc2.d') + if not os.path.isdir(d): + os.mkdir(d) + os.symlink('../init.d/' + name, os.path.join(d, 'S%02i%s' % (prio, name))) + + err, results = self.run_generator() + self.assertEqual(sorted(results), ['consumer.service', 'provider.service']) + self.assertFalse(results['provider.service'].has_option('Unit', 'After')) + self.assertEqual(results['consumer.service'].get('Unit', 'After'), + 'provider.service') + + def test_multiple_provides(self): + '''multiple Provides: names''' + + self.add_sysv('foo', {'Provides': 'foo bar baz'}) + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + self.assertEqual(set(results['foo.service'].options('Unit')), + set(['Documentation', 'SourcePath', 'Description'])) + # should create symlinks for the alternative names + for f in ['bar.service', 'baz.service']: + self.assertEqual(os.readlink(os.path.join(self.out_dir, f)), + 'foo.service') + + def test_same_provides_in_multiple_scripts(self): + '''multiple init.d scripts provide the same name''' + + self.add_sysv('foo', {'Provides': 'foo common'}, enable=True, prio=1) + self.add_sysv('bar', {'Provides': 'bar common'}, enable=True, prio=2) + err, results = self.run_generator() + self.assertEqual(sorted(results), ['bar.service', 'foo.service']) + # should create symlink for the alternative name for either unit + self.assertIn(os.readlink(os.path.join(self.out_dir, 'common.service')), + ['foo.service', 'bar.service']) + + def test_provide_other_script(self): + '''init.d scripts provides the name of another init.d script''' + + self.add_sysv('foo', {'Provides': 'foo bar'}, enable=True) + self.add_sysv('bar', {'Provides': 'bar'}, enable=True) + err, results = self.run_generator() + self.assertEqual(sorted(results), ['bar.service', 'foo.service']) + + def test_nonexecutable_script(self): + '''ignores non-executable init.d script''' + + os.chmod(self.add_sysv('foo', {}), 0o644) + err, results = self.run_generator() + self.assertEqual(results, {}) + + def test_sh_suffix(self): + '''init.d script with .sh suffix''' + + self.add_sysv('foo.sh', {}, enable=True) + err, results = self.run_generator() + s = results['foo.service'] + + self.assertEqual(s.sections(), ['Unit', 'Service']) + # should not have a .sh + self.assertEqual(s.get('Unit', 'Description'), 'LSB: test foo service') + + # calls correct script with .sh + init_script = os.path.join(self.init_d_dir, 'foo.sh') + self.assertEqual(s.get('Service', 'ExecStart'), + '%s start' % init_script) + self.assertEqual(s.get('Service', 'ExecStop'), + '%s stop' % init_script) + + self.assert_enabled('foo.service', [2, 3, 4, 5]) + + def test_sh_suffix_with_provides(self): + '''init.d script with .sh suffix and Provides:''' + + self.add_sysv('foo.sh', {'Provides': 'foo bar'}) + err, results = self.run_generator() + # ensure we don't try to create a symlink to itself + self.assertNotIn(err, 'itself') + self.assertEqual(list(results), ['foo.service']) + self.assertEqual(results['foo.service'].get('Unit', 'Description'), + 'LSB: test foo service') + + # should create symlink for the alternative name + self.assertEqual(os.readlink(os.path.join(self.out_dir, 'bar.service')), + 'foo.service') + + def test_hidden_files(self): + '''init.d script with hidden file suffix''' + + script = self.add_sysv('foo', {}, enable=True) + # backup files (not enabled in rcN.d/) + shutil.copy(script, script + '.dpkg-new') + shutil.copy(script, script + '.dpkg-dist') + shutil.copy(script, script + '.swp') + shutil.copy(script, script + '.rpmsave') + + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + + self.assert_enabled('foo.service', [2, 3, 4, 5]) + + def test_backup_file(self): + '''init.d script with backup file''' + + script = self.add_sysv('foo', {}, enable=True) + # backup files (not enabled in rcN.d/) + shutil.copy(script, script + '.bak') + shutil.copy(script, script + '.old') + + err, results = self.run_generator() + print(err) + self.assertEqual(sorted(results), + ['foo.bak.service', 'foo.old.service', 'foo.service']) + + # ensure we don't try to create a symlink to itself + self.assertNotIn(err, 'itself') + + self.assert_enabled('foo.service', [2, 3, 4, 5]) + self.assert_enabled('foo.bak.service', []) + self.assert_enabled('foo.old.service', []) + + def test_existing_native_unit(self): + '''existing native unit''' + + with open(os.path.join(self.unit_dir, 'foo.service'), 'w') as f: + f.write('[Unit]\n') + + self.add_sysv('foo.sh', {'Provides': 'foo bar'}, enable=True) + err, results = self.run_generator() + self.assertEqual(list(results), []) + # no enablement or alias links, as native unit is disabled + self.assertEqual(os.listdir(self.out_dir), []) + + +if __name__ == '__main__': + unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout, verbosity=2)) diff --git a/test/udev-test.pl b/test/udev-test.pl index 3e05b6177..d9b796700 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1233,8 +1233,8 @@ EOF devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", exp_name => "there", rules => <