summaryrefslogtreecommitdiffstats
path: root/src/shared/conf-parser.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* conf-parser: introduce config_parse_in_addr_non_null()Yu Watanabe2021-05-181-0/+1
|
* core: fix mtime calculation of dropin filesZbigniew Jędrzejewski-Szmek2021-03-041-1/+1
| | | | | | | | | | | | | | | | | Nominally, the bug was in unit_load_dropin(), which just took the last mtime instead of calculating the maximum. But instead of adding code to wrap the loop, this patch goes in the other direction. All (correct) callers of config_parse() followed a very similar pattern to calculate the maximum mtime. So let's simplify things by making config_parse() assume that mtime is initialized and update it to the maximum. This makes all the callers that care about mtime simpler and also fixes the issue in unit_load_dropin(). config_parse_many_nulstr() and config_parse_many() are different, because it makes sense to call them just once, and current ret_mtime behaviour make sense. Fixes #17730, https://bugzilla.redhat.com/show_bug.cgi?id=1933137.
* shared/conf-parser: allow more than one location of the main config fileZbigniew Jędrzejewski-Szmek2021-02-211-1/+1
| | | | No functional change as long as only one path is passed.
* conf-parser: use return codes in xxx_from_string()Yu Watanabe2021-02-111-7/+10
| | | | Follow-up for #11484.
* oom: rework *MemoryPressureLimit= properties to have 1/10000 precisionAnita Zhang2021-02-031-0/+1
| | | | | | | Requested in https://github.com/systemd/systemd/pull/15206#discussion_r505506657, preserve the full granularity for memory pressure limits (permyriad) instead of capping out at percent.
* Merge pull request #17478 from yuwata/split-network-internalYu Watanabe2020-11-271-0/+2
|\ | | | | libsystemd-network: split network-internal.c
| * libsystemd-network: move config_parse_hwaddr() and config_parse_hwaddrs()Yu Watanabe2020-10-291-0/+2
| |
* | tree-wide: fix "a the" or "the a"Yu Watanabe2020-11-131-1/+1
| |
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|/
* conf-parser: add a flavour of DEFINE_CONFIG_PARSE_ENUM() that allows ↵Lennart Poettering2020-10-271-2/+5
| | | | specifiying the precie from_string() function to call
* systemd-oomd: manager/daemonAnita Zhang2020-10-081-0/+1
|
* Use extract_first_word() in generated conf parsersZbigniew Jędrzejewski-Szmek2020-09-091-16/+18
|
* network: downgrade log level in conf parsersYu Watanabe2020-07-161-7/+7
|
* core: remove support for ".include" stanzaLennart Poettering2020-06-031-2/+1
| | | | | | | | | | Six years ago we declared it obsolete and removed it from the docs (c073a0c4a5ffbf6677dd6af02e7c7d59b2b901ab) and added a note about it in NEWS. Two years ago we add warning messages about it, indicating the feature will be removed (41b283d0f1f4abd85d0bbeeb7f71bb30f87cfab9) and mentioned it in NEWS again. Let's now kill it for good.
* conf-parser: return mtime in config_parse() and friendsLennart Poettering2020-06-021-4/+7
| | | | | | | | | | | | | This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86. Instead of reading the mtime off the configuration files after reading, let's do so before reading, but with the fd we read the data from. This is not only cleaner (as it allows us to save one stat()), but also has the benefit that we'll detect changes that happen while we read the files. This also reworks unit file drop-ins to use the common code for determining drop-in mtime, instead of reading system clock for that.
* network: also read mtime of drop-in configsYu Watanabe2020-06-011-1/+2
| | | | Fixes #15521.
* repart: Add UUID option to config filesTobias Hunger2020-05-251-0/+1
| | | | | Add a option to provide a UUID for the partition that will get created and document that.
* network: allow setting VLAN protocol on bridgesRubens Figueiredo2020-05-141-0/+1
| | | | Signed-off-by: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
* Merge pull request #14368 from poettering/repartZbigniew Jędrzejewski-Szmek2020-01-231-0/+1
|\
| * conf-parser: add parser for 32bit signed integersLennart Poettering2020-01-201-0/+1
| |
* | network,udev: use uint64_t for bit rateYu Watanabe2020-01-211-1/+1
|/ | | | Fixes #14620.
* udev: support AlternativeName= setting in .link fileYu Watanabe2019-12-161-0/+1
|
* shared/conf-parser: document what the flags doZbigniew Jędrzejewski-Szmek2019-11-221-3/+3
|
* shared/conf-parser: turn CONFIG_PARSE_REFUSE_BOM flag into a local variableZbigniew Jędrzejewski-Szmek2019-11-221-1/+0
| | | | This is an internal implementation detail.
* service: handle abort stops with dedicated timeoutJan Klötzke2019-04-121-0/+1
| | | | | | | | | | | | | | | | | When shooting down a service with SIGABRT the user might want to have a much longer stop timeout than on regular stops/shutdowns. Especially in the face of short stop timeouts the time might not be sufficient to write huge core dumps before the service is killed. This commit adds a dedicated (Default)TimeoutAbortSec= timer that is used when stopping a service via SIGABRT. In all other cases the existing TimeoutStopSec= is used. The timer value is unset by default to skip the special handling and use TimeoutStopSec= for state 'stop-watchdog' to keep the old behaviour. If the service is in state 'stop-watchdog' and the service should be stopped explicitly we still go to 'stop-sigterm' and re-apply the usual TimeoutStopSec= timeout.
* time-util: Introduce parse_sec_def_infinityFilipe Brandenburger2019-02-141-0/+1
| | | | | | | | | | | | | This works like parse_sec() but defaults to USEC_INFINITY when passed an empty string or only whitespace. Also introduce config_parse_sec_def_infinity, which can be used to parse config options using this function. This is useful for time options that use "infinity" for default and that can be reset by unsetting them. Introduce a test case to ensure it works as expected.
* core: remove JoinControllers= configuration settingLennart Poettering2018-11-161-1/+0
| | | | | | | | | | | | | | | | This removes the ability to configure which cgroup controllers to mount together. Instead, we'll now hardcode that "cpu" and "cpuacct" are mounted together as well as "net_cls" and "net_prio". The concept of mounting controllers together has no future as it does not exist to cgroupsv2. Moreover, the current logic is systematically broken, as revealed by the discussions in #10507. Also, we surveyed Red Hat customers and couldn't find a single user of the concept (which isn't particularly surprising, as it is broken...) This reduced the (already way too complex) cgroup handling for us, since we now know whenever we make a change to a cgroup for one controller to which other controllers it applies.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-4/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: unify how we define bit mak enumsLennart Poettering2018-06-121-4/+4
| | | | | | Let's always write "1 << 0", "1 << 1" and so on, except where we need more than 31 flag bits, where we write "UINT64(1) << 0", and so on to force 64bit values.
* conf-parser: add config_parse_permille()Marc Kleine-Budde2018-06-091-0/+1
|
* conf-parser: introduce DEFINE_CONFIG_PARSE*() macrosYu Watanabe2018-05-311-10/+74
| | | | | | | | This introduces several macros for defining config parsers. Also this fixes errno in DEFINE_CONFIG_PARSE_ENUM() and _ENUMV() and makes the log level lower when a duplicated item is specified to the settings parsed by the function defined by DEFINE_CONFIG_PARSE_ENUMV().
* conf-parser: make use of free_and_replace() at one more placeLennart Poettering2018-05-221-4/+1
|
* config-parser: introduce new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-05-221-53/+50
| | | | | | | | | | | | | | 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.
* core: move config_parse_limit() to the generic conf-parser.[ch]Lennart Poettering2018-05-171-0/+1
| | | | | | | 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.
* conf-parse: add a generic config_parse_mtu() conf file parser functionLennart Poettering2018-04-261-0/+1
| | | | | | | It's mostly a wrapper around parse_mtu() but with some nicer logging. The address family is initialized from the "ltype" parameter, so that configuration file parser tables can be easily declare it.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* systemd-link: Remove UDP Fragmentation Offload support. (#8183)Rosen Penev2018-03-181-0/+7
| | | | | | | | Support was killed in kernel 4.15 as well as ethtool 4.13. Justification was lack of use by drivers and too much of a maintenance burden. https://www.spinics.net/lists/netdev/msg443815.html Also moved config_parse_warn_compat to conf-parser.[ch] to fix compile errors.
* Move config_parse_join_controllers to shared, add testZbigniew Jędrzejewski-Szmek2018-02-191-0/+1
| | | | | | config_parse_join_controllers would free the destination argument on failure, which is contrary to our normal style, where failed parsing has no effect. Moving it to shared also allows a test to be added.
* shared/conf-parser: define a macro for the repeating argument setZbigniew Jędrzejewski-Szmek2018-02-191-47/+38
| | | | | | The arguments have to be indentical everywhere, so let's use a macro to make things more readable. But only in the headers, in the .c files let's keep them verbose so that it's easy to see the argument list.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* conf-parser: turn three bool function params into a flags fieldsLennart Poettering2017-11-131-7/+11
| | | | | This makes things more readable and fixes some issues with incorrect flag propagation between the various flavours of config_parse().
* config parser: Introduce config_parse_ip_portSusant Sahani2017-04-291-0/+1
|
* config parser: Introduce config_parse_uint8Susant Sahani2017-04-251-0/+1
|
* shared/conf-parser: add config_parse_many which takes strv with dirsZbigniew Jędrzejewski-Szmek2016-09-161-0/+10
| | | | This way we don't have to create a nulstr just to unpack it in a moment.
* tree-wide: rename config_parse_many to …_nulstrZbigniew Jędrzejewski-Szmek2016-09-161-18/+20
| | | | In preparation for adding a version which takes a strv.
* networkd: add options to bridge (#4051)Tobias Jungel2016-08-311-0/+1
| | | | This patch allows to configure AgeingTimeSec, Priority and DefaultPVID for bridge interfaces.
* tree-wide: port more code to use ifname_valid()Lennart Poettering2016-05-091-0/+1
|
* tree-wide: minor formatting inconsistency cleanupsVito Caputo2016-02-231-1/+1
|
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.