summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* os-util: add helpers for finding /etc/os-releaseLennart Poettering2018-08-24
| | | | | Place this new helpers in a new source file os-util.[ch], and move the existing and related call path_is_os_tree() to it as well.
* fileio: add parse_env_filev() that is like parse_env_file() but takes a va_listLennart Poettering2018-08-24
|
* fileio: accept FILE* in addition to path in parse_env_file()Lennart Poettering2018-08-24
| | | | | | | Most our other parsing functions do this, let's do this here too, internally we accept that anyway. Also, the closely related load_env_file() and load_env_file_pairs() also do this, so let's be systematic.
* process-util: add a new FORK_MOUNTNS_SLAVE flag for safe_fork()Lennart Poettering2018-08-24
| | | | | | | | We already have a flag for creating a new mount namespace for the child. Let's add an extension to that: a new FORK_MOUNTNFS_SLAVE flag. When used in combination will mark all mounts in the child namespace as MS_SLAVE so that the child can freely mount or unmount stuff but it won't leak into the parent.
* fd-util: add new helper call fd_duplicate_data_fd()Lennart Poettering2018-08-24
| | | | | | | | | | | | This call creates an fd from another fd containing the same data. Specifically, repeated read() on the returned fd should return the same data as the original fd. This call is useful when we want to copy data out of disk images and suchlike, and want to be pass fds with the data around without having to keep the disk image continously mounted. The implementation tries to be somewhat smart and tries to prefer memfds/pipes over files in /tmp or /var/tmp based on the size of the data, but has appropropriate fallbacks in place.
* basic: fix raw_clone() on 32-bit sparcMike Gilbert2018-08-24
| | | | | | | The clone syscall uses the same semantics as on 64-bit. The trap number for syscall entry is different. Bug: https://bugs.gentoo.org/656368
* load-fragment: allow to specify RestrictNamespaces= multiple timesYu Watanabe2018-08-24
| | | | | If multiple RestrictNamespaces= settings are set, then merge the settings. This also drops supporting "~yes" and "~no".
* nsflsgs: drop namespace_flag_{from,to}_string()Yu Watanabe2018-08-24
| | | | | | This also drops namespace_flag_to_string_many_with_check(), and renames namespace_flag_{from,to}_string_many() to namespace_flags_{from,to}_string().
* nsflags: drop namespace_flag_to_string_many_with_check()Yu Watanabe2018-08-24
| | | | | We always ignore the unused bits. So, it is not necessary to check them.
* logind: let's change the type of the runtime directory size to uint64_tLennart Poettering2018-08-24
| | | | | | | Externally it's an uint64_t anyway, and internally we most just initialize it to physical_memory() which returns uint64_t, hence there's exactly zero value in using it as size_t internally. Hence, let's fix that, and use uint64_t everywhere.
* util: add debug logging to system_tasks_max()Lennart Poettering2018-08-24
| | | | | We should always do debug logging when we eat up error conditions. Let's do so here too.
* util: fix physical_memory() to work correctly on cgroupsv2Lennart Poettering2018-08-24
| | | | | | | Let's look into the right cgroupsv2 attribute. Also, while we are at it, add debug logging for all error conditions we eat up silently otherwise.
* update TODOLennart Poettering2018-08-24
|
* nspawn: make sure our container PID 1 keeps logging to the original stderr ↵Lennart Poettering2018-08-24
| | | | | | | | | | | | | | | | | | as long as possible If we log to the pty that is configured as stdin/stdout/stderr of the container too early we risk filling it up in full before we start processing the pty from the parent process, resulting in deadlocks. Let's hence keep a copy of the original tty we were started on before setting up stdin/stdout/stderr, so that we can log to it, and keep using it as long as we can. Since the kernel's pty internal buffer is pretty small this actually triggered deadlocks when we debug logged at lot from nspawn's child processes, see: https://github.com/systemd/systemd/pull/9024#issuecomment-390403674 With this change we won't use the pty at all, only the actual payload we start will, and hence we won't deadlock on it, ever.
* doc: mention in NEWS that AF_INET{,6} are dropped from logindYu Watanabe2018-08-24
| | | | Closes #9072.
* timesync,shared: move logic requesting bus name to sharedYu Watanabe2018-08-24
| | | | | Preparation for setting DynamicUser= to other services which request bus names.
* core: support unit specifiers in IODeviceWeight= and friendsYu Watanabe2018-08-24
|
* tree-wide: remove some double newlines in headers, tooLennart Poettering2018-08-24
|
* find-double-newline: look in headers tooLennart Poettering2018-08-24
|
* conf-parser: make use of free_and_replace() at one more placeLennart Poettering2018-08-24
|
* tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-08-24
| | | | | | | | | | | This makes most header files easier to look at. Also Emacs gets really slow when browsing through large sections of overly long prototypes, which is much improved by this macro. We should probably not do something similar with too many other cases, as macros like this might help readability for some, but make it worse for others. But I think given the complexity of this specific prototype and how often we use it, it's worth doing.
* config-parser: introduce new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-08-24
| | | | | | | | | | | | | | This builds on the previous GENERIC_PARSER_ARGS macro work. I think in general it is a better idea to declare macros that generate full C statements instead of just parts of them, hence, let's introduce CONFIG_PARSER_PROTOTYPE() which defines a full C function prototype, instead of the pre-existing way of defining the C function prototype manually, but then using GENERIC_PARSER_ARGS to define its arguments. This doesn't drop GENERIC_PARSER_ARGS though, but renames it to CONFIG_PARSER_ARGUMENTS, and changes the ConfigParserCallback function type to use it. The new name follows more closely how the other symbols in the header are named.
* basic/rm-rf: include the path in error messagesZbigniew Jędrzejewski-Szmek2018-08-24
| | | | Attempted to remove disk file system under "/tmp/systemd-temporary-aWPkbQ", and we can't allow that.
* tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() ↵Lennart Poettering2018-08-24
| | | | macro
* string-table: add new DUMP_STRING_TABLE() macroLennart Poettering2018-08-24
| | | | | | | | | | | The macro is inspired by the other string table macros, and takes the same arguments in the same order and dumps a string table to stdout. Since it's typesafe it's nice to implement this as macro rather than regular function. This new macro is useful for implementing commands such as "systemctl -t help" and similar, i.e. wherever we want to dump all values of an enum to stdout.
* test-sizeof: show that a small 64 field is not enough to force the enum to ↵Zbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | | be 64 bits On both 32 and 64 bits, the result is: enum Enum → 32 bits, unsigned enum BigEnum → 32 bits, unsigned enum BigEnum2 → 64 bits, unsigned big_enum2_pos → 4 big_enum2_neg → 8 The last two lines show that even if the enum is 64 bit, and the field of an enum is defined with UINT64_C(), the field can still be smaller.
* rpm: add macros for common configuration dirsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | %_environmnentdir /usr/lib/environment.d %_modulesloaddir /usr/lib/modules-load.d %_modprobedir /usr/lib/modprobe.d This makes installing files there more convenient because people don't need to construct the path from %_prefix/lib/… . See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
* rpm: add macros for common configuration dirsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | %_environmnentdir /usr/lib/environment.d %_modulesloaddir /usr/lib/modules-load.d %_modprobedir /usr/lib/modprobe.d This makes installing files there more convenient because people don't need to construct the path from %_prefix/lib/… . See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/.
* fs-util: don't alter errno in unlink_tempfilep()Lennart Poettering2018-08-24
| | | | | | | | | | | Functions whose only purpose is to be used with _cleanup_() should not touch errno, so that failing removals do not alter errno at unexpected places. This is already done in unlink_and_freep(), rmdir_and_freep(), rm_rf_physical_and_freep(), hence do so for unlink_tempfilep(), too. Follow-up for #9013
* meson: use run_target for generating tags with ctagsEvegeny Vereshchagin2018-08-24
| | | | | | | | | | In https://github.com/systemd/systemd/pull/6561, `run_target` was changed to `custom_target`, which inadvertently caused relative paths to be passed to ctags due to https://github.com/mesonbuild/meson/issues/3589. The switch to `run_target` causes absolute paths to be passed again and makes it easier to jump from file to file, hopefully delaying the need to exit Vim :-)
* Use STRLEN in two placesZbigniew Jędrzejewski-Szmek2018-08-24
|
* test-copy: remove unnecessary initializationZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | Initializing just some of the values doesn't make sense. We should handle them all in the same way. In those tests there are no jumps, all steps are covered with assert_se(), so we know everything will be set if we get to the end of the function. And _not_ initializing those variables has the advantage that it allows valgrind to catch potential initalization errors in the function being tested.
* tree-wide: do not wrap assert_se in extra parenthesesZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | We were inconsitently using them in some cases, but in majority not. Using assignment in assert_se is very common, not an exception like in 'if', so let's drop the extra parens everywhere.
* core/mount-setup: remove part of check which is always trueZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | f1470e424b2b5337e3c383d68dc5a26af1ff4ce6 removed one check, but missed a similar one a few lines down. CID #1390949.
* login: use BUS_DEFINE_PROPERTY_GET* macrosYu Watanabe2018-08-24
|
* bus-util: add more macros for defining functions of getting dbus propertiesYu Watanabe2018-08-24
|
* fs-util,test: add helper to remove tempfilesZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | This simplifies the use of tempfiles in tests and fixes "leaked" temporary files in test-fileio, test-catalog, test-conf-parser. Not the whole tree is converted.
* path-util: one more empty_or_root() changeLennart Poettering2018-08-24
|
* process-util: add new helper call for adjusting the OOM scoreLennart Poettering2018-08-24
| | | | And let's make use of it in execute.c
* basic: split parsing of the OOM score adjust value into its own function in ↵Lennart Poettering2018-08-24
| | | | | | | | | | parse-util.c And port config_parse_exec_oom_score_adjust() over to use it. While we are at it, let's also fix config_parse_exec_oom_score_adjust() to accept an empty string for turning off OOM score adjustments set earlier.
* conf-parser: shorten config_parse_string() by using free_and_strdup() and ↵Lennart Poettering2018-08-24
| | | | empty_to_null()
* basic: be more careful when closing fds based on RLIMIT_NOFILELennart Poettering2018-08-24
| | | | | Let's make sure we properly handle cases where RLIMIT_NOFILE is set to infinity, zero or values outside of the "int" range.
* core: move config_parse_limit() to the generic conf-parser.[ch]Lennart Poettering2018-08-24
| | | | | | | That way we can use it in nspawn. Also, while we are at it, let's rename the call config_parse_rlimit(), i.e. insert the "r", to clarify what kind of limit this is about.
* rlimit-util: rework rlimit_{from|to}_string() to work without "Limit" prefixLennart Poettering2018-08-24
| | | | | let's make the call more generic, so that we can also easily use it for parsing "RLIMIT_xyz" style constants.
* inhibit: use pager for systemd-inhibit --listDavid Tardon2018-08-24
|
* Turn VALGRIND variable into a meson configuration switchZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Configuration through environment variable is inconvenient with meson, because they cannot be convieniently changed and/or are not preserved during reconfiguration (https://github.com/mesonbuild/meson/issues/1503). This adds -Dvalgrind=true/false, which has the advantage that it can be set at any time with meson configure -Dvalgrind=... and ninja will rebuild targets as necessary. Additional minor advantages are better consistency with the options for hashmap debugging, and typo avoidance with '#if' instead of '#ifdef'.
* core: Break circular dependency between unit.h and cgroup.hFelipe Sateler2018-08-24
|
* meson: use array type optionYu Watanabe2018-08-24
| | | | Array type option is supported since 0.44.0.
* meson: use warning() methodYu Watanabe2018-08-24
| | | | | This bumps the required minimum version of meson to 0.44, as `warning()` method is supported since 0.44.
* meson: use get_supported_arguments()Yu Watanabe2018-08-24
| | | | | This bumps the required minimum version of meson to 0.43, as `get_supported_arguments()` is supported since meson-0.43.