Imported Upstream version 229

This commit is contained in:
Martin Pitt 2016-02-11 17:57:18 +01:00
parent db2df898cc
commit 4c89c718b5
1216 changed files with 48516 additions and 21379 deletions

View File

@ -2,6 +2,22 @@
; A list of (major-mode . ((var1 . value1) (var2 . value2)))
; Mode can be nil, which gives default values.
; Note that we set a line width of 119 for .c and XML files, but for everything
; else (such as journal catalog files, unit files, README files) we stick to a
; more conservative 79 characters.
; NOTE: If you update this file make sure to update .vimrc and .editorconfig,
; too.
((nil . ((indent-tabs-mode . nil)
(tab-width . 8)))
)
(tab-width . 8)
(fill-column . 79)))
(c-mode . ((fill-column . 119)
(c-basic-offset . 8)
(eval . (c-set-offset 'substatement-open 0))
(eval . (c-set-offset 'statement-case-open 0))
(eval . (c-set-offset 'case-label 0))
(eval . (c-set-offset 'arglist-intro '++))
(eval . (c-set-offset 'arglist-close 0))))
(nxml-mode . ((nxml-child-indent . 2)
(fill-column . 119))))

20
.editorconfig Normal file
View File

@ -0,0 +1,20 @@
# EditorConfig configuration for systemd
# http://EditorConfig.org
# NOTE: If you update this file make sure to update .dir-locals.el and .vimrc,
# too.
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Match config files, set indent to spaces with width of eight
[*.{c,h}]
indent_style = space
indent_size = 8

11
.gitignore vendored
View File

@ -1,6 +1,5 @@
*.a
*.cache
*.html
*.la
*.lo
*.log
@ -110,7 +109,7 @@
/systemd-remount-api-vfs
/systemd-remount-fs
/systemd-reply-password
/systemd-resolve-host
/systemd-resolve
/systemd-resolved
/systemd-rfkill
/systemd-run
@ -134,9 +133,11 @@
/systemd-vconsole-setup
/tags
/test-acd
/test-acl-util
/test-af-list
/test-architecture
/test-arphrd-list
/test-ask-password-api
/test-async
/test-audit-type
/test-barrier
@ -177,11 +178,13 @@
/test-daemon
/test-date
/test-device-nodes
/test-dnssec-complex
/test-dhcp-client
/test-dhcp-option
/test-dhcp-server
/test-dhcp6-client
/test-dns-domain
/test-dnssec
/test-efi-disk.img
/test-ellipsize
/test-engine
@ -245,12 +248,16 @@
/test-pty
/test-qcow2
/test-ratelimit
/test-rbtree
/test-replace-var
/test-resolve
/test-resolve-tables
/test-ring
/test-rlimit-util
/test-sched-prio
/test-set
/test-sigbus
/test-signal-util
/test-siphash24
/test-sleep
/test-socket-util

15
.vimrc
View File

@ -1,5 +1,20 @@
" 'set exrc' in ~/.vimrc will read .vimrc from the current directory
" Warning: Enabling exrc is dangerous! You can do nearly everything from a
" vimrc configuration file, including write operations and shell execution.
" You should consider setting 'set secure' as well, which is highly
" recommended!
" Note that we set a line width of 119 for .c and XML files, but for everything
" else (such as journal catalog files, unit files, README files) we stick to a
" more conservative 79 characters.
" NOTE: If you update this file make sure to update .dir-locals.el and
" .editorconfig, too.
set tabstop=8
set shiftwidth=8
set expandtab
set makeprg=GCC_COLORS=\ make
set tw=79
au FileType xml set tw=119
au FileType c set tw=119

View File

@ -7,7 +7,7 @@
- Don't break code lines too eagerly. We do *not* force line breaks at
80ch, all of today's screens should be much larger than that. But
then again, don't overdo it, ~140ch should be enough really.
then again, don't overdo it, ~119ch should be enough really.
- Variables and functions *must* be static, unless they have a
prototype, and are supposed to be exported.

37
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,37 @@
# Contributing
We welcome contributions from everyone. However, please follow the following guidelines when posting a GitHub Pull
Request or filing a GitHub Issue on the systemd project:
## Filing Issues
* We use GitHub Issues **exclusively** for tracking **bugs** and **feature** **requests** of systemd. If you are
looking for help, please contact our [mailing list](http://lists.freedesktop.org/mailman/listinfo/systemd-devel)
instead.
* We only track bugs in the **two** **most** **recently** **released** **versions** of systemd in the GitHub Issue
tracker. If you are using an older version of systemd, please contact your distribution's bug tracker instead.
* When filing an issue, specify the **systemd** **version** you are experiencing the issue with. Also, indicate which
**distribution** you are using.
* Please include an explanation how to reproduce the issue you are pointing out.
Following these guidelines makes it easier for us to process your issue, and ensures we won't close your issue
right-away for being misfiled.
## Posting Pull Requests
* Make sure to post PRs only relative to a very recent git master.
* Follow our [Coding Style](https://raw.githubusercontent.com/systemd/systemd/master/CODING_STYLE) when contributing
code. This is a requirement for all code we merge.
* Make sure to run "make check" locally, before posting your PR. We use a CI system, meaning we don't even look at your
PR, if the build and tests don't pass.
* If you need to update the code in an existing PR, please consider opening a new PR (mentioning in it which old PR it
replaces) and closing the old PR. This is much preferable over force-pushing a new patch set into the PR's branch, as
commit comments aren't lost that way. That said, we don't follow this rule ourselves quite often, hence this is
really just a say as we say, not say as we do...
## Final Words
We'd like to apologize in advance if we are not able to process and reply to your issue or PR right-away. We have a lot
of work to do, but we are trying our best!
Thank you very much for your contributions!

View File

@ -25,7 +25,9 @@ MANPAGES += \
man/machine-info.5 \
man/os-release.5 \
man/sd-bus-errors.3 \
man/sd-bus.3 \
man/sd-daemon.3 \
man/sd-event.3 \
man/sd-id128.3 \
man/sd-journal.3 \
man/sd_booted.3 \
@ -47,18 +49,30 @@ MANPAGES += \
man/sd_bus_request_name.3 \
man/sd_event_add_child.3 \
man/sd_event_add_defer.3 \
man/sd_event_add_io.3 \
man/sd_event_add_signal.3 \
man/sd_event_add_time.3 \
man/sd_event_exit.3 \
man/sd_event_get_fd.3 \
man/sd_event_new.3 \
man/sd_event_now.3 \
man/sd_event_run.3 \
man/sd_event_set_name.3 \
man/sd_event_set_watchdog.3 \
man/sd_event_source_get_event.3 \
man/sd_event_source_get_pending.3 \
man/sd_event_source_set_description.3 \
man/sd_event_source_set_enabled.3 \
man/sd_event_source_set_prepare.3 \
man/sd_event_source_set_priority.3 \
man/sd_event_source_set_userdata.3 \
man/sd_event_source_unref.3 \
man/sd_event_wait.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_enumerate_fields.3 \
man/sd_journal_get_catalog.3 \
man/sd_journal_get_cursor.3 \
man/sd_journal_get_cutoff_realtime_usec.3 \
@ -66,6 +80,7 @@ MANPAGES += \
man/sd_journal_get_fd.3 \
man/sd_journal_get_realtime_usec.3 \
man/sd_journal_get_usage.3 \
man/sd_journal_has_runtime_files.3 \
man/sd_journal_next.3 \
man/sd_journal_open.3 \
man/sd_journal_print.3 \
@ -108,6 +123,7 @@ MANPAGES += \
man/systemd-nspawn.1 \
man/systemd-path.1 \
man/systemd-remount-fs.service.8 \
man/systemd-resolve.1 \
man/systemd-run.1 \
man/systemd-sleep.conf.5 \
man/systemd-socket-proxyd.8 \
@ -199,6 +215,19 @@ MANPAGES_ALIAS += \
man/SD_DEBUG.3 \
man/SD_EMERG.3 \
man/SD_ERR.3 \
man/SD_EVENT_ARMED.3 \
man/SD_EVENT_EXITING.3 \
man/SD_EVENT_FINISHED.3 \
man/SD_EVENT_INITIAL.3 \
man/SD_EVENT_OFF.3 \
man/SD_EVENT_ON.3 \
man/SD_EVENT_ONESHOT.3 \
man/SD_EVENT_PENDING.3 \
man/SD_EVENT_PREPARING.3 \
man/SD_EVENT_PRIORITY_IDLE.3 \
man/SD_EVENT_PRIORITY_IMPORTANT.3 \
man/SD_EVENT_PRIORITY_NORMAL.3 \
man/SD_EVENT_RUNNING.3 \
man/SD_ID128_CONST_STR.3 \
man/SD_ID128_FORMAT_STR.3 \
man/SD_ID128_FORMAT_VAL.3 \
@ -209,6 +238,7 @@ MANPAGES_ALIAS += \
man/SD_JOURNAL_FOREACH.3 \
man/SD_JOURNAL_FOREACH_BACKWARDS.3 \
man/SD_JOURNAL_FOREACH_DATA.3 \
man/SD_JOURNAL_FOREACH_FIELD.3 \
man/SD_JOURNAL_FOREACH_UNIQUE.3 \
man/SD_JOURNAL_INVALIDATE.3 \
man/SD_JOURNAL_LOCAL_ONLY.3 \
@ -260,6 +290,7 @@ MANPAGES_ALIAS += \
man/sd_bus_creds_has_permitted_cap.3 \
man/sd_bus_creds_ref.3 \
man/sd_bus_creds_unref.3 \
man/sd_bus_creds_unrefp.3 \
man/sd_bus_default_system.3 \
man/sd_bus_default_user.3 \
man/sd_bus_error_copy.3 \
@ -295,22 +326,45 @@ MANPAGES_ALIAS += \
man/sd_bus_ref.3 \
man/sd_bus_release_name.3 \
man/sd_bus_unref.3 \
man/sd_bus_unrefp.3 \
man/sd_event.3 \
man/sd_event_add_exit.3 \
man/sd_event_add_post.3 \
man/sd_event_child_handler_t.3 \
man/sd_event_default.3 \
man/sd_event_dispatch.3 \
man/sd_event_get_name.3 \
man/sd_event_get_exit_code.3 \
man/sd_event_get_state.3 \
man/sd_event_get_tid.3 \
man/sd_event_get_watchdog.3 \
man/sd_event_handler_t.3 \
man/sd_event_io_handler_t.3 \
man/sd_event_loop.3 \
man/sd_event_prepare.3 \
man/sd_event_ref.3 \
man/sd_event_signal_handler_t.3 \
man/sd_event_source.3 \
man/sd_event_source_get_child_pid.3 \
man/sd_event_source_get_description.3 \
man/sd_event_source_get_enabled.3 \
man/sd_event_source_get_io_events.3 \
man/sd_event_source_get_io_fd.3 \
man/sd_event_source_get_io_revents.3 \
man/sd_event_source_get_priority.3 \
man/sd_event_source_get_signal.3 \
man/sd_event_source_get_time.3 \
man/sd_event_source_get_time_accuracy.3 \
man/sd_event_source_get_time_clock.3 \
man/sd_event_source_get_userdata.3 \
man/sd_event_source_ref.3 \
man/sd_event_source_set_io_events.3 \
man/sd_event_source_set_io_fd.3 \
man/sd_event_source_set_time.3 \
man/sd_event_source_set_time_accuracy.3 \
man/sd_event_source_unrefp.3 \
man/sd_event_time_handler_t.3 \
man/sd_event_unref.3 \
man/sd_event_unrefp.3 \
man/sd_id128_equal.3 \
man/sd_id128_from_string.3 \
man/sd_id128_get_boot.3 \
@ -333,6 +387,7 @@ MANPAGES_ALIAS += \
man/sd_journal_get_events.3 \
man/sd_journal_get_monotonic_usec.3 \
man/sd_journal_get_timeout.3 \
man/sd_journal_has_persistent_files.3 \
man/sd_journal_next_skip.3 \
man/sd_journal_open_container.3 \
man/sd_journal_open_directory.3 \
@ -344,6 +399,7 @@ MANPAGES_ALIAS += \
man/sd_journal_process.3 \
man/sd_journal_reliable_fd.3 \
man/sd_journal_restart_data.3 \
man/sd_journal_restart_fields.3 \
man/sd_journal_restart_unique.3 \
man/sd_journal_seek_cursor.3 \
man/sd_journal_seek_monotonic_usec.3 \
@ -489,6 +545,19 @@ man/SD_CRIT.3: man/sd-daemon.3
man/SD_DEBUG.3: man/sd-daemon.3
man/SD_EMERG.3: man/sd-daemon.3
man/SD_ERR.3: man/sd-daemon.3
man/SD_EVENT_ARMED.3: man/sd_event_wait.3
man/SD_EVENT_EXITING.3: man/sd_event_wait.3
man/SD_EVENT_FINISHED.3: man/sd_event_wait.3
man/SD_EVENT_INITIAL.3: man/sd_event_wait.3
man/SD_EVENT_OFF.3: man/sd_event_source_set_enabled.3
man/SD_EVENT_ON.3: man/sd_event_source_set_enabled.3
man/SD_EVENT_ONESHOT.3: man/sd_event_source_set_enabled.3
man/SD_EVENT_PENDING.3: man/sd_event_wait.3
man/SD_EVENT_PREPARING.3: man/sd_event_wait.3
man/SD_EVENT_PRIORITY_IDLE.3: man/sd_event_source_set_priority.3
man/SD_EVENT_PRIORITY_IMPORTANT.3: man/sd_event_source_set_priority.3
man/SD_EVENT_PRIORITY_NORMAL.3: man/sd_event_source_set_priority.3
man/SD_EVENT_RUNNING.3: man/sd_event_wait.3
man/SD_ID128_CONST_STR.3: man/sd-id128.3
man/SD_ID128_FORMAT_STR.3: man/sd-id128.3
man/SD_ID128_FORMAT_VAL.3: man/sd-id128.3
@ -499,6 +568,7 @@ man/SD_JOURNAL_CURRENT_USER.3: man/sd_journal_open.3
man/SD_JOURNAL_FOREACH.3: man/sd_journal_next.3
man/SD_JOURNAL_FOREACH_BACKWARDS.3: man/sd_journal_next.3
man/SD_JOURNAL_FOREACH_DATA.3: man/sd_journal_get_data.3
man/SD_JOURNAL_FOREACH_FIELD.3: man/sd_journal_enumerate_fields.3
man/SD_JOURNAL_FOREACH_UNIQUE.3: man/sd_journal_query_unique.3
man/SD_JOURNAL_INVALIDATE.3: man/sd_journal_get_fd.3
man/SD_JOURNAL_LOCAL_ONLY.3: man/sd_journal_open.3
@ -550,6 +620,7 @@ man/sd_bus_creds_has_inheritable_cap.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_has_permitted_cap.3: man/sd_bus_creds_get_pid.3
man/sd_bus_creds_ref.3: man/sd_bus_creds_new_from_pid.3
man/sd_bus_creds_unref.3: man/sd_bus_creds_new_from_pid.3
man/sd_bus_creds_unrefp.3: man/sd_bus_creds_new_from_pid.3
man/sd_bus_default_system.3: man/sd_bus_default.3
man/sd_bus_default_user.3: man/sd_bus_default.3
man/sd_bus_error_copy.3: man/sd_bus_error.3
@ -585,22 +656,45 @@ man/sd_bus_path_encode_many.3: man/sd_bus_path_encode.3
man/sd_bus_ref.3: man/sd_bus_new.3
man/sd_bus_release_name.3: man/sd_bus_request_name.3
man/sd_bus_unref.3: man/sd_bus_new.3
man/sd_bus_unrefp.3: man/sd_bus_new.3
man/sd_event.3: man/sd_event_new.3
man/sd_event_add_exit.3: man/sd_event_add_defer.3
man/sd_event_add_post.3: man/sd_event_add_defer.3
man/sd_event_child_handler_t.3: man/sd_event_add_child.3
man/sd_event_default.3: man/sd_event_new.3
man/sd_event_dispatch.3: man/sd_event_wait.3
man/sd_event_get_name.3: man/sd_event_set_name.3
man/sd_event_get_exit_code.3: man/sd_event_exit.3
man/sd_event_get_state.3: man/sd_event_wait.3
man/sd_event_get_tid.3: man/sd_event_new.3
man/sd_event_get_watchdog.3: man/sd_event_set_watchdog.3
man/sd_event_handler_t.3: man/sd_event_add_defer.3
man/sd_event_io_handler_t.3: man/sd_event_add_io.3
man/sd_event_loop.3: man/sd_event_run.3
man/sd_event_prepare.3: man/sd_event_wait.3
man/sd_event_ref.3: man/sd_event_new.3
man/sd_event_signal_handler_t.3: man/sd_event_add_signal.3
man/sd_event_source.3: man/sd_event_add_io.3
man/sd_event_source_get_child_pid.3: man/sd_event_add_child.3
man/sd_event_source_get_description.3: man/sd_event_source_set_description.3
man/sd_event_source_get_enabled.3: man/sd_event_source_set_enabled.3
man/sd_event_source_get_io_events.3: man/sd_event_add_io.3
man/sd_event_source_get_io_fd.3: man/sd_event_add_io.3
man/sd_event_source_get_io_revents.3: man/sd_event_add_io.3
man/sd_event_source_get_priority.3: man/sd_event_source_set_priority.3
man/sd_event_source_get_signal.3: man/sd_event_add_signal.3
man/sd_event_source_get_time.3: man/sd_event_add_time.3
man/sd_event_source_get_time_accuracy.3: man/sd_event_add_time.3
man/sd_event_source_get_time_clock.3: man/sd_event_add_time.3
man/sd_event_source_get_userdata.3: man/sd_event_source_set_userdata.3
man/sd_event_source_ref.3: man/sd_event_source_unref.3
man/sd_event_source_set_io_events.3: man/sd_event_add_io.3
man/sd_event_source_set_io_fd.3: man/sd_event_add_io.3
man/sd_event_source_set_time.3: man/sd_event_add_time.3
man/sd_event_source_set_time_accuracy.3: man/sd_event_add_time.3
man/sd_event_source_unrefp.3: man/sd_event_source_unref.3
man/sd_event_time_handler_t.3: man/sd_event_add_time.3
man/sd_event_unref.3: man/sd_event_new.3
man/sd_event_unrefp.3: man/sd_event_new.3
man/sd_id128_equal.3: man/sd-id128.3
man/sd_id128_from_string.3: man/sd_id128_to_string.3
man/sd_id128_get_boot.3: man/sd_id128_get_machine.3
@ -623,6 +717,7 @@ man/sd_journal_get_data_threshold.3: man/sd_journal_get_data.3
man/sd_journal_get_events.3: man/sd_journal_get_fd.3
man/sd_journal_get_monotonic_usec.3: man/sd_journal_get_realtime_usec.3
man/sd_journal_get_timeout.3: man/sd_journal_get_fd.3
man/sd_journal_has_persistent_files.3: man/sd_journal_has_runtime_files.3
man/sd_journal_next_skip.3: man/sd_journal_next.3
man/sd_journal_open_container.3: man/sd_journal_open.3
man/sd_journal_open_directory.3: man/sd_journal_open.3
@ -634,6 +729,7 @@ man/sd_journal_printv.3: man/sd_journal_print.3
man/sd_journal_process.3: man/sd_journal_get_fd.3
man/sd_journal_reliable_fd.3: man/sd_journal_get_fd.3
man/sd_journal_restart_data.3: man/sd_journal_get_data.3
man/sd_journal_restart_fields.3: man/sd_journal_enumerate_fields.3
man/sd_journal_restart_unique.3: man/sd_journal_query_unique.3
man/sd_journal_seek_cursor.3: man/sd_journal_seek_head.3
man/sd_journal_seek_monotonic_usec.3: man/sd_journal_seek_head.3
@ -857,6 +953,45 @@ man/SD_EMERG.html: man/sd-daemon.html
man/SD_ERR.html: man/sd-daemon.html
$(html-alias)
man/SD_EVENT_ARMED.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_EXITING.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_FINISHED.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_INITIAL.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_OFF.html: man/sd_event_source_set_enabled.html
$(html-alias)
man/SD_EVENT_ON.html: man/sd_event_source_set_enabled.html
$(html-alias)
man/SD_EVENT_ONESHOT.html: man/sd_event_source_set_enabled.html
$(html-alias)
man/SD_EVENT_PENDING.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_PREPARING.html: man/sd_event_wait.html
$(html-alias)
man/SD_EVENT_PRIORITY_IDLE.html: man/sd_event_source_set_priority.html
$(html-alias)
man/SD_EVENT_PRIORITY_IMPORTANT.html: man/sd_event_source_set_priority.html
$(html-alias)
man/SD_EVENT_PRIORITY_NORMAL.html: man/sd_event_source_set_priority.html
$(html-alias)
man/SD_EVENT_RUNNING.html: man/sd_event_wait.html
$(html-alias)
man/SD_ID128_CONST_STR.html: man/sd-id128.html
$(html-alias)
@ -887,6 +1022,9 @@ man/SD_JOURNAL_FOREACH_BACKWARDS.html: man/sd_journal_next.html
man/SD_JOURNAL_FOREACH_DATA.html: man/sd_journal_get_data.html
$(html-alias)
man/SD_JOURNAL_FOREACH_FIELD.html: man/sd_journal_enumerate_fields.html
$(html-alias)
man/SD_JOURNAL_FOREACH_UNIQUE.html: man/sd_journal_query_unique.html
$(html-alias)
@ -1040,6 +1178,9 @@ man/sd_bus_creds_ref.html: man/sd_bus_creds_new_from_pid.html
man/sd_bus_creds_unref.html: man/sd_bus_creds_new_from_pid.html
$(html-alias)
man/sd_bus_creds_unrefp.html: man/sd_bus_creds_new_from_pid.html
$(html-alias)
man/sd_bus_default_system.html: man/sd_bus_default.html
$(html-alias)
@ -1145,19 +1286,43 @@ man/sd_bus_release_name.html: man/sd_bus_request_name.html
man/sd_bus_unref.html: man/sd_bus_new.html
$(html-alias)
man/sd_bus_unrefp.html: man/sd_bus_new.html
$(html-alias)
man/sd_event.html: man/sd_event_new.html
$(html-alias)
man/sd_event_add_exit.html: man/sd_event_add_defer.html
$(html-alias)
man/sd_event_add_post.html: man/sd_event_add_defer.html
$(html-alias)
man/sd_event_child_handler_t.html: man/sd_event_add_child.html
$(html-alias)
man/sd_event_default.html: man/sd_event_new.html
$(html-alias)
man/sd_event_dispatch.html: man/sd_event_wait.html
$(html-alias)
man/sd_event_get_name.html: man/sd_event_set_name.html
man/sd_event_get_exit_code.html: man/sd_event_exit.html
$(html-alias)
man/sd_event_get_state.html: man/sd_event_wait.html
$(html-alias)
man/sd_event_get_tid.html: man/sd_event_new.html
$(html-alias)
man/sd_event_get_watchdog.html: man/sd_event_set_watchdog.html
$(html-alias)
man/sd_event_handler_t.html: man/sd_event_add_defer.html
$(html-alias)
man/sd_event_io_handler_t.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_loop.html: man/sd_event_run.html
@ -1169,9 +1334,33 @@ man/sd_event_prepare.html: man/sd_event_wait.html
man/sd_event_ref.html: man/sd_event_new.html
$(html-alias)
man/sd_event_signal_handler_t.html: man/sd_event_add_signal.html
$(html-alias)
man/sd_event_source.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_get_child_pid.html: man/sd_event_add_child.html
$(html-alias)
man/sd_event_source_get_description.html: man/sd_event_source_set_description.html
$(html-alias)
man/sd_event_source_get_enabled.html: man/sd_event_source_set_enabled.html
$(html-alias)
man/sd_event_source_get_io_events.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_get_io_fd.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_get_io_revents.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_get_priority.html: man/sd_event_source_set_priority.html
$(html-alias)
man/sd_event_source_get_signal.html: man/sd_event_add_signal.html
$(html-alias)
@ -1184,15 +1373,36 @@ man/sd_event_source_get_time_accuracy.html: man/sd_event_add_time.html
man/sd_event_source_get_time_clock.html: man/sd_event_add_time.html
$(html-alias)
man/sd_event_source_get_userdata.html: man/sd_event_source_set_userdata.html
$(html-alias)
man/sd_event_source_ref.html: man/sd_event_source_unref.html
$(html-alias)
man/sd_event_source_set_io_events.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_set_io_fd.html: man/sd_event_add_io.html
$(html-alias)
man/sd_event_source_set_time.html: man/sd_event_add_time.html
$(html-alias)
man/sd_event_source_set_time_accuracy.html: man/sd_event_add_time.html
$(html-alias)
man/sd_event_source_unrefp.html: man/sd_event_source_unref.html
$(html-alias)
man/sd_event_time_handler_t.html: man/sd_event_add_time.html
$(html-alias)
man/sd_event_unref.html: man/sd_event_new.html
$(html-alias)
man/sd_event_unrefp.html: man/sd_event_new.html
$(html-alias)
man/sd_id128_equal.html: man/sd-id128.html
$(html-alias)
@ -1259,6 +1469,9 @@ man/sd_journal_get_monotonic_usec.html: man/sd_journal_get_realtime_usec.html
man/sd_journal_get_timeout.html: man/sd_journal_get_fd.html
$(html-alias)
man/sd_journal_has_persistent_files.html: man/sd_journal_has_runtime_files.html
$(html-alias)
man/sd_journal_next_skip.html: man/sd_journal_next.html
$(html-alias)
@ -1292,6 +1505,9 @@ man/sd_journal_reliable_fd.html: man/sd_journal_get_fd.html
man/sd_journal_restart_data.html: man/sd_journal_get_data.html
$(html-alias)
man/sd_journal_restart_fields.html: man/sd_journal_enumerate_fields.html
$(html-alias)
man/sd_journal_restart_unique.html: man/sd_journal_query_unique.html
$(html-alias)
@ -1793,16 +2009,21 @@ endif
if ENABLE_RESOLVED
MANPAGES += \
man/dnssec-trust-anchors.d.5 \
man/nss-resolve.8 \
man/resolved.conf.5 \
man/systemd-resolved.service.8
MANPAGES_ALIAS += \
man/libnss_resolve.so.2.8 \
man/resolved.conf.d.5 \
man/systemd-resolved.8
man/systemd-resolved.8 \
man/systemd.negative.5 \
man/systemd.positive.5
man/libnss_resolve.so.2.8: man/nss-resolve.8
man/resolved.conf.d.5: man/resolved.conf.5
man/systemd-resolved.8: man/systemd-resolved.service.8
man/systemd.negative.5: man/dnssec-trust-anchors.d.5
man/systemd.positive.5: man/dnssec-trust-anchors.d.5
man/libnss_resolve.so.2.html: man/nss-resolve.html
$(html-alias)
@ -1812,6 +2033,12 @@ man/resolved.conf.d.html: man/resolved.conf.html
man/systemd-resolved.html: man/systemd-resolved.service.html
$(html-alias)
man/systemd.negative.html: man/dnssec-trust-anchors.d.html
$(html-alias)
man/systemd.positive.html: man/dnssec-trust-anchors.d.html
$(html-alias)
endif
if ENABLE_RFKILL
@ -1961,6 +2188,7 @@ MANPAGES_ALIAS += \
man/sd_login_monitor_get_fd.3 \
man/sd_login_monitor_get_timeout.3 \
man/sd_login_monitor_unref.3 \
man/sd_login_monitor_unrefp.3 \
man/sd_peer_get_cgroup.3 \
man/sd_peer_get_machine_name.3 \
man/sd_peer_get_owner_uid.3 \
@ -2007,6 +2235,7 @@ man/sd_login_monitor_get_events.3: man/sd_login_monitor_new.3
man/sd_login_monitor_get_fd.3: man/sd_login_monitor_new.3
man/sd_login_monitor_get_timeout.3: man/sd_login_monitor_new.3
man/sd_login_monitor_unref.3: man/sd_login_monitor_new.3
man/sd_login_monitor_unrefp.3: man/sd_login_monitor_new.3
man/sd_peer_get_cgroup.3: man/sd_pid_get_session.3
man/sd_peer_get_machine_name.3: man/sd_pid_get_session.3
man/sd_peer_get_owner_uid.3: man/sd_pid_get_session.3
@ -2071,6 +2300,9 @@ man/sd_login_monitor_get_timeout.html: man/sd_login_monitor_new.html
man/sd_login_monitor_unref.html: man/sd_login_monitor_new.html
$(html-alias)
man/sd_login_monitor_unrefp.html: man/sd_login_monitor_new.html
$(html-alias)
man/sd_peer_get_cgroup.html: man/sd_pid_get_session.html
$(html-alias)
@ -2232,6 +2464,7 @@ EXTRA_DIST += \
man/coredumpctl.xml \
man/crypttab.xml \
man/daemon.xml \
man/dnssec-trust-anchors.d.xml \
man/file-hierarchy.xml \
man/halt.xml \
man/hostname.xml \
@ -2263,7 +2496,9 @@ EXTRA_DIST += \
man/resolved.conf.xml \
man/runlevel.xml \
man/sd-bus-errors.xml \
man/sd-bus.xml \
man/sd-daemon.xml \
man/sd-event.xml \
man/sd-id128.xml \
man/sd-journal.xml \
man/sd-login.xml \
@ -2286,12 +2521,23 @@ EXTRA_DIST += \
man/sd_bus_request_name.xml \
man/sd_event_add_child.xml \
man/sd_event_add_defer.xml \
man/sd_event_add_io.xml \
man/sd_event_add_signal.xml \
man/sd_event_add_time.xml \
man/sd_event_exit.xml \
man/sd_event_get_fd.xml \
man/sd_event_new.xml \
man/sd_event_now.xml \
man/sd_event_run.xml \
man/sd_event_set_name.xml \
man/sd_event_set_watchdog.xml \
man/sd_event_source_get_event.xml \
man/sd_event_source_get_pending.xml \
man/sd_event_source_set_description.xml \
man/sd_event_source_set_enabled.xml \
man/sd_event_source_set_prepare.xml \
man/sd_event_source_set_priority.xml \
man/sd_event_source_set_userdata.xml \
man/sd_event_source_unref.xml \
man/sd_event_wait.xml \
man/sd_get_seats.xml \
man/sd_id128_get_machine.xml \
@ -2299,6 +2545,7 @@ EXTRA_DIST += \
man/sd_id128_to_string.xml \
man/sd_is_fifo.xml \
man/sd_journal_add_match.xml \
man/sd_journal_enumerate_fields.xml \
man/sd_journal_get_catalog.xml \
man/sd_journal_get_cursor.xml \
man/sd_journal_get_cutoff_realtime_usec.xml \
@ -2306,6 +2553,7 @@ EXTRA_DIST += \
man/sd_journal_get_fd.xml \
man/sd_journal_get_realtime_usec.xml \
man/sd_journal_get_usage.xml \
man/sd_journal_has_runtime_files.xml \
man/sd_journal_next.xml \
man/sd_journal_open.xml \
man/sd_journal_print.xml \
@ -2375,6 +2623,7 @@ EXTRA_DIST += \
man/systemd-quotacheck.service.xml \
man/systemd-random-seed.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-resolve.xml \
man/systemd-resolved.service.xml \
man/systemd-rfkill.service.xml \
man/systemd-run.xml \

File diff suppressed because it is too large Load Diff

227
NEWS
View File

@ -1,5 +1,224 @@
systemd System and Service Manager
CHANGES WITH 229:
* The systemd-resolved DNS resolver service has gained a substantial
set of new features, most prominently it may now act as a DNSSEC
validating stub resolver. DNSSEC mode is currently turned off by
default, but it is expected that this is turned on by default in one
of the next releases. For now, we invite everybody to test the DNSSEC
logic by setting DNSSEC=allow-downgrade in
/etc/systemd/resolved.conf. The service also gained a full set of
D-Bus interfaces, including calls to configure DNS and DNSSEC
settings per link (for consumption by external network management
software). systemd-resolved (and systemd-networkd along with it) now
know to distinguish between "search" and "routing" domains. The
former are used to qualify single-label names, the latter are purely
used for routing lookups within certain domains to specific
links. resolved will now also synthesize RRs for all entries from
/etc/hosts.
* The systemd-resolve tool (which is a client utility for
systemd-resolved, and previously experimental) has been improved
considerably and is now fully supported and documented. Hence it has
moved from /usr/lib/systemd to /usr/bin.
* /dev/disk/by-path/ symlink support has been (re-)added for virtio
devices.
* The coredump collection logic has been reworked: when a coredump is
collected it is now written to disk, compressed and processed
(including stacktrace extraction) from a new instantiated service
systemd-coredump@.service, instead of directly from the
/proc/sys/kernel/core_pattern hook we provide. This is beneficial as
processing large coredumps can take up a substantial amount of
resources and time, and this previously happened entirely outside of
systemd's service supervision. With the new logic the core_pattern
hook only does minimal metadata collection before passing off control
to the new instantiated service, which is configured with a time
limit, a nice level and other settings to minimize negative impact on
the rest of the system. Also note that the new logic will honour the
RLIMIT_CORE setting of the crashed process, which now allows users
and processes to turn off coredumping for their processes by setting
this limit.
* The RLIMIT_CORE resource limit now defaults to "unlimited" for PID 1
and all forked processes by default. Previously, PID 1 would leave
the setting at "0" for all processes, as set by the kernel. Note that
the resource limit traditionally has no effect on the generated
coredumps on the system if the /proc/sys/kernel/core_pattern hook
logic is used. Since the limit is now honoured (see above) its
default has been changed so that the coredumping logic is enabled by
default for all processes, while allowing specific opt-out.
* When the stacktrace is extracted from processes of system users, this
is now done as "systemd-coredump" user, in order to sandbox this
potentially security sensitive parsing operation. (Note that when
processing coredumps of normal users this is done under the user ID
of process that crashed, as before.) Packagers should take notice
that it is now necessary to create the "systemd-coredump" system user
and group at package installation time.
* The systemd-activate socket activation testing tool gained support
for SOCK_DGRAM and SOCK_SEQPACKET sockets using the new --datagram
and --seqpacket switches. It also has been extended to support both
new-style and inetd-style file descriptor passing. Use the new
--inetd switch to request inetd-style file descriptor passing.
* Most systemd tools now honor a new $SYSTEMD_COLORS environment
variable, which takes a boolean value. If set to false, ANSI color
output is disabled in the tools even when run on a terminal that
supports it.
* The VXLAN support in networkd now supports two new settings
DestinationPort= and PortRange=.
* A new systemd.machine_id= kernel command line switch has been added,
that may be used to set the machine ID in /etc/machine-id if it is
not initialized yet. This command line option has no effect if the
file is already initialized.
* systemd-nspawn gained a new --as-pid2 switch that invokes any
specified command line as PID 2 rather than PID 1 in the
container. In this mode PID 1 will be a minimal stub init process
that implements the special POSIX and Linux semantics of PID 1
regarding signal and child process management. Note that this stub
init process is implemented in nspawn itself and requires no support
from the container image. This new logic is useful to support running
arbitrary command lines in the container, as normal processes are
generally not prepared to run as PID 1.
* systemd-nspawn gained a new --chdir= switch for setting the current
working directory for the process started in the container.
* "journalctl /dev/sda" will now output all kernel log messages from
the specified device, in addition to all devices that are parents of
it. This should make log output about devices pretty useful, as long
as kernel drivers attach enough metadata to the log messages. (The
usual SATA drivers do.)
* The sd-journal API gained two new calls
sd_journal_has_runtime_files() and sd_journal_has_persistent_files()
that report whether log data from /run or /var has been found.
* journalctl gained a new switch "--fields" that prints all journal
record field names currently in use in the journal. This is backed
by two new sd-journal API calls sd_journal_enumerate_fields() and
sd_journal_restart_fields().
* Most configurable timeouts in systemd now expect an argument of
"infinity" to turn them off, instead of "0" as before. The semantics
from now on is that a timeout of "0" means "now", and "infinity"
means "never". To maintain backwards compatibility, "0" continues to
turn off previously existing timeout settings.
* "systemctl reload-or-try-restart" has been renamed to "systemctl
try-reload-or-restart" to clarify what it actually does: the "try"
logic applies to both reloading and restarting, not just restarting.
The old name continues to be accepted for compatibility.
* On boot-up, when PID 1 detects that the system clock is behind the
release date of the systemd version in use, the clock is now set
to the latter. Previously, this was already done in timesyncd, in order
to avoid running with clocks set to the various clock epochs such as
1902, 1938 or 1970. With this change the logic is now done in PID 1
in addition to timesyncd during early boot-up, so that it is enforced
before the first process is spawned by systemd. Note that the logic
in timesyncd remains, as it is more comprehensive and ensures
montonic clocks by maintaining a persistant timestamp file in
/var. Since /var is generally not available in earliest boot or the
initrd, this part of the logic remains in timesyncd, and is not done
by PID 1.
* Support for tweaking details in net_cls.class_id through the
NetClass= configuration directive has been removed, as the kernel
people have decided to deprecate that controller in cgroup v2.
Userspace tools such as nftables are moving over to setting rules
that are specific to the full cgroup path of a task, which obsoletes
these controllers anyway. The NetClass= directive is kept around for
legacy compatibility reasons. For a more in-depth description of the
kernel change, please refer to the respective upstream commit:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bd1060a1d671
* A new service setting RuntimeMaxSec= has been added that may be used
to specify a maximum runtime for a service. If the timeout is hit, the
service is terminated and put into a failure state.
* A new service setting AmbientCapabilities= has been added. It allows
configuration of additional Linux process capabilities that are
passed to the activated processes. This is only available on very
recent kernels.
* The process resource limit settings in service units may now be used
to configure hard and soft limits individually.
* The various libsystemd APIs such as sd-bus or sd-event now publicly
expose support for gcc's __attribute__((cleanup())) C
extension. Specifically, for many object destructor functions
alternative versions whose names are suffixed with "p" have been
added, which take a pointer to a pointer to the object to destroy,
instead of just a pointer to the object itself. This is useful because
these destructor functions may be used directly as parameters to the
cleanup construct. Internally, systemd has been a heavy user of the
GCC extension since a long time, and with this change similar support
is now available to consumers of the library outside of systemd. Note
that by using this extension in your sources compatibility with old
and strictly ANSI compatible C compilers is lost. However, any gcc or
LLVM version of recent years have supported this extension.
* Timer units gained support for a new setting RandomizedDelaySec= that
allows configuring some additional randomized delay to the configured
time. This is useful to spread out timer events to avoid load peaks in
clusters or larger setups.
* Calendar time specifications now support sub-second accuracy.
* Socket units now support listening on SCTP and UDP-lite protocol
sockets.
* The sd-event API now comes with a full set of man pages.
* Older versions of systemd contained experimental support for
compressing journal files and coredumps with the LZ4 compressor that
was not compatible with the lz4 binary (due to API limitations of the
lz4 library). This support has been removed; only support for files
compatible with the lz4 binary remains. This LZ4 logic is now
officially supported and no longer considered experimental.
* The dkr image import logic has been removed again from importd. dkr's
micro-services focus doesn't fit into the machine image focus of
importd, and quickly got out of date with the upstream dkr API.
* Creation of the /run/lock/lockdev/ directory was dropped from
tmpfiles.d/legacy.conf. Better locking mechanisms like flock() have
been available for many years. If you still need this, you need to
create your own tmpfiles.d config file with:
d /run/lock/lockdev 0775 root lock -
Contributions from: Abdo Roig-Maranges, Alban Crequy, Aleksander
Adamowski, Alexander Kuleshov, Andreas Pokorny, Andrei Borzenkov,
Andrew Wilcox, Arthur Clement, Beniamino Galvani, Casey Schaufler,
Chris Atkinson, Chris Mayo, Christian Hesse, Damjan Georgievski, Dan
Dedrick, Daniele Medri, Daniel J Walsh, Daniel Korostil, Daniel Mack,
David Herrmann, Dimitri John Ledkov, Dominik Hannen, Douglas Christman,
Evgeny Vereshchagin, Filipe Brandenburger, Franck Bui, Gabor Kelemen,
Harald Hoyer, Hayden Walles, Helmut Grohne, Henrik Kaare Poulsen,
Hristo Venev, Hui Wang, Indrajit Raychaudhuri, Ismo Puustinen, Jakub
Wilk, Jan Alexander Steffens (heftig), Jan Engelhardt, Jan Synacek,
Joost Bremmer, Jorgen Schaefer, Karel Zak, Klearchos Chaloulos,
lc85446, Lennart Poettering, Lukas Nykryn, Mantas Mikulėnas, Marcel
Holtmann, Martin Pitt, Michael Biebl, Michael Olbrich, Michael Scherer,
Michał Górny, Michal Sekletar, Nicolas Cornu, Nicolas Iooss, Nils
Carlson, nmartensen, nnz1024, Patrick Ohly, Peter Hutterer, Phillip Sz,
Ronny Chevalier, Samu Kallio, Shawn Landden, Stef Walter, Susant
Sahani, Sylvain Plantefève, Tadej Janež, Thomas Hindoe Paaboel
Andersen, Tom Gundersen, Torstein Husebø, Umut Tezduyar Lindskog, Vito
Caputo, WaLyong Cho, Yu Watanabe, Zbigniew Jędrzejewski-Szmek
-- Berlin, 2016-02-11
CHANGES WITH 228:
* A number of properties previously only settable in unit
@ -88,6 +307,14 @@ CHANGES WITH 228:
from PID1's environment block into the environment block of
the service.
* Timer units gained support for a new RemainAfterElapse=
setting which takes a boolean argument. It defaults on on,
exposing behaviour unchanged to previous releases. If set to
off, timer units are unloaded after they elapsed if they
cannot elapse again. This is particularly useful for
transient timer units, which shall not stay around longer
than until they first elapse.
* systemd will now bump the net.unix.max_dgram_qlen to 512 by
default now (the kernel default is 16). This is beneficial
for avoiding blocking on AF_UNIX/SOCK_DGRAM sockets since it

13
README
View File

@ -15,7 +15,6 @@ GITWEB:
MAILING LIST:
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
http://lists.freedesktop.org/mailman/listinfo/systemd-commits
IRC:
#systemd on irc.freenode.org
@ -204,6 +203,9 @@ USERS AND GROUPS:
Similarly, the kdbus dbus1 proxy daemon requires the
"systemd-bus-proxy" system user and group to exist.
Similarly, the coredump support requires the
"systemd-coredump" system user and group to exist.
NSS:
systemd ships with three NSS modules:
@ -237,10 +239,6 @@ SYSV INIT.D SCRIPTS:
needs to look like, and provide an implementation at the marked places.
WARNINGS:
systemd will freeze execution during boot if /etc/mtab exists
but is not a symlink to /proc/mounts. Please ensure that
/etc/mtab is a proper symlink.
systemd will warn you during boot if /usr is on a different
file system than /. While in systemd itself very little will
break if /usr is on a separate partition, many of its
@ -267,3 +265,8 @@ WARNINGS:
servers if not specified otherwise at configure time. You
really should not ship an OS or device with this default
setting. See DISTRO_PORTING for details.
ENGINEERING AND CONSULTING SERVICES:
Kinvolk (https://kinvolk.io) offers professional engineering
and consulting services for systemd. Please contact Chris Kühl
<chris@kinvolk.io> for more information.

View File

@ -5,5 +5,14 @@
## Details
* General information about systemd can be found in the [systemd Wiki](http://www.freedesktop.org/wiki/Software/systemd)
* Information about build requirements are provided in the [README file](../master/README)
General information about systemd can be found in the [systemd Wiki](http://www.freedesktop.org/wiki/Software/systemd).
Information about build requirements are provided in the [README file](../master/README).
Consult our [NEWS file](../master/NEWS) for information about what's new in the most recent systemd versions.
Please see our [Contribution Guidelines](../master/CONTRIBUTING.md) for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our [Coding Style Guidelines](../master/CODING_STYLE).
If you are looking for support, please contact our [mailing list](http://lists.freedesktop.org/mailman/listinfo/systemd-devel) or join our [IRC channel](irc://irc.freenode.org/%23systemd).

61
TODO
View File

@ -33,6 +33,19 @@ Janitorial Clean-ups:
Features:
* delay activation of logind until somebody logs in, or when /dev/tty0 pulls it
in or lingering is on (so that containers don't bother with it until PAM is used). also exit-on-idle
* cache sd_event_now() result from before the first iteration...
* remove Capabilities=, after all AmbientCapabilities= and CapabilityBoundingSet= should be enough.
* support for the new copy_file_range() syscall
* add systemctl stop --job-mode=triggering that follows TRIGGERED_BY deps and adds them to the same transaction
* Maybe add a way how users can "pin" units into memory, so that they are not subject to automatic GC?
* PID1: find a way how we can reload unit file configuration for
specific units only, without reloading the whole of systemd
@ -58,8 +71,6 @@ Features:
* consider throwing a warning if a service declares it wants to be "Before=" a .device unit.
* "systemctl edit" should know a mode to create a new unit file
* there's probably something wrong with having user mounts below /sys,
as we have for debugfs. for exmaple, src/core/mount.c handles mounts
prefixed with /sys generally special.
@ -67,12 +78,8 @@ Features:
* man: document that unless you use StandardError=null the shell >/dev/stderr won't work in shell scripts in services
* "systemctl daemon-reload" should result in /etc/systemd/system.conf being reloaded by systemd
* install: include generator dirs in unit file search paths
* invent a better systemd-run scheme for naming scopes, that works with remoting
* rework C11 utf8.[ch] to use char32_t instead of uint32_t when referring
to unicode chars, to make things more expressive.
@ -103,7 +110,7 @@ Features:
* Rework systemctl's GetAll property parsing to use the generic bus_map_all_properties() API
* 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
* implement a per-service firewall based on net_cls
* Port various tools to make use of verbs.[ch], where applicable
@ -155,8 +162,6 @@ Features:
* maybe provide an API to allow migration of foreign PIDs into existing scopes.
* maybe support a new very "soft" reboot mode, that simply kills all processes, disassembles everything, flushes /run and sysvipc, and then reexecs systemd again
* man: maybe use the word "inspect" rather than "introspect"?
* systemctl: if some operation fails, show log output?
@ -166,9 +171,9 @@ Features:
- 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.
* exponential backoff in timesyncd and resolved when we cannot reach a server
* exponential backoff in timesyncd when we cannot reach a server
* timesyncd + resolved: add ugly bus calls to set NTP and DNS servers per-interface, for usage by NM
* timesyncd: add ugly bus calls to set NTP servers per-interface, for usage by NM
* extract_many_words() should probably be used by a lot of code that
currently uses FOREACH_WORD and friends. For example, most conf
@ -183,23 +188,16 @@ Features:
(throughout the codebase, not only PID1)
* resolved:
- put networkd events and rtnl events at a higher priority, so that
we always process them before we process client requests
- DNSSEC
- add display of private key types (http://tools.ietf.org/html/rfc4034#appendix-A.1.1)?
- DNS
- search paths
- mDNS/DNS-SD
- service registration
- service/domain/types browsing
- avahi compat
- DNS-SD service registration from socket units
- edns0
- dname: Not necessary for plain DNS as synthesized cname is handed out instead if we do not
announce dname support. However, for DNSSEC it is necessary as the synthesized cname
will not be signed.
- cname on PTR (?)
- resolved should optionally register additional per-interface LLMNR
names, so that for the container case we can establish the same name
(maybe "host") for referencing the server, everywhere.
- enable DNSSEC by default
- allow clients to request DNSSEC for a single lookup even if DNSSEC is off (?)
* refcounting in sd-resolve is borked
@ -213,8 +211,6 @@ Features:
* generator that automatically discovers btrfs subvolumes, identifies their purpose based on some xattr on them.
* timer units: actually add extra delays to timer units with high AccuracySec values, don't start them already when we are awake...
* a way for container managers to turn off getty starting via $container_headless= or so...
* figure out a nice way how we can let the admin know what child/sibling unit causes cgroup membership for a specific unit
@ -339,10 +335,6 @@ Features:
- generate a failure of a default event loop is executed out-of-thread
- maybe add support for inotify events
* in the final killing spree, detect processes from the root directory, and
complain loudly if they have argv[0][0] == '@' set.
https://bugzilla.redhat.com/show_bug.cgi?id=961044
* investigate endianness issues of UUID vs. GUID
* dbus: when a unit failed to load (i.e. is in UNIT_ERROR state), we
@ -491,10 +483,6 @@ Features:
- journal-or-kmsg is currently broken? See reverted
commit 4a01181e460686d8b4a543b1dfa7f77c9e3c5ab8.
- man: document that corrupted journal files is nothing to act on
- systemd-journal-upload (or a new, related tool): allow pushing out
journal messages onto the network in BSD syslog protocol,
continuously. Default to some link-local IP mcast group, to make this
useful as a one-stop debugging tool.
- rework journald sigbus stuff to use mutex
- 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
@ -609,8 +597,6 @@ Features:
removed or added to an existing machine
- "machinectl migrate" or similar to copy a container from or to a
difference host, via ssh
- man: document how update dkr images works with machinectl
http://lists.freedesktop.org/archives/systemd-devel/2015-February/028630.html
- introduce systemd-nspawn-ephemeral@.service, and hook it into
"machinectl start" with a new --ephemeral switch
- "machinectl status" should also show internal logs of the container in
@ -623,8 +609,6 @@ Features:
shell in it, and marks it read-only after use
* importd:
- dkr: support tarsum checksum verification, if it becomes reality one day...
- dkr: convert json bits to nspawn configuration
- generate a nice warning if mkfs.btrfs is missing
* cryptsetup:
@ -661,10 +645,6 @@ Features:
* coredump:
- save coredump in Windows/Mozilla minidump format
- move PID 1 segfaults to /var/lib/systemd/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.
* support crash reporting operation modes (https://live.gnome.org/GnomeOS/Design/Whiteboards/ProblemReporting)
@ -736,7 +716,6 @@ Features:
- Support --test based on current system state
- If we show an error about a unit (such as not showing up) and it has no Description string, then show a description string generated form the reverse of unit_name_mangle().
- after deserializing sockets in socket.c we should reapply sockopts and things
- make timer units go away after they elapsed
- drop PID 1 reloading, only do reexecing (difficult: Reload()
currently is properly synchronous, Reexec() is weird, because we
cannot delay the response properly until we are back, so instead of

View File

@ -38,6 +38,21 @@ Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
The system journal process has shut down and closed all currently
active journal files.
-- ec387f577b844b8fa948f33cad9a75e6
Subject: Disk space used by the journal
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
@JOURNAL_NAME@ (@JOURNAL_PATH@) is currently using @CURRENT_USE_PRETTY@.
Maximum allowed usage is set to @MAX_USE_PRETTY@.
Leaving at least @DISK_KEEP_FREE_PRETTY@ free (of currently available @DISK_AVAILABLE_PRETTY@ of disk space).
Enforced usage limit is thus @LIMIT_PRETTY@, of which @AVAILABLE_PRETTY@ are still available.
The limits controlling how much disk space is used by the journal may
be configured with SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=,
RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings in
/etc/systemd/journald.conf. See journald.conf(5) for details.
-- a596d6fe7bfa4994828e72309e95d61e
Subject: Messages from a service have been suppressed
Defined-By: systemd
@ -278,3 +293,42 @@ Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
The virtual machine @NAME@ with its leader PID @LEADER@ has been
shut down.
-- 36db2dfa5a9045e1bd4af5f93e1cf057
Subject: DNSSEC mode has been turned off, as server doesn't support it
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8) resolved.conf(5)
The resolver service (systemd-resolved.service) has detected that the
configured DNS server does not support DNSSEC, and DNSSEC validation has been
turned off as result.
This event will take place if DNSSEC=allow-downgrade is configured in
resolved.conf and the configured DNS server is incompatible with DNSSEC. Note
that using this mode permits DNSSEC downgrade attacks, as an attacker might be
able turn off DNSSEC validation on the system by inserting DNS replies in the
communication channel that result in a downgrade like this.
This event might be indication that the DNS server is indeed incompatible with
DNSSEC or that an attacker has successfully managed to stage such a downgrade
attack.
-- 1675d7f172174098b1108bf8c7dc8f5d
Subject: DNSSEC validation failed
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8)
A DNS query or resource record set failed DNSSEC validation. This is usually
indication that the communication channel used was tampered with.
-- 4d4408cfd0d144859184d1e65d7c8a65
Subject: A DNSSEC trust anchor has been revoked
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8)
A DNSSEC trust anchor has been revoked. A new trust anchor has to be
configured, or the operating system needs to be updated, to provide an updated
DNSSEC trust anchor.

262
catalog/systemd.hu.catalog Normal file
View File

@ -0,0 +1,262 @@
# This file is part of systemd.
#
# Copyright 2012 Lennart Poettering
# Copyright 2016 Gabor Kelemen
#
# 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 <http://www.gnu.org/licenses/>.
# Message catalog for systemd's own messages
# The catalog format is documented on
# http://www.freedesktop.org/wiki/Software/systemd/catalog
# For an explanation why we do all this, see https://xkcd.com/1024/
-- f77379a8490b408bbe5f6940505a777b
Subject: A napló elindult
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszernapló folyamat elindult, megnyitotta írásra a naplófájlokat,
és most készen áll kérések feldolgozására.
-- d93fb3c9c24d451a97cea615ce59c00b
Subject: A napló leállt
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszernapló folyamat leállt, és bezárt minden jelenleg aktív naplófájlt.
-- a596d6fe7bfa4994828e72309e95d61e
Subject: Egy szolgáltatás üzenetei elnémítva
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:journald.conf(5)
Egy szolgáltatás túl sok üzenetet naplózott adott idő alatt. A
szolgáltatástól származó üzenetek eldobásra kerültek.
Ne feledje, hogy csak a kérdéses szolgáltatás üzenetei kerültek eldobásra,
más szolgáltatások üzeneteit ez nem befolyásolja.
Az üzenetek eldobását vezérlő korlátok az /etc/systemd/journald.conf
RateLimitInterval= és RateLimitBurst= beállításaival adhatók meg.
Részletekért lásd a journald.conf(5) man oldalt.
-- e9bf28e6e834481bb6f48f548ad13606
Subject: Naplóüzenetek vesztek el
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Kernelüzenetek vesztek el, mert a naplózó rendszer nem tudta elég gyorsan
feldolgozni azokat.
-- fc2e22bc6ee647b6b90729ab34a250b1
Subject: Egy folyamat összeomlott: @COREDUMP_PID@ (@COREDUMP_COMM@)
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:core(5)
Ez a folyamat: @COREDUMP_PID@ (@COREDUMP_COMM@) összeomlott, és core fájlt
írt ki.
Ez általában programozási hibát jelez az összeomló programban, és
a szállítója felé kell bejelenteni.
-- 8d45620c1a4348dbb17410da57c60c66
Subject: Új munkamenet (@SESSION_ID@) létrehozva, felhasználója: @USER_ID@
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
Létrejött egy új munkamenet @SESSION_ID@ azonosítóval ezen felhasználóhoz:
@USER_ID@.
A munkamenet vezető folyamata: @LEADER@.
-- 3354939424b4456d9802ca8333ed424a
Subject: Munkamenet (@SESSION_ID@) befejezve
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
A következő azonosítójú munkamenet befejeződött: @SESSION_ID@.
-- fcbefc5da23d428093f97c82a9290f7b
Subject: Elérhető egy új munkaállomás: @SEAT_ID@
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
Beállításra kerül és használható egy új munkaállomás: @SEAT_ID@.
-- e7852bfe46784ed0accde04bc864c2d5
Subject: A munkaállomás eltávolítva: @SEAT_ID@
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
A munkaállomás el lett távolítva, és már nem érhető el: @SEAT_ID@
-- c7a787079b354eaaa9e77b371893cd27
Subject: Időmódosítás
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszeróra beállítva @REALTIME@ ezredmásodpercre 1970. január 1. után.
-- 45f82f4aef7a4bbf942ce861d1f20990
Subject: Időzóna-módosítás erre: @TIMEZONE@
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszer időzónája módosítva lett erre: @TIMEZONE@.
-- b07a249cd024414a82dd00cd181378ff
Subject: A rendszer indítása kész
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszerindításkor szükséges indításhoz sorba állított összes
rendszerszolgáltatás elindult. Ne feledje, hogy ez nem jelenti, hogy a
gép üresjáratban van, mivel egyes szolgáltatások még az indítás
befejezésével lehetnek elfoglalva.
A kernel indítása @KERNEL_USEC@ ezredmásodpercet igényelt.
A kiinduló RAM lemez indítása @INITRD_USEC@ ezredmásodpercet igényelt.
A felhasználói programok indítása @USERSPACE_USEC@ ezredmásodpercet igényelt.
-- 6bbd95ee977941e497c48be27c254128
Subject: A rendszer „@SLEEP@” alvási állapotba lépett
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszer belépett ebbe az alvási állapotba: @SLEEP@.
-- 8811e6df2a8e40f58a94cea26f8ebf14
Subject: A rendszer „@SLEEP@” alvási állapotból kilépett
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A rendszer kilépett ebből az alvási állapotból: @SLEEP@.
-- 98268866d1d54a499c4e98921d93bc40
Subject: Rendszer leállítása kezdeményezve
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A systemd leállítása kezdeményezve. A leállítás megkezdődött, minden
rendszerszolgáltatás befejeződik, minden fájlrendszer leválasztásra kerül.
-- 7d4958e842da4a758f6c1cdc7b36dcc5
Subject: A(z) @UNIT@ egység indítása megkezdődött
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység megkezdte az indulást.
-- 39f53479d3a045ac8e11786248231fbf
Subject: A(z) @UNIT@ egység befejezte az indulást
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység befejezte az indulást
Az indítás eredménye: @RESULT@.
-- de5b426a63be47a7b6ac3eaac82e2f6f
Subject: A(z) @UNIT@ egység megkezdte a leállást
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység megkezdte a leállást.
-- 9d1aaa27d60140bd96365438aad20286
Subject: A(z) @UNIT@ egység befejezte a leállást
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység befejezte a leállást.
-- be02cf6855d2428ba40df7e9d022f03d
Subject: A(z) @UNIT@ egység hibát jelzett
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység hibát jelzett.
Az eredmény: @RESULT@.
-- d34d037fff1847e6ae669a370e694725
Subject: A(z) @UNIT@ egység megkezdte a beállításainak újratöltését
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység megkezdte a beállításainak újratöltését.
-- 7b05ebc668384222baa8881179cfda54
Subject: A(z) @UNIT@ egység befejezte a beállításainak újratöltését
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @UNIT@ egység befejezte a beállításainak újratöltését.
Az eredmény: @RESULT@.
-- 641257651c1b4ec9a8624d7a40a9e1e7
Subject: A folyamat végrehajtása sikertelen: @EXECUTABLE@
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A folyamat végrehajtása sikertelen volt, és hibát jelzett: @EXECUTABLE@.
A folyamat által visszaadott hibaszám: @ERRNO@.
-- 0027229ca0644181a76c4e92458afa2e
Subject: Legalább egy üzenet nem továbbítható a rendszernaplónak
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Legalább egy üzenet nem volt továbbítható a journald-vel párhuzamosan futó
syslog szolgáltatásnak. Ez általában azt jelenti, hogy a syslog
megvalósítás nem volt képes lépést tartani a sorba állított
üzenetek sebességével.
-- 1dee0369c7fc4736b7099b38ecb46ee7
Subject: A csatolási pont nem üres
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A csatolási pontként megadott @WHERE@ könyvtár (második mező az /etc/fstab
fájlban, vagy a Where= sor a systemd egységfájlban) nem üres. Ez nem
akadályozza meg a csatolást, de a könyvtárban már meglévő fájlok
elérhetetlenné válnak. A fájlok láthatóvá tételéhez csatolja
az azokat tartalmazó fájlrendszert egy másodlagos helyre.
-- 24d8d4452573402496068381a6312df2
Subject: Egy virtuális gép vagy konténer elindult
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) elindult, és
használatra kész.
-- 58432bd3bace477cb514b56381b8a758
Subject: Egy virtuális gép vagy konténer befejeződött
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) leállt.

View File

@ -1,7 +1,7 @@
# This file is part of systemd.
#
# Copyright 2012 Lennart Poettering
# Copyright 2013 Sergey Ptashnick
# Copyright 2013-2016 Sergey Ptashnick
#
# 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
@ -43,6 +43,25 @@ Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Процесс, отвечающий за журналирование системных событий, завершил работу и
закрыл все свои файлы.
# Subject: Disk space used by the journal
-- ec387f577b844b8fa948f33cad9a75e6
Subject: Место на диске, занятое журналом
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
@JOURNAL_NAME@ (@JOURNAL_PATH@) сейчас занимает @CURRENT_USE_PRETTY@.
Максимальный разрешенный размер составляет @MAX_USE_PRETTY@.
Оставляем свободными как минимум @DISK_KEEP_FREE_PRETTY@ (сейчас на диске
свободно @DISK_AVAILABLE_PRETTY@).
Таким образом, предел использования составляет @LIMIT_PRETTY@, из которых
@AVAILABLE_PRETTY@ пока свободно.
Ограничения на размер журнала настраиваются при помощи параметров
SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=,
RuntimeKeepFree=, RuntimeMaxFileSize= в файле /etc/systemd/journald.conf.
Более подробные сведения вы можете получить на справочной странице
journald.conf(5).
# Subject: Messages from a service have been suppressed
-- a596d6fe7bfa4994828e72309e95d61e
Subject: Часть сообщений от службы пропущена
@ -292,3 +311,44 @@ Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Виртуальная машина @NAME@ (идентификатор главного процесса: @LEADER@) выключена.
# Subject: DNSSEC mode has been turned off, as server doesn't support it
-- 36db2dfa5a9045e1bd4af5f93e1cf057
Subject: Механизм DNSSEC был отключен, так как DNS-сервер его не поддерживает
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8) resolved.conf(5)
Служба разрешения имен хостов (systemd-resolved.service) определила, что
указанный в настойках DNS-сервер не поддерживает технологию DNSSEC, и
автоматически отключила DNSSEC-проверки.
Данное событие возникает, если в файле resolved.conf указан параметр
DNSSEC=allow-downgrade, и вышестоящий DNS-сервер не поддерживает DNSSEC.
Обратите внимание, что режим allow-downgrade допускает возможность атаки
"DNSSEC downgrade", в ходе которой атакующий хакер блокирует проверки DNSSEC
путем отправки ложных сообщений от имени DNS-сервера.
Возникновение данного события может свидетельствовать как о том, что ваш
DNS-сервер не поддерживает DNSSEC, так и о том, что некий хакер успешно провел
против вас атаку, направленную на блокировку DNSSEC-проверок.
# Subject: DNSSEC validation failed
-- 1675d7f172174098b1108bf8c7dc8f5d
Subject: Проверка DNSSEC провалена
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8)
DNS-запрос или отдельная ресурсная запись не прошла проверку DNSSEC.
Как правило, это свидетельствует о постороннем вмешательстве в канал связи.
# Subject: A DNSSEC trust anchor has been revoked
-- 4d4408cfd0d144859184d1e65d7c8a65
Subject: Открытый ключ DNSSEC был отозван
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: man:systemd-resolved.service(8)
Открытый ключ (trust ahcnor) DNSSEC был отозван. Необходимо настроить новый
открытый ключ, либо обновить систему, чтобы получить обновленный открытый ключ.

View File

@ -0,0 +1,6 @@
@@
expression e, fmt;
expression list vaargs;
@@
- snprintf(e, sizeof(e), fmt, vaargs);
+ xsprintf(e, fmt, vaargs);

View File

@ -20,7 +20,7 @@
AC_PREREQ([2.64])
AC_INIT([systemd],
[228],
[229],
[http://github.com/systemd/systemd/issues],
[systemd],
[http://www.freedesktop.org/wiki/Software/systemd])
@ -297,7 +297,8 @@ AC_SUBST(CAP_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, renameat2, kcmp, keyctl, key_serial_t, LO_FLAGS_PARTSCAN],
AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2,
kcmp, keyctl, key_serial_t, char16_t, char32_t, LO_FLAGS_PARTSCAN],
[], [], [[
#include <sys/types.h>
#include <unistd.h>
@ -555,7 +556,7 @@ AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"])
# ------------------------------------------------------------------------------
have_bzip2=no
AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Disable optional BZIP2 support]))
AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Enable optional BZIP2 support]))
AS_IF([test "x$enable_bzip2" != "xno"], [
AC_CHECK_HEADERS(bzlib.h,
[AC_DEFINE(HAVE_BZIP2, 1, [Define if BZIP2 is available])
@ -668,11 +669,14 @@ AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK
esac],
[have_smack=auto])
if test "x${have_smack}" = xauto; then
if test "x${have_smack}" != xno; then
AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
have_smack=yes
fi
AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
have_smack_run_label=no
AC_ARG_WITH(smack-run-label,
AS_HELP_STRING([--with-smack-run-label=STRING],
@ -690,12 +694,6 @@ AS_HELP_STRING([--with-smack-default-process-label=STRING],
[AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
[])
if test "x${have_smack}" = xyes ; then
AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
fi
AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE([gcrypt],
AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
@ -708,7 +706,7 @@ AC_ARG_ENABLE([gcrypt],
if test "x${have_gcrypt}" != xno ; then
m4_define([AM_PATH_LIBGCRYPT_FAIL],
[{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT headers not found.]); }]
[{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT/GPG-ERROR headers not found.]); }]
)
m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT(
[1.4.5],
@ -723,12 +721,22 @@ if test "x${have_gcrypt}" != xno ; then
[AM_PATH_LIBGCRYPT_FAIL]
)
if test "x$have_gcrypt" = xyes ; then
GCRYPT_LIBS="$LIBGCRYPT_LIBS"
GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
have_gpg_error=no
m4_ifdef([AM_PATH_GPG_ERROR], [AM_PATH_GPG_ERROR(
[1.12],
[have_gpg_error=yes],
[AM_PATH_LIBGCRYPT_FAIL]
)],
[AM_PATH_LIBGCRYPT_FAIL]
)
if test "x$have_gcrypt" = xyes -a "x$have_gpg_error" = xyes ; then
GCRYPT_LIBS="$LIBGCRYPT_LIBS $GPG_ERROR_LIBS"
GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS $GPG_ERROR_CFLAGS"
AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
else
have_gcrypt=no
have_gpg_error=no
fi
else
GCRYPT_LIBS=
@ -838,18 +846,6 @@ if test "x$enable_qrencode" != "xno"; then
fi
AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
# ------------------------------------------------------------------------------
have_microhttpd=no
AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
if test "x$enable_microhttpd" != "xno"; then
PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
[AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
# ------------------------------------------------------------------------------
have_gnutls=no
AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
@ -862,18 +858,39 @@ if test "x$enable_gnutls" != "xno"; then
fi
AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
# ------------------------------------------------------------------------------
have_microhttpd=no
AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
if test "x$enable_microhttpd" != "xno"; then
PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
[AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available])
have_microhttpd=yes
M4_DEFINES="$M4_DEFINES -DHAVE_MICROHTTPD"],
[have_microhttpd=no])
if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
# ------------------------------------------------------------------------------
have_libcurl=no
AC_ARG_ENABLE(libcurl, AS_HELP_STRING([--disable-libcurl], [disable libcurl support]))
if test "x$enable_libcurl" != "xno"; then
PKG_CHECK_MODULES(LIBCURL, [libcurl],
[AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available]) have_libcurl=yes], have_libcurl=no)
[AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available])
have_libcurl=yes
M4_DEFINES="$M4_DEFINES -DHAVE_LIBCURL"],
[have_libcurl=no])
if test "x$have_libcurl" = xno -a "x$enable_libcurl" = xyes; then
AC_MSG_ERROR([*** libcurl support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
# ------------------------------------------------------------------------------
AM_CONDITIONAL(HAVE_REMOTE, [test "$have_microhttpd" = "yes" -o "$have_libcurl" = "yes"])
# ------------------------------------------------------------------------------
have_libidn=no
AC_ARG_ENABLE(libidn, AS_HELP_STRING([--disable-libidn], [Disable optional LIBIDN support]))
@ -1089,6 +1106,7 @@ have_coredump=no
AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
if test "x$enable_coredump" != "xno"; then
have_coredump=yes
M4_DEFINES="$M4_DEFINES -DENABLE_COREDUMP"
fi
AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
@ -1159,7 +1177,7 @@ AC_SUBST([EFI_ARCH])
AC_SUBST([EFI_MACHINE_TYPE_NAME])
have_gnuefi=no
AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [Disable optional gnuefi support]))
AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [Enable optional gnuefi support]))
AS_IF([test "x$enable_gnuefi" != "xno"], [
AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
[AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
@ -1285,9 +1303,9 @@ AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
# ------------------------------------------------------------------------------
have_manpages=no
AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test "x$enable_manpages" != xno], [
have_manpages=yes
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test -z "$XSLTPROC"],
AC_MSG_ERROR([*** xsltproc is required for man pages]))
])
@ -1421,14 +1439,6 @@ 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])
])
@ -1597,7 +1607,6 @@ 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}

File diff suppressed because it is too large Load Diff

View File

@ -1654,7 +1654,7 @@ bluetooth:v0224*
ID_VENDOR_FROM_DATABASE=Comarch SA
bluetooth:v0225*
ID_VENDOR_FROM_DATABASE=Nestl Nespresso S.A.
ID_VENDOR_FROM_DATABASE=Nestlé Nespresso S.A.
bluetooth:v0226*
ID_VENDOR_FROM_DATABASE=Merlinia A/S
@ -1780,7 +1780,7 @@ bluetooth:v024E*
ID_VENDOR_FROM_DATABASE=Microtronics Engineering GmbH
bluetooth:v024F*
ID_VENDOR_FROM_DATABASE=Schneider Schreibgerte GmbH
ID_VENDOR_FROM_DATABASE=Schneider Schreibgeräte GmbH
bluetooth:v0250*
ID_VENDOR_FROM_DATABASE=Sapphire Circuits LLC
@ -1897,7 +1897,7 @@ bluetooth:v0275*
ID_VENDOR_FROM_DATABASE=Geotab
bluetooth:v0276*
ID_VENDOR_FROM_DATABASE=E.G.O. Elektro-Gertebau GmbH
ID_VENDOR_FROM_DATABASE=E.G.O. Elektro-Gerätebau GmbH
bluetooth:v0277*
ID_VENDOR_FROM_DATABASE=bewhere inc
@ -2066,3 +2066,168 @@ bluetooth:v02AD*
bluetooth:v02AE*
ID_VENDOR_FROM_DATABASE=WeatherFlow, Inc.
bluetooth:v02AF*
ID_VENDOR_FROM_DATABASE=Technicolor USA Inc.
bluetooth:v02B0*
ID_VENDOR_FROM_DATABASE=Bestechnic(Shanghai),Ltd
bluetooth:v02B1*
ID_VENDOR_FROM_DATABASE=Raden Inc
bluetooth:v02B2*
ID_VENDOR_FROM_DATABASE=JouZen Oy
bluetooth:v02B3*
ID_VENDOR_FROM_DATABASE=CLABER S.P.A.
bluetooth:v02B4*
ID_VENDOR_FROM_DATABASE=Hyginex, Inc.
bluetooth:v02B5*
ID_VENDOR_FROM_DATABASE=HANSHIN ELECTRIC RAILWAY CO.,LTD.
bluetooth:v02B6*
ID_VENDOR_FROM_DATABASE=Schneider Electric
bluetooth:v02B7*
ID_VENDOR_FROM_DATABASE=Oort Technologies LLC
bluetooth:v02B8*
ID_VENDOR_FROM_DATABASE=Chrono Therapeutics
bluetooth:v02B9*
ID_VENDOR_FROM_DATABASE=Rinnai Corporation
bluetooth:v02BA*
ID_VENDOR_FROM_DATABASE=Swissprime Technologies AG
bluetooth:v02BB*
ID_VENDOR_FROM_DATABASE=Koha.,Co.Ltd
bluetooth:v02BC*
ID_VENDOR_FROM_DATABASE=Genevac Ltd
bluetooth:v02BD*
ID_VENDOR_FROM_DATABASE=Chemtronics
bluetooth:v02BE*
ID_VENDOR_FROM_DATABASE=Seguro Technology Sp. z o.o.
bluetooth:v02BF*
ID_VENDOR_FROM_DATABASE=Redbird Flight Simulations
bluetooth:v02C0*
ID_VENDOR_FROM_DATABASE=Dash Robotics
bluetooth:v02C1*
ID_VENDOR_FROM_DATABASE=LINE Corporation
bluetooth:v02C2*
ID_VENDOR_FROM_DATABASE=Guillemot Corporation
bluetooth:v02C3*
ID_VENDOR_FROM_DATABASE=Techtronic Power Tools Technology Limited
bluetooth:v02C4*
ID_VENDOR_FROM_DATABASE=Wilson Sporting Goods
bluetooth:v02C5*
ID_VENDOR_FROM_DATABASE=Lenovo (Singapore) Pte Ltd. ( 联想(新加坡) )
bluetooth:v02C6*
ID_VENDOR_FROM_DATABASE=Ayatan Sensors
bluetooth:v02C7*
ID_VENDOR_FROM_DATABASE=Electronics Tomorrow Limited
bluetooth:v02C8*
ID_VENDOR_FROM_DATABASE=VASCO Data Security International, Inc.
bluetooth:v02C9*
ID_VENDOR_FROM_DATABASE=PayRange Inc.
bluetooth:v02CA*
ID_VENDOR_FROM_DATABASE=ABOV Semiconductor
bluetooth:v02CB*
ID_VENDOR_FROM_DATABASE=AINA-Wireless Inc.
bluetooth:v02CC*
ID_VENDOR_FROM_DATABASE=Eijkelkamp Soil & Water
bluetooth:v02CD*
ID_VENDOR_FROM_DATABASE=BMA ergonomics b.v.
bluetooth:v02CE*
ID_VENDOR_FROM_DATABASE=Teva Branded Pharmaceutical Products R&D, Inc.
bluetooth:v02CF*
ID_VENDOR_FROM_DATABASE=Anima
bluetooth:v02D0*
ID_VENDOR_FROM_DATABASE=3M
bluetooth:v02D1*
ID_VENDOR_FROM_DATABASE=Empatica Srl
bluetooth:v02D2*
ID_VENDOR_FROM_DATABASE=Afero, Inc.
bluetooth:v02D3*
ID_VENDOR_FROM_DATABASE=Powercast Corporation
bluetooth:v02D4*
ID_VENDOR_FROM_DATABASE=Secuyou ApS
bluetooth:v02D5*
ID_VENDOR_FROM_DATABASE=OMRON Corporation
bluetooth:v02D6*
ID_VENDOR_FROM_DATABASE=Send Solutions
bluetooth:v02D7*
ID_VENDOR_FROM_DATABASE=NIPPON SYSTEMWARE CO.,LTD.
bluetooth:v02D8*
ID_VENDOR_FROM_DATABASE=Neosfar
bluetooth:v02D9*
ID_VENDOR_FROM_DATABASE=Fliegl Agrartechnik GmbH
bluetooth:v02DA*
ID_VENDOR_FROM_DATABASE=Gilvader
bluetooth:v02DB*
ID_VENDOR_FROM_DATABASE=Digi International Inc (R)
bluetooth:v02DC*
ID_VENDOR_FROM_DATABASE=DeWalch Technologies, Inc.
bluetooth:v02DD*
ID_VENDOR_FROM_DATABASE=Flint Rehabilitation Devices, LLC
bluetooth:v02DE*
ID_VENDOR_FROM_DATABASE=Samsung SDS Co., Ltd.
bluetooth:v02DF*
ID_VENDOR_FROM_DATABASE=Blur Product Development
bluetooth:v02E0*
ID_VENDOR_FROM_DATABASE=University of Michigan
bluetooth:v02E1*
ID_VENDOR_FROM_DATABASE=Victron Energy BV
bluetooth:v02E2*
ID_VENDOR_FROM_DATABASE=NTT docomo
bluetooth:v02E3*
ID_VENDOR_FROM_DATABASE=Carmanah Technologies Corp.
bluetooth:v02E4*
ID_VENDOR_FROM_DATABASE=Bytestorm Ltd.
bluetooth:v02E5*
ID_VENDOR_FROM_DATABASE=Espressif Incorporated ( 乐鑫信息科技(上海)有限公司 )

File diff suppressed because it is too large Load Diff

View File

@ -465,7 +465,7 @@ usb:v03F0p011D*
ID_MODEL_FROM_DATABASE=Bluetooth 1.2 Interface [Broadcom BCM2035]
usb:v03F0p0121*
ID_MODEL_FROM_DATABASE=HP49g+ Calculator
ID_MODEL_FROM_DATABASE=HP 39g+ [F2224A], 39gs [F2223A], 40gs [F2225A], 48gII [F2226A], 49g+ [F2228A], 50g [F2229A, NW240AA]
usb:v03F0p0122*
ID_MODEL_FROM_DATABASE=HID Internet Keyboard
@ -567,7 +567,7 @@ usb:v03F0p042A*
ID_MODEL_FROM_DATABASE=LaserJet M1132 MFP
usb:v03F0p0441*
ID_MODEL_FROM_DATABASE=HP Prime Calculator
ID_MODEL_FROM_DATABASE=Prime [NW280AA, G8X92AA]
usb:v03F0p0504*
ID_MODEL_FROM_DATABASE=DeskJet 885c
@ -632,6 +632,9 @@ usb:v03F0p0712*
usb:v03F0p0714*
ID_MODEL_FROM_DATABASE=Printing Support
usb:v03F0p0741*
ID_MODEL_FROM_DATABASE=Prime Wireless Kit [FOK65AA]
usb:v03F0p0801*
ID_MODEL_FROM_DATABASE=ScanJet 7400c
@ -833,6 +836,9 @@ usb:v03F0p1524*
usb:v03F0p1539*
ID_MODEL_FROM_DATABASE=Mini Magnetic Stripe Reader
usb:v03F0p1541*
ID_MODEL_FROM_DATABASE=Prime [G8X92AA]
usb:v03F0p1602*
ID_MODEL_FROM_DATABASE=PhotoSmart 330 series
@ -1130,6 +1136,9 @@ usb:v03F0p2A11*
usb:v03F0p2A17*
ID_MODEL_FROM_DATABASE=LaserJet 2430
usb:v03F0p2A1D*
ID_MODEL_FROM_DATABASE=Integrated Module with Bluetooth 2.1 Wireless technology
usb:v03F0p2B11*
ID_MODEL_FROM_DATABASE=PSC 2170 series
@ -1898,6 +1907,9 @@ usb:v03F0pC802*
usb:v03F0pD104*
ID_MODEL_FROM_DATABASE=Bluetooth Dongle
usb:v03F0pD507*
ID_MODEL_FROM_DATABASE=39gII [NW249AA]
usb:v03F0pEFBE*
ID_MODEL_FROM_DATABASE=NEC Picty900
@ -3719,6 +3731,9 @@ usb:v041Ep3090*
usb:v041Ep30D3*
ID_MODEL_FROM_DATABASE=Sound Blaster Play!
usb:v041Ep3100*
ID_MODEL_FROM_DATABASE=IR Receiver (SB0540)
usb:v041Ep3121*
ID_MODEL_FROM_DATABASE=WoW tap chat
@ -5627,6 +5642,9 @@ usb:v0458p0083*
usb:v0458p0087*
ID_MODEL_FROM_DATABASE=Ergo 525V Laser Mouse
usb:v0458p0089*
ID_MODEL_FROM_DATABASE=Genius Traveler 350
usb:v0458p00CA*
ID_MODEL_FROM_DATABASE=Pen Mouse
@ -7031,6 +7049,9 @@ usb:v046Ap0081*
usb:v046Ap0106*
ID_MODEL_FROM_DATABASE=R-300 Wireless Mouse Receiver
usb:v046Ap010D*
ID_MODEL_FROM_DATABASE=MX-Board 3.0 Keyboard
usb:v046B*
ID_VENDOR_FROM_DATABASE=American Megatrends, Inc.
@ -11898,7 +11919,7 @@ usb:v04B3p4484*
ID_MODEL_FROM_DATABASE=SMSC USB20H04 3-Port Hub [ThinkPad X4 UltraBase, Wistron S Note-3 Media Slice]
usb:v04B3p4485*
ID_MODEL_FROM_DATABASE=Serial Converter
ID_MODEL_FROM_DATABASE=ThinkPad Dock Hub
usb:v04B3p4524*
ID_MODEL_FROM_DATABASE=40 Character Vacuum Fluorescent Display
@ -12570,7 +12591,7 @@ usb:v04B8p087C*
ID_MODEL_FROM_DATABASE=PX-1700F
usb:v04B8p087D*
ID_MODEL_FROM_DATABASE=PX-B750F
ID_MODEL_FROM_DATABASE=PX-B750F/WP-4525 Series
usb:v04B8p087F*
ID_MODEL_FROM_DATABASE=PX-403A
@ -15071,6 +15092,9 @@ usb:v04F3p0103*
usb:v04F3p01A4*
ID_MODEL_FROM_DATABASE=Wireless Keyboard
usb:v04F3p0201*
ID_MODEL_FROM_DATABASE=Touchscreen
usb:v04F3p0210*
ID_MODEL_FROM_DATABASE=Optical Mouse
@ -16406,6 +16430,9 @@ usb:v04F9p035D*
usb:v04F9p035E*
ID_MODEL_FROM_DATABASE=MFC-1910NW
usb:v04F9p0360*
ID_MODEL_FROM_DATABASE=DCP-1618W
usb:v04F9p0361*
ID_MODEL_FROM_DATABASE=MFC-1919NW
@ -18795,61 +18822,61 @@ usb:v056Ap0010*
ID_MODEL_FROM_DATABASE=ET-0405 [Graphire]
usb:v056Ap0011*
ID_MODEL_FROM_DATABASE=Graphire 2 4x5
ID_MODEL_FROM_DATABASE=ET-0405A [Graphire2 (4x5)]
usb:v056Ap0012*
ID_MODEL_FROM_DATABASE=Graphire 2 5x7
ID_MODEL_FROM_DATABASE=ET-0507A [Graphire2 (5x7)]
usb:v056Ap0013*
ID_MODEL_FROM_DATABASE=Graphire 3 4x5
ID_MODEL_FROM_DATABASE=CTE-430 [Graphire3 (4x5)]
usb:v056Ap0014*
ID_MODEL_FROM_DATABASE=Graphire 3 6x8
ID_MODEL_FROM_DATABASE=CTE-630 [Graphire3 (6x8)]
usb:v056Ap0015*
ID_MODEL_FROM_DATABASE=Graphire 4 4x5
ID_MODEL_FROM_DATABASE=CTE-440 [Graphire4 (4x5)]
usb:v056Ap0016*
ID_MODEL_FROM_DATABASE=Graphire 4 6x8
ID_MODEL_FROM_DATABASE=CTE-640 [Graphire4 (6x8)]
usb:v056Ap0017*
ID_MODEL_FROM_DATABASE=CTE-450 [Bamboo Fun]
ID_MODEL_FROM_DATABASE=CTE-450 [Bamboo Fun (small)]
usb:v056Ap0018*
ID_MODEL_FROM_DATABASE=Bamboo Fun 6x8
ID_MODEL_FROM_DATABASE=CTE-650 [Bamboo Fun (medium)]
usb:v056Ap0019*
ID_MODEL_FROM_DATABASE=Bamboo One Medium
ID_MODEL_FROM_DATABASE=CTE-631 [Bamboo One]
usb:v056Ap0020*
ID_MODEL_FROM_DATABASE=Intuos 4x5
ID_MODEL_FROM_DATABASE=GD-0405 [Intuos (4x5)]
usb:v056Ap0021*
ID_MODEL_FROM_DATABASE=Intuos 6x8
ID_MODEL_FROM_DATABASE=GD-0608 [Intuos (6x8)]
usb:v056Ap0022*
ID_MODEL_FROM_DATABASE=Intuos 9x12
ID_MODEL_FROM_DATABASE=GD-0912 [Intuos (9x12)]
usb:v056Ap0023*
ID_MODEL_FROM_DATABASE=Intuos 12x12
ID_MODEL_FROM_DATABASE=GD-1212 [Intuos (12x12)]
usb:v056Ap0024*
ID_MODEL_FROM_DATABASE=Intuos 12x18
ID_MODEL_FROM_DATABASE=GD-1218 [Intuos (12x18)]
usb:v056Ap0026*
ID_MODEL_FROM_DATABASE=Intuos5 touch S
ID_MODEL_FROM_DATABASE=PTH-450 [Intuos5 touch (S)]
usb:v056Ap0027*
ID_MODEL_FROM_DATABASE=Intuos5 touch M
ID_MODEL_FROM_DATABASE=PTH-650 [Intuos5 touch (M)]
usb:v056Ap0028*
ID_MODEL_FROM_DATABASE=Intuos5 touch L
ID_MODEL_FROM_DATABASE=PTH-850 [Intuos5 touch (L)]
usb:v056Ap0029*
ID_MODEL_FROM_DATABASE=Intuos5 S
ID_MODEL_FROM_DATABASE=PTK-450 [Intuos5 (S)]
usb:v056Ap002A*
ID_MODEL_FROM_DATABASE=Intuos5 M
ID_MODEL_FROM_DATABASE=PTK-650 [Intuos5 (M)]
usb:v056Ap0030*
ID_MODEL_FROM_DATABASE=PL400
@ -18879,49 +18906,70 @@ usb:v056Ap0039*
ID_MODEL_FROM_DATABASE=DTU-710
usb:v056Ap003F*
ID_MODEL_FROM_DATABASE=Cintiq 21UX (DTZ-2100)
ID_MODEL_FROM_DATABASE=DTZ-2100 [Cintiq 21UX]
usb:v056Ap0041*
ID_MODEL_FROM_DATABASE=Intuos2 4x5
ID_MODEL_FROM_DATABASE=XD-0405-U [Intuos2 (4x5)]
usb:v056Ap0042*
ID_MODEL_FROM_DATABASE=Intuos2 6x8
ID_MODEL_FROM_DATABASE=XD-0608-U [Intuos2 (6x8)]
usb:v056Ap0043*
ID_MODEL_FROM_DATABASE=Intuos2 9x12
ID_MODEL_FROM_DATABASE=XD-0912-U [Intuos2 (9x12)]
usb:v056Ap0044*
ID_MODEL_FROM_DATABASE=Intuos2 12x12
ID_MODEL_FROM_DATABASE=XD-1212-U [Intuos2 (12x12)]
usb:v056Ap0045*
ID_MODEL_FROM_DATABASE=Intuos2 12x18
ID_MODEL_FROM_DATABASE=XD-1218-U [Intuos2 (12x18)]
usb:v056Ap0047*
ID_MODEL_FROM_DATABASE=Intuos2 6x8
usb:v056Ap0057*
ID_MODEL_FROM_DATABASE=DTK-2241
usb:v056Ap0059*
ID_MODEL_FROM_DATABASE=DTH-2242 tablet
usb:v056Ap005B*
ID_MODEL_FROM_DATABASE=DTH-2200 [Cintiq 22HD Touch] tablet
usb:v056Ap005D*
ID_MODEL_FROM_DATABASE=DTH-2242 touchscreen
usb:v056Ap005E*
ID_MODEL_FROM_DATABASE=DTH-2200 [Cintiq 22HD Touch] touchscreen
usb:v056Ap0060*
ID_MODEL_FROM_DATABASE=Volito
ID_MODEL_FROM_DATABASE=FT-0405 [Volito, PenPartner, PenStation (4x5)]
usb:v056Ap0061*
ID_MODEL_FROM_DATABASE=PenStation2
ID_MODEL_FROM_DATABASE=FT-0203 [Volito, PenPartner, PenStation (2x3)]
usb:v056Ap0062*
ID_MODEL_FROM_DATABASE=Volito2 4x5
ID_MODEL_FROM_DATABASE=CTF-420 [Volito2]
usb:v056Ap0063*
ID_MODEL_FROM_DATABASE=Volito2 2x3
ID_MODEL_FROM_DATABASE=CTF-220 [BizTablet]
usb:v056Ap0064*
ID_MODEL_FROM_DATABASE=PenPartner2
ID_MODEL_FROM_DATABASE=CTF-221 [PenPartner2]
usb:v056Ap0065*
ID_MODEL_FROM_DATABASE=Bamboo
ID_MODEL_FROM_DATABASE=MTE-450 [Bamboo]
usb:v056Ap0069*
ID_MODEL_FROM_DATABASE=Bamboo One
ID_MODEL_FROM_DATABASE=CTF-430 [Bamboo One]
usb:v056Ap006A*
ID_MODEL_FROM_DATABASE=CTE-460 [Bamboo One Pen (S)]
usb:v056Ap006B*
ID_MODEL_FROM_DATABASE=CTE-660 [Bamboo One Pen (M)]
usb:v056Ap0081*
ID_MODEL_FROM_DATABASE=Graphire Wireless 6x8
ID_MODEL_FROM_DATABASE=CTE-630BT [Graphire Wireless (6x8)]
usb:v056Ap0084*
ID_MODEL_FROM_DATABASE=Wireless adapter for Bamboo tablets
@ -18932,41 +18980,44 @@ usb:v056Ap0090*
usb:v056Ap0093*
ID_MODEL_FROM_DATABASE=TPC93
usb:v056Ap0097*
ID_MODEL_FROM_DATABASE=TPC97
usb:v056Ap009A*
ID_MODEL_FROM_DATABASE=TPC9A
usb:v056Ap00B0*
ID_MODEL_FROM_DATABASE=Intuos3 4x5
ID_MODEL_FROM_DATABASE=PTZ-430 [Intuos3 (4x5)]
usb:v056Ap00B1*
ID_MODEL_FROM_DATABASE=Intuos3 6x18
ID_MODEL_FROM_DATABASE=PTZ-630 [Intuos3 (6x8)]
usb:v056Ap00B2*
ID_MODEL_FROM_DATABASE=Intuos3 9x12
ID_MODEL_FROM_DATABASE=PTZ-930 [Intuos3 (9x12)]
usb:v056Ap00B3*
ID_MODEL_FROM_DATABASE=Intuos3 12x12
ID_MODEL_FROM_DATABASE=PTZ-1230 [Intuos3 (12x12)]
usb:v056Ap00B4*
ID_MODEL_FROM_DATABASE=Intuos3 12x19
ID_MODEL_FROM_DATABASE=PTZ-1231W [Intuos3 (12x19)]
usb:v056Ap00B5*
ID_MODEL_FROM_DATABASE=Intuos3 6x11 (PTZ-631W)
ID_MODEL_FROM_DATABASE=PTZ-631W [Intuos3 (6x11)]
usb:v056Ap00B7*
ID_MODEL_FROM_DATABASE=Intuos3 4x6
ID_MODEL_FROM_DATABASE=PTZ-431W [Intuos3 (4x6)]
usb:v056Ap00B8*
ID_MODEL_FROM_DATABASE=Intuos4 4x6
ID_MODEL_FROM_DATABASE=PTK-440 [Intuos4 (4x6)]
usb:v056Ap00B9*
ID_MODEL_FROM_DATABASE=Intuos4 6x9
ID_MODEL_FROM_DATABASE=PTK-640 [Intuos4 (6x9)]
usb:v056Ap00BA*
ID_MODEL_FROM_DATABASE=Intuos4 8x13
ID_MODEL_FROM_DATABASE=PTK-840 [Intuos4 (8x13)]
usb:v056Ap00BB*
ID_MODEL_FROM_DATABASE=Intuos4 12x19
ID_MODEL_FROM_DATABASE=PTK-1240 [Intuos4 (12x19)]
usb:v056Ap00C0*
ID_MODEL_FROM_DATABASE=DTF-521
@ -18975,64 +19026,181 @@ usb:v056Ap00C4*
ID_MODEL_FROM_DATABASE=DTF-720
usb:v056Ap00C5*
ID_MODEL_FROM_DATABASE=Cintiq 20WSX
ID_MODEL_FROM_DATABASE=DTZ-20WSX [Cintiq 20WSX]
usb:v056Ap00C6*
ID_MODEL_FROM_DATABASE=Cintiq 12WX
ID_MODEL_FROM_DATABASE=DTZ-12WX [Cintiq 12WX]
usb:v056Ap00C7*
ID_MODEL_FROM_DATABASE=DTU-1931
usb:v056Ap00CC*
ID_MODEL_FROM_DATABASE=Cintiq 21UX (DTK-2100)
ID_MODEL_FROM_DATABASE=DTK-2100 [Cintiq 21UX]
usb:v056Ap00CE*
ID_MODEL_FROM_DATABASE=DTU-2231
usb:v056Ap00D0*
ID_MODEL_FROM_DATABASE=CTT-460 [Bamboo Touch]
usb:v056Ap00D1*
ID_MODEL_FROM_DATABASE=Bamboo Pen & Touch (CTH-460-DE)
ID_MODEL_FROM_DATABASE=CTH-460 [Bamboo Pen & Touch]
usb:v056Ap00D2*
ID_MODEL_FROM_DATABASE=CTH-461 [Bamboo Fun/Craft/Comic Pen & Touch (S)]
usb:v056Ap00D3*
ID_MODEL_FROM_DATABASE=Bamboo Fun (CTH-661)
ID_MODEL_FROM_DATABASE=CTH-661 [Bamboo Fun/Comic Pen & Touch (M)]
usb:v056Ap00D4*
ID_MODEL_FROM_DATABASE=Bamboo Pen (CTL-460)
ID_MODEL_FROM_DATABASE=CTL-460 [Bamboo Pen (S)]
usb:v056Ap00D5*
ID_MODEL_FROM_DATABASE=CTL-660 [Bamboo Pen (M)]
usb:v056Ap00D6*
ID_MODEL_FROM_DATABASE=Bamboo Pen & Touch (CTH-460)
ID_MODEL_FROM_DATABASE=CTH-460 [Bamboo Pen & Touch]
usb:v056Ap00D7*
ID_MODEL_FROM_DATABASE=CTH-461 [Bamboo Fun/Craft/Comic Pen & Touch (S)]
usb:v056Ap00D8*
ID_MODEL_FROM_DATABASE=CTH-661 [Bamboo Fun/Comic Pen & Touch (M)]
usb:v056Ap00D9*
ID_MODEL_FROM_DATABASE=CTT-460 [Bamboo Touch]
usb:v056Ap00DA*
ID_MODEL_FROM_DATABASE=CTH-461SE [Bamboo Pen & Touch Special Edition (S)]
usb:v056Ap00DB*
ID_MODEL_FROM_DATABASE=Bamboo Fun (CTH-661SE-NL)
ID_MODEL_FROM_DATABASE=CTH-661SE [Bamboo Pen & Touch Special Edition (M)]
usb:v056Ap00DC*
ID_MODEL_FROM_DATABASE=CTT-470 [Bamboo Touch]
usb:v056Ap00DD*
ID_MODEL_FROM_DATABASE=Bamboo Pen (CTL-470)
ID_MODEL_FROM_DATABASE=CTL-470 [Bamboo Connect]
usb:v056Ap00DE*
ID_MODEL_FROM_DATABASE=CTH-470 [Bamboo Fun Pen & Touch]
usb:v056Ap00DF*
ID_MODEL_FROM_DATABASE=CTH-670 [Bamboo Create/Fun]
usb:v056Ap00E2*
ID_MODEL_FROM_DATABASE=TPCE2
usb:v056Ap00E3*
ID_MODEL_FROM_DATABASE=TPCE3
usb:v056Ap00E5*
ID_MODEL_FROM_DATABASE=TPCE5
usb:v056Ap00E6*
ID_MODEL_FROM_DATABASE=TPCE6
usb:v056Ap00EC*
ID_MODEL_FROM_DATABASE=TPCEC
usb:v056Ap00ED*
ID_MODEL_FROM_DATABASE=TPCED
usb:v056Ap00EF*
ID_MODEL_FROM_DATABASE=TPCEF
usb:v056Ap00F4*
ID_MODEL_FROM_DATABASE=DTK-2400 [Cintiq 24HD] tablet
usb:v056Ap00F6*
ID_MODEL_FROM_DATABASE=Cintiq 24HD touch (DTH-2400) touchscreen
ID_MODEL_FROM_DATABASE=DTH-2400 [Cintiq 24HD touch] touchscreen
usb:v056Ap00F8*
ID_MODEL_FROM_DATABASE=Cintiq 24HD touch (DTH-2400) tablet
ID_MODEL_FROM_DATABASE=DTH-2400 [Cintiq 24HD touch] tablet
usb:v056Ap00FA*
ID_MODEL_FROM_DATABASE=DTK-2200 [Cintiq 22HD] tablet
usb:v056Ap00FB*
ID_MODEL_FROM_DATABASE=DTU-1031
usb:v056Ap0100*
ID_MODEL_FROM_DATABASE=TPC100
usb:v056Ap0101*
ID_MODEL_FROM_DATABASE=TPC101
usb:v056Ap010D*
ID_MODEL_FROM_DATABASE=TPC10D
usb:v056Ap010E*
ID_MODEL_FROM_DATABASE=TPC10E
usb:v056Ap010F*
ID_MODEL_FROM_DATABASE=TPC10F
usb:v056Ap0116*
ID_MODEL_FROM_DATABASE=TPC116
usb:v056Ap012C*
ID_MODEL_FROM_DATABASE=TPC12C
usb:v056Ap0300*
ID_MODEL_FROM_DATABASE=CTL-471 [Bamboo Splash, One by Wacom (S)]
usb:v056Ap0301*
ID_MODEL_FROM_DATABASE=CTL-671 [One by Wacom (M)]
usb:v056Ap0302*
ID_MODEL_FROM_DATABASE=Intuos CTH480S2 [Manga]
ID_MODEL_FROM_DATABASE=CTH-480 [Intuos Pen & Touch (S)]
usb:v056Ap0303*
ID_MODEL_FROM_DATABASE=CTH-680 [Intuos Pen & Touch (M)]
usb:v056Ap0304*
ID_MODEL_FROM_DATABASE=DTK-1300 [Cintiq 13HD]
usb:v056Ap0307*
ID_MODEL_FROM_DATABASE=Cintiq Companion Hybrid 13HD (DTH-A1300) tablet
ID_MODEL_FROM_DATABASE=DTH-A1300 [Cintiq Companion Hybrid] tablet
usb:v056Ap0309*
ID_MODEL_FROM_DATABASE=Cintiq Companion Hybrid 13HD (DTH-A1300) touchscreen
ID_MODEL_FROM_DATABASE=DTH-A1300 [Cintiq Companion Hybrid] touchscreen
usb:v056Ap030E*
ID_MODEL_FROM_DATABASE=Intuos Pen Small (CTL480)
ID_MODEL_FROM_DATABASE=CTL-480 [Intuos Pen (S)]
usb:v056Ap0314*
ID_MODEL_FROM_DATABASE=PTH-451 [Intuos pro (S)]
usb:v056Ap0315*
ID_MODEL_FROM_DATABASE=PTH-651 [Intuos pro (M)]
usb:v056Ap0317*
ID_MODEL_FROM_DATABASE=PTH-851 [Intuos pro (L)]
usb:v056Ap032F*
ID_MODEL_FROM_DATABASE=DTU-1031X
usb:v056Ap0400*
ID_MODEL_FROM_DATABASE=PenPartner 4x5
usb:v056Ap4001*
ID_MODEL_FROM_DATABASE=TPC4001
usb:v056Ap4004*
ID_MODEL_FROM_DATABASE=TPC4004
usb:v056Ap4850*
ID_MODEL_FROM_DATABASE=PenPartner 6x8
usb:v056Ap5000*
ID_MODEL_FROM_DATABASE=TPC5000
usb:v056Ap5002*
ID_MODEL_FROM_DATABASE=TPC5002
usb:v056Ap5010*
ID_MODEL_FROM_DATABASE=Thinkpad T550 touchscreen
ID_MODEL_FROM_DATABASE=TPC5010
usb:v056B*
ID_VENDOR_FROM_DATABASE=Decicon, Inc.
@ -20546,6 +20714,9 @@ usb:v058Fp6387*
usb:v058Fp6390*
ID_MODEL_FROM_DATABASE=USB 2.0-IDE bridge
usb:v058Fp6391*
ID_MODEL_FROM_DATABASE=IDE Bridge
usb:v058Fp9213*
ID_MODEL_FROM_DATABASE=MacAlly Kbd Hub
@ -20588,6 +20759,9 @@ usb:v058Fp9368*
usb:v058Fp9380*
ID_MODEL_FROM_DATABASE=Flash Drive
usb:v058Fp9381*
ID_MODEL_FROM_DATABASE=Flash Drive
usb:v058Fp9382*
ID_MODEL_FROM_DATABASE=Acer/Sweex Flash drive
@ -21563,6 +21737,9 @@ usb:v05ACp8281*
usb:v05ACp8286*
ID_MODEL_FROM_DATABASE=Bluetooth Host Controller
usb:v05ACp828C*
ID_MODEL_FROM_DATABASE=Bluetooth Host Controller
usb:v05ACp8300*
ID_MODEL_FROM_DATABASE=Built-in iSight (no firmware loaded)
@ -21950,6 +22127,9 @@ usb:v05CAp1812*
usb:v05CAp1814*
ID_MODEL_FROM_DATABASE=HD Webcam
usb:v05CAp1815*
ID_MODEL_FROM_DATABASE=Dell Laptop Integrated Webcam
usb:v05CAp1820*
ID_MODEL_FROM_DATABASE=Integrated Webcam
@ -22367,6 +22547,9 @@ usb:v05DAp20ED*
usb:v05DAp20EE*
ID_MODEL_FROM_DATABASE=Micortek ScanMaker X12USL
usb:v05DAp2838*
ID_MODEL_FROM_DATABASE=RT2832U
usb:v05DAp3008*
ID_MODEL_FROM_DATABASE=Scanner
@ -33638,6 +33821,90 @@ usb:v0A85*
usb:v0A86*
ID_VENDOR_FROM_DATABASE=NITGen Co., Ltd
usb:v0A89*
ID_VENDOR_FROM_DATABASE=Aktiv
usb:v0A89p0001*
ID_MODEL_FROM_DATABASE=Guardant Stealth/Net
usb:v0A89p0002*
ID_MODEL_FROM_DATABASE=Guardant ID
usb:v0A89p0003*
ID_MODEL_FROM_DATABASE=Guardant Stealth 2
usb:v0A89p0004*
ID_MODEL_FROM_DATABASE=Rutoken
usb:v0A89p0005*
ID_MODEL_FROM_DATABASE=Guardant Fidus
usb:v0A89p0006*
ID_MODEL_FROM_DATABASE=Guardant Stealth 3
usb:v0A89p0007*
ID_MODEL_FROM_DATABASE=Guardant Stealth 2
usb:v0A89p0008*
ID_MODEL_FROM_DATABASE=Guardant Stealth 3 Sign/Time
usb:v0A89p0009*
ID_MODEL_FROM_DATABASE=Guardant Code
usb:v0A89p000A*
ID_MODEL_FROM_DATABASE=Guardant Sign Pro
usb:v0A89p000B*
ID_MODEL_FROM_DATABASE=Guardant Sign Pro HID
usb:v0A89p000C*
ID_MODEL_FROM_DATABASE=Guardant Stealth 3 Sign/Time
usb:v0A89p000D*
ID_MODEL_FROM_DATABASE=Guardant Code HID
usb:v0A89p000F*
ID_MODEL_FROM_DATABASE=Guardant System Firmware Update
usb:v0A89p0020*
ID_MODEL_FROM_DATABASE=Rutoken S
usb:v0A89p0025*
ID_MODEL_FROM_DATABASE=Rutoken lite
usb:v0A89p0026*
ID_MODEL_FROM_DATABASE=Rutoken lite HID
usb:v0A89p002A*
ID_MODEL_FROM_DATABASE=Rutoken Mass Storage
usb:v0A89p002B*
ID_MODEL_FROM_DATABASE=Guardant Mass Storage
usb:v0A89p0030*
ID_MODEL_FROM_DATABASE=Rutoken ECP
usb:v0A89p0040*
ID_MODEL_FROM_DATABASE=Rutoken ECP HID
usb:v0A89p0060*
ID_MODEL_FROM_DATABASE=Rutoken Magistra
usb:v0A89p0061*
ID_MODEL_FROM_DATABASE=Rutoken Magistra
usb:v0A89p0069*
ID_MODEL_FROM_DATABASE=Reader
usb:v0A89p0080*
ID_MODEL_FROM_DATABASE=Rutoken PinPad Ex
usb:v0A89p0081*
ID_MODEL_FROM_DATABASE=Rutoken PinPad In
usb:v0A89p0082*
ID_MODEL_FROM_DATABASE=Rutoken PinPad 2
usb:v0A8D*
ID_VENDOR_FROM_DATABASE=Picturetel
@ -48467,6 +48734,9 @@ usb:v1871*
usb:v1871p0101*
ID_MODEL_FROM_DATABASE=UVC camera (Bresser microscope)
usb:v1871p0141*
ID_MODEL_FROM_DATABASE=Camera
usb:v1871p0D01*
ID_MODEL_FROM_DATABASE=USB2.0 Camera
@ -48548,6 +48818,9 @@ usb:v18A5p0216*
usb:v18A5p0218*
ID_MODEL_FROM_DATABASE=External Hard Drive
usb:v18A5p0224*
ID_MODEL_FROM_DATABASE=Store 'n' Go Micro Plus
usb:v18A5p0227*
ID_MODEL_FROM_DATABASE=Pocket Hard Drive
@ -48555,11 +48828,20 @@ usb:v18A5p022B*
ID_MODEL_FROM_DATABASE=Portable Hard Drive (Store'n'Go)
usb:v18A5p0237*
ID_MODEL_FROM_DATABASE=Portable Harddrive (500 GB)
ID_MODEL_FROM_DATABASE=Portable Harddrive
usb:v18A5p0243*
ID_MODEL_FROM_DATABASE=Flash Drive (Store'n'Go)
usb:v18A5p0302*
ID_MODEL_FROM_DATABASE=Flash Drive
usb:v18A5p0304*
ID_MODEL_FROM_DATABASE=Store 'n' Go
usb:v18A5p4123*
ID_MODEL_FROM_DATABASE=Store N Go
usb:v18B1*
ID_VENDOR_FROM_DATABASE=Petalynx
@ -48611,6 +48893,18 @@ usb:v18CDpCAFE*
usb:v18D1*
ID_VENDOR_FROM_DATABASE=Google Inc.
usb:v18D1p0001*
ID_MODEL_FROM_DATABASE=Onda V972 (storage access)
usb:v18D1p0003*
ID_MODEL_FROM_DATABASE=Android-powered device using AllWinner Technology SoC
usb:v18D1p0006*
ID_MODEL_FROM_DATABASE=Onda V972 MTP
usb:v18D1p0008*
ID_MODEL_FROM_DATABASE=Onda V972 PTP (camera)
usb:v18D1p0D02*
ID_MODEL_FROM_DATABASE=Celkon A88
@ -48641,6 +48935,9 @@ usb:v18D1p4E22*
usb:v18D1p4E24*
ID_MODEL_FROM_DATABASE=Nexus S (tether)
usb:v18D1p4E30*
ID_MODEL_FROM_DATABASE=Galaxy Nexus (fastboot)
usb:v18D1p4E40*
ID_MODEL_FROM_DATABASE=Nexus 7 (fastboot)
@ -48653,17 +48950,29 @@ usb:v18D1p4E42*
usb:v18D1p4E43*
ID_MODEL_FROM_DATABASE=Nexus 7 (PTP)
usb:v18D1p4E44*
ID_MODEL_FROM_DATABASE=Nexus 7 2012 (PTP)
usb:v18D1p4EE0*
ID_MODEL_FROM_DATABASE=Nexus 4 (bootloader)
usb:v18D1p4EE1*
ID_MODEL_FROM_DATABASE=Nexus 4 / 10
ID_MODEL_FROM_DATABASE=Nexus Device (MTP)
usb:v18D1p4EE2*
ID_MODEL_FROM_DATABASE=Nexus 4 (debug)
ID_MODEL_FROM_DATABASE=Nexus Device (debug)
usb:v18D1p4EE3*
ID_MODEL_FROM_DATABASE=Nexus 4 (tether)
ID_MODEL_FROM_DATABASE=Nexus 4/5/7/10 (tether)
usb:v18D1p4EE4*
ID_MODEL_FROM_DATABASE=Nexus 4 (debug + tether)
ID_MODEL_FROM_DATABASE=Nexus 4/5/7/10 (debug + tether)
usb:v18D1p4EE5*
ID_MODEL_FROM_DATABASE=Nexus 4 (PTP)
usb:v18D1p4EE6*
ID_MODEL_FROM_DATABASE=Nexus 4/5 (PTP + debug)
usb:v18D1p7102*
ID_MODEL_FROM_DATABASE=Toshiba Thrive tablet
@ -48671,6 +48980,12 @@ usb:v18D1p7102*
usb:v18D1pB004*
ID_MODEL_FROM_DATABASE=Pandigital / B&N Novel 9" tablet
usb:v18D1pD001*
ID_MODEL_FROM_DATABASE=Nexus 4 (fastboot)
usb:v18D1pD002*
ID_MODEL_FROM_DATABASE=Nexus 4 (debug)
usb:v18D1pD109*
ID_MODEL_FROM_DATABASE=LG G2x MTP
@ -52358,6 +52673,12 @@ usb:v2478*
usb:v2478p2008*
ID_MODEL_FROM_DATABASE=U209-000-R Serial Port
usb:v248A*
ID_VENDOR_FROM_DATABASE=Maxxter
usb:v248Ap8366*
ID_MODEL_FROM_DATABASE=Wireless Optical Mouse ACT-MUSW-002
usb:v249C*
ID_VENDOR_FROM_DATABASE=M2Tech s.r.l.

View File

@ -25,8 +25,7 @@
# https://github.com/systemd/systemd
# or create a bug report on https://github.com/systemd/systemd/issues and
# include your new rules, a description of the device, and the output of
# udevadm info /dev/input/eventXX
# (or /dev/input/event*).
# udevadm info /dev/input/eventXX.
#
# Allowed properties are:
# EVDEV_ABS_<axis>=<min>:<max>:<res>:<fuzz>:<flat>
@ -115,6 +114,13 @@ evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnInsp
EVDEV_ABS_35=25:2000:22
EVDEV_ABS_36=0:1351:28
# Dell Latitude E6220
evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6220*
EVDEV_ABS_00=76:1815:22
EVDEV_ABS_01=131:1330:30
EVDEV_ABS_35=76:1815:22
EVDEV_ABS_36=131:1330:30
#########################################
# Google
#########################################
@ -126,6 +132,17 @@ evdev:name:Atmel maXTouch Touch*:dmi:bvn*:bvr*:bd*:svnGOOGLE:pnSamus*
EVDEV_ABS_35=::10
EVDEV_ABS_36=::10
#########################################
# HP
#########################################
# HP Pavilion dm4
evdev:name:SynPS/2 Synaptics TouchPad*:dmi:*svnHewlett-Packard:pnHPPaviliondm4*
EVDEV_ABS_00=1360:5563:47
EVDEV_ABS_01=1269:4618:61
EVDEV_ABS_35=1360:5563:47
EVDEV_ABS_36=1269:4618:61
#########################################
# Lenovo
#########################################
@ -141,3 +158,14 @@ evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*T510*
EVDEV_ABS_01=841:5330:100
EVDEV_ABS_35=778:6239:72
EVDEV_ABS_36=841:5330:100
#########################################
# Samsung
#########################################
# Samsung 305V4
evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn305V4A/305V5A*
EVDEV_ABS_00=0:2480:28
EVDEV_ABS_01=0:1116:24
EVDEV_ABS_35=0:2480:28
EVDEV_ABS_36=0:1116:24

View File

@ -56,8 +56,7 @@
# https://github.com/systemd/systemd
# or create a bug report on https://github.com/systemd/systemd/issues and
# include your new rules, a description of the device, and the output of
# udevadm info /dev/input/eventXX
# (or /dev/input/event*).
# udevadm info /dev/input/eventXX.
##########################################
# Acer
@ -499,6 +498,13 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPProBook450G0:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard:pnHPProBook6555b:*
KEYBOARD_KEY_b2=www # Earth
# HP ProBook 440 G3
evdev:atkbd:dmi:bvn*:bvr*:svnHP*:pnHP*ProBook*440*G3*
KEYBOARD_KEY_92=brightnessdown
KEYBOARD_KEY_97=brightnessup
KEYBOARD_KEY_ee=switchvideomode
KEYBOARD_KEY_81=f20 # micmute
###########################################################
# IBM
###########################################################
@ -652,6 +658,11 @@ evdev:atkbd:dmi:bvn*:bvr*:svnLENOVO*:pn*IdeaPad*Z370*:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*Lenovo*V480*:pvr*
KEYBOARD_KEY_f1=f21
# Lenovo Thinkcentre M800z AIO machine
# key_scancode 00 is KEY_MICMUTE
keyboard:name:Microphone Mute Button:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*
KEYBOARD_KEY_00=f20
# enhanced USB keyboard
evdev:input:b0003v04B3p301B*
KEYBOARD_KEY_90001=prog1 # ThinkVantage

View File

@ -41,8 +41,7 @@
# https://github.com/systemd/systemd
# or create a bug report on https://github.com/systemd/systemd/issues and
# include your new rules, a description of the device, and the output of
# udevadm info /dev/input/eventXX
# (or /dev/input/event*).
# udevadm info /dev/input/eventXX.
#
# Allowed properties are:
# MOUSE_DPI
@ -309,6 +308,8 @@ mouse:usb:v046dpc046:name:Logitech USB 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:
# Logitech USB Laser Mouse M-U0007 [M500]
mouse:usb:v046dpc069:name:Logitech USB Laser Mouse:
# Logitech V500 Cordless Notebook Mouse
mouse:usb:v046dpc510:name:Logitech USB Receiver:
# Logitech M560 Wireless Mouse
@ -340,8 +341,6 @@ mouse:usb:v046dp1024:name:Logitech M310:
# 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)

View File

@ -37,8 +37,7 @@
# https://github.com/systemd/systemd
# or create a bug report on https://github.com/systemd/systemd/issues and
# include your new rules, a description of the device, and the output of
# udevadm info /dev/input/eventXX
# (or /dev/input/event*).
# udevadm info /dev/input/eventXX.
#
# Allowed properties are:
# POINTINGSTICK_CONST_ACCEL
@ -80,6 +79,10 @@
evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeD620*:pvr*
POINTINGSTICK_CONST_ACCEL=0.5
# Latitude E6320
evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6320*:pvr*
POINTINGSTICK_CONST_ACCEL=2.0
# Latitude E6400
evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6400*:pvr*
POINTINGSTICK_CONST_ACCEL=1.5

View File

@ -43,7 +43,7 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
eval "AS_TR_SH([$2])='-Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
[int main(void) { return 0; } ],
[$4]))],

1
man/.gitignore vendored
View File

@ -1,4 +1,5 @@
/systemd.directives.xml
/systemd.index.xml
/*.[13578]
/*.html
/custom-entities.ent

View File

@ -448,7 +448,7 @@ ARRAY "s" {
<example>
<title>Invoking a Method</title>
<para>The following command invokes a the
<para>The following command invokes the
<literal>StartUnit</literal> method on the
<literal>org.freedesktop.systemd1.Manager</literal>
interface of the

View File

@ -37,7 +37,8 @@
<xsl:template match="citerefentry[not(@project)]">
<a>
<xsl:attribute name="href">
<xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
<xsl:value-of select="refentrytitle"/><xsl:text>.html#</xsl:text>
<xsl:value-of select="refentrytitle/@target"/>
</xsl:attribute>
<xsl:call-template name="inline.charseq"/>
</a>

View File

@ -0,0 +1,200 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2016 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 <http://www.gnu.org/licenses/>.
-->
<refentry id="dnssec-trust-anchors.d" conditional='ENABLE_RESOLVED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>dnssec-trust-anchors.d</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>dnssec-trust-anchors.d</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>dnssec-trust-anchors.d</refname>
<refname>systemd.positive</refname>
<refname>systemd.negative</refname>
<refpurpose>DNSSEC trust anchor configuration files</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para><filename>/etc/dnssec-trust-anchors.d/*.positive</filename></para>
<para><filename>/run/dnssec-trust-anchors.d/*.positive</filename></para>
<para><filename>/usr/lib/dnssec-trust-anchors.d/*.positive</filename></para>
<para><filename>/etc/dnssec-trust-anchors.d/*.negative</filename></para>
<para><filename>/run/dnssec-trust-anchors.d/*.negative</filename></para>
<para><filename>/usr/lib/dnssec-trust-anchors.d/*.negative</filename></para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>The DNSSEC trust anchor configuration files define positive
and negative trust anchors
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
bases DNSSEC integrity proofs on.</para>
</refsect1>
<refsect1>
<title>Positive Trust Anchors</title>
<para>Positive trust anchor configuration files contain DNSKEY and
DS resource record definitions to use as base for DNSSEC integrity
proofs. See <ulink
url="https://tools.ietf.org/html/rfc4035#section-4.4">RFC 4035,
Section 4.4</ulink> for more information about DNSSEC trust
anchors.</para>
<para>Positive trust anchors are read from files with the suffix
<filename>.positive</filename> located in
<filename>/etc/dnssec-trust-anchors.d/</filename>,
<filename>/run/dnssec-trust-anchors.d/</filename> and
<filename>/usr/lib/dnssec-trust-anchors.d/</filename>. These
directories are searched in the specified order, and a trust
anchor file of the same name in an earlier path overrides a trust
anchor files in a later path. To disable a trust anchor file
shipped in <filename>/usr/lib/dnssec-trust-anchors.d/</filename>
it is sufficient to provide an identically-named file in
<filename>/etc/dnssec-trust-anchors.d/</filename> or
<filename>/run/dnssec-trust-anchors.d/</filename> that is either
empty or a symlink to <filename>/dev/null</filename> ("masked").</para>
<para>Positive trust anchor files are simple text files resembling
DNS zone files, as documented in <ulink
url="https://tools.ietf.org/html/rfc1035#section-5">RFC 1035, Section
5</ulink>. One DS or DNSKEY resource record may be listed per
line. Empty lines and lines starting with a semicolon
(<literal>;</literal>) are ignored and considered comments. A DS
resource record is specified like in the following example:</para>
<programlisting>. IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5</programlisting>
<para>The first word specifies the domain, use
<literal>.</literal> for the root domain. The domain may be
specified with or without trailing dot, which is considered
equivalent. The second word must be <literal>IN</literal> the
third word <literal>DS</literal>. The following words specify the
key tag, signature algorithm, digest algorithm, followed by the
hex-encoded key fingerprint. See <ulink
url="https://tools.ietf.org/html/rfc4034#section-5">RFC 4034,
Section 5</ulink> for details about the precise syntax and meaning
of these fields.</para>
<para>Alternatively, DNSKEY resource records may be used to define
trust anchors, like in the following example:</para>
<programlisting>. IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=</programlisting>
<para>The first word specifies the domain again, the second word
must be <literal>IN</literal>, followed by
<literal>DNSKEY</literal>. The subsequent words encode the DNSKEY
flags, protocol and algorithm fields, followed by the key data
encoded in Base64. See <ulink
url="https://tools.ietf.org/html/rfc4034#section-2">RFC 4034,
Section 2</ulink> for details about the precise syntax and meaning
of these fields.</para>
<para>If multiple DS or DNSKEY records are defined for the same
domain (possibly even in different trust anchor files), all keys
are used and are considered equivalent as base for DNSSEC
proofs.</para>
<para>Note that <filename>systemd-resolved</filename> will
automatically use a built-in trust anchor key for the Internet
root domain if no positive trust anchors are defined for the root
domain. In most cases it is hence unnecessary to define an
explicit key with trust anchor files. The built-in key is disabled
as soon as at least one trust anchor key for the root domain is
defined in trust anchor files.</para>
<para>It is generally recommended to encode trust anchors in DS
resource records, rather than DNSKEY resource records.</para>
<para>If a trust anchor specified via a DS record is found revoked
it is automatically removed from the trust anchor database for the
runtime. See <ulink url="https://tools.ietf.org/html/rfc5011">RFC
5011</ulink> for details about revoked trust anchors. Note that
<filename>systemd-resolved</filename> will not update its trust
anchor database from DNS servers automatically. Instead, it is
recommended to update the resolver software or update the new
trust anchor via adding in new trust anchor files.</para>
<para>The current DNSSEC trust anchor for the Internet's root
domain is available at the <ulink
url="https://data.iana.org/root-anchors/root-anchors.xml">IANA
Trust Anchor and Keys</ulink> page.</para>
</refsect1>
<refsect1>
<title>Negative Trust Anchors</title>
<para>Negative trust anchors define domains where DNSSEC
validation shall be turned off. Negative trust anchor files are
found at the same location as positive trust anchor files, and
follow the same overriding rules. They are text files with the
<filename>.negative</filename> suffix. Empty lines and lines whose
first character is <literal>;</literal> are ignored. Each line
specifies one domain name where DNSSEC validation shall be
disabled on.</para>
<para>Negative trust anchors are useful to support private DNS
subtrees that are not referenced from the Internet DNS hierarchy,
and not signed.</para>
<para><ulink url="https://tools.ietf.org/html/rfc7646">RFC
7646</ulink> for details on negative trust anchors.</para>
<para>If no negative trust anchor files are configured a built-in
set of well-known private DNS zone domains is used as negative
trust anchors.</para>
<para>It is also possibly to define per-interface negative trust
anchors using the <varname>DNSSECNegativeTrustAnchors=</varname>
setting in
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
files.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -63,7 +63,7 @@
and restrictions systemd makes on the file system
hierarchy.</para>
<para>Many of the paths described here are queriable
<para>Many of the paths described here can be queried
with the
<citerefentry><refentrytitle>systemd-path</refentrytitle><manvolnum>1</manvolnum></citerefentry>
tool.</para>

View File

@ -64,10 +64,6 @@
for DNS domain name labels, even though this is not a strict
requirement.</para>
<para>Depending on the operating system, other configuration files
might be checked for configuration of the hostname as well,
however only as fallback.</para>
<para>You may use
<citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to change the value of this file during runtime from the command

View File

@ -66,10 +66,10 @@
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.</para>
"lennarts-laptop"), and the transient hostname which is a fallback
value received from network configuration. If a static hostname is
set, and is valid (something other than localhost), then the
transient hostname is not used.</para>
<para>Note that the pretty hostname has little restrictions on the
characters used, while the static and transient hostnames are

View File

@ -72,6 +72,13 @@
<literal>[Remote]</literal> section:</para>
<variablelist>
<varlistentry>
<term><varname>Seal=</varname></term>
<listitem><para>Periodically sign the data in the journal using Forward Secure Sealing.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SplitMode=</varname></term>
@ -105,7 +112,7 @@
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd-journal-remote</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-journal-remote</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>

View File

@ -91,8 +91,14 @@
paths may be specified. If a file path refers to an executable
file, this is equivalent to an <literal>_EXE=</literal> match
for the canonicalized binary path. Similarly, if a path refers
to a device node, this is equivalent to a
<literal>_KERNEL_DEVICE=</literal> match for the device.</para>
to a device node then match is added for the kernel name of the
device (<literal>_KERNEL_DEVICE=</literal>). Also, matches for the
kernel names of all the parent devices are added automatically.
Device node paths are not stable across reboots, therefore match
for the current boot id (<literal>_BOOT_ID=</literal>) is
always added as well. Note that only the log entries for
the existing device nodes maybe queried by providing path to
the device node.</para>
<para>Additional constraints may be added using options
<option>--boot</option>, <option>--unit=</option>, etc., to
@ -571,6 +577,13 @@
field can take in all entries of the journal.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-N</option></term>
<term><option>--fields</option></term>
<listitem><para>Print all field names currently used in all entries of the journal.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--system</option></term>
<term><option>--user</option></term>

View File

@ -91,6 +91,7 @@
<term><varname>systemd.default_standard_output=</varname></term>
<term><varname>systemd.default_standard_error=</varname></term>
<term><varname>systemd.setenv=</varname></term>
<term><varname>systemd.machine_id=</varname></term>
<listitem>
<para>Parameters understood by the system and service
manager to control system behavior. For details, see

View File

@ -288,21 +288,17 @@
<varname>TasksMax=</varname> setting of the per-user slice
unit, see
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details. Defaults to 4096.</para></listitem>
for details. Defaults to 12288 (12K).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>RemoveIPC=</varname></term>
<listitem><para>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
<literal>yes</literal>.</para></listitem>
<listitem><para>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 and other system users
are excluded from the effect of this setting. Defaults to <literal>yes</literal>.</para></listitem>
</varlistentry>
</variablelist>

View File

@ -84,6 +84,12 @@
at install time. Use
<citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to initialize it on mounted (but not booted) system images.</para>
<para>The machine-id may also be set, for example when network
booting, by setting the <varname>systemd.machine_id=</varname>
kernel command line parameter or passing the option
<option>--machine-id=</option> to systemd. A machine-id may not
be set to all zeros.</para>
</refsect1>
<refsect1>

View File

@ -247,7 +247,7 @@
<literal>checksum</literal> is specified, the download is
checked for integrity after the transfer is complete, but no
signatures are verified. If <literal>signature</literal> is
specified, the checksum is verified and the images's signature
specified, the checksum is verified and the image's signature
is checked against a local keyring of trustable vendors. It is
strongly recommended to set this option to
<literal>signature</literal> if the server and protocol
@ -264,16 +264,6 @@
image.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--dkr-index-url</option></term>
<listitem><para>Specifies the index server to use for
downloading <literal>dkr</literal> images with the
<command>pull-dkr</command>. Takes a
<literal>http://</literal>, <literal>https://</literal>
URL.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--format=</option></term>
@ -760,42 +750,6 @@
below.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>pull-dkr</command> <replaceable>REMOTE</replaceable> [<replaceable>NAME</replaceable>]</term>
<listitem><para>Downloads a <literal>dkr</literal> container
image and makes it available locally. The remote name refers
to a <literal>dkr</literal> container name. If omitted, the
local machine name is derived from the <literal>dkr</literal>
container name.</para>
<para>Image verification is not available for
<literal>dkr</literal> containers, and thus
<option>--verify=no</option> must always be specified with
this command.</para>
<para>This command downloads all (missing) layers for the
specified container and places them in read-only subvolumes in
<filename>/var/lib/machines/</filename>. A writable snapshot
of the newest layer is then created under the specified local
machine name. To omit creation of this writable snapshot, pass
<literal>-</literal> as local machine name.</para>
<para>The read-only layer subvolumes are prefixed with
<filename>.dkr-</filename>, and thus not shown by
<command>list-images</command>, unless <option>--all</option>
is passed.</para>
<para>To specify the <literal>dkr</literal> index server to
use for looking up the specified container, use
<option>--dkr-index-url=</option>.</para>
<para>Note that pressing C-c during execution of this command
will not abort the download. Use
<command>cancel-transfer</command>, described
below.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>import-tar</command> <replaceable>FILE</replaceable> [<replaceable>NAME</replaceable>]</term>
<term><command>import-raw</command> <replaceable>FILE</replaceable> [<replaceable>NAME</replaceable>]</term>
@ -814,10 +768,9 @@
image is read from standard input, in which case the second
argument is mandatory.</para>
<para>Similar as with <command>pull-tar</command>,
<command>pull-raw</command> the file system
<filename>/var/lib/machines.raw</filename> is increased in
size of necessary and appropriate. Optionally, the
<para>Both <command>pull-tar</command> and <command>pull-raw</command>
will resize <filename>/var/lib/machines.raw</filename> and the
filesystem therein as necessary. Optionally, the
<option>--read-only</option> switch may be used to create a
read-only container or VM image. No cryptographic validation
is done when importing the images.</para>
@ -926,12 +879,12 @@
<para>Note that many image operations are only supported,
efficient or atomic on btrfs file systems. Due to this, if the
<command>pull-tar</command>, <command>pull-raw</command>,
<command>pull-dkr</command>, <command>import-tar</command>,
<command>import-raw</command> and <command>set-limit</command>
commands notice that <filename>/var/lib/machines</filename> is
empty and not located on btrfs, they will implicitly set up a
loopback file <filename>/var/lib/machines.raw</filename>
containing a btrfs file system that is mounted to
<command>import-tar</command>, <command>import-raw</command> and
<command>set-limit</command> commands notice that
<filename>/var/lib/machines</filename> is empty and not located on
btrfs, they will implicitly set up a loopback file
<filename>/var/lib/machines.raw</filename> containing a btrfs file
system that is mounted to
<filename>/var/lib/machines</filename>. The size of this loopback
file may be controlled dynamically with
<command>set-limit</command>.</para>
@ -994,18 +947,6 @@
login prompt into the container is requested.</para>
</example>
<example>
<title>Download a Fedora <literal>dkr</literal> image</title>
<programlisting># machinectl pull-dkr --verify=no mattdm/fedora
# systemd-nspawn -M fedora</programlisting>
<para>Downloads a <literal>dkr</literal> image and opens a shell
in it. Note that the specified download command might require an
index server to be specified with the
<literal>--dkr-index-url=</literal>.</para>
</example>
<example>
<title>Exports a container image as tar file</title>

View File

@ -71,9 +71,9 @@
is on the local loopback) and the IPv6 address ::1 (which is the
local host).</para></listitem>
<listitem><para>The hostname <literal>localhost</literal> is
resolved to the IP addresses 127.0.0.1 and
::1.</para></listitem>
<listitem><para>The hostname <literal>localhost</literal> (as well as any hostname ending in
<literal>.localhost</literal>, <literal>.localdomain</literal> or equal to <literal>localdomain</literal>) is
resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
<listitem><para>The hostname <literal>gateway</literal> is
resolved to all current default routing gateway addresses,

View File

@ -1,4 +1,4 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
@ -68,33 +68,46 @@
<refsect1>
<title>Options</title>
<para>The following options are available in the <literal>[Resolve]</literal> section:</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>DNS=</varname></term>
<listitem><para>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
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
For compatibility reasons, if set to the empty list, the DNS
servers listed in <filename>/etc/resolv.conf</filename> are
used, if any are configured there. This setting defaults to
the empty list.</para></listitem>
<listitem><para>A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. DNS requests
are sent to one of the listed DNS servers in parallel to suitable per-link DNS servers acquired from
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> or
set at runtime by external applications. For compatibility reasons, if this setting is not specified, the DNS
servers listed in <filename>/etc/resolv.conf</filename> are used instead, if that file exists and any servers
are configured in it. This setting defaults to the empty list.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>FallbackDNS=</varname></term>
<listitem><para>A space-separated list of IPv4 and IPv6
addresses to be used as the fallback DNS servers. Any
per-interface DNS servers obtained from
<listitem><para>A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. Any
per-link DNS servers obtained from
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
take precedence over this setting, as do any servers set via
<varname>DNS=</varname> above or
<filename>/etc/resolv.conf</filename>. 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.</para></listitem>
take precedence over this setting, as do any servers set via <varname>DNS=</varname> above or
<filename>/etc/resolv.conf</filename>. 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.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Domains=</varname></term>
<listitem><para>A space-separated list of domains. These domains are used as search suffixes when resolving
single-label host names (domain names which contain no dot), in order to qualify them into fully-qualified
domain names (FQDNs). Search domains are strictly processed in the order they are specified, until the name
with the suffix appended is found. For compatibility reasons, if this setting is not specified, the search
domains listed in <filename>/etc/resolv.conf</filename> are used instead, if that file exists and any domains
are configured in it. This setting defaults to the empty list.</para>
<para>Specified domain names may optionally be prefixed with <literal>~</literal>. In this case they do not
define a search path, but preferably direct DNS queries for the indicated domains to the DNS servers configured
with the system <varname>DNS=</varname> setting (see above), in case additional, suitable per-link DNS servers
are known. If no per-link DNS servers are known using the <literal>~</literal> syntax has no effect. Use the
construct <literal>~.</literal> (which is composed of <literal>~</literal> to indicate a routing domain and
<literal>.</literal> to indicate the DNS root domain that is the implied suffix of all DNS domains) to use the
system DNS server defined with <varname>DNS=</varname> preferably for all domains.</para></listitem>
</varlistentry>
<varlistentry>
@ -108,11 +121,87 @@
<literal>resolve</literal>, only resolution support is enabled,
but responding is disabled. Note that
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
also maintains per-interface LLMNR settings. LLMNR will be
enabled on an interface only if the per-interface and the
also maintains per-link LLMNR settings. LLMNR will be
enabled on a link only if the per-link and the
global setting is on.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>DNSSEC=</varname></term>
<listitem><para>Takes a boolean argument or
<literal>allow-downgrade</literal>. If true all DNS lookups are
DNSSEC-validated locally (excluding LLMNR and Multicast
DNS). If the response to a lookup request is detected to be invalid
a lookup failure is returned to applications. Note that
this mode requires a DNS server that supports DNSSEC. If the
DNS server does not properly support DNSSEC all validations
will fail. If set to <literal>allow-downgrade</literal> DNSSEC
validation is attempted, but if the server does not support
DNSSEC properly, DNSSEC mode is automatically disabled. Note
that this mode makes DNSSEC validation vulnerable to
"downgrade" attacks, where an attacker might be able to
trigger a downgrade to non-DNSSEC mode by synthesizing a DNS
response that suggests DNSSEC was not supported. If set to
false, DNS lookups are not DNSSEC validated.</para>
<para>Note that DNSSEC validation requires retrieval of
additional DNS data, and thus results in a small DNS look-up
time penalty.</para>
<para>DNSSEC requires knowledge of "trust anchors" to prove
data integrity. The trust anchor for the Internet root domain
is built into the resolver, additional trust anchors may be
defined with
<citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
Trust anchors may change at regular intervals, and old trust
anchors may be revoked. In such a case DNSSEC validation is
not possible until new trust anchors are configured locally or
the resolver software package is updated with the new root
trust anchor. In effect, when the built-in trust anchor is
revoked and <varname>DNSSEC=</varname> is true, all further
lookups will fail, as it cannot be proved anymore whether
lookups are correctly signed, or validly unsigned. If
<varname>DNSSEC=</varname> is set to
<literal>allow-downgrade</literal> the resolver will
automatically turn off DNSSEC validation in such a case.</para>
<para>Client programs looking up DNS data will be informed
whether lookups could be verified using DNSSEC, or whether the
returned data could not be verified (either because the data
was found unsigned in the DNS, or the DNS server did not
support DNSSEC or no appropriate trust anchors were known). In
the latter case it is assumed that client programs employ a
secondary scheme to validate the returned DNS data, should
this be required.</para>
<para>It is recommended to set <varname>DNSSEC=</varname> to
true on systems where it is known that the DNS server supports
DNSSEC correctly, and where software or trust anchor updates
happen regularly. On other systems it is recommended to set
<varname>DNSSEC=</varname> to
<literal>allow-downgrade</literal>.</para>
<para>In addition to this global DNSSEC setting
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
also maintains per-link DNSSEC settings. For system DNS
servers (see above), only the global DNSSEC setting is in
effect. For per-link DNS servers the per-link
setting is in effect, unless it is unset in which case the
global setting is used instead.</para>
<para>Site-private DNS zones generally conflict with DNSSEC
operation, unless a negative (if the private zone is not
signed) or positive (if the private zone is signed) trust
anchor is configured for them. If
<literal>allow-downgrade</literal> mode is selected, it is
attempted to detect site-private DNS zones using top-level
domains (TLDs) that are not known by the DNS root server. This
logic does not work in all private zone setups.</para>
<para>Defaults to off.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
@ -122,7 +211,8 @@
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry>
<citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry>
</para>
</refsect1>

123
man/sd-bus.xml Normal file
View File

@ -0,0 +1,123 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2016 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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd-bus" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd-bus</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Documentation</contrib>
<firstname>Zbigniew</firstname>
<surname>Jędrzejewski-Szmek</surname>
<email>zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd-bus</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd-bus</refname>
<refpurpose>A lightweight D-Bus and kdbus client library</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
</funcsynopsis>
<cmdsynopsis>
<command>pkg-config --cflags --libs libsystemd</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><filename>sd-bus.h</filename> provides an implementation
of a D-Bus client. It can interoperate both with the traditional
<citerefentry project='man-pages'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
and with kdbus. See
<ulink url="http://www.freedesktop.org/software/dbus/" />
for more information about the big picture.
</para>
<important>
<para>Interfaces described here have not been declared stable yet,
and are not accessible from <filename>libsystemd.so</filename>.
This documentation is provided in hope it might be useful for
developers, without any guarantees of availability or stability.
</para>
</important>
<para>See
<citerefentry><refentrytitle>sd_bus_default</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_request_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_start</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append_basic</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append_array</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append_string_memfd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append_strv</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_can_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_cookie</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_address</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_creds_get_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_get_name_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_get_owner_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_negotiate_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_path_encode</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-bus-errors</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_error_add_map</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_allow_interactive_authorization</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the functions available.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>dbus-send</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<ulink url="https://developer.gnome.org/gio/stable/gdbus.html">gdbus</ulink>
</para>
</refsect1>
</refentry>

View File

@ -71,10 +71,10 @@
<refsect1>
<title>Description</title>
<para><filename>sd-daemon.h</filename> provide APIs for new-style
<para><filename>sd-daemon.h</filename> provides APIs for new-style
daemons, as implemented by the
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
init system.</para>
service manager.</para>
<para>See
<citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

187
man/sd-event.xml Normal file
View File

@ -0,0 +1,187 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd-event" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd-event</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd-event</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd-event</refname>
<refpurpose>A generic event loop implementation</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
</funcsynopsis>
<cmdsynopsis>
<command>pkg-config --cflags --libs libsystemd</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><filename>sd-event.h</filename> provides a generic event
loop implementation, based on Linux <citerefentry
project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
<para>See
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_pending</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the functions available.</para>
<para>The event loop design is targeted on running a separate
instance of the event loop in each thread; it has no concept of
distributing events from a single event loop instance onto
multiple worker threads. Dispatching events is strictly ordered
and subject to configurable priorities. In each event loop
iteration a single event source is dispatched. Each time an event
source is dispatched the kernel is polled for new events, before
the next event source is dispatched. The event loop is designed to
honour priorities and provide fairness within each priority. It is
not designed to provide optimal throughput, as this contradicts
these goals due the limitations of the underlying <citerefentry
project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>
primitives.</para>
<para>The event loop implementation provides the following features:</para>
<orderedlist>
<listitem><para>I/O event sources, based on <citerefentry
project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>'s
file descriptor watching, including edge triggered events (<constant>EPOLLET</constant>). See <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>Timer event sources, based on <citerefentry
project='man-pages'><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
supporting the <constant>CLOCK_MONOTONIC</constant>,
<constant>CLOCK_REALTIME</constant>,
<constant>CLOCK_BOOTIME</constant> clocks, as well as the
<constant>CLOCK_REALTIME_ALARM</constant> and
<constant>CLOCK_BOOTTIME_ALARM</constant> clocks that can resume
the system from suspend. When creating timer events a required
accuracy parameter may be specified which allows coalescing of
timer events to minimize power consumption. See <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>UNIX process signal events, based on
<citerefentry
project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
including full support for real-time signals, and queued parameters. See <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>Child process state change events, based on
<citerefentry project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>. See <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>Static event sources, of three types: defer,
post and exit, for invoking calls in each event loop, after
other event sources or at event loop termination. See
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>Event sources may be assigned a 64bit priority
value, that controls the order in which event sources are
dispatched if multiple are pending simultaneously. See
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>The event loop may automatically send watchdog
notification messages to the service manager. See
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
<listitem><para>The event loop may be integrated into foreign
event loops, such as the GLib one. See
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for an example.</para></listitem>
</orderedlist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_pending</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -77,13 +77,17 @@
<citerefentry><refentrytitle>sd_journal_get_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_seek_head</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_query_enumerate</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_enumerate_fields</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cursor</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cutoff_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_usage</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_catalog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_journal_get_catalog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_has_runtime_files</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>sd_journal_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_journal_has_persistent_files</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the functions implemented.</para>
<para>Command line access for submitting entries to the journal is
@ -109,6 +113,8 @@
<citerefentry><refentrytitle>sd_journal_get_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_seek_head</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_query_enumerate</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_enumerate_fields</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cursor</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_cutoff_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@ -116,6 +122,8 @@
<citerefentry><refentrytitle>sd_journal_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_query_unique</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_catalog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_has_runtime_files</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_has_persistent_files</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>

View File

@ -470,7 +470,7 @@
modified by the caller.</para>
<para>All functions that take a <parameter>char***</parameter>
parameter will store the answer there as an address of a an array
parameter will store the answer there as an address of an array
of strings. Each individual string is NUL-terminated, and the
array is NULL-terminated as a whole. It will be valid as long as
<parameter>c</parameter> remains valid, and should not be freed or

View File

@ -48,6 +48,7 @@
<refname>sd_bus_creds_get_augmented_mask</refname>
<refname>sd_bus_creds_ref</refname>
<refname>sd_bus_creds_unref</refname>
<refname>sd_bus_creds_unrefp</refname>
<refpurpose>Retrieve credentials object for the specified PID</refpurpose>
</refnamediv>
@ -82,6 +83,11 @@
<funcdef>sd_bus_creds *<function>sd_bus_creds_unref</function></funcdef>
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_bus_creds_unrefp</function></funcdef>
<paramdef>sd_bus_creds **<parameter>c</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@ -235,6 +241,21 @@
<para><function>sd_bus_creds_unref()</function> destroys a reference
to <parameter>c</parameter>.</para>
<para><function>sd_bus_creds_unrefp()</function> is similar to
<function>sd_bus_creds_unref()</function> but takes a pointer to a
pointer to an <type>sd_bus_creds</type> object. This call is useful in
conjunction with GCC's and LLVM's <ulink
url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up
Variable Attribute</ulink>. Note that this function is defined as
inline function.</para>
<para><function>sd_bus_creds_ref()</function>,
<function>sd_bus_creds_unref()</function> and
<function>sd_bus_creds_unrefp()</function> execute no operation if
the passed in bus credentials object is
<constant>NULL</constant>.</para>
</refsect1>
<refsect1>

View File

@ -46,6 +46,7 @@
<refname>sd_bus_new</refname>
<refname>sd_bus_ref</refname>
<refname>sd_bus_unref</refname>
<refname>sd_bus_unrefp</refname>
<refpurpose>Create a new bus object and create or destroy references to it</refpurpose>
</refnamediv>
@ -68,6 +69,11 @@
<funcdef>sd_bus *<function>sd_bus_unref</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_bus_unrefp</function></funcdef>
<paramdef>sd_bus **<parameter>bus</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@ -93,14 +99,40 @@
only allocate a bus object but also start the connection to a
well-known bus in a single function invocation.</para>
<para><function>sd_bus_ref()</function> creates a new reference to
<parameter>bus</parameter>.</para>
<para><function>sd_bus_ref()</function> increases the reference
counter of <parameter>bus</parameter> by one.</para>
<para><function>sd_bus_unref()</function> destroys a reference to
<parameter>bus</parameter>. Once the reference count has dropped
to zero, <parameter>bus</parameter> cannot be used anymore, so
further calls to <function>sd_bus_ref()</function> or
<para><function>sd_bus_unref()</function> decreases the reference
counter of <parameter>bus</parameter> by one. Once the reference
count has dropped to zero, <parameter>bus</parameter> is destroyed
and cannot be used anymore, so further calls to
<function>sd_bus_ref()</function> or
<function>sd_bus_unref()</function> are illegal.</para>
<para><function>sd_bus_unrefp()</function> is similar to
<function>sd_bus_unref()</function> but takes a pointer to a
pointer to an <type>sd_bus</type> object. This call is useful in
conjunction with GCC's and LLVM's <ulink
url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up
Variable Attribute</ulink>. Note that this function is defined as
inline function. Use a declaration like the following, in order to
allocate a bus object that is freed automatically as the code
block is left:</para>
<programlisting>{
__attribute__((cleanup(sd_bus_unrefp)) sd_bus *bus = NULL;
int r;
r = sd_bus_default(&amp;bus);
if (r &lt; 0)
fprintf(stderr, "Failed to allocate bus: %s\n", strerror(-r));
}</programlisting>
<para><function>sd_bus_ref()</function>,
<function>sd_bus_unref()</function> and
<function>sd_bus_unrefp()</function> execute no operation if the
passed in bus object is <constant>NULL</constant>.</para>
</refsect1>
<refsect1>
@ -110,10 +142,10 @@
positive integer. On failure, it returns a negative errno-style
error code.</para>
<para><function>sd_bus_ref</function> always returns the argument.
<para><function>sd_bus_ref()</function> always returns the argument.
</para>
<para><function>sd_bus_unref</function> always returns
<para><function>sd_bus_unref()</function> always returns
<constant>NULL</constant>.</para>
</refsect1>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_add_child">
<refentry id="sd_event_add_child" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_add_child</title>
@ -45,13 +45,23 @@
<refnamediv>
<refname>sd_event_add_child</refname>
<refname>sd_event_source_get_child_pid</refname>
<refname>sd_event_child_handler_t</refname>
<refpurpose>Add a child state change event source to an event loop</refpurpose>
<refpurpose>Add a child process state change event source to an event loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event_source sd_event_source;</funcsynopsisinfo>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_child_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>const siginfo_t *<parameter>si</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_add_child</function></funcdef>
@ -63,13 +73,6 @@
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_child_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>const siginfo_t *<parameter>si</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_child_pid</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
@ -83,42 +86,75 @@
<title>Description</title>
<para><function>sd_event_add_child()</function> adds a new child
state change event source to an event loop object. The event loop
is specified in <parameter>event</parameter>, the event source is
returned in the <parameter>source</parameter> parameter. The
<parameter>pid</parameter> parameter specifies the process to
watch. The <parameter>handler</parameter> must reference a
function to call when the process changes state. The handler
function will be passed the <parameter>userdata</parameter>
pointer, which may be chosen freely by the caller. The handler
also receives a pointer to a <structname>const
siginfo_t</structname> structure containing the information about
the event. The <parameter>options</parameter> parameter determines
which state changes will be watched for. It must contain an OR-ed
mask of <constant>WEXITED</constant> (watch for the child
process state change event source to an event loop. The event loop
object is specified in the <parameter>event</parameter> parameter,
the event source object is returned in the
<parameter>source</parameter> parameter. The
<parameter>pid</parameter> parameter specifies the PID of the
process to watch. The <parameter>handler</parameter> must
reference a function to call when the process changes state. The
handler function will be passed the
<parameter>userdata</parameter> pointer, which may be chosen
freely by the caller. The handler also receives a pointer to a
<structname>siginfo_t</structname> structure containing
information about the child process event. The
<parameter>options</parameter> parameter determines which state
changes will be watched for. It must contain an OR-ed mask of
<constant>WEXITED</constant> (watch for the child process
terminating), <constant>WSTOPPED</constant> (watch for the child
being stopped by a signal), and <constant>WCONTINUED</constant>
(watch for the child being resumed by a signal). See
<citerefentry><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
process being stopped by a signal), and
<constant>WCONTINUED</constant> (watch for the child process being
resumed by a signal). See <citerefentry
project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for further information.</para>
<para>Only a single handler may be installed for a specific
child. The handler is enabled
for a single event (<constant>SD_EVENT_ONESHOT</constant>),
but this may be
changed with
child process. The handler is enabled for a single event
(<constant>SD_EVENT_ONESHOT</constant>), but this may be changed
with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If the handler function returns a negative error code, it will be
disabled after the invocation, even if
<constant>SD_EVENT_ON</constant> mode is set.
disabled after the invocation, even if the
<constant>SD_EVENT_ON</constant> mode was requested before.
</para>
<para>To destroy an event source object use
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but note that the event source is only removed from the event loop
when all references to the event source are dropped. To make sure
an event source does not fire anymore, even when there's still a
reference to it kept, consider setting the event source to
<constant>SD_EVENT_OFF</constant> with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>If the second parameter of
<function>sd_event_add_child()</function> is passed as NULL no
reference to the event source object is returned. In this case the
event source is considered "floating", and will be destroyed
implicitly when the event loop itself is destroyed.</para>
<para>Note that the <parameter>handler</parameter> function is
invoked at a time where the child process is not reaped yet (and
thus still is exposed as a zombie process by the kernel). However,
the child will be reaped automatically after the function
returns. Child processes for which no child process state change
event sources are installed will not be reaped by the event loop
implementation.</para>
<para>If both a child process state change event source and a
<constant>SIGCHLD</constant> signal event source is installed in
the same event loop, the configured event source priorities decide
which event source is dispatched first. If the signal handler is
processed first, it should leave the child processes for which
child process state change event sources are installed unreaped.</para>
<para><function>sd_event_source_get_child_pid()</function>
retrieves the configured <parameter>pid</parameter> of a child
state change event source created previously with
retrieves the configured PID of a child process state change event
source created previously with
<function>sd_event_add_child()</function>. It takes the event
source object as the <parameter>source</parameter> parameter and a
pointer to <type>pid_t</type> to return the result in.
pointer to a <type>pid_t</type> variable to return the process ID
in.
</para>
</refsect1>
@ -158,7 +194,7 @@
<term><constant>-EBUSY</constant></term>
<listitem><para>A handler is already installed for this
child.</para></listitem>
child process.</para></listitem>
</varlistentry>
@ -176,18 +212,16 @@
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para>The passed event source is not a child process event source.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_add_child()</function> and the other functions
described here are available as a shared library, which can be
compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -196,10 +230,16 @@
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_add_defer">
<refentry id="sd_event_add_defer" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_add_defer</title>
@ -46,13 +46,22 @@
<refname>sd_event_add_defer</refname>
<refname>sd_event_add_post</refname>
<refname>sd_event_add_exit</refname>
<refname>sd_event_handler_t</refname>
<refpurpose>Add static event sources to an event loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event_source sd_event_source;</funcsynopsisinfo>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_add_defer</function></funcdef>
@ -78,49 +87,67 @@
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>These three functions add new event sources to an event loop
object. The event loop is specified in
<parameter>event</parameter>, the event source is returned in the
<parameter>source</parameter> parameter. The event sources are
enabled statically and will "fire" when the event loop is run and
the conditions described below are met. The handler function will
be passed the <parameter>userdata</parameter> pointer, which may
be chosen freely by the caller.</para>
<para>These three functions add new static event sources to an
event loop. The event loop object is specified in the
<parameter>event</parameter> parameter, the event source object is
returned in the <parameter>source</parameter> parameter. The event
sources are enabled statically and will "fire" when the event loop
is run and the conditions described below are met. The handler
function will be passed the <parameter>userdata</parameter>
pointer, which may be chosen freely by the caller.</para>
<para><function>sd_event_add_defer()</function> adds a new event
source that will "fire" the next time the event loop is run. By
default, the handler will be called once
(<constant>SD_EVENT_ONESHOT</constant>).</para>
source that will be dispatched instantly, before the event loop
goes to sleep again and waits for new events. By default, the
handler will be called once
(<constant>SD_EVENT_ONESHOT</constant>). Note that if the event
source is set to <constant>SD_EVENT_ON</constant> the event loop
will never go to sleep again, but continuously call the handler,
possibly interleaved with other event sources.</para>
<para><function>sd_event_add_post()</function> adds a new event
source that will "fire" if any event handlers are invoked whenever
the event loop is run. By default, the source is enabled
permanently (<constant>SD_EVENT_ON</constant>).</para>
source that is run before the event loop will sleep and wait
for new events, but only after at least one other non-post event
source was dispatched. By default, the source is enabled
permanently (<constant>SD_EVENT_ON</constant>). Note that this
event source type will still allow the event loop to go to sleep
again, even if set to <constant>SD_EVENT_ON</constant>, as long as
no other event source is ever triggered.</para>
<para><function>sd_event_add_exit()</function> adds a new event
source that will "fire" when the event loop is terminated
with <function>sd_event_exit()</function>.</para>
source that will be dispatched when the event loop is terminated
with <citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
function may be used to enable the event source permanently
(<constant>SD_EVENT_ON</constant>) or to make it fire just once
(<constant>SD_EVENT_ONESHOT</constant>). If the handler function
returns a negative error code, it will be disabled after the
invocation, even if <constant>SD_EVENT_ON</constant> mode is
set.</para>
(<constant>SD_EVENT_ONESHOT</constant>).</para>
<para>If the handler function returns a negative error code, it
will be disabled after the invocation, even if the
<constant>SD_EVENT_ON</constant> mode was requested before.</para>
<para>To destroy an event source object use
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but note that the event source is only removed from the event loop
when all references to the event source are dropped. To make sure
an event source does not fire anymore, even when there's still a
reference to it kept, consider setting the event source to
<constant>SD_EVENT_OFF</constant> with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>If the second parameter of these functions is passed as
NULL no reference to the event source object is returned. In this
case the event source is considered "floating", and will be
destroyed implicitly when the event loop itself is
destroyed.</para>
</refsect1>
<refsect1>
@ -164,15 +191,7 @@
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>Functions described here are available as a shared library,
which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry
project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -181,10 +200,16 @@
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>

300
man/sd_event_add_io.xml Normal file
View File

@ -0,0 +1,300 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_add_io" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_add_io</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_add_io</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_add_io</refname>
<refname>sd_event_source_get_io_events</refname>
<refname>sd_event_source_set_io_events</refname>
<refname>sd_event_source_get_io_revents</refname>
<refname>sd_event_source_get_io_fd</refname>
<refname>sd_event_source_set_io_fd</refname>
<refname>sd_event_source</refname>
<refname>sd_event_io_handler_t</refname>
<refpurpose>Add an I/O event source to an event loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event_source sd_event_source;</funcsynopsisinfo>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_io_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>uint32_t <parameter>revents</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_add_io</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>sd_event_source **<parameter>source</parameter></paramdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>uint32_t <parameter>events</parameter></paramdef>
<paramdef>sd_event_io_handler_t <parameter>handler</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_io_events</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>uint32_t *<parameter>events</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_set_io_events</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>uint32_t <parameter>events</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_io_revents</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>uint32_t *<parameter>revents</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_io_fd</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_set_io_fd</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int <parameter>fd</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_add_io()</function> adds a new I/O event
source to an event loop. The event loop object is specified in the
<parameter>event</parameter> parameter, the event source object is
returned in the <parameter>source</parameter> parameter. The
<parameter>fd</parameter> parameter takes the UNIX file descriptor
to watch, which may refer to a socket, a FIFO, a message queue, a
serial connection, a character device, or any other file descriptor
compatible with Linux
<citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>. The
<parameter>events</parameter> parameter takes a bit mask of events
to watch for, a combination of the following event flags:
<constant>EPOLLIN</constant>, <constant>EPOLLOUT</constant>,
<constant>EPOLLRDHUP</constant>, <constant>EPOLLPRI</constant>,
and <constant>EPOLLET</constant>, see
<citerefentry project='man-pages'><refentrytitle>epoll_ctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for details. The <parameter>handler</parameter> shall reference a
function to call when the event source is triggered. The
<parameter>userdata</parameter> pointer will be passed to the
handler function, and may be chosen freely by the caller. The
handler will also be passed the file descriptor the event was seen
on, as well as the actual event flags. It's generally a subset of
the events watched, however may additionally include
<constant>EPOLLERR</constant> and <constant>EPOLLHUP</constant>.
</para>
<para>By default, an event source will stay enabled
continuously (<constant>SD_EVENT_ON</constant>), but this may be
changed with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If the handler function returns a negative error code, it will be
disabled after the invocation, even if the
<constant>SD_EVENT_ON</constant> mode was requested before. Note
that an event source set to <constant>SD_EVENT_ON</constant> will
fire continuously unless data is read from or written to the file
descriptor to reset the mask of events seen.
</para>
<para>Setting the I/O event mask to watch for to 0 does not mean
that the event source won't be triggered anymore, as
<constant>EPOLLHUP</constant> and <constant>EPOLLERR</constant>
may be triggered even with a zero event mask. To temporarily
disable an I/O event source use
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with <constant>SD_EVENT_OFF</constant> instead.</para>
<para>To destroy an event source object use
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but note that the event source is only removed from the event loop
when all references to the event source are dropped. To make sure
an event source does not fire anymore, even if it is still referenced,
disable the event source using
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with <constant>SD_EVENT_OFF</constant>.</para>
<para>If the second parameter of
<function>sd_event_add_io()</function> is
<constant>NULL</constant> no reference to the event source object
is returned. In this case the event source is considered
"floating", and will be destroyed implicitly when the event loop
itself is destroyed.</para>
<para>It is recommended to use
<function>sd_event_add_io()</function> only in conjunction with
file descriptors that have <constant>O_NONBLOCK</constant> set, to
ensure that all I/O operations from invoked handlers are properly
asynchronous and non-blocking. Using file descriptors without
<constant>O_NONBLOCK</constant> might result in unexpected
starvation of other event sources. See
<citerefentry project='man-pages'><refentrytitle>fcntl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for details on enabling <constant>O_NONBLOCK</constant> mode.</para>
<para><function>sd_event_source_get_io_events()</function> retrieves
the configured mask of watched I/O events of an event source created
previously with <function>sd_event_add_io()</function>. It takes
the event source object and a pointer to a variable to store the
mask in.</para>
<para><function>sd_event_source_set_io_events()</function>
configures the mask of watched I/O events of an event source created
previously with <function>sd_event_add_io()</function>. It takes the
event source object and the new event mask.</para>
<para><function>sd_event_source_get_io_revents()</function>
retrieves the I/O event mask of currently seen but undispatched
events from an event source created previously with
<function>sd_event_add_io()</function>. It takes the event source
object and a pointer to a variable to store the event mask
in. When called from a handler function on the handler's event
source object this will return the same mask as passed to the
handler's <parameter>revents</parameter> parameter. This call is
primarily useful to check for undispatched events of an event
source from the handler of an unrelated (possibly higher priority)
event source. Note the relation between
<function>sd_event_source_get_pending()</function> and
<function>sd_event_source_get_io_revents()</function>: both
functions will report non-zero results when there's an event
pending for the event source, but the former applies to all event
source types, the latter only to I/O event sources.</para>
<para><function>sd_event_source_get_io_fd()</function> retrieves
the UNIX file descriptor of an event source created previously
with <function>sd_event_add_io()</function>. It takes the event
source object and returns the non-negative file descriptor
or a negative error number on error (see below).</para>
<para><function>sd_event_source_set_io_fd()</function>
changes the UNIX file descriptor of an I/O event source created
previously with <function>sd_event_add_io()</function>. It takes
the event source object and the new file descriptor.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, these functions return 0 or a positive
integer. On failure, they return a negative errno-style error
code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned values may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para>The passed event source is not an I/O event source.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_pending</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll_ctl</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_add_signal">
<refentry id="sd_event_add_signal" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_add_signal</title>
@ -45,13 +45,24 @@
<refnamediv>
<refname>sd_event_add_signal</refname>
<refname>sd_event_source_get_signal</refname>
<refname>sd_event_signal_handler_t</refname>
<refpurpose>Add a signal event source to an event loop</refpurpose>
<refpurpose>Add a UNIX process signal event source to an event
loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event_source sd_event_source;</funcsynopsisinfo>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_signal_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>const struct signalfd_siginfo *<parameter>si</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_add_signal</function></funcdef>
@ -62,13 +73,6 @@
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_signal_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>const struct signalfd_siginfo *<parameter>si</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_signal</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
@ -80,43 +84,62 @@
<refsect1>
<title>Description</title>
<para><function>sd_event_add_signal()</function> adds a new signal
event source to an event loop object. The event loop is specified
in <parameter>event</parameter>, and the event source is returned in
the <parameter>source</parameter> parameter. The
<parameter>signal</parameter> parameter specifies the signal to be handled
(see
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>).
The <parameter>handler</parameter> must reference a function to
call when the signal is delivered or be <constant>NULL</constant>.
The handler function will be passed the
<parameter>userdata</parameter> pointer, which may be chosen
<para><function>sd_event_add_signal()</function> adds a new UNIX
process signal event source to an event loop. The event loop
object is specified in the <parameter>event</parameter> parameter,
and the event source object is returned in the
<parameter>source</parameter> parameter. The
<parameter>signal</parameter> parameter specifies the numeric
signal to be handled (see <citerefentry
project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>).
The <parameter>handler</parameter> parameter must reference a
function to call when the signal is received or be
<constant>NULL</constant>. The handler function will be passed
the <parameter>userdata</parameter> pointer, which may be chosen
freely by the caller. The handler also receives a pointer to a
<structname>const struct signalfd_siginfo</structname> containing
the information about the received signal. See
<citerefentry project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>
<structname>signalfd_siginfo</structname> structure containing
information about the received signal. See <citerefentry
project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for further information.</para>
<para>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 (<parameter>handler</parameter> is
signal. The signal will be unblocked by this call, and must be
blocked before this function is called in all threads (using
<citerefentry
project='man-pages'><refentrytitle>sigprocmask</refentrytitle><manvolnum>2</manvolnum></citerefentry>). If
the handler is not specified (<parameter>handler</parameter> is
<constant>NULL</constant>), a default handler which causes the
program to exit will be used. By default, the handler is enabled
permanently (<constant>SD_EVENT_ON</constant>), but this may be
changed with
program to exit cleanly will be used.</para>
<para>By default, the event source is enabled permanently
(<constant>SD_EVENT_ON</constant>), but this may be changed with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If the handler function returns a negative error code, it will be
disabled after the invocation, even if
<constant>SD_EVENT_ON</constant> mode is set.
disabled after the invocation, even if the
<constant>SD_EVENT_ON</constant> mode was requested before.
</para>
<para><function>sd_event_source_get_signal()</function> retrieves
the configured signal number of a signal event source created
previously with <function>sd_event_add_signal()</function>. It
takes the event source object as the <parameter>source</parameter>
parameter.</para>
<para>To destroy an event source object use
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but note that the event source is only removed from the event loop
when all references to the event source are dropped. To make sure
an event source does not fire anymore, even if it is still referenced,
disable the event source using
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with <constant>SD_EVENT_OFF</constant>.</para>
<para>If the second parameter of
<function>sd_event_add_signal()</function> is
<constant>NULL</constant> no reference to the event source object
is returned. In this case the event source is considered
"floating", and will be destroyed implicitly when the event loop
itself is destroyed.</para>
<para><function>sd_event_source_get_signal()</function> returns
the configured signal number of an event source created previously
with <function>sd_event_add_signal()</function>. It takes the
event source object as the <parameter>source</parameter>
parameter.</para>
</refsect1>
<refsect1>
@ -124,7 +147,7 @@
<para>On success, these functions return 0 or a positive
integer. On failure, they return a negative errno-style error
code. </para>
code.</para>
</refsect1>
<refsect1>
@ -143,7 +166,6 @@
<term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed.</para></listitem>
</varlistentry>
<varlistentry>
@ -151,35 +173,30 @@
<listitem><para>A handler is already installed for this
signal or the signal was not blocked previously.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para>The passed event source is not a signal event source.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_add_signal()</function> and the other functions
described here are available as a shared library, which can be
compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -188,10 +205,16 @@
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_add_time">
<refentry id="sd_event_add_time" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_add_time</title>
@ -49,13 +49,23 @@
<refname>sd_event_source_get_time_accuracy</refname>
<refname>sd_event_source_set_time_accuracy</refname>
<refname>sd_event_source_get_time_clock</refname>
<refname>sd_event_time_handler_t</refname>
<refpurpose>Add a timer event source to an event loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event_source sd_event_source;</funcsynopsisinfo>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_time_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_add_time</function></funcdef>
@ -68,35 +78,28 @@
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_time_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_time</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>usec_t *<parameter>usec</parameter></paramdef>
<paramdef>uint64_t *<parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_set_time</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>usec_t <parameter>usec</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_time_accuracy</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>usec_t *<parameter>usec</parameter></paramdef>
<paramdef>uint64_t *<parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_set_time_accuracy</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>usec_t <parameter>usec</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
@ -111,74 +114,120 @@
<refsect1>
<title>Description</title>
<para><function>sd_event_add_time()</function> adds a new timer
event source to an event loop object. The event loop is specified
in <parameter>event</parameter>, the event source is returned in
the <parameter>source</parameter> parameter. The
<parameter>clock</parameter> parameter takes a clock identifier,
one of <constant>CLOCK_REALTIME</constant>,
<constant>CLOCK_MONOTONIC</constant> and
<constant>CLOCK_BOOTTIME_ALARM</constant>. See
<citerefentry><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for details regarding the various types of clocks. The
<parameter>usec</parameter> parameter takes a time value in
microseconds, relative to the clock's epoch specifying when the
timer shall elapse the earliest. The
<parameter>accuracy</parameter> parameter takes an additional
accuracy value in microseconds specifying a time the timer event
may be delayed. Specify 0 for selecting the default accuracy
(250ms). Specify 1 for most accurate timers. Consider specifying
60000000 or larger (1h) for long-running events that may be
delayed substantially. Picking higher accuracy values allows the
system to coalesce timer events more aggressively, thus improving
power efficiency. The <parameter>handler</parameter> shall
reference a function to call when the timer elapses. The handler
function will be passed the <parameter>userdata</parameter>
pointer, which may be chosen freely by the caller. The handler is
also passed the configured time it was triggered, however it might
actually have been called at a slightly later time, subject to the
specified accuracy value, the kernel timer slack (see
<citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>)
and additional scheduling latencies.</para>
<para><function>sd_event_add_time()</function> adds a new timer event source to an event loop. The event loop
object is specified in the <parameter>event</parameter> parameter, the event source object is returned in the
<parameter>source</parameter> parameter. The <parameter>clock</parameter> parameter takes a clock identifier, one
of <constant>CLOCK_REALTIME</constant>, <constant>CLOCK_MONOTONIC</constant>, <constant>CLOCK_BOOTTIME</constant>,
<constant>CLOCK_REALTIME_ALARM</constant>, or <constant>CLOCK_BOOTTIME_ALARM</constant>. See
<citerefentry><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry> for details
regarding the various types of clocks. The <parameter>usec</parameter> parameter specifies the earliest time, in
microseconds (µs), relative to the clock's epoch, when the timer shall be triggered. If a time already in the past
is specified (including <constant>0</constant>), this timer source "fires" immediately and is ready to be
dispatched. If the paramater is specified as <constant>UINT64_MAX</constant> the timer event will never elapse,
which may be used as an alternative to explicitly disabling a timer event source with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The
<parameter>accuracy</parameter> parameter specifies an additional accuracy value in µs specifying how much the
timer event may be delayed. Use <constant>0</constant> to select the default accuracy (250ms). Use 1µs for maximum
accuracy. Consider specifying 60000000µs (1min) or larger for long-running events that may be delayed
substantially. Picking higher accuracy values allows the system to coalesce timer events more aggressively,
improving power efficiency. The <parameter>handler</parameter> parameter shall reference a function to call when
the timer elapses. The handler function will be passed the <parameter>userdata</parameter> pointer, which may be
chosen freely by the caller. The handler is also passed the configured trigger time, even if it is actually called
slightly later, subject to the specified accuracy value, the kernel timer slack (see
<citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>), and additional
scheduling latencies. To query the actual time the handler was called use
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>By default, the timer will elapse once
(<constant>SD_EVENT_ONESHOT</constant>), but this may be changed
with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If the handler function returns a negative error code, it will be
disabled after the invocation, even if
<constant>SD_EVENT_ON</constant> mode is set.
disabled after the invocation, even if the
<constant>SD_EVENT_ON</constant> mode was requested before. Note
that a timer event set to <constant>SD_EVENT_ON</constant> will
fire continuously unless its configured time is updated using
<function>sd_event_source_set_time()</function>.
</para>
<para>To destroy an event source object use
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but note that the event source is only removed from the event loop
when all references to the event source are dropped. To make sure
an event source does not fire anymore, even if it is still referenced,
disable the event source using
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with <constant>SD_EVENT_OFF</constant>.</para>
<para>If the second parameter of
<function>sd_event_add_time()</function> is
<constant>NULL</constant> no reference to the event source object
is returned. In this case the event source is considered
"floating", and will be destroyed implicitly when the event loop
itself is destroyed.</para>
<para>If the <parameter>handler</parameter> to
<function>sd_event_add_time()</function> is
<constant>NULL</constant>, and the event source fires, this will
be considered a request to exit the event loop. In this case, the
<parameter>userdata</parameter> parameter, cast to an integer, is
used for the exit code passed to
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>Use <constant>CLOCK_BOOTTIME_ALARM</constant> and
<constant>CLOCK_REALTIME_ALARM</constant> to define event sources
that may wake up the system from suspend.</para>
<para>In order to set up relative timers (that is, relative to the
current time), retrieve the current time via
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
add the desired timespan to it, and use the result as
the <parameter>usec</parameter> parameter to
<function>sd_event_add_time()</function>.</para>
<para>In order to set up repetitive timers (that is, timers that
are triggered in regular intervals), set up the timer normally,
for the first invocation. Each time the event handler is invoked,
update the timer's trigger time with
<citerefentry><refentrytitle>sd_event_source_set_time</refentrytitle><manvolnum>3</manvolnum></citerefentry> for the next timer
iteration, and reenable the timer using
<function>sd_event_source_set_enabled()</function>. To calculate
the next point in time to pass to
<function>sd_event_source_set_time()</function>, either use as
base the <parameter>usec</parameter> parameter passed to the timer
callback, or the timestamp returned by
<function>sd_event_now()</function>. In the former case timer
events will be regular, while in the latter case the scheduling
latency will keep accumulating on the timer.</para>
<para><function>sd_event_source_get_time()</function> retrieves
the configured time value of a timer event source created
the configured time value of an event source created
previously with <function>sd_event_add_time()</function>. It takes
the event source object and a pointer to a variable to store the
time in microseconds in.</para>
time in, relative to the selected clock's epoch, in µs.</para>
<para><function>sd_event_source_set_time()</function> changes the
configured time value of a timer event source created previously
with <function>sd_event_add_time()</function>. It takes the event
source object and a time relative to the selected clock's
epoch, in microseconds.</para>
time of an event source created previously with
<function>sd_event_add_time()</function>. It takes the event
source object and a time relative to the selected clock's epoch,
in µs.</para>
<para><function>sd_event_source_get_time_accuracy()</function>
retrieves the configured accuracy value of a timer event source
retrieves the configured accuracy value of a event source
created previously with <function>sd_event_add_time()</function>. It
takes the event source object and a pointer to a variable to store
the accuracy in microseconds in.</para>
the accuracy in. The accuracy is specified in µs.</para>
<para><function>sd_event_source_set_time_accuracy()</function>
changes the configured accuracy of a timer event source created
previously with <function>sd_event_add_time()</function>. It takes
the event source object and an accuracy, in microseconds.</para>
the event source object and accuracy, in µs.</para>
<para><function>sd_event_source_get_time_clock()</function>
retrieves the configured clock of a timer event source created
retrieves the configured clock of a event source created
previously with <function>sd_event_add_time()</function>. It takes
the event source object and a pointer to a variable to store the
clock identifier in.</para>
</refsect1>
<refsect1>
@ -192,7 +241,7 @@
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<para>Returned values may indicate the following problems:</para>
<variablelist>
<varlistentry>
@ -228,18 +277,16 @@
<listitem><para>The selected clock is not supported by the event loop implementation.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para>The passed event source is not a timer event source.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_add_time()</function> and the other functions
described here are available as a shared library, which can be
compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -248,11 +295,18 @@
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_now</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

163
man/sd_event_exit.xml Normal file
View File

@ -0,0 +1,163 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_exit" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_exit</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_exit</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_exit</refname>
<refname>sd_event_get_exit_code</refname>
<refpurpose>Ask the event loop to exit</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_exit</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>int <parameter>code</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_get_exit_code</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>int *<parameter>code</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_exit()</function> requests the event loop
specified in the <parameter>event</parameter> event loop object to
exit. The <parameter>code</parameter> parameter may be any integer
value and is returned as-is by
<citerefentry><refentrytitle>sd_event_loop</refentrytitle><manvolnum>3</manvolnum></citerefentry>
after the last event loop iteration. It may also be queried
using <function>sd_event_get_exit_code()</function>, see
below. </para>
<para>When exiting is requested the event loop will stop listening
for and dispatching regular event sources. Instead it will proceed
with executing only event sources registered with
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
in the order defined by their priority. After all exit event
sources have been dispatched the event loop is terminated.</para>
<para>If <function>sd_event_exit()</function> is invoked a second
time while the event loop is still processing exit event sources,
the exit code stored in the event loop object is updated, but
otherwise no further operation is executed.</para>
<para><function>sd_event_get_exit_code()</function> may be used to
query the exit code passed into
<function>sd_event_exit()</function> earlier.</para>
<para>While the full positive and negative integer ranges may be used
for the exit code, care should be taken not pick exit codes that
conflict with regular exit codes returned by
<function>sd_event_loop()</function>, if these exit codes shall be
distinguishable.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_exit()</function> and
<function>sd_event_get_exit_code()</function> return 0 or a positive
integer. On failure, they return a negative errno-style error
code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>The event loop object or error code pointer are invalid.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop was created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop has exited already and all exit handlers are already processed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENODATA</constant></term>
<listitem><para>The event loop has not been requested to exit yet.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -21,8 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_get_fd"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentry id="sd_event_get_fd" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_get_fd</title>
@ -51,11 +50,11 @@
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_get_fd</function></funcdef>
<paramdef>sd_bus *<parameter>event</parameter></paramdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@ -65,19 +64,29 @@
<title>Description</title>
<para><function>sd_event_get_fd()</function> returns the file
descriptor that the event loop object returned by the
descriptor that an event loop object returned by the
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>
function uses to wait for events. This file descriptor can be
polled for events. This makes it possible to embed the
function uses to wait for events. This file descriptor may itself
be polled for
<constant>POLLIN</constant>/<constant>EPOLLIN</constant>
events. This makes it possible to embed an
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>
event loop inside of another event loop.</para>
event loop into another, possibly foreign, event loop.</para>
<para>The returned file descriptor refers to an <citerefentry
project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>
object. It is recommended not to alter it by invoking
<citerefentry
project='man-pages'><refentrytitle>epoll_ctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
on it, in order to avoid interference with the event loop's inner
logic and assumptions.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_get_fd()</function> returns a
non-negative integer. On failure, it returns a negative
non-negative file descriptor. On failure, it returns a negative
errno-style error code.</para>
</refsect1>
@ -108,21 +117,13 @@
<title>Examples</title>
<example>
<title>Integration in glib event loop</title>
<title>Integration in the GLib event loop</title>
<programlisting><xi:include href="glib-event-glue.c" parse="text" /></programlisting>
</example>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_get_fd()</function> is available as a
shared library, which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry
project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -130,7 +131,9 @@
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_ref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll_ctl</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_new">
<refentry id="sd_event_new" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_new</title>
@ -47,32 +47,48 @@
<refname>sd_event_default</refname>
<refname>sd_event_ref</refname>
<refname>sd_event_unref</refname>
<refname>sd_event_unrefp</refname>
<refname>sd_event_get_tid</refname>
<refname>sd_event</refname>
<refpurpose>Acquire and release an event loop object</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>typedef</token> struct sd_event sd_event;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_new</function></funcdef>
<paramdef>sd_bus **<parameter>event</parameter></paramdef>
<paramdef>sd_event **<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_default</function></funcdef>
<paramdef>sd_bus **<parameter>event</parameter></paramdef>
<paramdef>sd_event **<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>sd_bus *<function>sd_event_ref</function></funcdef>
<paramdef>sd_bus *<parameter>event</parameter></paramdef>
<funcdef>sd_event *<function>sd_event_ref</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>sd_bus *<function>sd_event_unref</function></funcdef>
<paramdef>sd_bus *<parameter>event</parameter></paramdef>
<funcdef>sd_event *<function>sd_event_unref</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_event_unrefp</function></funcdef>
<paramdef>sd_event **<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_get_tid</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>pid_t *<parameter>tid</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@ -103,6 +119,17 @@
thread. All threads have exactly either zero or one default event loop
objects associated, but never more.</para>
<para>After allocating an event loop object, add event sources to
it with
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
and then execute the event loop using
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para><function>sd_event_ref()</function> increases the reference
count of the specified event loop object by one.</para>
@ -117,6 +144,40 @@
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.</para>
<para><function>sd_event_unrefp()</function> is similar to
<function>sd_event_unref()</function> but takes a pointer to a
pointer to an <type>sd_event</type> object. This call is useful in
conjunction with GCC's and LLVM's <ulink
url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up
Variable Attribute</ulink>. Note that this function is defined as
inline function. Use a declaration like the following,
in order to allocate an event loop object that is freed
automatically as the code block is left:</para>
<programlisting>{
__attribute__((cleanup(sd_event_unrefp)) sd_event *event = NULL;
int r;
r = sd_event_default(&amp;event);
if (r &lt; 0)
fprintf(stderr, "Failed to allocate event loop: %s\n", strerror(-r));
}</programlisting>
<para><function>sd_event_ref()</function>,
<function>sd_event_unref()</function> and
<function>sd_event_unrefp()</function> execute no operation if the
passed in event loop object is <constant>NULL</constant>.</para>
<para><function>sd_event_get_tid()</function> retrieves the thread
identifier ("TID") of the thread the specified event loop object
is associated with. This call is only supported for event loops
allocated with <function>sd_event_default()</function>, and
returns the identifier for the thread the event loop is the
default event loop of. See <citerefentry
project='man-pages'><refentrytitle>gettid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for more information on thread identifiers.</para>
</refsect1>
<refsect1>
@ -149,18 +210,19 @@
<listitem><para>The maximum number of event loops has been allocated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENXIO</constant></term>
<listitem><para><function>sd_event_get_tid()</function> was
invoked on an event loop object that was not allocated with
<function>sd_event_default()</function>.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_new()</function> and the other functions
described here are available as a shared library, which can be
compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -174,7 +236,9 @@
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>gettid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

146
man/sd_event_now.xml Normal file
View File

@ -0,0 +1,146 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_now" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_now</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_now</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_now</refname>
<refpurpose>Retrieve current event loop iteration timestamp</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_now</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>clockid_t <parameter>clock</parameter></paramdef>
<paramdef>uint64_t *<parameter>usec</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_now()</function> returns the time when
the most recent event loop iteration began. A timestamp
is taken right after returning from the event sleep, and before
dispatching any event sources. The <parameter>event</parameter>
parameter specifies the event loop object to retrieve the timestamp
from. The <parameter>clock</parameter> parameter specifies the clock to
retrieve the timestamp for, and is one of
<constant>CLOCK_REALTIME</constant> (or equivalently
<constant>CLOCK_REALTIME_ALARM</constant>),
<constant>CLOCK_MONOTONIC</constant>, or
<constant>CLOCK_BOOTTIME</constant> (or equivalently
<constant>CLOCK_BOOTTIME_ALARM</constant>), see
<citerefentry project='man-pages'><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for more information on the various clocks. The retrieved
timestamp is stored in the <parameter>usec</parameter> parameter,
in µs since the clock's epoch. If this function is invoked before
the first event loop iteration, the current time is returned, as
reported by <function>clock_gettime()</function>. To distinguish
this case from a regular invocation the return value will be
positive, and zero when the returned timestamp refers to an actual
event loop iteration.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>If the first event loop iteration has not run yet
<function>sd_event_now()</function> writes current time to
<parameter>usec</parameter> and returns a positive return value.
Otherwise, it will write the requested timestamp to <parameter>usec</parameter>
and return 0. On failure, the call returns a negative errno-style
error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned values may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>An invalid parameter was
passed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EOPNOTSUPP</constant></term>
<listitem><para>Unsupported clock type.
</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop object was created in a
different process.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_run">
<refentry id="sd_event_run" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_run</title>
@ -46,7 +46,7 @@
<refname>sd_event_run</refname>
<refname>sd_event_loop</refname>
<refpurpose>Run the libsystemd event loop</refpurpose>
<refpurpose>Run an event loop</refpurpose>
</refnamediv>
<refsynopsisdiv>
@ -56,7 +56,7 @@
<funcprototype>
<funcdef>int <function>sd_event_run</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>uint64_t <parameter>timeout</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
@ -69,47 +69,60 @@
<refsect1>
<title>Description</title>
<para><function>sd_event_run()</function> can be used to run one
iteration of the event loop of libsystemd. This function waits
until an event to process is available, and dispatches a handler
for it. The <parameter>timeout</parameter> parameter specifices the
maximum time (in microseconds) to wait. <constant>(uint64_t)
-1</constant> may be used to specify an infinite timeout.</para>
<para><function>sd_event_run()</function> may be used to run a single
iteration of the event loop specified in the
<parameter>event</parameter> parameter. The function waits until an event to
process is available, and dispatches the registered handler for
it. The <parameter>usec</parameter> parameter specifies the
maximum time (in microseconds) to wait for an event. Use
<constant>(uint64_t) -1</constant> to specify an infinite
timeout.</para>
<para><function>sd_event_loop</function> runs
<function>sd_event_wait</function> in a loop with a timeout of
infinity. This makes it suitable for the main event loop of a
program.</para>
<para><function>sd_event_loop()</function> invokes
<function>sd_event_run()</function> in a loop, thus implementing
the actual event loop. The call returns as soon as exiting was
requested using
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The event loop object <parameter>event</parameter> is
created with
<function>sd_event_new</function>.
Events to wait for and their handlers can be registered with
<function>sd_event_add_time</function>,
<function>sd_event_add_child</function>,
<function>sd_event_add_signal</function>,
<function>sd_event_add_defer</function>,
<function>sd_event_add_exit</function>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
Events sources to wait for and their handlers may be registered
with
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and
<function>sd_event_add_post</function>.
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para>For more fine-grained control,
<function>sd_event_prepare</function>,
<function>sd_event_wait</function>, and
<function>sd_event_dispatch</function> may be used. Along with
<function>sd_event_get_fd</function>, those functions make it
possible to integrate the libsystemd loop inside of another event
loop.</para>
<para>For low-level control of event loop execution, use
<citerefentry><refentrytitle>sd_event_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>sd_event_dispatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>
which are wrapped by <function>sd_event_run()</function>. Along
with
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
these functions allow integration of an
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>
event loop into foreign event loop implementations.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, these functions return 0 or a positive integer.
On failure, they return a negative errno-style error code.
<function>sd_event_run</function> returns 0 if the event loop is
finished, and a positive value if it can be continued.</para>
<para>On failure, these functions return a negative errno-style
error code. <function>sd_event_run()</function> returns a
positive, non-zero integer if an event source was dispatched, and
zero when the specified timeout hit before an event source has
seen any event, and hence no event source was
dispatched. <function>sd_event_loop()</function> returns the exit
code specified when invoking
<function>sd_event_exit()</function>.</para>
</refsect1>
<refsect1>
@ -122,7 +135,7 @@
<term><constant>-EINVAL</constant></term>
<listitem><para>The <parameter>event</parameter> parameter is
<constant>NULL</constant>.</para></listitem>
invalid or <constant>NULL</constant>.</para></listitem>
</varlistentry>
<varlistentry>
@ -153,15 +166,7 @@
<para>Other errors are possible, too.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para><function>sd_event_run()</function> and
<function>sd_event_loop()</function> are available
as a shared library, which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -169,13 +174,15 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<ulink url="https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html">GLib Main Event Loop</ulink>.
</para>
</refsect1>

View File

@ -1,151 +0,0 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_set_name"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_set_name</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>More text</contrib>
<firstname>Zbigniew</firstname>
<surname>Jędrzejewski-Szmek</surname>
<email>zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_set_name</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_set_name</refname>
<refname>sd_event_get_name</refname>
<refpurpose>Set human-readable names for event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_set_name</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>const char *<parameter>name</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_get_name</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>const char **<parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_set_name()</function> can be used to set
an arbitrary name for the event source
<parameter>source</parameter>. This name will be used in error
messages generated by
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for this source. The <parameter>name</parameter> must point
to a <constant>NUL</constant>-terminated string or be
<constant>NULL</constant>. In the latter case, the name will be
unset. The string is copied internally, so the
<parameter>name</parameter> argument is not referenced after the
function returns.</para>
<para><function>sd_event_set_name()</function> can be used to
query the current name assigned to source
<parameter>source</parameter>. It returns a pointer to the current
name (possibly <constant>NULL</constant>) in
<parameter>name</parameter>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_set_name()</function> and
<function>sd_event_get_name()</function> return a
non-negative integer. On failure, they return a negative
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
structure or the <parameter>name</parameter> argument for
<function>sd_event_get_name()</function> is
<constant>NULL</constant>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to copy the
name.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>The functions described here are available as a
shared library, which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry
project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,177 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_set_watchdog" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_set_watchdog</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_set_watchdog</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_set_watchdog</refname>
<refname>sd_event_get_watchdog</refname>
<refpurpose>Enable event loop watchdog support</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_set_watchdog</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>int b</paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_get_watchdog</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_set_watchdog()</function> may be used to
enable or disable automatic watchdog notification support in the
event loop object specified in the <parameter>event</parameter>
parameter. Specifically, depending on the <parameter>b</parameter>
boolean argument this will make sure the event loop wakes up in
regular intervals and sends watchdog notification messages to the
service manager, if this was requested by the service
manager. Watchdog support is determined with
<citerefentry><refentrytitle>sd_watchdog_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
and watchdog messages are sent with
<citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>. See
the <varname>WatchdogSec=</varname> setting in
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details on how to enable watchdog support for a service and
the protocol used. The wake-up interval is chosen as half the
watchdog timeout declared by the service manager via the
<varname>$WATCHDOG_USEC</varname> environment variable. If the
service manager did not request watchdog notifications, or if the
process was not invoked by the service manager this call with a
true <parameter>b</parameter> parameter executes no
operation. Passing a false <parameter>b</parameter> parameter will
disable the automatic sending of watchdog notification messages if
it was enabled before. Newly allocated event loop objects have
this feature disabled.</para>
<para>The first watchdog notification message is sent immediately
when <function>set_event_set_watchdog()</function> is invoked with
a true <parameter>b</parameter> parameter.</para>
<para>The watchdog logic is designed to allow the service manager
to automatically detect services that ceased processing of
incoming events, and thus appear "hung". Watchdog notifications
are sent out only at the beginning of each event loop
iteration. If an event source dispatch function blocks for an
excessively long time and does not return execution to the event
loop quickly, this might hence cause the notification message to
be delayed, and possibly result in abnormal program termination,
as configured in the service unit file.</para>
<para><function>sd_event_get_watchdog()</function> may be used to
determine whether watchdog support was previously requested by a
call to <function>sd_event_set_watchdog()</function> with a true
<parameter>b</parameter> parameter and successfully
enabled.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_set_watchdog()</function> and
<function>sd_event_get_watchdog()</function> return a non-zero
positive integer if the service manager requested watchdog support
and watchdog support was successfully enabled. They return zero if
the service manager did not request watchdog support, or if
watchdog support was explicitly disabled with a false
<parameter>b</parameter> parameter. On failure, they return a
negative errno-style error
code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>The passed event loop object was invalid.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_watchdog_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,100 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_get_event" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_get_event</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_get_event</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_get_event</refname>
<refpurpose>Retrieve the event loop of an event source</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>sd_event* <function>sd_event_source_get_event</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_get_event()</function> may be used
to retrieve the event loop object the event source object specified
as <parameter>source</parameter> is associated with. The event
loop object is specified when creating an event source object with
calls such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_source_get_event()</function>
returns the associated event loop object. On failure, it returns
NULL.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,167 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_get_pending" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_get_pending</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_get_pending</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_get_pending</refname>
<refpurpose>Determine pending state of event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_get_pending</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_get_pending()</function> may be
used to determine whether the event source object specified as
<parameter>source</parameter> has seen events but has not been
dispatched yet (and thus is marked "pending").</para>
<para>Event source objects initially are not marked pending, when
they are created with calls such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
with the exception of those created with
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>
which are immediately marked pending, and
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for which the "pending" concept is not defined. For details see
the respective manual pages.</para>
<para>In each event loop iteration one event source of those
marked pending is dispatched, in the order defined by the event
source priority, as set with
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>For I/O event sources, as created with
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
the call
<citerefentry><refentrytitle>sd_event_source_get_io_revents</refentrytitle><manvolnum>3</manvolnum></citerefentry>
may be used to query the type of event pending in more
detail.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success,
<function>sd_event_source_get_pending()</function> returns an
integer greater than zero when the event source is marked pending,
and zero when the event source is not marked pending. On failure,
it returns a negative errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para><parameter>source</parameter> refers to an
event source object created with
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,170 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_set_description" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_description</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>More text</contrib>
<firstname>Zbigniew</firstname>
<surname>Jędrzejewski-Szmek</surname>
<email>zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_description</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_description</refname>
<refname>sd_event_source_get_description</refname>
<refpurpose>Set or retrieve descriptive names of event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_set_description</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>const char *<parameter>description</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_description</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>const char **<parameter>description</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_description()</function> may
be used to set an arbitrary descriptive name for the event source
object specified as <parameter>source</parameter>. This name will
be used in debugging messages generated by
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for this event source, and may be queried using
<function>sd_event_source_get_description()</function> for
debugging purposes. The <parameter>description</parameter> parameter shall
point to a <constant>NUL</constant>-terminated string or be
<constant>NULL</constant>. In the latter case, the descriptive
name will be unset. The string is copied internally, hence the
<parameter>description</parameter> argument is not referenced
after the function returns.</para>
<para><function>sd_event_source_get_description()</function> may
be used to query the current descriptive name assigned to the
event source object <parameter>source</parameter>. It returns a
pointer to the current name in <parameter>description</parameter>,
stored in memory internal to the event source. The memory is
invalidated when the event source is destroyed or the descriptive
name is changed.</para>
<para>Event source objects generally have no description set when
they are created, except for UNIX signal event sources created
with
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
whose descriptive name is initialized to the signal's C constant
name (e.g. <literal>SIGINT</literal> or
<literal>SIGTERM</literal>).</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_source_set_description()</function> and
<function>sd_event_source_get_description()</function> return a
non-negative integer. On failure, they return a negative
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
object or the <parameter>description</parameter> argument for
<function>sd_event_source_get_description()</function> is
<constant>NULL</constant>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to copy the
name.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENXIO</constant></term>
<listitem><para>No name was set for the event
source.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,179 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_set_enabled" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_enabled</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_enabled</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_enabled</refname>
<refname>sd_event_source_get_enabled</refname>
<refname>SD_EVENT_ON</refname>
<refname>SD_EVENT_OFF</refname>
<refname>SD_EVENT_ONESHOT</refname>
<refpurpose>Enable or disable event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>enum</token> {
<constant>SD_EVENT_OFF</constant> = 0,
<constant>SD_EVENT_ON</constant> = 1,
<constant>SD_EVENT_ONESHOT</constant> = -1,
};</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_set_enabled</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int <parameter>enabled</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_enabled</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int *<parameter>enabled</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_enabled()</function> may be
used to enable or disable the event source object specified as
<parameter>source</parameter>. The <parameter>enabled</parameter>
parameter takes one of <constant>SD_EVENT_ON</constant> (to
enable), <constant>SD_EVENT_OFF</constant> (to disable) or
<constant>SD_EVENT_ONESHOT</constant>. If invoked with
<constant>SD_EVENT_ONESHOT</constant> the event source will be
enabled but automatically reset to
<constant>SD_EVENT_OFF</constant> after the event source was
dispatched once.</para>
<para>Event sources that are disabled will not result in event
loop wakeups and will not be dispatched, until they are enabled
again.</para>
<para><function>sd_event_source_get_enabled()</function> may be
used to query whether the event source object
<parameter>source</parameter> is currently enabled or not. It
returns the enablement state in
<parameter>enabled</parameter>.</para>
<para>Event source objects are enabled when they are first created
with calls such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>. However,
depending on the event source type they are enabled continuously
(<constant>SD_EVENT_ON</constant>) or only for a single invocation
of the event source handler
(<constant>SD_EVENT_ONESHOT</constant>). For details see the
respective manual pages.</para>
<para>As event source objects stay active and may be dispatched as
long as there is at least one reference to them, in many cases it
is a good idea to combine a call to
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with a prior call to
<function>sd_event_source_set_enabled()</function> with
<constant>SD_EVENT_OFF</constant>, to ensure the event source is
not dispatched again until all other remaining references are dropped.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_source_set_enabled()</function> and
<function>sd_event_source_get_enabled()</function> return a
non-negative integer. On failure, they return a negative
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,171 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_set_prepare" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_prepare</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_prepare</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_prepare</refname>
<refpurpose>Set a preparation callback for event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_set_prepare</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>sd_event_handler_t <parameter>callback</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_event_handler_t</function>)</funcdef>
<paramdef>sd_event_source *<parameter>s</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_prepare()</function> may be
used to set a preparation callback for the event source object
specified as <parameter>source</parameter>. The callback function
specified as <parameter>callback</parameter> will be invoked
immediately before the event loop goes to sleep to wait for
incoming events. It is invoked with the user data pointer passed
when the event source was created. The callback function may be
used to reconfigure the precise events to wait for. If the
<parameter>callback</parameter> parameter is passed as NULL the
callback function is reset. </para>
<para>Event source objects have no preparation callback associated
when they are first created with calls such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Preparation
callback functions are supported for all event source types with
the exception of those created with
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Preparation
callback functions are dispatched in the order indicated by the
event source's priority field, as set with
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Preparation
callbacks of disabled event sources (see
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>)
are not invoked.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success,
<function>sd_event_source_set_prepare()</function> returns a
non-negative integer. On failure, it returns a negative
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EDOM</constant></term>
<listitem><para>The specified event source has been created
with
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,189 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_set_priority" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_priority</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_priority</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_priority</refname>
<refname>sd_event_source_get_priority</refname>
<refname>SD_EVENT_PRIORITY_IMPORTANT</refname>
<refname>SD_EVENT_PRIORITY_NORMAL</refname>
<refname>SD_EVENT_PRIORITY_IDLE</refname>
<refpurpose>Set or retrieve the priority of event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>enum</token> {
<constant>SD_EVENT_SOURCE_IMPORTANT</constant> = -100,
<constant>SD_EVENT_SOURCE_NORMAL</constant> = 0,
<constant>SD_EVENT_SOURCE_IDLE</constant> = 100,
};</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_set_priority</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int64_t <parameter>priority</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_priority</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int64_t *<parameter>priority</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_priority()</function> may be
used to set the priority for the event source object specified as
<parameter>source</parameter>. The priority is specified as an
arbitrary signed 64bit integer. The priority is initialized to
<constant>SD_EVENT_PRIORITY_NORMAL</constant> (0) when the event
source is allocated with a call such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
and may be changed with this call. If multiple event sources have seen events at the same time, they are dispatched in the order indicated by the
event sources' priorities. Event sources with smaller priority
values are dispatched first. As well-known points of reference,
the constants <constant>SD_EVENT_PRIORITY_IMPORTANT</constant>
(-100), <constant>SD_EVENT_PRIORITY_NORMAL</constant> (0) and
<constant>SD_EVENT_PRIORITY_IDLE</constant> (100) may be used to
indicate event sources that shall be dispatched early, normally or
late. It is recommended to specify priorities based on these
definitions, and relative to them -- however, the full 64bit
signed integer range is available for ordering event
sources.</para>
<para>Priorities define the order in which event sources that have
seen events are dispatched. Care should be taken to ensure that
high-priority event sources (those with negative priority values
assigned) do not cause starvation of low-priority event sources
(those with positive priority values assigned).</para>
<para>The order in which event sources with the same priority are
dispatched is undefined, but the event loop generally tries to
dispatch them in the order it learnt about events on them. As the
backing kernel primitives do not provide accurate information
about the order in which events occurred this is not necessarily
reliable. However, it is guaranteed that if events are seen on
multiple same-priority event sources at the same time, each one is
not dispatched again until all others have been dispatched
once. This behaviour guarantees that within each priority
particular event sources do not starve or dominate the event
loop.</para>
<para><function>sd_event_source_get_priority()</function> may be
used to query the current priority assigned to the event source
object <parameter>source</parameter>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success,
<function>sd_event_source_set_priority()</function> and
<function>sd_event_source_get_priority()</function> return a
non-negative integer. On failure, they return a negative
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid
pointer to an <structname>sd_event_source</structname>
object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,119 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_set_userdata" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_userdata</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_userdata</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_userdata</refname>
<refname>sd_event_source_get_userdata</refname>
<refpurpose>Set or retrieve user data pointer of event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>void* <function>sd_event_source_set_userdata</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void* <function>sd_event_source_get_userdata</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_userdata()</function> may be
used to set an arbitrary user data pointer for the event source
object specified as <parameter>source</parameter>. The user data
pointer is usually specified when creating an event source object
with calls such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
and may be updated with this call. The user data pointer is also
passed to all handler callback functions associated with the event
source. The <parameter>userdata</parameter> parameter specifies
the new user data pointer to set, the function returns the
previous user data pointer. Note that <constant>NULL</constant> is
a valid user data pointer.</para>
<para><function>sd_event_source_get_userdata()</function> may be
used to query the current user data pointer assigned to the event
source object <parameter>source</parameter>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success,
<function>sd_event_source_set_userdata()</function> and
<function>sd_event_source_get_userdata()</function> return the
previously set user data pointer. On failure, they return
NULL.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,142 @@
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_source_unref" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_unref</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_unref</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_unref</refname>
<refname>sd_event_source_unrefp</refname>
<refname>sd_event_source_ref</refname>
<refpurpose>Increase or decrease event source reference counters</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>sd_event_source* <function>sd_event_source_unref</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_event_source_unrefp</function></funcdef>
<paramdef>sd_event_source **<parameter>source</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>sd_event_source* <function>sd_event_source_ref</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_unref()</function> may be used to
decrement by one the reference counter of the event source object
specified as <parameter>source</parameter>. The reference counter
is initially set to one, when the event source is created with calls
such as
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>. When
the reference counter reaches zero it is removed from its event loop
object and destroyed.</para>
<para><function>sd_event_source_unrefp()</function> is similar to
<function>sd_event_source_unref()</function> but takes a pointer to a
pointer to an <type>sd_event_source</type> object. This call is useful in
conjunction with GCC's and LLVM's <ulink
url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up
Variable Attribute</ulink>. Note that this function is defined as
inline function.</para>
<para><function>sd_event_source_ref()</function> may be used
to increase by one the reference counter of the event source object
specified as <parameter>source</parameter>.</para>
<para><function>sd_event_source_unref()</function>,
<function>sd_bus_creds_unrefp()</function> and
<function>sd_bus_creds_ref()</function> execute no operation if
the passed event source object is
<constant>NULL</constant>.</para>
<para>Note that event source objects stay alive and may be
dispatched as long as they have a reference counter greater than
zero. In order to drop a reference of an event source and make
sure the associated event source handler function is not called
anymore it is recommended to combine a call of
<function>sd_event_source_unref()</function> with a prior call to
<function>sd_event_source_set_enabled()</function> with
<constant>SD_EVENT_OFF</constant>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para><function>sd_event_source_unref()</function> always returns
<constant>NULL</constant>.
<function>sd_event_source_ref()</function> always returns the
event source object passed in.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_event_wait">
<refentry id="sd_event_wait" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_wait</title>
@ -46,14 +46,32 @@
<refname>sd_event_wait</refname>
<refname>sd_event_prepare</refname>
<refname>sd_event_dispatch</refname>
<refname>sd_event_get_state</refname>
<refname>SD_EVENT_INITIAL</refname>
<refname>SD_EVENT_PREPARING</refname>
<refname>SD_EVENT_ARMED</refname>
<refname>SD_EVENT_PENDING</refname>
<refname>SD_EVENT_RUNNING</refname>
<refname>SD_EVENT_EXITING</refname>
<refname>SD_EVENT_FINISHED</refname>
<refpurpose>Run parts of the libsystemd event loop</refpurpose>
<refpurpose>Low-level event loop operations</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcsynopsisinfo><token>enum</token> {
<constant>SD_EVENT_INITIAL</constant>,
<constant>SD_EVENT_PREPARING</constant>,
<constant>SD_EVENT_ARMED</constant>,
<constant>SD_EVENT_PENDING</constant>,
<constant>SD_EVENT_RUNNING</constant>,
<constant>SD_EVENT_EXITING</constant>,
<constant>SD_EVENT_FINISHED</constant>,
};</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_prepare</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
@ -62,7 +80,7 @@
<funcprototype>
<funcdef>int <function>sd_event_wait</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>uint64_t <parameter>timeout</parameter></paramdef>
<paramdef>uint64_t <parameter>usec</parameter></paramdef>
</funcprototype>
<funcprototype>
@ -70,66 +88,184 @@
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_get_state</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>Functions described here form parts of an event loop.</para>
<para>The low-level <function>sd_event_prepare()</function>,
<function>sd_event_wait()</function> and
<function>sd_event_dispatch()</function> functions may be used to
execute specific phases of an event loop. See
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>sd_event_loop</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for higher-level functions that execute individual but complete
iterations of an event loop or run it continuously.</para>
<para><function>sd_event_prepare</function> checks for pending
<para><function>sd_event_prepare()</function> checks for pending
events and arms necessary timers. If any events are ready to be
processed, it returns a positive value, and the events should be
processed with <function>sd_event_dispatch</function>.
<function>sd_event_dispatch</function> runs a handler for one of
the events from the sources with the highest priority. On success,
<function>sd_event_dispatch</function> returns either 0, which
means that the loop is finished, or a positive value, which means
that the loop is again in the initial state and
<function>sd_event_prepare</function> should be called again.
</para>
processed ("pending"), it returns a positive, non-zero value, and the caller
should process these events with
<function>sd_event_dispatch()</function>.</para>
<para>In case <function>sd_event_prepare</function> returned 0,
<function>sd_event_wait</function> should be called to wait for
events or a timeout. If any events are ready to be processed, it
returns a positive value, and the events should be processed with
<function>sd_event_dispatch</function>. Otherwise, the loop is
back in the initial state and <function>sd_event_prepare</function>
should be called again.</para>
<para><function>sd_event_dispatch()</function> dispatches the
highest priority event source that has a pending event. On
success, <function>sd_event_dispatch()</function> returns either
zero, which indicates that no further event sources may be
dispatched and exiting of the event loop was requested via
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>;
or a positive non-zero value, which means that an event source was
dispatched and the loop returned to its initial state, and the
caller should initiate the next event loop iteration by invoking
<function>sd_event_prepare()</function> again.</para>
<para>In case <function>sd_event_prepare()</function> returned
zero, <function>sd_event_wait()</function> should be called to
wait for further events or a timeout. If any events are ready to
be processed, it returns a positive, non-zero value, and the
events should be dispatched with
<function>sd_event_dispatch()</function>. Otherwise, the event
loop returned to its initial state and the next event loop
iteration should be initiated by invoking
<function>sd_event_prepare()</function> again.</para>
<para><function>sd_event_get_state()</function> may be used to
determine the state the event loop is currently in. It returns one
of the states described below.</para>
<para>All four functions take, as the first argument, the event
loop object <parameter>event</parameter> that has been created
with <function>sd_event_new()</function>. The timeout for
<function>sd_event_wait()</function> is specified in
<parameter>usec</parameter> in milliseconds. <constant>(uint64_t)
-1</constant> may be used to specify an infinite timeout.</para>
</refsect1>
<refsect1>
<title>State Machine</title>
<para>The event loop knows the following states, that may be
queried with <function>sd_event_get_state()</function>.</para>
<variablelist>
<varlistentry>
<term><constant>SD_EVENT_INITIAL</constant></term>
<listitem><para>The initial state the event loop is in,
before each event loop iteration. Use
<function>sd_event_prepare()</function> to transition the
event loop into the <constant>SD_EVENT_ARMED</constant> or
<constant>SD_EVENT_PENDING</constant> states.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_PREPARING</constant></term>
<listitem><para>An event source is currently being prepared,
i.e. the preparation handler is currently being executed, as
set with
<citerefentry><refentrytitle>sd_event_set_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>. This
state is only seen in the event source preparation handler
that is invoked from the
<function>sd_event_prepare()</function> call and is
immediately followed by <constant>SD_EVENT_ARMED</constant> or
<constant>SD_EVENT_PENDING</constant>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_ARMED</constant></term>
<listitem><para><function>sd_event_prepare()</function> has
been called and no event sources were ready to be
dispatched. Use <function>sd_event_wait()</function> to wait
for new events, and transition into
<constant>SD_EVENT_PENDING</constant> or back into
<constant>SD_EVENT_INITIAL</constant>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_PENDING</constant></term>
<listitem><para><function>sd_event_prepare()</function> or
<function>sd_event_wait()</function> have been called and
there were event sources with events pending. Use
<function>sd_event_dispatch()</function> to dispatch the
highest priority event source and transition back to
<constant>SD_EVENT_INITIAL</constant>, or
<constant>SD_EVENT_FINISHED</constant>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_RUNNING</constant></term>
<listitem><para>A regular event source is currently being
dispatched. This state is only seen in the event source
handler that is invoked from the
<function>sd_event_dispatch()</function> call, and is
immediately followed by <constant>SD_EVENT_INITIAL</constant>
or <constant>SD_EVENT_FINISHED</constant> as soon the event
source handler returns. Note that during dispatching of exit
event sources the <constant>SD_EVENT_EXITING</constant> state
is seen instead.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_EXITING</constant></term>
<listitem><para>Similar to
<constant>SD_EVENT_RUNNING</constant> but is the state in
effect while dispatching exit event sources. It is followed by
<constant>SD_EVENT_INITIAL</constant> or
<constant>SD_EVENT_FINISHED</constant> as soon as the event
handler returns.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_EVENT_FINISHED</constant></term>
<listitem><para>The event loop has exited. All exit event
sources have run. If the event loop is in this state it serves
no purpose anymore, and should be freed.</para></listitem>
</varlistentry>
</variablelist>
<para>A simplified flow chart of the states and the calls to
transition between them is shown below. Note that
<constant>SD_EVENT_PREPARING</constant>,
<constant>SD_EVENT_RUNNING</constant> and
<constant>SD_EVENT_EXITING</constant> are not shown here.</para>
<programlisting>
┌──────────┐
│ initial ├──←←←←←←←←←←←←←←←←←←←─┐
└───┬──────┘ ↑
│ ↑
sd_event_prepare ┌─────────┐ ↑
├ 0 →→→→→→→──┤ armed │ ↑
1 └───┬─────┘ ↑
↓ │ ↑
↓ sd_event_wait ↑
├───←←←←←←←─── 1 ┴─ 0 →→→→→→→─┘
┌───┴──────┐ ↑
│ pending │ ↑
└───┬──────┘ ↑
│ ↑
sd_event_dispatch ↑
↓ ↑
├ 1 ──────────→→→→→→→─────────┘
0
┌───┴──────┐
│ finished │
└──────────┘
INITIAL -&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---&lt;---\
| |
| ^
| |
v ret == 0 |
sd_event_prepare() &gt;---&gt;---&gt;---&gt;---&gt;- ARMED |
| | ^
| ret > 0 | |
| | |
v v ret == 0 |
PENDING &lt;---&lt;---&lt;---&lt;---&lt;---&lt; sd_event_wait() &gt;---&gt;---&gt;--+
| ret > 0 ^
| |
| |
v |
sd_event_dispatch() &gt;---&gt;---&gt;---&gt;---&gt;---&gt;---&gt;---&gt;---&gt;---&gt;---&gt;/
| ret > 0
| ret == 0
|
v
FINISHED
</programlisting>
<para>All three functions take, as the first argument, the event
loop object <parameter>event</parameter> that is created with
<function>sd_event_new</function>. The timeout for
<function>sd_event_wait</function> is specified with
<parameter>timeout</parameter> in milliseconds.
<constant>(uint64_t) -1</constant> may be used to specify an
infinite timeout.</para>
</refsect1>
<refsect1>
@ -137,13 +273,15 @@
<para>On success, these functions return 0 or a positive integer.
On failure, they return a negative errno-style error code. In case
of <function>sd_event_prepare</function> and
<function>sd_event_wait</function>, a positive value means that
events are ready to be processed and 0 means that no events are
ready. In case of <function>sd_event_dispatch</function>, a
positive value means that the loop is again in the initial state
and 0 means the loop is finished. For any of these functions, a
negative return value means the loop must be aborted.</para>
of <function>sd_event_prepare()</function> and
<function>sd_event_wait()</function>, a positive, non-zero return
code indicates that events are ready to be processed and zero
indicates that no events are ready. In case of
<function>sd_event_dispatch()</function>, a positive, non-zero
return code indicates that the event loop returned to its initial
state and zero indicates the event loop has
exited. <function>sd_event_get_state()</function> returns a
positive or zero state on success.</para>
</refsect1>
<refsect1>
@ -156,7 +294,7 @@
<term><constant>-EINVAL</constant></term>
<listitem><para>The <parameter>event</parameter> parameter is
<constant>NULL</constant>.</para></listitem>
invalid or <constant>NULL</constant>.</para></listitem>
</varlistentry>
<varlistentry>
@ -185,14 +323,7 @@
<para>Other errors are possible, too.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>Functions described here are available
as a shared library, which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
@ -200,13 +331,15 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
<citerefentry><refentrytitle>sd_event_add_post</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_prepare</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -0,0 +1,161 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2016 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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_journal_enumerate_fields">
<refentryinfo>
<title>sd_journal_enumerate_fields</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_journal_enumerate_fields</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_journal_enumerate_fields</refname>
<refname>sd_journal_restart_fields</refname>
<refname>SD_JOURNAL_FOREACH_FIELD</refname>
<refpurpose>Read used field names from the journal</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_journal_enumerate_fields</function></funcdef>
<paramdef>sd_journal *<parameter>j</parameter></paramdef>
<paramdef>const char **<parameter>field</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_journal_restart_fields</function></funcdef>
<paramdef>sd_journal *<parameter>j</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef><function>SD_JOURNAL_FOREACH_FIELD</function></funcdef>
<paramdef>sd_journal *<parameter>j</parameter></paramdef>
<paramdef>const char *<parameter>field</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_journal_enumerate_fields()</function> may be used to iterate through all field names used in the
opened journal files. On each invocation the next field name is returned. The order of the returned field names is
not defined. It takes two arguments: the journal context object, plus a pointer to a constant string pointer where
the field name is stored in. The returned data is in a read-only memory map and is only valid until the next
invocation of <function>sd_journal_enumerate_fields()</function>. Note that this call is subject to the data field
size threshold as controlled by <function>sd_journal_set_data_threshold()</function>.</para>
<para><function>sd_journal_restart_fields()</function> resets the field name enumeration index to the beginning of
the list. The next invocation of <function>sd_journal_enumerate_fields()</function> will return the first field
name again.</para>
<para>The <function>SD_JOURNAL_FOREACH_FIELD()</function> macro may be used as a handy wrapper around
<function>sd_journal_restart_fields()</function> and <function>sd_journal_enumerate_fields()</function>.</para>
<para>These functions currently are not influenced by matches set with <function>sd_journal_add_match()</function>
but this might change in a later version of this software.</para>
<para>To retrieve the possible values a specific field can take use
<citerefentry><refentrytitle>sd_journal_query_unique</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para><function>sd_journal_enumerate_fields()</function> returns a
positive integer if the next field name has been read, 0 when no
more field names are known, or a negative errno-style error code.
<function>sd_journal_restart_fields()</function> returns
nothing.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>The <function>sd_journal_enumerate_fields()</function> and <function>sd_journal_restart_fields()</function>
interfaces are available as a shared library, which can be compiled and linked to with the
<constant>libsystemd</constant> <citerefentry
project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> file.</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>Use the <function>SD_JOURNAL_FOREACH_FIELD</function> macro to iterate through all field names in use in the
current journal.</para>
<programlisting>#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;systemd/sd-journal.h&gt;
int main(int argc, char *argv[]) {
sd_journal *j;
const char *field;
int r;
r = sd_journal_open(&amp;j, SD_JOURNAL_LOCAL_ONLY);
if (r &lt; 0) {
fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
return 1;
}
SD_JOURNAL_FOREACH_FIELD(j, field)
printf("%s\n", field);
sd_journal_close(j);
return 0;
}</programlisting>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_query_unique</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -0,0 +1,95 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2016 Jan Synáček
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 <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_journal_has_runtime_files">
<refentryinfo>
<title>sd_journal_has_runtime_files</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Jan</firstname>
<surname>Synáček</surname>
<email>jan.synacek@gmail.com</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd_journal_has_runtime_files</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_journal_has_runtime_files</refname>
<refname>sd_journal_has_persistent_files</refname>
<refpurpose>Query availability of runtime or persistent journal files.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_journal_has_runtime_files</function></funcdef>
<paramdef>sd_journal *<parameter>j</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_journal_has_persistent_files</function></funcdef>
<paramdef>sd_journal *<parameter>j</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_journal_has_runtime_files()</function> returns a positive value
if runtime journal files (present in /run/systemd/journal/) have been found.
Otherwise returns 0.</para>
<para><function>sd_journal_has_persistent_files()</function> returns a positive value
if persistent journal files (present in /var/log/journal/) have been found.
Otherwise returns 0.</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>Both <function>sd_journal_has_runtime_files()</function>
and <function>sd_journal_has_persistent_files()</function> return -EINVAL
if their argument is NULL.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -128,6 +128,11 @@
<para>Note that these functions currently are not influenced by
matches set with <function>sd_journal_add_match()</function> but
this might change in a later version of this software.</para>
<para>To enumerate all field names currently in use (and thus all suitable field parameters for
<function>sd_journal_query_unique()</function>), use the
<citerefentry><refentrytitle>sd_journal_enumerate_fields</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call.</para>
</refsect1>
<refsect1>
@ -167,25 +172,25 @@
#include &lt;systemd/sd-journal.h&gt;
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(&amp;j, SD_JOURNAL_LOCAL_ONLY);
if (r &lt; 0) {
fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
return 1;
}
r = sd_journal_query_unique(j, "_SYSTEMD_UNIT");
if (r &lt; 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(&amp;j, SD_JOURNAL_LOCAL_ONLY);
if (r &lt; 0) {
fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
return 1;
}
r = sd_journal_query_unique(j, "_SYSTEMD_UNIT");
if (r &lt; 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;
}</programlisting>
</refsect1>
@ -198,6 +203,7 @@ int main(int argc, char *argv[]) {
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_enumerate_fields</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>

View File

@ -45,6 +45,7 @@
<refnamediv>
<refname>sd_login_monitor_new</refname>
<refname>sd_login_monitor_unref</refname>
<refname>sd_login_monitor_unrefp</refname>
<refname>sd_login_monitor_flush</refname>
<refname>sd_login_monitor_get_fd</refname>
<refname>sd_login_monitor_get_events</refname>
@ -68,6 +69,11 @@
<paramdef>sd_login_monitor *<parameter>m</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>sd_login_monitor_unrefp</function></funcdef>
<paramdef>sd_login_monitor **<parameter>m</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_login_monitor_flush</function></funcdef>
<paramdef>sd_login_monitor *<parameter>m</parameter></paramdef>
@ -121,6 +127,26 @@
descriptor returned by
<function>sd_login_monitor_get_fd()</function>.</para>
<para><function>sd_login_monitor_unrefp()</function> is similar to
<function>sd_login_monitor_unref()</function> but takes a pointer
to a pointer to an <type>sd_login_monitor</type> object. This call
is useful in conjunction with GCC's and LLVM's <ulink
url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up
Variable Attribute</ulink>. Note that this function is defined as
inline function. Use a declaration like the following, in order to
allocate a login monitor object that is freed automatically as the
code block is left:</para>
<programlisting>{
__attribute__((cleanup(sd_login_monitor_unrefp)) sd_login_monitor *m = NULL;
int r;
r = sd_login_monitor_default(&amp;m);
if (r &lt; 0)
fprintf(stderr, "Failed to allocate login monitor object: %s\n", strerror(-r));
}</programlisting>
<para><function>sd_login_monitor_flush()</function> 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
@ -128,6 +154,11 @@
state. If this call is not invoked, the file descriptor will
immediately wake up the event loop again.</para>
<para><function>sd_login_monitor_unref()</function> and
<function>sd_login_monitor_unrefp()</function> execute no
operation if the passed in monitor object is
<constant>NULL</constant>.</para>
<para><function>sd_login_monitor_get_fd()</function> may be used
to retrieve the file descriptor of the monitor object that may be
integrated in an application defined event loop, based around

View File

@ -242,7 +242,7 @@
multiple file descriptors are submitted at once, the specified
name will be assigned to all of them. In order to assign
different names to submitted file descriptors, submit them in
seperate invocations of
separate invocations of
<function>sd_pid_notify_with_fds()</function>. The name may
consist of any ASCII character, but must not contain control
characters or <literal>:</literal>. It may not be longer than

View File

@ -192,7 +192,7 @@
<function>sd_seat_get_sessions()</function>,
<function>sd_seat_can_multi_session()</function>,
<function>sd_seat_can_tty()</function> and
<function>sd_seat_can_grapical()</function> interfaces are
<function>sd_seat_can_graphical()</function> interfaces are
available as a shared library, which can be compiled and linked to
with the
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>

View File

@ -98,6 +98,11 @@
<varname>WatchdogSec=</varname> in service files. See
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details.</para>
<para>Use
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
to enable automatic watchdog support in
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>-based event loops.</para>
</refsect1>
<refsect1>
@ -168,7 +173,8 @@
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -683,14 +683,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<para>Start (activate) one or more units specified on the
command line.</para>
<para>Note that glob patterns operate on a list of currently
loaded units. Units which are not active and are not in a
failed state usually are not loaded, and would not be
matched by any pattern. In addition, in case of
instantiated units, systemd is often unaware of the
instance name until the instance has been started. Therefore,
using glob patterns with <command>start</command>
has limited usefulness.</para>
<para>Note that glob patterns operate on the set of primary names of currently loaded units. Units which
are not active and are not in a failed state usually are not loaded, and will not be matched by any
pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
the instance has been started. Therefore, using glob patterns with <command>start</command> has limited
usefulness. Also, secondary alias names of units are not considered.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -736,9 +733,9 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<listitem>
<para>Restart one or more units specified on the command
line if the units are running. This does nothing if units are not
running. Note that, for compatibility with Red Hat init
scripts, <command>condrestart</command> is equivalent to this
command.</para>
running.</para>
<!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
don't document that. -->
</listitem>
</varlistentry>
<varlistentry>
@ -751,14 +748,14 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
</listitem>
</varlistentry>
<varlistentry>
<term><command>reload-or-try-restart <replaceable>PATTERN</replaceable>...</command></term>
<term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>...</command></term>
<listitem>
<para>Reload one or more units if they support it. If not,
restart them instead. This does nothing if the units are not
running. Note that, for compatibility with SysV init scripts,
<command>force-reload</command> is equivalent to this
command.</para>
running.</para>
<!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
don't document that. -->
</listitem>
</varlistentry>
<varlistentry>
@ -832,7 +829,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
output. If you are looking for computer-parsable output,
use <command>show</command> instead. By default, this
function only shows 10 lines of output and ellipsizes
lines to fit in the terminal window. This can be changes
lines to fit in the terminal window. This can be changed
with <option>--lines</option> and <option>--full</option>,
see above. In addition, <command>journalctl
--unit=<replaceable>NAME</replaceable></command> or
@ -888,6 +885,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para>
<para>If the specified unit appears to be inactive, the
changes will be only stored on disk as described
previously hence they will be effective when the unit will
be started.</para>
<para>Note that this command allows changing multiple
properties at the same time, which is preferable over
setting them individually. Like unit file configuration
@ -1132,7 +1134,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<tbody>
<row>
<entry><literal>enabled</literal></entry>
<entry morerows='1'>Enabled through a symlink in a <filename>.wants/</filename> or <filename>.requires/</filename> subdirectory of <filename>/etc/systemd/system/</filename> (persistently) or <filename>/run/systemd/system/</filename> (transiently).</entry>
<entry morerows='1'>Enabled via <filename>.wants/</filename>, <filename>.requires/</filename> or alias symlinks (permanently in <filename>/etc/systemd/system/</filename>, or transiently in <filename>/run/systemd/system/</filename>).</entry>
<entry morerows='1'>0</entry>
</row>
<row>
@ -1171,7 +1173,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
</row>
<row>
<entry><literal>bad</literal></entry>
<entry>Unit file is invalid or another error occured. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry>
<entry>Unit file is invalid or another error occurred. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry>
<entry>&gt; 0</entry>
</row>
</tbody>
@ -1696,34 +1698,28 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<refsect2>
<title>Parameter Syntax</title>
<para>Unit commands listed above take either a single unit name
(designated as <replaceable>NAME</replaceable>), or multiple
unit specifications (designated as
<replaceable>PATTERN</replaceable>...). In the first case, the
unit name with or without a suffix must be given. If the suffix
is not specified, systemctl will append a suitable suffix,
<literal>.service</literal> by default, and a type-specific
suffix in case of commands which operate only on specific unit
types. For example,
<para>Unit commands listed above take either a single unit name (designated as <replaceable>NAME</replaceable>),
or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>...). In the first case, the
unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
case of commands which operate only on specific unit types. For example,
<programlisting># systemctl start sshd</programlisting> and
<programlisting># systemctl start sshd.service</programlisting>
are equivalent, as are
<programlisting># systemctl isolate default</programlisting>
and
<programlisting># systemctl isolate default.target</programlisting>
Note that (absolute) paths to device nodes are automatically
converted to device unit names, and other (absolute) paths to
mount unit names.
Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
paths to mount unit names.
<programlisting># systemctl status /dev/sda
# systemctl status /home</programlisting>
are equivalent to:
<programlisting># systemctl status dev-sda.device
# systemctl status home.mount</programlisting>
In the second case, shell-style globs will be matched against
currently loaded units; literal unit names, with or without
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.</para>
In the second case, shell-style globs will be matched against the primary names of all currently loaded units;
literal unit names, with or without 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.</para>
<para>Glob patterns use
<citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@ -1731,16 +1727,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<literal>*</literal>, <literal>?</literal>,
<literal>[]</literal> may be used. See
<citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for more details. The patterns are matched against the names of
for more details. The patterns are matched against the primary names of
currently loaded units, and patterns which do not match anything
are silently skipped. For example:
<programlisting># systemctl stop sshd@*.service</programlisting>
will stop all <filename>sshd@.service</filename> instances.
will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
loaded are not considered for glob expansion.
</para>
<para>For unit file commands, the specified
<replaceable>NAME</replaceable> should be the full name of the
unit file, or the absolute path to the unit file:
<para>For unit file commands, the specified <replaceable>NAME</replaceable> should be the name of the unit file
(possibly abbreviated, see above), or the absolute path to the unit file:
<programlisting># systemctl enable foo.service</programlisting>
or
<programlisting># systemctl link /path/to/foo.service</programlisting>

View File

@ -60,24 +60,21 @@
<refsect1>
<title>Description</title>
<para><command>systemd-activate</command> 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).
<para><command>systemd-activate</command> may be used to launch a socket-activated service binary from the command
line for testing purposes. It may also be used to launch individual instances of the service binary per connection.
</para>
<para>The daemon to launch and its options should be specified
after options intended for <command>systemd-activate</command>.
</para>
<para>If the <option>-a</option> option is given, file descriptor
of the connection will be used as the standard input and output of
the launched process. Otherwise, standard input and output will be
inherited, and sockets will be passed through file descriptors 3
and higher. Sockets passed through <varname>$LISTEN_FDS</varname>
to <command>systemd-activate</command> will be passed through to
the daemon, in the original positions. Other sockets specified
with <option>--listen</option> will use consecutive descriptors.
<para>If the <option>--inetd</option> option is given, the socket file descriptor will be used as the standard
input and output of the launched process. Otherwise, standard input and output will be inherited, and sockets will
be passed through file descriptors 3 and higher. Sockets passed through <varname>$LISTEN_FDS</varname> to
<command>systemd-activate</command> will be passed through to the daemon, in the original positions. Other sockets
specified with <option>--listen=</option> will use consecutive descriptors. By default,
<command>systemd-activate</command> listens on a stream socket, use <option>--datagram</option> and
<option>--seqpacket</option> to listen on datagram or sequential packet sockets instead (see below).
</para>
</refsect1>
@ -98,9 +95,32 @@
<term><option>-a</option></term>
<term><option>--accept</option></term>
<listitem><para>Launch a separate instance of daemon per
connection and pass the connection socket as standard input
and standard output.</para></listitem>
<listitem><para>Launch an instance of the service binary for each connection and pass the connection
socket.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<term><option>--datagram</option></term>
<listitem><para>Listen on a datagram socket (<constant>SOCK_DGRAM</constant>), instead of a stream socket
(<constant>SOCK_STREAM</constant>). May not be combined with <option>--seqpacket</option>.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--seqpacket</option></term>
<listitem><para>Listen on a sequential packet socket (<constant>SOCK_SEQPACKET</constant>), instead of a stream
socket (<constant>SOCK_STREAM</constant>). May not be combined with
<option>--datagram</option>.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--inetd</option></term>
<listitem><para>Use the inetd protocol for passing file descriptors, i.e. as standard input and standard
output, instead of the new-style protocol for passing file descriptors using <varname>$LISTEN_FDS</varname>
(see above).</para></listitem>
</varlistentry>
<varlistentry>
@ -160,7 +180,7 @@
<example>
<title>Run an echo server on port 2000</title>
<programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 -a cat</programlisting>
<programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 --inetd -a cat</programlisting>
</example>
<example>

View File

@ -149,7 +149,7 @@
possible to cache multiple passwords under the same keyname,
in which case they will be stored as NUL-separated list of
passwords. Use
<citerefentry><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
<citerefentry project='die-net'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to access the cached key via the kernel keyring
directly. Example: <literal>--keyname=cryptsetup</literal></para></listitem>
</varlistentry>
@ -209,7 +209,7 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>plymouth</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>

View File

@ -59,7 +59,7 @@
<para><command>systemd-detect-virt</command> detects execution in
a virtualized environment. It identifies the virtualization
technology and can distinguish full VM virtualization from
technology and can distinguish full machine virtualization from
container virtualization. <filename>systemd-detect-virt</filename>
exits with a return value of 0 (success) if a virtualization
technology is detected, and non-zero (error) otherwise. By default,
@ -88,7 +88,7 @@
</thead>
<tbody>
<row>
<entry morerows="9">VM</entry>
<entry valign="top" morerows="9">VM</entry>
<entry><varname>qemu</varname></entry>
<entry>QEMU software virtualization</entry>
</row>
@ -139,7 +139,7 @@
</row>
<row>
<entry morerows="5">Container</entry>
<entry valign="top" morerows="5">Container</entry>
<entry><varname>openvz</varname></entry>
<entry>OpenVZ/Virtuozzo</entry>
</row>
@ -173,8 +173,8 @@
</table>
<para>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
"innermost" is detected and identified. That means if both
machine and container virtualization are used in
conjunction, only the latter will be identified (unless
<option>--vm</option> is passed).</para>
</refsect1>
@ -197,8 +197,7 @@
<term><option>-v</option></term>
<term><option>--vm</option></term>
<listitem><para>Only detects VM virtualization (i.e. full
hardware virtualization).</para></listitem>
<listitem><para>Only detects hardware virtualization).</para></listitem>
</varlistentry>
<varlistentry>

View File

@ -64,7 +64,7 @@
used to escape and to undo escaping of strings.</para>
<para>The command takes any number of strings on the command line,
and will process them individually, one after the other. It will
and will process them individually, one after another. It will
output them separated by spaces to stdout.</para>
<para>By default, this command will escape the strings passed,

View File

@ -193,7 +193,7 @@
</varlistentry>
<varlistentry>
<term><constant>application/event-stream</constant></term>
<term><constant>text/event-stream</constant></term>
<listitem><para>Entries are formatted as JSON data structures,
wrapped in a format suitable for <ulink

View File

@ -293,15 +293,24 @@ journalctl -o export | systemd-journal-remote -o /tmp/dir -
</programlisting>
</para>
<para>Retrieve events from a remote
<para>Retrieve all available events from a remote
<citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
instance and store them in
<filename>/var/log/journal/some.host/remote-some~host.journal</filename>:
<filename>/var/log/journal/remote/remote-some.host.journal</filename>:
<programlisting>
systemd-journal-remote --url http://some.host:19531/
</programlisting>
</para>
</refsect1>
<para>Retrieve current boot events and wait for new events from a remote
<citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
instance, and store them in
<filename>/var/log/journal/remote/remote-some.host.journal</filename>:
<programlisting>
systemd-journal-remote --url http://some.host:19531/entries?boot&amp;follow
</programlisting>
</para>
</refsect1>
<refsect1>
<title>See Also</title>

View File

@ -106,13 +106,6 @@
<programlisting>mkdir -p /var/log/journal
systemd-tmpfiles --create --prefix /var/log/journal</programlisting>
<para><filename>systemd-journald</filename> will forward all
received log messages to the
<constant>AF_UNIX</constant>/<constant>SOCK_DGRAM</constant>
socket <filename>/run/systemd/journal/syslog</filename>, if it
exists, which may be used by Unix syslog daemons to process the
data further.</para>
<para>See
<citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for information about the configuration of this service.</para>

View File

@ -248,16 +248,76 @@
<option>--ephemeral</option>.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-a</option></term>
<term><option>--as-pid2</option></term>
<listitem><para>Invoke the shell or specified program as process ID (PID) 2 instead of PID 1 (init). By
default, if neither this option nor <option>--boot</option> is used, the selected binary is run as process with
PID 1, a mode only suitable for programs that are aware of the special semantics that the process with PID 1
has on UNIX. For example, it needs to reap all processes reparented to it, and should implement
<command>sysvinit</command> compatible signal handling (specifically: it needs to reboot on SIGINT, reexecute
on SIGTERM, reload configuration on SIGHUP, and so on). With <option>--as-pid2</option> a minimal stub init
process is run as PID 1 and the selected binary is executed as PID 2 (and hence does not need to implement any
special semantics). The stub init process will reap processes as necessary and react appropriately to
signals. It is recommended to use this mode to invoke arbitrary commands in containers, unless they have been
modified to run correctly as PID 1. Or in other words: this switch should be used for pretty much all commands,
except when the command refers to an init or shell implementation, as these are generally capable of running
correctly as PID 1). This option may not be combined with <option>--boot</option> or
<option>--share-system</option>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-b</option></term>
<term><option>--boot</option></term>
<listitem><para>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 <option>--share-system</option>.
</para></listitem>
<listitem><para>Automatically search for an init binary and invoke it as PID 1, 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 <option>--as-pid2</option> or
<option>--share-system</option>.</para>
<para>The following table explains the different modes of invocation and relationship to
<option>--as-pid2</option> (see above):</para>
<table>
<title>Invocation Mode</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname="switch" />
<colspec colname="explanation" />
<thead>
<row>
<entry>Switch</entry>
<entry>Explanation</entry>
</row>
</thead>
<tbody>
<row>
<entry>Neither <option>--as-pid2</option> nor <option>--boot</option> specified</entry>
<entry>The passed parameters are interpreted as command line, which is executed as PID 1 in the container.</entry>
</row>
<row>
<entry><option>--as-pid2</option> specified</entry>
<entry>The passed parameters are interpreted as command line, which are executed as PID 2 in the container. A stub init process is run as PID 1.</entry>
</row>
<row>
<entry><option>--boot</option> specified</entry>
<entry>An init binary as automatically searched and run as PID 1 in the container. The passed parameters are used as invocation parameters for this process.</entry>
</row>
</tbody>
</tgroup>
</table>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--chdir=</option></term>
<listitem><para>Change to the specified working directory before invoking the process in the container. Expects
an absolute path in the container's file system namespace.</para></listitem>
</varlistentry>
<varlistentry>
@ -770,8 +830,8 @@
<option>yes</option>, full volatile mode is enabled. This
means the root directory is mounted as a mostly unpopulated
<literal>tmpfs</literal> instance, and
<filename>/usr</filename> from the OS tree is mounted into it,
read-only (the system thus starts up with read-only OS
<filename>/usr</filename> from the OS tree is mounted into it
in read-only mode (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 <option>state</option>, the OS tree is

View File

@ -60,7 +60,7 @@
<para><command>systemd-path</command> may be used to query system
and user paths. The tool makes many of the paths described in
<citerefentry><refentrytitle>file-hierarchy</refentrytitle><manvolnum>7</manvolnum></citerefentry>
queriable.</para>
available for querying.</para>
<para>When invoked without arguments, a list of known paths and
their current values is shown. When at least one argument is

277
man/systemd-resolve.xml Normal file
View File

@ -0,0 +1,277 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2016 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 <http://www.gnu.org/licenses/>.
-->
<refentry id="systemd-resolve"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>systemd-resolve</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>systemd-resolve</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>systemd-resolve</refname>
<refpurpose>Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<arg choice="plain" rep="repeat"><replaceable>HOSTNAME</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<arg choice="plain" rep="repeat"><replaceable>ADDRESS</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<command> --type=<replaceable>TYPE</replaceable></command>
<arg choice="plain" rep="repeat"><replaceable>RRDOMAIN</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<command> --service</command>
<arg choice="plain"><arg choice="opt"><arg choice="opt"><replaceable>NAME</replaceable></arg>
<replaceable>TYPE</replaceable></arg> <replaceable>DOMAIN</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<command> --statistics</command>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-resolve</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<command> --reset-statistics</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><command>systemd-resolve</command> may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource
records and services with the
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
resolver service. By default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4
and IPv6 addresses. If the parameters specified are formatted as IPv4 or IPv6 operation the reverse operation is
done, and a hostname is retrieved for the specified addresses.</para>
<para>The <option>--type=</option> switch may be used to specify a DNS resource record type (A, AAAA, SOA, MX, ...) in
order to request a specific DNS resource record, instead of the address or reverse address lookups.
The special value <literal>help</literal> may be used to list known values.</para>
<para>The <option>--service</option> switch may be used to resolve <ulink
url="https://tools.ietf.org/html/rfc2782">SRV</ulink> and <ulink
url="https://tools.ietf.org/html/rfc6763">DNS-SD</ulink> services (see below). In this mode, between one and three
arguments are required. If three parameters are passed the first is assumed to be the DNS-SD service name, the
second the SRV service type, and the third the domain to search in. In this case a full DNS-SD style SRV and TXT
lookup is executed. If only two parameters are specified, the first is assumed to be the SRV service type, and the
second the domain to look in. In this case no TXT RR is requested. Finally, if only one parameter is specified, it
is assumed to be a domain name, that is already prefixed with an SRV type, and an SRV lookup is done (no
TXT).</para>
<para>The <option>--statistics</option> switch may be used to show resolver statistics, including information about
the number of succesful and failed DNSSEC validations.</para>
<para>The <option>--reset-statistics</option> may be used to reset various statistics counters maintained the
resolver, including those shown in the <option>--statistics</option> output. This operation requires root
privileges.</para>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>-4</option></term>
<term><option>-6</option></term>
<listitem><para>By default, when resolving a hostname, both IPv4 and IPv6
addresses are acquired. By specifying <option>-4</option> only IPv4 addresses are requested, by specifying
<option>-6</option> only IPv6 addresses are requested.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-i</option> <replaceable>INTERFACE</replaceable></term>
<term><option>--interface=</option><replaceable>INTERFACE</replaceable></term>
<listitem><para>Specifies the network interface to execute the query on. This may either be specified as numeric
interface index or as network interface string (e.g. <literal>en0</literal>). Note that this option has no
effect if system-wide DNS configuration (as configured in <filename>/etc/resolv.conf</filename> or
<filename>/etc/systemd/resolve.conf</filename>) in place of per-link configuration is used.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-p</option> <replaceable>PROTOCOL</replaceable></term>
<term><option>--protocol=</option><replaceable>PROTOCOL</replaceable></term>
<listitem><para>Specifies the network protocol for the query. May be one of <literal>dns</literal>
(i.e. classic unicast DNS), <literal>llmnr</literal> (<ulink
url="https://tools.ietf.org/html/rfc4795">Link-Local Multicast Name Resolution</ulink>),
<literal>llmr-ipv4</literal>, <literal>llmnr-ipv6</literal> (LLMNR via the indicated underlying IP
protocols). By default the lookup is done via all protocols suitable for the lookup. If used, limits the set of
protocols that may be used. Use this option multiple times to enable resolving via multiple protocols at the
same time. The setting <literal>llmnr</literal> is identical to specifying this switch once with
<literal>llmnr-ipv4</literal> and once via <literal>llmnr-ipv6</literal>. Note that this option does not force
the service to resolve the operation with the specified protocol, as that might require a suitable network
interface and configuration.
The special value <literal>help</literal> may be used to list known values.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option> <replaceable>TYPE</replaceable></term>
<term><option>--type=</option><replaceable>TYPE</replaceable></term>
<term><option>-c</option> <replaceable>CLASS</replaceable></term>
<term><option>--class=</option><replaceable>CLASS</replaceable></term>
<listitem><para>Specifies the DNS resource record type (e.g. A, AAAA, MX, …) and class (e.g. IN, ANY, …) to
look up. If these options are used a DNS resource record set matching the specified class and type is
requested. The class defaults to IN if only a type is specified.
The special value <literal>help</literal> may be used to list known values.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--service</option></term>
<listitem><para>Enables service resolution. This enables DNS-SD and simple SRV service resolution, depending
on the specified list of parameters (see above).</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--service-address=</option><replaceable>BOOL</replaceable></term>
<listitem><para>Takes a boolean parameter. If true (the default), when doing a service lookup with
<option>--service</option> the hostnames contained in the SRV resource records are resolved as well.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--service-txt=</option><replaceable>BOOL</replaceable></term>
<listitem><para>Takes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with
<option>--service</option> the TXT service metadata record is resolved as well.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--cname=</option><replaceable>BOOL</replaceable></term>
<listitem><para>Takes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are
followed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error is
returned.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--search=</option><replaceable>BOOL</replaceable></term>
<listitem><para>Takes a boolean parameter. If true (the default), any specified single-label hostnames will be
searched in the domains configured in the search domain list, if it is non-empty. Otherwise, the search domain
logic is disabled.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--legend=</option><replaceable>BOOL</replaceable></term>
<listitem><para>Takes a boolean parameter. If true (the default), column headers and meta information about the
query response are shown. Otherwise, this output is suppressed.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--statistics</option></term>
<listitem><para>If specified general resolver statistics are shown, including information whether DNSSEC is
enabled and available, as well as resolution and validation statistics.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--reset-statistics</option></term>
<listitem><para>Resets the statistics counters shown in <option>--statistics</option> to zero.</para></listitem>
</varlistentry>
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
</variablelist>
</refsect1>
<refsect1>
<title>Examples</title>
<example>
<title>Retrieve the addresses of the <literal>www.0pointer.net</literal> domain</title>
<programlisting>$ systemd-resolve www.0pointer.net</programlisting>
</example>
<example>
<title>Retrieve the domain of the <literal>85.214.157.71</literal> IP address</title>
<programlisting>$ systemd-resolve 85.214.157.71</programlisting>
</example>
<example>
<title>Retrieve the MX record of the <literal>0pointer.net</literal> domain</title>
<programlisting>$ systemd-resolve -t MX 0pointer.net</programlisting>
</example>
<example>
<title>Resolve an SRV service</title>
<programlisting>$ systemd-resolve --service _xmpp-server._tcp gmail.com</programlisting>
</example>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -56,15 +56,15 @@
<refsect1>
<title>Description</title>
<para><command>systemd-resolved</command> 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
<filename>/run/systemd/resolve/resolv.conf</filename> for
compatibility which may be symlinked from
<filename>/etc/resolv.conf</filename>. The glibc NSS module
<citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is necessary to allow libc's NSS resolver functions to resolve
host names via <command>systemd-resolved</command>.</para>
<para><command>systemd-resolved</command> is a system service that provides network name resolution to local
applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR resolver and
responder. In addition it maintains the <filename>/run/systemd/resolve/resolv.conf</filename> file for
compatibility with traditional Linux programs. This file may be symlinked from
<filename>/etc/resolv.conf</filename>.</para>
<para>The glibc NSS module
<citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry> is required to
permit glibc's NSS resolver functions to resolve host names via <command>systemd-resolved</command>.</para>
<para>The DNS servers contacted are determined from the global
settings in <filename>/etc/systemd/resolved.conf</filename>, the
@ -87,15 +87,18 @@
is on the local loopback) and the IPv6 address ::1 (which is the
local host).</para></listitem>
<listitem><para>The hostname <literal>localhost</literal> is
resolved to the IP addresses 127.0.0.1 and
::1.</para></listitem>
<listitem><para>The hostname <literal>localhost</literal> (as well as any hostname ending in
<literal>.localhost</literal>, <literal>.localdomain</literal> or equal to <literal>localdomain</literal>) is
resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
<listitem><para>The hostname <literal>gateway</literal> 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.</para></listitem>
<listitem><para>The mappings defined in <filename>/etc/hosts</filename> are resolved to their configured
addresses and back.</para></listitem>
</itemizedlist>
<para>Lookup requests are routed to the available DNS servers
@ -104,7 +107,7 @@
<itemizedlist>
<listitem><para>Lookups for the special hostname
<literal>localhost</literal> are never routed to the
network.</para></listitem>
network. (A few other, special domains are handled the same way.)</para></listitem>
<listitem><para>Single-label names are routed to all local
interfaces capable of IP multicasting, using the LLMNR
@ -117,7 +120,7 @@
<listitem><para>Multi-label names are routed to all local
interfaces that have a DNS sever configured, plus the globally
configured DNS server if there is one. Address lookups from the
link-local addres range are never routed to
link-local address range are never routed to
DNS.</para></listitem>
</itemizedlist>
@ -133,10 +136,12 @@
per-interface domains are exclusively routed to the matching
interfaces.</para>
<para>Note that
<filename>/run/systemd/resolve/resolv.conf</filename> should not
be used directly, but only through a symlink from
<filename>/etc/resolv.conf</filename>.</para>
<para>Note that <filename>/run/systemd/resolve/resolv.conf</filename> should not be used directly by applications,
but only through a symlink from <filename>/etc/resolv.conf</filename>.</para>
<para>See the <ulink url="http://www.freedesktop.org/wiki/Software/systemd/resolved"> resolved D-Bus API
Documentation</ulink> for information about the APIs <filename>systemd-resolved</filename> provides.</para>
</refsect1>
<refsect1>
@ -144,7 +149,11 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>nss-resolve</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolve</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>hosts</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>

View File

@ -354,13 +354,26 @@
<listitem><para>These settings control various default
resource limits for units. See
<citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for details. Use the string <varname>infinity</varname> to
configure no limit on a specific resource. The multiplicative suffixes
K (=1024), M (=1024*1024) and so on for G, T, P and E may be used for
resource limits measured in bytes (e.g. DefaultLimitAS=16G). 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
for details. The resource limit is possible to specify in two formats,
<option>value</option> to set soft and hard limits to the same value,
or <option>soft:hard</option> to set both limits individually (e.g. DefaultLimitAS=4G:16G).
Use the string <varname>infinity</varname> to
configure no limit on a specific resource. The multiplicative
suffixes K (=1024), M (=1024*1024) and so on for G, T, P and E
may be used for resource limits measured in bytes
(e.g. DefaultLimitAS=16G). For the limits referring to time values,
the usual time units ms, s, min, h and so on may be used (see
<citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for details). Note that if no time unit is specified for
<varname>DefaultLimitCPU=</varname> the default unit of seconds is
implied, while for <varname>DefaultLimitRTTIME=</varname> the default
unit of microseconds is implied. Also, note that the effective
granularity of the limits might influence their
enforcement. For example, time limits specified for
<varname>DefaultLimitCPU=</varname> will be rounded up implicitly to
multiples of 1s. 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.</para></listitem>
</varlistentry>
</variablelist>

View File

@ -630,7 +630,10 @@
<listitem><para>These settings set both soft and hard limits
of various resources for executed processes. See
<citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for details. Use the string <varname>infinity</varname> to
for details. The resource limit is possible to specify in two formats,
<option>value</option> to set soft and hard limits to the same value,
or <option>soft:hard</option> to set both limits individually (e.g. LimitAS=4G:16G).
Use the string <varname>infinity</varname> to
configure no limit on a specific resource. The multiplicative
suffixes K (=1024), M (=1024*1024) and so on for G, T, P and E
may be used for resource limits measured in bytes
@ -803,6 +806,35 @@
settings.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>AmbientCapabilities=</varname></term>
<listitem><para>Controls which capabilities to include in the
ambient capability set for the executed process. Takes a
whitespace-separated list of capability names as read by
<citerefentry project='mankier'><refentrytitle>cap_from_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
e.g. <constant>CAP_SYS_ADMIN</constant>,
<constant>CAP_DAC_OVERRIDE</constant>,
<constant>CAP_SYS_PTRACE</constant>. This option may appear more than
once in which case the ambient capability sets are merged.
If the list of capabilities is prefixed with <literal>~</literal>, all
but the listed capabilities will be included, the effect of the
assignment inverted. If the empty string is
assigned to this option, the ambient capability set is reset to
the empty capability set, and all prior settings have no effect.
If set to <literal>~</literal> (without any further argument), the
ambient capability set is reset to the full set of available
capabilities, also undoing any previous settings. Note that adding
capabilities to ambient capability set adds them to the process's
inherited capability set.
</para><para>
Ambient capability sets are useful if you want to execute a process
as a non-privileged user but still want to give it some capabilities.
Note that in this case option <constant>keep-caps</constant> is
automatically added to <varname>SecureBits=</varname> to retain the
capabilities over the user change.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SecureBits=</varname></term>
<listitem><para>Controls the secure bits set for the executed
@ -1381,6 +1413,7 @@
<varlistentry>
<term><varname>$LISTEN_FDS</varname></term>
<term><varname>$LISTEN_PID</varname></term>
<term><varname>$LISTEN_FDNAMES</varname></term>
<listitem><para>Information about file descriptors passed to a
service for socket activation. See
@ -1388,6 +1421,24 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>$NOTIFY_SOCKET</varname></term>
<listitem><para>The socket
<function>sd_notify()</function> talks to. See
<citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>$WATCHDOG_PID</varname></term>
<term><varname>$WATCHDOG_USEC</varname></term>
<listitem><para>Information about watchdog keep-alive notifications. See
<citerefentry><refentrytitle>sd_watchdog_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>$TERM</varname></term>
@ -1402,8 +1453,8 @@
<para>Additional variables may be configured by the following
means: for processes spawned in specific units, use the
<varname>Environment=</varname> and
<varname>EnvironmentFile=</varname> options above; to specify
<varname>Environment=</varname>, <varname>EnvironmentFile=</varname>
and <varname>PassEnvironment=</varname> options above; to specify
variables globally, use <varname>DefaultEnvironment=</varname>
(see
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>)

View File

@ -164,13 +164,16 @@
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
<citerefentry
project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
or <command>systemd</command> itself (this means: no
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>!). They
can however rely on the most basic kernel functionality to
be available, including a mounted <filename>/sys</filename>,
<filename>/proc</filename>, <filename>/dev</filename>.
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>)!.
Non-essential file systems like
<filename>/var</filename> and <filename>/home</filename>
are mounted after generators have run. Generators
can however rely on the most basic kernel functionality to be
available, including a mounted <filename>/sys</filename>,
<filename>/proc</filename>, <filename>/dev</filename>,
<filename>/usr</filename>.
</para>
</listitem>
@ -315,7 +318,7 @@
</example>
<example>
<title>Debuging a generator</title>
<title>Debugging a generator</title>
<programlisting>dir=$(mktemp -d)
SYSTEMD_LOG_LEVEL=debug &systemgeneratordir;/systemd-fstab-generator \

View File

@ -88,7 +88,8 @@
configured in a unit file <filename>home-lennart.mount</filename>.
For details about the escaping logic used to convert a file system
path to a unit name, see
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
Note that mount units cannot be templated.</para>
<para>Optionally, a mount unit may be accompanied by an automount
unit, to allow on-demand or parallelized mounting. See

View File

@ -493,6 +493,25 @@
VXLAN Group Policy </ulink> document. Defaults to false.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>DestinationPort=</varname></term>
<listitem>
<para>Configures the default destination UDP port on a per-device basis.
If destination port is not specified then Linux kernel default will be used.
Set destination port 4789 to get the IANA assigned value,
and destination port 0 to get default values.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>PortRange=</varname></term>
<listitem>
<para>Configures VXLAN port range. VXLAN bases source
UDP port based on flow to help the receiver to be able
to load balance based on outer header flow. It
restricts the port range to the normal UDP local
ports, and allows overriding via configuration.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>

View File

@ -228,7 +228,7 @@
<literal>ipv4</literal>, or <literal>ipv6</literal>.</para>
<para>Note that DHCPv6 will by default be triggered by Router
Advertisment, if that is enabled, regardless of this parameter.
Advertisement, if that is enabled, regardless of this parameter.
By enabling DHCPv6 support explicitly, the DHCPv6 client will
be started regardless of the presence of routers on the link,
or what flags the routers pass. See
@ -277,10 +277,59 @@
<varlistentry>
<term><varname>LLMNR=</varname></term>
<listitem>
<para>A boolean or <literal>resolve</literal>. When true, enables
Link-Local Multicast Name Resolution on the link. When set to
<literal>resolve</literal>, only resolution is enabled, but not
announcement. Defaults to true.</para>
<para>A boolean or <literal>resolve</literal>. When true,
enables <ulink
url="https://tools.ietf.org/html/rfc4795">Link-Local
Multicast Name Resolution</ulink> on the link. When set to
<literal>resolve</literal>, only resolution is enabled,
but not host registration and announcement. Defaults to
true. This setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>MulticastDNS=</varname></term>
<listitem>
<para>A boolean or <literal>resolve</literal>. When true,
enables <ulink
url="https://tools.ietf.org/html/rfc6762">Multicast
DNS</ulink> support on the link. When set to
<literal>resolve</literal>, only resolution is enabled,
but not host or service registration and
announcement. Defaults to false. This setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>DNSSEC=</varname></term>
<listitem>
<para>A boolean or
<literal>allow-downgrade</literal>. When true, enables
<ulink
url="https://tools.ietf.org/html/rfc4033">DNSSEC</ulink>
DNS validation support on the link. When set to
<literal>allow-downgrade</literal>, compatibility with
non-DNSSEC capable networks is increased, by automatically
turning off DNSEC in this case. This option defines a
per-interface setting for
<citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>'s
global <varname>DNSSEC=</varname> option. Defaults to
false. This setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>DNSSECNegativeTrustAnchors=</varname></term>
<listitem><para>A space-separated list of DNSSEC negative
trust anchor domains. If specified and DNSSEC is enabled,
look-ups done via the interface's DNS server will be subject
to the list of negative trust anchors, and not require
authentication for the specified domains, or anything below
it. Use this to disable DNSSEC authentication for specific
private domains, that cannot be proven valid using the
Internet DNS hierarchy. Defaults to the empty list. This
setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -346,19 +395,38 @@
<para>A DNS server address, which must be in the format
described in
<citerefentry project='man-pages'><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
This option may be specified more than once.</para>
This option may be specified more than once. This setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Domains=</varname></term>
<listitem>
<para>The domains used for DNS resolution over this link.</para>
<para>The domains used for DNS host name resolution on this link. Takes a list of DNS domain names which
are used as search suffixes for extending single-label host names (host names containing no dots) to become
fully qualified domain names (FQDNs). If a single-label host name is resolved on this interface, each of
the specified search domains are appended to it in turn, converting it into a fully qualified domain name,
until one of them may be successfully resolved.</para>
<para>The specified domains are also used for routing of DNS queries: look-ups for host names ending in the
domains specified here are preferably routed to the DNS servers configured for this interface. If a domain
name is prefixed with <literal>~</literal>, the domain name becomes a pure "routing" domain, is used for
DNS query routing purposes only and is not used in the described domain search logic. By specifying a
routing domain of <literal>~.</literal> (the tilda indicating definition of a routing domain, the dot
referring to the DNS root domain which is the implied suffix of all valid DNS names) it is possible to
route all DNS traffic preferably to the DNS server specified for this interface. The route domain logic is
particularly useful on multi-homed hosts with DNS servers serving particular private DNS zones on each
interface.</para>
<para>This setting is read by
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>NTP=</varname></term>
<listitem>
<para>An NTP server address. This option may be specified more than once.</para>
<para>An NTP server address. This option may be specified more than once. This setting is read by
<citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -649,15 +717,20 @@
<varlistentry>
<term><varname>UseDomains=</varname></term>
<listitem>
<para>When true (not the default), the domain name
received from the DHCP server will be used for DNS
resolution over this link. When a name cannot be resolved
as specified, the domain name will be used a suffix and
name resolution of that will be attempted.</para>
<para>Takes a boolean argument, or a the special value <literal>route</literal>. When true, the domain name
received from the DHCP server will be used as DNS search domain over this link, similar to the effect of
the <option>Domains=</option> setting. If set to <literal>route</literal>, the domain name received from
the DHCP server will be used for routing DNS queries only, but not for searching, similar to the effect of
the <option>Domains=</option> setting when the argument is prefixed with <literal>~</literal>. Defaults to
false.</para>
<para>This corresponds to the <option>domain</option>
option in <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
and should not be enabled on untrusted networks.</para>
<para>It is recommended to enable this option only on trusted networks, as setting this affects resolution
of all host names, in particular to single-label names. It is generally safer to use the supplied domain
only as routing domain, rather than as search domain, in order to not have it affect local resolution of
single-label names.</para>
<para>When set to true, this setting corresponds to the <option>domain</option> option in <citerefentry
project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -673,7 +746,7 @@
<term><varname>UseTimezone=</varname></term>
<listitem><para>When true, the timezone received from the
DHCP server will be set as as timezone of the local
DHCP server will be set as timezone of the local
system. Defaults to <literal>no</literal>.</para></listitem>
</varlistentry>
@ -1011,9 +1084,10 @@ DHCP=yes
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
<citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -141,15 +141,21 @@
<varlistentry>
<term><varname>Boot=</varname></term>
<listitem><para>Takes a boolean argument, which defaults to off. If
enabled, <command>systemd-nspawn</command> will automatically
search for an <filename>init</filename> executable and invoke
it. In this case, the specified parameters using
<varname>Parameters=</varname> are passed as additional
arguments to the <filename>init</filename> process. This
setting corresponds to the <option>--boot</option> switch on
the <command>systemd-nspawn</command> command
line. </para></listitem>
<listitem><para>Takes a boolean argument, which defaults to off. If enabled, <command>systemd-nspawn</command>
will automatically search for an <filename>init</filename> executable and invoke it. In this case, the
specified parameters using <varname>Parameters=</varname> are passed as additional arguments to the
<filename>init</filename> process. This setting corresponds to the <option>--boot</option> switch on the
<command>systemd-nspawn</command> command line. This option may not be combined with
<varname>ProcessTwo=yes</varname>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ProcessTwo=</varname></term>
<listitem><para>Takes a boolean argument, which defaults to off. If enabled, the specified program is run as
PID 2. A stub init process is run as PID 1. This setting corresponds to the <option>--as-pid2</option> switch
on the <command>systemd-nspawn</command> command line. This option may not be combined with
<varname>Boot=yes</varname>.</para></listitem>
</varlistentry>
<varlistentry>
@ -186,13 +192,21 @@
switch.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>WorkingDirectory=</varname></term>
<listitem><para>Selects the working directory for the process invoked in the container. Expects an absolute
path in the container's file system namespace. This corresponds to the <option>--chdir=</option> command line
switch.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Capability=</varname></term>
<term><varname>DropCapability=</varname></term>
<listitem><para>Takes a space-separated list of Linux process
capabilities (see
<citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for details). The <varname>Capability=</varname> setting
specifies additional capabilities to pass on top of the
default set of capabilities. The

View File

@ -423,23 +423,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term><varname>NetClass=</varname></term>
<listitem><para>Configures a network class number to assign to the
unit. This value will be set to the
<literal>net_cls.class_id</literal> property of the
<literal>net_cls</literal> cgroup of the unit. The directive
accepts a numerical value (for fixed number assignment) and the keyword
<literal>auto</literal> (for dynamic allocation). Network traffic of
all processes inside the unit will have the network class ID assigned
by the kernel. Also see
the kernel docs for
<ulink url="https://www.kernel.org/doc/Documentation/cgroups/net_cls.txt">net_cls controller</ulink>
and
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Slice=</varname></term>
@ -459,6 +442,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.</para>
<para>Special care should be taken when relying on the default slice assignment in templated service units
that have <varname>DefaultDependencies=no</varname> set, see
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, section
"Automatic Dependencies" for details.</para>
</listitem>
</varlistentry>

View File

@ -113,6 +113,16 @@
involved with early boot or late system shutdown should disable
this option.</para>
<para>Instanced service units (i.e. service units with an <literal>@</literal> in their name) are assigned by
default a per-template slice unit (see
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>), named after the
template unit, containing all instances of the specific template. This slice is normally stopped at shutdown,
together with all template instances. If that is not desired, set <varname>DefaultDependencies=no</varname> in the
template unit, and either define your own per-template slice unit file that also sets
<varname>DefaultDependencies=no</varname>, or set <varname>Slice=system.slice</varname> (or another suitable slice)
in the template unit. Also see
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
<para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
@ -361,7 +371,7 @@
with a <literal>-</literal> exit successfully.</para>
<para><varname>ExecStartPost=</varname> commands are only run after
the service has started, as determined by <varname>Type=</varname>
the service has started successfully, as determined by <varname>Type=</varname>
(i.e. the process has been started for <varname>Type=simple</varname>
or <varname>Type=idle</varname>, the process exits successfully for
<varname>Type=oneshot</varname>, the initial process exits successfully
@ -373,6 +383,11 @@
used to start long-running processes. All processes forked
off by processes invoked via <varname>ExecStartPre=</varname> will
be killed before the next service process is run.</para>
<para>Note that if any of the commands specified in <varname>ExecStartPre=</varname>,
<varname>ExecStart=</varname>, or <varname>ExecStartPost=</varname> fail (and are not prefixed with
<literal>-</literal>, see above) or time out before the service is fully up, execution continues with commands
specified in <varname>ExecStopPost=</varname>, the commands in <varname>ExecStop=</varname> are skipped.</para>
</listitem>
</varlistentry>
@ -428,21 +443,36 @@
<constant>SIGKILL</constant> immediately after the command
exited, this would not result in a clean stop. The specified
command should hence be a synchronous operation, not an
asynchronous one.</para></listitem>
asynchronous one.</para>
<para>Note that the commands specified in <varname>ExecStop=</varname> are only executed when the service
started successfuly first. They are not invoked if the service was never started at all, or in case its
start-up failed, for example because any of the commands specified in <varname>ExecStart=</varname>,
<varname>ExecStartPre=</varname> or <varname>ExecStartPost=</varname> failed (and weren't prefixed with
<literal>-</literal>, see above) or timed out. Use <varname>ExecStopPost=</varname> to invoke commands when a
service failed to start up correctly and is shut down again.</para>
<para>It is recommended to use this setting for commands that communicate with the service requesting clean
termination. When the commands specified with this option are executed it should be assumed that the service is
still fully up and is able to react correctly to all commands. For post-mortem clean-up steps use
<varname>ExecStopPost=</varname> instead.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ExecStopPost=</varname></term>
<listitem><para>Additional commands that are executed after
the service was stopped. This includes cases where the
commands configured in <varname>ExecStop=</varname> were used,
where the service does not have any
<varname>ExecStop=</varname> defined, or where the service
exited unexpectedly. This argument takes multiple command
lines, following the same scheme as described for
<varname>ExecStart=</varname>. Use of these settings is
optional. Specifier and environment variable substitution is
supported.</para></listitem>
<listitem><para>Additional commands that are executed after the service is stopped. This includes cases where
the commands configured in <varname>ExecStop=</varname> were used, where the service does not have any
<varname>ExecStop=</varname> defined, or where the service exited unexpectedly. This argument takes multiple
command lines, following the same scheme as described for <varname>ExecStart=</varname>. Use of these settings
is optional. Specifier and environment variable substitution is supported. Note that unlike
<varname>ExecStop=</varname> commands specified with this setting are invoked when a service failed to start
up correctly and is shut down again.</para>
<para>It is recommended to use this setting for clean-up operations that shall be executed even when the
service failed to start up correctly. Commands configured with this setting need to be able to operate even if
the service failed starting up half-way and left incompletely initialized data around. As the service's
processes have been terminated already when the commands specified with this setting are executed they should
not attempt to communicate with them.</para></listitem>
</varlistentry>
<varlistentry>
@ -460,7 +490,7 @@
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
<literal>0</literal> to disable the timeout logic. Defaults to
<literal>infinity</literal> to disable the timeout logic. Defaults to
<varname>DefaultTimeoutStartSec=</varname> from the manager
configuration file, except when
<varname>Type=oneshot</varname> is used, in which case the
@ -479,7 +509,7 @@
<varname>KillMode=</varname> in
<citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
Takes a unit-less value in seconds, or a time span value such
as "5min 20s". Pass <literal>0</literal> to disable the
as "5min 20s". Pass <literal>infinity</literal> to disable the
timeout logic. Defaults to
<varname>DefaultTimeoutStopSec=</varname> from the manager
configuration file (see
@ -495,6 +525,16 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>RuntimeMaxSec=</varname></term>
<listitem><para>Configures a maximum time for the service to run. If this is used and the service has been
active for longer than the specified time it is terminated and put into a failure state. Note that this setting
does not have any effect on <varname>Type=oneshot</varname> services, as they terminate immediately after
activation completed. Pass <literal>infinity</literal> (the default) to configure no runtime
limit.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>WatchdogSec=</varname></term>
<listitem><para>Configures the watchdog timeout for a service.
@ -506,7 +546,8 @@
larger than the configured time, then the service is placed in
a failed state and it will be terminated with
<constant>SIGABRT</constant>. By setting
<varname>Restart=</varname> to <option>on-failure</option> or
<varname>Restart=</varname> to <option>on-failure</option>,
<option>on-watchdog</option>, <option>on-abnormal</option> or
<option>always</option>, the service will be automatically
restarted. The time configured here will be passed to the
executed service process in the
@ -521,7 +562,9 @@
check whether the service manager expects watchdog keep-alive
notifications. See
<citerefentry><refentrytitle>sd_watchdog_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for details.
for details.
<citerefentry><refentrytitle>sd_event_set_watchdog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
may be used to enable automatic watchdog notification support.
</para></listitem>
</varlistentry>
@ -678,8 +721,10 @@
<constant>SIGPIPE</constant>. Exit status definitions can
either be numeric exit codes or termination signal names,
separated by spaces. For example:
<programlisting>SuccessExitStatus=1 2 8
SIGKILL</programlisting> ensures that exit codes 1, 2, 8 and
<programlisting>SuccessExitStatus=1 2 8 SIGKILL</programlisting>
ensures that exit codes 1, 2, 8 and
the termination signal <constant>SIGKILL</constant> are
considered clean service terminations.
</para>
@ -711,14 +756,16 @@
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:
<programlisting>RestartPreventExitStatus=1 6
SIGABRT</programlisting> ensures that exit codes 1 and 6 and
the termination signal <constant>SIGABRT</constant> 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.</para></listitem>
<programlisting>RestartPreventExitStatus=1 6 SIGABRT</programlisting>
ensures that exit codes 1 and 6 and the termination signal
<constant>SIGABRT</constant> 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.</para></listitem>
</varlistentry>
<varlistentry>
@ -826,86 +873,12 @@
effect.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>StartLimitInterval=</varname></term>
<term><varname>StartLimitBurst=</varname></term>
<listitem><para>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
<varname>StartLimitInterval=</varname> to configure the
checking interval (defaults to
<varname>DefaultStartLimitInterval=</varname> in manager
configuration file, set to 0 to disable any kind of rate
limiting). Use <varname>StartLimitBurst=</varname> to
configure how many starts per interval are allowed (defaults
to <varname>DefaultStartLimitBurst=</varname> in manager
configuration file). These configuration options are
particularly useful in conjunction with
<varname>Restart=</varname>; however, they apply to all kinds
of starts (including manual), not just those triggered by the
<varname>Restart=</varname> logic. Note that units which are
configured for <varname>Restart=</varname> 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 <command>systemctl reset-failed</command>
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.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>StartLimitAction=</varname></term>
<listitem><para>Configure the action to take if the rate limit
configured with <varname>StartLimitInterval=</varname> and
<varname>StartLimitBurst=</varname> is hit. Takes one of
<option>none</option>,
<option>reboot</option>,
<option>reboot-force</option>,
<option>reboot-immediate</option>,
<option>poweroff</option>,
<option>poweroff-force</option> or
<option>poweroff-immediate</option>. If
<option>none</option> is set, hitting the rate limit will
trigger no action besides that the start will not be
permitted. <option>reboot</option> causes a reboot following
the normal shutdown procedure (i.e. equivalent to
<command>systemctl reboot</command>).
<option>reboot-force</option> causes a forced reboot which
will terminate all processes forcibly but should cause no
dirty file systems on reboot (i.e. equivalent to
<command>systemctl reboot -f</command>) and
<option>reboot-immediate</option> causes immediate execution
of the
<citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
system call, which might result in data loss. Similarly,
<option>poweroff</option>, <option>poweroff-force</option>,
<option>poweroff-immediate</option> have the effect of
powering down the system with similar semantics. Defaults to
<option>none</option>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>FailureAction=</varname></term>
<listitem><para>Configure the action to take when the service
enters a failed state. Takes the same values as
<varname>StartLimitAction=</varname> and executes the same
actions. Defaults to <option>none</option>. </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>RebootArgument=</varname></term>
<listitem><para>Configure the optional argument for the
<citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
system call if <varname>StartLimitAction=</varname> or
<varname>FailureAction=</varname> is a reboot action. This
works just like the optional argument to <command>systemctl
reboot</command> command.</para></listitem>
<listitem><para>Configure the action to take when the service enters a failed state. Takes the same values as
the unit setting <varname>StartLimitAction=</varname> and executes the same actions (see
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). Defaults to
<option>none</option>. </para></listitem>
</varlistentry>
<varlistentry>

View File

@ -310,6 +310,15 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SocketProtocol=</varname></term>
<listitem><para>Takes a one of <option>udplite</option>
or <option>sctp</option>. Specifies a socket protocol
(<constant>IPPROTO_UDPLITE</constant>) UDP-Lite
(<constant>IPPROTO_SCTP</constant>) SCTP socket respectively. </para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>BindIPv6Only=</varname></term>
<listitem><para>Takes a one of <option>default</option>,

View File

@ -92,6 +92,7 @@
<filename>shutdown.target</filename>,
<filename>sigpwr.target</filename>,
<filename>sleep.target</filename>,
<filename>slices.target</filename>,
<filename>smartcard.target</filename>,
<filename>sockets.target</filename>,
<filename>sound.target</filename>,
@ -203,12 +204,22 @@
<varlistentry>
<term><filename>emergency.target</filename></term>
<listitem>
<para>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
<varname>systemd.unit=</varname> and has otherwise little
use.
</para>
<para>A special target unit that starts an emergency shell on the main console. This target does not pull in
any serices or mounts. It is the most minimal version of starting the system in order to acquire an
interactive shell; the only processes running are usually just the system manager (PID 1) and the shell
process. This unit is supposed to be used with the kernel command line option
<varname>systemd.unit=</varname>; it is also used when a file system check on a required file system fails,
and boot-up cannot continue. Compare with <filename>rescue.target</filename>, which serves a similar purpose,
but also starts the most basic services and mounts all file systems.</para>
<para>Use the <literal>systemd.unit=emergency.target</literal> kernel command line option to boot into this
mode. A short alias for this kernel command line option is <literal>emergency</literal>, for compatibility
with SysV.</para>
<para>In many ways booting into <filename>emergency.target</filename> is similar to the effect of booting
with <literal>init=/bin/sh</literal> on the kernel command line, except that emergency mode provides you with
the full system and service manager, and allows starting individual units in order to continue the boot
process in steps.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -439,11 +450,18 @@
<varlistentry>
<term><filename>rescue.target</filename></term>
<listitem>
<para>A special target unit for setting up the base system
and a rescue shell.</para>
<para>A special target unit that pulls in the base system (including system mounts) and spawns a rescue
shell. Isolate to this target in order to administer the system in single-user mode with all file systems
mounted but with no services running, except for the most basic. Compare with
<filename>emergency.target</filename>, which is much more reduced and does not provide the file systems or
most basic services.</para>
<para><filename>runlevel1.target</filename> is an alias for
this target unit, for compatibility with SysV.</para>
<para><filename>runlevel1.target</filename> is an alias for this target unit, for compatibility with
SysV.</para>
<para>Use the <literal>systemd.unit=rescue.target</literal> kernel command line option to boot into this
mode. A short alias for this kernel command line option is <literal>1</literal>, for compatibility with
SysV.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -502,11 +520,24 @@
hook units into the sleep state logic.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>slices.target</filename></term>
<listitem>
<para>A special target unit that sets up all slice units (see
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
details) that shall be active after boot. By default the generic <filename>user.slice</filename>,
<filename>system.slice</filename>, <filename>machines.slice</filename> slice units, as well as the the root
slice unit <filename>-.slice</filename> are pulled in and ordered before this unit (see below).</para>
<para>It's a good idea to add <varname>WantedBy=slices.target</varname> lines to the <literal>[Install]</literal>
section of all slices units that may be installed dynamically.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>sockets.target</filename></term>
<listitem>
<para>A special target unit that sets up all socket
units.(see
units (see
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details) that shall be active after boot.</para>
@ -587,7 +618,7 @@
<varlistentry>
<term><filename>umount.target</filename></term>
<listitem>
<para>A special target unit that umounts all mount and
<para>A special target unit that unmounts all mount and
automount points on system shutdown.</para>
<para>Mounts that shall be unmounted on system shutdown

View File

@ -229,6 +229,10 @@
the value and all values plus multiples of the repetition value
are matched.</para>
<para>The seconds component may contain decimal fractions both in
the value and the repetition. All fractions are rounded to 6
decimal places.</para>
<para>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, <literal>:00</literal> is
@ -276,6 +280,7 @@ Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03
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
05:40:23.4200004/3.1700005 → 05:40:23.420000/3.170001
2003-03-05 05:40 UTC → 2003-03-05 05:40:00 UTC
2003-03-05 → 2003-03-05 00:00:00
03-05 → *-03-05 00:00:00

Some files were not shown because too many files have changed in this diff Show More